@gitkraken/core-gitlens 0.44.0 → 0.46.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 +34 -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/github.d.ts +13 -1
- package/dist/plus/git-github/api/github.js +99 -30
- package/dist/plus/git-github/api/github.js.map +1 -1
- package/dist/plus/git-github/api/issueWrites.d.ts +9 -2
- package/dist/plus/git-github/api/issueWrites.js +61 -31
- package/dist/plus/git-github/api/issueWrites.js.map +1 -1
- package/dist/plus/git-github/api/pullRequestWrites.d.ts +95 -0
- package/dist/plus/git-github/api/pullRequestWrites.js +469 -0
- package/dist/plus/git-github/api/pullRequestWrites.js.map +1 -0
- 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 +17 -9
- package/dist/plus/integrations/authentication/configuredIntegrationService.js +71 -19
- package/dist/plus/integrations/authentication/configuredIntegrationService.js.map +1 -1
- package/dist/plus/integrations/authentication/integrationAuthenticationProvider.d.ts +9 -40
- package/dist/plus/integrations/authentication/integrationAuthenticationProvider.js +0 -182
- package/dist/plus/integrations/authentication/integrationAuthenticationService.d.ts +5 -2
- package/dist/plus/integrations/authentication/integrationAuthenticationService.js +15 -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/authentication/observedAuthenticationProvider.d.ts +1 -0
- package/dist/plus/integrations/authentication/observedAuthenticationProvider.js +14 -4
- package/dist/plus/integrations/authentication/observedAuthenticationProvider.js.map +1 -1
- package/dist/plus/integrations/authentication/rejectedTokenTracker.d.ts +2 -2
- package/dist/plus/integrations/authentication/rejectedTokenTracker.js +19 -5
- package/dist/plus/integrations/authentication/rejectedTokenTracker.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 +13 -13
- package/dist/plus/integrations/index.d.ts +41 -25
- package/dist/plus/integrations/index.js +40 -8
- package/dist/plus/integrations/index.js.map +1 -1
- package/dist/plus/integrations/integrationService.d.ts +20 -22
- package/dist/plus/integrations/integrationService.js +80 -9
- 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 +70 -15
- 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 +15 -4
- package/dist/plus/integrations/models/gitHostIntegration.js.map +1 -1
- package/dist/plus/integrations/models/integration.d.ts +12 -177
- package/dist/plus/integrations/models/integration.js +21 -77
- package/dist/plus/integrations/models/integration.js.map +1 -1
- 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 +252 -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 +16 -6
- package/dist/plus/integrations/providers/github.js +109 -12
- 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 +0 -1
- 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 +3 -2
- package/dist/plus/integrations/providers/jira.js.map +1 -1
- package/dist/plus/integrations/providers/jiraIssueByKey.d.ts +1 -1
- package/dist/plus/integrations/providers/jiraIssueByKey.js.map +1 -1
- 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 +3 -2
- package/dist/plus/integrations/providers/providersApi.js +2 -1
- 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 +3 -4
- 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 +1 -6
- package/dist/plus/integrations/utils/integration.utils.js +2 -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 +135 -16
- package/package.json +5 -1
- package/dist/plus/integrations/authentication/integrationAuthenticationProvider.js.map +0 -1
- package/dist/plus/integrations/telemetry.js.map +0 -1
|
@@ -2,42 +2,31 @@ import { Disposable } from "../../../utils/disposable.js";
|
|
|
2
2
|
import { Emitter, Event } from "../../../utils/event.js";
|
|
3
3
|
import { ResourceDescriptor } from "../../../git/models/resourceDescriptor.js";
|
|
4
4
|
import { AutolinkReference, DynamicAutolinkReference } from "../../../git/models/autolink.js";
|
|
5
|
-
import { IssueOrPullRequest,
|
|
6
|
-
import { Issue as Issue$1, IssueShape
|
|
7
|
-
import { PullRequest
|
|
5
|
+
import { IssueOrPullRequest, IssueOrPullRequestType } from "../../../git/models/issueOrPullRequest.js";
|
|
6
|
+
import { Issue as Issue$1, IssueShape } from "../../../git/models/issue.js";
|
|
7
|
+
import { PullRequest } from "../../../git/models/pullRequest.js";
|
|
8
8
|
import { ScopedLogger } from "../../../utils/logger.scoped.js";
|
|
9
9
|
import { Account as Account$1 } from "../../../git/models/author.js";
|
|
10
10
|
import { ConnectionResource, ProviderAuthenticationSession, SessionPublication } from "../authentication/models.js";
|
|
11
|
-
import {
|
|
11
|
+
import { IntegrationIds, IssuesHostIntegrationIds } from "../constants.js";
|
|
12
12
|
import { Sources } from "../telemetry.js";
|
|
13
|
+
import { IntegrationAuthenticationProviderDescriptor, IntegrationAuthenticationSessionDescriptor } from "../authentication/integrationAuthenticationProvider.js";
|
|
13
14
|
import { ProviderWarningCause, ProviderWarningScope } from "../results.js";
|
|
15
|
+
import { IntegrationCredential, IntegrationKey, IntegrationResult, IntegrationType } from "./publicIntegration.js";
|
|
16
|
+
import { IntegrationServiceContext } from "../context.js";
|
|
14
17
|
import { ProviderRefusal, ProviderScopeFailure } from "../collectionMetadata.js";
|
|
15
18
|
import { ProviderPullRequestCount, ProviderPullRequestSearchPage } from "./pullRequestReads.js";
|
|
16
19
|
import { ProvidersApi } from "../providers/providersApi.js";
|
|
17
20
|
import { FailureBackoff } from "../utils/failureBackoff.js";
|
|
18
21
|
import { AccountWideIssuesResult, ProviderIssueSearchPage, ProviderSearchCount, SearchMyIssuesOptions } from "./issueReads.js";
|
|
19
|
-
import { GitHostIntegration } from "./gitHostIntegration.js";
|
|
20
22
|
import { IssuesIntegration } from "./issuesIntegration.js";
|
|
23
|
+
import { GitHostIntegration } from "./gitHostIntegration.js";
|
|
21
24
|
import { IntegrationConnectionChangeEvent } from "../integrationService.js";
|
|
22
25
|
import { IntegrationAuthenticationService } from "../authentication/integrationAuthenticationService.js";
|
|
23
|
-
import { IntegrationAuthenticationProviderDescriptor, IntegrationAuthenticationSessionDescriptor } from "../authentication/integrationAuthenticationProvider.js";
|
|
24
|
-
import { IntegrationServiceContext } from "../context.js";
|
|
25
26
|
import { CollectionMetadata } from "@gitkraken/provider-apis";
|
|
26
27
|
//#region ../plus/integrations/src/models/integration.d.ts
|
|
27
28
|
export type Integration = GitHostIntegration | IssuesIntegration;
|
|
28
29
|
export type IntegrationById<T extends IntegrationIds> = T extends IssuesHostIntegrationIds ? IssuesIntegration : GitHostIntegration;
|
|
29
|
-
export type IntegrationType = 'git' | 'issues';
|
|
30
|
-
export type IntegrationKey<T extends IntegrationIds = IntegrationIds> = T extends GitCloudHostIntegrationId | IssuesCloudHostIntegrationId ? `${T}` : `${T}:${string}`;
|
|
31
|
-
export type IntegrationConnectedKey<T extends IntegrationIds = IntegrationIds> = `connected:${IntegrationKey<T>}`;
|
|
32
|
-
export type IntegrationResult<T> = {
|
|
33
|
-
value: T;
|
|
34
|
-
duration?: number;
|
|
35
|
-
error?: Error;
|
|
36
|
-
} | {
|
|
37
|
-
error: Error;
|
|
38
|
-
duration?: number;
|
|
39
|
-
value?: never;
|
|
40
|
-
} | undefined;
|
|
41
30
|
/** A per-connection read's session that could not be resolved for a retryable reason (see `resolveReadSession`). */
|
|
42
31
|
export declare class ReadSessionFailure {
|
|
43
32
|
readonly error: Error;
|
|
@@ -51,162 +40,6 @@ export declare function isReadSessionFailure(session: ProviderAuthenticationSess
|
|
|
51
40
|
export type BatchSlot<T> = PromiseFulfilledResult<T> | (PromiseRejectedResult & {
|
|
52
41
|
failure?: ProviderScopeFailure;
|
|
53
42
|
});
|
|
54
|
-
/**
|
|
55
|
-
* An input a pull request's etag can be widened to, each of which a host changes without moving `updatedAt`. Every
|
|
56
|
-
* entry costs its own fields in the cheap check, so a caller picks only the ones it needs. `'checks'` is the check
|
|
57
|
-
* rollup.
|
|
58
|
-
*/
|
|
59
|
-
export type PullRequestEtagInclude = 'mergeable' | 'reviewDecision' | 'checks';
|
|
60
|
-
/** Every {@link PullRequestEtagInclude}, in the canonical order an etag lists them in. */
|
|
61
|
-
export declare const pullRequestEtagIncludes: readonly PullRequestEtagInclude[];
|
|
62
|
-
/**
|
|
63
|
-
* The change state a batch read's etag is computed from (see `reads/etag.ts`), in the NORMALIZED vocabulary of
|
|
64
|
-
* `PullRequestShape` — the values a full row carries after its provider's whole conversion chain, so a cheap
|
|
65
|
-
* check and a full read of the same pull request yield the same fields. Each of `mergeableState`, `reviewDecision`
|
|
66
|
-
* and `statusCheckRollupState` counts only when its {@link PullRequestEtagInclude} is requested.
|
|
67
|
-
*/
|
|
68
|
-
export interface PullRequestEtagFields {
|
|
69
|
-
state: IssueOrPullRequestState;
|
|
70
|
-
isDraft?: boolean;
|
|
71
|
-
updatedDate: Date;
|
|
72
|
-
headSha?: string;
|
|
73
|
-
mergeableState?: PullRequestMergeableState;
|
|
74
|
-
reviewDecision?: PullRequestReviewDecision;
|
|
75
|
-
statusCheckRollupState?: PullRequestStatusCheckRollupState;
|
|
76
|
-
/**
|
|
77
|
-
* A fingerprint of the fields a host changes without moving an update time ({@link pullRequestRevision}); set
|
|
78
|
-
* only for hosts that keep none (Azure DevOps and Server). Part of the etag whenever it is set, not an include.
|
|
79
|
-
*/
|
|
80
|
-
revision?: string;
|
|
81
|
-
/**
|
|
82
|
-
* A full row marked `viewerUnresolved`, which no cheap check ever sets: such a row never compares unchanged, so it
|
|
83
|
-
* is read in full again rather than kept without a viewer until the pull request changes.
|
|
84
|
-
*/
|
|
85
|
-
viewerUnresolved?: true;
|
|
86
|
-
/**
|
|
87
|
-
* The pull request's merge-queue entry, as far as the etag reads it: whether it's queued, in which state and since
|
|
88
|
-
* when, none of which moves `updatedDate`. Part of the etag whenever it is set, not an include, and set only on a
|
|
89
|
-
* queued pull request, so every other pull request's etag is unchanged by it. Read only where the queue is
|
|
90
|
-
* (github.com).
|
|
91
|
-
*/
|
|
92
|
-
mergeQueue?: Pick<PullRequestMergeQueueEntry, 'state' | 'enqueuedAt'>;
|
|
93
|
-
/**
|
|
94
|
-
* When the pull request's `mergeQueueRemoval` happened, set only while it has one. Like `mergeQueue`, part of the
|
|
95
|
-
* etag whenever it is set, not an include: a pull request that joins its queue and is removed between two checks
|
|
96
|
-
* moves neither its update time nor, at either check, `mergeQueue`.
|
|
97
|
-
*/
|
|
98
|
-
mergeQueueRemovedAt?: Date;
|
|
99
|
-
/**
|
|
100
|
-
* The read selected merge-queue data (GitHub.com, for a read that asks for it or a host that opts in), whatever
|
|
101
|
-
* that data says. Part of the etag whenever it is set, as a marker: without it a pull request that isn't queued and
|
|
102
|
-
* has no removal computes the etag it has without the data, so a host that starts asking for the data would keep a
|
|
103
|
-
* held row lacking it as `unchanged`. A full row sets it from its `mergeQueueRequired`, which only a read that
|
|
104
|
-
* selected the data carries; a cheap check sets it from the same selection.
|
|
105
|
-
*/
|
|
106
|
-
mergeQueueRead?: true;
|
|
107
|
-
/**
|
|
108
|
-
* The head's checks, from {@link pullRequestCheckRunsEtag}, set whenever the read selected check runs (a count of 0
|
|
109
|
-
* when the head has none), so it also marks such a read, as {@link mergeQueueRead} does.
|
|
110
|
-
*/
|
|
111
|
-
checkRuns?: PullRequestCheckRunsEtag;
|
|
112
|
-
}
|
|
113
|
-
/** A head's checks, as a pull request's etag reads them. */
|
|
114
|
-
export interface PullRequestCheckRunsEtag {
|
|
115
|
-
/** A 64-bit hash of each check's id, kind, name, status and conclusion, in id order. */
|
|
116
|
-
readonly hash: string;
|
|
117
|
-
readonly count: number;
|
|
118
|
-
/** The head has checks the read lacks (the row's `checkRunsTruncated`). */
|
|
119
|
-
readonly truncated: boolean;
|
|
120
|
-
}
|
|
121
|
-
/**
|
|
122
|
-
* {@link PullRequestEtagFields.checkRuns}, which the cheap check and the full read build alike from the same fields.
|
|
123
|
-
* Hashed to keep the etag short at any number of checks, so a collision is the only way a change can hide, at about
|
|
124
|
-
* 2^-64.
|
|
125
|
-
*/
|
|
126
|
-
export declare function pullRequestCheckRunsEtag(runs: readonly Pick<PullRequestCheckRun, 'id' | 'kind' | 'name' | 'status' | 'conclusion'>[], truncated: boolean): PullRequestCheckRunsEtag;
|
|
127
|
-
/**
|
|
128
|
-
* The fields of a pull request {@link pullRequestRevision} reads, as a full row carries them. A `PullRequestShape`
|
|
129
|
-
* is one, so a full read passes its row as is and a cheap check builds one from the same mapped values.
|
|
130
|
-
*/
|
|
131
|
-
export interface PullRequestRevisionSource {
|
|
132
|
-
readonly title: string;
|
|
133
|
-
readonly body?: string;
|
|
134
|
-
readonly refs?: {
|
|
135
|
-
readonly base: {
|
|
136
|
-
readonly branch: string;
|
|
137
|
-
};
|
|
138
|
-
};
|
|
139
|
-
readonly reviewRequests?: readonly PullRequestRevisionReviewer[];
|
|
140
|
-
readonly latestReviews?: readonly PullRequestRevisionReviewer[];
|
|
141
|
-
}
|
|
142
|
-
interface PullRequestRevisionReviewer {
|
|
143
|
-
readonly reviewer: {
|
|
144
|
-
readonly id: string;
|
|
145
|
-
};
|
|
146
|
-
readonly state: PullRequestReviewState;
|
|
147
|
-
}
|
|
148
|
-
/**
|
|
149
|
-
* {@link PullRequestEtagFields.revision}: a 64-bit hash of a pull request's title, description, target branch and
|
|
150
|
-
* reviewers (each one's id and review state, in a canonical order). Hashed to keep the etag short, so a collision is
|
|
151
|
-
* the only way a change can hide, at about 2^-64.
|
|
152
|
-
*/
|
|
153
|
-
export declare function pullRequestRevision(pr: PullRequestRevisionSource): string;
|
|
154
|
-
/**
|
|
155
|
-
* An input an issue's etag can be widened to, which a host changes without moving `updatedAt`. `'reactions'` is the
|
|
156
|
-
* thumbs-up count, and widens the etag only on hosts whose rows really fetch one (GitHub/GHE and GitLab).
|
|
157
|
-
*/
|
|
158
|
-
export type IssueEtagInclude = 'reactions';
|
|
159
|
-
/** Every {@link IssueEtagInclude}, in the canonical order an etag lists them in. */
|
|
160
|
-
export declare const issueEtagIncludes: readonly IssueEtagInclude[];
|
|
161
|
-
/** The issue twin of {@link PullRequestEtagFields}, in {@link IssueShape}'s normalized vocabulary. */
|
|
162
|
-
export interface IssueEtagFields {
|
|
163
|
-
state: IssueOrPullRequestState | undefined;
|
|
164
|
-
updatedDate: Date;
|
|
165
|
-
/** Counts only when `'reactions'` is requested, and only from a row whose read fetched reactions. */
|
|
166
|
-
thumbsUpCount?: number;
|
|
167
|
-
/**
|
|
168
|
-
* Azure DevOps only: the version of the rule a work item's body is read by ({@link azureWorkItemDescriptionRule}).
|
|
169
|
-
* A change of rule changes the body without moving `updatedDate`, so a row read under an earlier one must not
|
|
170
|
-
* compare unchanged.
|
|
171
|
-
*/
|
|
172
|
-
descriptionRule?: number;
|
|
173
|
-
/**
|
|
174
|
-
* Azure DevOps only: the version of the rule a work item's `viewer` is set by ({@link azureWorkItemViewerRule}).
|
|
175
|
-
* A full row that names someone but got no viewer (its organization's identity couldn't be read) leaves it out, so
|
|
176
|
-
* it never compares unchanged and is read in full again rather than kept without one.
|
|
177
|
-
*/
|
|
178
|
-
viewerRule?: number;
|
|
179
|
-
/**
|
|
180
|
-
* Linear only: the row's `syncedWith` links as {@link linearSyncedWithEtagKeys} spells them, so a link added, removed
|
|
181
|
-
* or moved to other coordinates changes the etag whether or not the issue's update time moves. `null` on a
|
|
182
|
-
* full row without `syncedWith` (held from before it existed, or read while Linear failed to resolve it), which
|
|
183
|
-
* never compares unchanged with a cheap check's list.
|
|
184
|
-
*/
|
|
185
|
-
syncedWithKeys?: readonly string[] | null;
|
|
186
|
-
}
|
|
187
|
-
/**
|
|
188
|
-
* {@link IssueEtagFields.descriptionRule}: the version of the rule an Azure DevOps work item's body is read by, stamped
|
|
189
|
-
* on both sides of its etag. Bumped whenever the rule changes which field a work item's body comes from, so every row
|
|
190
|
-
* a caller holds from before is read in full once. 1: the first rich text field with content (provider-apis'
|
|
191
|
-
* `getAzureWorkItemDescription`), where it used to be only Description. The rule lives in provider-apis, so a bump of
|
|
192
|
-
* that package that changes it must bump this too; the etag tests pin the rule to catch one.
|
|
193
|
-
*
|
|
194
|
-
* It can't cover a row whose read found the organization's field catalog unavailable: that row's body falls back to
|
|
195
|
-
* the built-in fields, and a cheap check, which reads no body, can't tell it from a complete one, so it stays as read
|
|
196
|
-
* until the work item changes.
|
|
197
|
-
*/
|
|
198
|
-
export declare const azureWorkItemDescriptionRule = 1;
|
|
199
|
-
/**
|
|
200
|
-
* {@link IssueEtagFields.viewerRule}: the version of the rule an Azure DevOps work item's `viewer` is set by, stamped
|
|
201
|
-
* on both sides of its etag, so every row a caller holds from before it was set is read in full once. 1: the user's
|
|
202
|
-
* identity in the work item's organization (gitkraken/kepler#4291).
|
|
203
|
-
*/
|
|
204
|
-
export declare const azureWorkItemViewerRule = 1;
|
|
205
|
-
/**
|
|
206
|
-
* A Linear row's sync links in its etag, sorted: each as its GitHub id and, when known, the coordinates a host matches
|
|
207
|
-
* the GitHub row by, so a link whose coordinates Linear fills in or changes later compares changed.
|
|
208
|
-
*/
|
|
209
|
-
export declare function linearSyncedWithEtagKeys(links: readonly IssueSyncedWith[]): string[];
|
|
210
43
|
/** A batch read's target, in the form its provider addresses it by: a repository coordinate, or a tracker's resource. */
|
|
211
44
|
type BatchTarget = {
|
|
212
45
|
owner: string;
|
|
@@ -215,7 +48,7 @@ type BatchTarget = {
|
|
|
215
48
|
} | {
|
|
216
49
|
resourceId: string;
|
|
217
50
|
};
|
|
218
|
-
type SyncReqUsecase = Exclude<'getAccountForCommit' | 'getAccountForEmail' | 'getAccountForResource' | 'getCurrentAccount' | 'getDefaultBranch' | 'getIssue' | 'getIssueOrPullRequest' | 'getIssuesBatch' | 'getIssuesEtagFields' | 'getIssuesForProject' | 'getIssuesForRepos' | 'getMyPullRequestsForUser' | 'getOrganizationsForUser' | 'getProjectsForOrg' | 'getProjectsForResources' | 'getPullRequest' | 'getPullRequestActivity' | 'getPullRequestCheckLogs' | 'getPullRequestsBatch' | 'getPullRequestsEtagFields' | 'getPullRequestsForBranches' | 'getPullRequestsForCommits' | 'getRepositoriesForOrg' | 'getRepositoriesForUser' | 'getPullRequestForBranch' | 'getPullRequestForCommit' | 'getPullRequestsForRepos' | 'getRepositoryMetadata' | 'getResourcesForUser' | 'getSshSigningKeysForEmails' | 'countIssues' | 'countPullRequests' | 'dequeuePullRequest' | 'enqueuePullRequest' | 'mergePullRequest' | 'mutateIssue' | 'searchIssuesPage' | 'searchPullRequestsPage' | 'searchMyIssues' | 'searchMyPullRequests' | 'searchPullRequests', 'all'>;
|
|
51
|
+
type SyncReqUsecase = Exclude<'getAccountForCommit' | 'getAccountForEmail' | 'getAccountForResource' | 'getCurrentAccount' | 'getDefaultBranch' | 'getIssue' | 'getIssueOrPullRequest' | 'getIssuesBatch' | 'getIssuesEtagFields' | 'getIssuesForProject' | 'getIssuesForRepos' | 'getMyPullRequestsForUser' | 'getOrganizationsForUser' | 'getProjectsForOrg' | 'getProjectsForResources' | 'getPullRequest' | 'getPullRequestActivity' | 'getPullRequestCheckLogs' | 'getPullRequestsBatch' | 'getPullRequestsEtagFields' | 'getPullRequestsForBranches' | 'getPullRequestsForCommits' | 'getRepositoriesForOrg' | 'getRepositoriesForUser' | 'getPullRequestForBranch' | 'getPullRequestForCommit' | 'getPullRequestsForRepos' | 'getRepositoryMetadata' | 'getResourcesForUser' | 'getSshSigningKeysForEmails' | 'countIssues' | 'countPullRequests' | 'dequeuePullRequest' | 'enqueuePullRequest' | 'mergePullRequest' | 'mutateIssue' | 'writePullRequest' | 'searchIssuesPage' | 'searchPullRequestsPage' | 'searchMyIssues' | 'searchMyPullRequests' | 'searchPullRequests', 'all'>;
|
|
219
52
|
export declare abstract class IntegrationBase<ID extends IntegrationIds = IntegrationIds, T extends ResourceDescriptor = ResourceDescriptor> implements Disposable {
|
|
220
53
|
protected readonly ctx: IntegrationServiceContext;
|
|
221
54
|
protected readonly authenticationService: IntegrationAuthenticationService;
|
|
@@ -266,6 +99,8 @@ export declare abstract class IntegrationBase<ID extends IntegrationIds = Integr
|
|
|
266
99
|
protected runSessionTransition<T>(fn: () => Promise<T>): Promise<T>;
|
|
267
100
|
/** An expired session is refreshed first; when that fails, nothing is returned rather than a token the provider refuses. */
|
|
268
101
|
getSession(source: Sources): ProviderAuthenticationSession | Promise<ProviderAuthenticationSession | undefined> | undefined;
|
|
102
|
+
/** {@link getSession}'s token, for a consumer of the public view, which never sees the session itself. */
|
|
103
|
+
getCredential(source: Sources): Promise<IntegrationCredential | undefined>;
|
|
269
104
|
private getRefreshedSession;
|
|
270
105
|
private isSessionForIntegrationHost;
|
|
271
106
|
/**
|
|
@@ -507,7 +342,7 @@ export declare abstract class IntegrationBase<ID extends IntegrationIds = Integr
|
|
|
507
342
|
/** Names each scoped refusal's cause (see {@link describeRefusal}); only once the credential is proven. */
|
|
508
343
|
private nameRefusalCauses;
|
|
509
344
|
/** Returns whether it spent a strike (see {@link trackRequestException}). */
|
|
510
|
-
protected handleConnectionAuthenticationRejection(connectionId: string, silent?: boolean): boolean;
|
|
345
|
+
protected handleConnectionAuthenticationRejection(connectionId: string, silent?: boolean, rejectedAccessToken?: string): boolean;
|
|
511
346
|
/** Returns whether it spent a strike (see {@link trackRequestException}). */
|
|
512
347
|
protected handleProviderException(syncReqUsecase: SyncReqUsecase, ex: Error, options?: {
|
|
513
348
|
scope?: ScopedLogger | undefined;
|
|
@@ -13,8 +13,8 @@ import "../constants.js";
|
|
|
13
13
|
import { isAzureProviderId } from "../providers/providerErrors.js";
|
|
14
14
|
import { attributeScopedAuthFailures, hasOnlyScopedAuthFailures, markCredentialRefusals, toCollectionScopeFailure } from "../collectionMetadata.js";
|
|
15
15
|
import { throwIfAllSettledFailed } from "../providers/utils/providerPaging.js";
|
|
16
|
+
import { providersMetadata } from "../providers/metadata.js";
|
|
16
17
|
import { areDomainsOnSameHost } from "../utils/domain.utils.js";
|
|
17
|
-
import { providersMetadata } from "../providers/models.js";
|
|
18
18
|
import { isSelfManagedHostIntegrationId } from "../utils/integration.utils.js";
|
|
19
19
|
import { getSessionIdentity } from "../authentication/models.js";
|
|
20
20
|
import { RejectedTokenTracker } from "../authentication/rejectedTokenTracker.js";
|
|
@@ -31,76 +31,6 @@ var ReadSessionFailure = class {
|
|
|
31
31
|
function isReadSessionFailure(session) {
|
|
32
32
|
return session instanceof ReadSessionFailure;
|
|
33
33
|
}
|
|
34
|
-
/** Every {@link PullRequestEtagInclude}, in the canonical order an etag lists them in. */
|
|
35
|
-
const pullRequestEtagIncludes = [
|
|
36
|
-
"mergeable",
|
|
37
|
-
"reviewDecision",
|
|
38
|
-
"checks"
|
|
39
|
-
];
|
|
40
|
-
/**
|
|
41
|
-
* {@link PullRequestEtagFields.checkRuns}, which the cheap check and the full read build alike from the same fields.
|
|
42
|
-
* Hashed to keep the etag short at any number of checks, so a collision is the only way a change can hide, at about
|
|
43
|
-
* 2^-64.
|
|
44
|
-
*/
|
|
45
|
-
function pullRequestCheckRunsEtag(runs, truncated) {
|
|
46
|
-
const entries = runs.map((run) => [
|
|
47
|
-
run.id,
|
|
48
|
-
run.kind,
|
|
49
|
-
run.name,
|
|
50
|
-
run.status,
|
|
51
|
-
run.conclusion ?? null
|
|
52
|
-
]).sort(([a], [b]) => a < b ? -1 : a > b ? 1 : 0);
|
|
53
|
-
return {
|
|
54
|
-
hash: fnv1aHash64(JSON.stringify(entries)),
|
|
55
|
-
count: entries.length,
|
|
56
|
-
truncated
|
|
57
|
-
};
|
|
58
|
-
}
|
|
59
|
-
/**
|
|
60
|
-
* {@link PullRequestEtagFields.revision}: a 64-bit hash of a pull request's title, description, target branch and
|
|
61
|
-
* reviewers (each one's id and review state, in a canonical order). Hashed to keep the etag short, so a collision is
|
|
62
|
-
* the only way a change can hide, at about 2^-64.
|
|
63
|
-
*/
|
|
64
|
-
function pullRequestRevision(pr) {
|
|
65
|
-
return fnv1aHash64(JSON.stringify([
|
|
66
|
-
pr.title,
|
|
67
|
-
pr.body ?? null,
|
|
68
|
-
pr.refs?.base.branch ?? null,
|
|
69
|
-
toRevisionReviewers(pr.reviewRequests),
|
|
70
|
-
toRevisionReviewers(pr.latestReviews)
|
|
71
|
-
]));
|
|
72
|
-
}
|
|
73
|
-
/** Each reviewer as its serialized `[id, state]`, sorted, so the host's order never moves the revision. */
|
|
74
|
-
function toRevisionReviewers(reviewers) {
|
|
75
|
-
return reviewers?.map((r) => JSON.stringify([r.reviewer.id, r.state])).sort() ?? null;
|
|
76
|
-
}
|
|
77
|
-
/** Every {@link IssueEtagInclude}, in the canonical order an etag lists them in. */
|
|
78
|
-
const issueEtagIncludes = ["reactions"];
|
|
79
|
-
/**
|
|
80
|
-
* {@link IssueEtagFields.descriptionRule}: the version of the rule an Azure DevOps work item's body is read by, stamped
|
|
81
|
-
* on both sides of its etag. Bumped whenever the rule changes which field a work item's body comes from, so every row
|
|
82
|
-
* a caller holds from before is read in full once. 1: the first rich text field with content (provider-apis'
|
|
83
|
-
* `getAzureWorkItemDescription`), where it used to be only Description. The rule lives in provider-apis, so a bump of
|
|
84
|
-
* that package that changes it must bump this too; the etag tests pin the rule to catch one.
|
|
85
|
-
*
|
|
86
|
-
* It can't cover a row whose read found the organization's field catalog unavailable: that row's body falls back to
|
|
87
|
-
* the built-in fields, and a cheap check, which reads no body, can't tell it from a complete one, so it stays as read
|
|
88
|
-
* until the work item changes.
|
|
89
|
-
*/
|
|
90
|
-
const azureWorkItemDescriptionRule = 1;
|
|
91
|
-
/**
|
|
92
|
-
* {@link IssueEtagFields.viewerRule}: the version of the rule an Azure DevOps work item's `viewer` is set by, stamped
|
|
93
|
-
* on both sides of its etag, so every row a caller holds from before it was set is read in full once. 1: the user's
|
|
94
|
-
* identity in the work item's organization (gitkraken/kepler#4291).
|
|
95
|
-
*/
|
|
96
|
-
const azureWorkItemViewerRule = 1;
|
|
97
|
-
/**
|
|
98
|
-
* A Linear row's sync links in its etag, sorted: each as its GitHub id and, when known, the coordinates a host matches
|
|
99
|
-
* the GitHub row by, so a link whose coordinates Linear fills in or changes later compares changed.
|
|
100
|
-
*/
|
|
101
|
-
function linearSyncedWithEtagKeys(links) {
|
|
102
|
-
return links.map((link) => link.owner != null ? `${link.id}:${link.owner}/${link.repo}#${link.number}` : `${link.id}:`).sort();
|
|
103
|
-
}
|
|
104
34
|
function batchTargetRepository(target) {
|
|
105
35
|
if ("resourceId" in target) return void 0;
|
|
106
36
|
return [
|
|
@@ -230,6 +160,15 @@ var IntegrationBase = class IntegrationBase {
|
|
|
230
160
|
if (this.connectionExpired) return this.getRefreshedSession();
|
|
231
161
|
return this._session;
|
|
232
162
|
}
|
|
163
|
+
/** {@link getSession}'s token, for a consumer of the public view, which never sees the session itself. */
|
|
164
|
+
async getCredential(source) {
|
|
165
|
+
const session = await this.getSession(source);
|
|
166
|
+
if (session == null) return void 0;
|
|
167
|
+
return {
|
|
168
|
+
providerId: this.authProvider.id,
|
|
169
|
+
accessToken: session.accessToken
|
|
170
|
+
};
|
|
171
|
+
}
|
|
233
172
|
async getRefreshedSession() {
|
|
234
173
|
if (await this.refreshSessionIfExpired() != null) return void 0;
|
|
235
174
|
return this._session != null && this.connectionExpired !== true && this.isSessionForIntegrationHost(this._session) ? this._session : void 0;
|
|
@@ -256,7 +195,7 @@ var IntegrationBase = class IntegrationBase {
|
|
|
256
195
|
async resolveReadSession(connectionId, scope, source) {
|
|
257
196
|
if (this.ctx.config.isIntegrationsEnabled?.() === false || this.ctx.storage.getWorkspace(this.connectedKey) === false) return;
|
|
258
197
|
if (connectionId) {
|
|
259
|
-
const
|
|
198
|
+
const rejectedToken = this._rejectedTokens.claimRefresh(connectionId);
|
|
260
199
|
try {
|
|
261
200
|
const session = await (await this.authenticationService.get(this.authProvider.id)).getSession({
|
|
262
201
|
...this.authProviderDescriptor,
|
|
@@ -264,7 +203,8 @@ var IntegrationBase = class IntegrationBase {
|
|
|
264
203
|
cloud: true
|
|
265
204
|
}, {
|
|
266
205
|
source,
|
|
267
|
-
refreshRejectedToken
|
|
206
|
+
refreshRejectedToken: rejectedToken === true,
|
|
207
|
+
isRejectedToken: typeof rejectedToken === "function" ? rejectedToken : void 0
|
|
268
208
|
});
|
|
269
209
|
return session != null && this.isSessionForIntegrationHost(session) ? session : void 0;
|
|
270
210
|
} catch (ex) {
|
|
@@ -567,6 +507,7 @@ var IntegrationBase = class IntegrationBase {
|
|
|
567
507
|
}
|
|
568
508
|
let newSession;
|
|
569
509
|
let refetchFailed = false;
|
|
510
|
+
const signOutMark = resyncing ? this.authenticationService.getSignOutMark() : void 0;
|
|
570
511
|
try {
|
|
571
512
|
newSession = await this.resolveSessionLocked({
|
|
572
513
|
sync: forceSync,
|
|
@@ -578,7 +519,10 @@ var IntegrationBase = class IntegrationBase {
|
|
|
578
519
|
failure = toError(ex);
|
|
579
520
|
}
|
|
580
521
|
if (oldSession && newSession && newSession === this._session && newSession.accessToken !== oldSession.accessToken) this.resetRecoveryAccounting();
|
|
581
|
-
if (resyncing && newSession == null && !refetchFailed) await (await this.authenticationService.get(this.authProvider.id)).deleteSession(this.authProviderDescriptor, {
|
|
522
|
+
if (resyncing && newSession == null && !refetchFailed) await (await this.authenticationService.get(this.authProvider.id)).deleteSession(this.authProviderDescriptor, {
|
|
523
|
+
preserveConfigured: false,
|
|
524
|
+
signOutMark
|
|
525
|
+
});
|
|
582
526
|
break;
|
|
583
527
|
}
|
|
584
528
|
case "disconnected": await this.disconnectLocked({ silent: true }, true);
|
|
@@ -756,9 +700,9 @@ var IntegrationBase = class IntegrationBase {
|
|
|
756
700
|
attributeScopedAuthFailures(metadata, (refusal, scope) => describeRefusal(session, refusal, scope));
|
|
757
701
|
}
|
|
758
702
|
/** Returns whether it spent a strike (see {@link trackRequestException}). */
|
|
759
|
-
handleConnectionAuthenticationRejection(connectionId, silent) {
|
|
703
|
+
handleConnectionAuthenticationRejection(connectionId, silent, rejectedAccessToken) {
|
|
760
704
|
this._validatedCredentials.clear();
|
|
761
|
-
if (this._rejectedTokens.recordRejection(connectionId)) return false;
|
|
705
|
+
if (this._rejectedTokens.recordRejection(connectionId, rejectedAccessToken)) return false;
|
|
762
706
|
this.trackRequestException({
|
|
763
707
|
connectionId,
|
|
764
708
|
silent
|
|
@@ -1173,6 +1117,6 @@ __decorate([trace()], IntegrationBase.prototype, "getLinkedIssueOrPullRequest",
|
|
|
1173
1117
|
__decorate([trace()], IntegrationBase.prototype, "getIssueResultCore", null);
|
|
1174
1118
|
__decorate([trace()], IntegrationBase.prototype, "getPullRequest", null);
|
|
1175
1119
|
//#endregion
|
|
1176
|
-
export { IntegrationBase, ReadSessionFailure,
|
|
1120
|
+
export { IntegrationBase, ReadSessionFailure, isReadSessionFailure };
|
|
1177
1121
|
|
|
1178
1122
|
//# sourceMappingURL=integration.js.map
|