@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
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import type { CollectionMetadata, CollectionScopeFailure } from '@gitkraken/provider-apis';
|
|
1
2
|
import type { Account, UnidentifiedAuthor } from '../../../git/models/author.js';
|
|
2
3
|
import type { DefaultBranch } from '../../../git/models/defaultBranch.js';
|
|
4
|
+
import type { IssueShape, IssueStateFilter } from '../../../git/models/issue.js';
|
|
3
5
|
import type { IssueOrPullRequestState as PullRequestState } from '../../../git/models/issueOrPullRequest.js';
|
|
4
|
-
import type { PullRequest, PullRequestMergeMethod } from '../../../git/models/pullRequest.js';
|
|
6
|
+
import type { PullRequest, PullRequestMergeMethod, PullRequestStateFilter } from '../../../git/models/pullRequest.js';
|
|
5
7
|
import type { RepositoryMetadata } from '../../../git/models/repositoryMetadata.js';
|
|
6
8
|
import type { ResourceDescriptor } from '../../../git/models/resourceDescriptor.js';
|
|
7
9
|
import type { PullRequestUrlIdentity } from '../../../git/utils/pullRequest.utils.js';
|
|
@@ -12,24 +14,111 @@ import { Logger } from '../../../utils/logger.js';
|
|
|
12
14
|
import { getScopedLogger } from '../../../utils/logger.scoped.js';
|
|
13
15
|
import type { PagedResult } from '../../../utils/paging.js';
|
|
14
16
|
import type { ProviderAuthenticationSession } from '../authentication/models.js';
|
|
17
|
+
import { toTokenWithInfo } from '../authentication/models.js';
|
|
18
|
+
import { toCollectionScopeFailure } from '../collectionMetadata.js';
|
|
15
19
|
import type { IntegrationIds } from '../constants.js';
|
|
16
|
-
import { GitCloudHostIntegrationId } from '../constants.js';
|
|
20
|
+
import { GitCloudHostIntegrationId, GitSelfManagedHostIntegrationId } from '../constants.js';
|
|
21
|
+
import { toError } from '../errors.js';
|
|
17
22
|
import type {
|
|
18
23
|
GetIssuesOptions,
|
|
19
24
|
GetPullRequestsOptions,
|
|
20
25
|
PagedProjectInput,
|
|
21
26
|
PagedRepoInput,
|
|
22
27
|
ProviderAccount,
|
|
28
|
+
ProviderApiPagedResult,
|
|
29
|
+
ProviderHierarchyResult,
|
|
23
30
|
ProviderIssue,
|
|
31
|
+
ProviderOrganization,
|
|
24
32
|
ProviderPullRequest,
|
|
25
33
|
ProviderRepoInput,
|
|
26
34
|
ProviderReposInput,
|
|
27
35
|
ProviderRepository,
|
|
28
36
|
} from '../providers/models.js';
|
|
29
|
-
import {
|
|
37
|
+
import {
|
|
38
|
+
IssueFilter,
|
|
39
|
+
PagingMode,
|
|
40
|
+
PullRequestFilter,
|
|
41
|
+
toIssueShape,
|
|
42
|
+
toProviderIssueStates,
|
|
43
|
+
toProviderPullRequestStates,
|
|
44
|
+
} from '../providers/models.js';
|
|
45
|
+
import type { ProvidersApi } from '../providers/providersApi.js';
|
|
46
|
+
import { mergeCollectionMetadata } from '../providers/utils/providerPaging.js';
|
|
30
47
|
import type { IntegrationResult, IntegrationType } from './integration.js';
|
|
31
48
|
import { IntegrationBase } from './integration.js';
|
|
32
49
|
|
|
50
|
+
function isAzureDevOpsProvider(
|
|
51
|
+
providerId: IntegrationIds,
|
|
52
|
+
): providerId is GitCloudHostIntegrationId.AzureDevOps | GitSelfManagedHostIntegrationId.AzureDevOpsServer {
|
|
53
|
+
return (
|
|
54
|
+
providerId === GitCloudHostIntegrationId.AzureDevOps ||
|
|
55
|
+
providerId === GitSelfManagedHostIntegrationId.AzureDevOpsServer
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
function normalizeSelfManagedBaseUrl(domain: string | undefined, protocol: string | undefined): string | undefined {
|
|
60
|
+
const value = domain?.trim();
|
|
61
|
+
if (!value) return undefined;
|
|
62
|
+
|
|
63
|
+
if (/^[a-z][a-z\d+\-.]*:\/\//i.test(value)) {
|
|
64
|
+
try {
|
|
65
|
+
const url = new URL(value);
|
|
66
|
+
return `${url.protocol}//${url.host}${url.pathname.replace(/\/+$/, '')}`;
|
|
67
|
+
} catch {
|
|
68
|
+
return undefined;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
const scheme = protocol ?? 'https:';
|
|
73
|
+
try {
|
|
74
|
+
const url = new URL(`${scheme}//${value}`);
|
|
75
|
+
return `${url.protocol}//${url.host}${url.pathname.replace(/\/+$/, '')}`;
|
|
76
|
+
} catch {
|
|
77
|
+
return undefined;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
function getSelfManagedApiBaseUrl(
|
|
82
|
+
providerId: IntegrationIds,
|
|
83
|
+
domain: string | undefined,
|
|
84
|
+
protocol: string | undefined,
|
|
85
|
+
): string | undefined {
|
|
86
|
+
const baseUrl = normalizeSelfManagedBaseUrl(domain, protocol);
|
|
87
|
+
if (baseUrl == null) return undefined;
|
|
88
|
+
|
|
89
|
+
switch (providerId) {
|
|
90
|
+
case GitSelfManagedHostIntegrationId.CloudGitHubEnterprise:
|
|
91
|
+
return `${baseUrl.replace(/\/api(?:\/v\d+)?$/, '')}/api/v3`;
|
|
92
|
+
case GitSelfManagedHostIntegrationId.CloudGitLabSelfHosted:
|
|
93
|
+
return baseUrl.replace(/\/api(?:\/v\d+)?$/, '');
|
|
94
|
+
case GitSelfManagedHostIntegrationId.BitbucketServer:
|
|
95
|
+
return `${baseUrl.replace(/\/rest\/api\/1\.0$/, '')}/rest/api/1.0`;
|
|
96
|
+
case GitSelfManagedHostIntegrationId.AzureDevOpsServer:
|
|
97
|
+
return baseUrl;
|
|
98
|
+
default:
|
|
99
|
+
return undefined;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export type SearchMyPullRequestsOptions = {
|
|
104
|
+
includeReviewRequested?: boolean;
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Rejects a read the provider can't serve as asked: logs the reason and returns it as the `{ error }` half of an
|
|
109
|
+
* {@link IntegrationResult}, timed from `start`.
|
|
110
|
+
*
|
|
111
|
+
* A single builder because these refusals are a contract, not incidental returns — the read cores below reject on
|
|
112
|
+
* unsupported input, an inexpressible filter set, or an unresolvable filter account, and each one must reach the
|
|
113
|
+
* caller as an error it can surface as a warning rather than as an empty success. Writing the message once also
|
|
114
|
+
* keeps the logged text and the thrown text from drifting apart, which is exactly what happened while each site
|
|
115
|
+
* spelled its message out twice.
|
|
116
|
+
*/
|
|
117
|
+
function unsupportedRead<T>(message: string, start: number, logContext?: string): IntegrationResult<T> {
|
|
118
|
+
Logger.warn(message, logContext);
|
|
119
|
+
return { error: new Error(message), duration: performance.now() - start };
|
|
120
|
+
}
|
|
121
|
+
|
|
33
122
|
export abstract class GitHostIntegration<
|
|
34
123
|
ID extends IntegrationIds = IntegrationIds,
|
|
35
124
|
T extends ResourceDescriptor = ResourceDescriptor,
|
|
@@ -63,6 +152,40 @@ export abstract class GitHostIntegration<
|
|
|
63
152
|
options?: { avatarSize?: number },
|
|
64
153
|
): Promise<Account | undefined>;
|
|
65
154
|
|
|
155
|
+
/**
|
|
156
|
+
* Returns the SSH signing keys (full OpenSSH-format `<type> <key> [comment]` strings) registered by the accounts
|
|
157
|
+
* matching the given emails on this integration, for building an `allowed_signers` file. Keyed by lowercased email;
|
|
158
|
+
* emails with no match (and unsupported integrations) are absent. Batching the lookups is left to the integration.
|
|
159
|
+
*/
|
|
160
|
+
@gate()
|
|
161
|
+
@trace()
|
|
162
|
+
async getSshSigningKeysForEmails(repo: T, emails: string[]): Promise<Map<string, string[]>> {
|
|
163
|
+
const scope = getScopedLogger();
|
|
164
|
+
|
|
165
|
+
const connected = this.maybeConnected ?? (await this.isConnected());
|
|
166
|
+
if (!connected) return new Map();
|
|
167
|
+
|
|
168
|
+
await this.refreshSessionIfExpired(scope);
|
|
169
|
+
|
|
170
|
+
try {
|
|
171
|
+
const keys = await this.getProviderSshSigningKeysForEmails(this._session!, repo, emails);
|
|
172
|
+
this.resetRequestExceptionCount('getSshSigningKeysForEmails');
|
|
173
|
+
return keys;
|
|
174
|
+
} catch (ex) {
|
|
175
|
+
this.handleProviderException('getSshSigningKeysForEmails', ex, { scope: scope });
|
|
176
|
+
return new Map();
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
/** Override in integrations that expose users' SSH signing keys. Defaults to none. */
|
|
181
|
+
protected getProviderSshSigningKeysForEmails(
|
|
182
|
+
_session: ProviderAuthenticationSession,
|
|
183
|
+
_repo: T,
|
|
184
|
+
_emails: string[],
|
|
185
|
+
): Promise<Map<string, string[]>> {
|
|
186
|
+
return Promise.resolve(new Map<string, string[]>());
|
|
187
|
+
}
|
|
188
|
+
|
|
66
189
|
@gate()
|
|
67
190
|
@trace()
|
|
68
191
|
async getAccountForCommit(
|
|
@@ -126,7 +249,12 @@ export abstract class GitHostIntegration<
|
|
|
126
249
|
return defaultBranch;
|
|
127
250
|
}
|
|
128
251
|
|
|
129
|
-
getRepoInfo?(repo: {
|
|
252
|
+
getRepoInfo?(repo: {
|
|
253
|
+
owner: string;
|
|
254
|
+
name: string;
|
|
255
|
+
project?: string;
|
|
256
|
+
connectionId?: string;
|
|
257
|
+
}): Promise<ProviderRepository | undefined>;
|
|
130
258
|
|
|
131
259
|
protected abstract getProviderDefaultBranch(
|
|
132
260
|
{ accessToken }: ProviderAuthenticationSession,
|
|
@@ -176,6 +304,196 @@ export abstract class GitHostIntegration<
|
|
|
176
304
|
cancellation?: AbortSignal,
|
|
177
305
|
): Promise<RepositoryMetadata | undefined>;
|
|
178
306
|
|
|
307
|
+
/**
|
|
308
|
+
* Whether this git host implements generic org discovery. False for providers that register no
|
|
309
|
+
* {@link getProviderOrganizationsForUser} hook (e.g. Bitbucket Data Center) — the facade uses this to
|
|
310
|
+
* report `unsupported` instead of a silent empty list, which is indistinguishable from "has no orgs".
|
|
311
|
+
*/
|
|
312
|
+
get supportsOrganizationDiscovery(): boolean {
|
|
313
|
+
return this.getProviderOrganizationsForUser != null;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
/** Whether this git host implements generic repository discovery ({@link getProviderRepositoriesForOrg}). */
|
|
317
|
+
get supportsRepositoryDiscovery(): boolean {
|
|
318
|
+
return this.getProviderRepositoriesForOrg != null;
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
/**
|
|
322
|
+
* Whether this git host has a project tier between org and repo ({@link getProviderProjectsForOrg}). Only
|
|
323
|
+
* Azure DevOps does; the facade uses this to skip the read entirely rather than call a core that returns
|
|
324
|
+
* `undefined` for a session-less reason and be misread as a broken connection.
|
|
325
|
+
*/
|
|
326
|
+
get supportsProjectDiscovery(): boolean {
|
|
327
|
+
return this.getProviderProjectsForOrg != null;
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
/**
|
|
331
|
+
* Whether this git host implements the account-wide user-affiliated repository read
|
|
332
|
+
* ({@link getProviderRepositoriesForUser}) — the org-less `gk provider repos <provider>` equivalent.
|
|
333
|
+
*/
|
|
334
|
+
get supportsUserRepositoryDiscovery(): boolean {
|
|
335
|
+
return this.getProviderRepositoriesForUser != null;
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
/**
|
|
339
|
+
* Whether this git host exposes issues on the ProviderBackend surface. Most git hosts do; a host with no
|
|
340
|
+
* usable issue tracker overrides this to false — Bitbucket Cloud (deprecated in favor of dedicated issue
|
|
341
|
+
* integrations like Jira) and Bitbucket Data Center (never had one) — so the facade reports issues as
|
|
342
|
+
* unsupported instead of serving a partial/deprecated source or failing inside a provider client that
|
|
343
|
+
* registers no issue function at all.
|
|
344
|
+
*
|
|
345
|
+
* Keep this in sync with {@link ProviderMetadata.supportedIssueFilters}: a provider that declares no issue
|
|
346
|
+
* filters and no issue read is answering the same capability question twice, and the two must agree.
|
|
347
|
+
*/
|
|
348
|
+
get supportsIssues(): boolean {
|
|
349
|
+
return true;
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
/**
|
|
353
|
+
* Lists the organizations (orgs/workspaces/groups) the current user belongs to on this host.
|
|
354
|
+
* `truncated === true` means the defensive page-drain backstop stopped before the upstream listing was
|
|
355
|
+
* exhausted.
|
|
356
|
+
*
|
|
357
|
+
* Resolves the session for `connectionId` (or the primary connection when omitted, honoring multi-account
|
|
358
|
+
* reads) and recovers a thrown error into `{ error }` so callers can surface it as a warning instead of
|
|
359
|
+
* swallowing it to `undefined`.
|
|
360
|
+
*/
|
|
361
|
+
@trace()
|
|
362
|
+
async getOrganizationsForUserResult(
|
|
363
|
+
connectionId?: string,
|
|
364
|
+
): Promise<IntegrationResult<ProviderHierarchyResult<ProviderOrganization> | undefined>> {
|
|
365
|
+
const scope = getScopedLogger();
|
|
366
|
+
// `connectionId` targets a specific account (multi-account); omitted reads the primary.
|
|
367
|
+
const session = await this.resolveReadSession(connectionId, scope);
|
|
368
|
+
if (session == null) return undefined;
|
|
369
|
+
|
|
370
|
+
const start = performance.now();
|
|
371
|
+
try {
|
|
372
|
+
const result = await this.getProviderOrganizationsForUser?.(session);
|
|
373
|
+
this.resetRequestExceptionCount('getOrganizationsForUser');
|
|
374
|
+
return { value: result, duration: performance.now() - start };
|
|
375
|
+
} catch (ex) {
|
|
376
|
+
this.handleProviderException('getOrganizationsForUser', ex, { scope: scope });
|
|
377
|
+
return { error: toError(ex), duration: performance.now() - start };
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
protected getProviderOrganizationsForUser?(
|
|
382
|
+
session: ProviderAuthenticationSession,
|
|
383
|
+
): Promise<ProviderHierarchyResult<ProviderOrganization> | undefined>;
|
|
384
|
+
|
|
385
|
+
/**
|
|
386
|
+
* Result-returning list of the projects a git host exposes beneath its orgs, unified into the
|
|
387
|
+
* {@link ProviderOrganization} shape. Only Azure DevOps has a project tier between org and repo; other
|
|
388
|
+
* git hosts have none and leave {@link getProviderProjectsForOrg} undefined, so this returns `undefined`
|
|
389
|
+
* for them (the ProviderBackend facade then treats them as having no projects). With `org`, scopes to
|
|
390
|
+
* that org's projects; without, returns projects across every org the user can see.
|
|
391
|
+
*/
|
|
392
|
+
@trace()
|
|
393
|
+
async getProjectsForOrgResult(
|
|
394
|
+
org?: string,
|
|
395
|
+
connectionId?: string,
|
|
396
|
+
): Promise<IntegrationResult<ProviderHierarchyResult<ProviderOrganization> | undefined>> {
|
|
397
|
+
const scope = getScopedLogger();
|
|
398
|
+
// `connectionId` targets a specific account (multi-account); omitted reads the primary.
|
|
399
|
+
const session = await this.resolveReadSession(connectionId, scope);
|
|
400
|
+
if (session == null) return undefined;
|
|
401
|
+
|
|
402
|
+
if (this.getProviderProjectsForOrg == null) {
|
|
403
|
+
return undefined;
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
const start = performance.now();
|
|
407
|
+
try {
|
|
408
|
+
const result = await this.getProviderProjectsForOrg(session, org);
|
|
409
|
+
this.resetRequestExceptionCount('getProjectsForOrg');
|
|
410
|
+
return { value: result, duration: performance.now() - start };
|
|
411
|
+
} catch (ex) {
|
|
412
|
+
this.handleProviderException('getProjectsForOrg', ex, { scope: scope });
|
|
413
|
+
return { error: toError(ex), duration: performance.now() - start };
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
protected getProviderProjectsForOrg?(
|
|
418
|
+
session: ProviderAuthenticationSession,
|
|
419
|
+
org?: string,
|
|
420
|
+
): Promise<ProviderHierarchyResult<ProviderOrganization> | undefined>;
|
|
421
|
+
|
|
422
|
+
/**
|
|
423
|
+
* Lists repositories under the given organization (org/workspace/group) one page at a time — follow
|
|
424
|
+
* `paging.cursor` to page, or drain with the integrations provider paging helper.
|
|
425
|
+
* `options.project` is only meaningful for Azure DevOps, whose repos are scoped by `org` + `project`;
|
|
426
|
+
* every other host ignores it. (Azure without a project can't page its cross-project merge, so it
|
|
427
|
+
* returns all matches in a single page.) `truncated === true` means the defensive page-drain
|
|
428
|
+
* backstop stopped before the upstream listing was exhausted.
|
|
429
|
+
*
|
|
430
|
+
* Resolves the session for `connectionId` (or the primary connection when omitted) and recovers a thrown
|
|
431
|
+
* error into `{ error }`, so a caller surfaces it as a warning instead of a silent `undefined`.
|
|
432
|
+
*/
|
|
433
|
+
@trace()
|
|
434
|
+
async getRepositoriesForOrgResult(
|
|
435
|
+
org: string,
|
|
436
|
+
options?: { project?: string; cursor?: string; connectionId?: string },
|
|
437
|
+
): Promise<IntegrationResult<ProviderHierarchyResult<ProviderRepository> | undefined>> {
|
|
438
|
+
const scope = getScopedLogger();
|
|
439
|
+
// `connectionId` targets a specific account (multi-account); omitted reads the primary.
|
|
440
|
+
const session = await this.resolveReadSession(options?.connectionId, scope);
|
|
441
|
+
if (session == null) return undefined;
|
|
442
|
+
|
|
443
|
+
const start = performance.now();
|
|
444
|
+
try {
|
|
445
|
+
const result = await this.getProviderRepositoriesForOrg?.(session, org, options);
|
|
446
|
+
this.resetRequestExceptionCount('getRepositoriesForOrg');
|
|
447
|
+
return { value: result, duration: performance.now() - start };
|
|
448
|
+
} catch (ex) {
|
|
449
|
+
this.handleProviderException('getRepositoriesForOrg', ex, { scope: scope });
|
|
450
|
+
return { error: toError(ex), duration: performance.now() - start };
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
protected getProviderRepositoriesForOrg?(
|
|
455
|
+
session: ProviderAuthenticationSession,
|
|
456
|
+
org: string,
|
|
457
|
+
options?: { project?: string; cursor?: string },
|
|
458
|
+
): Promise<ProviderHierarchyResult<ProviderRepository> | undefined>;
|
|
459
|
+
|
|
460
|
+
/**
|
|
461
|
+
* Result-returning account-wide, user-affiliated repository read (the org-less
|
|
462
|
+
* `gk provider repos <provider>` equivalent): repositories the user owns, collaborates on, or can
|
|
463
|
+
* access through org membership — NOT every repo of every org. Optional: providers without a native
|
|
464
|
+
* user-affiliated listing (Bitbucket workspaces, Azure orgs, which require an org/workspace scope)
|
|
465
|
+
* leave the hook undefined and the facade reports the read as unsupported so callers fan out per org.
|
|
466
|
+
*/
|
|
467
|
+
@trace()
|
|
468
|
+
async getRepositoriesForUserResult(options?: {
|
|
469
|
+
cursor?: string;
|
|
470
|
+
connectionId?: string;
|
|
471
|
+
}): Promise<IntegrationResult<ProviderHierarchyResult<ProviderRepository> | undefined>> {
|
|
472
|
+
const scope = getScopedLogger();
|
|
473
|
+
// `connectionId` targets a specific account (multi-account); omitted reads the primary.
|
|
474
|
+
const session = await this.resolveReadSession(options?.connectionId, scope);
|
|
475
|
+
if (session == null) return undefined;
|
|
476
|
+
|
|
477
|
+
if (this.getProviderRepositoriesForUser == null) {
|
|
478
|
+
return undefined;
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
const start = performance.now();
|
|
482
|
+
try {
|
|
483
|
+
const result = await this.getProviderRepositoriesForUser(session, options);
|
|
484
|
+
this.resetRequestExceptionCount('getRepositoriesForUser');
|
|
485
|
+
return { value: result, duration: performance.now() - start };
|
|
486
|
+
} catch (ex) {
|
|
487
|
+
this.handleProviderException('getRepositoriesForUser', ex, { scope: scope });
|
|
488
|
+
return { error: toError(ex), duration: performance.now() - start };
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
protected getProviderRepositoriesForUser?(
|
|
493
|
+
session: ProviderAuthenticationSession,
|
|
494
|
+
options?: { cursor?: string },
|
|
495
|
+
): Promise<ProviderHierarchyResult<ProviderRepository> | undefined>;
|
|
496
|
+
|
|
179
497
|
async mergePullRequest(pr: PullRequest, options?: { mergeMethod?: PullRequestMergeMethod }): Promise<boolean> {
|
|
180
498
|
const scope = getScopedLogger();
|
|
181
499
|
|
|
@@ -283,30 +601,118 @@ export abstract class GitHostIntegration<
|
|
|
283
601
|
rev: string,
|
|
284
602
|
): Promise<PullRequest | undefined>;
|
|
285
603
|
|
|
604
|
+
/**
|
|
605
|
+
* Memoized identity lookups backing filter resolution. Keyed by the session's token fingerprint plus the
|
|
606
|
+
* scope of the lookup (base URL, and the Azure organization for the per-instance variant), so a different
|
|
607
|
+
* account, host, or org never reuses an entry and a rotated token simply misses.
|
|
608
|
+
*
|
|
609
|
+
* Not cleared when the token changes: one integration instance serves every connection of its provider
|
|
610
|
+
* (multi-account), so clearing on a fingerprint change would make two accounts reading in alternation
|
|
611
|
+
* evict each other and defeat the memo. Entries are bounded by tokens x hosts x orgs seen — a handful for
|
|
612
|
+
* the life of the integration.
|
|
613
|
+
*/
|
|
614
|
+
private readonly _filterAccounts = new Map<string, Promise<ProviderAccount | undefined>>();
|
|
615
|
+
|
|
616
|
+
/**
|
|
617
|
+
* Resolves the account a repo-scoped read turns `IssueFilter`/`PullRequestFilter` into a provider
|
|
618
|
+
* login/id with, memoized per token+scope.
|
|
619
|
+
*
|
|
620
|
+
* Every FILTERED read needs this, and `ProvidersApi.getCurrentUser` is a bare round trip — unlike
|
|
621
|
+
* {@link IntegrationBase.getCurrentAccount}, which the host caches. So a consumer that fans ONE page out
|
|
622
|
+
* into several filtered reads paid one identity request PER read, all resolving the same account: a
|
|
623
|
+
* per-user-facet fan-out (author + assignee + review-requested) doubled its request count, and paid it
|
|
624
|
+
* again on every page turn.
|
|
625
|
+
*
|
|
626
|
+
* The promise is memoized rather than the value, so concurrent facets share one in-flight request instead
|
|
627
|
+
* of racing. A rejection is evicted so the next read retries rather than caching a failure — matching how
|
|
628
|
+
* `getCurrentAccount` invalidates on error.
|
|
629
|
+
*/
|
|
630
|
+
private getFilterAccount(
|
|
631
|
+
api: ProvidersApi,
|
|
632
|
+
session: ProviderAuthenticationSession,
|
|
633
|
+
customUrl: string | undefined,
|
|
634
|
+
organization?: string,
|
|
635
|
+
): Promise<ProviderAccount | undefined> {
|
|
636
|
+
const key = `${this.getSessionFingerprint(session)}:${customUrl ?? ''}:${organization ?? ''}`;
|
|
637
|
+
|
|
638
|
+
let pending = this._filterAccounts.get(key);
|
|
639
|
+
if (pending == null) {
|
|
640
|
+
const tokenWithInfo = toTokenWithInfo(this.authProvider.id, session);
|
|
641
|
+
pending = (
|
|
642
|
+
organization != null
|
|
643
|
+
? api.getCurrentUserForInstance(tokenWithInfo, organization, { baseUrl: customUrl })
|
|
644
|
+
: api.getCurrentUser(tokenWithInfo, { baseUrl: customUrl })
|
|
645
|
+
).catch((ex: unknown) => {
|
|
646
|
+
this._filterAccounts.delete(key);
|
|
647
|
+
throw ex;
|
|
648
|
+
});
|
|
649
|
+
this._filterAccounts.set(key, pending);
|
|
650
|
+
}
|
|
651
|
+
|
|
652
|
+
return pending;
|
|
653
|
+
}
|
|
654
|
+
|
|
286
655
|
async getMyIssuesForRepos(
|
|
287
656
|
reposOrRepoIds: ProviderReposInput,
|
|
288
|
-
options?: {
|
|
657
|
+
options?: {
|
|
658
|
+
filters?: IssueFilter[];
|
|
659
|
+
cursor?: string;
|
|
660
|
+
customUrl?: string;
|
|
661
|
+
page?: number;
|
|
662
|
+
pageSize?: number;
|
|
663
|
+
/** When true, don't constrain to the current user's assigned issues even if the Assignee filter is set. */
|
|
664
|
+
includeAllAssignees?: boolean;
|
|
665
|
+
/** Issue states to include; when omitted the provider returns its default (open only). */
|
|
666
|
+
state?: IssueStateFilter;
|
|
667
|
+
},
|
|
668
|
+
connectionId?: string,
|
|
289
669
|
): Promise<PagedResult<ProviderIssue> | undefined> {
|
|
670
|
+
return (await this.getMyIssuesForReposResult(reposOrRepoIds, options, connectionId))?.value;
|
|
671
|
+
}
|
|
672
|
+
|
|
673
|
+
/**
|
|
674
|
+
* Result-returning core of {@link getMyIssuesForRepos}. Resolves the session for `connectionId`
|
|
675
|
+
* (or the primary connection when omitted, so multi-account reads use the right token) and recovers
|
|
676
|
+
* thrown errors and validation failures into `{ error }` so callers can surface them as warnings
|
|
677
|
+
* rather than swallowing them to `undefined`.
|
|
678
|
+
*/
|
|
679
|
+
async getMyIssuesForReposResult(
|
|
680
|
+
reposOrRepoIds: ProviderReposInput,
|
|
681
|
+
options?: {
|
|
682
|
+
filters?: IssueFilter[];
|
|
683
|
+
cursor?: string;
|
|
684
|
+
customUrl?: string;
|
|
685
|
+
page?: number;
|
|
686
|
+
pageSize?: number;
|
|
687
|
+
includeAllAssignees?: boolean;
|
|
688
|
+
state?: IssueStateFilter;
|
|
689
|
+
},
|
|
690
|
+
connectionId?: string,
|
|
691
|
+
): Promise<IntegrationResult<(PagedResult<ProviderIssue> & { metadata?: CollectionMetadata }) | undefined>> {
|
|
290
692
|
const scope = getScopedLogger();
|
|
291
693
|
const providerId = this.authProvider.id;
|
|
292
|
-
const
|
|
293
|
-
|
|
694
|
+
const states = toProviderIssueStates(options?.state);
|
|
695
|
+
// `connectionId` targets a specific account (multi-account); omitted reads the primary. The session
|
|
696
|
+
// is resolved here for connectivity/bail; the connection's token is applied per API call below.
|
|
697
|
+
const session = await this.resolveReadSession(connectionId, scope);
|
|
698
|
+
if (session == null) return undefined;
|
|
294
699
|
|
|
295
|
-
|
|
700
|
+
const start = performance.now();
|
|
701
|
+
const customUrl =
|
|
702
|
+
options?.customUrl ?? getSelfManagedApiBaseUrl(providerId, session.domain || this.domain, session.protocol);
|
|
296
703
|
|
|
297
704
|
const api = await this.getProvidersApi();
|
|
298
705
|
if (
|
|
299
706
|
providerId !== GitCloudHostIntegrationId.GitLab &&
|
|
300
707
|
(api.isRepoIdsInput(reposOrRepoIds) ||
|
|
301
|
-
(providerId
|
|
708
|
+
(isAzureDevOpsProvider(providerId) &&
|
|
302
709
|
!reposOrRepoIds.every(repo => repo.project != null && repo.namespace != null)))
|
|
303
710
|
) {
|
|
304
|
-
|
|
305
|
-
return undefined;
|
|
711
|
+
return unsupportedRead(`Unsupported input for provider ${providerId}`, start, 'getIssuesForRepos');
|
|
306
712
|
}
|
|
307
713
|
|
|
308
714
|
let getIssuesOptions: GetIssuesOptions | undefined;
|
|
309
|
-
if (providerId
|
|
715
|
+
if (isAzureDevOpsProvider(providerId)) {
|
|
310
716
|
const organizations = new Set<string>();
|
|
311
717
|
const projects = new Set<string>();
|
|
312
718
|
for (const repo of reposOrRepoIds as ProviderRepoInput[]) {
|
|
@@ -315,49 +721,59 @@ export abstract class GitHostIntegration<
|
|
|
315
721
|
}
|
|
316
722
|
|
|
317
723
|
if (organizations.size > 1) {
|
|
318
|
-
|
|
319
|
-
|
|
724
|
+
return unsupportedRead(
|
|
725
|
+
`Multiple organizations not supported for provider ${providerId}`,
|
|
726
|
+
start,
|
|
727
|
+
'getIssuesForRepos',
|
|
728
|
+
);
|
|
320
729
|
} else if (organizations.size === 0) {
|
|
321
|
-
|
|
322
|
-
return undefined;
|
|
730
|
+
return unsupportedRead(`No organizations found for provider ${providerId}`, start, 'getIssuesForRepos');
|
|
323
731
|
}
|
|
324
732
|
|
|
325
733
|
const organization: string = first(organizations.values())!;
|
|
326
734
|
|
|
327
735
|
if (options?.filters != null) {
|
|
328
736
|
if (!api.providerSupportsIssueFilters(providerId, options.filters)) {
|
|
329
|
-
|
|
330
|
-
|
|
737
|
+
return unsupportedRead(
|
|
738
|
+
`Unsupported filters for provider ${providerId}`,
|
|
739
|
+
start,
|
|
740
|
+
'getIssuesForRepos',
|
|
741
|
+
);
|
|
331
742
|
}
|
|
332
743
|
|
|
333
744
|
let userAccount: ProviderAccount | undefined;
|
|
334
745
|
try {
|
|
335
|
-
userAccount = await
|
|
746
|
+
userAccount = await this.getFilterAccount(api, session, customUrl, organization);
|
|
336
747
|
} catch (ex) {
|
|
337
748
|
Logger.error(ex, 'getIssuesForRepos');
|
|
338
|
-
return
|
|
749
|
+
return { error: toError(ex), duration: performance.now() - start };
|
|
339
750
|
}
|
|
340
751
|
|
|
341
752
|
if (userAccount == null) {
|
|
342
|
-
|
|
343
|
-
return undefined;
|
|
753
|
+
return unsupportedRead(`Unable to get current user for ${providerId}`, start, 'getIssuesForRepos');
|
|
344
754
|
}
|
|
345
755
|
|
|
346
756
|
const userFilterProperty = userAccount.name;
|
|
347
757
|
|
|
348
758
|
if (userFilterProperty == null) {
|
|
349
|
-
|
|
350
|
-
|
|
759
|
+
return unsupportedRead(
|
|
760
|
+
`Unable to get user property for filter for ${providerId}`,
|
|
761
|
+
start,
|
|
762
|
+
'getIssuesForRepos',
|
|
763
|
+
);
|
|
351
764
|
}
|
|
352
765
|
|
|
353
766
|
getIssuesOptions = {
|
|
354
767
|
authorLogin: options.filters.includes(IssueFilter.Author) ? userFilterProperty : undefined,
|
|
355
|
-
assigneeLogins:
|
|
768
|
+
assigneeLogins:
|
|
769
|
+
!options.includeAllAssignees && options.filters.includes(IssueFilter.Assignee)
|
|
770
|
+
? [userFilterProperty]
|
|
771
|
+
: undefined,
|
|
356
772
|
mentionLogin: options.filters.includes(IssueFilter.Mention) ? userFilterProperty : undefined,
|
|
357
773
|
};
|
|
358
774
|
}
|
|
359
775
|
|
|
360
|
-
const cursorInfo =
|
|
776
|
+
const cursorInfo = this.parseCursorInfo<PagedProjectInput>(options?.cursor);
|
|
361
777
|
const cursors: PagedProjectInput[] = cursorInfo.cursors ?? [];
|
|
362
778
|
let projectInputs: PagedProjectInput[] = Array.from(projects.values(), project => ({
|
|
363
779
|
namespace: organization,
|
|
@@ -369,73 +785,136 @@ export abstract class GitHostIntegration<
|
|
|
369
785
|
}
|
|
370
786
|
|
|
371
787
|
try {
|
|
372
|
-
const cursor: { cursors: PagedProjectInput[] } = { cursors: [] };
|
|
788
|
+
const cursor: { cursors: PagedProjectInput[]; page?: number } = { cursors: [] };
|
|
373
789
|
let hasMore = false;
|
|
790
|
+
let truncated = false;
|
|
791
|
+
let metadata: CollectionMetadata | undefined;
|
|
374
792
|
const data: ProviderIssue[] = [];
|
|
375
|
-
|
|
793
|
+
// `allSettled`, not `Promise.all`: one project's read rejecting must not discard every sibling
|
|
794
|
+
// project's already-fetched issues and cursors. A rejected project is recorded as a structured
|
|
795
|
+
// failure so the facade can warn and set `fetchFailed` instead of reporting a partial project set
|
|
796
|
+
// as complete.
|
|
797
|
+
const settled = await Promise.allSettled(
|
|
376
798
|
projectInputs.map(async projectInput => {
|
|
377
799
|
const results = await api.getIssuesForAzureProject(
|
|
378
|
-
|
|
800
|
+
toTokenWithInfo(providerId, session),
|
|
379
801
|
projectInput.namespace,
|
|
380
802
|
projectInput.project,
|
|
381
803
|
{
|
|
382
804
|
...getIssuesOptions,
|
|
383
805
|
cursor: projectInput.cursor,
|
|
806
|
+
baseUrl: customUrl,
|
|
807
|
+
// Continuation is driven by the per-project cursor; only apply an explicit page on the
|
|
808
|
+
// first request so it can't clobber a continuation cursor on later pages.
|
|
809
|
+
page: projectInput.cursor == null ? options?.page : undefined,
|
|
810
|
+
pageSize: options?.pageSize,
|
|
811
|
+
states: states,
|
|
384
812
|
},
|
|
385
813
|
);
|
|
386
|
-
|
|
387
|
-
if (results.paging?.more) {
|
|
388
|
-
hasMore = true;
|
|
389
|
-
cursor.cursors.push({
|
|
390
|
-
namespace: projectInput.namespace,
|
|
391
|
-
project: projectInput.project,
|
|
392
|
-
cursor: results.paging.cursor,
|
|
393
|
-
});
|
|
394
|
-
}
|
|
814
|
+
return { projectInput: projectInput, results: results };
|
|
395
815
|
}),
|
|
396
816
|
);
|
|
397
817
|
|
|
818
|
+
for (let i = 0; i < settled.length; i++) {
|
|
819
|
+
const outcome = settled[i];
|
|
820
|
+
const projectInput = projectInputs[i];
|
|
821
|
+
if (outcome.status !== 'fulfilled') {
|
|
822
|
+
truncated = true;
|
|
823
|
+
const failure = toCollectionScopeFailure(
|
|
824
|
+
{
|
|
825
|
+
providerId: providerId,
|
|
826
|
+
resourceId: projectInput.namespace,
|
|
827
|
+
projectId: projectInput.project,
|
|
828
|
+
},
|
|
829
|
+
outcome.reason,
|
|
830
|
+
);
|
|
831
|
+
metadata = mergeCollectionMetadata(metadata, {
|
|
832
|
+
completeness: 'partial',
|
|
833
|
+
failures: [failure],
|
|
834
|
+
});
|
|
835
|
+
continue;
|
|
836
|
+
}
|
|
837
|
+
|
|
838
|
+
const { projectInput: _projectInput, results } = outcome.value;
|
|
839
|
+
data.push(...results.values);
|
|
840
|
+
if (results.paging?.more) {
|
|
841
|
+
hasMore = true;
|
|
842
|
+
cursor.cursors.push({
|
|
843
|
+
namespace: projectInput.namespace,
|
|
844
|
+
project: projectInput.project,
|
|
845
|
+
cursor: results.paging.cursor,
|
|
846
|
+
});
|
|
847
|
+
}
|
|
848
|
+
}
|
|
849
|
+
|
|
850
|
+
// Keep the requested page number in the composite cursor so the facade can report the real
|
|
851
|
+
// currentPage when the consumer continues using only the cursor.
|
|
852
|
+
if (options?.page != null) {
|
|
853
|
+
cursor.page = options.page;
|
|
854
|
+
}
|
|
855
|
+
|
|
398
856
|
return {
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
857
|
+
value: {
|
|
858
|
+
values: data,
|
|
859
|
+
paging: {
|
|
860
|
+
more: hasMore,
|
|
861
|
+
cursor: JSON.stringify(cursor),
|
|
862
|
+
truncated: truncated || undefined,
|
|
863
|
+
// Echo the requested numbered page so the facade reports the real currentPage for
|
|
864
|
+
// numbered-page hosts (GitLab/Bitbucket/Azure), not a synthesized 1. Cursor-only hosts
|
|
865
|
+
// leave `page` undefined via their own reads.
|
|
866
|
+
page: options?.page,
|
|
867
|
+
},
|
|
868
|
+
metadata: metadata,
|
|
403
869
|
},
|
|
870
|
+
duration: performance.now() - start,
|
|
404
871
|
};
|
|
405
872
|
} catch (ex) {
|
|
406
873
|
Logger.error(ex, 'getIssuesForRepos');
|
|
407
|
-
return
|
|
874
|
+
return { error: toError(ex), duration: performance.now() - start };
|
|
408
875
|
}
|
|
409
876
|
}
|
|
410
877
|
if (options?.filters != null) {
|
|
878
|
+
// Validate the requested filters against what this provider actually supports — same guard the Azure
|
|
879
|
+
// branch above applies. Without it an unsupported filter (e.g. GitLab has no Mention endpoint) would
|
|
880
|
+
// resolve to no filter property being set and silently degrade to an unfiltered, project-wide read.
|
|
881
|
+
if (!api.providerSupportsIssueFilters(providerId, options.filters)) {
|
|
882
|
+
return unsupportedRead(`Unsupported filters for provider ${providerId}`, start, 'getIssuesForRepos');
|
|
883
|
+
}
|
|
884
|
+
|
|
411
885
|
let userAccount: ProviderAccount | undefined;
|
|
412
886
|
try {
|
|
413
|
-
userAccount = await
|
|
887
|
+
userAccount = await this.getFilterAccount(api, session, customUrl);
|
|
414
888
|
} catch (ex) {
|
|
415
889
|
Logger.error(ex, 'getIssuesForRepos');
|
|
416
|
-
return
|
|
890
|
+
return { error: toError(ex), duration: performance.now() - start };
|
|
417
891
|
}
|
|
418
892
|
|
|
419
893
|
if (userAccount == null) {
|
|
420
|
-
|
|
421
|
-
return undefined;
|
|
894
|
+
return unsupportedRead(`Unable to get current user for ${providerId}`, start, 'getIssuesForRepos');
|
|
422
895
|
}
|
|
423
896
|
|
|
424
897
|
const userFilterProperty = userAccount.username;
|
|
425
898
|
if (userFilterProperty == null) {
|
|
426
|
-
|
|
427
|
-
|
|
899
|
+
return unsupportedRead(
|
|
900
|
+
`Unable to get user property for filter for ${providerId}`,
|
|
901
|
+
start,
|
|
902
|
+
'getIssuesForRepos',
|
|
903
|
+
);
|
|
428
904
|
}
|
|
429
905
|
|
|
430
906
|
getIssuesOptions = {
|
|
431
907
|
authorLogin: options.filters.includes(IssueFilter.Author) ? userFilterProperty : undefined,
|
|
432
|
-
assigneeLogins:
|
|
908
|
+
assigneeLogins:
|
|
909
|
+
!options.includeAllAssignees && options.filters.includes(IssueFilter.Assignee)
|
|
910
|
+
? [userFilterProperty]
|
|
911
|
+
: undefined,
|
|
433
912
|
mentionLogin: options.filters.includes(IssueFilter.Mention) ? userFilterProperty : undefined,
|
|
434
913
|
};
|
|
435
914
|
}
|
|
436
915
|
|
|
437
916
|
if (api.getProviderIssuesPagingMode(providerId) === PagingMode.Repo && !api.isRepoIdsInput(reposOrRepoIds)) {
|
|
438
|
-
const cursorInfo =
|
|
917
|
+
const cursorInfo = this.parseCursorInfo<PagedRepoInput>(options?.cursor);
|
|
439
918
|
const cursors: PagedRepoInput[] = cursorInfo.cursors ?? [];
|
|
440
919
|
let repoInputs: PagedRepoInput[] = reposOrRepoIds.map(repo => ({ repo: repo, cursor: undefined }));
|
|
441
920
|
if (cursors.length > 0) {
|
|
@@ -443,80 +922,205 @@ export abstract class GitHostIntegration<
|
|
|
443
922
|
}
|
|
444
923
|
|
|
445
924
|
try {
|
|
446
|
-
const cursor: { cursors: PagedRepoInput[] } = { cursors: [] };
|
|
925
|
+
const cursor: { cursors: PagedRepoInput[]; page?: number } = { cursors: [] };
|
|
447
926
|
let hasMore = false;
|
|
927
|
+
let truncated = false;
|
|
928
|
+
let metadata: CollectionMetadata | undefined;
|
|
448
929
|
const data: ProviderIssue[] = [];
|
|
449
|
-
|
|
930
|
+
// `allSettled`, not `Promise.all`: one repo's read rejecting must not discard every sibling repo's
|
|
931
|
+
// already-fetched issues and cursors. A rejected repo is recorded as a structured failure so the
|
|
932
|
+
// facade can warn and set `fetchFailed` instead of reporting a partial repo set as complete.
|
|
933
|
+
const settled = await Promise.allSettled(
|
|
450
934
|
repoInputs.map(async repoInput => {
|
|
451
|
-
const results = await api.getIssuesForRepo(
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
935
|
+
const results = await api.getIssuesForRepo(
|
|
936
|
+
toTokenWithInfo(providerId, session),
|
|
937
|
+
repoInput.repo,
|
|
938
|
+
{
|
|
939
|
+
...getIssuesOptions,
|
|
940
|
+
cursor: repoInput.cursor,
|
|
941
|
+
baseUrl: customUrl,
|
|
942
|
+
// Continuation is driven by the per-repo cursor; only apply an explicit page on the
|
|
943
|
+
// first request so it can't clobber a continuation cursor on later pages.
|
|
944
|
+
page: repoInput.cursor == null ? options?.page : undefined,
|
|
945
|
+
pageSize: options?.pageSize,
|
|
946
|
+
states: states,
|
|
947
|
+
},
|
|
948
|
+
);
|
|
949
|
+
return { repoInput: repoInput, results: results };
|
|
461
950
|
}),
|
|
462
951
|
);
|
|
463
952
|
|
|
953
|
+
for (let i = 0; i < settled.length; i++) {
|
|
954
|
+
const outcome = settled[i];
|
|
955
|
+
const repoInput = repoInputs[i];
|
|
956
|
+
if (outcome.status !== 'fulfilled') {
|
|
957
|
+
truncated = true;
|
|
958
|
+
const failure = toCollectionScopeFailure(
|
|
959
|
+
{
|
|
960
|
+
providerId: providerId,
|
|
961
|
+
repositoryId: `${repoInput.repo.namespace}/${repoInput.repo.name}`,
|
|
962
|
+
},
|
|
963
|
+
outcome.reason,
|
|
964
|
+
);
|
|
965
|
+
metadata = mergeCollectionMetadata(metadata, {
|
|
966
|
+
completeness: 'partial',
|
|
967
|
+
failures: [failure],
|
|
968
|
+
});
|
|
969
|
+
continue;
|
|
970
|
+
}
|
|
971
|
+
|
|
972
|
+
const { repoInput: _repoInput, results } = outcome.value;
|
|
973
|
+
data.push(...results.values);
|
|
974
|
+
if (results.paging?.more) {
|
|
975
|
+
hasMore = true;
|
|
976
|
+
cursor.cursors.push({ repo: repoInput.repo, cursor: results.paging.cursor });
|
|
977
|
+
}
|
|
978
|
+
}
|
|
979
|
+
|
|
980
|
+
if (options?.page != null) {
|
|
981
|
+
cursor.page = options.page;
|
|
982
|
+
}
|
|
983
|
+
|
|
464
984
|
return {
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
985
|
+
value: {
|
|
986
|
+
values: data,
|
|
987
|
+
paging: {
|
|
988
|
+
more: hasMore,
|
|
989
|
+
cursor: JSON.stringify(cursor),
|
|
990
|
+
truncated: truncated || undefined,
|
|
991
|
+
// Echo the requested numbered page so the facade reports the real currentPage for
|
|
992
|
+
// numbered-page hosts (GitLab/Bitbucket/Azure), not a synthesized 1. Cursor-only hosts
|
|
993
|
+
// leave `page` undefined via their own reads.
|
|
994
|
+
page: options?.page,
|
|
995
|
+
},
|
|
996
|
+
metadata: metadata,
|
|
469
997
|
},
|
|
998
|
+
duration: performance.now() - start,
|
|
470
999
|
};
|
|
471
1000
|
} catch (ex) {
|
|
472
1001
|
Logger.error(ex, 'getIssuesForRepos');
|
|
473
|
-
return
|
|
1002
|
+
return { error: toError(ex), duration: performance.now() - start };
|
|
474
1003
|
}
|
|
475
1004
|
}
|
|
476
1005
|
|
|
477
1006
|
try {
|
|
478
|
-
|
|
1007
|
+
const result = await api.getIssuesForRepos(toTokenWithInfo(providerId, session), reposOrRepoIds, {
|
|
479
1008
|
...getIssuesOptions,
|
|
480
1009
|
cursor: options?.cursor,
|
|
481
|
-
baseUrl:
|
|
1010
|
+
baseUrl: customUrl,
|
|
1011
|
+
page: options?.page,
|
|
1012
|
+
pageSize: options?.pageSize,
|
|
1013
|
+
states: states,
|
|
482
1014
|
});
|
|
1015
|
+
return { value: result, duration: performance.now() - start };
|
|
483
1016
|
} catch (ex) {
|
|
484
1017
|
Logger.error(ex, 'getIssuesForRepos');
|
|
485
|
-
return
|
|
1018
|
+
return { error: toError(ex), duration: performance.now() - start };
|
|
486
1019
|
}
|
|
487
1020
|
}
|
|
488
1021
|
|
|
1022
|
+
/**
|
|
1023
|
+
* Repo-scoped "my issues" read returning the normalized {@link IssueShape} the ProviderBackend facade
|
|
1024
|
+
* consumes (`listIssuesPage({ repos })`, `broadenIssues`). Maps {@link getMyIssuesForReposResult} — the raw
|
|
1025
|
+
* provider-apis path — to IssueShape.
|
|
1026
|
+
*
|
|
1027
|
+
* It's the seam rather than an inline map so a provider whose only issue client already yields normalized
|
|
1028
|
+
* shapes, and isn't wired into the raw path, can override it and serve these reads without a
|
|
1029
|
+
* `ProviderIssue` round-trip. No provider does today: the one candidate (Bitbucket Cloud's legacy
|
|
1030
|
+
* `getUsersIssuesForRepo`) reports `supportsIssues: false`, so the facade never reaches this for it.
|
|
1031
|
+
*/
|
|
1032
|
+
async getMyIssuesForReposAsShapesResult(
|
|
1033
|
+
reposOrRepoIds: ProviderReposInput,
|
|
1034
|
+
options?: {
|
|
1035
|
+
filters?: IssueFilter[];
|
|
1036
|
+
cursor?: string;
|
|
1037
|
+
customUrl?: string;
|
|
1038
|
+
page?: number;
|
|
1039
|
+
pageSize?: number;
|
|
1040
|
+
includeAllAssignees?: boolean;
|
|
1041
|
+
state?: IssueStateFilter;
|
|
1042
|
+
},
|
|
1043
|
+
connectionId?: string,
|
|
1044
|
+
): Promise<IntegrationResult<(PagedResult<IssueShape> & { metadata?: CollectionMetadata }) | undefined>> {
|
|
1045
|
+
const result = await this.getMyIssuesForReposResult(reposOrRepoIds, options, connectionId);
|
|
1046
|
+
if (result == null) return undefined;
|
|
1047
|
+
if (result.error != null) return { error: result.error, duration: result.duration };
|
|
1048
|
+
if (result.value == null) return { value: undefined, duration: result.duration };
|
|
1049
|
+
|
|
1050
|
+
const values = result.value.values
|
|
1051
|
+
.map(issue => toIssueShape(issue, this))
|
|
1052
|
+
.filter((issue): issue is IssueShape => issue != null);
|
|
1053
|
+
return { value: { ...result.value, values: values }, duration: result.duration };
|
|
1054
|
+
}
|
|
1055
|
+
|
|
489
1056
|
async getMyPullRequestsForRepos(
|
|
490
1057
|
reposOrRepoIds: ProviderReposInput,
|
|
491
|
-
options?: {
|
|
492
|
-
|
|
1058
|
+
options?: {
|
|
1059
|
+
filters?: PullRequestFilter[];
|
|
1060
|
+
cursor?: string;
|
|
1061
|
+
customUrl?: string;
|
|
1062
|
+
page?: number;
|
|
1063
|
+
pageSize?: number;
|
|
1064
|
+
/** PR states to include; when omitted the provider returns its default (open only). */
|
|
1065
|
+
state?: PullRequestStateFilter | PullRequestStateFilter[];
|
|
1066
|
+
},
|
|
1067
|
+
connectionId?: string,
|
|
1068
|
+
): Promise<ProviderApiPagedResult<ProviderPullRequest> | undefined> {
|
|
1069
|
+
return (await this.getMyPullRequestsForReposResult(reposOrRepoIds, options, connectionId))?.value;
|
|
1070
|
+
}
|
|
1071
|
+
|
|
1072
|
+
/**
|
|
1073
|
+
* Result-returning core of {@link getMyPullRequestsForRepos}. Resolves the session for `connectionId`
|
|
1074
|
+
* (or the primary connection when omitted, so multi-account reads use the right token) and recovers
|
|
1075
|
+
* thrown errors and validation failures into `{ error }` so callers can surface them as warnings
|
|
1076
|
+
* rather than swallowing them to `undefined`.
|
|
1077
|
+
*/
|
|
1078
|
+
async getMyPullRequestsForReposResult(
|
|
1079
|
+
reposOrRepoIds: ProviderReposInput,
|
|
1080
|
+
options?: {
|
|
1081
|
+
filters?: PullRequestFilter[];
|
|
1082
|
+
cursor?: string;
|
|
1083
|
+
customUrl?: string;
|
|
1084
|
+
page?: number;
|
|
1085
|
+
pageSize?: number;
|
|
1086
|
+
state?: PullRequestStateFilter | PullRequestStateFilter[];
|
|
1087
|
+
},
|
|
1088
|
+
connectionId?: string,
|
|
1089
|
+
): Promise<IntegrationResult<ProviderApiPagedResult<ProviderPullRequest> | undefined>> {
|
|
493
1090
|
const scope = getScopedLogger();
|
|
494
1091
|
const providerId = this.authProvider.id;
|
|
495
|
-
const
|
|
496
|
-
|
|
1092
|
+
const states = toProviderPullRequestStates(options?.state);
|
|
1093
|
+
// `connectionId` targets a specific account (multi-account); omitted reads the primary. The session
|
|
1094
|
+
// is resolved here for connectivity/bail; the connection's token is applied per API call below.
|
|
1095
|
+
const session = await this.resolveReadSession(connectionId, scope);
|
|
1096
|
+
if (session == null) return undefined;
|
|
497
1097
|
|
|
498
|
-
|
|
1098
|
+
const start = performance.now();
|
|
1099
|
+
const customUrl =
|
|
1100
|
+
options?.customUrl ?? getSelfManagedApiBaseUrl(providerId, session.domain || this.domain, session.protocol);
|
|
499
1101
|
|
|
500
1102
|
const api = await this.getProvidersApi();
|
|
501
1103
|
if (
|
|
502
1104
|
providerId !== GitCloudHostIntegrationId.GitLab &&
|
|
503
1105
|
(api.isRepoIdsInput(reposOrRepoIds) ||
|
|
504
|
-
(providerId
|
|
1106
|
+
(isAzureDevOpsProvider(providerId) &&
|
|
505
1107
|
!reposOrRepoIds.every(repo => repo.project != null && repo.namespace != null)))
|
|
506
1108
|
) {
|
|
507
|
-
|
|
508
|
-
return undefined;
|
|
1109
|
+
return unsupportedRead(`Unsupported input for provider ${providerId}`, start);
|
|
509
1110
|
}
|
|
510
1111
|
|
|
511
1112
|
let getPullRequestsOptions: GetPullRequestsOptions | undefined;
|
|
512
1113
|
if (options?.filters != null) {
|
|
513
1114
|
if (!api.providerSupportsPullRequestFilters(providerId, options.filters)) {
|
|
514
|
-
|
|
515
|
-
|
|
1115
|
+
return unsupportedRead(
|
|
1116
|
+
`Unsupported filters for provider ${providerId}`,
|
|
1117
|
+
start,
|
|
1118
|
+
'getPullRequestsForRepos',
|
|
1119
|
+
);
|
|
516
1120
|
}
|
|
517
1121
|
|
|
518
1122
|
let userAccount: ProviderAccount | undefined;
|
|
519
|
-
if (providerId
|
|
1123
|
+
if (isAzureDevOpsProvider(providerId)) {
|
|
520
1124
|
const organizations = new Set<string>();
|
|
521
1125
|
for (const repo of reposOrRepoIds as ProviderRepoInput[]) {
|
|
522
1126
|
organizations.add(repo.namespace);
|
|
@@ -527,37 +1131,47 @@ export abstract class GitHostIntegration<
|
|
|
527
1131
|
`Multiple organizations not supported for provider ${providerId}`,
|
|
528
1132
|
'getPullRequestsForRepos',
|
|
529
1133
|
);
|
|
530
|
-
return
|
|
1134
|
+
return {
|
|
1135
|
+
error: new Error(`Multiple organizations not supported for provider ${providerId}`),
|
|
1136
|
+
duration: performance.now() - start,
|
|
1137
|
+
};
|
|
531
1138
|
} else if (organizations.size === 0) {
|
|
532
|
-
|
|
533
|
-
|
|
1139
|
+
return unsupportedRead(
|
|
1140
|
+
`No organizations found for provider ${providerId}`,
|
|
1141
|
+
start,
|
|
1142
|
+
'getPullRequestsForRepos',
|
|
1143
|
+
);
|
|
534
1144
|
}
|
|
535
1145
|
|
|
536
1146
|
const organization: string = first(organizations.values())!;
|
|
537
1147
|
try {
|
|
538
|
-
userAccount = await
|
|
1148
|
+
userAccount = await this.getFilterAccount(api, session, customUrl, organization);
|
|
539
1149
|
} catch (ex) {
|
|
540
1150
|
Logger.error(ex, 'getPullRequestsForRepos');
|
|
541
|
-
return
|
|
1151
|
+
return { error: toError(ex), duration: performance.now() - start };
|
|
542
1152
|
}
|
|
543
1153
|
} else {
|
|
544
1154
|
try {
|
|
545
|
-
userAccount = await
|
|
1155
|
+
userAccount = await this.getFilterAccount(api, session, customUrl);
|
|
546
1156
|
} catch (ex) {
|
|
547
1157
|
Logger.error(ex, 'getPullRequestsForRepos');
|
|
548
|
-
return
|
|
1158
|
+
return { error: toError(ex), duration: performance.now() - start };
|
|
549
1159
|
}
|
|
550
1160
|
}
|
|
551
1161
|
|
|
552
1162
|
if (userAccount == null) {
|
|
553
|
-
|
|
554
|
-
|
|
1163
|
+
return unsupportedRead(
|
|
1164
|
+
`Unable to get current user for ${providerId}`,
|
|
1165
|
+
start,
|
|
1166
|
+
'getPullRequestsForRepos',
|
|
1167
|
+
);
|
|
555
1168
|
}
|
|
556
1169
|
|
|
557
1170
|
let userFilterProperty: string | null;
|
|
558
1171
|
switch (providerId) {
|
|
559
1172
|
case GitCloudHostIntegrationId.Bitbucket:
|
|
560
1173
|
case GitCloudHostIntegrationId.AzureDevOps:
|
|
1174
|
+
case GitSelfManagedHostIntegrationId.AzureDevOpsServer:
|
|
561
1175
|
userFilterProperty = userAccount.id;
|
|
562
1176
|
break;
|
|
563
1177
|
default:
|
|
@@ -566,16 +1180,42 @@ export abstract class GitHostIntegration<
|
|
|
566
1180
|
}
|
|
567
1181
|
|
|
568
1182
|
if (userFilterProperty == null) {
|
|
569
|
-
|
|
570
|
-
|
|
1183
|
+
return unsupportedRead(
|
|
1184
|
+
`Unable to get user property for filter for ${providerId}`,
|
|
1185
|
+
start,
|
|
1186
|
+
'getPullRequestsForRepos',
|
|
1187
|
+
);
|
|
1188
|
+
}
|
|
1189
|
+
|
|
1190
|
+
// Route the "review requested from me" filter to the field each provider actually reads:
|
|
1191
|
+
// GitHub/GitLab expect a login (reviewRequestedLogin), Bitbucket/Azure an account id (reviewerId),
|
|
1192
|
+
// and Bitbucket Server a login (reviewerLogin). `userFilterProperty` is already the account id for
|
|
1193
|
+
// Bitbucket/Azure and the username for the rest.
|
|
1194
|
+
let reviewRequestedLogin: string | undefined;
|
|
1195
|
+
let reviewerId: string | undefined;
|
|
1196
|
+
let reviewerLogin: string | undefined;
|
|
1197
|
+
if (options.filters.includes(PullRequestFilter.ReviewRequested)) {
|
|
1198
|
+
switch (providerId) {
|
|
1199
|
+
case GitCloudHostIntegrationId.Bitbucket:
|
|
1200
|
+
case GitCloudHostIntegrationId.AzureDevOps:
|
|
1201
|
+
case GitSelfManagedHostIntegrationId.AzureDevOpsServer:
|
|
1202
|
+
reviewerId = userFilterProperty;
|
|
1203
|
+
break;
|
|
1204
|
+
case GitSelfManagedHostIntegrationId.BitbucketServer:
|
|
1205
|
+
reviewerLogin = userFilterProperty;
|
|
1206
|
+
break;
|
|
1207
|
+
default:
|
|
1208
|
+
reviewRequestedLogin = userFilterProperty;
|
|
1209
|
+
break;
|
|
1210
|
+
}
|
|
571
1211
|
}
|
|
572
1212
|
|
|
573
1213
|
getPullRequestsOptions = {
|
|
574
1214
|
authorLogin: options.filters.includes(PullRequestFilter.Author) ? userFilterProperty : undefined,
|
|
575
1215
|
assigneeLogins: options.filters.includes(PullRequestFilter.Assignee) ? [userFilterProperty] : undefined,
|
|
576
|
-
reviewRequestedLogin:
|
|
577
|
-
|
|
578
|
-
|
|
1216
|
+
reviewRequestedLogin: reviewRequestedLogin,
|
|
1217
|
+
reviewerId: reviewerId,
|
|
1218
|
+
reviewerLogin: reviewerLogin,
|
|
579
1219
|
mentionLogin: options.filters.includes(PullRequestFilter.Mention) ? userFilterProperty : undefined,
|
|
580
1220
|
};
|
|
581
1221
|
}
|
|
@@ -584,7 +1224,7 @@ export abstract class GitHostIntegration<
|
|
|
584
1224
|
api.getProviderPullRequestsPagingMode(providerId) === PagingMode.Repo &&
|
|
585
1225
|
!api.isRepoIdsInput(reposOrRepoIds)
|
|
586
1226
|
) {
|
|
587
|
-
const cursorInfo =
|
|
1227
|
+
const cursorInfo = this.parseCursorInfo<PagedRepoInput>(options?.cursor);
|
|
588
1228
|
const cursors: PagedRepoInput[] = cursorInfo.cursors ?? [];
|
|
589
1229
|
let repoInputs: PagedRepoInput[] = reposOrRepoIds.map(repo => ({ repo: repo, cursor: undefined }));
|
|
590
1230
|
if (cursors.length > 0) {
|
|
@@ -592,46 +1232,114 @@ export abstract class GitHostIntegration<
|
|
|
592
1232
|
}
|
|
593
1233
|
|
|
594
1234
|
try {
|
|
595
|
-
const cursor: { cursors: PagedRepoInput[] } = { cursors: [] };
|
|
1235
|
+
const cursor: { cursors: PagedRepoInput[]; page?: number } = { cursors: [] };
|
|
596
1236
|
let hasMore = false;
|
|
1237
|
+
let truncated = false;
|
|
1238
|
+
let metadata: CollectionMetadata | undefined;
|
|
1239
|
+
const failures: CollectionScopeFailure[] = [];
|
|
597
1240
|
const data: ProviderPullRequest[] = [];
|
|
598
|
-
|
|
1241
|
+
// `allSettled`, not `Promise.all`: one repo's read rejecting must not discard every sibling repo's
|
|
1242
|
+
// already-fetched PRs and cursors. A rejected repo becomes a structured `CollectionScopeFailure`
|
|
1243
|
+
// (attributed to that repo) so the facade warns on it + sets `fetchFailed`, while the survivors and
|
|
1244
|
+
// their continuation cursors are still returned.
|
|
1245
|
+
const settled = await Promise.allSettled(
|
|
599
1246
|
repoInputs.map(async repoInput => {
|
|
600
|
-
const results = await api.getPullRequestsForRepo(
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
1247
|
+
const results = await api.getPullRequestsForRepo(
|
|
1248
|
+
toTokenWithInfo(providerId, session),
|
|
1249
|
+
repoInput.repo,
|
|
1250
|
+
{
|
|
1251
|
+
...getPullRequestsOptions,
|
|
1252
|
+
cursor: repoInput.cursor,
|
|
1253
|
+
baseUrl: customUrl,
|
|
1254
|
+
// Continuation is driven by the per-repo cursor; only apply an explicit page on the
|
|
1255
|
+
// first request so it can't clobber a continuation cursor on later pages.
|
|
1256
|
+
page: repoInput.cursor == null ? options?.page : undefined,
|
|
1257
|
+
pageSize: options?.pageSize,
|
|
1258
|
+
states: states,
|
|
1259
|
+
// Azure DevOps only populates clone URLs on request (extra call); no-op elsewhere.
|
|
1260
|
+
includeRemoteInfo: isAzureDevOpsProvider(providerId) ? true : undefined,
|
|
1261
|
+
},
|
|
1262
|
+
);
|
|
1263
|
+
return { repoInput: repoInput, results: results };
|
|
610
1264
|
}),
|
|
611
1265
|
);
|
|
612
1266
|
|
|
1267
|
+
// `allSettled` preserves order, so `settled[i]` is `repoInputs[i]`.
|
|
1268
|
+
settled.forEach((outcome, i) => {
|
|
1269
|
+
if (outcome.status !== 'fulfilled') {
|
|
1270
|
+
const failedRepo = repoInputs[i].repo;
|
|
1271
|
+
failures.push(
|
|
1272
|
+
toCollectionScopeFailure(
|
|
1273
|
+
{ providerId: providerId, repositoryId: `${failedRepo.namespace}/${failedRepo.name}` },
|
|
1274
|
+
outcome.reason,
|
|
1275
|
+
),
|
|
1276
|
+
);
|
|
1277
|
+
return;
|
|
1278
|
+
}
|
|
1279
|
+
|
|
1280
|
+
const { repoInput, results } = outcome.value;
|
|
1281
|
+
data.push(...results.values);
|
|
1282
|
+
// Fan-out across repos: preserve each repo's SDK completeness/failures and its terminal
|
|
1283
|
+
// truncation so a single failed/incomplete repo isn't lost when merged with its siblings.
|
|
1284
|
+
metadata = mergeCollectionMetadata(metadata, results.metadata);
|
|
1285
|
+
if (results.paging?.truncated) {
|
|
1286
|
+
truncated = true;
|
|
1287
|
+
}
|
|
1288
|
+
if (results.paging?.more) {
|
|
1289
|
+
hasMore = true;
|
|
1290
|
+
cursor.cursors.push({ repo: repoInput.repo, cursor: results.paging.cursor });
|
|
1291
|
+
}
|
|
1292
|
+
});
|
|
1293
|
+
|
|
1294
|
+
// Merge the GitLens-side per-repo rejections into the SDK metadata so both flow through the same
|
|
1295
|
+
// warning/fetchFailed assessment downstream.
|
|
1296
|
+
if (failures.length > 0) {
|
|
1297
|
+
metadata = mergeCollectionMetadata(metadata, { completeness: 'partial', failures: failures });
|
|
1298
|
+
}
|
|
1299
|
+
|
|
1300
|
+
// Keep the requested page number in the composite cursor so the facade can report the real
|
|
1301
|
+
// currentPage when the consumer continues using only the cursor.
|
|
1302
|
+
if (options?.page != null) {
|
|
1303
|
+
cursor.page = options.page;
|
|
1304
|
+
}
|
|
1305
|
+
|
|
613
1306
|
return {
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
1307
|
+
value: {
|
|
1308
|
+
values: data,
|
|
1309
|
+
paging: {
|
|
1310
|
+
more: hasMore,
|
|
1311
|
+
cursor: JSON.stringify(cursor),
|
|
1312
|
+
truncated: truncated || undefined,
|
|
1313
|
+
// Echo the requested numbered page so the facade reports the real currentPage for
|
|
1314
|
+
// numbered-page hosts (GitLab/Bitbucket/Azure), not a synthesized 1. Cursor-only hosts
|
|
1315
|
+
// leave `page` undefined via their own reads.
|
|
1316
|
+
page: options?.page,
|
|
1317
|
+
},
|
|
1318
|
+
metadata: metadata,
|
|
618
1319
|
},
|
|
1320
|
+
duration: performance.now() - start,
|
|
619
1321
|
};
|
|
620
1322
|
} catch (ex) {
|
|
621
1323
|
Logger.error(ex, 'getPullRequestsForRepos');
|
|
622
|
-
return
|
|
1324
|
+
return { error: toError(ex), duration: performance.now() - start };
|
|
623
1325
|
}
|
|
624
1326
|
}
|
|
625
1327
|
|
|
626
1328
|
try {
|
|
627
|
-
|
|
1329
|
+
const result = await api.getPullRequestsForRepos(toTokenWithInfo(providerId, session), reposOrRepoIds, {
|
|
628
1330
|
...getPullRequestsOptions,
|
|
629
1331
|
cursor: options?.cursor,
|
|
630
|
-
baseUrl:
|
|
1332
|
+
baseUrl: customUrl,
|
|
1333
|
+
page: options?.page,
|
|
1334
|
+
pageSize: options?.pageSize,
|
|
1335
|
+
states: states,
|
|
1336
|
+
// Azure DevOps only populates clone URLs on request (extra call); no-op elsewhere.
|
|
1337
|
+
includeRemoteInfo: isAzureDevOpsProvider(providerId) ? true : undefined,
|
|
631
1338
|
});
|
|
1339
|
+
return { value: result, duration: performance.now() - start };
|
|
632
1340
|
} catch (ex) {
|
|
633
1341
|
Logger.error(ex, 'getPullRequestsForRepos');
|
|
634
|
-
return
|
|
1342
|
+
return { error: toError(ex), duration: performance.now() - start };
|
|
635
1343
|
}
|
|
636
1344
|
}
|
|
637
1345
|
|
|
@@ -639,81 +1347,243 @@ export abstract class GitHostIntegration<
|
|
|
639
1347
|
repo?: T,
|
|
640
1348
|
cancellation?: AbortSignal,
|
|
641
1349
|
silent?: boolean,
|
|
1350
|
+
connectionId?: string,
|
|
1351
|
+
state?: PullRequestStateFilter,
|
|
1352
|
+
options?: SearchMyPullRequestsOptions,
|
|
642
1353
|
): Promise<IntegrationResult<PullRequest[] | undefined>>;
|
|
643
1354
|
async searchMyPullRequests(
|
|
644
1355
|
repos?: T[],
|
|
645
1356
|
cancellation?: AbortSignal,
|
|
646
1357
|
silent?: boolean,
|
|
1358
|
+
connectionId?: string,
|
|
1359
|
+
state?: PullRequestStateFilter,
|
|
1360
|
+
options?: SearchMyPullRequestsOptions,
|
|
647
1361
|
): Promise<IntegrationResult<PullRequest[] | undefined>>;
|
|
648
1362
|
@trace()
|
|
649
1363
|
async searchMyPullRequests(
|
|
650
1364
|
repos?: T | T[],
|
|
651
1365
|
cancellation?: AbortSignal,
|
|
652
1366
|
silent?: boolean,
|
|
1367
|
+
connectionId?: string,
|
|
1368
|
+
state?: PullRequestStateFilter,
|
|
1369
|
+
options?: SearchMyPullRequestsOptions,
|
|
653
1370
|
): Promise<IntegrationResult<PullRequest[] | undefined>> {
|
|
654
1371
|
const scope = getScopedLogger();
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
await this.refreshSessionIfExpired(scope);
|
|
1372
|
+
// `connectionId` targets a specific account (multi-account); omitted reads the primary.
|
|
1373
|
+
const session = await this.resolveReadSession(connectionId, scope);
|
|
1374
|
+
if (session == null) return undefined;
|
|
659
1375
|
|
|
660
1376
|
const start = performance.now();
|
|
661
1377
|
try {
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
1378
|
+
// Prefer the optional metadata-aware path for account-wide reads so partial failures (e.g. one Azure
|
|
1379
|
+
// org rejecting) are surfaced as a soft `{ value, error }` instead of being lost. Repo-scoped reads and
|
|
1380
|
+
// providers without that override keep using the legacy array path.
|
|
1381
|
+
let result: IntegrationResult<PullRequest[] | undefined>;
|
|
1382
|
+
if (this.searchProviderMyPullRequestsResult != null && repos == null) {
|
|
1383
|
+
result = await this.searchProviderMyPullRequestsResult(
|
|
1384
|
+
session,
|
|
1385
|
+
repos != null ? (Array.isArray(repos) ? repos : [repos]) : undefined,
|
|
1386
|
+
cancellation,
|
|
1387
|
+
silent,
|
|
1388
|
+
state,
|
|
1389
|
+
options,
|
|
1390
|
+
);
|
|
1391
|
+
} else {
|
|
1392
|
+
result = {
|
|
1393
|
+
value: await this.searchProviderMyPullRequests(
|
|
1394
|
+
session,
|
|
1395
|
+
repos != null ? (Array.isArray(repos) ? repos : [repos]) : undefined,
|
|
1396
|
+
cancellation,
|
|
1397
|
+
silent,
|
|
1398
|
+
state,
|
|
1399
|
+
options,
|
|
1400
|
+
),
|
|
1401
|
+
};
|
|
1402
|
+
}
|
|
668
1403
|
this.resetRequestExceptionCount('searchMyPullRequests');
|
|
669
|
-
|
|
1404
|
+
// `IntegrationResult` is a strict union of value-only or error-only (and may be `undefined`). Return the
|
|
1405
|
+
// matching branch explicitly; a missing result is treated as a successful empty read.
|
|
1406
|
+
if (result == null) {
|
|
1407
|
+
return { value: undefined, duration: performance.now() - start };
|
|
1408
|
+
}
|
|
1409
|
+
if (result.error != null) {
|
|
1410
|
+
return { error: result.error, duration: performance.now() - start };
|
|
1411
|
+
}
|
|
1412
|
+
return { value: result.value, duration: performance.now() - start };
|
|
670
1413
|
} catch (ex) {
|
|
671
1414
|
this.handleProviderException('searchMyPullRequests', ex, {
|
|
672
1415
|
scope: scope,
|
|
673
1416
|
silent: true,
|
|
674
1417
|
});
|
|
675
1418
|
return {
|
|
676
|
-
error: ex,
|
|
1419
|
+
error: toError(ex),
|
|
677
1420
|
duration: performance.now() - start,
|
|
678
1421
|
};
|
|
679
1422
|
}
|
|
680
1423
|
}
|
|
681
1424
|
|
|
1425
|
+
/**
|
|
1426
|
+
* Account-wide, user-scoped counterpart of {@link getMyPullRequestsForReposResult} that returns the raw
|
|
1427
|
+
* `ProviderPullRequest` shape (not the normalized model). Unlike the repo-scoped core, this needs no
|
|
1428
|
+
* `repos` — it reads the current user's pull requests across the account, so the ProviderBackend sweep
|
|
1429
|
+
* can drive its Kanban "done" column even when no repositories are supplied (where the repo-scoped core
|
|
1430
|
+
* rejects an empty `repos` input). Recovers thrown errors into `{ error }` so callers surface warnings.
|
|
1431
|
+
*/
|
|
1432
|
+
async getMyPullRequestsForUserResult(
|
|
1433
|
+
options?: {
|
|
1434
|
+
state?: PullRequestStateFilter[];
|
|
1435
|
+
cursor?: string;
|
|
1436
|
+
includeReviewRequested?: boolean;
|
|
1437
|
+
/** Exact OR union of account-wide relationships to include. */
|
|
1438
|
+
filters?: PullRequestFilter[];
|
|
1439
|
+
/** Request only the stable list fields, omitting optional provider enrichments. */
|
|
1440
|
+
summary?: boolean;
|
|
1441
|
+
},
|
|
1442
|
+
connectionId?: string,
|
|
1443
|
+
): Promise<IntegrationResult<ProviderApiPagedResult<ProviderPullRequest> | undefined>> {
|
|
1444
|
+
const scope = getScopedLogger();
|
|
1445
|
+
// `connectionId` targets a specific account (multi-account); omitted reads the primary.
|
|
1446
|
+
const session = await this.resolveReadSession(connectionId, scope);
|
|
1447
|
+
if (session == null) return undefined;
|
|
1448
|
+
|
|
1449
|
+
if (this.getProviderMyPullRequestsForUser == null) {
|
|
1450
|
+
return undefined;
|
|
1451
|
+
}
|
|
1452
|
+
|
|
1453
|
+
const start = performance.now();
|
|
1454
|
+
try {
|
|
1455
|
+
const result = await this.getProviderMyPullRequestsForUser(session, options);
|
|
1456
|
+
this.resetRequestExceptionCount('getMyPullRequestsForUser');
|
|
1457
|
+
return { value: result, duration: performance.now() - start };
|
|
1458
|
+
} catch (ex) {
|
|
1459
|
+
this.handleProviderException('getMyPullRequestsForUser', ex, { scope: scope });
|
|
1460
|
+
return { error: toError(ex), duration: performance.now() - start };
|
|
1461
|
+
}
|
|
1462
|
+
}
|
|
1463
|
+
|
|
1464
|
+
/**
|
|
1465
|
+
* Reads the current user's pull requests across the whole account using each provider's native "my PRs"
|
|
1466
|
+
* query, returning the raw provider shape. Without `filters`, the exact user scopes depend on provider-native
|
|
1467
|
+
* behavior and options like `includeReviewRequested`. With `filters`, each member is an exact account-wide OR
|
|
1468
|
+
* relationship validated by the facade before this provider hook is called. Optional: providers that can't
|
|
1469
|
+
* express an account-wide user query leave it undefined and the surface falls back to repo-scoped.
|
|
1470
|
+
*
|
|
1471
|
+
* These native user queries are cursor-based, so `cursor` (not a page number) drives continuation; there
|
|
1472
|
+
* is no jump-to-page-N and no per-call page size on this path.
|
|
1473
|
+
*
|
|
1474
|
+
* `includeReviewRequested` opts into the review-requested slice for providers whose account-wide read
|
|
1475
|
+
* only returns authored PRs natively and must fan out per-repo to add reviewer PRs (Bitbucket). It's off
|
|
1476
|
+
* by default so a sweep pays gkcli-parity cost (authored only) unless the caller deliberately opts in;
|
|
1477
|
+
* providers whose native query already covers review-requested PRs ignore it.
|
|
1478
|
+
*/
|
|
1479
|
+
protected getProviderMyPullRequestsForUser?(
|
|
1480
|
+
session: ProviderAuthenticationSession,
|
|
1481
|
+
options?: {
|
|
1482
|
+
state?: PullRequestStateFilter[];
|
|
1483
|
+
cursor?: string;
|
|
1484
|
+
includeReviewRequested?: boolean;
|
|
1485
|
+
filters?: PullRequestFilter[];
|
|
1486
|
+
summary?: boolean;
|
|
1487
|
+
},
|
|
1488
|
+
): Promise<ProviderApiPagedResult<ProviderPullRequest> | undefined>;
|
|
1489
|
+
|
|
1490
|
+
/**
|
|
1491
|
+
* Parses a Repo/Project paging cursor into its `cursors` bundle. Guards against valid JSON whose
|
|
1492
|
+
* `cursors` is a truthy non-array (e.g. `{ "cursors": "..." }`), which would otherwise bypass the
|
|
1493
|
+
* `?? []` fallback at call sites and flow into `.map()` downstream, throwing instead of degrading to
|
|
1494
|
+
* the first page.
|
|
1495
|
+
*/
|
|
1496
|
+
private parseCursorInfo<T>(cursor?: string): { cursors?: T[] } {
|
|
1497
|
+
try {
|
|
1498
|
+
const parsed = JSON.parse(cursor ?? '{}') as { cursors?: T[] };
|
|
1499
|
+
return Array.isArray(parsed?.cursors) ? parsed : {};
|
|
1500
|
+
} catch {
|
|
1501
|
+
return {};
|
|
1502
|
+
}
|
|
1503
|
+
}
|
|
1504
|
+
|
|
1505
|
+
// `state` selects which PR states to include (open/closed/merged/all). Providers that cannot express it
|
|
1506
|
+
// in a single query filter the normalized results; omitted preserves the historical open-only behavior.
|
|
682
1507
|
protected abstract searchProviderMyPullRequests(
|
|
683
1508
|
session: ProviderAuthenticationSession,
|
|
684
1509
|
repos?: T[],
|
|
685
1510
|
cancellation?: AbortSignal,
|
|
686
1511
|
silent?: boolean,
|
|
1512
|
+
state?: PullRequestStateFilter,
|
|
1513
|
+
options?: SearchMyPullRequestsOptions,
|
|
687
1514
|
): Promise<PullRequest[] | undefined>;
|
|
688
1515
|
|
|
1516
|
+
/**
|
|
1517
|
+
* Optional metadata-aware counterpart of {@link searchProviderMyPullRequests}. Providers whose account-wide
|
|
1518
|
+
* "my PRs" read already produces {@link ProviderApiPagedResult} with completeness/failures can override
|
|
1519
|
+
* this to return a soft `{ value, error }` result so `searchMyPullRequests` surfaces partial data and a
|
|
1520
|
+
* warning instead of silently discarding the failure signal. The wrapper prefers this when present; the
|
|
1521
|
+
* abstract {@link searchProviderMyPullRequests} remains the required fallback for repo-scoped and
|
|
1522
|
+
* metadata-oblivious paths.
|
|
1523
|
+
*/
|
|
1524
|
+
protected searchProviderMyPullRequestsResult?(
|
|
1525
|
+
session: ProviderAuthenticationSession,
|
|
1526
|
+
repos?: T[],
|
|
1527
|
+
cancellation?: AbortSignal,
|
|
1528
|
+
silent?: boolean,
|
|
1529
|
+
state?: PullRequestStateFilter,
|
|
1530
|
+
options?: SearchMyPullRequestsOptions,
|
|
1531
|
+
): Promise<IntegrationResult<PullRequest[] | undefined>>;
|
|
1532
|
+
|
|
689
1533
|
async searchPullRequests(
|
|
690
1534
|
searchQuery: string,
|
|
691
1535
|
repo?: T,
|
|
692
1536
|
cancellation?: AbortSignal,
|
|
1537
|
+
options?: { include?: PullRequestState[] },
|
|
693
1538
|
): Promise<PullRequest[] | undefined>;
|
|
694
1539
|
async searchPullRequests(
|
|
695
1540
|
searchQuery: string,
|
|
696
1541
|
repos?: T[],
|
|
697
1542
|
cancellation?: AbortSignal,
|
|
1543
|
+
options?: { include?: PullRequestState[] },
|
|
1544
|
+
): Promise<PullRequest[] | undefined>;
|
|
1545
|
+
async searchPullRequests(
|
|
1546
|
+
searchQuery: string,
|
|
1547
|
+
repo?: T,
|
|
1548
|
+
cancellation?: AbortSignal,
|
|
1549
|
+
connectionId?: string,
|
|
1550
|
+
options?: { include?: PullRequestState[] },
|
|
1551
|
+
): Promise<PullRequest[] | undefined>;
|
|
1552
|
+
async searchPullRequests(
|
|
1553
|
+
searchQuery: string,
|
|
1554
|
+
repos?: T[],
|
|
1555
|
+
cancellation?: AbortSignal,
|
|
1556
|
+
connectionId?: string,
|
|
1557
|
+
options?: { include?: PullRequestState[] },
|
|
698
1558
|
): Promise<PullRequest[] | undefined>;
|
|
699
1559
|
@trace()
|
|
700
1560
|
async searchPullRequests(
|
|
701
1561
|
searchQuery: string,
|
|
702
1562
|
repos?: T | T[],
|
|
703
1563
|
cancellation?: AbortSignal,
|
|
1564
|
+
connectionIdOrOptions?: string | { include?: PullRequestState[] },
|
|
1565
|
+
options?: { include?: PullRequestState[] },
|
|
704
1566
|
): Promise<PullRequest[] | undefined> {
|
|
1567
|
+
// `connectionId` (string) can be omitted when passing `options`; split the overlapping 4th arg.
|
|
1568
|
+
// When the 4th arg isn't the options object (a string `connectionId` or `undefined`), fall back to
|
|
1569
|
+
// the 5th-arg `options` so an explicit `undefined` connectionId still honors state filtering.
|
|
1570
|
+
const connectionId = typeof connectionIdOrOptions === 'string' ? connectionIdOrOptions : undefined;
|
|
1571
|
+
const searchOptions =
|
|
1572
|
+
connectionIdOrOptions != null && typeof connectionIdOrOptions !== 'string'
|
|
1573
|
+
? connectionIdOrOptions
|
|
1574
|
+
: options;
|
|
705
1575
|
const scope = getScopedLogger();
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
await this.refreshSessionIfExpired(scope);
|
|
1576
|
+
// `connectionId` targets a specific account (multi-account); omitted reads the primary.
|
|
1577
|
+
const session = await this.resolveReadSession(connectionId, scope);
|
|
1578
|
+
if (session == null) return undefined;
|
|
710
1579
|
|
|
711
1580
|
try {
|
|
712
1581
|
const prs = await this.searchProviderPullRequests?.(
|
|
713
|
-
|
|
1582
|
+
session,
|
|
714
1583
|
searchQuery,
|
|
715
1584
|
repos != null ? (Array.isArray(repos) ? repos : [repos]) : undefined,
|
|
716
1585
|
cancellation,
|
|
1586
|
+
searchOptions,
|
|
717
1587
|
);
|
|
718
1588
|
this.resetRequestExceptionCount('searchPullRequests');
|
|
719
1589
|
return prs;
|
|
@@ -728,6 +1598,7 @@ export abstract class GitHostIntegration<
|
|
|
728
1598
|
searchQuery: string,
|
|
729
1599
|
repos?: T[],
|
|
730
1600
|
cancellation?: AbortSignal,
|
|
1601
|
+
options?: { include?: PullRequestState[] },
|
|
731
1602
|
): Promise<PullRequest[] | undefined>;
|
|
732
1603
|
|
|
733
1604
|
getPullRequestIdentityFromMaybeUrl(search: string): PullRequestUrlIdentity | undefined {
|