@gitkraken/core-gitlens 0.3.1 → 0.4.100
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +83 -1
- package/README.md +22 -12
- 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 +4 -3
- package/dist/git/context.d.ts.map +1 -1
- package/dist/git/context.js.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 +1 -0
- 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 +5 -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 +32 -0
- package/dist/git/utils/conflictResolution.utils.d.ts.map +1 -1
- package/dist/git/utils/conflictResolution.utils.js +95 -0
- 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 +1 -0
- package/dist/git-cli/providers/operations.d.ts.map +1 -1
- package/dist/git-cli/providers/operations.js +22 -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 +4 -1
- package/dist/git-cli/providers/worktrees.d.ts.map +1 -1
- package/dist/git-cli/providers/worktrees.js +31 -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 +5 -7
- 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 +71 -15
- package/dist/plus/git-github/api/github.d.ts.map +1 -1
- package/dist/plus/git-github/api/github.js +350 -84
- 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 +30 -0
- package/dist/plus/integrations/authentication/cloudIntegrationService.d.ts.map +1 -0
- package/dist/plus/integrations/authentication/cloudIntegrationService.js +214 -0
- package/dist/plus/integrations/authentication/cloudIntegrationService.js.map +1 -0
- package/dist/plus/integrations/authentication/configuredIntegrationService.d.ts +114 -0
- package/dist/plus/integrations/authentication/configuredIntegrationService.d.ts.map +1 -0
- package/dist/plus/integrations/authentication/configuredIntegrationService.js +497 -0
- package/dist/plus/integrations/authentication/configuredIntegrationService.js.map +1 -0
- package/dist/plus/integrations/authentication/integrationAuthenticationProvider.d.ts +112 -0
- package/dist/plus/integrations/authentication/integrationAuthenticationProvider.d.ts.map +1 -0
- package/dist/plus/integrations/authentication/integrationAuthenticationProvider.js +217 -0
- package/dist/plus/integrations/authentication/integrationAuthenticationProvider.js.map +1 -0
- package/dist/plus/integrations/authentication/integrationAuthenticationService.d.ts +62 -0
- package/dist/plus/integrations/authentication/integrationAuthenticationService.d.ts.map +1 -0
- package/dist/plus/integrations/authentication/integrationAuthenticationService.js +126 -0
- package/dist/plus/integrations/authentication/integrationAuthenticationService.js.map +1 -0
- package/dist/plus/integrations/authentication/manualTokenProvider.d.ts +16 -0
- package/dist/plus/integrations/authentication/manualTokenProvider.d.ts.map +1 -0
- package/dist/plus/integrations/authentication/manualTokenProvider.js +53 -0
- package/dist/plus/integrations/authentication/manualTokenProvider.js.map +1 -0
- package/dist/plus/integrations/authentication/models.d.ts +120 -0
- package/dist/plus/integrations/authentication/models.d.ts.map +1 -0
- package/dist/plus/integrations/authentication/models.js +64 -0
- package/dist/plus/integrations/authentication/models.js.map +1 -0
- 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 +57 -0
- package/dist/plus/integrations/constants.d.ts.map +1 -0
- package/dist/plus/integrations/constants.js +138 -0
- package/dist/plus/integrations/constants.js.map +1 -0
- package/dist/plus/integrations/context.d.ts +358 -0
- package/dist/plus/integrations/context.d.ts.map +1 -0
- package/dist/plus/integrations/context.js +2 -0
- package/dist/plus/integrations/context.js.map +1 -0
- package/dist/plus/integrations/errors.d.ts +79 -0
- package/dist/plus/integrations/errors.d.ts.map +1 -0
- package/dist/plus/integrations/errors.js +150 -0
- package/dist/plus/integrations/errors.js.map +1 -0
- package/dist/plus/integrations/index.d.ts +77 -0
- package/dist/plus/integrations/index.d.ts.map +1 -0
- package/dist/plus/integrations/index.js +64 -0
- package/dist/plus/integrations/index.js.map +1 -0
- package/dist/plus/integrations/integrationService.d.ts +379 -0
- package/dist/plus/integrations/integrationService.d.ts.map +1 -0
- package/dist/plus/integrations/integrationService.js +1895 -0
- package/dist/plus/integrations/integrationService.js.map +1 -0
- 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 +341 -0
- package/dist/plus/integrations/models/gitHostIntegration.d.ts.map +1 -0
- package/dist/plus/integrations/models/gitHostIntegration.js +1146 -0
- package/dist/plus/integrations/models/gitHostIntegration.js.map +1 -0
- package/dist/plus/integrations/models/integration.d.ts +212 -0
- package/dist/plus/integrations/models/integration.d.ts.map +1 -0
- package/dist/plus/integrations/models/integration.js +627 -0
- package/dist/plus/integrations/models/integration.js.map +1 -0
- package/dist/plus/integrations/models/issuesIntegration.d.ts +108 -0
- package/dist/plus/integrations/models/issuesIntegration.d.ts.map +1 -0
- package/dist/plus/integrations/models/issuesIntegration.js +216 -0
- package/dist/plus/integrations/models/issuesIntegration.js.map +1 -0
- 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 +25 -0
- package/dist/plus/integrations/providers/apiClients.d.ts.map +1 -0
- package/dist/plus/integrations/providers/apiClients.js +39 -0
- package/dist/plus/integrations/providers/apiClients.js.map +1 -0
- 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 +59 -0
- package/dist/plus/integrations/providers/azure/azure.d.ts.map +1 -0
- package/dist/plus/integrations/providers/azure/azure.js +519 -0
- package/dist/plus/integrations/providers/azure/azure.js.map +1 -0
- package/dist/plus/integrations/providers/azure/models.d.ts +302 -0
- package/dist/plus/integrations/providers/azure/models.d.ts.map +1 -0
- package/dist/plus/integrations/providers/azure/models.js +203 -0
- package/dist/plus/integrations/providers/azure/models.js.map +1 -0
- package/dist/plus/integrations/providers/azureDevOps.d.ts +141 -0
- package/dist/plus/integrations/providers/azureDevOps.d.ts.map +1 -0
- package/dist/plus/integrations/providers/azureDevOps.js +925 -0
- package/dist/plus/integrations/providers/azureDevOps.js.map +1 -0
- package/dist/plus/integrations/providers/bitbucket/bitbucket.d.ts +53 -0
- package/dist/plus/integrations/providers/bitbucket/bitbucket.d.ts.map +1 -0
- package/dist/plus/integrations/providers/bitbucket/bitbucket.js +589 -0
- package/dist/plus/integrations/providers/bitbucket/bitbucket.js.map +1 -0
- package/dist/plus/integrations/providers/bitbucket/models.d.ts +222 -0
- package/dist/plus/integrations/providers/bitbucket/models.d.ts.map +1 -0
- package/dist/plus/integrations/providers/bitbucket/models.js +158 -0
- package/dist/plus/integrations/providers/bitbucket/models.js.map +1 -0
- package/dist/plus/integrations/providers/bitbucket-server/models.d.ts +138 -0
- package/dist/plus/integrations/providers/bitbucket-server/models.d.ts.map +1 -0
- package/dist/plus/integrations/providers/bitbucket-server/models.js +130 -0
- package/dist/plus/integrations/providers/bitbucket-server/models.js.map +1 -0
- package/dist/plus/integrations/providers/bitbucket-server.d.ts +84 -0
- package/dist/plus/integrations/providers/bitbucket-server.d.ts.map +1 -0
- package/dist/plus/integrations/providers/bitbucket-server.js +242 -0
- package/dist/plus/integrations/providers/bitbucket-server.js.map +1 -0
- package/dist/plus/integrations/providers/bitbucket.d.ts +84 -0
- package/dist/plus/integrations/providers/bitbucket.d.ts.map +1 -0
- package/dist/plus/integrations/providers/bitbucket.js +477 -0
- package/dist/plus/integrations/providers/bitbucket.js.map +1 -0
- package/dist/plus/integrations/providers/github/github.d.ts +5 -0
- package/dist/plus/integrations/providers/github/github.d.ts.map +1 -0
- package/dist/plus/integrations/providers/github/github.js +47 -0
- package/dist/plus/integrations/providers/github/github.js.map +1 -0
- package/dist/plus/integrations/providers/github/github.utils.d.ts +11 -0
- package/dist/plus/integrations/providers/github/github.utils.d.ts.map +1 -0
- package/dist/plus/integrations/providers/github/github.utils.js +6 -0
- package/dist/plus/integrations/providers/github/github.utils.js.map +1 -0
- package/dist/plus/integrations/providers/github/models.d.ts +3 -0
- package/dist/plus/integrations/providers/github/models.d.ts.map +1 -0
- package/dist/plus/integrations/providers/github/models.js +2 -0
- package/dist/plus/integrations/providers/github/models.js.map +1 -0
- package/dist/plus/integrations/providers/github.d.ts +116 -0
- package/dist/plus/integrations/providers/github.d.ts.map +1 -0
- package/dist/plus/integrations/providers/github.js +445 -0
- package/dist/plus/integrations/providers/github.js.map +1 -0
- package/dist/plus/integrations/providers/gitlab/gitlab.d.ts +71 -0
- package/dist/plus/integrations/providers/gitlab/gitlab.d.ts.map +1 -0
- package/dist/plus/integrations/providers/gitlab/gitlab.js +902 -0
- package/dist/plus/integrations/providers/gitlab/gitlab.js.map +1 -0
- package/dist/plus/integrations/providers/gitlab/gitlab.utils.d.ts +27 -0
- package/dist/plus/integrations/providers/gitlab/gitlab.utils.d.ts.map +1 -0
- package/dist/plus/integrations/providers/gitlab/gitlab.utils.js +53 -0
- package/dist/plus/integrations/providers/gitlab/gitlab.utils.js.map +1 -0
- package/dist/plus/integrations/providers/gitlab/models.d.ts +138 -0
- package/dist/plus/integrations/providers/gitlab/models.d.ts.map +1 -0
- package/dist/plus/integrations/providers/gitlab/models.js +99 -0
- package/dist/plus/integrations/providers/gitlab/models.js.map +1 -0
- package/dist/plus/integrations/providers/gitlab.d.ts +124 -0
- package/dist/plus/integrations/providers/gitlab.d.ts.map +1 -0
- package/dist/plus/integrations/providers/gitlab.js +519 -0
- package/dist/plus/integrations/providers/gitlab.js.map +1 -0
- package/dist/plus/integrations/providers/jira.d.ts +57 -0
- package/dist/plus/integrations/providers/jira.d.ts.map +1 -0
- package/dist/plus/integrations/providers/jira.js +425 -0
- package/dist/plus/integrations/providers/jira.js.map +1 -0
- package/dist/plus/integrations/providers/linear.d.ts +58 -0
- package/dist/plus/integrations/providers/linear.d.ts.map +1 -0
- package/dist/plus/integrations/providers/linear.js +304 -0
- package/dist/plus/integrations/providers/linear.js.map +1 -0
- package/dist/plus/integrations/providers/models.d.ts +712 -0
- package/dist/plus/integrations/providers/models.d.ts.map +1 -0
- package/dist/plus/integrations/providers/models.js +850 -0
- package/dist/plus/integrations/providers/models.js.map +1 -0
- package/dist/plus/integrations/providers/providersApi.d.ts +262 -0
- package/dist/plus/integrations/providers/providersApi.d.ts.map +1 -0
- package/dist/plus/integrations/providers/providersApi.js +1033 -0
- package/dist/plus/integrations/providers/providersApi.js.map +1 -0
- 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 +75 -0
- package/dist/plus/integrations/providers/utils.d.ts.map +1 -0
- package/dist/plus/integrations/providers/utils.js +313 -0
- package/dist/plus/integrations/providers/utils.js.map +1 -0
- package/dist/plus/integrations/reads/context.d.ts +52 -0
- package/dist/plus/integrations/reads/context.d.ts.map +1 -0
- package/dist/plus/integrations/reads/context.js +2 -0
- package/dist/plus/integrations/reads/context.js.map +1 -0
- package/dist/plus/integrations/reads/cursors.d.ts +66 -0
- package/dist/plus/integrations/reads/cursors.d.ts.map +1 -0
- package/dist/plus/integrations/reads/cursors.js +133 -0
- package/dist/plus/integrations/reads/cursors.js.map +1 -0
- package/dist/plus/integrations/reads/drains.d.ts +60 -0
- package/dist/plus/integrations/reads/drains.d.ts.map +1 -0
- package/dist/plus/integrations/reads/drains.js +255 -0
- package/dist/plus/integrations/reads/drains.js.map +1 -0
- package/dist/plus/integrations/reads/filters.d.ts +81 -0
- package/dist/plus/integrations/reads/filters.d.ts.map +1 -0
- package/dist/plus/integrations/reads/filters.js +87 -0
- package/dist/plus/integrations/reads/filters.js.map +1 -0
- package/dist/plus/integrations/reads/hierarchy.d.ts +17 -0
- package/dist/plus/integrations/reads/hierarchy.d.ts.map +1 -0
- package/dist/plus/integrations/reads/hierarchy.js +348 -0
- package/dist/plus/integrations/reads/hierarchy.js.map +1 -0
- package/dist/plus/integrations/reads/hierarchy.utils.d.ts +53 -0
- package/dist/plus/integrations/reads/hierarchy.utils.d.ts.map +1 -0
- package/dist/plus/integrations/reads/hierarchy.utils.js +85 -0
- package/dist/plus/integrations/reads/hierarchy.utils.js.map +1 -0
- package/dist/plus/integrations/reads/issueTracker.d.ts +19 -0
- package/dist/plus/integrations/reads/issueTracker.d.ts.map +1 -0
- package/dist/plus/integrations/reads/issueTracker.js +346 -0
- package/dist/plus/integrations/reads/issueTracker.js.map +1 -0
- package/dist/plus/integrations/reads/issues.d.ts +34 -0
- package/dist/plus/integrations/reads/issues.d.ts.map +1 -0
- package/dist/plus/integrations/reads/issues.js +244 -0
- package/dist/plus/integrations/reads/issues.js.map +1 -0
- package/dist/plus/integrations/reads/paging.d.ts +136 -0
- package/dist/plus/integrations/reads/paging.d.ts.map +1 -0
- package/dist/plus/integrations/reads/paging.js +221 -0
- package/dist/plus/integrations/reads/paging.js.map +1 -0
- package/dist/plus/integrations/reads/pullRequests.d.ts +32 -0
- package/dist/plus/integrations/reads/pullRequests.d.ts.map +1 -0
- package/dist/plus/integrations/reads/pullRequests.js +151 -0
- package/dist/plus/integrations/reads/pullRequests.js.map +1 -0
- package/dist/plus/integrations/reads/warnings.d.ts +47 -0
- package/dist/plus/integrations/reads/warnings.d.ts.map +1 -0
- package/dist/plus/integrations/reads/warnings.js +81 -0
- package/dist/plus/integrations/reads/warnings.js.map +1 -0
- package/dist/plus/integrations/results.d.ts +189 -0
- package/dist/plus/integrations/results.d.ts.map +1 -0
- package/dist/plus/integrations/results.js +62 -0
- package/dist/plus/integrations/results.js.map +1 -0
- package/dist/plus/integrations/telemetry.d.ts +26 -0
- package/dist/plus/integrations/telemetry.d.ts.map +1 -0
- package/dist/plus/integrations/telemetry.js +11 -0
- package/dist/plus/integrations/telemetry.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 +40 -0
- package/dist/plus/integrations/utils/integration.utils.d.ts.map +1 -0
- package/dist/plus/integrations/utils/integration.utils.js +182 -0
- package/dist/plus/integrations/utils/integration.utils.js.map +1 -0
- 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/disposable.d.ts +15 -2
- package/dist/utils/disposable.d.ts.map +1 -1
- package/dist/utils/disposable.js.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 -172
- package/src/git/cache.ts +75 -8
- package/src/git/context.ts +4 -3
- 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/operations.ts +1 -1
- package/src/git/providers/status.ts +1 -1
- package/src/git/providers/worktrees.ts +17 -3
- 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/conflictResolution.utils.ts +126 -0
- 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/operations.ts +22 -2
- 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 +57 -6
- 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 +5 -7
- 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 +497 -129
- 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 +292 -0
- package/src/plus/integrations/authentication/configuredIntegrationService.ts +651 -0
- package/src/plus/integrations/authentication/integrationAuthenticationProvider.ts +363 -0
- package/src/plus/integrations/authentication/integrationAuthenticationService.ts +148 -0
- package/src/plus/integrations/authentication/manualTokenProvider.ts +79 -0
- package/src/plus/integrations/authentication/models.ts +202 -0
- package/src/plus/integrations/collectionMetadata.ts +143 -0
- package/src/plus/integrations/constants.ts +190 -0
- package/src/plus/integrations/context.ts +382 -0
- package/src/plus/integrations/errors.ts +184 -0
- package/src/plus/integrations/index.ts +216 -0
- package/src/plus/integrations/integrationService.ts +2589 -0
- package/src/plus/integrations/lite.ts +233 -0
- package/src/plus/integrations/manager.ts +359 -0
- package/src/plus/integrations/models/gitHostIntegration.ts +1631 -0
- package/src/plus/integrations/models/integration.ts +926 -0
- package/src/plus/integrations/models/issuesIntegration.ts +264 -0
- package/src/plus/integrations/providerFilters.ts +12 -0
- package/src/plus/integrations/providers/apiClients.ts +69 -0
- package/src/plus/integrations/providers/apiConfig.ts +71 -0
- package/src/plus/integrations/providers/azure/azure.ts +822 -0
- package/src/plus/integrations/providers/azure/models.ts +618 -0
- package/src/plus/integrations/providers/azureDevOps.ts +1342 -0
- package/src/plus/integrations/providers/bitbucket/bitbucket.ts +904 -0
- package/src/plus/integrations/providers/bitbucket/models.ts +445 -0
- package/src/plus/integrations/providers/bitbucket-server/models.ts +283 -0
- package/src/plus/integrations/providers/bitbucket-server.ts +447 -0
- package/src/plus/integrations/providers/bitbucket.ts +794 -0
- package/src/plus/integrations/providers/github/github.ts +64 -0
- package/src/plus/integrations/providers/github/github.utils.ts +23 -0
- package/src/plus/integrations/providers/github/models.ts +29 -0
- package/src/plus/integrations/providers/github.ts +750 -0
- package/src/plus/integrations/providers/gitlab/gitlab.ts +1320 -0
- package/src/plus/integrations/providers/gitlab/gitlab.utils.ts +80 -0
- package/src/plus/integrations/providers/gitlab/models.ts +271 -0
- package/src/plus/integrations/providers/gitlab.ts +832 -0
- package/src/plus/integrations/providers/jira.ts +564 -0
- package/src/plus/integrations/providers/linear.ts +402 -0
- package/src/plus/integrations/providers/models.ts +1622 -0
- package/src/plus/integrations/providers/providersApi.ts +1889 -0
- 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 +419 -0
- package/src/plus/integrations/reads/context.ts +75 -0
- package/src/plus/integrations/reads/cursors.ts +224 -0
- package/src/plus/integrations/reads/drains.ts +343 -0
- package/src/plus/integrations/reads/filters.ts +124 -0
- package/src/plus/integrations/reads/hierarchy.ts +493 -0
- package/src/plus/integrations/reads/hierarchy.utils.ts +106 -0
- package/src/plus/integrations/reads/issueTracker.ts +480 -0
- package/src/plus/integrations/reads/issues.ts +407 -0
- package/src/plus/integrations/reads/paging.ts +277 -0
- package/src/plus/integrations/reads/pullRequests.ts +267 -0
- package/src/plus/integrations/reads/warnings.ts +170 -0
- package/src/plus/integrations/results.ts +275 -0
- package/src/plus/integrations/telemetry.ts +29 -0
- package/src/plus/integrations/utils/domain.utils.ts +26 -0
- package/src/plus/integrations/utils/integration.utils.ts +215 -0
- 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/disposable.ts +15 -2
- 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
|
@@ -13,7 +13,7 @@ import type { Account, UnidentifiedAuthor } from '../../../git/models/author.js'
|
|
|
13
13
|
import type { DefaultBranch } from '../../../git/models/defaultBranch.js';
|
|
14
14
|
import type { Issue, IssueShape } from '../../../git/models/issue.js';
|
|
15
15
|
import type { IssueOrPullRequest } from '../../../git/models/issueOrPullRequest.js';
|
|
16
|
-
import type { PullRequest } from '../../../git/models/pullRequest.js';
|
|
16
|
+
import type { PullRequest, PullRequestState, PullRequestStateFilter } from '../../../git/models/pullRequest.js';
|
|
17
17
|
import { PullRequestMergeMethod } from '../../../git/models/pullRequest.js';
|
|
18
18
|
import type { Provider } from '../../../git/models/remoteProvider.js';
|
|
19
19
|
import type { RepositoryMetadata } from '../../../git/models/repositoryMetadata.js';
|
|
@@ -27,6 +27,7 @@ import {
|
|
|
27
27
|
isRevisionRange,
|
|
28
28
|
isSha,
|
|
29
29
|
} from '../../../git/utils/revision.utils.js';
|
|
30
|
+
import { chunk } from '../../../utils/array.js';
|
|
30
31
|
import { base64 } from '../../../utils/base64.js';
|
|
31
32
|
import { CancellationError } from '../../../utils/cancellation.js';
|
|
32
33
|
import { trace } from '../../../utils/decorators/log.js';
|
|
@@ -55,6 +56,7 @@ import type {
|
|
|
55
56
|
GitHubPullRequest,
|
|
56
57
|
GitHubPullRequestLite,
|
|
57
58
|
GitHubPullRequestState,
|
|
59
|
+
GitHubSshSigningKey,
|
|
58
60
|
GitHubTag,
|
|
59
61
|
} from '../models.js';
|
|
60
62
|
import {
|
|
@@ -66,11 +68,6 @@ import {
|
|
|
66
68
|
import type { GitHubApiConfig } from './config.js';
|
|
67
69
|
import type { GitHubTokenInfo } from './token.js';
|
|
68
70
|
|
|
69
|
-
interface CancellationToken {
|
|
70
|
-
isCancellationRequested: boolean;
|
|
71
|
-
onCancellationRequested(fn: () => void): { dispose(): void };
|
|
72
|
-
}
|
|
73
|
-
|
|
74
71
|
const emptyPagedResult: PagedResult<any> = Object.freeze({ values: [] });
|
|
75
72
|
const emptyBlameResult: GitHubBlame = Object.freeze({ ranges: [] });
|
|
76
73
|
|
|
@@ -83,6 +80,9 @@ const maxRequestRetries = 2;
|
|
|
83
80
|
const requestRetryBaseDelay = 300; // ms
|
|
84
81
|
const requestRetryMaxDelay = 2000; // ms
|
|
85
82
|
|
|
83
|
+
/** How many email->login user searches to alias into a single GraphQL request (keeps query cost within limits). */
|
|
84
|
+
const accountResolveBatchSize = 25;
|
|
85
|
+
|
|
86
86
|
function isRetryableTransientError(ex: unknown): ex is RequestError {
|
|
87
87
|
// An aborted request is rethrown as the original `AbortError` (not a `RequestError`), so it is
|
|
88
88
|
// excluded here. octokit maps a fetch/network failure to a `RequestError` with status 500 and
|
|
@@ -101,6 +101,31 @@ function isRetryableTransientError(ex: unknown): ex is RequestError {
|
|
|
101
101
|
}
|
|
102
102
|
}
|
|
103
103
|
|
|
104
|
+
/**
|
|
105
|
+
* When a rate-limited request may be retried, as a UTC epoch in seconds, or `undefined` when the response says
|
|
106
|
+
* nothing useful. Header precedence follows GitHub's own guidance
|
|
107
|
+
* (docs.github.com/en/rest/using-the-rest-api/rate-limits-for-the-rest-api): `retry-after` wins when present —
|
|
108
|
+
* it is the only one a secondary limit reliably sets — and `x-ratelimit-reset` covers the primary limit.
|
|
109
|
+
*/
|
|
110
|
+
function rateLimitResetAt(ex: RequestError): number | undefined {
|
|
111
|
+
const headers = ex.response?.headers;
|
|
112
|
+
if (headers == null) return undefined;
|
|
113
|
+
|
|
114
|
+
// `retry-after` is a delay in seconds, not an epoch, so it has to be added to now to compare with `resetAt`.
|
|
115
|
+
const retryAfter = toPositiveInt(headers['retry-after']);
|
|
116
|
+
if (retryAfter != null) return Math.floor(Date.now() / 1000) + retryAfter;
|
|
117
|
+
|
|
118
|
+
return toPositiveInt(headers['x-ratelimit-reset']);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
function toPositiveInt(value: string | number | undefined): number | undefined {
|
|
122
|
+
if (value == null) return undefined;
|
|
123
|
+
|
|
124
|
+
const parsed = typeof value === 'number' ? value : parseInt(value, 10);
|
|
125
|
+
// Rejects NaN and a nonsensical negative/zero, either of which would present as an already-elapsed reset.
|
|
126
|
+
return Number.isFinite(parsed) && parsed > 0 ? parsed : undefined;
|
|
127
|
+
}
|
|
128
|
+
|
|
104
129
|
function getRequestRetryDelay(attempt: number): number {
|
|
105
130
|
// Exponential backoff with equal jitter, capped — spreads retries so a brief upstream blip
|
|
106
131
|
// isn't hammered by every in-flight request landing on the same schedule.
|
|
@@ -132,15 +157,18 @@ author {
|
|
|
132
157
|
avatarUrl(size: $avatarSize)
|
|
133
158
|
url
|
|
134
159
|
}
|
|
160
|
+
body
|
|
135
161
|
baseRefName
|
|
136
162
|
baseRefOid
|
|
137
163
|
headRefName
|
|
138
164
|
headRefOid
|
|
139
165
|
headRepository {
|
|
166
|
+
isFork
|
|
140
167
|
name
|
|
141
168
|
owner {
|
|
142
169
|
login
|
|
143
170
|
}
|
|
171
|
+
sshUrl
|
|
144
172
|
url
|
|
145
173
|
}
|
|
146
174
|
isCrossRepository
|
|
@@ -153,6 +181,7 @@ repository {
|
|
|
153
181
|
owner {
|
|
154
182
|
login
|
|
155
183
|
}
|
|
184
|
+
sshUrl
|
|
156
185
|
url
|
|
157
186
|
viewerPermission
|
|
158
187
|
}
|
|
@@ -554,6 +583,61 @@ export class GitHubApi {
|
|
|
554
583
|
}
|
|
555
584
|
}
|
|
556
585
|
|
|
586
|
+
@trace({ args: (provider, token) => ({ provider: provider?.name, token: `<token:${token.microHash}>` }) })
|
|
587
|
+
async getAccountsForEmails(
|
|
588
|
+
provider: Provider,
|
|
589
|
+
token: GitHubTokenInfo,
|
|
590
|
+
emails: string[],
|
|
591
|
+
options?: { baseUrl?: string },
|
|
592
|
+
): Promise<Map<string, string>> {
|
|
593
|
+
const scope = getScopedLogger();
|
|
594
|
+
|
|
595
|
+
// Resolves email -> login for many emails in one request via field aliasing, chunked to keep query cost within
|
|
596
|
+
// GitHub's limits. Each email is passed as a GraphQL variable (never interpolated into the query string) so an
|
|
597
|
+
// attacker-controllable commit email can't inject query structure. Keyed by lowercased email.
|
|
598
|
+
//
|
|
599
|
+
// This is intentionally best-effort: user-by-email search only matches accounts whose email is public, and the
|
|
600
|
+
// search API is subject to GitHub's separate search/secondary rate limits, so misses and per-batch failures are
|
|
601
|
+
// expected and tolerated. GitHub noreply addresses (the common case) are decoded locally by the caller without
|
|
602
|
+
// hitting this at all.
|
|
603
|
+
const result = new Map<string, string>();
|
|
604
|
+
if (emails.length === 0) return result;
|
|
605
|
+
|
|
606
|
+
interface QueryResult {
|
|
607
|
+
[alias: string]: { nodes?: ({ login: string | null } | null)[] | null } | null | undefined;
|
|
608
|
+
}
|
|
609
|
+
|
|
610
|
+
for (const batch of chunk(emails, accountResolveBatchSize)) {
|
|
611
|
+
const declarations = batch.map((_, i) => `$q${i}: String!`).join(', ');
|
|
612
|
+
const fields = batch
|
|
613
|
+
.map((_, i) => `e${i}: search(type: USER, query: $q${i}, first: 1) { nodes { ... on User { login } } }`)
|
|
614
|
+
.join('\n\t');
|
|
615
|
+
const query = `query getAccountsForEmails(${declarations}) {\n\t${fields}\n}`;
|
|
616
|
+
|
|
617
|
+
const variables: RequestParameters = { ...options };
|
|
618
|
+
batch.forEach((email, i) => {
|
|
619
|
+
variables[`q${i}`] = `in:email ${email}`;
|
|
620
|
+
});
|
|
621
|
+
|
|
622
|
+
try {
|
|
623
|
+
const rsp = await this.graphql<QueryResult>(provider, token, query, variables, scope);
|
|
624
|
+
if (rsp == null) continue;
|
|
625
|
+
|
|
626
|
+
batch.forEach((email, i) => {
|
|
627
|
+
const login = rsp[`e${i}`]?.nodes?.[0]?.login;
|
|
628
|
+
if (login) {
|
|
629
|
+
result.set(email.toLowerCase(), login);
|
|
630
|
+
}
|
|
631
|
+
});
|
|
632
|
+
} catch (ex) {
|
|
633
|
+
// Best-effort enrichment — a failed batch (e.g. query cost) shouldn't abort the others.
|
|
634
|
+
scope?.error(ex);
|
|
635
|
+
}
|
|
636
|
+
}
|
|
637
|
+
|
|
638
|
+
return result;
|
|
639
|
+
}
|
|
640
|
+
|
|
557
641
|
@trace({
|
|
558
642
|
args: (provider, token, owner, repo) => ({
|
|
559
643
|
provider: provider.name,
|
|
@@ -815,7 +899,7 @@ export class GitHubApi {
|
|
|
815
899
|
) {
|
|
816
900
|
repository(name: $repo, owner: $owner) {
|
|
817
901
|
pullRequest(number: $number) {
|
|
818
|
-
${
|
|
902
|
+
${gqlPullRequestLiteFragment}
|
|
819
903
|
}
|
|
820
904
|
}
|
|
821
905
|
}`;
|
|
@@ -959,7 +1043,7 @@ export class GitHubApi {
|
|
|
959
1043
|
baseUrl?: string;
|
|
960
1044
|
avatarSize?: number;
|
|
961
1045
|
},
|
|
962
|
-
cancellation?:
|
|
1046
|
+
cancellation?: AbortSignal,
|
|
963
1047
|
): Promise<PullRequest | undefined> {
|
|
964
1048
|
const scope = getScopedLogger();
|
|
965
1049
|
|
|
@@ -1049,7 +1133,7 @@ export class GitHubApi {
|
|
|
1049
1133
|
options?: {
|
|
1050
1134
|
baseUrl?: string;
|
|
1051
1135
|
},
|
|
1052
|
-
cancellation?:
|
|
1136
|
+
cancellation?: AbortSignal,
|
|
1053
1137
|
): Promise<RepositoryMetadata | undefined> {
|
|
1054
1138
|
const scope = getScopedLogger();
|
|
1055
1139
|
|
|
@@ -2343,6 +2427,64 @@ export class GitHubApi {
|
|
|
2343
2427
|
}
|
|
2344
2428
|
}
|
|
2345
2429
|
|
|
2430
|
+
@trace({
|
|
2431
|
+
args: (provider, token, username) => ({
|
|
2432
|
+
provider: provider?.name,
|
|
2433
|
+
token: `<token:${token.microHash}>`,
|
|
2434
|
+
username: username,
|
|
2435
|
+
}),
|
|
2436
|
+
})
|
|
2437
|
+
async getUserSshSigningKeys(
|
|
2438
|
+
provider: Provider | undefined,
|
|
2439
|
+
token: GitHubTokenInfo,
|
|
2440
|
+
username: string,
|
|
2441
|
+
options?: { baseUrl?: string },
|
|
2442
|
+
): Promise<GitHubSshSigningKey[]> {
|
|
2443
|
+
const scope = getScopedLogger();
|
|
2444
|
+
|
|
2445
|
+
// SSH signing keys are public, so this works for any user with the current token (no extra scope needed).
|
|
2446
|
+
// TODO@eamodio implement pagination
|
|
2447
|
+
try {
|
|
2448
|
+
const rsp = await this.request(
|
|
2449
|
+
provider,
|
|
2450
|
+
token,
|
|
2451
|
+
'GET /users/{username}/ssh_signing_keys',
|
|
2452
|
+
{ username: username, per_page: 100, ...options },
|
|
2453
|
+
scope,
|
|
2454
|
+
);
|
|
2455
|
+
return rsp?.data ?? [];
|
|
2456
|
+
} catch (ex) {
|
|
2457
|
+
if (ex instanceof RequestNotFoundError) return [];
|
|
2458
|
+
|
|
2459
|
+
throw this.handleException(ex, provider, scope);
|
|
2460
|
+
}
|
|
2461
|
+
}
|
|
2462
|
+
|
|
2463
|
+
@trace({ args: (provider, token) => ({ provider: provider?.name, token: `<token:${token.microHash}>` }) })
|
|
2464
|
+
async getCurrentUserSshSigningKeys(
|
|
2465
|
+
provider: Provider | undefined,
|
|
2466
|
+
token: GitHubTokenInfo,
|
|
2467
|
+
options?: { baseUrl?: string },
|
|
2468
|
+
): Promise<GitHubSshSigningKey[]> {
|
|
2469
|
+
const scope = getScopedLogger();
|
|
2470
|
+
|
|
2471
|
+
// TODO@eamodio implement pagination
|
|
2472
|
+
try {
|
|
2473
|
+
const rsp = await this.request(
|
|
2474
|
+
provider,
|
|
2475
|
+
token,
|
|
2476
|
+
'GET /user/ssh_signing_keys',
|
|
2477
|
+
{ per_page: 100, ...options },
|
|
2478
|
+
scope,
|
|
2479
|
+
);
|
|
2480
|
+
return rsp?.data ?? [];
|
|
2481
|
+
} catch (ex) {
|
|
2482
|
+
if (ex instanceof RequestNotFoundError) return [];
|
|
2483
|
+
|
|
2484
|
+
throw this.handleException(ex, provider, scope);
|
|
2485
|
+
}
|
|
2486
|
+
}
|
|
2487
|
+
|
|
2346
2488
|
@trace({ args: (token, owner, repo) => ({ token: `<token:${token.microHash}>`, owner: owner, repo: repo }) })
|
|
2347
2489
|
async getDefaultBranchName(token: GitHubTokenInfo, owner: string, repo: string): Promise<string | undefined> {
|
|
2348
2490
|
const scope = getScopedLogger();
|
|
@@ -2965,10 +3107,9 @@ export class GitHubApi {
|
|
|
2965
3107
|
query: string,
|
|
2966
3108
|
variables: RequestParameters,
|
|
2967
3109
|
scope: ScopedLogger | undefined,
|
|
2968
|
-
cancellation?:
|
|
3110
|
+
cancellation?: AbortSignal | undefined,
|
|
2969
3111
|
): Promise<T | undefined> {
|
|
2970
3112
|
const { accessToken, ...tokenInfo } = token;
|
|
2971
|
-
|
|
2972
3113
|
// Only dedupe when no cancellation/request option is in play — sharing a promise that
|
|
2973
3114
|
// carries one caller's AbortSignal would let one cancellation cancel for everyone.
|
|
2974
3115
|
const dedupable = cancellation == null && variables?.request == null;
|
|
@@ -2988,16 +3129,12 @@ export class GitHubApi {
|
|
|
2988
3129
|
|
|
2989
3130
|
const run = async (): Promise<T | undefined> => {
|
|
2990
3131
|
try {
|
|
2991
|
-
let aborter: AbortController | undefined;
|
|
2992
3132
|
if (cancellation != null) {
|
|
2993
|
-
if (cancellation.
|
|
2994
|
-
|
|
2995
|
-
aborter = new AbortController();
|
|
2996
|
-
cancellation.onCancellationRequested(() => aborter!.abort());
|
|
3133
|
+
if (cancellation.aborted) throw new CancellationError();
|
|
2997
3134
|
|
|
2998
3135
|
variables = {
|
|
2999
3136
|
...variables,
|
|
3000
|
-
request: { ...variables?.request, signal:
|
|
3137
|
+
request: { ...variables?.request, signal: cancellation },
|
|
3001
3138
|
};
|
|
3002
3139
|
}
|
|
3003
3140
|
|
|
@@ -3010,7 +3147,7 @@ export class GitHubApi {
|
|
|
3010
3147
|
this.getDefaults(accessToken, graphql)(query, variables),
|
|
3011
3148
|
),
|
|
3012
3149
|
retryable,
|
|
3013
|
-
|
|
3150
|
+
cancellation,
|
|
3014
3151
|
scope,
|
|
3015
3152
|
);
|
|
3016
3153
|
} catch (ex) {
|
|
@@ -3071,17 +3208,15 @@ export class GitHubApi {
|
|
|
3071
3208
|
route: R,
|
|
3072
3209
|
options: (Endpoints[R]['parameters'] & RequestParameters) | undefined,
|
|
3073
3210
|
scope: ScopedLogger | undefined,
|
|
3074
|
-
cancellation?:
|
|
3211
|
+
cancellation?: AbortSignal | undefined,
|
|
3075
3212
|
): Promise<Endpoints[R]['response']> {
|
|
3076
3213
|
const { accessToken } = token;
|
|
3077
3214
|
try {
|
|
3078
3215
|
let signal: AbortSignal | undefined;
|
|
3079
3216
|
if (cancellation != null) {
|
|
3080
|
-
if (cancellation.
|
|
3217
|
+
if (cancellation.aborted) throw new CancellationError();
|
|
3081
3218
|
|
|
3082
|
-
|
|
3083
|
-
cancellation.onCancellationRequested(() => aborter.abort());
|
|
3084
|
-
signal = aborter.signal;
|
|
3219
|
+
signal = cancellation;
|
|
3085
3220
|
options = { ...options, request: { ...options?.request, signal: signal } };
|
|
3086
3221
|
}
|
|
3087
3222
|
|
|
@@ -3184,22 +3319,18 @@ export class GitHubApi {
|
|
|
3184
3319
|
case 410: // Gone
|
|
3185
3320
|
case 422: // Unprocessable Entity
|
|
3186
3321
|
throw new RequestNotFoundError(ex);
|
|
3187
|
-
|
|
3322
|
+
case 429: // Too Many Requests
|
|
3323
|
+
// GitHub returns "a `403` or `429` response" for BOTH its primary and secondary rate limits
|
|
3324
|
+
// (docs.github.com/en/rest/using-the-rest-api/rate-limits-for-the-rest-api). 429 is unambiguous —
|
|
3325
|
+
// unlike 403, it is never a permission failure — so it needs no message check.
|
|
3326
|
+
throw new RequestRateLimitError(ex, accessToken, rateLimitResetAt(ex));
|
|
3188
3327
|
case 401: // Unauthorized
|
|
3189
3328
|
throw new AuthenticationError(tokenInfo, AuthenticationErrorReason.Unauthorized, ex);
|
|
3190
3329
|
case 403: // Forbidden
|
|
3330
|
+
// The other status the rate limits arrive on, but 403 is also a plain permission failure, so here
|
|
3331
|
+
// the message is the discriminant.
|
|
3191
3332
|
if (ex.message.includes('rate limit')) {
|
|
3192
|
-
|
|
3193
|
-
|
|
3194
|
-
const reset = ex.response?.headers?.['x-ratelimit-reset'];
|
|
3195
|
-
if (reset != null) {
|
|
3196
|
-
resetAt = parseInt(reset, 10);
|
|
3197
|
-
if (Number.isNaN(resetAt)) {
|
|
3198
|
-
resetAt = undefined;
|
|
3199
|
-
}
|
|
3200
|
-
}
|
|
3201
|
-
|
|
3202
|
-
throw new RequestRateLimitError(ex, accessToken, resetAt);
|
|
3333
|
+
throw new RequestRateLimitError(ex, accessToken, rateLimitResetAt(ex));
|
|
3203
3334
|
}
|
|
3204
3335
|
throw new AuthenticationError(tokenInfo, AuthenticationErrorReason.Forbidden, ex);
|
|
3205
3336
|
case 500: // Internal Server Error
|
|
@@ -3319,7 +3450,7 @@ export class GitHubApi {
|
|
|
3319
3450
|
}
|
|
3320
3451
|
|
|
3321
3452
|
@trace({ args: (provider, token) => ({ provider: provider.name, token: `<token:${token.microHash}>` }) })
|
|
3322
|
-
async
|
|
3453
|
+
async searchMyPullRequestsPage(
|
|
3323
3454
|
provider: Provider,
|
|
3324
3455
|
token: GitHubTokenInfo,
|
|
3325
3456
|
options?: {
|
|
@@ -3329,40 +3460,54 @@ export class GitHubApi {
|
|
|
3329
3460
|
baseUrl?: string;
|
|
3330
3461
|
avatarSize?: number;
|
|
3331
3462
|
silent?: boolean;
|
|
3463
|
+
state?: PullRequestStateFilter;
|
|
3464
|
+
cursor?: string;
|
|
3465
|
+
/**
|
|
3466
|
+
* Uses the lightweight PR fragment while retaining identity, body, author, repository, and branch refs.
|
|
3467
|
+
* Intended for aggregate/list surfaces that do not consume review, check, or diff statistics.
|
|
3468
|
+
*/
|
|
3469
|
+
summary?: boolean;
|
|
3470
|
+
/**
|
|
3471
|
+
* Adds GitHub's provider-native `involves:@me` relationship. Disable when `search` already carries
|
|
3472
|
+
* an explicit relationship qualifier such as `author:@me` or `review-requested:@me`.
|
|
3473
|
+
*/
|
|
3474
|
+
includeDefaultInvolvement?: boolean;
|
|
3332
3475
|
},
|
|
3333
|
-
cancellation?:
|
|
3334
|
-
): Promise<PullRequest[]> {
|
|
3476
|
+
cancellation?: AbortSignal,
|
|
3477
|
+
): Promise<{ values: PullRequest[]; cursor?: string; hasMore: boolean; truncated: boolean }> {
|
|
3335
3478
|
const scope = getScopedLogger();
|
|
3336
|
-
|
|
3337
3479
|
const limit = Math.min(100, this.config.getLaunchpadQueryLimit?.() ?? 100);
|
|
3338
3480
|
|
|
3339
3481
|
try {
|
|
3340
3482
|
interface SearchResult {
|
|
3341
3483
|
search: {
|
|
3342
3484
|
issueCount: number;
|
|
3485
|
+
pageInfo: {
|
|
3486
|
+
endCursor?: string | null;
|
|
3487
|
+
hasNextPage: boolean;
|
|
3488
|
+
};
|
|
3343
3489
|
nodes: GitHubPullRequest[];
|
|
3344
3490
|
};
|
|
3345
|
-
viewer: {
|
|
3346
|
-
login: string;
|
|
3347
|
-
};
|
|
3348
3491
|
}
|
|
3349
3492
|
|
|
3350
3493
|
const query = `query searchMyPullRequests(
|
|
3351
|
-
|
|
3352
|
-
|
|
3353
|
-
|
|
3354
|
-
|
|
3355
|
-
|
|
3356
|
-
|
|
3357
|
-
|
|
3358
|
-
|
|
3494
|
+
$search: String!
|
|
3495
|
+
$cursor: String
|
|
3496
|
+
$avatarSize: Int
|
|
3497
|
+
) {
|
|
3498
|
+
search(first: ${limit}, after: $cursor, query: $search, type: ISSUE) {
|
|
3499
|
+
issueCount
|
|
3500
|
+
pageInfo {
|
|
3501
|
+
endCursor
|
|
3502
|
+
hasNextPage
|
|
3503
|
+
}
|
|
3504
|
+
nodes {
|
|
3505
|
+
...on PullRequest {
|
|
3506
|
+
${options?.summary ? gqlPullRequestLiteFragment : gqlPullRequestFragment}
|
|
3507
|
+
}
|
|
3359
3508
|
}
|
|
3360
3509
|
}
|
|
3361
|
-
}
|
|
3362
|
-
viewer {
|
|
3363
|
-
login
|
|
3364
|
-
}
|
|
3365
|
-
}`;
|
|
3510
|
+
}`;
|
|
3366
3511
|
|
|
3367
3512
|
let search = options?.search?.trim() ?? '';
|
|
3368
3513
|
|
|
@@ -3374,65 +3519,81 @@ export class GitHubApi {
|
|
|
3374
3519
|
search += ` repo:${options.repos.join(' repo:')}`;
|
|
3375
3520
|
}
|
|
3376
3521
|
|
|
3377
|
-
// Hack for now, ultimately this should be passed in
|
|
3378
3522
|
const ignoredRepos = this.config.getLaunchpadIgnoredRepositories?.() ?? [];
|
|
3379
3523
|
if (ignoredRepos.length) {
|
|
3380
3524
|
search += ` -repo:${ignoredRepos.join(' -repo:')}`;
|
|
3381
3525
|
}
|
|
3382
3526
|
|
|
3383
|
-
// Hack for now, ultimately this should be passed in
|
|
3384
3527
|
const enabledOrgs = this.config.getLaunchpadIncludedOrganizations?.() ?? [];
|
|
3385
3528
|
if (enabledOrgs.length) {
|
|
3386
3529
|
search += ` org:${enabledOrgs.join(' org:')}`;
|
|
3387
3530
|
} else {
|
|
3388
|
-
// Hack for now, ultimately this should be passed in
|
|
3389
3531
|
const ignoredOrgs = this.config.getLaunchpadIgnoredOrganizations?.() ?? [];
|
|
3390
3532
|
if (ignoredOrgs.length) {
|
|
3391
3533
|
search += ` -org:${ignoredOrgs.join(' -org:')}`;
|
|
3392
3534
|
}
|
|
3393
3535
|
}
|
|
3394
3536
|
|
|
3537
|
+
const stateQualifier =
|
|
3538
|
+
options?.state === 'closed'
|
|
3539
|
+
? 'is:closed is:unmerged'
|
|
3540
|
+
: options?.state === 'merged'
|
|
3541
|
+
? 'is:merged'
|
|
3542
|
+
: options?.state === 'all'
|
|
3543
|
+
? ''
|
|
3544
|
+
: 'is:open';
|
|
3545
|
+
|
|
3546
|
+
const relationshipQualifier =
|
|
3547
|
+
options?.includeDefaultInvolvement === false
|
|
3548
|
+
? 'is:pr archived:false'
|
|
3549
|
+
: 'is:pr involves:@me archived:false';
|
|
3395
3550
|
const rsp = await this.graphql<SearchResult>(
|
|
3396
3551
|
provider,
|
|
3397
3552
|
token,
|
|
3398
3553
|
query,
|
|
3399
3554
|
{
|
|
3400
|
-
search:
|
|
3555
|
+
search: [stateQualifier, relationshipQualifier, search].filter(Boolean).join(' ').trim(),
|
|
3556
|
+
cursor: options?.cursor,
|
|
3401
3557
|
baseUrl: options?.baseUrl,
|
|
3402
3558
|
avatarSize: options?.avatarSize,
|
|
3403
3559
|
},
|
|
3404
3560
|
scope,
|
|
3405
3561
|
cancellation,
|
|
3406
3562
|
);
|
|
3407
|
-
if (rsp == null) return [];
|
|
3408
|
-
|
|
3409
|
-
const viewer = rsp.viewer.login;
|
|
3410
|
-
|
|
3411
|
-
function toQueryResult(pr: GitHubPullRequest): PullRequest {
|
|
3412
|
-
const reasons = [];
|
|
3413
|
-
if (pr.author.login === viewer) {
|
|
3414
|
-
reasons.push('authored');
|
|
3415
|
-
}
|
|
3416
|
-
if (pr.assignees.nodes.some(a => a.login === viewer)) {
|
|
3417
|
-
reasons.push('assigned');
|
|
3418
|
-
}
|
|
3419
|
-
if (pr.reviewRequests.nodes.some(r => r.requestedReviewer?.login === viewer)) {
|
|
3420
|
-
reasons.push('review-requested');
|
|
3421
|
-
}
|
|
3422
|
-
if (reasons.length === 0) {
|
|
3423
|
-
reasons.push('mentioned');
|
|
3424
|
-
}
|
|
3563
|
+
if (rsp == null) return { values: [], hasMore: false, truncated: false };
|
|
3425
3564
|
|
|
3426
|
-
|
|
3427
|
-
|
|
3428
|
-
|
|
3429
|
-
|
|
3430
|
-
|
|
3565
|
+
const results: PullRequest[] = rsp.search.nodes.map(pr =>
|
|
3566
|
+
options?.summary ? fromGitHubPullRequestLite(pr, provider) : fromGitHubPullRequest(pr, provider),
|
|
3567
|
+
);
|
|
3568
|
+
return {
|
|
3569
|
+
values: results,
|
|
3570
|
+
cursor: rsp.search.pageInfo.endCursor ?? undefined,
|
|
3571
|
+
hasMore: rsp.search.pageInfo.hasNextPage,
|
|
3572
|
+
truncated: rsp.search.issueCount > 1000,
|
|
3573
|
+
};
|
|
3431
3574
|
} catch (ex) {
|
|
3432
3575
|
throw this.handleException(ex, provider, scope, options?.silent);
|
|
3433
3576
|
}
|
|
3434
3577
|
}
|
|
3435
3578
|
|
|
3579
|
+
@trace({ args: (provider, token) => ({ provider: provider.name, token: `<token:${token.microHash}>` }) })
|
|
3580
|
+
async searchMyPullRequests(
|
|
3581
|
+
provider: Provider,
|
|
3582
|
+
token: GitHubTokenInfo,
|
|
3583
|
+
options?: {
|
|
3584
|
+
search?: string;
|
|
3585
|
+
user?: string;
|
|
3586
|
+
repos?: string[];
|
|
3587
|
+
baseUrl?: string;
|
|
3588
|
+
avatarSize?: number;
|
|
3589
|
+
silent?: boolean;
|
|
3590
|
+
state?: PullRequestStateFilter;
|
|
3591
|
+
},
|
|
3592
|
+
cancellation?: AbortSignal,
|
|
3593
|
+
): Promise<PullRequest[]> {
|
|
3594
|
+
return (await this.searchMyPullRequestsPage(provider, token, options, cancellation)).values;
|
|
3595
|
+
}
|
|
3596
|
+
|
|
3436
3597
|
@trace({ args: (provider, token) => ({ provider: provider.name, token: `<token:${token.microHash}>` }) })
|
|
3437
3598
|
async searchMyIssues(
|
|
3438
3599
|
provider: Provider,
|
|
@@ -3444,55 +3605,130 @@ export class GitHubApi {
|
|
|
3444
3605
|
baseUrl?: string;
|
|
3445
3606
|
avatarSize?: number;
|
|
3446
3607
|
includeBody?: boolean;
|
|
3608
|
+
includeAllAssignees?: boolean;
|
|
3609
|
+
cursor?: string;
|
|
3610
|
+
/**
|
|
3611
|
+
* Which of the three "my issues" searches to run. Omitted runs all three (GitHub's own definition of
|
|
3612
|
+
* "mine": authored ∪ assigned ∪ mentioned). Supplied, only the `true` ones run — so a caller wanting
|
|
3613
|
+
* `assignee:@me` parity asks for `{ assigned: true }` instead of filtering the union client-side (which
|
|
3614
|
+
* can't work: the dropped items still counted toward this page, so `hasMore`/`cursor` would describe a
|
|
3615
|
+
* different result set than `values`).
|
|
3616
|
+
*
|
|
3617
|
+
* At least one must be `true`; an all-`false` set reads nothing rather than silently widening back to
|
|
3618
|
+
* the union. The facade never sends one (an empty filter set means "unfiltered" there).
|
|
3619
|
+
*/
|
|
3620
|
+
categories?: { authored?: boolean; assigned?: boolean; mentioned?: boolean };
|
|
3447
3621
|
},
|
|
3448
|
-
cancellation?:
|
|
3449
|
-
): Promise<
|
|
3622
|
+
cancellation?: AbortSignal,
|
|
3623
|
+
): Promise<
|
|
3624
|
+
| {
|
|
3625
|
+
values: IssueShape[];
|
|
3626
|
+
cursor?: string;
|
|
3627
|
+
hasMore: boolean;
|
|
3628
|
+
page: number;
|
|
3629
|
+
truncated: boolean;
|
|
3630
|
+
}
|
|
3631
|
+
| undefined
|
|
3632
|
+
> {
|
|
3450
3633
|
const scope = getScopedLogger();
|
|
3451
3634
|
|
|
3452
|
-
|
|
3453
|
-
|
|
3454
|
-
|
|
3455
|
-
|
|
3456
|
-
|
|
3457
|
-
nodes: GitHubIssue[];
|
|
3458
|
-
};
|
|
3459
|
-
mentioned: {
|
|
3460
|
-
nodes: GitHubIssue[];
|
|
3635
|
+
type SearchCategory = {
|
|
3636
|
+
issueCount: number;
|
|
3637
|
+
pageInfo?: {
|
|
3638
|
+
endCursor?: string | null;
|
|
3639
|
+
hasNextPage: boolean;
|
|
3461
3640
|
};
|
|
3641
|
+
nodes: GitHubIssue[];
|
|
3642
|
+
};
|
|
3643
|
+
interface SearchResult {
|
|
3644
|
+
authored?: SearchCategory;
|
|
3645
|
+
assigned?: SearchCategory;
|
|
3646
|
+
mentioned?: SearchCategory;
|
|
3647
|
+
}
|
|
3648
|
+
interface SearchCursor {
|
|
3649
|
+
page?: number;
|
|
3650
|
+
authored?: string | null;
|
|
3651
|
+
assigned?: string | null;
|
|
3652
|
+
mentioned?: string | null;
|
|
3653
|
+
truncated?: boolean;
|
|
3462
3654
|
}
|
|
3463
3655
|
|
|
3464
|
-
|
|
3465
|
-
|
|
3466
|
-
|
|
3467
|
-
|
|
3468
|
-
|
|
3469
|
-
|
|
3470
|
-
|
|
3656
|
+
let cursor: SearchCursor | undefined;
|
|
3657
|
+
if (options?.cursor != null) {
|
|
3658
|
+
try {
|
|
3659
|
+
cursor = JSON.parse(options.cursor) as SearchCursor;
|
|
3660
|
+
} catch {}
|
|
3661
|
+
}
|
|
3662
|
+
const page = Math.max(1, Math.trunc(cursor?.page ?? 1));
|
|
3663
|
+
// A category is read when the caller asked for it AND it hasn't been exhausted (`null` cursor slot). An
|
|
3664
|
+
// excluded category needs no cursor bookkeeping: `nextCategoryCursor` reads a missing response category as
|
|
3665
|
+
// `null`, so it stays excluded across continuations on its own.
|
|
3666
|
+
const categories = options?.categories;
|
|
3667
|
+
const requested = {
|
|
3668
|
+
authored: categories?.authored ?? categories == null,
|
|
3669
|
+
assigned: categories?.assigned ?? categories == null,
|
|
3670
|
+
mentioned: categories?.mentioned ?? categories == null,
|
|
3671
|
+
};
|
|
3672
|
+
const includeAuthored = requested.authored && cursor?.authored !== null;
|
|
3673
|
+
const includeAssigned = requested.assigned && cursor?.assigned !== null;
|
|
3674
|
+
const includeMentioned = requested.mentioned && cursor?.mentioned !== null;
|
|
3675
|
+
// Reading nothing is the honest answer to "none of the three": widening back to the union would return
|
|
3676
|
+
// issues the caller explicitly excluded.
|
|
3677
|
+
if (!includeAuthored && !includeAssigned && !includeMentioned) {
|
|
3678
|
+
return { values: [], hasMore: false, page: page, truncated: cursor?.truncated === true };
|
|
3679
|
+
}
|
|
3471
3680
|
|
|
3472
3681
|
const query = `query searchMyIssues(
|
|
3473
3682
|
$authored: String!
|
|
3474
3683
|
$assigned: String!
|
|
3475
3684
|
$mentioned: String!
|
|
3685
|
+
$authoredCursor: String
|
|
3686
|
+
$assignedCursor: String
|
|
3687
|
+
$mentionedCursor: String
|
|
3688
|
+
$includeAuthored: Boolean!
|
|
3689
|
+
$includeAssigned: Boolean!
|
|
3690
|
+
$includeMentioned: Boolean!
|
|
3476
3691
|
$avatarSize: Int
|
|
3477
3692
|
) {
|
|
3478
|
-
authored: search(first: 100, query: $authored, type: ISSUE)
|
|
3693
|
+
authored: search(first: 100, after: $authoredCursor, query: $authored, type: ISSUE)
|
|
3694
|
+
@include(if: $includeAuthored) {
|
|
3695
|
+
issueCount
|
|
3696
|
+
pageInfo {
|
|
3697
|
+
endCursor
|
|
3698
|
+
hasNextPage
|
|
3699
|
+
}
|
|
3479
3700
|
nodes {
|
|
3480
3701
|
... on Issue {
|
|
3481
|
-
${
|
|
3702
|
+
${gqIssueFragment}
|
|
3703
|
+
${options?.includeBody ? 'body' : ''}
|
|
3482
3704
|
}
|
|
3483
3705
|
}
|
|
3484
3706
|
}
|
|
3485
|
-
assigned: search(first: 100, query: $assigned, type: ISSUE)
|
|
3707
|
+
assigned: search(first: 100, after: $assignedCursor, query: $assigned, type: ISSUE)
|
|
3708
|
+
@include(if: $includeAssigned) {
|
|
3709
|
+
issueCount
|
|
3710
|
+
pageInfo {
|
|
3711
|
+
endCursor
|
|
3712
|
+
hasNextPage
|
|
3713
|
+
}
|
|
3486
3714
|
nodes {
|
|
3487
3715
|
... on Issue {
|
|
3488
|
-
${
|
|
3716
|
+
${gqIssueFragment}
|
|
3717
|
+
${options?.includeBody ? 'body' : ''}
|
|
3489
3718
|
}
|
|
3490
3719
|
}
|
|
3491
3720
|
}
|
|
3492
|
-
mentioned: search(first: 100, query: $mentioned, type: ISSUE)
|
|
3721
|
+
mentioned: search(first: 100, after: $mentionedCursor, query: $mentioned, type: ISSUE)
|
|
3722
|
+
@include(if: $includeMentioned) {
|
|
3723
|
+
issueCount
|
|
3724
|
+
pageInfo {
|
|
3725
|
+
endCursor
|
|
3726
|
+
hasNextPage
|
|
3727
|
+
}
|
|
3493
3728
|
nodes {
|
|
3494
3729
|
... on Issue {
|
|
3495
|
-
${
|
|
3730
|
+
${gqIssueFragment}
|
|
3731
|
+
${options?.includeBody ? 'body' : ''}
|
|
3496
3732
|
}
|
|
3497
3733
|
}
|
|
3498
3734
|
}
|
|
@@ -3510,6 +3746,15 @@ export class GitHubApi {
|
|
|
3510
3746
|
}
|
|
3511
3747
|
|
|
3512
3748
|
const baseFilters = 'type:issue is:open archived:false';
|
|
3749
|
+
// `includeAllAssignees` broadens the assigned category from "assigned to me" to "assigned to anyone"
|
|
3750
|
+
// (`assignee:*` is GitHub's has-any-assignee qualifier). Authored/mentioned stay bound to `@me` — they're
|
|
3751
|
+
// user-relative by definition, so an all-assignees read still only surfaces the current user's authored
|
|
3752
|
+
// and mentioned issues plus every assigned-to-anyone issue.
|
|
3753
|
+
//
|
|
3754
|
+
// NOTE: GitHub only honors `assignee:*` when the search is scoped to a single repository (see GitHub's
|
|
3755
|
+
// issue-search docs). Callers using `includeAllAssignees` must scope the read via `repos` (the broaden
|
|
3756
|
+
// fan-out does this per org/repo); an unscoped account-wide `assignee:*` is not meaningful to GitHub.
|
|
3757
|
+
const assignedQualifier = options?.includeAllAssignees ? 'assignee:*' : 'assignee:@me';
|
|
3513
3758
|
try {
|
|
3514
3759
|
const rsp = await this.graphql<SearchResult>(
|
|
3515
3760
|
provider,
|
|
@@ -3517,8 +3762,14 @@ export class GitHubApi {
|
|
|
3517
3762
|
query,
|
|
3518
3763
|
{
|
|
3519
3764
|
authored: `${search} ${baseFilters} author:@me`.trim(),
|
|
3520
|
-
assigned: `${search} ${baseFilters}
|
|
3765
|
+
assigned: `${search} ${baseFilters} ${assignedQualifier}`.trim(),
|
|
3521
3766
|
mentioned: `${search} ${baseFilters} mentions:@me`.trim(),
|
|
3767
|
+
authoredCursor: cursor?.authored ?? undefined,
|
|
3768
|
+
assignedCursor: cursor?.assigned ?? undefined,
|
|
3769
|
+
mentionedCursor: cursor?.mentioned ?? undefined,
|
|
3770
|
+
includeAuthored: includeAuthored,
|
|
3771
|
+
includeAssigned: includeAssigned,
|
|
3772
|
+
includeMentioned: includeMentioned,
|
|
3522
3773
|
baseUrl: options?.baseUrl,
|
|
3523
3774
|
avatarSize: options?.avatarSize,
|
|
3524
3775
|
},
|
|
@@ -3530,14 +3781,48 @@ export class GitHubApi {
|
|
|
3530
3781
|
return fromGitHubIssue(issue, provider);
|
|
3531
3782
|
}
|
|
3532
3783
|
|
|
3533
|
-
if (rsp == null) return [];
|
|
3784
|
+
if (rsp == null) return { values: [], hasMore: false, page: page, truncated: false };
|
|
3534
3785
|
|
|
3535
3786
|
const results: IterableIterator<IssueShape> = uniqueBy(
|
|
3536
|
-
[...rsp.assigned
|
|
3787
|
+
[...(rsp.assigned?.nodes ?? []), ...(rsp.mentioned?.nodes ?? []), ...(rsp.authored?.nodes ?? [])].map(
|
|
3788
|
+
toQueryResult,
|
|
3789
|
+
),
|
|
3537
3790
|
r => r.url,
|
|
3538
3791
|
(original, _current) => original,
|
|
3539
3792
|
);
|
|
3540
|
-
|
|
3793
|
+
|
|
3794
|
+
const nextCategoryCursor = (category: SearchCategory | undefined): string | null => {
|
|
3795
|
+
if (category?.pageInfo?.hasNextPage && category.pageInfo.endCursor) {
|
|
3796
|
+
return category.pageInfo.endCursor;
|
|
3797
|
+
}
|
|
3798
|
+
return null;
|
|
3799
|
+
};
|
|
3800
|
+
const next: SearchCursor = {
|
|
3801
|
+
page: page + 1,
|
|
3802
|
+
authored: nextCategoryCursor(rsp.authored),
|
|
3803
|
+
assigned: nextCategoryCursor(rsp.assigned),
|
|
3804
|
+
mentioned: nextCategoryCursor(rsp.mentioned),
|
|
3805
|
+
};
|
|
3806
|
+
const hasMore = next.authored != null || next.assigned != null || next.mentioned != null;
|
|
3807
|
+
// GitHub search exposes at most 1,000 results per category. Paging removes the previous 100-item
|
|
3808
|
+
// truncation; only the upstream search ceiling or an unusable continuation remains incomplete.
|
|
3809
|
+
const continuationMissing = [rsp.authored, rsp.assigned, rsp.mentioned].some(
|
|
3810
|
+
category => category?.pageInfo?.hasNextPage === true && category.pageInfo.endCursor == null,
|
|
3811
|
+
);
|
|
3812
|
+
const truncated =
|
|
3813
|
+
cursor?.truncated === true ||
|
|
3814
|
+
(rsp.authored?.issueCount ?? 0) > 1000 ||
|
|
3815
|
+
(rsp.assigned?.issueCount ?? 0) > 1000 ||
|
|
3816
|
+
(rsp.mentioned?.issueCount ?? 0) > 1000 ||
|
|
3817
|
+
continuationMissing;
|
|
3818
|
+
next.truncated = truncated || undefined;
|
|
3819
|
+
return {
|
|
3820
|
+
values: [...results],
|
|
3821
|
+
cursor: hasMore ? JSON.stringify(next) : undefined,
|
|
3822
|
+
hasMore: hasMore,
|
|
3823
|
+
page: page,
|
|
3824
|
+
truncated: truncated,
|
|
3825
|
+
};
|
|
3541
3826
|
} catch (ex) {
|
|
3542
3827
|
throw this.handleException(ex, provider, scope);
|
|
3543
3828
|
}
|
|
@@ -3547,13 +3832,27 @@ export class GitHubApi {
|
|
|
3547
3832
|
async searchPullRequests(
|
|
3548
3833
|
provider: Provider,
|
|
3549
3834
|
token: GitHubTokenInfo,
|
|
3550
|
-
options?: {
|
|
3551
|
-
|
|
3835
|
+
options?: {
|
|
3836
|
+
search?: string;
|
|
3837
|
+
user?: string;
|
|
3838
|
+
repos?: string[];
|
|
3839
|
+
baseUrl?: string;
|
|
3840
|
+
avatarSize?: number;
|
|
3841
|
+
include?: PullRequestState[];
|
|
3842
|
+
},
|
|
3843
|
+
cancellation?: AbortSignal,
|
|
3552
3844
|
): Promise<PullRequest[]> {
|
|
3553
3845
|
const scope = getScopedLogger();
|
|
3846
|
+
const pageSize = 10;
|
|
3847
|
+
const include = options?.include?.length ? options.include : undefined;
|
|
3848
|
+
const requiresPagination = shouldPaginateGitHubSearchState(include);
|
|
3554
3849
|
|
|
3555
3850
|
interface SearchResult {
|
|
3556
3851
|
search: {
|
|
3852
|
+
pageInfo: {
|
|
3853
|
+
endCursor?: string | null;
|
|
3854
|
+
hasNextPage: boolean;
|
|
3855
|
+
};
|
|
3557
3856
|
nodes: GitHubPullRequest[];
|
|
3558
3857
|
};
|
|
3559
3858
|
}
|
|
@@ -3561,9 +3860,14 @@ export class GitHubApi {
|
|
|
3561
3860
|
try {
|
|
3562
3861
|
const query = `query searchPullRequests(
|
|
3563
3862
|
$searchQuery: String!
|
|
3863
|
+
$cursor: String
|
|
3564
3864
|
$avatarSize: Int
|
|
3565
3865
|
) {
|
|
3566
|
-
|
|
3866
|
+
search(first: ${pageSize}, after: $cursor, query: $searchQuery, type: ISSUE) {
|
|
3867
|
+
pageInfo {
|
|
3868
|
+
endCursor
|
|
3869
|
+
hasNextPage
|
|
3870
|
+
}
|
|
3567
3871
|
nodes {
|
|
3568
3872
|
...on PullRequest {
|
|
3569
3873
|
${gqlPullRequestFragment}
|
|
@@ -3583,22 +3887,44 @@ export class GitHubApi {
|
|
|
3583
3887
|
search += `${repo}${options.repos.join(repo)}`;
|
|
3584
3888
|
}
|
|
3585
3889
|
|
|
3586
|
-
const
|
|
3587
|
-
|
|
3588
|
-
|
|
3589
|
-
|
|
3590
|
-
|
|
3591
|
-
|
|
3592
|
-
|
|
3593
|
-
|
|
3594
|
-
|
|
3595
|
-
|
|
3596
|
-
|
|
3597
|
-
|
|
3598
|
-
|
|
3890
|
+
const searchQuery = ['is:pr', toGitHubSearchStateQualifier(include), 'archived:false', search.trim()]
|
|
3891
|
+
.filter(Boolean)
|
|
3892
|
+
.join(' ');
|
|
3893
|
+
|
|
3894
|
+
// Bound the paginated case with a defensive page backstop like the other paged provider drains, so a
|
|
3895
|
+
// large, low-match result set can't fan out into an unbounded request loop.
|
|
3896
|
+
const maxSearchPages = 20;
|
|
3897
|
+
let cursor: string | undefined;
|
|
3898
|
+
const results: PullRequest[] = [];
|
|
3899
|
+
for (let page = 0; page < maxSearchPages; page++) {
|
|
3900
|
+
const rsp = await this.graphql<SearchResult>(
|
|
3901
|
+
provider,
|
|
3902
|
+
token,
|
|
3903
|
+
query,
|
|
3904
|
+
{
|
|
3905
|
+
searchQuery: searchQuery,
|
|
3906
|
+
cursor: cursor,
|
|
3907
|
+
baseUrl: options?.baseUrl,
|
|
3908
|
+
avatarSize: options?.avatarSize,
|
|
3909
|
+
},
|
|
3910
|
+
scope,
|
|
3911
|
+
cancellation,
|
|
3912
|
+
);
|
|
3913
|
+
if (rsp == null) return [];
|
|
3599
3914
|
|
|
3600
|
-
|
|
3601
|
-
|
|
3915
|
+
const pageResults = filterPullRequestsBySearchState(
|
|
3916
|
+
rsp.search.nodes.map(pr => fromGitHubPullRequest(pr, provider)),
|
|
3917
|
+
include,
|
|
3918
|
+
);
|
|
3919
|
+
results.push(...pageResults);
|
|
3920
|
+
|
|
3921
|
+
cursor = rsp.search.pageInfo.endCursor ?? undefined;
|
|
3922
|
+
if (!requiresPagination || results.length >= pageSize || !rsp.search.pageInfo.hasNextPage) {
|
|
3923
|
+
break;
|
|
3924
|
+
}
|
|
3925
|
+
}
|
|
3926
|
+
|
|
3927
|
+
return results.slice(0, pageSize);
|
|
3602
3928
|
} catch (ex) {
|
|
3603
3929
|
throw this.handleException(ex, provider, scope);
|
|
3604
3930
|
}
|
|
@@ -3618,7 +3944,7 @@ export class GitHubApi {
|
|
|
3618
3944
|
nodeId: string,
|
|
3619
3945
|
expectedSourceSha: string,
|
|
3620
3946
|
options?: { mergeMethod?: PullRequestMergeMethod; baseUrl?: string },
|
|
3621
|
-
cancellation?:
|
|
3947
|
+
cancellation?: AbortSignal,
|
|
3622
3948
|
): Promise<boolean> {
|
|
3623
3949
|
const scope = getScopedLogger();
|
|
3624
3950
|
interface QueryResult {
|
|
@@ -3680,3 +4006,45 @@ export class GitHubApi {
|
|
|
3680
4006
|
function isGitHubDotCom(options?: { baseUrl?: string }) {
|
|
3681
4007
|
return options?.baseUrl == null || options.baseUrl === 'https://api.github.com';
|
|
3682
4008
|
}
|
|
4009
|
+
|
|
4010
|
+
// Translates the requested PR states into a GitHub search state qualifier. GitHub search treats
|
|
4011
|
+
// `is:closed` as closed-or-merged, `is:merged` as its subset, and `is:unmerged` as open + closed
|
|
4012
|
+
// (not-merged), so `closed` and `merged` (distinct in our model) map to `is:closed is:unmerged` and
|
|
4013
|
+
// `is:merged`. `undefined` preserves the historical open-only default.
|
|
4014
|
+
export function toGitHubSearchStateQualifier(include: PullRequestState[] | undefined): string {
|
|
4015
|
+
if (include == null) return 'is:open';
|
|
4016
|
+
|
|
4017
|
+
const opened = include.includes('opened');
|
|
4018
|
+
const closed = include.includes('closed');
|
|
4019
|
+
const merged = include.includes('merged');
|
|
4020
|
+
|
|
4021
|
+
if (opened && closed && merged) return ''; // all states -> no qualifier
|
|
4022
|
+
if (opened && closed) return 'is:unmerged';
|
|
4023
|
+
if (closed && merged) return 'is:closed';
|
|
4024
|
+
// `opened && merged` isn't expressible as a single AND qualifier; omit it here and post-filter.
|
|
4025
|
+
if (opened && merged) return '';
|
|
4026
|
+
if (opened) return 'is:open';
|
|
4027
|
+
if (merged) return 'is:merged';
|
|
4028
|
+
if (closed) return 'is:closed is:unmerged';
|
|
4029
|
+
return 'is:open'; // empty include -> default
|
|
4030
|
+
}
|
|
4031
|
+
|
|
4032
|
+
export function filterPullRequestsBySearchState<T extends { state: PullRequestState }>(
|
|
4033
|
+
pullRequests: T[],
|
|
4034
|
+
include: PullRequestState[] | undefined,
|
|
4035
|
+
): T[] {
|
|
4036
|
+
const states = include?.length ? include : (['opened'] satisfies PullRequestState[]);
|
|
4037
|
+
const allowedStates = new Set<PullRequestState>(states);
|
|
4038
|
+
// There are only 3 possible states, so a full set means every state is allowed; use the deduped set
|
|
4039
|
+
// size rather than the raw length so duplicates (e.g. `['opened', 'opened', 'closed']`) don't skip filtering.
|
|
4040
|
+
if (allowedStates.size === 3) return pullRequests;
|
|
4041
|
+
|
|
4042
|
+
return pullRequests.filter(pr => allowedStates.has(pr.state));
|
|
4043
|
+
}
|
|
4044
|
+
|
|
4045
|
+
function shouldPaginateGitHubSearchState(include: PullRequestState[] | undefined): boolean {
|
|
4046
|
+
if (include == null || include.length === 0) return false;
|
|
4047
|
+
|
|
4048
|
+
const uniqueStates = new Set<PullRequestState>(include);
|
|
4049
|
+
return uniqueStates.size === 2 && uniqueStates.has('opened') && uniqueStates.has('merged');
|
|
4050
|
+
}
|