@gitkraken/core-gitlens 0.62.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 +22 -1
- package/dist/git/cache.d.ts +1 -0
- package/dist/git/cache.js +11 -0
- package/dist/git/cache.js.map +1 -1
- package/dist/git/errors.d.ts +15 -0
- package/dist/git/errors.js +9 -1
- package/dist/git/errors.js.map +1 -1
- package/dist/git/models/pullRequest.d.ts +3 -0
- package/dist/git/models/pullRequest.js.map +1 -1
- package/dist/git/providers/operations.d.ts +4 -3
- package/dist/git/providers/staging.d.ts +16 -8
- package/dist/git/run.types.d.ts +6 -0
- package/dist/git/utils/hiddenRefs.utils.d.ts +15 -0
- package/dist/git/utils/hiddenRefs.utils.js +68 -2
- package/dist/git/utils/hiddenRefs.utils.js.map +1 -1
- package/dist/git/utils/pullRequest.utils.d.ts +3 -6
- package/dist/git/utils/pullRequest.utils.js +6 -7
- package/dist/git/utils/pullRequest.utils.js.map +1 -1
- package/dist/git/watching/gitIgnoreFilter.d.ts +12 -5
- package/dist/git/watching/gitIgnoreFilter.js +26 -32
- package/dist/git/watching/gitIgnoreFilter.js.map +1 -1
- package/dist/git/watching/provider.d.ts +18 -3
- package/dist/git/watching/watchGroup.d.ts +7 -2
- package/dist/git/watching/watchGroup.js +51 -3
- package/dist/git/watching/watchGroup.js.map +1 -1
- package/dist/git/watching/watchService.d.ts +6 -3
- package/dist/git/watching/watchService.js +94 -64
- package/dist/git/watching/watchService.js.map +1 -1
- package/dist/git-cli/cliGitProvider.d.ts +2 -0
- package/dist/git-cli/cliGitProvider.js +85 -24
- package/dist/git-cli/cliGitProvider.js.map +1 -1
- package/dist/git-cli/exec/git.js +4 -4
- package/dist/git-cli/exec/git.js.map +1 -1
- package/dist/git-cli/exec/indexLock.d.ts +7 -5
- package/dist/git-cli/exec/indexLock.js +19 -15
- package/dist/git-cli/exec/indexLock.js.map +1 -1
- package/dist/git-cli/providers/config.d.ts +1 -0
- package/dist/git-cli/providers/config.js +13 -3
- package/dist/git-cli/providers/config.js.map +1 -1
- package/dist/git-cli/providers/staging.d.ts +8 -8
- package/dist/git-cli/providers/staging.js +119 -24
- package/dist/git-cli/providers/staging.js.map +1 -1
- package/dist/plus/git-github/api/config.d.ts +5 -0
- package/dist/plus/git-github/api/config.js.map +1 -1
- package/dist/plus/git-github/api/github.js +24 -4
- package/dist/plus/git-github/api/github.js.map +1 -1
- package/dist/plus/git-github/models.d.ts +12 -0
- package/dist/plus/git-github/models.js +8 -3
- package/dist/plus/git-github/models.js.map +1 -1
- package/dist/plus/integrations/context.d.ts +5 -0
- 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/github.js +6 -2
- package/dist/plus/integrations/providers/github.js.map +1 -1
- package/dist/plus/integrations/providers/gitlab/gitlab.d.ts +2 -2
- package/dist/plus/integrations/providers/gitlab/gitlab.js +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/etag.d.ts +5 -0
- package/dist/plus/integrations/reads/etag.js +2 -0
- package/dist/plus/integrations/reads/etag.js.map +1 -1
- package/dist/plus/integrations/reads/sweeps.js +1 -1
- package/dist/utils/env/node/exec.d.ts +2 -0
- package/dist/utils/env/node/exec.js +2 -0
- package/dist/utils/env/node/exec.js.map +1 -1
- package/docs/integrations.md +86 -9
- 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
|
@@ -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;
|