@gitkraken/core-gitlens 0.4.0 → 0.4.100
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 +71 -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 +131 -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 +293 -12
- package/dist/plus/integrations/integrationService.d.ts.map +1 -1
- package/dist/plus/integrations/integrationService.js +1305 -37
- 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 +269 -10
- package/dist/plus/integrations/models/gitHostIntegration.d.ts.map +1 -1
- package/dist/plus/integrations/models/gitHostIntegration.js +712 -88
- 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 +87 -7
- package/dist/plus/integrations/models/issuesIntegration.d.ts.map +1 -1
- package/dist/plus/integrations/models/issuesIntegration.js +148 -33
- 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/context.d.ts +52 -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 +348 -0
- package/dist/plus/integrations/reads/hierarchy.js.map +1 -0
- package/dist/plus/integrations/reads/hierarchy.utils.d.ts +53 -0
- package/dist/plus/integrations/reads/hierarchy.utils.d.ts.map +1 -0
- package/dist/plus/integrations/reads/hierarchy.utils.js +85 -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 +346 -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/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 +149 -0
- package/src/plus/integrations/index.ts +148 -51
- package/src/plus/integrations/integrationService.ts +1714 -49
- package/src/plus/integrations/lite.ts +233 -0
- package/src/plus/integrations/manager.ts +359 -0
- package/src/plus/integrations/models/gitHostIntegration.ts +1014 -121
- package/src/plus/integrations/models/integration.ts +293 -24
- package/src/plus/integrations/models/issuesIntegration.ts +178 -38
- 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/context.ts +75 -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 +493 -0
- package/src/plus/integrations/reads/hierarchy.utils.ts +106 -0
- package/src/plus/integrations/reads/issueTracker.ts +480 -0
- package/src/plus/integrations/reads/issues.ts +407 -0
- package/src/plus/integrations/reads/paging.ts +277 -0
- package/src/plus/integrations/reads/pullRequests.ts +267 -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
|
@@ -9,9 +9,56 @@ import { trace } from '../../../utils/decorators/log.js';
|
|
|
9
9
|
import { first } from '../../../utils/iterable.js';
|
|
10
10
|
import { Logger } from '../../../utils/logger.js';
|
|
11
11
|
import { getScopedLogger } from '../../../utils/logger.scoped.js';
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
12
|
+
import { toTokenWithInfo } from '../authentication/models.js';
|
|
13
|
+
import { toCollectionScopeFailure } from '../collectionMetadata.js';
|
|
14
|
+
import { GitCloudHostIntegrationId, GitSelfManagedHostIntegrationId } from '../constants.js';
|
|
15
|
+
import { toError } from '../errors.js';
|
|
16
|
+
import { IssueFilter, PagingMode, PullRequestFilter, toIssueShape, toProviderIssueStates, toProviderPullRequestStates, } from '../providers/models.js';
|
|
17
|
+
import { mergeCollectionMetadata } from '../providers/utils/providerPaging.js';
|
|
14
18
|
import { IntegrationBase } from './integration.js';
|
|
19
|
+
function isAzureDevOpsProvider(providerId) {
|
|
20
|
+
return (providerId === GitCloudHostIntegrationId.AzureDevOps ||
|
|
21
|
+
providerId === GitSelfManagedHostIntegrationId.AzureDevOpsServer);
|
|
22
|
+
}
|
|
23
|
+
function normalizeSelfManagedBaseUrl(domain, protocol) {
|
|
24
|
+
const value = domain?.trim();
|
|
25
|
+
if (!value)
|
|
26
|
+
return undefined;
|
|
27
|
+
if (/^[a-z][a-z\d+\-.]*:\/\//i.test(value)) {
|
|
28
|
+
try {
|
|
29
|
+
const url = new URL(value);
|
|
30
|
+
return `${url.protocol}//${url.host}${url.pathname.replace(/\/+$/, '')}`;
|
|
31
|
+
}
|
|
32
|
+
catch {
|
|
33
|
+
return undefined;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
const scheme = protocol ?? 'https:';
|
|
37
|
+
try {
|
|
38
|
+
const url = new URL(`${scheme}//${value}`);
|
|
39
|
+
return `${url.protocol}//${url.host}${url.pathname.replace(/\/+$/, '')}`;
|
|
40
|
+
}
|
|
41
|
+
catch {
|
|
42
|
+
return undefined;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
function getSelfManagedApiBaseUrl(providerId, domain, protocol) {
|
|
46
|
+
const baseUrl = normalizeSelfManagedBaseUrl(domain, protocol);
|
|
47
|
+
if (baseUrl == null)
|
|
48
|
+
return undefined;
|
|
49
|
+
switch (providerId) {
|
|
50
|
+
case GitSelfManagedHostIntegrationId.CloudGitHubEnterprise:
|
|
51
|
+
return `${baseUrl.replace(/\/api(?:\/v\d+)?$/, '')}/api/v3`;
|
|
52
|
+
case GitSelfManagedHostIntegrationId.CloudGitLabSelfHosted:
|
|
53
|
+
return baseUrl.replace(/\/api(?:\/v\d+)?$/, '');
|
|
54
|
+
case GitSelfManagedHostIntegrationId.BitbucketServer:
|
|
55
|
+
return `${baseUrl.replace(/\/rest\/api\/1\.0$/, '')}/rest/api/1.0`;
|
|
56
|
+
case GitSelfManagedHostIntegrationId.AzureDevOpsServer:
|
|
57
|
+
return baseUrl;
|
|
58
|
+
default:
|
|
59
|
+
return undefined;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
15
62
|
export class GitHostIntegration extends IntegrationBase {
|
|
16
63
|
type = 'git';
|
|
17
64
|
async getAccountForEmail(repo, email, options) {
|
|
@@ -30,6 +77,31 @@ export class GitHostIntegration extends IntegrationBase {
|
|
|
30
77
|
return undefined;
|
|
31
78
|
}
|
|
32
79
|
}
|
|
80
|
+
/**
|
|
81
|
+
* Returns the SSH signing keys (full OpenSSH-format `<type> <key> [comment]` strings) registered by the accounts
|
|
82
|
+
* matching the given emails on this integration, for building an `allowed_signers` file. Keyed by lowercased email;
|
|
83
|
+
* emails with no match (and unsupported integrations) are absent. Batching the lookups is left to the integration.
|
|
84
|
+
*/
|
|
85
|
+
async getSshSigningKeysForEmails(repo, emails) {
|
|
86
|
+
const scope = getScopedLogger();
|
|
87
|
+
const connected = this.maybeConnected ?? (await this.isConnected());
|
|
88
|
+
if (!connected)
|
|
89
|
+
return new Map();
|
|
90
|
+
await this.refreshSessionIfExpired(scope);
|
|
91
|
+
try {
|
|
92
|
+
const keys = await this.getProviderSshSigningKeysForEmails(this._session, repo, emails);
|
|
93
|
+
this.resetRequestExceptionCount('getSshSigningKeysForEmails');
|
|
94
|
+
return keys;
|
|
95
|
+
}
|
|
96
|
+
catch (ex) {
|
|
97
|
+
this.handleProviderException('getSshSigningKeysForEmails', ex, { scope: scope });
|
|
98
|
+
return new Map();
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
/** Override in integrations that expose users' SSH signing keys. Defaults to none. */
|
|
102
|
+
getProviderSshSigningKeysForEmails(_session, _repo, _emails) {
|
|
103
|
+
return Promise.resolve(new Map());
|
|
104
|
+
}
|
|
33
105
|
async getAccountForCommit(repo, rev, options) {
|
|
34
106
|
const scope = getScopedLogger();
|
|
35
107
|
const connected = this.maybeConnected ?? (await this.isConnected());
|
|
@@ -88,6 +160,162 @@ export class GitHostIntegration extends IntegrationBase {
|
|
|
88
160
|
}), { expiryOverride: options?.expiryOverride });
|
|
89
161
|
return metadata;
|
|
90
162
|
}
|
|
163
|
+
/**
|
|
164
|
+
* Lists the organizations (orgs/workspaces/groups) the current user belongs to on this host.
|
|
165
|
+
* `truncated === true` means the defensive page-drain backstop stopped before the upstream listing
|
|
166
|
+
* was exhausted.
|
|
167
|
+
*/
|
|
168
|
+
async getOrganizationsForUser() {
|
|
169
|
+
return (await this.getOrganizationsForUserResult())?.value;
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Whether this git host implements generic org discovery. False for providers that register no
|
|
173
|
+
* {@link getProviderOrganizationsForUser} hook (e.g. Bitbucket Data Center) — the facade uses this to
|
|
174
|
+
* report `unsupported` instead of a silent empty list, which is indistinguishable from "has no orgs".
|
|
175
|
+
*/
|
|
176
|
+
get supportsOrganizationDiscovery() {
|
|
177
|
+
return this.getProviderOrganizationsForUser != null;
|
|
178
|
+
}
|
|
179
|
+
/** Whether this git host implements generic repository discovery ({@link getProviderRepositoriesForOrg}). */
|
|
180
|
+
get supportsRepositoryDiscovery() {
|
|
181
|
+
return this.getProviderRepositoriesForOrg != null;
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* Whether this git host has a project tier between org and repo ({@link getProviderProjectsForOrg}). Only
|
|
185
|
+
* Azure DevOps does; the facade uses this to skip the read entirely rather than call a core that returns
|
|
186
|
+
* `undefined` for a session-less reason and be misread as a broken connection.
|
|
187
|
+
*/
|
|
188
|
+
get supportsProjectDiscovery() {
|
|
189
|
+
return this.getProviderProjectsForOrg != null;
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* Whether this git host implements the account-wide user-affiliated repository read
|
|
193
|
+
* ({@link getProviderRepositoriesForUser}) — the org-less `gk provider repos <provider>` equivalent.
|
|
194
|
+
*/
|
|
195
|
+
get supportsUserRepositoryDiscovery() {
|
|
196
|
+
return this.getProviderRepositoriesForUser != null;
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* Whether this git host exposes issues on the ProviderBackend surface. Most git hosts do; a host with no
|
|
200
|
+
* usable issue tracker overrides this to false — Bitbucket Cloud (deprecated in favor of dedicated issue
|
|
201
|
+
* integrations like Jira) and Bitbucket Data Center (never had one) — so the facade reports issues as
|
|
202
|
+
* unsupported instead of serving a partial/deprecated source or failing inside a provider client that
|
|
203
|
+
* registers no issue function at all.
|
|
204
|
+
*
|
|
205
|
+
* Keep this in sync with {@link ProviderMetadata.supportedIssueFilters}: a provider that declares no issue
|
|
206
|
+
* filters and no issue read is answering the same capability question twice, and the two must agree.
|
|
207
|
+
*/
|
|
208
|
+
get supportsIssues() {
|
|
209
|
+
return true;
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* Result-returning core of {@link getOrganizationsForUser}. Resolves the session for `connectionId`
|
|
213
|
+
* (or the primary connection when omitted, honoring multi-account reads) and recovers a thrown error
|
|
214
|
+
* into `{ error }` so callers can surface it as a warning instead of swallowing it to `undefined`.
|
|
215
|
+
*/
|
|
216
|
+
async getOrganizationsForUserResult(connectionId) {
|
|
217
|
+
const scope = getScopedLogger();
|
|
218
|
+
// `connectionId` targets a specific account (multi-account); omitted reads the primary.
|
|
219
|
+
const session = await this.resolveReadSession(connectionId, scope);
|
|
220
|
+
if (session == null)
|
|
221
|
+
return undefined;
|
|
222
|
+
const start = performance.now();
|
|
223
|
+
try {
|
|
224
|
+
const result = await this.getProviderOrganizationsForUser?.(session);
|
|
225
|
+
this.resetRequestExceptionCount('getOrganizationsForUser');
|
|
226
|
+
return { value: result, duration: performance.now() - start };
|
|
227
|
+
}
|
|
228
|
+
catch (ex) {
|
|
229
|
+
this.handleProviderException('getOrganizationsForUser', ex, { scope: scope });
|
|
230
|
+
return { error: toError(ex), duration: performance.now() - start };
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* Result-returning list of the projects a git host exposes beneath its orgs, unified into the
|
|
235
|
+
* {@link ProviderOrganization} shape. Only Azure DevOps has a project tier between org and repo; other
|
|
236
|
+
* git hosts have none and leave {@link getProviderProjectsForOrg} undefined, so this returns `undefined`
|
|
237
|
+
* for them (the ProviderBackend facade then treats them as having no projects). With `org`, scopes to
|
|
238
|
+
* that org's projects; without, returns projects across every org the user can see.
|
|
239
|
+
*/
|
|
240
|
+
async getProjectsForOrgResult(org, connectionId) {
|
|
241
|
+
const scope = getScopedLogger();
|
|
242
|
+
// `connectionId` targets a specific account (multi-account); omitted reads the primary.
|
|
243
|
+
const session = await this.resolveReadSession(connectionId, scope);
|
|
244
|
+
if (session == null)
|
|
245
|
+
return undefined;
|
|
246
|
+
if (this.getProviderProjectsForOrg == null) {
|
|
247
|
+
return undefined;
|
|
248
|
+
}
|
|
249
|
+
const start = performance.now();
|
|
250
|
+
try {
|
|
251
|
+
const result = await this.getProviderProjectsForOrg(session, org);
|
|
252
|
+
this.resetRequestExceptionCount('getProjectsForOrg');
|
|
253
|
+
return { value: result, duration: performance.now() - start };
|
|
254
|
+
}
|
|
255
|
+
catch (ex) {
|
|
256
|
+
this.handleProviderException('getProjectsForOrg', ex, { scope: scope });
|
|
257
|
+
return { error: toError(ex), duration: performance.now() - start };
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
/**
|
|
261
|
+
* Lists repositories under the given organization (org/workspace/group) one page at a time — follow
|
|
262
|
+
* `paging.cursor` to page, or drain with the integrations provider paging helper.
|
|
263
|
+
* `options.project` is only meaningful for Azure DevOps, whose repos are scoped by `org` + `project`;
|
|
264
|
+
* every other host ignores it. (Azure without a project can't page its cross-project merge, so it
|
|
265
|
+
* returns all matches in a single page.) `truncated === true` means the defensive page-drain
|
|
266
|
+
* backstop stopped before the upstream listing was exhausted.
|
|
267
|
+
*/
|
|
268
|
+
async getRepositoriesForOrg(org, options) {
|
|
269
|
+
return (await this.getRepositoriesForOrgResult(org, options))?.value;
|
|
270
|
+
}
|
|
271
|
+
/**
|
|
272
|
+
* Result-returning core of {@link getRepositoriesForOrg}. Resolves the session for `connectionId`
|
|
273
|
+
* (or the primary connection when omitted) and recovers a thrown error into `{ error }` for warnings.
|
|
274
|
+
*/
|
|
275
|
+
async getRepositoriesForOrgResult(org, options) {
|
|
276
|
+
const scope = getScopedLogger();
|
|
277
|
+
// `connectionId` targets a specific account (multi-account); omitted reads the primary.
|
|
278
|
+
const session = await this.resolveReadSession(options?.connectionId, scope);
|
|
279
|
+
if (session == null)
|
|
280
|
+
return undefined;
|
|
281
|
+
const start = performance.now();
|
|
282
|
+
try {
|
|
283
|
+
const result = await this.getProviderRepositoriesForOrg?.(session, org, options);
|
|
284
|
+
this.resetRequestExceptionCount('getRepositoriesForOrg');
|
|
285
|
+
return { value: result, duration: performance.now() - start };
|
|
286
|
+
}
|
|
287
|
+
catch (ex) {
|
|
288
|
+
this.handleProviderException('getRepositoriesForOrg', ex, { scope: scope });
|
|
289
|
+
return { error: toError(ex), duration: performance.now() - start };
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
/**
|
|
293
|
+
* Result-returning account-wide, user-affiliated repository read (the org-less
|
|
294
|
+
* `gk provider repos <provider>` equivalent): repositories the user owns, collaborates on, or can
|
|
295
|
+
* access through org membership — NOT every repo of every org. Optional: providers without a native
|
|
296
|
+
* user-affiliated listing (Bitbucket workspaces, Azure orgs, which require an org/workspace scope)
|
|
297
|
+
* leave the hook undefined and the facade reports the read as unsupported so callers fan out per org.
|
|
298
|
+
*/
|
|
299
|
+
async getRepositoriesForUserResult(options) {
|
|
300
|
+
const scope = getScopedLogger();
|
|
301
|
+
// `connectionId` targets a specific account (multi-account); omitted reads the primary.
|
|
302
|
+
const session = await this.resolveReadSession(options?.connectionId, scope);
|
|
303
|
+
if (session == null)
|
|
304
|
+
return undefined;
|
|
305
|
+
if (this.getProviderRepositoriesForUser == null) {
|
|
306
|
+
return undefined;
|
|
307
|
+
}
|
|
308
|
+
const start = performance.now();
|
|
309
|
+
try {
|
|
310
|
+
const result = await this.getProviderRepositoriesForUser(session, options);
|
|
311
|
+
this.resetRequestExceptionCount('getRepositoriesForUser');
|
|
312
|
+
return { value: result, duration: performance.now() - start };
|
|
313
|
+
}
|
|
314
|
+
catch (ex) {
|
|
315
|
+
this.handleProviderException('getRepositoriesForUser', ex, { scope: scope });
|
|
316
|
+
return { error: toError(ex), duration: performance.now() - start };
|
|
317
|
+
}
|
|
318
|
+
}
|
|
91
319
|
async mergePullRequest(pr, options) {
|
|
92
320
|
const scope = getScopedLogger();
|
|
93
321
|
const connected = this.maybeConnected ?? (await this.isConnected());
|
|
@@ -147,23 +375,79 @@ export class GitHostIntegration extends IntegrationBase {
|
|
|
147
375
|
}), options);
|
|
148
376
|
return pr;
|
|
149
377
|
}
|
|
150
|
-
|
|
378
|
+
/**
|
|
379
|
+
* Memoized identity lookups backing filter resolution. Keyed by the session's token fingerprint plus the
|
|
380
|
+
* scope of the lookup (base URL, and the Azure organization for the per-instance variant), so a different
|
|
381
|
+
* account, host, or org never reuses an entry and a rotated token simply misses.
|
|
382
|
+
*
|
|
383
|
+
* Not cleared when the token changes: one integration instance serves every connection of its provider
|
|
384
|
+
* (multi-account), so clearing on a fingerprint change would make two accounts reading in alternation
|
|
385
|
+
* evict each other and defeat the memo. Entries are bounded by tokens x hosts x orgs seen — a handful for
|
|
386
|
+
* the life of the integration.
|
|
387
|
+
*/
|
|
388
|
+
_filterAccounts = new Map();
|
|
389
|
+
/**
|
|
390
|
+
* Resolves the account a repo-scoped read turns `IssueFilter`/`PullRequestFilter` into a provider
|
|
391
|
+
* login/id with, memoized per token+scope.
|
|
392
|
+
*
|
|
393
|
+
* Every FILTERED read needs this, and `ProvidersApi.getCurrentUser` is a bare round trip — unlike
|
|
394
|
+
* {@link IntegrationBase.getCurrentAccount}, which the host caches. So a consumer that fans ONE page out
|
|
395
|
+
* into several filtered reads paid one identity request PER read, all resolving the same account: a
|
|
396
|
+
* per-user-facet fan-out (author + assignee + review-requested) doubled its request count, and paid it
|
|
397
|
+
* again on every page turn.
|
|
398
|
+
*
|
|
399
|
+
* The promise is memoized rather than the value, so concurrent facets share one in-flight request instead
|
|
400
|
+
* of racing. A rejection is evicted so the next read retries rather than caching a failure — matching how
|
|
401
|
+
* `getCurrentAccount` invalidates on error.
|
|
402
|
+
*/
|
|
403
|
+
getFilterAccount(api, session, customUrl, organization) {
|
|
404
|
+
const key = `${this.getSessionFingerprint(session)}:${customUrl ?? ''}:${organization ?? ''}`;
|
|
405
|
+
let pending = this._filterAccounts.get(key);
|
|
406
|
+
if (pending == null) {
|
|
407
|
+
const tokenWithInfo = toTokenWithInfo(this.authProvider.id, session);
|
|
408
|
+
pending = (organization != null
|
|
409
|
+
? api.getCurrentUserForInstance(tokenWithInfo, organization, { baseUrl: customUrl })
|
|
410
|
+
: api.getCurrentUser(tokenWithInfo, { baseUrl: customUrl })).catch((ex) => {
|
|
411
|
+
this._filterAccounts.delete(key);
|
|
412
|
+
throw ex;
|
|
413
|
+
});
|
|
414
|
+
this._filterAccounts.set(key, pending);
|
|
415
|
+
}
|
|
416
|
+
return pending;
|
|
417
|
+
}
|
|
418
|
+
async getMyIssuesForRepos(reposOrRepoIds, options, connectionId) {
|
|
419
|
+
return (await this.getMyIssuesForReposResult(reposOrRepoIds, options, connectionId))?.value;
|
|
420
|
+
}
|
|
421
|
+
/**
|
|
422
|
+
* Result-returning core of {@link getMyIssuesForRepos}. Resolves the session for `connectionId`
|
|
423
|
+
* (or the primary connection when omitted, so multi-account reads use the right token) and recovers
|
|
424
|
+
* thrown errors and validation failures into `{ error }` so callers can surface them as warnings
|
|
425
|
+
* rather than swallowing them to `undefined`.
|
|
426
|
+
*/
|
|
427
|
+
async getMyIssuesForReposResult(reposOrRepoIds, options, connectionId) {
|
|
151
428
|
const scope = getScopedLogger();
|
|
152
429
|
const providerId = this.authProvider.id;
|
|
153
|
-
const
|
|
154
|
-
|
|
430
|
+
const states = toProviderIssueStates(options?.state);
|
|
431
|
+
// `connectionId` targets a specific account (multi-account); omitted reads the primary. The session
|
|
432
|
+
// is resolved here for connectivity/bail; the connection's token is applied per API call below.
|
|
433
|
+
const session = await this.resolveReadSession(connectionId, scope);
|
|
434
|
+
if (session == null)
|
|
155
435
|
return undefined;
|
|
156
|
-
|
|
436
|
+
const start = performance.now();
|
|
437
|
+
const customUrl = options?.customUrl ?? getSelfManagedApiBaseUrl(providerId, session.domain || this.domain, session.protocol);
|
|
157
438
|
const api = await this.getProvidersApi();
|
|
158
439
|
if (providerId !== GitCloudHostIntegrationId.GitLab &&
|
|
159
440
|
(api.isRepoIdsInput(reposOrRepoIds) ||
|
|
160
|
-
(providerId
|
|
441
|
+
(isAzureDevOpsProvider(providerId) &&
|
|
161
442
|
!reposOrRepoIds.every(repo => repo.project != null && repo.namespace != null)))) {
|
|
162
443
|
Logger.warn(`Unsupported input for provider ${providerId}`, 'getIssuesForRepos');
|
|
163
|
-
return
|
|
444
|
+
return {
|
|
445
|
+
error: new Error(`Unsupported input for provider ${providerId}`),
|
|
446
|
+
duration: performance.now() - start,
|
|
447
|
+
};
|
|
164
448
|
}
|
|
165
449
|
let getIssuesOptions;
|
|
166
|
-
if (providerId
|
|
450
|
+
if (isAzureDevOpsProvider(providerId)) {
|
|
167
451
|
const organizations = new Set();
|
|
168
452
|
const projects = new Set();
|
|
169
453
|
for (const repo of reposOrRepoIds) {
|
|
@@ -172,42 +456,59 @@ export class GitHostIntegration extends IntegrationBase {
|
|
|
172
456
|
}
|
|
173
457
|
if (organizations.size > 1) {
|
|
174
458
|
Logger.warn(`Multiple organizations not supported for provider ${providerId}`, 'getIssuesForRepos');
|
|
175
|
-
return
|
|
459
|
+
return {
|
|
460
|
+
error: new Error(`Multiple organizations not supported for provider ${providerId}`),
|
|
461
|
+
duration: performance.now() - start,
|
|
462
|
+
};
|
|
176
463
|
}
|
|
177
464
|
else if (organizations.size === 0) {
|
|
178
465
|
Logger.warn(`No organizations found for provider ${providerId}`, 'getIssuesForRepos');
|
|
179
|
-
return
|
|
466
|
+
return {
|
|
467
|
+
error: new Error(`No organizations found for provider ${providerId}`),
|
|
468
|
+
duration: performance.now() - start,
|
|
469
|
+
};
|
|
180
470
|
}
|
|
181
471
|
const organization = first(organizations.values());
|
|
182
472
|
if (options?.filters != null) {
|
|
183
473
|
if (!api.providerSupportsIssueFilters(providerId, options.filters)) {
|
|
184
474
|
Logger.warn(`Unsupported filters for provider ${providerId}`, 'getIssuesForRepos');
|
|
185
|
-
return
|
|
475
|
+
return {
|
|
476
|
+
error: new Error(`Unsupported filters for provider ${providerId}`),
|
|
477
|
+
duration: performance.now() - start,
|
|
478
|
+
};
|
|
186
479
|
}
|
|
187
480
|
let userAccount;
|
|
188
481
|
try {
|
|
189
|
-
userAccount = await
|
|
482
|
+
userAccount = await this.getFilterAccount(api, session, customUrl, organization);
|
|
190
483
|
}
|
|
191
484
|
catch (ex) {
|
|
192
485
|
Logger.error(ex, 'getIssuesForRepos');
|
|
193
|
-
return
|
|
486
|
+
return { error: toError(ex), duration: performance.now() - start };
|
|
194
487
|
}
|
|
195
488
|
if (userAccount == null) {
|
|
196
489
|
Logger.warn(`Unable to get current user for ${providerId}`, 'getIssuesForRepos');
|
|
197
|
-
return
|
|
490
|
+
return {
|
|
491
|
+
error: new Error(`Unable to get current user for ${providerId}`),
|
|
492
|
+
duration: performance.now() - start,
|
|
493
|
+
};
|
|
198
494
|
}
|
|
199
495
|
const userFilterProperty = userAccount.name;
|
|
200
496
|
if (userFilterProperty == null) {
|
|
201
497
|
Logger.warn(`Unable to get user property for filter for ${providerId}`, 'getIssuesForRepos');
|
|
202
|
-
return
|
|
498
|
+
return {
|
|
499
|
+
error: new Error(`Unable to get user property for filter for ${providerId}`),
|
|
500
|
+
duration: performance.now() - start,
|
|
501
|
+
};
|
|
203
502
|
}
|
|
204
503
|
getIssuesOptions = {
|
|
205
504
|
authorLogin: options.filters.includes(IssueFilter.Author) ? userFilterProperty : undefined,
|
|
206
|
-
assigneeLogins: options.filters.includes(IssueFilter.Assignee)
|
|
505
|
+
assigneeLogins: !options.includeAllAssignees && options.filters.includes(IssueFilter.Assignee)
|
|
506
|
+
? [userFilterProperty]
|
|
507
|
+
: undefined,
|
|
207
508
|
mentionLogin: options.filters.includes(IssueFilter.Mention) ? userFilterProperty : undefined,
|
|
208
509
|
};
|
|
209
510
|
}
|
|
210
|
-
const cursorInfo =
|
|
511
|
+
const cursorInfo = this.parseCursorInfo(options?.cursor);
|
|
211
512
|
const cursors = cursorInfo.cursors ?? [];
|
|
212
513
|
let projectInputs = Array.from(projects.values(), project => ({
|
|
213
514
|
namespace: organization,
|
|
@@ -220,12 +521,43 @@ export class GitHostIntegration extends IntegrationBase {
|
|
|
220
521
|
try {
|
|
221
522
|
const cursor = { cursors: [] };
|
|
222
523
|
let hasMore = false;
|
|
524
|
+
let truncated = false;
|
|
525
|
+
let metadata;
|
|
223
526
|
const data = [];
|
|
224
|
-
|
|
225
|
-
|
|
527
|
+
// `allSettled`, not `Promise.all`: one project's read rejecting must not discard every sibling
|
|
528
|
+
// project's already-fetched issues and cursors. A rejected project is recorded as a structured
|
|
529
|
+
// failure so the facade can warn and set `fetchFailed` instead of reporting a partial project set
|
|
530
|
+
// as complete.
|
|
531
|
+
const settled = await Promise.allSettled(projectInputs.map(async (projectInput) => {
|
|
532
|
+
const results = await api.getIssuesForAzureProject(toTokenWithInfo(providerId, session), projectInput.namespace, projectInput.project, {
|
|
226
533
|
...getIssuesOptions,
|
|
227
534
|
cursor: projectInput.cursor,
|
|
535
|
+
baseUrl: customUrl,
|
|
536
|
+
// Continuation is driven by the per-project cursor; only apply an explicit page on the
|
|
537
|
+
// first request so it can't clobber a continuation cursor on later pages.
|
|
538
|
+
page: projectInput.cursor == null ? options?.page : undefined,
|
|
539
|
+
pageSize: options?.pageSize,
|
|
540
|
+
states: states,
|
|
228
541
|
});
|
|
542
|
+
return { projectInput: projectInput, results: results };
|
|
543
|
+
}));
|
|
544
|
+
for (let i = 0; i < settled.length; i++) {
|
|
545
|
+
const outcome = settled[i];
|
|
546
|
+
const projectInput = projectInputs[i];
|
|
547
|
+
if (outcome.status !== 'fulfilled') {
|
|
548
|
+
truncated = true;
|
|
549
|
+
const failure = toCollectionScopeFailure({
|
|
550
|
+
providerId: providerId,
|
|
551
|
+
resourceId: projectInput.namespace,
|
|
552
|
+
projectId: projectInput.project,
|
|
553
|
+
}, outcome.reason);
|
|
554
|
+
metadata = mergeCollectionMetadata(metadata, {
|
|
555
|
+
completeness: 'partial',
|
|
556
|
+
failures: [failure],
|
|
557
|
+
});
|
|
558
|
+
continue;
|
|
559
|
+
}
|
|
560
|
+
const { projectInput: _projectInput, results } = outcome.value;
|
|
229
561
|
data.push(...results.values);
|
|
230
562
|
if (results.paging?.more) {
|
|
231
563
|
hasMore = true;
|
|
@@ -235,46 +567,78 @@ export class GitHostIntegration extends IntegrationBase {
|
|
|
235
567
|
cursor: results.paging.cursor,
|
|
236
568
|
});
|
|
237
569
|
}
|
|
238
|
-
}
|
|
570
|
+
}
|
|
571
|
+
// Keep the requested page number in the composite cursor so the facade can report the real
|
|
572
|
+
// currentPage when the consumer continues using only the cursor.
|
|
573
|
+
if (options?.page != null) {
|
|
574
|
+
cursor.page = options.page;
|
|
575
|
+
}
|
|
239
576
|
return {
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
577
|
+
value: {
|
|
578
|
+
values: data,
|
|
579
|
+
paging: {
|
|
580
|
+
more: hasMore,
|
|
581
|
+
cursor: JSON.stringify(cursor),
|
|
582
|
+
truncated: truncated || undefined,
|
|
583
|
+
// Echo the requested numbered page so the facade reports the real currentPage for
|
|
584
|
+
// numbered-page hosts (GitLab/Bitbucket/Azure), not a synthesized 1. Cursor-only hosts
|
|
585
|
+
// leave `page` undefined via their own reads.
|
|
586
|
+
page: options?.page,
|
|
587
|
+
},
|
|
588
|
+
metadata: metadata,
|
|
244
589
|
},
|
|
590
|
+
duration: performance.now() - start,
|
|
245
591
|
};
|
|
246
592
|
}
|
|
247
593
|
catch (ex) {
|
|
248
594
|
Logger.error(ex, 'getIssuesForRepos');
|
|
249
|
-
return
|
|
595
|
+
return { error: toError(ex), duration: performance.now() - start };
|
|
250
596
|
}
|
|
251
597
|
}
|
|
252
598
|
if (options?.filters != null) {
|
|
599
|
+
// Validate the requested filters against what this provider actually supports — same guard the Azure
|
|
600
|
+
// branch above applies. Without it an unsupported filter (e.g. GitLab has no Mention endpoint) would
|
|
601
|
+
// resolve to no filter property being set and silently degrade to an unfiltered, project-wide read.
|
|
602
|
+
if (!api.providerSupportsIssueFilters(providerId, options.filters)) {
|
|
603
|
+
Logger.warn(`Unsupported filters for provider ${providerId}`, 'getIssuesForRepos');
|
|
604
|
+
return {
|
|
605
|
+
error: new Error(`Unsupported filters for provider ${providerId}`),
|
|
606
|
+
duration: performance.now() - start,
|
|
607
|
+
};
|
|
608
|
+
}
|
|
253
609
|
let userAccount;
|
|
254
610
|
try {
|
|
255
|
-
userAccount = await
|
|
611
|
+
userAccount = await this.getFilterAccount(api, session, customUrl);
|
|
256
612
|
}
|
|
257
613
|
catch (ex) {
|
|
258
614
|
Logger.error(ex, 'getIssuesForRepos');
|
|
259
|
-
return
|
|
615
|
+
return { error: toError(ex), duration: performance.now() - start };
|
|
260
616
|
}
|
|
261
617
|
if (userAccount == null) {
|
|
262
618
|
Logger.warn(`Unable to get current user for ${providerId}`, 'getIssuesForRepos');
|
|
263
|
-
return
|
|
619
|
+
return {
|
|
620
|
+
error: new Error(`Unable to get current user for ${providerId}`),
|
|
621
|
+
duration: performance.now() - start,
|
|
622
|
+
};
|
|
264
623
|
}
|
|
265
624
|
const userFilterProperty = userAccount.username;
|
|
266
625
|
if (userFilterProperty == null) {
|
|
267
626
|
Logger.warn(`Unable to get user property for filter for ${providerId}`, 'getIssuesForRepos');
|
|
268
|
-
return
|
|
627
|
+
return {
|
|
628
|
+
error: new Error(`Unable to get user property for filter for ${providerId}`),
|
|
629
|
+
duration: performance.now() - start,
|
|
630
|
+
};
|
|
269
631
|
}
|
|
270
632
|
getIssuesOptions = {
|
|
271
633
|
authorLogin: options.filters.includes(IssueFilter.Author) ? userFilterProperty : undefined,
|
|
272
|
-
assigneeLogins: options.filters.includes(IssueFilter.Assignee)
|
|
634
|
+
assigneeLogins: !options.includeAllAssignees && options.filters.includes(IssueFilter.Assignee)
|
|
635
|
+
? [userFilterProperty]
|
|
636
|
+
: undefined,
|
|
273
637
|
mentionLogin: options.filters.includes(IssueFilter.Mention) ? userFilterProperty : undefined,
|
|
274
638
|
};
|
|
275
639
|
}
|
|
276
640
|
if (api.getProviderIssuesPagingMode(providerId) === PagingMode.Repo && !api.isRepoIdsInput(reposOrRepoIds)) {
|
|
277
|
-
const cursorInfo =
|
|
641
|
+
const cursorInfo = this.parseCursorInfo(options?.cursor);
|
|
278
642
|
const cursors = cursorInfo.cursors ?? [];
|
|
279
643
|
let repoInputs = reposOrRepoIds.map(repo => ({ repo: repo, cursor: undefined }));
|
|
280
644
|
if (cursors.length > 0) {
|
|
@@ -283,105 +647,201 @@ export class GitHostIntegration extends IntegrationBase {
|
|
|
283
647
|
try {
|
|
284
648
|
const cursor = { cursors: [] };
|
|
285
649
|
let hasMore = false;
|
|
650
|
+
let truncated = false;
|
|
651
|
+
let metadata;
|
|
286
652
|
const data = [];
|
|
287
|
-
|
|
288
|
-
|
|
653
|
+
// `allSettled`, not `Promise.all`: one repo's read rejecting must not discard every sibling repo's
|
|
654
|
+
// already-fetched issues and cursors. A rejected repo is recorded as a structured failure so the
|
|
655
|
+
// facade can warn and set `fetchFailed` instead of reporting a partial repo set as complete.
|
|
656
|
+
const settled = await Promise.allSettled(repoInputs.map(async (repoInput) => {
|
|
657
|
+
const results = await api.getIssuesForRepo(toTokenWithInfo(providerId, session), repoInput.repo, {
|
|
289
658
|
...getIssuesOptions,
|
|
290
659
|
cursor: repoInput.cursor,
|
|
291
|
-
baseUrl:
|
|
660
|
+
baseUrl: customUrl,
|
|
661
|
+
// Continuation is driven by the per-repo cursor; only apply an explicit page on the
|
|
662
|
+
// first request so it can't clobber a continuation cursor on later pages.
|
|
663
|
+
page: repoInput.cursor == null ? options?.page : undefined,
|
|
664
|
+
pageSize: options?.pageSize,
|
|
665
|
+
states: states,
|
|
292
666
|
});
|
|
667
|
+
return { repoInput: repoInput, results: results };
|
|
668
|
+
}));
|
|
669
|
+
for (let i = 0; i < settled.length; i++) {
|
|
670
|
+
const outcome = settled[i];
|
|
671
|
+
const repoInput = repoInputs[i];
|
|
672
|
+
if (outcome.status !== 'fulfilled') {
|
|
673
|
+
truncated = true;
|
|
674
|
+
const failure = toCollectionScopeFailure({
|
|
675
|
+
providerId: providerId,
|
|
676
|
+
repositoryId: `${repoInput.repo.namespace}/${repoInput.repo.name}`,
|
|
677
|
+
}, outcome.reason);
|
|
678
|
+
metadata = mergeCollectionMetadata(metadata, {
|
|
679
|
+
completeness: 'partial',
|
|
680
|
+
failures: [failure],
|
|
681
|
+
});
|
|
682
|
+
continue;
|
|
683
|
+
}
|
|
684
|
+
const { repoInput: _repoInput, results } = outcome.value;
|
|
293
685
|
data.push(...results.values);
|
|
294
686
|
if (results.paging?.more) {
|
|
295
687
|
hasMore = true;
|
|
296
688
|
cursor.cursors.push({ repo: repoInput.repo, cursor: results.paging.cursor });
|
|
297
689
|
}
|
|
298
|
-
}
|
|
690
|
+
}
|
|
691
|
+
if (options?.page != null) {
|
|
692
|
+
cursor.page = options.page;
|
|
693
|
+
}
|
|
299
694
|
return {
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
695
|
+
value: {
|
|
696
|
+
values: data,
|
|
697
|
+
paging: {
|
|
698
|
+
more: hasMore,
|
|
699
|
+
cursor: JSON.stringify(cursor),
|
|
700
|
+
truncated: truncated || undefined,
|
|
701
|
+
// Echo the requested numbered page so the facade reports the real currentPage for
|
|
702
|
+
// numbered-page hosts (GitLab/Bitbucket/Azure), not a synthesized 1. Cursor-only hosts
|
|
703
|
+
// leave `page` undefined via their own reads.
|
|
704
|
+
page: options?.page,
|
|
705
|
+
},
|
|
706
|
+
metadata: metadata,
|
|
304
707
|
},
|
|
708
|
+
duration: performance.now() - start,
|
|
305
709
|
};
|
|
306
710
|
}
|
|
307
711
|
catch (ex) {
|
|
308
712
|
Logger.error(ex, 'getIssuesForRepos');
|
|
309
|
-
return
|
|
713
|
+
return { error: toError(ex), duration: performance.now() - start };
|
|
310
714
|
}
|
|
311
715
|
}
|
|
312
716
|
try {
|
|
313
|
-
|
|
717
|
+
const result = await api.getIssuesForRepos(toTokenWithInfo(providerId, session), reposOrRepoIds, {
|
|
314
718
|
...getIssuesOptions,
|
|
315
719
|
cursor: options?.cursor,
|
|
316
|
-
baseUrl:
|
|
720
|
+
baseUrl: customUrl,
|
|
721
|
+
page: options?.page,
|
|
722
|
+
pageSize: options?.pageSize,
|
|
723
|
+
states: states,
|
|
317
724
|
});
|
|
725
|
+
return { value: result, duration: performance.now() - start };
|
|
318
726
|
}
|
|
319
727
|
catch (ex) {
|
|
320
728
|
Logger.error(ex, 'getIssuesForRepos');
|
|
321
|
-
return
|
|
729
|
+
return { error: toError(ex), duration: performance.now() - start };
|
|
322
730
|
}
|
|
323
731
|
}
|
|
324
|
-
|
|
732
|
+
/**
|
|
733
|
+
* Repo-scoped "my issues" read returning the normalized {@link IssueShape} the ProviderBackend facade
|
|
734
|
+
* consumes (`listIssuesPage({ repos })`, `broadenIssues`). Maps {@link getMyIssuesForReposResult} — the raw
|
|
735
|
+
* provider-apis path — to IssueShape.
|
|
736
|
+
*
|
|
737
|
+
* It's the seam rather than an inline map so a provider whose only issue client already yields normalized
|
|
738
|
+
* shapes, and isn't wired into the raw path, can override it and serve these reads without a
|
|
739
|
+
* `ProviderIssue` round-trip. No provider does today: the one candidate (Bitbucket Cloud's legacy
|
|
740
|
+
* `getUsersIssuesForRepo`) reports `supportsIssues: false`, so the facade never reaches this for it.
|
|
741
|
+
*/
|
|
742
|
+
async getMyIssuesForReposAsShapesResult(reposOrRepoIds, options, connectionId) {
|
|
743
|
+
const result = await this.getMyIssuesForReposResult(reposOrRepoIds, options, connectionId);
|
|
744
|
+
if (result == null)
|
|
745
|
+
return undefined;
|
|
746
|
+
if (result.error != null)
|
|
747
|
+
return { error: result.error, duration: result.duration };
|
|
748
|
+
if (result.value == null)
|
|
749
|
+
return { value: undefined, duration: result.duration };
|
|
750
|
+
const values = result.value.values
|
|
751
|
+
.map(issue => toIssueShape(issue, this))
|
|
752
|
+
.filter((issue) => issue != null);
|
|
753
|
+
return { value: { ...result.value, values: values }, duration: result.duration };
|
|
754
|
+
}
|
|
755
|
+
async getMyPullRequestsForRepos(reposOrRepoIds, options, connectionId) {
|
|
756
|
+
return (await this.getMyPullRequestsForReposResult(reposOrRepoIds, options, connectionId))?.value;
|
|
757
|
+
}
|
|
758
|
+
/**
|
|
759
|
+
* Result-returning core of {@link getMyPullRequestsForRepos}. Resolves the session for `connectionId`
|
|
760
|
+
* (or the primary connection when omitted, so multi-account reads use the right token) and recovers
|
|
761
|
+
* thrown errors and validation failures into `{ error }` so callers can surface them as warnings
|
|
762
|
+
* rather than swallowing them to `undefined`.
|
|
763
|
+
*/
|
|
764
|
+
async getMyPullRequestsForReposResult(reposOrRepoIds, options, connectionId) {
|
|
325
765
|
const scope = getScopedLogger();
|
|
326
766
|
const providerId = this.authProvider.id;
|
|
327
|
-
const
|
|
328
|
-
|
|
767
|
+
const states = toProviderPullRequestStates(options?.state);
|
|
768
|
+
// `connectionId` targets a specific account (multi-account); omitted reads the primary. The session
|
|
769
|
+
// is resolved here for connectivity/bail; the connection's token is applied per API call below.
|
|
770
|
+
const session = await this.resolveReadSession(connectionId, scope);
|
|
771
|
+
if (session == null)
|
|
329
772
|
return undefined;
|
|
330
|
-
|
|
773
|
+
const start = performance.now();
|
|
774
|
+
const customUrl = options?.customUrl ?? getSelfManagedApiBaseUrl(providerId, session.domain || this.domain, session.protocol);
|
|
331
775
|
const api = await this.getProvidersApi();
|
|
332
776
|
if (providerId !== GitCloudHostIntegrationId.GitLab &&
|
|
333
777
|
(api.isRepoIdsInput(reposOrRepoIds) ||
|
|
334
|
-
(providerId
|
|
778
|
+
(isAzureDevOpsProvider(providerId) &&
|
|
335
779
|
!reposOrRepoIds.every(repo => repo.project != null && repo.namespace != null)))) {
|
|
336
780
|
Logger.warn(`Unsupported input for provider ${providerId}`);
|
|
337
|
-
return
|
|
781
|
+
return {
|
|
782
|
+
error: new Error(`Unsupported input for provider ${providerId}`),
|
|
783
|
+
duration: performance.now() - start,
|
|
784
|
+
};
|
|
338
785
|
}
|
|
339
786
|
let getPullRequestsOptions;
|
|
340
787
|
if (options?.filters != null) {
|
|
341
788
|
if (!api.providerSupportsPullRequestFilters(providerId, options.filters)) {
|
|
342
789
|
Logger.warn(`Unsupported filters for provider ${providerId}`, 'getPullRequestsForRepos');
|
|
343
|
-
return
|
|
790
|
+
return {
|
|
791
|
+
error: new Error(`Unsupported filters for provider ${providerId}`),
|
|
792
|
+
duration: performance.now() - start,
|
|
793
|
+
};
|
|
344
794
|
}
|
|
345
795
|
let userAccount;
|
|
346
|
-
if (providerId
|
|
796
|
+
if (isAzureDevOpsProvider(providerId)) {
|
|
347
797
|
const organizations = new Set();
|
|
348
798
|
for (const repo of reposOrRepoIds) {
|
|
349
799
|
organizations.add(repo.namespace);
|
|
350
800
|
}
|
|
351
801
|
if (organizations.size > 1) {
|
|
352
802
|
Logger.warn(`Multiple organizations not supported for provider ${providerId}`, 'getPullRequestsForRepos');
|
|
353
|
-
return
|
|
803
|
+
return {
|
|
804
|
+
error: new Error(`Multiple organizations not supported for provider ${providerId}`),
|
|
805
|
+
duration: performance.now() - start,
|
|
806
|
+
};
|
|
354
807
|
}
|
|
355
808
|
else if (organizations.size === 0) {
|
|
356
809
|
Logger.warn(`No organizations found for provider ${providerId}`, 'getPullRequestsForRepos');
|
|
357
|
-
return
|
|
810
|
+
return {
|
|
811
|
+
error: new Error(`No organizations found for provider ${providerId}`),
|
|
812
|
+
duration: performance.now() - start,
|
|
813
|
+
};
|
|
358
814
|
}
|
|
359
815
|
const organization = first(organizations.values());
|
|
360
816
|
try {
|
|
361
|
-
userAccount = await
|
|
817
|
+
userAccount = await this.getFilterAccount(api, session, customUrl, organization);
|
|
362
818
|
}
|
|
363
819
|
catch (ex) {
|
|
364
820
|
Logger.error(ex, 'getPullRequestsForRepos');
|
|
365
|
-
return
|
|
821
|
+
return { error: toError(ex), duration: performance.now() - start };
|
|
366
822
|
}
|
|
367
823
|
}
|
|
368
824
|
else {
|
|
369
825
|
try {
|
|
370
|
-
userAccount = await
|
|
826
|
+
userAccount = await this.getFilterAccount(api, session, customUrl);
|
|
371
827
|
}
|
|
372
828
|
catch (ex) {
|
|
373
829
|
Logger.error(ex, 'getPullRequestsForRepos');
|
|
374
|
-
return
|
|
830
|
+
return { error: toError(ex), duration: performance.now() - start };
|
|
375
831
|
}
|
|
376
832
|
}
|
|
377
833
|
if (userAccount == null) {
|
|
378
834
|
Logger.warn(`Unable to get current user for ${providerId}`, 'getPullRequestsForRepos');
|
|
379
|
-
return
|
|
835
|
+
return {
|
|
836
|
+
error: new Error(`Unable to get current user for ${providerId}`),
|
|
837
|
+
duration: performance.now() - start,
|
|
838
|
+
};
|
|
380
839
|
}
|
|
381
840
|
let userFilterProperty;
|
|
382
841
|
switch (providerId) {
|
|
383
842
|
case GitCloudHostIntegrationId.Bitbucket:
|
|
384
843
|
case GitCloudHostIntegrationId.AzureDevOps:
|
|
844
|
+
case GitSelfManagedHostIntegrationId.AzureDevOpsServer:
|
|
385
845
|
userFilterProperty = userAccount.id;
|
|
386
846
|
break;
|
|
387
847
|
default:
|
|
@@ -390,20 +850,45 @@ export class GitHostIntegration extends IntegrationBase {
|
|
|
390
850
|
}
|
|
391
851
|
if (userFilterProperty == null) {
|
|
392
852
|
Logger.warn(`Unable to get user property for filter for ${providerId}`, 'getPullRequestsForRepos');
|
|
393
|
-
return
|
|
853
|
+
return {
|
|
854
|
+
error: new Error(`Unable to get user property for filter for ${providerId}`),
|
|
855
|
+
duration: performance.now() - start,
|
|
856
|
+
};
|
|
857
|
+
}
|
|
858
|
+
// Route the "review requested from me" filter to the field each provider actually reads:
|
|
859
|
+
// GitHub/GitLab expect a login (reviewRequestedLogin), Bitbucket/Azure an account id (reviewerId),
|
|
860
|
+
// and Bitbucket Server a login (reviewerLogin). `userFilterProperty` is already the account id for
|
|
861
|
+
// Bitbucket/Azure and the username for the rest.
|
|
862
|
+
let reviewRequestedLogin;
|
|
863
|
+
let reviewerId;
|
|
864
|
+
let reviewerLogin;
|
|
865
|
+
if (options.filters.includes(PullRequestFilter.ReviewRequested)) {
|
|
866
|
+
switch (providerId) {
|
|
867
|
+
case GitCloudHostIntegrationId.Bitbucket:
|
|
868
|
+
case GitCloudHostIntegrationId.AzureDevOps:
|
|
869
|
+
case GitSelfManagedHostIntegrationId.AzureDevOpsServer:
|
|
870
|
+
reviewerId = userFilterProperty;
|
|
871
|
+
break;
|
|
872
|
+
case GitSelfManagedHostIntegrationId.BitbucketServer:
|
|
873
|
+
reviewerLogin = userFilterProperty;
|
|
874
|
+
break;
|
|
875
|
+
default:
|
|
876
|
+
reviewRequestedLogin = userFilterProperty;
|
|
877
|
+
break;
|
|
878
|
+
}
|
|
394
879
|
}
|
|
395
880
|
getPullRequestsOptions = {
|
|
396
881
|
authorLogin: options.filters.includes(PullRequestFilter.Author) ? userFilterProperty : undefined,
|
|
397
882
|
assigneeLogins: options.filters.includes(PullRequestFilter.Assignee) ? [userFilterProperty] : undefined,
|
|
398
|
-
reviewRequestedLogin:
|
|
399
|
-
|
|
400
|
-
|
|
883
|
+
reviewRequestedLogin: reviewRequestedLogin,
|
|
884
|
+
reviewerId: reviewerId,
|
|
885
|
+
reviewerLogin: reviewerLogin,
|
|
401
886
|
mentionLogin: options.filters.includes(PullRequestFilter.Mention) ? userFilterProperty : undefined,
|
|
402
887
|
};
|
|
403
888
|
}
|
|
404
889
|
if (api.getProviderPullRequestsPagingMode(providerId) === PagingMode.Repo &&
|
|
405
890
|
!api.isRepoIdsInput(reposOrRepoIds)) {
|
|
406
|
-
const cursorInfo =
|
|
891
|
+
const cursorInfo = this.parseCursorInfo(options?.cursor);
|
|
407
892
|
const cursors = cursorInfo.cursors ?? [];
|
|
408
893
|
let repoInputs = reposOrRepoIds.map(repo => ({ repo: repo, cursor: undefined }));
|
|
409
894
|
if (cursors.length > 0) {
|
|
@@ -412,55 +897,129 @@ export class GitHostIntegration extends IntegrationBase {
|
|
|
412
897
|
try {
|
|
413
898
|
const cursor = { cursors: [] };
|
|
414
899
|
let hasMore = false;
|
|
900
|
+
let truncated = false;
|
|
901
|
+
let metadata;
|
|
902
|
+
const failures = [];
|
|
415
903
|
const data = [];
|
|
416
|
-
|
|
417
|
-
|
|
904
|
+
// `allSettled`, not `Promise.all`: one repo's read rejecting must not discard every sibling repo's
|
|
905
|
+
// already-fetched PRs and cursors. A rejected repo becomes a structured `CollectionScopeFailure`
|
|
906
|
+
// (attributed to that repo) so the facade warns on it + sets `fetchFailed`, while the survivors and
|
|
907
|
+
// their continuation cursors are still returned.
|
|
908
|
+
const settled = await Promise.allSettled(repoInputs.map(async (repoInput) => {
|
|
909
|
+
const results = await api.getPullRequestsForRepo(toTokenWithInfo(providerId, session), repoInput.repo, {
|
|
418
910
|
...getPullRequestsOptions,
|
|
419
911
|
cursor: repoInput.cursor,
|
|
420
|
-
baseUrl:
|
|
912
|
+
baseUrl: customUrl,
|
|
913
|
+
// Continuation is driven by the per-repo cursor; only apply an explicit page on the
|
|
914
|
+
// first request so it can't clobber a continuation cursor on later pages.
|
|
915
|
+
page: repoInput.cursor == null ? options?.page : undefined,
|
|
916
|
+
pageSize: options?.pageSize,
|
|
917
|
+
states: states,
|
|
918
|
+
// Azure DevOps only populates clone URLs on request (extra call); no-op elsewhere.
|
|
919
|
+
includeRemoteInfo: isAzureDevOpsProvider(providerId) ? true : undefined,
|
|
421
920
|
});
|
|
921
|
+
return { repoInput: repoInput, results: results };
|
|
922
|
+
}));
|
|
923
|
+
// `allSettled` preserves order, so `settled[i]` is `repoInputs[i]`.
|
|
924
|
+
settled.forEach((outcome, i) => {
|
|
925
|
+
if (outcome.status !== 'fulfilled') {
|
|
926
|
+
const failedRepo = repoInputs[i].repo;
|
|
927
|
+
failures.push(toCollectionScopeFailure({ providerId: providerId, repositoryId: `${failedRepo.namespace}/${failedRepo.name}` }, outcome.reason));
|
|
928
|
+
return;
|
|
929
|
+
}
|
|
930
|
+
const { repoInput, results } = outcome.value;
|
|
422
931
|
data.push(...results.values);
|
|
932
|
+
// Fan-out across repos: preserve each repo's SDK completeness/failures and its terminal
|
|
933
|
+
// truncation so a single failed/incomplete repo isn't lost when merged with its siblings.
|
|
934
|
+
metadata = mergeCollectionMetadata(metadata, results.metadata);
|
|
935
|
+
if (results.paging?.truncated) {
|
|
936
|
+
truncated = true;
|
|
937
|
+
}
|
|
423
938
|
if (results.paging?.more) {
|
|
424
939
|
hasMore = true;
|
|
425
940
|
cursor.cursors.push({ repo: repoInput.repo, cursor: results.paging.cursor });
|
|
426
941
|
}
|
|
427
|
-
})
|
|
942
|
+
});
|
|
943
|
+
// Merge the GitLens-side per-repo rejections into the SDK metadata so both flow through the same
|
|
944
|
+
// warning/fetchFailed assessment downstream.
|
|
945
|
+
if (failures.length > 0) {
|
|
946
|
+
metadata = mergeCollectionMetadata(metadata, { completeness: 'partial', failures: failures });
|
|
947
|
+
}
|
|
948
|
+
// Keep the requested page number in the composite cursor so the facade can report the real
|
|
949
|
+
// currentPage when the consumer continues using only the cursor.
|
|
950
|
+
if (options?.page != null) {
|
|
951
|
+
cursor.page = options.page;
|
|
952
|
+
}
|
|
428
953
|
return {
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
954
|
+
value: {
|
|
955
|
+
values: data,
|
|
956
|
+
paging: {
|
|
957
|
+
more: hasMore,
|
|
958
|
+
cursor: JSON.stringify(cursor),
|
|
959
|
+
truncated: truncated || undefined,
|
|
960
|
+
// Echo the requested numbered page so the facade reports the real currentPage for
|
|
961
|
+
// numbered-page hosts (GitLab/Bitbucket/Azure), not a synthesized 1. Cursor-only hosts
|
|
962
|
+
// leave `page` undefined via their own reads.
|
|
963
|
+
page: options?.page,
|
|
964
|
+
},
|
|
965
|
+
metadata: metadata,
|
|
433
966
|
},
|
|
967
|
+
duration: performance.now() - start,
|
|
434
968
|
};
|
|
435
969
|
}
|
|
436
970
|
catch (ex) {
|
|
437
971
|
Logger.error(ex, 'getPullRequestsForRepos');
|
|
438
|
-
return
|
|
972
|
+
return { error: toError(ex), duration: performance.now() - start };
|
|
439
973
|
}
|
|
440
974
|
}
|
|
441
975
|
try {
|
|
442
|
-
|
|
976
|
+
const result = await api.getPullRequestsForRepos(toTokenWithInfo(providerId, session), reposOrRepoIds, {
|
|
443
977
|
...getPullRequestsOptions,
|
|
444
978
|
cursor: options?.cursor,
|
|
445
|
-
baseUrl:
|
|
979
|
+
baseUrl: customUrl,
|
|
980
|
+
page: options?.page,
|
|
981
|
+
pageSize: options?.pageSize,
|
|
982
|
+
states: states,
|
|
983
|
+
// Azure DevOps only populates clone URLs on request (extra call); no-op elsewhere.
|
|
984
|
+
includeRemoteInfo: isAzureDevOpsProvider(providerId) ? true : undefined,
|
|
446
985
|
});
|
|
986
|
+
return { value: result, duration: performance.now() - start };
|
|
447
987
|
}
|
|
448
988
|
catch (ex) {
|
|
449
989
|
Logger.error(ex, 'getPullRequestsForRepos');
|
|
450
|
-
return
|
|
990
|
+
return { error: toError(ex), duration: performance.now() - start };
|
|
451
991
|
}
|
|
452
992
|
}
|
|
453
|
-
async searchMyPullRequests(repos, cancellation, silent) {
|
|
993
|
+
async searchMyPullRequests(repos, cancellation, silent, connectionId, state, options) {
|
|
454
994
|
const scope = getScopedLogger();
|
|
455
|
-
|
|
456
|
-
|
|
995
|
+
// `connectionId` targets a specific account (multi-account); omitted reads the primary.
|
|
996
|
+
const session = await this.resolveReadSession(connectionId, scope);
|
|
997
|
+
if (session == null)
|
|
457
998
|
return undefined;
|
|
458
|
-
await this.refreshSessionIfExpired(scope);
|
|
459
999
|
const start = performance.now();
|
|
460
1000
|
try {
|
|
461
|
-
|
|
1001
|
+
// Prefer the optional metadata-aware path for account-wide reads so partial failures (e.g. one Azure
|
|
1002
|
+
// org rejecting) are surfaced as a soft `{ value, error }` instead of being lost. Repo-scoped reads and
|
|
1003
|
+
// providers without that override keep using the legacy array path.
|
|
1004
|
+
let result;
|
|
1005
|
+
if (this.searchProviderMyPullRequestsResult != null && repos == null) {
|
|
1006
|
+
result = await this.searchProviderMyPullRequestsResult(session, repos != null ? (Array.isArray(repos) ? repos : [repos]) : undefined, cancellation, silent, state, options);
|
|
1007
|
+
}
|
|
1008
|
+
else {
|
|
1009
|
+
result = {
|
|
1010
|
+
value: await this.searchProviderMyPullRequests(session, repos != null ? (Array.isArray(repos) ? repos : [repos]) : undefined, cancellation, silent, state, options),
|
|
1011
|
+
};
|
|
1012
|
+
}
|
|
462
1013
|
this.resetRequestExceptionCount('searchMyPullRequests');
|
|
463
|
-
|
|
1014
|
+
// `IntegrationResult` is a strict union of value-only or error-only (and may be `undefined`). Return the
|
|
1015
|
+
// matching branch explicitly; a missing result is treated as a successful empty read.
|
|
1016
|
+
if (result == null) {
|
|
1017
|
+
return { value: undefined, duration: performance.now() - start };
|
|
1018
|
+
}
|
|
1019
|
+
if (result.error != null) {
|
|
1020
|
+
return { error: result.error, duration: performance.now() - start };
|
|
1021
|
+
}
|
|
1022
|
+
return { value: result.value, duration: performance.now() - start };
|
|
464
1023
|
}
|
|
465
1024
|
catch (ex) {
|
|
466
1025
|
this.handleProviderException('searchMyPullRequests', ex, {
|
|
@@ -468,19 +1027,68 @@ export class GitHostIntegration extends IntegrationBase {
|
|
|
468
1027
|
silent: true,
|
|
469
1028
|
});
|
|
470
1029
|
return {
|
|
471
|
-
error: ex,
|
|
1030
|
+
error: toError(ex),
|
|
472
1031
|
duration: performance.now() - start,
|
|
473
1032
|
};
|
|
474
1033
|
}
|
|
475
1034
|
}
|
|
476
|
-
|
|
1035
|
+
/**
|
|
1036
|
+
* Account-wide, user-scoped counterpart of {@link getMyPullRequestsForReposResult} that returns the raw
|
|
1037
|
+
* `ProviderPullRequest` shape (not the normalized model). Unlike the repo-scoped core, this needs no
|
|
1038
|
+
* `repos` — it reads the current user's pull requests across the account, so the ProviderBackend sweep
|
|
1039
|
+
* can drive its Kanban "done" column even when no repositories are supplied (where the repo-scoped core
|
|
1040
|
+
* rejects an empty `repos` input). Recovers thrown errors into `{ error }` so callers surface warnings.
|
|
1041
|
+
*/
|
|
1042
|
+
async getMyPullRequestsForUserResult(options, connectionId) {
|
|
477
1043
|
const scope = getScopedLogger();
|
|
478
|
-
|
|
479
|
-
|
|
1044
|
+
// `connectionId` targets a specific account (multi-account); omitted reads the primary.
|
|
1045
|
+
const session = await this.resolveReadSession(connectionId, scope);
|
|
1046
|
+
if (session == null)
|
|
480
1047
|
return undefined;
|
|
481
|
-
|
|
1048
|
+
if (this.getProviderMyPullRequestsForUser == null) {
|
|
1049
|
+
return undefined;
|
|
1050
|
+
}
|
|
1051
|
+
const start = performance.now();
|
|
482
1052
|
try {
|
|
483
|
-
const
|
|
1053
|
+
const result = await this.getProviderMyPullRequestsForUser(session, options);
|
|
1054
|
+
this.resetRequestExceptionCount('getMyPullRequestsForUser');
|
|
1055
|
+
return { value: result, duration: performance.now() - start };
|
|
1056
|
+
}
|
|
1057
|
+
catch (ex) {
|
|
1058
|
+
this.handleProviderException('getMyPullRequestsForUser', ex, { scope: scope });
|
|
1059
|
+
return { error: toError(ex), duration: performance.now() - start };
|
|
1060
|
+
}
|
|
1061
|
+
}
|
|
1062
|
+
/**
|
|
1063
|
+
* Parses a Repo/Project paging cursor into its `cursors` bundle. Guards against valid JSON whose
|
|
1064
|
+
* `cursors` is a truthy non-array (e.g. `{ "cursors": "..." }`), which would otherwise bypass the
|
|
1065
|
+
* `?? []` fallback at call sites and flow into `.map()` downstream, throwing instead of degrading to
|
|
1066
|
+
* the first page.
|
|
1067
|
+
*/
|
|
1068
|
+
parseCursorInfo(cursor) {
|
|
1069
|
+
try {
|
|
1070
|
+
const parsed = JSON.parse(cursor ?? '{}');
|
|
1071
|
+
return Array.isArray(parsed?.cursors) ? parsed : {};
|
|
1072
|
+
}
|
|
1073
|
+
catch {
|
|
1074
|
+
return {};
|
|
1075
|
+
}
|
|
1076
|
+
}
|
|
1077
|
+
async searchPullRequests(searchQuery, repos, cancellation, connectionIdOrOptions, options) {
|
|
1078
|
+
// `connectionId` (string) can be omitted when passing `options`; split the overlapping 4th arg.
|
|
1079
|
+
// When the 4th arg isn't the options object (a string `connectionId` or `undefined`), fall back to
|
|
1080
|
+
// the 5th-arg `options` so an explicit `undefined` connectionId still honors state filtering.
|
|
1081
|
+
const connectionId = typeof connectionIdOrOptions === 'string' ? connectionIdOrOptions : undefined;
|
|
1082
|
+
const searchOptions = connectionIdOrOptions != null && typeof connectionIdOrOptions !== 'string'
|
|
1083
|
+
? connectionIdOrOptions
|
|
1084
|
+
: options;
|
|
1085
|
+
const scope = getScopedLogger();
|
|
1086
|
+
// `connectionId` targets a specific account (multi-account); omitted reads the primary.
|
|
1087
|
+
const session = await this.resolveReadSession(connectionId, scope);
|
|
1088
|
+
if (session == null)
|
|
1089
|
+
return undefined;
|
|
1090
|
+
try {
|
|
1091
|
+
const prs = await this.searchProviderPullRequests?.(session, searchQuery, repos != null ? (Array.isArray(repos) ? repos : [repos]) : undefined, cancellation, searchOptions);
|
|
484
1092
|
this.resetRequestExceptionCount('searchPullRequests');
|
|
485
1093
|
return prs;
|
|
486
1094
|
}
|
|
@@ -497,6 +1105,10 @@ __decorate([
|
|
|
497
1105
|
gate(),
|
|
498
1106
|
trace()
|
|
499
1107
|
], GitHostIntegration.prototype, "getAccountForEmail", null);
|
|
1108
|
+
__decorate([
|
|
1109
|
+
gate(),
|
|
1110
|
+
trace()
|
|
1111
|
+
], GitHostIntegration.prototype, "getSshSigningKeysForEmails", null);
|
|
500
1112
|
__decorate([
|
|
501
1113
|
gate(),
|
|
502
1114
|
trace()
|
|
@@ -507,6 +1119,18 @@ __decorate([
|
|
|
507
1119
|
__decorate([
|
|
508
1120
|
trace()
|
|
509
1121
|
], GitHostIntegration.prototype, "getRepositoryMetadata", null);
|
|
1122
|
+
__decorate([
|
|
1123
|
+
trace()
|
|
1124
|
+
], GitHostIntegration.prototype, "getOrganizationsForUserResult", null);
|
|
1125
|
+
__decorate([
|
|
1126
|
+
trace()
|
|
1127
|
+
], GitHostIntegration.prototype, "getProjectsForOrgResult", null);
|
|
1128
|
+
__decorate([
|
|
1129
|
+
trace()
|
|
1130
|
+
], GitHostIntegration.prototype, "getRepositoriesForOrgResult", null);
|
|
1131
|
+
__decorate([
|
|
1132
|
+
trace()
|
|
1133
|
+
], GitHostIntegration.prototype, "getRepositoriesForUserResult", null);
|
|
510
1134
|
__decorate([
|
|
511
1135
|
trace()
|
|
512
1136
|
], GitHostIntegration.prototype, "getPullRequestForBranch", null);
|