@gitkraken/core-gitlens 0.4.0 → 0.4.101
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 +74 -1
- package/README.md +9 -2
- package/dist/git/cache.d.ts +29 -2
- package/dist/git/cache.d.ts.map +1 -1
- package/dist/git/cache.js +67 -7
- package/dist/git/cache.js.map +1 -1
- package/dist/git/context.d.ts.map +1 -1
- package/dist/git/errors.d.ts +31 -1
- package/dist/git/errors.d.ts.map +1 -1
- package/dist/git/errors.js +29 -0
- package/dist/git/errors.js.map +1 -1
- package/dist/git/models/author.d.ts.map +1 -1
- package/dist/git/models/author.js.map +1 -1
- package/dist/git/models/autolink.d.ts.map +1 -1
- package/dist/git/models/autolink.js.map +1 -1
- package/dist/git/models/blame.d.ts.map +1 -1
- package/dist/git/models/blame.js.map +1 -1
- package/dist/git/models/branch.d.ts.map +1 -1
- package/dist/git/models/branch.js.map +1 -1
- package/dist/git/models/commit.d.ts.map +1 -1
- package/dist/git/models/commit.js +1 -1
- package/dist/git/models/commit.js.map +1 -1
- package/dist/git/models/contributor.d.ts.map +1 -1
- package/dist/git/models/contributor.js.map +1 -1
- package/dist/git/models/defaultBranch.d.ts.map +1 -1
- package/dist/git/models/defaultBranch.js.map +1 -1
- package/dist/git/models/diff.d.ts.map +1 -1
- package/dist/git/models/diff.js.map +1 -1
- package/dist/git/models/file.d.ts.map +1 -1
- package/dist/git/models/file.js.map +1 -1
- package/dist/git/models/fileChange.d.ts.map +1 -1
- package/dist/git/models/fileChange.js.map +1 -1
- package/dist/git/models/fileStatus.d.ts +22 -22
- package/dist/git/models/fileStatus.d.ts.map +1 -1
- package/dist/git/models/fileStatus.js.map +1 -1
- package/dist/git/models/graph.d.ts +122 -1
- package/dist/git/models/graph.d.ts.map +1 -1
- package/dist/git/models/graph.js +4 -0
- package/dist/git/models/graph.js.map +1 -1
- package/dist/git/models/graphSearch.d.ts.map +1 -1
- package/dist/git/models/graphSearch.js.map +1 -1
- package/dist/git/models/graphSession.d.ts +177 -0
- package/dist/git/models/graphSession.d.ts.map +1 -0
- package/dist/git/models/graphSession.js +7 -0
- package/dist/git/models/graphSession.js.map +1 -0
- package/dist/git/models/issue.d.ts +12 -2
- package/dist/git/models/issue.d.ts.map +1 -1
- package/dist/git/models/issue.js +3 -1
- package/dist/git/models/issue.js.map +1 -1
- package/dist/git/models/issueOrPullRequest.d.ts.map +1 -1
- package/dist/git/models/issueOrPullRequest.js.map +1 -1
- package/dist/git/models/lineRange.d.ts.map +1 -1
- package/dist/git/models/lineRange.js.map +1 -1
- package/dist/git/models/log.d.ts.map +1 -1
- package/dist/git/models/log.js.map +1 -1
- package/dist/git/models/mergeConflicts.d.ts.map +1 -1
- package/dist/git/models/mergeConflicts.js.map +1 -1
- package/dist/git/models/patch.d.ts.map +1 -1
- package/dist/git/models/patch.js.map +1 -1
- package/dist/git/models/pausedOperationStatus.d.ts.map +1 -1
- package/dist/git/models/pausedOperationStatus.js.map +1 -1
- package/dist/git/models/pullRequest.d.ts +27 -2
- package/dist/git/models/pullRequest.d.ts.map +1 -1
- package/dist/git/models/pullRequest.js +7 -1
- package/dist/git/models/pullRequest.js.map +1 -1
- package/dist/git/models/rebase.d.ts.map +1 -1
- package/dist/git/models/rebase.js.map +1 -1
- package/dist/git/models/reference.d.ts.map +1 -1
- package/dist/git/models/reference.js.map +1 -1
- package/dist/git/models/reflog.d.ts.map +1 -1
- package/dist/git/models/reflog.js.map +1 -1
- package/dist/git/models/remote.d.ts.map +1 -1
- package/dist/git/models/remote.js.map +1 -1
- package/dist/git/models/remoteProvider.d.ts.map +1 -1
- package/dist/git/models/remoteProvider.js.map +1 -1
- package/dist/git/models/remoteResource.d.ts.map +1 -1
- package/dist/git/models/remoteResource.js.map +1 -1
- package/dist/git/models/repository.d.ts +20 -2
- package/dist/git/models/repository.d.ts.map +1 -1
- package/dist/git/models/repository.js +19 -0
- package/dist/git/models/repository.js.map +1 -1
- package/dist/git/models/repositoryChangeEvent.d.ts.map +1 -1
- package/dist/git/models/repositoryChangeEvent.js.map +1 -1
- package/dist/git/models/repositoryIdentities.d.ts.map +1 -1
- package/dist/git/models/repositoryIdentities.js.map +1 -1
- package/dist/git/models/repositoryMetadata.d.ts.map +1 -1
- package/dist/git/models/repositoryMetadata.js.map +1 -1
- package/dist/git/models/resourceDescriptor.d.ts +16 -0
- package/dist/git/models/resourceDescriptor.d.ts.map +1 -1
- package/dist/git/models/resourceDescriptor.js.map +1 -1
- package/dist/git/models/revision.d.ts.map +1 -1
- package/dist/git/models/revision.js.map +1 -1
- package/dist/git/models/search.d.ts.map +1 -1
- package/dist/git/models/search.js.map +1 -1
- package/dist/git/models/shortlog.d.ts.map +1 -1
- package/dist/git/models/shortlog.js.map +1 -1
- package/dist/git/models/signature.d.ts +14 -0
- package/dist/git/models/signature.d.ts.map +1 -1
- package/dist/git/models/signature.js.map +1 -1
- package/dist/git/models/staging.d.ts.map +1 -1
- package/dist/git/models/staging.js.map +1 -1
- package/dist/git/models/stash.d.ts.map +1 -1
- package/dist/git/models/stash.js.map +1 -1
- package/dist/git/models/status.d.ts.map +1 -1
- package/dist/git/models/status.js.map +1 -1
- package/dist/git/models/statusFile.d.ts.map +1 -1
- package/dist/git/models/statusFile.js.map +1 -1
- package/dist/git/models/tag.d.ts +11 -1
- package/dist/git/models/tag.d.ts.map +1 -1
- package/dist/git/models/tag.js +9 -2
- package/dist/git/models/tag.js.map +1 -1
- package/dist/git/models/tree.d.ts.map +1 -1
- package/dist/git/models/tree.js.map +1 -1
- package/dist/git/models/user.d.ts.map +1 -1
- package/dist/git/models/user.js.map +1 -1
- package/dist/git/models/worktree.d.ts.map +1 -1
- package/dist/git/models/worktree.js.map +1 -1
- package/dist/git/parsers/diffParser.d.ts.map +1 -1
- package/dist/git/parsers/diffParser.js +1 -1
- package/dist/git/parsers/diffParser.js.map +1 -1
- package/dist/git/parsers/rebaseTodoParser.d.ts.map +1 -1
- package/dist/git/parsers/rebaseTodoParser.js.map +1 -1
- package/dist/git/providers/blame.d.ts.map +1 -1
- package/dist/git/providers/blame.js.map +1 -1
- package/dist/git/providers/branches.d.ts +8 -1
- package/dist/git/providers/branches.d.ts.map +1 -1
- package/dist/git/providers/branches.js.map +1 -1
- package/dist/git/providers/commits.d.ts +6 -1
- package/dist/git/providers/commits.d.ts.map +1 -1
- package/dist/git/providers/commits.js.map +1 -1
- package/dist/git/providers/config.d.ts +6 -2
- package/dist/git/providers/config.d.ts.map +1 -1
- package/dist/git/providers/config.js.map +1 -1
- package/dist/git/providers/contributors.d.ts.map +1 -1
- package/dist/git/providers/contributors.js.map +1 -1
- package/dist/git/providers/diff.d.ts.map +1 -1
- package/dist/git/providers/diff.js.map +1 -1
- package/dist/git/providers/graph.d.ts +55 -1
- package/dist/git/providers/graph.d.ts.map +1 -1
- package/dist/git/providers/graph.js.map +1 -1
- package/dist/git/providers/operations.d.ts.map +1 -1
- package/dist/git/providers/operations.js.map +1 -1
- package/dist/git/providers/patch.d.ts.map +1 -1
- package/dist/git/providers/patch.js.map +1 -1
- package/dist/git/providers/pausedOperations.d.ts.map +1 -1
- package/dist/git/providers/pausedOperations.js.map +1 -1
- package/dist/git/providers/provider.d.ts.map +1 -1
- package/dist/git/providers/provider.js.map +1 -1
- package/dist/git/providers/refs.d.ts.map +1 -1
- package/dist/git/providers/refs.js.map +1 -1
- package/dist/git/providers/remotes.d.ts.map +1 -1
- package/dist/git/providers/remotes.js.map +1 -1
- package/dist/git/providers/revision.d.ts.map +1 -1
- package/dist/git/providers/revision.js.map +1 -1
- package/dist/git/providers/shared/remotes.d.ts.map +1 -1
- package/dist/git/providers/shared/remotes.js.map +1 -1
- package/dist/git/providers/staging.d.ts.map +1 -1
- package/dist/git/providers/staging.js.map +1 -1
- package/dist/git/providers/stash.d.ts.map +1 -1
- package/dist/git/providers/stash.js.map +1 -1
- package/dist/git/providers/status.d.ts +1 -0
- package/dist/git/providers/status.d.ts.map +1 -1
- package/dist/git/providers/status.js.map +1 -1
- package/dist/git/providers/tags.d.ts.map +1 -1
- package/dist/git/providers/tags.js.map +1 -1
- package/dist/git/providers/types.d.ts.map +1 -1
- package/dist/git/providers/types.js.map +1 -1
- package/dist/git/providers/worktrees.d.ts +3 -1
- package/dist/git/providers/worktrees.d.ts.map +1 -1
- package/dist/git/providers/worktrees.js.map +1 -1
- package/dist/git/remotes/azure-devops.d.ts.map +1 -1
- package/dist/git/remotes/azure-devops.js +27 -31
- package/dist/git/remotes/azure-devops.js.map +1 -1
- package/dist/git/remotes/bitbucket-server.d.ts.map +1 -1
- package/dist/git/remotes/bitbucket-server.js +21 -23
- package/dist/git/remotes/bitbucket-server.js.map +1 -1
- package/dist/git/remotes/bitbucket.d.ts.map +1 -1
- package/dist/git/remotes/bitbucket.js +21 -23
- package/dist/git/remotes/bitbucket.js.map +1 -1
- package/dist/git/remotes/custom.d.ts.map +1 -1
- package/dist/git/remotes/custom.js.map +1 -1
- package/dist/git/remotes/gerrit.d.ts.map +1 -1
- package/dist/git/remotes/gerrit.js +11 -13
- package/dist/git/remotes/gerrit.js.map +1 -1
- package/dist/git/remotes/gitea.d.ts.map +1 -1
- package/dist/git/remotes/gitea.js +12 -14
- package/dist/git/remotes/gitea.js.map +1 -1
- package/dist/git/remotes/github.d.ts.map +1 -1
- package/dist/git/remotes/github.js +54 -56
- package/dist/git/remotes/github.js.map +1 -1
- package/dist/git/remotes/gitlab.d.ts.map +1 -1
- package/dist/git/remotes/gitlab.js +93 -95
- package/dist/git/remotes/gitlab.js.map +1 -1
- package/dist/git/remotes/google-source.d.ts.map +1 -1
- package/dist/git/remotes/google-source.js.map +1 -1
- package/dist/git/remotes/matcher.d.ts.map +1 -1
- package/dist/git/remotes/matcher.js.map +1 -1
- package/dist/git/run.types.d.ts +62 -3
- package/dist/git/run.types.d.ts.map +1 -1
- package/dist/git/service.d.ts.map +1 -1
- package/dist/git/utils/autolink.utils.d.ts.map +1 -1
- package/dist/git/utils/autolink.utils.js.map +1 -1
- package/dist/git/utils/blame.utils.d.ts.map +1 -1
- package/dist/git/utils/blame.utils.js.map +1 -1
- package/dist/git/utils/branch.utils.d.ts.map +1 -1
- package/dist/git/utils/branch.utils.js +12 -1
- package/dist/git/utils/branch.utils.js.map +1 -1
- package/dist/git/utils/commit.utils.d.ts.map +1 -1
- package/dist/git/utils/commit.utils.js.map +1 -1
- package/dist/git/utils/conflictResolution.utils.d.ts.map +1 -1
- package/dist/git/utils/conflictResolution.utils.js.map +1 -1
- package/dist/git/utils/contributor.utils.d.ts +1 -1
- package/dist/git/utils/contributor.utils.d.ts.map +1 -1
- package/dist/git/utils/contributor.utils.js +1 -2
- package/dist/git/utils/contributor.utils.js.map +1 -1
- package/dist/git/utils/fetch.utils.d.ts.map +1 -1
- package/dist/git/utils/fetch.utils.js.map +1 -1
- package/dist/git/utils/fileStatus.utils.d.ts +7 -0
- package/dist/git/utils/fileStatus.utils.d.ts.map +1 -1
- package/dist/git/utils/fileStatus.utils.js +6 -0
- package/dist/git/utils/fileStatus.utils.js.map +1 -1
- package/dist/git/utils/graph.utils.d.ts +20 -0
- package/dist/git/utils/graph.utils.d.ts.map +1 -0
- package/dist/git/utils/graph.utils.js +40 -0
- package/dist/git/utils/graph.utils.js.map +1 -0
- package/dist/git/utils/issue.utils.d.ts.map +1 -1
- package/dist/git/utils/issue.utils.js +1 -0
- package/dist/git/utils/issue.utils.js.map +1 -1
- package/dist/git/utils/issueOrPullRequest.utils.d.ts.map +1 -1
- package/dist/git/utils/issueOrPullRequest.utils.js.map +1 -1
- package/dist/git/utils/mergeConflicts.utils.d.ts.map +1 -1
- package/dist/git/utils/mergeConflicts.utils.js.map +1 -1
- package/dist/git/utils/pausedOperationStatus.utils.d.ts +13 -13
- package/dist/git/utils/pausedOperationStatus.utils.d.ts.map +1 -1
- package/dist/git/utils/pausedOperationStatus.utils.js.map +1 -1
- package/dist/git/utils/pullRequest.utils.d.ts.map +1 -1
- package/dist/git/utils/pullRequest.utils.js +9 -0
- package/dist/git/utils/pullRequest.utils.js.map +1 -1
- package/dist/git/utils/reachability.utils.d.ts +20 -2
- package/dist/git/utils/reachability.utils.d.ts.map +1 -1
- package/dist/git/utils/reachability.utils.js +68 -7
- package/dist/git/utils/reachability.utils.js.map +1 -1
- package/dist/git/utils/rebase.utils.d.ts.map +1 -1
- package/dist/git/utils/rebase.utils.js.map +1 -1
- package/dist/git/utils/reference.utils.d.ts.map +1 -1
- package/dist/git/utils/reference.utils.js.map +1 -1
- package/dist/git/utils/remote.utils.d.ts.map +1 -1
- package/dist/git/utils/remote.utils.js.map +1 -1
- package/dist/git/utils/repository.utils.d.ts.map +1 -1
- package/dist/git/utils/repository.utils.js.map +1 -1
- package/dist/git/utils/resourceDescriptor.utils.d.ts.map +1 -1
- package/dist/git/utils/resourceDescriptor.utils.js.map +1 -1
- package/dist/git/utils/revision.utils.d.ts.map +1 -1
- package/dist/git/utils/revision.utils.js.map +1 -1
- package/dist/git/utils/search.utils.d.ts.map +1 -1
- package/dist/git/utils/search.utils.js.map +1 -1
- package/dist/git/utils/sorting.d.ts.map +1 -1
- package/dist/git/utils/sorting.js.map +1 -1
- package/dist/git/utils/sshKey.utils.d.ts +7 -0
- package/dist/git/utils/sshKey.utils.d.ts.map +1 -0
- package/dist/git/utils/sshKey.utils.js +25 -0
- package/dist/git/utils/sshKey.utils.js.map +1 -0
- package/dist/git/utils/status.utils.d.ts.map +1 -1
- package/dist/git/utils/status.utils.js.map +1 -1
- package/dist/git/utils/statusFile.utils.d.ts.map +1 -1
- package/dist/git/utils/statusFile.utils.js.map +1 -1
- package/dist/git/utils/tag.utils.d.ts.map +1 -1
- package/dist/git/utils/tag.utils.js.map +1 -1
- package/dist/git/utils/tooltip.utils.d.ts.map +1 -1
- package/dist/git/utils/tooltip.utils.js.map +1 -1
- package/dist/git/utils/uriAuthority.d.ts.map +1 -1
- package/dist/git/utils/uriAuthority.js.map +1 -1
- package/dist/git/utils/user.utils.d.ts.map +1 -1
- package/dist/git/utils/user.utils.js.map +1 -1
- package/dist/git/utils/worktree.utils.d.ts.map +1 -1
- package/dist/git/utils/worktree.utils.js.map +1 -1
- package/dist/git/watching/changeEvent.d.ts.map +1 -1
- package/dist/git/watching/changeEvent.js.map +1 -1
- package/dist/git/watching/classifyChange.d.ts.map +1 -1
- package/dist/git/watching/classifyChange.js.map +1 -1
- package/dist/git/watching/gitIgnoreFilter.d.ts.map +1 -1
- package/dist/git/watching/gitIgnoreFilter.js.map +1 -1
- package/dist/git/watching/initWatcher.d.ts.map +1 -1
- package/dist/git/watching/initWatcher.js.map +1 -1
- package/dist/git/watching/provider.d.ts.map +1 -1
- package/dist/git/watching/provider.js.map +1 -1
- package/dist/git/watching/watchGroup.d.ts.map +1 -1
- package/dist/git/watching/watchGroup.js.map +1 -1
- package/dist/git/watching/watchService.d.ts +4 -0
- package/dist/git/watching/watchService.d.ts.map +1 -1
- package/dist/git/watching/watchService.js +15 -1
- package/dist/git/watching/watchService.js.map +1 -1
- package/dist/git/watching/watchSession.d.ts +7 -0
- package/dist/git/watching/watchSession.d.ts.map +1 -1
- package/dist/git/watching/watchSession.js +14 -2
- package/dist/git/watching/watchSession.js.map +1 -1
- package/dist/git/watching/watcherPatterns.d.ts.map +1 -1
- package/dist/git/watching/watcherPatterns.js.map +1 -1
- package/dist/git-cli/cliGitProvider.d.ts.map +1 -1
- package/dist/git-cli/exec/exec.d.ts.map +1 -1
- package/dist/git-cli/exec/exec.errors.d.ts.map +1 -1
- package/dist/git-cli/exec/exec.errors.js.map +1 -1
- package/dist/git-cli/exec/exec.js.map +1 -1
- package/dist/git-cli/exec/exec.types.d.ts.map +1 -1
- package/dist/git-cli/exec/exec.types.js.map +1 -1
- package/dist/git-cli/exec/features.d.ts.map +1 -1
- package/dist/git-cli/exec/features.js.map +1 -1
- package/dist/git-cli/exec/git.d.ts +19 -27
- package/dist/git-cli/exec/git.d.ts.map +1 -1
- package/dist/git-cli/exec/git.js +126 -34
- package/dist/git-cli/exec/git.js.map +1 -1
- package/dist/git-cli/exec/gitQueue.d.ts.map +1 -1
- package/dist/git-cli/exec/gitQueue.js.map +1 -1
- package/dist/git-cli/exec/locator.d.ts.map +1 -1
- package/dist/git-cli/exec/locator.js.map +1 -1
- package/dist/git-cli/parsers/blameParser.d.ts.map +1 -1
- package/dist/git-cli/parsers/blameParser.js.map +1 -1
- package/dist/git-cli/parsers/indexParser.d.ts.map +1 -1
- package/dist/git-cli/parsers/indexParser.js.map +1 -1
- package/dist/git-cli/parsers/logParser.d.ts +9 -1
- package/dist/git-cli/parsers/logParser.d.ts.map +1 -1
- package/dist/git-cli/parsers/logParser.js +141 -60
- package/dist/git-cli/parsers/logParser.js.map +1 -1
- package/dist/git-cli/parsers/mergeTreeParser.d.ts.map +1 -1
- package/dist/git-cli/parsers/mergeTreeParser.js.map +1 -1
- package/dist/git-cli/parsers/refParser.d.ts.map +1 -1
- package/dist/git-cli/parsers/refParser.js.map +1 -1
- package/dist/git-cli/parsers/reflogParser.d.ts.map +1 -1
- package/dist/git-cli/parsers/reflogParser.js.map +1 -1
- package/dist/git-cli/parsers/remoteParser.d.ts.map +1 -1
- package/dist/git-cli/parsers/remoteParser.js.map +1 -1
- package/dist/git-cli/parsers/shortlogParser.d.ts.map +1 -1
- package/dist/git-cli/parsers/shortlogParser.js.map +1 -1
- package/dist/git-cli/parsers/signatureParser.d.ts.map +1 -1
- package/dist/git-cli/parsers/signatureParser.js.map +1 -1
- package/dist/git-cli/parsers/sshSignatureParser.d.ts +21 -0
- package/dist/git-cli/parsers/sshSignatureParser.d.ts.map +1 -0
- package/dist/git-cli/parsers/sshSignatureParser.js +78 -0
- package/dist/git-cli/parsers/sshSignatureParser.js.map +1 -0
- package/dist/git-cli/parsers/statusParser.d.ts.map +1 -1
- package/dist/git-cli/parsers/statusParser.js.map +1 -1
- package/dist/git-cli/parsers/treeParser.d.ts.map +1 -1
- package/dist/git-cli/parsers/treeParser.js.map +1 -1
- package/dist/git-cli/parsers/worktreeParser.d.ts.map +1 -1
- package/dist/git-cli/parsers/worktreeParser.js +5 -7
- package/dist/git-cli/parsers/worktreeParser.js.map +1 -1
- package/dist/git-cli/providers/blame.d.ts.map +1 -1
- package/dist/git-cli/providers/blame.js.map +1 -1
- package/dist/git-cli/providers/branches.d.ts +1 -0
- package/dist/git-cli/providers/branches.d.ts.map +1 -1
- package/dist/git-cli/providers/branches.js +51 -32
- package/dist/git-cli/providers/branches.js.map +1 -1
- package/dist/git-cli/providers/commitFilesetUtils.d.ts.map +1 -1
- package/dist/git-cli/providers/commitFilesetUtils.js.map +1 -1
- package/dist/git-cli/providers/commits.d.ts +12 -1
- package/dist/git-cli/providers/commits.d.ts.map +1 -1
- package/dist/git-cli/providers/commits.js +89 -8
- package/dist/git-cli/providers/commits.js.map +1 -1
- package/dist/git-cli/providers/config.d.ts.map +1 -1
- package/dist/git-cli/providers/config.js.map +1 -1
- package/dist/git-cli/providers/contributors.d.ts.map +1 -1
- package/dist/git-cli/providers/contributors.js.map +1 -1
- package/dist/git-cli/providers/diff.d.ts.map +1 -1
- package/dist/git-cli/providers/diff.js.map +1 -1
- package/dist/git-cli/providers/graph.d.ts +35 -1
- package/dist/git-cli/providers/graph.d.ts.map +1 -1
- package/dist/git-cli/providers/graph.js +1434 -330
- package/dist/git-cli/providers/graph.js.map +1 -1
- package/dist/git-cli/providers/operations.d.ts.map +1 -1
- package/dist/git-cli/providers/operations.js.map +1 -1
- package/dist/git-cli/providers/patch.d.ts.map +1 -1
- package/dist/git-cli/providers/patch.js.map +1 -1
- package/dist/git-cli/providers/pausedOperations.d.ts.map +1 -1
- package/dist/git-cli/providers/pausedOperations.js +3 -3
- package/dist/git-cli/providers/pausedOperations.js.map +1 -1
- package/dist/git-cli/providers/refs.d.ts.map +1 -1
- package/dist/git-cli/providers/refs.js.map +1 -1
- package/dist/git-cli/providers/remotes.d.ts.map +1 -1
- package/dist/git-cli/providers/remotes.js.map +1 -1
- package/dist/git-cli/providers/revision.d.ts +1 -0
- package/dist/git-cli/providers/revision.d.ts.map +1 -1
- package/dist/git-cli/providers/revision.js +33 -0
- package/dist/git-cli/providers/revision.js.map +1 -1
- package/dist/git-cli/providers/staging.d.ts.map +1 -1
- package/dist/git-cli/providers/staging.js.map +1 -1
- package/dist/git-cli/providers/stash.d.ts.map +1 -1
- package/dist/git-cli/providers/stash.js.map +1 -1
- package/dist/git-cli/providers/status.d.ts +28 -0
- package/dist/git-cli/providers/status.d.ts.map +1 -1
- package/dist/git-cli/providers/status.js +240 -154
- package/dist/git-cli/providers/status.js.map +1 -1
- package/dist/git-cli/providers/tags.d.ts.map +1 -1
- package/dist/git-cli/providers/tags.js +2 -1
- package/dist/git-cli/providers/tags.js.map +1 -1
- package/dist/git-cli/providers/worktrees.d.ts +2 -1
- package/dist/git-cli/providers/worktrees.d.ts.map +1 -1
- package/dist/git-cli/providers/worktrees.js +28 -3
- package/dist/git-cli/providers/worktrees.js.map +1 -1
- package/dist/git-cli/service.d.ts.map +1 -1
- package/dist/git-cli/service.js +8 -0
- package/dist/git-cli/service.js.map +1 -1
- package/dist/ipc/ipcServer.d.ts.map +1 -1
- package/dist/ipc/ipcServer.js +1 -1
- package/dist/ipc/ipcServer.js.map +1 -1
- package/dist/plus/agents/providers/claudeCodeProvider.d.ts +6 -1
- package/dist/plus/agents/providers/claudeCodeProvider.d.ts.map +1 -1
- package/dist/plus/agents/providers/claudeCodeProvider.js +19 -0
- package/dist/plus/agents/providers/claudeCodeProvider.js.map +1 -1
- package/dist/plus/agents/providers/claudeCodeTranscript.d.ts +68 -0
- package/dist/plus/agents/providers/claudeCodeTranscript.d.ts.map +1 -1
- package/dist/plus/agents/providers/claudeCodeTranscript.js +262 -8
- package/dist/plus/agents/providers/claudeCodeTranscript.js.map +1 -1
- package/dist/plus/agents/types.d.ts +36 -2
- package/dist/plus/agents/types.d.ts.map +1 -1
- package/dist/plus/ai/constants.d.ts +1 -2
- package/dist/plus/ai/constants.d.ts.map +1 -1
- package/dist/plus/ai/constants.js +1 -8
- package/dist/plus/ai/constants.js.map +1 -1
- package/dist/plus/ai/errors.d.ts.map +1 -1
- package/dist/plus/ai/errors.js.map +1 -1
- package/dist/plus/ai/models/conversation.d.ts.map +1 -1
- package/dist/plus/ai/models/conversation.js.map +1 -1
- package/dist/plus/ai/models/model.d.ts +2 -1
- package/dist/plus/ai/models/model.d.ts.map +1 -1
- package/dist/plus/ai/models/model.js +50 -1
- package/dist/plus/ai/models/model.js.map +1 -1
- package/dist/plus/ai/models/promptTemplates.d.ts +5 -2
- package/dist/plus/ai/models/promptTemplates.d.ts.map +1 -1
- package/dist/plus/ai/models/promptTemplates.js.map +1 -1
- package/dist/plus/ai/models/provider.d.ts.map +1 -1
- package/dist/plus/ai/models/provider.js.map +1 -1
- package/dist/plus/ai/models/results.d.ts.map +1 -1
- package/dist/plus/ai/models/results.js.map +1 -1
- package/dist/plus/ai/prompts.d.ts +1 -1
- package/dist/plus/ai/prompts.d.ts.map +1 -1
- package/dist/plus/ai/prompts.js +15 -47
- package/dist/plus/ai/prompts.js.map +1 -1
- package/dist/plus/ai/providers/anthropicProvider.d.ts +5 -0
- package/dist/plus/ai/providers/anthropicProvider.d.ts.map +1 -1
- package/dist/plus/ai/providers/anthropicProvider.js +40 -3
- package/dist/plus/ai/providers/anthropicProvider.js.map +1 -1
- package/dist/plus/ai/providers/azureProvider.d.ts.map +1 -1
- package/dist/plus/ai/providers/azureProvider.js.map +1 -1
- package/dist/plus/ai/providers/context.d.ts.map +1 -1
- package/dist/plus/ai/providers/context.js.map +1 -1
- package/dist/plus/ai/providers/deepSeekProvider.d.ts.map +1 -1
- package/dist/plus/ai/providers/deepSeekProvider.js +17 -1
- package/dist/plus/ai/providers/deepSeekProvider.js.map +1 -1
- package/dist/plus/ai/providers/geminiProvider.d.ts.map +1 -1
- package/dist/plus/ai/providers/geminiProvider.js +25 -6
- package/dist/plus/ai/providers/geminiProvider.js.map +1 -1
- package/dist/plus/ai/providers/gitkrakenProvider.d.ts.map +1 -1
- package/dist/plus/ai/providers/gitkrakenProvider.js +1 -0
- package/dist/plus/ai/providers/gitkrakenProvider.js.map +1 -1
- package/dist/plus/ai/providers/huggingFaceProvider.d.ts +1 -1
- package/dist/plus/ai/providers/huggingFaceProvider.d.ts.map +1 -1
- package/dist/plus/ai/providers/huggingFaceProvider.js +21 -18
- package/dist/plus/ai/providers/huggingFaceProvider.js.map +1 -1
- package/dist/plus/ai/providers/mistralProvider.d.ts.map +1 -1
- package/dist/plus/ai/providers/mistralProvider.js.map +1 -1
- package/dist/plus/ai/providers/ollamaProvider.d.ts.map +1 -1
- package/dist/plus/ai/providers/ollamaProvider.js.map +1 -1
- package/dist/plus/ai/providers/openAICompatibleProvider.d.ts.map +1 -1
- package/dist/plus/ai/providers/openAICompatibleProvider.js.map +1 -1
- package/dist/plus/ai/providers/openAICompatibleProviderBase.d.ts +10 -1
- package/dist/plus/ai/providers/openAICompatibleProviderBase.d.ts.map +1 -1
- package/dist/plus/ai/providers/openAICompatibleProviderBase.js +9 -1
- package/dist/plus/ai/providers/openAICompatibleProviderBase.js.map +1 -1
- package/dist/plus/ai/providers/openRouterProvider.d.ts.map +1 -1
- package/dist/plus/ai/providers/openRouterProvider.js.map +1 -1
- package/dist/plus/ai/providers/openaiProvider.d.ts.map +1 -1
- package/dist/plus/ai/providers/openaiProvider.js.map +1 -1
- package/dist/plus/ai/providers/xaiProvider.d.ts.map +1 -1
- package/dist/plus/ai/providers/xaiProvider.js +14 -1
- package/dist/plus/ai/providers/xaiProvider.js.map +1 -1
- package/dist/plus/ai/utils/ai.utils.d.ts.map +1 -1
- package/dist/plus/ai/utils/ai.utils.js +0 -2
- package/dist/plus/ai/utils/ai.utils.js.map +1 -1
- package/dist/plus/ai/utils/results.utils.d.ts +3 -0
- package/dist/plus/ai/utils/results.utils.d.ts.map +1 -1
- package/dist/plus/ai/utils/results.utils.js +26 -0
- package/dist/plus/ai/utils/results.utils.js.map +1 -1
- package/dist/plus/ai/utils/truncation.utils.d.ts +1 -1
- package/dist/plus/ai/utils/truncation.utils.d.ts.map +1 -1
- package/dist/plus/ai/utils/truncation.utils.js.map +1 -1
- package/dist/plus/git-github/api/config.d.ts.map +1 -1
- package/dist/plus/git-github/api/config.js.map +1 -1
- package/dist/plus/git-github/api/github.d.ts +66 -3
- package/dist/plus/git-github/api/github.d.ts.map +1 -1
- package/dist/plus/git-github/api/github.js +345 -74
- package/dist/plus/git-github/api/github.js.map +1 -1
- package/dist/plus/git-github/api/github.utils.d.ts.map +1 -1
- package/dist/plus/git-github/api/github.utils.js.map +1 -1
- package/dist/plus/git-github/api/token.d.ts.map +1 -1
- package/dist/plus/git-github/api/token.js.map +1 -1
- package/dist/plus/git-github/api/tokenUtils.d.ts.map +1 -1
- package/dist/plus/git-github/api/tokenUtils.js.map +1 -1
- package/dist/plus/git-github/api/types.d.ts.map +1 -1
- package/dist/plus/git-github/api/types.js.map +1 -1
- package/dist/plus/git-github/context.d.ts.map +1 -1
- package/dist/plus/git-github/models.d.ts +5 -0
- package/dist/plus/git-github/models.d.ts.map +1 -1
- package/dist/plus/git-github/models.js +27 -2
- package/dist/plus/git-github/models.js.map +1 -1
- package/dist/plus/git-github/providers/github/blame.d.ts.map +1 -1
- package/dist/plus/git-github/providers/github/blame.js.map +1 -1
- package/dist/plus/git-github/providers/github/branches.d.ts +2 -1
- package/dist/plus/git-github/providers/github/branches.d.ts.map +1 -1
- package/dist/plus/git-github/providers/github/branches.js +7 -3
- package/dist/plus/git-github/providers/github/branches.js.map +1 -1
- package/dist/plus/git-github/providers/github/commits.d.ts.map +1 -1
- package/dist/plus/git-github/providers/github/commits.js.map +1 -1
- package/dist/plus/git-github/providers/github/config.d.ts.map +1 -1
- package/dist/plus/git-github/providers/github/config.js.map +1 -1
- package/dist/plus/git-github/providers/github/contributors.d.ts.map +1 -1
- package/dist/plus/git-github/providers/github/contributors.js.map +1 -1
- package/dist/plus/git-github/providers/github/diff.d.ts.map +1 -1
- package/dist/plus/git-github/providers/github/diff.js +2 -2
- package/dist/plus/git-github/providers/github/diff.js.map +1 -1
- package/dist/plus/git-github/providers/github/graph.d.ts +12 -1
- package/dist/plus/git-github/providers/github/graph.d.ts.map +1 -1
- package/dist/plus/git-github/providers/github/graph.js +85 -0
- package/dist/plus/git-github/providers/github/graph.js.map +1 -1
- package/dist/plus/git-github/providers/github/refs.d.ts.map +1 -1
- package/dist/plus/git-github/providers/github/refs.js.map +1 -1
- package/dist/plus/git-github/providers/github/remotes.d.ts.map +1 -1
- package/dist/plus/git-github/providers/github/remotes.js.map +1 -1
- package/dist/plus/git-github/providers/github/revision.d.ts.map +1 -1
- package/dist/plus/git-github/providers/github/revision.js.map +1 -1
- package/dist/plus/git-github/providers/github/status.d.ts.map +1 -1
- package/dist/plus/git-github/providers/github/status.js.map +1 -1
- package/dist/plus/git-github/providers/github/tags.d.ts.map +1 -1
- package/dist/plus/git-github/providers/github/tags.js +3 -1
- package/dist/plus/git-github/providers/github/tags.js.map +1 -1
- package/dist/plus/git-github/providers/githubGitProvider.d.ts.map +1 -1
- package/dist/plus/git-github/providers/githubGitProvider.js.map +1 -1
- package/dist/plus/git-github/providers/githubProvider.d.ts.map +1 -1
- package/dist/plus/git-github/providers/githubProvider.js.map +1 -1
- package/dist/plus/integrations/authentication/cloudIntegrationService.d.ts +20 -1
- package/dist/plus/integrations/authentication/cloudIntegrationService.d.ts.map +1 -1
- package/dist/plus/integrations/authentication/cloudIntegrationService.js +134 -10
- package/dist/plus/integrations/authentication/cloudIntegrationService.js.map +1 -1
- package/dist/plus/integrations/authentication/configuredIntegrationService.d.ts +52 -5
- package/dist/plus/integrations/authentication/configuredIntegrationService.d.ts.map +1 -1
- package/dist/plus/integrations/authentication/configuredIntegrationService.js +248 -46
- package/dist/plus/integrations/authentication/configuredIntegrationService.js.map +1 -1
- package/dist/plus/integrations/authentication/integrationAuthenticationProvider.d.ts +24 -4
- package/dist/plus/integrations/authentication/integrationAuthenticationProvider.d.ts.map +1 -1
- package/dist/plus/integrations/authentication/integrationAuthenticationProvider.js +58 -26
- package/dist/plus/integrations/authentication/integrationAuthenticationProvider.js.map +1 -1
- package/dist/plus/integrations/authentication/integrationAuthenticationService.d.ts.map +1 -1
- package/dist/plus/integrations/authentication/integrationAuthenticationService.js +7 -3
- package/dist/plus/integrations/authentication/integrationAuthenticationService.js.map +1 -1
- package/dist/plus/integrations/authentication/manualTokenProvider.d.ts +1 -0
- package/dist/plus/integrations/authentication/manualTokenProvider.d.ts.map +1 -1
- package/dist/plus/integrations/authentication/manualTokenProvider.js +9 -5
- package/dist/plus/integrations/authentication/manualTokenProvider.js.map +1 -1
- package/dist/plus/integrations/authentication/models.d.ts +33 -0
- package/dist/plus/integrations/authentication/models.d.ts.map +1 -1
- package/dist/plus/integrations/authentication/models.js.map +1 -1
- package/dist/plus/integrations/collectionMetadata.d.ts +21 -0
- package/dist/plus/integrations/collectionMetadata.d.ts.map +1 -0
- package/dist/plus/integrations/collectionMetadata.js +121 -0
- package/dist/plus/integrations/collectionMetadata.js.map +1 -0
- package/dist/plus/integrations/constants.d.ts +12 -2
- package/dist/plus/integrations/constants.d.ts.map +1 -1
- package/dist/plus/integrations/constants.js +10 -0
- package/dist/plus/integrations/constants.js.map +1 -1
- package/dist/plus/integrations/context.d.ts +10 -6
- package/dist/plus/integrations/context.d.ts.map +1 -1
- package/dist/plus/integrations/errors.d.ts +65 -0
- package/dist/plus/integrations/errors.d.ts.map +1 -1
- package/dist/plus/integrations/errors.js +135 -0
- package/dist/plus/integrations/errors.js.map +1 -1
- package/dist/plus/integrations/index.d.ts +57 -12
- package/dist/plus/integrations/index.d.ts.map +1 -1
- package/dist/plus/integrations/index.js +39 -37
- package/dist/plus/integrations/index.js.map +1 -1
- package/dist/plus/integrations/integrationService.d.ts +297 -13
- package/dist/plus/integrations/integrationService.d.ts.map +1 -1
- package/dist/plus/integrations/integrationService.js +672 -36
- package/dist/plus/integrations/integrationService.js.map +1 -1
- package/dist/plus/integrations/lite.d.ts +47 -0
- package/dist/plus/integrations/lite.d.ts.map +1 -0
- package/dist/plus/integrations/lite.js +141 -0
- package/dist/plus/integrations/lite.js.map +1 -0
- package/dist/plus/integrations/manager.d.ts +332 -0
- package/dist/plus/integrations/manager.d.ts.map +1 -0
- package/dist/plus/integrations/manager.js +2 -0
- package/dist/plus/integrations/manager.js.map +1 -0
- package/dist/plus/integrations/models/gitHostIntegration.d.ts +262 -10
- package/dist/plus/integrations/models/gitHostIntegration.d.ts.map +1 -1
- package/dist/plus/integrations/models/gitHostIntegration.js +675 -101
- package/dist/plus/integrations/models/gitHostIntegration.js.map +1 -1
- package/dist/plus/integrations/models/integration.d.ts +88 -3
- package/dist/plus/integrations/models/integration.d.ts.map +1 -1
- package/dist/plus/integrations/models/integration.js +192 -21
- package/dist/plus/integrations/models/integration.js.map +1 -1
- package/dist/plus/integrations/models/issuesIntegration.d.ts +70 -7
- package/dist/plus/integrations/models/issuesIntegration.d.ts.map +1 -1
- package/dist/plus/integrations/models/issuesIntegration.js +108 -35
- package/dist/plus/integrations/models/issuesIntegration.js.map +1 -1
- package/dist/plus/integrations/providerFilters.d.ts +12 -0
- package/dist/plus/integrations/providerFilters.d.ts.map +1 -0
- package/dist/plus/integrations/providerFilters.js +14 -0
- package/dist/plus/integrations/providerFilters.js.map +1 -0
- package/dist/plus/integrations/providers/apiClients.d.ts.map +1 -1
- package/dist/plus/integrations/providers/apiClients.js +3 -3
- package/dist/plus/integrations/providers/apiClients.js.map +1 -1
- package/dist/plus/integrations/providers/apiConfig.d.ts +52 -0
- package/dist/plus/integrations/providers/apiConfig.d.ts.map +1 -0
- package/dist/plus/integrations/providers/apiConfig.js +19 -0
- package/dist/plus/integrations/providers/apiConfig.js.map +1 -0
- package/dist/plus/integrations/providers/azure/azure.d.ts +14 -2
- package/dist/plus/integrations/providers/azure/azure.d.ts.map +1 -1
- package/dist/plus/integrations/providers/azure/azure.js +107 -32
- package/dist/plus/integrations/providers/azure/azure.js.map +1 -1
- package/dist/plus/integrations/providers/azure/models.d.ts +16 -0
- package/dist/plus/integrations/providers/azure/models.d.ts.map +1 -1
- package/dist/plus/integrations/providers/azure/models.js +6 -6
- package/dist/plus/integrations/providers/azure/models.js.map +1 -1
- package/dist/plus/integrations/providers/azureDevOps.d.ts +55 -9
- package/dist/plus/integrations/providers/azureDevOps.d.ts.map +1 -1
- package/dist/plus/integrations/providers/azureDevOps.js +572 -79
- package/dist/plus/integrations/providers/azureDevOps.js.map +1 -1
- package/dist/plus/integrations/providers/bitbucket/bitbucket.d.ts +13 -2
- package/dist/plus/integrations/providers/bitbucket/bitbucket.d.ts.map +1 -1
- package/dist/plus/integrations/providers/bitbucket/bitbucket.js +108 -32
- package/dist/plus/integrations/providers/bitbucket/bitbucket.js.map +1 -1
- package/dist/plus/integrations/providers/bitbucket/models.d.ts.map +1 -1
- package/dist/plus/integrations/providers/bitbucket/models.js.map +1 -1
- package/dist/plus/integrations/providers/bitbucket-server/models.d.ts +19 -1
- package/dist/plus/integrations/providers/bitbucket-server/models.d.ts.map +1 -1
- package/dist/plus/integrations/providers/bitbucket-server/models.js +20 -1
- package/dist/plus/integrations/providers/bitbucket-server/models.js.map +1 -1
- package/dist/plus/integrations/providers/bitbucket-server.d.ts +28 -4
- package/dist/plus/integrations/providers/bitbucket-server.d.ts.map +1 -1
- package/dist/plus/integrations/providers/bitbucket-server.js +110 -6
- package/dist/plus/integrations/providers/bitbucket-server.js.map +1 -1
- package/dist/plus/integrations/providers/bitbucket.d.ts +38 -4
- package/dist/plus/integrations/providers/bitbucket.d.ts.map +1 -1
- package/dist/plus/integrations/providers/bitbucket.js +330 -34
- package/dist/plus/integrations/providers/bitbucket.js.map +1 -1
- package/dist/plus/integrations/providers/github/github.d.ts.map +1 -1
- package/dist/plus/integrations/providers/github/github.js +1 -1
- package/dist/plus/integrations/providers/github/github.js.map +1 -1
- package/dist/plus/integrations/providers/github/github.utils.d.ts.map +1 -1
- package/dist/plus/integrations/providers/github/github.utils.js.map +1 -1
- package/dist/plus/integrations/providers/github/models.d.ts.map +1 -1
- package/dist/plus/integrations/providers/github/models.js.map +1 -1
- package/dist/plus/integrations/providers/github.d.ts +49 -6
- package/dist/plus/integrations/providers/github.d.ts.map +1 -1
- package/dist/plus/integrations/providers/github.js +289 -4
- package/dist/plus/integrations/providers/github.js.map +1 -1
- package/dist/plus/integrations/providers/gitlab/gitlab.d.ts +11 -3
- package/dist/plus/integrations/providers/gitlab/gitlab.d.ts.map +1 -1
- package/dist/plus/integrations/providers/gitlab/gitlab.js +121 -47
- package/dist/plus/integrations/providers/gitlab/gitlab.js.map +1 -1
- package/dist/plus/integrations/providers/gitlab/gitlab.utils.d.ts +6 -0
- package/dist/plus/integrations/providers/gitlab/gitlab.utils.d.ts.map +1 -1
- package/dist/plus/integrations/providers/gitlab/gitlab.utils.js +8 -0
- package/dist/plus/integrations/providers/gitlab/gitlab.utils.js.map +1 -1
- package/dist/plus/integrations/providers/gitlab/models.d.ts +10 -0
- package/dist/plus/integrations/providers/gitlab/models.d.ts.map +1 -1
- package/dist/plus/integrations/providers/gitlab/models.js +8 -5
- package/dist/plus/integrations/providers/gitlab/models.js.map +1 -1
- package/dist/plus/integrations/providers/gitlab.d.ts +50 -5
- package/dist/plus/integrations/providers/gitlab.d.ts.map +1 -1
- package/dist/plus/integrations/providers/gitlab.js +274 -8
- package/dist/plus/integrations/providers/gitlab.js.map +1 -1
- package/dist/plus/integrations/providers/jira.d.ts +13 -2
- package/dist/plus/integrations/providers/jira.d.ts.map +1 -1
- package/dist/plus/integrations/providers/jira.js +200 -30
- package/dist/plus/integrations/providers/jira.js.map +1 -1
- package/dist/plus/integrations/providers/linear.d.ts +16 -5
- package/dist/plus/integrations/providers/linear.d.ts.map +1 -1
- package/dist/plus/integrations/providers/linear.js +127 -21
- package/dist/plus/integrations/providers/linear.js.map +1 -1
- package/dist/plus/integrations/providers/models.d.ts +339 -60
- package/dist/plus/integrations/providers/models.d.ts.map +1 -1
- package/dist/plus/integrations/providers/models.js +307 -59
- package/dist/plus/integrations/providers/models.js.map +1 -1
- package/dist/plus/integrations/providers/providersApi.d.ts +144 -11
- package/dist/plus/integrations/providers/providersApi.d.ts.map +1 -1
- package/dist/plus/integrations/providers/providersApi.js +486 -55
- package/dist/plus/integrations/providers/providersApi.js.map +1 -1
- package/dist/plus/integrations/providers/trello.d.ts +47 -0
- package/dist/plus/integrations/providers/trello.d.ts.map +1 -0
- package/dist/plus/integrations/providers/trello.js +141 -0
- package/dist/plus/integrations/providers/trello.js.map +1 -0
- package/dist/plus/integrations/providers/utils/providerPaging.d.ts +29 -0
- package/dist/plus/integrations/providers/utils/providerPaging.d.ts.map +1 -0
- package/dist/plus/integrations/providers/utils/providerPaging.js +154 -0
- package/dist/plus/integrations/providers/utils/providerPaging.js.map +1 -0
- package/dist/plus/integrations/providers/utils.d.ts +21 -0
- package/dist/plus/integrations/providers/utils.d.ts.map +1 -1
- package/dist/plus/integrations/providers/utils.js +57 -6
- package/dist/plus/integrations/providers/utils.js.map +1 -1
- package/dist/plus/integrations/reads/broaden.d.ts +20 -0
- package/dist/plus/integrations/reads/broaden.d.ts.map +1 -0
- package/dist/plus/integrations/reads/broaden.js +326 -0
- package/dist/plus/integrations/reads/broaden.js.map +1 -0
- package/dist/plus/integrations/reads/context.d.ts +74 -0
- package/dist/plus/integrations/reads/context.d.ts.map +1 -0
- package/dist/plus/integrations/reads/context.js +2 -0
- package/dist/plus/integrations/reads/context.js.map +1 -0
- package/dist/plus/integrations/reads/cursors.d.ts +66 -0
- package/dist/plus/integrations/reads/cursors.d.ts.map +1 -0
- package/dist/plus/integrations/reads/cursors.js +133 -0
- package/dist/plus/integrations/reads/cursors.js.map +1 -0
- package/dist/plus/integrations/reads/drains.d.ts +60 -0
- package/dist/plus/integrations/reads/drains.d.ts.map +1 -0
- package/dist/plus/integrations/reads/drains.js +255 -0
- package/dist/plus/integrations/reads/drains.js.map +1 -0
- package/dist/plus/integrations/reads/filters.d.ts +81 -0
- package/dist/plus/integrations/reads/filters.d.ts.map +1 -0
- package/dist/plus/integrations/reads/filters.js +87 -0
- package/dist/plus/integrations/reads/filters.js.map +1 -0
- package/dist/plus/integrations/reads/hierarchy.d.ts +17 -0
- package/dist/plus/integrations/reads/hierarchy.d.ts.map +1 -0
- package/dist/plus/integrations/reads/hierarchy.js +320 -0
- package/dist/plus/integrations/reads/hierarchy.js.map +1 -0
- package/dist/plus/integrations/reads/hierarchy.utils.d.ts +77 -0
- package/dist/plus/integrations/reads/hierarchy.utils.d.ts.map +1 -0
- package/dist/plus/integrations/reads/hierarchy.utils.js +128 -0
- package/dist/plus/integrations/reads/hierarchy.utils.js.map +1 -0
- package/dist/plus/integrations/reads/issueTracker.d.ts +19 -0
- package/dist/plus/integrations/reads/issueTracker.d.ts.map +1 -0
- package/dist/plus/integrations/reads/issueTracker.js +334 -0
- package/dist/plus/integrations/reads/issueTracker.js.map +1 -0
- package/dist/plus/integrations/reads/issues.d.ts +34 -0
- package/dist/plus/integrations/reads/issues.d.ts.map +1 -0
- package/dist/plus/integrations/reads/issues.js +244 -0
- package/dist/plus/integrations/reads/issues.js.map +1 -0
- package/dist/plus/integrations/reads/paging.d.ts +136 -0
- package/dist/plus/integrations/reads/paging.d.ts.map +1 -0
- package/dist/plus/integrations/reads/paging.js +221 -0
- package/dist/plus/integrations/reads/paging.js.map +1 -0
- package/dist/plus/integrations/reads/pullRequests.d.ts +32 -0
- package/dist/plus/integrations/reads/pullRequests.d.ts.map +1 -0
- package/dist/plus/integrations/reads/pullRequests.js +151 -0
- package/dist/plus/integrations/reads/pullRequests.js.map +1 -0
- package/dist/plus/integrations/reads/resolveRepository.d.ts +25 -0
- package/dist/plus/integrations/reads/resolveRepository.d.ts.map +1 -0
- package/dist/plus/integrations/reads/resolveRepository.js +235 -0
- package/dist/plus/integrations/reads/resolveRepository.js.map +1 -0
- package/dist/plus/integrations/reads/sweeps.d.ts +11 -0
- package/dist/plus/integrations/reads/sweeps.d.ts.map +1 -0
- package/dist/plus/integrations/reads/sweeps.js +125 -0
- package/dist/plus/integrations/reads/sweeps.js.map +1 -0
- package/dist/plus/integrations/reads/warnings.d.ts +47 -0
- package/dist/plus/integrations/reads/warnings.d.ts.map +1 -0
- package/dist/plus/integrations/reads/warnings.js +81 -0
- package/dist/plus/integrations/reads/warnings.js.map +1 -0
- package/dist/plus/integrations/results.d.ts +189 -0
- package/dist/plus/integrations/results.d.ts.map +1 -0
- package/dist/plus/integrations/results.js +62 -0
- package/dist/plus/integrations/results.js.map +1 -0
- package/dist/plus/integrations/utils/domain.utils.d.ts +5 -0
- package/dist/plus/integrations/utils/domain.utils.d.ts.map +1 -0
- package/dist/plus/integrations/utils/domain.utils.js +27 -0
- package/dist/plus/integrations/utils/domain.utils.js.map +1 -0
- package/dist/plus/integrations/utils/integration.utils.d.ts +27 -1
- package/dist/plus/integrations/utils/integration.utils.d.ts.map +1 -1
- package/dist/plus/integrations/utils/integration.utils.js +86 -15
- package/dist/plus/integrations/utils/integration.utils.js.map +1 -1
- package/dist/utils/array.d.ts.map +1 -1
- package/dist/utils/array.js.map +1 -1
- package/dist/utils/brand.d.ts.map +1 -1
- package/dist/utils/cancellation.d.ts +13 -0
- package/dist/utils/cancellation.d.ts.map +1 -1
- package/dist/utils/cancellation.js +52 -7
- package/dist/utils/cancellation.js.map +1 -1
- package/dist/utils/charCode.d.ts.map +1 -1
- package/dist/utils/coalescedRun.d.ts +16 -0
- package/dist/utils/coalescedRun.d.ts.map +1 -0
- package/dist/utils/coalescedRun.js +43 -0
- package/dist/utils/coalescedRun.js.map +1 -0
- package/dist/utils/color.d.ts.map +1 -1
- package/dist/utils/color.js +3 -3
- package/dist/utils/color.js.map +1 -1
- package/dist/utils/date.d.ts +24 -0
- package/dist/utils/date.d.ts.map +1 -1
- package/dist/utils/date.js +62 -0
- package/dist/utils/date.js.map +1 -1
- package/dist/utils/debounce.js +1 -1
- package/dist/utils/debounce.js.map +1 -1
- package/dist/utils/decorators/debounce.d.ts.map +1 -1
- package/dist/utils/decorators/debounce.js.map +1 -1
- package/dist/utils/decorators/gate.d.ts.map +1 -1
- package/dist/utils/decorators/gate.js +2 -2
- package/dist/utils/decorators/gate.js.map +1 -1
- package/dist/utils/decorators/log.d.ts.map +1 -1
- package/dist/utils/decorators/log.js +5 -5
- package/dist/utils/decorators/log.js.map +1 -1
- package/dist/utils/decorators/memoize.d.ts.map +1 -1
- package/dist/utils/decorators/memoize.js +2 -2
- package/dist/utils/decorators/memoize.js.map +1 -1
- package/dist/utils/decorators/resolver.d.ts.map +1 -1
- package/dist/utils/decorators/resolver.js.map +1 -1
- package/dist/utils/decorators/sequentialize.d.ts.map +1 -1
- package/dist/utils/decorators/sequentialize.js +2 -2
- package/dist/utils/decorators/sequentialize.js.map +1 -1
- package/dist/utils/decorators/serializable.d.ts.map +1 -1
- package/dist/utils/decorators/serializable.js +1 -1
- package/dist/utils/decorators/serializable.js.map +1 -1
- package/dist/utils/dedupedAsyncCache.d.ts.map +1 -1
- package/dist/utils/env/browser/base64.d.ts.map +1 -1
- package/dist/utils/env/browser/base64.js.map +1 -1
- package/dist/utils/env/browser/crypto.d.ts.map +1 -1
- package/dist/utils/env/browser/crypto.js.map +1 -1
- package/dist/utils/env/browser/fs.d.ts.map +1 -1
- package/dist/utils/env/browser/fs.js.map +1 -1
- package/dist/utils/env/browser/hex.d.ts.map +1 -1
- package/dist/utils/env/browser/hex.js.map +1 -1
- package/dist/utils/env/browser/hrtime.d.ts.map +1 -1
- package/dist/utils/env/browser/hrtime.js.map +1 -1
- package/dist/utils/env/browser/logScope.d.ts.map +1 -1
- package/dist/utils/env/browser/logScope.js.map +1 -1
- package/dist/utils/env/browser/md5.d.ts.map +1 -1
- package/dist/utils/env/browser/md5.js.map +1 -1
- package/dist/utils/env/browser/platform.d.ts.map +1 -1
- package/dist/utils/env/browser/platform.js.map +1 -1
- package/dist/utils/env/node/base64.d.ts.map +1 -1
- package/dist/utils/env/node/base64.js.map +1 -1
- package/dist/utils/env/node/crypto.d.ts.map +1 -1
- package/dist/utils/env/node/crypto.js.map +1 -1
- package/dist/utils/env/node/exec.d.ts +9 -1
- package/dist/utils/env/node/exec.d.ts.map +1 -1
- package/dist/utils/env/node/exec.js +11 -4
- package/dist/utils/env/node/exec.js.map +1 -1
- package/dist/utils/env/node/fs.d.ts.map +1 -1
- package/dist/utils/env/node/fs.js.map +1 -1
- package/dist/utils/env/node/hex.d.ts.map +1 -1
- package/dist/utils/env/node/hex.js.map +1 -1
- package/dist/utils/env/node/hrtime.d.ts.map +1 -1
- package/dist/utils/env/node/hrtime.js.map +1 -1
- package/dist/utils/env/node/logScope.d.ts.map +1 -1
- package/dist/utils/env/node/logScope.js.map +1 -1
- package/dist/utils/env/node/platform.d.ts.map +1 -1
- package/dist/utils/env/node/platform.js.map +1 -1
- package/dist/utils/event.d.ts.map +1 -1
- package/dist/utils/event.js +18 -22
- package/dist/utils/event.js.map +1 -1
- package/dist/utils/formatter.d.ts.map +1 -1
- package/dist/utils/formatter.js.map +1 -1
- package/dist/utils/function.d.ts.map +1 -1
- package/dist/utils/function.js +3 -3
- package/dist/utils/function.js.map +1 -1
- package/dist/utils/hash.js.map +1 -1
- package/dist/utils/iterable.d.ts.map +1 -1
- package/dist/utils/iterable.js +2 -6
- package/dist/utils/iterable.js.map +1 -1
- package/dist/utils/lazy.d.ts.map +1 -1
- package/dist/utils/lazy.js.map +1 -1
- package/dist/utils/logger.d.ts.map +1 -1
- package/dist/utils/logger.js +1 -1
- package/dist/utils/logger.js.map +1 -1
- package/dist/utils/logger.scoped.js +1 -1
- package/dist/utils/logger.scoped.js.map +1 -1
- package/dist/utils/lruMap.d.ts.map +1 -1
- package/dist/utils/lruMap.js.map +1 -1
- package/dist/utils/mru.d.ts.map +1 -1
- package/dist/utils/mru.js.map +1 -1
- package/dist/utils/object.js.map +1 -1
- package/dist/utils/paging.d.ts +29 -0
- package/dist/utils/paging.d.ts.map +1 -1
- package/dist/utils/paging.js +18 -0
- package/dist/utils/paging.js.map +1 -1
- package/dist/utils/path.js.map +1 -1
- package/dist/utils/promise.d.ts +10 -0
- package/dist/utils/promise.d.ts.map +1 -1
- package/dist/utils/promise.js +26 -3
- package/dist/utils/promise.js.map +1 -1
- package/dist/utils/promiseCache.d.ts +12 -2
- package/dist/utils/promiseCache.d.ts.map +1 -1
- package/dist/utils/promiseCache.js +80 -50
- package/dist/utils/promiseCache.js.map +1 -1
- package/dist/utils/searchTree.d.ts.map +1 -1
- package/dist/utils/searchTree.js +4 -1
- package/dist/utils/searchTree.js.map +1 -1
- package/dist/utils/stopwatch.d.ts.map +1 -1
- package/dist/utils/string.js +1 -1
- package/dist/utils/string.js.map +1 -1
- package/dist/utils/subscriptionManager.d.ts.map +1 -1
- package/dist/utils/subscriptionManager.js.map +1 -1
- package/dist/utils/trie.d.ts.map +1 -1
- package/dist/utils/trie.js +1 -0
- package/dist/utils/trie.js.map +1 -1
- package/docs/integrations.md +372 -0
- package/docs/kepler-read-api-parity.md +112 -0
- package/package.json +238 -213
- package/src/git/cache.ts +75 -8
- package/src/git/errors.ts +36 -1
- package/src/git/models/commit.ts +1 -1
- package/src/git/models/graph.ts +147 -0
- package/src/git/models/graphSession.ts +205 -0
- package/src/git/models/issue.ts +12 -1
- package/src/git/models/pullRequest.ts +27 -1
- package/src/git/models/repository.ts +24 -1
- package/src/git/models/resourceDescriptor.ts +17 -0
- package/src/git/models/signature.ts +16 -0
- package/src/git/models/tag.ts +6 -1
- package/src/git/parsers/diffParser.ts +1 -1
- package/src/git/providers/branches.ts +6 -1
- package/src/git/providers/commits.ts +6 -1
- package/src/git/providers/config.ts +5 -1
- package/src/git/providers/graph.ts +69 -2
- package/src/git/providers/status.ts +1 -1
- package/src/git/providers/worktrees.ts +3 -1
- package/src/git/remotes/azure-devops.ts +29 -33
- package/src/git/remotes/bitbucket-server.ts +23 -25
- package/src/git/remotes/bitbucket.ts +23 -25
- package/src/git/remotes/gerrit.ts +12 -14
- package/src/git/remotes/gitea.ts +13 -15
- package/src/git/remotes/github.ts +56 -58
- package/src/git/remotes/gitlab.ts +102 -104
- package/src/git/run.types.ts +54 -4
- package/src/git/utils/branch.utils.ts +12 -1
- package/src/git/utils/contributor.utils.ts +1 -1
- package/src/git/utils/fileStatus.utils.ts +7 -0
- package/src/git/utils/graph.utils.ts +46 -0
- package/src/git/utils/issue.utils.ts +1 -0
- package/src/git/utils/pullRequest.utils.ts +9 -0
- package/src/git/utils/reachability.utils.ts +79 -8
- package/src/git/utils/sshKey.utils.ts +30 -0
- package/src/git/watching/watchService.ts +16 -1
- package/src/git/watching/watchSession.ts +20 -2
- package/src/git-cli/exec/git.ts +144 -42
- package/src/git-cli/parsers/logParser.ts +83 -1
- package/src/git-cli/parsers/sshSignatureParser.ts +85 -0
- package/src/git-cli/parsers/worktreeParser.ts +5 -7
- package/src/git-cli/providers/branches.ts +60 -38
- package/src/git-cli/providers/commits.ts +102 -9
- package/src/git-cli/providers/graph.ts +1771 -393
- package/src/git-cli/providers/pausedOperations.ts +3 -3
- package/src/git-cli/providers/revision.ts +42 -0
- package/src/git-cli/providers/status.ts +333 -178
- package/src/git-cli/providers/tags.ts +2 -0
- package/src/git-cli/providers/worktrees.ts +40 -4
- package/src/git-cli/service.ts +9 -0
- package/src/ipc/ipcServer.ts +1 -1
- package/src/plus/agents/providers/claudeCodeProvider.ts +25 -0
- package/src/plus/agents/providers/claudeCodeTranscript.ts +320 -8
- package/src/plus/agents/types.ts +34 -0
- package/src/plus/ai/constants.ts +1 -9
- package/src/plus/ai/models/model.ts +53 -2
- package/src/plus/ai/models/promptTemplates.ts +9 -2
- package/src/plus/ai/prompts.ts +16 -48
- package/src/plus/ai/providers/anthropicProvider.ts +45 -3
- package/src/plus/ai/providers/deepSeekProvider.ts +17 -1
- package/src/plus/ai/providers/geminiProvider.ts +25 -6
- package/src/plus/ai/providers/gitkrakenProvider.ts +2 -0
- package/src/plus/ai/providers/huggingFaceProvider.ts +28 -21
- package/src/plus/ai/providers/openAICompatibleProviderBase.ts +16 -1
- package/src/plus/ai/providers/xaiProvider.ts +14 -1
- package/src/plus/ai/utils/ai.utils.ts +0 -2
- package/src/plus/ai/utils/results.utils.ts +32 -0
- package/src/plus/ai/utils/truncation.utils.ts +0 -1
- package/src/plus/git-github/api/github.ts +484 -104
- package/src/plus/git-github/models.ts +33 -0
- package/src/plus/git-github/providers/github/branches.ts +6 -3
- package/src/plus/git-github/providers/github/diff.ts +1 -1
- package/src/plus/git-github/providers/github/graph.ts +131 -0
- package/src/plus/git-github/providers/github/tags.ts +2 -0
- package/src/plus/integrations/authentication/cloudIntegrationService.ts +189 -17
- package/src/plus/integrations/authentication/configuredIntegrationService.ts +287 -50
- package/src/plus/integrations/authentication/integrationAuthenticationProvider.ts +105 -31
- package/src/plus/integrations/authentication/integrationAuthenticationService.ts +7 -3
- package/src/plus/integrations/authentication/manualTokenProvider.ts +12 -5
- package/src/plus/integrations/authentication/models.ts +35 -1
- package/src/plus/integrations/collectionMetadata.ts +143 -0
- package/src/plus/integrations/constants.ts +21 -0
- package/src/plus/integrations/context.ts +8 -9
- package/src/plus/integrations/errors.ts +153 -0
- package/src/plus/integrations/index.ts +148 -51
- package/src/plus/integrations/integrationService.ts +940 -49
- package/src/plus/integrations/lite.ts +233 -0
- package/src/plus/integrations/manager.ts +359 -0
- package/src/plus/integrations/models/gitHostIntegration.ts +1005 -134
- package/src/plus/integrations/models/integration.ts +293 -24
- package/src/plus/integrations/models/issuesIntegration.ts +132 -39
- package/src/plus/integrations/providerFilters.ts +12 -0
- package/src/plus/integrations/providers/apiClients.ts +8 -11
- package/src/plus/integrations/providers/apiConfig.ts +71 -0
- package/src/plus/integrations/providers/azure/azure.ts +164 -33
- package/src/plus/integrations/providers/azure/models.ts +19 -6
- package/src/plus/integrations/providers/azureDevOps.ts +766 -101
- package/src/plus/integrations/providers/bitbucket/bitbucket.ts +164 -34
- package/src/plus/integrations/providers/bitbucket-server/models.ts +32 -1
- package/src/plus/integrations/providers/bitbucket-server.ts +173 -8
- package/src/plus/integrations/providers/bitbucket.ts +489 -45
- package/src/plus/integrations/providers/github/github.ts +2 -2
- package/src/plus/integrations/providers/github/github.utils.ts +1 -1
- package/src/plus/integrations/providers/github.ts +390 -6
- package/src/plus/integrations/providers/gitlab/gitlab.ts +170 -60
- package/src/plus/integrations/providers/gitlab/gitlab.utils.ts +9 -0
- package/src/plus/integrations/providers/gitlab/models.ts +19 -5
- package/src/plus/integrations/providers/gitlab.ts +369 -10
- package/src/plus/integrations/providers/jira.ts +247 -42
- package/src/plus/integrations/providers/linear.ts +154 -27
- package/src/plus/integrations/providers/models.ts +583 -75
- package/src/plus/integrations/providers/providersApi.ts +849 -86
- package/src/plus/integrations/providers/trello.ts +205 -0
- package/src/plus/integrations/providers/utils/providerPaging.ts +177 -0
- package/src/plus/integrations/providers/utils.ts +68 -8
- package/src/plus/integrations/reads/broaden.ts +452 -0
- package/src/plus/integrations/reads/context.ts +99 -0
- package/src/plus/integrations/reads/cursors.ts +224 -0
- package/src/plus/integrations/reads/drains.ts +343 -0
- package/src/plus/integrations/reads/filters.ts +124 -0
- package/src/plus/integrations/reads/hierarchy.ts +473 -0
- package/src/plus/integrations/reads/hierarchy.utils.ts +155 -0
- package/src/plus/integrations/reads/issueTracker.ts +468 -0
- package/src/plus/integrations/reads/issues.ts +409 -0
- package/src/plus/integrations/reads/paging.ts +277 -0
- package/src/plus/integrations/reads/pullRequests.ts +260 -0
- package/src/plus/integrations/reads/resolveRepository.ts +272 -0
- package/src/plus/integrations/reads/sweeps.ts +185 -0
- package/src/plus/integrations/reads/warnings.ts +170 -0
- package/src/plus/integrations/results.ts +275 -0
- package/src/plus/integrations/utils/domain.utils.ts +26 -0
- package/src/plus/integrations/utils/integration.utils.ts +93 -16
- package/src/utils/brand.ts +0 -2
- package/src/utils/cancellation.ts +56 -7
- package/src/utils/coalescedRun.ts +45 -0
- package/src/utils/color.ts +3 -3
- package/src/utils/date.ts +72 -0
- package/src/utils/debounce.ts +1 -1
- package/src/utils/decorators/gate.ts +2 -2
- package/src/utils/decorators/log.ts +5 -5
- package/src/utils/decorators/memoize.ts +2 -2
- package/src/utils/decorators/sequentialize.ts +2 -2
- package/src/utils/decorators/serializable.ts +1 -1
- package/src/utils/env/node/exec.ts +20 -5
- package/src/utils/event.ts +19 -25
- package/src/utils/function.ts +3 -3
- package/src/utils/iterable.ts +2 -6
- package/src/utils/logger.scoped.ts +1 -1
- package/src/utils/logger.ts +1 -1
- package/src/utils/paging.ts +46 -0
- package/src/utils/promise.ts +33 -3
- package/src/utils/promiseCache.ts +81 -51
- package/src/utils/searchTree.ts +4 -2
- package/src/utils/string.ts +1 -1
- package/src/utils/trie.ts +1 -0
- package/dist/plus/ai/providers/githubModelsProvider.d.ts +0 -19
- package/dist/plus/ai/providers/githubModelsProvider.d.ts.map +0 -1
- package/dist/plus/ai/providers/githubModelsProvider.js +0 -51
- package/dist/plus/ai/providers/githubModelsProvider.js.map +0 -1
- package/src/plus/ai/providers/githubModelsProvider.ts +0 -92
|
@@ -10,10 +10,25 @@ import { fromDisposables } from '../../utils/disposable.js';
|
|
|
10
10
|
import { Emitter } from '../../utils/event.js';
|
|
11
11
|
import { filterMap, flatten } from '../../utils/iterable.js';
|
|
12
12
|
import { getScopedLogger } from '../../utils/logger.scoped.js';
|
|
13
|
+
import { CloudIntegrationService } from './authentication/cloudIntegrationService.js';
|
|
14
|
+
import { ConfiguredIntegrationService } from './authentication/configuredIntegrationService.js';
|
|
15
|
+
import { IntegrationAuthenticationService } from './authentication/integrationAuthenticationService.js';
|
|
13
16
|
import { getSupportedCloudIntegrationIds, isSupportedCloudIntegrationId, toIntegrationId, } from './authentication/models.js';
|
|
14
17
|
import { GitCloudHostIntegrationId, GitSelfManagedHostIntegrationId, IssuesCloudHostIntegrationId, } from './constants.js';
|
|
15
18
|
import { createApiClients } from './providers/apiClients.js';
|
|
16
|
-
import {
|
|
19
|
+
import { providersMetadata } from './providers/models.js';
|
|
20
|
+
import { broadenIssues } from './reads/broaden.js';
|
|
21
|
+
import { getSupportedFilters } from './reads/filters.js';
|
|
22
|
+
import { listOrgs, listProjects, listRepos } from './reads/hierarchy.js';
|
|
23
|
+
import { listIssuesPage } from './reads/issues.js';
|
|
24
|
+
import { listIssueTrackerIssuesPage } from './reads/issueTracker.js';
|
|
25
|
+
import { listPullRequestsPage } from './reads/pullRequests.js';
|
|
26
|
+
import { resolveRepository } from './reads/resolveRepository.js';
|
|
27
|
+
import { sweepClosedPullRequests, sweepPullRequests } from './reads/sweeps.js';
|
|
28
|
+
import { noConnectionWarning } from './reads/warnings.js';
|
|
29
|
+
import { hostFromDomain } from './utils/domain.utils.js';
|
|
30
|
+
import { convertRemoteProviderIdToIntegrationId, getIntegrationIdForRemote, isCloudGitSelfManagedHostIntegrationId, isGitCloudHostIntegrationId, isGitSelfManagedHostIntegrationId, isNonExpiringZeroTokenIntegrationId, remoteProviderTypeForConfig, remoteProviderTypeForIntegration, } from './utils/integration.utils.js';
|
|
31
|
+
const maxSmallIntegerV8 = 2 ** 30 - 1; // Max number that can be stored in V8's smis (small integers)
|
|
17
32
|
export class IntegrationService {
|
|
18
33
|
authenticationService;
|
|
19
34
|
configuredIntegrationService;
|
|
@@ -112,7 +127,26 @@ export class IntegrationService {
|
|
|
112
127
|
}
|
|
113
128
|
return true;
|
|
114
129
|
}
|
|
130
|
+
/**
|
|
131
|
+
* Starts the cloud connect flow without skipping an already-connected provider, allowing the host/GK Dev
|
|
132
|
+
* flow to add another account for that provider instead of treating the existing primary as sufficient.
|
|
133
|
+
* Returns whether a new connection was actually added (measured by a new cloud connection id appearing),
|
|
134
|
+
* since {@link connectCloudIntegrations} only reports provider-level success and can't detect a newly added
|
|
135
|
+
* secondary for an already-connected provider.
|
|
136
|
+
*/
|
|
137
|
+
async connectSecondary(id, source) {
|
|
138
|
+
const before = new Set(this.getConfigured(id, { cloud: true }).map(c => c.id));
|
|
139
|
+
await this.connectCloudIntegrations({ integrationIds: [id], skipIfConnected: false }, source);
|
|
140
|
+
return this.getConfigured(id, { cloud: true }).some(c => !before.has(c.id));
|
|
141
|
+
}
|
|
115
142
|
async get(id, domain) {
|
|
143
|
+
// Normalize to a bare host before anything keys off it. Callers pass a self-managed domain in both shapes
|
|
144
|
+
// — a full URL from a stored session/descriptor, a bare host from `hostFromDomain` — and the cache key is
|
|
145
|
+
// `${id}:${domain}`, so the same host arriving in two shapes would build two instances (and two
|
|
146
|
+
// "primaries") for one host.
|
|
147
|
+
if (isGitSelfManagedHostIntegrationId(id)) {
|
|
148
|
+
domain = hostFromDomain(domain) ?? domain;
|
|
149
|
+
}
|
|
116
150
|
let integration = this.getCached(id, domain);
|
|
117
151
|
if (integration == null) {
|
|
118
152
|
switch (id) {
|
|
@@ -127,7 +161,7 @@ export class IntegrationService {
|
|
|
127
161
|
return integration;
|
|
128
162
|
const configured = this.getConfigured(GitSelfManagedHostIntegrationId.CloudGitHubEnterprise);
|
|
129
163
|
if (configured.length) {
|
|
130
|
-
const { domain: configuredDomain } = configured[0];
|
|
164
|
+
const { domain: configuredDomain } = configured.find(c => c.primary) ?? configured[0];
|
|
131
165
|
if (configuredDomain == null)
|
|
132
166
|
throw new Error(`Domain is required for '${id}' integration`);
|
|
133
167
|
integration = new (await import(/* webpackChunkName: "integrations" */ './providers/github.js')).GitHubEnterpriseIntegration(this.ctx, this.authenticationService, this.getProvidersApi.bind(this), this._onDidChangeIntegrationConnection, configuredDomain);
|
|
@@ -150,7 +184,7 @@ export class IntegrationService {
|
|
|
150
184
|
return integration;
|
|
151
185
|
const configured = this.getConfigured(GitSelfManagedHostIntegrationId.CloudGitLabSelfHosted);
|
|
152
186
|
if (configured.length) {
|
|
153
|
-
const { domain: configuredDomain } = configured[0];
|
|
187
|
+
const { domain: configuredDomain } = configured.find(c => c.primary) ?? configured[0];
|
|
154
188
|
if (configuredDomain == null)
|
|
155
189
|
throw new Error(`Domain is required for '${id}' integration`);
|
|
156
190
|
integration = new (await import(/* webpackChunkName: "integrations" */ './providers/gitlab.js')).GitLabSelfHostedIntegration(this.ctx, this.authenticationService, this.getProvidersApi.bind(this), this._onDidChangeIntegrationConnection, configuredDomain);
|
|
@@ -173,7 +207,7 @@ export class IntegrationService {
|
|
|
173
207
|
return integration;
|
|
174
208
|
const configured = this.getConfigured(GitSelfManagedHostIntegrationId.BitbucketServer);
|
|
175
209
|
if (configured.length) {
|
|
176
|
-
const { domain: configuredDomain } = configured[0];
|
|
210
|
+
const { domain: configuredDomain } = configured.find(c => c.primary) ?? configured[0];
|
|
177
211
|
if (configuredDomain == null)
|
|
178
212
|
throw new Error(`Domain is required for '${id}' integration`);
|
|
179
213
|
integration = new (await import(/* webpackChunkName: "integrations" */ './providers/bitbucket-server.js')).BitbucketServerIntegration(this.ctx, this.authenticationService, this.getProvidersApi.bind(this), this._onDidChangeIntegrationConnection, configuredDomain);
|
|
@@ -196,7 +230,7 @@ export class IntegrationService {
|
|
|
196
230
|
return integration;
|
|
197
231
|
const configured = this.getConfigured(GitSelfManagedHostIntegrationId.AzureDevOpsServer);
|
|
198
232
|
if (configured.length) {
|
|
199
|
-
const { domain: configuredDomain } = configured[0];
|
|
233
|
+
const { domain: configuredDomain } = configured.find(c => c.primary) ?? configured[0];
|
|
200
234
|
if (configuredDomain == null)
|
|
201
235
|
throw new Error(`Domain is required for '${id}' integration`);
|
|
202
236
|
integration = new (await import(/* webpackChunkName: "integrations" */ './providers/azureDevOps.js')).AzureDevOpsServerIntegration(this.ctx, this.authenticationService, this.getProvidersApi.bind(this), this._onDidChangeIntegrationConnection, configuredDomain);
|
|
@@ -214,6 +248,9 @@ export class IntegrationService {
|
|
|
214
248
|
case IssuesCloudHostIntegrationId.Linear:
|
|
215
249
|
integration = new (await import(/* webpackChunkName: "integrations" */ './providers/linear.js')).LinearIntegration(this.ctx, this.authenticationService, this.getProvidersApi.bind(this), this._onDidChangeIntegrationConnection);
|
|
216
250
|
break;
|
|
251
|
+
case IssuesCloudHostIntegrationId.Trello:
|
|
252
|
+
integration = new (await import(/* webpackChunkName: "integrations" */ './providers/trello.js')).TrelloIntegration(this.ctx, this.authenticationService, this.getProvidersApi.bind(this), this._onDidChangeIntegrationConnection);
|
|
253
|
+
break;
|
|
217
254
|
default:
|
|
218
255
|
throw new Error(`Integration with '${id}' is not supported`);
|
|
219
256
|
}
|
|
@@ -224,6 +261,14 @@ export class IntegrationService {
|
|
|
224
261
|
getConfigured(id, options) {
|
|
225
262
|
return this.configuredIntegrationService.getConfigured(id, options);
|
|
226
263
|
}
|
|
264
|
+
/**
|
|
265
|
+
* The filters this provider's reads accept — part of the public {@link IntegrationManager} contract, so it
|
|
266
|
+
* stays a method here even though it needs no instance state; see {@link getSupportedFilters} for the
|
|
267
|
+
* capability table itself and why a consumer should intersect against it before reading.
|
|
268
|
+
*/
|
|
269
|
+
getSupportedFilters(providerId) {
|
|
270
|
+
return getSupportedFilters(providerId);
|
|
271
|
+
}
|
|
227
272
|
/**
|
|
228
273
|
* Returns the connected integration for a `GitRemote`, if any.
|
|
229
274
|
* Internal counterpart to the host's `getRemoteIntegration(remote)` helper.
|
|
@@ -332,20 +377,20 @@ export class IntegrationService {
|
|
|
332
377
|
}
|
|
333
378
|
return this.getMyIssuesCore(integrations);
|
|
334
379
|
}
|
|
335
|
-
async getMyCurrentAccounts(integrationIds) {
|
|
380
|
+
async getMyCurrentAccounts(integrationIds, connectionId) {
|
|
336
381
|
const accounts = new Map();
|
|
337
382
|
await Promise.allSettled(integrationIds.map(async (integrationId) => {
|
|
338
|
-
const integration = await this.
|
|
383
|
+
const integration = await this.getIntegrationForRead(integrationId, connectionId);
|
|
339
384
|
if (integration == null)
|
|
340
385
|
return;
|
|
341
|
-
const account = await integration.getCurrentAccount();
|
|
386
|
+
const account = await integration.getCurrentAccount({ connectionId: connectionId });
|
|
342
387
|
if (account) {
|
|
343
388
|
accounts.set(integrationId, account);
|
|
344
389
|
}
|
|
345
390
|
}));
|
|
346
391
|
return accounts;
|
|
347
392
|
}
|
|
348
|
-
async getMyPullRequests(integrationIds, cancellation, silent) {
|
|
393
|
+
async getMyPullRequests(integrationIds, cancellation, silent, options) {
|
|
349
394
|
const integrations = new Map();
|
|
350
395
|
for (const integrationId of integrationIds?.length
|
|
351
396
|
? integrationIds
|
|
@@ -361,15 +406,15 @@ export class IntegrationService {
|
|
|
361
406
|
}
|
|
362
407
|
if (integrations.size === 0)
|
|
363
408
|
return undefined;
|
|
364
|
-
return this.getMyPullRequestsCore(integrations, cancellation, silent);
|
|
409
|
+
return this.getMyPullRequestsCore(integrations, cancellation, silent, options);
|
|
365
410
|
}
|
|
366
|
-
async getMyPullRequestsCore(integrations, cancellation, silent) {
|
|
411
|
+
async getMyPullRequestsCore(integrations, cancellation, silent, options) {
|
|
367
412
|
const start = performance.now();
|
|
368
413
|
const promises = [];
|
|
369
414
|
for (const [integration, repos] of integrations) {
|
|
370
415
|
if (integration == null)
|
|
371
416
|
continue;
|
|
372
|
-
promises.push(integration.searchMyPullRequests(repos, cancellation, silent));
|
|
417
|
+
promises.push(integration.searchMyPullRequests(repos, cancellation, silent, undefined, undefined, options));
|
|
373
418
|
}
|
|
374
419
|
const results = await Promise.allSettled(promises);
|
|
375
420
|
const successfulResults = [
|
|
@@ -418,17 +463,246 @@ export class IntegrationService {
|
|
|
418
463
|
}
|
|
419
464
|
return this.getMyPullRequestsCore(integrations);
|
|
420
465
|
}
|
|
466
|
+
// #region ProviderBackend surface (#5438)
|
|
467
|
+
//
|
|
468
|
+
// Generic discovery (orgs/projects/repos) and page-oriented reads that Kepler's ProviderBackend
|
|
469
|
+
// adapter maps to its own DTOs. All results are neutral (`ProviderResult`/`ProviderPagedResult`) and
|
|
470
|
+
// carry per-provider warnings recovered from the read cores, so a single provider's auth/rate-limit
|
|
471
|
+
// failure degrades to a warning instead of failing the whole call. The reads are repo-scoped (they
|
|
472
|
+
// compose the git-host `*Result` cores); account-scoped fan-out is the adapter's responsibility.
|
|
473
|
+
/**
|
|
474
|
+
* Warnings for an early-returning read where the integration couldn't be resolved. When a specific
|
|
475
|
+
* `connectionId` or self-managed `domain` was requested, a missing integration means that target is
|
|
476
|
+
* unavailable — surface a `no-connection` warning + `fetchFailed` so the caller can tell it apart from
|
|
477
|
+
* a truly empty account. Without an explicit target, it's simply not connected, which stays a silent
|
|
478
|
+
* empty result.
|
|
479
|
+
*/
|
|
480
|
+
earlyReturnConnectionWarnings(id, connectionId, domain) {
|
|
481
|
+
const requestedDomain = isGitSelfManagedHostIntegrationId(id) ? domain : undefined;
|
|
482
|
+
const invalidDomain = this.isEmptyExplicitSelector(domain);
|
|
483
|
+
if (connectionId == null && requestedDomain == null && !invalidDomain) {
|
|
484
|
+
return { warnings: [], fetchFailed: false };
|
|
485
|
+
}
|
|
486
|
+
const resolvedDomain = invalidDomain
|
|
487
|
+
? domain?.trim()
|
|
488
|
+
: this.resolveDomainForRead(id, connectionId, requestedDomain);
|
|
489
|
+
return { warnings: [noConnectionWarning(id, resolvedDomain, connectionId)], fetchFailed: true };
|
|
490
|
+
}
|
|
491
|
+
isEmptyExplicitSelector(value) {
|
|
492
|
+
return value?.trim().length === 0;
|
|
493
|
+
}
|
|
494
|
+
domainForRead(integration, id, connectionId, domain) {
|
|
495
|
+
if (!isGitSelfManagedHostIntegrationId(id)) {
|
|
496
|
+
return connectionId != null ? this.getConfiguredConnectionDomain(id, connectionId) : integration.domain;
|
|
497
|
+
}
|
|
498
|
+
return this.resolveDomainForRead(id, connectionId, domain) ?? integration.domain;
|
|
499
|
+
}
|
|
500
|
+
/**
|
|
501
|
+
* Resolves the right integration instance for a read. A configured connection domain takes precedence over
|
|
502
|
+
* an explicit fallback domain; the latter lets external/manual authentication providers address a
|
|
503
|
+
* self-managed host without persisting `ConfiguredIntegrationService` state.
|
|
504
|
+
*/
|
|
505
|
+
async getIntegrationForRead(id, connectionId, domain) {
|
|
506
|
+
// Empty explicit selectors are invalid targets, not an instruction to fall back to the primary
|
|
507
|
+
// connection. Keep this at the common read boundary so every public surface behaves consistently.
|
|
508
|
+
if (this.isEmptyExplicitSelector(connectionId) || this.isEmptyExplicitSelector(domain))
|
|
509
|
+
return undefined;
|
|
510
|
+
const resolvedDomain = this.resolveDomainForRead(id, connectionId, domain);
|
|
511
|
+
try {
|
|
512
|
+
return await this.get(id, resolvedDomain);
|
|
513
|
+
}
|
|
514
|
+
catch {
|
|
515
|
+
return undefined;
|
|
516
|
+
}
|
|
517
|
+
}
|
|
518
|
+
resolveDomainForRead(id, connectionId, domain) {
|
|
519
|
+
if (!isGitSelfManagedHostIntegrationId(id))
|
|
520
|
+
return undefined;
|
|
521
|
+
return ((connectionId != null ? this.getConfiguredConnectionDomain(id, connectionId) : undefined) ??
|
|
522
|
+
hostFromDomain(domain) ??
|
|
523
|
+
// With no explicit target, pin the primary configured host rather than leaving the domain undefined:
|
|
524
|
+
// `get(id, undefined)` falls back to `findCachedById`, which returns the FIRST entry by Map insertion
|
|
525
|
+
// order. With two hosts of the same provider that makes the instance depend on which host happened to
|
|
526
|
+
// be constructed first, so orgs/repos could come from one host and PRs from another in the same UI.
|
|
527
|
+
this.primaryConfiguredDomain(id));
|
|
528
|
+
}
|
|
529
|
+
/** The primary configured host for a self-managed provider (first configured when none is flagged primary). */
|
|
530
|
+
primaryConfiguredDomain(id) {
|
|
531
|
+
const configured = this.getConfigured(id);
|
|
532
|
+
return (configured.find(c => c.primary) ?? configured[0])?.domain;
|
|
533
|
+
}
|
|
534
|
+
/**
|
|
535
|
+
* Forces a real session refresh before a read when `forceSync` is set, so the read consumes a freshly
|
|
536
|
+
* exchanged token rather than a possibly-stale cached one. Both paths refresh, by different mechanisms: a
|
|
537
|
+
* per-connection (`connectionId`) read syncs that specific connection's session directly through the auth
|
|
538
|
+
* provider (the integration's primary-only sync path would never reach a secondary account), while a
|
|
539
|
+
* primary read syncs via the integration's own cloud-connection machinery.
|
|
540
|
+
* Best-effort — a failed sync is swallowed so the read still proceeds (and surfaces its own warning).
|
|
541
|
+
*/
|
|
542
|
+
async forceRefreshIfRequested(integration, forceSync, connectionId) {
|
|
543
|
+
if (forceSync !== true)
|
|
544
|
+
return;
|
|
545
|
+
try {
|
|
546
|
+
if (connectionId != null) {
|
|
547
|
+
// Refresh the specific connection's session directly; the primary-only sync path below would not
|
|
548
|
+
// reach a secondary account. `cloud: true` is required for multi-account backend connections.
|
|
549
|
+
const authProvider = await this.authenticationService.get(integration.authProvider.id);
|
|
550
|
+
const descriptor = { ...integration.authProviderDescriptor, connectionId: connectionId, cloud: true };
|
|
551
|
+
await authProvider?.deleteSession(descriptor);
|
|
552
|
+
await authProvider?.getSession(descriptor, { sync: true });
|
|
553
|
+
}
|
|
554
|
+
else {
|
|
555
|
+
await integration.syncCloudConnection('connected', true);
|
|
556
|
+
}
|
|
557
|
+
}
|
|
558
|
+
catch { }
|
|
559
|
+
}
|
|
560
|
+
/**
|
|
561
|
+
* Lists the orgs/workspaces/groups (and issue-tracker resources) visible to the user, unified into
|
|
562
|
+
* {@link ProviderOrganization}. Scoped to `providerId` when given, otherwise fanned out over every
|
|
563
|
+
* supported provider. `connectionId` only makes sense with a single `providerId`.
|
|
564
|
+
*/
|
|
565
|
+
async listOrgs(options) {
|
|
566
|
+
return listOrgs(this, options);
|
|
567
|
+
}
|
|
568
|
+
/**
|
|
569
|
+
* Lists the projects visible to the user, unified into the {@link ProviderOrganization}
|
|
570
|
+
* `{ providerId, id, name, org?, url }` shape. Covers issue-tracker providers (Jira/Linear, which expose
|
|
571
|
+
* projects under their resources) *and* git hosts that have a project tier (Azure DevOps, whose repos are
|
|
572
|
+
* org + project scoped). Scoped to `providerId` when given, else fanned out over both the supported issue
|
|
573
|
+
* trackers and Azure DevOps. Providers with no project tier (GitHub, GitLab, Bitbucket) contribute nothing.
|
|
574
|
+
*/
|
|
575
|
+
async listProjects(options) {
|
|
576
|
+
return listProjects(this, options);
|
|
577
|
+
}
|
|
578
|
+
/**
|
|
579
|
+
* Lists repositories under an org for a git-host provider, one page at a time. Pass `page` (1-based)
|
|
580
|
+
* to advance; the returned `cursor` is only meaningful for cursor-only hosts.
|
|
581
|
+
*/
|
|
582
|
+
async listRepos(options) {
|
|
583
|
+
return listRepos(this, options);
|
|
584
|
+
}
|
|
585
|
+
/**
|
|
586
|
+
* Reads one page of the user's pull requests for the given git-host provider. With `repos`, reads those
|
|
587
|
+
* repos' PRs (translating `page` ↔ the provider's opaque cursor) and maps the raw provider PRs to
|
|
588
|
+
* {@link PullRequestShape}. With no `repos`, reads the current user's PRs account-wide — the
|
|
589
|
+
* repo-scoped core rejects an empty `repos` input for GitHub/Bitbucket/Azure, so route to the
|
|
590
|
+
* account-wide `searchMyPullRequests` core instead (which is already user-scoped and returns shapes).
|
|
591
|
+
*/
|
|
592
|
+
async listPullRequestsPage(options) {
|
|
593
|
+
return listPullRequestsPage(this, options);
|
|
594
|
+
}
|
|
595
|
+
async listIssuesPage(options) {
|
|
596
|
+
return listIssuesPage(this, options);
|
|
597
|
+
}
|
|
598
|
+
/**
|
|
599
|
+
* Reads the user's issues from an issue-tracker provider (Jira/Linear/Trello), whose issues live under
|
|
600
|
+
* resource → project (not repos), so they can't go through {@link listIssuesPage} (git-host, repo-scoped).
|
|
601
|
+
* Returns the normalized {@link IssueShape} these providers produce, aggregated across the projects of the
|
|
602
|
+
* given `org` (or every visible resource/project when omitted). `includeAllAssignees` drops the
|
|
603
|
+
* "assigned to me" scoping so unassigned issues are included. Best-effort: a per-step failure becomes a
|
|
604
|
+
* warning without failing the whole read.
|
|
605
|
+
*
|
|
606
|
+
* Paginated by project: these providers have no single cross-project issue cursor, so a page is a bounded
|
|
607
|
+
* window of projects (each drained by its own read). Pagination is opt-in — a caller that supplies none of
|
|
608
|
+
* `page`/`cursor`/`itemsPerPage` reads every matched project in one page (`hasMore: false`), preserving the
|
|
609
|
+
* "aggregate everything" contract for callers that don't page. When any of those is supplied, the read is
|
|
610
|
+
* windowed to `itemsPerPage` projects (default 20) advanced 1-based via `page`/`cursor`, with `hasMore`/
|
|
611
|
+
* `cursor` carrying the next window. Note: a project's own read has an internal page backstop (see the
|
|
612
|
+
* per-provider drains); if a single project exceeds it, its extra issues can't be paged from here, but that
|
|
613
|
+
* incompleteness IS surfaced as `page.truncated` (Jira/Linear report the backstop hit) rather than passed
|
|
614
|
+
* off as a complete read.
|
|
615
|
+
*
|
|
616
|
+
* Takes no `domain`, unlike the git-host reads: every issue-tracker provider is cloud-only
|
|
617
|
+
* ({@link IssuesCloudHostIntegrationId}), so there is no self-managed host to address.
|
|
618
|
+
*/
|
|
619
|
+
async listIssueTrackerIssuesPage(options) {
|
|
620
|
+
return listIssueTrackerIssuesPage(this, options);
|
|
621
|
+
}
|
|
622
|
+
/**
|
|
623
|
+
* Sweeps the user's pull requests across providers by draining every page (an "all-pages" read),
|
|
624
|
+
* returning the neutral sweep result with per-provider warnings. `truncated` is set when a provider
|
|
625
|
+
* hit `maxPages` with more still available; `fetchFailed` when a drain aborted on a read error.
|
|
626
|
+
* `targets` selects a connection/domain independently for each provider. The legacy `connectionId` is
|
|
627
|
+
* honored only when `providerIds` resolves to a single provider (otherwise ambiguous).
|
|
628
|
+
*/
|
|
629
|
+
async sweepPullRequests(options) {
|
|
630
|
+
return sweepPullRequests(this, options);
|
|
631
|
+
}
|
|
632
|
+
/**
|
|
633
|
+
* Closed/merged counterpart of {@link sweepPullRequests}, feeding Kepler's Kanban "done" column. Applies
|
|
634
|
+
* the native cross-provider state filter (`Closed` + `Merged`) so it works beyond GitHub.
|
|
635
|
+
*/
|
|
636
|
+
async sweepClosedPullRequests(options) {
|
|
637
|
+
return sweepClosedPullRequests(this, options);
|
|
638
|
+
}
|
|
639
|
+
/**
|
|
640
|
+
* Broadens the user's issues by fanning out over the supplied orgs: for each org it lists the org's
|
|
641
|
+
* repositories, then reads that org's issues. A per-org failure becomes a warning without failing the
|
|
642
|
+
* whole fan-out. `broadenedProviderIds` lists the distinct providers whose issue read resolved (even
|
|
643
|
+
* if every issue duplicated a baseline). `failedProviderIds` identifies providers with no usable org;
|
|
644
|
+
* `incompleteProviderIds` identifies providers with both a usable org and a failed/truncated sibling.
|
|
645
|
+
* `fanOutCount` is the number of org work items spawned.
|
|
646
|
+
* Each org may carry its own `connectionId` (and, for a self-managed host with no configured connection, its
|
|
647
|
+
* own `domain`) to target a specific account — the fan-out spans providers, so the target is scoped per org
|
|
648
|
+
* rather than globally.
|
|
649
|
+
*/
|
|
650
|
+
async broadenIssues(options) {
|
|
651
|
+
return broadenIssues(this, options);
|
|
652
|
+
}
|
|
653
|
+
/**
|
|
654
|
+
* Resolves a repository from a remote URL to its provider identity, using core-gitlens' remote matcher
|
|
655
|
+
* plus the provider's `getRepo` (the equivalent of `gk repo resolve`). Supports every provider whose
|
|
656
|
+
* client exposes `getRepo`. Per-request outcomes preserve the distinctions consumers need for their
|
|
657
|
+
* canonicalization policy.
|
|
658
|
+
*/
|
|
659
|
+
async resolveRepository(options) {
|
|
660
|
+
return resolveRepository(this, options);
|
|
661
|
+
}
|
|
662
|
+
/** {@link RepositoryResolutionContext} seam: the user's `remotes` configs, for the remote matcher. */
|
|
663
|
+
getRemoteConfigs() {
|
|
664
|
+
return this.ctx.config.getRemoteConfigs();
|
|
665
|
+
}
|
|
666
|
+
/** {@link RepositoryResolutionContext} seam: instance lookup by host, for the cloud-host resolution branch. */
|
|
667
|
+
getIntegrationForDomain(id, domain) {
|
|
668
|
+
return this.get(id, domain);
|
|
669
|
+
}
|
|
670
|
+
// #endregion ProviderBackend surface (#5438)
|
|
421
671
|
_ignoreSSLErrors = new Map();
|
|
422
672
|
ignoreSSLErrors(integration) {
|
|
423
673
|
if (this.ctx.http.isWeb)
|
|
424
674
|
return false;
|
|
425
|
-
|
|
675
|
+
// Key by id + domain: the config lookup is domain-scoped, so a value computed for one self-managed
|
|
676
|
+
// domain must not be reused for another domain of the same provider.
|
|
677
|
+
const cacheKey = `${integration.id}:${integration.domain ?? ''}`;
|
|
678
|
+
let ignoreSSLErrors = this._ignoreSSLErrors.get(cacheKey);
|
|
426
679
|
if (ignoreSSLErrors === undefined) {
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
680
|
+
// Normalize both sides to a RemoteProviderId before comparing: a lowercased config type
|
|
681
|
+
// (e.g. `AzureDevOps` → `azuredevops`, `BitbucketServer` → `bitbucketserver`) does not equal the
|
|
682
|
+
// integration id (`azureDevOps`, `bitbucket-server`), so a plain `toLowerCase()` compare misses them.
|
|
683
|
+
const integrationRemoteType = remoteProviderTypeForIntegration(integration.id);
|
|
684
|
+
const cfg = this.ctx.config.getRemoteConfigs().find(remote => {
|
|
685
|
+
if (integration.domain == null || integrationRemoteType == null)
|
|
686
|
+
return false;
|
|
687
|
+
if (remoteProviderTypeForConfig(remote.type) !== integrationRemoteType)
|
|
688
|
+
return false;
|
|
689
|
+
// Match domain- and regex-based remotes alike, so `ignoreSSLErrors` applies to a regex-configured
|
|
690
|
+
// self-managed host too (mirrors the matcher's own regex handling).
|
|
691
|
+
if (remote.domain != null)
|
|
692
|
+
return remote.domain === integration.domain;
|
|
693
|
+
// Truthy (not just non-null): an empty regex would compile to a match-everything pattern.
|
|
694
|
+
if (remote.regex) {
|
|
695
|
+
try {
|
|
696
|
+
return new RegExp(remote.regex, 'i').test(integration.domain);
|
|
697
|
+
}
|
|
698
|
+
catch {
|
|
699
|
+
return false;
|
|
700
|
+
}
|
|
701
|
+
}
|
|
702
|
+
return false;
|
|
703
|
+
});
|
|
430
704
|
ignoreSSLErrors = cfg?.ignoreSSLErrors ?? false;
|
|
431
|
-
this._ignoreSSLErrors.set(
|
|
705
|
+
this._ignoreSSLErrors.set(cacheKey, ignoreSSLErrors);
|
|
432
706
|
}
|
|
433
707
|
return ignoreSSLErrors;
|
|
434
708
|
}
|
|
@@ -511,7 +785,16 @@ export class IntegrationService {
|
|
|
511
785
|
async function load() {
|
|
512
786
|
return new (await import(/* webpackChunkName: "integrations" */ './providers/providersApi.js')).ProvidersApi(authenticationService);
|
|
513
787
|
}
|
|
514
|
-
|
|
788
|
+
// Never keep a rejected promise cached: a single failure (a module-resolution error, a transient
|
|
789
|
+
// construction failure) would otherwise poison every `ProvidersApi` read for the lifetime of the
|
|
790
|
+
// service, so consumers get instant empty results with no way to recover short of a restart.
|
|
791
|
+
const loading = (this._providersApi = load());
|
|
792
|
+
void loading.catch(() => {
|
|
793
|
+
// Only clear our own attempt, so a newer load already in flight isn't dropped
|
|
794
|
+
if (this._providersApi === loading) {
|
|
795
|
+
this._providersApi = undefined;
|
|
796
|
+
}
|
|
797
|
+
});
|
|
515
798
|
}
|
|
516
799
|
return this._providersApi;
|
|
517
800
|
}
|
|
@@ -523,23 +806,48 @@ export class IntegrationService {
|
|
|
523
806
|
}
|
|
524
807
|
async *getSupportedCloudIntegrations(domainsById) {
|
|
525
808
|
for (const id of getSupportedCloudIntegrationIds()) {
|
|
526
|
-
if (isCloudGitSelfManagedHostIntegrationId(id)
|
|
527
|
-
|
|
809
|
+
if (isCloudGitSelfManagedHostIntegrationId(id)) {
|
|
810
|
+
const domains = new Set(domainsById.get(id) ?? []);
|
|
811
|
+
for (const domain of this.configuredIntegrationService
|
|
812
|
+
.getConfigured(id, { cloud: true })
|
|
813
|
+
.map(c => c.domain)
|
|
814
|
+
.filter((domain) => domain != null && domain.length > 0)) {
|
|
815
|
+
domains.add(hostFromDomain(domain) ?? domain);
|
|
816
|
+
}
|
|
817
|
+
if (domains.size !== 0) {
|
|
818
|
+
for (const domain of domains) {
|
|
819
|
+
const integration = await this.get(id, domain);
|
|
820
|
+
if (integration != null) {
|
|
821
|
+
yield integration;
|
|
822
|
+
}
|
|
823
|
+
}
|
|
824
|
+
continue;
|
|
825
|
+
}
|
|
826
|
+
// Try getting whatever we have now because we will need to disconnect.
|
|
528
827
|
const integration = await this.get(id, undefined);
|
|
529
828
|
if (integration != null) {
|
|
530
829
|
yield integration;
|
|
531
830
|
}
|
|
831
|
+
continue;
|
|
532
832
|
}
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
yield integration;
|
|
537
|
-
}
|
|
833
|
+
const integration = await this.get(id);
|
|
834
|
+
if (integration != null) {
|
|
835
|
+
yield integration;
|
|
538
836
|
}
|
|
539
837
|
}
|
|
540
838
|
}
|
|
839
|
+
getCloudConnectionState(integration, connectedIntegrations, domainsById) {
|
|
840
|
+
if (isCloudGitSelfManagedHostIntegrationId(integration.id)) {
|
|
841
|
+
const host = hostFromDomain(integration.domain) ?? integration.domain;
|
|
842
|
+
return domainsById.get(integration.id)?.has(host) ? 'connected' : 'disconnected';
|
|
843
|
+
}
|
|
844
|
+
return connectedIntegrations.has(integration.id) ? 'connected' : 'disconnected';
|
|
845
|
+
}
|
|
541
846
|
findCachedById(id) {
|
|
542
|
-
const
|
|
847
|
+
const cached = this._integrations.get(id);
|
|
848
|
+
if (cached != null)
|
|
849
|
+
return cached;
|
|
850
|
+
const key = `${id}:`;
|
|
543
851
|
for (const [k, integration] of this._integrations) {
|
|
544
852
|
if (k.startsWith(key)) {
|
|
545
853
|
return integration;
|
|
@@ -547,40 +855,295 @@ export class IntegrationService {
|
|
|
547
855
|
}
|
|
548
856
|
return undefined;
|
|
549
857
|
}
|
|
858
|
+
getCachedForDomain(id, domain) {
|
|
859
|
+
return isGitSelfManagedHostIntegrationId(id) ? this.getCached(id, domain) : this.findCachedById(id);
|
|
860
|
+
}
|
|
861
|
+
getConfiguredCloudConnection(id, connectionId) {
|
|
862
|
+
const connection = this.configuredIntegrationService
|
|
863
|
+
.getConfigured(id, { cloud: true })
|
|
864
|
+
.find(c => c.id === connectionId);
|
|
865
|
+
if (connection == null) {
|
|
866
|
+
throw new Error(`Connection '${connectionId}' is not configured for '${id}'`);
|
|
867
|
+
}
|
|
868
|
+
return connection;
|
|
869
|
+
}
|
|
870
|
+
getConfiguredConnectionDomain(id, connectionId) {
|
|
871
|
+
if (!isGitSelfManagedHostIntegrationId(id))
|
|
872
|
+
return undefined;
|
|
873
|
+
return this.configuredIntegrationService.getConfigured(id).find(c => c.id === connectionId)?.domain;
|
|
874
|
+
}
|
|
875
|
+
getCloudPrimaryConnectionIdsByDomain(id) {
|
|
876
|
+
const primaryByDomain = new Map();
|
|
877
|
+
const fallbackByDomain = new Map();
|
|
878
|
+
for (const descriptor of this.configuredIntegrationService.getConfigured(id, { cloud: true })) {
|
|
879
|
+
const domain = isGitSelfManagedHostIntegrationId(id)
|
|
880
|
+
? (hostFromDomain(descriptor.domain) ?? descriptor.domain)
|
|
881
|
+
: undefined;
|
|
882
|
+
if (!fallbackByDomain.has(domain)) {
|
|
883
|
+
fallbackByDomain.set(domain, descriptor.id);
|
|
884
|
+
}
|
|
885
|
+
if (descriptor.primary && !primaryByDomain.has(domain)) {
|
|
886
|
+
primaryByDomain.set(domain, descriptor.id);
|
|
887
|
+
}
|
|
888
|
+
}
|
|
889
|
+
for (const [domain, connectionId] of fallbackByDomain) {
|
|
890
|
+
if (!primaryByDomain.has(domain)) {
|
|
891
|
+
primaryByDomain.set(domain, connectionId);
|
|
892
|
+
}
|
|
893
|
+
}
|
|
894
|
+
return primaryByDomain;
|
|
895
|
+
}
|
|
550
896
|
async syncCloudIntegrations(forceConnect) {
|
|
551
897
|
const scope = getScopedLogger();
|
|
552
898
|
const connectedIntegrations = new Set();
|
|
553
899
|
const domainsById = new Map();
|
|
900
|
+
const connectionsById = new Map();
|
|
554
901
|
const loggedIn = (await this.ctx.account.getAccount()) != null;
|
|
555
902
|
if (loggedIn) {
|
|
556
903
|
const connections = await this.authenticationService.cloudIntegrations.getConnections();
|
|
557
904
|
if (connections == null)
|
|
558
905
|
return;
|
|
559
|
-
|
|
906
|
+
for (const p of connections) {
|
|
560
907
|
const integrationId = toIntegrationId[p.provider];
|
|
561
908
|
// GKDev includes some integrations like "google" that we don't support
|
|
562
909
|
if (integrationId == null)
|
|
563
|
-
|
|
564
|
-
connectedIntegrations.add(
|
|
910
|
+
continue;
|
|
911
|
+
connectedIntegrations.add(integrationId);
|
|
912
|
+
const list = connectionsById.get(integrationId);
|
|
913
|
+
if (list != null) {
|
|
914
|
+
list.push(p);
|
|
915
|
+
}
|
|
916
|
+
else {
|
|
917
|
+
connectionsById.set(integrationId, [p]);
|
|
918
|
+
}
|
|
565
919
|
if (p.domain?.length > 0) {
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
domainsById.
|
|
920
|
+
const host = hostFromDomain(p.domain);
|
|
921
|
+
if (host != null) {
|
|
922
|
+
let domains = domainsById.get(integrationId);
|
|
923
|
+
if (domains == null) {
|
|
924
|
+
domains = new Set();
|
|
925
|
+
domainsById.set(integrationId, domains);
|
|
926
|
+
}
|
|
927
|
+
domains.add(host);
|
|
569
928
|
}
|
|
570
|
-
|
|
929
|
+
else {
|
|
571
930
|
scope?.warn(`Invalid domain for ${integrationId} integration: ${p.domain}. Ignoring.`);
|
|
572
931
|
}
|
|
573
932
|
}
|
|
574
|
-
}
|
|
933
|
+
}
|
|
575
934
|
}
|
|
576
935
|
for await (const integration of this.getSupportedCloudIntegrations(domainsById)) {
|
|
577
|
-
await integration.syncCloudConnection(
|
|
936
|
+
await integration.syncCloudConnection(this.getCloudConnectionState(integration, connectedIntegrations, domainsById), forceConnect);
|
|
937
|
+
}
|
|
938
|
+
// Persist every account when the backend advertises per-connection identity (multi-account). This
|
|
939
|
+
// is a strict no-op for backends that return a single, id-less connection per provider.
|
|
940
|
+
for (const [integrationId, connections] of connectionsById) {
|
|
941
|
+
await this.reconcileCloudConnections(integrationId, connections, forceConnect);
|
|
578
942
|
}
|
|
579
943
|
this.ctx.hooks?.connection?.onConnectedChanged?.({
|
|
580
944
|
integrationIds: [...connectedIntegrations.values()],
|
|
581
945
|
});
|
|
582
946
|
return connectedIntegrations;
|
|
583
947
|
}
|
|
948
|
+
/**
|
|
949
|
+
* Whether the user has locally disconnected this provider/host. Mirrors the integration model's
|
|
950
|
+
* `connected:${key}` workspace flag (key = id for cloud, `${id}:${domain}` for self-managed), which is
|
|
951
|
+
* set to `false` on a local disconnect and cleared on (re)connect.
|
|
952
|
+
*/
|
|
953
|
+
isLocallyDisconnected(id, host) {
|
|
954
|
+
const key = isGitSelfManagedHostIntegrationId(id) ? `connected:${id}:${host ?? ''}` : `connected:${id}`;
|
|
955
|
+
return this.ctx.storage.getWorkspace(key) === false;
|
|
956
|
+
}
|
|
957
|
+
/**
|
|
958
|
+
* Reconciles the locally stored connections for a provider with what the backend reports, so that
|
|
959
|
+
* multiple accounts on the same provider coexist. Only engages when the backend provides
|
|
960
|
+
* per-connection ids; otherwise the single-connection flow above already handled the primary.
|
|
961
|
+
*/
|
|
962
|
+
async reconcileCloudConnections(id, connections, forceConnect) {
|
|
963
|
+
const scope = getScopedLogger();
|
|
964
|
+
const identified = connections.filter((c) => c.id != null);
|
|
965
|
+
if (identified.length === 0)
|
|
966
|
+
return;
|
|
967
|
+
// Capture the effective primary before any mutation (sync store, prune-driven promotion, or the
|
|
968
|
+
// backend primary selection below) so we can tell whether it actually changed. The prune step can
|
|
969
|
+
// promote a secondary to primary via removeConfigured, so sampling this after pruning would miss it.
|
|
970
|
+
const primaryBefore = this.getCloudPrimaryConnectionIdsByDomain(id);
|
|
971
|
+
const cloudIntegrations = this.authenticationService.cloudIntegrations;
|
|
972
|
+
// Fetch + store each connection's session so getConfigured() reflects every account.
|
|
973
|
+
const syncedIds = new Set();
|
|
974
|
+
const syncEligibleIds = new Set();
|
|
975
|
+
const syncedPrimaryIdsByDomain = new Map();
|
|
976
|
+
// Snapshot existing cloud descriptors by id once, so the per-connection account-name lookup below is
|
|
977
|
+
// O(1) instead of re-filtering the whole configured list each iteration (O(n²) with multi-account).
|
|
978
|
+
// Each backend connection id is processed once, so reading the pre-loop snapshot is sufficient.
|
|
979
|
+
const existingById = new Map(this.configuredIntegrationService.getConfigured(id, { cloud: true }).map(c => [c.id, c]));
|
|
980
|
+
for (const connection of identified) {
|
|
981
|
+
// The wire `domain` is usually a full URL, though cloud providers can return a bare host.
|
|
982
|
+
// Self-managed integrations are keyed/constructed by host.
|
|
983
|
+
const host = hostFromDomain(connection.domain);
|
|
984
|
+
// Self-managed connections are keyed by host, so an unparseable/empty domain would store the
|
|
985
|
+
// session and descriptor under an empty host — producing ambiguous keys (`connected:<id>:`) that
|
|
986
|
+
// break later resolution and local-disconnect checks. Skip such a connection rather than corrupt
|
|
987
|
+
// state; cloud providers key off their canonical domain and are unaffected.
|
|
988
|
+
if (isGitSelfManagedHostIntegrationId(id) && !host) {
|
|
989
|
+
scope?.warn(`Skipping connection '${connection.id}' for ${id}: unresolved host from domain`);
|
|
990
|
+
continue;
|
|
991
|
+
}
|
|
992
|
+
// Don't resurrect a connection the user disconnected locally: a host "disconnect" only clears
|
|
993
|
+
// local state (the backend still lists the token), so without this the next non-forced sync would
|
|
994
|
+
// re-store the secret/config. A forced reconnect clears this flag (in the sync loop above) before
|
|
995
|
+
// reconcile runs, so it proceeds normally.
|
|
996
|
+
if (this.isLocallyDisconnected(id, host))
|
|
997
|
+
continue;
|
|
998
|
+
syncEligibleIds.add(connection.id);
|
|
999
|
+
// On a routine (non-forced) check-in, skip the token fetch + secret write for a connection we
|
|
1000
|
+
// already have stored and that hasn't expired: nothing to refresh, so avoid the extra GK API
|
|
1001
|
+
// traffic and secret churn. Still treat it as synced (so it doesn't trip the prune guard) and
|
|
1002
|
+
// record its primary below. Forced syncs, new connections, and expired tokens fall through and
|
|
1003
|
+
// fetch as before.
|
|
1004
|
+
const cached = existingById.get(connection.id);
|
|
1005
|
+
if (!forceConnect && cached != null && !isDescriptorExpired(cached)) {
|
|
1006
|
+
syncedIds.add(connection.id);
|
|
1007
|
+
if (connection.primary) {
|
|
1008
|
+
const domain = isGitSelfManagedHostIntegrationId(id) ? host : undefined;
|
|
1009
|
+
if (!syncedPrimaryIdsByDomain.has(domain)) {
|
|
1010
|
+
syncedPrimaryIdsByDomain.set(domain, connection.id);
|
|
1011
|
+
}
|
|
1012
|
+
}
|
|
1013
|
+
continue;
|
|
1014
|
+
}
|
|
1015
|
+
try {
|
|
1016
|
+
const session = await cloudIntegrations.getConnectionSession(id, undefined, connection.id);
|
|
1017
|
+
if (session == null)
|
|
1018
|
+
continue;
|
|
1019
|
+
let providerSession = toProviderSession(id, connection, session, host);
|
|
1020
|
+
// Resolve a human-readable account handle with the same precedence as the gk CLI:
|
|
1021
|
+
// (1) the value the backend put on the connection, (2) a previously-resolved name cached in
|
|
1022
|
+
// our configured store (keyed by connection id), (3) a live provider-API lookup. This keeps
|
|
1023
|
+
// provider round-trips to the first sight of a connection; degrade to undefined on failure.
|
|
1024
|
+
const existing = existingById.get(connection.id);
|
|
1025
|
+
const accountName = normalizeAccountName(connection.accountName) ??
|
|
1026
|
+
normalizeAccountName(existing?.accountName) ??
|
|
1027
|
+
(await this.resolveAccountName(id, host, providerSession));
|
|
1028
|
+
if (accountName != null) {
|
|
1029
|
+
providerSession = {
|
|
1030
|
+
...providerSession,
|
|
1031
|
+
account: { ...providerSession.account, label: accountName },
|
|
1032
|
+
};
|
|
1033
|
+
}
|
|
1034
|
+
await this.configuredIntegrationService.storeSession(id, providerSession);
|
|
1035
|
+
syncedIds.add(connection.id);
|
|
1036
|
+
if (connection.primary) {
|
|
1037
|
+
const domain = isGitSelfManagedHostIntegrationId(id) ? host : undefined;
|
|
1038
|
+
if (!syncedPrimaryIdsByDomain.has(domain)) {
|
|
1039
|
+
syncedPrimaryIdsByDomain.set(domain, connection.id);
|
|
1040
|
+
}
|
|
1041
|
+
}
|
|
1042
|
+
}
|
|
1043
|
+
catch (ex) {
|
|
1044
|
+
scope?.warn(`Failed to sync connection '${connection.id}' for ${id}: ${ex instanceof Error ? ex.message : String(ex)}`);
|
|
1045
|
+
}
|
|
1046
|
+
}
|
|
1047
|
+
// Prune stored cloud connections that no longer exist on the backend — but only when every backend
|
|
1048
|
+
// connection that should sync did sync this cycle. Otherwise a transient token fetch failure would
|
|
1049
|
+
// delete a still-valid connection with no replacement (e.g. a legacy single connection during the
|
|
1050
|
+
// backend id rollout); defer pruning to a later clean cycle. Deliberately skipped connections (local
|
|
1051
|
+
// disconnects or invalid self-managed hosts) don't block pruning of unrelated stale descriptors.
|
|
1052
|
+
// Scope deletes to cloud so a local PAT sharing the id survives.
|
|
1053
|
+
const prunedDomains = new Set();
|
|
1054
|
+
if ([...syncEligibleIds].every(connectionId => syncedIds.has(connectionId))) {
|
|
1055
|
+
const liveIds = new Set(identified.map(c => c.id));
|
|
1056
|
+
for (const descriptor of this.configuredIntegrationService.getConfigured(id, { cloud: true })) {
|
|
1057
|
+
if (!liveIds.has(descriptor.id)) {
|
|
1058
|
+
prunedDomains.add(isGitSelfManagedHostIntegrationId(id) ? descriptor.domain : undefined);
|
|
1059
|
+
await this.configuredIntegrationService.deleteConnection(id, descriptor.id, true);
|
|
1060
|
+
}
|
|
1061
|
+
}
|
|
1062
|
+
}
|
|
1063
|
+
// Apply the backend's primary selection, then refresh any warm model only when the effective primary
|
|
1064
|
+
// actually changed (vs the pre-reconcile value captured above). switchConnection() drops the in-memory
|
|
1065
|
+
// session and fires change events, so calling it on every check-in (when the primary is unchanged)
|
|
1066
|
+
// causes needless churn for multi-account providers. Self-managed providers can have one primary per
|
|
1067
|
+
// host, so apply and refresh by host scope rather than by provider id alone.
|
|
1068
|
+
for (const connectionId of syncedPrimaryIdsByDomain.values()) {
|
|
1069
|
+
await this.configuredIntegrationService.setPrimaryConnection(id, connectionId);
|
|
1070
|
+
}
|
|
1071
|
+
const primaryAfter = this.getCloudPrimaryConnectionIdsByDomain(id);
|
|
1072
|
+
const domains = new Set(primaryBefore.keys());
|
|
1073
|
+
for (const domain of primaryAfter.keys()) {
|
|
1074
|
+
domains.add(domain);
|
|
1075
|
+
}
|
|
1076
|
+
for (const domain of prunedDomains) {
|
|
1077
|
+
domains.add(domain);
|
|
1078
|
+
}
|
|
1079
|
+
for (const domain of domains) {
|
|
1080
|
+
if (primaryBefore.get(domain) === primaryAfter.get(domain) && !prunedDomains.has(domain))
|
|
1081
|
+
continue;
|
|
1082
|
+
this.getCachedForDomain(id, domain)?.switchConnection();
|
|
1083
|
+
}
|
|
1084
|
+
}
|
|
1085
|
+
/**
|
|
1086
|
+
* Switches the default connection for a provider to `connectionId` (its backend token id). Performs
|
|
1087
|
+
* the server-side primary switch first, then mirrors it locally and refreshes any warm model. Throws
|
|
1088
|
+
* if the backend switch fails so the caller can surface it (local state stays untouched).
|
|
1089
|
+
*/
|
|
1090
|
+
async setPrimaryConnection(id, connectionId) {
|
|
1091
|
+
const connection = this.getConfiguredCloudConnection(id, connectionId);
|
|
1092
|
+
if (!(await this.authenticationService.cloudIntegrations.setPrimaryConnection(id, connectionId))) {
|
|
1093
|
+
throw new Error(`Failed to set primary connection '${connectionId}' for '${id}'`);
|
|
1094
|
+
}
|
|
1095
|
+
await this.configuredIntegrationService.setPrimaryConnection(id, connectionId);
|
|
1096
|
+
this.getCachedForDomain(id, connection.domain)?.switchConnection();
|
|
1097
|
+
}
|
|
1098
|
+
/**
|
|
1099
|
+
* Removes a single connection for a provider by its backend token id. The backend removes the
|
|
1100
|
+
* connection (auto-promoting a secondary to primary when the removed one was primary); we then mirror
|
|
1101
|
+
* that locally and refresh any warm model. Unlike {@link IntegrationBase.disconnect}, this targets one
|
|
1102
|
+
* account. This always talks to the cloud backend, so the local mirror is cloud-scoped and preserves any
|
|
1103
|
+
* local PAT that happens to share the same id.
|
|
1104
|
+
* Throws if the backend delete fails so the caller can surface it (local state stays untouched).
|
|
1105
|
+
*/
|
|
1106
|
+
async deleteConnection(id, connectionId) {
|
|
1107
|
+
const connection = this.getConfiguredCloudConnection(id, connectionId);
|
|
1108
|
+
if (!(await this.authenticationService.cloudIntegrations.disconnectConnection(id, connectionId))) {
|
|
1109
|
+
throw new Error(`Failed to delete connection '${connectionId}' for '${id}'`);
|
|
1110
|
+
}
|
|
1111
|
+
await this.configuredIntegrationService.deleteConnection(id, connectionId, true);
|
|
1112
|
+
this.getCachedForDomain(id, connection.domain)?.switchConnection();
|
|
1113
|
+
}
|
|
1114
|
+
/**
|
|
1115
|
+
* Resolves a human-readable account handle (e.g. the GitHub login) for a connection by asking the
|
|
1116
|
+
* provider API with that connection's token. The token backend doesn't expose it. Routes through the
|
|
1117
|
+
* integration model so the correct provider API base URL (incl. self-managed domains) and auth type
|
|
1118
|
+
* are used. Best-effort: returns undefined on any failure so callers degrade gracefully.
|
|
1119
|
+
*/
|
|
1120
|
+
async resolveAccountName(id, host, session) {
|
|
1121
|
+
const scope = getScopedLogger();
|
|
1122
|
+
try {
|
|
1123
|
+
// Route through the integration so the correct provider API base URL (incl. the self-managed
|
|
1124
|
+
// host) and auth type are used. Cloud providers ignore the host.
|
|
1125
|
+
const integration = await this.get(id, host);
|
|
1126
|
+
const account = await integration?.getProviderAccountForSession(session);
|
|
1127
|
+
return account?.username ?? account?.name ?? undefined;
|
|
1128
|
+
}
|
|
1129
|
+
catch (ex) {
|
|
1130
|
+
scope?.warn(`Failed to resolve account name for '${id}': ${ex instanceof Error ? ex.message : String(ex)}`);
|
|
1131
|
+
return undefined;
|
|
1132
|
+
}
|
|
1133
|
+
}
|
|
1134
|
+
/**
|
|
1135
|
+
* Forces a refresh of connected cloud integrations from the backend (equivalent to a "--sync" list),
|
|
1136
|
+
* reconciling local state (multi-account connections, primary flags, account names) so a subsequent
|
|
1137
|
+
* {@link getConfigured} reflects the latest server-side connections. Intended for consumers that need
|
|
1138
|
+
* an up-to-date connection list on demand. Rejects when the authoritative backend connection list cannot
|
|
1139
|
+
* be read, so callers never mistake stale local state for a successful refresh.
|
|
1140
|
+
*/
|
|
1141
|
+
async refreshConnections() {
|
|
1142
|
+
const connected = await this.syncCloudIntegrations(true);
|
|
1143
|
+
if (connected == null) {
|
|
1144
|
+
throw new Error('Failed to refresh provider connections');
|
|
1145
|
+
}
|
|
1146
|
+
}
|
|
584
1147
|
}
|
|
585
1148
|
__decorate([
|
|
586
1149
|
debug()
|
|
@@ -599,7 +1162,10 @@ __decorate([
|
|
|
599
1162
|
], IntegrationService.prototype, "getMyIssuesForRemotes", null);
|
|
600
1163
|
__decorate([
|
|
601
1164
|
debug({
|
|
602
|
-
args: integrationIds => ({
|
|
1165
|
+
args: (integrationIds, connectionId) => ({
|
|
1166
|
+
integrationIds: integrationIds?.length ? integrationIds.join(',') : '<undefined>',
|
|
1167
|
+
connectionId: connectionId ?? '<primary>',
|
|
1168
|
+
}),
|
|
603
1169
|
})
|
|
604
1170
|
], IntegrationService.prototype, "getMyCurrentAccounts", null);
|
|
605
1171
|
__decorate([
|
|
@@ -624,4 +1190,74 @@ __decorate([
|
|
|
624
1190
|
gate(),
|
|
625
1191
|
trace()
|
|
626
1192
|
], IntegrationService.prototype, "syncCloudIntegrations", null);
|
|
1193
|
+
/** Internal factory used by the GitLens host and integration tests that need the full service surface. */
|
|
1194
|
+
export function createIntegrationService(ctx) {
|
|
1195
|
+
const configured = new ConfiguredIntegrationService(ctx);
|
|
1196
|
+
const cloud = new CloudIntegrationService(ctx);
|
|
1197
|
+
let service;
|
|
1198
|
+
const auth = new IntegrationAuthenticationService(configured, ctx, () => service, cloud);
|
|
1199
|
+
service = new IntegrationService(auth, configured, ctx);
|
|
1200
|
+
void purgeRetiredIntegrationStorage(ctx, configured);
|
|
1201
|
+
return service;
|
|
1202
|
+
}
|
|
1203
|
+
const retiredIntegrationsStorageKey = 'integrations:migrated:cloudOnly';
|
|
1204
|
+
async function purgeRetiredIntegrationStorage(ctx, configured) {
|
|
1205
|
+
if (ctx.storage.get(retiredIntegrationsStorageKey))
|
|
1206
|
+
return;
|
|
1207
|
+
try {
|
|
1208
|
+
await configured.purgeStoredConfiguration(['github-enterprise', 'gitlab-self-hosted']);
|
|
1209
|
+
await ctx.storage.store(retiredIntegrationsStorageKey, true);
|
|
1210
|
+
}
|
|
1211
|
+
catch {
|
|
1212
|
+
// Best-effort cleanup retries on the next startup while the migration flag remains unset.
|
|
1213
|
+
}
|
|
1214
|
+
}
|
|
1215
|
+
function protocolFromDomain(domain) {
|
|
1216
|
+
const value = domain?.trim();
|
|
1217
|
+
if (!value)
|
|
1218
|
+
return undefined;
|
|
1219
|
+
if (!/^[a-z][a-z\d+\-.]*:\/\//i.test(value))
|
|
1220
|
+
return undefined;
|
|
1221
|
+
try {
|
|
1222
|
+
return new URL(value).protocol || undefined;
|
|
1223
|
+
}
|
|
1224
|
+
catch {
|
|
1225
|
+
return undefined;
|
|
1226
|
+
}
|
|
1227
|
+
}
|
|
1228
|
+
function normalizeAccountName(accountName) {
|
|
1229
|
+
const value = accountName?.trim();
|
|
1230
|
+
return value ? value : undefined;
|
|
1231
|
+
}
|
|
1232
|
+
/**
|
|
1233
|
+
* Whether a stored connection descriptor's token has expired. A missing `expiresAt` is treated as
|
|
1234
|
+
* not-expired (non-expiring/legacy tokens, e.g. GitHub and self-managed cloud, carry no meaningful
|
|
1235
|
+
* expiry), matching the session-expiry checks elsewhere.
|
|
1236
|
+
*/
|
|
1237
|
+
function isDescriptorExpired(descriptor) {
|
|
1238
|
+
if (descriptor.expiresAt == null)
|
|
1239
|
+
return false;
|
|
1240
|
+
return new Date(descriptor.expiresAt).getTime() < Date.now();
|
|
1241
|
+
}
|
|
1242
|
+
function toProviderSession(id, connection, session, host) {
|
|
1243
|
+
// GitHub, the cloud self-managed hosts, and Trello return `expiresIn: 0` for a non-expiring token; left
|
|
1244
|
+
// as 0 the session's `expiresAt` would be `now` and rejected as expired on the next read. Map it to the
|
|
1245
|
+
// maximum expiry (mirrors the auth provider's own guard).
|
|
1246
|
+
const expiresIn = session.expiresIn === 0 && isNonExpiringZeroTokenIntegrationId(id) ? maxSmallIntegerV8 : session.expiresIn;
|
|
1247
|
+
const protocol = protocolFromDomain(connection.domain);
|
|
1248
|
+
return {
|
|
1249
|
+
id: connection.id,
|
|
1250
|
+
accessToken: session.accessToken,
|
|
1251
|
+
account: { id: '', label: '' },
|
|
1252
|
+
scopes: session.scopes ? session.scopes.split(',') : [],
|
|
1253
|
+
cloud: true,
|
|
1254
|
+
type: session.type,
|
|
1255
|
+
expiresAt: new Date(expiresIn * 1000 + Date.now()),
|
|
1256
|
+
// Self-managed connections are keyed by their host; cloud providers use the canonical domain.
|
|
1257
|
+
domain: isGitSelfManagedHostIntegrationId(id) ? (host ?? '') : (providersMetadata[id]?.domain ?? ''),
|
|
1258
|
+
...(protocol != null ? { protocol: protocol } : {}),
|
|
1259
|
+
// Carried for providers whose client needs an app key alongside the token (e.g. Trello).
|
|
1260
|
+
...(session.appKey != null ? { appKey: session.appKey } : {}),
|
|
1261
|
+
};
|
|
1262
|
+
}
|
|
627
1263
|
//# sourceMappingURL=integrationService.js.map
|