@gitkraken/core-gitlens 0.5.112 → 0.5.113
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +3 -3
- package/dist/plus/git-github/api/github.d.ts +6 -0
- package/dist/plus/git-github/api/github.d.ts.map +1 -1
- package/dist/plus/git-github/api/github.js +15 -4
- package/dist/plus/git-github/api/github.js.map +1 -1
- package/dist/plus/integrations/integrationService.d.ts +4 -0
- package/dist/plus/integrations/integrationService.d.ts.map +1 -1
- package/dist/plus/integrations/integrationService.js.map +1 -1
- package/dist/plus/integrations/manager.d.ts +17 -0
- package/dist/plus/integrations/manager.d.ts.map +1 -1
- package/dist/plus/integrations/models/gitHostIntegration.d.ts +18 -17
- package/dist/plus/integrations/models/gitHostIntegration.d.ts.map +1 -1
- package/dist/plus/integrations/models/gitHostIntegration.js +9 -0
- package/dist/plus/integrations/models/gitHostIntegration.js.map +1 -1
- package/dist/plus/integrations/providers/github.d.ts +1 -0
- package/dist/plus/integrations/providers/github.d.ts.map +1 -1
- package/dist/plus/integrations/providers/github.js +1 -0
- package/dist/plus/integrations/providers/github.js.map +1 -1
- package/dist/plus/integrations/providers/models.d.ts +2 -1
- package/dist/plus/integrations/providers/models.d.ts.map +1 -1
- package/dist/plus/integrations/providers/models.js.map +1 -1
- package/dist/plus/integrations/reads/pullRequests.d.ts +6 -0
- package/dist/plus/integrations/reads/pullRequests.d.ts.map +1 -1
- package/dist/plus/integrations/reads/pullRequests.js +28 -40
- package/dist/plus/integrations/reads/pullRequests.js.map +1 -1
- package/dist/plus/integrations/reads/searchPullRequests.d.ts +2 -0
- package/dist/plus/integrations/reads/searchPullRequests.d.ts.map +1 -1
- package/dist/plus/integrations/reads/searchPullRequests.js +1 -0
- package/dist/plus/integrations/reads/searchPullRequests.js.map +1 -1
- package/package.json +2 -2
- package/src/plus/git-github/api/github.ts +28 -7
- package/src/plus/integrations/integrationService.ts +4 -0
- package/src/plus/integrations/manager.ts +17 -0
- package/src/plus/integrations/models/gitHostIntegration.ts +29 -18
- package/src/plus/integrations/providers/github.ts +2 -0
- package/src/plus/integrations/providers/models.ts +6 -0
- package/src/plus/integrations/reads/pullRequests.ts +51 -70
- package/src/plus/integrations/reads/searchPullRequests.ts +3 -0
|
@@ -48,6 +48,12 @@ export async function listPullRequestsPage(
|
|
|
48
48
|
includeReviewRequested?: boolean;
|
|
49
49
|
page?: number;
|
|
50
50
|
cursor?: string;
|
|
51
|
+
/**
|
|
52
|
+
* Requests the lightweight row shape (see {@link IntegrationManager.listPullRequestsPage}). Opt-in
|
|
53
|
+
* only, and only on the repo-scoped branch: the account-wide branch has always read the lightweight
|
|
54
|
+
* shape and keeps doing so, so an explicit `false` does not widen it back to the full projection.
|
|
55
|
+
*/
|
|
56
|
+
summary?: boolean;
|
|
51
57
|
itemsPerPage?: number;
|
|
52
58
|
forceSync?: boolean;
|
|
53
59
|
connectionId?: string;
|
|
@@ -115,45 +121,49 @@ export async function listPullRequestsPage(
|
|
|
115
121
|
);
|
|
116
122
|
}
|
|
117
123
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
124
|
+
// Everything but the cursor, shared by the initial read and the drain's re-reads below so the two cannot
|
|
125
|
+
// drift. `summary` is the reason this matters beyond tidiness: a re-read that dropped it would both
|
|
126
|
+
// revert to the full payload — on the very path that issues the most requests — and return rows of a
|
|
127
|
+
// different shape than the first page, since a summary row reports `headCommit`/`commitCount` as absent.
|
|
128
|
+
// `summary` is pinned true here rather than forwarded: this branch has never had a full projection to
|
|
129
|
+
// fall back to (see the option's doc), so honoring an explicit `false` would promise a widening the read
|
|
130
|
+
// cannot deliver.
|
|
131
|
+
const accountWideInput = {
|
|
132
|
+
state: options.states,
|
|
133
|
+
includeReviewRequested: options.includeReviewRequested ?? false,
|
|
134
|
+
filters: resolvedFilters.filters,
|
|
135
|
+
summary: true,
|
|
136
|
+
};
|
|
137
|
+
// `filters` scopes the read to the current user (the core resolves the account for these), so it returns
|
|
138
|
+
// the user's PRs. `pageSize` rides along so PagingMode.Repo hosts (GitLab, Bitbucket, Azure), whose
|
|
139
|
+
// per-repo cursor path ignores a synthesized page-number cursor, honor the requested size.
|
|
140
|
+
const scopedInput = {
|
|
141
|
+
state: options.states,
|
|
142
|
+
filters: resolvedFilters.filters,
|
|
143
|
+
pageSize: options.itemsPerPage,
|
|
144
|
+
summary: options.summary,
|
|
145
|
+
};
|
|
146
|
+
const readPage = (pageCursor: string | undefined, requestedPage?: number) =>
|
|
147
|
+
runCaptured(
|
|
148
|
+
options.providerId,
|
|
149
|
+
domain,
|
|
150
|
+
options.connectionId,
|
|
151
|
+
() =>
|
|
152
|
+
accountWide
|
|
153
|
+
? integration.getMyPullRequestsForUserResult(
|
|
154
|
+
{ ...accountWideInput, cursor: pageCursor },
|
|
155
|
+
options.connectionId,
|
|
156
|
+
)
|
|
157
|
+
: integration.getMyPullRequestsForReposResult(
|
|
158
|
+
options.repos ?? [],
|
|
159
|
+
{ ...scopedInput, cursor: pageCursor, page: requestedPage },
|
|
160
|
+
options.connectionId,
|
|
161
|
+
),
|
|
162
|
+
{
|
|
163
|
+
warnOnMissingSession: warnOnMissingSessionForDomain(options.providerId, options.domain),
|
|
164
|
+
},
|
|
165
|
+
);
|
|
166
|
+
const { value, warning } = await readPage(cursor, options.page != null ? page : undefined);
|
|
157
167
|
|
|
158
168
|
let items = value?.values ?? [];
|
|
159
169
|
// Cursor-only account-wide reads start at page 1; a page-only request is advanced through opaque
|
|
@@ -180,37 +190,8 @@ export async function listPullRequestsPage(
|
|
|
180
190
|
requestedPage: page,
|
|
181
191
|
itemsPerPage: options.itemsPerPage,
|
|
182
192
|
warnings: warnings,
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
options.providerId,
|
|
186
|
-
domain,
|
|
187
|
-
options.connectionId,
|
|
188
|
-
() =>
|
|
189
|
-
accountWide
|
|
190
|
-
? integration.getMyPullRequestsForUserResult(
|
|
191
|
-
{
|
|
192
|
-
state: options.states,
|
|
193
|
-
cursor: cursor,
|
|
194
|
-
includeReviewRequested: includeReviewRequested,
|
|
195
|
-
filters: resolvedFilters.filters,
|
|
196
|
-
summary: true,
|
|
197
|
-
},
|
|
198
|
-
options.connectionId,
|
|
199
|
-
)
|
|
200
|
-
: integration.getMyPullRequestsForReposResult(
|
|
201
|
-
options.repos ?? [],
|
|
202
|
-
{
|
|
203
|
-
state: options.states,
|
|
204
|
-
filters: resolvedFilters.filters,
|
|
205
|
-
cursor: cursor,
|
|
206
|
-
pageSize: options.itemsPerPage,
|
|
207
|
-
},
|
|
208
|
-
options.connectionId,
|
|
209
|
-
),
|
|
210
|
-
{
|
|
211
|
-
warnOnMissingSession: warnOnMissingSessionForDomain(options.providerId, options.domain),
|
|
212
|
-
},
|
|
213
|
-
),
|
|
193
|
+
// A drain advances through provider continuations, so only the cursor positions these reads.
|
|
194
|
+
readPage: (cursor: string) => readPage(cursor),
|
|
214
195
|
},
|
|
215
196
|
);
|
|
216
197
|
items = drained.items;
|
|
@@ -48,6 +48,8 @@ export async function searchPullRequestsPage(
|
|
|
48
48
|
forceSync?: boolean;
|
|
49
49
|
connectionId?: string;
|
|
50
50
|
domain?: string;
|
|
51
|
+
/** See {@link IntegrationManager.searchPullRequestsPage}. */
|
|
52
|
+
summary?: boolean;
|
|
51
53
|
},
|
|
52
54
|
): Promise<ProviderPagedResult<PullRequestShape>> {
|
|
53
55
|
const page = Math.max(1, Math.trunc(options.page ?? 1));
|
|
@@ -142,6 +144,7 @@ export async function searchPullRequestsPage(
|
|
|
142
144
|
criteria: options.criteria,
|
|
143
145
|
cursor: cursor,
|
|
144
146
|
pageSize: options.itemsPerPage,
|
|
147
|
+
summary: options.summary,
|
|
145
148
|
},
|
|
146
149
|
undefined,
|
|
147
150
|
options.connectionId,
|