@gitkraken/core-gitlens 0.64.1 → 0.65.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.
Files changed (27) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/plus/integrations/extensionManager.js.map +1 -1
  3. package/dist/plus/integrations/index.js +5 -1
  4. package/dist/plus/integrations/index.js.map +1 -1
  5. package/dist/plus/integrations/integrationService.d.ts +8 -4
  6. package/dist/plus/integrations/integrationService.js +23 -22
  7. package/dist/plus/integrations/integrationService.js.map +1 -1
  8. package/dist/plus/integrations/models/gitlabIssueWrites.d.ts +12 -5
  9. package/dist/plus/integrations/models/gitlabIssueWrites.js.map +1 -1
  10. package/dist/plus/integrations/models/gitlabMergeRequestWrites.d.ts +4 -1
  11. package/dist/plus/integrations/providers/gitlab/issueDelete.d.ts +11 -0
  12. package/dist/plus/integrations/providers/gitlab/issueDelete.js +132 -0
  13. package/dist/plus/integrations/providers/gitlab/issueDelete.js.map +1 -0
  14. package/dist/plus/integrations/providers/gitlab/issueWrites.d.ts +2 -1
  15. package/dist/plus/integrations/providers/gitlab/issueWrites.js +77 -33
  16. package/dist/plus/integrations/providers/gitlab/issueWrites.js.map +1 -1
  17. package/dist/plus/integrations/providers/gitlab/mergeRequestWrites.d.ts +1 -0
  18. package/dist/plus/integrations/providers/gitlab/mergeRequestWrites.js +7 -2
  19. package/dist/plus/integrations/providers/gitlab/mergeRequestWrites.js.map +1 -1
  20. package/dist/plus/integrations/providers/gitlab/writeTransport.d.ts +11 -0
  21. package/dist/plus/integrations/providers/gitlab/writeTransport.js +50 -10
  22. package/dist/plus/integrations/providers/gitlab/writeTransport.js.map +1 -1
  23. package/dist/plus/integrations/providers/gitlab.d.ts +4 -9
  24. package/dist/plus/integrations/providers/gitlab.js +29 -29
  25. package/dist/plus/integrations/providers/gitlab.js.map +1 -1
  26. package/docs/integrations.md +14 -4
  27. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -6,6 +6,12 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [0.65.0] - 2026-12-04
10
+
11
+ ### Added
12
+
13
+ - Adds GitLab Self-Managed issue write discovery, creation, editing, closing, reopening, and permanent deletion when available. `IntegrationManager` uses the selected account and installation and verifies the project and issue identities before writing ([#6263](https://github.com/gitkraken/vscode-gitlens/issues/6263)).
14
+
9
15
  ## [0.64.1] - 2026-12-03
10
16
 
11
17
  ### Fixed
@@ -1 +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
+ {"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: importing the GitLab write factories would exceed the extension's webworker bundle budget.\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"}
@@ -13,6 +13,7 @@ import { getAzureRepositoryIdentity } from "./providers/azure/azure.utils.js";
13
13
  import { isGitHostIntegration, isIntegration, isIssuesIntegration } from "./models/publicIntegration.js";
14
14
  import { createIntegrationService } from "./integrationService.js";
15
15
  import { toIntegrationServiceContext } from "./managerContext.js";
16
+ import { GitLabIssueWriter } from "./providers/gitlab/issueWrites.js";
16
17
  import { GitLabMergeRequestWriter } from "./providers/gitlab/mergeRequestWrites.js";
17
18
  import { createManualTokenAuthProvider } from "./authentication/manualTokenProvider.js";
18
19
  import { EntityIdentifierProviderType, EntityType, EntityVersion, decodeEntityIdentifier, decodeEntityIdentifiersFromGitConfig, encodeEntityIdentifier, encodeIssueOrPullRequestForGitConfig, getEntityIdentifierInput, getIssueFromGitConfigEntityIdentifier, getIssueOwner, getProviderIdFromEntityIdentifier } from "./providers/utils.js";
@@ -32,7 +33,10 @@ import { getActionablePullRequests, toActionablePullRequestInput } from "./provi
32
33
  * own VS Code subscriptions.
33
34
  */
34
35
  function createIntegrationManager(ctx) {
35
- return createIntegrationService(toIntegrationServiceContext(ctx), (transport) => new GitLabMergeRequestWriter(transport));
36
+ return createIntegrationService(toIntegrationServiceContext(ctx), {
37
+ issue: (transport) => new GitLabIssueWriter(transport),
38
+ mergeRequest: (transport) => new GitLabMergeRequestWriter(transport)
39
+ });
36
40
  }
37
41
  //#endregion
38
42
  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 { 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"}
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 { GitLabIssueWriter } from './providers/gitlab/issueWrites.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(toIntegrationServiceContext(ctx), {\n\t\tissue: transport => new GitLabIssueWriter(transport),\n\t\tmergeRequest: transport => 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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqNA,SAAgB,yBAAyB,KAAoD;CAC5F,OAAO,yBAAyB,4BAA4B,GAAG,GAAG;EACjE,QAAO,cAAa,IAAI,kBAAkB,SAAS;EACnD,eAAc,cAAa,IAAI,yBAAyB,SAAS;CAClE,CAAC;AACF"}
@@ -36,6 +36,7 @@ import { ApiClients } from "./providers/apiClients.js";
36
36
  import { AzureDevOpsIntegration } from "./providers/azureDevOps.js";
37
37
  import { BitbucketIntegration } from "./providers/bitbucket.js";
38
38
  import { GitHubEnterpriseIntegration, GitHubIntegration } from "./providers/github.js";
39
+ import { GitLabIssueWriter } from "./providers/gitlab/issueWrites.js";
39
40
  import { GitLabMergeRequestWriter } from "./providers/gitlab/mergeRequestWrites.js";
40
41
  import { RepositoryResolutionContext } from "./reads/context.js";
41
42
  import { IntegrationAuthenticationService } from "./authentication/integrationAuthenticationService.js";
@@ -44,12 +45,15 @@ import { IntegrationAuthenticationService } from "./authentication/integrationAu
44
45
  export interface IntegrationConnectionChangeEvent extends ConnectionStateChangeEvent {
45
46
  integration: IntegrationBase;
46
47
  }
47
- export type GitLabMergeRequestWriterFactory = (transport: GitLabWriteTransport) => GitLabMergeRequestWriter;
48
+ type GitLabWriterFactories = {
49
+ issue: (transport: GitLabWriteTransport) => GitLabIssueWriter;
50
+ mergeRequest: (transport: GitLabWriteTransport) => GitLabMergeRequestWriter;
51
+ };
48
52
  export declare class IntegrationService implements Disposable, IntegrationManager, RepositoryResolutionContext {
49
53
  private readonly authenticationService;
50
54
  private readonly configuredIntegrationService;
51
55
  private readonly ctx;
52
- private readonly createGitLabMergeRequestWriter?;
56
+ private readonly gitLabWriters?;
53
57
  get onDidChange(): Event<ConfiguredIntegrationsChangeEvent>;
54
58
  private readonly _onDidChangeConnectionState;
55
59
  get onDidChangeConnectionState(): Event<ConnectionStateChangeEvent>;
@@ -64,7 +68,7 @@ export declare class IntegrationService implements Disposable, IntegrationManage
64
68
  get apis(): ApiClients;
65
69
  /** The shared `GitHubApi` instance — also consumed by the host's GitHub git provider (one instance). */
66
70
  get github(): Promise<GitHubApi | undefined>;
67
- constructor(authenticationService: IntegrationAuthenticationService, configuredIntegrationService: ConfiguredIntegrationService, ctx: IntegrationServiceContext, createGitLabMergeRequestWriter?: GitLabMergeRequestWriterFactory | undefined);
71
+ constructor(authenticationService: IntegrationAuthenticationService, configuredIntegrationService: ConfiguredIntegrationService, ctx: IntegrationServiceContext, gitLabWriters?: GitLabWriterFactories | undefined);
68
72
  dispose(): void;
69
73
  connectCloudIntegrations(options?: {
70
74
  integrationIds: SupportedCloudIntegrationIds[];
@@ -699,6 +703,6 @@ export declare class IntegrationService implements Disposable, IntegrationManage
699
703
  refreshConnections(): Promise<void>;
700
704
  }
701
705
  /** Internal factory used by the GitLens host and integration tests that need the full service surface. */
702
- export declare function createIntegrationService(ctx: IntegrationServiceContext, createGitLabMergeRequestWriter?: GitLabMergeRequestWriterFactory): IntegrationService;
706
+ export declare function createIntegrationService(ctx: IntegrationServiceContext, gitLabWriters?: GitLabWriterFactories): IntegrationService;
703
707
  //#endregion
704
708
  //# sourceMappingURL=integrationService.d.ts.map
@@ -13,7 +13,7 @@ import { GitCloudHostIntegrationId, GitSelfManagedHostIntegrationId, IssuesCloud
13
13
  import "./providers/utils/providerPaging.js";
14
14
  import { providersMetadata } from "./providers/metadata.js";
15
15
  import { areDomainsOnSameHost, baseUrlFromDomain, getRemoteHostMatcher, hostFromDomain, matchesInstallationOrigin, sameConfiguredBaseUrl } from "./utils/domain.utils.js";
16
- import { convertRemoteProviderIdToIntegrationId, getGitHubEnterprisePullRequestWriteOrigin, getIntegrationIdForRemote, isCloudSelfManagedHostIntegrationId, isGitCloudHostIntegrationId, isGitSelfManagedHostIntegrationId, isNonExpiringZeroTokenIntegrationId, isSelfManagedHostIntegrationId, remoteProviderTypeForConfig, remoteProviderTypeForIntegration } from "./utils/integration.utils.js";
16
+ import { convertRemoteProviderIdToIntegrationId, getGitHubEnterprisePullRequestWriteOrigin, getIntegrationIdForRemote, getSelfManagedBaseUrl, isCloudSelfManagedHostIntegrationId, isGitCloudHostIntegrationId, isGitSelfManagedHostIntegrationId, isNonExpiringZeroTokenIntegrationId, isSelfManagedHostIntegrationId, remoteProviderTypeForConfig, remoteProviderTypeForIntegration } from "./utils/integration.utils.js";
17
17
  import { getSupportedCloudIntegrationIds, isSupportedCloudIntegrationId, toIntegrationId } from "./authentication/models.js";
18
18
  import { CloudIntegrationService } from "./authentication/cloudIntegrationService.js";
19
19
  import { ConfiguredIntegrationService } from "./authentication/configuredIntegrationService.js";
@@ -57,7 +57,7 @@ var IntegrationService = class {
57
57
  authenticationService;
58
58
  configuredIntegrationService;
59
59
  ctx;
60
- createGitLabMergeRequestWriter;
60
+ gitLabWriters;
61
61
  get onDidChange() {
62
62
  return this.configuredIntegrationService.onDidChange;
63
63
  }
@@ -80,11 +80,11 @@ var IntegrationService = class {
80
80
  get github() {
81
81
  return this.apis.github;
82
82
  }
83
- constructor(authenticationService, configuredIntegrationService, ctx, createGitLabMergeRequestWriter) {
83
+ constructor(authenticationService, configuredIntegrationService, ctx, gitLabWriters) {
84
84
  this.authenticationService = authenticationService;
85
85
  this.configuredIntegrationService = configuredIntegrationService;
86
86
  this.ctx = ctx;
87
- this.createGitLabMergeRequestWriter = createGitLabMergeRequestWriter;
87
+ this.gitLabWriters = gitLabWriters;
88
88
  this._disposable = fromDisposables(configuredIntegrationService.onWillChangeSession(({ integrationId, session, previousDomain }) => {
89
89
  this.onSessionPublishing(integrationId, { session }, [session.domain, previousDomain]);
90
90
  }), configuredIntegrationService.onWillRemoveSessions(({ integrationId, connectionId, cloud, domain }) => {
@@ -1008,7 +1008,7 @@ var IntegrationService = class {
1008
1008
  return this.withGitLabIssueWriter(input, "write", (writer) => writer.delete(input));
1009
1009
  }
1010
1010
  withGitLabIssueWriter(scope, access, run) {
1011
- return this.withGitLabWriter(scope, access, (integration, connection, isSelectionCurrent) => integration.getIssueWriter(scope, connection, isSelectionCurrent), run);
1011
+ return this.withGitLabWriter(scope, access, this.gitLabWriters?.issue, run);
1012
1012
  }
1013
1013
  getGitLabMergeRequestCreateOptions(options) {
1014
1014
  const input = { ...options };
@@ -1031,25 +1031,26 @@ var IntegrationService = class {
1031
1031
  return this.withGitLabMergeRequestWriter(input, "write", (writer) => writer.delete(input));
1032
1032
  }
1033
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
1034
  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");
1035
+ return this.withGitLabWriter(scope, access, this.gitLabWriters?.mergeRequest, run);
1036
+ }
1037
+ async withGitLabWriter(scope, access, create, run) {
1038
+ if (create == null) return gitLabWriteFailure("unsupported");
1039
+ const providerId = scope.providerId;
1040
+ if (providerId !== "gitlab" && providerId !== "cloud-gitlab-self-hosted") return gitLabWriteFailure("unsupported");
1041
+ const baseUrl = typeof scope.baseUrl === "string" ? scope.baseUrl : "";
1042
+ const selfManaged = providerId === "cloud-gitlab-self-hosted";
1043
+ if (typeof scope.connectionId !== "string" || !scope.connectionId || scope.connectionId.trim() !== scope.connectionId || (selfManaged ? !matchesInstallationOrigin(baseUrl, baseUrl) || baseUrl !== getSelfManagedBaseUrl(providerId, baseUrl) || hostFromDomain(baseUrl) === "gitlab.com" : baseUrl !== "https://gitlab.com") || scope.expectedAccountId !== void 0 && !isGitLabDecimalId(scope.expectedAccountId)) return gitLabWriteFailure("invalid-input");
1047
1044
  try {
1048
- const selection = await this.configuredIntegrationService.captureConnectionSelection(scope.providerId, scope.connectionId);
1045
+ const selection = await this.configuredIntegrationService.captureConnectionSelection(providerId, scope.connectionId);
1049
1046
  if (!selection?.isCurrent()) return gitLabWriteFailure("no-connection");
1050
- const selected = await select(await this.get(scope.providerId), selection.connection, selection.isCurrent);
1047
+ const domain = selection.connection.domain;
1048
+ if (selfManaged && (!domain || !matchesInstallationOrigin(domain, baseUrl))) return gitLabWriteFailure("no-connection");
1049
+ const integration = await this.get(providerId, domain);
1050
+ if (integration == null) return gitLabWriteFailure("no-connection");
1051
+ const selected = await integration.getWriteTransport(scope, selection.connection, selection.isCurrent);
1051
1052
  if (selected == null) return gitLabWriteFailure("no-connection");
1052
- const result = await run(selected.writer);
1053
+ const result = await run(create(selected.transport));
1053
1054
  return access === "read" && !await selected.isCurrent() ? gitLabWriteFailure("no-connection") : result;
1054
1055
  } catch (ex) {
1055
1056
  return toGitLabPreflightFailure(ex);
@@ -1807,11 +1808,11 @@ __decorate([debug()], IntegrationService.prototype, "reset", null);
1807
1808
  __decorate([gate()], IntegrationService.prototype, "queueCloudSync", null);
1808
1809
  __decorate([trace()], IntegrationService.prototype, "syncCloudIntegrationsCore", null);
1809
1810
  /** Internal factory used by the GitLens host and integration tests that need the full service surface. */
1810
- function createIntegrationService(ctx, createGitLabMergeRequestWriter) {
1811
+ function createIntegrationService(ctx, gitLabWriters) {
1811
1812
  const configured = new ConfiguredIntegrationService(ctx);
1812
1813
  const cloud = new CloudIntegrationService(ctx);
1813
1814
  let service;
1814
- service = new IntegrationService(new IntegrationAuthenticationService(configured, ctx, () => service, cloud), configured, ctx, createGitLabMergeRequestWriter);
1815
+ service = new IntegrationService(new IntegrationAuthenticationService(configured, ctx, () => service, cloud), configured, ctx, gitLabWriters);
1815
1816
  purgeRetiredIntegrationStorage(ctx, configured);
1816
1817
  purgeJiraDiscoveryStorage(ctx);
1817
1818
  return service;