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