@gitkraken/core-gitlens 0.45.0 → 0.47.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 +35 -1
- package/dist/git/models/remote.js +2 -2
- package/dist/git/models/remote.js.map +1 -1
- package/dist/git/remotes/matcher.js +25 -3
- package/dist/git/remotes/matcher.js.map +1 -1
- package/dist/git/utils/branchLanded.utils.d.ts +7 -0
- package/dist/git/utils/branchLanded.utils.js +10 -1
- package/dist/git/utils/branchLanded.utils.js.map +1 -1
- package/dist/git/utils/remote.utils.d.ts +1 -0
- package/dist/git/utils/remote.utils.js +14 -5
- package/dist/git/utils/remote.utils.js.map +1 -1
- package/dist/git-cli/parsers/logParser.js +227 -468
- package/dist/git-cli/parsers/logParser.js.map +1 -1
- package/dist/git-cli/parsers/refParser.js +4 -4
- package/dist/git-cli/parsers/refParser.js.map +1 -1
- package/dist/git-cli/providers/branches.d.ts +5 -0
- package/dist/git-cli/providers/branches.js +25 -21
- package/dist/git-cli/providers/branches.js.map +1 -1
- package/dist/git-cli/providers/config.js +2 -2
- package/dist/git-cli/providers/pausedOperations.js +2 -2
- package/dist/git-cli/providers/pausedOperations.js.map +1 -1
- package/dist/git-cli/providers/staging.js +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/api/enterprisePullRequestMergePolicy.d.ts +31 -0
- package/dist/plus/git-github/api/enterprisePullRequestMergePolicy.js +166 -0
- package/dist/plus/git-github/api/enterprisePullRequestMergePolicy.js.map +1 -0
- package/dist/plus/git-github/api/github.d.ts +13 -5
- package/dist/plus/git-github/api/github.js +53 -13
- package/dist/plus/git-github/api/github.js.map +1 -1
- package/dist/plus/git-github/api/issueWrites.d.ts +7 -1
- package/dist/plus/git-github/api/issueWrites.js +62 -32
- package/dist/plus/git-github/api/issueWrites.js.map +1 -1
- package/dist/plus/git-github/api/pullRequestWrites.d.ts +7 -3
- package/dist/plus/git-github/api/pullRequestWrites.js +120 -67
- package/dist/plus/git-github/api/pullRequestWrites.js.map +1 -1
- package/dist/plus/integrations/authentication/cloudIntegrationAuthenticationProvider.d.ts +44 -0
- package/dist/plus/integrations/authentication/cloudIntegrationAuthenticationProvider.js +199 -0
- package/dist/plus/integrations/authentication/cloudIntegrationAuthenticationProvider.js.map +1 -0
- package/dist/plus/integrations/authentication/configuredIntegrationService.d.ts +7 -0
- package/dist/plus/integrations/authentication/configuredIntegrationService.js +53 -7
- package/dist/plus/integrations/authentication/configuredIntegrationService.js.map +1 -1
- package/dist/plus/integrations/authentication/integrationAuthenticationProvider.d.ts +2 -38
- package/dist/plus/integrations/authentication/integrationAuthenticationProvider.js +0 -199
- package/dist/plus/integrations/authentication/integrationAuthenticationService.d.ts +4 -2
- package/dist/plus/integrations/authentication/integrationAuthenticationService.js +12 -1
- package/dist/plus/integrations/authentication/integrationAuthenticationService.js.map +1 -1
- package/dist/plus/integrations/authentication/models.d.ts +0 -1
- package/dist/plus/integrations/authentication/models.js +1 -2
- package/dist/plus/integrations/authentication/models.js.map +1 -1
- package/dist/plus/integrations/constants.d.ts +0 -10
- package/dist/plus/integrations/constants.js +1 -95
- package/dist/plus/integrations/constants.js.map +1 -1
- package/dist/plus/integrations/context.d.ts +17 -17
- package/dist/plus/integrations/index.d.ts +44 -25
- package/dist/plus/integrations/index.js +41 -8
- package/dist/plus/integrations/index.js.map +1 -1
- package/dist/plus/integrations/integrationService.d.ts +24 -24
- package/dist/plus/integrations/integrationService.js +125 -34
- package/dist/plus/integrations/integrationService.js.map +1 -1
- package/dist/plus/integrations/lite.js +1 -1
- package/dist/plus/integrations/lite.js.map +1 -1
- package/dist/plus/integrations/manager.d.ts +81 -21
- package/dist/plus/integrations/models/actionablePullRequest.d.ts +213 -0
- package/dist/plus/integrations/models/actionablePullRequest.js +25 -0
- package/dist/plus/integrations/models/actionablePullRequest.js.map +1 -0
- package/dist/plus/integrations/models/gitHostIntegration.d.ts +13 -46
- package/dist/plus/integrations/models/gitHostIntegration.js +22 -8
- package/dist/plus/integrations/models/gitHostIntegration.js.map +1 -1
- package/dist/plus/integrations/models/integration.d.ts +11 -175
- package/dist/plus/integrations/models/integration.js +22 -76
- package/dist/plus/integrations/models/integration.js.map +1 -1
- package/dist/plus/integrations/models/issueTrackerWrites.d.ts +128 -0
- package/dist/plus/integrations/models/issueTrackerWrites.js +0 -0
- package/dist/plus/integrations/models/issuesIntegration.d.ts +9 -5
- package/dist/plus/integrations/models/issuesIntegration.js +5 -3
- package/dist/plus/integrations/models/issuesIntegration.js.map +1 -1
- package/dist/plus/integrations/models/publicIntegration.d.ts +257 -0
- package/dist/plus/integrations/models/publicIntegration.js +21 -0
- package/dist/plus/integrations/models/publicIntegration.js.map +1 -0
- package/dist/plus/integrations/providerFilters.d.ts +58 -0
- package/dist/plus/integrations/providerFilters.js.map +1 -1
- package/dist/plus/integrations/providers/actionablePullRequests.d.ts +19 -0
- package/dist/plus/integrations/providers/actionablePullRequests.js +32 -0
- package/dist/plus/integrations/providers/actionablePullRequests.js.map +1 -0
- package/dist/plus/integrations/providers/apiClients.d.ts +1 -2
- package/dist/plus/integrations/providers/apiClients.js.map +1 -1
- package/dist/plus/integrations/providers/asana.d.ts +3 -2
- package/dist/plus/integrations/providers/asana.js +2 -1
- package/dist/plus/integrations/providers/asana.js.map +1 -1
- package/dist/plus/integrations/providers/azure/azure.d.ts +1 -1
- package/dist/plus/integrations/providers/azure/azure.js +1 -1
- package/dist/plus/integrations/providers/azure/azure.utils.d.ts +10 -3
- package/dist/plus/integrations/providers/azure/azure.utils.js +5 -1
- package/dist/plus/integrations/providers/azure/azure.utils.js.map +1 -1
- package/dist/plus/integrations/providers/azure/models.d.ts +1 -5
- package/dist/plus/integrations/providers/azure/models.js +1 -1
- package/dist/plus/integrations/providers/azure/models.js.map +1 -1
- package/dist/plus/integrations/providers/azureDevOps.d.ts +8 -5
- package/dist/plus/integrations/providers/azureDevOps.js +2 -1
- package/dist/plus/integrations/providers/azureDevOps.js.map +1 -1
- package/dist/plus/integrations/providers/azureDevOpsServer.d.ts +5 -4
- package/dist/plus/integrations/providers/azureDevOpsServer.js +3 -1
- package/dist/plus/integrations/providers/azureDevOpsServer.js.map +1 -1
- package/dist/plus/integrations/providers/bitbucket/bitbucket.d.ts +2 -2
- package/dist/plus/integrations/providers/bitbucket/bitbucket.js.map +1 -1
- package/dist/plus/integrations/providers/bitbucket/models.d.ts +1 -1
- package/dist/plus/integrations/providers/bitbucket/models.js.map +1 -1
- package/dist/plus/integrations/providers/bitbucket-server.d.ts +5 -4
- package/dist/plus/integrations/providers/bitbucket-server.js +2 -1
- package/dist/plus/integrations/providers/bitbucket-server.js.map +1 -1
- package/dist/plus/integrations/providers/bitbucket.d.ts +4 -3
- package/dist/plus/integrations/providers/bitbucket.js +2 -1
- package/dist/plus/integrations/providers/bitbucket.js.map +1 -1
- package/dist/plus/integrations/providers/github/github.d.ts +0 -1
- package/dist/plus/integrations/providers/github/github.js +1 -1
- package/dist/plus/integrations/providers/github/github.js.map +1 -1
- package/dist/plus/integrations/providers/github.d.ts +29 -11
- package/dist/plus/integrations/providers/github.js +195 -78
- package/dist/plus/integrations/providers/github.js.map +1 -1
- package/dist/plus/integrations/providers/gitlab/gitlab.d.ts +2 -2
- package/dist/plus/integrations/providers/gitlab/gitlab.js +1 -2
- package/dist/plus/integrations/providers/gitlab/gitlab.js.map +1 -1
- package/dist/plus/integrations/providers/gitlab/gitlab.utils.d.ts +14 -1
- package/dist/plus/integrations/providers/gitlab/gitlab.utils.js.map +1 -1
- package/dist/plus/integrations/providers/gitlab/models.d.ts +2 -10
- package/dist/plus/integrations/providers/gitlab/models.js.map +1 -1
- package/dist/plus/integrations/providers/gitlab.d.ts +7 -5
- package/dist/plus/integrations/providers/gitlab.js +2 -1
- package/dist/plus/integrations/providers/gitlab.js.map +1 -1
- package/dist/plus/integrations/providers/issueSorts.d.ts +1 -0
- package/dist/plus/integrations/providers/jira-server.d.ts +4 -4
- package/dist/plus/integrations/providers/jira-server.js +3 -2
- package/dist/plus/integrations/providers/jira-server.js.map +1 -1
- package/dist/plus/integrations/providers/jira.d.ts +3 -3
- package/dist/plus/integrations/providers/jira.js +4 -3
- package/dist/plus/integrations/providers/jira.js.map +1 -1
- package/dist/plus/integrations/providers/jiraIssueByKey.d.ts +3 -1
- package/dist/plus/integrations/providers/jiraIssueByKey.js +1 -1
- package/dist/plus/integrations/providers/jiraIssueByKey.js.map +1 -1
- package/dist/plus/integrations/providers/jiraIssueWriteErrors.d.ts +10 -0
- package/dist/plus/integrations/providers/jiraIssueWriteErrors.js +68 -0
- package/dist/plus/integrations/providers/jiraIssueWriteErrors.js.map +1 -0
- package/dist/plus/integrations/providers/jiraIssueWrites.d.ts +40 -0
- package/dist/plus/integrations/providers/jiraIssueWrites.js +397 -0
- package/dist/plus/integrations/providers/jiraIssueWrites.js.map +1 -0
- package/dist/plus/integrations/providers/linear.d.ts +4 -3
- package/dist/plus/integrations/providers/linear.js +3 -2
- package/dist/plus/integrations/providers/linear.js.map +1 -1
- package/dist/plus/integrations/providers/linearIssuesEtag.d.ts +1 -1
- package/dist/plus/integrations/providers/linearIssuesEtag.js +1 -1
- package/dist/plus/integrations/providers/linearIssuesEtag.js.map +1 -1
- package/dist/plus/integrations/providers/metadata.d.ts +136 -0
- package/dist/plus/integrations/providers/metadata.js +513 -0
- package/dist/plus/integrations/providers/metadata.js.map +1 -0
- package/dist/plus/integrations/providers/models.d.ts +10 -206
- package/dist/plus/integrations/providers/models.js +8 -539
- package/dist/plus/integrations/providers/models.js.map +1 -1
- package/dist/plus/integrations/providers/providersApi.d.ts +7 -3
- package/dist/plus/integrations/providers/providersApi.js +23 -11
- package/dist/plus/integrations/providers/providersApi.js.map +1 -1
- package/dist/plus/integrations/providers/trello.d.ts +1 -1
- package/dist/plus/integrations/providers/trello.js +2 -1
- package/dist/plus/integrations/providers/trello.js.map +1 -1
- package/dist/plus/integrations/providers/utils/providerPaging.d.ts +2 -0
- package/dist/plus/integrations/providers/utils/providerPaging.js +3 -2
- package/dist/plus/integrations/providers/utils/providerPaging.js.map +1 -1
- package/dist/plus/integrations/providers/utils.d.ts +119 -10
- package/dist/plus/integrations/providers/utils.js +57 -3
- package/dist/plus/integrations/providers/utils.js.map +1 -1
- package/dist/plus/integrations/reads/autolinks.d.ts +1 -1
- package/dist/plus/integrations/reads/autolinks.js +1 -1
- package/dist/plus/integrations/reads/autolinks.js.map +1 -1
- package/dist/plus/integrations/reads/broaden.d.ts +1 -1
- package/dist/plus/integrations/reads/broaden.js +3 -2
- package/dist/plus/integrations/reads/broaden.js.map +1 -1
- package/dist/plus/integrations/reads/context.d.ts +1 -1
- package/dist/plus/integrations/reads/counts.d.ts +1 -88
- package/dist/plus/integrations/reads/counts.js +4 -2
- package/dist/plus/integrations/reads/counts.js.map +1 -1
- package/dist/plus/integrations/reads/currentAccount.d.ts +1 -18
- package/dist/plus/integrations/reads/currentAccount.js.map +1 -1
- package/dist/plus/integrations/reads/drains.d.ts +4 -3
- package/dist/plus/integrations/reads/drains.js +1 -1
- package/dist/plus/integrations/reads/drains.js.map +1 -1
- package/dist/plus/integrations/reads/etag.d.ts +174 -3
- package/dist/plus/integrations/reads/etag.js +69 -14
- package/dist/plus/integrations/reads/etag.js.map +1 -1
- package/dist/plus/integrations/reads/filters.d.ts +3 -61
- package/dist/plus/integrations/reads/filters.js +1 -1
- package/dist/plus/integrations/reads/filters.js.map +1 -1
- package/dist/plus/integrations/reads/hierarchy.d.ts +1 -1
- package/dist/plus/integrations/reads/hierarchy.js +4 -2
- package/dist/plus/integrations/reads/hierarchy.js.map +1 -1
- package/dist/plus/integrations/reads/issueBatch.d.ts +2 -102
- package/dist/plus/integrations/reads/issueBatch.js +3 -4
- package/dist/plus/integrations/reads/issueBatch.js.map +1 -1
- package/dist/plus/integrations/reads/issueTracker.d.ts +1 -1
- package/dist/plus/integrations/reads/issueTracker.js +4 -3
- package/dist/plus/integrations/reads/issueTracker.js.map +1 -1
- package/dist/plus/integrations/reads/issues.d.ts +1 -1
- package/dist/plus/integrations/reads/issues.js +4 -2
- package/dist/plus/integrations/reads/issues.js.map +1 -1
- package/dist/plus/integrations/reads/paging.d.ts +1 -1
- package/dist/plus/integrations/reads/paging.js +1 -1
- package/dist/plus/integrations/reads/paging.js.map +1 -1
- package/dist/plus/integrations/reads/pullRequestActivity.d.ts +1 -24
- package/dist/plus/integrations/reads/pullRequestActivity.js +2 -1
- package/dist/plus/integrations/reads/pullRequestActivity.js.map +1 -1
- package/dist/plus/integrations/reads/pullRequestBatch.d.ts +2 -56
- package/dist/plus/integrations/reads/pullRequestBatch.js +23 -3
- package/dist/plus/integrations/reads/pullRequestBatch.js.map +1 -1
- package/dist/plus/integrations/reads/pullRequestBranches.d.ts +1 -47
- package/dist/plus/integrations/reads/pullRequestBranches.js +2 -1
- package/dist/plus/integrations/reads/pullRequestBranches.js.map +1 -1
- package/dist/plus/integrations/reads/pullRequestCheckLogs.d.ts +1 -15
- package/dist/plus/integrations/reads/pullRequestCheckLogs.js +2 -1
- package/dist/plus/integrations/reads/pullRequestCheckLogs.js.map +1 -1
- package/dist/plus/integrations/reads/pullRequests.js +4 -2
- package/dist/plus/integrations/reads/pullRequests.js.map +1 -1
- package/dist/plus/integrations/reads/pullRequestsForCommits.d.ts +1 -16
- package/dist/plus/integrations/reads/pullRequestsForCommits.js +2 -1
- package/dist/plus/integrations/reads/pullRequestsForCommits.js.map +1 -1
- package/dist/plus/integrations/reads/resolveRepository.js +10 -5
- package/dist/plus/integrations/reads/resolveRepository.js.map +1 -1
- package/dist/plus/integrations/reads/searchIssues.js +2 -1
- package/dist/plus/integrations/reads/searchIssues.js.map +1 -1
- package/dist/plus/integrations/reads/searchPullRequests.js +2 -1
- package/dist/plus/integrations/reads/searchPullRequests.js.map +1 -1
- package/dist/plus/integrations/reads/sweeps.d.ts +1 -1
- package/dist/plus/integrations/reads/sweeps.js +3 -2
- package/dist/plus/integrations/reads/sweeps.js.map +1 -1
- package/dist/plus/integrations/reads/warnings.d.ts +1 -1
- package/dist/plus/integrations/reads/warnings.js +1 -1
- package/dist/plus/integrations/reads/warnings.js.map +1 -1
- package/dist/plus/integrations/results.d.ts +324 -2
- package/dist/plus/integrations/results.js.map +1 -1
- package/dist/plus/integrations/telemetry.d.ts +0 -10
- package/dist/plus/integrations/telemetry.js +0 -11
- package/dist/plus/integrations/utils/domain.utils.d.ts +1 -0
- package/dist/plus/integrations/utils/domain.utils.js +10 -2
- package/dist/plus/integrations/utils/domain.utils.js.map +1 -1
- package/dist/plus/integrations/utils/integration.utils.d.ts +2 -6
- package/dist/plus/integrations/utils/integration.utils.js +8 -9
- package/dist/plus/integrations/utils/integration.utils.js.map +1 -1
- package/dist/utils/env/node/exec.js +2 -2
- package/dist/utils/keys/chord.d.ts +13 -2
- package/dist/utils/keys/chord.js +76 -17
- package/dist/utils/keys/chord.js.map +1 -1
- package/dist/utils/keys/keybinding.d.ts +12 -0
- package/dist/utils/keys/keybinding.js +52 -2
- package/dist/utils/keys/keybinding.js.map +1 -1
- package/dist/utils/markdown.d.ts +21 -0
- package/dist/utils/markdown.js +33 -1
- package/dist/utils/markdown.js.map +1 -1
- package/docs/integrations.md +174 -19
- package/package.json +5 -1
- package/dist/plus/integrations/authentication/integrationAuthenticationProvider.js.map +0 -1
- package/dist/plus/integrations/telemetry.js.map +0 -1
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
import { PagedResult } from "../../../utils/paging.js";
|
|
2
|
+
import { ResourceDescriptor } from "../../../git/models/resourceDescriptor.js";
|
|
3
|
+
import { AutolinkReference, DynamicAutolinkReference } from "../../../git/models/autolink.js";
|
|
4
|
+
import { IssueOrPullRequest, IssueOrPullRequestState, IssueOrPullRequestType } from "../../../git/models/issueOrPullRequest.js";
|
|
5
|
+
import { Issue } from "../../../git/models/issue.js";
|
|
6
|
+
import { PullRequest, PullRequestFilter, PullRequestMergeMethod, PullRequestMergeQueueActionResult, PullRequestMergeQueueEntry, PullRequestStackInfo, PullRequestStackLayers, PullRequestStateFilter } from "../../../git/models/pullRequest.js";
|
|
7
|
+
import { Account, UnidentifiedAuthor } from "../../../git/models/author.js";
|
|
8
|
+
import { DefaultBranch } from "../../../git/models/defaultBranch.js";
|
|
9
|
+
import { RepositoryMetadata } from "../../../git/models/repositoryMetadata.js";
|
|
10
|
+
import { PullRequestUrlIdentity } from "../../../git/utils/pullRequest.utils.js";
|
|
11
|
+
import { GitCloudHostIntegrationId, IntegrationIds, IssuesCloudHostIntegrationId, IssuesHostIntegrationIds } from "../constants.js";
|
|
12
|
+
import { Sources } from "../telemetry.js";
|
|
13
|
+
import "../providerFilters.js";
|
|
14
|
+
import { ProviderRepositoryShape } from "../results.js";
|
|
15
|
+
import { ProviderRepositoriesInput } from "../manager.js";
|
|
16
|
+
//#region ../plus/integrations/src/models/publicIntegration.d.ts
|
|
17
|
+
/** The kind of an integration: a git host or an issue tracker. */
|
|
18
|
+
export type IntegrationType = 'git' | 'issues';
|
|
19
|
+
export type IntegrationKey<T extends IntegrationIds = IntegrationIds> = T extends GitCloudHostIntegrationId | IssuesCloudHostIntegrationId ? `${T}` : `${T}:${string}`;
|
|
20
|
+
export type IntegrationConnectedKey<T extends IntegrationIds = IntegrationIds> = `connected:${IntegrationKey<T>}`;
|
|
21
|
+
/** A read's outcome: its value, or the error it failed with; `undefined` when there was nothing to read. */
|
|
22
|
+
export type IntegrationResult<T> = {
|
|
23
|
+
value: T;
|
|
24
|
+
duration?: number;
|
|
25
|
+
error?: Error;
|
|
26
|
+
} | {
|
|
27
|
+
error: Error;
|
|
28
|
+
duration?: number;
|
|
29
|
+
value?: never;
|
|
30
|
+
} | undefined;
|
|
31
|
+
/** The credential an integration is connected with, for a consumer that has to hand it to another service. */
|
|
32
|
+
export interface IntegrationCredential {
|
|
33
|
+
/** The id of the provider the token was issued for, which is the integration's own id. */
|
|
34
|
+
readonly providerId: IntegrationIds;
|
|
35
|
+
readonly accessToken: string;
|
|
36
|
+
}
|
|
37
|
+
/** Read options for {@link GitHostIntegration.searchMyPullRequests} and the provider hook behind it. */
|
|
38
|
+
export type SearchMyPullRequestsOptions = {
|
|
39
|
+
/** Suppresses the user-facing notification when the read fails. */
|
|
40
|
+
silent?: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* PR states to include (open/closed/merged/all). Providers that cannot express it in a single query
|
|
43
|
+
* filter the normalized results; omitted preserves the historical open-only behavior.
|
|
44
|
+
*/
|
|
45
|
+
state?: PullRequestStateFilter;
|
|
46
|
+
includeReviewRequested?: boolean;
|
|
47
|
+
};
|
|
48
|
+
/** Read options for {@link GitHostIntegration.searchPullRequests} and the provider hook behind it. */
|
|
49
|
+
export type SearchPullRequestsOptions = {
|
|
50
|
+
/** PR states to include; omitted preserves the provider's default. */
|
|
51
|
+
include?: IssueOrPullRequestState[];
|
|
52
|
+
};
|
|
53
|
+
/** Read options for {@link GitHostIntegration.getMyPullRequestsForRepos}. */
|
|
54
|
+
export type MyPullRequestsForReposOptions = {
|
|
55
|
+
filters?: PullRequestFilter[];
|
|
56
|
+
cursor?: string;
|
|
57
|
+
customUrl?: string;
|
|
58
|
+
page?: number;
|
|
59
|
+
pageSize?: number;
|
|
60
|
+
/** PR states to include; when omitted the provider returns its default (open only). */
|
|
61
|
+
state?: PullRequestStateFilter | PullRequestStateFilter[];
|
|
62
|
+
/** Requests the lightweight row shape without per-row build status or commit count. */
|
|
63
|
+
summary?: boolean;
|
|
64
|
+
/**
|
|
65
|
+
* Most per-repository requests one provider read keeps in flight. Defaults to 6. Only hosts that read repository
|
|
66
|
+
* by repository fan out — GitLab, GitLab self-managed, Bitbucket Cloud, Bitbucket Data Center and Azure DevOps;
|
|
67
|
+
* GitHub/GHE send one query whatever the repo count. A value that isn't a finite number >= 1 falls back to the
|
|
68
|
+
* default.
|
|
69
|
+
*/
|
|
70
|
+
scopeConcurrency?: number;
|
|
71
|
+
/**
|
|
72
|
+
* Azure DevOps only, repo-scoped: `false` skips the lookup that fills each row's clone URLs, saving one
|
|
73
|
+
* request per repository (and fork source) per page. Rows then carry no `refs.base.url`/`refs.head.url`
|
|
74
|
+
* (empty) and no `cloneHttps`/`cloneSsh`, so leave it on for rows that will be checked out or matched to local
|
|
75
|
+
* remotes. Defaults to `true`; other providers ignore it.
|
|
76
|
+
*/
|
|
77
|
+
includeRemoteInfo?: boolean;
|
|
78
|
+
};
|
|
79
|
+
/** The members shared by every integration view. */
|
|
80
|
+
interface IntegrationViewBase {
|
|
81
|
+
readonly type: IntegrationType;
|
|
82
|
+
readonly id: IntegrationIds;
|
|
83
|
+
readonly name: string;
|
|
84
|
+
/**
|
|
85
|
+
* The `gl-provider-<key>` glicon key for this provider, which is NOT always its id: a self-managed variant
|
|
86
|
+
* draws with its cloud family's glyph.
|
|
87
|
+
*/
|
|
88
|
+
readonly icon: string;
|
|
89
|
+
readonly domain: string;
|
|
90
|
+
/** Whether the integration has a session; `undefined` until it has looked. */
|
|
91
|
+
readonly maybeConnected: boolean | undefined;
|
|
92
|
+
/** Whether the user's plan allows this integration (a trial or paid account; GitHub and GitLab cloud always do). */
|
|
93
|
+
access(): Promise<boolean>;
|
|
94
|
+
autolinks(): (AutolinkReference | DynamicAutolinkReference)[] | Promise<(AutolinkReference | DynamicAutolinkReference)[]>;
|
|
95
|
+
/** Connects the integration, prompting the user if needed; whether it became connected. */
|
|
96
|
+
connect(source: Sources): Promise<boolean>;
|
|
97
|
+
isConnected(): Promise<boolean>;
|
|
98
|
+
/**
|
|
99
|
+
* The credential the integration is connected with, refreshed first when it has expired; `undefined` when it isn't
|
|
100
|
+
* connected or the refresh failed. An unexpired token is returned as is, so one the provider has since revoked still
|
|
101
|
+
* comes back.
|
|
102
|
+
*/
|
|
103
|
+
getCredential(source: Sources): Promise<IntegrationCredential | undefined>;
|
|
104
|
+
getIssue(resource: ResourceDescriptor, id: string, options?: {
|
|
105
|
+
connectionId?: string;
|
|
106
|
+
expiryOverride?: boolean | number;
|
|
107
|
+
}): Promise<Issue | undefined>;
|
|
108
|
+
getLinkedIssueOrPullRequest(resource: ResourceDescriptor, link: {
|
|
109
|
+
id: string;
|
|
110
|
+
key: string;
|
|
111
|
+
}, options?: {
|
|
112
|
+
expiryOverride?: boolean | number;
|
|
113
|
+
type?: IssueOrPullRequestType;
|
|
114
|
+
throwOnError?: boolean;
|
|
115
|
+
}): Promise<IssueOrPullRequest | undefined>;
|
|
116
|
+
}
|
|
117
|
+
/** A git host integration (GitHub, GitLab, Bitbucket, Azure DevOps, and their self-managed variants). */
|
|
118
|
+
export interface GitHostIntegration extends IntegrationViewBase {
|
|
119
|
+
readonly type: 'git';
|
|
120
|
+
/**
|
|
121
|
+
* Removes a queued pull request from its base branch's merge queue, losing its place there. Results, failures and
|
|
122
|
+
* cancellation as {@link GitHostIntegration.enqueuePullRequest}.
|
|
123
|
+
*/
|
|
124
|
+
dequeuePullRequest(pr: PullRequest, cancellation?: AbortSignal): Promise<PullRequestMergeQueueActionResult>;
|
|
125
|
+
disconnect(options?: {
|
|
126
|
+
silent?: boolean;
|
|
127
|
+
currentSessionOnly?: boolean;
|
|
128
|
+
}): Promise<void>;
|
|
129
|
+
/**
|
|
130
|
+
* Adds a pull request to its base branch's merge queue (where `mergeQueueRequired` says merging means queueing).
|
|
131
|
+
* The result says why on failure: the host's refusal (`already-queued`, `head-changed`, `permission`, …),
|
|
132
|
+
* `unsupported` where this host has no merge queue to act on (only GitHub.com's is), or `unknown` for anything
|
|
133
|
+
* else, including no connection or a failure to reach the host; the provider's message rides along for logs, not
|
|
134
|
+
* for display. Cancellation throws `CancellationError`.
|
|
135
|
+
*/
|
|
136
|
+
enqueuePullRequest(pr: PullRequest, cancellation?: AbortSignal): Promise<PullRequestMergeQueueActionResult>;
|
|
137
|
+
getAccountForCommit(repo: ResourceDescriptor, rev: string, options?: {
|
|
138
|
+
avatarSize?: number;
|
|
139
|
+
}): Promise<Account | UnidentifiedAuthor | undefined>;
|
|
140
|
+
/** Gets the established local session's cache descriptor for this fetch remote, without resolving or refreshing it. */
|
|
141
|
+
getCachedPullRequestScope?(remoteUrl: string): IntegrationCacheDescriptor | undefined;
|
|
142
|
+
getCurrentAccount(options?: {
|
|
143
|
+
avatarSize?: number;
|
|
144
|
+
connectionId?: string;
|
|
145
|
+
expiryOverride?: boolean | number;
|
|
146
|
+
}): Promise<Account | undefined>;
|
|
147
|
+
getDefaultBranch(repo: ResourceDescriptor, options?: {
|
|
148
|
+
cancellation?: AbortSignal;
|
|
149
|
+
expiryOverride?: boolean | number;
|
|
150
|
+
}): Promise<DefaultBranch | undefined>;
|
|
151
|
+
/**
|
|
152
|
+
* Merge-queue entries for the given base branches of the repository, keyed by pull request number, for rows from a
|
|
153
|
+
* read that selects no merge queue. Only hosts with a readable merge queue implement this (currently GitHub.com);
|
|
154
|
+
* `undefined` means unavailable. Interim: expect it to go once every pull request read can carry its entry.
|
|
155
|
+
*/
|
|
156
|
+
getMergeQueueEntriesByPullRequestNumber?(owner: string, repo: string, branches: readonly string[], cancellation?: AbortSignal): Promise<Map<number, PullRequestMergeQueueEntry> | undefined>;
|
|
157
|
+
/**
|
|
158
|
+
* The current user's pull requests (or, without `filters`, every pull request) in `reposOrRepoIds`, one page at a
|
|
159
|
+
* time; `undefined` when the read failed.
|
|
160
|
+
*/
|
|
161
|
+
getMyPullRequestsForRepos(reposOrRepoIds: ProviderRepositoriesInput, options?: MyPullRequestsForReposOptions, connectionId?: string): Promise<PagedResult<PullRequest> | undefined>;
|
|
162
|
+
getPullRequest(resource: ResourceDescriptor, id: string, options?: {
|
|
163
|
+
expiryOverride?: boolean | number;
|
|
164
|
+
throwOnError?: boolean;
|
|
165
|
+
}): Promise<PullRequest | undefined>;
|
|
166
|
+
getPullRequestForBranch(repo: ResourceDescriptor, branch: string, options?: {
|
|
167
|
+
avatarSize?: number;
|
|
168
|
+
expiryOverride?: boolean | number;
|
|
169
|
+
include?: IssueOrPullRequestState[];
|
|
170
|
+
/**
|
|
171
|
+
* Rethrow a failed lookup instead of folding it into `undefined`, for callers that must tell
|
|
172
|
+
* "no pull request" apart from "couldn't ask".
|
|
173
|
+
*/
|
|
174
|
+
throwOnError?: boolean;
|
|
175
|
+
}): Promise<PullRequest | undefined>;
|
|
176
|
+
getPullRequestForCommit(repo: ResourceDescriptor, rev: string, options?: {
|
|
177
|
+
expiryOverride?: boolean | number;
|
|
178
|
+
throwOnError?: boolean;
|
|
179
|
+
}): Promise<PullRequest | undefined>;
|
|
180
|
+
getPullRequestIdentityFromMaybeUrl(search: string): PullRequestUrlIdentity | undefined;
|
|
181
|
+
/**
|
|
182
|
+
* The repository a host reports for `repo`, or `undefined` when it can't be read. Only the hosts that can look a
|
|
183
|
+
* repository up implement it.
|
|
184
|
+
*/
|
|
185
|
+
getRepoInfo?(repo: {
|
|
186
|
+
owner: string;
|
|
187
|
+
name: string;
|
|
188
|
+
project?: string;
|
|
189
|
+
connectionId?: string;
|
|
190
|
+
}): Promise<Pick<ProviderRepositoryShape, 'id' | 'namespace' | 'name' | 'project'> | undefined>;
|
|
191
|
+
getRepositoryMetadata(repo: ResourceDescriptor, options?: {
|
|
192
|
+
cancellation?: AbortSignal;
|
|
193
|
+
expiryOverride?: boolean | number;
|
|
194
|
+
}): Promise<RepositoryMetadata | undefined>;
|
|
195
|
+
/**
|
|
196
|
+
* The SSH signing keys (full OpenSSH-format `<type> <key> [comment]` strings) registered by the accounts matching
|
|
197
|
+
* `emails`, for building an `allowed_signers` file. Keyed by lowercased email; an email with no match is absent.
|
|
198
|
+
* A provider that doesn't expose signing keys (or isn't connected, or fails the read) returns an empty map.
|
|
199
|
+
*/
|
|
200
|
+
getSshSigningKeysForEmails(repo: ResourceDescriptor, emails: string[]): Promise<Map<string, string[]>>;
|
|
201
|
+
/**
|
|
202
|
+
* The ordered layers of the stack the given pull request belongs to, bottom to top. `undefined` when the host
|
|
203
|
+
* has no stacks concept, the repository isn't enrolled, or the pull request isn't stacked.
|
|
204
|
+
*/
|
|
205
|
+
getStackLayersForPullRequest?(owner: string, repo: string, pullRequestNumber: number, cancellation?: AbortSignal): Promise<PullRequestStackLayers | undefined>;
|
|
206
|
+
/**
|
|
207
|
+
* Stack membership for every stacked pull request in the repository, keyed by pull request number. Only hosts
|
|
208
|
+
* with a stacks concept implement this (currently GitHub).
|
|
209
|
+
*/
|
|
210
|
+
getStacksByPullRequestNumber?(owner: string, repo: string, cancellation?: AbortSignal): Promise<Map<number, PullRequestStackInfo> | undefined>;
|
|
211
|
+
mergePullRequest(pr: PullRequest, options?: {
|
|
212
|
+
mergeMethod?: PullRequestMergeMethod;
|
|
213
|
+
}, cancellation?: AbortSignal): Promise<boolean>;
|
|
214
|
+
/** Account-wide (or repo-scoped) search for the current user's pull requests. */
|
|
215
|
+
searchMyPullRequests(repos?: ResourceDescriptor | ResourceDescriptor[], cancellation?: AbortSignal, options?: SearchMyPullRequestsOptions & {
|
|
216
|
+
connectionId?: string;
|
|
217
|
+
}): Promise<IntegrationResult<PullRequest[] | undefined>>;
|
|
218
|
+
/** Free-text search across pull requests, optionally narrowed to `repos`. */
|
|
219
|
+
searchPullRequests(searchQuery: string, repos?: ResourceDescriptor | ResourceDescriptor[], cancellation?: AbortSignal, options?: SearchPullRequestsOptions & {
|
|
220
|
+
connectionId?: string;
|
|
221
|
+
}): Promise<PullRequest[] | undefined>;
|
|
222
|
+
}
|
|
223
|
+
/** An issue tracker integration (Jira, Linear, Trello, and their self-managed variants). */
|
|
224
|
+
export interface IssuesIntegration extends IntegrationViewBase {
|
|
225
|
+
readonly type: 'issues';
|
|
226
|
+
}
|
|
227
|
+
export type Integration = GitHostIntegration | IssuesIntegration;
|
|
228
|
+
export type IntegrationById<T extends IntegrationIds> = T extends IssuesHostIntegrationIds ? IssuesIntegration : GitHostIntegration;
|
|
229
|
+
/**
|
|
230
|
+
* What a consumer-owned cache is told about the integration a cached value was read through: enough to key the value
|
|
231
|
+
* by host and to invalidate it when the connection or its credential changes.
|
|
232
|
+
*/
|
|
233
|
+
export interface IntegrationCacheDescriptor {
|
|
234
|
+
readonly id: IntegrationIds;
|
|
235
|
+
readonly domain?: string;
|
|
236
|
+
/** The HTTP(S) origin used by the selected session for this Enterprise pull request read. */
|
|
237
|
+
readonly installationOrigin?: string;
|
|
238
|
+
/** Whether the integration has a session; `undefined` until it has looked. */
|
|
239
|
+
readonly maybeConnected?: boolean;
|
|
240
|
+
/** A hash of the current session's token, which changes when the account or token does. */
|
|
241
|
+
readonly sessionFingerprint?: string;
|
|
242
|
+
}
|
|
243
|
+
/** Whether `value` is an integration. Replaces an `instanceof` check against the internal base class. */
|
|
244
|
+
export declare function isIntegration(value: unknown): value is Integration;
|
|
245
|
+
/**
|
|
246
|
+
* Whether `integration` is a git host. Generic so it narrows whatever integration type it is handed: the public
|
|
247
|
+
* {@link Integration} views, or (inside the package) the classes, which implement them.
|
|
248
|
+
*/
|
|
249
|
+
export declare function isGitHostIntegration<T extends Integration>(integration: T): integration is Extract<T, {
|
|
250
|
+
readonly type: 'git';
|
|
251
|
+
}>;
|
|
252
|
+
/** Whether `integration` is an issue tracker. Generic for the same reason as {@link isGitHostIntegration}. */
|
|
253
|
+
export declare function isIssuesIntegration<T extends Integration>(integration: T): integration is Extract<T, {
|
|
254
|
+
readonly type: 'issues';
|
|
255
|
+
}>;
|
|
256
|
+
//#endregion
|
|
257
|
+
//# sourceMappingURL=publicIntegration.d.ts.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { IntegrationBase } from "./integration.js";
|
|
2
|
+
//#region ../plus/integrations/src/models/publicIntegration.ts
|
|
3
|
+
/** Whether `value` is an integration. Replaces an `instanceof` check against the internal base class. */
|
|
4
|
+
function isIntegration(value) {
|
|
5
|
+
return value instanceof IntegrationBase;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Whether `integration` is a git host. Generic so it narrows whatever integration type it is handed: the public
|
|
9
|
+
* {@link Integration} views, or (inside the package) the classes, which implement them.
|
|
10
|
+
*/
|
|
11
|
+
function isGitHostIntegration(integration) {
|
|
12
|
+
return integration.type === "git";
|
|
13
|
+
}
|
|
14
|
+
/** Whether `integration` is an issue tracker. Generic for the same reason as {@link isGitHostIntegration}. */
|
|
15
|
+
function isIssuesIntegration(integration) {
|
|
16
|
+
return integration.type === "issues";
|
|
17
|
+
}
|
|
18
|
+
//#endregion
|
|
19
|
+
export { isGitHostIntegration, isIntegration, isIssuesIntegration };
|
|
20
|
+
|
|
21
|
+
//# sourceMappingURL=publicIntegration.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"publicIntegration.js","names":[],"sources":["../../../../../plus/integrations/src/models/publicIntegration.ts"],"sourcesContent":["import type { Account, UnidentifiedAuthor } from '@gitlens/git/models/author.js';\nimport type { AutolinkReference, DynamicAutolinkReference } from '@gitlens/git/models/autolink.js';\nimport type { DefaultBranch } from '@gitlens/git/models/defaultBranch.js';\nimport type { Issue } from '@gitlens/git/models/issue.js';\nimport type {\n\tIssueOrPullRequest,\n\tIssueOrPullRequestState,\n\tIssueOrPullRequestType,\n} from '@gitlens/git/models/issueOrPullRequest.js';\nimport type {\n\tPullRequest,\n\tPullRequestMergeMethod,\n\tPullRequestMergeQueueActionResult,\n\tPullRequestMergeQueueEntry,\n\tPullRequestStackInfo,\n\tPullRequestStackLayers,\n\tPullRequestStateFilter,\n} from '@gitlens/git/models/pullRequest.js';\nimport type { RepositoryMetadata } from '@gitlens/git/models/repositoryMetadata.js';\nimport type { ResourceDescriptor } from '@gitlens/git/models/resourceDescriptor.js';\nimport type { PullRequestUrlIdentity } from '@gitlens/git/utils/pullRequest.utils.js';\nimport type { PagedResult } from '@gitlens/utils/paging.js';\nimport type {\n\tGitCloudHostIntegrationId,\n\tIntegrationIds,\n\tIssuesCloudHostIntegrationId,\n\tIssuesHostIntegrationIds,\n} from '../constants.js';\nimport type { ProviderRepositoriesInput } from '../manager.js';\nimport type { PullRequestFilter } from '../providerFilters.js';\nimport type { ProviderRepositoryShape } from '../results.js';\nimport type { Sources } from '../telemetry.js';\nimport { IntegrationBase } from './integration.js';\n\n// The public, interface-only views of the integration classes: what a consumer of the `index.js` facade may call on\n// an integration. They are written out member by member, in package-owned and `@gitlens/*` types only, so nothing\n// a consumer can reach from them names `@gitkraken/provider-apis` or an internal class. The classes `implements`\n// these views, so the compiler keeps each class member assignable to the view's.\n// Code inside the package keeps importing the classes from `models/*`.\n// The views' doc comments are the consumer contract; the classes' doc comments are maintainer notes.\n\n/** The kind of an integration: a git host or an issue tracker. */\nexport type IntegrationType = 'git' | 'issues';\n\n// Keep this in step with `isSelfManagedHostIntegrationId`: it is the type-level twin of that predicate, and a\n// disagreement compiles cleanly while the runtime writes a domain-keyed key the type says is unkeyed (so the\n// local-disconnect flag is written under one key and read under another).\nexport type IntegrationKey<T extends IntegrationIds = IntegrationIds> = T extends\n\t| GitCloudHostIntegrationId\n\t| IssuesCloudHostIntegrationId\n\t? `${T}`\n\t: `${T}:${string}`;\n\nexport type IntegrationConnectedKey<T extends IntegrationIds = IntegrationIds> = `connected:${IntegrationKey<T>}`;\n\n/** A read's outcome: its value, or the error it failed with; `undefined` when there was nothing to read. */\nexport type IntegrationResult<T> =\n\t| { value: T; duration?: number; error?: Error }\n\t| { error: Error; duration?: number; value?: never }\n\t| undefined;\n\n/** The credential an integration is connected with, for a consumer that has to hand it to another service. */\nexport interface IntegrationCredential {\n\t/** The id of the provider the token was issued for, which is the integration's own id. */\n\treadonly providerId: IntegrationIds;\n\treadonly accessToken: string;\n}\n\n/** Read options for {@link GitHostIntegration.searchMyPullRequests} and the provider hook behind it. */\nexport type SearchMyPullRequestsOptions = {\n\t/** Suppresses the user-facing notification when the read fails. */\n\tsilent?: boolean;\n\t/**\n\t * PR states to include (open/closed/merged/all). Providers that cannot express it in a single query\n\t * filter the normalized results; omitted preserves the historical open-only behavior.\n\t */\n\tstate?: PullRequestStateFilter;\n\tincludeReviewRequested?: boolean;\n};\n\n/** Read options for {@link GitHostIntegration.searchPullRequests} and the provider hook behind it. */\nexport type SearchPullRequestsOptions = {\n\t/** PR states to include; omitted preserves the provider's default. */\n\tinclude?: IssueOrPullRequestState[];\n};\n\n/** Read options for {@link GitHostIntegration.getMyPullRequestsForRepos}. */\nexport type MyPullRequestsForReposOptions = {\n\tfilters?: PullRequestFilter[];\n\tcursor?: string;\n\tcustomUrl?: string;\n\tpage?: number;\n\tpageSize?: number;\n\t/** PR states to include; when omitted the provider returns its default (open only). */\n\tstate?: PullRequestStateFilter | PullRequestStateFilter[];\n\t/** Requests the lightweight row shape without per-row build status or commit count. */\n\tsummary?: boolean;\n\t/**\n\t * Most per-repository requests one provider read keeps in flight. Defaults to 6. Only hosts that read repository\n\t * by repository fan out — GitLab, GitLab self-managed, Bitbucket Cloud, Bitbucket Data Center and Azure DevOps;\n\t * GitHub/GHE send one query whatever the repo count. A value that isn't a finite number >= 1 falls back to the\n\t * default.\n\t */\n\tscopeConcurrency?: number;\n\t/**\n\t * Azure DevOps only, repo-scoped: `false` skips the lookup that fills each row's clone URLs, saving one\n\t * request per repository (and fork source) per page. Rows then carry no `refs.base.url`/`refs.head.url`\n\t * (empty) and no `cloneHttps`/`cloneSsh`, so leave it on for rows that will be checked out or matched to local\n\t * remotes. Defaults to `true`; other providers ignore it.\n\t */\n\tincludeRemoteInfo?: boolean;\n};\n\n/** The members shared by every integration view. */\ninterface IntegrationViewBase {\n\treadonly type: IntegrationType;\n\treadonly id: IntegrationIds;\n\treadonly name: string;\n\t/**\n\t * The `gl-provider-<key>` glicon key for this provider, which is NOT always its id: a self-managed variant\n\t * draws with its cloud family's glyph.\n\t */\n\treadonly icon: string;\n\treadonly domain: string;\n\t/** Whether the integration has a session; `undefined` until it has looked. */\n\treadonly maybeConnected: boolean | undefined;\n\n\t/** Whether the user's plan allows this integration (a trial or paid account; GitHub and GitLab cloud always do). */\n\taccess(): Promise<boolean>;\n\tautolinks():\n\t\t| (AutolinkReference | DynamicAutolinkReference)[]\n\t\t| Promise<(AutolinkReference | DynamicAutolinkReference)[]>;\n\t/** Connects the integration, prompting the user if needed; whether it became connected. */\n\tconnect(source: Sources): Promise<boolean>;\n\tisConnected(): Promise<boolean>;\n\t/**\n\t * The credential the integration is connected with, refreshed first when it has expired; `undefined` when it isn't\n\t * connected or the refresh failed. An unexpired token is returned as is, so one the provider has since revoked still\n\t * comes back.\n\t */\n\tgetCredential(source: Sources): Promise<IntegrationCredential | undefined>;\n\tgetIssue(\n\t\tresource: ResourceDescriptor,\n\t\tid: string,\n\t\toptions?: { connectionId?: string; expiryOverride?: boolean | number },\n\t): Promise<Issue | undefined>;\n\tgetLinkedIssueOrPullRequest(\n\t\tresource: ResourceDescriptor,\n\t\tlink: { id: string; key: string },\n\t\toptions?: { expiryOverride?: boolean | number; type?: IssueOrPullRequestType; throwOnError?: boolean },\n\t): Promise<IssueOrPullRequest | undefined>;\n}\n\n/** A git host integration (GitHub, GitLab, Bitbucket, Azure DevOps, and their self-managed variants). */\nexport interface GitHostIntegration extends IntegrationViewBase {\n\treadonly type: 'git';\n\n\t/**\n\t * Removes a queued pull request from its base branch's merge queue, losing its place there. Results, failures and\n\t * cancellation as {@link GitHostIntegration.enqueuePullRequest}.\n\t */\n\tdequeuePullRequest(pr: PullRequest, cancellation?: AbortSignal): Promise<PullRequestMergeQueueActionResult>;\n\tdisconnect(options?: { silent?: boolean; currentSessionOnly?: boolean }): Promise<void>;\n\t/**\n\t * Adds a pull request to its base branch's merge queue (where `mergeQueueRequired` says merging means queueing).\n\t * The result says why on failure: the host's refusal (`already-queued`, `head-changed`, `permission`, …),\n\t * `unsupported` where this host has no merge queue to act on (only GitHub.com's is), or `unknown` for anything\n\t * else, including no connection or a failure to reach the host; the provider's message rides along for logs, not\n\t * for display. Cancellation throws `CancellationError`.\n\t */\n\tenqueuePullRequest(pr: PullRequest, cancellation?: AbortSignal): Promise<PullRequestMergeQueueActionResult>;\n\tgetAccountForCommit(\n\t\trepo: ResourceDescriptor,\n\t\trev: string,\n\t\toptions?: { avatarSize?: number },\n\t): Promise<Account | UnidentifiedAuthor | undefined>;\n\t/** Gets the established local session's cache descriptor for this fetch remote, without resolving or refreshing it. */\n\tgetCachedPullRequestScope?(remoteUrl: string): IntegrationCacheDescriptor | undefined;\n\tgetCurrentAccount(options?: {\n\t\tavatarSize?: number;\n\t\tconnectionId?: string;\n\t\texpiryOverride?: boolean | number;\n\t}): Promise<Account | undefined>;\n\tgetDefaultBranch(\n\t\trepo: ResourceDescriptor,\n\t\toptions?: { cancellation?: AbortSignal; expiryOverride?: boolean | number },\n\t): Promise<DefaultBranch | undefined>;\n\t/**\n\t * Merge-queue entries for the given base branches of the repository, keyed by pull request number, for rows from a\n\t * read that selects no merge queue. Only hosts with a readable merge queue implement this (currently GitHub.com);\n\t * `undefined` means unavailable. Interim: expect it to go once every pull request read can carry its entry.\n\t */\n\tgetMergeQueueEntriesByPullRequestNumber?(\n\t\towner: string,\n\t\trepo: string,\n\t\tbranches: readonly string[],\n\t\tcancellation?: AbortSignal,\n\t): Promise<Map<number, PullRequestMergeQueueEntry> | undefined>;\n\t/**\n\t * The current user's pull requests (or, without `filters`, every pull request) in `reposOrRepoIds`, one page at a\n\t * time; `undefined` when the read failed.\n\t */\n\tgetMyPullRequestsForRepos(\n\t\treposOrRepoIds: ProviderRepositoriesInput,\n\t\toptions?: MyPullRequestsForReposOptions,\n\t\tconnectionId?: string,\n\t): Promise<PagedResult<PullRequest> | undefined>;\n\tgetPullRequest(\n\t\tresource: ResourceDescriptor,\n\t\tid: string,\n\t\toptions?: { expiryOverride?: boolean | number; throwOnError?: boolean },\n\t): Promise<PullRequest | undefined>;\n\tgetPullRequestForBranch(\n\t\trepo: ResourceDescriptor,\n\t\tbranch: string,\n\t\toptions?: {\n\t\t\tavatarSize?: number;\n\t\t\texpiryOverride?: boolean | number;\n\t\t\tinclude?: IssueOrPullRequestState[];\n\t\t\t/**\n\t\t\t * Rethrow a failed lookup instead of folding it into `undefined`, for callers that must tell\n\t\t\t * \"no pull request\" apart from \"couldn't ask\".\n\t\t\t */\n\t\t\tthrowOnError?: boolean;\n\t\t},\n\t): Promise<PullRequest | undefined>;\n\tgetPullRequestForCommit(\n\t\trepo: ResourceDescriptor,\n\t\trev: string,\n\t\toptions?: { expiryOverride?: boolean | number; throwOnError?: boolean },\n\t): Promise<PullRequest | undefined>;\n\tgetPullRequestIdentityFromMaybeUrl(search: string): PullRequestUrlIdentity | undefined;\n\t/**\n\t * The repository a host reports for `repo`, or `undefined` when it can't be read. Only the hosts that can look a\n\t * repository up implement it.\n\t */\n\tgetRepoInfo?(repo: {\n\t\towner: string;\n\t\tname: string;\n\t\tproject?: string;\n\t\tconnectionId?: string;\n\t}): Promise<Pick<ProviderRepositoryShape, 'id' | 'namespace' | 'name' | 'project'> | undefined>;\n\tgetRepositoryMetadata(\n\t\trepo: ResourceDescriptor,\n\t\toptions?: { cancellation?: AbortSignal; expiryOverride?: boolean | number },\n\t): Promise<RepositoryMetadata | undefined>;\n\t/**\n\t * The SSH signing keys (full OpenSSH-format `<type> <key> [comment]` strings) registered by the accounts matching\n\t * `emails`, for building an `allowed_signers` file. Keyed by lowercased email; an email with no match is absent.\n\t * A provider that doesn't expose signing keys (or isn't connected, or fails the read) returns an empty map.\n\t */\n\tgetSshSigningKeysForEmails(repo: ResourceDescriptor, emails: string[]): Promise<Map<string, string[]>>;\n\t/**\n\t * The ordered layers of the stack the given pull request belongs to, bottom to top. `undefined` when the host\n\t * has no stacks concept, the repository isn't enrolled, or the pull request isn't stacked.\n\t */\n\tgetStackLayersForPullRequest?(\n\t\towner: string,\n\t\trepo: string,\n\t\tpullRequestNumber: number,\n\t\tcancellation?: AbortSignal,\n\t): Promise<PullRequestStackLayers | undefined>;\n\t/**\n\t * Stack membership for every stacked pull request in the repository, keyed by pull request number. Only hosts\n\t * with a stacks concept implement this (currently GitHub).\n\t */\n\tgetStacksByPullRequestNumber?(\n\t\towner: string,\n\t\trepo: string,\n\t\tcancellation?: AbortSignal,\n\t): Promise<Map<number, PullRequestStackInfo> | undefined>;\n\tmergePullRequest(\n\t\tpr: PullRequest,\n\t\toptions?: { mergeMethod?: PullRequestMergeMethod },\n\t\tcancellation?: AbortSignal,\n\t): Promise<boolean>;\n\t/** Account-wide (or repo-scoped) search for the current user's pull requests. */\n\tsearchMyPullRequests(\n\t\trepos?: ResourceDescriptor | ResourceDescriptor[],\n\t\tcancellation?: AbortSignal,\n\t\toptions?: SearchMyPullRequestsOptions & { connectionId?: string },\n\t): Promise<IntegrationResult<PullRequest[] | undefined>>;\n\t/** Free-text search across pull requests, optionally narrowed to `repos`. */\n\tsearchPullRequests(\n\t\tsearchQuery: string,\n\t\trepos?: ResourceDescriptor | ResourceDescriptor[],\n\t\tcancellation?: AbortSignal,\n\t\toptions?: SearchPullRequestsOptions & { connectionId?: string },\n\t): Promise<PullRequest[] | undefined>;\n}\n\n/** An issue tracker integration (Jira, Linear, Trello, and their self-managed variants). */\nexport interface IssuesIntegration extends IntegrationViewBase {\n\treadonly type: 'issues';\n}\n\nexport type Integration = GitHostIntegration | IssuesIntegration;\n\nexport type IntegrationById<T extends IntegrationIds> = T extends IssuesHostIntegrationIds\n\t? IssuesIntegration\n\t: GitHostIntegration;\n\n/**\n * What a consumer-owned cache is told about the integration a cached value was read through: enough to key the value\n * by host and to invalidate it when the connection or its credential changes.\n */\nexport interface IntegrationCacheDescriptor {\n\treadonly id: IntegrationIds;\n\treadonly domain?: string;\n\t/** The HTTP(S) origin used by the selected session for this Enterprise pull request read. */\n\treadonly installationOrigin?: string;\n\t/** Whether the integration has a session; `undefined` until it has looked. */\n\treadonly maybeConnected?: boolean;\n\t/** A hash of the current session's token, which changes when the account or token does. */\n\treadonly sessionFingerprint?: string;\n}\n\n/** Whether `value` is an integration. Replaces an `instanceof` check against the internal base class. */\nexport function isIntegration(value: unknown): value is Integration {\n\treturn value instanceof IntegrationBase;\n}\n\n/**\n * Whether `integration` is a git host. Generic so it narrows whatever integration type it is handed: the public\n * {@link Integration} views, or (inside the package) the classes, which implement them.\n */\nexport function isGitHostIntegration<T extends Integration>(\n\tintegration: T,\n): integration is Extract<T, { readonly type: 'git' }> {\n\treturn integration.type === 'git';\n}\n\n/** Whether `integration` is an issue tracker. Generic for the same reason as {@link isGitHostIntegration}. */\nexport function isIssuesIntegration<T extends Integration>(\n\tintegration: T,\n): integration is Extract<T, { readonly type: 'issues' }> {\n\treturn integration.type === 'issues';\n}\n"],"mappings":";;;AA8TA,SAAgB,cAAc,OAAsC;CACnE,OAAO,iBAAiB;AACzB;;;;;AAMA,SAAgB,qBACf,aACsD;CACtD,OAAO,YAAY,SAAS;AAC7B;;AAGA,SAAgB,oBACf,aACyD;CACzD,OAAO,YAAY,SAAS;AAC7B"}
|
|
@@ -6,6 +6,64 @@ export declare enum IssueFilter {
|
|
|
6
6
|
Assignee = "assignee",
|
|
7
7
|
Mention = "mention"
|
|
8
8
|
}
|
|
9
|
+
/**
|
|
10
|
+
* What `getSupportedFilters` (`reads/filters.ts`) reports: every vocabulary a provider's reads can express, so a consumer can
|
|
11
|
+
* narrow to it BEFORE issuing a read. See that function for the capability table itself and why intersecting
|
|
12
|
+
* against this is what keeps a filtered read from being refused.
|
|
13
|
+
*
|
|
14
|
+
* Named rather than written inline, because the same shape is the declared return type of THREE declarations that
|
|
15
|
+
* all describe one value — this function, `IntegrationService.getSupportedFilters`, which only forwards to it, and
|
|
16
|
+
* `IntegrationManager.getSupportedFilters`, which publishes it. Spelled out three times, a member added here
|
|
17
|
+
* reached one of them and left the others a compile error away from the truth; that is exactly how the two sort
|
|
18
|
+
* members below came to be written out three times.
|
|
19
|
+
*/
|
|
20
|
+
export type SupportedFilters = {
|
|
21
|
+
pullRequests: PullRequestFilter[];
|
|
22
|
+
pullRequestsAccountWide: PullRequestFilter[];
|
|
23
|
+
/**
|
|
24
|
+
* Criteria and scopes the filtered pull-request search can express. Always present; an empty relationship list
|
|
25
|
+
* means the provider exposes no filtered pull-request search.
|
|
26
|
+
*/
|
|
27
|
+
pullRequestSearch: PullRequestSearchCapabilities;
|
|
28
|
+
/**
|
|
29
|
+
* Filters the repo-scoped issue read accepts — and, for an issue tracker (Jira/Linear/Trello), its
|
|
30
|
+
* project-scoped read, that being its only issue surface. A tracker therefore reports here and leaves
|
|
31
|
+
* `issuesAccountWide` empty, so intersecting a tracker against that field would read "cannot filter" for a
|
|
32
|
+
* provider that filters fine.
|
|
33
|
+
*/
|
|
34
|
+
issues: IssueFilter[];
|
|
35
|
+
issuesAccountWide: IssueFilter[];
|
|
36
|
+
/**
|
|
37
|
+
* What the filtered issue search (and the count probe over the same criteria) can express. Always present: a
|
|
38
|
+
* provider with no filtered issue search reports an empty `relationships` and all-false flags, which is the
|
|
39
|
+
* signal to hide that surface rather than to hide individual chips.
|
|
40
|
+
*/
|
|
41
|
+
issueSearch: IssueSearchCapabilities;
|
|
42
|
+
/**
|
|
43
|
+
* Sort keys the repo-scoped issue read can express — and, for an issue tracker, its project-scoped read. Empty
|
|
44
|
+
* means the read can't be ordered, so pass no `sort`.
|
|
45
|
+
*
|
|
46
|
+
* A key here is expressible on ONE provider query. A page spanning several repositories or projects is a merge,
|
|
47
|
+
* and a merge can only order by what a normalized issue carries, so `priority`/`dueDate`/`resolved` are refused
|
|
48
|
+
* there even where they are listed. Read one scope at a time to use them.
|
|
49
|
+
*/
|
|
50
|
+
issueSorts: IssueSorting[];
|
|
51
|
+
/**
|
|
52
|
+
* Sort keys the account-wide issue read can express — a different vocabulary, not a subset: for GitLab the two
|
|
53
|
+
* reads are different APIs. Needs no mergeability caveat, because every account-wide read is a union of several
|
|
54
|
+
* queries, so only keys a merge can honor are listed at all. Empty for an issue tracker, which reports under
|
|
55
|
+
* `issueSorts`.
|
|
56
|
+
*/
|
|
57
|
+
issueSortsAccountWide: IssueSorting[];
|
|
58
|
+
/**
|
|
59
|
+
* Whether issue list reads can be asked for a `state` other than open (`closed`, `all`). False means
|
|
60
|
+
* only open issues are readable, and the read refuses the other two rather than serving the open list.
|
|
61
|
+
*
|
|
62
|
+
* Includes Azure DevOps Services and Server list reads. Filtered search reports its independent state
|
|
63
|
+
* capability under `issueSearch.states`.
|
|
64
|
+
*/
|
|
65
|
+
issueStates: boolean;
|
|
66
|
+
};
|
|
9
67
|
//#endregion
|
|
10
68
|
export { type IssueSearchCapabilities, type IssueSearchCriteria, type IssueSearchRelationship, type IssueSortField, type IssueSorting, PullRequestFilter, type PullRequestSearchCapabilities, type PullRequestSearchCriteria, type PullRequestSortField, type PullRequestSorting };
|
|
11
69
|
//# sourceMappingURL=providerFilters.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"providerFilters.js","names":[],"sources":["../../../../plus/integrations/src/providerFilters.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"providerFilters.js","names":[],"sources":["../../../../plus/integrations/src/providerFilters.ts"],"sourcesContent":["import type { IssueSearchCapabilities, IssueSorting } from '@gitlens/git/models/issue.js';\nimport type { PullRequestFilter, PullRequestSearchCapabilities } from '@gitlens/git/models/pullRequest.js';\n\nexport { PullRequestFilter } from '@gitlens/git/models/pullRequest.js';\n\nexport enum IssueFilter {\n\tAuthor = 'author',\n\tAssignee = 'assignee',\n\tMention = 'mention',\n}\n\n/**\n * The filtered issue search's criteria model, re-exported from the git models so it can be reached from here\n * alongside the two filter enums above.\n *\n * It lives in `@gitlens/git` rather than in this package because the provider implementations that translate it\n * to a query — the GitHub API client among them — sit BELOW this package in the dependency graph and can't import\n * from it. {@link IssueSearchRelationship} is a superset of {@link IssueFilter}: it adds the two user-independent\n * relationships (`any-assignee`, `unassigned`) that the user-relative \"my issues\" filters have no way to name.\n */\nexport type {\n\tIssueSearchCapabilities,\n\tIssueSearchCriteria,\n\tIssueSearchRelationship,\n\tIssueSortField,\n\tIssueSorting,\n} from '@gitlens/git/models/issue.js';\n\n/**\n * The filtered pull-request search criteria and its capability table. These live in `@gitlens/git` for the\n * same dependency-direction reason as the issue-search model above: provider API clients translate them below\n * this package and cannot import this facade.\n */\nexport type {\n\tPullRequestSearchCapabilities,\n\tPullRequestSearchCriteria,\n\tPullRequestSortField,\n\tPullRequestSorting,\n} from '@gitlens/git/models/pullRequest.js';\n\n/**\n * What `getSupportedFilters` (`reads/filters.ts`) reports: every vocabulary a provider's reads can express, so a consumer can\n * narrow to it BEFORE issuing a read. See that function for the capability table itself and why intersecting\n * against this is what keeps a filtered read from being refused.\n *\n * Named rather than written inline, because the same shape is the declared return type of THREE declarations that\n * all describe one value — this function, `IntegrationService.getSupportedFilters`, which only forwards to it, and\n * `IntegrationManager.getSupportedFilters`, which publishes it. Spelled out three times, a member added here\n * reached one of them and left the others a compile error away from the truth; that is exactly how the two sort\n * members below came to be written out three times.\n */\nexport type SupportedFilters = {\n\tpullRequests: PullRequestFilter[];\n\tpullRequestsAccountWide: PullRequestFilter[];\n\t/**\n\t * Criteria and scopes the filtered pull-request search can express. Always present; an empty relationship list\n\t * means the provider exposes no filtered pull-request search.\n\t */\n\tpullRequestSearch: PullRequestSearchCapabilities;\n\t/**\n\t * Filters the repo-scoped issue read accepts — and, for an issue tracker (Jira/Linear/Trello), its\n\t * project-scoped read, that being its only issue surface. A tracker therefore reports here and leaves\n\t * `issuesAccountWide` empty, so intersecting a tracker against that field would read \"cannot filter\" for a\n\t * provider that filters fine.\n\t */\n\tissues: IssueFilter[];\n\tissuesAccountWide: IssueFilter[];\n\t/**\n\t * What the filtered issue search (and the count probe over the same criteria) can express. Always present: a\n\t * provider with no filtered issue search reports an empty `relationships` and all-false flags, which is the\n\t * signal to hide that surface rather than to hide individual chips.\n\t */\n\tissueSearch: IssueSearchCapabilities;\n\t/**\n\t * Sort keys the repo-scoped issue read can express — and, for an issue tracker, its project-scoped read. Empty\n\t * means the read can't be ordered, so pass no `sort`.\n\t *\n\t * A key here is expressible on ONE provider query. A page spanning several repositories or projects is a merge,\n\t * and a merge can only order by what a normalized issue carries, so `priority`/`dueDate`/`resolved` are refused\n\t * there even where they are listed. Read one scope at a time to use them.\n\t */\n\tissueSorts: IssueSorting[];\n\t/**\n\t * Sort keys the account-wide issue read can express — a different vocabulary, not a subset: for GitLab the two\n\t * reads are different APIs. Needs no mergeability caveat, because every account-wide read is a union of several\n\t * queries, so only keys a merge can honor are listed at all. Empty for an issue tracker, which reports under\n\t * `issueSorts`.\n\t */\n\tissueSortsAccountWide: IssueSorting[];\n\t/**\n\t * Whether issue list reads can be asked for a `state` other than open (`closed`, `all`). False means\n\t * only open issues are readable, and the read refuses the other two rather than serving the open list.\n\t *\n\t * Includes Azure DevOps Services and Server list reads. Filtered search reports its independent state\n\t * capability under `issueSearch.states`.\n\t */\n\tissueStates: boolean;\n};\n"],"mappings":";;AAKA,IAAY,cAAL,yBAAA,aAAA;CACN,YAAA,YAAA;CACA,YAAA,cAAA;CACA,YAAA,aAAA;;AACD,EAAA,CAAA,CAAA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { PullRequest } from "../../../git/models/pullRequest.js";
|
|
2
|
+
import { ActionablePullRequestAccount, ActionablePullRequestEnrichedItems, ActionablePullRequestFields, ActionablePullRequestInput } from "../models/actionablePullRequest.js";
|
|
3
|
+
//#region ../plus/integrations/src/providers/actionablePullRequests.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* Converts a pull request into the input {@link getActionablePullRequests} categorizes, with the entity-identifier
|
|
6
|
+
* `uuid` that keys its pins and snoozes.
|
|
7
|
+
*/
|
|
8
|
+
export declare function toActionablePullRequestInput(pr: PullRequest): ActionablePullRequestInput;
|
|
9
|
+
/**
|
|
10
|
+
* Categorizes pull requests for the viewer (Launchpad's action categories), using provider-apis' categorizer.
|
|
11
|
+
*
|
|
12
|
+
* Generic so a caller's extra properties survive: the categorizer spreads each input into its output. The casts
|
|
13
|
+
* only cross the SDK's nominal string enums, whose values the neutral types share (see the parity test).
|
|
14
|
+
*/
|
|
15
|
+
export declare function getActionablePullRequests<T extends ActionablePullRequestInput>(pullRequests: T[], viewer: Pick<ActionablePullRequestAccount, 'id'> | null, options?: {
|
|
16
|
+
enrichedItemsByUniqueId?: ActionablePullRequestEnrichedItems;
|
|
17
|
+
}): (T & ActionablePullRequestFields)[];
|
|
18
|
+
//#endregion
|
|
19
|
+
//# sourceMappingURL=actionablePullRequests.d.ts.map
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import "../constants.js";
|
|
2
|
+
import "./pullRequestReviews.js";
|
|
3
|
+
import { GitPullRequestMergeableState as GitPullRequestMergeableState$1, toProviderPullRequest } from "./models.js";
|
|
4
|
+
import { encodeEntityIdentifier, getEntityIdentifierInput } from "./utils.js";
|
|
5
|
+
import { GitProviderUtils } from "@gitkraken/provider-apis";
|
|
6
|
+
//#region ../plus/integrations/src/providers/actionablePullRequests.ts
|
|
7
|
+
/**
|
|
8
|
+
* Converts a pull request into the input {@link getActionablePullRequests} categorizes, with the entity-identifier
|
|
9
|
+
* `uuid` that keys its pins and snoozes.
|
|
10
|
+
*/
|
|
11
|
+
function toActionablePullRequestInput(pr) {
|
|
12
|
+
const { reviews, mergeableState, ...providerPr } = toProviderPullRequest(pr);
|
|
13
|
+
return {
|
|
14
|
+
...providerPr,
|
|
15
|
+
mergeableState: mergeableState ?? (pr.provider.id === "bitbucket" ? GitPullRequestMergeableState$1.Mergeable : GitPullRequestMergeableState$1.Unknown),
|
|
16
|
+
reviews: reviews?.filter((r) => r.state !== "DISMISSED") ?? null,
|
|
17
|
+
uuid: encodeEntityIdentifier(getEntityIdentifierInput(pr))
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Categorizes pull requests for the viewer (Launchpad's action categories), using provider-apis' categorizer.
|
|
22
|
+
*
|
|
23
|
+
* Generic so a caller's extra properties survive: the categorizer spreads each input into its output. The casts
|
|
24
|
+
* only cross the SDK's nominal string enums, whose values the neutral types share (see the parity test).
|
|
25
|
+
*/
|
|
26
|
+
function getActionablePullRequests(pullRequests, viewer, options) {
|
|
27
|
+
return GitProviderUtils.getActionablePullRequests(pullRequests, viewer, options);
|
|
28
|
+
}
|
|
29
|
+
//#endregion
|
|
30
|
+
export { getActionablePullRequests, toActionablePullRequestInput };
|
|
31
|
+
|
|
32
|
+
//# sourceMappingURL=actionablePullRequests.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"actionablePullRequests.js","names":["GitPullRequestMergeableState"],"sources":["../../../../../plus/integrations/src/providers/actionablePullRequests.ts"],"sourcesContent":["import type { GitPullRequestReviewState, PullRequestWithUniqueID } from '@gitkraken/provider-apis';\nimport { GitProviderUtils } from '@gitkraken/provider-apis';\nimport type { PullRequest } from '@gitlens/git/models/pullRequest.js';\nimport { GitCloudHostIntegrationId } from '../constants.js';\nimport type {\n\tActionablePullRequestAccount,\n\tActionablePullRequestEnrichedItems,\n\tActionablePullRequestFields,\n\tActionablePullRequestInput,\n} from '../models/actionablePullRequest.js';\nimport { GitPullRequestMergeableState, toProviderPullRequest } from './models.js';\nimport type { ProviderPullRequestReview } from './pullRequestReviews.js';\nimport { providerPullRequestReviewStateDismissed } from './pullRequestReviews.js';\nimport { encodeEntityIdentifier, getEntityIdentifierInput } from './utils.js';\n\n// Launchpad's categorization over provider-apis' categorizer. Kept apart from `models.ts` so the public facade can\n// re-export these: their signatures are in the neutral `ActionablePullRequest*` types, and the SDK stays an\n// implementation detail of this module.\n\n/**\n * Converts a pull request into the input {@link getActionablePullRequests} categorizes, with the entity-identifier\n * `uuid` that keys its pins and snoozes.\n */\nexport function toActionablePullRequestInput(pr: PullRequest): ActionablePullRequestInput {\n\tconst { reviews, mergeableState, ...providerPr } = toProviderPullRequest(pr);\n\t// Built as the SDK's own type, which the neutral one mirrors, so a field the SDK requires can't go missing.\n\tconst input: PullRequestWithUniqueID = {\n\t\t...providerPr,\n\t\t// The SDK's type requires a mergeability, and its categorizer only acts on a known one, so an unfetched\n\t\t// one goes over as its own `UNKNOWN`. Except on Bitbucket Cloud, which reports no mergeability at all:\n\t\t// Launchpad's \"Ready to merge\" needs one, so its rows go over as `MERGEABLE`, as provider-apis' own\n\t\t// Bitbucket rows already do.\n\t\tmergeableState:\n\t\t\tmergeableState ??\n\t\t\t(pr.provider.id === GitCloudHostIntegrationId.Bitbucket\n\t\t\t\t? GitPullRequestMergeableState.Mergeable\n\t\t\t\t: GitPullRequestMergeableState.Unknown),\n\t\t// The SDK boundary: `getActionablePullRequests` categorizes by review state and only knows\n\t\t// provider-apis' own vocabulary, so the locally-added dismissed state is dropped here rather than\n\t\t// handed over as a value it would fall through on. Our own projection keeps it — see\n\t\t// `providerPullRequestReviewStateDismissed`. `commitOid` rides along on the surviving reviews: it is an\n\t\t// extra property the SDK ignores, not a value it could misread.\n\t\treviews:\n\t\t\treviews?.filter(\n\t\t\t\t(r): r is ProviderPullRequestReview & { state: GitPullRequestReviewState } =>\n\t\t\t\t\tr.state !== providerPullRequestReviewStateDismissed,\n\t\t\t) ?? null,\n\t\tuuid: encodeEntityIdentifier(getEntityIdentifierInput(pr)),\n\t};\n\treturn input;\n}\n\n/**\n * Categorizes pull requests for the viewer (Launchpad's action categories), using provider-apis' categorizer.\n *\n * Generic so a caller's extra properties survive: the categorizer spreads each input into its output. The casts\n * only cross the SDK's nominal string enums, whose values the neutral types share (see the parity test).\n */\nexport function getActionablePullRequests<T extends ActionablePullRequestInput>(\n\tpullRequests: T[],\n\tviewer: Pick<ActionablePullRequestAccount, 'id'> | null,\n\toptions?: { enrichedItemsByUniqueId?: ActionablePullRequestEnrichedItems },\n): (T & ActionablePullRequestFields)[] {\n\treturn GitProviderUtils.getActionablePullRequests(\n\t\tpullRequests as unknown as PullRequestWithUniqueID[],\n\t\tviewer,\n\t\toptions,\n\t) as unknown as (T & ActionablePullRequestFields)[];\n}\n"],"mappings":";;;;;;;;;;AAuBA,SAAgB,6BAA6B,IAA6C;CACzF,MAAM,EAAE,SAAS,gBAAgB,GAAG,eAAe,sBAAsB,EAAE;CAyB3E,OAAO;EAtBN,GAAG;EAKH,gBACC,mBACC,GAAG,SAAS,OAAA,cACVA,+BAA6B,YAC7BA,+BAA6B;EAMjC,SACC,SAAS,QACP,MACA,EAAE,UAAA,WACJ,KAAK;EACN,MAAM,uBAAuB,yBAAyB,EAAE,CAAC;CAE/C;AACZ;;;;;;;AAQA,SAAgB,0BACf,cACA,QACA,SACsC;CACtC,OAAO,iBAAiB,0BACvB,cACA,QACA,OACD;AACD"}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { Disposable } from "../../../utils/disposable.js";
|
|
2
2
|
import { GitHubApi } from "../../git-github/api/github.js";
|
|
3
|
+
import { IntegrationServiceContext } from "../context.js";
|
|
3
4
|
import { AzureWorkItemStatesCache } from "./azure/workItemStateCategories.js";
|
|
4
5
|
import { AzureWorkItemDescriptionsCache } from "./azure/workItemDescriptions.js";
|
|
5
6
|
import { AzureDevOpsApi } from "./azure/azure.js";
|
|
6
7
|
import { BitbucketApi } from "./bitbucket/bitbucket.js";
|
|
7
|
-
import "./github/github.js";
|
|
8
8
|
import { GitLabApi } from "./gitlab/gitlab.js";
|
|
9
|
-
import { IntegrationServiceContext } from "../context.js";
|
|
10
9
|
//#region ../plus/integrations/src/providers/apiClients.d.ts
|
|
11
10
|
/**
|
|
12
11
|
* The per-provider API clients, owned and built by the package. `GitLabApi`/`BitbucketApi`/`AzureDevOpsApi`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apiClients.js","names":[],"sources":["../../../../../plus/integrations/src/providers/apiClients.ts"],"sourcesContent":["import type { Disposable } from '@gitlens/utils/disposable.js';\nimport { getScopedLogger } from '@gitlens/utils/logger.scoped.js';\nimport type { IntegrationServiceContext } from '../context.js';\nimport type { AzureDevOpsApi } from './azure/azure.js';\nimport { AzureWorkItemDescriptionsCache } from './azure/workItemDescriptions.js';\nimport { AzureWorkItemStatesCache } from './azure/workItemStateCategories.js';\nimport type { BitbucketApi } from './bitbucket/bitbucket.js';\nimport type {
|
|
1
|
+
{"version":3,"file":"apiClients.js","names":[],"sources":["../../../../../plus/integrations/src/providers/apiClients.ts"],"sourcesContent":["import type { GitHubApi } from '@gitlens/git-github/api/github.js';\nimport type { Disposable } from '@gitlens/utils/disposable.js';\nimport { getScopedLogger } from '@gitlens/utils/logger.scoped.js';\nimport type { IntegrationServiceContext } from '../context.js';\nimport type { AzureDevOpsApi } from './azure/azure.js';\nimport { AzureWorkItemDescriptionsCache } from './azure/workItemDescriptions.js';\nimport { AzureWorkItemStatesCache } from './azure/workItemStateCategories.js';\nimport type { BitbucketApi } from './bitbucket/bitbucket.js';\nimport type { GitLabApi } from './gitlab/gitlab.js';\n\n/**\n * The per-provider API clients, owned and built by the package. `GitLabApi`/`BitbucketApi`/`AzureDevOpsApi`\n * live in the package; `GitHubApi` comes from `@gitlens/git-github` (shared with the host's GitHub git\n * provider, which reads the manager's memoized instance via `manager.github`). `undefined` is tolerated for\n * offline/limited runtimes.\n */\nexport interface ApiClients {\n\treadonly azureWorkItemStates: AzureWorkItemStatesCache;\n\treadonly azureWorkItemDescriptions: AzureWorkItemDescriptionsCache;\n\treadonly github: Promise<GitHubApi | undefined>;\n\treadonly gitlab: Promise<GitLabApi | undefined>;\n\treadonly gitlabIfBuilt?: Promise<GitLabApi | undefined>;\n\treadonly bitbucket: Promise<BitbucketApi | undefined>;\n\treadonly azure: Promise<AzureDevOpsApi | undefined>;\n}\n\n/**\n * Lazily constructs + memoizes the API clients from the runtime context, pushing each to `disposables` for\n * teardown. Mirrors the lazy-chunked construction the host's `Container` did before the package took\n * ownership (the host used to build these and inject them back through the context — a pure round-trip).\n */\nexport function createApiClients(ctx: IntegrationServiceContext, disposables: Disposable[]): ApiClients {\n\tconst azureWorkItemStates = new AzureWorkItemStatesCache();\n\tconst azureWorkItemDescriptions = new AzureWorkItemDescriptionsCache();\n\tdisposables.push(\n\t\tctx.config.onDidChange(e => {\n\t\t\tif (e.httpProxy) {\n\t\t\t\tazureWorkItemStates.clear();\n\t\t\t\tazureWorkItemDescriptions.clear();\n\t\t\t}\n\t\t}),\n\t\t{\n\t\t\tdispose: () => {\n\t\t\t\tazureWorkItemStates.clear();\n\t\t\t\tazureWorkItemDescriptions.clear();\n\t\t\t},\n\t\t},\n\t);\n\tlet github: Promise<GitHubApi | undefined> | undefined;\n\tlet gitlab: Promise<GitLabApi | undefined> | undefined;\n\tlet bitbucket: Promise<BitbucketApi | undefined> | undefined;\n\tlet azure: Promise<AzureDevOpsApi | undefined> | undefined;\n\n\tconst build = async <T extends Disposable>(load: () => Promise<T>): Promise<T | undefined> => {\n\t\tconst scope = getScopedLogger();\n\t\ttry {\n\t\t\tconst api = await load();\n\t\t\tdisposables.push(api);\n\t\t\treturn api;\n\t\t} catch (ex) {\n\t\t\tscope?.error(ex, 'Failed to construct integration API client');\n\t\t\treturn undefined;\n\t\t}\n\t};\n\n\treturn {\n\t\tazureWorkItemStates: azureWorkItemStates,\n\t\tazureWorkItemDescriptions: azureWorkItemDescriptions,\n\t\tget github() {\n\t\t\treturn (github ??= build(async () =>\n\t\t\t\t(await import(/* webpackChunkName: \"integrations\" */ './github/github.js')).createGitHubApi(ctx),\n\t\t\t));\n\t\t},\n\t\tget gitlab() {\n\t\t\treturn (gitlab ??= build(async () =>\n\t\t\t\t(await import(/* webpackChunkName: \"integrations\" */ './gitlab/gitlab.js')).createGitLabApi(ctx),\n\t\t\t));\n\t\t},\n\t\tget gitlabIfBuilt() {\n\t\t\treturn gitlab;\n\t\t},\n\t\tget bitbucket() {\n\t\t\treturn (bitbucket ??= build(async () =>\n\t\t\t\t(await import(/* webpackChunkName: \"integrations\" */ './bitbucket/bitbucket.js')).createBitbucketApi(\n\t\t\t\t\tctx,\n\t\t\t\t),\n\t\t\t));\n\t\t},\n\t\tget azure() {\n\t\t\treturn (azure ??= build(async () =>\n\t\t\t\t(await import(/* webpackChunkName: \"integrations\" */ './azure/azure.js')).createAzureDevOpsApi(\n\t\t\t\t\tctx,\n\t\t\t\t\tazureWorkItemStates,\n\t\t\t\t\tazureWorkItemDescriptions,\n\t\t\t\t),\n\t\t\t));\n\t\t},\n\t};\n}\n"],"mappings":";;;;;;;;;AA+BA,SAAgB,iBAAiB,KAAgC,aAAuC;CACvG,MAAM,sBAAsB,IAAI,yBAAyB;CACzD,MAAM,4BAA4B,IAAI,+BAA+B;CACrE,YAAY,KACX,IAAI,OAAO,aAAY,MAAK;EAC3B,IAAI,EAAE,WAAW;GAChB,oBAAoB,MAAM;GAC1B,0BAA0B,MAAM;EACjC;CACD,CAAC,GACD,EACC,eAAe;EACd,oBAAoB,MAAM;EAC1B,0BAA0B,MAAM;CACjC,EACD,CACD;CACA,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CAEJ,MAAM,QAAQ,OAA6B,SAAmD;EAC7F,MAAM,QAAQ,gBAAgB;EAC9B,IAAI;GACH,MAAM,MAAM,MAAM,KAAK;GACvB,YAAY,KAAK,GAAG;GACpB,OAAO;EACR,SAAS,IAAI;GACZ,OAAO,MAAM,IAAI,4CAA4C;GAC7D;EACD;CACD;CAEA,OAAO;EACe;EACM;EAC3B,IAAI,SAAS;GACZ,OAAQ,WAAW,MAAM,aACvB,MAAM;;IAA8C;EAAqB,CAAE,gBAAgB,GAAG,CAChG;EACD;EACA,IAAI,SAAS;GACZ,OAAQ,WAAW,MAAM,aACvB,MAAM;;IAA8C;EAAqB,CAAE,gBAAgB,GAAG,CAChG;EACD;EACA,IAAI,gBAAgB;GACnB,OAAO;EACR;EACA,IAAI,YAAY;GACf,OAAQ,cAAc,MAAM,aAC1B,MAAM;;IAA8C;EAA2B,CAAE,mBACjF,GACD,CACD;EACD;EACA,IAAI,QAAQ;GACX,OAAQ,UAAU,MAAM,aACtB,MAAM;;IAA8C;EAAmB,CAAE,qBACzE,KACA,qBACA,yBACD,CACD;EACD;CACD;AACD"}
|
|
@@ -4,10 +4,11 @@ import { Issue, IssueShape } from "../../../git/models/issue.js";
|
|
|
4
4
|
import { Account } from "../../../git/models/author.js";
|
|
5
5
|
import { ProviderAuthenticationSession } from "../authentication/models.js";
|
|
6
6
|
import { IssuesCloudHostIntegrationId } from "../constants.js";
|
|
7
|
-
import {
|
|
7
|
+
import { IntegrationAuthenticationProviderDescriptor } from "../authentication/integrationAuthenticationProvider.js";
|
|
8
|
+
import { ProviderMetadata } from "./metadata.js";
|
|
8
9
|
import { AccountWideIssuesResult, IssuesForProjectOptions, ProjectIssuesDrain, ProjectIssuesRequest, SearchMyIssuesOptions } from "../models/issueReads.js";
|
|
9
10
|
import { IssuesIntegration } from "../models/issuesIntegration.js";
|
|
10
|
-
import {
|
|
11
|
+
import { ProviderApiCollectionResult } from "./models.js";
|
|
11
12
|
//#region ../plus/integrations/src/providers/asana.d.ts
|
|
12
13
|
declare const metadata: ProviderMetadata & {
|
|
13
14
|
id: IssuesCloudHostIntegrationId.Asana;
|
|
@@ -5,8 +5,9 @@ import { isIssueResourceDescriptor } from "../../../git/utils/resourceDescriptor
|
|
|
5
5
|
import { IntegrationReadUnavailableError, toError } from "../errors.js";
|
|
6
6
|
import { throwIfCallerContractError, toCollectionScopeFailure } from "../collectionMetadata.js";
|
|
7
7
|
import { collectProviderPagedResult, mergeCollectionMetadata } from "./utils/providerPaging.js";
|
|
8
|
-
import {
|
|
8
|
+
import { providersMetadata } from "./metadata.js";
|
|
9
9
|
import { toTokenWithInfo } from "../authentication/models.js";
|
|
10
|
+
import { fromProviderIssue, toIssueProviderState, toIssueShape, toProviderIssueStates } from "./models.js";
|
|
10
11
|
import { IssuesIntegration, groupProjectIssuesSearches } from "../models/issuesIntegration.js";
|
|
11
12
|
//#region ../plus/integrations/src/providers/asana.ts
|
|
12
13
|
const metadata = providersMetadata.asana;
|