@gitkraken/core-gitlens 0.54.0 → 0.56.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 (83) hide show
  1. package/CHANGELOG.md +21 -1
  2. package/dist/git/cache.js +3 -0
  3. package/dist/git/cache.js.map +1 -1
  4. package/dist/git/models/pullRequest.d.ts +14 -0
  5. package/dist/git/models/pullRequest.js.map +1 -1
  6. package/dist/git/utils/pullRequest.utils.d.ts +3 -1
  7. package/dist/git/utils/pullRequest.utils.js +9 -1
  8. package/dist/git/utils/pullRequest.utils.js.map +1 -1
  9. package/dist/git-cli/providers/pausedOperations.d.ts +2 -0
  10. package/dist/git-cli/providers/pausedOperations.js +104 -40
  11. package/dist/git-cli/providers/pausedOperations.js.map +1 -1
  12. package/dist/plus/git-github/api/github.d.ts +2 -0
  13. package/dist/plus/git-github/api/github.js +16 -6
  14. package/dist/plus/git-github/api/github.js.map +1 -1
  15. package/dist/plus/git-github/api/pullRequestSearchQuery.d.ts +1 -0
  16. package/dist/plus/git-github/api/pullRequestSearchQuery.js +29 -5
  17. package/dist/plus/git-github/api/pullRequestSearchQuery.js.map +1 -1
  18. package/dist/plus/integrations/fieldPresence.d.ts +3 -0
  19. package/dist/plus/integrations/fieldPresence.js +7 -1
  20. package/dist/plus/integrations/fieldPresence.js.map +1 -1
  21. package/dist/plus/integrations/index.d.ts +3 -2
  22. package/dist/plus/integrations/index.js.map +1 -1
  23. package/dist/plus/integrations/integrationService.d.ts +11 -2
  24. package/dist/plus/integrations/integrationService.js +75 -3
  25. package/dist/plus/integrations/integrationService.js.map +1 -1
  26. package/dist/plus/integrations/manager.d.ts +17 -2
  27. package/dist/plus/integrations/models/bitbucketPullRequestWrites.d.ts +217 -0
  28. package/dist/plus/integrations/models/bitbucketPullRequestWrites.js +0 -0
  29. package/dist/plus/integrations/models/integration.d.ts +2 -1
  30. package/dist/plus/integrations/models/integration.js +6 -0
  31. package/dist/plus/integrations/models/integration.js.map +1 -1
  32. package/dist/plus/integrations/models/publicIntegration.d.ts +1 -0
  33. package/dist/plus/integrations/models/pullRequestReads.d.ts +2 -0
  34. package/dist/plus/integrations/providers/azure/writeIdentity.d.ts +0 -3
  35. package/dist/plus/integrations/providers/azure/writeIdentity.js +4 -12
  36. package/dist/plus/integrations/providers/azure/writeIdentity.js.map +1 -1
  37. package/dist/plus/integrations/providers/azureDevOps.d.ts +0 -2
  38. package/dist/plus/integrations/providers/azureDevOps.js +1 -7
  39. package/dist/plus/integrations/providers/azureDevOps.js.map +1 -1
  40. package/dist/plus/integrations/providers/azurePullRequestWrites.js +24 -26
  41. package/dist/plus/integrations/providers/azurePullRequestWrites.js.map +1 -1
  42. package/dist/plus/integrations/providers/azureWorkItemWriteErrors.js +4 -3
  43. package/dist/plus/integrations/providers/azureWorkItemWriteErrors.js.map +1 -1
  44. package/dist/plus/integrations/providers/azureWorkItemWrites.js +22 -21
  45. package/dist/plus/integrations/providers/azureWorkItemWrites.js.map +1 -1
  46. package/dist/plus/integrations/providers/bitbucket.d.ts +4 -0
  47. package/dist/plus/integrations/providers/bitbucket.js +8 -0
  48. package/dist/plus/integrations/providers/bitbucket.js.map +1 -1
  49. package/dist/plus/integrations/providers/bitbucketPullRequestWriteErrors.d.ts +13 -0
  50. package/dist/plus/integrations/providers/bitbucketPullRequestWriteErrors.js +88 -0
  51. package/dist/plus/integrations/providers/bitbucketPullRequestWriteErrors.js.map +1 -0
  52. package/dist/plus/integrations/providers/bitbucketPullRequestWriteLedger.d.ts +14 -0
  53. package/dist/plus/integrations/providers/bitbucketPullRequestWriteLedger.js +36 -0
  54. package/dist/plus/integrations/providers/bitbucketPullRequestWriteLedger.js.map +1 -0
  55. package/dist/plus/integrations/providers/bitbucketPullRequestWrites.d.ts +47 -0
  56. package/dist/plus/integrations/providers/bitbucketPullRequestWrites.js +795 -0
  57. package/dist/plus/integrations/providers/bitbucketPullRequestWrites.js.map +1 -0
  58. package/dist/plus/integrations/providers/issueSorts.d.ts +1 -0
  59. package/dist/plus/integrations/providers/metadata.js +6 -3
  60. package/dist/plus/integrations/providers/metadata.js.map +1 -1
  61. package/dist/plus/integrations/providers/providersApi.d.ts +4 -0
  62. package/dist/plus/integrations/providers/providersApi.js +5 -0
  63. package/dist/plus/integrations/providers/providersApi.js.map +1 -1
  64. package/dist/plus/integrations/providers/utils/writeInputs.d.ts +7 -0
  65. package/dist/plus/integrations/providers/utils/writeInputs.js +17 -0
  66. package/dist/plus/integrations/providers/utils/writeInputs.js.map +1 -0
  67. package/dist/plus/integrations/reads/drains.d.ts +1 -0
  68. package/dist/plus/integrations/reads/filters.js +13 -1
  69. package/dist/plus/integrations/reads/filters.js.map +1 -1
  70. package/dist/plus/integrations/reads/pullRequestBatch.js +3 -3
  71. package/dist/plus/integrations/reads/pullRequestBatch.js.map +1 -1
  72. package/dist/plus/integrations/reads/searchPullRequests.d.ts +3 -3
  73. package/dist/plus/integrations/reads/searchPullRequests.js +4 -3
  74. package/dist/plus/integrations/reads/searchPullRequests.js.map +1 -1
  75. package/dist/plus/integrations/reads/sweeps.js +20 -6
  76. package/dist/plus/integrations/reads/sweeps.js.map +1 -1
  77. package/dist/plus/integrations/reads/warnings.d.ts +1 -0
  78. package/dist/plus/integrations/reads/warnings.js +7 -2
  79. package/dist/plus/integrations/reads/warnings.js.map +1 -1
  80. package/dist/plus/integrations/results.d.ts +7 -0
  81. package/dist/plus/integrations/results.js.map +1 -1
  82. package/docs/integrations.md +188 -1
  83. package/package.json +1 -1
@@ -39,5 +39,6 @@ export declare function toGitHubPullRequestSortQualifier(sort: PullRequestSortin
39
39
  * An omitted relationship is the explicitly unfiltered repository/organization scope, never `involves:@me`.
40
40
  */
41
41
  export declare function toGitHubPullRequestSearchFacets(criteria: PullRequestSearchCriteria | undefined): GitHubPullRequestSearchFacet[];
42
+ export declare function toGitHubPullRequestOpenCountQualifiers(criteria: PullRequestSearchCriteria | undefined): string[] | undefined;
42
43
  //#endregion
43
44
  //# sourceMappingURL=pullRequestSearchQuery.d.ts.map
@@ -1,4 +1,5 @@
1
- import "../../../git/models/pullRequest.js";
1
+ import { defaultPullRequestSort } from "../../../git/models/pullRequest.js";
2
+ import { effectivePullRequestSearchSort, isValidPullRequestChangedSince } from "../../../git/utils/pullRequest.utils.js";
2
3
  import { sanitizeGitHubQualifierValue, sanitizeGitHubSearchText } from "./issueSearchQuery.js";
3
4
  //#region ../plus/git-github/src/api/pullRequestSearchQuery.ts
4
5
  /**
@@ -70,10 +71,12 @@ function stateQualifiers(state) {
70
71
  */
71
72
  function toGitHubPullRequestSearchFacets(criteria) {
72
73
  const relationships = criteria?.relationships?.length ? [...new Set(criteria.relationships)] : [void 0];
73
- const requestedStates = criteria?.states?.length ? [...new Set(criteria.states)] : ["open"];
74
+ const changedSince = criteria?.changedSince;
75
+ if (criteria != null && changedSince != null) assertGitHubChangedSinceCriteria(changedSince, criteria, relationships.length);
76
+ const requestedStates = criteria?.states?.length ? [...new Set(criteria.states)] : [changedSince != null ? "all" : "open"];
74
77
  const states = requestedStates.includes("all") ? ["all"] : requestedStates;
75
78
  const text = criteria?.text != null ? sanitizeGitHubSearchText(criteria.text) : "";
76
- const sort = criteria?.sort ?? "updated:desc";
79
+ const sort = effectivePullRequestSearchSort(criteria);
77
80
  const sortQualifier = toGitHubPullRequestSortQualifier(sort);
78
81
  if (sortQualifier == null) throw new Error(`GitHub cannot order a pull request search by '${sort}'`);
79
82
  const dateQualifiers = [];
@@ -82,7 +85,7 @@ function toGitHubPullRequestSearchFacets(criteria) {
82
85
  const sanitized = sanitizeGitHubQualifierValue(value);
83
86
  if (sanitized.length > 0) dateQualifiers.push(toQualifier(sanitized));
84
87
  };
85
- pushDate(criteria?.updatedAfter, (v) => `updated:>=${v}`);
88
+ pushDate(changedSince != null ? laterUpdatedBound(criteria?.updatedAfter, changedSince) : criteria?.updatedAfter, (v) => `updated:>=${v}`);
86
89
  pushDate(criteria?.createdAfter, (v) => `created:>=${v}`);
87
90
  return relationships.flatMap((relationship) => states.map((state) => ({
88
91
  alias: `${relationship != null ? relationshipAlias[relationship] : "scope"}${stateAlias[state]}`,
@@ -98,7 +101,28 @@ function toGitHubPullRequestSearchFacets(criteria) {
98
101
  ]
99
102
  })));
100
103
  }
104
+ function toGitHubPullRequestOpenCountQualifiers(criteria) {
105
+ if (criteria?.changedSince == null) return void 0;
106
+ const [facet] = toGitHubPullRequestSearchFacets({
107
+ ...criteria,
108
+ states: ["open"],
109
+ sort: void 0,
110
+ changedSince: void 0
111
+ });
112
+ const sortQualifier = toGitHubPullRequestSortQualifier(defaultPullRequestSort);
113
+ return facet.qualifiers.filter((q) => q !== sortQualifier);
114
+ }
115
+ function assertGitHubChangedSinceCriteria(changedSince, criteria, relationshipCount) {
116
+ if (!isValidPullRequestChangedSince(changedSince)) throw new Error(`GitHub cannot search pull requests changed since '${changedSince}'`);
117
+ if (criteria.states?.length && criteria.states.some((s) => s !== "all")) throw new Error("GitHub cannot search pull requests changed since a time in only some states");
118
+ if (criteria.sort != null && criteria.sort !== "updated:asc") throw new Error(`GitHub cannot order pull requests changed since a time by '${criteria.sort}'`);
119
+ if (relationshipCount > 1) throw new Error("GitHub cannot count the open pull requests of several relationships");
120
+ }
121
+ function laterUpdatedBound(updatedAfter, changedSince) {
122
+ if (updatedAfter == null) return changedSince;
123
+ return Date.parse(updatedAfter) > Date.parse(changedSince) ? updatedAfter : changedSince;
124
+ }
101
125
  //#endregion
102
- export { gitHubPullRequestRelationshipQualifiers, gitHubPullRequestSortQualifiers, toGitHubPullRequestSearchFacets, toGitHubPullRequestSortQualifier };
126
+ export { gitHubPullRequestRelationshipQualifiers, gitHubPullRequestSortQualifiers, toGitHubPullRequestOpenCountQualifiers, toGitHubPullRequestSearchFacets, toGitHubPullRequestSortQualifier };
103
127
 
104
128
  //# sourceMappingURL=pullRequestSearchQuery.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"pullRequestSearchQuery.js","names":[],"sources":["../../../../../plus/git-github/src/api/pullRequestSearchQuery.ts"],"sourcesContent":["import type {\n\tPullRequestSearchCriteria,\n\tPullRequestSorting,\n\tPullRequestStateFilter,\n} from '@gitlens/git/models/pullRequest.js';\nimport { defaultPullRequestSort, PullRequestFilter } from '@gitlens/git/models/pullRequest.js';\nimport { sanitizeGitHubQualifierValue, sanitizeGitHubSearchText } from './issueSearchQuery.js';\n\nexport type GitHubPullRequestSearchFacet = {\n\t/** Stable GraphQL alias and composite-cursor key. */\n\talias: string;\n\tqualifiers: string[];\n};\n\n/**\n * The GitHub search qualifier each relationship translates to. Exhaustive over `PullRequestFilter` so a new\n * member can't be silently unmapped.\n *\n * Exported because the account-wide read builds its own facets from the same vocabulary (see\n * `GitHubIntegrationBase.getProviderMyPullRequestsForUser`). Kept as ONE declaration rather than a copy per\n * caller: the exhaustive `Record` makes a missing key a compile error, but nothing would catch two copies\n * disagreeing on a qualifier STRING, and a wrong qualifier is a read that quietly answers a different question.\n */\nexport const gitHubPullRequestRelationshipQualifiers: Record<PullRequestFilter, string> = {\n\t[PullRequestFilter.Author]: 'author:@me',\n\t[PullRequestFilter.Assignee]: 'assignee:@me',\n\t[PullRequestFilter.ReviewRequested]: 'review-requested:@me',\n\t[PullRequestFilter.Reviewed]: 'reviewed-by:@me',\n\t[PullRequestFilter.Mention]: 'mentions:@me',\n};\n\nconst relationshipAlias: Record<PullRequestFilter, string> = {\n\t[PullRequestFilter.Author]: 'author',\n\t[PullRequestFilter.Assignee]: 'assignee',\n\t[PullRequestFilter.ReviewRequested]: 'reviewRequested',\n\t[PullRequestFilter.Reviewed]: 'reviewed',\n\t[PullRequestFilter.Mention]: 'mention',\n};\n\nconst stateAlias: Record<PullRequestStateFilter, string> = {\n\topen: 'Open',\n\tclosed: 'Closed',\n\tmerged: 'Merged',\n\tall: 'All',\n};\n\n/**\n * How each orderable key becomes a GitHub `sort:` qualifier.\n *\n * A literal `Record` over the union rather than a derived transform, for the same reason the relationship tables\n * are: adding a sort field without deciding its qualifier fails the build instead of quietly emitting a search\n * with no ordering constraint — the one failure mode the ordering contract exists to prevent, and the one a\n * caller cannot detect from the result.\n *\n * `updated:desc` maps to the bare `sort:updated`, not `sort:updated-desc`. The two are the same query to GitHub,\n * but the bare form is what this read has always emitted, so keeping it makes the default byte-identical to\n * today's query — matching `toGitHubIssueSortQualifier`. Do not \"normalize\" it.\n */\nexport const gitHubPullRequestSortQualifiers: Partial<Record<PullRequestSorting, string>> = {\n\t'created:asc': 'sort:created-asc',\n\t'created:desc': 'sort:created-desc',\n\t'updated:asc': 'sort:updated-asc',\n\t'updated:desc': 'sort:updated',\n};\n\n/** The `sort:` qualifier for a key, or `undefined` when there is no key or GitHub can't express it. */\nexport function toGitHubPullRequestSortQualifier(sort: PullRequestSorting | undefined): string | undefined {\n\treturn sort != null ? gitHubPullRequestSortQualifiers[sort] : undefined;\n}\n\nfunction stateQualifiers(state: PullRequestStateFilter): string[] {\n\tswitch (state) {\n\t\tcase 'closed':\n\t\t\t// GitHub's `is:closed` includes merged PRs; `is:unmerged` removes that subset.\n\t\t\treturn ['is:closed', 'is:unmerged'];\n\t\tcase 'merged':\n\t\t\treturn ['is:merged'];\n\t\tcase 'all':\n\t\t\treturn [];\n\t\tcase 'open':\n\t\t\treturn ['is:open'];\n\t}\n}\n\n/**\n * Translates provider-neutral PR criteria into the independent GitHub searches whose union answers the request.\n *\n * GitHub's API search syntax ANDs repeated relationship/state qualifiers and does not implement the boolean\n * groups accepted by the newer web UI. Each requested relationship × state pair therefore becomes one GraphQL\n * alias; the API client sends every active alias in a single document, preserving one HTTP request per page.\n * An omitted relationship is the explicitly unfiltered repository/organization scope, never `involves:@me`.\n */\nexport function toGitHubPullRequestSearchFacets(\n\tcriteria: PullRequestSearchCriteria | undefined,\n): GitHubPullRequestSearchFacet[] {\n\tconst relationships: (PullRequestFilter | undefined)[] = criteria?.relationships?.length\n\t\t? [...new Set(criteria.relationships)]\n\t\t: [undefined];\n\tconst requestedStates: PullRequestStateFilter[] = criteria?.states?.length\n\t\t? [...new Set(criteria.states)]\n\t\t: ['open'];\n\tconst states: PullRequestStateFilter[] = requestedStates.includes('all') ? ['all'] : requestedStates;\n\tconst text = criteria?.text != null ? sanitizeGitHubSearchText(criteria.text) : '';\n\t// Ordering is part of the contract, not an option: without an explicit `sort:` GitHub answers in relevance\n\t// order, so which rows land inside the result ceiling would shift with its ranking even when nothing changed\n\t// upstream. A key GitHub can't express is REFUSED here, not approximated with a fallback order — a silent\n\t// `sort:updated` substitute would emit one order in the query while the merged-page comparator applied another\n\t// (or none for an unknown field), which is exactly the \"the N most recent are what you get\" promise the ceiling\n\t// contract cannot keep under a guessed order. Unreachable through the facade — every key is validated against\n\t// `githubPullRequestSearchCapabilities.sorts` first — so this guards the direct callers of this exported builder\n\t// and of `GitHubApi.searchPullRequestsPage`.\n\t//\n\t// Deliberately STRICTER than the issue path, which drops an inexpressible qualifier and searches on\n\t// (`toGitHubIssueSearchQualifiers` pushes `toGitHubIssueSortQualifier`'s result only when it is non-null). The\n\t// two reads differ in what that costs: an issue search is served by whichever facets the provider ordered, while\n\t// this one hands its merged page to `getPullRequestComparator`, so a dropped qualifier here means the query and\n\t// the comparator disagree about the order the ceiling was applied under. Refusing is the only answer that\n\t// cannot lie about which rows were reachable.\n\tconst sort = criteria?.sort ?? defaultPullRequestSort;\n\tconst sortQualifier = toGitHubPullRequestSortQualifier(sort);\n\tif (sortQualifier == null) {\n\t\tthrow new Error(`GitHub cannot order a pull request search by '${sort}'`);\n\t}\n\n\t// Facet-independent, unlike the relationship/state qualifiers below — build once and share.\n\tconst dateQualifiers: string[] = [];\n\tconst pushDate = (value: string | undefined, toQualifier: (sanitized: string) => string): void => {\n\t\tif (value == null) return;\n\n\t\tconst sanitized = sanitizeGitHubQualifierValue(value);\n\t\tif (sanitized.length > 0) {\n\t\t\tdateQualifiers.push(toQualifier(sanitized));\n\t\t}\n\t};\n\tpushDate(criteria?.updatedAfter, v => `updated:>=${v}`);\n\tpushDate(criteria?.createdAfter, v => `created:>=${v}`);\n\n\treturn relationships.flatMap(relationship =>\n\t\tstates.map(state => ({\n\t\t\talias: `${relationship != null ? relationshipAlias[relationship] : 'scope'}${stateAlias[state]}`,\n\t\t\tqualifiers: [\n\t\t\t\t'is:pr',\n\t\t\t\t...(relationship != null ? [gitHubPullRequestRelationshipQualifiers[relationship]] : []),\n\t\t\t\t...stateQualifiers(state),\n\t\t\t\t// `!= null`, not truthy: `draft:false` narrows to ready-for-review PRs just as `draft:true` narrows to drafts.\n\t\t\t\t...(criteria?.draft != null ? [`draft:${criteria.draft}`] : []),\n\t\t\t\t...(criteria?.includeArchived === true ? [] : ['archived:false']),\n\t\t\t\t...(text.length > 0 ? [text] : []),\n\t\t\t\t...dateQualifiers,\n\t\t\t\tsortQualifier,\n\t\t\t],\n\t\t})),\n\t);\n}\n"],"mappings":";;;;;;;;;;;;AAuBA,MAAa,0CAA6E;EAC7D,WAAA;EACE,aAAA;EACO,qBAAA;EACP,gBAAA;EACD,YAAA;AAC9B;AAEA,MAAM,oBAAuD;EAChC,WAAA;EACE,aAAA;EACO,qBAAA;EACP,gBAAA;EACD,YAAA;AAC9B;AAEA,MAAM,aAAqD;CAC1D,MAAM;CACN,QAAQ;CACR,QAAQ;CACR,KAAK;AACN;;;;;;;;;;;;;AAcA,MAAa,kCAA+E;CAC3F,eAAe;CACf,gBAAgB;CAChB,eAAe;CACf,gBAAgB;AACjB;;AAGA,SAAgB,iCAAiC,MAA0D;CAC1G,OAAO,QAAQ,OAAO,gCAAgC,QAAQ,KAAA;AAC/D;AAEA,SAAS,gBAAgB,OAAyC;CACjE,QAAQ,OAAR;EACC,KAAK,UAEJ,OAAO,CAAC,aAAa,aAAa;EACnC,KAAK,UACJ,OAAO,CAAC,WAAW;EACpB,KAAK,OACJ,OAAO,CAAC;EACT,KAAK,QACJ,OAAO,CAAC,SAAS;CACnB;AACD;;;;;;;;;AAUA,SAAgB,gCACf,UACiC;CACjC,MAAM,gBAAmD,UAAU,eAAe,SAC/E,CAAC,GAAG,IAAI,IAAI,SAAS,aAAa,CAAC,IACnC,CAAC,KAAA,CAAS;CACb,MAAM,kBAA4C,UAAU,QAAQ,SACjE,CAAC,GAAG,IAAI,IAAI,SAAS,MAAM,CAAC,IAC5B,CAAC,MAAM;CACV,MAAM,SAAmC,gBAAgB,SAAS,KAAK,IAAI,CAAC,KAAK,IAAI;CACrF,MAAM,OAAO,UAAU,QAAQ,OAAO,yBAAyB,SAAS,IAAI,IAAI;CAgBhF,MAAM,OAAO,UAAU,QAAA;CACvB,MAAM,gBAAgB,iCAAiC,IAAI;CAC3D,IAAI,iBAAiB,MACpB,MAAM,IAAI,MAAM,iDAAiD,KAAK,EAAE;CAIzE,MAAM,iBAA2B,CAAC;CAClC,MAAM,YAAY,OAA2B,gBAAqD;EACjG,IAAI,SAAS,MAAM;EAEnB,MAAM,YAAY,6BAA6B,KAAK;EACpD,IAAI,UAAU,SAAS,GACtB,eAAe,KAAK,YAAY,SAAS,CAAC;CAE5C;CACA,SAAS,UAAU,eAAc,MAAK,aAAa,GAAG;CACtD,SAAS,UAAU,eAAc,MAAK,aAAa,GAAG;CAEtD,OAAO,cAAc,SAAQ,iBAC5B,OAAO,KAAI,WAAU;EACpB,OAAO,GAAG,gBAAgB,OAAO,kBAAkB,gBAAgB,UAAU,WAAW;EACxF,YAAY;GACX;GACA,GAAI,gBAAgB,OAAO,CAAC,wCAAwC,aAAa,IAAI,CAAC;GACtF,GAAG,gBAAgB,KAAK;GAExB,GAAI,UAAU,SAAS,OAAO,CAAC,SAAS,SAAS,OAAO,IAAI,CAAC;GAC7D,GAAI,UAAU,oBAAoB,OAAO,CAAC,IAAI,CAAC,gBAAgB;GAC/D,GAAI,KAAK,SAAS,IAAI,CAAC,IAAI,IAAI,CAAC;GAChC,GAAG;GACH;EACD;CACD,EAAE,CACH;AACD"}
1
+ {"version":3,"file":"pullRequestSearchQuery.js","names":[],"sources":["../../../../../plus/git-github/src/api/pullRequestSearchQuery.ts"],"sourcesContent":["import type {\n\tPullRequestSearchCriteria,\n\tPullRequestSorting,\n\tPullRequestStateFilter,\n} from '@gitlens/git/models/pullRequest.js';\nimport { defaultPullRequestSort, PullRequestFilter } from '@gitlens/git/models/pullRequest.js';\nimport {\n\teffectivePullRequestSearchSort,\n\tisValidPullRequestChangedSince,\n} from '@gitlens/git/utils/pullRequest.utils.js';\nimport { sanitizeGitHubQualifierValue, sanitizeGitHubSearchText } from './issueSearchQuery.js';\n\nexport type GitHubPullRequestSearchFacet = {\n\t/** Stable GraphQL alias and composite-cursor key. */\n\talias: string;\n\tqualifiers: string[];\n};\n\n/**\n * The GitHub search qualifier each relationship translates to. Exhaustive over `PullRequestFilter` so a new\n * member can't be silently unmapped.\n *\n * Exported because the account-wide read builds its own facets from the same vocabulary (see\n * `GitHubIntegrationBase.getProviderMyPullRequestsForUser`). Kept as ONE declaration rather than a copy per\n * caller: the exhaustive `Record` makes a missing key a compile error, but nothing would catch two copies\n * disagreeing on a qualifier STRING, and a wrong qualifier is a read that quietly answers a different question.\n */\nexport const gitHubPullRequestRelationshipQualifiers: Record<PullRequestFilter, string> = {\n\t[PullRequestFilter.Author]: 'author:@me',\n\t[PullRequestFilter.Assignee]: 'assignee:@me',\n\t[PullRequestFilter.ReviewRequested]: 'review-requested:@me',\n\t[PullRequestFilter.Reviewed]: 'reviewed-by:@me',\n\t[PullRequestFilter.Mention]: 'mentions:@me',\n};\n\nconst relationshipAlias: Record<PullRequestFilter, string> = {\n\t[PullRequestFilter.Author]: 'author',\n\t[PullRequestFilter.Assignee]: 'assignee',\n\t[PullRequestFilter.ReviewRequested]: 'reviewRequested',\n\t[PullRequestFilter.Reviewed]: 'reviewed',\n\t[PullRequestFilter.Mention]: 'mention',\n};\n\nconst stateAlias: Record<PullRequestStateFilter, string> = {\n\topen: 'Open',\n\tclosed: 'Closed',\n\tmerged: 'Merged',\n\tall: 'All',\n};\n\n/**\n * How each orderable key becomes a GitHub `sort:` qualifier.\n *\n * A literal `Record` over the union rather than a derived transform, for the same reason the relationship tables\n * are: adding a sort field without deciding its qualifier fails the build instead of quietly emitting a search\n * with no ordering constraint — the one failure mode the ordering contract exists to prevent, and the one a\n * caller cannot detect from the result.\n *\n * `updated:desc` maps to the bare `sort:updated`, not `sort:updated-desc`. The two are the same query to GitHub,\n * but the bare form is what this read has always emitted, so keeping it makes the default byte-identical to\n * today's query — matching `toGitHubIssueSortQualifier`. Do not \"normalize\" it.\n */\nexport const gitHubPullRequestSortQualifiers: Partial<Record<PullRequestSorting, string>> = {\n\t'created:asc': 'sort:created-asc',\n\t'created:desc': 'sort:created-desc',\n\t'updated:asc': 'sort:updated-asc',\n\t'updated:desc': 'sort:updated',\n};\n\n/** The `sort:` qualifier for a key, or `undefined` when there is no key or GitHub can't express it. */\nexport function toGitHubPullRequestSortQualifier(sort: PullRequestSorting | undefined): string | undefined {\n\treturn sort != null ? gitHubPullRequestSortQualifiers[sort] : undefined;\n}\n\nfunction stateQualifiers(state: PullRequestStateFilter): string[] {\n\tswitch (state) {\n\t\tcase 'closed':\n\t\t\t// GitHub's `is:closed` includes merged PRs; `is:unmerged` removes that subset.\n\t\t\treturn ['is:closed', 'is:unmerged'];\n\t\tcase 'merged':\n\t\t\treturn ['is:merged'];\n\t\tcase 'all':\n\t\t\treturn [];\n\t\tcase 'open':\n\t\t\treturn ['is:open'];\n\t}\n}\n\n/**\n * Translates provider-neutral PR criteria into the independent GitHub searches whose union answers the request.\n *\n * GitHub's API search syntax ANDs repeated relationship/state qualifiers and does not implement the boolean\n * groups accepted by the newer web UI. Each requested relationship × state pair therefore becomes one GraphQL\n * alias; the API client sends every active alias in a single document, preserving one HTTP request per page.\n * An omitted relationship is the explicitly unfiltered repository/organization scope, never `involves:@me`.\n */\nexport function toGitHubPullRequestSearchFacets(\n\tcriteria: PullRequestSearchCriteria | undefined,\n): GitHubPullRequestSearchFacet[] {\n\tconst relationships: (PullRequestFilter | undefined)[] = criteria?.relationships?.length\n\t\t? [...new Set(criteria.relationships)]\n\t\t: [undefined];\n\tconst changedSince = criteria?.changedSince;\n\tif (criteria != null && changedSince != null) {\n\t\tassertGitHubChangedSinceCriteria(changedSince, criteria, relationships.length);\n\t}\n\n\tconst requestedStates: PullRequestStateFilter[] = criteria?.states?.length\n\t\t? [...new Set(criteria.states)]\n\t\t: [changedSince != null ? 'all' : 'open'];\n\tconst states: PullRequestStateFilter[] = requestedStates.includes('all') ? ['all'] : requestedStates;\n\tconst text = criteria?.text != null ? sanitizeGitHubSearchText(criteria.text) : '';\n\t// Ordering is part of the contract, not an option: without an explicit `sort:` GitHub answers in relevance\n\t// order, so which rows land inside the result ceiling would shift with its ranking even when nothing changed\n\t// upstream. A key GitHub can't express is REFUSED here, not approximated with a fallback order — a silent\n\t// `sort:updated` substitute would emit one order in the query while the merged-page comparator applied another\n\t// (or none for an unknown field), which is exactly the \"the N most recent are what you get\" promise the ceiling\n\t// contract cannot keep under a guessed order. Unreachable through the facade — every key is validated against\n\t// `githubPullRequestSearchCapabilities.sorts` first — so this guards the direct callers of this exported builder\n\t// and of `GitHubApi.searchPullRequestsPage`.\n\t//\n\t// Deliberately STRICTER than the issue path, which drops an inexpressible qualifier and searches on\n\t// (`toGitHubIssueSearchQualifiers` pushes `toGitHubIssueSortQualifier`'s result only when it is non-null). The\n\t// two reads differ in what that costs: an issue search is served by whichever facets the provider ordered, while\n\t// this one hands its merged page to `getPullRequestComparator`, so a dropped qualifier here means the query and\n\t// the comparator disagree about the order the ceiling was applied under. Refusing is the only answer that\n\t// cannot lie about which rows were reachable.\n\tconst sort = effectivePullRequestSearchSort(criteria);\n\tconst sortQualifier = toGitHubPullRequestSortQualifier(sort);\n\tif (sortQualifier == null) {\n\t\tthrow new Error(`GitHub cannot order a pull request search by '${sort}'`);\n\t}\n\n\t// Facet-independent, unlike the relationship/state qualifiers below — build once and share.\n\tconst dateQualifiers: string[] = [];\n\tconst pushDate = (value: string | undefined, toQualifier: (sanitized: string) => string): void => {\n\t\tif (value == null) return;\n\n\t\tconst sanitized = sanitizeGitHubQualifierValue(value);\n\t\tif (sanitized.length > 0) {\n\t\t\tdateQualifiers.push(toQualifier(sanitized));\n\t\t}\n\t};\n\t// SEE: GitHub search honors only one of two `updated:` qualifiers (observed against api.github.com, 2026-11).\n\tpushDate(\n\t\tchangedSince != null ? laterUpdatedBound(criteria?.updatedAfter, changedSince) : criteria?.updatedAfter,\n\t\tv => `updated:>=${v}`,\n\t);\n\tpushDate(criteria?.createdAfter, v => `created:>=${v}`);\n\n\treturn relationships.flatMap(relationship =>\n\t\tstates.map(state => ({\n\t\t\talias: `${relationship != null ? relationshipAlias[relationship] : 'scope'}${stateAlias[state]}`,\n\t\t\tqualifiers: [\n\t\t\t\t'is:pr',\n\t\t\t\t...(relationship != null ? [gitHubPullRequestRelationshipQualifiers[relationship]] : []),\n\t\t\t\t...stateQualifiers(state),\n\t\t\t\t// `!= null`, not truthy: `draft:false` narrows to ready-for-review PRs just as `draft:true` narrows to drafts.\n\t\t\t\t...(criteria?.draft != null ? [`draft:${criteria.draft}`] : []),\n\t\t\t\t...(criteria?.includeArchived === true ? [] : ['archived:false']),\n\t\t\t\t...(text.length > 0 ? [text] : []),\n\t\t\t\t...dateQualifiers,\n\t\t\t\tsortQualifier,\n\t\t\t],\n\t\t})),\n\t);\n}\n\nexport function toGitHubPullRequestOpenCountQualifiers(\n\tcriteria: PullRequestSearchCriteria | undefined,\n): string[] | undefined {\n\tif (criteria?.changedSince == null) return undefined;\n\n\tconst [facet] = toGitHubPullRequestSearchFacets({\n\t\t...criteria,\n\t\tstates: ['open'],\n\t\tsort: undefined,\n\t\tchangedSince: undefined,\n\t});\n\tconst sortQualifier = toGitHubPullRequestSortQualifier(defaultPullRequestSort);\n\treturn facet.qualifiers.filter(q => q !== sortQualifier);\n}\n\nfunction assertGitHubChangedSinceCriteria(\n\tchangedSince: string,\n\tcriteria: PullRequestSearchCriteria,\n\trelationshipCount: number,\n): void {\n\tif (!isValidPullRequestChangedSince(changedSince)) {\n\t\tthrow new Error(`GitHub cannot search pull requests changed since '${changedSince}'`);\n\t}\n\tif (criteria.states?.length && criteria.states.some(s => s !== 'all')) {\n\t\tthrow new Error('GitHub cannot search pull requests changed since a time in only some states');\n\t}\n\tif (criteria.sort != null && criteria.sort !== 'updated:asc') {\n\t\tthrow new Error(`GitHub cannot order pull requests changed since a time by '${criteria.sort}'`);\n\t}\n\tif (relationshipCount > 1) {\n\t\tthrow new Error('GitHub cannot count the open pull requests of several relationships');\n\t}\n}\n\nfunction laterUpdatedBound(updatedAfter: string | undefined, changedSince: string): string {\n\tif (updatedAfter == null) return changedSince;\n\n\treturn Date.parse(updatedAfter) > Date.parse(changedSince) ? updatedAfter : changedSince;\n}\n"],"mappings":";;;;;;;;;;;;;AA2BA,MAAa,0CAA6E;EAC7D,WAAA;EACE,aAAA;EACO,qBAAA;EACP,gBAAA;EACD,YAAA;AAC9B;AAEA,MAAM,oBAAuD;EAChC,WAAA;EACE,aAAA;EACO,qBAAA;EACP,gBAAA;EACD,YAAA;AAC9B;AAEA,MAAM,aAAqD;CAC1D,MAAM;CACN,QAAQ;CACR,QAAQ;CACR,KAAK;AACN;;;;;;;;;;;;;AAcA,MAAa,kCAA+E;CAC3F,eAAe;CACf,gBAAgB;CAChB,eAAe;CACf,gBAAgB;AACjB;;AAGA,SAAgB,iCAAiC,MAA0D;CAC1G,OAAO,QAAQ,OAAO,gCAAgC,QAAQ,KAAA;AAC/D;AAEA,SAAS,gBAAgB,OAAyC;CACjE,QAAQ,OAAR;EACC,KAAK,UAEJ,OAAO,CAAC,aAAa,aAAa;EACnC,KAAK,UACJ,OAAO,CAAC,WAAW;EACpB,KAAK,OACJ,OAAO,CAAC;EACT,KAAK,QACJ,OAAO,CAAC,SAAS;CACnB;AACD;;;;;;;;;AAUA,SAAgB,gCACf,UACiC;CACjC,MAAM,gBAAmD,UAAU,eAAe,SAC/E,CAAC,GAAG,IAAI,IAAI,SAAS,aAAa,CAAC,IACnC,CAAC,KAAA,CAAS;CACb,MAAM,eAAe,UAAU;CAC/B,IAAI,YAAY,QAAQ,gB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gBAAgB,MAAM,OAAO,KAAA;CAE3C,MAAM,CAAC,SAAS,gCAAgC;EAC/C,GAAG;EACH,QAAQ,CAAC,MAAM;EACf,MAAM,KAAA;EACN,cAAc,KAAA;CACf,CAAC;CACD,MAAM,gBAAgB,iCAAiC,sBAAsB;CAC7E,OAAO,MAAM,WAAW,QAAO,MAAK,MAAM,aAAa;AACxD;AAEA,SAAS,iCACR,cACA,UACA,mBACO;CACP,IAAI,CAAC,+BAA+B,YAAY,GAC/C,MAAM,IAAI,MAAM,qDAAqD,aAAa,EAAE;CAErF,IAAI,SAAS,QAAQ,UAAU,SAAS,OAAO,MAAK,MAAK,MAAM,KAAK,GACnE,MAAM,IAAI,MAAM,6EAA6E;CAE9F,IAAI,SAAS,QAAQ,QAAQ,SAAS,SAAS,eAC9C,MAAM,IAAI,MAAM,8DAA8D,SAAS,KAAK,EAAE;CAE/F,IAAI,oBAAoB,GACvB,MAAM,IAAI,MAAM,qEAAqE;AAEvF;AAEA,SAAS,kBAAkB,cAAkC,cAA8B;CAC1F,IAAI,gBAAgB,MAAM,OAAO;CAEjC,OAAO,KAAK,MAAM,YAAY,IAAI,KAAK,MAAM,YAAY,IAAI,eAAe;AAC7E"}
@@ -95,5 +95,8 @@ export declare function getPullRequestFieldPresence(pr: PullRequestShape): Reado
95
95
  * `undefined` when either is unknown or the provider has no table yet — then nothing can be said about any field.
96
96
  */
97
97
  export declare function getIssueFieldPresence(issue: IssueShape): Readonly<Record<IssueFieldGroup, FieldPresence>> | undefined;
98
+ export declare function isPullRequestRowAsCompleteAsBatch(pr: PullRequestShape, options: {
99
+ mergeQueue: boolean;
100
+ }): boolean;
98
101
  //#endregion
99
102
  //# sourceMappingURL=fieldPresence.d.ts.map
@@ -470,7 +470,13 @@ function getPullRequestFieldPresence(pr) {
470
470
  function getIssueFieldPresence(issue) {
471
471
  return lookup(issuePresence, issue.provider.id, issue.projection);
472
472
  }
473
+ function isPullRequestRowAsCompleteAsBatch(pr, options) {
474
+ const row = getPullRequestFieldPresence(pr);
475
+ const batch = lookup(pullRequestPresence, pr.provider.id, "batch");
476
+ if (row == null || batch == null) return false;
477
+ return pullRequestFieldGroups.every((group) => batch[group] !== "fetched" || group === "checkRuns" || group === "mergeQueue" && !options.mergeQueue || row[group] === "fetched");
478
+ }
473
479
  //#endregion
474
- export { getIssueFieldPresence, getPullRequestFieldPresence };
480
+ export { getIssueFieldPresence, getPullRequestFieldPresence, isPullRequestRowAsCompleteAsBatch };
475
481
 
476
482
  //# sourceMappingURL=fieldPresence.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fieldPresence.js","names":[],"sources":["../../../../plus/integrations/src/fieldPresence.ts"],"sourcesContent":["import type { IssueProjection, IssueShape } from '@gitlens/git/models/issue.js';\nimport type { PullRequestProjection, PullRequestShape } from '@gitlens/git/models/pullRequest.js';\nimport {\n\tGitCloudHostIntegrationId,\n\tGitSelfManagedHostIntegrationId,\n\tIssuesCloudHostIntegrationId,\n\tIssuesSelfManagedHostIntegrationId,\n} from './constants.js';\n\n/**\n * Whether a row's read fetched a field group.\n *\n * - `fetched`: the read asked for it and surfaces it, so an empty value means \"none\".\n * - `not-requested`: this read didn't ask for it, or asked but doesn't surface it faithfully. Ignore the value even\n * when one is present (some reads fill placeholders); another read may supply it.\n * - `unavailable`: this provider or host can't supply it on this read.\n */\nexport type FieldPresence = 'fetched' | 'not-requested' | 'unavailable';\n\n/** A group is `fetched` only when every field in it is. */\nexport type PullRequestFieldGroup =\n\t/** `body`. */\n\t| 'description'\n\t/** `latestReviews`. */\n\t| 'reviews'\n\t/**\n\t * `reviewRequests`: who is requested. Not each request's `isCodeOwner`, which only GitLens' own GitHub reads\n\t * report; every other row leaves it undefined.\n\t */\n\t| 'reviewRequests'\n\t/**\n\t * `reviewDecision`. Only GitHub reports one; elsewhere it is derived from the reviewers' states on the row, which\n\t * ignores the host's own approval rules, so it is never `fetched` there — derive it from `reviews` and\n\t * `reviewRequests` instead.\n\t */\n\t| 'reviewDecision'\n\t/** `assignees`. */\n\t| 'assignees'\n\t/** `statusCheckRollupState`, on the `PullRequest` class. */\n\t| 'checks'\n\t/** `mergeableState`. */\n\t| 'mergeable'\n\t/** `additions`, `deletions` and `filesChanged`. */\n\t| 'diffStats'\n\t/** `commitCount`, on the `PullRequest` class. */\n\t| 'commitCount'\n\t/** `commentsCount`. */\n\t| 'comments'\n\t/** `thumbsUpCount`. */\n\t| 'reactions'\n\t/** `viewerCanUpdate`, on the `PullRequest` class, and `repository.accessLevel`. */\n\t| 'access'\n\t/** `authoredByMe`, and the `viewer` it was matched against. */\n\t| 'authoredByMe'\n\t/** `stack`. */\n\t| 'stack'\n\t/** `milestone`. */\n\t| 'milestone'\n\t/**\n\t * `mergeQueue`, `mergeQueueRequired` and `mergeQueueRemoval`: the merge-queue data was read, so an absent entry\n\t * means not queued and an absent removal means none since the pull request last joined. Only GitHub.com's is read,\n\t * and only for a read that asks for it or, when it doesn't say, a host that opts in\n\t * (`ConfigProvider.getPullRequestReadOptions`). The tables describe what a read that selects it gets;\n\t * {@link getPullRequestFieldPresence} answers `not-requested` for a row that carries no `mergeQueueRequired`,\n\t * since GitHub's `isMergeQueueEnabled` is non-null, so every row whose read selected the merge-queue data has it\n\t * defined.\n\t */\n\t| 'mergeQueue'\n\t/**\n\t * `checkRuns` and `checkRunsTruncated`. Only GitHub's and GitHub Enterprise's batch reads read them, and only for a\n\t * read that asks (`checkRuns`); {@link getPullRequestFieldPresence} answers `not-requested` for a batch row without\n\t * `checkRuns`.\n\t */\n\t| 'checkRuns';\n\n/** A group is `fetched` only when every field in it is. */\nexport type IssueFieldGroup =\n\t/** `body`, and `bodyField` where the provider sets it. */\n\t| 'description'\n\t/** `assignees`. */\n\t| 'assignees'\n\t/** `labels`. */\n\t| 'labels'\n\t/** `commentsCount`. */\n\t| 'comments'\n\t/** `thumbsUpCount`. */\n\t| 'reactions'\n\t/** `repository.accessLevel`. */\n\t| 'access'\n\t/** `milestone`: a Linear issue's is its project milestone. */\n\t| 'milestone';\n\ntype Presence<G extends string> = Readonly<Record<G, FieldPresence>>;\ntype PresenceTable<P extends string, G extends string> = Readonly<Partial<Record<P, Presence<G>>>>;\n\nconst pullRequestFieldGroups: readonly PullRequestFieldGroup[] = [\n\t'description',\n\t'reviews',\n\t'reviewRequests',\n\t'reviewDecision',\n\t'assignees',\n\t'checks',\n\t'mergeable',\n\t'diffStats',\n\t'commitCount',\n\t'comments',\n\t'reactions',\n\t'access',\n\t'authoredByMe',\n\t'stack',\n\t'milestone',\n\t'mergeQueue',\n\t'checkRuns',\n];\n\nconst issueFieldGroups: readonly IssueFieldGroup[] = [\n\t'description',\n\t'assignees',\n\t'labels',\n\t'comments',\n\t'reactions',\n\t'access',\n\t'milestone',\n];\n\n/** Every group in `groups` listed as neither `fetched` nor `unavailable` is `not-requested`. */\nfunction presenceOf<G extends string>(\n\tgroups: readonly G[],\n\tfetched: readonly G[],\n\tunavailable: readonly G[] = [],\n): Presence<G> {\n\treturn Object.freeze(\n\t\tObject.fromEntries(\n\t\t\tgroups.map(\n\t\t\t\tgroup =>\n\t\t\t\t\t[\n\t\t\t\t\t\tgroup,\n\t\t\t\t\t\tfetched.includes(group)\n\t\t\t\t\t\t\t? 'fetched'\n\t\t\t\t\t\t\t: unavailable.includes(group)\n\t\t\t\t\t\t\t\t? 'unavailable'\n\t\t\t\t\t\t\t\t: 'not-requested',\n\t\t\t\t\t] as const,\n\t\t\t),\n\t\t) as Record<G, FieldPresence>,\n\t);\n}\n\nfunction pullRequestPresenceOf(\n\tfetched: readonly PullRequestFieldGroup[],\n\tunavailable?: readonly PullRequestFieldGroup[],\n): Presence<PullRequestFieldGroup> {\n\treturn presenceOf(pullRequestFieldGroups, fetched, unavailable);\n}\n\nfunction issuePresenceOf(\n\tfetched: readonly IssueFieldGroup[],\n\tunavailable?: readonly IssueFieldGroup[],\n): Presence<IssueFieldGroup> {\n\treturn presenceOf(issueFieldGroups, fetched, unavailable);\n}\n\n/**\n * GitLens' own lite fragment (`fromGitHubPullRequestLite`). `stack` and `mergeQueue` are only selected against\n * github.com.\n */\nconst gitHubLite = pullRequestPresenceOf(['description', 'stack', 'milestone', 'mergeQueue']);\n\n/**\n * GitLens' own full fragment, which selects no reactions. The account-wide and batch reads return its rows as they\n * are, GitHub's own review decision included: none stays none, even while a review is requested.\n * `authoredByMe` needs the current account, which a read may fail to resolve, and the other reads never set it.\n */\nconst gitHubFullGroups: 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'access',\n\t'stack',\n\t'milestone',\n\t'mergeQueue',\n];\nconst gitHubFull = pullRequestPresenceOf(gitHubFullGroups);\n\nconst gitHubPullRequests: PresenceTable<PullRequestProjection, PullRequestFieldGroup> = {\n\tpoint: gitHubLite,\n\tsearch: gitHubFull,\n\t'search-summary': gitHubLite,\n\t'text-search': gitHubFull,\n\taccount: gitHubFull,\n\t// The lite fragment's own rows.\n\t'account-summary': gitHubLite,\n\t// provider-apis' own fragment and normalizer. Its review-state map has no DISMISSED, so a dismissed review is\n\t// dropped (and none carries a `commitOid`); it removes code-owner requests; it derives the review decision from\n\t// that list rather than reading GitHub's; and it doesn't read `repository.accessLevel`.\n\trepos: pullRequestPresenceOf([\n\t\t'description',\n\t\t'assignees',\n\t\t'checks',\n\t\t'mergeable',\n\t\t'diffStats',\n\t\t'commitCount',\n\t\t'comments',\n\t\t'reactions',\n\t\t'milestone',\n\t]),\n\t// `summary` drops the `commits` subtree that carries both the check rollup and the commit count.\n\t'repos-summary': pullRequestPresenceOf([\n\t\t'description',\n\t\t'assignees',\n\t\t'mergeable',\n\t\t'diffStats',\n\t\t'comments',\n\t\t'reactions',\n\t\t'milestone',\n\t]),\n\tbatch: pullRequestPresenceOf([...gitHubFullGroups, 'checkRuns']),\n};\n\n/**\n * GitHub Enterprise Server rejects the stack selection, and the merge-queue one isn't verified there, so neither is\n * selected: a read that carries `stack` or `mergeQueue` on github.com can't here.\n * provider-apis also gates check runs on the server version, which this table can't see, so its rollup on the\n * repository-scoped read may come from commit statuses alone.\n */\nconst gitHubEnterprisePullRequests: PresenceTable<PullRequestProjection, PullRequestFieldGroup> = Object.fromEntries(\n\tObject.entries(gitHubPullRequests).map(([projection, presence]) => {\n\t\tconst enterprise: Record<PullRequestFieldGroup, FieldPresence> = { ...presence };\n\t\tif (enterprise.stack === 'fetched') {\n\t\t\tenterprise.stack = 'unavailable';\n\t\t}\n\t\tif (enterprise.mergeQueue === 'fetched') {\n\t\t\tenterprise.mergeQueue = 'unavailable';\n\t\t}\n\t\tif (projection === 'repos') {\n\t\t\tenterprise.checks = 'not-requested';\n\t\t}\n\t\treturn [projection, Object.freeze(enterprise)];\n\t}),\n);\n\n/** GitLens' own issue fragment, which every native read selects with the body. */\nconst gitHubNativeIssue = presenceOf(issueFieldGroups, issueFieldGroups);\n\nconst gitHubIssues: PresenceTable<IssueProjection, IssueFieldGroup> = {\n\tpoint: gitHubNativeIssue,\n\tsearch: gitHubNativeIssue,\n\taccount: gitHubNativeIssue,\n\t// provider-apis' own fragment selects neither the body nor the repository's `viewerPermission`.\n\trepos: presenceOf(issueFieldGroups, ['assignees', 'labels', 'comments', 'reactions', 'milestone']),\n\tbatch: gitHubNativeIssue,\n};\n\n/*\n * Every other provider. None of them reads the viewer's access (`repository.accessLevel` is absent on every row),\n * resolves `authoredByMe` reliably, or has stacks, and only GitLab and Linear have milestones; none's merge queue\n * (GitLab's merge trains included) is read yet. provider-apis honors neither `summary` nor `includeReviews` for them,\n * so each `-summary` tag reads like its full one.\n */\n\n/**\n * GitLens' own GitLab reads: the point reads, and the free-text search. They select the description but leave it,\n * and everything else beyond the merge request's identity and refs, off the row.\n */\nconst gitLabOwn = pullRequestPresenceOf([], ['stack', 'mergeQueue', 'checkRuns']);\n\n/**\n * provider-apis' merge request fragment and normalizer, which every other GitLab read goes through. It turns a null\n * count into 0: GitLab's schema makes `diffStatsSummary`, `commitCount` and `userNotesCount` nullable, so none is\n * promised — except that GitLab.com's comment count resolver answers 0 rather than null, which a self-managed\n * version may not.\n */\nfunction gitLabProviderApis(comments: boolean): Presence<PullRequestFieldGroup> {\n\treturn pullRequestPresenceOf(\n\t\t[\n\t\t\t'description',\n\t\t\t'reviews',\n\t\t\t'reviewRequests',\n\t\t\t'assignees',\n\t\t\t'checks',\n\t\t\t'mergeable',\n\t\t\t'reactions',\n\t\t\t'milestone',\n\t\t\t...(comments ? (['comments'] as const) : []),\n\t\t],\n\t\t['stack', 'mergeQueue', 'checkRuns'],\n\t);\n}\n\nfunction gitLabPullRequestsFor(\n\tproviderApis: Presence<PullRequestFieldGroup>,\n): PresenceTable<PullRequestProjection, PullRequestFieldGroup> {\n\treturn {\n\t\tpoint: gitLabOwn,\n\t\tsearch: providerApis,\n\t\t'text-search': gitLabOwn,\n\t\taccount: providerApis,\n\t\t'account-summary': providerApis,\n\t\trepos: providerApis,\n\t\t'repos-summary': providerApis,\n\t\tbatch: providerApis,\n\t};\n}\n\n/**\n * Azure DevOps pull requests have no assignees (both converters fill `assignees` with the reviewers, which `reviews` and\n * `reviewRequests` already hold) and no reactions. Neither converter reads checks or counts.\n */\nconst azureUnavailable: readonly PullRequestFieldGroup[] = [\n\t'assignees',\n\t'reactions',\n\t'stack',\n\t'milestone',\n\t'mergeQueue',\n\t'checkRuns',\n];\n/** Every list read: Azure truncates a listed pull request's description (to 400 characters). */\nconst azureListed = pullRequestPresenceOf(['reviews', 'reviewRequests', 'mergeable'], azureUnavailable);\n/** The batch reads fetch each pull request by id, which returns the whole description. */\nconst azureById = pullRequestPresenceOf(['description', 'reviews', 'reviewRequests', 'mergeable'], azureUnavailable);\n\nconst azurePullRequests: PresenceTable<PullRequestProjection, PullRequestFieldGroup> = {\n\t// GitLens' own converter, which leaves the description off the row.\n\tpoint: azureListed,\n\tsearch: azureListed,\n\t'text-search': azureListed,\n\taccount: azureListed,\n\t'account-summary': azureListed,\n\trepos: azureListed,\n\t'repos-summary': azureListed,\n\tbatch: azureById,\n};\n\nconst azureServerPullRequests: PresenceTable<PullRequestProjection, PullRequestFieldGroup> = {\n\t...azurePullRequests,\n\t'search-summary': azureListed,\n};\n\n/**\n * Bitbucket pull requests have no assignees or reactions. Neither provider-apis nor GitLens reads their build\n * statuses or mergeability: provider-apis fills a literal Mergeable, and GitLens' own converters leave it unset.\n */\nconst bitbucketUnavailable: readonly PullRequestFieldGroup[] = [\n\t'assignees',\n\t'reactions',\n\t'stack',\n\t'milestone',\n\t'mergeQueue',\n\t'checkRuns',\n];\nconst bitbucketProviderApis = pullRequestPresenceOf(\n\t['description', 'reviews', 'reviewRequests', 'comments'],\n\tbitbucketUnavailable,\n);\n\nconst bitbucketPullRequests: PresenceTable<PullRequestProjection, PullRequestFieldGroup> = {\n\t// GitLens' own converter, which drops the comment count. The commit read selects `+values.*`, which isn't\n\t// known to bring the participants the reviews come from, as the other two point reads do.\n\tpoint: pullRequestPresenceOf(['description'], bitbucketUnavailable),\n\tsearch: bitbucketProviderApis,\n\t'text-search': bitbucketProviderApis,\n\taccount: bitbucketProviderApis,\n\t'account-summary': bitbucketProviderApis,\n\trepos: bitbucketProviderApis,\n\t'repos-summary': bitbucketProviderApis,\n\t// GitLens' own converter over reads that do select the participants.\n\tbatch: pullRequestPresenceOf(['description', 'reviews', 'reviewRequests'], bitbucketUnavailable),\n};\n\n/** provider-apis' and GitLens' own Data Center converters read the same fields. */\nconst bitbucketServerAll = pullRequestPresenceOf(\n\t['description', 'reviews', 'reviewRequests', 'comments'],\n\tbitbucketUnavailable,\n);\nconst bitbucketServerPullRequests: PresenceTable<PullRequestProjection, PullRequestFieldGroup> = {\n\tpoint: bitbucketServerAll,\n\tsearch: bitbucketServerAll,\n\t'search-summary': bitbucketServerAll,\n\t'text-search': bitbucketServerAll,\n\taccount: bitbucketServerAll,\n\t'account-summary': bitbucketServerAll,\n\trepos: bitbucketServerAll,\n\t'repos-summary': bitbucketServerAll,\n\tbatch: bitbucketServerAll,\n};\n\n/**\n * provider-apis' GitLab issue reads (GraphQL, and REST for the account-wide one). The repository's access isn't read.\n * The GraphQL comment count is nullable like the merge request's, and passed through, so only GitLab.com's is\n * promised; the REST one is always a number. The REST normalizer drops the milestone the response carries.\n */\nfunction gitLabIssuesFor(comments: boolean): PresenceTable<IssueProjection, IssueFieldGroup> {\n\tconst graphQL = issuePresenceOf([\n\t\t'description',\n\t\t'assignees',\n\t\t'labels',\n\t\t'reactions',\n\t\t'milestone',\n\t\t...(comments ? (['comments'] as const) : []),\n\t]);\n\treturn {\n\t\tpoint: graphQL,\n\t\taccount: issuePresenceOf(['description', 'assignees', 'labels', 'comments', 'reactions']),\n\t\trepos: graphQL,\n\t\tbatch: graphQL,\n\t};\n}\n\n/**\n * Azure DevOps work items have no reactions (provider-apis' converter fills 0; GitLens' leaves it unset) and belong to\n * a project, not a repository.\n */\nconst azureWorkItemUnavailable: readonly IssueFieldGroup[] = ['reactions', 'access', 'milestone'];\n/** provider-apis' work item converter, and GitLens' copy of it for the batch read. */\nconst azureWorkItem = issuePresenceOf(['description', 'assignees', 'labels', 'comments'], azureWorkItemUnavailable);\n/** GitLens' own work item converter, which drops the tags. */\nconst azureOwnWorkItem = issuePresenceOf(['description', 'assignees', 'comments'], azureWorkItemUnavailable);\n\nconst azureIssues: PresenceTable<IssueProjection, IssueFieldGroup> = {\n\tpoint: azureOwnWorkItem,\n\taccount: azureWorkItem,\n\trepos: azureWorkItem,\n\tbatch: azureWorkItem,\n};\n\nconst azureServerIssues: PresenceTable<IssueProjection, IssueFieldGroup> = {\n\t...azureIssues,\n\tsearch: azureOwnWorkItem,\n};\n\n/**\n * Bitbucket Cloud's legacy issues, which only the host's own `getIssue` and `searchMyIssues` read. They have no\n * labels, their votes aren't reactions, and neither a comment count nor the repository's access is read.\n */\nconst bitbucketIssue = issuePresenceOf(['description', 'assignees'], ['labels', 'reactions', 'milestone']);\nconst bitbucketIssues: PresenceTable<IssueProjection, IssueFieldGroup> = {\n\tpoint: bitbucketIssue,\n\taccount: bitbucketIssue,\n};\n\n/**\n * Tracker issues belong to no repository, and a tracker's votes aren't reactions (and read 0 where voting is off), so\n * neither group can be supplied. Nor a milestone: Trello has none, and Jira's fix versions and sprints are many per\n * issue, not one.\n */\nconst trackerUnavailable: readonly IssueFieldGroup[] = ['reactions', 'access', 'milestone'];\n/**\n * provider-apis' Jira converter counts the comments embedded in the issue, which Jira may cap, rather than reading\n * their total.\n */\nconst jiraProviderApis = issuePresenceOf(['description', 'assignees', 'labels'], trackerUnavailable);\n\nconst jiraIssues: PresenceTable<IssueProjection, IssueFieldGroup> = {\n\tpoint: jiraProviderApis,\n\taccount: jiraProviderApis,\n\tproject: jiraProviderApis,\n\t// GitLens' own by-key read, which reads the comment total.\n\tbatch: issuePresenceOf(['description', 'assignees', 'labels', 'comments'], trackerUnavailable),\n};\n\nconst jiraServerIssues: PresenceTable<IssueProjection, IssueFieldGroup> = {\n\t...jiraIssues,\n\tbatch: jiraProviderApis,\n};\n\n/** provider-apis' Linear fragment selects no labels (it fills an empty list), comments or reactions. */\nconst linearIssue = issuePresenceOf(['description', 'assignees', 'milestone'], ['access']);\nconst linearIssues: PresenceTable<IssueProjection, IssueFieldGroup> = {\n\tpoint: linearIssue,\n\taccount: linearIssue,\n\tproject: linearIssue,\n\tbatch: linearIssue,\n};\n\n/** A Trello card's description is never read; its members are its assignees. */\nconst trelloCard = issuePresenceOf(['assignees', 'labels', 'comments'], trackerUnavailable);\nconst trelloIssues: PresenceTable<IssueProjection, IssueFieldGroup> = {\n\tpoint: trelloCard,\n\tproject: trelloCard,\n};\n\n/**\n * provider-apis' Asana task fields: its notes, its single assignee, its tags as labels and its likes as reactions.\n * Comments are stories, which a task doesn't count, so reading them would cost a request per task.\n */\nconst asanaTask = issuePresenceOf(['description', 'assignees', 'labels', 'reactions'], ['access', 'milestone']);\nconst asanaIssues: PresenceTable<IssueProjection, IssueFieldGroup> = {\n\tpoint: asanaTask,\n\taccount: asanaTask,\n\tproject: asanaTask,\n};\n\nconst pullRequestPresence = new Map<string, PresenceTable<PullRequestProjection, PullRequestFieldGroup>>([\n\t[GitCloudHostIntegrationId.GitHub, gitHubPullRequests],\n\t[GitSelfManagedHostIntegrationId.CloudGitHubEnterprise, gitHubEnterprisePullRequests],\n\t[GitCloudHostIntegrationId.GitLab, gitLabPullRequestsFor(gitLabProviderApis(true))],\n\t[GitSelfManagedHostIntegrationId.CloudGitLabSelfHosted, gitLabPullRequestsFor(gitLabProviderApis(false))],\n\t[GitCloudHostIntegrationId.AzureDevOps, azurePullRequests],\n\t[GitSelfManagedHostIntegrationId.AzureDevOpsServer, azureServerPullRequests],\n\t[GitCloudHostIntegrationId.Bitbucket, bitbucketPullRequests],\n\t[GitSelfManagedHostIntegrationId.BitbucketServer, bitbucketServerPullRequests],\n]);\n\nconst issuePresence = new Map<string, PresenceTable<IssueProjection, IssueFieldGroup>>([\n\t[GitCloudHostIntegrationId.GitHub, gitHubIssues],\n\t[GitSelfManagedHostIntegrationId.CloudGitHubEnterprise, gitHubIssues],\n\t[GitCloudHostIntegrationId.GitLab, gitLabIssuesFor(true)],\n\t[GitSelfManagedHostIntegrationId.CloudGitLabSelfHosted, gitLabIssuesFor(false)],\n\t[GitCloudHostIntegrationId.AzureDevOps, azureIssues],\n\t[GitSelfManagedHostIntegrationId.AzureDevOpsServer, azureServerIssues],\n\t[GitCloudHostIntegrationId.Bitbucket, bitbucketIssues],\n\t[IssuesCloudHostIntegrationId.Jira, jiraIssues],\n\t[IssuesSelfManagedHostIntegrationId.JiraServer, jiraServerIssues],\n\t[IssuesCloudHostIntegrationId.Linear, linearIssues],\n\t[IssuesCloudHostIntegrationId.Trello, trelloIssues],\n\t[IssuesCloudHostIntegrationId.Asana, asanaIssues],\n]);\n\nfunction lookup<P extends string, G extends string>(\n\ttables: ReadonlyMap<string, PresenceTable<P, G>>,\n\tproviderId: string,\n\tprojection: P | undefined,\n): Presence<G> | undefined {\n\tif (projection == null) return undefined;\n\n\tconst table = tables.get(providerId);\n\t// `hasOwn` so a projection read off an untrusted row can't resolve to an `Object.prototype` member.\n\treturn table != null && Object.hasOwn(table, projection) ? table[projection] : undefined;\n}\n\n/** The table entries with a group downgraded to `not-requested`, made once per entry and group rather than per call. */\nconst downgradedPresence = new WeakMap<\n\tPresence<PullRequestFieldGroup>,\n\tMap<PullRequestFieldGroup, Presence<PullRequestFieldGroup>>\n>();\n\nfunction downgrade(\n\tpresence: Presence<PullRequestFieldGroup>,\n\tgroup: PullRequestFieldGroup,\n): Presence<PullRequestFieldGroup> {\n\tlet byGroup = downgradedPresence.get(presence);\n\tif (byGroup == null) {\n\t\tbyGroup = new Map();\n\t\tdowngradedPresence.set(presence, byGroup);\n\t}\n\n\tlet downgraded = byGroup.get(group);\n\tif (downgraded == null) {\n\t\tdowngraded = Object.freeze({ ...presence, [group]: 'not-requested' });\n\t\tbyGroup.set(group, downgraded);\n\t}\n\treturn downgraded;\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 *\n * `mergeQueue` and `checkRuns` are derived from the row: a table says `fetched` for a read that selects them. GitHub's\n * `isMergeQueueEnabled` is non-null, so `mergeQueueRequired` is defined on every row whose read selected the merge-queue\n * data, and `checkRuns` is defined (empty when the head has none) on every row whose read selected check runs.\n */\nexport function getPullRequestFieldPresence(\n\tpr: PullRequestShape,\n): Readonly<Record<PullRequestFieldGroup, FieldPresence>> | undefined {\n\tlet presence = lookup(pullRequestPresence, pr.provider.id, pr.projection);\n\tif (presence == null) return undefined;\n\n\tif (presence.mergeQueue === 'fetched' && pr.mergeQueueRequired == null) {\n\t\tpresence = downgrade(presence, 'mergeQueue');\n\t}\n\tif (presence.checkRuns === 'fetched' && pr.checkRuns == null) {\n\t\tpresence = downgrade(presence, 'checkRuns');\n\t}\n\treturn presence;\n}\n\n/**\n * Which field groups the read that produced `issue` fetched, keyed by its provider and {@link IssueShape.projection}.\n * `undefined` when either is unknown or the provider has no table yet — then nothing can be said about any field.\n */\nexport function getIssueFieldPresence(issue: IssueShape): Readonly<Record<IssueFieldGroup, FieldPresence>> | undefined {\n\treturn lookup(issuePresence, issue.provider.id, issue.projection);\n}\n"],"mappings":";;AA+FA,MAAM,yBAA2D;CAChE;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD;AAEA,MAAM,mBAA+C;CACpD;CACA;CACA;CACA;CACA;CACA;CACA;AACD;;AAGA,SAAS,WACR,QACA,SACA,cAA4B,CAAC,GACf;CACd,OAAO,OAAO,OACb,OAAO,YACN,OAAO,KACN,UACC,CACC,OACA,QAAQ,SAAS,KAAK,IACnB,YACA,YAAY,SAAS,KAAK,IACzB,gBACA,eACL,CACF,CACD,CACD;AACD;AAEA,SAAS,sBACR,SACA,aACkC;CAClC,OAAO,WAAW,wBAAwB,SAAS,WAAW;AAC/D;AAEA,SAAS,gBACR,SACA,aAC4B;CAC5B,OAAO,WAAW,kBAAkB,SAAS,WAAW;AACzD;;;;;AAMA,MAAM,aAAa,sBAAsB;CAAC;CAAe;CAAS;CAAa;AAAY,CAAC;;;;;;AAO5F,MAAM,mBAAqD;CAC1D;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD;AACA,MAAM,aAAa,sBAAsB,gBAAgB;AAEzD,MAAM,qBAAkF;CACvF,OAAO;CACP,QAAQ;CACR,kBAAkB;CAClB,eAAe;CACf,SAAS;CAET,mBAAmB;CAInB,OAAO,sBAAsB;EAC5B;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACD,CAAC;CAED,iBAAiB,sBAAsB;EACtC;EACA;EACA;EACA;EACA;EACA;EACA;CACD,CAAC;CACD,OAAO,sBAAsB,CAAC,GAAG,kBAAkB,WAAW,CAAC;AAChE;;;;;;;AAQA,MAAM,+BAA4F,OAAO,YACxG,OAAO,Q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],"sourcesContent":["import type { IssueProjection, IssueShape } from '@gitlens/git/models/issue.js';\nimport type { PullRequestProjection, PullRequestShape } from '@gitlens/git/models/pullRequest.js';\nimport {\n\tGitCloudHostIntegrationId,\n\tGitSelfManagedHostIntegrationId,\n\tIssuesCloudHostIntegrationId,\n\tIssuesSelfManagedHostIntegrationId,\n} from './constants.js';\n\n/**\n * Whether a row's read fetched a field group.\n *\n * - `fetched`: the read asked for it and surfaces it, so an empty value means \"none\".\n * - `not-requested`: this read didn't ask for it, or asked but doesn't surface it faithfully. Ignore the value even\n * when one is present (some reads fill placeholders); another read may supply it.\n * - `unavailable`: this provider or host can't supply it on this read.\n */\nexport type FieldPresence = 'fetched' | 'not-requested' | 'unavailable';\n\n/** A group is `fetched` only when every field in it is. */\nexport type PullRequestFieldGroup =\n\t/** `body`. */\n\t| 'description'\n\t/** `latestReviews`. */\n\t| 'reviews'\n\t/**\n\t * `reviewRequests`: who is requested. Not each request's `isCodeOwner`, which only GitLens' own GitHub reads\n\t * report; every other row leaves it undefined.\n\t */\n\t| 'reviewRequests'\n\t/**\n\t * `reviewDecision`. Only GitHub reports one; elsewhere it is derived from the reviewers' states on the row, which\n\t * ignores the host's own approval rules, so it is never `fetched` there — derive it from `reviews` and\n\t * `reviewRequests` instead.\n\t */\n\t| 'reviewDecision'\n\t/** `assignees`. */\n\t| 'assignees'\n\t/** `statusCheckRollupState`, on the `PullRequest` class. */\n\t| 'checks'\n\t/** `mergeableState`. */\n\t| 'mergeable'\n\t/** `additions`, `deletions` and `filesChanged`. */\n\t| 'diffStats'\n\t/** `commitCount`, on the `PullRequest` class. */\n\t| 'commitCount'\n\t/** `commentsCount`. */\n\t| 'comments'\n\t/** `thumbsUpCount`. */\n\t| 'reactions'\n\t/** `viewerCanUpdate`, on the `PullRequest` class, and `repository.accessLevel`. */\n\t| 'access'\n\t/** `authoredByMe`, and the `viewer` it was matched against. */\n\t| 'authoredByMe'\n\t/** `stack`. */\n\t| 'stack'\n\t/** `milestone`. */\n\t| 'milestone'\n\t/**\n\t * `mergeQueue`, `mergeQueueRequired` and `mergeQueueRemoval`: the merge-queue data was read, so an absent entry\n\t * means not queued and an absent removal means none since the pull request last joined. Only GitHub.com's is read,\n\t * and only for a read that asks for it or, when it doesn't say, a host that opts in\n\t * (`ConfigProvider.getPullRequestReadOptions`). The tables describe what a read that selects it gets;\n\t * {@link getPullRequestFieldPresence} answers `not-requested` for a row that carries no `mergeQueueRequired`,\n\t * since GitHub's `isMergeQueueEnabled` is non-null, so every row whose read selected the merge-queue data has it\n\t * defined.\n\t */\n\t| 'mergeQueue'\n\t/**\n\t * `checkRuns` and `checkRunsTruncated`. Only GitHub's and GitHub Enterprise's batch reads read them, and only for a\n\t * read that asks (`checkRuns`); {@link getPullRequestFieldPresence} answers `not-requested` for a batch row without\n\t * `checkRuns`.\n\t */\n\t| 'checkRuns';\n\n/** A group is `fetched` only when every field in it is. */\nexport type IssueFieldGroup =\n\t/** `body`, and `bodyField` where the provider sets it. */\n\t| 'description'\n\t/** `assignees`. */\n\t| 'assignees'\n\t/** `labels`. */\n\t| 'labels'\n\t/** `commentsCount`. */\n\t| 'comments'\n\t/** `thumbsUpCount`. */\n\t| 'reactions'\n\t/** `repository.accessLevel`. */\n\t| 'access'\n\t/** `milestone`: a Linear issue's is its project milestone. */\n\t| 'milestone';\n\ntype Presence<G extends string> = Readonly<Record<G, FieldPresence>>;\ntype PresenceTable<P extends string, G extends string> = Readonly<Partial<Record<P, Presence<G>>>>;\n\nconst pullRequestFieldGroups: readonly PullRequestFieldGroup[] = [\n\t'description',\n\t'reviews',\n\t'reviewRequests',\n\t'reviewDecision',\n\t'assignees',\n\t'checks',\n\t'mergeable',\n\t'diffStats',\n\t'commitCount',\n\t'comments',\n\t'reactions',\n\t'access',\n\t'authoredByMe',\n\t'stack',\n\t'milestone',\n\t'mergeQueue',\n\t'checkRuns',\n];\n\nconst issueFieldGroups: readonly IssueFieldGroup[] = [\n\t'description',\n\t'assignees',\n\t'labels',\n\t'comments',\n\t'reactions',\n\t'access',\n\t'milestone',\n];\n\n/** Every group in `groups` listed as neither `fetched` nor `unavailable` is `not-requested`. */\nfunction presenceOf<G extends string>(\n\tgroups: readonly G[],\n\tfetched: readonly G[],\n\tunavailable: readonly G[] = [],\n): Presence<G> {\n\treturn Object.freeze(\n\t\tObject.fromEntries(\n\t\t\tgroups.map(\n\t\t\t\tgroup =>\n\t\t\t\t\t[\n\t\t\t\t\t\tgroup,\n\t\t\t\t\t\tfetched.includes(group)\n\t\t\t\t\t\t\t? 'fetched'\n\t\t\t\t\t\t\t: unavailable.includes(group)\n\t\t\t\t\t\t\t\t? 'unavailable'\n\t\t\t\t\t\t\t\t: 'not-requested',\n\t\t\t\t\t] as const,\n\t\t\t),\n\t\t) as Record<G, FieldPresence>,\n\t);\n}\n\nfunction pullRequestPresenceOf(\n\tfetched: readonly PullRequestFieldGroup[],\n\tunavailable?: readonly PullRequestFieldGroup[],\n): Presence<PullRequestFieldGroup> {\n\treturn presenceOf(pullRequestFieldGroups, fetched, unavailable);\n}\n\nfunction issuePresenceOf(\n\tfetched: readonly IssueFieldGroup[],\n\tunavailable?: readonly IssueFieldGroup[],\n): Presence<IssueFieldGroup> {\n\treturn presenceOf(issueFieldGroups, fetched, unavailable);\n}\n\n/**\n * GitLens' own lite fragment (`fromGitHubPullRequestLite`). `stack` and `mergeQueue` are only selected against\n * github.com.\n */\nconst gitHubLite = pullRequestPresenceOf(['description', 'stack', 'milestone', 'mergeQueue']);\n\n/**\n * GitLens' own full fragment, which selects no reactions. The account-wide and batch reads return its rows as they\n * are, GitHub's own review decision included: none stays none, even while a review is requested.\n * `authoredByMe` needs the current account, which a read may fail to resolve, and the other reads never set it.\n */\nconst gitHubFullGroups: 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'access',\n\t'stack',\n\t'milestone',\n\t'mergeQueue',\n];\nconst gitHubFull = pullRequestPresenceOf(gitHubFullGroups);\n\nconst gitHubPullRequests: PresenceTable<PullRequestProjection, PullRequestFieldGroup> = {\n\tpoint: gitHubLite,\n\tsearch: gitHubFull,\n\t'search-summary': gitHubLite,\n\t'text-search': gitHubFull,\n\taccount: gitHubFull,\n\t// The lite fragment's own rows.\n\t'account-summary': gitHubLite,\n\t// provider-apis' own fragment and normalizer. Its review-state map has no DISMISSED, so a dismissed review is\n\t// dropped (and none carries a `commitOid`); it removes code-owner requests; it derives the review decision from\n\t// that list rather than reading GitHub's; and it doesn't read `repository.accessLevel`.\n\trepos: pullRequestPresenceOf([\n\t\t'description',\n\t\t'assignees',\n\t\t'checks',\n\t\t'mergeable',\n\t\t'diffStats',\n\t\t'commitCount',\n\t\t'comments',\n\t\t'reactions',\n\t\t'milestone',\n\t]),\n\t// `summary` drops the `commits` subtree that carries both the check rollup and the commit count.\n\t'repos-summary': pullRequestPresenceOf([\n\t\t'description',\n\t\t'assignees',\n\t\t'mergeable',\n\t\t'diffStats',\n\t\t'comments',\n\t\t'reactions',\n\t\t'milestone',\n\t]),\n\tbatch: pullRequestPresenceOf([...gitHubFullGroups, 'checkRuns']),\n};\n\n/**\n * GitHub Enterprise Server rejects the stack selection, and the merge-queue one isn't verified there, so neither is\n * selected: a read that carries `stack` or `mergeQueue` on github.com can't here.\n * provider-apis also gates check runs on the server version, which this table can't see, so its rollup on the\n * repository-scoped read may come from commit statuses alone.\n */\nconst gitHubEnterprisePullRequests: PresenceTable<PullRequestProjection, PullRequestFieldGroup> = Object.fromEntries(\n\tObject.entries(gitHubPullRequests).map(([projection, presence]) => {\n\t\tconst enterprise: Record<PullRequestFieldGroup, FieldPresence> = { ...presence };\n\t\tif (enterprise.stack === 'fetched') {\n\t\t\tenterprise.stack = 'unavailable';\n\t\t}\n\t\tif (enterprise.mergeQueue === 'fetched') {\n\t\t\tenterprise.mergeQueue = 'unavailable';\n\t\t}\n\t\tif (projection === 'repos') {\n\t\t\tenterprise.checks = 'not-requested';\n\t\t}\n\t\treturn [projection, Object.freeze(enterprise)];\n\t}),\n);\n\n/** GitLens' own issue fragment, which every native read selects with the body. */\nconst gitHubNativeIssue = presenceOf(issueFieldGroups, issueFieldGroups);\n\nconst gitHubIssues: PresenceTable<IssueProjection, IssueFieldGroup> = {\n\tpoint: gitHubNativeIssue,\n\tsearch: gitHubNativeIssue,\n\taccount: gitHubNativeIssue,\n\t// provider-apis' own fragment selects neither the body nor the repository's `viewerPermission`.\n\trepos: presenceOf(issueFieldGroups, ['assignees', 'labels', 'comments', 'reactions', 'milestone']),\n\tbatch: gitHubNativeIssue,\n};\n\n/*\n * Every other provider. None of them reads the viewer's access (`repository.accessLevel` is absent on every row),\n * resolves `authoredByMe` reliably, or has stacks, and only GitLab and Linear have milestones; none's merge queue\n * (GitLab's merge trains included) is read yet. provider-apis honors neither `summary` nor `includeReviews` for them,\n * so each `-summary` tag reads like its full one.\n */\n\n/**\n * GitLens' own GitLab reads: the point reads, and the free-text search. They select the description but leave it,\n * and everything else beyond the merge request's identity and refs, off the row.\n */\nconst gitLabOwn = pullRequestPresenceOf([], ['stack', 'mergeQueue', 'checkRuns']);\n\n/**\n * provider-apis' merge request fragment and normalizer, which every other GitLab read goes through. It turns a null\n * count into 0: GitLab's schema makes `diffStatsSummary`, `commitCount` and `userNotesCount` nullable, so none is\n * promised — except that GitLab.com's comment count resolver answers 0 rather than null, which a self-managed\n * version may not.\n */\nfunction gitLabProviderApis(comments: boolean): Presence<PullRequestFieldGroup> {\n\treturn pullRequestPresenceOf(\n\t\t[\n\t\t\t'description',\n\t\t\t'reviews',\n\t\t\t'reviewRequests',\n\t\t\t'assignees',\n\t\t\t'checks',\n\t\t\t'mergeable',\n\t\t\t'reactions',\n\t\t\t'milestone',\n\t\t\t...(comments ? (['comments'] as const) : []),\n\t\t],\n\t\t['stack', 'mergeQueue', 'checkRuns'],\n\t);\n}\n\nfunction gitLabPullRequestsFor(\n\tproviderApis: Presence<PullRequestFieldGroup>,\n): PresenceTable<PullRequestProjection, PullRequestFieldGroup> {\n\treturn {\n\t\tpoint: gitLabOwn,\n\t\tsearch: providerApis,\n\t\t'text-search': gitLabOwn,\n\t\taccount: providerApis,\n\t\t'account-summary': providerApis,\n\t\trepos: providerApis,\n\t\t'repos-summary': providerApis,\n\t\tbatch: providerApis,\n\t};\n}\n\n/**\n * Azure DevOps pull requests have no assignees (both converters fill `assignees` with the reviewers, which `reviews` and\n * `reviewRequests` already hold) and no reactions. Neither converter reads checks or counts.\n */\nconst azureUnavailable: readonly PullRequestFieldGroup[] = [\n\t'assignees',\n\t'reactions',\n\t'stack',\n\t'milestone',\n\t'mergeQueue',\n\t'checkRuns',\n];\n/** Every list read: Azure truncates a listed pull request's description (to 400 characters). */\nconst azureListed = pullRequestPresenceOf(['reviews', 'reviewRequests', 'mergeable'], azureUnavailable);\n/** The batch reads fetch each pull request by id, which returns the whole description. */\nconst azureById = pullRequestPresenceOf(['description', 'reviews', 'reviewRequests', 'mergeable'], azureUnavailable);\n\nconst azurePullRequests: PresenceTable<PullRequestProjection, PullRequestFieldGroup> = {\n\t// GitLens' own converter, which leaves the description off the row.\n\tpoint: azureListed,\n\tsearch: azureListed,\n\t'text-search': azureListed,\n\taccount: azureListed,\n\t'account-summary': azureListed,\n\trepos: azureListed,\n\t'repos-summary': azureListed,\n\tbatch: azureById,\n};\n\nconst azureServerPullRequests: PresenceTable<PullRequestProjection, PullRequestFieldGroup> = {\n\t...azurePullRequests,\n\t'search-summary': azureListed,\n};\n\n/**\n * Bitbucket pull requests have no assignees or reactions. Neither provider-apis nor GitLens reads their build\n * statuses or mergeability: provider-apis fills a literal Mergeable, and GitLens' own converters leave it unset.\n */\nconst bitbucketUnavailable: readonly PullRequestFieldGroup[] = [\n\t'assignees',\n\t'reactions',\n\t'stack',\n\t'milestone',\n\t'mergeQueue',\n\t'checkRuns',\n];\nconst bitbucketProviderApis = pullRequestPresenceOf(\n\t['description', 'reviews', 'reviewRequests', 'comments'],\n\tbitbucketUnavailable,\n);\n\nconst bitbucketPullRequests: PresenceTable<PullRequestProjection, PullRequestFieldGroup> = {\n\t// GitLens' own converter, which drops the comment count. The commit read selects `+values.*`, which isn't\n\t// known to bring the participants the reviews come from, as the other two point reads do.\n\tpoint: pullRequestPresenceOf(['description'], bitbucketUnavailable),\n\tsearch: bitbucketProviderApis,\n\t'text-search': bitbucketProviderApis,\n\taccount: bitbucketProviderApis,\n\t'account-summary': bitbucketProviderApis,\n\trepos: bitbucketProviderApis,\n\t'repos-summary': bitbucketProviderApis,\n\t// GitLens' own converter over reads that do select the participants.\n\tbatch: pullRequestPresenceOf(['description', 'reviews', 'reviewRequests'], bitbucketUnavailable),\n};\n\n/** provider-apis' and GitLens' own Data Center converters read the same fields. */\nconst bitbucketServerAll = pullRequestPresenceOf(\n\t['description', 'reviews', 'reviewRequests', 'comments'],\n\tbitbucketUnavailable,\n);\nconst bitbucketServerPullRequests: PresenceTable<PullRequestProjection, PullRequestFieldGroup> = {\n\tpoint: bitbucketServerAll,\n\tsearch: bitbucketServerAll,\n\t'search-summary': bitbucketServerAll,\n\t'text-search': bitbucketServerAll,\n\taccount: bitbucketServerAll,\n\t'account-summary': bitbucketServerAll,\n\trepos: bitbucketServerAll,\n\t'repos-summary': bitbucketServerAll,\n\tbatch: bitbucketServerAll,\n};\n\n/**\n * provider-apis' GitLab issue reads (GraphQL, and REST for the account-wide one). The repository's access isn't read.\n * The GraphQL comment count is nullable like the merge request's, and passed through, so only GitLab.com's is\n * promised; the REST one is always a number. The REST normalizer drops the milestone the response carries.\n */\nfunction gitLabIssuesFor(comments: boolean): PresenceTable<IssueProjection, IssueFieldGroup> {\n\tconst graphQL = issuePresenceOf([\n\t\t'description',\n\t\t'assignees',\n\t\t'labels',\n\t\t'reactions',\n\t\t'milestone',\n\t\t...(comments ? (['comments'] as const) : []),\n\t]);\n\treturn {\n\t\tpoint: graphQL,\n\t\taccount: issuePresenceOf(['description', 'assignees', 'labels', 'comments', 'reactions']),\n\t\trepos: graphQL,\n\t\tbatch: graphQL,\n\t};\n}\n\n/**\n * Azure DevOps work items have no reactions (provider-apis' converter fills 0; GitLens' leaves it unset) and belong to\n * a project, not a repository.\n */\nconst azureWorkItemUnavailable: readonly IssueFieldGroup[] = ['reactions', 'access', 'milestone'];\n/** provider-apis' work item converter, and GitLens' copy of it for the batch read. */\nconst azureWorkItem = issuePresenceOf(['description', 'assignees', 'labels', 'comments'], azureWorkItemUnavailable);\n/** GitLens' own work item converter, which drops the tags. */\nconst azureOwnWorkItem = issuePresenceOf(['description', 'assignees', 'comments'], azureWorkItemUnavailable);\n\nconst azureIssues: PresenceTable<IssueProjection, IssueFieldGroup> = {\n\tpoint: azureOwnWorkItem,\n\taccount: azureWorkItem,\n\trepos: azureWorkItem,\n\tbatch: azureWorkItem,\n};\n\nconst azureServerIssues: PresenceTable<IssueProjection, IssueFieldGroup> = {\n\t...azureIssues,\n\tsearch: azureOwnWorkItem,\n};\n\n/**\n * Bitbucket Cloud's legacy issues, which only the host's own `getIssue` and `searchMyIssues` read. They have no\n * labels, their votes aren't reactions, and neither a comment count nor the repository's access is read.\n */\nconst bitbucketIssue = issuePresenceOf(['description', 'assignees'], ['labels', 'reactions', 'milestone']);\nconst bitbucketIssues: PresenceTable<IssueProjection, IssueFieldGroup> = {\n\tpoint: bitbucketIssue,\n\taccount: bitbucketIssue,\n};\n\n/**\n * Tracker issues belong to no repository, and a tracker's votes aren't reactions (and read 0 where voting is off), so\n * neither group can be supplied. Nor a milestone: Trello has none, and Jira's fix versions and sprints are many per\n * issue, not one.\n */\nconst trackerUnavailable: readonly IssueFieldGroup[] = ['reactions', 'access', 'milestone'];\n/**\n * provider-apis' Jira converter counts the comments embedded in the issue, which Jira may cap, rather than reading\n * their total.\n */\nconst jiraProviderApis = issuePresenceOf(['description', 'assignees', 'labels'], trackerUnavailable);\n\nconst jiraIssues: PresenceTable<IssueProjection, IssueFieldGroup> = {\n\tpoint: jiraProviderApis,\n\taccount: jiraProviderApis,\n\tproject: jiraProviderApis,\n\t// GitLens' own by-key read, which reads the comment total.\n\tbatch: issuePresenceOf(['description', 'assignees', 'labels', 'comments'], trackerUnavailable),\n};\n\nconst jiraServerIssues: PresenceTable<IssueProjection, IssueFieldGroup> = {\n\t...jiraIssues,\n\tbatch: jiraProviderApis,\n};\n\n/** provider-apis' Linear fragment selects no labels (it fills an empty list), comments or reactions. */\nconst linearIssue = issuePresenceOf(['description', 'assignees', 'milestone'], ['access']);\nconst linearIssues: PresenceTable<IssueProjection, IssueFieldGroup> = {\n\tpoint: linearIssue,\n\taccount: linearIssue,\n\tproject: linearIssue,\n\tbatch: linearIssue,\n};\n\n/** A Trello card's description is never read; its members are its assignees. */\nconst trelloCard = issuePresenceOf(['assignees', 'labels', 'comments'], trackerUnavailable);\nconst trelloIssues: PresenceTable<IssueProjection, IssueFieldGroup> = {\n\tpoint: trelloCard,\n\tproject: trelloCard,\n};\n\n/**\n * provider-apis' Asana task fields: its notes, its single assignee, its tags as labels and its likes as reactions.\n * Comments are stories, which a task doesn't count, so reading them would cost a request per task.\n */\nconst asanaTask = issuePresenceOf(['description', 'assignees', 'labels', 'reactions'], ['access', 'milestone']);\nconst asanaIssues: PresenceTable<IssueProjection, IssueFieldGroup> = {\n\tpoint: asanaTask,\n\taccount: asanaTask,\n\tproject: asanaTask,\n};\n\nconst pullRequestPresence = new Map<string, PresenceTable<PullRequestProjection, PullRequestFieldGroup>>([\n\t[GitCloudHostIntegrationId.GitHub, gitHubPullRequests],\n\t[GitSelfManagedHostIntegrationId.CloudGitHubEnterprise, gitHubEnterprisePullRequests],\n\t[GitCloudHostIntegrationId.GitLab, gitLabPullRequestsFor(gitLabProviderApis(true))],\n\t[GitSelfManagedHostIntegrationId.CloudGitLabSelfHosted, gitLabPullRequestsFor(gitLabProviderApis(false))],\n\t[GitCloudHostIntegrationId.AzureDevOps, azurePullRequests],\n\t[GitSelfManagedHostIntegrationId.AzureDevOpsServer, azureServerPullRequests],\n\t[GitCloudHostIntegrationId.Bitbucket, bitbucketPullRequests],\n\t[GitSelfManagedHostIntegrationId.BitbucketServer, bitbucketServerPullRequests],\n]);\n\nconst issuePresence = new Map<string, PresenceTable<IssueProjection, IssueFieldGroup>>([\n\t[GitCloudHostIntegrationId.GitHub, gitHubIssues],\n\t[GitSelfManagedHostIntegrationId.CloudGitHubEnterprise, gitHubIssues],\n\t[GitCloudHostIntegrationId.GitLab, gitLabIssuesFor(true)],\n\t[GitSelfManagedHostIntegrationId.CloudGitLabSelfHosted, gitLabIssuesFor(false)],\n\t[GitCloudHostIntegrationId.AzureDevOps, azureIssues],\n\t[GitSelfManagedHostIntegrationId.AzureDevOpsServer, azureServerIssues],\n\t[GitCloudHostIntegrationId.Bitbucket, bitbucketIssues],\n\t[IssuesCloudHostIntegrationId.Jira, jiraIssues],\n\t[IssuesSelfManagedHostIntegrationId.JiraServer, jiraServerIssues],\n\t[IssuesCloudHostIntegrationId.Linear, linearIssues],\n\t[IssuesCloudHostIntegrationId.Trello, trelloIssues],\n\t[IssuesCloudHostIntegrationId.Asana, asanaIssues],\n]);\n\nfunction lookup<P extends string, G extends string>(\n\ttables: ReadonlyMap<string, PresenceTable<P, G>>,\n\tproviderId: string,\n\tprojection: P | undefined,\n): Presence<G> | undefined {\n\tif (projection == null) return undefined;\n\n\tconst table = tables.get(providerId);\n\t// `hasOwn` so a projection read off an untrusted row can't resolve to an `Object.prototype` member.\n\treturn table != null && Object.hasOwn(table, projection) ? table[projection] : undefined;\n}\n\n/** The table entries with a group downgraded to `not-requested`, made once per entry and group rather than per call. */\nconst downgradedPresence = new WeakMap<\n\tPresence<PullRequestFieldGroup>,\n\tMap<PullRequestFieldGroup, Presence<PullRequestFieldGroup>>\n>();\n\nfunction downgrade(\n\tpresence: Presence<PullRequestFieldGroup>,\n\tgroup: PullRequestFieldGroup,\n): Presence<PullRequestFieldGroup> {\n\tlet byGroup = downgradedPresence.get(presence);\n\tif (byGroup == null) {\n\t\tbyGroup = new Map();\n\t\tdowngradedPresence.set(presence, byGroup);\n\t}\n\n\tlet downgraded = byGroup.get(group);\n\tif (downgraded == null) {\n\t\tdowngraded = Object.freeze({ ...presence, [group]: 'not-requested' });\n\t\tbyGroup.set(group, downgraded);\n\t}\n\treturn downgraded;\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 *\n * `mergeQueue` and `checkRuns` are derived from the row: a table says `fetched` for a read that selects them. GitHub's\n * `isMergeQueueEnabled` is non-null, so `mergeQueueRequired` is defined on every row whose read selected the merge-queue\n * data, and `checkRuns` is defined (empty when the head has none) on every row whose read selected check runs.\n */\nexport function getPullRequestFieldPresence(\n\tpr: PullRequestShape,\n): Readonly<Record<PullRequestFieldGroup, FieldPresence>> | undefined {\n\tlet presence = lookup(pullRequestPresence, pr.provider.id, pr.projection);\n\tif (presence == null) return undefined;\n\n\tif (presence.mergeQueue === 'fetched' && pr.mergeQueueRequired == null) {\n\t\tpresence = downgrade(presence, 'mergeQueue');\n\t}\n\tif (presence.checkRuns === 'fetched' && pr.checkRuns == null) {\n\t\tpresence = downgrade(presence, 'checkRuns');\n\t}\n\treturn presence;\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\nexport function isPullRequestRowAsCompleteAsBatch(pr: PullRequestShape, options: { mergeQueue: boolean }): boolean {\n\tconst row = getPullRequestFieldPresence(pr);\n\tconst batch = lookup(pullRequestPresence, pr.provider.id, 'batch');\n\tif (row == null || batch == null) return false;\n\n\treturn pullRequestFieldGroups.every(\n\t\tgroup =>\n\t\t\tbatch[group] !== 'fetched' ||\n\t\t\tgroup === 'checkRuns' ||\n\t\t\t(group === 'mergeQueue' && !options.mergeQueue) ||\n\t\t\trow[group] === 'fetched',\n\t);\n}\n"],"mappings":";;AA+FA,MAAM,yBAA2D;CAChE;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD;AAEA,MAAM,mBAA+C;CACpD;CACA;CACA;CACA;CACA;CACA;CACA;AACD;;AAGA,SAAS,WACR,QACA,SACA,cAA4B,CAAC,GACf;CACd,OAAO,OAAO,OACb,OAAO,YACN,OAAO,KACN,UACC,CACC,OACA,QAAQ,SAAS,KAAK,IACnB,YACA,YAAY,SAAS,KAAK,IACzB,gBACA,eACL,CACF,CACD,CACD;AACD;AAEA,SAAS,sBACR,SACA,aACkC;CAClC,OAAO,WAAW,wBAAwB,SAAS,WAAW;AAC/D;AAEA,SAAS,gBACR,SACA,aAC4B;CAC5B,OAAO,WAAW,kBAAkB,SAAS,WAAW;AACzD;;;;;AAMA,MAAM,aAAa,sBAAsB;CAAC;CAAe;CAAS;CAAa;AAAY,CAAC;;;;;;AAO5F,MAAM,mBAAqD;CAC1D;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD;AACA,MAAM,aAAa,sBAAsB,gBAAgB;AAEzD,MAAM,qBAAkF;CACvF,OAAO;CACP,QAAQ;CACR,kBAAkB;CAClB,eAAe;CACf,SAAS;CAET,mBAAmB;CAInB,OAAO,sBAAsB;EAC5B;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACD,CAAC;CAED,iBAAiB,sBAAsB;EACtC;EACA;EACA;EACA;EACA;EACA;EACA;CACD,CAAC;CACD,OAAO,sBAAsB,CAAC,GAAG,kBAAkB,WAAW,CAAC;AAChE;;;;;;;AAQA,MAAM,+BAA4F,OAAO,YACxG,OAAO,QAAQ,kBAAkB,CAAC,CAAC,KAAK,CAAC,YAAY,cAAc;CAClE,MAAM,aAA2D,EAAE,GAAG,S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,SAAS,MAAM,OAAO;CAEzC,OAAO,uBAAuB,OAC7B,UACC,MAAM,WAAW,aACjB,UAAU,eACT,UAAU,gBAAgB,CAAC,QAAQ,cACpC,IAAI,WAAW,SACjB;AACD"}
@@ -18,10 +18,11 @@ import { IntegrationAuthenticationProvider, IntegrationAuthenticationProviderDes
18
18
  import { IssueTrackerCreateOptions, IssueTrackerCreateOptionsResult, IssueTrackerDeleteOptions, IssueTrackerField, IssueTrackerIssueReceipt, IssueTrackerIssueWriteOptions, IssueTrackerIssueWriteOptionsResult, IssueTrackerStatus, IssueTrackerTransition, IssueTrackerWriteConnection, IssueTrackerWriteFailure, IssueTrackerWriteOptions, IssueTrackerWriteResult, IssueTrackerWriteTargetOptions, IssueTrackerWriteTargetResult } from "./models/issueTrackerWrites.js";
19
19
  import { AzureServerWorkItemWriteScope, AzureServicesWorkItemWriteScope, WorkItemAddress, WorkItemCreateOptions, WorkItemCreateOptionsResult, WorkItemDeleteCapability, WorkItemDeleteOptions, WorkItemDeleteResult, WorkItemDeleteTargetChanged, WorkItemDeletion, WorkItemReceipt, WorkItemState, WorkItemWriteContext, WorkItemWriteField, WorkItemWriteOptions, WorkItemWriteOptionsResult, WorkItemWriteResult, WorkItemWriteScope, WorkItemWriteTargetOptions, WorkItemWriteTargetResult } from "./models/workItemWrites.js";
20
20
  import { AzurePullRequestCreateCapabilityOptions, AzurePullRequestCreateCapabilityResult, AzurePullRequestMergeStrategy, AzurePullRequestRepository, AzurePullRequestWriteAction, AzurePullRequestWriteFailure, AzurePullRequestWriteOptions, AzurePullRequestWriteResult, AzurePullRequestWriteTargetOptions, AzurePullRequestWriteTargetResult, AzureServerPullRequestWriteOptions, AzureServerPullRequestWriteScope, AzureServerPullRequestWriteTargetOptions, AzureWrittenPullRequest } from "./models/azurePullRequestWrites.js";
21
+ import { BitbucketPullRequestCreateCapabilityOptions, BitbucketPullRequestCreateCapabilityResult, BitbucketPullRequestMergeCapability, BitbucketPullRequestMergeStatusOptions, BitbucketPullRequestMergeStatusResult, BitbucketPullRequestMergeStrategy, BitbucketPullRequestRepository, BitbucketPullRequestWriteAction, BitbucketPullRequestWriteFailure, BitbucketPullRequestWriteOptions, BitbucketPullRequestWriteReleaseOptions, BitbucketPullRequestWriteReleaseResult, BitbucketPullRequestWriteResult, BitbucketPullRequestWriteTargetOptions, BitbucketPullRequestWriteTargetResult, BitbucketUnsettledPullRequestWrite, BitbucketWrittenPullRequest } from "./models/bitbucketPullRequestWrites.js";
21
22
  import { CaptureRelationshipCurrency, IssueRelationshipFailure, IssueRelationshipPin, IssueRelationshipReceipt, IssueRelationshipWriteOptions, IssueRelationshipWriteResult, IssueRelationshipsOptions, IssueRelationshipsResult } from "./models/issueRelationships.js";
22
23
  import { IssueFilter } from "./providerFilters.js";
23
24
  import { IssueEtagInclude, PullRequestEtagInclude } from "./reads/etag.js";
24
- import { ConnectionStateChangeEvent, CurrentAccountResult, IssueBatchResult, IssueBatchTarget, IssueCountResult, IssueCountScope, ProviderBroadenResult, ProviderLinearProjectShape, ProviderOrganization, ProviderPageInfo, ProviderPagedResult, ProviderRepositoryShape, ProviderResult, ProviderSweepResult, ProviderSweepTargetRef, ProviderWarning, ProviderWarningCause, ProviderWarningCauseReason, ProviderWarningKind, ProviderWarningOmission, ProviderWarningOmissionKind, ProviderWarningOmissionRecovery, ProviderWarningOmissionScope, ProviderWarningScope, ProviderWarningSelector, ProviderWarningUnreadableItems, PullRequestActivityResult, PullRequestActivityTarget, PullRequestBatchResult, PullRequestBatchTarget, PullRequestBranchResult, PullRequestBranchTarget, PullRequestCheckLogResult, PullRequestCheckLogTarget, PullRequestCountResult, PullRequestCountScope, PullRequestForCommitResult, RepositoryIdentity, RepositoryResolution, RepositoryResolutionStatus, ResolveRepositoryResult } from "./results.js";
25
+ import { ConnectionStateChangeEvent, CurrentAccountResult, IssueBatchResult, IssueBatchTarget, IssueCountResult, IssueCountScope, ProviderBroadenResult, ProviderLinearProjectShape, ProviderOrganization, ProviderPageInfo, ProviderPagedResult, ProviderPullRequestSearchResult, ProviderRepositoryShape, ProviderResult, ProviderSweepResult, ProviderSweepTargetRef, ProviderWarning, ProviderWarningCause, ProviderWarningCauseReason, ProviderWarningKind, ProviderWarningOmission, ProviderWarningOmissionKind, ProviderWarningOmissionRecovery, ProviderWarningOmissionScope, ProviderWarningScope, ProviderWarningSelector, ProviderWarningUnreadableItems, PullRequestActivityResult, PullRequestActivityTarget, PullRequestBatchResult, PullRequestBatchTarget, PullRequestBranchResult, PullRequestBranchTarget, PullRequestCheckLogResult, PullRequestCheckLogTarget, PullRequestCountResult, PullRequestCountScope, PullRequestForCommitResult, RepositoryIdentity, RepositoryResolution, RepositoryResolutionStatus, ResolveRepositoryResult } from "./results.js";
25
26
  import { ClosedPullRequestSweepOptions, GetAutolinkReferencesOptions, IntegrationManager, IssueDeleteOptions, IssueWriteOptions, IssueWriteTargetOptions, IssueWriteTargetResult, ListLinearProjectsOptions, ListOrgsOptions, ListProjectsOptions, ProviderBroadenOrg, ProviderRepositoriesInput, ProviderRepositoryInput, ProviderSweepTarget, ProviderSweepTargetEvent, PullRequestCreateCapabilityOptions, PullRequestSweepOptions, PullRequestWriteOptions, PullRequestWriteTargetOptions } from "./manager.js";
26
27
  import { GitHostIntegration, Integration, IntegrationById, IntegrationCacheDescriptor, IntegrationConnectedKey, IntegrationCredential, IntegrationResult, IntegrationType, IssuesIntegration, MyPullRequestsForReposOptions, SearchMyPullRequestsOptions, SearchPullRequestsOptions, isGitHostIntegration, isIntegration, isIssuesIntegration } from "./models/publicIntegration.js";
27
28
  import { AccountProvider, AuthenticationSessionsChangeEvent, ConfigChangeEvent, ConfigProvider, HttpProvider, IntegrationServiceHooks, IntegrationStorageProvider, IntegrationsRemoteConfig, RepositoriesProvider } from "./context.js";
@@ -108,5 +109,5 @@ export interface IntegrationManagerContext {
108
109
  */
109
110
  export declare function createIntegrationManager(ctx: IntegrationManagerContext): IntegrationManager;
110
111
  //#endregion
111
- export { type Account, type AccountProvider, type ActionablePullRequest, type ActionablePullRequestAccount, ActionablePullRequestBuildStatusState, type ActionablePullRequestCategory, type ActionablePullRequestEnrichedItem, type ActionablePullRequestEnrichedItems, type ActionablePullRequestFields, type ActionablePullRequestInput, ActionablePullRequestReviewState, type AuthenticationSessionLike, type AuthenticationSessionsChangeEvent, type Autolink, type AutolinkReference, type AzurePullRequestCreateCapabilityOptions, type AzurePullRequestCreateCapabilityResult, type AzurePullRequestMergeStrategy, type AzurePullRequestRepository, type AzurePullRequestWriteAction, type AzurePullRequestWriteFailure, type AzurePullRequestWriteOptions, type AzurePullRequestWriteResult, type AzurePullRequestWriteTargetOptions, type AzurePullRequestWriteTargetResult, type AzureServerPullRequestWriteOptions, type AzureServerPullRequestWriteScope, type AzureServerPullRequestWriteTargetOptions, type AzureServerWorkItemWriteScope, type AzureServicesWorkItemWriteScope, type AzureWrittenPullRequest, type CaptureRelationshipCurrency, type ClosedPullRequestSweepOptions, type CloudIntegrationAuthType, type CloudIntegrationConnection, type CloudIntegrationType, type ConfigChangeEvent, type ConfigProvider, type ConfiguredIntegrationDescriptor, type ConfiguredIntegrationsChangeEvent, type ConnectionStateChangeEvent, type CurrentAccountResult, type DynamicAutolinkReference, type EntityIdentifier, type EntityIdentifierFields, type EntityIdentifierInput, EntityIdentifierProviderType, EntityType, EntityVersion, type FieldPresence, type GetAutolinkReferencesOptions, GitCloudHostIntegrationId, type GitConfigEntityIdentifier, type GitHostIntegration, GitSelfManagedHostIntegrationId, type HttpProvider, type Integration, type IntegrationAuthenticationProvider, type IntegrationAuthenticationProviderDescriptor, type IntegrationAuthenticationSessionDescriptor, type IntegrationById, type IntegrationCacheDescriptor, type IntegrationConnectedKey, type IntegrationCredential, type IntegrationIds, type IntegrationManager, type IntegrationResult, type IntegrationServiceHooks, type IntegrationStorageProvider, type IntegrationType, type IntegrationsRemoteConfig, type IssueBatchResult, type IssueBatchTarget, type IssueCountResult, type IssueCountScope, type IssueDeleteOptions, type IssueEtagInclude, type IssueFieldGroup, IssueFilter, type IssueProjection, type IssueRelationshipFailure, type IssueRelationshipPin, type IssueRelationshipReceipt, type IssueRelationshipWriteOptions, type IssueRelationshipWriteResult, type IssueRelationshipsOptions, type IssueRelationshipsResult, type IssueSearchCapabilities, type IssueSearchCriteria, type IssueSearchRelationship, type IssueStateFilter, type IssueTrackerCreateOptions, type IssueTrackerCreateOptionsResult, type IssueTrackerDeleteOptions, type IssueTrackerField, type IssueTrackerIssueReceipt, type IssueTrackerIssueWriteOptions, type IssueTrackerIssueWriteOptionsResult, type IssueTrackerStatus, type IssueTrackerTransition, type IssueTrackerWriteConnection, type IssueTrackerWriteFailure, type IssueTrackerWriteOptions, type IssueTrackerWriteResult, type IssueTrackerWriteTargetOptions, type IssueTrackerWriteTargetResult, type IssueWriteOptions, type IssueWriteResult, type IssueWriteTargetOptions, type IssueWriteTargetResult, IssuesCloudHostIntegrationId, type IssuesIntegration, IssuesSelfManagedHostIntegrationId, type ListLinearProjectsOptions, type ListOrgsOptions, type ListProjectsOptions, LookupBackedOffError, type ManualTokenAuthProviderOptions, type MyPullRequestsForReposOptions, type ProviderAuthenticationSession, type ProviderBroadenOrg, type ProviderBroadenResult, type ProviderLinearProjectShape, type ProviderMetadata, type ProviderOrganization, type ProviderPageInfo, type ProviderPagedResult, type ProviderReference, type ProviderRepositoriesInput, type ProviderRepositoryInput, type ProviderRepositoryShape, type ProviderResult, type ProviderSweepResult, type ProviderSweepTarget, type ProviderSweepTargetEvent, type ProviderSweepTargetRef, type ProviderWarning, type ProviderWarningCause, type ProviderWarningCauseReason, type ProviderWarningKind, type ProviderWarningOmission, type ProviderWarningOmissionKind, type ProviderWarningOmissionRecovery, type ProviderWarningOmissionScope, type ProviderWarningScope, type ProviderWarningSelector, type ProviderWarningUnreadableItems, type PullRequestActivityAuthor, type PullRequestActivityComment, type PullRequestActivityItem, type PullRequestActivityResult, type PullRequestActivityReview, type PullRequestActivityReviewComment, type PullRequestActivityTarget, type PullRequestBatchResult, type PullRequestBatchTarget, type PullRequestBranchResult, type PullRequestBranchTarget, type PullRequestCheckLogResult, type PullRequestCheckLogTarget, type PullRequestCountResult, type PullRequestCountScope, type PullRequestCreateCapabilityOptions, type PullRequestCreateCapabilityResult, type PullRequestEntityIdentifierInput, type PullRequestEtagInclude, type PullRequestFieldGroup, PullRequestFilter, type PullRequestForCommitResult, type PullRequestProjection, type PullRequestSearchCapabilities, type PullRequestSearchCriteria, type PullRequestStateFilter, type PullRequestSweepOptions, type PullRequestWriteFailure, type PullRequestWriteOptions, type PullRequestWriteResult, type PullRequestWriteSnapshot, type PullRequestWriteTargetOptions, type PullRequestWriteTargetResult, type RefSet, type RepositoriesProvider, type RepositoryIdentity, type RepositoryResolution, type RepositoryResolutionStatus, type ResolveRepositoryResult, type SearchMyPullRequestsOptions, type SearchPullRequestsOptions, type Source, type Sources, type SupportedCloudIntegrationIds, type TokenInfo, type WorkItemAddress, type WorkItemCreateOptions, type WorkItemCreateOptionsResult, type WorkItemDeleteCapability, type WorkItemDeleteOptions, type WorkItemDeleteResult, type WorkItemDeleteTargetChanged, type WorkItemDeletion, type WorkItemReceipt, type WorkItemState, type WorkItemWriteContext, type WorkItemWriteField, type WorkItemWriteOptions, type WorkItemWriteOptionsResult, type WorkItemWriteResult, type WorkItemWriteScope, type WorkItemWriteTargetOptions, type WorkItemWriteTargetResult, areDomainsOnSameHost, convertRemoteProviderIdToIntegrationId, createManualTokenAuthProvider, decodeEntityIdentifier, decodeEntityIdentifiersFromGitConfig, encodeEntityIdentifier, encodeIssueOrPullRequestForGitConfig, getActionablePullRequests, getAzureRepositoryIdentity, getEntityIdentifierInput, getIntegrationConnectedKey, getIntegrationIdForRemote, getIssueFieldPresence, getIssueFromGitConfigEntityIdentifier, getIssueOwner, getProviderIdFromEntityIdentifier, getPullRequestFieldPresence, getSingleConfiguredDomain, hostFromDomain, isAzureProviderId, isCloudGitSelfManagedHostIntegrationId, isGitCloudHostIntegrationId, isGitHostIntegration, isGitSelfManagedHostIntegrationId, isIntegration, isIntegrationId, isIssuesHostIntegrationId, isIssuesIntegration, isMaybeGitLabPullRequestUrl, isSelfManagedHostIntegrationId, isSupportedCloudIntegrationId, providersMetadata, splitOwnerAndRepo, supportsCodeSuggest, toActionablePullRequestInput, toCloudIntegrationType, toIntegrationId, toTokenInfo, toTokenWithInfo };
112
+ export { type Account, type AccountProvider, type ActionablePullRequest, type ActionablePullRequestAccount, ActionablePullRequestBuildStatusState, type ActionablePullRequestCategory, type ActionablePullRequestEnrichedItem, type ActionablePullRequestEnrichedItems, type ActionablePullRequestFields, type ActionablePullRequestInput, ActionablePullRequestReviewState, type AuthenticationSessionLike, type AuthenticationSessionsChangeEvent, type Autolink, type AutolinkReference, type AzurePullRequestCreateCapabilityOptions, type AzurePullRequestCreateCapabilityResult, type AzurePullRequestMergeStrategy, type AzurePullRequestRepository, type AzurePullRequestWriteAction, type AzurePullRequestWriteFailure, type AzurePullRequestWriteOptions, type AzurePullRequestWriteResult, type AzurePullRequestWriteTargetOptions, type AzurePullRequestWriteTargetResult, type AzureServerPullRequestWriteOptions, type AzureServerPullRequestWriteScope, type AzureServerPullRequestWriteTargetOptions, type AzureServerWorkItemWriteScope, type AzureServicesWorkItemWriteScope, type AzureWrittenPullRequest, type BitbucketPullRequestCreateCapabilityOptions, type BitbucketPullRequestCreateCapabilityResult, type BitbucketPullRequestMergeCapability, type BitbucketPullRequestMergeStatusOptions, type BitbucketPullRequestMergeStatusResult, type BitbucketPullRequestMergeStrategy, type BitbucketPullRequestRepository, type BitbucketPullRequestWriteAction, type BitbucketPullRequestWriteFailure, type BitbucketPullRequestWriteOptions, type BitbucketPullRequestWriteReleaseOptions, type BitbucketPullRequestWriteReleaseResult, type BitbucketPullRequestWriteResult, type BitbucketPullRequestWriteTargetOptions, type BitbucketPullRequestWriteTargetResult, type BitbucketUnsettledPullRequestWrite, type BitbucketWrittenPullRequest, type CaptureRelationshipCurrency, type ClosedPullRequestSweepOptions, type CloudIntegrationAuthType, type CloudIntegrationConnection, type CloudIntegrationType, type ConfigChangeEvent, type ConfigProvider, type ConfiguredIntegrationDescriptor, type ConfiguredIntegrationsChangeEvent, type ConnectionStateChangeEvent, type CurrentAccountResult, type DynamicAutolinkReference, type EntityIdentifier, type EntityIdentifierFields, type EntityIdentifierInput, EntityIdentifierProviderType, EntityType, EntityVersion, type FieldPresence, type GetAutolinkReferencesOptions, GitCloudHostIntegrationId, type GitConfigEntityIdentifier, type GitHostIntegration, GitSelfManagedHostIntegrationId, type HttpProvider, type Integration, type IntegrationAuthenticationProvider, type IntegrationAuthenticationProviderDescriptor, type IntegrationAuthenticationSessionDescriptor, type IntegrationById, type IntegrationCacheDescriptor, type IntegrationConnectedKey, type IntegrationCredential, type IntegrationIds, type IntegrationManager, type IntegrationResult, type IntegrationServiceHooks, type IntegrationStorageProvider, type IntegrationType, type IntegrationsRemoteConfig, type IssueBatchResult, type IssueBatchTarget, type IssueCountResult, type IssueCountScope, type IssueDeleteOptions, type IssueEtagInclude, type IssueFieldGroup, IssueFilter, type IssueProjection, type IssueRelationshipFailure, type IssueRelationshipPin, type IssueRelationshipReceipt, type IssueRelationshipWriteOptions, type IssueRelationshipWriteResult, type IssueRelationshipsOptions, type IssueRelationshipsResult, type IssueSearchCapabilities, type IssueSearchCriteria, type IssueSearchRelationship, type IssueStateFilter, type IssueTrackerCreateOptions, type IssueTrackerCreateOptionsResult, type IssueTrackerDeleteOptions, type IssueTrackerField, type IssueTrackerIssueReceipt, type IssueTrackerIssueWriteOptions, type IssueTrackerIssueWriteOptionsResult, type IssueTrackerStatus, type IssueTrackerTransition, type IssueTrackerWriteConnection, type IssueTrackerWriteFailure, type IssueTrackerWriteOptions, type IssueTrackerWriteResult, type IssueTrackerWriteTargetOptions, type IssueTrackerWriteTargetResult, type IssueWriteOptions, type IssueWriteResult, type IssueWriteTargetOptions, type IssueWriteTargetResult, IssuesCloudHostIntegrationId, type IssuesIntegration, IssuesSelfManagedHostIntegrationId, type ListLinearProjectsOptions, type ListOrgsOptions, type ListProjectsOptions, LookupBackedOffError, type ManualTokenAuthProviderOptions, type MyPullRequestsForReposOptions, type ProviderAuthenticationSession, type ProviderBroadenOrg, type ProviderBroadenResult, type ProviderLinearProjectShape, type ProviderMetadata, type ProviderOrganization, type ProviderPageInfo, type ProviderPagedResult, type ProviderPullRequestSearchResult, type ProviderReference, type ProviderRepositoriesInput, type ProviderRepositoryInput, type ProviderRepositoryShape, type ProviderResult, type ProviderSweepResult, type ProviderSweepTarget, type ProviderSweepTargetEvent, type ProviderSweepTargetRef, type ProviderWarning, type ProviderWarningCause, type ProviderWarningCauseReason, type ProviderWarningKind, type ProviderWarningOmission, type ProviderWarningOmissionKind, type ProviderWarningOmissionRecovery, type ProviderWarningOmissionScope, type ProviderWarningScope, type ProviderWarningSelector, type ProviderWarningUnreadableItems, type PullRequestActivityAuthor, type PullRequestActivityComment, type PullRequestActivityItem, type PullRequestActivityResult, type PullRequestActivityReview, type PullRequestActivityReviewComment, type PullRequestActivityTarget, type PullRequestBatchResult, type PullRequestBatchTarget, type PullRequestBranchResult, type PullRequestBranchTarget, type PullRequestCheckLogResult, type PullRequestCheckLogTarget, type PullRequestCountResult, type PullRequestCountScope, type PullRequestCreateCapabilityOptions, type PullRequestCreateCapabilityResult, type PullRequestEntityIdentifierInput, type PullRequestEtagInclude, type PullRequestFieldGroup, PullRequestFilter, type PullRequestForCommitResult, type PullRequestProjection, type PullRequestSearchCapabilities, type PullRequestSearchCriteria, type PullRequestStateFilter, type PullRequestSweepOptions, type PullRequestWriteFailure, type PullRequestWriteOptions, type PullRequestWriteResult, type PullRequestWriteSnapshot, type PullRequestWriteTargetOptions, type PullRequestWriteTargetResult, type RefSet, type RepositoriesProvider, type RepositoryIdentity, type RepositoryResolution, type RepositoryResolutionStatus, type ResolveRepositoryResult, type SearchMyPullRequestsOptions, type SearchPullRequestsOptions, type Source, type Sources, type SupportedCloudIntegrationIds, type TokenInfo, type WorkItemAddress, type WorkItemCreateOptions, type WorkItemCreateOptionsResult, type WorkItemDeleteCapability, type WorkItemDeleteOptions, type WorkItemDeleteResult, type WorkItemDeleteTargetChanged, type WorkItemDeletion, type WorkItemReceipt, type WorkItemState, type WorkItemWriteContext, type WorkItemWriteField, type WorkItemWriteOptions, type WorkItemWriteOptionsResult, type WorkItemWriteResult, type WorkItemWriteScope, type WorkItemWriteTargetOptions, type WorkItemWriteTargetResult, areDomainsOnSameHost, convertRemoteProviderIdToIntegrationId, createManualTokenAuthProvider, decodeEntityIdentifier, decodeEntityIdentifiersFromGitConfig, encodeEntityIdentifier, encodeIssueOrPullRequestForGitConfig, getActionablePullRequests, getAzureRepositoryIdentity, getEntityIdentifierInput, getIntegrationConnectedKey, getIntegrationIdForRemote, getIssueFieldPresence, getIssueFromGitConfigEntityIdentifier, getIssueOwner, getProviderIdFromEntityIdentifier, getPullRequestFieldPresence, getSingleConfiguredDomain, hostFromDomain, isAzureProviderId, isCloudGitSelfManagedHostIntegrationId, isGitCloudHostIntegrationId, isGitHostIntegration, isGitSelfManagedHostIntegrationId, isIntegration, isIntegrationId, isIssuesHostIntegrationId, isIssuesIntegration, isMaybeGitLabPullRequestUrl, isSelfManagedHostIntegrationId, isSupportedCloudIntegrationId, providersMetadata, splitOwnerAndRepo, supportsCodeSuggest, toActionablePullRequestInput, toCloudIntegrationType, toIntegrationId, toTokenInfo, toTokenWithInfo };
112
113
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../../plus/integrations/src/index.ts"],"sourcesContent":["// Public facade for `@gitlens/integrations`.\n//\n// External consumers should import from this entry point only, not from the\n// package's internal subpaths, with one exception: the lightweight, token-scoped\n// read API is a supported public subpath (`./lite.js`). It's kept out of this\n// facade on purpose so importing the session-managed manager doesn't eagerly pull\n// in every provider API client. The internal classes (IntegrationService,\n// IntegrationAuthenticationService, etc.) are not part of the public API and\n// may be refactored without semver bumps.\n\nimport type { Account } from '@gitlens/git/models/author.js';\nimport type { DefaultBranch } from '@gitlens/git/models/defaultBranch.js';\nimport type { Issue } from '@gitlens/git/models/issue.js';\nimport type { IssueOrPullRequest, IssueOrPullRequestType } from '@gitlens/git/models/issueOrPullRequest.js';\nimport type { PullRequest } from '@gitlens/git/models/pullRequest.js';\nimport type { RepositoryMetadata } from '@gitlens/git/models/repositoryMetadata.js';\nimport type { ResourceDescriptor } from '@gitlens/git/models/resourceDescriptor.js';\nimport { CacheController } from '@gitlens/utils/promiseCache.js';\nimport type {\n\tAccountProvider,\n\tConfigProvider,\n\tHttpProvider,\n\tIntegrationCacheProvider,\n\tIntegrationServiceHooks,\n\tIntegrationStorageProvider,\n\tRepositoriesProvider,\n} from './context.js';\nimport { createIntegrationService } from './integrationService.js';\nimport type { IntegrationManager } from './manager.js';\nimport type { IntegrationCacheDescriptor } from './models/publicIntegration.js';\n\nexport type { Autolink, AutolinkReference, DynamicAutolinkReference, RefSet } from '@gitlens/git/models/autolink.js';\nexport type { ProviderReference } from '@gitlens/git/models/remoteProvider.js';\n\n/** A cached provider value, which may still be resolving. */\nexport type IntegrationManagerCacheResult<T> = Promise<T | undefined> | T | undefined;\n\n/** Produces an account value on a cache miss. */\nexport type IntegrationManagerCacheLoader<T> = (cacheable: CacheController) => {\n\tvalue: IntegrationManagerCacheResult<T>;\n\texpiresAt?: number;\n};\n\n/** The integration identity supplied to the consumer-owned account cache. */\nexport type IntegrationAccountCacheDescriptor = IntegrationCacheDescriptor;\n\n/** Cache controls attached to a provider account lookup. */\nexport interface IntegrationManagerCacheOptions {\n\treadonly connectionId?: string;\n\treadonly etag?: string;\n\treadonly expiryOverride?: boolean | number;\n\treadonly expireOnError?: boolean;\n}\n\n/**\n * Optional consumer-owned cache for values reused by the public manager facade.\n *\n * Only `getCurrentAccount` is required. Each other lookup is optional: one the cache omits runs its loader on every\n * call, uncached. A cache that keys entries by integration should key them by the descriptor's `id` and `domain`,\n * and treat `maybeConnected` and `sessionFingerprint` as the entry's etag, so a reconnect or a token change misses.\n *\n * The manager calls each method on the cache object itself, so a class instance (methods on its prototype) works.\n */\nexport interface IntegrationManagerCacheProvider {\n\tgetCurrentAccount(\n\t\tintegration: IntegrationAccountCacheDescriptor,\n\t\tcacheable: IntegrationManagerCacheLoader<Account>,\n\t\toptions?: IntegrationManagerCacheOptions,\n\t): IntegrationManagerCacheResult<Account>;\n\tgetRepositoryMetadata?(\n\t\trepo: ResourceDescriptor,\n\t\tintegration: IntegrationCacheDescriptor | undefined,\n\t\tcacheable: IntegrationManagerCacheLoader<RepositoryMetadata>,\n\t\toptions?: IntegrationManagerCacheOptions,\n\t): IntegrationManagerCacheResult<RepositoryMetadata>;\n\tgetRepositoryDefaultBranch?(\n\t\trepo: ResourceDescriptor,\n\t\tintegration: IntegrationCacheDescriptor | undefined,\n\t\tcacheable: IntegrationManagerCacheLoader<DefaultBranch>,\n\t\toptions?: IntegrationManagerCacheOptions,\n\t): IntegrationManagerCacheResult<DefaultBranch>;\n\tgetPullRequestForSha?(\n\t\tsha: string,\n\t\trepo: ResourceDescriptor,\n\t\tintegration: IntegrationCacheDescriptor | undefined,\n\t\tcacheable: IntegrationManagerCacheLoader<PullRequest>,\n\t\toptions?: IntegrationManagerCacheOptions,\n\t): IntegrationManagerCacheResult<PullRequest>;\n\tgetPullRequestForBranch?(\n\t\tbranch: string,\n\t\trepo: ResourceDescriptor,\n\t\tintegration: IntegrationCacheDescriptor | undefined,\n\t\tcacheable: IntegrationManagerCacheLoader<PullRequest>,\n\t\toptions?: IntegrationManagerCacheOptions,\n\t): IntegrationManagerCacheResult<PullRequest>;\n\tgetPullRequest?(\n\t\tid: string,\n\t\tresource: ResourceDescriptor,\n\t\tintegration: IntegrationCacheDescriptor | undefined,\n\t\tcacheable: IntegrationManagerCacheLoader<PullRequest>,\n\t\toptions?: IntegrationManagerCacheOptions,\n\t): IntegrationManagerCacheResult<PullRequest>;\n\tgetIssueOrPullRequest?(\n\t\tid: string,\n\t\ttype: IssueOrPullRequestType | undefined,\n\t\tresource: ResourceDescriptor,\n\t\tintegration: IntegrationCacheDescriptor | undefined,\n\t\tcacheable: IntegrationManagerCacheLoader<IssueOrPullRequest>,\n\t\toptions?: IntegrationManagerCacheOptions,\n\t): IntegrationManagerCacheResult<IssueOrPullRequest>;\n\tgetIssue?(\n\t\tid: string,\n\t\tresource: ResourceDescriptor,\n\t\tintegration: IntegrationCacheDescriptor | undefined,\n\t\tcacheable: IntegrationManagerCacheLoader<Issue>,\n\t\toptions?: IntegrationManagerCacheOptions,\n\t): IntegrationManagerCacheResult<Issue>;\n\t/** Evicts cached pull requests for the given installation origin, or all pull requests when omitted. */\n\tdeletePullRequests?(scope?: { id: IntegrationCacheDescriptor['id']; domain: string }): void;\n}\n\nfunction loadUncached<T>(loader: IntegrationManagerCacheLoader<T>): IntegrationManagerCacheResult<T> {\n\treturn loader(new CacheController()).value;\n}\n\n/**\n * What a consumer cache is handed in place of the integration itself. The getters read through to the integration\n * when the cache reads them, as reading the integration did, without handing a consumer the class.\n */\nfunction toCacheDescriptor(integration: IntegrationCacheDescriptor): IntegrationCacheDescriptor;\nfunction toCacheDescriptor(integration: IntegrationCacheDescriptor | undefined): IntegrationCacheDescriptor | undefined;\nfunction toCacheDescriptor(\n\tintegration: IntegrationCacheDescriptor | undefined,\n): IntegrationCacheDescriptor | undefined {\n\tif (integration == null) return undefined;\n\n\treturn {\n\t\tid: integration.id,\n\t\tdomain: integration.domain,\n\t\t...(integration.installationOrigin != null && { installationOrigin: integration.installationOrigin }),\n\t\tget maybeConnected() {\n\t\t\treturn integration.maybeConnected;\n\t\t},\n\t\tget sessionFingerprint() {\n\t\t\treturn integration.sessionFingerprint;\n\t\t},\n\t};\n}\n\nconst uncachedIntegrationCacheProvider: IntegrationCacheProvider = {\n\tgetRepositoryMetadata: (_repo, _integration, loader) => loadUncached(loader),\n\tgetRepositoryDefaultBranch: (_repo, _integration, loader) => loadUncached(loader),\n\tgetPullRequestForSha: (_sha, _repo, _integration, loader) => loadUncached(loader),\n\tgetPullRequestForBranch: (_branch, _repo, _integration, loader) => loadUncached(loader),\n\tgetPullRequest: (_id, _resource, _integration, loader) => loadUncached(loader),\n\tgetIssueOrPullRequest: (_id, _type, _resource, _integration, loader) => loadUncached(loader),\n\tgetIssue: (_id, _resource, _integration, loader) => loadUncached(loader),\n\tgetCurrentAccount: (_integration, loader) => loadUncached(loader),\n\t// Nothing is cached, so there is nothing to evict.\n\tdeletePullRequests: () => {},\n};\n\n/**\n * Adapts the consumer's cache to the internal one: each lookup the consumer supplies is called on `cache` itself (never\n * spread or detached, which would lose a class instance's prototype methods and `this`), and every other lookup runs\n * uncached.\n */\nfunction toIntegrationCacheProvider(cache: IntegrationManagerCacheProvider | undefined): IntegrationCacheProvider {\n\tif (cache == null) return uncachedIntegrationCacheProvider;\n\n\treturn {\n\t\tgetRepositoryMetadata: (repo, integration, loader, options) =>\n\t\t\tcache.getRepositoryMetadata != null\n\t\t\t\t? cache.getRepositoryMetadata(repo, toCacheDescriptor(integration), loader, options)\n\t\t\t\t: loadUncached(loader),\n\t\tgetRepositoryDefaultBranch: (repo, integration, loader, options) =>\n\t\t\tcache.getRepositoryDefaultBranch != null\n\t\t\t\t? cache.getRepositoryDefaultBranch(repo, toCacheDescriptor(integration), loader, options)\n\t\t\t\t: loadUncached(loader),\n\t\tgetPullRequestForSha: (sha, repo, integration, loader, options) =>\n\t\t\tcache.getPullRequestForSha != null\n\t\t\t\t? cache.getPullRequestForSha(sha, repo, toCacheDescriptor(integration), loader, options)\n\t\t\t\t: loadUncached(loader),\n\t\tgetPullRequestForBranch: (branch, repo, integration, loader, options) =>\n\t\t\tcache.getPullRequestForBranch != null\n\t\t\t\t? cache.getPullRequestForBranch(branch, repo, toCacheDescriptor(integration), loader, options)\n\t\t\t\t: loadUncached(loader),\n\t\tgetPullRequest: (id, resource, integration, loader, options) =>\n\t\t\tcache.getPullRequest != null\n\t\t\t\t? cache.getPullRequest(id, resource, toCacheDescriptor(integration), loader, options)\n\t\t\t\t: loadUncached(loader),\n\t\tgetIssueOrPullRequest: (id, type, resource, integration, loader, options) =>\n\t\t\tcache.getIssueOrPullRequest != null\n\t\t\t\t? cache.getIssueOrPullRequest(id, type, resource, toCacheDescriptor(integration), loader, options)\n\t\t\t\t: loadUncached(loader),\n\t\tgetIssue: (id, resource, integration, loader, options) =>\n\t\t\tcache.getIssue != null\n\t\t\t\t? cache.getIssue(id, resource, toCacheDescriptor(integration), loader, options)\n\t\t\t\t: loadUncached(loader),\n\t\tgetCurrentAccount: (integration, loader, options) =>\n\t\t\tcache.getCurrentAccount(toCacheDescriptor(integration), loader, options),\n\t\tdeletePullRequests: scope => cache.deletePullRequests?.(scope),\n\t};\n}\n\n/**\n * Consumer-facing runtime for {@link createIntegrationManager}.\n *\n * External consumers may omit `cache`; reads then execute their loaders directly without cross-call caching.\n * The extension host's broader integration context remains private to the implementation.\n */\nexport interface IntegrationManagerContext {\n\treadonly storage: IntegrationStorageProvider;\n\treadonly account: AccountProvider;\n\treadonly config: ConfigProvider;\n\treadonly http: HttpProvider;\n\treadonly cache?: IntegrationManagerCacheProvider;\n\treadonly repositories: RepositoriesProvider;\n\treadonly hooks?: IntegrationServiceHooks;\n}\n\nexport type {\n\tClosedPullRequestSweepOptions,\n\tGetAutolinkReferencesOptions,\n\tIntegrationManager,\n\tIssueDeleteOptions,\n\tIssueWriteOptions,\n\tIssueWriteTargetOptions,\n\tIssueWriteTargetResult,\n\tListLinearProjectsOptions,\n\tListOrgsOptions,\n\tListProjectsOptions,\n\t// Every option shape a caller has to BUILD is exported, not just the ones the manager returns:\n\t// `manager.js` is not a public subpath, so a type omitted here can't be named by a consumer at all\n\t// (`broadenIssues`' `orgs` needed `ProviderBroadenOrg` and had to be re-declared downstream).\n\tProviderBroadenOrg,\n\tProviderRepositoriesInput,\n\tProviderRepositoryInput,\n\tProviderSweepTarget,\n\tProviderSweepTargetEvent,\n\tPullRequestCreateCapabilityOptions,\n\tPullRequestSweepOptions,\n\tPullRequestWriteOptions,\n\tPullRequestWriteTargetOptions,\n} from './manager.js';\nexport type {\n\tIssueTrackerCreateOptions,\n\tIssueTrackerCreateOptionsResult,\n\tIssueTrackerDeleteOptions,\n\tIssueTrackerField,\n\tIssueTrackerIssueReceipt,\n\tIssueTrackerIssueWriteOptions,\n\tIssueTrackerIssueWriteOptionsResult,\n\tIssueTrackerStatus,\n\tIssueTrackerTransition,\n\tIssueTrackerWriteConnection,\n\tIssueTrackerWriteFailure,\n\tIssueTrackerWriteOptions,\n\tIssueTrackerWriteResult,\n\tIssueTrackerWriteTargetOptions,\n\tIssueTrackerWriteTargetResult,\n} from './models/issueTrackerWrites.js';\nexport type {\n\tAzurePullRequestCreateCapabilityOptions,\n\tAzurePullRequestCreateCapabilityResult,\n\tAzurePullRequestMergeStrategy,\n\tAzurePullRequestRepository,\n\tAzurePullRequestWriteAction,\n\tAzurePullRequestWriteFailure,\n\tAzurePullRequestWriteOptions,\n\tAzurePullRequestWriteResult,\n\tAzurePullRequestWriteTargetOptions,\n\tAzurePullRequestWriteTargetResult,\n\tAzureServerPullRequestWriteOptions,\n\tAzureServerPullRequestWriteScope,\n\tAzureServerPullRequestWriteTargetOptions,\n\tAzureWrittenPullRequest,\n} from './models/azurePullRequestWrites.js';\nexport type {\n\tAzureServerWorkItemWriteScope,\n\tAzureServicesWorkItemWriteScope,\n\tWorkItemAddress,\n\tWorkItemCreateOptions,\n\tWorkItemCreateOptionsResult,\n\tWorkItemDeleteCapability,\n\tWorkItemDeleteOptions,\n\tWorkItemDeleteResult,\n\tWorkItemDeleteTargetChanged,\n\tWorkItemDeletion,\n\tWorkItemReceipt,\n\tWorkItemState,\n\tWorkItemWriteContext,\n\tWorkItemWriteField,\n\tWorkItemWriteOptions,\n\tWorkItemWriteOptionsResult,\n\tWorkItemWriteResult,\n\tWorkItemWriteScope,\n\tWorkItemWriteTargetOptions,\n\tWorkItemWriteTargetResult,\n} from './models/workItemWrites.js';\nexport type {\n\tCaptureRelationshipCurrency,\n\tIssueRelationshipsOptions,\n\tIssueRelationshipsResult,\n\tIssueRelationshipWriteOptions,\n\tIssueRelationshipWriteResult,\n\tIssueRelationshipPin,\n\tIssueRelationshipReceipt,\n\tIssueRelationshipFailure,\n} from './models/issueRelationships.js';\nexport type { IssueWriteResult } from '@gitlens/git-github/api/issueWrites.js';\nexport type {\n\tPullRequestCreateCapabilityResult,\n\tPullRequestWriteFailure,\n\tPullRequestWriteResult,\n\tPullRequestWriteSnapshot,\n\tPullRequestWriteTargetResult,\n} from '@gitlens/git-github/api/pullRequestWrites.js';\n\n/**\n * Construct an `@gitlens/integrations` manager bound to the supplied runtime.\n *\n * The runtime is the **single** cross-boundary contract — anything the\n * package needs (HTTP, storage, cache, auth, subscription, telemetry, UI,\n * configuration, environment) flows through it. The package never imports\n * `vscode`, `Container`, or any consumer-internal types.\n *\n * The returned manager owns its internal services; dispose it (or its\n * containing scope) to release every cached integration plus the runtime's\n * own VS Code subscriptions.\n */\nexport function createIntegrationManager(ctx: IntegrationManagerContext): IntegrationManager {\n\treturn createIntegrationService({\n\t\t...ctx,\n\t\tcache: toIntegrationCacheProvider(ctx.cache),\n\t});\n}\n\n// Re-exports for the public API surface.\nexport type {\n\tAccountProvider,\n\tAuthenticationSessionsChangeEvent,\n\tConfigChangeEvent,\n\tConfigProvider,\n\tRepositoriesProvider,\n\tHttpProvider,\n\tIntegrationsRemoteConfig,\n\tIntegrationServiceHooks,\n\tIntegrationStorageProvider,\n} from './context.js';\nexport type { Source, Sources } from './telemetry.js';\nexport type { IntegrationIds, SupportedCloudIntegrationIds } from './constants.js';\nexport type { ConfiguredIntegrationsChangeEvent } from './authentication/configuredIntegrationService.js';\n\n// Authentication contract — what `IntegrationServiceHooks.createAuthenticationProvider`\n// implementers return. Consumers can plug in any auth strategy (manual token,\n// OAuth, host-managed) by returning an object implementing this interface from\n// the hook.\nexport type {\n\tIntegrationAuthenticationProvider,\n\tIntegrationAuthenticationProviderDescriptor,\n\tIntegrationAuthenticationSessionDescriptor,\n} from './authentication/integrationAuthenticationProvider.js';\nexport type {\n\tAuthenticationSessionLike,\n\tCloudIntegrationAuthType,\n\tCloudIntegrationConnection,\n\tCloudIntegrationType,\n\tConfiguredIntegrationDescriptor,\n\tProviderAuthenticationSession,\n} from './authentication/models.js';\n// Provider-id mapping helpers for consumers bridging their own provider ids to `IntegrationIds`\n// (e.g. mapping multi-account connections from `getConfigured` back to a provider) and vice versa.\nexport { toCloudIntegrationType, toIntegrationId } from './authentication/models.js';\n// Domain normalization is part of connection selection and repository resolution; consumers should use the\n// same implementation rather than importing an internal utility subpath or maintaining a divergent copy.\nexport { areDomainsOnSameHost, hostFromDomain } from './utils/domain.utils.js';\n\n// Convenience: wrap a static access token (env var, CLI flag, secret manager)\n// as an `IntegrationAuthenticationProvider`. For OAuth/refresh flows, implement\n// the interface directly — this helper is for non-interactive consumers only.\nexport {\n\tcreateManualTokenAuthProvider,\n\ttype ManualTokenAuthProviderOptions,\n} from './authentication/manualTokenProvider.js';\n\nexport {\n\tGitCloudHostIntegrationId,\n\tGitSelfManagedHostIntegrationId,\n\tIssuesCloudHostIntegrationId,\n\tIssuesSelfManagedHostIntegrationId,\n\tisIntegrationId,\n\tisSupportedCloudIntegrationId,\n} from './constants.js';\n\n// Neutral pagination + warning result types the Kepler ProviderBackend adapter maps to its own DTOs.\n// These carry no `@gitkraken/provider-apis` types, so consumers depend only on `@gitkraken/core-gitlens`.\nexport type {\n\tConnectionStateChangeEvent,\n\tProviderBroadenResult,\n\tProviderPagedResult,\n\tProviderPageInfo,\n\tProviderResult,\n\tProviderSweepResult,\n\tProviderSweepTargetRef,\n\tProviderWarning,\n\tProviderWarningCause,\n\tProviderWarningCauseReason,\n\tProviderWarningKind,\n\tProviderWarningOmission,\n\tProviderWarningOmissionKind,\n\tProviderWarningOmissionRecovery,\n\tProviderWarningOmissionScope,\n\tProviderWarningScope,\n\tProviderWarningSelector,\n\tProviderWarningUnreadableItems,\n\tProviderLinearProjectShape,\n\tProviderOrganization,\n\tProviderRepositoryShape,\n\tRepositoryIdentity,\n\tRepositoryResolution,\n\tRepositoryResolutionStatus,\n\tResolveRepositoryResult,\n} from './results.js';\n// Runtime enums — re-exported as values (not `export type`) so consumers can read their members.\nexport { IssueFilter, PullRequestFilter } from './providerFilters.js';\n// The filtered issue search's criteria model and the capability table that says which of it a provider honors.\n// String unions and plain interfaces, so a consumer builds criteria without importing an internal subpath.\nexport type { IssueSearchCapabilities, IssueSearchCriteria, IssueSearchRelationship } from './providerFilters.js';\n// Account-wide pull-request search criteria and the per-provider capability table.\nexport type { PullRequestSearchCapabilities, PullRequestSearchCriteria } from './providerFilters.js';\n// The count-only issue and pull-request probes' input and result shapes.\nexport type { IssueCountResult, IssueCountScope, PullRequestCountResult, PullRequestCountScope } from './results.js';\nexport type { IssueBatchResult, IssueBatchTarget } from './results.js';\nexport type { PullRequestBatchResult, PullRequestBatchTarget } from './results.js';\nexport type { IssueEtagInclude, PullRequestEtagInclude } from './reads/etag.js';\nexport type { PullRequestBranchResult, PullRequestBranchTarget } from './results.js';\nexport type { PullRequestCheckLogResult, PullRequestCheckLogTarget } from './results.js';\nexport type { PullRequestActivityResult, PullRequestActivityTarget } from './results.js';\nexport type {\n\tPullRequestActivityAuthor,\n\tPullRequestActivityComment,\n\tPullRequestActivityItem,\n\tPullRequestActivityReview,\n\tPullRequestActivityReviewComment,\n} from '@gitlens/git/models/pullRequestActivity.js';\nexport type { PullRequestForCommitResult } from './results.js';\n// The current-account read's result, and the account shape every identity-bearing read already returns.\nexport type { CurrentAccountResult } from './results.js';\nexport type { Account } from '@gitlens/git/models/author.js';\n// Cross-provider PR/issue state filters (string unions in the git models).\nexport type { PullRequestStateFilter } from '@gitlens/git/models/pullRequest.js';\nexport type { IssueStateFilter } from '@gitlens/git/models/issue.js';\n// Which read produced a row, and which of its fields that read fetched.\nexport type { PullRequestProjection } from '@gitlens/git/models/pullRequest.js';\nexport type { IssueProjection } from '@gitlens/git/models/issue.js';\nexport type { FieldPresence, IssueFieldGroup, PullRequestFieldGroup } from './fieldPresence.js';\nexport { getIssueFieldPresence, getPullRequestFieldPresence } from './fieldPresence.js';\n\n// Interface-only views of the integrations the manager hands out (`get`, `getIntegrationsForAccountWideRead`), named\n// after the internal classes they view, and the types their members take and return. The classes stay internal; see\n// `models/publicIntegration.ts`.\nexport type {\n\tGitHostIntegration,\n\tIntegration,\n\tIntegrationById,\n\tIntegrationCacheDescriptor,\n\tIntegrationConnectedKey,\n\tIntegrationCredential,\n\tIntegrationResult,\n\tIntegrationType,\n\tIssuesIntegration,\n\tMyPullRequestsForReposOptions,\n\tSearchMyPullRequestsOptions,\n\tSearchPullRequestsOptions,\n} from './models/publicIntegration.js';\n// Guards over the views. `isIntegration` replaces an `instanceof` check against the internal base class.\nexport { isGitHostIntegration, isIntegration, isIssuesIntegration } from './models/publicIntegration.js';\nexport {\n\tconvertRemoteProviderIdToIntegrationId,\n\tgetIntegrationConnectedKey,\n\tgetIntegrationIdForRemote,\n\tisCloudGitSelfManagedHostIntegrationId,\n\tisGitCloudHostIntegrationId,\n\tisGitSelfManagedHostIntegrationId,\n\tisIssuesHostIntegrationId,\n\tisSelfManagedHostIntegrationId,\n} from './utils/integration.utils.js';\nexport { getSingleConfiguredDomain } from './utils/domain.utils.js';\nexport { getAzureRepositoryIdentity } from './providers/azure/azure.utils.js';\nexport { isAzureProviderId } from './providers/providerErrors.js';\nexport { LookupBackedOffError } from './errors.js';\n\n// Provider metadata (names, domains, icons, capabilities) and the per-provider feature checks built on it.\nexport type { ProviderMetadata } from './providers/metadata.js';\nexport { providersMetadata, supportsCodeSuggest } from './providers/metadata.js';\n\n// Token fingerprints, for logging and error reporting without the token itself.\nexport type { TokenInfo } from './authentication/models.js';\nexport { toTokenInfo, toTokenWithInfo } from './authentication/models.js';\n\n// Entity identifiers: the neutral codec Launchpad (pins/snoozes), drafts and branch-issue associations key by.\nexport type {\n\tEntityIdentifier,\n\tEntityIdentifierFields,\n\tEntityIdentifierInput,\n\tGitConfigEntityIdentifier,\n\tPullRequestEntityIdentifierInput,\n} from './providers/utils.js';\n// Runtime consts (and their same-named value unions) for building identifiers without string literals.\nexport {\n\tEntityIdentifierProviderType,\n\tEntityType,\n\tEntityVersion,\n\tdecodeEntityIdentifier,\n\tdecodeEntityIdentifiersFromGitConfig,\n\tencodeEntityIdentifier,\n\tencodeIssueOrPullRequestForGitConfig,\n\tgetEntityIdentifierInput,\n\tgetIssueFromGitConfigEntityIdentifier,\n\tgetIssueOwner,\n\tgetProviderIdFromEntityIdentifier,\n} from './providers/utils.js';\n\nexport { isMaybeGitLabPullRequestUrl, splitOwnerAndRepo } from './providers/gitlab/gitlab.utils.js';\n\n// Actionable pull requests: Launchpad's categorization, over neutral copies of the provider-apis shapes it reads.\nexport type {\n\tActionablePullRequest,\n\tActionablePullRequestAccount,\n\tActionablePullRequestCategory,\n\tActionablePullRequestEnrichedItem,\n\tActionablePullRequestEnrichedItems,\n\tActionablePullRequestFields,\n\tActionablePullRequestInput,\n} from './models/actionablePullRequest.js';\nexport {\n\tActionablePullRequestBuildStatusState,\n\tActionablePullRequestReviewState,\n} from './models/actionablePullRequest.js';\nexport { getActionablePullRequests, toActionablePullRequestInput } from './providers/actionablePullRequests.js';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAyHA,SAAS,aAAgB,QAA4E;CACpG,OAAO,OAAO,IAAI,gBAAgB,CAAC,CAAC,CAAC;AACtC;AAQA,SAAS,kBACR,aACyC;CACzC,IAAI,eAAe,MAAM,OAAO,KAAA;CAEhC,OAAO;EACN,IAAI,YAAY;EAChB,QAAQ,YAAY;EACpB,GAAI,YAAY,sBAAsB,QAAQ,EAAE,oBAAoB,YAAY,mBAAmB;EACnG,IAAI,iBAAiB;GACpB,OAAO,YAAY;EACpB;EACA,IAAI,qBAAqB;GACxB,OAAO,YAAY;EACpB;CACD;AACD;AAEA,MAAM,mCAA6D;CAClE,wBAAwB,OAAO,cAAc,WAAW,aAAa,MAAM;CAC3E,6BAA6B,OAAO,cAAc,WAAW,aAAa,MAAM;CAChF,uBAAuB,MAAM,OAAO,cAAc,W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ACvB,WAAW,IAAI,UAAU,aAAa,QAAQ,YAC7C,MAAM,YAAY,OACf,MAAM,SAAS,IAAI,UAAU,kBAAkB,WAAW,GAAG,QAAQ,OAAO,IAC5E,aAAa,MAAM;EACvB,oBAAoB,aAAa,QAAQ,YACxC,MAAM,kBAAkB,kBAAkB,WAAW,GAAG,QAAQ,OAAO;EACxE,qBAAoB,UAAS,MAAM,qBAAqB,KAAK;CAC9D;AACD;;;;;;;;;;;;;AAgIA,SAAgB,yBAAyB,KAAoD;CAC5F,OAAO,yBAAyB;EAC/B,GAAG;EACH,OAAO,2BAA2B,IAAI,KAAK;CAC5C,CAAC;AACF"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../../plus/integrations/src/index.ts"],"sourcesContent":["// Public facade for `@gitlens/integrations`.\n//\n// External consumers should import from this entry point only, not from the\n// package's internal subpaths, with one exception: the lightweight, token-scoped\n// read API is a supported public subpath (`./lite.js`). It's kept out of this\n// facade on purpose so importing the session-managed manager doesn't eagerly pull\n// in every provider API client. The internal classes (IntegrationService,\n// IntegrationAuthenticationService, etc.) are not part of the public API and\n// may be refactored without semver bumps.\n\nimport type { Account } from '@gitlens/git/models/author.js';\nimport type { DefaultBranch } from '@gitlens/git/models/defaultBranch.js';\nimport type { Issue } from '@gitlens/git/models/issue.js';\nimport type { IssueOrPullRequest, IssueOrPullRequestType } from '@gitlens/git/models/issueOrPullRequest.js';\nimport type { PullRequest } from '@gitlens/git/models/pullRequest.js';\nimport type { RepositoryMetadata } from '@gitlens/git/models/repositoryMetadata.js';\nimport type { ResourceDescriptor } from '@gitlens/git/models/resourceDescriptor.js';\nimport { CacheController } from '@gitlens/utils/promiseCache.js';\nimport type {\n\tAccountProvider,\n\tConfigProvider,\n\tHttpProvider,\n\tIntegrationCacheProvider,\n\tIntegrationServiceHooks,\n\tIntegrationStorageProvider,\n\tRepositoriesProvider,\n} from './context.js';\nimport { createIntegrationService } from './integrationService.js';\nimport type { IntegrationManager } from './manager.js';\nimport type { IntegrationCacheDescriptor } from './models/publicIntegration.js';\n\nexport type { Autolink, AutolinkReference, DynamicAutolinkReference, RefSet } from '@gitlens/git/models/autolink.js';\nexport type { ProviderReference } from '@gitlens/git/models/remoteProvider.js';\n\n/** A cached provider value, which may still be resolving. */\nexport type IntegrationManagerCacheResult<T> = Promise<T | undefined> | T | undefined;\n\n/** Produces an account value on a cache miss. */\nexport type IntegrationManagerCacheLoader<T> = (cacheable: CacheController) => {\n\tvalue: IntegrationManagerCacheResult<T>;\n\texpiresAt?: number;\n};\n\n/** The integration identity supplied to the consumer-owned account cache. */\nexport type IntegrationAccountCacheDescriptor = IntegrationCacheDescriptor;\n\n/** Cache controls attached to a provider account lookup. */\nexport interface IntegrationManagerCacheOptions {\n\treadonly connectionId?: string;\n\treadonly etag?: string;\n\treadonly expiryOverride?: boolean | number;\n\treadonly expireOnError?: boolean;\n}\n\n/**\n * Optional consumer-owned cache for values reused by the public manager facade.\n *\n * Only `getCurrentAccount` is required. Each other lookup is optional: one the cache omits runs its loader on every\n * call, uncached. A cache that keys entries by integration should key them by the descriptor's `id` and `domain`,\n * and treat `maybeConnected` and `sessionFingerprint` as the entry's etag, so a reconnect or a token change misses.\n *\n * The manager calls each method on the cache object itself, so a class instance (methods on its prototype) works.\n */\nexport interface IntegrationManagerCacheProvider {\n\tgetCurrentAccount(\n\t\tintegration: IntegrationAccountCacheDescriptor,\n\t\tcacheable: IntegrationManagerCacheLoader<Account>,\n\t\toptions?: IntegrationManagerCacheOptions,\n\t): IntegrationManagerCacheResult<Account>;\n\tgetRepositoryMetadata?(\n\t\trepo: ResourceDescriptor,\n\t\tintegration: IntegrationCacheDescriptor | undefined,\n\t\tcacheable: IntegrationManagerCacheLoader<RepositoryMetadata>,\n\t\toptions?: IntegrationManagerCacheOptions,\n\t): IntegrationManagerCacheResult<RepositoryMetadata>;\n\tgetRepositoryDefaultBranch?(\n\t\trepo: ResourceDescriptor,\n\t\tintegration: IntegrationCacheDescriptor | undefined,\n\t\tcacheable: IntegrationManagerCacheLoader<DefaultBranch>,\n\t\toptions?: IntegrationManagerCacheOptions,\n\t): IntegrationManagerCacheResult<DefaultBranch>;\n\tgetPullRequestForSha?(\n\t\tsha: string,\n\t\trepo: ResourceDescriptor,\n\t\tintegration: IntegrationCacheDescriptor | undefined,\n\t\tcacheable: IntegrationManagerCacheLoader<PullRequest>,\n\t\toptions?: IntegrationManagerCacheOptions,\n\t): IntegrationManagerCacheResult<PullRequest>;\n\tgetPullRequestForBranch?(\n\t\tbranch: string,\n\t\trepo: ResourceDescriptor,\n\t\tintegration: IntegrationCacheDescriptor | undefined,\n\t\tcacheable: IntegrationManagerCacheLoader<PullRequest>,\n\t\toptions?: IntegrationManagerCacheOptions,\n\t): IntegrationManagerCacheResult<PullRequest>;\n\tgetPullRequest?(\n\t\tid: string,\n\t\tresource: ResourceDescriptor,\n\t\tintegration: IntegrationCacheDescriptor | undefined,\n\t\tcacheable: IntegrationManagerCacheLoader<PullRequest>,\n\t\toptions?: IntegrationManagerCacheOptions,\n\t): IntegrationManagerCacheResult<PullRequest>;\n\tgetIssueOrPullRequest?(\n\t\tid: string,\n\t\ttype: IssueOrPullRequestType | undefined,\n\t\tresource: ResourceDescriptor,\n\t\tintegration: IntegrationCacheDescriptor | undefined,\n\t\tcacheable: IntegrationManagerCacheLoader<IssueOrPullRequest>,\n\t\toptions?: IntegrationManagerCacheOptions,\n\t): IntegrationManagerCacheResult<IssueOrPullRequest>;\n\tgetIssue?(\n\t\tid: string,\n\t\tresource: ResourceDescriptor,\n\t\tintegration: IntegrationCacheDescriptor | undefined,\n\t\tcacheable: IntegrationManagerCacheLoader<Issue>,\n\t\toptions?: IntegrationManagerCacheOptions,\n\t): IntegrationManagerCacheResult<Issue>;\n\t/** Evicts cached pull requests for the given installation origin, or all pull requests when omitted. */\n\tdeletePullRequests?(scope?: { id: IntegrationCacheDescriptor['id']; domain: string }): void;\n}\n\nfunction loadUncached<T>(loader: IntegrationManagerCacheLoader<T>): IntegrationManagerCacheResult<T> {\n\treturn loader(new CacheController()).value;\n}\n\n/**\n * What a consumer cache is handed in place of the integration itself. The getters read through to the integration\n * when the cache reads them, as reading the integration did, without handing a consumer the class.\n */\nfunction toCacheDescriptor(integration: IntegrationCacheDescriptor): IntegrationCacheDescriptor;\nfunction toCacheDescriptor(integration: IntegrationCacheDescriptor | undefined): IntegrationCacheDescriptor | undefined;\nfunction toCacheDescriptor(\n\tintegration: IntegrationCacheDescriptor | undefined,\n): IntegrationCacheDescriptor | undefined {\n\tif (integration == null) return undefined;\n\n\treturn {\n\t\tid: integration.id,\n\t\tdomain: integration.domain,\n\t\t...(integration.installationOrigin != null && { installationOrigin: integration.installationOrigin }),\n\t\tget maybeConnected() {\n\t\t\treturn integration.maybeConnected;\n\t\t},\n\t\tget sessionFingerprint() {\n\t\t\treturn integration.sessionFingerprint;\n\t\t},\n\t};\n}\n\nconst uncachedIntegrationCacheProvider: IntegrationCacheProvider = {\n\tgetRepositoryMetadata: (_repo, _integration, loader) => loadUncached(loader),\n\tgetRepositoryDefaultBranch: (_repo, _integration, loader) => loadUncached(loader),\n\tgetPullRequestForSha: (_sha, _repo, _integration, loader) => loadUncached(loader),\n\tgetPullRequestForBranch: (_branch, _repo, _integration, loader) => loadUncached(loader),\n\tgetPullRequest: (_id, _resource, _integration, loader) => loadUncached(loader),\n\tgetIssueOrPullRequest: (_id, _type, _resource, _integration, loader) => loadUncached(loader),\n\tgetIssue: (_id, _resource, _integration, loader) => loadUncached(loader),\n\tgetCurrentAccount: (_integration, loader) => loadUncached(loader),\n\t// Nothing is cached, so there is nothing to evict.\n\tdeletePullRequests: () => {},\n};\n\n/**\n * Adapts the consumer's cache to the internal one: each lookup the consumer supplies is called on `cache` itself (never\n * spread or detached, which would lose a class instance's prototype methods and `this`), and every other lookup runs\n * uncached.\n */\nfunction toIntegrationCacheProvider(cache: IntegrationManagerCacheProvider | undefined): IntegrationCacheProvider {\n\tif (cache == null) return uncachedIntegrationCacheProvider;\n\n\treturn {\n\t\tgetRepositoryMetadata: (repo, integration, loader, options) =>\n\t\t\tcache.getRepositoryMetadata != null\n\t\t\t\t? cache.getRepositoryMetadata(repo, toCacheDescriptor(integration), loader, options)\n\t\t\t\t: loadUncached(loader),\n\t\tgetRepositoryDefaultBranch: (repo, integration, loader, options) =>\n\t\t\tcache.getRepositoryDefaultBranch != null\n\t\t\t\t? cache.getRepositoryDefaultBranch(repo, toCacheDescriptor(integration), loader, options)\n\t\t\t\t: loadUncached(loader),\n\t\tgetPullRequestForSha: (sha, repo, integration, loader, options) =>\n\t\t\tcache.getPullRequestForSha != null\n\t\t\t\t? cache.getPullRequestForSha(sha, repo, toCacheDescriptor(integration), loader, options)\n\t\t\t\t: loadUncached(loader),\n\t\tgetPullRequestForBranch: (branch, repo, integration, loader, options) =>\n\t\t\tcache.getPullRequestForBranch != null\n\t\t\t\t? cache.getPullRequestForBranch(branch, repo, toCacheDescriptor(integration), loader, options)\n\t\t\t\t: loadUncached(loader),\n\t\tgetPullRequest: (id, resource, integration, loader, options) =>\n\t\t\tcache.getPullRequest != null\n\t\t\t\t? cache.getPullRequest(id, resource, toCacheDescriptor(integration), loader, options)\n\t\t\t\t: loadUncached(loader),\n\t\tgetIssueOrPullRequest: (id, type, resource, integration, loader, options) =>\n\t\t\tcache.getIssueOrPullRequest != null\n\t\t\t\t? cache.getIssueOrPullRequest(id, type, resource, toCacheDescriptor(integration), loader, options)\n\t\t\t\t: loadUncached(loader),\n\t\tgetIssue: (id, resource, integration, loader, options) =>\n\t\t\tcache.getIssue != null\n\t\t\t\t? cache.getIssue(id, resource, toCacheDescriptor(integration), loader, options)\n\t\t\t\t: loadUncached(loader),\n\t\tgetCurrentAccount: (integration, loader, options) =>\n\t\t\tcache.getCurrentAccount(toCacheDescriptor(integration), loader, options),\n\t\tdeletePullRequests: scope => cache.deletePullRequests?.(scope),\n\t};\n}\n\n/**\n * Consumer-facing runtime for {@link createIntegrationManager}.\n *\n * External consumers may omit `cache`; reads then execute their loaders directly without cross-call caching.\n * The extension host's broader integration context remains private to the implementation.\n */\nexport interface IntegrationManagerContext {\n\treadonly storage: IntegrationStorageProvider;\n\treadonly account: AccountProvider;\n\treadonly config: ConfigProvider;\n\treadonly http: HttpProvider;\n\treadonly cache?: IntegrationManagerCacheProvider;\n\treadonly repositories: RepositoriesProvider;\n\treadonly hooks?: IntegrationServiceHooks;\n}\n\nexport type {\n\tClosedPullRequestSweepOptions,\n\tGetAutolinkReferencesOptions,\n\tIntegrationManager,\n\tIssueDeleteOptions,\n\tIssueWriteOptions,\n\tIssueWriteTargetOptions,\n\tIssueWriteTargetResult,\n\tListLinearProjectsOptions,\n\tListOrgsOptions,\n\tListProjectsOptions,\n\t// Every option shape a caller has to BUILD is exported, not just the ones the manager returns:\n\t// `manager.js` is not a public subpath, so a type omitted here can't be named by a consumer at all\n\t// (`broadenIssues`' `orgs` needed `ProviderBroadenOrg` and had to be re-declared downstream).\n\tProviderBroadenOrg,\n\tProviderRepositoriesInput,\n\tProviderRepositoryInput,\n\tProviderSweepTarget,\n\tProviderSweepTargetEvent,\n\tPullRequestCreateCapabilityOptions,\n\tPullRequestSweepOptions,\n\tPullRequestWriteOptions,\n\tPullRequestWriteTargetOptions,\n} from './manager.js';\nexport type {\n\tIssueTrackerCreateOptions,\n\tIssueTrackerCreateOptionsResult,\n\tIssueTrackerDeleteOptions,\n\tIssueTrackerField,\n\tIssueTrackerIssueReceipt,\n\tIssueTrackerIssueWriteOptions,\n\tIssueTrackerIssueWriteOptionsResult,\n\tIssueTrackerStatus,\n\tIssueTrackerTransition,\n\tIssueTrackerWriteConnection,\n\tIssueTrackerWriteFailure,\n\tIssueTrackerWriteOptions,\n\tIssueTrackerWriteResult,\n\tIssueTrackerWriteTargetOptions,\n\tIssueTrackerWriteTargetResult,\n} from './models/issueTrackerWrites.js';\nexport type {\n\tAzurePullRequestCreateCapabilityOptions,\n\tAzurePullRequestCreateCapabilityResult,\n\tAzurePullRequestMergeStrategy,\n\tAzurePullRequestRepository,\n\tAzurePullRequestWriteAction,\n\tAzurePullRequestWriteFailure,\n\tAzurePullRequestWriteOptions,\n\tAzurePullRequestWriteResult,\n\tAzurePullRequestWriteTargetOptions,\n\tAzurePullRequestWriteTargetResult,\n\tAzureServerPullRequestWriteOptions,\n\tAzureServerPullRequestWriteScope,\n\tAzureServerPullRequestWriteTargetOptions,\n\tAzureWrittenPullRequest,\n} from './models/azurePullRequestWrites.js';\nexport type {\n\tBitbucketPullRequestCreateCapabilityOptions,\n\tBitbucketPullRequestCreateCapabilityResult,\n\tBitbucketPullRequestMergeCapability,\n\tBitbucketPullRequestMergeStatusOptions,\n\tBitbucketPullRequestMergeStatusResult,\n\tBitbucketPullRequestMergeStrategy,\n\tBitbucketPullRequestRepository,\n\tBitbucketPullRequestWriteAction,\n\tBitbucketPullRequestWriteFailure,\n\tBitbucketPullRequestWriteOptions,\n\tBitbucketPullRequestWriteReleaseOptions,\n\tBitbucketPullRequestWriteReleaseResult,\n\tBitbucketPullRequestWriteResult,\n\tBitbucketPullRequestWriteTargetOptions,\n\tBitbucketPullRequestWriteTargetResult,\n\tBitbucketUnsettledPullRequestWrite,\n\tBitbucketWrittenPullRequest,\n} from './models/bitbucketPullRequestWrites.js';\nexport type {\n\tAzureServerWorkItemWriteScope,\n\tAzureServicesWorkItemWriteScope,\n\tWorkItemAddress,\n\tWorkItemCreateOptions,\n\tWorkItemCreateOptionsResult,\n\tWorkItemDeleteCapability,\n\tWorkItemDeleteOptions,\n\tWorkItemDeleteResult,\n\tWorkItemDeleteTargetChanged,\n\tWorkItemDeletion,\n\tWorkItemReceipt,\n\tWorkItemState,\n\tWorkItemWriteContext,\n\tWorkItemWriteField,\n\tWorkItemWriteOptions,\n\tWorkItemWriteOptionsResult,\n\tWorkItemWriteResult,\n\tWorkItemWriteScope,\n\tWorkItemWriteTargetOptions,\n\tWorkItemWriteTargetResult,\n} from './models/workItemWrites.js';\nexport type {\n\tCaptureRelationshipCurrency,\n\tIssueRelationshipsOptions,\n\tIssueRelationshipsResult,\n\tIssueRelationshipWriteOptions,\n\tIssueRelationshipWriteResult,\n\tIssueRelationshipPin,\n\tIssueRelationshipReceipt,\n\tIssueRelationshipFailure,\n} from './models/issueRelationships.js';\nexport type { IssueWriteResult } from '@gitlens/git-github/api/issueWrites.js';\nexport type {\n\tPullRequestCreateCapabilityResult,\n\tPullRequestWriteFailure,\n\tPullRequestWriteResult,\n\tPullRequestWriteSnapshot,\n\tPullRequestWriteTargetResult,\n} from '@gitlens/git-github/api/pullRequestWrites.js';\n\n/**\n * Construct an `@gitlens/integrations` manager bound to the supplied runtime.\n *\n * The runtime is the **single** cross-boundary contract — anything the\n * package needs (HTTP, storage, cache, auth, subscription, telemetry, UI,\n * configuration, environment) flows through it. The package never imports\n * `vscode`, `Container`, or any consumer-internal types.\n *\n * The returned manager owns its internal services; dispose it (or its\n * containing scope) to release every cached integration plus the runtime's\n * own VS Code subscriptions.\n */\nexport function createIntegrationManager(ctx: IntegrationManagerContext): IntegrationManager {\n\treturn createIntegrationService({\n\t\t...ctx,\n\t\tcache: toIntegrationCacheProvider(ctx.cache),\n\t});\n}\n\n// Re-exports for the public API surface.\nexport type {\n\tAccountProvider,\n\tAuthenticationSessionsChangeEvent,\n\tConfigChangeEvent,\n\tConfigProvider,\n\tRepositoriesProvider,\n\tHttpProvider,\n\tIntegrationsRemoteConfig,\n\tIntegrationServiceHooks,\n\tIntegrationStorageProvider,\n} from './context.js';\nexport type { Source, Sources } from './telemetry.js';\nexport type { IntegrationIds, SupportedCloudIntegrationIds } from './constants.js';\nexport type { ConfiguredIntegrationsChangeEvent } from './authentication/configuredIntegrationService.js';\n\n// Authentication contract — what `IntegrationServiceHooks.createAuthenticationProvider`\n// implementers return. Consumers can plug in any auth strategy (manual token,\n// OAuth, host-managed) by returning an object implementing this interface from\n// the hook.\nexport type {\n\tIntegrationAuthenticationProvider,\n\tIntegrationAuthenticationProviderDescriptor,\n\tIntegrationAuthenticationSessionDescriptor,\n} from './authentication/integrationAuthenticationProvider.js';\nexport type {\n\tAuthenticationSessionLike,\n\tCloudIntegrationAuthType,\n\tCloudIntegrationConnection,\n\tCloudIntegrationType,\n\tConfiguredIntegrationDescriptor,\n\tProviderAuthenticationSession,\n} from './authentication/models.js';\n// Provider-id mapping helpers for consumers bridging their own provider ids to `IntegrationIds`\n// (e.g. mapping multi-account connections from `getConfigured` back to a provider) and vice versa.\nexport { toCloudIntegrationType, toIntegrationId } from './authentication/models.js';\n// Domain normalization is part of connection selection and repository resolution; consumers should use the\n// same implementation rather than importing an internal utility subpath or maintaining a divergent copy.\nexport { areDomainsOnSameHost, hostFromDomain } from './utils/domain.utils.js';\n\n// Convenience: wrap a static access token (env var, CLI flag, secret manager)\n// as an `IntegrationAuthenticationProvider`. For OAuth/refresh flows, implement\n// the interface directly — this helper is for non-interactive consumers only.\nexport {\n\tcreateManualTokenAuthProvider,\n\ttype ManualTokenAuthProviderOptions,\n} from './authentication/manualTokenProvider.js';\n\nexport {\n\tGitCloudHostIntegrationId,\n\tGitSelfManagedHostIntegrationId,\n\tIssuesCloudHostIntegrationId,\n\tIssuesSelfManagedHostIntegrationId,\n\tisIntegrationId,\n\tisSupportedCloudIntegrationId,\n} from './constants.js';\n\n// Neutral pagination + warning result types the Kepler ProviderBackend adapter maps to its own DTOs.\n// These carry no `@gitkraken/provider-apis` types, so consumers depend only on `@gitkraken/core-gitlens`.\nexport type {\n\tConnectionStateChangeEvent,\n\tProviderBroadenResult,\n\tProviderPagedResult,\n\tProviderPageInfo,\n\tProviderPullRequestSearchResult,\n\tProviderResult,\n\tProviderSweepResult,\n\tProviderSweepTargetRef,\n\tProviderWarning,\n\tProviderWarningCause,\n\tProviderWarningCauseReason,\n\tProviderWarningKind,\n\tProviderWarningOmission,\n\tProviderWarningOmissionKind,\n\tProviderWarningOmissionRecovery,\n\tProviderWarningOmissionScope,\n\tProviderWarningScope,\n\tProviderWarningSelector,\n\tProviderWarningUnreadableItems,\n\tProviderLinearProjectShape,\n\tProviderOrganization,\n\tProviderRepositoryShape,\n\tRepositoryIdentity,\n\tRepositoryResolution,\n\tRepositoryResolutionStatus,\n\tResolveRepositoryResult,\n} from './results.js';\n// Runtime enums — re-exported as values (not `export type`) so consumers can read their members.\nexport { IssueFilter, PullRequestFilter } from './providerFilters.js';\n// The filtered issue search's criteria model and the capability table that says which of it a provider honors.\n// String unions and plain interfaces, so a consumer builds criteria without importing an internal subpath.\nexport type { IssueSearchCapabilities, IssueSearchCriteria, IssueSearchRelationship } from './providerFilters.js';\n// Account-wide pull-request search criteria and the per-provider capability table.\nexport type { PullRequestSearchCapabilities, PullRequestSearchCriteria } from './providerFilters.js';\n// The count-only issue and pull-request probes' input and result shapes.\nexport type { IssueCountResult, IssueCountScope, PullRequestCountResult, PullRequestCountScope } from './results.js';\nexport type { IssueBatchResult, IssueBatchTarget } from './results.js';\nexport type { PullRequestBatchResult, PullRequestBatchTarget } from './results.js';\nexport type { IssueEtagInclude, PullRequestEtagInclude } from './reads/etag.js';\nexport type { PullRequestBranchResult, PullRequestBranchTarget } from './results.js';\nexport type { PullRequestCheckLogResult, PullRequestCheckLogTarget } from './results.js';\nexport type { PullRequestActivityResult, PullRequestActivityTarget } from './results.js';\nexport type {\n\tPullRequestActivityAuthor,\n\tPullRequestActivityComment,\n\tPullRequestActivityItem,\n\tPullRequestActivityReview,\n\tPullRequestActivityReviewComment,\n} from '@gitlens/git/models/pullRequestActivity.js';\nexport type { PullRequestForCommitResult } from './results.js';\n// The current-account read's result, and the account shape every identity-bearing read already returns.\nexport type { CurrentAccountResult } from './results.js';\nexport type { Account } from '@gitlens/git/models/author.js';\n// Cross-provider PR/issue state filters (string unions in the git models).\nexport type { PullRequestStateFilter } from '@gitlens/git/models/pullRequest.js';\nexport type { IssueStateFilter } from '@gitlens/git/models/issue.js';\n// Which read produced a row, and which of its fields that read fetched.\nexport type { PullRequestProjection } from '@gitlens/git/models/pullRequest.js';\nexport type { IssueProjection } from '@gitlens/git/models/issue.js';\nexport type { FieldPresence, IssueFieldGroup, PullRequestFieldGroup } from './fieldPresence.js';\nexport { getIssueFieldPresence, getPullRequestFieldPresence } from './fieldPresence.js';\n\n// Interface-only views of the integrations the manager hands out (`get`, `getIntegrationsForAccountWideRead`), named\n// after the internal classes they view, and the types their members take and return. The classes stay internal; see\n// `models/publicIntegration.ts`.\nexport type {\n\tGitHostIntegration,\n\tIntegration,\n\tIntegrationById,\n\tIntegrationCacheDescriptor,\n\tIntegrationConnectedKey,\n\tIntegrationCredential,\n\tIntegrationResult,\n\tIntegrationType,\n\tIssuesIntegration,\n\tMyPullRequestsForReposOptions,\n\tSearchMyPullRequestsOptions,\n\tSearchPullRequestsOptions,\n} from './models/publicIntegration.js';\n// Guards over the views. `isIntegration` replaces an `instanceof` check against the internal base class.\nexport { isGitHostIntegration, isIntegration, isIssuesIntegration } from './models/publicIntegration.js';\nexport {\n\tconvertRemoteProviderIdToIntegrationId,\n\tgetIntegrationConnectedKey,\n\tgetIntegrationIdForRemote,\n\tisCloudGitSelfManagedHostIntegrationId,\n\tisGitCloudHostIntegrationId,\n\tisGitSelfManagedHostIntegrationId,\n\tisIssuesHostIntegrationId,\n\tisSelfManagedHostIntegrationId,\n} from './utils/integration.utils.js';\nexport { getSingleConfiguredDomain } from './utils/domain.utils.js';\nexport { getAzureRepositoryIdentity } from './providers/azure/azure.utils.js';\nexport { isAzureProviderId } from './providers/providerErrors.js';\nexport { LookupBackedOffError } from './errors.js';\n\n// Provider metadata (names, domains, icons, capabilities) and the per-provider feature checks built on it.\nexport type { ProviderMetadata } from './providers/metadata.js';\nexport { providersMetadata, supportsCodeSuggest } from './providers/metadata.js';\n\n// Token fingerprints, for logging and error reporting without the token itself.\nexport type { TokenInfo } from './authentication/models.js';\nexport { toTokenInfo, toTokenWithInfo } from './authentication/models.js';\n\n// Entity identifiers: the neutral codec Launchpad (pins/snoozes), drafts and branch-issue associations key by.\nexport type {\n\tEntityIdentifier,\n\tEntityIdentifierFields,\n\tEntityIdentifierInput,\n\tGitConfigEntityIdentifier,\n\tPullRequestEntityIdentifierInput,\n} from './providers/utils.js';\n// Runtime consts (and their same-named value unions) for building identifiers without string literals.\nexport {\n\tEntityIdentifierProviderType,\n\tEntityType,\n\tEntityVersion,\n\tdecodeEntityIdentifier,\n\tdecodeEntityIdentifiersFromGitConfig,\n\tencodeEntityIdentifier,\n\tencodeIssueOrPullRequestForGitConfig,\n\tgetEntityIdentifierInput,\n\tgetIssueFromGitConfigEntityIdentifier,\n\tgetIssueOwner,\n\tgetProviderIdFromEntityIdentifier,\n} from './providers/utils.js';\n\nexport { isMaybeGitLabPullRequestUrl, splitOwnerAndRepo } from './providers/gitlab/gitlab.utils.js';\n\n// Actionable pull requests: Launchpad's categorization, over neutral copies of the provider-apis shapes it reads.\nexport type {\n\tActionablePullRequest,\n\tActionablePullRequestAccount,\n\tActionablePullRequestCategory,\n\tActionablePullRequestEnrichedItem,\n\tActionablePullRequestEnrichedItems,\n\tActionablePullRequestFields,\n\tActionablePullRequestInput,\n} from './models/actionablePullRequest.js';\nexport {\n\tActionablePullRequestBuildStatusState,\n\tActionablePullRequestReviewState,\n} from './models/actionablePullRequest.js';\nexport { getActionablePullRequests, toActionablePullRequestInput } from './providers/actionablePullRequests.js';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAyHA,SAAS,aAAgB,QAA4E;CACpG,OAAO,OAAO,IAAI,gBAAgB,CAAC,CAAC,CAAC;AACtC;AAQA,SAAS,kBACR,aACyC;CACzC,IAAI,eAAe,MAAM,OAAO,KAAA;CAEhC,OAAO;EACN,IAAI,YAAY;EAChB,QAAQ,YAAY;EACpB,GAAI,YAAY,sBAAsB,QAAQ,EAAE,oBAAoB,YAAY,mBAAmB;EACnG,IAAI,iBAAiB;GACpB,OAAO,YAAY;EACpB;EACA,IAAI,qBAAqB;GACxB,OAAO,YAAY;EACpB;CACD;AACD;AAEA,MAAM,mCAA6D;CAClE,wBAAwB,OAAO,cAAc,WAAW,aAAa,MAAM;CAC3E,6BAA6B,OAAO,cAAc,W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AkB,WAAW,GAAG,QAAQ,OAAO,IAC/F,aAAa,MAAM;EACvB,WAAW,IAAI,UAAU,aAAa,QAAQ,YAC7C,MAAM,YAAY,OACf,MAAM,SAAS,IAAI,UAAU,kBAAkB,WAAW,GAAG,QAAQ,OAAO,IAC5E,aAAa,MAAM;EACvB,oBAAoB,aAAa,QAAQ,YACxC,MAAM,kBAAkB,kBAAkB,WAAW,GAAG,QAAQ,OAAO;EACxE,qBAAoB,UAAS,MAAM,qBAAqB,KAAK;CAC9D;AACD;;;;;;;;;;;;;AAmJA,SAAgB,yBAAyB,KAAoD;CAC5F,OAAO,yBAAyB;EAC/B,GAAG;EACH,OAAO,2BAA2B,IAAI,KAAK;CAC5C,CAAC;AACF"}
@@ -15,10 +15,11 @@ import { Source } from "./telemetry.js";
15
15
  import { IssueTrackerCreateOptions, IssueTrackerCreateOptionsResult, IssueTrackerDeleteOptions, IssueTrackerIssueWriteOptions, IssueTrackerIssueWriteOptionsResult, IssueTrackerWriteOptions, IssueTrackerWriteResult, IssueTrackerWriteTargetOptions, IssueTrackerWriteTargetResult } from "./models/issueTrackerWrites.js";
16
16
  import { WorkItemAddress, WorkItemCreateOptions, WorkItemCreateOptionsResult, WorkItemDeleteOptions, WorkItemDeleteResult, WorkItemWriteOptions, WorkItemWriteOptionsResult, WorkItemWriteResult, WorkItemWriteTargetOptions, WorkItemWriteTargetResult } from "./models/workItemWrites.js";
17
17
  import { AzurePullRequestCreateCapabilityOptions, AzurePullRequestCreateCapabilityResult, AzurePullRequestWriteOptions, AzurePullRequestWriteResult, AzurePullRequestWriteTargetOptions, AzurePullRequestWriteTargetResult, AzureServerPullRequestWriteOptions, AzureServerPullRequestWriteScope, AzureServerPullRequestWriteTargetOptions } from "./models/azurePullRequestWrites.js";
18
+ import { BitbucketPullRequestCreateCapabilityOptions, BitbucketPullRequestCreateCapabilityResult, BitbucketPullRequestMergeStatusOptions, BitbucketPullRequestMergeStatusResult, BitbucketPullRequestWriteOptions, BitbucketPullRequestWriteReleaseOptions, BitbucketPullRequestWriteReleaseResult, BitbucketPullRequestWriteResult, BitbucketPullRequestWriteTargetOptions, BitbucketPullRequestWriteTargetResult } from "./models/bitbucketPullRequestWrites.js";
18
19
  import { CaptureRelationshipCurrency, IssueRelationshipWriteOptions, IssueRelationshipWriteResult, IssueRelationshipsOptions, IssueRelationshipsResult } from "./models/issueRelationships.js";
19
20
  import { IssueFilter, SupportedFilters } from "./providerFilters.js";
20
21
  import { IssueEtagInclude, PullRequestEtagInclude } from "./reads/etag.js";
21
- import { ConnectionStateChangeEvent, CurrentAccountResult, IssueBatchResult, IssueBatchTarget, IssueCountResult, IssueCountScope, ProviderBroadenResult, ProviderLinearProjectShape, ProviderOrganization, ProviderPagedResult, ProviderRepositoryShape, ProviderResult, ProviderSweepResult, ProviderWarning, PullRequestActivityResult, PullRequestActivityTarget, PullRequestBatchResult, PullRequestBatchTarget, PullRequestBranchResult, PullRequestBranchTarget, PullRequestCheckLogResult, PullRequestCheckLogTarget, PullRequestCountResult, PullRequestCountScope, PullRequestForCommitResult, ResolveRepositoryResult } from "./results.js";
22
+ import { ConnectionStateChangeEvent, CurrentAccountResult, IssueBatchResult, IssueBatchTarget, IssueCountResult, IssueCountScope, ProviderBroadenResult, ProviderLinearProjectShape, ProviderOrganization, ProviderPagedResult, ProviderPullRequestSearchResult, ProviderRepositoryShape, ProviderResult, ProviderSweepResult, ProviderWarning, PullRequestActivityResult, PullRequestActivityTarget, PullRequestBatchResult, PullRequestBatchTarget, PullRequestBranchResult, PullRequestBranchTarget, PullRequestCheckLogResult, PullRequestCheckLogTarget, PullRequestCountResult, PullRequestCountScope, PullRequestForCommitResult, ResolveRepositoryResult } from "./results.js";
22
23
  import { ClosedPullRequestSweepOptions, GetAutolinkReferencesOptions, IntegrationManager, IssueDeleteOptions, IssueWriteOptions, IssueWriteTargetOptions, IssueWriteTargetResult, ListLinearProjectsOptions, ListOrgsOptions, ListProjectsOptions, ProviderBroadenOrg, PullRequestCreateCapabilityOptions, PullRequestSweepOptions, PullRequestWriteOptions, PullRequestWriteTargetOptions } from "./manager.js";
23
24
  import { IntegrationResult, SearchMyPullRequestsOptions } from "./models/publicIntegration.js";
24
25
  import { IntegrationServiceContext, IntegrationsRemoteConfig } from "./context.js";
@@ -29,6 +30,7 @@ import { ProviderReposInput } from "./providers/models.js";
29
30
  import { GitHostIntegration } from "./models/gitHostIntegration.js";
30
31
  import { ApiClients } from "./providers/apiClients.js";
31
32
  import { AzureDevOpsIntegration } from "./providers/azureDevOps.js";
33
+ import { BitbucketIntegration } from "./providers/bitbucket.js";
32
34
  import { GitHubEnterpriseIntegration, GitHubIntegration } from "./providers/github.js";
33
35
  import { RepositoryResolutionContext } from "./reads/context.js";
34
36
  import { IntegrationAuthenticationService } from "./authentication/integrationAuthenticationService.js";
@@ -71,6 +73,7 @@ export declare class IntegrationService implements Disposable, IntegrationManage
71
73
  */
72
74
  connectSecondary(id: SupportedCloudIntegrationIds, source?: Source): Promise<boolean>;
73
75
  get(id: GitCloudHostIntegrationId.AzureDevOps): Promise<AzureDevOpsIntegration>;
76
+ get(id: GitCloudHostIntegrationId.Bitbucket): Promise<BitbucketIntegration>;
74
77
  get(id: GitCloudHostIntegrationId.GitHub): Promise<GitHubIntegration>;
75
78
  get(id: GitSelfManagedHostIntegrationId.CloudGitHubEnterprise, domain: string): Promise<GitHubEnterpriseIntegration>;
76
79
  get(id: GitCloudHostIntegrationId): Promise<GitHostIntegration>;
@@ -278,7 +281,7 @@ export declare class IntegrationService implements Disposable, IntegrationManage
278
281
  mergeQueue?: boolean;
279
282
  /** See {@link IntegrationManager.searchPullRequestsPage}. */
280
283
  cancellation?: AbortSignal;
281
- }): Promise<ProviderPagedResult<PullRequestShape>>;
284
+ }): Promise<ProviderPullRequestSearchResult>;
282
285
  listIssuesPage(options: {
283
286
  state?: IssueStateFilter;
284
287
  providerId: IntegrationIds;
@@ -526,6 +529,12 @@ export declare class IntegrationService implements Disposable, IntegrationManage
526
529
  resolveAzurePullRequestWriteTarget(options: AzurePullRequestWriteTargetOptions | AzureServerPullRequestWriteTargetOptions): Promise<AzurePullRequestWriteTargetResult>;
527
530
  writeAzurePullRequest(options: AzurePullRequestWriteOptions | AzureServerPullRequestWriteOptions): Promise<AzurePullRequestWriteResult>;
528
531
  private withAzurePullRequestWriter;
532
+ getBitbucketPullRequestCreateCapability(options: BitbucketPullRequestCreateCapabilityOptions): Promise<BitbucketPullRequestCreateCapabilityResult>;
533
+ resolveBitbucketPullRequestWriteTarget(options: BitbucketPullRequestWriteTargetOptions): Promise<BitbucketPullRequestWriteTargetResult>;
534
+ writeBitbucketPullRequest(options: BitbucketPullRequestWriteOptions): Promise<BitbucketPullRequestWriteResult>;
535
+ getBitbucketPullRequestMergeStatus(options: BitbucketPullRequestMergeStatusOptions): Promise<BitbucketPullRequestMergeStatusResult>;
536
+ releaseBitbucketPullRequestWrite(options: BitbucketPullRequestWriteReleaseOptions): Promise<BitbucketPullRequestWriteReleaseResult>;
537
+ private withBitbucketPullRequestWriter;
529
538
  getWorkItemCreateOptions(options: WorkItemCreateOptions): Promise<WorkItemCreateOptionsResult>;
530
539
  getWorkItemWriteOptions(options: WorkItemAddress): Promise<WorkItemWriteOptionsResult>;
531
540
  writeWorkItem(options: WorkItemWriteOptions): Promise<WorkItemWriteResult>;