@gitkraken/core-gitlens 0.63.0 → 0.64.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 +8 -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/integrations/extensionManager.d.ts +6 -0
- package/dist/plus/integrations/extensionManager.js +10 -0
- package/dist/plus/integrations/extensionManager.js.map +1 -0
- package/dist/plus/integrations/index.d.ts +5 -63
- package/dist/plus/integrations/index.js +4 -53
- package/dist/plus/integrations/index.js.map +1 -1
- package/dist/plus/integrations/integrationService.d.ts +14 -2
- package/dist/plus/integrations/integrationService.js +48 -12
- package/dist/plus/integrations/integrationService.js.map +1 -1
- package/dist/plus/integrations/manager.d.ts +10 -0
- package/dist/plus/integrations/managerContext.d.ts +69 -0
- package/dist/plus/integrations/managerContext.js +59 -0
- package/dist/plus/integrations/managerContext.js.map +1 -0
- package/dist/plus/integrations/models/gitlabMergeRequestWrites.d.ts +167 -0
- package/dist/plus/integrations/models/gitlabMergeRequestWrites.js +0 -0
- package/dist/plus/integrations/providers/azure/azure.js +1 -1
- package/dist/plus/integrations/providers/github.js +1 -1
- package/dist/plus/integrations/providers/gitlab/gitlab.d.ts +2 -2
- package/dist/plus/integrations/providers/gitlab/gitlab.js +3 -3
- package/dist/plus/integrations/providers/gitlab/gitlab.js.map +1 -1
- package/dist/plus/integrations/providers/gitlab/issueWrites.d.ts +4 -13
- package/dist/plus/integrations/providers/gitlab/issueWrites.js +33 -136
- package/dist/plus/integrations/providers/gitlab/issueWrites.js.map +1 -1
- package/dist/plus/integrations/providers/gitlab/mergeRequestWrites.d.ts +30 -0
- package/dist/plus/integrations/providers/gitlab/mergeRequestWrites.js +569 -0
- package/dist/plus/integrations/providers/gitlab/mergeRequestWrites.js.map +1 -0
- package/dist/plus/integrations/providers/gitlab/writeErrors.d.ts +12 -0
- package/dist/plus/integrations/providers/gitlab/writeErrors.js +101 -0
- package/dist/plus/integrations/providers/gitlab/writeErrors.js.map +1 -0
- package/dist/plus/integrations/providers/gitlab/writeTransport.d.ts +47 -0
- package/dist/plus/integrations/providers/gitlab/writeTransport.js +135 -0
- package/dist/plus/integrations/providers/gitlab/writeTransport.js.map +1 -0
- package/dist/plus/integrations/providers/gitlab.d.ts +6 -1
- package/dist/plus/integrations/providers/gitlab.js +9 -1
- package/dist/plus/integrations/providers/gitlab.js.map +1 -1
- package/dist/plus/integrations/reads/sweeps.js +1 -1
- package/dist/utils/env/node/exec.js +2 -2
- package/docs/integrations.md +77 -0
- package/package.json +1 -1
- package/dist/plus/integrations/providers/gitlab/issueWriteErrors.d.ts +0 -11
- package/dist/plus/integrations/providers/gitlab/issueWriteErrors.js +0 -73
- package/dist/plus/integrations/providers/gitlab/issueWriteErrors.js.map +0 -1
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { createIntegrationService } from "./integrationService.js";
|
|
2
|
+
import { toIntegrationServiceContext } from "./managerContext.js";
|
|
3
|
+
//#region ../plus/integrations/src/extensionManager.ts
|
|
4
|
+
function createExtensionIntegrationManager(ctx) {
|
|
5
|
+
return createIntegrationService(toIntegrationServiceContext(ctx));
|
|
6
|
+
}
|
|
7
|
+
//#endregion
|
|
8
|
+
export { createExtensionIntegrationManager };
|
|
9
|
+
|
|
10
|
+
//# sourceMappingURL=extensionManager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extensionManager.js","names":[],"sources":["../../../../plus/integrations/src/extensionManager.ts"],"sourcesContent":["import { createIntegrationService } from './integrationService.js';\nimport type { IntegrationManager } from './manager.js';\nimport type { IntegrationManagerContext } from './managerContext.js';\nimport { toIntegrationServiceContext } from './managerContext.js';\n\n// KEEP: never import `index.js` or the GitLab merge request writer here; the extension's bundle budget depends on it.\nexport function createExtensionIntegrationManager(ctx: IntegrationManagerContext): IntegrationManager {\n\treturn createIntegrationService(toIntegrationServiceContext(ctx));\n}\n"],"mappings":";;;AAMA,SAAgB,kCAAkC,KAAoD;CACrG,OAAO,yBAAyB,4BAA4B,GAAG,CAAC;AACjE"}
|
|
@@ -1,14 +1,9 @@
|
|
|
1
|
-
import { CacheController } from "../../utils/promiseCache.js";
|
|
2
|
-
import { ResourceDescriptor } from "../../git/models/resourceDescriptor.js";
|
|
3
1
|
import { Autolink, AutolinkReference, DynamicAutolinkReference, RefSet } from "../../git/models/autolink.js";
|
|
4
2
|
import { ProviderReference } from "../../git/models/remoteProvider.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { PullRequest, PullRequestFilter, PullRequestProjection, PullRequestSearchCapabilities, PullRequestSearchCriteria, PullRequestStateFilter } from "../../git/models/pullRequest.js";
|
|
3
|
+
import { IssueProjection, IssueSearchCapabilities, IssueSearchCriteria, IssueSearchRelationship, IssueStateFilter } from "../../git/models/issue.js";
|
|
4
|
+
import { PullRequestFilter, PullRequestProjection, PullRequestSearchCapabilities, PullRequestSearchCriteria, PullRequestStateFilter } from "../../git/models/pullRequest.js";
|
|
8
5
|
import { Account } from "../../git/models/author.js";
|
|
9
|
-
import { DefaultBranch } from "../../git/models/defaultBranch.js";
|
|
10
6
|
import { PullRequestActivityAuthor, PullRequestActivityComment, PullRequestActivityItem, PullRequestActivityReview, PullRequestActivityReviewComment } from "../../git/models/pullRequestActivity.js";
|
|
11
|
-
import { RepositoryMetadata } from "../../git/models/repositoryMetadata.js";
|
|
12
7
|
import { PullRequestCreateCapabilityResult, PullRequestWriteFailure, PullRequestWriteResult, PullRequestWriteSnapshot, PullRequestWriteTargetResult } from "../git-github/api/pullRequestWrites.js";
|
|
13
8
|
import { IssueWriteResult } from "../git-github/api/issueWrites.js";
|
|
14
9
|
import { AuthenticationSessionLike, CloudIntegrationAuthType, CloudIntegrationConnection, CloudIntegrationType, ConfiguredIntegrationDescriptor, ProviderAuthenticationSession, TokenInfo, toCloudIntegrationType, toIntegrationId, toTokenInfo, toTokenWithInfo } from "./authentication/models.js";
|
|
@@ -21,6 +16,7 @@ import { AzurePullRequestCreateCapabilityOptions, AzurePullRequestCreateCapabili
|
|
|
21
16
|
import { BitbucketPullRequestCreateCapabilityOptions, BitbucketPullRequestCreateCapabilityResult, BitbucketPullRequestMergeCapability, BitbucketPullRequestMergeStatusOptions, BitbucketPullRequestMergeStatusResult, BitbucketPullRequestMergeStrategy, BitbucketPullRequestRepository, BitbucketPullRequestWriteAction, BitbucketPullRequestWriteFailure, BitbucketPullRequestWriteOptions, BitbucketPullRequestWriteReleaseOptions, BitbucketPullRequestWriteReleaseResult, BitbucketPullRequestWriteResult, BitbucketPullRequestWriteTargetOptions, BitbucketPullRequestWriteTargetResult, BitbucketUnsettledPullRequestWrite, BitbucketWrittenPullRequest } from "./models/bitbucketPullRequestWrites.js";
|
|
22
17
|
import { BitbucketServerPullRequestActionCapability, BitbucketServerPullRequestCreateCapabilityResult, BitbucketServerPullRequestMergeCapability, BitbucketServerPullRequestRepository, BitbucketServerPullRequestVeto, BitbucketServerPullRequestWriteAction, BitbucketServerPullRequestWriteFailure, BitbucketServerPullRequestWriteOptions, BitbucketServerPullRequestWriteResult, BitbucketServerPullRequestWriteScope, BitbucketServerPullRequestWriteTargetOptions, BitbucketServerPullRequestWriteTargetResult, BitbucketServerWrittenPullRequest } from "./models/bitbucketServerPullRequestWrites.js";
|
|
23
18
|
import { GitLabIssueCreateOptions, GitLabIssueCreateOptionsResult, GitLabIssueDeleteOptions, GitLabIssueReceipt, GitLabIssueWriteAddress, GitLabIssueWriteCapability, GitLabIssueWriteContext, GitLabIssueWriteFailure, GitLabIssueWriteField, GitLabIssueWriteOptions, GitLabIssueWriteOptionsResult, GitLabIssueWriteResult, GitLabIssueWriteScope, GitLabIssueWriteTargetOptions, GitLabIssueWriteTargetResult } from "./models/gitlabIssueWrites.js";
|
|
19
|
+
import { GitLabMergeBlocker, GitLabMergeExecution, GitLabMergeMethod, GitLabMergeRequestCreateOptions, GitLabMergeRequestCreateOptionsResult, GitLabMergeRequestDeleteOptions, GitLabMergeRequestMergeCapability, GitLabMergeRequestProject, GitLabMergeRequestReceipt, GitLabMergeRequestWriteAddress, GitLabMergeRequestWriteCapability, GitLabMergeRequestWriteContext, GitLabMergeRequestWriteFailure, GitLabMergeRequestWriteField, GitLabMergeRequestWriteOptions, GitLabMergeRequestWriteOptionsResult, GitLabMergeRequestWriteResult, GitLabMergeRequestWriteScope, GitLabMergeRequestWriteTargetOptions, GitLabMergeRequestWriteTargetResult, GitLabMergeSquash } from "./models/gitlabMergeRequestWrites.js";
|
|
24
20
|
import { CaptureRelationshipCurrency, IssueRelationshipFailure, IssueRelationshipPin, IssueRelationshipReceipt, IssueRelationshipWriteOptions, IssueRelationshipWriteResult, IssueRelationshipsOptions, IssueRelationshipsResult } from "./models/issueRelationships.js";
|
|
25
21
|
import { IssueFilter } from "./providerFilters.js";
|
|
26
22
|
import { IssueEtagInclude, PullRequestEtagInclude } from "./reads/etag.js";
|
|
@@ -35,6 +31,7 @@ import { LookupBackedOffError } from "./errors.js";
|
|
|
35
31
|
import { isAzureProviderId } from "./providers/providerErrors.js";
|
|
36
32
|
import { EntityIdentifier, EntityIdentifierFields, EntityIdentifierInput, EntityIdentifierProviderType, EntityType, EntityVersion, GitConfigEntityIdentifier, PullRequestEntityIdentifierInput, decodeEntityIdentifier, decodeEntityIdentifiersFromGitConfig, encodeEntityIdentifier, encodeIssueOrPullRequestForGitConfig, getEntityIdentifierInput, getIssueFromGitConfigEntityIdentifier, getIssueOwner, getProviderIdFromEntityIdentifier } from "./providers/utils.js";
|
|
37
33
|
import { ManualTokenAuthProviderOptions, createManualTokenAuthProvider } from "./authentication/manualTokenProvider.js";
|
|
34
|
+
import { IntegrationAccountCacheDescriptor, IntegrationManagerCacheLoader, IntegrationManagerCacheOptions, IntegrationManagerCacheProvider, IntegrationManagerCacheResult, IntegrationManagerContext } from "./managerContext.js";
|
|
38
35
|
import { FieldPresence, IssueFieldGroup, PullRequestFieldGroup, getIssueFieldPresence, getPullRequestFieldPresence } from "./fieldPresence.js";
|
|
39
36
|
import { areDomainsOnSameHost, getSingleConfiguredDomain, hostFromDomain } from "./utils/domain.utils.js";
|
|
40
37
|
import { convertRemoteProviderIdToIntegrationId, getIntegrationConnectedKey, getIntegrationIdForRemote, isCloudGitSelfManagedHostIntegrationId, isGitCloudHostIntegrationId, isGitSelfManagedHostIntegrationId, isIssuesHostIntegrationId, isSelfManagedHostIntegrationId } from "./utils/integration.utils.js";
|
|
@@ -42,61 +39,6 @@ import { getAzureRepositoryIdentity } from "./providers/azure/azure.utils.js";
|
|
|
42
39
|
import { isMaybeGitLabPullRequestUrl, splitOwnerAndRepo } from "./providers/gitlab/gitlab.utils.js";
|
|
43
40
|
import { getActionablePullRequests, toActionablePullRequestInput } from "./providers/actionablePullRequests.js";
|
|
44
41
|
//#region ../plus/integrations/src/index.d.ts
|
|
45
|
-
/** A cached provider value, which may still be resolving. */
|
|
46
|
-
export type IntegrationManagerCacheResult<T> = Promise<T | undefined> | T | undefined;
|
|
47
|
-
/** Produces an account value on a cache miss. */
|
|
48
|
-
export type IntegrationManagerCacheLoader<T> = (cacheable: CacheController) => {
|
|
49
|
-
value: IntegrationManagerCacheResult<T>;
|
|
50
|
-
expiresAt?: number;
|
|
51
|
-
};
|
|
52
|
-
/** The integration identity supplied to the consumer-owned account cache. */
|
|
53
|
-
export type IntegrationAccountCacheDescriptor = IntegrationCacheDescriptor;
|
|
54
|
-
/** Cache controls attached to a provider account lookup. */
|
|
55
|
-
export interface IntegrationManagerCacheOptions {
|
|
56
|
-
readonly connectionId?: string;
|
|
57
|
-
readonly etag?: string;
|
|
58
|
-
readonly expiryOverride?: boolean | number;
|
|
59
|
-
readonly expireOnError?: boolean;
|
|
60
|
-
}
|
|
61
|
-
/**
|
|
62
|
-
* Optional consumer-owned cache for values reused by the public manager facade.
|
|
63
|
-
*
|
|
64
|
-
* Only `getCurrentAccount` is required. Each other lookup is optional: one the cache omits runs its loader on every
|
|
65
|
-
* call, uncached. A cache that keys entries by integration should key them by the descriptor's `id` and `domain`,
|
|
66
|
-
* and treat `maybeConnected` and `sessionFingerprint` as the entry's etag, so a reconnect or a token change misses.
|
|
67
|
-
*
|
|
68
|
-
* The manager calls each method on the cache object itself, so a class instance (methods on its prototype) works.
|
|
69
|
-
*/
|
|
70
|
-
export interface IntegrationManagerCacheProvider {
|
|
71
|
-
getCurrentAccount(integration: IntegrationAccountCacheDescriptor, cacheable: IntegrationManagerCacheLoader<Account>, options?: IntegrationManagerCacheOptions): IntegrationManagerCacheResult<Account>;
|
|
72
|
-
getRepositoryMetadata?(repo: ResourceDescriptor, integration: IntegrationCacheDescriptor | undefined, cacheable: IntegrationManagerCacheLoader<RepositoryMetadata>, options?: IntegrationManagerCacheOptions): IntegrationManagerCacheResult<RepositoryMetadata>;
|
|
73
|
-
getRepositoryDefaultBranch?(repo: ResourceDescriptor, integration: IntegrationCacheDescriptor | undefined, cacheable: IntegrationManagerCacheLoader<DefaultBranch>, options?: IntegrationManagerCacheOptions): IntegrationManagerCacheResult<DefaultBranch>;
|
|
74
|
-
getPullRequestForSha?(sha: string, repo: ResourceDescriptor, integration: IntegrationCacheDescriptor | undefined, cacheable: IntegrationManagerCacheLoader<PullRequest>, options?: IntegrationManagerCacheOptions): IntegrationManagerCacheResult<PullRequest>;
|
|
75
|
-
getPullRequestForBranch?(branch: string, repo: ResourceDescriptor, integration: IntegrationCacheDescriptor | undefined, cacheable: IntegrationManagerCacheLoader<PullRequest>, options?: IntegrationManagerCacheOptions): IntegrationManagerCacheResult<PullRequest>;
|
|
76
|
-
getPullRequest?(id: string, resource: ResourceDescriptor, integration: IntegrationCacheDescriptor | undefined, cacheable: IntegrationManagerCacheLoader<PullRequest>, options?: IntegrationManagerCacheOptions): IntegrationManagerCacheResult<PullRequest>;
|
|
77
|
-
getIssueOrPullRequest?(id: string, type: IssueOrPullRequestType | undefined, resource: ResourceDescriptor, integration: IntegrationCacheDescriptor | undefined, cacheable: IntegrationManagerCacheLoader<IssueOrPullRequest>, options?: IntegrationManagerCacheOptions): IntegrationManagerCacheResult<IssueOrPullRequest>;
|
|
78
|
-
getIssue?(id: string, resource: ResourceDescriptor, integration: IntegrationCacheDescriptor | undefined, cacheable: IntegrationManagerCacheLoader<Issue>, options?: IntegrationManagerCacheOptions): IntegrationManagerCacheResult<Issue>;
|
|
79
|
-
/** Evicts cached pull requests for the given installation origin, or all pull requests when omitted. */
|
|
80
|
-
deletePullRequests?(scope?: {
|
|
81
|
-
id: IntegrationCacheDescriptor['id'];
|
|
82
|
-
domain: string;
|
|
83
|
-
}): void;
|
|
84
|
-
}
|
|
85
|
-
/**
|
|
86
|
-
* Consumer-facing runtime for {@link createIntegrationManager}.
|
|
87
|
-
*
|
|
88
|
-
* External consumers may omit `cache`; reads then execute their loaders directly without cross-call caching.
|
|
89
|
-
* The extension host's broader integration context remains private to the implementation.
|
|
90
|
-
*/
|
|
91
|
-
export interface IntegrationManagerContext {
|
|
92
|
-
readonly storage: IntegrationStorageProvider;
|
|
93
|
-
readonly account: AccountProvider;
|
|
94
|
-
readonly config: ConfigProvider;
|
|
95
|
-
readonly http: HttpProvider;
|
|
96
|
-
readonly cache?: IntegrationManagerCacheProvider;
|
|
97
|
-
readonly repositories: RepositoriesProvider;
|
|
98
|
-
readonly hooks?: IntegrationServiceHooks;
|
|
99
|
-
}
|
|
100
42
|
/**
|
|
101
43
|
* Construct an `@gitkraken/core-gitlens/plus/integrations` manager bound to the supplied runtime.
|
|
102
44
|
*
|
|
@@ -111,5 +53,5 @@ export interface IntegrationManagerContext {
|
|
|
111
53
|
*/
|
|
112
54
|
export declare function createIntegrationManager(ctx: IntegrationManagerContext): IntegrationManager;
|
|
113
55
|
//#endregion
|
|
114
|
-
export { type Account, type AccountProvider, type ActionablePullRequest, type ActionablePullRequestAccount, ActionablePullRequestBuildStatusState, type ActionablePullRequestCategory, type ActionablePullRequestEnrichedItem, type ActionablePullRequestEnrichedItems, type ActionablePullRequestFields, type ActionablePullRequestInput, ActionablePullRequestReviewState, type AuthenticationSessionLike, type AuthenticationSessionsChangeEvent, type Autolink, type AutolinkReference, type AzurePullRequestCreateCapabilityOptions, type AzurePullRequestCreateCapabilityResult, type AzurePullRequestMergeStrategy, type AzurePullRequestRepository, type AzurePullRequestWriteAction, type AzurePullRequestWriteFailure, type AzurePullRequestWriteOptions, type AzurePullRequestWriteResult, type AzurePullRequestWriteTargetOptions, type AzurePullRequestWriteTargetResult, type AzureServerPullRequestWriteOptions, type AzureServerPullRequestWriteScope, type AzureServerPullRequestWriteTargetOptions, type AzureServerWorkItemWriteScope, type AzureServicesWorkItemWriteScope, type AzureWrittenPullRequest, type BitbucketPullRequestCreateCapabilityOptions, type BitbucketPullRequestCreateCapabilityResult, type BitbucketPullRequestMergeCapability, type BitbucketPullRequestMergeStatusOptions, type BitbucketPullRequestMergeStatusResult, type BitbucketPullRequestMergeStrategy, type BitbucketPullRequestRepository, type BitbucketPullRequestWriteAction, type BitbucketPullRequestWriteFailure, type BitbucketPullRequestWriteOptions, type BitbucketPullRequestWriteReleaseOptions, type BitbucketPullRequestWriteReleaseResult, type BitbucketPullRequestWriteResult, type BitbucketPullRequestWriteTargetOptions, type BitbucketPullRequestWriteTargetResult, type BitbucketServerPullRequestActionCapability, type BitbucketServerPullRequestCreateCapabilityResult, type BitbucketServerPullRequestMergeCapability, type BitbucketServerPullRequestRepository, type BitbucketServerPullRequestVeto, type BitbucketServerPullRequestWriteAction, type BitbucketServerPullRequestWriteFailure, type BitbucketServerPullRequestWriteOptions, type BitbucketServerPullRequestWriteResult, type BitbucketServerPullRequestWriteScope, type BitbucketServerPullRequestWriteTargetOptions, type BitbucketServerPullRequestWriteTargetResult, type BitbucketServerWrittenPullRequest, type BitbucketUnsettledPullRequestWrite, type BitbucketWrittenPullRequest, type CaptureRelationshipCurrency, type ClosedPullRequestSweepOptions, type CloudIntegrationAuthType, type CloudIntegrationConnection, type CloudIntegrationType, type ConfigChangeEvent, type ConfigProvider, type ConfiguredIntegrationDescriptor, type ConfiguredIntegrationsChangeEvent, type ConnectionStateChangeEvent, type CurrentAccountResult, type DynamicAutolinkReference, type EntityIdentifier, type EntityIdentifierFields, type EntityIdentifierInput, EntityIdentifierProviderType, EntityType, EntityVersion, type FieldPresence, type GetAutolinkReferencesOptions, GitCloudHostIntegrationId, type GitConfigEntityIdentifier, type GitHostIntegration, type GitLabIssueCreateOptions, type GitLabIssueCreateOptionsResult, type GitLabIssueDeleteOptions, type GitLabIssueReceipt, type GitLabIssueWriteAddress, type GitLabIssueWriteCapability, type GitLabIssueWriteContext, type GitLabIssueWriteFailure, type GitLabIssueWriteField, type GitLabIssueWriteOptions, type GitLabIssueWriteOptionsResult, type GitLabIssueWriteResult, type GitLabIssueWriteScope, type GitLabIssueWriteTargetOptions, type GitLabIssueWriteTargetResult, GitSelfManagedHostIntegrationId, type HttpProvider, type Integration, type IntegrationAuthenticationProvider, type IntegrationAuthenticationProviderDescriptor, type IntegrationAuthenticationSessionDescriptor, type IntegrationById, type IntegrationCacheDescriptor, type IntegrationConnectedKey, type IntegrationCredential, type IntegrationIds, type IntegrationManager, type IntegrationResult, type IntegrationServiceHooks, type IntegrationStorageProvider, type IntegrationType, type IntegrationsRemoteConfig, type IssueBatchResult, type IssueBatchTarget, type IssueCountResult, type IssueCountScope, type IssueDeleteOptions, type IssueEtagInclude, type IssueFieldGroup, IssueFilter, type IssueProjection, type IssueRelationshipFailure, type IssueRelationshipPin, type IssueRelationshipReceipt, type IssueRelationshipWriteOptions, type IssueRelationshipWriteResult, type IssueRelationshipsOptions, type IssueRelationshipsResult, type IssueSearchCapabilities, type IssueSearchCriteria, type IssueSearchRelationship, type IssueStateFilter, type IssueTrackerCreateOptions, type IssueTrackerCreateOptionsResult, type IssueTrackerDeleteOptions, type IssueTrackerField, type IssueTrackerIssueReceipt, type IssueTrackerIssueWriteOptions, type IssueTrackerIssueWriteOptionsResult, type IssueTrackerStatus, type IssueTrackerTransition, type IssueTrackerWriteConnection, type IssueTrackerWriteFailure, type IssueTrackerWriteOptions, type IssueTrackerWriteResult, type IssueTrackerWriteTargetOptions, type IssueTrackerWriteTargetResult, type IssueWriteOptions, type IssueWriteResult, type IssueWriteTargetOptions, type IssueWriteTargetResult, IssuesCloudHostIntegrationId, type IssuesIntegration, IssuesSelfManagedHostIntegrationId, type ListLinearProjectsOptions, type ListOrgsOptions, type ListProjectsOptions, LookupBackedOffError, type ManualTokenAuthProviderOptions, type MyPullRequestsForReposOptions, type ProviderAuthenticationSession, type ProviderBroadenOrg, type ProviderBroadenResult, type ProviderLinearProjectShape, type ProviderMetadata, type ProviderOrganization, type ProviderPageInfo, type ProviderPagedResult, type ProviderPullRequestSearchResult, type ProviderReference, type ProviderRepositoriesInput, type ProviderRepositoryInput, type ProviderRepositoryShape, type ProviderResult, type ProviderSweepResult, type ProviderSweepTarget, type ProviderSweepTargetEvent, type ProviderSweepTargetRef, type ProviderWarning, type ProviderWarningCause, type ProviderWarningCauseReason, type ProviderWarningKind, type ProviderWarningOmission, type ProviderWarningOmissionKind, type ProviderWarningOmissionRecovery, type ProviderWarningOmissionScope, type ProviderWarningScope, type ProviderWarningSelector, type ProviderWarningUnreadableItems, type PullRequestActivityAuthor, type PullRequestActivityComment, type PullRequestActivityItem, type PullRequestActivityResult, type PullRequestActivityReview, type PullRequestActivityReviewComment, type PullRequestActivityTarget, type PullRequestBatchResult, type PullRequestBatchTarget, type PullRequestBranchResult, type PullRequestBranchTarget, type PullRequestCheckLogResult, type PullRequestCheckLogTarget, type PullRequestCountResult, type PullRequestCountScope, type PullRequestCreateCapabilityOptions, type PullRequestCreateCapabilityResult, type PullRequestEntityIdentifierInput, type PullRequestEtagInclude, type PullRequestFieldGroup, PullRequestFilter, type PullRequestForCommitResult, type PullRequestProjection, type PullRequestSearchCapabilities, type PullRequestSearchCriteria, type PullRequestStateFilter, type PullRequestSweepOptions, type PullRequestWriteFailure, type PullRequestWriteOptions, type PullRequestWriteResult, type PullRequestWriteSnapshot, type PullRequestWriteTargetOptions, type PullRequestWriteTargetResult, type RefSet, type RepositoriesProvider, type RepositoryIdentity, type RepositoryResolution, type RepositoryResolutionStatus, type ResolveRepositoryResult, type SearchMyPullRequestsOptions, type SearchPullRequestsOptions, type Source, type Sources, type SupportedCloudIntegrationIds, type TokenInfo, type WorkItemAddress, type WorkItemCreateOptions, type WorkItemCreateOptionsResult, type WorkItemDeleteCapability, type WorkItemDeleteOptions, type WorkItemDeleteResult, type WorkItemDeleteTargetChanged, type WorkItemDeletion, type WorkItemReceipt, type WorkItemState, type WorkItemWriteContext, type WorkItemWriteField, type WorkItemWriteOptions, type WorkItemWriteOptionsResult, type WorkItemWriteResult, type WorkItemWriteScope, type WorkItemWriteTargetOptions, type WorkItemWriteTargetResult, areDomainsOnSameHost, convertRemoteProviderIdToIntegrationId, createManualTokenAuthProvider, decodeEntityIdentifier, decodeEntityIdentifiersFromGitConfig, encodeEntityIdentifier, encodeIssueOrPullRequestForGitConfig, getActionablePullRequests, getAzureRepositoryIdentity, getEntityIdentifierInput, getIntegrationConnectedKey, getIntegrationIdForRemote, getIssueFieldPresence, getIssueFromGitConfigEntityIdentifier, getIssueOwner, getProviderIdFromEntityIdentifier, getPullRequestFieldPresence, getSingleConfiguredDomain, hostFromDomain, isAzureProviderId, isCloudGitSelfManagedHostIntegrationId, isGitCloudHostIntegrationId, isGitHostIntegration, isGitSelfManagedHostIntegrationId, isIntegration, isIntegrationId, isIssuesHostIntegrationId, isIssuesIntegration, isMaybeGitLabPullRequestUrl, isSelfManagedHostIntegrationId, isSupportedCloudIntegrationId, providersMetadata, splitOwnerAndRepo, supportsCodeSuggest, toActionablePullRequestInput, toCloudIntegrationType, toIntegrationId, toTokenInfo, toTokenWithInfo };
|
|
56
|
+
export { type Account, type AccountProvider, type ActionablePullRequest, type ActionablePullRequestAccount, ActionablePullRequestBuildStatusState, type ActionablePullRequestCategory, type ActionablePullRequestEnrichedItem, type ActionablePullRequestEnrichedItems, type ActionablePullRequestFields, type ActionablePullRequestInput, ActionablePullRequestReviewState, type AuthenticationSessionLike, type AuthenticationSessionsChangeEvent, type Autolink, type AutolinkReference, type AzurePullRequestCreateCapabilityOptions, type AzurePullRequestCreateCapabilityResult, type AzurePullRequestMergeStrategy, type AzurePullRequestRepository, type AzurePullRequestWriteAction, type AzurePullRequestWriteFailure, type AzurePullRequestWriteOptions, type AzurePullRequestWriteResult, type AzurePullRequestWriteTargetOptions, type AzurePullRequestWriteTargetResult, type AzureServerPullRequestWriteOptions, type AzureServerPullRequestWriteScope, type AzureServerPullRequestWriteTargetOptions, type AzureServerWorkItemWriteScope, type AzureServicesWorkItemWriteScope, type AzureWrittenPullRequest, type BitbucketPullRequestCreateCapabilityOptions, type BitbucketPullRequestCreateCapabilityResult, type BitbucketPullRequestMergeCapability, type BitbucketPullRequestMergeStatusOptions, type BitbucketPullRequestMergeStatusResult, type BitbucketPullRequestMergeStrategy, type BitbucketPullRequestRepository, type BitbucketPullRequestWriteAction, type BitbucketPullRequestWriteFailure, type BitbucketPullRequestWriteOptions, type BitbucketPullRequestWriteReleaseOptions, type BitbucketPullRequestWriteReleaseResult, type BitbucketPullRequestWriteResult, type BitbucketPullRequestWriteTargetOptions, type BitbucketPullRequestWriteTargetResult, type BitbucketServerPullRequestActionCapability, type BitbucketServerPullRequestCreateCapabilityResult, type BitbucketServerPullRequestMergeCapability, type BitbucketServerPullRequestRepository, type BitbucketServerPullRequestVeto, type BitbucketServerPullRequestWriteAction, type BitbucketServerPullRequestWriteFailure, type BitbucketServerPullRequestWriteOptions, type BitbucketServerPullRequestWriteResult, type BitbucketServerPullRequestWriteScope, type BitbucketServerPullRequestWriteTargetOptions, type BitbucketServerPullRequestWriteTargetResult, type BitbucketServerWrittenPullRequest, type BitbucketUnsettledPullRequestWrite, type BitbucketWrittenPullRequest, type CaptureRelationshipCurrency, type ClosedPullRequestSweepOptions, type CloudIntegrationAuthType, type CloudIntegrationConnection, type CloudIntegrationType, type ConfigChangeEvent, type ConfigProvider, type ConfiguredIntegrationDescriptor, type ConfiguredIntegrationsChangeEvent, type ConnectionStateChangeEvent, type CurrentAccountResult, type DynamicAutolinkReference, type EntityIdentifier, type EntityIdentifierFields, type EntityIdentifierInput, EntityIdentifierProviderType, EntityType, EntityVersion, type FieldPresence, type GetAutolinkReferencesOptions, GitCloudHostIntegrationId, type GitConfigEntityIdentifier, type GitHostIntegration, type GitLabIssueCreateOptions, type GitLabIssueCreateOptionsResult, type GitLabIssueDeleteOptions, type GitLabIssueReceipt, type GitLabIssueWriteAddress, type GitLabIssueWriteCapability, type GitLabIssueWriteContext, type GitLabIssueWriteFailure, type GitLabIssueWriteField, type GitLabIssueWriteOptions, type GitLabIssueWriteOptionsResult, type GitLabIssueWriteResult, type GitLabIssueWriteScope, type GitLabIssueWriteTargetOptions, type GitLabIssueWriteTargetResult, type GitLabMergeBlocker, type GitLabMergeExecution, type GitLabMergeMethod, type GitLabMergeRequestCreateOptions, type GitLabMergeRequestCreateOptionsResult, type GitLabMergeRequestDeleteOptions, type GitLabMergeRequestMergeCapability, type GitLabMergeRequestProject, type GitLabMergeRequestReceipt, type GitLabMergeRequestWriteAddress, type GitLabMergeRequestWriteCapability, type GitLabMergeRequestWriteContext, type GitLabMergeRequestWriteFailure, type GitLabMergeRequestWriteField, type GitLabMergeRequestWriteOptions, type GitLabMergeRequestWriteOptionsResult, type GitLabMergeRequestWriteResult, type GitLabMergeRequestWriteScope, type GitLabMergeRequestWriteTargetOptions, type GitLabMergeRequestWriteTargetResult, type GitLabMergeSquash, GitSelfManagedHostIntegrationId, type HttpProvider, type Integration, type IntegrationAccountCacheDescriptor, type IntegrationAuthenticationProvider, type IntegrationAuthenticationProviderDescriptor, type IntegrationAuthenticationSessionDescriptor, type IntegrationById, type IntegrationCacheDescriptor, type IntegrationConnectedKey, type IntegrationCredential, type IntegrationIds, type IntegrationManager, type IntegrationManagerCacheLoader, type IntegrationManagerCacheOptions, type IntegrationManagerCacheProvider, type IntegrationManagerCacheResult, type IntegrationManagerContext, type IntegrationResult, type IntegrationServiceHooks, type IntegrationStorageProvider, type IntegrationType, type IntegrationsRemoteConfig, type IssueBatchResult, type IssueBatchTarget, type IssueCountResult, type IssueCountScope, type IssueDeleteOptions, type IssueEtagInclude, type IssueFieldGroup, IssueFilter, type IssueProjection, type IssueRelationshipFailure, type IssueRelationshipPin, type IssueRelationshipReceipt, type IssueRelationshipWriteOptions, type IssueRelationshipWriteResult, type IssueRelationshipsOptions, type IssueRelationshipsResult, type IssueSearchCapabilities, type IssueSearchCriteria, type IssueSearchRelationship, type IssueStateFilter, type IssueTrackerCreateOptions, type IssueTrackerCreateOptionsResult, type IssueTrackerDeleteOptions, type IssueTrackerField, type IssueTrackerIssueReceipt, type IssueTrackerIssueWriteOptions, type IssueTrackerIssueWriteOptionsResult, type IssueTrackerStatus, type IssueTrackerTransition, type IssueTrackerWriteConnection, type IssueTrackerWriteFailure, type IssueTrackerWriteOptions, type IssueTrackerWriteResult, type IssueTrackerWriteTargetOptions, type IssueTrackerWriteTargetResult, type IssueWriteOptions, type IssueWriteResult, type IssueWriteTargetOptions, type IssueWriteTargetResult, IssuesCloudHostIntegrationId, type IssuesIntegration, IssuesSelfManagedHostIntegrationId, type ListLinearProjectsOptions, type ListOrgsOptions, type ListProjectsOptions, LookupBackedOffError, type ManualTokenAuthProviderOptions, type MyPullRequestsForReposOptions, type ProviderAuthenticationSession, type ProviderBroadenOrg, type ProviderBroadenResult, type ProviderLinearProjectShape, type ProviderMetadata, type ProviderOrganization, type ProviderPageInfo, type ProviderPagedResult, type ProviderPullRequestSearchResult, type ProviderReference, type ProviderRepositoriesInput, type ProviderRepositoryInput, type ProviderRepositoryShape, type ProviderResult, type ProviderSweepResult, type ProviderSweepTarget, type ProviderSweepTargetEvent, type ProviderSweepTargetRef, type ProviderWarning, type ProviderWarningCause, type ProviderWarningCauseReason, type ProviderWarningKind, type ProviderWarningOmission, type ProviderWarningOmissionKind, type ProviderWarningOmissionRecovery, type ProviderWarningOmissionScope, type ProviderWarningScope, type ProviderWarningSelector, type ProviderWarningUnreadableItems, type PullRequestActivityAuthor, type PullRequestActivityComment, type PullRequestActivityItem, type PullRequestActivityResult, type PullRequestActivityReview, type PullRequestActivityReviewComment, type PullRequestActivityTarget, type PullRequestBatchResult, type PullRequestBatchTarget, type PullRequestBranchResult, type PullRequestBranchTarget, type PullRequestCheckLogResult, type PullRequestCheckLogTarget, type PullRequestCountResult, type PullRequestCountScope, type PullRequestCreateCapabilityOptions, type PullRequestCreateCapabilityResult, type PullRequestEntityIdentifierInput, type PullRequestEtagInclude, type PullRequestFieldGroup, PullRequestFilter, type PullRequestForCommitResult, type PullRequestProjection, type PullRequestSearchCapabilities, type PullRequestSearchCriteria, type PullRequestStateFilter, type PullRequestSweepOptions, type PullRequestWriteFailure, type PullRequestWriteOptions, type PullRequestWriteResult, type PullRequestWriteSnapshot, type PullRequestWriteTargetOptions, type PullRequestWriteTargetResult, type RefSet, type RepositoriesProvider, type RepositoryIdentity, type RepositoryResolution, type RepositoryResolutionStatus, type ResolveRepositoryResult, type SearchMyPullRequestsOptions, type SearchPullRequestsOptions, type Source, type Sources, type SupportedCloudIntegrationIds, type TokenInfo, type WorkItemAddress, type WorkItemCreateOptions, type WorkItemCreateOptionsResult, type WorkItemDeleteCapability, type WorkItemDeleteOptions, type WorkItemDeleteResult, type WorkItemDeleteTargetChanged, type WorkItemDeletion, type WorkItemReceipt, type WorkItemState, type WorkItemWriteContext, type WorkItemWriteField, type WorkItemWriteOptions, type WorkItemWriteOptionsResult, type WorkItemWriteResult, type WorkItemWriteScope, type WorkItemWriteTargetOptions, type WorkItemWriteTargetResult, areDomainsOnSameHost, convertRemoteProviderIdToIntegrationId, createManualTokenAuthProvider, decodeEntityIdentifier, decodeEntityIdentifiersFromGitConfig, encodeEntityIdentifier, encodeIssueOrPullRequestForGitConfig, getActionablePullRequests, getAzureRepositoryIdentity, getEntityIdentifierInput, getIntegrationConnectedKey, getIntegrationIdForRemote, getIssueFieldPresence, getIssueFromGitConfigEntityIdentifier, getIssueOwner, getProviderIdFromEntityIdentifier, getPullRequestFieldPresence, getSingleConfiguredDomain, hostFromDomain, isAzureProviderId, isCloudGitSelfManagedHostIntegrationId, isGitCloudHostIntegrationId, isGitHostIntegration, isGitSelfManagedHostIntegrationId, isIntegration, isIntegrationId, isIssuesHostIntegrationId, isIssuesIntegration, isMaybeGitLabPullRequestUrl, isSelfManagedHostIntegrationId, isSupportedCloudIntegrationId, providersMetadata, splitOwnerAndRepo, supportsCodeSuggest, toActionablePullRequestInput, toCloudIntegrationType, toIntegrationId, toTokenInfo, toTokenWithInfo };
|
|
115
57
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,70 +1,24 @@
|
|
|
1
|
-
import { CacheController } from "../../utils/promiseCache.js";
|
|
2
1
|
import { PullRequestFilter } from "../../git/models/pullRequest.js";
|
|
3
2
|
import { LookupBackedOffError } from "./errors.js";
|
|
4
3
|
import { GitCloudHostIntegrationId, GitSelfManagedHostIntegrationId, IssuesCloudHostIntegrationId, IssuesSelfManagedHostIntegrationId, isIntegrationId, isSupportedCloudIntegrationId } from "./constants.js";
|
|
5
4
|
import { isAzureProviderId } from "./providers/providerErrors.js";
|
|
6
|
-
import { getIssueFieldPresence, getPullRequestFieldPresence } from "./fieldPresence.js";
|
|
7
5
|
import { IssueFilter } from "./providerFilters.js";
|
|
8
6
|
import { providersMetadata, supportsCodeSuggest } from "./providers/metadata.js";
|
|
9
7
|
import { areDomainsOnSameHost, getSingleConfiguredDomain, hostFromDomain } from "./utils/domain.utils.js";
|
|
10
8
|
import { convertRemoteProviderIdToIntegrationId, getIntegrationConnectedKey, getIntegrationIdForRemote, isCloudGitSelfManagedHostIntegrationId, isGitCloudHostIntegrationId, isGitSelfManagedHostIntegrationId, isIssuesHostIntegrationId, isSelfManagedHostIntegrationId } from "./utils/integration.utils.js";
|
|
11
9
|
import { toCloudIntegrationType, toIntegrationId, toTokenInfo, toTokenWithInfo } from "./authentication/models.js";
|
|
10
|
+
import { getIssueFieldPresence, getPullRequestFieldPresence } from "./fieldPresence.js";
|
|
12
11
|
import { ActionablePullRequestBuildStatusState, ActionablePullRequestReviewState } from "./models/actionablePullRequest.js";
|
|
13
12
|
import { getAzureRepositoryIdentity } from "./providers/azure/azure.utils.js";
|
|
14
13
|
import { isGitHostIntegration, isIntegration, isIssuesIntegration } from "./models/publicIntegration.js";
|
|
15
14
|
import { createIntegrationService } from "./integrationService.js";
|
|
15
|
+
import { toIntegrationServiceContext } from "./managerContext.js";
|
|
16
|
+
import { GitLabMergeRequestWriter } from "./providers/gitlab/mergeRequestWrites.js";
|
|
16
17
|
import { createManualTokenAuthProvider } from "./authentication/manualTokenProvider.js";
|
|
17
18
|
import { EntityIdentifierProviderType, EntityType, EntityVersion, decodeEntityIdentifier, decodeEntityIdentifiersFromGitConfig, encodeEntityIdentifier, encodeIssueOrPullRequestForGitConfig, getEntityIdentifierInput, getIssueFromGitConfigEntityIdentifier, getIssueOwner, getProviderIdFromEntityIdentifier } from "./providers/utils.js";
|
|
18
19
|
import { isMaybeGitLabPullRequestUrl, splitOwnerAndRepo } from "./providers/gitlab/gitlab.utils.js";
|
|
19
20
|
import { getActionablePullRequests, toActionablePullRequestInput } from "./providers/actionablePullRequests.js";
|
|
20
21
|
//#region ../plus/integrations/src/index.ts
|
|
21
|
-
function loadUncached(loader) {
|
|
22
|
-
return loader(new CacheController()).value;
|
|
23
|
-
}
|
|
24
|
-
function toCacheDescriptor(integration) {
|
|
25
|
-
if (integration == null) return void 0;
|
|
26
|
-
return {
|
|
27
|
-
id: integration.id,
|
|
28
|
-
domain: integration.domain,
|
|
29
|
-
...integration.installationOrigin != null && { installationOrigin: integration.installationOrigin },
|
|
30
|
-
get maybeConnected() {
|
|
31
|
-
return integration.maybeConnected;
|
|
32
|
-
},
|
|
33
|
-
get sessionFingerprint() {
|
|
34
|
-
return integration.sessionFingerprint;
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
const uncachedIntegrationCacheProvider = {
|
|
39
|
-
getRepositoryMetadata: (_repo, _integration, loader) => loadUncached(loader),
|
|
40
|
-
getRepositoryDefaultBranch: (_repo, _integration, loader) => loadUncached(loader),
|
|
41
|
-
getPullRequestForSha: (_sha, _repo, _integration, loader) => loadUncached(loader),
|
|
42
|
-
getPullRequestForBranch: (_branch, _repo, _integration, loader) => loadUncached(loader),
|
|
43
|
-
getPullRequest: (_id, _resource, _integration, loader) => loadUncached(loader),
|
|
44
|
-
getIssueOrPullRequest: (_id, _type, _resource, _integration, loader) => loadUncached(loader),
|
|
45
|
-
getIssue: (_id, _resource, _integration, loader) => loadUncached(loader),
|
|
46
|
-
getCurrentAccount: (_integration, loader) => loadUncached(loader),
|
|
47
|
-
deletePullRequests: () => {}
|
|
48
|
-
};
|
|
49
|
-
/**
|
|
50
|
-
* Adapts the consumer's cache to the internal one: each lookup the consumer supplies is called on `cache` itself (never
|
|
51
|
-
* spread or detached, which would lose a class instance's prototype methods and `this`), and every other lookup runs
|
|
52
|
-
* uncached.
|
|
53
|
-
*/
|
|
54
|
-
function toIntegrationCacheProvider(cache) {
|
|
55
|
-
if (cache == null) return uncachedIntegrationCacheProvider;
|
|
56
|
-
return {
|
|
57
|
-
getRepositoryMetadata: (repo, integration, loader, options) => cache.getRepositoryMetadata != null ? cache.getRepositoryMetadata(repo, toCacheDescriptor(integration), loader, options) : loadUncached(loader),
|
|
58
|
-
getRepositoryDefaultBranch: (repo, integration, loader, options) => cache.getRepositoryDefaultBranch != null ? cache.getRepositoryDefaultBranch(repo, toCacheDescriptor(integration), loader, options) : loadUncached(loader),
|
|
59
|
-
getPullRequestForSha: (sha, repo, integration, loader, options) => cache.getPullRequestForSha != null ? cache.getPullRequestForSha(sha, repo, toCacheDescriptor(integration), loader, options) : loadUncached(loader),
|
|
60
|
-
getPullRequestForBranch: (branch, repo, integration, loader, options) => cache.getPullRequestForBranch != null ? cache.getPullRequestForBranch(branch, repo, toCacheDescriptor(integration), loader, options) : loadUncached(loader),
|
|
61
|
-
getPullRequest: (id, resource, integration, loader, options) => cache.getPullRequest != null ? cache.getPullRequest(id, resource, toCacheDescriptor(integration), loader, options) : loadUncached(loader),
|
|
62
|
-
getIssueOrPullRequest: (id, type, resource, integration, loader, options) => cache.getIssueOrPullRequest != null ? cache.getIssueOrPullRequest(id, type, resource, toCacheDescriptor(integration), loader, options) : loadUncached(loader),
|
|
63
|
-
getIssue: (id, resource, integration, loader, options) => cache.getIssue != null ? cache.getIssue(id, resource, toCacheDescriptor(integration), loader, options) : loadUncached(loader),
|
|
64
|
-
getCurrentAccount: (integration, loader, options) => cache.getCurrentAccount(toCacheDescriptor(integration), loader, options),
|
|
65
|
-
deletePullRequests: (scope) => cache.deletePullRequests?.(scope)
|
|
66
|
-
};
|
|
67
|
-
}
|
|
68
22
|
/**
|
|
69
23
|
* Construct an `@gitkraken/core-gitlens/plus/integrations` manager bound to the supplied runtime.
|
|
70
24
|
*
|
|
@@ -78,10 +32,7 @@ function toIntegrationCacheProvider(cache) {
|
|
|
78
32
|
* own VS Code subscriptions.
|
|
79
33
|
*/
|
|
80
34
|
function createIntegrationManager(ctx) {
|
|
81
|
-
return createIntegrationService(
|
|
82
|
-
...ctx,
|
|
83
|
-
cache: toIntegrationCacheProvider(ctx.cache)
|
|
84
|
-
});
|
|
35
|
+
return createIntegrationService(toIntegrationServiceContext(ctx), (transport) => new GitLabMergeRequestWriter(transport));
|
|
85
36
|
}
|
|
86
37
|
//#endregion
|
|
87
38
|
export { ActionablePullRequestBuildStatusState, ActionablePullRequestReviewState, EntityIdentifierProviderType, EntityType, EntityVersion, GitCloudHostIntegrationId, GitSelfManagedHostIntegrationId, IssueFilter, IssuesCloudHostIntegrationId, IssuesSelfManagedHostIntegrationId, LookupBackedOffError, PullRequestFilter, areDomainsOnSameHost, convertRemoteProviderIdToIntegrationId, createIntegrationManager, createManualTokenAuthProvider, decodeEntityIdentifier, decodeEntityIdentifiersFromGitConfig, encodeEntityIdentifier, encodeIssueOrPullRequestForGitConfig, getActionablePullRequests, getAzureRepositoryIdentity, getEntityIdentifierInput, getIntegrationConnectedKey, getIntegrationIdForRemote, getIssueFieldPresence, getIssueFromGitConfigEntityIdentifier, getIssueOwner, getProviderIdFromEntityIdentifier, getPullRequestFieldPresence, getSingleConfiguredDomain, hostFromDomain, isAzureProviderId, isCloudGitSelfManagedHostIntegrationId, isGitCloudHostIntegrationId, isGitHostIntegration, isGitSelfManagedHostIntegrationId, isIntegration, isIntegrationId, isIssuesHostIntegrationId, isIssuesIntegration, isMaybeGitLabPullRequestUrl, isSelfManagedHostIntegrationId, isSupportedCloudIntegrationId, providersMetadata, splitOwnerAndRepo, supportsCodeSuggest, toActionablePullRequestInput, toCloudIntegrationType, toIntegrationId, toTokenInfo, toTokenWithInfo };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../../plus/integrations/src/index.ts"],"sourcesContent":["// Public facade for `@gitlens/integrations`.\n//\n// External consumers should import from this entry point only, not from the\n// package's internal subpaths, with one exception: the lightweight, token-scoped\n// read API is a supported public subpath (`./lite.js`). It's kept out of this\n// facade on purpose so importing the session-managed manager doesn't eagerly pull\n// in every provider API client. The internal classes (IntegrationService,\n// IntegrationAuthenticationService, etc.) are not part of the public API and\n// may be refactored without semver bumps.\n\nimport type { Account } from '@gitlens/git/models/author.js';\nimport type { DefaultBranch } from '@gitlens/git/models/defaultBranch.js';\nimport type { Issue } from '@gitlens/git/models/issue.js';\nimport type { IssueOrPullRequest, IssueOrPullRequestType } from '@gitlens/git/models/issueOrPullRequest.js';\nimport type { PullRequest } 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 { CacheController } from '@gitlens/utils/promiseCache.js';\nimport type {\n\tAccountProvider,\n\tConfigProvider,\n\tHttpProvider,\n\tIntegrationCacheProvider,\n\tIntegrationServiceHooks,\n\tIntegrationStorageProvider,\n\tRepositoriesProvider,\n} from './context.js';\nimport { createIntegrationService } from './integrationService.js';\nimport type { IntegrationManager } from './manager.js';\nimport type { IntegrationCacheDescriptor } from './models/publicIntegration.js';\n\nexport type { Autolink, AutolinkReference, DynamicAutolinkReference, RefSet } from '@gitlens/git/models/autolink.js';\nexport type { ProviderReference } from '@gitlens/git/models/remoteProvider.js';\n\n/** A cached provider value, which may still be resolving. */\nexport type IntegrationManagerCacheResult<T> = Promise<T | undefined> | T | undefined;\n\n/** Produces an account value on a cache miss. */\nexport type IntegrationManagerCacheLoader<T> = (cacheable: CacheController) => {\n\tvalue: IntegrationManagerCacheResult<T>;\n\texpiresAt?: number;\n};\n\n/** The integration identity supplied to the consumer-owned account cache. */\nexport type IntegrationAccountCacheDescriptor = IntegrationCacheDescriptor;\n\n/** Cache controls attached to a provider account lookup. */\nexport interface IntegrationManagerCacheOptions {\n\treadonly connectionId?: string;\n\treadonly etag?: string;\n\treadonly expiryOverride?: boolean | number;\n\treadonly expireOnError?: boolean;\n}\n\n/**\n * Optional consumer-owned cache for values reused by the public manager facade.\n *\n * Only `getCurrentAccount` is required. Each other lookup is optional: one the cache omits runs its loader on every\n * call, uncached. A cache that keys entries by integration should key them by the descriptor's `id` and `domain`,\n * and treat `maybeConnected` and `sessionFingerprint` as the entry's etag, so a reconnect or a token change misses.\n *\n * The manager calls each method on the cache object itself, so a class instance (methods on its prototype) works.\n */\nexport interface IntegrationManagerCacheProvider {\n\tgetCurrentAccount(\n\t\tintegration: IntegrationAccountCacheDescriptor,\n\t\tcacheable: IntegrationManagerCacheLoader<Account>,\n\t\toptions?: IntegrationManagerCacheOptions,\n\t): IntegrationManagerCacheResult<Account>;\n\tgetRepositoryMetadata?(\n\t\trepo: ResourceDescriptor,\n\t\tintegration: IntegrationCacheDescriptor | undefined,\n\t\tcacheable: IntegrationManagerCacheLoader<RepositoryMetadata>,\n\t\toptions?: IntegrationManagerCacheOptions,\n\t): IntegrationManagerCacheResult<RepositoryMetadata>;\n\tgetRepositoryDefaultBranch?(\n\t\trepo: ResourceDescriptor,\n\t\tintegration: IntegrationCacheDescriptor | undefined,\n\t\tcacheable: IntegrationManagerCacheLoader<DefaultBranch>,\n\t\toptions?: IntegrationManagerCacheOptions,\n\t): IntegrationManagerCacheResult<DefaultBranch>;\n\tgetPullRequestForSha?(\n\t\tsha: string,\n\t\trepo: ResourceDescriptor,\n\t\tintegration: IntegrationCacheDescriptor | undefined,\n\t\tcacheable: IntegrationManagerCacheLoader<PullRequest>,\n\t\toptions?: IntegrationManagerCacheOptions,\n\t): IntegrationManagerCacheResult<PullRequest>;\n\tgetPullRequestForBranch?(\n\t\tbranch: string,\n\t\trepo: ResourceDescriptor,\n\t\tintegration: IntegrationCacheDescriptor | undefined,\n\t\tcacheable: IntegrationManagerCacheLoader<PullRequest>,\n\t\toptions?: IntegrationManagerCacheOptions,\n\t): IntegrationManagerCacheResult<PullRequest>;\n\tgetPullRequest?(\n\t\tid: string,\n\t\tresource: ResourceDescriptor,\n\t\tintegration: IntegrationCacheDescriptor | undefined,\n\t\tcacheable: IntegrationManagerCacheLoader<PullRequest>,\n\t\toptions?: IntegrationManagerCacheOptions,\n\t): IntegrationManagerCacheResult<PullRequest>;\n\tgetIssueOrPullRequest?(\n\t\tid: string,\n\t\ttype: IssueOrPullRequestType | undefined,\n\t\tresource: ResourceDescriptor,\n\t\tintegration: IntegrationCacheDescriptor | undefined,\n\t\tcacheable: IntegrationManagerCacheLoader<IssueOrPullRequest>,\n\t\toptions?: IntegrationManagerCacheOptions,\n\t): IntegrationManagerCacheResult<IssueOrPullRequest>;\n\tgetIssue?(\n\t\tid: string,\n\t\tresource: ResourceDescriptor,\n\t\tintegration: IntegrationCacheDescriptor | undefined,\n\t\tcacheable: IntegrationManagerCacheLoader<Issue>,\n\t\toptions?: IntegrationManagerCacheOptions,\n\t): IntegrationManagerCacheResult<Issue>;\n\t/** Evicts cached pull requests for the given installation origin, or all pull requests when omitted. */\n\tdeletePullRequests?(scope?: { id: IntegrationCacheDescriptor['id']; domain: string }): void;\n}\n\nfunction loadUncached<T>(loader: IntegrationManagerCacheLoader<T>): IntegrationManagerCacheResult<T> {\n\treturn loader(new CacheController()).value;\n}\n\n/**\n * What a consumer cache is handed in place of the integration itself. The getters read through to the integration\n * when the cache reads them, as reading the integration did, without handing a consumer the class.\n */\nfunction toCacheDescriptor(integration: IntegrationCacheDescriptor): IntegrationCacheDescriptor;\nfunction toCacheDescriptor(integration: IntegrationCacheDescriptor | undefined): IntegrationCacheDescriptor | undefined;\nfunction toCacheDescriptor(\n\tintegration: IntegrationCacheDescriptor | undefined,\n): IntegrationCacheDescriptor | undefined {\n\tif (integration == null) return undefined;\n\n\treturn {\n\t\tid: integration.id,\n\t\tdomain: integration.domain,\n\t\t...(integration.installationOrigin != null && { installationOrigin: integration.installationOrigin }),\n\t\tget maybeConnected() {\n\t\t\treturn integration.maybeConnected;\n\t\t},\n\t\tget sessionFingerprint() {\n\t\t\treturn integration.sessionFingerprint;\n\t\t},\n\t};\n}\n\nconst uncachedIntegrationCacheProvider: IntegrationCacheProvider = {\n\tgetRepositoryMetadata: (_repo, _integration, loader) => loadUncached(loader),\n\tgetRepositoryDefaultBranch: (_repo, _integration, loader) => loadUncached(loader),\n\tgetPullRequestForSha: (_sha, _repo, _integration, loader) => loadUncached(loader),\n\tgetPullRequestForBranch: (_branch, _repo, _integration, loader) => loadUncached(loader),\n\tgetPullRequest: (_id, _resource, _integration, loader) => loadUncached(loader),\n\tgetIssueOrPullRequest: (_id, _type, _resource, _integration, loader) => loadUncached(loader),\n\tgetIssue: (_id, _resource, _integration, loader) => loadUncached(loader),\n\tgetCurrentAccount: (_integration, loader) => loadUncached(loader),\n\t// Nothing is cached, so there is nothing to evict.\n\tdeletePullRequests: () => {},\n};\n\n/**\n * Adapts the consumer's cache to the internal one: each lookup the consumer supplies is called on `cache` itself (never\n * spread or detached, which would lose a class instance's prototype methods and `this`), and every other lookup runs\n * uncached.\n */\nfunction toIntegrationCacheProvider(cache: IntegrationManagerCacheProvider | undefined): IntegrationCacheProvider {\n\tif (cache == null) return uncachedIntegrationCacheProvider;\n\n\treturn {\n\t\tgetRepositoryMetadata: (repo, integration, loader, options) =>\n\t\t\tcache.getRepositoryMetadata != null\n\t\t\t\t? cache.getRepositoryMetadata(repo, toCacheDescriptor(integration), loader, options)\n\t\t\t\t: loadUncached(loader),\n\t\tgetRepositoryDefaultBranch: (repo, integration, loader, options) =>\n\t\t\tcache.getRepositoryDefaultBranch != null\n\t\t\t\t? cache.getRepositoryDefaultBranch(repo, toCacheDescriptor(integration), loader, options)\n\t\t\t\t: loadUncached(loader),\n\t\tgetPullRequestForSha: (sha, repo, integration, loader, options) =>\n\t\t\tcache.getPullRequestForSha != null\n\t\t\t\t? cache.getPullRequestForSha(sha, repo, toCacheDescriptor(integration), loader, options)\n\t\t\t\t: loadUncached(loader),\n\t\tgetPullRequestForBranch: (branch, repo, integration, loader, options) =>\n\t\t\tcache.getPullRequestForBranch != null\n\t\t\t\t? cache.getPullRequestForBranch(branch, repo, toCacheDescriptor(integration), loader, options)\n\t\t\t\t: loadUncached(loader),\n\t\tgetPullRequest: (id, resource, integration, loader, options) =>\n\t\t\tcache.getPullRequest != null\n\t\t\t\t? cache.getPullRequest(id, resource, toCacheDescriptor(integration), loader, options)\n\t\t\t\t: loadUncached(loader),\n\t\tgetIssueOrPullRequest: (id, type, resource, integration, loader, options) =>\n\t\t\tcache.getIssueOrPullRequest != null\n\t\t\t\t? cache.getIssueOrPullRequest(id, type, resource, toCacheDescriptor(integration), loader, options)\n\t\t\t\t: loadUncached(loader),\n\t\tgetIssue: (id, resource, integration, loader, options) =>\n\t\t\tcache.getIssue != null\n\t\t\t\t? cache.getIssue(id, resource, toCacheDescriptor(integration), loader, options)\n\t\t\t\t: loadUncached(loader),\n\t\tgetCurrentAccount: (integration, loader, options) =>\n\t\t\tcache.getCurrentAccount(toCacheDescriptor(integration), loader, options),\n\t\tdeletePullRequests: scope => cache.deletePullRequests?.(scope),\n\t};\n}\n\n/**\n * Consumer-facing runtime for {@link createIntegrationManager}.\n *\n * External consumers may omit `cache`; reads then execute their loaders directly without cross-call caching.\n * The extension host's broader integration context remains private to the implementation.\n */\nexport interface IntegrationManagerContext {\n\treadonly storage: IntegrationStorageProvider;\n\treadonly account: AccountProvider;\n\treadonly config: ConfigProvider;\n\treadonly http: HttpProvider;\n\treadonly cache?: IntegrationManagerCacheProvider;\n\treadonly repositories: RepositoriesProvider;\n\treadonly hooks?: IntegrationServiceHooks;\n}\n\nexport type {\n\tClosedPullRequestSweepOptions,\n\tGetAutolinkReferencesOptions,\n\tIntegrationManager,\n\tIssueDeleteOptions,\n\tIssueWriteOptions,\n\tIssueWriteTargetOptions,\n\tIssueWriteTargetResult,\n\tListLinearProjectsOptions,\n\tListOrgsOptions,\n\tListProjectsOptions,\n\t// Every option shape a caller has to BUILD is exported, not just the ones the manager returns:\n\t// `manager.js` is not a public subpath, so a type omitted here can't be named by a consumer at all\n\t// (`broadenIssues`' `orgs` needed `ProviderBroadenOrg` and had to be re-declared downstream).\n\tProviderBroadenOrg,\n\tProviderRepositoriesInput,\n\tProviderRepositoryInput,\n\tProviderSweepTarget,\n\tProviderSweepTargetEvent,\n\tPullRequestCreateCapabilityOptions,\n\tPullRequestSweepOptions,\n\tPullRequestWriteOptions,\n\tPullRequestWriteTargetOptions,\n} from './manager.js';\nexport type {\n\tGitLabIssueCreateOptions,\n\tGitLabIssueCreateOptionsResult,\n\tGitLabIssueDeleteOptions,\n\tGitLabIssueReceipt,\n\tGitLabIssueWriteAddress,\n\tGitLabIssueWriteCapability,\n\tGitLabIssueWriteContext,\n\tGitLabIssueWriteFailure,\n\tGitLabIssueWriteField,\n\tGitLabIssueWriteOptions,\n\tGitLabIssueWriteOptionsResult,\n\tGitLabIssueWriteResult,\n\tGitLabIssueWriteScope,\n\tGitLabIssueWriteTargetOptions,\n\tGitLabIssueWriteTargetResult,\n} from './models/gitlabIssueWrites.js';\nexport type {\n\tIssueTrackerCreateOptions,\n\tIssueTrackerCreateOptionsResult,\n\tIssueTrackerDeleteOptions,\n\tIssueTrackerField,\n\tIssueTrackerIssueReceipt,\n\tIssueTrackerIssueWriteOptions,\n\tIssueTrackerIssueWriteOptionsResult,\n\tIssueTrackerStatus,\n\tIssueTrackerTransition,\n\tIssueTrackerWriteConnection,\n\tIssueTrackerWriteFailure,\n\tIssueTrackerWriteOptions,\n\tIssueTrackerWriteResult,\n\tIssueTrackerWriteTargetOptions,\n\tIssueTrackerWriteTargetResult,\n} from './models/issueTrackerWrites.js';\nexport type {\n\tAzurePullRequestCreateCapabilityOptions,\n\tAzurePullRequestCreateCapabilityResult,\n\tAzurePullRequestMergeStrategy,\n\tAzurePullRequestRepository,\n\tAzurePullRequestWriteAction,\n\tAzurePullRequestWriteFailure,\n\tAzurePullRequestWriteOptions,\n\tAzurePullRequestWriteResult,\n\tAzurePullRequestWriteTargetOptions,\n\tAzurePullRequestWriteTargetResult,\n\tAzureServerPullRequestWriteOptions,\n\tAzureServerPullRequestWriteScope,\n\tAzureServerPullRequestWriteTargetOptions,\n\tAzureWrittenPullRequest,\n} from './models/azurePullRequestWrites.js';\nexport type {\n\tBitbucketPullRequestCreateCapabilityOptions,\n\tBitbucketPullRequestCreateCapabilityResult,\n\tBitbucketPullRequestMergeCapability,\n\tBitbucketPullRequestMergeStatusOptions,\n\tBitbucketPullRequestMergeStatusResult,\n\tBitbucketPullRequestMergeStrategy,\n\tBitbucketPullRequestRepository,\n\tBitbucketPullRequestWriteAction,\n\tBitbucketPullRequestWriteFailure,\n\tBitbucketPullRequestWriteOptions,\n\tBitbucketPullRequestWriteReleaseOptions,\n\tBitbucketPullRequestWriteReleaseResult,\n\tBitbucketPullRequestWriteResult,\n\tBitbucketPullRequestWriteTargetOptions,\n\tBitbucketPullRequestWriteTargetResult,\n\tBitbucketUnsettledPullRequestWrite,\n\tBitbucketWrittenPullRequest,\n} from './models/bitbucketPullRequestWrites.js';\nexport type {\n\tBitbucketServerPullRequestActionCapability,\n\tBitbucketServerPullRequestCreateCapabilityResult,\n\tBitbucketServerPullRequestMergeCapability,\n\tBitbucketServerPullRequestRepository,\n\tBitbucketServerPullRequestVeto,\n\tBitbucketServerPullRequestWriteAction,\n\tBitbucketServerPullRequestWriteFailure,\n\tBitbucketServerPullRequestWriteOptions,\n\tBitbucketServerPullRequestWriteResult,\n\tBitbucketServerPullRequestWriteScope,\n\tBitbucketServerPullRequestWriteTargetOptions,\n\tBitbucketServerPullRequestWriteTargetResult,\n\tBitbucketServerWrittenPullRequest,\n} from './models/bitbucketServerPullRequestWrites.js';\nexport type {\n\tAzureServerWorkItemWriteScope,\n\tAzureServicesWorkItemWriteScope,\n\tWorkItemAddress,\n\tWorkItemCreateOptions,\n\tWorkItemCreateOptionsResult,\n\tWorkItemDeleteCapability,\n\tWorkItemDeleteOptions,\n\tWorkItemDeleteResult,\n\tWorkItemDeleteTargetChanged,\n\tWorkItemDeletion,\n\tWorkItemReceipt,\n\tWorkItemState,\n\tWorkItemWriteContext,\n\tWorkItemWriteField,\n\tWorkItemWriteOptions,\n\tWorkItemWriteOptionsResult,\n\tWorkItemWriteResult,\n\tWorkItemWriteScope,\n\tWorkItemWriteTargetOptions,\n\tWorkItemWriteTargetResult,\n} from './models/workItemWrites.js';\nexport type {\n\tCaptureRelationshipCurrency,\n\tIssueRelationshipsOptions,\n\tIssueRelationshipsResult,\n\tIssueRelationshipWriteOptions,\n\tIssueRelationshipWriteResult,\n\tIssueRelationshipPin,\n\tIssueRelationshipReceipt,\n\tIssueRelationshipFailure,\n} from './models/issueRelationships.js';\nexport type { IssueWriteResult } from '@gitlens/git-github/api/issueWrites.js';\nexport type {\n\tPullRequestCreateCapabilityResult,\n\tPullRequestWriteFailure,\n\tPullRequestWriteResult,\n\tPullRequestWriteSnapshot,\n\tPullRequestWriteTargetResult,\n} from '@gitlens/git-github/api/pullRequestWrites.js';\n\n/**\n * Construct an `@gitlens/integrations` manager bound to the supplied runtime.\n *\n * The runtime is the **single** cross-boundary contract — anything the\n * package needs (HTTP, storage, cache, auth, subscription, telemetry, UI,\n * configuration, environment) flows through it. The package never imports\n * `vscode`, `Container`, or any consumer-internal types.\n *\n * The returned manager owns its internal services; dispose it (or its\n * containing scope) to release every cached integration plus the runtime's\n * own VS Code subscriptions.\n */\nexport function createIntegrationManager(ctx: IntegrationManagerContext): IntegrationManager {\n\treturn createIntegrationService({\n\t\t...ctx,\n\t\tcache: toIntegrationCacheProvider(ctx.cache),\n\t});\n}\n\n// Re-exports for the public API surface.\nexport type {\n\tAccountProvider,\n\tAuthenticationSessionsChangeEvent,\n\tConfigChangeEvent,\n\tConfigProvider,\n\tRepositoriesProvider,\n\tHttpProvider,\n\tIntegrationsRemoteConfig,\n\tIntegrationServiceHooks,\n\tIntegrationStorageProvider,\n} from './context.js';\nexport type { Source, Sources } from './telemetry.js';\nexport type { IntegrationIds, SupportedCloudIntegrationIds } from './constants.js';\nexport type { ConfiguredIntegrationsChangeEvent } from './authentication/configuredIntegrationService.js';\n\n// Authentication contract — what `IntegrationServiceHooks.createAuthenticationProvider`\n// implementers return. Consumers can plug in any auth strategy (manual token,\n// OAuth, host-managed) by returning an object implementing this interface from\n// the hook.\nexport type {\n\tIntegrationAuthenticationProvider,\n\tIntegrationAuthenticationProviderDescriptor,\n\tIntegrationAuthenticationSessionDescriptor,\n} from './authentication/integrationAuthenticationProvider.js';\nexport type {\n\tAuthenticationSessionLike,\n\tCloudIntegrationAuthType,\n\tCloudIntegrationConnection,\n\tCloudIntegrationType,\n\tConfiguredIntegrationDescriptor,\n\tProviderAuthenticationSession,\n} from './authentication/models.js';\n// Provider-id mapping helpers for consumers bridging their own provider ids to `IntegrationIds`\n// (e.g. mapping multi-account connections from `getConfigured` back to a provider) and vice versa.\nexport { toCloudIntegrationType, toIntegrationId } from './authentication/models.js';\n// Domain normalization is part of connection selection and repository resolution; consumers should use the\n// same implementation rather than importing an internal utility subpath or maintaining a divergent copy.\nexport { areDomainsOnSameHost, hostFromDomain } from './utils/domain.utils.js';\n\n// Convenience: wrap a static access token (env var, CLI flag, secret manager)\n// as an `IntegrationAuthenticationProvider`. For OAuth/refresh flows, implement\n// the interface directly — this helper is for non-interactive consumers only.\nexport {\n\tcreateManualTokenAuthProvider,\n\ttype ManualTokenAuthProviderOptions,\n} from './authentication/manualTokenProvider.js';\n\nexport {\n\tGitCloudHostIntegrationId,\n\tGitSelfManagedHostIntegrationId,\n\tIssuesCloudHostIntegrationId,\n\tIssuesSelfManagedHostIntegrationId,\n\tisIntegrationId,\n\tisSupportedCloudIntegrationId,\n} from './constants.js';\n\n// Neutral pagination + warning result types the Kepler ProviderBackend adapter maps to its own DTOs.\n// These carry no `@gitkraken/provider-apis` types, so consumers depend only on `@gitkraken/core-gitlens`.\nexport type {\n\tConnectionStateChangeEvent,\n\tProviderBroadenResult,\n\tProviderPagedResult,\n\tProviderPageInfo,\n\tProviderPullRequestSearchResult,\n\tProviderResult,\n\tProviderSweepResult,\n\tProviderSweepTargetRef,\n\tProviderWarning,\n\tProviderWarningCause,\n\tProviderWarningCauseReason,\n\tProviderWarningKind,\n\tProviderWarningOmission,\n\tProviderWarningOmissionKind,\n\tProviderWarningOmissionRecovery,\n\tProviderWarningOmissionScope,\n\tProviderWarningScope,\n\tProviderWarningSelector,\n\tProviderWarningUnreadableItems,\n\tProviderLinearProjectShape,\n\tProviderOrganization,\n\tProviderRepositoryShape,\n\tRepositoryIdentity,\n\tRepositoryResolution,\n\tRepositoryResolutionStatus,\n\tResolveRepositoryResult,\n} from './results.js';\n// Runtime enums — re-exported as values (not `export type`) so consumers can read their members.\nexport { IssueFilter, PullRequestFilter } from './providerFilters.js';\n// The filtered issue search's criteria model and the capability table that says which of it a provider honors.\n// String unions and plain interfaces, so a consumer builds criteria without importing an internal subpath.\nexport type { IssueSearchCapabilities, IssueSearchCriteria, IssueSearchRelationship } from './providerFilters.js';\n// Account-wide pull-request search criteria and the per-provider capability table.\nexport type { PullRequestSearchCapabilities, PullRequestSearchCriteria } from './providerFilters.js';\n// The count-only issue and pull-request probes' input and result shapes.\nexport type { IssueCountResult, IssueCountScope, PullRequestCountResult, PullRequestCountScope } from './results.js';\nexport type { IssueBatchResult, IssueBatchTarget } from './results.js';\nexport type { PullRequestBatchResult, PullRequestBatchTarget } from './results.js';\nexport type { IssueEtagInclude, PullRequestEtagInclude } from './reads/etag.js';\nexport type { PullRequestBranchResult, PullRequestBranchTarget } from './results.js';\nexport type { PullRequestCheckLogResult, PullRequestCheckLogTarget } from './results.js';\nexport type { PullRequestActivityResult, PullRequestActivityTarget } from './results.js';\nexport type {\n\tPullRequestActivityAuthor,\n\tPullRequestActivityComment,\n\tPullRequestActivityItem,\n\tPullRequestActivityReview,\n\tPullRequestActivityReviewComment,\n} from '@gitlens/git/models/pullRequestActivity.js';\nexport type { PullRequestForCommitResult } from './results.js';\n// The current-account read's result, and the account shape every identity-bearing read already returns.\nexport type { CurrentAccountResult } from './results.js';\nexport type { Account } from '@gitlens/git/models/author.js';\n// Cross-provider PR/issue state filters (string unions in the git models).\nexport type { PullRequestStateFilter } from '@gitlens/git/models/pullRequest.js';\nexport type { IssueStateFilter } from '@gitlens/git/models/issue.js';\n// Which read produced a row, and which of its fields that read fetched.\nexport type { PullRequestProjection } from '@gitlens/git/models/pullRequest.js';\nexport type { IssueProjection } from '@gitlens/git/models/issue.js';\nexport type { FieldPresence, IssueFieldGroup, PullRequestFieldGroup } from './fieldPresence.js';\nexport { getIssueFieldPresence, getPullRequestFieldPresence } from './fieldPresence.js';\n\n// Interface-only views of the integrations the manager hands out (`get`, `getIntegrationsForAccountWideRead`), named\n// after the internal classes they view, and the types their members take and return. The classes stay internal; see\n// `models/publicIntegration.ts`.\nexport type {\n\tGitHostIntegration,\n\tIntegration,\n\tIntegrationById,\n\tIntegrationCacheDescriptor,\n\tIntegrationConnectedKey,\n\tIntegrationCredential,\n\tIntegrationResult,\n\tIntegrationType,\n\tIssuesIntegration,\n\tMyPullRequestsForReposOptions,\n\tSearchMyPullRequestsOptions,\n\tSearchPullRequestsOptions,\n} from './models/publicIntegration.js';\n// Guards over the views. `isIntegration` replaces an `instanceof` check against the internal base class.\nexport { isGitHostIntegration, isIntegration, isIssuesIntegration } from './models/publicIntegration.js';\nexport {\n\tconvertRemoteProviderIdToIntegrationId,\n\tgetIntegrationConnectedKey,\n\tgetIntegrationIdForRemote,\n\tisCloudGitSelfManagedHostIntegrationId,\n\tisGitCloudHostIntegrationId,\n\tisGitSelfManagedHostIntegrationId,\n\tisIssuesHostIntegrationId,\n\tisSelfManagedHostIntegrationId,\n} from './utils/integration.utils.js';\nexport { getSingleConfiguredDomain } from './utils/domain.utils.js';\nexport { getAzureRepositoryIdentity } from './providers/azure/azure.utils.js';\nexport { isAzureProviderId } from './providers/providerErrors.js';\nexport { LookupBackedOffError } from './errors.js';\n\n// Provider metadata (names, domains, icons, capabilities) and the per-provider feature checks built on it.\nexport type { ProviderMetadata } from './providers/metadata.js';\nexport { providersMetadata, supportsCodeSuggest } from './providers/metadata.js';\n\n// Token fingerprints, for logging and error reporting without the token itself.\nexport type { TokenInfo } from './authentication/models.js';\nexport { toTokenInfo, toTokenWithInfo } from './authentication/models.js';\n\n// Entity identifiers: the neutral codec Launchpad (pins/snoozes), drafts and branch-issue associations key by.\nexport type {\n\tEntityIdentifier,\n\tEntityIdentifierFields,\n\tEntityIdentifierInput,\n\tGitConfigEntityIdentifier,\n\tPullRequestEntityIdentifierInput,\n} from './providers/utils.js';\n// Runtime consts (and their same-named value unions) for building identifiers without string literals.\nexport {\n\tEntityIdentifierProviderType,\n\tEntityType,\n\tEntityVersion,\n\tdecodeEntityIdentifier,\n\tdecodeEntityIdentifiersFromGitConfig,\n\tencodeEntityIdentifier,\n\tencodeIssueOrPullRequestForGitConfig,\n\tgetEntityIdentifierInput,\n\tgetIssueFromGitConfigEntityIdentifier,\n\tgetIssueOwner,\n\tgetProviderIdFromEntityIdentifier,\n} from './providers/utils.js';\n\nexport { isMaybeGitLabPullRequestUrl, splitOwnerAndRepo } from './providers/gitlab/gitlab.utils.js';\n\n// Actionable pull requests: Launchpad's categorization, over neutral copies of the provider-apis shapes it reads.\nexport type {\n\tActionablePullRequest,\n\tActionablePullRequestAccount,\n\tActionablePullRequestCategory,\n\tActionablePullRequestEnrichedItem,\n\tActionablePullRequestEnrichedItems,\n\tActionablePullRequestFields,\n\tActionablePullRequestInput,\n} from './models/actionablePullRequest.js';\nexport {\n\tActionablePullRequestBuildStatusState,\n\tActionablePullRequestReviewState,\n} from './models/actionablePullRequest.js';\nexport { getActionablePullRequests, toActionablePullRequestInput } from './providers/actionablePullRequests.js';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAyHA,SAAS,aAAgB,QAA4E;CACpG,OAAO,OAAO,IAAI,gBAAgB,CAAC,CAAC,CAAC;AACtC;AAQA,SAAS,kBACR,aACyC;CACzC,IAAI,eAAe,MAAM,OAAO,KAAA;CAEhC,OAAO;EACN,IAAI,YAAY;EAChB,QAAQ,YAAY;EACpB,GAAI,YAAY,sBAAsB,QAAQ,EAAE,oBAAoB,YAAY,mBAAmB;EACnG,IAAI,iBAAiB;GACpB,OAAO,YAAY;EACpB;EACA,IAAI,qBAAqB;GACxB,OAAO,YAAY;EACpB;CACD;AACD;AAEA,MAAM,mCAA6D;CAClE,wBAAwB,OAAO,cAAc,WAAW,aAAa,MAAM;CAC3E,6BAA6B,OAAO,cAAc,WAAW,aAAa,MAAM;CAChF,uBAAuB,MAAM,OAAO,cAAc,WAAW,aAAa,MAAM;CAChF,0BAA0B,SAAS,OAAO,cAAc,WAAW,aAAa,MAAM;CACtF,iBAAiB,KAAK,WAAW,cAAc,WAAW,aAAa,MAAM;CAC7E,wBAAwB,KAAK,OAAO,WAAW,cAAc,WAAW,aAAa,MAAM;CAC3F,WAAW,KAAK,WAAW,cAAc,WAAW,aAAa,MAAM;CACvE,oBAAoB,cAAc,WAAW,aAAa,MAAM;CAEhE,0BAA0B,CAAC;AAC5B;;;;;;AAOA,SAAS,2BAA2B,OAA8E;CACjH,IAAI,SAAS,MAAM,OAAO;CAE1B,OAAO;EACN,wBAAwB,MAAM,aAAa,QAAQ,YAClD,MAAM,yBAAyB,OAC5B,MAAM,sBAAsB,MAAM,kBAAkB,WAAW,GAAG,QAAQ,OAAO,IACjF,aAAa,MAAM;EACvB,6BAA6B,MAAM,aAAa,QAAQ,YACvD,MAAM,8BAA8B,OACjC,MAAM,2BAA2B,MAAM,kBAAkB,WAAW,GAAG,QAAQ,OAAO,IACtF,aAAa,MAAM;EACvB,uBAAuB,KAAK,MAAM,aAAa,QAAQ,YACtD,MAAM,wBAAwB,OAC3B,MAAM,qBAAqB,KAAK,MAAM,kBAAkB,WAAW,GAAG,QAAQ,OAAO,IACrF,aAAa,MAAM;EACvB,0BAA0B,QAAQ,MAAM,aAAa,QAAQ,YAC5D,MAAM,2BAA2B,OAC9B,MAAM,wBAAwB,QAAQ,MAAM,kBAAkB,WAAW,GAAG,QAAQ,OAAO,IAC3F,aAAa,MAAM;EACvB,iBAAiB,IAAI,UAAU,aAAa,QAAQ,YACnD,MAAM,kBAAkB,OACrB,MAAM,eAAe,IAAI,UAAU,kBAAkB,WAAW,GAAG,QAAQ,OAAO,IAClF,aAAa,MAAM;EACvB,wBAAwB,IAAI,MAAM,UAAU,aAAa,QAAQ,YAChE,MAAM,yBAAyB,OAC5B,MAAM,sBAAsB,IAAI,MAAM,UAAU,kBAAkB,WAAW,GAAG,QAAQ,OAAO,IAC/F,aAAa,MAAM;EACvB,WAAW,IAAI,UAAU,aAAa,QAAQ,YAC7C,MAAM,YAAY,OACf,MAAM,SAAS,IAAI,UAAU,kBAAkB,WAAW,GAAG,QAAQ,OAAO,IAC5E,aAAa,MAAM;EACvB,oBAAoB,aAAa,QAAQ,YACxC,MAAM,kBAAkB,kBAAkB,WAAW,GAAG,QAAQ,OAAO;EACxE,qBAAoB,UAAS,MAAM,qBAAqB,KAAK;CAC9D;AACD;;;;;;;;;;;;;AAmLA,SAAgB,yBAAyB,KAAoD;CAC5F,OAAO,yBAAyB;EAC/B,GAAG;EACH,OAAO,2BAA2B,IAAI,KAAK;CAC5C,CAAC;AACF"}
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../plus/integrations/src/index.ts"],"sourcesContent":["// Public facade for `@gitlens/integrations`.\n//\n// External consumers should import from this entry point only, not from the\n// package's internal subpaths, with one exception: the lightweight, token-scoped\n// read API is a supported public subpath (`./lite.js`). It's kept out of this\n// facade on purpose so importing the session-managed manager doesn't eagerly pull\n// in every provider API client. The internal classes (IntegrationService,\n// IntegrationAuthenticationService, etc.) are not part of the public API and\n// may be refactored without semver bumps.\n\nimport { createIntegrationService } from './integrationService.js';\nimport type { IntegrationManager } from './manager.js';\nimport type { IntegrationManagerContext } from './managerContext.js';\nimport { toIntegrationServiceContext } from './managerContext.js';\nimport { GitLabMergeRequestWriter } from './providers/gitlab/mergeRequestWrites.js';\n\nexport type { Autolink, AutolinkReference, DynamicAutolinkReference, RefSet } from '@gitlens/git/models/autolink.js';\nexport type { ProviderReference } from '@gitlens/git/models/remoteProvider.js';\n\nexport type {\n\tIntegrationAccountCacheDescriptor,\n\tIntegrationManagerCacheLoader,\n\tIntegrationManagerCacheOptions,\n\tIntegrationManagerCacheProvider,\n\tIntegrationManagerCacheResult,\n\tIntegrationManagerContext,\n} from './managerContext.js';\n\nexport type {\n\tClosedPullRequestSweepOptions,\n\tGetAutolinkReferencesOptions,\n\tIntegrationManager,\n\tIssueDeleteOptions,\n\tIssueWriteOptions,\n\tIssueWriteTargetOptions,\n\tIssueWriteTargetResult,\n\tListLinearProjectsOptions,\n\tListOrgsOptions,\n\tListProjectsOptions,\n\t// Every option shape a caller has to BUILD is exported, not just the ones the manager returns:\n\t// `manager.js` is not a public subpath, so a type omitted here can't be named by a consumer at all\n\t// (`broadenIssues`' `orgs` needed `ProviderBroadenOrg` and had to be re-declared downstream).\n\tProviderBroadenOrg,\n\tProviderRepositoriesInput,\n\tProviderRepositoryInput,\n\tProviderSweepTarget,\n\tProviderSweepTargetEvent,\n\tPullRequestCreateCapabilityOptions,\n\tPullRequestSweepOptions,\n\tPullRequestWriteOptions,\n\tPullRequestWriteTargetOptions,\n} from './manager.js';\nexport type {\n\tGitLabIssueCreateOptions,\n\tGitLabIssueCreateOptionsResult,\n\tGitLabIssueDeleteOptions,\n\tGitLabIssueReceipt,\n\tGitLabIssueWriteAddress,\n\tGitLabIssueWriteCapability,\n\tGitLabIssueWriteContext,\n\tGitLabIssueWriteFailure,\n\tGitLabIssueWriteField,\n\tGitLabIssueWriteOptions,\n\tGitLabIssueWriteOptionsResult,\n\tGitLabIssueWriteResult,\n\tGitLabIssueWriteScope,\n\tGitLabIssueWriteTargetOptions,\n\tGitLabIssueWriteTargetResult,\n} from './models/gitlabIssueWrites.js';\nexport type {\n\tGitLabMergeBlocker,\n\tGitLabMergeExecution,\n\tGitLabMergeMethod,\n\tGitLabMergeRequestCreateOptions,\n\tGitLabMergeRequestCreateOptionsResult,\n\tGitLabMergeRequestDeleteOptions,\n\tGitLabMergeRequestMergeCapability,\n\tGitLabMergeRequestProject,\n\tGitLabMergeRequestReceipt,\n\tGitLabMergeRequestWriteAddress,\n\tGitLabMergeRequestWriteCapability,\n\tGitLabMergeRequestWriteContext,\n\tGitLabMergeRequestWriteFailure,\n\tGitLabMergeRequestWriteField,\n\tGitLabMergeRequestWriteOptions,\n\tGitLabMergeRequestWriteOptionsResult,\n\tGitLabMergeRequestWriteResult,\n\tGitLabMergeRequestWriteScope,\n\tGitLabMergeRequestWriteTargetOptions,\n\tGitLabMergeRequestWriteTargetResult,\n\tGitLabMergeSquash,\n} from './models/gitlabMergeRequestWrites.js';\nexport type {\n\tIssueTrackerCreateOptions,\n\tIssueTrackerCreateOptionsResult,\n\tIssueTrackerDeleteOptions,\n\tIssueTrackerField,\n\tIssueTrackerIssueReceipt,\n\tIssueTrackerIssueWriteOptions,\n\tIssueTrackerIssueWriteOptionsResult,\n\tIssueTrackerStatus,\n\tIssueTrackerTransition,\n\tIssueTrackerWriteConnection,\n\tIssueTrackerWriteFailure,\n\tIssueTrackerWriteOptions,\n\tIssueTrackerWriteResult,\n\tIssueTrackerWriteTargetOptions,\n\tIssueTrackerWriteTargetResult,\n} from './models/issueTrackerWrites.js';\nexport type {\n\tAzurePullRequestCreateCapabilityOptions,\n\tAzurePullRequestCreateCapabilityResult,\n\tAzurePullRequestMergeStrategy,\n\tAzurePullRequestRepository,\n\tAzurePullRequestWriteAction,\n\tAzurePullRequestWriteFailure,\n\tAzurePullRequestWriteOptions,\n\tAzurePullRequestWriteResult,\n\tAzurePullRequestWriteTargetOptions,\n\tAzurePullRequestWriteTargetResult,\n\tAzureServerPullRequestWriteOptions,\n\tAzureServerPullRequestWriteScope,\n\tAzureServerPullRequestWriteTargetOptions,\n\tAzureWrittenPullRequest,\n} from './models/azurePullRequestWrites.js';\nexport type {\n\tBitbucketPullRequestCreateCapabilityOptions,\n\tBitbucketPullRequestCreateCapabilityResult,\n\tBitbucketPullRequestMergeCapability,\n\tBitbucketPullRequestMergeStatusOptions,\n\tBitbucketPullRequestMergeStatusResult,\n\tBitbucketPullRequestMergeStrategy,\n\tBitbucketPullRequestRepository,\n\tBitbucketPullRequestWriteAction,\n\tBitbucketPullRequestWriteFailure,\n\tBitbucketPullRequestWriteOptions,\n\tBitbucketPullRequestWriteReleaseOptions,\n\tBitbucketPullRequestWriteReleaseResult,\n\tBitbucketPullRequestWriteResult,\n\tBitbucketPullRequestWriteTargetOptions,\n\tBitbucketPullRequestWriteTargetResult,\n\tBitbucketUnsettledPullRequestWrite,\n\tBitbucketWrittenPullRequest,\n} from './models/bitbucketPullRequestWrites.js';\nexport type {\n\tBitbucketServerPullRequestActionCapability,\n\tBitbucketServerPullRequestCreateCapabilityResult,\n\tBitbucketServerPullRequestMergeCapability,\n\tBitbucketServerPullRequestRepository,\n\tBitbucketServerPullRequestVeto,\n\tBitbucketServerPullRequestWriteAction,\n\tBitbucketServerPullRequestWriteFailure,\n\tBitbucketServerPullRequestWriteOptions,\n\tBitbucketServerPullRequestWriteResult,\n\tBitbucketServerPullRequestWriteScope,\n\tBitbucketServerPullRequestWriteTargetOptions,\n\tBitbucketServerPullRequestWriteTargetResult,\n\tBitbucketServerWrittenPullRequest,\n} from './models/bitbucketServerPullRequestWrites.js';\nexport type {\n\tAzureServerWorkItemWriteScope,\n\tAzureServicesWorkItemWriteScope,\n\tWorkItemAddress,\n\tWorkItemCreateOptions,\n\tWorkItemCreateOptionsResult,\n\tWorkItemDeleteCapability,\n\tWorkItemDeleteOptions,\n\tWorkItemDeleteResult,\n\tWorkItemDeleteTargetChanged,\n\tWorkItemDeletion,\n\tWorkItemReceipt,\n\tWorkItemState,\n\tWorkItemWriteContext,\n\tWorkItemWriteField,\n\tWorkItemWriteOptions,\n\tWorkItemWriteOptionsResult,\n\tWorkItemWriteResult,\n\tWorkItemWriteScope,\n\tWorkItemWriteTargetOptions,\n\tWorkItemWriteTargetResult,\n} from './models/workItemWrites.js';\nexport type {\n\tCaptureRelationshipCurrency,\n\tIssueRelationshipsOptions,\n\tIssueRelationshipsResult,\n\tIssueRelationshipWriteOptions,\n\tIssueRelationshipWriteResult,\n\tIssueRelationshipPin,\n\tIssueRelationshipReceipt,\n\tIssueRelationshipFailure,\n} from './models/issueRelationships.js';\nexport type { IssueWriteResult } from '@gitlens/git-github/api/issueWrites.js';\nexport type {\n\tPullRequestCreateCapabilityResult,\n\tPullRequestWriteFailure,\n\tPullRequestWriteResult,\n\tPullRequestWriteSnapshot,\n\tPullRequestWriteTargetResult,\n} from '@gitlens/git-github/api/pullRequestWrites.js';\n\n/**\n * Construct an `@gitlens/integrations` manager bound to the supplied runtime.\n *\n * The runtime is the **single** cross-boundary contract — anything the\n * package needs (HTTP, storage, cache, auth, subscription, telemetry, UI,\n * configuration, environment) flows through it. The package never imports\n * `vscode`, `Container`, or any consumer-internal types.\n *\n * The returned manager owns its internal services; dispose it (or its\n * containing scope) to release every cached integration plus the runtime's\n * own VS Code subscriptions.\n */\nexport function createIntegrationManager(ctx: IntegrationManagerContext): IntegrationManager {\n\treturn createIntegrationService(\n\t\ttoIntegrationServiceContext(ctx),\n\t\ttransport => new GitLabMergeRequestWriter(transport),\n\t);\n}\n\n// Re-exports for the public API surface.\nexport type {\n\tAccountProvider,\n\tAuthenticationSessionsChangeEvent,\n\tConfigChangeEvent,\n\tConfigProvider,\n\tRepositoriesProvider,\n\tHttpProvider,\n\tIntegrationsRemoteConfig,\n\tIntegrationServiceHooks,\n\tIntegrationStorageProvider,\n} from './context.js';\nexport type { Source, Sources } from './telemetry.js';\nexport type { IntegrationIds, SupportedCloudIntegrationIds } from './constants.js';\nexport type { ConfiguredIntegrationsChangeEvent } from './authentication/configuredIntegrationService.js';\n\n// Authentication contract — what `IntegrationServiceHooks.createAuthenticationProvider`\n// implementers return. Consumers can plug in any auth strategy (manual token,\n// OAuth, host-managed) by returning an object implementing this interface from\n// the hook.\nexport type {\n\tIntegrationAuthenticationProvider,\n\tIntegrationAuthenticationProviderDescriptor,\n\tIntegrationAuthenticationSessionDescriptor,\n} from './authentication/integrationAuthenticationProvider.js';\nexport type {\n\tAuthenticationSessionLike,\n\tCloudIntegrationAuthType,\n\tCloudIntegrationConnection,\n\tCloudIntegrationType,\n\tConfiguredIntegrationDescriptor,\n\tProviderAuthenticationSession,\n} from './authentication/models.js';\n// Provider-id mapping helpers for consumers bridging their own provider ids to `IntegrationIds`\n// (e.g. mapping multi-account connections from `getConfigured` back to a provider) and vice versa.\nexport { toCloudIntegrationType, toIntegrationId } from './authentication/models.js';\n// Domain normalization is part of connection selection and repository resolution; consumers should use the\n// same implementation rather than importing an internal utility subpath or maintaining a divergent copy.\nexport { areDomainsOnSameHost, hostFromDomain } from './utils/domain.utils.js';\n\n// Convenience: wrap a static access token (env var, CLI flag, secret manager)\n// as an `IntegrationAuthenticationProvider`. For OAuth/refresh flows, implement\n// the interface directly — this helper is for non-interactive consumers only.\nexport {\n\tcreateManualTokenAuthProvider,\n\ttype ManualTokenAuthProviderOptions,\n} from './authentication/manualTokenProvider.js';\n\nexport {\n\tGitCloudHostIntegrationId,\n\tGitSelfManagedHostIntegrationId,\n\tIssuesCloudHostIntegrationId,\n\tIssuesSelfManagedHostIntegrationId,\n\tisIntegrationId,\n\tisSupportedCloudIntegrationId,\n} from './constants.js';\n\n// Neutral pagination + warning result types the Kepler ProviderBackend adapter maps to its own DTOs.\n// These carry no `@gitkraken/provider-apis` types, so consumers depend only on `@gitkraken/core-gitlens`.\nexport type {\n\tConnectionStateChangeEvent,\n\tProviderBroadenResult,\n\tProviderPagedResult,\n\tProviderPageInfo,\n\tProviderPullRequestSearchResult,\n\tProviderResult,\n\tProviderSweepResult,\n\tProviderSweepTargetRef,\n\tProviderWarning,\n\tProviderWarningCause,\n\tProviderWarningCauseReason,\n\tProviderWarningKind,\n\tProviderWarningOmission,\n\tProviderWarningOmissionKind,\n\tProviderWarningOmissionRecovery,\n\tProviderWarningOmissionScope,\n\tProviderWarningScope,\n\tProviderWarningSelector,\n\tProviderWarningUnreadableItems,\n\tProviderLinearProjectShape,\n\tProviderOrganization,\n\tProviderRepositoryShape,\n\tRepositoryIdentity,\n\tRepositoryResolution,\n\tRepositoryResolutionStatus,\n\tResolveRepositoryResult,\n} from './results.js';\n// Runtime enums — re-exported as values (not `export type`) so consumers can read their members.\nexport { IssueFilter, PullRequestFilter } from './providerFilters.js';\n// The filtered issue search's criteria model and the capability table that says which of it a provider honors.\n// String unions and plain interfaces, so a consumer builds criteria without importing an internal subpath.\nexport type { IssueSearchCapabilities, IssueSearchCriteria, IssueSearchRelationship } from './providerFilters.js';\n// Account-wide pull-request search criteria and the per-provider capability table.\nexport type { PullRequestSearchCapabilities, PullRequestSearchCriteria } from './providerFilters.js';\n// The count-only issue and pull-request probes' input and result shapes.\nexport type { IssueCountResult, IssueCountScope, PullRequestCountResult, PullRequestCountScope } from './results.js';\nexport type { IssueBatchResult, IssueBatchTarget } from './results.js';\nexport type { PullRequestBatchResult, PullRequestBatchTarget } from './results.js';\nexport type { IssueEtagInclude, PullRequestEtagInclude } from './reads/etag.js';\nexport type { PullRequestBranchResult, PullRequestBranchTarget } from './results.js';\nexport type { PullRequestCheckLogResult, PullRequestCheckLogTarget } from './results.js';\nexport type { PullRequestActivityResult, PullRequestActivityTarget } from './results.js';\nexport type {\n\tPullRequestActivityAuthor,\n\tPullRequestActivityComment,\n\tPullRequestActivityItem,\n\tPullRequestActivityReview,\n\tPullRequestActivityReviewComment,\n} from '@gitlens/git/models/pullRequestActivity.js';\nexport type { PullRequestForCommitResult } from './results.js';\n// The current-account read's result, and the account shape every identity-bearing read already returns.\nexport type { CurrentAccountResult } from './results.js';\nexport type { Account } from '@gitlens/git/models/author.js';\n// Cross-provider PR/issue state filters (string unions in the git models).\nexport type { PullRequestStateFilter } from '@gitlens/git/models/pullRequest.js';\nexport type { IssueStateFilter } from '@gitlens/git/models/issue.js';\n// Which read produced a row, and which of its fields that read fetched.\nexport type { PullRequestProjection } from '@gitlens/git/models/pullRequest.js';\nexport type { IssueProjection } from '@gitlens/git/models/issue.js';\nexport type { FieldPresence, IssueFieldGroup, PullRequestFieldGroup } from './fieldPresence.js';\nexport { getIssueFieldPresence, getPullRequestFieldPresence } from './fieldPresence.js';\n\n// Interface-only views of the integrations the manager hands out (`get`, `getIntegrationsForAccountWideRead`), named\n// after the internal classes they view, and the types their members take and return. The classes stay internal; see\n// `models/publicIntegration.ts`.\nexport type {\n\tGitHostIntegration,\n\tIntegration,\n\tIntegrationById,\n\tIntegrationCacheDescriptor,\n\tIntegrationConnectedKey,\n\tIntegrationCredential,\n\tIntegrationResult,\n\tIntegrationType,\n\tIssuesIntegration,\n\tMyPullRequestsForReposOptions,\n\tSearchMyPullRequestsOptions,\n\tSearchPullRequestsOptions,\n} from './models/publicIntegration.js';\n// Guards over the views. `isIntegration` replaces an `instanceof` check against the internal base class.\nexport { isGitHostIntegration, isIntegration, isIssuesIntegration } from './models/publicIntegration.js';\nexport {\n\tconvertRemoteProviderIdToIntegrationId,\n\tgetIntegrationConnectedKey,\n\tgetIntegrationIdForRemote,\n\tisCloudGitSelfManagedHostIntegrationId,\n\tisGitCloudHostIntegrationId,\n\tisGitSelfManagedHostIntegrationId,\n\tisIssuesHostIntegrationId,\n\tisSelfManagedHostIntegrationId,\n} from './utils/integration.utils.js';\nexport { getSingleConfiguredDomain } from './utils/domain.utils.js';\nexport { getAzureRepositoryIdentity } from './providers/azure/azure.utils.js';\nexport { isAzureProviderId } from './providers/providerErrors.js';\nexport { LookupBackedOffError } from './errors.js';\n\n// Provider metadata (names, domains, icons, capabilities) and the per-provider feature checks built on it.\nexport type { ProviderMetadata } from './providers/metadata.js';\nexport { providersMetadata, supportsCodeSuggest } from './providers/metadata.js';\n\n// Token fingerprints, for logging and error reporting without the token itself.\nexport type { TokenInfo } from './authentication/models.js';\nexport { toTokenInfo, toTokenWithInfo } from './authentication/models.js';\n\n// Entity identifiers: the neutral codec Launchpad (pins/snoozes), drafts and branch-issue associations key by.\nexport type {\n\tEntityIdentifier,\n\tEntityIdentifierFields,\n\tEntityIdentifierInput,\n\tGitConfigEntityIdentifier,\n\tPullRequestEntityIdentifierInput,\n} from './providers/utils.js';\n// Runtime consts (and their same-named value unions) for building identifiers without string literals.\nexport {\n\tEntityIdentifierProviderType,\n\tEntityType,\n\tEntityVersion,\n\tdecodeEntityIdentifier,\n\tdecodeEntityIdentifiersFromGitConfig,\n\tencodeEntityIdentifier,\n\tencodeIssueOrPullRequestForGitConfig,\n\tgetEntityIdentifierInput,\n\tgetIssueFromGitConfigEntityIdentifier,\n\tgetIssueOwner,\n\tgetProviderIdFromEntityIdentifier,\n} from './providers/utils.js';\n\nexport { isMaybeGitLabPullRequestUrl, splitOwnerAndRepo } from './providers/gitlab/gitlab.utils.js';\n\n// Actionable pull requests: Launchpad's categorization, over neutral copies of the provider-apis shapes it reads.\nexport type {\n\tActionablePullRequest,\n\tActionablePullRequestAccount,\n\tActionablePullRequestCategory,\n\tActionablePullRequestEnrichedItem,\n\tActionablePullRequestEnrichedItems,\n\tActionablePullRequestFields,\n\tActionablePullRequestInput,\n} from './models/actionablePullRequest.js';\nexport {\n\tActionablePullRequestBuildStatusState,\n\tActionablePullRequestReviewState,\n} from './models/actionablePullRequest.js';\nexport { getActionablePullRequests, toActionablePullRequestInput } from './providers/actionablePullRequests.js';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoNA,SAAgB,yBAAyB,KAAoD;CAC5F,OAAO,yBACN,4BAA4B,GAAG,IAC/B,cAAa,IAAI,yBAAyB,SAAS,CACpD;AACD"}
|
|
@@ -18,6 +18,7 @@ import { AzurePullRequestCreateCapabilityOptions, AzurePullRequestCreateCapabili
|
|
|
18
18
|
import { BitbucketPullRequestCreateCapabilityOptions, BitbucketPullRequestCreateCapabilityResult, BitbucketPullRequestMergeStatusOptions, BitbucketPullRequestMergeStatusResult, BitbucketPullRequestWriteOptions, BitbucketPullRequestWriteReleaseOptions, BitbucketPullRequestWriteReleaseResult, BitbucketPullRequestWriteResult, BitbucketPullRequestWriteTargetOptions, BitbucketPullRequestWriteTargetResult } from "./models/bitbucketPullRequestWrites.js";
|
|
19
19
|
import { BitbucketServerPullRequestCreateCapabilityResult, BitbucketServerPullRequestWriteOptions, BitbucketServerPullRequestWriteResult, BitbucketServerPullRequestWriteScope, BitbucketServerPullRequestWriteTargetOptions, BitbucketServerPullRequestWriteTargetResult } from "./models/bitbucketServerPullRequestWrites.js";
|
|
20
20
|
import { GitLabIssueCreateOptions, GitLabIssueCreateOptionsResult, GitLabIssueDeleteOptions, GitLabIssueWriteAddress, GitLabIssueWriteOptions, GitLabIssueWriteOptionsResult, GitLabIssueWriteResult, GitLabIssueWriteTargetOptions, GitLabIssueWriteTargetResult } from "./models/gitlabIssueWrites.js";
|
|
21
|
+
import { GitLabMergeRequestCreateOptions, GitLabMergeRequestCreateOptionsResult, GitLabMergeRequestDeleteOptions, GitLabMergeRequestWriteAddress, GitLabMergeRequestWriteOptions, GitLabMergeRequestWriteOptionsResult, GitLabMergeRequestWriteResult, GitLabMergeRequestWriteTargetOptions, GitLabMergeRequestWriteTargetResult } from "./models/gitlabMergeRequestWrites.js";
|
|
21
22
|
import { CaptureRelationshipCurrency, IssueRelationshipWriteOptions, IssueRelationshipWriteResult, IssueRelationshipsOptions, IssueRelationshipsResult } from "./models/issueRelationships.js";
|
|
22
23
|
import { IssueFilter, SupportedFilters } from "./providerFilters.js";
|
|
23
24
|
import { IssueEtagInclude, PullRequestEtagInclude } from "./reads/etag.js";
|
|
@@ -30,10 +31,12 @@ import { IssuesIntegration } from "./models/issuesIntegration.js";
|
|
|
30
31
|
import { Integration, IntegrationBase, IntegrationById } from "./models/integration.js";
|
|
31
32
|
import { ProviderReposInput } from "./providers/models.js";
|
|
32
33
|
import { GitHostIntegration } from "./models/gitHostIntegration.js";
|
|
34
|
+
import { GitLabWriteTransport } from "./providers/gitlab/writeTransport.js";
|
|
33
35
|
import { ApiClients } from "./providers/apiClients.js";
|
|
34
36
|
import { AzureDevOpsIntegration } from "./providers/azureDevOps.js";
|
|
35
37
|
import { BitbucketIntegration } from "./providers/bitbucket.js";
|
|
36
38
|
import { GitHubEnterpriseIntegration, GitHubIntegration } from "./providers/github.js";
|
|
39
|
+
import { GitLabMergeRequestWriter } from "./providers/gitlab/mergeRequestWrites.js";
|
|
37
40
|
import { RepositoryResolutionContext } from "./reads/context.js";
|
|
38
41
|
import { IntegrationAuthenticationService } from "./authentication/integrationAuthenticationService.js";
|
|
39
42
|
//#region ../plus/integrations/src/integrationService.d.ts
|
|
@@ -41,10 +44,12 @@ import { IntegrationAuthenticationService } from "./authentication/integrationAu
|
|
|
41
44
|
export interface IntegrationConnectionChangeEvent extends ConnectionStateChangeEvent {
|
|
42
45
|
integration: IntegrationBase;
|
|
43
46
|
}
|
|
47
|
+
export type GitLabMergeRequestWriterFactory = (transport: GitLabWriteTransport) => GitLabMergeRequestWriter;
|
|
44
48
|
export declare class IntegrationService implements Disposable, IntegrationManager, RepositoryResolutionContext {
|
|
45
49
|
private readonly authenticationService;
|
|
46
50
|
private readonly configuredIntegrationService;
|
|
47
51
|
private readonly ctx;
|
|
52
|
+
private readonly createGitLabMergeRequestWriter?;
|
|
48
53
|
get onDidChange(): Event<ConfiguredIntegrationsChangeEvent>;
|
|
49
54
|
private readonly _onDidChangeConnectionState;
|
|
50
55
|
get onDidChangeConnectionState(): Event<ConnectionStateChangeEvent>;
|
|
@@ -59,7 +64,7 @@ export declare class IntegrationService implements Disposable, IntegrationManage
|
|
|
59
64
|
get apis(): ApiClients;
|
|
60
65
|
/** The shared `GitHubApi` instance — also consumed by the host's GitHub git provider (one instance). */
|
|
61
66
|
get github(): Promise<GitHubApi | undefined>;
|
|
62
|
-
constructor(authenticationService: IntegrationAuthenticationService, configuredIntegrationService: ConfiguredIntegrationService, ctx: IntegrationServiceContext);
|
|
67
|
+
constructor(authenticationService: IntegrationAuthenticationService, configuredIntegrationService: ConfiguredIntegrationService, ctx: IntegrationServiceContext, createGitLabMergeRequestWriter?: GitLabMergeRequestWriterFactory | undefined);
|
|
63
68
|
dispose(): void;
|
|
64
69
|
connectCloudIntegrations(options?: {
|
|
65
70
|
integrationIds: SupportedCloudIntegrationIds[];
|
|
@@ -554,6 +559,13 @@ export declare class IntegrationService implements Disposable, IntegrationManage
|
|
|
554
559
|
writeGitLabIssue(options: GitLabIssueWriteOptions): Promise<GitLabIssueWriteResult>;
|
|
555
560
|
deleteGitLabIssue(options: GitLabIssueDeleteOptions): Promise<GitLabIssueWriteResult>;
|
|
556
561
|
private withGitLabIssueWriter;
|
|
562
|
+
getGitLabMergeRequestCreateOptions(options: GitLabMergeRequestCreateOptions): Promise<GitLabMergeRequestCreateOptionsResult>;
|
|
563
|
+
getGitLabMergeRequestWriteOptions(options: GitLabMergeRequestWriteAddress): Promise<GitLabMergeRequestWriteOptionsResult>;
|
|
564
|
+
resolveGitLabMergeRequestWriteTarget(options: GitLabMergeRequestWriteTargetOptions): Promise<GitLabMergeRequestWriteTargetResult>;
|
|
565
|
+
writeGitLabMergeRequest(options: GitLabMergeRequestWriteOptions): Promise<GitLabMergeRequestWriteResult>;
|
|
566
|
+
deleteGitLabMergeRequest(options: GitLabMergeRequestDeleteOptions): Promise<GitLabMergeRequestWriteResult>;
|
|
567
|
+
private withGitLabMergeRequestWriter;
|
|
568
|
+
private withGitLabWriter;
|
|
557
569
|
getIssueTrackerCreateOptions(options: IssueTrackerCreateOptions): Promise<IssueTrackerCreateOptionsResult>;
|
|
558
570
|
getIssueTrackerIssueWriteOptions(options: IssueTrackerIssueWriteOptions): Promise<IssueTrackerIssueWriteOptionsResult>;
|
|
559
571
|
writeIssueTrackerIssue(options: IssueTrackerWriteOptions): Promise<IssueTrackerWriteResult>;
|
|
@@ -687,6 +699,6 @@ export declare class IntegrationService implements Disposable, IntegrationManage
|
|
|
687
699
|
refreshConnections(): Promise<void>;
|
|
688
700
|
}
|
|
689
701
|
/** Internal factory used by the GitLens host and integration tests that need the full service surface. */
|
|
690
|
-
export declare function createIntegrationService(ctx: IntegrationServiceContext): IntegrationService;
|
|
702
|
+
export declare function createIntegrationService(ctx: IntegrationServiceContext, createGitLabMergeRequestWriter?: GitLabMergeRequestWriterFactory): IntegrationService;
|
|
691
703
|
//#endregion
|
|
692
704
|
//# sourceMappingURL=integrationService.d.ts.map
|
|
@@ -27,7 +27,7 @@ import { toBitbucketPullRequestWriteFailure } from "./providers/bitbucketPullReq
|
|
|
27
27
|
import { isBitbucketPullRequestMergeStatusRead, isBitbucketPullRequestScope, isBitbucketPullRequestWrite, isBitbucketPullRequestWriteRelease } from "./providers/bitbucketPullRequestWrites.js";
|
|
28
28
|
import { toBitbucketServerPullRequestWriteFailure } from "./providers/bitbucketServerPullRequestWriteErrors.js";
|
|
29
29
|
import { isBitbucketServerPullRequestScope, isBitbucketServerPullRequestWrite } from "./providers/bitbucketServerPullRequestWrites.js";
|
|
30
|
-
import {
|
|
30
|
+
import { gitLabWriteFailure, toGitLabPreflightFailure } from "./providers/gitlab/writeErrors.js";
|
|
31
31
|
import { toJiraIssueWriteFailure } from "./providers/jiraIssueWriteErrors.js";
|
|
32
32
|
import { isJiraWriteIdentifier } from "./providers/jiraIssueWrites.js";
|
|
33
33
|
import { getAutolinkReferences } from "./reads/autolinks.js";
|
|
@@ -57,6 +57,7 @@ var IntegrationService = class {
|
|
|
57
57
|
authenticationService;
|
|
58
58
|
configuredIntegrationService;
|
|
59
59
|
ctx;
|
|
60
|
+
createGitLabMergeRequestWriter;
|
|
60
61
|
get onDidChange() {
|
|
61
62
|
return this.configuredIntegrationService.onDidChange;
|
|
62
63
|
}
|
|
@@ -79,10 +80,11 @@ var IntegrationService = class {
|
|
|
79
80
|
get github() {
|
|
80
81
|
return this.apis.github;
|
|
81
82
|
}
|
|
82
|
-
constructor(authenticationService, configuredIntegrationService, ctx) {
|
|
83
|
+
constructor(authenticationService, configuredIntegrationService, ctx, createGitLabMergeRequestWriter) {
|
|
83
84
|
this.authenticationService = authenticationService;
|
|
84
85
|
this.configuredIntegrationService = configuredIntegrationService;
|
|
85
86
|
this.ctx = ctx;
|
|
87
|
+
this.createGitLabMergeRequestWriter = createGitLabMergeRequestWriter;
|
|
86
88
|
this._disposable = fromDisposables(configuredIntegrationService.onWillChangeSession(({ integrationId, session, previousDomain }) => {
|
|
87
89
|
this.onSessionPublishing(integrationId, { session }, [session.domain, previousDomain]);
|
|
88
90
|
}), configuredIntegrationService.onWillRemoveSessions(({ integrationId, connectionId, cloud, domain }) => {
|
|
@@ -1005,18 +1007,52 @@ var IntegrationService = class {
|
|
|
1005
1007
|
const input = { ...options };
|
|
1006
1008
|
return this.withGitLabIssueWriter(input, "write", (writer) => writer.delete(input));
|
|
1007
1009
|
}
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1010
|
+
withGitLabIssueWriter(scope, access, run) {
|
|
1011
|
+
return this.withGitLabWriter(scope, access, (integration, connection, isSelectionCurrent) => integration.getIssueWriter(scope, connection, isSelectionCurrent), run);
|
|
1012
|
+
}
|
|
1013
|
+
getGitLabMergeRequestCreateOptions(options) {
|
|
1014
|
+
const input = { ...options };
|
|
1015
|
+
return this.withGitLabMergeRequestWriter(input, "read", (writer) => writer.getCreateOptions(input));
|
|
1016
|
+
}
|
|
1017
|
+
getGitLabMergeRequestWriteOptions(options) {
|
|
1018
|
+
const input = { ...options };
|
|
1019
|
+
return this.withGitLabMergeRequestWriter(input, "read", (writer) => writer.getMergeRequestOptions(input));
|
|
1020
|
+
}
|
|
1021
|
+
resolveGitLabMergeRequestWriteTarget(options) {
|
|
1022
|
+
const input = { ...options };
|
|
1023
|
+
return this.withGitLabMergeRequestWriter(input, "read", (writer) => writer.resolveTarget(input));
|
|
1024
|
+
}
|
|
1025
|
+
writeGitLabMergeRequest(options) {
|
|
1026
|
+
const input = { ...options };
|
|
1027
|
+
return this.withGitLabMergeRequestWriter(input, "write", (writer) => writer.write(input));
|
|
1028
|
+
}
|
|
1029
|
+
deleteGitLabMergeRequest(options) {
|
|
1030
|
+
const input = { ...options };
|
|
1031
|
+
return this.withGitLabMergeRequestWriter(input, "write", (writer) => writer.delete(input));
|
|
1032
|
+
}
|
|
1033
|
+
async withGitLabMergeRequestWriter(scope, access, run) {
|
|
1034
|
+
const create = this.createGitLabMergeRequestWriter;
|
|
1035
|
+
if (create == null) return gitLabWriteFailure("unsupported");
|
|
1036
|
+
return this.withGitLabWriter(scope, access, async (integration, connection, isSelectionCurrent) => {
|
|
1037
|
+
const selected = await integration.getWriteTransport(scope, connection, isSelectionCurrent);
|
|
1038
|
+
return selected && {
|
|
1039
|
+
writer: create(selected.transport),
|
|
1040
|
+
isCurrent: selected.isCurrent
|
|
1041
|
+
};
|
|
1042
|
+
}, run);
|
|
1043
|
+
}
|
|
1044
|
+
async withGitLabWriter(scope, access, select, run) {
|
|
1045
|
+
if (scope.providerId !== "gitlab") return gitLabWriteFailure("unsupported");
|
|
1046
|
+
if (typeof scope.connectionId !== "string" || !scope.connectionId || scope.connectionId.trim() !== scope.connectionId || scope.baseUrl !== "https://gitlab.com" || scope.expectedAccountId !== void 0 && !isGitLabDecimalId(scope.expectedAccountId)) return gitLabWriteFailure("invalid-input");
|
|
1011
1047
|
try {
|
|
1012
1048
|
const selection = await this.configuredIntegrationService.captureConnectionSelection(scope.providerId, scope.connectionId);
|
|
1013
|
-
if (!selection?.isCurrent()) return
|
|
1014
|
-
const selected = await (await this.get(scope.providerId)
|
|
1015
|
-
if (selected == null) return
|
|
1049
|
+
if (!selection?.isCurrent()) return gitLabWriteFailure("no-connection");
|
|
1050
|
+
const selected = await select(await this.get(scope.providerId), selection.connection, selection.isCurrent);
|
|
1051
|
+
if (selected == null) return gitLabWriteFailure("no-connection");
|
|
1016
1052
|
const result = await run(selected.writer);
|
|
1017
|
-
return access === "read" && !await selected.isCurrent() ?
|
|
1053
|
+
return access === "read" && !await selected.isCurrent() ? gitLabWriteFailure("no-connection") : result;
|
|
1018
1054
|
} catch (ex) {
|
|
1019
|
-
return
|
|
1055
|
+
return toGitLabPreflightFailure(ex);
|
|
1020
1056
|
}
|
|
1021
1057
|
}
|
|
1022
1058
|
getIssueTrackerCreateOptions(options) {
|
|
@@ -1771,11 +1807,11 @@ __decorate([debug()], IntegrationService.prototype, "reset", null);
|
|
|
1771
1807
|
__decorate([gate()], IntegrationService.prototype, "queueCloudSync", null);
|
|
1772
1808
|
__decorate([trace()], IntegrationService.prototype, "syncCloudIntegrationsCore", null);
|
|
1773
1809
|
/** Internal factory used by the GitLens host and integration tests that need the full service surface. */
|
|
1774
|
-
function createIntegrationService(ctx) {
|
|
1810
|
+
function createIntegrationService(ctx, createGitLabMergeRequestWriter) {
|
|
1775
1811
|
const configured = new ConfiguredIntegrationService(ctx);
|
|
1776
1812
|
const cloud = new CloudIntegrationService(ctx);
|
|
1777
1813
|
let service;
|
|
1778
|
-
service = new IntegrationService(new IntegrationAuthenticationService(configured, ctx, () => service, cloud), configured, ctx);
|
|
1814
|
+
service = new IntegrationService(new IntegrationAuthenticationService(configured, ctx, () => service, cloud), configured, ctx, createGitLabMergeRequestWriter);
|
|
1779
1815
|
purgeRetiredIntegrationStorage(ctx, configured);
|
|
1780
1816
|
purgeJiraDiscoveryStorage(ctx);
|
|
1781
1817
|
return service;
|