@gitkraken/core-gitlens 0.5.108 → 0.5.109

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 (137) hide show
  1. package/CHANGELOG.md +17 -1
  2. package/dist/git/models/issue.d.ts +70 -0
  3. package/dist/git/models/issue.d.ts.map +1 -1
  4. package/dist/git/models/issue.js +17 -0
  5. package/dist/git/models/issue.js.map +1 -1
  6. package/dist/git/utils/issue.utils.d.ts +41 -1
  7. package/dist/git/utils/issue.utils.d.ts.map +1 -1
  8. package/dist/git/utils/issue.utils.js +80 -0
  9. package/dist/git/utils/issue.utils.js.map +1 -1
  10. package/dist/plus/git-github/api/github.d.ts +33 -6
  11. package/dist/plus/git-github/api/github.d.ts.map +1 -1
  12. package/dist/plus/git-github/api/github.js +137 -15
  13. package/dist/plus/git-github/api/github.js.map +1 -1
  14. package/dist/plus/git-github/api/issueSearchQuery.d.ts +49 -5
  15. package/dist/plus/git-github/api/issueSearchQuery.d.ts.map +1 -1
  16. package/dist/plus/git-github/api/issueSearchQuery.js +64 -6
  17. package/dist/plus/git-github/api/issueSearchQuery.js.map +1 -1
  18. package/dist/plus/integrations/collectionMetadata.d.ts +18 -0
  19. package/dist/plus/integrations/collectionMetadata.d.ts.map +1 -1
  20. package/dist/plus/integrations/collectionMetadata.js +24 -0
  21. package/dist/plus/integrations/collectionMetadata.js.map +1 -1
  22. package/dist/plus/integrations/integrationService.d.ts +15 -9
  23. package/dist/plus/integrations/integrationService.d.ts.map +1 -1
  24. package/dist/plus/integrations/integrationService.js.map +1 -1
  25. package/dist/plus/integrations/manager.d.ts +40 -26
  26. package/dist/plus/integrations/manager.d.ts.map +1 -1
  27. package/dist/plus/integrations/models/gitHostIntegration.d.ts +6 -31
  28. package/dist/plus/integrations/models/gitHostIntegration.d.ts.map +1 -1
  29. package/dist/plus/integrations/models/gitHostIntegration.js +11 -1
  30. package/dist/plus/integrations/models/gitHostIntegration.js.map +1 -1
  31. package/dist/plus/integrations/models/issueReads.d.ts +63 -1
  32. package/dist/plus/integrations/models/issueReads.d.ts.map +1 -1
  33. package/dist/plus/integrations/models/issuesIntegration.d.ts +7 -21
  34. package/dist/plus/integrations/models/issuesIntegration.d.ts.map +1 -1
  35. package/dist/plus/integrations/models/issuesIntegration.js.map +1 -1
  36. package/dist/plus/integrations/providerFilters.d.ts +1 -1
  37. package/dist/plus/integrations/providerFilters.d.ts.map +1 -1
  38. package/dist/plus/integrations/providers/azureDevOps.d.ts.map +1 -1
  39. package/dist/plus/integrations/providers/azureDevOps.js +1 -0
  40. package/dist/plus/integrations/providers/azureDevOps.js.map +1 -1
  41. package/dist/plus/integrations/providers/github.d.ts.map +1 -1
  42. package/dist/plus/integrations/providers/github.js +1 -0
  43. package/dist/plus/integrations/providers/github.js.map +1 -1
  44. package/dist/plus/integrations/providers/gitlab.d.ts.map +1 -1
  45. package/dist/plus/integrations/providers/gitlab.js +1 -0
  46. package/dist/plus/integrations/providers/gitlab.js.map +1 -1
  47. package/dist/plus/integrations/providers/issueSorts.d.ts +36 -0
  48. package/dist/plus/integrations/providers/issueSorts.d.ts.map +1 -0
  49. package/dist/plus/integrations/providers/issueSorts.js +76 -0
  50. package/dist/plus/integrations/providers/issueSorts.js.map +1 -0
  51. package/dist/plus/integrations/providers/jira.d.ts +3 -9
  52. package/dist/plus/integrations/providers/jira.d.ts.map +1 -1
  53. package/dist/plus/integrations/providers/jira.js +5 -1
  54. package/dist/plus/integrations/providers/jira.js.map +1 -1
  55. package/dist/plus/integrations/providers/linear.d.ts +24 -9
  56. package/dist/plus/integrations/providers/linear.d.ts.map +1 -1
  57. package/dist/plus/integrations/providers/linear.js +63 -5
  58. package/dist/plus/integrations/providers/linear.js.map +1 -1
  59. package/dist/plus/integrations/providers/models.d.ts +63 -7
  60. package/dist/plus/integrations/providers/models.d.ts.map +1 -1
  61. package/dist/plus/integrations/providers/models.js +55 -0
  62. package/dist/plus/integrations/providers/models.js.map +1 -1
  63. package/dist/plus/integrations/providers/providersApi.d.ts +18 -3
  64. package/dist/plus/integrations/providers/providersApi.d.ts.map +1 -1
  65. package/dist/plus/integrations/providers/providersApi.js +24 -7
  66. package/dist/plus/integrations/providers/providersApi.js.map +1 -1
  67. package/dist/plus/integrations/providers/trello.d.ts +3 -9
  68. package/dist/plus/integrations/providers/trello.d.ts.map +1 -1
  69. package/dist/plus/integrations/providers/trello.js +1 -0
  70. package/dist/plus/integrations/providers/trello.js.map +1 -1
  71. package/dist/plus/integrations/providers/utils/providerPaging.d.ts.map +1 -1
  72. package/dist/plus/integrations/providers/utils/providerPaging.js +5 -1
  73. package/dist/plus/integrations/providers/utils/providerPaging.js.map +1 -1
  74. package/dist/plus/integrations/reads/broaden.d.ts +6 -0
  75. package/dist/plus/integrations/reads/broaden.d.ts.map +1 -1
  76. package/dist/plus/integrations/reads/broaden.js.map +1 -1
  77. package/dist/plus/integrations/reads/counts.d.ts +8 -1
  78. package/dist/plus/integrations/reads/counts.d.ts.map +1 -1
  79. package/dist/plus/integrations/reads/counts.js.map +1 -1
  80. package/dist/plus/integrations/reads/filters.d.ts +59 -9
  81. package/dist/plus/integrations/reads/filters.d.ts.map +1 -1
  82. package/dist/plus/integrations/reads/filters.js +17 -0
  83. package/dist/plus/integrations/reads/filters.js.map +1 -1
  84. package/dist/plus/integrations/reads/issueTracker.d.ts +18 -1
  85. package/dist/plus/integrations/reads/issueTracker.d.ts.map +1 -1
  86. package/dist/plus/integrations/reads/issueTracker.js +40 -3
  87. package/dist/plus/integrations/reads/issueTracker.js.map +1 -1
  88. package/dist/plus/integrations/reads/issues.d.ts +27 -3
  89. package/dist/plus/integrations/reads/issues.d.ts.map +1 -1
  90. package/dist/plus/integrations/reads/issues.js +223 -123
  91. package/dist/plus/integrations/reads/issues.js.map +1 -1
  92. package/dist/plus/integrations/reads/ordering.d.ts +101 -0
  93. package/dist/plus/integrations/reads/ordering.d.ts.map +1 -0
  94. package/dist/plus/integrations/reads/ordering.js +48 -0
  95. package/dist/plus/integrations/reads/ordering.js.map +1 -0
  96. package/dist/plus/integrations/reads/searchIssues.d.ts +7 -2
  97. package/dist/plus/integrations/reads/searchIssues.d.ts.map +1 -1
  98. package/dist/plus/integrations/reads/searchIssues.js +9 -3
  99. package/dist/plus/integrations/reads/searchIssues.js.map +1 -1
  100. package/dist/plus/integrations/reads/warnings.d.ts +34 -2
  101. package/dist/plus/integrations/reads/warnings.d.ts.map +1 -1
  102. package/dist/plus/integrations/reads/warnings.js +47 -2
  103. package/dist/plus/integrations/reads/warnings.js.map +1 -1
  104. package/dist/plus/integrations/results.d.ts +10 -0
  105. package/dist/plus/integrations/results.d.ts.map +1 -1
  106. package/dist/plus/integrations/results.js.map +1 -1
  107. package/package.json +2 -2
  108. package/src/git/models/issue.ts +73 -0
  109. package/src/git/utils/issue.utils.ts +91 -1
  110. package/src/plus/git-github/api/github.ts +180 -20
  111. package/src/plus/git-github/api/issueSearchQuery.ts +67 -7
  112. package/src/plus/integrations/collectionMetadata.ts +24 -0
  113. package/src/plus/integrations/integrationService.ts +15 -10
  114. package/src/plus/integrations/manager.ts +40 -31
  115. package/src/plus/integrations/models/gitHostIntegration.ts +18 -31
  116. package/src/plus/integrations/models/issueReads.ts +65 -1
  117. package/src/plus/integrations/models/issuesIntegration.ts +7 -6
  118. package/src/plus/integrations/providerFilters.ts +2 -0
  119. package/src/plus/integrations/providers/azureDevOps.ts +1 -0
  120. package/src/plus/integrations/providers/github.ts +1 -0
  121. package/src/plus/integrations/providers/gitlab.ts +1 -0
  122. package/src/plus/integrations/providers/issueSorts.ts +89 -0
  123. package/src/plus/integrations/providers/jira.ts +9 -3
  124. package/src/plus/integrations/providers/linear.ts +77 -8
  125. package/src/plus/integrations/providers/models.ts +122 -5
  126. package/src/plus/integrations/providers/providersApi.ts +51 -13
  127. package/src/plus/integrations/providers/trello.ts +4 -3
  128. package/src/plus/integrations/providers/utils/providerPaging.ts +6 -1
  129. package/src/plus/integrations/reads/broaden.ts +6 -0
  130. package/src/plus/integrations/reads/counts.ts +8 -1
  131. package/src/plus/integrations/reads/filters.ts +70 -8
  132. package/src/plus/integrations/reads/issueTracker.ts +78 -4
  133. package/src/plus/integrations/reads/issues.ts +386 -194
  134. package/src/plus/integrations/reads/ordering.ts +124 -0
  135. package/src/plus/integrations/reads/searchIssues.ts +15 -3
  136. package/src/plus/integrations/reads/warnings.ts +72 -1
  137. package/src/plus/integrations/results.ts +10 -0
@@ -1,13 +1,44 @@
1
1
  import { mergeAssessmentInto } from '../collectionMetadata.js';
2
2
  import { GitCloudHostIntegrationId, GitSelfManagedHostIntegrationId } from '../constants.js';
3
- import { PagingMode, providersMetadata } from '../providers/models.js';
3
+ import { isRepoIdsInput, PagingMode, providersMetadata } from '../providers/models.js';
4
4
  import { mergeCollectionMetadata } from '../providers/utils/providerPaging.js';
5
5
  import { reconcileOmissionsWithFailure } from '../results.js';
6
6
  import { isGitHostIntegration, isIssuesHostIntegrationId, warnOnMissingSessionForDomain, } from '../utils/integration.utils.js';
7
7
  import { runCaptured } from './drains.js';
8
8
  import { resolveAccountWideIssueFilters } from './filters.js';
9
+ import { resolveIssueSort, toIssueOrdering } from './ordering.js';
9
10
  import { drainFlatPagesToRequestedPage, drainToRequestedPage, isPageNumberAdvanceable, pageToCursor, refusedPage, resolveContinuation, resolveCurrentPage, toProviderPageInfo, usableCursor, } from './paging.js';
10
- import { gitHostOnlySurfaceWarning, issuesUnsupportedWarning, otherWarning, truncationWarning, unsupportedAccountWideIssueFiltersWarning, } from './warnings.js';
11
+ import { gitHostOnlySurfaceWarning, issuesUnsupportedWarning, otherWarning, truncationWarning, unmergeableIssueSortWarning, unsupportedAccountWideIssueFiltersWarning, unsupportedIssueSortWarning, } from './warnings.js';
12
+ /**
13
+ * Whether a repo-scoped page is assembled from SEVERAL provider queries and merged here — which is what decides
14
+ * whether the requested order can be honored at all.
15
+ *
16
+ * `PagingMode.Repos` (GitHub) sends one search however many repositories are named, so its page arrives ordered by
17
+ * the provider. `Repo` (GitLab) issues one query per repository, and `Project` (Azure) one per PROJECT — several
18
+ * repositories of the same project are still one query, which is why that case counts distinct projects rather than
19
+ * repositories.
20
+ *
21
+ * The `Repo` case has a second way to merge that has nothing to do with the count: given repository IDS rather than
22
+ * descriptors, `getMyIssuesForReposResult` skips its per-repository fan-out entirely (that branch is guarded on
23
+ * `!isRepoIdsInput`) and calls the SDK's `getIssuesForRepos`, which for GitLab is the multi-project aggregate that
24
+ * merges in the SDK and refuses `priority`/`dueDate` however few scopes it was given. Treating that as merged is
25
+ * what makes this facade refuse it up front, with the message that names the reason, instead of letting the SDK
26
+ * reject a read the capability table had just promised.
27
+ */
28
+ function mergesProviderQueries(pagingMode, repos) {
29
+ const scopes = repos ?? [];
30
+ switch (pagingMode) {
31
+ case PagingMode.Repo:
32
+ // `isRepoIdsInput` is the same predicate `ProvidersApi` selects the SDK aggregate with, so this cannot
33
+ // disagree with the branch it is predicting.
34
+ return isRepoIdsInput(scopes) ? scopes.length > 0 : scopes.length > 1;
35
+ case PagingMode.Project:
36
+ // Only the descriptor form carries a project; the id form is refused by the Azure read before it runs.
37
+ return new Set(scopes.map(r => (typeof r === 'object' ? r.project : undefined))).size > 1;
38
+ default:
39
+ return false;
40
+ }
41
+ }
11
42
  export async function listIssuesPage(ctx, options) {
12
43
  const page = Math.max(1, options.page ?? 1);
13
44
  if (isIssuesHostIntegrationId(options.providerId)) {
@@ -31,125 +62,190 @@ export async function listIssuesPage(ctx, options) {
31
62
  if (!integration.supportsIssues) {
32
63
  return refusedPage(page, [issuesUnsupportedWarning(options.providerId, domain, options.connectionId)], true);
33
64
  }
34
- const accountWide = (options.repos?.length ?? 0) === 0;
35
- if (accountWide) {
36
- // The account-wide read is cursor-only, so a refusal can't claim the requested position — it reports
37
- // page 1, per ProviderPageInfo.currentPage.
38
- const refused = (warning) => refusedPage(1, [warning], true);
39
- // Checked before the provider-specific guards below: a caller passing both has a contradictory request
40
- // whatever the provider, and saying so is more useful than reporting one half of it as unsupported.
41
- // `filters` narrows this read to a relationship (`[Assignee]` ⇒ just assigned-to-me); `includeAllAssignees`
42
- // broadens it to every assignee. Honoring either silently would answer a question the caller didn't ask.
43
- if (options.filters?.length && options.includeAllAssignees === true) {
44
- return refused(otherWarning(options.providerId, domain, options.connectionId, '`filters` and `includeAllAssignees` are contradictory for an account-wide issue read; pass only one.'));
45
- }
46
- // GitHub expresses "any assignee" as `assignee:*`, which is meaningless without a scope: unscoped it
47
- // matches millions of issues across all of GitHub instead of the user's own world. ANY scope makes it
48
- // meaningful (one repository, several, or an org) — it is specifically THIS branch, the account-wide read,
49
- // that has none to offer. Scope the read to repositories (or use `searchIssuesPage`, whose criteria model
50
- // takes `any-assignee` alongside a `repos`/`org` scope) rather than reading unscoped.
51
- if (options.includeAllAssignees === true &&
52
- (options.providerId === GitCloudHostIntegrationId.GitHub ||
53
- options.providerId === GitSelfManagedHostIntegrationId.CloudGitHubEnterprise)) {
54
- return refused(otherWarning(options.providerId, domain, options.connectionId, '`includeAllAssignees` is not supported for account-wide GitHub issue reads; scope the read to repositories instead.'));
55
- }
56
- // Only a host with a project layer can narrow server-side. Reject the request rather than serving an
57
- // unscoped list as if it had been narrowed: the caller would otherwise have to filter client-side,
58
- // which desynchronizes the filtered `items` from this read's `hasMore`/`currentPage` and shows
59
- // "no issues" for a page that simply held none of the requested project's.
60
- if ((options.org != null || options.project != null) && !integration.supportsProjectDiscovery) {
61
- return refused(otherWarning(options.providerId, domain, options.connectionId, `Project-scoped issue reads are not supported by '${options.providerId}'; scope the read to repositories instead.`));
62
- }
63
- // Narrowing the account-wide read is only honest when the provider can express it server-side: its
64
- // per-relationship queries produced the page and the cursor together, so dropping items afterward would
65
- // leave `items` describing a different result set than `hasMore`/`currentPage`.
66
- const resolvedIssueFilters = resolveAccountWideIssueFilters(options.providerId, options.filters);
67
- if (resolvedIssueFilters.unsupported) {
68
- return refused(unsupportedAccountWideIssueFiltersWarning(options.providerId, domain, options.connectionId, options.filters));
69
- }
70
- // The repo-scoped core rejects empty repos (GitHub/Bitbucket/Azure); read the account-wide,
71
- // already-user-scoped core instead. GitHub exposes a composite cursor across its authored,
72
- // assigned, and mentioned searches. Walk it internally when the caller supplies only page N.
73
- const readAccountWidePage = (cursor) => runCaptured(options.providerId, domain, options.connectionId, () => integration.searchMyIssuesWithTruncationResult(undefined, undefined, options.connectionId, {
74
- includeAllAssignees: options.includeAllAssignees,
75
- filters: resolvedIssueFilters.filters,
76
- cursor: cursor,
77
- org: options.org,
78
- project: options.project,
79
- }), { warnOnMissingSession: warnOnMissingSession });
80
- const first = await readAccountWidePage(options.cursor);
81
- const warnings = first.warning != null ? [first.warning] : [];
82
- // Merged across the walked pages, so a per-scope failure reported on an earlier page isn't lost by
83
- // paging past it — the one thing this read accumulates that the filtered search doesn't.
84
- let allMetadata = first.value?.metadata;
85
- const drained = await drainFlatPagesToRequestedPage(first, {
86
- requestedPage: page,
87
- suppliedCursor: options.cursor,
88
- warnings: warnings,
89
- readPage: readAccountWidePage,
90
- fold: p => {
91
- allMetadata = mergeCollectionMetadata(allMetadata, p.metadata);
92
- },
93
- });
94
- const { value, currentPage, requestedPageMissing } = drained;
95
- const currentTruncated = drained.truncated;
96
- const pageFetchFailed = drained.fetchFailed;
97
- // GitHub, GitLab, and Azure implement an account-wide issue search; a provider that doesn't (Bitbucket
98
- // exposes no issues at all, and `supportsIssues` already short-circuits it above) returns `undefined`
99
- // with no error. Surface that as an explicit unsupported warning + fetchFailed rather than a silent
100
- // empty successthe caller must fall back (e.g. broadenIssues over repos).
101
- if (value == null && warnings.length === 0) {
102
- return refused(otherWarning(options.providerId, domain, options.connectionId, `Account-wide issue search is not supported by '${options.providerId}'; scope the read to repositories instead.`));
103
- }
104
- const items = requestedPageMissing ? [] : (value?.values ?? []);
105
- // Fold in structured per-scope failures from the account-wide fan-out (e.g. Azure across projects):
106
- // scope-aware warnings + `fetchFailed` when a scope failed, without discarding the successful items.
107
- const assessment = mergeAssessmentInto(warnings, options.providerId, domain, options.connectionId, allMetadata);
108
- // An account-wide search that couldn't confirm completeness (a provider cap with no cursor, or a
109
- // per-scope backstop/failure) is incomplete and can't be paged; report it as truncated (+ a
110
- // provider-neutral warning, unless a structured failure already explains it) rather than a complete
111
- // list. Don't hard-code GitHub's "100 per category" cap here — Azure reaches this via a per-project
112
- // backstop, and other providers may cap differently.
113
- // The account-wide read is cursor-only (its composite cursor spans several provider searches, so a
114
- // page number can't address it): `hasMore` without a real cursor is a dead end, so report it as
115
- // terminal-but-incomplete rather than inviting the caller to page forever.
116
- const continuation = resolveContinuation({
117
- hasMore: requestedPageMissing ? false : (value?.hasMore ?? false),
118
- cursor: requestedPageMissing ? undefined : usableCursor(value?.cursor),
119
- truncated: currentTruncated,
120
- }, undefined);
121
- const truncated = continuation.truncated || assessment.truncated;
122
- if (truncated && warnings.length === 0) {
123
- warnings.push(truncationWarning(options.providerId, domain, options.connectionId, 'Account-wide issue search',
124
- // `exhausted`: this composite read exposes no budget the caller can raise, so nothing it
125
- // could call would return the withheld items.
126
- assessment.fetchFailed || pageFetchFailed ? 'interrupted' : 'exhausted'));
127
- }
128
- // A metadata omission from an earlier page asserts the read succeeded; a later page may since have failed.
129
- reconcileOmissionsWithFailure(warnings, assessment.fetchFailed || pageFetchFailed);
130
- return {
131
- items: items,
132
- warnings: warnings,
133
- page: {
134
- // Positional, per ProviderPageInfo.currentPage. `currentPage` already carries what the provider
135
- // reported or what the internal drain counted; a requested page past the terminal cursor is
136
- // reported as that empty page N. The account-wide read is cursor-only, so a `page` the caller
137
- // didn't pair with a cursor is never echoed.
138
- currentPage: requestedPageMissing
139
- ? page
140
- : resolveCurrentPage({
141
- providerPage: currentPage,
142
- requestedPage: page,
143
- suppliedCursor: options.cursor,
144
- pageAdvanceable: false,
145
- }),
146
- itemsPerPage: items.length,
147
- truncated: truncated || undefined,
148
- },
149
- hasMore: continuation.hasMore,
150
- cursor: continuation.cursor,
151
- fetchFailed: assessment.fetchFailed || pageFetchFailed || undefined,
152
- };
65
+ // `repos` is what selects between the two: with none there is no scope to query per repository, so the
66
+ // provider's own account-wide search answers instead. They are different provider queries with different
67
+ // capability tables, cursors and completeness signals see each function.
68
+ const context = {
69
+ options: options,
70
+ integration: integration,
71
+ domain: domain,
72
+ warnOnMissingSession: warnOnMissingSession,
73
+ page: page,
74
+ };
75
+ return (options.repos?.length ?? 0) === 0 ? readAccountWideIssuesPage(context) : readRepoScopedIssuesPage(context);
76
+ }
77
+ /**
78
+ * The account-wide read: the provider's own definition of "my issues", behind a composite cursor that spans
79
+ * several provider searches.
80
+ *
81
+ * Its own function rather than a branch of the paged read, because almost nothing is shared past the guards: it
82
+ * validates a different filter table and a different sort table, it is cursor-only (a page number cannot address
83
+ * a composite cursor), it accumulates per-scope failures across the pages it walks, and it always merges several
84
+ * queries. The two used to share one 460-line function behind a mode flag, and the comments explaining how far
85
+ * apart they are were the clue that they wanted separating.
86
+ */
87
+ async function readAccountWideIssuesPage({ options, integration, domain, warnOnMissingSession, page, }) {
88
+ // The account-wide read is cursor-only, so a refusal can't claim the requested position it reports
89
+ // page 1, per ProviderPageInfo.currentPage.
90
+ const refused = (warning) => refusedPage(1, [warning], true);
91
+ // Checked before the provider-specific guards below: a caller passing both has a contradictory request
92
+ // whatever the provider, and saying so is more useful than reporting one half of it as unsupported.
93
+ // `filters` narrows this read to a relationship (`[Assignee]` ⇒ just assigned-to-me); `includeAllAssignees`
94
+ // broadens it to every assignee. Honoring either silently would answer a question the caller didn't ask.
95
+ if (options.filters?.length && options.includeAllAssignees === true) {
96
+ return refused(otherWarning(options.providerId, domain, options.connectionId, '`filters` and `includeAllAssignees` are contradictory for an account-wide issue read; pass only one.'));
97
+ }
98
+ // GitHub expresses "any assignee" as `assignee:*`, which is meaningless without a scope: unscoped it
99
+ // matches millions of issues across all of GitHub instead of the user's own world. ANY scope makes it
100
+ // meaningful (one repository, several, or an org) — it is specifically THIS branch, the account-wide read,
101
+ // that has none to offer. Scope the read to repositories (or use `searchIssuesPage`, whose criteria model
102
+ // takes `any-assignee` alongside a `repos`/`org` scope) rather than reading unscoped.
103
+ if (options.includeAllAssignees === true &&
104
+ (options.providerId === GitCloudHostIntegrationId.GitHub ||
105
+ options.providerId === GitSelfManagedHostIntegrationId.CloudGitHubEnterprise)) {
106
+ return refused(otherWarning(options.providerId, domain, options.connectionId, '`includeAllAssignees` is not supported for account-wide GitHub issue reads; scope the read to repositories instead.'));
107
+ }
108
+ // Only a host with a project layer can narrow server-side. Reject the request rather than serving an
109
+ // unscoped list as if it had been narrowed: the caller would otherwise have to filter client-side,
110
+ // which desynchronizes the filtered `items` from this read's `hasMore`/`currentPage` and shows
111
+ // "no issues" for a page that simply held none of the requested project's.
112
+ if ((options.org != null || options.project != null) && !integration.supportsProjectDiscovery) {
113
+ return refused(otherWarning(options.providerId, domain, options.connectionId, `Project-scoped issue reads are not supported by '${options.providerId}'; scope the read to repositories instead.`));
114
+ }
115
+ // Narrowing the account-wide read is only honest when the provider can express it server-side: its
116
+ // per-relationship queries produced the page and the cursor together, so dropping items afterward would
117
+ // leave `items` describing a different result set than `hasMore`/`currentPage`.
118
+ const resolvedIssueFilters = resolveAccountWideIssueFilters(options.providerId, options.filters);
119
+ if (resolvedIssueFilters.unsupported) {
120
+ return refused(unsupportedAccountWideIssueFiltersWarning(options.providerId, domain, options.connectionId, options.filters));
121
+ }
122
+ // Every provider's account-wide read is a UNION of several queries — GitHub's three `@me` searches,
123
+ // GitLab's one REST call per relationship, Azure's (project x relationship) drains — so it always merges,
124
+ // and `supportedAccountWideIssueSorts` already lists only keys a merge can honor. No separate
125
+ // mergeability refusal is needed here, unlike on the repo-scoped path below.
126
+ const resolvedSort = resolveIssueSort(providersMetadata[options.providerId]?.supportedAccountWideIssueSorts, options.sort);
127
+ if (resolvedSort.rejection != null) {
128
+ return refused(unsupportedIssueSortWarning(options.providerId, domain, options.connectionId, resolvedSort.rejection));
129
+ }
130
+ // `merged: true` unconditionally: this read has no scope count for a caller to reduce. It is also why no
131
+ // `unmergeable` check follows `supportedAccountWideIssueSorts` declares only keys a merge can honor.
132
+ const accountWideOrdering = toIssueOrdering(resolvedSort.sort, true);
133
+ // The repo-scoped core rejects empty repos (GitHub/Bitbucket/Azure); read the account-wide,
134
+ // already-user-scoped core instead. GitHub exposes a composite cursor across its authored,
135
+ // assigned, and mentioned searches. Walk it internally when the caller supplies only page N.
136
+ const readAccountWidePage = (cursor) => runCaptured(options.providerId, domain, options.connectionId, () => integration.searchMyIssuesWithTruncationResult(undefined, undefined, options.connectionId, {
137
+ includeAllAssignees: options.includeAllAssignees,
138
+ filters: resolvedIssueFilters.filters,
139
+ cursor: cursor,
140
+ org: options.org,
141
+ project: options.project,
142
+ sort: accountWideOrdering.sort,
143
+ }), { warnOnMissingSession: warnOnMissingSession });
144
+ const first = await readAccountWidePage(options.cursor);
145
+ const warnings = first.warning != null ? [first.warning] : [];
146
+ // Merged across the walked pages, so a per-scope failure reported on an earlier page isn't lost by
147
+ // paging past it — the one thing this read accumulates that the filtered search doesn't.
148
+ let allMetadata = first.value?.metadata;
149
+ const drained = await drainFlatPagesToRequestedPage(first, {
150
+ requestedPage: page,
151
+ suppliedCursor: options.cursor,
152
+ warnings: warnings,
153
+ readPage: readAccountWidePage,
154
+ fold: p => {
155
+ allMetadata = mergeCollectionMetadata(allMetadata, p.metadata);
156
+ },
157
+ });
158
+ const { value, currentPage, requestedPageMissing } = drained;
159
+ const currentTruncated = drained.truncated;
160
+ const pageFetchFailed = drained.fetchFailed;
161
+ // GitHub, GitLab, and Azure implement an account-wide issue search; a provider that doesn't (Bitbucket
162
+ // exposes no issues at all, and `supportsIssues` already short-circuits it above) returns `undefined`
163
+ // with no error. Surface that as an explicit unsupported warning + fetchFailed rather than a silent
164
+ // empty success — the caller must fall back (e.g. broadenIssues over repos).
165
+ if (value == null && warnings.length === 0) {
166
+ return refused(otherWarning(options.providerId, domain, options.connectionId, `Account-wide issue search is not supported by '${options.providerId}'; scope the read to repositories instead.`));
167
+ }
168
+ const items = requestedPageMissing ? [] : (value?.values ?? []);
169
+ // Each query arrived ordered by the provider; their union is not, and the union is what this read publishes.
170
+ // Idempotent for GitHub, whose aliased-search engine already ordered the same merge — one call here rather
171
+ // than the same logic repeated in each of the three provider implementations.
172
+ const orderedItems = accountWideOrdering.order(items);
173
+ // Fold in structured per-scope failures from the account-wide fan-out (e.g. Azure across projects):
174
+ // scope-aware warnings + `fetchFailed` when a scope failed, without discarding the successful items.
175
+ const assessment = mergeAssessmentInto(warnings, options.providerId, domain, options.connectionId, allMetadata);
176
+ // An account-wide search that couldn't confirm completeness (a provider cap with no cursor, or a
177
+ // per-scope backstop/failure) is incomplete and can't be paged; report it as truncated (+ a
178
+ // provider-neutral warning, unless a structured failure already explains it) rather than a complete
179
+ // list. Don't hard-code GitHub's "100 per category" cap here — Azure reaches this via a per-project
180
+ // backstop, and other providers may cap differently.
181
+ // The account-wide read is cursor-only (its composite cursor spans several provider searches, so a
182
+ // page number can't address it): `hasMore` without a real cursor is a dead end, so report it as
183
+ // terminal-but-incomplete rather than inviting the caller to page forever.
184
+ const continuation = resolveContinuation({
185
+ hasMore: requestedPageMissing ? false : (value?.hasMore ?? false),
186
+ cursor: requestedPageMissing ? undefined : usableCursor(value?.cursor),
187
+ truncated: currentTruncated,
188
+ }, undefined);
189
+ const truncated = continuation.truncated || assessment.truncated;
190
+ if (truncated && warnings.length === 0) {
191
+ warnings.push(truncationWarning(options.providerId, domain, options.connectionId, 'Account-wide issue search',
192
+ // `exhausted`: this composite read exposes no budget the caller can raise, so nothing it
193
+ // could call would return the withheld items.
194
+ assessment.fetchFailed || pageFetchFailed ? 'interrupted' : 'exhausted'));
195
+ }
196
+ // A metadata omission from an earlier page asserts the read succeeded; a later page may since have failed.
197
+ reconcileOmissionsWithFailure(warnings, assessment.fetchFailed || pageFetchFailed);
198
+ return {
199
+ items: orderedItems,
200
+ warnings: warnings,
201
+ page: {
202
+ // Positional, per ProviderPageInfo.currentPage. `currentPage` already carries what the provider
203
+ // reported or what the internal drain counted; a requested page past the terminal cursor is
204
+ // reported as that empty page N. The account-wide read is cursor-only, so a `page` the caller
205
+ // didn't pair with a cursor is never echoed.
206
+ currentPage: requestedPageMissing
207
+ ? page
208
+ : resolveCurrentPage({
209
+ providerPage: currentPage,
210
+ requestedPage: page,
211
+ suppliedCursor: options.cursor,
212
+ pageAdvanceable: false,
213
+ }),
214
+ itemsPerPage: orderedItems.length,
215
+ truncated: truncated || undefined,
216
+ },
217
+ hasMore: continuation.hasMore,
218
+ cursor: continuation.cursor,
219
+ fetchFailed: assessment.fetchFailed || pageFetchFailed || undefined,
220
+ };
221
+ }
222
+ /**
223
+ * The repository-scoped read: one provider query per repository or project, paged by the provider's own
224
+ * continuation and drained internally when the caller supplied only a page number.
225
+ *
226
+ * See {@link readAccountWideIssuesPage} for why the two are separate functions.
227
+ */
228
+ async function readRepoScopedIssuesPage({ options, integration, domain, warnOnMissingSession, page, }) {
229
+ const metadata = providersMetadata[options.providerId];
230
+ // How many separate provider queries this page is assembled from, which decides whether the requested order can
231
+ // be honored at all. `PagingMode.Repos` (GitHub) sends ONE search however many repositories are named, so its
232
+ // page arrives ordered by the provider; `Repo` (GitLab) and `Project` (Azure) issue one query per scope and are
233
+ // concatenated here, so a page spanning several of them is only as orderable as a normalized issue is.
234
+ const resolvedRepoScopedSort = resolveIssueSort(metadata?.supportedIssueSorts, options.sort);
235
+ if (resolvedRepoScopedSort.rejection != null) {
236
+ return refusedPage(page, [
237
+ unsupportedIssueSortWarning(options.providerId, domain, options.connectionId, resolvedRepoScopedSort.rejection),
238
+ ], true);
239
+ }
240
+ const issuesPagingMode = metadata?.issuesPagingMode;
241
+ const ordering = toIssueOrdering(resolvedRepoScopedSort.sort, mergesProviderQueries(issuesPagingMode, options.repos));
242
+ // Refused rather than served as concatenated per-scope runs, which would look ordered without being so — and
243
+ // only where it actually merges, since the same key against the same provider is perfectly answerable for a
244
+ // single repository or project.
245
+ if (ordering.unmergeable != null) {
246
+ return refusedPage(page, [
247
+ unmergeableIssueSortWarning(options.providerId, domain, options.connectionId, ordering.unmergeable, issuesPagingMode === PagingMode.Project ? 'projects' : 'repositories'),
248
+ ], true);
153
249
  }
154
250
  const cursor = options.cursor ?? pageToCursor(page);
155
251
  const { value, warning } = await runCaptured(options.providerId, domain, options.connectionId, () =>
@@ -164,6 +260,7 @@ export async function listIssuesPage(ctx, options) {
164
260
  cursor: cursor,
165
261
  page: options.page,
166
262
  pageSize: options.itemsPerPage,
263
+ sort: ordering.sort,
167
264
  }, options.connectionId), { warnOnMissingSession: warnOnMissingSession });
168
265
  let items = value?.values ?? [];
169
266
  const warnings = warning != null ? [warning] : [];
@@ -172,7 +269,7 @@ export async function listIssuesPage(ctx, options) {
172
269
  let allMetadata = value?.metadata;
173
270
  // Cursor-only repo-scoped hosts (e.g. GitHub) ignore a synthesized page-number cursor, so a page-only
174
271
  // request is advanced through the provider's own continuations (see drainToRequestedPage).
175
- if (providersMetadata[options.providerId]?.issuesPagingMode === PagingMode.Repos &&
272
+ if (issuesPagingMode === PagingMode.Repos &&
176
273
  options.page != null &&
177
274
  options.page > 1 &&
178
275
  options.cursor == null &&
@@ -186,6 +283,7 @@ export async function listIssuesPage(ctx, options) {
186
283
  includeAllAssignees: options.includeAllAssignees,
187
284
  cursor: cursor,
188
285
  pageSize: options.itemsPerPage,
286
+ sort: ordering.sort,
189
287
  }, options.connectionId), { warnOnMissingSession: warnOnMissingSession }),
190
288
  });
191
289
  items = drained.items;
@@ -193,12 +291,14 @@ export async function listIssuesPage(ctx, options) {
193
291
  allMetadata = drained.metadata;
194
292
  pageFetchFailed = drained.fetchFailed;
195
293
  }
294
+ // Ordered once the drain (above) has assembled whichever pages this position spans.
295
+ items = ordering.order(items);
196
296
  // Convert the SDK collection metadata into scope-aware warnings + failure/truncation flags, appending
197
297
  // them to any captured thrown-error warning without discarding the partial result's items.
198
298
  const assessment = mergeAssessmentInto(warnings, options.providerId, domain, options.connectionId, allMetadata);
199
299
  // Never advertise `hasMore` without a continuation the caller can act on, and only synthesize a page
200
300
  // number for a host that reads it as one (see `isPageNumberAdvanceable`).
201
- const issuesPageAdvanceable = isPageNumberAdvanceable(providersMetadata[options.providerId]?.issuesPagingMode);
301
+ const issuesPageAdvanceable = isPageNumberAdvanceable(issuesPagingMode);
202
302
  const continuation = resolveContinuation(paged, issuesPageAdvanceable ? paged.page.currentPage + 1 : undefined);
203
303
  // A provider read that couldn't confirm completeness (e.g. Bitbucket's single-page repo issue read
204
304
  // that dropped a repo) sets `paging.truncated`; surface it as a terminal `page.truncated` so a partial
@@ -1 +1 @@
1
- {"version":3,"file":"issues.js","sourceRoot":"","sources":["../../../../src/plus/integrations/reads/issues.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAE/D,OAAO,EAAE,yBAAyB,EAAE,+BAA+B,EAAE,MAAM,iBAAiB,CAAC;AAE7F,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AACvE,OAAO,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;AAE/E,OAAO,EAAE,6BAA6B,EAAE,MAAM,eAAe,CAAC;AAC9D,OAAO,EACN,oBAAoB,EACpB,yBAAyB,EACzB,6BAA6B,GAC7B,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,8BAA8B,EAAE,MAAM,cAAc,CAAC;AAC9D,OAAO,EACN,6BAA6B,EAC7B,oBAAoB,EACpB,uBAAuB,EACvB,YAAY,EACZ,WAAW,EACX,mBAAmB,EACnB,kBAAkB,EAClB,kBAAkB,EAClB,YAAY,GACZ,MAAM,aAAa,CAAC;AACrB,OAAO,EACN,yBAAyB,EACzB,wBAAwB,EACxB,YAAY,EACZ,iBAAiB,EACjB,yCAAyC,GACzC,MAAM,eAAe,CAAC;AAEvB,MAAM,CAAC,KAAK,UAAU,cAAc,CACnC,GAAwB,EACxB,OA2BC;IAED,MAAM,IAAI,GAAG,IAAI,C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,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACxC,QAAQ,CAAC,IAAI,CACZ,iBAAiB,CAChB,OAAO,CAAC,UAAU,EAClB,MAAM,EACN,OAAO,CAAC,YAAY,EACpB,OAAO;QACP,yFAAyF;QACzF,oEAAoE;QACpE,UAAU,CAAC,WAAW,IAAI,eAAe,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,WAAW,CACvE,CACD,CAAC;IACH,CAAC;IACD,2GAA2G;IAC3G,6BAA6B,CAAC,QAAQ,EAAE,UAAU,CAAC,WAAW,IAAI,eAAe,CAAC,CAAC;IACnF,OAAO;QACN,KAAK,EAAE,KAAK;QACZ,QAAQ,EAAE,QAAQ;QAClB,IAAI,EAAE;YACL,GAAG,KAAK,CAAC,IAAI;YACb,oGAAoG;YACpG,sFAAsF;YACtF,WAAW,EAAE,kBAAkB,CAAC;gBAC/B,YAAY,EAAE,KAAK,CAAC,IAAI,CAAC,WAAW;gBACpC,aAAa,EAAE,IAAI;gBACnB,cAAc,EAAE,OAAO,CAAC,MAAM;gBAC9B,eAAe,EAAE,qBAAqB;aACtC,CAAC;YACF,SAAS,EAAE,SAAS,IAAI,SAAS;SACjC;QACD,OAAO,EAAE,YAAY,CAAC,OAAO;QAC7B,MAAM,EAAE,YAAY,CAAC,MAAM;QAC3B,WAAW,EAAE,UAAU,CAAC,WAAW,IAAI,eAAe,IAAI,SAAS;KACnE,CAAC;AACH,CAAC"}
@@ -0,0 +1,101 @@
1
+ import type { IssueShape, IssueSorting } from '../../../git/models/issue.js';
2
+ /**
3
+ * How an issue read decides what order to request, and how to order a page it assembled itself.
4
+ *
5
+ * Its own module rather than more of `filters.ts` because it answers a different question. That file validates what
6
+ * a caller asked to NARROW to; this one resolves what a caller asked to ORDER by — and unlike a filter, an order
7
+ * doesn't only have to be expressible by the provider, it also has to survive the read's own merging. Every issue
8
+ * read makes both decisions in the same shape, so they are resolved here once rather than at each read.
9
+ */
10
+ /**
11
+ * Why {@link resolveIssueSort} refused a key, carrying what the refusal has to say — the same shape
12
+ * `IssueSearchCriteriaRejection` uses for the filtered search, and for the same reason.
13
+ *
14
+ * The payload travels WITH the rejection rather than being re-read at the warning: the check already held both
15
+ * values, so handing them back is what lets a caller word the refusal without re-deriving anything TypeScript
16
+ * can no longer narrow (which is how this grew five non-null assertions), and it makes it impossible for the
17
+ * message to name a supported list the check didn't use.
18
+ */
19
+ export type UnsupportedIssueSortRejection = {
20
+ reason: 'unsupported-sort';
21
+ /** The key the caller asked for. Non-optional, unlike the `sort` a successful resolve returns. */
22
+ requested: IssueSorting;
23
+ /** Every key this surface CAN express, for the message. `undefined` when the read can't be ordered at all. */
24
+ supported: IssueSorting[] | undefined;
25
+ };
26
+ /**
27
+ * Resolves the order an issue read should request: validates a caller-supplied key against what one provider
28
+ * surface can express server-side, and supplies this facade's default when the caller asked for none.
29
+ *
30
+ * Three outcomes, and each is a decision rather than a convenience:
31
+ * - A key the surface can't express is REJECTED and the read refused whole, never resolved to the nearest
32
+ * supported key. Same reason a dropped filter isn't dropped: the provider serves at most a bounded window of
33
+ * matches, so a list ordered by something else is a DIFFERENT subset than the one asked for, and the cursor that
34
+ * comes with it describes that other subset — indistinguishable, from the result, from the order requested.
35
+ * - An omitted key becomes {@link defaultIssueSort}, because leaving it to the provider is what makes the same
36
+ * read return different things on different hosts (Azure by creation, Jira by nothing at all). The default is
37
+ * this facade's promise; the SDK deliberately has no opinion.
38
+ * - An omitted key on a surface that can't express even the default returns `undefined`, leaving that provider's
39
+ * own order. A default the caller never asked for must not refuse a read that works today.
40
+ *
41
+ * Takes the supported list rather than an `IntegrationIds`, unlike the filter validators, because which list
42
+ * applies is the CALLER's decision — `supportedIssueSorts` for a repo-scoped or tracker read,
43
+ * `supportedAccountWideIssueSorts` for an account-wide one — and that branch already exists at the call site
44
+ * (`repos` present or not). Resolving it in here would duplicate it.
45
+ */
46
+ export declare function resolveIssueSort(supported: IssueSorting[] | undefined, sort: IssueSorting | undefined): {
47
+ rejection?: UnsupportedIssueSortRejection;
48
+ sort?: IssueSorting;
49
+ };
50
+ /**
51
+ * Why a merged page can't honor the key it was given: the read fans out over several provider queries and no
52
+ * normalized issue carries the field to merge on.
53
+ *
54
+ * Named for the same reason {@link UnsupportedIssueSortRejection} is, and kept separate from it because the two
55
+ * refusals are different claims: that one says the PROVIDER can't express the key, this one says the provider
56
+ * can but this READ's shape can't — the same key against the same provider succeeds on a single scope.
57
+ */
58
+ export type UnmergeableIssueSort = {
59
+ /** The key the caller asked for, which a single-scope read of this provider would have honored. */
60
+ requested: IssueSorting;
61
+ };
62
+ /**
63
+ * What a read does with the order it resolved, once it also knows whether the page it is about to build MERGES
64
+ * several provider queries.
65
+ *
66
+ * Both facts are bound here, at the one point a read knows them, rather than consulted separately at the refusal
67
+ * and again at the sort. That is the difference this type buys: `merged` and the comparator were each tested twice
68
+ * per read, and the two tests are the same decision — whether the requested order survives this page's shape.
69
+ */
70
+ export type IssueOrdering = {
71
+ /** The key to send to the provider, or `undefined` to leave the provider's own order. */
72
+ readonly sort: IssueSorting | undefined;
73
+ /**
74
+ * Set when the requested key cannot be honored: this page merges several queries, and no normalized issue
75
+ * carries the field to merge on. The read refuses rather than serving concatenated per-scope runs, which would
76
+ * look ordered without being so. `undefined` for a single-query page, where the provider did the ordering.
77
+ *
78
+ * Carries the key rather than being a bare flag, for the same reason {@link UnsupportedIssueSortRejection}
79
+ * does: the refusal needs it, and re-reading `sort` at the call site needs an assertion for an invariant this
80
+ * type would otherwise not express.
81
+ */
82
+ readonly unmergeable: UnmergeableIssueSort | undefined;
83
+ /**
84
+ * Orders a merged page. A no-op for a single-query page (the provider already ordered it, and re-sorting could
85
+ * only reproduce that order while hiding a provider that ignored the key) and for a read with no key at all.
86
+ *
87
+ * Returns a new array rather than sorting in place: the input is often the provider's own `values`, and a read
88
+ * that mutates what it was handed is a surprise waiting for the next caller to share that reference.
89
+ */
90
+ order(items: IssueShape[]): IssueShape[];
91
+ };
92
+ /**
93
+ * Binds a resolved sort key to the shape of the page about to be built.
94
+ *
95
+ * `merged` is the caller's own count of provider queries reduced to the only thing that matters: GitHub sends one
96
+ * search however many repositories are named, GitLab one per repository, Azure and the trackers one per project,
97
+ * and every account-wide read is a union of several. Above one, the union is what gets published, and only a field
98
+ * an {@link IssueShape} carries can order it.
99
+ */
100
+ export declare function toIssueOrdering(sort: IssueSorting | undefined, merged: boolean): IssueOrdering;
101
+ //# sourceMappingURL=ordering.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ordering.d.ts","sourceRoot":"","sources":["../../../../src/plus/integrations/reads/ordering.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAI7E;;;;;;;GAOG;AAEH;;;;;;;;GAQG;AACH,MAAM,MAAM,6BAA6B,GAAG;IAC3C,MAAM,EAAE,kBAAkB,CAAC;IAC3B,kGAAkG;IAClG,SAAS,EAAE,YAAY,CAAC;IACxB,8GAA8G;IAC9G,SAAS,EAAE,YAAY,EAAE,GAAG,SAAS,CAAC;CACtC,CAAC;AAEF;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,gBAAgB,CAC/B,SAAS,EAAE,YAAY,EAAE,GAAG,SAAS,EACrC,IAAI,EAAE,YAAY,GAAG,SAAS,GAC5B;IAAE,SAAS,CAAC,EAAE,6BAA6B,CAAC;IAAC,IAAI,CAAC,EAAE,YAAY,CAAA;CAAE,CASpE;AAED;;;;;;;GAOG;AACH,MAAM,MAAM,oBAAoB,GAAG;IAClC,mGAAmG;IACnG,SAAS,EAAE,YAAY,CAAC;CACxB,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,MAAM,aAAa,GAAG;IAC3B,yFAAyF;IACzF,QAAQ,CAAC,IAAI,EAAE,YAAY,GAAG,SAAS,CAAC;IACxC;;;;;;;;OAQG;IACH,QAAQ,CAAC,WAAW,EAAE,oBAAoB,GAAG,SAAS,CAAC;IACvD;;;;;;OAMG;IACH,KAAK,CAAC,KAAK,EAAE,UAAU,EAAE,GAAG,UAAU,EAAE,CAAC;CACzC,CAAC;AAEF;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,YAAY,GAAG,SAAS,EAAE,MAAM,EAAE,OAAO,GAAG,aAAa,CAO9F"}