@gitkraken/core-gitlens 0.15.6 → 0.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/CHANGELOG.md +22 -1
  2. package/dist/git/cache.d.ts +13 -0
  3. package/dist/git/cache.js +43 -6
  4. package/dist/git/cache.js.map +1 -1
  5. package/dist/git/features.d.ts +1 -1
  6. package/dist/git/features.js +1 -0
  7. package/dist/git/features.js.map +1 -1
  8. package/dist/git/models/issue.d.ts +14 -1
  9. package/dist/git/models/issue.js +3 -1
  10. package/dist/git/models/issue.js.map +1 -1
  11. package/dist/git/providers/branches.d.ts +29 -0
  12. package/dist/git/service.d.ts +4 -2
  13. package/dist/git/service.js +6 -4
  14. package/dist/git/service.js.map +1 -1
  15. package/dist/git/utils/issue.utils.js +4 -0
  16. package/dist/git/utils/issue.utils.js.map +1 -1
  17. package/dist/git/watching/worktreeSummary.d.ts +19 -4
  18. package/dist/git/watching/worktreeSummary.js +121 -36
  19. package/dist/git/watching/worktreeSummary.js.map +1 -1
  20. package/dist/git-cli/cliGitProvider.js +1 -1
  21. package/dist/git-cli/providers/branches.d.ts +50 -0
  22. package/dist/git-cli/providers/branches.js +280 -21
  23. package/dist/git-cli/providers/branches.js.map +1 -1
  24. package/dist/git-cli/providers/config.js +3 -2
  25. package/dist/git-cli/providers/config.js.map +1 -1
  26. package/dist/git-cli/providers/revision.js +1 -1
  27. package/dist/git-cli/providers/stash.js +1 -1
  28. package/dist/git-cli/providers/worktrees.js +23 -6
  29. package/dist/git-cli/providers/worktrees.js.map +1 -1
  30. package/dist/git-cli/service.d.ts +3 -0
  31. package/dist/git-cli/service.js +1 -0
  32. package/dist/git-cli/service.js.map +1 -1
  33. package/dist/plus/integrations/fieldPresence.d.ts +1 -1
  34. package/dist/plus/integrations/fieldPresence.js.map +1 -1
  35. package/dist/plus/integrations/models/integration.d.ts +18 -0
  36. package/dist/plus/integrations/models/integration.js +13 -1
  37. package/dist/plus/integrations/models/integration.js.map +1 -1
  38. package/dist/plus/integrations/providers/azure/azure.d.ts +7 -0
  39. package/dist/plus/integrations/providers/azure/azure.js +26 -4
  40. package/dist/plus/integrations/providers/azure/azure.js.map +1 -1
  41. package/dist/plus/integrations/providers/azure/models.d.ts +11 -3
  42. package/dist/plus/integrations/providers/azure/models.js +37 -23
  43. package/dist/plus/integrations/providers/azure/models.js.map +1 -1
  44. package/dist/plus/integrations/providers/azure/workItemStateCategories.d.ts +14 -4
  45. package/dist/plus/integrations/providers/azure/workItemStateCategories.js +31 -4
  46. package/dist/plus/integrations/providers/azure/workItemStateCategories.js.map +1 -1
  47. package/dist/plus/integrations/providers/issueSorts.d.ts +1 -0
  48. package/dist/plus/integrations/providers/models.d.ts +2 -1
  49. package/dist/plus/integrations/providers/models.js +9 -2
  50. package/dist/plus/integrations/providers/models.js.map +1 -1
  51. package/dist/plus/integrations/providers/providersApi.d.ts +6 -0
  52. package/dist/plus/integrations/providers/providersApi.js +20 -4
  53. package/dist/plus/integrations/providers/providersApi.js.map +1 -1
  54. package/dist/plus/integrations/reads/drains.d.ts +1 -0
  55. package/dist/plus/integrations/reads/etag.js +8 -3
  56. package/dist/plus/integrations/reads/etag.js.map +1 -1
  57. package/docs/integrations.md +15 -6
  58. package/package.json +2 -2
@@ -2,6 +2,7 @@ import { FileWatchingProvider } from "../git/watching/provider.js";
2
2
  import { WatchPollingOptions } from "../git/watching/watchService.js";
3
3
  import { GitLocation } from "./exec/locator.js";
4
4
  import { CliGitProviderOptions } from "./cliGitProvider.js";
5
+ import { WorktreeSummaryServiceOptions } from "../git/watching/worktreeSummary.js";
5
6
  import { GitService } from "../git/service.js";
6
7
  //#region ../git-cli/src/service.d.ts
7
8
  /**
@@ -35,6 +36,8 @@ export interface CliGitServiceOptions {
35
36
  * watcher is asked.
36
37
  */
37
38
  watchPolling?: WatchPollingOptions;
39
+ /** For tests only; production never passes it (see `WorktreeSummaryServiceOptions.verifyBaseRemeasure`) */
40
+ verifyBaseRemeasure?: WorktreeSummaryServiceOptions['verifyBaseRemeasure'];
38
41
  }
39
42
  /**
40
43
  * Creates a ready-to-use {@link GitService} backed by the CLI git provider.
@@ -25,6 +25,7 @@ import { findGitPath } from "./exec/locator.js";
25
25
  function createCliGitService(options) {
26
26
  const service = GitService.createSingleton(options.watchingProvider, {
27
27
  watchPolling: options.watchPolling,
28
+ verifyBaseRemeasure: options.verifyBaseRemeasure,
28
29
  readFile: (path) => options.context.fs.readFile(fileUri(path))
29
30
  });
30
31
  const locator = options.locator ?? (() => findGitPath(options.gitPath ?? null));
@@ -1 +1 @@
1
- {"version":3,"file":"service.js","names":[],"sources":["../../../git-cli/src/service.ts"],"sourcesContent":["import { GitService } from '@gitlens/git/service.js';\nimport type { FileWatchingProvider } from '@gitlens/git/watching/provider.js';\nimport type { WatchPollingOptions } from '@gitlens/git/watching/watchService.js';\nimport { fileUri } from '@gitlens/utils/uri.js';\nimport type { CliGitProviderOptions } from './cliGitProvider.js';\nimport { CliGitProvider } from './cliGitProvider.js';\nimport type { GitLocation } from './exec/locator.js';\nimport { findGitPath } from './exec/locator.js';\n\n/**\n * Options for {@link createCliGitService}.\n */\nexport interface CliGitServiceOptions {\n\t/**\n\t * Path(s) to the git binary.\n\t * Auto-detected if omitted (searches PATH, platform-specific locations).\n\t * Ignored when {@link locator} is provided.\n\t */\n\tgitPath?: string | string[];\n\n\t/**\n\t * Custom git binary resolver. When provided, used instead of the\n\t * default `findGitPath(gitPath)` lookup.\n\t */\n\tlocator?: () => Promise<GitLocation>;\n\n\t/** Host-provided context hooks (cache events, workspace, integrations, telemetry, fs) */\n\tcontext: CliGitProviderOptions['context'];\n\n\t/** Git execution options passed through to the underlying Git executor */\n\tgitOptions?: CliGitProviderOptions['gitOptions'];\n\n\t/** Use an existing Cache instance, or one will be created */\n\tcache?: CliGitProviderOptions['cache'];\n\n\t/**\n\t * Filesystem watching provider. When provided, the {@link GitService}\n\t * will watch repositories for changes (file creates, edits, deletes).\n\t */\n\twatchingProvider?: FileWatchingProvider;\n\n\t/**\n\t * Polls in place of (or beside) the watchers {@link watchingProvider} reports it can't trust. When omitted, no\n\t * watcher is asked.\n\t */\n\twatchPolling?: WatchPollingOptions;\n}\n\n/**\n * Creates a ready-to-use {@link GitService} backed by the CLI git provider.\n *\n * This is the primary entry point for standalone (non-VS Code) consumers\n * of the `@gitlens/git-cli` library. It creates a singleton {@link GitService},\n * wires up a {@link CliGitProvider}, and registers it for all repository paths.\n *\n * @example\n * ```typescript\n * const git = createCliGitService({ context: {} });\n *\n * const repo = git.forRepo('/path/to/repo')!;\n * const branches = await repo.branches.getBranches();\n * const status = await repo.status.getStatus();\n * await repo.ops!.fetch({ remote: 'origin' });\n *\n * git.dispose(); // cleans up provider, cache, and module-level state\n * ```\n */\nexport function createCliGitService(options: CliGitServiceOptions): GitService {\n\tconst service = GitService.createSingleton(options.watchingProvider, {\n\t\twatchPolling: options.watchPolling,\n\t\t// The host's file system reads the shared `.git/config` the watch service compares reports of\n\t\treadFile: path => options.context.fs.readFile(fileUri(path)),\n\t});\n\n\tconst locator = options.locator ?? (() => findGitPath(options.gitPath ?? null));\n\tconst provider = new CliGitProvider({\n\t\tcontext: options.context,\n\t\tlocator: locator,\n\t\tgitOptions: options.gitOptions,\n\t\tcache: options.cache,\n\t});\n\n\tservice.register(provider, () => true);\n\n\t// Advance the provider cache's status generation clock from the watch session's global events — the standalone\n\t// analogue of what the VS Code host wires in `GitProviderService`. Without this, a consumer that passes a\n\t// `watchingProvider` and drives watch sessions gets FS events but a FROZEN clock, so `dedupeByStatusGeneration`\n\t// degrades to the pre-change/post-change stale-join this branch exists to fix. Standalone has no `Repository`\n\t// models, so there are no force-fired `closed`/`lastFetched` bypassing the session for the global repo event to\n\t// miss. Subscriptions are torn down with the service (its `watchService`'s emitters are disposed on dispose).\n\tservice.watchService?.onDidChangeWorkingTree(repoPath => provider.cache.onWorkingTreeChanged(repoPath));\n\t// Announced kinds were evicted when core announced its write; evicting them again would discard what the host\n\t// re-read since\n\tservice.watchService?.onDidChangeRepository(e => {\n\t\tconst changes = e.getUnannouncedChanges();\n\t\tif (changes.length) {\n\t\t\tprovider.cache.onRepositoryChanged(e.repoPath, changes);\n\t\t}\n\t});\n\t// FETCH_HEAD maps to no session change, and there's no `Repository` model here to force-fire `lastFetched` (as\n\t// the VS Code host does), so bridge it straight to the cache or the last-fetched time is never re-read.\n\tservice.watchService?.onDidChangeFetchHead(repoPath =>\n\t\tprovider.cache.onRepositoryChanged(repoPath, ['lastFetched']),\n\t);\n\treturn service;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAmEA,SAAgB,oBAAoB,SAA2C;CAC9E,MAAM,UAAU,WAAW,gBAAgB,QAAQ,kBAAkB;EACpE,cAAc,QAAQ;EAEtB,WAAU,SAAQ,QAAQ,QAAQ,GAAG,SAAS,QAAQ,IAAI,CAAC;CAC5D,CAAC;CAED,MAAM,UAAU,QAAQ,kBAAkB,YAAY,QAAQ,WAAW,IAAI;CAC7E,MAAM,WAAW,IAAI,eAAe;EACnC,SAAS,QAAQ;EACR;EACT,YAAY,QAAQ;EACpB,OAAO,QAAQ;CAChB,CAAC;CAED,QAAQ,SAAS,gBAAgB,IAAI;CAQrC,QAAQ,cAAc,wBAAuB,aAAY,SAAS,MAAM,qBAAqB,QAAQ,CAAC;CAGtG,QAAQ,cAAc,uBAAsB,MAAK;EAChD,MAAM,UAAU,EAAE,sBAAsB;EACxC,IAAI,QAAQ,QACX,SAAS,MAAM,oBAAoB,EAAE,UAAU,OAAO;CAExD,CAAC;CAGD,QAAQ,cAAc,sBAAqB,aAC1C,SAAS,MAAM,oBAAoB,UAAU,CAAC,aAAa,CAAC,CAC7D;CACA,OAAO;AACR"}
1
+ {"version":3,"file":"service.js","names":[],"sources":["../../../git-cli/src/service.ts"],"sourcesContent":["import { GitService } from '@gitlens/git/service.js';\nimport type { FileWatchingProvider } from '@gitlens/git/watching/provider.js';\nimport type { WatchPollingOptions } from '@gitlens/git/watching/watchService.js';\nimport type { WorktreeSummaryServiceOptions } from '@gitlens/git/watching/worktreeSummary.js';\nimport { fileUri } from '@gitlens/utils/uri.js';\nimport type { CliGitProviderOptions } from './cliGitProvider.js';\nimport { CliGitProvider } from './cliGitProvider.js';\nimport type { GitLocation } from './exec/locator.js';\nimport { findGitPath } from './exec/locator.js';\n\n/**\n * Options for {@link createCliGitService}.\n */\nexport interface CliGitServiceOptions {\n\t/**\n\t * Path(s) to the git binary.\n\t * Auto-detected if omitted (searches PATH, platform-specific locations).\n\t * Ignored when {@link locator} is provided.\n\t */\n\tgitPath?: string | string[];\n\n\t/**\n\t * Custom git binary resolver. When provided, used instead of the\n\t * default `findGitPath(gitPath)` lookup.\n\t */\n\tlocator?: () => Promise<GitLocation>;\n\n\t/** Host-provided context hooks (cache events, workspace, integrations, telemetry, fs) */\n\tcontext: CliGitProviderOptions['context'];\n\n\t/** Git execution options passed through to the underlying Git executor */\n\tgitOptions?: CliGitProviderOptions['gitOptions'];\n\n\t/** Use an existing Cache instance, or one will be created */\n\tcache?: CliGitProviderOptions['cache'];\n\n\t/**\n\t * Filesystem watching provider. When provided, the {@link GitService}\n\t * will watch repositories for changes (file creates, edits, deletes).\n\t */\n\twatchingProvider?: FileWatchingProvider;\n\n\t/**\n\t * Polls in place of (or beside) the watchers {@link watchingProvider} reports it can't trust. When omitted, no\n\t * watcher is asked.\n\t */\n\twatchPolling?: WatchPollingOptions;\n\n\t/** For tests only; production never passes it (see `WorktreeSummaryServiceOptions.verifyBaseRemeasure`) */\n\tverifyBaseRemeasure?: WorktreeSummaryServiceOptions['verifyBaseRemeasure'];\n}\n\n/**\n * Creates a ready-to-use {@link GitService} backed by the CLI git provider.\n *\n * This is the primary entry point for standalone (non-VS Code) consumers\n * of the `@gitlens/git-cli` library. It creates a singleton {@link GitService},\n * wires up a {@link CliGitProvider}, and registers it for all repository paths.\n *\n * @example\n * ```typescript\n * const git = createCliGitService({ context: {} });\n *\n * const repo = git.forRepo('/path/to/repo')!;\n * const branches = await repo.branches.getBranches();\n * const status = await repo.status.getStatus();\n * await repo.ops!.fetch({ remote: 'origin' });\n *\n * git.dispose(); // cleans up provider, cache, and module-level state\n * ```\n */\nexport function createCliGitService(options: CliGitServiceOptions): GitService {\n\tconst service = GitService.createSingleton(options.watchingProvider, {\n\t\twatchPolling: options.watchPolling,\n\t\tverifyBaseRemeasure: options.verifyBaseRemeasure,\n\t\t// The host's file system reads the shared `.git/config` the watch service compares reports of\n\t\treadFile: path => options.context.fs.readFile(fileUri(path)),\n\t});\n\n\tconst locator = options.locator ?? (() => findGitPath(options.gitPath ?? null));\n\tconst provider = new CliGitProvider({\n\t\tcontext: options.context,\n\t\tlocator: locator,\n\t\tgitOptions: options.gitOptions,\n\t\tcache: options.cache,\n\t});\n\n\tservice.register(provider, () => true);\n\n\t// Advance the provider cache's status generation clock from the watch session's global events — the standalone\n\t// analogue of what the VS Code host wires in `GitProviderService`. Without this, a consumer that passes a\n\t// `watchingProvider` and drives watch sessions gets FS events but a FROZEN clock, so `dedupeByStatusGeneration`\n\t// degrades to the pre-change/post-change stale-join this branch exists to fix. Standalone has no `Repository`\n\t// models, so there are no force-fired `closed`/`lastFetched` bypassing the session for the global repo event to\n\t// miss. Subscriptions are torn down with the service (its `watchService`'s emitters are disposed on dispose).\n\tservice.watchService?.onDidChangeWorkingTree(repoPath => provider.cache.onWorkingTreeChanged(repoPath));\n\t// Announced kinds were evicted when core announced its write; evicting them again would discard what the host\n\t// re-read since\n\tservice.watchService?.onDidChangeRepository(e => {\n\t\tconst changes = e.getUnannouncedChanges();\n\t\tif (changes.length) {\n\t\t\tprovider.cache.onRepositoryChanged(e.repoPath, changes);\n\t\t}\n\t});\n\t// FETCH_HEAD maps to no session change, and there's no `Repository` model here to force-fire `lastFetched` (as\n\t// the VS Code host does), so bridge it straight to the cache or the last-fetched time is never re-read.\n\tservice.watchService?.onDidChangeFetchHead(repoPath =>\n\t\tprovider.cache.onRepositoryChanged(repoPath, ['lastFetched']),\n\t);\n\treturn service;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAuEA,SAAgB,oBAAoB,SAA2C;CAC9E,MAAM,UAAU,WAAW,gBAAgB,QAAQ,kBAAkB;EACpE,cAAc,QAAQ;EACtB,qBAAqB,QAAQ;EAE7B,WAAU,SAAQ,QAAQ,QAAQ,GAAG,SAAS,QAAQ,IAAI,CAAC;CAC5D,CAAC;CAED,MAAM,UAAU,QAAQ,kBAAkB,YAAY,QAAQ,WAAW,IAAI;CAC7E,MAAM,WAAW,IAAI,eAAe;EACnC,SAAS,QAAQ;EACR;EACT,YAAY,QAAQ;EACpB,OAAO,QAAQ;CAChB,CAAC;CAED,QAAQ,SAAS,gBAAgB,IAAI;CAQrC,QAAQ,cAAc,wBAAuB,aAAY,SAAS,MAAM,qBAAqB,QAAQ,CAAC;CAGtG,QAAQ,cAAc,uBAAsB,MAAK;EAChD,MAAM,UAAU,EAAE,sBAAsB;EACxC,IAAI,QAAQ,QACX,SAAS,MAAM,oBAAoB,EAAE,UAAU,OAAO;CAExD,CAAC;CAGD,QAAQ,cAAc,sBAAqB,aAC1C,SAAS,MAAM,oBAAoB,UAAU,CAAC,aAAa,CAAC,CAC7D;CACA,OAAO;AACR"}
@@ -49,7 +49,7 @@ export type PullRequestFieldGroup =
49
49
  'stack';
50
50
  /** A group is `fetched` only when every field in it is. */
51
51
  export type IssueFieldGroup =
52
- /** `body`. */
52
+ /** `body`, and `bodyField` where the provider sets it. */
53
53
  'description' |
54
54
  /** `assignees`. */
55
55
  'assignees' |
@@ -1 +1 @@
1
- {"version":3,"file":"fieldPresence.js","names":[],"sources":["../../../../plus/integrations/src/fieldPresence.ts"],"sourcesContent":["import type { IssueProjection, IssueShape } from '@gitlens/git/models/issue.js';\nimport type { PullRequestProjection, PullRequestShape } from '@gitlens/git/models/pullRequest.js';\nimport {\n\tGitCloudHostIntegrationId,\n\tGitSelfManagedHostIntegrationId,\n\tIssuesCloudHostIntegrationId,\n\tIssuesSelfManagedHostIntegrationId,\n} from './constants.js';\n\n/**\n * Whether a row's read fetched a field group.\n *\n * - `fetched`: the read asked for it and surfaces it, so an empty value means \"none\".\n * - `not-requested`: this read didn't ask for it, or asked but doesn't surface it faithfully. Ignore the value even\n * when one is present (some reads fill placeholders); another read may supply it.\n * - `unavailable`: this provider or host can't supply it on this read.\n */\nexport type FieldPresence = 'fetched' | 'not-requested' | 'unavailable';\n\n/** A group is `fetched` only when every field in it is. */\nexport type PullRequestFieldGroup =\n\t/** `body`. */\n\t| 'description'\n\t/** `latestReviews`. */\n\t| 'reviews'\n\t/**\n\t * `reviewRequests`: who is requested. Not each request's `isCodeOwner`, which only GitLens' own GitHub reads\n\t * report; every other row leaves it undefined.\n\t */\n\t| 'reviewRequests'\n\t/**\n\t * `reviewDecision`. Only GitHub reports one; elsewhere it is derived from the reviewers' states on the row, which\n\t * ignores the host's own approval rules, so it is never `fetched` there — derive it from `reviews` and\n\t * `reviewRequests` instead.\n\t */\n\t| 'reviewDecision'\n\t/** `assignees`. */\n\t| 'assignees'\n\t/** `statusCheckRollupState`, on the `PullRequest` class. */\n\t| 'checks'\n\t/** `mergeableState`. */\n\t| 'mergeable'\n\t/** `additions`, `deletions` and `filesChanged`. */\n\t| 'diffStats'\n\t/** `commitCount`, on the `PullRequest` class. */\n\t| 'commitCount'\n\t/** `commentsCount`. */\n\t| 'comments'\n\t/** `thumbsUpCount`. */\n\t| 'reactions'\n\t/** `viewerCanUpdate`, on the `PullRequest` class, and `repository.accessLevel`. */\n\t| 'access'\n\t/** `authoredByMe`, and the `viewer` it was matched against. */\n\t| 'authoredByMe'\n\t/** `stack`. */\n\t| 'stack';\n\n/** A group is `fetched` only when every field in it is. */\nexport type IssueFieldGroup =\n\t/** `body`. */\n\t| 'description'\n\t/** `assignees`. */\n\t| 'assignees'\n\t/** `labels`. */\n\t| 'labels'\n\t/** `commentsCount`. */\n\t| 'comments'\n\t/** `thumbsUpCount`. */\n\t| 'reactions'\n\t/** `repository.accessLevel`. */\n\t| 'access';\n\ntype Presence<G extends string> = Readonly<Record<G, FieldPresence>>;\ntype PresenceTable<P extends string, G extends string> = Readonly<Partial<Record<P, Presence<G>>>>;\n\nconst pullRequestFieldGroups: readonly PullRequestFieldGroup[] = [\n\t'description',\n\t'reviews',\n\t'reviewRequests',\n\t'reviewDecision',\n\t'assignees',\n\t'checks',\n\t'mergeable',\n\t'diffStats',\n\t'commitCount',\n\t'comments',\n\t'reactions',\n\t'access',\n\t'authoredByMe',\n\t'stack',\n];\n\nconst issueFieldGroups: readonly IssueFieldGroup[] = [\n\t'description',\n\t'assignees',\n\t'labels',\n\t'comments',\n\t'reactions',\n\t'access',\n];\n\n/** Every group in `groups` listed as neither `fetched` nor `unavailable` is `not-requested`. */\nfunction presenceOf<G extends string>(\n\tgroups: readonly G[],\n\tfetched: readonly G[],\n\tunavailable: readonly G[] = [],\n): Presence<G> {\n\treturn Object.freeze(\n\t\tObject.fromEntries(\n\t\t\tgroups.map(\n\t\t\t\tgroup =>\n\t\t\t\t\t[\n\t\t\t\t\t\tgroup,\n\t\t\t\t\t\tfetched.includes(group)\n\t\t\t\t\t\t\t? 'fetched'\n\t\t\t\t\t\t\t: unavailable.includes(group)\n\t\t\t\t\t\t\t\t? 'unavailable'\n\t\t\t\t\t\t\t\t: 'not-requested',\n\t\t\t\t\t] as const,\n\t\t\t),\n\t\t) as Record<G, FieldPresence>,\n\t);\n}\n\nfunction pullRequestPresenceOf(\n\tfetched: readonly PullRequestFieldGroup[],\n\tunavailable?: readonly PullRequestFieldGroup[],\n): Presence<PullRequestFieldGroup> {\n\treturn presenceOf(pullRequestFieldGroups, fetched, unavailable);\n}\n\nfunction issuePresenceOf(\n\tfetched: readonly IssueFieldGroup[],\n\tunavailable?: readonly IssueFieldGroup[],\n): Presence<IssueFieldGroup> {\n\treturn presenceOf(issueFieldGroups, fetched, unavailable);\n}\n\n/** GitLens' own lite fragment (`fromGitHubPullRequestLite`). `stack` is only selected against github.com. */\nconst gitHubLite = pullRequestPresenceOf(['description', 'stack']);\n\n/**\n * GitLens' own full fragment, which selects no reactions. The account-wide and batch reads return its rows as they\n * are, GitHub's own review decision included: none stays none, even while a review is requested.\n * `authoredByMe` needs the current account, which a read may fail to resolve, and the other reads never set it.\n */\nconst gitHubFull = pullRequestPresenceOf([\n\t'description',\n\t'reviews',\n\t'reviewRequests',\n\t'reviewDecision',\n\t'assignees',\n\t'checks',\n\t'mergeable',\n\t'diffStats',\n\t'commitCount',\n\t'comments',\n\t'access',\n\t'stack',\n]);\n\nconst gitHubPullRequests: PresenceTable<PullRequestProjection, PullRequestFieldGroup> = {\n\tpoint: gitHubLite,\n\tsearch: gitHubFull,\n\t'search-summary': gitHubLite,\n\t'text-search': gitHubFull,\n\taccount: gitHubFull,\n\t// The lite fragment's own rows.\n\t'account-summary': gitHubLite,\n\t// provider-apis' own fragment and normalizer. Its review-state map has no DISMISSED, so a dismissed review is\n\t// dropped (and none carries a `commitOid`); it removes code-owner requests; it derives the review decision from\n\t// that list rather than reading GitHub's; and it doesn't read `repository.accessLevel`.\n\trepos: pullRequestPresenceOf([\n\t\t'description',\n\t\t'assignees',\n\t\t'checks',\n\t\t'mergeable',\n\t\t'diffStats',\n\t\t'commitCount',\n\t\t'comments',\n\t\t'reactions',\n\t]),\n\t// `summary` drops the `commits` subtree that carries both the check rollup and the commit count.\n\t'repos-summary': pullRequestPresenceOf([\n\t\t'description',\n\t\t'assignees',\n\t\t'mergeable',\n\t\t'diffStats',\n\t\t'comments',\n\t\t'reactions',\n\t]),\n\tbatch: gitHubFull,\n};\n\n/**\n * GitHub Enterprise Server rejects the stack selection, so a read that carries `stack` on github.com can't here.\n * provider-apis also gates check runs on the server version, which this table can't see, so its rollup on the\n * repository-scoped read may come from commit statuses alone.\n */\nconst gitHubEnterprisePullRequests: PresenceTable<PullRequestProjection, PullRequestFieldGroup> = Object.fromEntries(\n\tObject.entries(gitHubPullRequests).map(([projection, presence]) => {\n\t\tconst enterprise: Record<PullRequestFieldGroup, FieldPresence> = { ...presence };\n\t\tif (enterprise.stack === 'fetched') {\n\t\t\tenterprise.stack = 'unavailable';\n\t\t}\n\t\tif (projection === 'repos') {\n\t\t\tenterprise.checks = 'not-requested';\n\t\t}\n\t\treturn [projection, Object.freeze(enterprise)];\n\t}),\n);\n\n/** GitLens' own issue fragment, which every native read selects with the body. */\nconst gitHubNativeIssue = presenceOf(issueFieldGroups, issueFieldGroups);\n\nconst gitHubIssues: PresenceTable<IssueProjection, IssueFieldGroup> = {\n\tpoint: gitHubNativeIssue,\n\tsearch: gitHubNativeIssue,\n\taccount: gitHubNativeIssue,\n\t// provider-apis' own fragment selects neither the body nor the repository's `viewerPermission`.\n\trepos: presenceOf(issueFieldGroups, ['assignees', 'labels', 'comments', 'reactions']),\n\tbatch: gitHubNativeIssue,\n};\n\n/*\n * Every other provider. None of them reads the viewer's access (`repository.accessLevel` is absent on every row),\n * resolves `authoredByMe` reliably, or has stacks. provider-apis honors neither `summary` nor\n * `includeReviews` for them, so each `-summary` tag reads like its full one.\n */\n\n/**\n * GitLens' own GitLab reads: the point reads, and the free-text search. They select the description but leave it,\n * and everything else beyond the merge request's identity and refs, off the row.\n */\nconst gitLabOwn = pullRequestPresenceOf([], ['stack']);\n\n/**\n * provider-apis' merge request fragment and normalizer, which every other GitLab read goes through. It turns a null\n * count into 0: GitLab's schema makes `diffStatsSummary`, `commitCount` and `userNotesCount` nullable, so none is\n * promised — except that GitLab.com's comment count resolver answers 0 rather than null, which a self-managed\n * version may not.\n */\nfunction gitLabProviderApis(comments: boolean): Presence<PullRequestFieldGroup> {\n\treturn pullRequestPresenceOf(\n\t\t[\n\t\t\t'description',\n\t\t\t'reviews',\n\t\t\t'reviewRequests',\n\t\t\t'assignees',\n\t\t\t'checks',\n\t\t\t'mergeable',\n\t\t\t'reactions',\n\t\t\t...(comments ? (['comments'] as const) : []),\n\t\t],\n\t\t['stack'],\n\t);\n}\n\nfunction gitLabPullRequestsFor(\n\tproviderApis: Presence<PullRequestFieldGroup>,\n): PresenceTable<PullRequestProjection, PullRequestFieldGroup> {\n\treturn {\n\t\tpoint: gitLabOwn,\n\t\tsearch: providerApis,\n\t\t'text-search': gitLabOwn,\n\t\taccount: providerApis,\n\t\t'account-summary': providerApis,\n\t\trepos: providerApis,\n\t\t'repos-summary': providerApis,\n\t\tbatch: providerApis,\n\t};\n}\n\n/**\n * Azure DevOps pull requests have no assignees (both converters fill `assignees` with the reviewers, which `reviews` and\n * `reviewRequests` already hold) and no reactions. Neither converter reads checks or counts.\n */\nconst azureUnavailable: readonly PullRequestFieldGroup[] = ['assignees', 'reactions', 'stack'];\n/** Every list read: Azure truncates a listed pull request's description (to 400 characters). */\nconst azureListed = pullRequestPresenceOf(['reviews', 'reviewRequests', 'mergeable'], azureUnavailable);\n/** The batch reads fetch each pull request by id, which returns the whole description. */\nconst azureById = pullRequestPresenceOf(['description', 'reviews', 'reviewRequests', 'mergeable'], azureUnavailable);\n\nconst azurePullRequests: PresenceTable<PullRequestProjection, PullRequestFieldGroup> = {\n\t// GitLens' own converter, which leaves the description off the row.\n\tpoint: azureListed,\n\tsearch: azureListed,\n\t'text-search': azureListed,\n\taccount: azureListed,\n\t'account-summary': azureListed,\n\trepos: azureListed,\n\t'repos-summary': azureListed,\n\tbatch: azureById,\n};\n\nconst azureServerPullRequests: PresenceTable<PullRequestProjection, PullRequestFieldGroup> = {\n\t...azurePullRequests,\n\t'search-summary': azureListed,\n};\n\n/**\n * Bitbucket pull requests have no assignees or reactions. Neither provider-apis nor GitLens reads their build\n * statuses or mergeability: provider-apis fills a literal Mergeable, and GitLens' own converters leave it unset.\n */\nconst bitbucketUnavailable: readonly PullRequestFieldGroup[] = ['assignees', 'reactions', 'stack'];\nconst bitbucketProviderApis = pullRequestPresenceOf(\n\t['description', 'reviews', 'reviewRequests', 'comments'],\n\tbitbucketUnavailable,\n);\n\nconst bitbucketPullRequests: PresenceTable<PullRequestProjection, PullRequestFieldGroup> = {\n\t// GitLens' own converter, which drops the comment count. The commit read selects `+values.*`, which isn't\n\t// known to bring the participants the reviews come from, as the other two point reads do.\n\tpoint: pullRequestPresenceOf(['description'], bitbucketUnavailable),\n\tsearch: bitbucketProviderApis,\n\t'text-search': bitbucketProviderApis,\n\taccount: bitbucketProviderApis,\n\t'account-summary': bitbucketProviderApis,\n\trepos: bitbucketProviderApis,\n\t'repos-summary': bitbucketProviderApis,\n\t// GitLens' own converter over reads that do select the participants.\n\tbatch: pullRequestPresenceOf(['description', 'reviews', 'reviewRequests'], bitbucketUnavailable),\n};\n\n/** provider-apis' and GitLens' own Data Center converters read the same fields. */\nconst bitbucketServerAll = pullRequestPresenceOf(\n\t['description', 'reviews', 'reviewRequests', 'comments'],\n\tbitbucketUnavailable,\n);\nconst bitbucketServerPullRequests: PresenceTable<PullRequestProjection, PullRequestFieldGroup> = {\n\tpoint: bitbucketServerAll,\n\tsearch: bitbucketServerAll,\n\t'search-summary': bitbucketServerAll,\n\t'text-search': bitbucketServerAll,\n\taccount: bitbucketServerAll,\n\t'account-summary': bitbucketServerAll,\n\trepos: bitbucketServerAll,\n\t'repos-summary': bitbucketServerAll,\n\tbatch: bitbucketServerAll,\n};\n\n/**\n * provider-apis' GitLab issue reads (GraphQL, and REST for the account-wide one). The repository's access isn't read.\n * The GraphQL comment count is nullable like the merge request's, and passed through, so only GitLab.com's is\n * promised; the REST one is always a number.\n */\nfunction gitLabIssuesFor(comments: boolean): PresenceTable<IssueProjection, IssueFieldGroup> {\n\tconst graphQL = issuePresenceOf([\n\t\t'description',\n\t\t'assignees',\n\t\t'labels',\n\t\t'reactions',\n\t\t...(comments ? (['comments'] as const) : []),\n\t]);\n\treturn {\n\t\tpoint: graphQL,\n\t\taccount: issuePresenceOf(['description', 'assignees', 'labels', 'comments', 'reactions']),\n\t\trepos: graphQL,\n\t\tbatch: graphQL,\n\t};\n}\n\n/**\n * Azure DevOps work items have no reactions (provider-apis' converter fills 0; GitLens' leaves it unset) and belong to\n * a project, not a repository.\n */\nconst azureWorkItemUnavailable: readonly IssueFieldGroup[] = ['reactions', 'access'];\n/** provider-apis' work item converter, and GitLens' copy of it for the batch read. */\nconst azureWorkItem = issuePresenceOf(['description', 'assignees', 'labels', 'comments'], azureWorkItemUnavailable);\n/** GitLens' own work item converter, which drops the tags. */\nconst azureOwnWorkItem = issuePresenceOf(['description', 'assignees', 'comments'], azureWorkItemUnavailable);\n\nconst azureIssues: PresenceTable<IssueProjection, IssueFieldGroup> = {\n\tpoint: azureOwnWorkItem,\n\taccount: azureWorkItem,\n\trepos: azureWorkItem,\n\tbatch: azureWorkItem,\n};\n\nconst azureServerIssues: PresenceTable<IssueProjection, IssueFieldGroup> = {\n\t...azureIssues,\n\tsearch: azureOwnWorkItem,\n};\n\n/**\n * Bitbucket Cloud's legacy issues, which only the host's own `getIssue` and `searchMyIssues` read. They have no\n * labels, their votes aren't reactions, and neither a comment count nor the repository's access is read.\n */\nconst bitbucketIssue = issuePresenceOf(['description', 'assignees'], ['labels', 'reactions']);\nconst bitbucketIssues: PresenceTable<IssueProjection, IssueFieldGroup> = {\n\tpoint: bitbucketIssue,\n\taccount: bitbucketIssue,\n};\n\n/**\n * Tracker issues belong to no repository, and a tracker's votes aren't reactions (and read 0 where voting is off), so\n * neither group can be supplied.\n */\nconst trackerUnavailable: readonly IssueFieldGroup[] = ['reactions', 'access'];\n/**\n * provider-apis' Jira converter counts the comments embedded in the issue, which Jira may cap, rather than reading\n * their total.\n */\nconst jiraProviderApis = issuePresenceOf(['description', 'assignees', 'labels'], trackerUnavailable);\n\nconst jiraIssues: PresenceTable<IssueProjection, IssueFieldGroup> = {\n\tpoint: jiraProviderApis,\n\taccount: jiraProviderApis,\n\tproject: jiraProviderApis,\n\t// GitLens' own by-key read, which reads the comment total.\n\tbatch: issuePresenceOf(['description', 'assignees', 'labels', 'comments'], trackerUnavailable),\n};\n\nconst jiraServerIssues: PresenceTable<IssueProjection, IssueFieldGroup> = {\n\t...jiraIssues,\n\tbatch: jiraProviderApis,\n};\n\n/** provider-apis' Linear fragment selects no labels (it fills an empty list), comments or reactions. */\nconst linearIssue = issuePresenceOf(['description', 'assignees'], ['access']);\nconst linearIssues: PresenceTable<IssueProjection, IssueFieldGroup> = {\n\tpoint: linearIssue,\n\taccount: linearIssue,\n\tproject: linearIssue,\n\tbatch: linearIssue,\n};\n\n/** A Trello card's description is never read; its members are its assignees. */\nconst trelloCard = issuePresenceOf(['assignees', 'labels', 'comments'], trackerUnavailable);\nconst trelloIssues: PresenceTable<IssueProjection, IssueFieldGroup> = {\n\tpoint: trelloCard,\n\tproject: trelloCard,\n};\n\nconst pullRequestPresence = new Map<string, PresenceTable<PullRequestProjection, PullRequestFieldGroup>>([\n\t[GitCloudHostIntegrationId.GitHub, gitHubPullRequests],\n\t[GitSelfManagedHostIntegrationId.CloudGitHubEnterprise, gitHubEnterprisePullRequests],\n\t[GitCloudHostIntegrationId.GitLab, gitLabPullRequestsFor(gitLabProviderApis(true))],\n\t[GitSelfManagedHostIntegrationId.CloudGitLabSelfHosted, gitLabPullRequestsFor(gitLabProviderApis(false))],\n\t[GitCloudHostIntegrationId.AzureDevOps, azurePullRequests],\n\t[GitSelfManagedHostIntegrationId.AzureDevOpsServer, azureServerPullRequests],\n\t[GitCloudHostIntegrationId.Bitbucket, bitbucketPullRequests],\n\t[GitSelfManagedHostIntegrationId.BitbucketServer, bitbucketServerPullRequests],\n]);\n\nconst issuePresence = new Map<string, PresenceTable<IssueProjection, IssueFieldGroup>>([\n\t[GitCloudHostIntegrationId.GitHub, gitHubIssues],\n\t[GitSelfManagedHostIntegrationId.CloudGitHubEnterprise, gitHubIssues],\n\t[GitCloudHostIntegrationId.GitLab, gitLabIssuesFor(true)],\n\t[GitSelfManagedHostIntegrationId.CloudGitLabSelfHosted, gitLabIssuesFor(false)],\n\t[GitCloudHostIntegrationId.AzureDevOps, azureIssues],\n\t[GitSelfManagedHostIntegrationId.AzureDevOpsServer, azureServerIssues],\n\t[GitCloudHostIntegrationId.Bitbucket, bitbucketIssues],\n\t[IssuesCloudHostIntegrationId.Jira, jiraIssues],\n\t[IssuesSelfManagedHostIntegrationId.JiraServer, jiraServerIssues],\n\t[IssuesCloudHostIntegrationId.Linear, linearIssues],\n\t[IssuesCloudHostIntegrationId.Trello, trelloIssues],\n]);\n\nfunction lookup<P extends string, G extends string>(\n\ttables: ReadonlyMap<string, PresenceTable<P, G>>,\n\tproviderId: string,\n\tprojection: P | undefined,\n): Presence<G> | undefined {\n\tif (projection == null) return undefined;\n\n\tconst table = tables.get(providerId);\n\t// `hasOwn` so a projection read off an untrusted row can't resolve to an `Object.prototype` member.\n\treturn table != null && Object.hasOwn(table, projection) ? table[projection] : undefined;\n}\n\n/**\n * Which field groups the read that produced `pr` fetched, keyed by its provider and {@link PullRequestShape.projection}.\n * `undefined` when either is unknown or the provider has no table yet — then nothing can be said about any field.\n */\nexport function getPullRequestFieldPresence(\n\tpr: PullRequestShape,\n): Readonly<Record<PullRequestFieldGroup, FieldPresence>> | undefined {\n\treturn lookup(pullRequestPresence, pr.provider.id, pr.projection);\n}\n\n/**\n * Which field groups the read that produced `issue` fetched, keyed by its provider and {@link IssueShape.projection}.\n * `undefined` when either is unknown or the provider has no table yet — then nothing can be said about any field.\n */\nexport function getIssueFieldPresence(issue: IssueShape): Readonly<Record<IssueFieldGroup, FieldPresence>> | undefined {\n\treturn lookup(issuePresence, issue.provider.id, issue.projection);\n}\n"],"mappings":";;AA2EA,MAAM,yBAA2D;CAChE;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD;AAEA,MAAM,mBAA+C;CACpD;CACA;CACA;CACA;CACA;CACA;AACD;;AAGA,SAAS,WACR,QACA,SACA,cAA4B,CAAC,GACf;CACd,OAAO,OAAO,OACb,OAAO,YACN,OAAO,KACN,UACC,CACC,OACA,QAAQ,SAAS,KAAK,IACnB,YACA,YAAY,SAAS,KAAK,IACzB,gBACA,eACL,CACF,CACD,CACD;AACD;AAEA,SAAS,sBACR,SACA,aACkC;CA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AAiB;CACzD,CAAA,uBAAoD,uBAAuB;CAC3E,CAAA,aAAsC,qBAAqB;CAC3D,CAAA,oBAAkD,2BAA2B;AAC9E,CAAC;AAED,MAAM,gCAAgB,IAAI,IAA6D;CACtF,CAAA,UAAmC,YAAY;CAC/C,CAAA,2BAAwD,YAAY;CACpE,CAAA,UAAmC,gBAAgB,IAAI,CAAC;CACxD,CAAA,4BAAwD,gBAAgB,KAAK,CAAC;CAC9E,CAAA,eAAwC,WAAW;CACnD,CAAA,uBAAoD,iBAAiB;CACrE,CAAA,aAAsC,eAAe;CACrD,CAAA,QAAoC,UAAU;CAC9C,CAAA,eAAgD,gBAAgB;CAChE,CAAA,UAAsC,YAAY;CAClD,CAAA,UAAsC,YAAY;AACnD,CAAC;AAED,SAAS,OACR,QACA,YACA,YAC0B;CAC1B,IAAI,cAAc,MAAM,OAAO,KAAA;CAE/B,MAAM,QAAQ,OAAO,IAAI,UAAU;CAEnC,OAAO,SAAS,QAAQ,OAAO,OAAO,OAAO,UAAU,IAAI,MAAM,cAAc,KAAA;AAChF;;;;;AAMA,SAAgB,4BACf,IACqE;CACrE,OAAO,OAAO,qBAAqB,GAAG,SAAS,IAAI,GAAG,UAAU;AACjE;;;;;AAMA,SAAgB,sBAAsB,OAAiF;CACtH,OAAO,OAAO,eAAe,MAAM,SAAS,IAAI,MAAM,UAAU;AACjE"}
1
+ {"version":3,"file":"fieldPresence.js","names":[],"sources":["../../../../plus/integrations/src/fieldPresence.ts"],"sourcesContent":["import type { IssueProjection, IssueShape } from '@gitlens/git/models/issue.js';\nimport type { PullRequestProjection, PullRequestShape } from '@gitlens/git/models/pullRequest.js';\nimport {\n\tGitCloudHostIntegrationId,\n\tGitSelfManagedHostIntegrationId,\n\tIssuesCloudHostIntegrationId,\n\tIssuesSelfManagedHostIntegrationId,\n} from './constants.js';\n\n/**\n * Whether a row's read fetched a field group.\n *\n * - `fetched`: the read asked for it and surfaces it, so an empty value means \"none\".\n * - `not-requested`: this read didn't ask for it, or asked but doesn't surface it faithfully. Ignore the value even\n * when one is present (some reads fill placeholders); another read may supply it.\n * - `unavailable`: this provider or host can't supply it on this read.\n */\nexport type FieldPresence = 'fetched' | 'not-requested' | 'unavailable';\n\n/** A group is `fetched` only when every field in it is. */\nexport type PullRequestFieldGroup =\n\t/** `body`. */\n\t| 'description'\n\t/** `latestReviews`. */\n\t| 'reviews'\n\t/**\n\t * `reviewRequests`: who is requested. Not each request's `isCodeOwner`, which only GitLens' own GitHub reads\n\t * report; every other row leaves it undefined.\n\t */\n\t| 'reviewRequests'\n\t/**\n\t * `reviewDecision`. Only GitHub reports one; elsewhere it is derived from the reviewers' states on the row, which\n\t * ignores the host's own approval rules, so it is never `fetched` there — derive it from `reviews` and\n\t * `reviewRequests` instead.\n\t */\n\t| 'reviewDecision'\n\t/** `assignees`. */\n\t| 'assignees'\n\t/** `statusCheckRollupState`, on the `PullRequest` class. */\n\t| 'checks'\n\t/** `mergeableState`. */\n\t| 'mergeable'\n\t/** `additions`, `deletions` and `filesChanged`. */\n\t| 'diffStats'\n\t/** `commitCount`, on the `PullRequest` class. */\n\t| 'commitCount'\n\t/** `commentsCount`. */\n\t| 'comments'\n\t/** `thumbsUpCount`. */\n\t| 'reactions'\n\t/** `viewerCanUpdate`, on the `PullRequest` class, and `repository.accessLevel`. */\n\t| 'access'\n\t/** `authoredByMe`, and the `viewer` it was matched against. */\n\t| 'authoredByMe'\n\t/** `stack`. */\n\t| 'stack';\n\n/** A group is `fetched` only when every field in it is. */\nexport type IssueFieldGroup =\n\t/** `body`, and `bodyField` where the provider sets it. */\n\t| 'description'\n\t/** `assignees`. */\n\t| 'assignees'\n\t/** `labels`. */\n\t| 'labels'\n\t/** `commentsCount`. */\n\t| 'comments'\n\t/** `thumbsUpCount`. */\n\t| 'reactions'\n\t/** `repository.accessLevel`. */\n\t| 'access';\n\ntype Presence<G extends string> = Readonly<Record<G, FieldPresence>>;\ntype PresenceTable<P extends string, G extends string> = Readonly<Partial<Record<P, Presence<G>>>>;\n\nconst pullRequestFieldGroups: readonly PullRequestFieldGroup[] = [\n\t'description',\n\t'reviews',\n\t'reviewRequests',\n\t'reviewDecision',\n\t'assignees',\n\t'checks',\n\t'mergeable',\n\t'diffStats',\n\t'commitCount',\n\t'comments',\n\t'reactions',\n\t'access',\n\t'authoredByMe',\n\t'stack',\n];\n\nconst issueFieldGroups: readonly IssueFieldGroup[] = [\n\t'description',\n\t'assignees',\n\t'labels',\n\t'comments',\n\t'reactions',\n\t'access',\n];\n\n/** Every group in `groups` listed as neither `fetched` nor `unavailable` is `not-requested`. */\nfunction presenceOf<G extends string>(\n\tgroups: readonly G[],\n\tfetched: readonly G[],\n\tunavailable: readonly G[] = [],\n): Presence<G> {\n\treturn Object.freeze(\n\t\tObject.fromEntries(\n\t\t\tgroups.map(\n\t\t\t\tgroup =>\n\t\t\t\t\t[\n\t\t\t\t\t\tgroup,\n\t\t\t\t\t\tfetched.includes(group)\n\t\t\t\t\t\t\t? 'fetched'\n\t\t\t\t\t\t\t: unavailable.includes(group)\n\t\t\t\t\t\t\t\t? 'unavailable'\n\t\t\t\t\t\t\t\t: 'not-requested',\n\t\t\t\t\t] as const,\n\t\t\t),\n\t\t) as Record<G, FieldPresence>,\n\t);\n}\n\nfunction pullRequestPresenceOf(\n\tfetched: readonly PullRequestFieldGroup[],\n\tunavailable?: readonly PullRequestFieldGroup[],\n): Presence<PullRequestFieldGroup> {\n\treturn presenceOf(pullRequestFieldGroups, fetched, unavailable);\n}\n\nfunction issuePresenceOf(\n\tfetched: readonly IssueFieldGroup[],\n\tunavailable?: readonly IssueFieldGroup[],\n): Presence<IssueFieldGroup> {\n\treturn presenceOf(issueFieldGroups, fetched, unavailable);\n}\n\n/** GitLens' own lite fragment (`fromGitHubPullRequestLite`). `stack` is only selected against github.com. */\nconst gitHubLite = pullRequestPresenceOf(['description', 'stack']);\n\n/**\n * GitLens' own full fragment, which selects no reactions. The account-wide and batch reads return its rows as they\n * are, GitHub's own review decision included: none stays none, even while a review is requested.\n * `authoredByMe` needs the current account, which a read may fail to resolve, and the other reads never set it.\n */\nconst gitHubFull = pullRequestPresenceOf([\n\t'description',\n\t'reviews',\n\t'reviewRequests',\n\t'reviewDecision',\n\t'assignees',\n\t'checks',\n\t'mergeable',\n\t'diffStats',\n\t'commitCount',\n\t'comments',\n\t'access',\n\t'stack',\n]);\n\nconst gitHubPullRequests: PresenceTable<PullRequestProjection, PullRequestFieldGroup> = {\n\tpoint: gitHubLite,\n\tsearch: gitHubFull,\n\t'search-summary': gitHubLite,\n\t'text-search': gitHubFull,\n\taccount: gitHubFull,\n\t// The lite fragment's own rows.\n\t'account-summary': gitHubLite,\n\t// provider-apis' own fragment and normalizer. Its review-state map has no DISMISSED, so a dismissed review is\n\t// dropped (and none carries a `commitOid`); it removes code-owner requests; it derives the review decision from\n\t// that list rather than reading GitHub's; and it doesn't read `repository.accessLevel`.\n\trepos: pullRequestPresenceOf([\n\t\t'description',\n\t\t'assignees',\n\t\t'checks',\n\t\t'mergeable',\n\t\t'diffStats',\n\t\t'commitCount',\n\t\t'comments',\n\t\t'reactions',\n\t]),\n\t// `summary` drops the `commits` subtree that carries both the check rollup and the commit count.\n\t'repos-summary': pullRequestPresenceOf([\n\t\t'description',\n\t\t'assignees',\n\t\t'mergeable',\n\t\t'diffStats',\n\t\t'comments',\n\t\t'reactions',\n\t]),\n\tbatch: gitHubFull,\n};\n\n/**\n * GitHub Enterprise Server rejects the stack selection, so a read that carries `stack` on github.com can't here.\n * provider-apis also gates check runs on the server version, which this table can't see, so its rollup on the\n * repository-scoped read may come from commit statuses alone.\n */\nconst gitHubEnterprisePullRequests: PresenceTable<PullRequestProjection, PullRequestFieldGroup> = Object.fromEntries(\n\tObject.entries(gitHubPullRequests).map(([projection, presence]) => {\n\t\tconst enterprise: Record<PullRequestFieldGroup, FieldPresence> = { ...presence };\n\t\tif (enterprise.stack === 'fetched') {\n\t\t\tenterprise.stack = 'unavailable';\n\t\t}\n\t\tif (projection === 'repos') {\n\t\t\tenterprise.checks = 'not-requested';\n\t\t}\n\t\treturn [projection, Object.freeze(enterprise)];\n\t}),\n);\n\n/** GitLens' own issue fragment, which every native read selects with the body. */\nconst gitHubNativeIssue = presenceOf(issueFieldGroups, issueFieldGroups);\n\nconst gitHubIssues: PresenceTable<IssueProjection, IssueFieldGroup> = {\n\tpoint: gitHubNativeIssue,\n\tsearch: gitHubNativeIssue,\n\taccount: gitHubNativeIssue,\n\t// provider-apis' own fragment selects neither the body nor the repository's `viewerPermission`.\n\trepos: presenceOf(issueFieldGroups, ['assignees', 'labels', 'comments', 'reactions']),\n\tbatch: gitHubNativeIssue,\n};\n\n/*\n * Every other provider. None of them reads the viewer's access (`repository.accessLevel` is absent on every row),\n * resolves `authoredByMe` reliably, or has stacks. provider-apis honors neither `summary` nor\n * `includeReviews` for them, so each `-summary` tag reads like its full one.\n */\n\n/**\n * GitLens' own GitLab reads: the point reads, and the free-text search. They select the description but leave it,\n * and everything else beyond the merge request's identity and refs, off the row.\n */\nconst gitLabOwn = pullRequestPresenceOf([], ['stack']);\n\n/**\n * provider-apis' merge request fragment and normalizer, which every other GitLab read goes through. It turns a null\n * count into 0: GitLab's schema makes `diffStatsSummary`, `commitCount` and `userNotesCount` nullable, so none is\n * promised — except that GitLab.com's comment count resolver answers 0 rather than null, which a self-managed\n * version may not.\n */\nfunction gitLabProviderApis(comments: boolean): Presence<PullRequestFieldGroup> {\n\treturn pullRequestPresenceOf(\n\t\t[\n\t\t\t'description',\n\t\t\t'reviews',\n\t\t\t'reviewRequests',\n\t\t\t'assignees',\n\t\t\t'checks',\n\t\t\t'mergeable',\n\t\t\t'reactions',\n\t\t\t...(comments ? (['comments'] as const) : []),\n\t\t],\n\t\t['stack'],\n\t);\n}\n\nfunction gitLabPullRequestsFor(\n\tproviderApis: Presence<PullRequestFieldGroup>,\n): PresenceTable<PullRequestProjection, PullRequestFieldGroup> {\n\treturn {\n\t\tpoint: gitLabOwn,\n\t\tsearch: providerApis,\n\t\t'text-search': gitLabOwn,\n\t\taccount: providerApis,\n\t\t'account-summary': providerApis,\n\t\trepos: providerApis,\n\t\t'repos-summary': providerApis,\n\t\tbatch: providerApis,\n\t};\n}\n\n/**\n * Azure DevOps pull requests have no assignees (both converters fill `assignees` with the reviewers, which `reviews` and\n * `reviewRequests` already hold) and no reactions. Neither converter reads checks or counts.\n */\nconst azureUnavailable: readonly PullRequestFieldGroup[] = ['assignees', 'reactions', 'stack'];\n/** Every list read: Azure truncates a listed pull request's description (to 400 characters). */\nconst azureListed = pullRequestPresenceOf(['reviews', 'reviewRequests', 'mergeable'], azureUnavailable);\n/** The batch reads fetch each pull request by id, which returns the whole description. */\nconst azureById = pullRequestPresenceOf(['description', 'reviews', 'reviewRequests', 'mergeable'], azureUnavailable);\n\nconst azurePullRequests: PresenceTable<PullRequestProjection, PullRequestFieldGroup> = {\n\t// GitLens' own converter, which leaves the description off the row.\n\tpoint: azureListed,\n\tsearch: azureListed,\n\t'text-search': azureListed,\n\taccount: azureListed,\n\t'account-summary': azureListed,\n\trepos: azureListed,\n\t'repos-summary': azureListed,\n\tbatch: azureById,\n};\n\nconst azureServerPullRequests: PresenceTable<PullRequestProjection, PullRequestFieldGroup> = {\n\t...azurePullRequests,\n\t'search-summary': azureListed,\n};\n\n/**\n * Bitbucket pull requests have no assignees or reactions. Neither provider-apis nor GitLens reads their build\n * statuses or mergeability: provider-apis fills a literal Mergeable, and GitLens' own converters leave it unset.\n */\nconst bitbucketUnavailable: readonly PullRequestFieldGroup[] = ['assignees', 'reactions', 'stack'];\nconst bitbucketProviderApis = pullRequestPresenceOf(\n\t['description', 'reviews', 'reviewRequests', 'comments'],\n\tbitbucketUnavailable,\n);\n\nconst bitbucketPullRequests: PresenceTable<PullRequestProjection, PullRequestFieldGroup> = {\n\t// GitLens' own converter, which drops the comment count. The commit read selects `+values.*`, which isn't\n\t// known to bring the participants the reviews come from, as the other two point reads do.\n\tpoint: pullRequestPresenceOf(['description'], bitbucketUnavailable),\n\tsearch: bitbucketProviderApis,\n\t'text-search': bitbucketProviderApis,\n\taccount: bitbucketProviderApis,\n\t'account-summary': bitbucketProviderApis,\n\trepos: bitbucketProviderApis,\n\t'repos-summary': bitbucketProviderApis,\n\t// GitLens' own converter over reads that do select the participants.\n\tbatch: pullRequestPresenceOf(['description', 'reviews', 'reviewRequests'], bitbucketUnavailable),\n};\n\n/** provider-apis' and GitLens' own Data Center converters read the same fields. */\nconst bitbucketServerAll = pullRequestPresenceOf(\n\t['description', 'reviews', 'reviewRequests', 'comments'],\n\tbitbucketUnavailable,\n);\nconst bitbucketServerPullRequests: PresenceTable<PullRequestProjection, PullRequestFieldGroup> = {\n\tpoint: bitbucketServerAll,\n\tsearch: bitbucketServerAll,\n\t'search-summary': bitbucketServerAll,\n\t'text-search': bitbucketServerAll,\n\taccount: bitbucketServerAll,\n\t'account-summary': bitbucketServerAll,\n\trepos: bitbucketServerAll,\n\t'repos-summary': bitbucketServerAll,\n\tbatch: bitbucketServerAll,\n};\n\n/**\n * provider-apis' GitLab issue reads (GraphQL, and REST for the account-wide one). The repository's access isn't read.\n * The GraphQL comment count is nullable like the merge request's, and passed through, so only GitLab.com's is\n * promised; the REST one is always a number.\n */\nfunction gitLabIssuesFor(comments: boolean): PresenceTable<IssueProjection, IssueFieldGroup> {\n\tconst graphQL = issuePresenceOf([\n\t\t'description',\n\t\t'assignees',\n\t\t'labels',\n\t\t'reactions',\n\t\t...(comments ? (['comments'] as const) : []),\n\t]);\n\treturn {\n\t\tpoint: graphQL,\n\t\taccount: issuePresenceOf(['description', 'assignees', 'labels', 'comments', 'reactions']),\n\t\trepos: graphQL,\n\t\tbatch: graphQL,\n\t};\n}\n\n/**\n * Azure DevOps work items have no reactions (provider-apis' converter fills 0; GitLens' leaves it unset) and belong to\n * a project, not a repository.\n */\nconst azureWorkItemUnavailable: readonly IssueFieldGroup[] = ['reactions', 'access'];\n/** provider-apis' work item converter, and GitLens' copy of it for the batch read. */\nconst azureWorkItem = issuePresenceOf(['description', 'assignees', 'labels', 'comments'], azureWorkItemUnavailable);\n/** GitLens' own work item converter, which drops the tags. */\nconst azureOwnWorkItem = issuePresenceOf(['description', 'assignees', 'comments'], azureWorkItemUnavailable);\n\nconst azureIssues: PresenceTable<IssueProjection, IssueFieldGroup> = {\n\tpoint: azureOwnWorkItem,\n\taccount: azureWorkItem,\n\trepos: azureWorkItem,\n\tbatch: azureWorkItem,\n};\n\nconst azureServerIssues: PresenceTable<IssueProjection, IssueFieldGroup> = {\n\t...azureIssues,\n\tsearch: azureOwnWorkItem,\n};\n\n/**\n * Bitbucket Cloud's legacy issues, which only the host's own `getIssue` and `searchMyIssues` read. They have no\n * labels, their votes aren't reactions, and neither a comment count nor the repository's access is read.\n */\nconst bitbucketIssue = issuePresenceOf(['description', 'assignees'], ['labels', 'reactions']);\nconst bitbucketIssues: PresenceTable<IssueProjection, IssueFieldGroup> = {\n\tpoint: bitbucketIssue,\n\taccount: bitbucketIssue,\n};\n\n/**\n * Tracker issues belong to no repository, and a tracker's votes aren't reactions (and read 0 where voting is off), so\n * neither group can be supplied.\n */\nconst trackerUnavailable: readonly IssueFieldGroup[] = ['reactions', 'access'];\n/**\n * provider-apis' Jira converter counts the comments embedded in the issue, which Jira may cap, rather than reading\n * their total.\n */\nconst jiraProviderApis = issuePresenceOf(['description', 'assignees', 'labels'], trackerUnavailable);\n\nconst jiraIssues: PresenceTable<IssueProjection, IssueFieldGroup> = {\n\tpoint: jiraProviderApis,\n\taccount: jiraProviderApis,\n\tproject: jiraProviderApis,\n\t// GitLens' own by-key read, which reads the comment total.\n\tbatch: issuePresenceOf(['description', 'assignees', 'labels', 'comments'], trackerUnavailable),\n};\n\nconst jiraServerIssues: PresenceTable<IssueProjection, IssueFieldGroup> = {\n\t...jiraIssues,\n\tbatch: jiraProviderApis,\n};\n\n/** provider-apis' Linear fragment selects no labels (it fills an empty list), comments or reactions. */\nconst linearIssue = issuePresenceOf(['description', 'assignees'], ['access']);\nconst linearIssues: PresenceTable<IssueProjection, IssueFieldGroup> = {\n\tpoint: linearIssue,\n\taccount: linearIssue,\n\tproject: linearIssue,\n\tbatch: linearIssue,\n};\n\n/** A Trello card's description is never read; its members are its assignees. */\nconst trelloCard = issuePresenceOf(['assignees', 'labels', 'comments'], trackerUnavailable);\nconst trelloIssues: PresenceTable<IssueProjection, IssueFieldGroup> = {\n\tpoint: trelloCard,\n\tproject: trelloCard,\n};\n\nconst pullRequestPresence = new Map<string, PresenceTable<PullRequestProjection, PullRequestFieldGroup>>([\n\t[GitCloudHostIntegrationId.GitHub, gitHubPullRequests],\n\t[GitSelfManagedHostIntegrationId.CloudGitHubEnterprise, gitHubEnterprisePullRequests],\n\t[GitCloudHostIntegrationId.GitLab, gitLabPullRequestsFor(gitLabProviderApis(true))],\n\t[GitSelfManagedHostIntegrationId.CloudGitLabSelfHosted, gitLabPullRequestsFor(gitLabProviderApis(false))],\n\t[GitCloudHostIntegrationId.AzureDevOps, azurePullRequests],\n\t[GitSelfManagedHostIntegrationId.AzureDevOpsServer, azureServerPullRequests],\n\t[GitCloudHostIntegrationId.Bitbucket, bitbucketPullRequests],\n\t[GitSelfManagedHostIntegrationId.BitbucketServer, bitbucketServerPullRequests],\n]);\n\nconst issuePresence = new Map<string, PresenceTable<IssueProjection, IssueFieldGroup>>([\n\t[GitCloudHostIntegrationId.GitHub, gitHubIssues],\n\t[GitSelfManagedHostIntegrationId.CloudGitHubEnterprise, gitHubIssues],\n\t[GitCloudHostIntegrationId.GitLab, gitLabIssuesFor(true)],\n\t[GitSelfManagedHostIntegrationId.CloudGitLabSelfHosted, gitLabIssuesFor(false)],\n\t[GitCloudHostIntegrationId.AzureDevOps, azureIssues],\n\t[GitSelfManagedHostIntegrationId.AzureDevOpsServer, azureServerIssues],\n\t[GitCloudHostIntegrationId.Bitbucket, bitbucketIssues],\n\t[IssuesCloudHostIntegrationId.Jira, jiraIssues],\n\t[IssuesSelfManagedHostIntegrationId.JiraServer, jiraServerIssues],\n\t[IssuesCloudHostIntegrationId.Linear, linearIssues],\n\t[IssuesCloudHostIntegrationId.Trello, trelloIssues],\n]);\n\nfunction lookup<P extends string, G extends string>(\n\ttables: ReadonlyMap<string, PresenceTable<P, G>>,\n\tproviderId: string,\n\tprojection: P | undefined,\n): Presence<G> | undefined {\n\tif (projection == null) return undefined;\n\n\tconst table = tables.get(providerId);\n\t// `hasOwn` so a projection read off an untrusted row can't resolve to an `Object.prototype` member.\n\treturn table != null && Object.hasOwn(table, projection) ? table[projection] : undefined;\n}\n\n/**\n * Which field groups the read that produced `pr` fetched, keyed by its provider and {@link PullRequestShape.projection}.\n * `undefined` when either is unknown or the provider has no table yet — then nothing can be said about any field.\n */\nexport function getPullRequestFieldPresence(\n\tpr: PullRequestShape,\n): Readonly<Record<PullRequestFieldGroup, FieldPresence>> | undefined {\n\treturn lookup(pullRequestPresence, pr.provider.id, pr.projection);\n}\n\n/**\n * Which field groups the read that produced `issue` fetched, keyed by its provider and {@link IssueShape.projection}.\n * `undefined` when either is unknown or the provider has no table yet — then nothing can be said about any field.\n */\nexport function getIssueFieldPresence(issue: IssueShape): Readonly<Record<IssueFieldGroup, FieldPresence>> | undefined {\n\treturn lookup(issuePresence, issue.provider.id, issue.projection);\n}\n"],"mappings":";;AA2EA,MAAM,yBAA2D;CAChE;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD;AAEA,MAAM,mBAA+C;CACpD;CACA;CACA;CACA;CACA;CACA;AACD;;AAGA,SAAS,WACR,QACA,SACA,cAA4B,CAAC,GACf;CACd,OAAO,OAAO,OACb,OAAO,YACN,OAAO,KACN,UACC,CACC,OACA,QAAQ,SAAS,KAAK,IACnB,YACA,YAAY,SAAS,KAAK,IACzB,gBACA,eACL,CACF,CACD,CACD;AACD;AAEA,SAAS,sBACR,SACA,aACkC;CAClC,OAAO,WAAW,wBAAwB,SAAS,WAAW;AAC/D;AAEA,SAAS,gBACR,SACA,aAC4B;CAC5B,OAAO,WAAW,kBAAkB,SAAS,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AAED,MAAM,gCAAgB,IAAI,IAA6D;CACtF,CAAA,UAAmC,YAAY;CAC/C,CAAA,2BAAwD,YAAY;CACpE,CAAA,UAAmC,gBAAgB,IAAI,CAAC;CACxD,CAAA,4BAAwD,gBAAgB,KAAK,CAAC;CAC9E,CAAA,eAAwC,WAAW;CACnD,CAAA,uBAAoD,iBAAiB;CACrE,CAAA,aAAsC,eAAe;CACrD,CAAA,QAAoC,UAAU;CAC9C,CAAA,eAAgD,gBAAgB;CAChE,CAAA,UAAsC,YAAY;CAClD,CAAA,UAAsC,YAAY;AACnD,CAAC;AAED,SAAS,OACR,QACA,YACA,YAC0B;CAC1B,IAAI,cAAc,MAAM,OAAO,KAAA;CAE/B,MAAM,QAAQ,OAAO,IAAI,UAAU;CAEnC,OAAO,SAAS,QAAQ,OAAO,OAAO,OAAO,UAAU,IAAI,MAAM,cAAc,KAAA;AAChF;;;;;AAMA,SAAgB,4BACf,IACqE;CACrE,OAAO,OAAO,qBAAqB,GAAG,SAAS,IAAI,GAAG,UAAU;AACjE;;;;;AAMA,SAAgB,sBAAsB,OAAiF;CACtH,OAAO,OAAO,eAAe,MAAM,SAAS,IAAI,MAAM,UAAU;AACjE"}
@@ -118,7 +118,25 @@ export interface IssueEtagFields {
118
118
  updatedDate: Date;
119
119
  /** Counts only when `'reactions'` is requested, and only from a row whose read fetched reactions. */
120
120
  thumbsUpCount?: number;
121
+ /**
122
+ * Azure DevOps only: the version of the rule a work item's body is read by ({@link azureWorkItemDescriptionRule}).
123
+ * A change of rule changes the body without moving `updatedDate`, so a row read under an earlier one must not
124
+ * compare unchanged.
125
+ */
126
+ descriptionRule?: number;
121
127
  }
128
+ /**
129
+ * {@link IssueEtagFields.descriptionRule}: the version of the rule an Azure DevOps work item's body is read by, stamped
130
+ * on both sides of its etag. Bumped whenever the rule changes which field a work item's body comes from, so every row
131
+ * a caller holds from before is read in full once. 1: the first rich text field with content (provider-apis'
132
+ * `getAzureWorkItemDescription`), where it used to be only Description. The rule lives in provider-apis, so a bump of
133
+ * that package that changes it must bump this too; the etag tests pin the rule to catch one.
134
+ *
135
+ * It can't cover a row whose read found the organization's field catalog unavailable: that row's body falls back to
136
+ * the built-in fields, and a cheap check, which reads no body, can't tell it from a complete one, so it stays as read
137
+ * until the work item changes.
138
+ */
139
+ export declare const azureWorkItemDescriptionRule = 1;
122
140
  /** A batch read's target, in the form its provider addresses it by: a repository coordinate, or a tracker's resource. */
123
141
  type BatchTarget = {
124
142
  owner: string;
@@ -56,6 +56,18 @@ function toRevisionReviewers(reviewers) {
56
56
  /** Every {@link IssueEtagInclude}, in the canonical order an etag lists them in. */
57
57
  const issueEtagIncludes = ["reactions"];
58
58
  /**
59
+ * {@link IssueEtagFields.descriptionRule}: the version of the rule an Azure DevOps work item's body is read by, stamped
60
+ * on both sides of its etag. Bumped whenever the rule changes which field a work item's body comes from, so every row
61
+ * a caller holds from before is read in full once. 1: the first rich text field with content (provider-apis'
62
+ * `getAzureWorkItemDescription`), where it used to be only Description. The rule lives in provider-apis, so a bump of
63
+ * that package that changes it must bump this too; the etag tests pin the rule to catch one.
64
+ *
65
+ * It can't cover a row whose read found the organization's field catalog unavailable: that row's body falls back to
66
+ * the built-in fields, and a cheap check, which reads no body, can't tell it from a complete one, so it stays as read
67
+ * until the work item changes.
68
+ */
69
+ const azureWorkItemDescriptionRule = 1;
70
+ /**
59
71
  * The scope a batch read records a refused target under. It is decided here rather than in the read, which has the
60
72
  * same targets, because naming the refusal's cause (`describeRefusal`) needs it too. Azure DevOps: the organization
61
73
  * and project, since its refusals come from those (an organization's OAuth policy or tenant, a project's permissions)
@@ -950,6 +962,6 @@ __decorate([trace()], IntegrationBase.prototype, "getLinkedIssueOrPullRequest",
950
962
  __decorate([trace()], IntegrationBase.prototype, "getIssueResultCore", null);
951
963
  __decorate([trace()], IntegrationBase.prototype, "getPullRequest", null);
952
964
  //#endregion
953
- export { IntegrationBase, ReadSessionFailure, isReadSessionFailure, issueEtagIncludes, pullRequestEtagIncludes, pullRequestRevision };
965
+ export { IntegrationBase, ReadSessionFailure, azureWorkItemDescriptionRule, isReadSessionFailure, issueEtagIncludes, pullRequestEtagIncludes, pullRequestRevision };
954
966
 
955
967
  //# sourceMappingURL=integration.js.map