@gitkraken/core-gitlens 0.39.0 → 0.41.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +29 -1
- package/dist/git/models/pullRequest.d.ts +55 -1
- package/dist/git/models/pullRequest.js +5 -1
- package/dist/git/models/pullRequest.js.map +1 -1
- package/dist/git/models/pullRequestActivity.d.ts +55 -0
- package/dist/git/models/pullRequestActivity.js +0 -0
- package/dist/git/utils/pullRequest.utils.js +3 -1
- package/dist/git/utils/pullRequest.utils.js.map +1 -1
- package/dist/git/watching/worktreeSummary.d.ts +1 -0
- package/dist/git/watching/worktreeSummary.js +34 -2
- package/dist/git/watching/worktreeSummary.js.map +1 -1
- package/dist/plus/git-github/api/aliasedQuery.d.ts +19 -0
- package/dist/plus/git-github/api/aliasedQuery.js +21 -0
- package/dist/plus/git-github/api/aliasedQuery.js.map +1 -0
- package/dist/plus/git-github/api/cancellation.d.ts +4 -0
- package/dist/plus/git-github/api/cancellation.js +9 -0
- package/dist/plus/git-github/api/cancellation.js.map +1 -0
- package/dist/plus/git-github/api/checkRunLogs.d.ts +31 -0
- package/dist/plus/git-github/api/checkRunLogs.js +252 -0
- package/dist/plus/git-github/api/checkRunLogs.js.map +1 -0
- package/dist/plus/git-github/api/checkRuns.d.ts +26 -0
- package/dist/plus/git-github/api/checkRuns.js +191 -0
- package/dist/plus/git-github/api/checkRuns.js.map +1 -0
- package/dist/plus/git-github/api/github.d.ts +25 -2
- package/dist/plus/git-github/api/github.js +169 -37
- package/dist/plus/git-github/api/github.js.map +1 -1
- package/dist/plus/git-github/api/issueWrites.d.ts +51 -0
- package/dist/plus/git-github/api/issueWrites.js +192 -0
- package/dist/plus/git-github/api/issueWrites.js.map +1 -0
- package/dist/plus/git-github/api/pullRequestActivity.d.ts +19 -0
- package/dist/plus/git-github/api/pullRequestActivity.js +355 -0
- package/dist/plus/git-github/api/pullRequestActivity.js.map +1 -0
- package/dist/plus/git-github/models.d.ts +100 -4
- package/dist/plus/git-github/models.js +135 -3
- package/dist/plus/git-github/models.js.map +1 -1
- package/dist/plus/integrations/authentication/rejectedTokenTracker.d.ts +7 -8
- package/dist/plus/integrations/authentication/rejectedTokenTracker.js +7 -8
- package/dist/plus/integrations/authentication/rejectedTokenTracker.js.map +1 -1
- package/dist/plus/integrations/fieldPresence.d.ts +10 -5
- package/dist/plus/integrations/fieldPresence.js +46 -25
- package/dist/plus/integrations/fieldPresence.js.map +1 -1
- package/dist/plus/integrations/index.d.ts +6 -2
- package/dist/plus/integrations/index.js.map +1 -1
- package/dist/plus/integrations/integrationService.d.ts +31 -1
- package/dist/plus/integrations/integrationService.js +45 -0
- package/dist/plus/integrations/integrationService.js.map +1 -1
- package/dist/plus/integrations/manager.d.ts +86 -0
- package/dist/plus/integrations/models/gitHostIntegration.d.ts +31 -1
- package/dist/plus/integrations/models/gitHostIntegration.js +68 -0
- package/dist/plus/integrations/models/gitHostIntegration.js.map +1 -1
- package/dist/plus/integrations/models/integration.d.ts +26 -5
- package/dist/plus/integrations/models/integration.js +35 -10
- package/dist/plus/integrations/models/integration.js.map +1 -1
- package/dist/plus/integrations/providers/asana.d.ts +4 -5
- package/dist/plus/integrations/providers/asana.js +53 -12
- package/dist/plus/integrations/providers/asana.js.map +1 -1
- package/dist/plus/integrations/providers/github.d.ts +18 -3
- package/dist/plus/integrations/providers/github.js +90 -5
- package/dist/plus/integrations/providers/github.js.map +1 -1
- package/dist/plus/integrations/providers/linear.js +6 -6
- package/dist/plus/integrations/providers/linear.js.map +1 -1
- package/dist/plus/integrations/providers/models.d.ts +6 -15
- package/dist/plus/integrations/providers/models.js +1 -1
- package/dist/plus/integrations/providers/models.js.map +1 -1
- package/dist/plus/integrations/providers/providersApi.d.ts +1 -6
- package/dist/plus/integrations/providers/providersApi.js.map +1 -1
- package/dist/plus/integrations/reads/etag.js +20 -5
- package/dist/plus/integrations/reads/etag.js.map +1 -1
- package/dist/plus/integrations/reads/pullRequestActivity.d.ts +36 -0
- package/dist/plus/integrations/reads/pullRequestActivity.js +103 -0
- package/dist/plus/integrations/reads/pullRequestActivity.js.map +1 -0
- package/dist/plus/integrations/reads/pullRequestBatch.d.ts +4 -1
- package/dist/plus/integrations/reads/pullRequestBatch.js +5 -2
- package/dist/plus/integrations/reads/pullRequestBatch.js.map +1 -1
- package/dist/plus/integrations/reads/pullRequestBranches.d.ts +2 -0
- package/dist/plus/integrations/reads/pullRequestBranches.js +2 -1
- package/dist/plus/integrations/reads/pullRequestBranches.js.map +1 -1
- package/dist/plus/integrations/reads/pullRequestCheckLogs.d.ts +27 -0
- package/dist/plus/integrations/reads/pullRequestCheckLogs.js +92 -0
- package/dist/plus/integrations/reads/pullRequestCheckLogs.js.map +1 -0
- package/docs/integrations.md +115 -5
- package/package.json +2 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pullRequestActivity.js","names":[],"sources":["../../../../../plus/git-github/src/api/pullRequestActivity.ts"],"sourcesContent":["import type {\n\tPullRequestActivityAuthor,\n\tPullRequestActivityItem,\n\tPullRequestActivityPage,\n} from '@gitlens/git/models/pullRequestActivity.js';\nimport { base64, fromBase64ToString } from '@gitlens/utils/base64.js';\nimport { isCancellationError } from '@gitlens/utils/cancellation.js';\nimport type { ScopedLogger } from '@gitlens/utils/logger.scoped.js';\nimport type { AliasedGraphql, GraphqlAliasError } from './aliasedQuery.js';\nimport { getAliasErrorVerdict } from './aliasedQuery.js';\n\nexport interface GitHubPullRequestActivityCursor {\n\treadonly t: string;\n\treadonly ids: readonly string[];\n}\n\nexport interface GitHubPullRequestActivityTarget {\n\treadonly owner: string;\n\treadonly repo: string;\n\treadonly number: number;\n\treadonly cursor?: GitHubPullRequestActivityCursor;\n}\n\ntype ActivityActorNode = { __typename?: string; login?: string | null; url?: string | null } | null;\n\ntype ActivityCommentFields = {\n\tid: string;\n\turl: string;\n\tbody?: string | null;\n\tpublishedAt?: string | null;\n\tcreatedAt: string;\n\tviewerDidAuthor?: boolean | null;\n\tisMinimized?: boolean | null;\n\tauthor?: ActivityActorNode;\n};\n\ntype ActivityReviewCommentNode = ActivityCommentFields & {\n\tpath: string;\n\tline?: number | null;\n\tstartLine?: number | null;\n\toriginalLine?: number | null;\n\toutdated?: boolean | null;\n\treplyTo?: { id: string } | null;\n\tcommit?: { oid: string } | null;\n};\n\ntype ActivityTimelineNode =\n\t| (ActivityCommentFields & { __typename: 'IssueComment' })\n\t| (ActivityCommentFields & {\n\t\t\t__typename: 'PullRequestReview';\n\t\t\tstate: string;\n\t\t\tsubmittedAt?: string | null;\n\t\t\tcommit?: { oid: string } | null;\n\t\t\tcomments?: { totalCount: number; nodes?: (ActivityReviewCommentNode | null)[] | null } | null;\n\t })\n\t| { __typename: string; id?: string };\n\ntype ActivityNode = Extract<ActivityTimelineNode, { __typename: 'IssueComment' | 'PullRequestReview' }>;\n\ntype ActivityTimelineItems = {\n\tpageInfo: ActivityPageInfo;\n\tnodes?: (ActivityTimelineNode | null)[] | null;\n};\n\ntype ActivityPageInfo = { hasNextPage: boolean; endCursor?: string | null };\n\ntype PullRequestActivityResponse = Record<\n\tstring,\n\t{ pullRequest?: { createdAt: string; timelineItems: ActivityTimelineItems } | null } | null | undefined\n>;\n\ntype ActivityQueryTarget = GitHubPullRequestActivityTarget & { readonly after?: string };\n\ntype TimelineEntry = { node: ActivityNode; publishedAt: Date; second: number; createdSecond: number };\n\ntype Timeline = { createdAt: string; entries: readonly TimelineEntry[]; pageInfo: ActivityPageInfo };\n\ntype StaleTimeline = {\n\tindex: number;\n\ttarget: GitHubPullRequestActivityTarget & { readonly cursor: GitHubPullRequestActivityCursor };\n\ttimeline: Timeline;\n};\n\nconst maxPageSize = 100;\nconst maxFollowPages = 4;\nconst reviewCommentsPageSize = 20;\n\nconst activityItemTypes = 'PULL_REQUEST_REVIEW, ISSUE_COMMENT';\nconst actorFields = 'author { __typename login url }';\nconst reviewCommentFields = `id url body path line startLine originalLine outdated publishedAt createdAt viewerDidAuthor isMinimized replyTo { id } commit { oid } ${actorFields}`;\nconst timelineNodeFields = `pageInfo { hasNextPage endCursor }\n\t\t\t\t\t\tnodes { __typename\n\t\t\t\t\t\t\t... on IssueComment { id url body publishedAt createdAt viewerDidAuthor isMinimized ${actorFields} }\n\t\t\t\t\t\t\t... on PullRequestReview { id url body state publishedAt submittedAt createdAt viewerDidAuthor isMinimized commit { oid }\n\t\t\t\t\t\t\t\t${actorFields}\n\t\t\t\t\t\t\t\tcomments(first: ${reviewCommentsPageSize}) { totalCount nodes { ${reviewCommentFields} } } }\n\t\t\t\t\t\t}`;\n\nexport async function readGitHubPullRequestActivity(\n\tgraphql: AliasedGraphql,\n\ttargets: readonly GitHubPullRequestActivityTarget[],\n\tlimit: number,\n\tscope: ScopedLogger | undefined,\n): Promise<PromiseSettledResult<PullRequestActivityPage | undefined>[]> {\n\tlet timelines: PromiseSettledResult<Timeline | undefined>[];\n\ttry {\n\t\ttimelines = await readTimelines(graphql, targets, limit, scope);\n\t} catch (ex) {\n\t\tif (isCancellationError(ex)) throw ex;\n\n\t\tscope?.warn(`failed to read pull request activity; ex=${ex}`);\n\t\treturn targets.map((): PromiseRejectedResult => ({ status: 'rejected', reason: ex }));\n\t}\n\n\treturn targets.map((target, i): PromiseSettledResult<PullRequestActivityPage | undefined> => {\n\t\tconst slot = timelines[i];\n\t\tif (slot.status === 'rejected') return slot;\n\t\tif (slot.value == null) return { status: 'fulfilled', value: undefined };\n\n\t\ttry {\n\t\t\treturn { status: 'fulfilled', value: toActivityPage(slot.value, target.cursor, limit) };\n\t\t} catch (ex) {\n\t\t\tscope?.warn(`failed to map pull request activity; ${describeTarget(target)}, ex=${ex}`);\n\t\t\treturn { status: 'rejected', reason: ex };\n\t\t}\n\t});\n}\n\nasync function readTimelines(\n\tgraphql: AliasedGraphql,\n\ttargets: readonly GitHubPullRequestActivityTarget[],\n\tlimit: number,\n\tscope: ScopedLogger | undefined,\n): Promise<PromiseSettledResult<Timeline | undefined>[]> {\n\tconst { data, errors } = await queryActivity(graphql, targets, limit);\n\tconst timelines = targets.map((target, i): PromiseSettledResult<Timeline | undefined> => {\n\t\tconst alias = `p${i}`;\n\t\tconst node = data[alias]?.pullRequest;\n\t\tconst verdict = getAliasErrorVerdict(errors, alias, node);\n\t\tif (verdict != null && verdict !== 'absent') return verdict;\n\t\tif (node == null) return { status: 'fulfilled', value: undefined };\n\n\t\ttry {\n\t\t\treturn {\n\t\t\t\tstatus: 'fulfilled',\n\t\t\t\tvalue: {\n\t\t\t\t\tcreatedAt: node.createdAt,\n\t\t\t\t\tentries: toTimelineEntries(node.timelineItems),\n\t\t\t\t\tpageInfo: node.timelineItems.pageInfo,\n\t\t\t\t},\n\t\t\t};\n\t\t} catch (ex) {\n\t\t\tscope?.warn(`failed to map pull request activity; ${describeTarget(target)}, ex=${ex}`);\n\t\t\treturn { status: 'rejected', reason: ex };\n\t\t}\n\t});\n\n\tconst stale = targets.flatMap((target, i): StaleTimeline[] => {\n\t\tconst slot = timelines[i];\n\t\tconst cursor = target.cursor;\n\t\treturn cursor != null && slot.status === 'fulfilled' && slot.value != null\n\t\t\t? [{ index: i, target: { ...target, cursor: cursor }, timeline: slot.value }]\n\t\t\t: [];\n\t});\n\tconst followed = await readPastStalePages(graphql, stale, limit, scope);\n\tstale.forEach((s, i) => {\n\t\ttimelines[s.index] = { status: 'fulfilled', value: followed[i] };\n\t});\n\treturn timelines;\n}\n\nasync function queryActivity(\n\tgraphql: AliasedGraphql,\n\ttargets: readonly ActivityQueryTarget[],\n\tlimit: number,\n): Promise<{ readonly data: PullRequestActivityResponse; readonly errors: readonly GraphqlAliasError[] }> {\n\tconst variables: Record<string, unknown> = {};\n\ttargets.forEach((target, i) => {\n\t\tvariables[`o${i}`] = target.owner;\n\t\tvariables[`n${i}`] = target.repo;\n\t\tvariables[`k${i}`] = target.number;\n\t\tif (target.cursor != null) {\n\t\t\tvariables[`s${i}`] = activitySince(target.cursor);\n\t\t\tif (target.after != null) {\n\t\t\t\tvariables[`a${i}`] = target.after;\n\t\t\t}\n\t\t}\n\t});\n\n\tconst rsp = await graphql<PullRequestActivityResponse>(activityQuery(targets, limit), variables);\n\tif (rsp?.data == null) throw new Error('GitHub returned no data for the pull request activity');\n\n\treturn rsp;\n}\n\nasync function readPastStalePages(\n\tgraphql: AliasedGraphql,\n\tstale: readonly StaleTimeline[],\n\tlimit: number,\n\tscope: ScopedLogger | undefined,\n): Promise<Timeline[]> {\n\tconst timelines = stale.map(s => s.timeline);\n\tlet due = stale.flatMap((s, index) => followFrom(index, s.timeline, s.target.cursor));\n\tfor (let round = 0; round < maxFollowPages && due.length !== 0; round++) {\n\t\tlet answer: { readonly data: PullRequestActivityResponse; readonly errors: readonly GraphqlAliasError[] };\n\t\ttry {\n\t\t\tanswer = await queryActivity(\n\t\t\t\tgraphql,\n\t\t\t\tdue.map(d => ({ ...stale[d.index].target, after: d.after })),\n\t\t\t\tlimit,\n\t\t\t);\n\t\t} catch (ex) {\n\t\t\tif (isCancellationError(ex)) throw ex;\n\n\t\t\tscope?.warn(`failed to read past pull request activity pages; ex=${ex}`);\n\t\t\tbreak;\n\t\t}\n\n\t\tconst { data, errors } = answer;\n\t\tdue = due.flatMap(({ index }, i) => {\n\t\t\tconst alias = `p${i}`;\n\t\t\tconst next = data[alias]?.pullRequest?.timelineItems;\n\t\t\tif (next == null || errors.some(e => e.path?.[0] === alias)) {\n\t\t\t\tscope?.warn(`failed to read past a pull request activity page; ${describeTarget(stale[index].target)}`);\n\t\t\t\treturn [];\n\t\t\t}\n\n\t\t\tconst timeline: Timeline = {\n\t\t\t\tcreatedAt: timelines[index].createdAt,\n\t\t\t\tentries: [...timelines[index].entries, ...toTimelineEntries(next)],\n\t\t\t\tpageInfo: next.pageInfo,\n\t\t\t};\n\t\t\ttimelines[index] = timeline;\n\t\t\treturn followFrom(index, timeline, stale[index].target.cursor);\n\t\t});\n\t}\n\treturn timelines;\n}\n\nfunction followFrom(\n\tindex: number,\n\ttimeline: Timeline,\n\tcursor: GitHubPullRequestActivityCursor,\n): { index: number; after: string }[] {\n\tconst { hasNextPage, endCursor } = timeline.pageInfo;\n\tif (!hasNextPage || endCursor == null) return [];\n\n\tconst since = toEpochSecond(cursor.t);\n\tconst seen = new Set(cursor.ids);\n\treturn timeline.entries.some(i => i.second >= since && !seen.has(i.node.id))\n\t\t? []\n\t\t: [{ index: index, after: endCursor }];\n}\n\nfunction activityQuery(targets: readonly ActivityQueryTarget[], limit: number): string {\n\tconst params: string[] = [];\n\tconst fields: string[] = [];\n\ttargets.forEach((target, i) => {\n\t\tparams.push(`$o${i}: String!`, `$n${i}: String!`, `$k${i}: Int!`);\n\t\tif (target.cursor != null) {\n\t\t\tparams.push(`$s${i}: DateTime!`);\n\t\t}\n\n\t\tconst after = target.cursor != null && target.after != null;\n\t\tif (after) {\n\t\t\tparams.push(`$a${i}: String!`);\n\t\t}\n\n\t\tconst timeline =\n\t\t\ttarget.cursor != null\n\t\t\t\t? `timelineItems(first: ${activityPageSize(limit, target.cursor)}, since: $s${i}, ${after ? `after: $a${i}, ` : ''}itemTypes: [${activityItemTypes}])`\n\t\t\t\t: `timelineItems(last: ${limit}, itemTypes: [${activityItemTypes}])`;\n\t\tfields.push(`p${i}: repository(owner: $o${i}, name: $n${i}) {\n\t\t\t\tpullRequest(number: $k${i}) {\n\t\t\t\t\tcreatedAt\n\t\t\t\t\t${timeline} {\n\t\t\t\t\t\t${timelineNodeFields}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}`);\n\t});\n\treturn `query getPullRequestActivity(\n\t\t\t${params.join('\\n\\t\\t\\t')}\n\t\t) {\n\t\t\t${fields.join('\\n\\t\\t\\t')}\n\t\t}`;\n}\n\nfunction activityPageSize(limit: number, cursor: GitHubPullRequestActivityCursor): number {\n\treturn Math.min(maxPageSize, limit + cursor.ids.length);\n}\n\nfunction activitySince(cursor: GitHubPullRequestActivityCursor): string {\n\treturn new Date(toEpochSecond(cursor.t) * 1000 - 1000).toISOString();\n}\n\nfunction describeTarget(target: GitHubPullRequestActivityTarget): string {\n\treturn `${target.owner}/${target.repo}#${target.number}`;\n}\n\nexport function encodePullRequestActivityCursor(cursor: GitHubPullRequestActivityCursor): string {\n\treturn base64(JSON.stringify({ v: 1, t: cursor.t, ids: cursor.ids }))\n\t\t.replace(/\\+/g, '-')\n\t\t.replace(/\\//g, '_')\n\t\t.replace(/=+$/, '');\n}\n\nexport function decodePullRequestActivityCursor(cursor: string): GitHubPullRequestActivityCursor | undefined {\n\tif (!/^[A-Za-z0-9_-]+$/.test(cursor)) return undefined;\n\n\tlet parsed: unknown;\n\ttry {\n\t\tconst padded = cursor\n\t\t\t.replace(/-/g, '+')\n\t\t\t.replace(/_/g, '/')\n\t\t\t.padEnd(Math.ceil(cursor.length / 4) * 4, '=');\n\t\tparsed = JSON.parse(fromBase64ToString(padded));\n\t} catch {\n\t\treturn undefined;\n\t}\n\tif (parsed == null || typeof parsed !== 'object') return undefined;\n\n\tconst { v, t, ids } = parsed as { v?: unknown; t?: unknown; ids?: unknown };\n\tif (v !== 1 || typeof t !== 'string' || Number.isNaN(Date.parse(t))) return undefined;\n\tif (!Array.isArray(ids) || !ids.every((id): id is string => typeof id === 'string')) return undefined;\n\n\treturn { t: t, ids: ids };\n}\n\nfunction toTimelineEntries(items: ActivityTimelineItems): TimelineEntry[] {\n\tconst entries: TimelineEntry[] = [];\n\tfor (const item of items.nodes ?? []) {\n\t\tif (item?.id == null || !isActivityNode(item)) continue;\n\t\tif (item.__typename === 'PullRequestReview' && item.state === 'PENDING') continue;\n\n\t\tconst publishedAt = new Date(activityTime(item));\n\t\tentries.push({\n\t\t\tnode: item,\n\t\t\tpublishedAt: publishedAt,\n\t\t\tsecond: toEpochSecond(publishedAt),\n\t\t\tcreatedSecond: toEpochSecond(item.createdAt),\n\t\t});\n\t}\n\treturn entries;\n}\n\nfunction toActivityPage(\n\ttimeline: Timeline,\n\tcursor: GitHubPullRequestActivityCursor | undefined,\n\tlimit: number,\n): PullRequestActivityPage {\n\tconst returned = timeline.entries;\n\n\tif (cursor == null) {\n\t\treturn {\n\t\t\titems: returned.flatMap(i => toActivityItems(i.node, i.publishedAt)),\n\t\t\tcursor: encodePullRequestActivityCursor(baselineCursor(returned, timeline.createdAt)),\n\t\t\thasMore: false,\n\t\t};\n\t}\n\n\tconst since = toEpochSecond(cursor.t);\n\tconst seen = new Set(cursor.ids);\n\tconst inWindow = returned.filter(i => i.second >= since);\n\tconst fresh = inWindow.filter(i => !seen.has(i.node.id));\n\tconst kept = fresh.slice(0, limit);\n\tconst lastKept = kept.at(-1);\n\tconst cut = fresh.length > kept.length || timeline.pageInfo.hasNextPage;\n\treturn {\n\t\titems: kept.flatMap(i => toActivityItems(i.node, i.publishedAt)),\n\t\tcursor: encodePullRequestActivityCursor(\n\t\t\tlastKept != null\n\t\t\t\t? resumeCursor(cursor, returned, inWindow, kept, lastKept, fresh.slice(limit), cut)\n\t\t\t\t: cursor,\n\t\t),\n\t\thasMore: cut,\n\t};\n}\n\nfunction activityTime(node: ActivityNode): string {\n\treturn node.__typename === 'PullRequestReview'\n\t\t? (node.submittedAt ?? node.publishedAt ?? node.createdAt)\n\t\t: (node.publishedAt ?? node.createdAt);\n}\n\nfunction baselineCursor(timeline: readonly TimelineEntry[], createdAt: string): GitHubPullRequestActivityCursor {\n\tif (timeline.length === 0) return { t: toIsoSecond(toEpochSecond(createdAt)), ids: [] };\n\n\tconst t = Math.max(...timeline.map(i => i.second));\n\treturn { t: toIsoSecond(t), ids: timeline.filter(i => i.second === t).map(i => i.node.id) };\n}\n\nfunction resumeCursor(\n\tcursor: GitHubPullRequestActivityCursor,\n\treturned: readonly TimelineEntry[],\n\tinWindow: readonly TimelineEntry[],\n\tkept: readonly TimelineEntry[],\n\tlastKept: TimelineEntry,\n\ttrimmed: readonly TimelineEntry[],\n\tcut: boolean,\n): GitHubPullRequestActivityCursor {\n\tlet t: number;\n\tif (cut) {\n\t\tt = Math.max(\n\t\t\ttoEpochSecond(cursor.t),\n\t\t\tMath.min(lastKept.second, lastKept.createdSecond, ...trimmed.map(i => i.second)),\n\t\t);\n\t} else {\n\t\tt = Math.max(...kept.map(i => i.second));\n\t}\n\n\tconst delivered = new Set([...cursor.ids, ...kept.map(i => i.node.id)]);\n\tconst ids = inWindow.filter(i => i.second >= t && delivered.has(i.node.id)).map(i => i.node.id);\n\tif (cut) {\n\t\tconst present = new Set(returned.map(i => i.node.id));\n\t\tids.push(...cursor.ids.filter(id => !present.has(id)));\n\t}\n\treturn { t: toIsoSecond(t), ids: [...new Set(ids)] };\n}\n\nfunction isActivityNode(node: ActivityTimelineNode): node is ActivityNode {\n\treturn node.__typename === 'IssueComment' || node.__typename === 'PullRequestReview';\n}\n\nfunction toActivityItems(node: ActivityNode, publishedAt: Date): PullRequestActivityItem[] {\n\tconst base = {\n\t\tid: node.id,\n\t\turl: node.url,\n\t\t...authorOf(node.author),\n\t\tpublishedAt: publishedAt,\n\t\tbyViewer: node.viewerDidAuthor === true,\n\t\tisMinimized: node.isMinimized === true,\n\t};\n\tif (node.__typename === 'IssueComment') return [{ kind: 'comment', ...base, body: node.body ?? '' }];\n\n\tconst comments = (node.comments?.nodes ?? []).filter((c): c is ActivityReviewCommentNode => c != null);\n\tconst items: PullRequestActivityItem[] = [\n\t\t{\n\t\t\tkind: 'review',\n\t\t\t...base,\n\t\t\tstate: fromGitHubReviewState(node.state),\n\t\t\tbody: node.body ?? '',\n\t\t\t...(node.commit?.oid != null ? { commitSha: node.commit.oid } : {}),\n\t\t\t...((node.comments?.totalCount ?? 0) > comments.length ? { commentsTruncated: true as const } : {}),\n\t\t},\n\t];\n\n\tconst ordered = comments\n\t\t.map(c => ({ comment: c, createdAt: Date.parse(c.createdAt) }))\n\t\t.sort((a, b) => a.createdAt - b.createdAt);\n\tfor (const { comment } of ordered) {\n\t\titems.push({\n\t\t\tkind: 'review-comment',\n\t\t\tid: comment.id,\n\t\t\turl: comment.url,\n\t\t\t...authorOf(comment.author),\n\t\t\tpublishedAt: publishedAt,\n\t\t\tbyViewer: comment.viewerDidAuthor === true,\n\t\t\tisMinimized: comment.isMinimized === true,\n\t\t\treviewId: node.id,\n\t\t\tbody: comment.body ?? '',\n\t\t\tpath: comment.path,\n\t\t\t...(comment.line != null ? { line: comment.line } : {}),\n\t\t\t...(comment.startLine != null ? { startLine: comment.startLine } : {}),\n\t\t\t...(comment.originalLine != null ? { originalLine: comment.originalLine } : {}),\n\t\t\toutdated: comment.outdated === true,\n\t\t\t...(comment.replyTo?.id != null ? { inReplyTo: comment.replyTo.id } : {}),\n\t\t\t...(comment.commit?.oid != null ? { commitSha: comment.commit.oid } : {}),\n\t\t});\n\t}\n\treturn items;\n}\n\nfunction authorOf(actor: ActivityActorNode | undefined): { author?: PullRequestActivityAuthor } {\n\tif (actor?.login == null) return {};\n\n\treturn {\n\t\tauthor: {\n\t\t\tlogin: actor.login,\n\t\t\t...(actor.url != null ? { url: actor.url } : {}),\n\t\t\tisBot: actor.__typename === 'Bot',\n\t\t},\n\t};\n}\n\nfunction fromGitHubReviewState(state: string): 'approved' | 'changes-requested' | 'commented' | 'dismissed' {\n\tswitch (state) {\n\t\tcase 'APPROVED':\n\t\t\treturn 'approved';\n\t\tcase 'CHANGES_REQUESTED':\n\t\t\treturn 'changes-requested';\n\t\tcase 'DISMISSED':\n\t\t\treturn 'dismissed';\n\t\tdefault:\n\t\t\treturn 'commented';\n\t}\n}\n\nfunction toIsoSecond(second: number): string {\n\treturn new Date(second * 1000).toISOString();\n}\n\nfunction toEpochSecond(time: string | Date): number {\n\treturn Math.floor((typeof time === 'string' ? Date.parse(time) : time.getTime()) / 1000);\n}\n"],"mappings":";;;;AAmFA,MAAM,cAAc;AACpB,MAAM,iBAAiB;AACvB,MAAM,yBAAyB;AAE/B,MAAM,oBAAoB;AAC1B,MAAM,cAAc;AAEpB,MAAM,qBAAqB;;6FAEkE,YAAY;;UAE/F,YAAY;0BACI,uBAAuB,yBAAyB,yIAN2F,cAMvE;;AAG9F,eAAsB,8BACrB,SACA,SACA,OAC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YAAY,QAAwB;CAC5C,wBAAO,IAAI,KAAK,SAAS,GAAI,EAAA,CAAE,YAAY;AAC5C;AAEA,SAAS,cAAc,MAA6B;CACnD,OAAO,KAAK,OAAO,OAAO,SAAS,WAAW,KAAK,MAAM,IAAI,IAAI,KAAK,QAAQ,KAAK,GAAI;AACxF"}
|
|
@@ -2,7 +2,7 @@ import { GitFileIndexStatus } from "../../git/models/fileStatus.js";
|
|
|
2
2
|
import { Provider } from "../../git/models/remoteProvider.js";
|
|
3
3
|
import { IssueOrPullRequestState } from "../../git/models/issueOrPullRequest.js";
|
|
4
4
|
import { Issue, IssueLabel, IssueProjection } from "../../git/models/issue.js";
|
|
5
|
-
import { PullRequest, PullRequestMergeQueueEntry, PullRequestMergeQueueRemoval, PullRequestMergeQueueState, PullRequestMergeableState, PullRequestProjection, PullRequestReviewDecision, PullRequestReviewState, PullRequestStatusCheckRollupState } from "../../git/models/pullRequest.js";
|
|
5
|
+
import { PullRequest, PullRequestCheckRun, PullRequestCheckRunConclusion, PullRequestCheckRunStatus, PullRequestMergeQueueEntry, PullRequestMergeQueueRemoval, PullRequestMergeQueueState, PullRequestMergeableState, PullRequestProjection, PullRequestReviewDecision, PullRequestReviewState, PullRequestStatusCheckRollupState } from "../../git/models/pullRequest.js";
|
|
6
6
|
import { Endpoints } from "@octokit/types";
|
|
7
7
|
//#region ../plus/git-github/src/models.d.ts
|
|
8
8
|
export interface GitHubBlame {
|
|
@@ -262,8 +262,10 @@ export interface GitHubPullRequest extends GitHubPullRequestLite {
|
|
|
262
262
|
totalCount: number;
|
|
263
263
|
nodes: {
|
|
264
264
|
commit: {
|
|
265
|
+
id?: string;
|
|
265
266
|
statusCheckRollup: {
|
|
266
267
|
state: 'SUCCESS' | 'FAILURE' | 'PENDING' | 'EXPECTED' | 'ERROR';
|
|
268
|
+
contexts?: GitHubCheckContexts;
|
|
267
269
|
} | null;
|
|
268
270
|
};
|
|
269
271
|
}[];
|
|
@@ -286,16 +288,19 @@ export interface GitHubPullRequestEtagNode extends Pick<GitHubPullRequest, 'id'
|
|
|
286
288
|
mergeable?: GitHubPullRequestMergeableState | null;
|
|
287
289
|
/** Only with `reviewDecision`. `null` on a repository that requires no review. */
|
|
288
290
|
reviewDecision?: GitHubPullRequestReviewDecision | null;
|
|
289
|
-
/** Only with `checks`. */
|
|
290
291
|
commits?: {
|
|
291
292
|
nodes: {
|
|
292
293
|
commit: {
|
|
294
|
+
id?: string;
|
|
293
295
|
statusCheckRollup: {
|
|
294
|
-
state
|
|
296
|
+
state?: GitHubPullRequestStatusCheckRollupState;
|
|
297
|
+
contexts?: GitHubCheckContexts<GitHubCheckContextEtagNode>;
|
|
295
298
|
} | null;
|
|
296
299
|
};
|
|
297
300
|
}[];
|
|
298
301
|
};
|
|
302
|
+
/** Every page of the head's checks, set by `GitHubApi.getPullRequestsEtagFieldsBatch` when it reads them. */
|
|
303
|
+
checkRuns?: GitHubCheckContextsRead<GitHubCheckContextEtagNode>;
|
|
299
304
|
/** Selected when the read selects merge-queue data, like the full read's. `null` when the pull request isn't queued. */
|
|
300
305
|
mergeQueueEntry?: Pick<GitHubMergeQueueEntry, 'state' | 'enqueuedAt'> | null;
|
|
301
306
|
/** Selected when the read selects merge-queue data, exactly as the full read selects it. */
|
|
@@ -306,6 +311,62 @@ export interface GitHubPullRequestEtagNode extends Pick<GitHubPullRequest, 'id'
|
|
|
306
311
|
*/
|
|
307
312
|
isMergeQueueEnabled?: boolean;
|
|
308
313
|
}
|
|
314
|
+
export type GitHubCheckStatusState = 'REQUESTED' | 'QUEUED' | 'IN_PROGRESS' | 'COMPLETED' | 'WAITING' | 'PENDING';
|
|
315
|
+
export type GitHubCheckConclusionState = 'ACTION_REQUIRED' | 'TIMED_OUT' | 'CANCELLED' | 'FAILURE' | 'SUCCESS' | 'NEUTRAL' | 'SKIPPED' | 'STARTUP_FAILURE' | 'STALE';
|
|
316
|
+
export type GitHubStatusState = 'EXPECTED' | 'ERROR' | 'FAILURE' | 'PENDING' | 'SUCCESS';
|
|
317
|
+
export interface GitHubCheckRunContext {
|
|
318
|
+
__typename: 'CheckRun';
|
|
319
|
+
id: string;
|
|
320
|
+
databaseId: number | null;
|
|
321
|
+
name: string;
|
|
322
|
+
status: GitHubCheckStatusState;
|
|
323
|
+
conclusion: GitHubCheckConclusionState | null;
|
|
324
|
+
detailsUrl: string | null;
|
|
325
|
+
url: string | null;
|
|
326
|
+
title: string | null;
|
|
327
|
+
startedAt: string | null;
|
|
328
|
+
completedAt: string | null;
|
|
329
|
+
isRequired?: boolean;
|
|
330
|
+
checkSuite: {
|
|
331
|
+
app: {
|
|
332
|
+
slug: string;
|
|
333
|
+
} | null;
|
|
334
|
+
workflowRun: {
|
|
335
|
+
workflow: {
|
|
336
|
+
name: string;
|
|
337
|
+
} | null;
|
|
338
|
+
} | null;
|
|
339
|
+
} | null;
|
|
340
|
+
}
|
|
341
|
+
export interface GitHubStatusContext {
|
|
342
|
+
__typename: 'StatusContext';
|
|
343
|
+
id: string;
|
|
344
|
+
context: string;
|
|
345
|
+
state: GitHubStatusState;
|
|
346
|
+
targetUrl: string | null;
|
|
347
|
+
createdAt: string;
|
|
348
|
+
isRequired?: boolean;
|
|
349
|
+
}
|
|
350
|
+
export type GitHubCheckContext = GitHubCheckRunContext | GitHubStatusContext;
|
|
351
|
+
export interface GitHubCheckContexts<N extends GitHubCheckContextEtagNode = GitHubCheckContext> {
|
|
352
|
+
pageInfo: {
|
|
353
|
+
hasNextPage: boolean;
|
|
354
|
+
endCursor: string | null;
|
|
355
|
+
};
|
|
356
|
+
nodes: (N | null)[] | null;
|
|
357
|
+
}
|
|
358
|
+
/** A head's checks, read across every page. `truncated` means the head has checks `contexts` lacks. */
|
|
359
|
+
export interface GitHubCheckContextsRead<N extends GitHubCheckContextEtagNode = GitHubCheckContext> {
|
|
360
|
+
readonly contexts: readonly (N | null)[];
|
|
361
|
+
readonly truncated: boolean;
|
|
362
|
+
}
|
|
363
|
+
export type GitHubCheckContextEtagNode = (Pick<GitHubCheckRunContext, '__typename' | 'id' | 'databaseId' | 'name' | 'status' | 'conclusion'> & {
|
|
364
|
+
checkSuite: {
|
|
365
|
+
app: {
|
|
366
|
+
slug: string;
|
|
367
|
+
} | null;
|
|
368
|
+
} | null;
|
|
369
|
+
}) | Pick<GitHubStatusContext, '__typename' | 'id' | 'context' | 'state'>;
|
|
309
370
|
/**
|
|
310
371
|
* An input beyond an issue's lifecycle fields that `GitHubApi.getIssuesEtagFieldsBatch` can select. Mirrors the
|
|
311
372
|
* integrations package's `IssueEtagInclude`, which this package cannot import.
|
|
@@ -347,7 +408,42 @@ export declare function toGitHubPullRequestReviewDecision(reviewDecision: PullRe
|
|
|
347
408
|
export declare function fromGitHubPullRequestMergeableState(mergeableState: GitHubPullRequestMergeableState): PullRequestMergeableState;
|
|
348
409
|
export declare function toGitHubPullRequestMergeableState(mergeableState: PullRequestMergeableState): GitHubPullRequestMergeableState;
|
|
349
410
|
export declare function fromGitHubPullRequestStatusCheckRollupState(state: GitHubPullRequestStatusCheckRollupState | null | undefined): PullRequestStatusCheckRollupState | undefined;
|
|
350
|
-
export declare function fromGitHubPullRequest(pr: GitHubPullRequest, provider: Provider, projection?: PullRequestProjection): PullRequest;
|
|
411
|
+
export declare function fromGitHubPullRequest(pr: GitHubPullRequest, provider: Provider, projection?: PullRequestProjection, checkRuns?: GitHubCheckContextsRead): PullRequest;
|
|
412
|
+
/** What a check run's opaque {@link PullRequestCheckRun.id} names. */
|
|
413
|
+
export type GitHubCheckRunRef =
|
|
414
|
+
/** A GitHub Actions job, by its job id (the check run's `databaseId`). */
|
|
415
|
+
{
|
|
416
|
+
readonly kind: 'actions-job';
|
|
417
|
+
readonly jobId: number;
|
|
418
|
+
} |
|
|
419
|
+
/** Any other check run, by its node id. */
|
|
420
|
+
{
|
|
421
|
+
readonly kind: 'check-run';
|
|
422
|
+
readonly nodeId: string;
|
|
423
|
+
} |
|
|
424
|
+
/** A commit status, by its node id. */
|
|
425
|
+
{
|
|
426
|
+
readonly kind: 'status';
|
|
427
|
+
readonly nodeId: string;
|
|
428
|
+
};
|
|
429
|
+
export declare function encodeGitHubCheckRunId(ref: GitHubCheckRunRef): string;
|
|
430
|
+
/** `undefined` for an id {@link encodeGitHubCheckRunId} didn't make. */
|
|
431
|
+
export declare function decodeGitHubCheckRunId(id: string): GitHubCheckRunRef | undefined;
|
|
432
|
+
/** An unknown status reads as `pending`, so a state GitHub adds later never fails the row. */
|
|
433
|
+
export declare function fromGitHubCheckStatusState(status: GitHubCheckStatusState): PullRequestCheckRunStatus;
|
|
434
|
+
/** An unknown conclusion reads as none, so a value GitHub adds later never fails the row. */
|
|
435
|
+
export declare function fromGitHubCheckConclusionState(conclusion: GitHubCheckConclusionState | null | undefined): PullRequestCheckRunConclusion | undefined;
|
|
436
|
+
export declare function fromGitHubStatusState(state: GitHubStatusState): {
|
|
437
|
+
status: PullRequestCheckRunStatus;
|
|
438
|
+
conclusion?: PullRequestCheckRunConclusion;
|
|
439
|
+
};
|
|
440
|
+
/**
|
|
441
|
+
* A check context's kind, name and normalized state: what both a full row's {@link PullRequestCheckRun} and the etag's
|
|
442
|
+
* cheap check read, so the two agree. `undefined` for a context type this doesn't know.
|
|
443
|
+
*/
|
|
444
|
+
export declare function fromGitHubCheckContextState(context: GitHubCheckContextEtagNode | null): Pick<PullRequestCheckRun, 'kind' | 'name' | 'status' | 'conclusion'> | undefined;
|
|
445
|
+
export declare function toGitHubCheckRunId(context: GitHubCheckContextEtagNode): string;
|
|
446
|
+
export declare function fromGitHubCheckContext(context: GitHubCheckContext | null): PullRequestCheckRun | undefined;
|
|
351
447
|
export declare function fromGitHubIssue(value: GitHubIssue, provider: Provider, projection?: IssueProjection): Issue;
|
|
352
448
|
//#endregion
|
|
353
449
|
//# sourceMappingURL=models.d.ts.map
|
|
@@ -181,7 +181,7 @@ function fromGitHubPullRequestStatusCheckRollupState(state) {
|
|
|
181
181
|
default: return;
|
|
182
182
|
}
|
|
183
183
|
}
|
|
184
|
-
function fromGitHubPullRequest(pr, provider, projection) {
|
|
184
|
+
function fromGitHubPullRequest(pr, provider, projection, checkRuns) {
|
|
185
185
|
const viewerLatestReview = pr.viewerLatestReview;
|
|
186
186
|
const latestReviews = [...pr.latestReviews.nodes, ...viewerLatestReview != null && !pr.latestReviews.nodes.some((r) => r.id === viewerLatestReview.id) ? [viewerLatestReview] : []].filter((review) => review.state !== "PENDING");
|
|
187
187
|
return new PullRequest(provider, fromGitHubMemberOrGhost(pr.author), String(pr.number), pr.id, pr.title, pr.permalink, {
|
|
@@ -232,7 +232,139 @@ function fromGitHubPullRequest(pr, provider, projection) {
|
|
|
232
232
|
username: r.login,
|
|
233
233
|
avatarUrl: r.avatarUrl,
|
|
234
234
|
url: r.url
|
|
235
|
-
})), fromGitHubPullRequestStatusCheckRollupState(pr.commits.nodes?.[0]?.commit.statusCheckRollup?.state), void 0, void 0, pr.commits.totalCount, fromGitHubPullRequestStack(pr), pr.changedFiles, pr.body ?? void 0, pr.number, void 0, projection, void 0, void 0, fromGitHubMilestone(pr.milestone), fromGitHubPullRequestMergeQueueEntry(pr), pr.isMergeQueueEnabled, fromGitHubMergeQueueRemoval(pr.mergeQueueEvents));
|
|
235
|
+
})), fromGitHubPullRequestStatusCheckRollupState(pr.commits.nodes?.[0]?.commit.statusCheckRollup?.state), void 0, void 0, pr.commits.totalCount, fromGitHubPullRequestStack(pr), pr.changedFiles, pr.body ?? void 0, pr.number, void 0, projection, void 0, void 0, fromGitHubMilestone(pr.milestone), fromGitHubPullRequestMergeQueueEntry(pr), pr.isMergeQueueEnabled, fromGitHubMergeQueueRemoval(pr.mergeQueueEvents), checkRuns?.contexts.map(fromGitHubCheckContext).filter((run) => run != null), checkRuns?.truncated ? true : void 0);
|
|
236
|
+
}
|
|
237
|
+
function encodeGitHubCheckRunId(ref) {
|
|
238
|
+
switch (ref.kind) {
|
|
239
|
+
case "actions-job": return `a:${ref.jobId}`;
|
|
240
|
+
case "check-run": return `c:${ref.nodeId}`;
|
|
241
|
+
case "status": return `s:${ref.nodeId}`;
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
/** `undefined` for an id {@link encodeGitHubCheckRunId} didn't make. */
|
|
245
|
+
function decodeGitHubCheckRunId(id) {
|
|
246
|
+
const value = id.slice(2);
|
|
247
|
+
if (value.length === 0) return void 0;
|
|
248
|
+
switch (id.slice(0, 2)) {
|
|
249
|
+
case "a:": {
|
|
250
|
+
const jobId = Number(value);
|
|
251
|
+
return /^\d+$/.test(value) && Number.isSafeInteger(jobId) ? {
|
|
252
|
+
kind: "actions-job",
|
|
253
|
+
jobId
|
|
254
|
+
} : void 0;
|
|
255
|
+
}
|
|
256
|
+
case "c:": return {
|
|
257
|
+
kind: "check-run",
|
|
258
|
+
nodeId: value
|
|
259
|
+
};
|
|
260
|
+
case "s:": return {
|
|
261
|
+
kind: "status",
|
|
262
|
+
nodeId: value
|
|
263
|
+
};
|
|
264
|
+
default: return;
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
/** An unknown status reads as `pending`, so a state GitHub adds later never fails the row. */
|
|
268
|
+
function fromGitHubCheckStatusState(status) {
|
|
269
|
+
switch (status) {
|
|
270
|
+
case "REQUESTED": return "requested";
|
|
271
|
+
case "QUEUED": return "queued";
|
|
272
|
+
case "IN_PROGRESS": return "in-progress";
|
|
273
|
+
case "COMPLETED": return "completed";
|
|
274
|
+
case "WAITING": return "waiting";
|
|
275
|
+
default: return "pending";
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
/** An unknown conclusion reads as none, so a value GitHub adds later never fails the row. */
|
|
279
|
+
function fromGitHubCheckConclusionState(conclusion) {
|
|
280
|
+
switch (conclusion) {
|
|
281
|
+
case "ACTION_REQUIRED": return "action-required";
|
|
282
|
+
case "TIMED_OUT": return "timed-out";
|
|
283
|
+
case "CANCELLED": return "cancelled";
|
|
284
|
+
case "FAILURE": return "failure";
|
|
285
|
+
case "SUCCESS": return "success";
|
|
286
|
+
case "NEUTRAL": return "neutral";
|
|
287
|
+
case "SKIPPED": return "skipped";
|
|
288
|
+
case "STARTUP_FAILURE": return "startup-failure";
|
|
289
|
+
case "STALE": return "stale";
|
|
290
|
+
default: return;
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
function fromGitHubStatusState(state) {
|
|
294
|
+
switch (state) {
|
|
295
|
+
case "SUCCESS": return {
|
|
296
|
+
status: "completed",
|
|
297
|
+
conclusion: "success"
|
|
298
|
+
};
|
|
299
|
+
case "FAILURE": return {
|
|
300
|
+
status: "completed",
|
|
301
|
+
conclusion: "failure"
|
|
302
|
+
};
|
|
303
|
+
case "ERROR": return {
|
|
304
|
+
status: "completed",
|
|
305
|
+
conclusion: "error"
|
|
306
|
+
};
|
|
307
|
+
default: return { status: "pending" };
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
/**
|
|
311
|
+
* A check context's kind, name and normalized state: what both a full row's {@link PullRequestCheckRun} and the etag's
|
|
312
|
+
* cheap check read, so the two agree. `undefined` for a context type this doesn't know.
|
|
313
|
+
*/
|
|
314
|
+
function fromGitHubCheckContextState(context) {
|
|
315
|
+
switch (context?.__typename) {
|
|
316
|
+
case "CheckRun": return {
|
|
317
|
+
kind: "check-run",
|
|
318
|
+
name: context.name,
|
|
319
|
+
status: fromGitHubCheckStatusState(context.status),
|
|
320
|
+
conclusion: fromGitHubCheckConclusionState(context.conclusion)
|
|
321
|
+
};
|
|
322
|
+
case "StatusContext": return {
|
|
323
|
+
kind: "status",
|
|
324
|
+
name: context.context,
|
|
325
|
+
...fromGitHubStatusState(context.state)
|
|
326
|
+
};
|
|
327
|
+
default: return;
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
function gitHubActionsJobId(context) {
|
|
331
|
+
return context.checkSuite?.app?.slug === "github-actions" ? context.databaseId : null;
|
|
332
|
+
}
|
|
333
|
+
function toGitHubCheckRunId(context) {
|
|
334
|
+
if (context.__typename === "StatusContext") return encodeGitHubCheckRunId({
|
|
335
|
+
kind: "status",
|
|
336
|
+
nodeId: context.id
|
|
337
|
+
});
|
|
338
|
+
const jobId = gitHubActionsJobId(context);
|
|
339
|
+
return encodeGitHubCheckRunId(jobId != null ? {
|
|
340
|
+
kind: "actions-job",
|
|
341
|
+
jobId
|
|
342
|
+
} : {
|
|
343
|
+
kind: "check-run",
|
|
344
|
+
nodeId: context.id
|
|
345
|
+
});
|
|
346
|
+
}
|
|
347
|
+
function fromGitHubCheckContext(context) {
|
|
348
|
+
const state = fromGitHubCheckContextState(context);
|
|
349
|
+
if (state == null || context == null) return void 0;
|
|
350
|
+
if (context.__typename === "StatusContext") return {
|
|
351
|
+
...state,
|
|
352
|
+
id: toGitHubCheckRunId(context),
|
|
353
|
+
url: context.targetUrl ?? void 0,
|
|
354
|
+
required: context.isRequired,
|
|
355
|
+
startedAt: new Date(context.createdAt),
|
|
356
|
+
hasLog: false
|
|
357
|
+
};
|
|
358
|
+
return {
|
|
359
|
+
...state,
|
|
360
|
+
id: toGitHubCheckRunId(context),
|
|
361
|
+
workflowName: context.checkSuite?.workflowRun?.workflow?.name ?? void 0,
|
|
362
|
+
url: context.detailsUrl ?? context.url ?? void 0,
|
|
363
|
+
required: context.isRequired,
|
|
364
|
+
startedAt: context.startedAt != null ? new Date(context.startedAt) : void 0,
|
|
365
|
+
completedAt: context.completedAt != null ? new Date(context.completedAt) : void 0,
|
|
366
|
+
hasLog: gitHubActionsJobId(context) != null || context.title != null
|
|
367
|
+
};
|
|
236
368
|
}
|
|
237
369
|
function fromGitHubIssue(value, provider, projection) {
|
|
238
370
|
return new Issue({
|
|
@@ -273,6 +405,6 @@ function fromGitHubViewerPermissionToAccessLevel(permission) {
|
|
|
273
405
|
}
|
|
274
406
|
}
|
|
275
407
|
//#endregion
|
|
276
|
-
export { fromCommitFileStatus, fromGitHubIssue, fromGitHubIssueOrPullRequestState, fromGitHubMergeQueueEntry, fromGitHubMergeQueueEntryState, fromGitHubMergeQueueRemoval, fromGitHubPullRequest, fromGitHubPullRequestLite, fromGitHubPullRequestMergeableState, fromGitHubPullRequestReviewDecision, fromGitHubPullRequestReviewState, fromGitHubPullRequestStatusCheckRollupState, toGitHubPullRequestMergeableState, toGitHubPullRequestReviewDecision, toGitHubPullRequestState };
|
|
408
|
+
export { decodeGitHubCheckRunId, encodeGitHubCheckRunId, fromCommitFileStatus, fromGitHubCheckConclusionState, fromGitHubCheckContext, fromGitHubCheckContextState, fromGitHubCheckStatusState, fromGitHubIssue, fromGitHubIssueOrPullRequestState, fromGitHubMergeQueueEntry, fromGitHubMergeQueueEntryState, fromGitHubMergeQueueRemoval, fromGitHubPullRequest, fromGitHubPullRequestLite, fromGitHubPullRequestMergeableState, fromGitHubPullRequestReviewDecision, fromGitHubPullRequestReviewState, fromGitHubPullRequestStatusCheckRollupState, fromGitHubStatusState, toGitHubCheckRunId, toGitHubPullRequestMergeableState, toGitHubPullRequestReviewDecision, toGitHubPullRequestState };
|
|
277
409
|
|
|
278
410
|
//# sourceMappingURL=models.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"models.js","names":[],"sources":["../../../../plus/git-github/src/models.ts"],"sourcesContent":["import type { Endpoints } from '@octokit/types';\nimport { GitFileIndexStatus } from '@gitlens/git/models/fileStatus.js';\nimport type { IssueLabel, IssueProjection } from '@gitlens/git/models/issue.js';\nimport { Issue, RepositoryAccessLevel } from '@gitlens/git/models/issue.js';\nimport type { IssueMilestone } from '@gitlens/git/models/issueOrPullRequest.js';\nimport type {\n\tPullRequestMember,\n\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\tstatusCheckRollup: {\n\t\t\t\t\tstate: 'SUCCESS' | 'FAILURE' | 'PENDING' | 'EXPECTED' | 'ERROR';\n\t\t\t\t} | null;\n\t\t\t};\n\t\t}[];\n\t};\n\ttotalCommentsCount: number;\n\tviewerCanUpdate: boolean;\n}\n\n/**\n * An input beyond a pull request's lifecycle fields that `GitHubApi.getPullRequestsEtagFieldsBatch` can select.\n * Mirrors the integrations package's `PullRequestEtagInclude`, which this package cannot import.\n */\nexport type GitHubPullRequestEtagInclude = 'mergeable' | 'reviewDecision' | 'checks';\n\n/**\n * The change state `GitHubApi.getPullRequestsEtagFieldsBatch` selects: a pull request's lifecycle fields, plus,\n * for each requested {@link GitHubPullRequestEtagInclude}, what its etag reads. Each selection is the full\n * fragment's own, so a value here is the one a full read would have mapped.\n */\nexport interface GitHubPullRequestEtagNode extends Pick<\n\tGitHubPullRequest,\n\t'id' | 'number' | 'state' | 'isDraft' | 'updatedAt' | 'headRefOid'\n> {\n\t/** Only with `mergeable`. */\n\tmergeable?: GitHubPullRequestMergeableState | null;\n\t/** Only with `reviewDecision`. `null` on a repository that requires no review. */\n\treviewDecision?: GitHubPullRequestReviewDecision | null;\n\t/** Only with `checks`. */\n\tcommits?: {\n\t\tnodes: { commit: { statusCheckRollup: { state: GitHubPullRequestStatusCheckRollupState } | null } }[];\n\t};\n\t/** 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\n/**\n * An input beyond an issue's lifecycle fields that `GitHubApi.getIssuesEtagFieldsBatch` can select. Mirrors the\n * integrations package's `IssueEtagInclude`, which this package cannot import.\n */\nexport type GitHubIssueEtagInclude = 'reactions';\n\n/**\n * The change state `GitHubApi.getIssuesEtagFieldsBatch` selects, plus, for each requested\n * {@link GitHubIssueEtagInclude}, the full fragment's own selection of it.\n */\nexport interface GitHubIssueEtagNode extends Pick<GitHubIssue, 'id' | 'number' | 'state' | 'updatedAt'> {\n\t/** Only with `reactions`: the thumbs-up reactions, as the full fragment selects them. */\n\treactions?: { totalCount: number };\n}\n\nexport type GitHubViewerPermission =\n\t| 'ADMIN' // Can read, clone, and push to this repository. Can also manage issues, pull requests, and repository settings, including adding collaborators\n\t| 'MAINTAIN' // Can read, clone, and push to this repository. They can also manage issues, pull requests, and some repository settings\n\t| 'WRITE' // Can read, clone, and push to this repository. Can also manage issues and pull requests\n\t| 'TRIAGE' // Can read and clone this repository. Can also manage issues and pull requests\n\t| 'READ' // Can read and clone this repository. Can also open and comment on issues and pull requests\n\t| 'NONE';\n\n/** `ghost` is how github.com renders an actor whose account was deleted, under the handle `ghost` */\nfunction fromGitHubMemberOrGhost(member: GitHubMember | null | undefined): PullRequestMember {\n\tif (member == null) return { id: 'ghost', name: 'ghost', username: 'ghost' };\n\n\treturn {\n\t\tid: member.login,\n\t\tname: member.login,\n\t\tusername: member.login,\n\t\tavatarUrl: member.avatarUrl,\n\t\turl: member.url,\n\t};\n}\n\nexport function fromGitHubPullRequestLite(\n\tpr: GitHubPullRequestLite,\n\tprovider: Provider,\n\tprojection?: PullRequestProjection,\n): PullRequest {\n\treturn new PullRequest(\n\t\tprovider,\n\t\tfromGitHubMemberOrGhost(pr.author),\n\t\tString(pr.number),\n\t\tpr.id,\n\t\tpr.title,\n\t\tpr.permalink,\n\t\t{\n\t\t\towner: pr.repository.owner.login,\n\t\t\trepo: pr.repository.name,\n\t\t\taccessLevel: fromGitHubViewerPermissionToAccessLevel(pr.repository.viewerPermission),\n\t\t},\n\t\tfromGitHubIssueOrPullRequestState(pr.state),\n\t\tnew Date(pr.createdAt),\n\t\tnew Date(pr.updatedAt),\n\t\tpr.closedAt == null ? undefined : new Date(pr.closedAt),\n\t\tpr.mergedAt == null ? undefined : new Date(pr.mergedAt),\n\t\tundefined,\n\t\tundefined,\n\t\t{\n\t\t\thead: {\n\t\t\t\texists: pr.headRepository != null,\n\t\t\t\towner: pr.headRepository?.owner.login,\n\t\t\t\trepo: pr.headRepository?.name,\n\t\t\t\tsha: pr.headRefOid,\n\t\t\t\tbranch: pr.headRefName,\n\t\t\t\turl: pr.headRepository?.url,\n\t\t\t\tcloneHttps: pr.headRepository != null ? `${pr.headRepository.url}.git` : undefined,\n\t\t\t\tcloneSsh: pr.headRepository?.sshUrl,\n\t\t\t\tisFork: pr.headRepository?.isFork,\n\t\t\t},\n\t\t\tbase: {\n\t\t\t\texists: pr.repository != null,\n\t\t\t\towner: pr.repository?.owner.login,\n\t\t\t\trepo: pr.repository?.name,\n\t\t\t\tsha: pr.baseRefOid,\n\t\t\t\tbranch: pr.baseRefName,\n\t\t\t\turl: pr.repository?.url,\n\t\t\t\tcloneHttps: pr.repository != null ? `${pr.repository.url}.git` : undefined,\n\t\t\t\tcloneSsh: pr.repository?.sshUrl,\n\t\t\t\tisFork: pr.repository?.isFork,\n\t\t\t},\n\t\t\tisCrossRepository: pr.isCrossRepository,\n\t\t},\n\t\tpr.isDraft,\n\t\t// The lite fragment selects nothing between `isDraft` and `stack`.\n\t\tundefined, // additions\n\t\tundefined, // deletions\n\t\tundefined, // commentsCount\n\t\tundefined, // thumbsUpCount\n\t\tundefined, // reviewDecision\n\t\tundefined, // reviewRequests\n\t\tundefined, // latestReviews\n\t\tundefined, // assignees\n\t\tundefined, // statusCheckRollupState\n\t\tundefined, // project\n\t\tundefined, // version\n\t\tundefined, // commitCount\n\t\tfromGitHubPullRequestStack(pr),\n\t\tundefined, // filesChanged\n\t\tpr.body ?? undefined,\n\t\tpr.number,\n\t\tundefined, // authoredByMe\n\t\tprojection,\n\t\tundefined, // viewer\n\t\tundefined, // viewerUnresolved\n\t\tfromGitHubMilestone(pr.milestone),\n\t\tfromGitHubPullRequestMergeQueueEntry(pr),\n\t\tpr.isMergeQueueEnabled,\n\t\tfromGitHubMergeQueueRemoval(pr.mergeQueueEvents),\n\t);\n}\n\n/** `undefined` only for a node from a selection that left the milestone out, which no fragment does today. */\nfunction fromGitHubMilestone(milestone: GitHubMilestone | null | undefined): IssueMilestone | null | undefined {\n\tif (milestone == null) return milestone;\n\n\treturn {\n\t\tid: milestone.id,\n\t\ttitle: milestone.title,\n\t\tstate: milestone.state === 'CLOSED' ? 'closed' : 'open',\n\t\t...(milestone.dueOn != null ? { dueDate: new Date(milestone.dueOn) } : {}),\n\t\t...(milestone.url ? { url: milestone.url } : {}),\n\t};\n}\n\n/** Both fields are absent on GitHub Enterprise Server (never selected) and `null` when unstacked. */\nfunction fromGitHubPullRequestStack(pr: GitHubPullRequestLite): PullRequestStackInfo | undefined {\n\tif (pr.stack == null || pr.stackEntry == null) return undefined;\n\n\treturn {\n\t\tid: pr.stack.id,\n\t\tnumber: pr.stack.number,\n\t\tsize: pr.stack.size,\n\t\tposition: pr.stackEntry.position,\n\t\tbaseRef: pr.stack.baseRefName,\n\t};\n}\n\n/** Absent 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): PullRequest {\n\t// `latestReviews` is capped, so keep the viewer's own review even when it falls outside that window, deduped\n\t// by review id since the two selections overlap. Unsubmitted drafts are dropped from the union rather than\n\t// from the viewer's side alone: `PENDING` is in GitHub's review-state enum on both selections, and the field\n\t// this feeds is documented as reviews already SUBMITTED — a draft there tells a \"needs my review\" consumer\n\t// the review is done, and a reviewer with a submitted review plus a draft would get two conflicting rows.\n\tconst viewerLatestReview = pr.viewerLatestReview;\n\tconst latestReviews = [\n\t\t...pr.latestReviews.nodes,\n\t\t...(viewerLatestReview != null && !pr.latestReviews.nodes.some(r => r.id === viewerLatestReview.id)\n\t\t\t? [viewerLatestReview]\n\t\t\t: []),\n\t].filter(review => review.state !== 'PENDING');\n\n\treturn new PullRequest(\n\t\tprovider,\n\t\tfromGitHubMemberOrGhost(pr.author),\n\t\tString(pr.number),\n\t\tpr.id,\n\t\tpr.title,\n\t\tpr.permalink,\n\t\t{\n\t\t\towner: pr.repository.owner.login,\n\t\t\trepo: pr.repository.name,\n\t\t\taccessLevel: fromGitHubViewerPermissionToAccessLevel(pr.repository.viewerPermission),\n\t\t},\n\t\tfromGitHubIssueOrPullRequestState(pr.state),\n\t\tnew Date(pr.createdAt),\n\t\tnew Date(pr.updatedAt),\n\t\tpr.closedAt == null ? undefined : new Date(pr.closedAt),\n\t\tpr.mergedAt == null ? undefined : new Date(pr.mergedAt),\n\t\tfromGitHubPullRequestMergeableState(pr.mergeable),\n\t\tpr.viewerCanUpdate,\n\t\t{\n\t\t\thead: {\n\t\t\t\texists: pr.headRepository != null,\n\t\t\t\towner: pr.headRepository?.owner.login,\n\t\t\t\trepo: pr.headRepository?.name,\n\t\t\t\tsha: pr.headRefOid,\n\t\t\t\tbranch: pr.headRefName,\n\t\t\t\turl: pr.headRepository?.url,\n\t\t\t\tcloneHttps: pr.headRepository != null ? `${pr.headRepository.url}.git` : undefined,\n\t\t\t\tcloneSsh: pr.headRepository?.sshUrl,\n\t\t\t\tisFork: pr.headRepository?.isFork,\n\t\t\t},\n\t\t\tbase: {\n\t\t\t\texists: pr.repository != null,\n\t\t\t\towner: pr.repository?.owner.login,\n\t\t\t\trepo: pr.repository?.name,\n\t\t\t\tsha: pr.baseRefOid,\n\t\t\t\tbranch: pr.baseRefName,\n\t\t\t\turl: pr.repository?.url,\n\t\t\t\tcloneHttps: pr.repository != null ? `${pr.repository.url}.git` : undefined,\n\t\t\t\tcloneSsh: pr.repository?.sshUrl,\n\t\t\t\tisFork: pr.repository?.isFork,\n\t\t\t},\n\t\t\tisCrossRepository: pr.isCrossRepository,\n\t\t},\n\t\tpr.isDraft,\n\t\tpr.additions,\n\t\tpr.deletions,\n\t\tpr.totalCommentsCount,\n\t\tundefined, // thumbsUpCount: the fragment selects no reactions\n\t\tfromGitHubPullRequestReviewDecision(pr.reviewDecision),\n\t\tpr.reviewRequests.nodes\n\t\t\t.map(r =>\n\t\t\t\tr.requestedReviewer != null\n\t\t\t\t\t? {\n\t\t\t\t\t\t\tisCodeOwner: r.asCodeOwner,\n\t\t\t\t\t\t\treviewer: {\n\t\t\t\t\t\t\t\t// A team has no login: an empty id, which matches no one, rather than a missing one.\n\t\t\t\t\t\t\t\tid: r.requestedReviewer.login ?? '',\n\t\t\t\t\t\t\t\tname: r.requestedReviewer.login,\n\t\t\t\t\t\t\t\tusername: r.requestedReviewer.login,\n\t\t\t\t\t\t\t\tavatarUrl: r.requestedReviewer.avatarUrl,\n\t\t\t\t\t\t\t\turl: r.requestedReviewer.url,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tstate: PullRequestReviewState.ReviewRequested,\n\t\t\t\t\t\t}\n\t\t\t\t\t: undefined,\n\t\t\t)\n\t\t\t.filter(<T>(r?: T): r is T => Boolean(r)),\n\t\tlatestReviews.map(r => ({\n\t\t\treviewer: fromGitHubMemberOrGhost(r.author),\n\t\t\tstate: fromGitHubPullRequestReviewState(r.state),\n\t\t\tcommitOid: r.commit?.oid,\n\t\t})),\n\t\tpr.assignees.nodes.map(r => ({\n\t\t\tid: r.login,\n\t\t\tname: r.login,\n\t\t\tusername: r.login,\n\t\t\tavatarUrl: r.avatarUrl,\n\t\t\turl: r.url,\n\t\t})),\n\t\tfromGitHubPullRequestStatusCheckRollupState(pr.commits.nodes?.[0]?.commit.statusCheckRollup?.state),\n\t\tundefined, // project\n\t\tundefined, // version\n\t\tpr.commits.totalCount,\n\t\tfromGitHubPullRequestStack(pr),\n\t\tpr.changedFiles,\n\t\tpr.body ?? undefined,\n\t\tpr.number,\n\t\tundefined, // authoredByMe\n\t\tprojection,\n\t\tundefined, // viewer\n\t\tundefined, // viewerUnresolved\n\t\tfromGitHubMilestone(pr.milestone),\n\t\tfromGitHubPullRequestMergeQueueEntry(pr),\n\t\tpr.isMergeQueueEnabled,\n\t\tfromGitHubMergeQueueRemoval(pr.mergeQueueEvents),\n\t);\n}\n\nexport function fromGitHubIssue(value: GitHubIssue, provider: Provider, projection?: IssueProjection): Issue {\n\treturn new Issue(\n\t\t{\n\t\t\tid: provider.id,\n\t\t\tname: provider.name,\n\t\t\tdomain: provider.domain,\n\t\t\ticon: provider.icon,\n\t\t},\n\t\tString(value.number),\n\t\tvalue.id,\n\t\tvalue.title,\n\t\tvalue.url,\n\t\tnew Date(value.createdAt),\n\t\tnew Date(value.updatedAt),\n\t\tvalue.closed,\n\t\tfromGitHubIssueOrPullRequestState(value.state),\n\t\tvalue.author == null\n\t\t\t? undefined\n\t\t\t: {\n\t\t\t\t\tid: value.author.login,\n\t\t\t\t\tname: value.author.login,\n\t\t\t\t\tusername: value.author.login,\n\t\t\t\t\tavatarUrl: value.author.avatarUrl,\n\t\t\t\t\turl: value.author.url,\n\t\t\t\t},\n\t\tvalue.assignees.nodes.map(assignee => ({\n\t\t\tid: assignee.login,\n\t\t\tname: assignee.login,\n\t\t\tusername: assignee.login,\n\t\t\tavatarUrl: assignee.avatarUrl,\n\t\t\turl: assignee.url,\n\t\t})),\n\t\t{\n\t\t\towner: value.repository.owner.login,\n\t\t\trepo: value.repository.name,\n\t\t\taccessLevel: fromGitHubViewerPermissionToAccessLevel(value.repository.viewerPermission),\n\t\t\turl: value.repository.url,\n\t\t},\n\t\tvalue.closedAt == null ? undefined : new Date(value.closedAt),\n\t\tvalue.labels?.nodes == null\n\t\t\t? undefined\n\t\t\t: value.labels.nodes.map(label => ({\n\t\t\t\t\tcolor: label.color,\n\t\t\t\t\tname: label.name,\n\t\t\t\t})),\n\t\tvalue.comments?.totalCount,\n\t\tvalue.reactions?.totalCount,\n\t\tvalue.body,\n\t\tundefined, // project\n\t\tundefined, // number\n\t\tundefined, // issueType\n\t\tundefined, // providerState\n\t\tundefined, // bodyFormat\n\t\tundefined, // iterations\n\t\tprojection,\n\t\tundefined, // bodyField\n\t\tundefined, // viewer\n\t\tundefined, // viewerUnresolved\n\t\tundefined, // syncedWith\n\t\tfromGitHubMilestone(value.milestone),\n\t);\n}\n\nfunction fromGitHubViewerPermissionToAccessLevel(\n\tpermission: GitHubViewerPermission | null | undefined,\n): RepositoryAccessLevel {\n\tswitch (permission) {\n\t\tcase 'ADMIN':\n\t\t\treturn RepositoryAccessLevel.Admin;\n\t\tcase 'MAINTAIN':\n\t\t\treturn RepositoryAccessLevel.Maintain;\n\t\tcase 'WRITE':\n\t\t\treturn RepositoryAccessLevel.Write;\n\t\tcase 'TRIAGE':\n\t\t\treturn RepositoryAccessLevel.Triage;\n\t\tcase 'READ':\n\t\t\treturn RepositoryAccessLevel.Read;\n\t\tdefault:\n\t\t\treturn RepositoryAccessLevel.None;\n\t}\n}\n"],"mappings":";;;;AA0GA,SAAgB,qBAAqB,QAAgE;CACpG,QAAQ,QAAR;EACC,KAAK,SACJ,OAAO,mBAAmB;EAC3B,KAAK;EACL,KAAK,YACJ,OAAO,mBAAmB;EAC3B,KAAK,WACJ,OAAO,mBAAmB;EAC3B,KAAK,WACJ,OAAO,mBAAmB;EAC3B,KAAK,UACJ,OAAO,mBAAmB;CAC5B;AAED;;AA6PA,SAAS,wBAAwB,QAA4D;CAC5F,IAAI,UAAU,MAAM,OAAO;EAAE,IAAI;EAAS,MAAM;EAAS,UAAU;CAAQ;CAE3E,OAAO;EACN,IAAI,OAAO;EACX,MAAM,OAAO;EACb,U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AAK,QACJ,OAAA;EACD,SACC,OAAA;CACF;AACD"}
|
|
1
|
+
{"version":3,"file":"models.js","names":[],"sources":["../../../../plus/git-github/src/models.ts"],"sourcesContent":["import type { Endpoints } from '@octokit/types';\nimport { GitFileIndexStatus } from '@gitlens/git/models/fileStatus.js';\nimport type { IssueLabel, IssueProjection } from '@gitlens/git/models/issue.js';\nimport { Issue, RepositoryAccessLevel } from '@gitlens/git/models/issue.js';\nimport type { IssueMilestone } from '@gitlens/git/models/issueOrPullRequest.js';\nimport type {\n\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\treturn new PullRequest(\n\t\tprovider,\n\t\tfromGitHubMemberOrGhost(pr.author),\n\t\tString(pr.number),\n\t\tpr.id,\n\t\tpr.title,\n\t\tpr.permalink,\n\t\t{\n\t\t\towner: pr.repository.owner.login,\n\t\t\trepo: pr.repository.name,\n\t\t\taccessLevel: fromGitHubViewerPermissionToAccessLevel(pr.repository.viewerPermission),\n\t\t},\n\t\tfromGitHubIssueOrPullRequestState(pr.state),\n\t\tnew Date(pr.createdAt),\n\t\tnew Date(pr.updatedAt),\n\t\tpr.closedAt == null ? undefined : new Date(pr.closedAt),\n\t\tpr.mergedAt == null ? undefined : new Date(pr.mergedAt),\n\t\tundefined,\n\t\tundefined,\n\t\t{\n\t\t\thead: {\n\t\t\t\texists: pr.headRepository != null,\n\t\t\t\towner: pr.headRepository?.owner.login,\n\t\t\t\trepo: pr.headRepository?.name,\n\t\t\t\tsha: pr.headRefOid,\n\t\t\t\tbranch: pr.headRefName,\n\t\t\t\turl: pr.headRepository?.url,\n\t\t\t\tcloneHttps: pr.headRepository != null ? `${pr.headRepository.url}.git` : undefined,\n\t\t\t\tcloneSsh: pr.headRepository?.sshUrl,\n\t\t\t\tisFork: pr.headRepository?.isFork,\n\t\t\t},\n\t\t\tbase: {\n\t\t\t\texists: pr.repository != null,\n\t\t\t\towner: pr.repository?.owner.login,\n\t\t\t\trepo: pr.repository?.name,\n\t\t\t\tsha: pr.baseRefOid,\n\t\t\t\tbranch: pr.baseRefName,\n\t\t\t\turl: pr.repository?.url,\n\t\t\t\tcloneHttps: pr.repository != null ? `${pr.repository.url}.git` : undefined,\n\t\t\t\tcloneSsh: pr.repository?.sshUrl,\n\t\t\t\tisFork: pr.repository?.isFork,\n\t\t\t},\n\t\t\tisCrossRepository: pr.isCrossRepository,\n\t\t},\n\t\tpr.isDraft,\n\t\t// The lite fragment selects nothing between `isDraft` and `stack`.\n\t\tundefined, // additions\n\t\tundefined, // deletions\n\t\tundefined, // commentsCount\n\t\tundefined, // thumbsUpCount\n\t\tundefined, // reviewDecision\n\t\tundefined, // reviewRequests\n\t\tundefined, // latestReviews\n\t\tundefined, // assignees\n\t\tundefined, // statusCheckRollupState\n\t\tundefined, // project\n\t\tundefined, // version\n\t\tundefined, // commitCount\n\t\tfromGitHubPullRequestStack(pr),\n\t\tundefined, // filesChanged\n\t\tpr.body ?? undefined,\n\t\tpr.number,\n\t\tundefined, // authoredByMe\n\t\tprojection,\n\t\tundefined, // viewer\n\t\tundefined, // viewerUnresolved\n\t\tfromGitHubMilestone(pr.milestone),\n\t\tfromGitHubPullRequestMergeQueueEntry(pr),\n\t\tpr.isMergeQueueEnabled,\n\t\tfromGitHubMergeQueueRemoval(pr.mergeQueueEvents),\n\t);\n}\n\n/** `undefined` only for a node from a selection that left the milestone out, which no fragment does today. */\nfunction fromGitHubMilestone(milestone: GitHubMilestone | null | undefined): IssueMilestone | null | undefined {\n\tif (milestone == null) return milestone;\n\n\treturn {\n\t\tid: milestone.id,\n\t\ttitle: milestone.title,\n\t\tstate: milestone.state === 'CLOSED' ? 'closed' : 'open',\n\t\t...(milestone.dueOn != null ? { dueDate: new Date(milestone.dueOn) } : {}),\n\t\t...(milestone.url ? { url: milestone.url } : {}),\n\t};\n}\n\n/** Both fields are absent on GitHub Enterprise Server (never selected) and `null` when unstacked. */\nfunction fromGitHubPullRequestStack(pr: GitHubPullRequestLite): PullRequestStackInfo | undefined {\n\tif (pr.stack == null || pr.stackEntry == null) return undefined;\n\n\treturn {\n\t\tid: pr.stack.id,\n\t\tnumber: pr.stack.number,\n\t\tsize: pr.stack.size,\n\t\tposition: pr.stackEntry.position,\n\t\tbaseRef: pr.stack.baseRefName,\n\t};\n}\n\n/** Absent 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\treturn new PullRequest(\n\t\tprovider,\n\t\tfromGitHubMemberOrGhost(pr.author),\n\t\tString(pr.number),\n\t\tpr.id,\n\t\tpr.title,\n\t\tpr.permalink,\n\t\t{\n\t\t\towner: pr.repository.owner.login,\n\t\t\trepo: pr.repository.name,\n\t\t\taccessLevel: fromGitHubViewerPermissionToAccessLevel(pr.repository.viewerPermission),\n\t\t},\n\t\tfromGitHubIssueOrPullRequestState(pr.state),\n\t\tnew Date(pr.createdAt),\n\t\tnew Date(pr.updatedAt),\n\t\tpr.closedAt == null ? undefined : new Date(pr.closedAt),\n\t\tpr.mergedAt == null ? undefined : new Date(pr.mergedAt),\n\t\tfromGitHubPullRequestMergeableState(pr.mergeable),\n\t\tpr.viewerCanUpdate,\n\t\t{\n\t\t\thead: {\n\t\t\t\texists: pr.headRepository != null,\n\t\t\t\towner: pr.headRepository?.owner.login,\n\t\t\t\trepo: pr.headRepository?.name,\n\t\t\t\tsha: pr.headRefOid,\n\t\t\t\tbranch: pr.headRefName,\n\t\t\t\turl: pr.headRepository?.url,\n\t\t\t\tcloneHttps: pr.headRepository != null ? `${pr.headRepository.url}.git` : undefined,\n\t\t\t\tcloneSsh: pr.headRepository?.sshUrl,\n\t\t\t\tisFork: pr.headRepository?.isFork,\n\t\t\t},\n\t\t\tbase: {\n\t\t\t\texists: pr.repository != null,\n\t\t\t\towner: pr.repository?.owner.login,\n\t\t\t\trepo: pr.repository?.name,\n\t\t\t\tsha: pr.baseRefOid,\n\t\t\t\tbranch: pr.baseRefName,\n\t\t\t\turl: pr.repository?.url,\n\t\t\t\tcloneHttps: pr.repository != null ? `${pr.repository.url}.git` : undefined,\n\t\t\t\tcloneSsh: pr.repository?.sshUrl,\n\t\t\t\tisFork: pr.repository?.isFork,\n\t\t\t},\n\t\t\tisCrossRepository: pr.isCrossRepository,\n\t\t},\n\t\tpr.isDraft,\n\t\tpr.additions,\n\t\tpr.deletions,\n\t\tpr.totalCommentsCount,\n\t\tundefined, // thumbsUpCount: the fragment selects no reactions\n\t\tfromGitHubPullRequestReviewDecision(pr.reviewDecision),\n\t\tpr.reviewRequests.nodes\n\t\t\t.map(r =>\n\t\t\t\tr.requestedReviewer != null\n\t\t\t\t\t? {\n\t\t\t\t\t\t\tisCodeOwner: r.asCodeOwner,\n\t\t\t\t\t\t\treviewer: {\n\t\t\t\t\t\t\t\t// A team has no login: an empty id, which matches no one, rather than a missing one.\n\t\t\t\t\t\t\t\tid: r.requestedReviewer.login ?? '',\n\t\t\t\t\t\t\t\tname: r.requestedReviewer.login,\n\t\t\t\t\t\t\t\tusername: r.requestedReviewer.login,\n\t\t\t\t\t\t\t\tavatarUrl: r.requestedReviewer.avatarUrl,\n\t\t\t\t\t\t\t\turl: r.requestedReviewer.url,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tstate: PullRequestReviewState.ReviewRequested,\n\t\t\t\t\t\t}\n\t\t\t\t\t: undefined,\n\t\t\t)\n\t\t\t.filter(<T>(r?: T): r is T => Boolean(r)),\n\t\tlatestReviews.map(r => ({\n\t\t\treviewer: fromGitHubMemberOrGhost(r.author),\n\t\t\tstate: fromGitHubPullRequestReviewState(r.state),\n\t\t\tcommitOid: r.commit?.oid,\n\t\t})),\n\t\tpr.assignees.nodes.map(r => ({\n\t\t\tid: r.login,\n\t\t\tname: r.login,\n\t\t\tusername: r.login,\n\t\t\tavatarUrl: r.avatarUrl,\n\t\t\turl: r.url,\n\t\t})),\n\t\tfromGitHubPullRequestStatusCheckRollupState(pr.commits.nodes?.[0]?.commit.statusCheckRollup?.state),\n\t\tundefined, // project\n\t\tundefined, // version\n\t\tpr.commits.totalCount,\n\t\tfromGitHubPullRequestStack(pr),\n\t\tpr.changedFiles,\n\t\tpr.body ?? undefined,\n\t\tpr.number,\n\t\tundefined, // authoredByMe\n\t\tprojection,\n\t\tundefined, // viewer\n\t\tundefined, // viewerUnresolved\n\t\tfromGitHubMilestone(pr.milestone),\n\t\tfromGitHubPullRequestMergeQueueEntry(pr),\n\t\tpr.isMergeQueueEnabled,\n\t\tfromGitHubMergeQueueRemoval(pr.mergeQueueEvents),\n\t\tcheckRuns?.contexts.map(fromGitHubCheckContext).filter((run): run is PullRequestCheckRun => run != null),\n\t\tcheckRuns?.truncated ? true : undefined,\n\t);\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\treturn new Issue(\n\t\t{\n\t\t\tid: provider.id,\n\t\t\tname: provider.name,\n\t\t\tdomain: provider.domain,\n\t\t\ticon: provider.icon,\n\t\t},\n\t\tString(value.number),\n\t\tvalue.id,\n\t\tvalue.title,\n\t\tvalue.url,\n\t\tnew Date(value.createdAt),\n\t\tnew Date(value.updatedAt),\n\t\tvalue.closed,\n\t\tfromGitHubIssueOrPullRequestState(value.state),\n\t\tvalue.author == null\n\t\t\t? undefined\n\t\t\t: {\n\t\t\t\t\tid: value.author.login,\n\t\t\t\t\tname: value.author.login,\n\t\t\t\t\tusername: value.author.login,\n\t\t\t\t\tavatarUrl: value.author.avatarUrl,\n\t\t\t\t\turl: value.author.url,\n\t\t\t\t},\n\t\tvalue.assignees.nodes.map(assignee => ({\n\t\t\tid: assignee.login,\n\t\t\tname: assignee.login,\n\t\t\tusername: assignee.login,\n\t\t\tavatarUrl: assignee.avatarUrl,\n\t\t\turl: assignee.url,\n\t\t})),\n\t\t{\n\t\t\towner: value.repository.owner.login,\n\t\t\trepo: value.repository.name,\n\t\t\taccessLevel: fromGitHubViewerPermissionToAccessLevel(value.repository.viewerPermission),\n\t\t\turl: value.repository.url,\n\t\t},\n\t\tvalue.closedAt == null ? undefined : new Date(value.closedAt),\n\t\tvalue.labels?.nodes == null\n\t\t\t? undefined\n\t\t\t: value.labels.nodes.map(label => ({\n\t\t\t\t\tcolor: label.color,\n\t\t\t\t\tname: label.name,\n\t\t\t\t})),\n\t\tvalue.comments?.totalCount,\n\t\tvalue.reactions?.totalCount,\n\t\tvalue.body,\n\t\tundefined, // project\n\t\tundefined, // number\n\t\tundefined, // issueType\n\t\tundefined, // providerState\n\t\tundefined, // bodyFormat\n\t\tundefined, // iterations\n\t\tprojection,\n\t\tundefined, // bodyField\n\t\tundefined, // viewer\n\t\tundefined, // viewerUnresolved\n\t\tundefined, // syncedWith\n\t\tfromGitHubMilestone(value.milestone),\n\t);\n}\n\nfunction fromGitHubViewerPermissionToAccessLevel(\n\tpermission: GitHubViewerPermission | null | undefined,\n): RepositoryAccessLevel {\n\tswitch (permission) {\n\t\tcase 'ADMIN':\n\t\t\treturn RepositoryAccessLevel.Admin;\n\t\tcase 'MAINTAIN':\n\t\t\treturn RepositoryAccessLevel.Maintain;\n\t\tcase 'WRITE':\n\t\t\treturn RepositoryAccessLevel.Write;\n\t\tcase 'TRIAGE':\n\t\t\treturn RepositoryAccessLevel.Triage;\n\t\tcase 'READ':\n\t\t\treturn RepositoryAccessLevel.Read;\n\t\tdefault:\n\t\t\treturn RepositoryAccessLevel.None;\n\t}\n}\n"],"mappings":";;;;AA6GA,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;;AAqUA,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,OAAO,IAAI,YACV,UACA,wBAAwB,GAAG,MAAM,GACjC,OAAO,GAAG,MAAM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;AACD;AAEA,SAAS,wCACR,YACwB;CACxB,QAAQ,YAAR;EACC,KAAK,SACJ,OAAA;EACD,KAAK,YACJ,OAAA;EACD,KAAK,SACJ,OAAA;EACD,KAAK,UACJ,OAAA;EACD,KAAK,QACJ,OAAA;EACD,SACC,OAAA;CACF;AACD"}
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* Per-connection recovery state for a cloud token the provider REFUSED — a revoked grant, retired scopes, an
|
|
4
4
|
* app removed from the org. A purely predictive refresh (`expiresIn < 60`) cannot see that case, because the
|
|
5
|
-
* backend still believes the token is valid, so without this the refused token is re-sent on every
|
|
5
|
+
* backend still believes the token is valid, so without this the refused token is re-sent on every request and
|
|
6
6
|
* the failure only clears when the user reconnects by hand.
|
|
7
7
|
*
|
|
8
8
|
* One recovery refresh per connection, then the connection is the failure budget's problem:
|
|
9
|
-
* - {@link recordRejection}
|
|
9
|
+
* - {@link recordRejection} when the provider rejects the credential — arms the refresh, or reports that the rejection is
|
|
10
10
|
* not recoverable so the caller counts it as a real failure instead.
|
|
11
|
-
* - {@link claimRefresh}
|
|
12
|
-
* fires once and no further
|
|
11
|
+
* - {@link claimRefresh} when the next operation resolves its session — spends the rejection, so the refresh
|
|
12
|
+
* fires once and no further operation of that connection asks the cloud again.
|
|
13
13
|
*
|
|
14
14
|
* Deliberately NOT re-armed when the refresh hands back a different token. The GK cloud mints a new access
|
|
15
15
|
* token on every `/refresh`, so a credential the provider refuses for a reason a refresh cannot fix (retired
|
|
@@ -21,9 +21,8 @@
|
|
|
21
21
|
export declare class RejectedTokenTracker {
|
|
22
22
|
private readonly _rejections;
|
|
23
23
|
/**
|
|
24
|
-
* Whether
|
|
25
|
-
*
|
|
26
|
-
* that throws must not leave the refresh armed and ask the cloud again on the next read.
|
|
24
|
+
* Whether an operation on `connectionId` must force a cloud refresh of a token known to be refused. A session
|
|
25
|
+
* lookup that throws must still spend the rejection so a later operation does not ask the cloud again.
|
|
27
26
|
*/
|
|
28
27
|
claimRefresh(connectionId: string): boolean;
|
|
29
28
|
/**
|
|
@@ -35,7 +34,7 @@ export declare class RejectedTokenTracker {
|
|
|
35
34
|
recordRejection(connectionId: string): boolean;
|
|
36
35
|
/** Drops all state, for when the stored tokens a rejection could name are replaced or gone. */
|
|
37
36
|
clear(): void;
|
|
38
|
-
/** Whether any connection is holding a rejection. For assertions;
|
|
37
|
+
/** Whether any connection is holding a rejection. For assertions; session resolution uses {@link claimRefresh}. */
|
|
39
38
|
get empty(): boolean;
|
|
40
39
|
}
|
|
41
40
|
//#endregion
|