@gitkraken/core-gitlens 0.12.0 → 0.13.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 +57 -1
- package/dist/git/cache.d.ts +84 -29
- package/dist/git/cache.js +188 -54
- package/dist/git/cache.js.map +1 -1
- package/dist/git/features.d.ts +1 -1
- package/dist/git/features.js +4 -0
- package/dist/git/features.js.map +1 -1
- package/dist/git/models/branch.d.ts +15 -2
- package/dist/git/models/branch.js +27 -5
- package/dist/git/models/branch.js.map +1 -1
- package/dist/git/models/status.js +1 -1
- package/dist/git/models/worktree.d.ts +4 -1
- package/dist/git/models/worktree.js +4 -2
- package/dist/git/models/worktree.js.map +1 -1
- package/dist/git/providers/branches.d.ts +73 -8
- package/dist/git/providers/pausedOperations.d.ts +6 -0
- package/dist/git/providers/provider.d.ts +34 -2
- package/dist/git/providers/status.d.ts +8 -2
- package/dist/git/remotes/azure-devops.js +61 -53
- package/dist/git/remotes/azure-devops.js.map +1 -1
- package/dist/git/service.d.ts +8 -5
- package/dist/git/service.js +16 -8
- package/dist/git/service.js.map +1 -1
- package/dist/git/utils/branch.utils.d.ts +8 -1
- package/dist/git/utils/branch.utils.js +30 -1
- package/dist/git/utils/branch.utils.js.map +1 -1
- package/dist/git/watching/changeEvent.d.ts +13 -2
- package/dist/git/watching/changeEvent.js +17 -3
- package/dist/git/watching/changeEvent.js.map +1 -1
- package/dist/git/watching/gitDirPoller.d.ts +111 -0
- package/dist/git/watching/gitDirPoller.js +266 -0
- package/dist/git/watching/gitDirPoller.js.map +1 -0
- package/dist/git/watching/provider.d.ts +16 -0
- package/dist/git/watching/watchGroup.d.ts +40 -4
- package/dist/git/watching/watchGroup.js +143 -17
- package/dist/git/watching/watchGroup.js.map +1 -1
- package/dist/git/watching/watchService.d.ts +70 -1
- package/dist/git/watching/watchService.js +158 -13
- package/dist/git/watching/watchService.js.map +1 -1
- package/dist/git/watching/watchSession.d.ts +44 -0
- package/dist/git/watching/watchSession.js +91 -6
- package/dist/git/watching/watchSession.js.map +1 -1
- package/dist/git/watching/watcherPatterns.d.ts +21 -0
- package/dist/git/watching/watcherPatterns.js +67 -1
- package/dist/git/watching/watcherPatterns.js.map +1 -1
- package/dist/git/watching/worktreeSummary.d.ts +34 -7
- package/dist/git/watching/worktreeSummary.js +39 -12
- package/dist/git/watching/worktreeSummary.js.map +1 -1
- package/dist/git-cli/cliGitProvider.d.ts +34 -2
- package/dist/git-cli/cliGitProvider.js +119 -17
- package/dist/git-cli/cliGitProvider.js.map +1 -1
- package/dist/git-cli/exec/commandClassifier.d.ts +15 -0
- package/dist/git-cli/exec/commandClassifier.js +48 -2
- package/dist/git-cli/exec/commandClassifier.js.map +1 -1
- package/dist/git-cli/exec/git.d.ts +15 -3
- package/dist/git-cli/exec/git.js +38 -17
- package/dist/git-cli/exec/git.js.map +1 -1
- package/dist/git-cli/exec/gitQueue.d.ts +2 -0
- package/dist/git-cli/exec/gitQueue.js +2 -1
- package/dist/git-cli/exec/gitQueue.js.map +1 -1
- package/dist/git-cli/exec/indexLock.d.ts +38 -0
- package/dist/git-cli/exec/indexLock.js +150 -0
- package/dist/git-cli/exec/indexLock.js.map +1 -0
- package/dist/git-cli/parsers/worktreeParser.js +42 -2
- package/dist/git-cli/parsers/worktreeParser.js.map +1 -1
- package/dist/git-cli/providers/branches.d.ts +109 -10
- package/dist/git-cli/providers/branches.js +624 -131
- package/dist/git-cli/providers/branches.js.map +1 -1
- package/dist/git-cli/providers/config.d.ts +9 -5
- package/dist/git-cli/providers/config.js +60 -27
- package/dist/git-cli/providers/config.js.map +1 -1
- package/dist/git-cli/providers/operations.d.ts +17 -0
- package/dist/git-cli/providers/operations.js +153 -96
- package/dist/git-cli/providers/operations.js.map +1 -1
- package/dist/git-cli/providers/pausedOperations.d.ts +8 -0
- package/dist/git-cli/providers/pausedOperations.js +60 -40
- package/dist/git-cli/providers/pausedOperations.js.map +1 -1
- package/dist/git-cli/providers/refs.js +11 -8
- package/dist/git-cli/providers/refs.js.map +1 -1
- package/dist/git-cli/providers/remotes.js +19 -10
- package/dist/git-cli/providers/remotes.js.map +1 -1
- package/dist/git-cli/providers/staging.js +40 -15
- package/dist/git-cli/providers/staging.js.map +1 -1
- package/dist/git-cli/providers/stash.d.ts +2 -0
- package/dist/git-cli/providers/stash.js +33 -18
- package/dist/git-cli/providers/stash.js.map +1 -1
- package/dist/git-cli/providers/status.d.ts +3 -1
- package/dist/git-cli/providers/status.js +38 -20
- package/dist/git-cli/providers/status.js.map +1 -1
- package/dist/git-cli/providers/tags.js +6 -4
- package/dist/git-cli/providers/tags.js.map +1 -1
- package/dist/git-cli/providers/worktrees.d.ts +1 -0
- package/dist/git-cli/providers/worktrees.js +60 -31
- package/dist/git-cli/providers/worktrees.js.map +1 -1
- package/dist/git-cli/service.d.ts +6 -0
- package/dist/git-cli/service.js +5 -2
- package/dist/git-cli/service.js.map +1 -1
- package/dist/ipc/discovery.js +1 -1
- package/dist/plus/agents/providers/claudeCodeTranscript.js +6 -6
- package/dist/plus/agents/providers/claudeCodeTranscript.js.map +1 -1
- package/dist/plus/ai/providers/openAICompatibleProviderBase.js +1 -1
- package/dist/plus/git-github/providers/github/status.d.ts +3 -1
- package/dist/plus/git-github/providers/github/status.js +1 -1
- package/dist/plus/git-github/providers/github/status.js.map +1 -1
- package/dist/plus/integrations/collectionMetadata.d.ts +13 -2
- package/dist/plus/integrations/collectionMetadata.js +14 -2
- package/dist/plus/integrations/collectionMetadata.js.map +1 -1
- package/dist/plus/integrations/index.d.ts +2 -2
- package/dist/plus/integrations/index.js.map +1 -1
- package/dist/plus/integrations/integrationService.d.ts +1 -0
- package/dist/plus/integrations/integrationService.js +1 -1
- package/dist/plus/integrations/integrationService.js.map +1 -1
- package/dist/plus/integrations/manager.d.ts +1 -0
- package/dist/plus/integrations/models/gitHostIntegration.d.ts +41 -5
- package/dist/plus/integrations/models/gitHostIntegration.js +106 -29
- package/dist/plus/integrations/models/gitHostIntegration.js.map +1 -1
- package/dist/plus/integrations/models/issueReads.d.ts +17 -4
- package/dist/plus/integrations/providers/apiClients.d.ts +2 -0
- package/dist/plus/integrations/providers/apiClients.js +7 -1
- package/dist/plus/integrations/providers/apiClients.js.map +1 -1
- package/dist/plus/integrations/providers/azure/azure.d.ts +5 -4
- package/dist/plus/integrations/providers/azure/azure.js +37 -77
- package/dist/plus/integrations/providers/azure/azure.js.map +1 -1
- package/dist/plus/integrations/providers/azure/azure.utils.js +20 -17
- package/dist/plus/integrations/providers/azure/azure.utils.js.map +1 -1
- package/dist/plus/integrations/providers/azure/models.d.ts +2 -2
- package/dist/plus/integrations/providers/azure/models.js +4 -4
- package/dist/plus/integrations/providers/azure/models.js.map +1 -1
- package/dist/plus/integrations/providers/azure/workItemStateCategories.d.ts +18 -14
- package/dist/plus/integrations/providers/azure/workItemStateCategories.js +69 -17
- package/dist/plus/integrations/providers/azure/workItemStateCategories.js.map +1 -1
- package/dist/plus/integrations/providers/azureDevOps.d.ts +44 -0
- package/dist/plus/integrations/providers/azureDevOps.js +108 -17
- package/dist/plus/integrations/providers/azureDevOps.js.map +1 -1
- package/dist/plus/integrations/providers/azureDevOpsServer.d.ts +45 -1
- package/dist/plus/integrations/providers/azureDevOpsServer.js +121 -6
- package/dist/plus/integrations/providers/azureDevOpsServer.js.map +1 -1
- package/dist/plus/integrations/providers/jira-server.js +18 -14
- package/dist/plus/integrations/providers/jira-server.js.map +1 -1
- package/dist/plus/integrations/providers/jira.js +18 -14
- package/dist/plus/integrations/providers/jira.js.map +1 -1
- package/dist/plus/integrations/providers/models.d.ts +1 -2
- package/dist/plus/integrations/providers/models.js +9 -2
- package/dist/plus/integrations/providers/models.js.map +1 -1
- package/dist/plus/integrations/providers/providersApi.d.ts +7 -17
- package/dist/plus/integrations/providers/providersApi.js +85 -78
- package/dist/plus/integrations/providers/providersApi.js.map +1 -1
- package/dist/plus/integrations/providers/utils/jiraIssueDrains.d.ts +22 -0
- package/dist/plus/integrations/providers/utils/jiraIssueDrains.js +69 -9
- package/dist/plus/integrations/providers/utils/jiraIssueDrains.js.map +1 -1
- package/dist/plus/integrations/providers/utils/providerPaging.js +8 -2
- package/dist/plus/integrations/providers/utils/providerPaging.js.map +1 -1
- package/dist/plus/integrations/reads/filters.d.ts +3 -3
- package/dist/plus/integrations/reads/filters.js.map +1 -1
- package/dist/plus/integrations/reads/issueBatch.d.ts +2 -1
- package/dist/plus/integrations/reads/issueBatch.js +1 -1
- package/dist/plus/integrations/reads/issueBatch.js.map +1 -1
- package/dist/plus/integrations/reads/issueTracker.js +23 -14
- package/dist/plus/integrations/reads/issueTracker.js.map +1 -1
- package/dist/plus/integrations/reads/issues.d.ts +2 -1
- package/dist/plus/integrations/reads/issues.js +18 -3
- package/dist/plus/integrations/reads/issues.js.map +1 -1
- package/dist/plus/integrations/reads/pullRequestBatch.js +1 -1
- package/dist/plus/integrations/reads/resolveRepository.js +12 -3
- package/dist/plus/integrations/reads/resolveRepository.js.map +1 -1
- package/dist/plus/integrations/reads/warnings.d.ts +11 -4
- package/dist/plus/integrations/reads/warnings.js +15 -5
- package/dist/plus/integrations/reads/warnings.js.map +1 -1
- package/dist/plus/integrations/results.d.ts +36 -2
- package/dist/plus/integrations/results.js +33 -13
- package/dist/plus/integrations/results.js.map +1 -1
- package/dist/utils/env/node/exec.js +2 -2
- package/dist/utils/promiseCache.d.ts +10 -0
- package/dist/utils/promiseCache.js +17 -2
- package/dist/utils/promiseCache.js.map +1 -1
- package/docs/integrations.md +52 -20
- package/package.json +2 -2
|
@@ -10,7 +10,7 @@ import { toTokenWithInfo } from "../authentication/models.js";
|
|
|
10
10
|
import "../providerFilters.js";
|
|
11
11
|
import { decodePathSegment } from "../utils/domain.utils.js";
|
|
12
12
|
import { collectProviderPagedResult, flatSettledResultsOrThrow, mergeCollectionMetadata, resolveBranchPullRequests, selectBranchPullRequests } from "./utils/providerPaging.js";
|
|
13
|
-
import { fromProviderIssue, fromProviderPullRequest, getProviderPullRequestIdentity, providerPullRequestMatchesSearch, providersMetadata, toIssueShape, toProviderPullRequestStates } from "./models.js";
|
|
13
|
+
import { fromProviderIssue, fromProviderPullRequest, getProviderPullRequestIdentity, providerPullRequestMatchesSearch, providersMetadata, toIssueShape, toProviderIssueStates, toProviderPullRequestStates } from "./models.js";
|
|
14
14
|
import { toAzurePullRequestEtagFields, toAzureWorkItemEtagFields } from "./azure/models.js";
|
|
15
15
|
import { GitHostIntegration } from "../models/gitHostIntegration.js";
|
|
16
16
|
import { getAzurePullRequestIdentityFromMaybeUrl } from "./azure/azure.utils.js";
|
|
@@ -26,8 +26,18 @@ function getAzureRepositoryIdentity(repo) {
|
|
|
26
26
|
};
|
|
27
27
|
}
|
|
28
28
|
function getAzureRepositoryApiBaseUrl(baseUrl, repo) {
|
|
29
|
+
if (!isValidAzureVirtualDirectory(repo.virtualDirectory)) throw new Error(`Invalid Azure virtual directory '${repo.virtualDirectory}'.`);
|
|
30
|
+
const url = findAzureRepositoryApiBaseUrl(baseUrl, repo);
|
|
31
|
+
if (url == null) throw new Error("Azure repository virtual directory does not match the configured installation");
|
|
32
|
+
return url;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* {@link getAzureRepositoryApiBaseUrl}, `undefined` when the connection doesn't serve `repo`'s virtual directory or it
|
|
36
|
+
* isn't a valid one.
|
|
37
|
+
*/
|
|
38
|
+
function findAzureRepositoryApiBaseUrl(baseUrl, repo) {
|
|
39
|
+
if (!isValidAzureVirtualDirectory(repo.virtualDirectory)) return void 0;
|
|
29
40
|
const directory = repo.virtualDirectory?.split("/");
|
|
30
|
-
if (directory?.some((segment) => !segment || segment === "." || segment === "..")) throw new Error(`Invalid Azure virtual directory '${repo.virtualDirectory}'.`);
|
|
31
41
|
const url = new URL(baseUrl);
|
|
32
42
|
const toUrl = (segments) => `${url.protocol}//${url.host}${segments.map((s) => `/${s}`).join("")}`;
|
|
33
43
|
const configured = url.pathname.split("/").filter(Boolean);
|
|
@@ -36,7 +46,39 @@ function getAzureRepositoryApiBaseUrl(baseUrl, repo) {
|
|
|
36
46
|
const installation = namesCollection ? configured.slice(0, -1) : configured;
|
|
37
47
|
if (directory == null) return toUrl(installation);
|
|
38
48
|
for (const candidate of namesCollection ? [configured, installation] : [configured]) if (candidate.length === directory.length && candidate.every((s, i) => sameAzurePathSegment(s, directory[i]))) return toUrl(candidate);
|
|
39
|
-
|
|
49
|
+
}
|
|
50
|
+
function isValidAzureVirtualDirectory(virtualDirectory) {
|
|
51
|
+
return !virtualDirectory?.split("/").some((segment) => !segment || segment === "." || segment === "..");
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* The paths a project-less reading's `{vdir}/{owner}` can be below the connection `baseUrl` addresses: the address
|
|
55
|
+
* itself, or its parent when the address names a collection (see {@link resolveAzureProjectlessRepository}). A
|
|
56
|
+
* connection at the host root serves no virtual directory, so none.
|
|
57
|
+
*/
|
|
58
|
+
function getAzureProjectlessDirectories(baseUrl) {
|
|
59
|
+
const configured = new URL(baseUrl).pathname.split("/").filter(Boolean);
|
|
60
|
+
return [configured, configured.slice(0, -1)].filter((path) => path.length > 0);
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Whether `repo`'s path could be the project-less form of a repository named after its project, as read below the
|
|
64
|
+
* connection `baseUrl` addresses: that reading moves the parsed owner into the virtual directory, so its directory and
|
|
65
|
+
* owner must be one of {@link getAzureProjectlessDirectories}.
|
|
66
|
+
*/
|
|
67
|
+
function isAzureProjectlessCandidate(baseUrl, repo) {
|
|
68
|
+
if (getAzureRepositoryIdentity({
|
|
69
|
+
owner: repo.owner,
|
|
70
|
+
name: repo.name
|
|
71
|
+
}).projectName == null) return false;
|
|
72
|
+
const directory = [...repo.virtualDirectory?.split("/") ?? [], repo.owner];
|
|
73
|
+
return getAzureProjectlessDirectories(baseUrl).some((path) => path.length === directory.length && path.every((s, i) => sameAzurePathSegment(s, directory[i])));
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* The virtual directory ahead of `owner` (empty when nothing is) in whichever of {@link getAzureProjectlessDirectories}
|
|
77
|
+
* ends with it, `undefined` when none does. A caller-supplied repository scope carries only its owner, so this places
|
|
78
|
+
* it where {@link isAzureProjectlessCandidate} expects it.
|
|
79
|
+
*/
|
|
80
|
+
function getAzureScopeVirtualDirectory(baseUrl, owner) {
|
|
81
|
+
return getAzureProjectlessDirectories(baseUrl).find((p) => sameAzurePathSegment(p.at(-1), owner))?.slice(0, -1).map(decodePathSegment).join("/");
|
|
40
82
|
}
|
|
41
83
|
function sameAzurePathSegment(encoded, value) {
|
|
42
84
|
return decodePathSegment(encoded).toLowerCase() === value.toLowerCase();
|
|
@@ -55,6 +97,28 @@ function uniqueAzureNames(names) {
|
|
|
55
97
|
return unique;
|
|
56
98
|
}
|
|
57
99
|
/**
|
|
100
|
+
* Re-reads a remote's `{owner}/{project}/_git/{repo}` as the project-less form of a repository named after its
|
|
101
|
+
* project: behind a path, `{vdir}/{collection}/_git/{repo}` parses as collection `{vdir}` and project `{collection}`.
|
|
102
|
+
* When `collections` lists the parsed project but not the parsed owner, the owner joins the virtual directory, the
|
|
103
|
+
* parsed project is the collection, and the project is the repository's own name. Otherwise returns `repo`.
|
|
104
|
+
*/
|
|
105
|
+
function resolveAzureProjectlessRepository(repo, collections) {
|
|
106
|
+
const { projectName, repositoryName } = getAzureRepositoryIdentity({
|
|
107
|
+
owner: repo.owner,
|
|
108
|
+
name: repo.name
|
|
109
|
+
});
|
|
110
|
+
if (projectName == null) return repo;
|
|
111
|
+
const collection = collections.find((c) => sameAzureName(c, projectName));
|
|
112
|
+
if (collection == null || collections.some((c) => sameAzureName(c, repo.owner))) return repo;
|
|
113
|
+
return {
|
|
114
|
+
...repo,
|
|
115
|
+
owner: collection,
|
|
116
|
+
name: `${repositoryName}/_git/${repositoryName}`,
|
|
117
|
+
project: repositoryName,
|
|
118
|
+
virtualDirectory: repo.virtualDirectory ? `${repo.virtualDirectory}/${repo.owner}` : repo.owner
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
58
122
|
* Flags the reviews of `pr` that name one of the current user's groups (see `PullRequestReviewer.isMyGroup`), which a
|
|
59
123
|
* reviewer read finds through that group rather than through the user.
|
|
60
124
|
*/
|
|
@@ -119,6 +183,30 @@ var AzureDevOpsIntegrationBase = class extends GitHostIntegration {
|
|
|
119
183
|
collectionApiBaseUrl(session, _collection) {
|
|
120
184
|
return this.apiBaseUrlFor(session);
|
|
121
185
|
}
|
|
186
|
+
/**
|
|
187
|
+
* The repository a remote-derived descriptor names, and the base its requests append it to. Azure DevOps Services
|
|
188
|
+
* reads the descriptor as parsed; the server override first settles a path the parser can't (see
|
|
189
|
+
* {@link resolveAzureProjectlessRepository}).
|
|
190
|
+
*/
|
|
191
|
+
getRepositoryTarget(session, repo, _cancellation) {
|
|
192
|
+
return Promise.resolve({
|
|
193
|
+
repo,
|
|
194
|
+
baseUrl: getAzureRepositoryApiBaseUrl(this.apiBaseUrlFor(session), repo)
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* Reads `repo` with GitLens' Azure client at its target (see {@link getRepositoryTarget}). A read that finds nothing
|
|
199
|
+
* for a target whose path couldn't be settled may have addressed the wrong collection, so it throws instead, which
|
|
200
|
+
* keeps that miss out of the host's caches until the path can be settled.
|
|
201
|
+
*/
|
|
202
|
+
async readRepository(session, repo, read, cancellation) {
|
|
203
|
+
const azure = await this.authenticationService.apis.azure;
|
|
204
|
+
if (azure == null) return void 0;
|
|
205
|
+
const target = await this.getRepositoryTarget(session, repo, cancellation);
|
|
206
|
+
const result = await read(azure, target);
|
|
207
|
+
if (result == null && target.unsettled) throw new Error(`${this.name}: nothing read for '${target.repo.owner}/${target.repo.name}', whose collection couldn't be settled`);
|
|
208
|
+
return result;
|
|
209
|
+
}
|
|
122
210
|
/** Reads the organizations (Azure DevOps Server: the collections) the account can see. */
|
|
123
211
|
async requestResourcesForUser(session, userId) {
|
|
124
212
|
const api = await this.getProvidersApi();
|
|
@@ -467,19 +555,19 @@ var AzureDevOpsIntegrationBase = class extends GitHostIntegration {
|
|
|
467
555
|
this.ctx.hooks?.ui?.onError?.(`${ex.message}. Check branch policies, and ensure you have the necessary permissions to merge the pull request.`);
|
|
468
556
|
}
|
|
469
557
|
async getProviderAccountForCommit(session, repo, rev, options) {
|
|
470
|
-
return (
|
|
558
|
+
return this.readRepository(session, repo, (azure, target) => azure.getAccountForCommit(this, toTokenWithInfo(this.id, session), target.repo.owner, target.repo.name, rev, target.baseUrl, options));
|
|
471
559
|
}
|
|
472
560
|
async getProviderAccountForEmail(_session, _repo, _email, _options) {
|
|
473
561
|
return Promise.resolve(void 0);
|
|
474
562
|
}
|
|
475
563
|
async getProviderDefaultBranch(session, repo, cancellation) {
|
|
476
|
-
return (
|
|
564
|
+
return this.readRepository(session, repo, (azure, target) => azure.getDefaultBranch(this, toTokenWithInfo(this.id, session), target.repo.owner, target.repo.name, { baseUrl: target.baseUrl }, cancellation), cancellation);
|
|
477
565
|
}
|
|
478
566
|
async getProviderLinkedIssueOrPullRequest(session, repo, { id }, type) {
|
|
479
|
-
return (
|
|
480
|
-
baseUrl:
|
|
567
|
+
return this.readRepository(session, repo, (azure, target) => azure.getIssueOrPullRequest(this, toTokenWithInfo(this.id, session), target.repo.owner, target.repo.name, id, {
|
|
568
|
+
baseUrl: target.baseUrl,
|
|
481
569
|
type
|
|
482
|
-
});
|
|
570
|
+
}));
|
|
483
571
|
}
|
|
484
572
|
async getProviderIssue(session, project, id) {
|
|
485
573
|
if ((await this.getProviderCurrentAccount(session))?.username == null) return void 0;
|
|
@@ -492,10 +580,10 @@ var AzureDevOpsIntegrationBase = class extends GitHostIntegration {
|
|
|
492
580
|
return (await this.authenticationService.apis.azure)?.getIssue(this, toTokenWithInfo(this.id, session), matchingProject, id, { baseUrl: this.collectionApiBaseUrl(session, matchingProject.resourceName) });
|
|
493
581
|
}
|
|
494
582
|
async getProviderPullRequestForBranch(session, repo, branch, _options) {
|
|
495
|
-
return (
|
|
583
|
+
return this.readRepository(session, repo, (azure, target) => azure.getPullRequestForBranch(this, toTokenWithInfo(this.id, session), target.repo.owner, target.repo.name, branch, { baseUrl: target.baseUrl }));
|
|
496
584
|
}
|
|
497
585
|
async getProviderPullRequestForCommit(session, repo, rev) {
|
|
498
|
-
return (
|
|
586
|
+
return this.readRepository(session, repo, (azure, target) => azure.getPullRequestForCommit(this, toTokenWithInfo(this.id, session), target.repo.owner, target.repo.name, rev, target.baseUrl));
|
|
499
587
|
}
|
|
500
588
|
/**
|
|
501
589
|
* One request per target, settled independently so one target's failure rejects only its own slot; converted
|
|
@@ -697,25 +785,27 @@ var AzureDevOpsIntegrationBase = class extends GitHostIntegration {
|
|
|
697
785
|
return resolveBranchPullRequests(targets, found, (coordinates) => this.getProviderPullRequestsBatch(session, coordinates, { currentAccount: options.currentAccount }, cancellation));
|
|
698
786
|
}
|
|
699
787
|
async getProviderPullRequest(session, resource, id) {
|
|
700
|
-
return (
|
|
788
|
+
return this.readRepository(session, resource, (azure, target) => azure.getPullRequest(this, toTokenWithInfo(this.id, session), target.repo.owner, target.repo.project ?? target.repo.name, id, { baseUrl: target.baseUrl }));
|
|
701
789
|
}
|
|
702
790
|
getProviderPullRequestIdentityFromMaybeUrl(search) {
|
|
703
791
|
return getAzurePullRequestIdentityFromMaybeUrl(search, this.id);
|
|
704
792
|
}
|
|
705
793
|
async getRepoInfo(repo) {
|
|
706
|
-
|
|
707
|
-
if (identity.projectName == null) return void 0;
|
|
794
|
+
if (getAzureRepositoryIdentity(repo).projectName == null) return void 0;
|
|
708
795
|
const api = await this.getProvidersApi();
|
|
709
796
|
const session = await this.resolveReadSessionOrThrow(repo.connectionId, void 0);
|
|
710
797
|
if (session == null) return void 0;
|
|
798
|
+
const target = await this.getRepositoryTarget(session, repo);
|
|
799
|
+
const identity = getAzureRepositoryIdentity(target.repo);
|
|
800
|
+
if (identity.projectName == null) return void 0;
|
|
711
801
|
const { tokenWithInfo, options } = this.getApiOptions(session);
|
|
712
802
|
return api.getRepo(tokenWithInfo, identity.resourceName, identity.repositoryName, identity.projectName, {
|
|
713
803
|
...options,
|
|
714
|
-
baseUrl:
|
|
804
|
+
baseUrl: target.baseUrl
|
|
715
805
|
});
|
|
716
806
|
}
|
|
717
807
|
async getProviderRepositoryMetadata(session, repo, cancellation) {
|
|
718
|
-
return (
|
|
808
|
+
return this.readRepository(session, repo, (azure, target) => azure.getRepositoryMetadata(this, toTokenWithInfo(this.id, session), target.repo.owner, target.repo.name, { baseUrl: target.baseUrl }, cancellation), cancellation);
|
|
719
809
|
}
|
|
720
810
|
async searchProviderMyPullRequests(session, repos, _cancellation, options) {
|
|
721
811
|
if (repos != null) return;
|
|
@@ -991,7 +1081,8 @@ var AzureDevOpsIntegrationBase = class extends GitHostIntegration {
|
|
|
991
1081
|
...this.getCollectionApiOptions(session, p.resourceName),
|
|
992
1082
|
...filter,
|
|
993
1083
|
cursor,
|
|
994
|
-
sort: searchOptions?.sort
|
|
1084
|
+
sort: searchOptions?.sort,
|
|
1085
|
+
states: toProviderIssueStates(searchOptions?.state)
|
|
995
1086
|
}), 20, {
|
|
996
1087
|
providerId: this.id,
|
|
997
1088
|
resourceId: p.resourceId,
|
|
@@ -1156,6 +1247,6 @@ var AzureDevOpsIntegration = class extends AzureDevOpsIntegrationBase {
|
|
|
1156
1247
|
}
|
|
1157
1248
|
};
|
|
1158
1249
|
//#endregion
|
|
1159
|
-
export { AzureDevOpsIntegration, AzureDevOpsIntegrationBase, getAzureRepositoryApiBaseUrl, getAzureRepositoryIdentity, markMyGroupReviews, sameAzureName, toAzureReviewerReads, uniqueAzureNames };
|
|
1250
|
+
export { AzureDevOpsIntegration, AzureDevOpsIntegrationBase, findAzureRepositoryApiBaseUrl, getAzureRepositoryApiBaseUrl, getAzureRepositoryIdentity, getAzureScopeVirtualDirectory, isAzureProjectlessCandidate, markMyGroupReviews, resolveAzureProjectlessRepository, sameAzureName, toAzureReviewerReads, uniqueAzureNames };
|
|
1160
1251
|
|
|
1161
1252
|
//# sourceMappingURL=azureDevOps.js.map
|