@gitkraken/core-gitlens 0.36.0 → 0.37.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -1
- package/dist/git/utils/branch.utils.d.ts +14 -0
- package/dist/git/utils/branch.utils.js +37 -1
- package/dist/git/utils/branch.utils.js.map +1 -1
- package/dist/git/utils/branchLanded.utils.d.ts +43 -0
- package/dist/git/utils/branchLanded.utils.js +56 -0
- package/dist/git/utils/branchLanded.utils.js.map +1 -0
- package/dist/plus/ai/models/model.js +58 -4
- package/dist/plus/ai/models/model.js.map +1 -1
- package/dist/plus/ai/providers/anthropicProvider.js +58 -223
- package/dist/plus/ai/providers/anthropicProvider.js.map +1 -1
- package/dist/plus/ai/providers/deepSeekProvider.js +32 -18
- package/dist/plus/ai/providers/deepSeekProvider.js.map +1 -1
- package/dist/plus/ai/providers/geminiProvider.js +25 -189
- package/dist/plus/ai/providers/geminiProvider.js.map +1 -1
- package/dist/plus/ai/providers/mistralProvider.js +31 -73
- package/dist/plus/ai/providers/mistralProvider.js.map +1 -1
- package/dist/plus/ai/providers/xaiProvider.js +9 -11
- package/dist/plus/ai/providers/xaiProvider.js.map +1 -1
- package/dist/plus/git-github/api/github.d.ts +14 -3
- package/dist/plus/git-github/api/github.js +47 -14
- package/dist/plus/git-github/api/github.js.map +1 -1
- package/dist/plus/integrations/integrationService.d.ts +2 -0
- package/dist/plus/integrations/integrationService.js.map +1 -1
- package/dist/plus/integrations/manager.d.ts +24 -5
- package/dist/plus/integrations/models/issuesIntegration.d.ts +2 -1
- package/dist/plus/integrations/models/issuesIntegration.js +6 -3
- package/dist/plus/integrations/models/issuesIntegration.js.map +1 -1
- package/dist/plus/integrations/providers/azureDevOps.d.ts +21 -6
- package/dist/plus/integrations/providers/azureDevOps.js +24 -12
- package/dist/plus/integrations/providers/azureDevOps.js.map +1 -1
- package/dist/plus/integrations/providers/azureDevOpsServer.d.ts +49 -3
- package/dist/plus/integrations/providers/azureDevOpsServer.js +151 -23
- package/dist/plus/integrations/providers/azureDevOpsServer.js.map +1 -1
- package/dist/plus/integrations/providers/linear.d.ts +3 -2
- package/dist/plus/integrations/providers/linear.js +7 -5
- package/dist/plus/integrations/providers/linear.js.map +1 -1
- package/dist/plus/integrations/reads/searchPullRequests.d.ts +2 -0
- package/dist/plus/integrations/reads/searchPullRequests.js +18 -9
- package/dist/plus/integrations/reads/searchPullRequests.js.map +1 -1
- package/docs/integrations.md +27 -6
- package/package.json +1 -1
|
@@ -88,14 +88,57 @@ export declare class AzureDevOpsServerIntegration extends AzureDevOpsIntegration
|
|
|
88
88
|
*/
|
|
89
89
|
private getCollectionNames;
|
|
90
90
|
invalidateDiscoveryCaches(): void;
|
|
91
|
+
/**
|
|
92
|
+
* The collection a token limited to one collection is limited to, per credential and installation, once the server
|
|
93
|
+
* level refused it and {@link findTokenCollection} found it (#6071). Kept with the account it was found with, and
|
|
94
|
+
* dropped with the other discovery caches.
|
|
95
|
+
*/
|
|
96
|
+
private readonly _tokenCollections;
|
|
97
|
+
/** The address of `collection`'s own routes, e.g. its connection data. */
|
|
98
|
+
private collectionAddress;
|
|
99
|
+
/**
|
|
100
|
+
* Finds the collection a token the server level refused is limited to, and the current user there.
|
|
101
|
+
*
|
|
102
|
+
* Azure DevOps Server can limit a personal access token to one collection (the token dialog's "Organization"
|
|
103
|
+
* choice). The server level refuses such a token with a `401`, and nothing there names its collection: the server's
|
|
104
|
+
* connection data, collection list and resource areas all refuse it too. So this tries, in order, the collection the
|
|
105
|
+
* read names, the ones this connection already discovered, those of the repositories open on this installation, and
|
|
106
|
+
* `DefaultCollection`, the installer's default; the first whose own connection data answers is the token's.
|
|
107
|
+
*
|
|
108
|
+
* A candidate that refuses the token or doesn't exist is skipped; any other failure is that failure, not a reason to
|
|
109
|
+
* try the next one. `undefined` when no candidate answers.
|
|
110
|
+
*/
|
|
111
|
+
private findTokenCollection;
|
|
112
|
+
/** See {@link findTokenCollection}: deduplicated in the order they are tried, compared as Azure compares names. */
|
|
113
|
+
private getTokenCollectionCandidates;
|
|
114
|
+
/**
|
|
115
|
+
* The current user on the server, or, when the server level refuses a token limited to one collection, in that
|
|
116
|
+
* collection (see {@link findTokenCollection}). The account is then the collection's identity, which is also the id
|
|
117
|
+
* the collection's creator and reviewer filters compare against (see {@link getFilterUserId}).
|
|
118
|
+
*/
|
|
119
|
+
private getCurrentUser;
|
|
120
|
+
/**
|
|
121
|
+
* The refusal a read reports when neither the server level nor any collection {@link findTokenCollection} tried
|
|
122
|
+
* accepts the token. It stays an authentication failure, so the connection is recovered exactly as before; only
|
|
123
|
+
* its wording names a collection-limited token as a possible cause, which "invalid or expired" alone hides.
|
|
124
|
+
*/
|
|
125
|
+
private toServerLevelRefusal;
|
|
91
126
|
/**
|
|
92
127
|
* Only the server level lists the collections: below one, Azure DevOps Server answers `projectCollections` with a
|
|
93
128
|
* 404 page. On that 404 an address that names a collection reads the collection's own connection data, whose
|
|
94
129
|
* `webApplicationRelativeDirectory` spells it, and reports it as the one collection visible there. When that read
|
|
95
130
|
* fails, the address is presumed to name a collection, which the failure carries (see {@link getCollectionNames}) for
|
|
96
131
|
* as long as the failed discovery is kept; connection data that answers for the server says it doesn't.
|
|
132
|
+
*
|
|
133
|
+
* A token limited to one collection sees only that collection, which the server level refuses to list (#6071): it
|
|
134
|
+
* is the collection {@link findTokenCollection} found, read there the same way.
|
|
97
135
|
*/
|
|
98
|
-
protected requestResourcesForUser(session: ProviderAuthenticationSession, userId: string): Promise<ProviderAzureResource[] | undefined>;
|
|
136
|
+
protected requestResourcesForUser(session: ProviderAuthenticationSession, userId: string, organization?: string): Promise<ProviderAzureResource[] | undefined>;
|
|
137
|
+
/**
|
|
138
|
+
* The collection the address names, read from its own connection data, once the server-level list answered with a
|
|
139
|
+
* 404 (see {@link requestResourcesForUser}); the 404 stands when that data answers for the server.
|
|
140
|
+
*/
|
|
141
|
+
private getCollectionAddressedBy;
|
|
99
142
|
/**
|
|
100
143
|
* The filtered work-item search snapshots matching ids with bounded WIQL queries, then reads details for each
|
|
101
144
|
* page's slice. See {@link resolveWorkItemSearchScope} for why a search never spans several collections.
|
|
@@ -193,7 +236,10 @@ export declare class AzureDevOpsServerIntegration extends AzureDevOpsIntegration
|
|
|
193
236
|
private resolvePullRequestSearchFacets;
|
|
194
237
|
/** Reads the collection's own connection data, at the installation's address. */
|
|
195
238
|
protected requestOrganizationUserId(session: ProviderAuthenticationSession, collection: string): Promise<string | undefined>;
|
|
196
|
-
/**
|
|
239
|
+
/**
|
|
240
|
+
* Every collection the account can see, or a refusal when discovery itself failed. `named` is the collection the
|
|
241
|
+
* search names, if any; see {@link getProviderResourcesForUser}.
|
|
242
|
+
*/
|
|
197
243
|
private getSearchCollections;
|
|
198
244
|
/**
|
|
199
245
|
* A collection's projects, refused when discovery was incomplete: a search bounded by an incomplete project set
|
|
@@ -215,7 +261,7 @@ export declare class AzureDevOpsServerIntegration extends AzureDevOpsIntegration
|
|
|
215
261
|
private assertSearchDates;
|
|
216
262
|
private searchUnavailable;
|
|
217
263
|
protected providerOnDisconnect(): void;
|
|
218
|
-
protected _requestForCurrentUser(session: ProviderAuthenticationSession): Promise<Account | undefined>;
|
|
264
|
+
protected _requestForCurrentUser(session: ProviderAuthenticationSession, organization?: string): Promise<Account | undefined>;
|
|
219
265
|
}
|
|
220
266
|
//#endregion
|
|
221
267
|
//# sourceMappingURL=azureDevOpsServer.d.ts.map
|
|
@@ -14,6 +14,7 @@ import { toTokenWithInfo } from "../authentication/models.js";
|
|
|
14
14
|
import { getAzureRepositoryIdentity } from "./azure/azure.utils.js";
|
|
15
15
|
import { discoveryCacheTtl } from "./utils/discoveryCache.js";
|
|
16
16
|
import { AzureDevOpsIntegrationBase, findAzureRepositoryApiBaseUrl, getAzureRepositoryApiBaseUrl, getAzureScopeVirtualDirectory, isAzureProjectlessCandidate, markMyGroupReviews, resolveAzureProjectlessRepository, sameAzureName, toAzureReviewerReads, uniqueAzureNames } from "./azureDevOps.js";
|
|
17
|
+
import * as l10n from "@vscode/l10n";
|
|
17
18
|
//#region ../plus/integrations/src/providers/azureDevOpsServer.ts
|
|
18
19
|
/**
|
|
19
20
|
* Whether `value` can stand as one route segment. Encoding keeps `.` and `..` as they are, and a URL resolves them
|
|
@@ -23,6 +24,13 @@ function isAzureRouteSegment(value) {
|
|
|
23
24
|
return value.length > 0 && value !== "." && value !== "..";
|
|
24
25
|
}
|
|
25
26
|
/**
|
|
27
|
+
* A request the credential was refused with a `401`: how Azure DevOps Server answers a server-level read with a token
|
|
28
|
+
* limited to one collection (#6071). A `403` (a missing permission) or any other failure is not one.
|
|
29
|
+
*/
|
|
30
|
+
function isServerLevelRefusal(ex) {
|
|
31
|
+
return ex instanceof AuthenticationError && ex.reason === 2;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
26
34
|
* Runs one scope of a count probe, answering a refusal of THAT scope (see `searchUnavailable`) as the error itself,
|
|
27
35
|
* which the facade reports and drops without failing the scopes around it. Anything else — a rejected credential,
|
|
28
36
|
* a failed request — still rejects, so the batch reports it.
|
|
@@ -261,6 +269,101 @@ var AzureDevOpsServerIntegration = class extends AzureDevOpsIntegrationBase {
|
|
|
261
269
|
invalidateDiscoveryCaches() {
|
|
262
270
|
super.invalidateDiscoveryCaches();
|
|
263
271
|
this._collectionNames.clear();
|
|
272
|
+
this._tokenCollections.clear();
|
|
273
|
+
}
|
|
274
|
+
/**
|
|
275
|
+
* The collection a token limited to one collection is limited to, per credential and installation, once the server
|
|
276
|
+
* level refused it and {@link findTokenCollection} found it (#6071). Kept with the account it was found with, and
|
|
277
|
+
* dropped with the other discovery caches.
|
|
278
|
+
*/
|
|
279
|
+
_tokenCollections = /* @__PURE__ */ new Map();
|
|
280
|
+
/** The address of `collection`'s own routes, e.g. its connection data. */
|
|
281
|
+
collectionAddress(session, collection) {
|
|
282
|
+
return `${this.collectionApiBaseUrl(session, collection)}/${encodeURIComponent(collection)}`;
|
|
283
|
+
}
|
|
284
|
+
/**
|
|
285
|
+
* Finds the collection a token the server level refused is limited to, and the current user there.
|
|
286
|
+
*
|
|
287
|
+
* Azure DevOps Server can limit a personal access token to one collection (the token dialog's "Organization"
|
|
288
|
+
* choice). The server level refuses such a token with a `401`, and nothing there names its collection: the server's
|
|
289
|
+
* connection data, collection list and resource areas all refuse it too. So this tries, in order, the collection the
|
|
290
|
+
* read names, the ones this connection already discovered, those of the repositories open on this installation, and
|
|
291
|
+
* `DefaultCollection`, the installer's default; the first whose own connection data answers is the token's.
|
|
292
|
+
*
|
|
293
|
+
* A candidate that refuses the token or doesn't exist is skipped; any other failure is that failure, not a reason to
|
|
294
|
+
* try the next one. `undefined` when no candidate answers.
|
|
295
|
+
*/
|
|
296
|
+
async findTokenCollection(session, candidates) {
|
|
297
|
+
const azure = await this.authenticationService.apis.azure;
|
|
298
|
+
if (azure == null) return void 0;
|
|
299
|
+
const token = toTokenWithInfo(this.id, session);
|
|
300
|
+
for (const collection of candidates) try {
|
|
301
|
+
const user = await azure.getCurrentUserOnServer(this, token, this.collectionAddress(session, collection));
|
|
302
|
+
if (user != null) {
|
|
303
|
+
this._tokenCollections.set(this.discoveryKey(session), collection);
|
|
304
|
+
return user;
|
|
305
|
+
}
|
|
306
|
+
} catch (ex) {
|
|
307
|
+
if (!(ex instanceof AuthenticationError) && !(ex instanceof RequestNotFoundError)) throw ex;
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
/** See {@link findTokenCollection}: deduplicated in the order they are tried, compared as Azure compares names. */
|
|
311
|
+
async getTokenCollectionCandidates(session, organization) {
|
|
312
|
+
const known = this._organizations?.get(this.discoveryKey(session))?.map((o) => o.name) ?? [];
|
|
313
|
+
const remotes = await this.ctx.repositories.getOpenRemotes();
|
|
314
|
+
const owners = await Promise.all(remotes.map(async (r) => await this.authenticationService.getByRemote(r) === this ? r.provider?.owner : void 0));
|
|
315
|
+
const baseUrl = this.apiBaseUrlFor(session);
|
|
316
|
+
const shortFormCollections = uniqueAzureNames(remotes.flatMap((r, i) => {
|
|
317
|
+
const owner = owners[i];
|
|
318
|
+
if (owner == null || getAzureScopeVirtualDirectory(baseUrl, owner) == null) return [];
|
|
319
|
+
const { projectName } = getAzureRepositoryIdentity({
|
|
320
|
+
owner,
|
|
321
|
+
name: r.provider?.repoName ?? ""
|
|
322
|
+
});
|
|
323
|
+
return projectName != null ? [projectName] : [];
|
|
324
|
+
}));
|
|
325
|
+
return {
|
|
326
|
+
candidates: uniqueAzureNames([
|
|
327
|
+
organization,
|
|
328
|
+
...known,
|
|
329
|
+
...owners,
|
|
330
|
+
...shortFormCollections,
|
|
331
|
+
"DefaultCollection"
|
|
332
|
+
].filter((c) => Boolean(c))),
|
|
333
|
+
shortFormCollections
|
|
334
|
+
};
|
|
335
|
+
}
|
|
336
|
+
/**
|
|
337
|
+
* The current user on the server, or, when the server level refuses a token limited to one collection, in that
|
|
338
|
+
* collection (see {@link findTokenCollection}). The account is then the collection's identity, which is also the id
|
|
339
|
+
* the collection's creator and reviewer filters compare against (see {@link getFilterUserId}).
|
|
340
|
+
*/
|
|
341
|
+
async getCurrentUser(session, organization) {
|
|
342
|
+
const azure = await this.authenticationService.apis.azure;
|
|
343
|
+
if (azure == null) return void 0;
|
|
344
|
+
const token = toTokenWithInfo(this.id, session);
|
|
345
|
+
const known = this._tokenCollections.get(this.discoveryKey(session));
|
|
346
|
+
if (known != null) return azure.getCurrentUserOnServer(this, token, this.collectionAddress(session, known));
|
|
347
|
+
try {
|
|
348
|
+
return await azure.getCurrentUserOnServer(this, token, this.apiBaseUrlFor(session));
|
|
349
|
+
} catch (ex) {
|
|
350
|
+
if (!isServerLevelRefusal(ex)) throw ex;
|
|
351
|
+
const refused = this.apiBaseUrlFor(session).toLowerCase();
|
|
352
|
+
const { candidates, shortFormCollections } = await this.getTokenCollectionCandidates(session, organization);
|
|
353
|
+
const alreadyAddressesCandidate = candidates.some((c) => this.collectionAddress(session, c).toLowerCase() === refused);
|
|
354
|
+
const user = await this.findTokenCollection(session, alreadyAddressesCandidate ? shortFormCollections : candidates);
|
|
355
|
+
if (user != null) return user;
|
|
356
|
+
throw alreadyAddressesCandidate ? ex : this.toServerLevelRefusal(session, ex);
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
/**
|
|
360
|
+
* The refusal a read reports when neither the server level nor any collection {@link findTokenCollection} tried
|
|
361
|
+
* accepts the token. It stays an authentication failure, so the connection is recovered exactly as before; only
|
|
362
|
+
* its wording names a collection-limited token as a possible cause, which "invalid or expired" alone hides.
|
|
363
|
+
*/
|
|
364
|
+
toServerLevelRefusal(session, ex) {
|
|
365
|
+
const { accessToken: _accessToken, ...tokenInfo } = toTokenWithInfo(this.id, session);
|
|
366
|
+
return new AuthenticationError(tokenInfo, l10n.t("Your '{0}' credentials were refused: the token is invalid or expired, or it is limited to a collection that couldn't be found. Use a token for all accessible organizations, or open a repository from the token's collection.", this.id), ex);
|
|
264
367
|
}
|
|
265
368
|
/**
|
|
266
369
|
* Only the server level lists the collections: below one, Azure DevOps Server answers `projectCollections` with a
|
|
@@ -268,23 +371,44 @@ var AzureDevOpsServerIntegration = class extends AzureDevOpsIntegrationBase {
|
|
|
268
371
|
* `webApplicationRelativeDirectory` spells it, and reports it as the one collection visible there. When that read
|
|
269
372
|
* fails, the address is presumed to name a collection, which the failure carries (see {@link getCollectionNames}) for
|
|
270
373
|
* as long as the failed discovery is kept; connection data that answers for the server says it doesn't.
|
|
374
|
+
*
|
|
375
|
+
* A token limited to one collection sees only that collection, which the server level refuses to list (#6071): it
|
|
376
|
+
* is the collection {@link findTokenCollection} found, read there the same way.
|
|
271
377
|
*/
|
|
272
|
-
async requestResourcesForUser(session, userId) {
|
|
273
|
-
|
|
274
|
-
|
|
378
|
+
async requestResourcesForUser(session, userId, organization) {
|
|
379
|
+
let collection = this._tokenCollections.get(this.discoveryKey(session));
|
|
380
|
+
if (collection == null) try {
|
|
381
|
+
return await super.requestResourcesForUser(session, userId, organization);
|
|
275
382
|
} catch (ex) {
|
|
276
|
-
if (
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
throw collectionError;
|
|
383
|
+
if (isServerLevelRefusal(ex)) {
|
|
384
|
+
await this.getCurrentUser(session, organization);
|
|
385
|
+
collection = this._tokenCollections.get(this.discoveryKey(session));
|
|
386
|
+
if (collection == null) throw ex;
|
|
387
|
+
} else {
|
|
388
|
+
if (!(ex instanceof RequestNotFoundError)) throw ex;
|
|
389
|
+
return [await this.getCollectionAddressedBy(session, ex)];
|
|
284
390
|
}
|
|
285
|
-
if (addressed == null) throw ex;
|
|
286
|
-
return [addressed];
|
|
287
391
|
}
|
|
392
|
+
return [await (await this.authenticationService.apis.azure)?.getAddressedCollection(this, toTokenWithInfo(this.id, session), this.collectionAddress(session, collection)) ?? {
|
|
393
|
+
id: collection,
|
|
394
|
+
name: collection
|
|
395
|
+
}];
|
|
396
|
+
}
|
|
397
|
+
/**
|
|
398
|
+
* The collection the address names, read from its own connection data, once the server-level list answered with a
|
|
399
|
+
* 404 (see {@link requestResourcesForUser}); the 404 stands when that data answers for the server.
|
|
400
|
+
*/
|
|
401
|
+
async getCollectionAddressedBy(session, notFound) {
|
|
402
|
+
const azure = await this.authenticationService.apis.azure;
|
|
403
|
+
let addressed;
|
|
404
|
+
try {
|
|
405
|
+
addressed = await azure?.getAddressedCollection(this, toTokenWithInfo(this.id, session), this.apiBaseUrlFor(session));
|
|
406
|
+
} catch (collectionError) {
|
|
407
|
+
if (typeof collectionError === "object" && collectionError != null) this._collectionListRefusals.add(collectionError);
|
|
408
|
+
throw collectionError;
|
|
409
|
+
}
|
|
410
|
+
if (addressed == null) throw notFound;
|
|
411
|
+
return addressed;
|
|
288
412
|
}
|
|
289
413
|
/**
|
|
290
414
|
* The filtered work-item search snapshots matching ids with bounded WIQL queries, then reads details for each
|
|
@@ -346,7 +470,7 @@ var AzureDevOpsServerIntegration = class extends AzureDevOpsIntegrationBase {
|
|
|
346
470
|
const repoCollections = uniqueAzureNames(repos?.map((r) => r.namespace) ?? []);
|
|
347
471
|
if (repoCollections.length > 1) throw this.searchUnavailable("the repositories span several collections; search each collection separately");
|
|
348
472
|
if (org && repoCollections.length === 1 && !sameAzureName(org, repoCollections[0])) throw this.searchUnavailable(`the repositories are not in the '${org}' collection`);
|
|
349
|
-
const collections = await this.getSearchCollections(session);
|
|
473
|
+
const collections = await this.getSearchCollections(session, org || repoCollections[0]);
|
|
350
474
|
const name = org || repoCollections[0] || (collections.length === 1 ? collections[0].name : void 0);
|
|
351
475
|
if (name == null) throw this.searchUnavailable(`the account can see ${collections.length} collections; pass \`org\` to choose the one to search`);
|
|
352
476
|
const collection = findAzureCollection(collections, name);
|
|
@@ -401,7 +525,8 @@ var AzureDevOpsServerIntegration = class extends AzureDevOpsIntegrationBase {
|
|
|
401
525
|
const last = slice.at(-1);
|
|
402
526
|
const hasMore = last != null && start + slice.length < drain.rows.length;
|
|
403
527
|
const viewerFor = this.getOrganizationViewers(session);
|
|
404
|
-
const
|
|
528
|
+
const lookups = Promise.all(slice.map((r) => r.currentAccount == null && pullRequestNamesPeople(r.pr) ? viewerFor(r.collection) : Promise.resolve(r.currentAccount)));
|
|
529
|
+
const viewers = await (cancellation != null ? raceWithSignal(lookups, cancellation) : lookups);
|
|
405
530
|
return {
|
|
406
531
|
values: slice.map((r, i) => fromProviderPullRequest(r.pr, this, {
|
|
407
532
|
project: r.project,
|
|
@@ -596,7 +721,7 @@ var AzureDevOpsServerIntegration = class extends AzureDevOpsIntegrationBase {
|
|
|
596
721
|
* user reads every project the account can see, the same breadth as the account-wide pull request read.
|
|
597
722
|
*/
|
|
598
723
|
async resolvePullRequestSearchFacets(session, repos, org) {
|
|
599
|
-
const collections = await this.getSearchCollections(session);
|
|
724
|
+
const collections = await this.getSearchCollections(session, org || repos?.[0]?.namespace);
|
|
600
725
|
const collectionFor = (name) => {
|
|
601
726
|
const collection = findAzureCollection(collections, name);
|
|
602
727
|
if (collection == null) throw this.searchUnavailable(`the '${name}' collection is not visible`);
|
|
@@ -639,11 +764,14 @@ var AzureDevOpsServerIntegration = class extends AzureDevOpsIntegrationBase {
|
|
|
639
764
|
}
|
|
640
765
|
/** Reads the collection's own connection data, at the installation's address. */
|
|
641
766
|
async requestOrganizationUserId(session, collection) {
|
|
642
|
-
return (await (await this.authenticationService.apis.azure)?.getCurrentUserOnServer(this, toTokenWithInfo(this.id, session),
|
|
767
|
+
return (await (await this.authenticationService.apis.azure)?.getCurrentUserOnServer(this, toTokenWithInfo(this.id, session), this.collectionAddress(session, collection)))?.id;
|
|
643
768
|
}
|
|
644
|
-
/**
|
|
645
|
-
|
|
646
|
-
|
|
769
|
+
/**
|
|
770
|
+
* Every collection the account can see, or a refusal when discovery itself failed. `named` is the collection the
|
|
771
|
+
* search names, if any; see {@link getProviderResourcesForUser}.
|
|
772
|
+
*/
|
|
773
|
+
async getSearchCollections(session, named) {
|
|
774
|
+
const collections = await this.getProviderResourcesForUser(session, false, named);
|
|
647
775
|
if (collections == null) throw this.searchUnavailable("the account’s collections could not be read");
|
|
648
776
|
return collections;
|
|
649
777
|
}
|
|
@@ -690,10 +818,10 @@ var AzureDevOpsServerIntegration = class extends AzureDevOpsIntegrationBase {
|
|
|
690
818
|
this._pullRequestSearches.clear();
|
|
691
819
|
this._latestPullRequestSearches.clear();
|
|
692
820
|
this._collectionNames.clear();
|
|
821
|
+
this._tokenCollections.clear();
|
|
693
822
|
}
|
|
694
|
-
async _requestForCurrentUser(session) {
|
|
695
|
-
const
|
|
696
|
-
const user = azure ? await azure.getCurrentUserOnServer(this, toTokenWithInfo(this.id, session), this.apiBaseUrlFor(session)) : void 0;
|
|
823
|
+
async _requestForCurrentUser(session, organization) {
|
|
824
|
+
const user = await this.getCurrentUser(session, organization);
|
|
697
825
|
return user ? {
|
|
698
826
|
provider: this,
|
|
699
827
|
id: user.id,
|