@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
|
@@ -0,0 +1,1622 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
Account,
|
|
3
|
+
ActionablePullRequest,
|
|
4
|
+
AnyEntityIdentifierInput,
|
|
5
|
+
AzureDevOps,
|
|
6
|
+
AzureOrganization,
|
|
7
|
+
AzureProject,
|
|
8
|
+
AzureSetPullRequestInput,
|
|
9
|
+
Bitbucket,
|
|
10
|
+
BitbucketServer,
|
|
11
|
+
BitbucketWorkspaceStub,
|
|
12
|
+
CollectionMetadata,
|
|
13
|
+
CursorPageInput,
|
|
14
|
+
EnterpriseOptions,
|
|
15
|
+
GetRepoInput,
|
|
16
|
+
GitBuildStatusState as GitBuildStatusStateType,
|
|
17
|
+
GitHub,
|
|
18
|
+
GitIssueState as GitIssueStateType,
|
|
19
|
+
GitLab,
|
|
20
|
+
GitLabGroup,
|
|
21
|
+
GitMergeStrategy,
|
|
22
|
+
GitPullRequest,
|
|
23
|
+
GitPullRequestMergeableState as GitPullRequestMergeableStateType,
|
|
24
|
+
GitPullRequestReviewState as GitPullRequestReviewStateType,
|
|
25
|
+
GitPullRequestState as GitPullRequestStateType,
|
|
26
|
+
GitRepository,
|
|
27
|
+
GitRepositoryRemoteInfo,
|
|
28
|
+
Jira,
|
|
29
|
+
JiraProject,
|
|
30
|
+
JiraResource,
|
|
31
|
+
Linear,
|
|
32
|
+
LinearOrganization,
|
|
33
|
+
LinearTeam,
|
|
34
|
+
NumberedPageInput,
|
|
35
|
+
Organization,
|
|
36
|
+
Issue as ProviderApiIssue,
|
|
37
|
+
PullRequestWithUniqueID,
|
|
38
|
+
RequestFunction,
|
|
39
|
+
RequestOptions,
|
|
40
|
+
Response,
|
|
41
|
+
SetPullRequestInput,
|
|
42
|
+
Trello,
|
|
43
|
+
} from '@gitkraken/provider-apis';
|
|
44
|
+
import entityIdentifiersModule from '@gitkraken/provider-apis/entity-identifiers';
|
|
45
|
+
import providerUtilsModule from '@gitkraken/provider-apis/provider-utils';
|
|
46
|
+
import type { Account as UserAccount } from '../../../git/models/author.js';
|
|
47
|
+
import type { IssueMember, IssueProject, IssueShape, IssueStateFilter } from '../../../git/models/issue.js';
|
|
48
|
+
import { Issue, RepositoryAccessLevel } from '../../../git/models/issue.js';
|
|
49
|
+
import type {
|
|
50
|
+
PullRequestMember,
|
|
51
|
+
PullRequestRef,
|
|
52
|
+
PullRequestRefs,
|
|
53
|
+
PullRequestRepositoryIdentityDescriptor,
|
|
54
|
+
PullRequestReviewer,
|
|
55
|
+
PullRequestState,
|
|
56
|
+
PullRequestStateFilter,
|
|
57
|
+
} from '../../../git/models/pullRequest.js';
|
|
58
|
+
import {
|
|
59
|
+
PullRequest,
|
|
60
|
+
PullRequestMergeableState,
|
|
61
|
+
PullRequestReviewDecision,
|
|
62
|
+
PullRequestReviewState,
|
|
63
|
+
PullRequestStatusCheckRollupState,
|
|
64
|
+
} from '../../../git/models/pullRequest.js';
|
|
65
|
+
import type { Provider, ProviderReference } from '../../../git/models/remoteProvider.js';
|
|
66
|
+
import type { ProviderScope } from '../../../git/models/resourceDescriptor.js';
|
|
67
|
+
import { gitSuffixRegex } from '../../../git/utils/remote.utils.js';
|
|
68
|
+
import type { PagedResult } from '../../../utils/paging.js';
|
|
69
|
+
import { equalsIgnoreCase } from '../../../utils/string.js';
|
|
70
|
+
import type { IntegrationIds } from '../constants.js';
|
|
71
|
+
import {
|
|
72
|
+
GitCloudHostIntegrationId,
|
|
73
|
+
GitSelfManagedHostIntegrationId,
|
|
74
|
+
IssuesCloudHostIntegrationId,
|
|
75
|
+
} from '../constants.js';
|
|
76
|
+
import type { Integration, IntegrationType } from '../models/integration.js';
|
|
77
|
+
import { IssueFilter, PullRequestFilter } from '../providerFilters.js';
|
|
78
|
+
|
|
79
|
+
export { IssueFilter, PullRequestFilter } from '../providerFilters.js';
|
|
80
|
+
import type { ProviderRepositoryShape } from '../results.js';
|
|
81
|
+
|
|
82
|
+
export type { ProviderOrganization, ProviderRepositoryShape } from '../results.js';
|
|
83
|
+
import { getEntityIdentifierInput } from './utils.js';
|
|
84
|
+
|
|
85
|
+
type GitBuildStatusState = GitBuildStatusStateType;
|
|
86
|
+
type GitIssueState = GitIssueStateType;
|
|
87
|
+
type GitPullRequestMergeableState = GitPullRequestMergeableStateType;
|
|
88
|
+
type GitPullRequestReviewState = GitPullRequestReviewStateType;
|
|
89
|
+
type GitPullRequestState = GitPullRequestStateType;
|
|
90
|
+
|
|
91
|
+
const { EntityIdentifierUtils } = entityIdentifiersModule;
|
|
92
|
+
const { GitProviderUtils } = providerUtilsModule;
|
|
93
|
+
|
|
94
|
+
// Local runtime copies of the `@gitkraken/provider-apis` string enums. Duplicated (not imported as
|
|
95
|
+
// values) because the SDK ships as CJS whose named enum exports can't be statically imported as ESM
|
|
96
|
+
// values from the bundled `dist`. Exported so the enum-parity test can deep-equal them against the
|
|
97
|
+
// real SDK enums and turn any upstream drift into a test failure instead of a silent mismatch.
|
|
98
|
+
export const GitBuildStatusState = {
|
|
99
|
+
ActionRequired: 'ACTION_REQUIRED' as GitBuildStatusState,
|
|
100
|
+
Cancelled: 'CANCELLED' as GitBuildStatusState,
|
|
101
|
+
Error: 'ERROR' as GitBuildStatusState,
|
|
102
|
+
Failed: 'FAILED' as GitBuildStatusState,
|
|
103
|
+
Pending: 'PENDING' as GitBuildStatusState,
|
|
104
|
+
Running: 'RUNNING' as GitBuildStatusState,
|
|
105
|
+
Skipped: 'SKIPPED' as GitBuildStatusState,
|
|
106
|
+
Success: 'SUCCESS' as GitBuildStatusState,
|
|
107
|
+
Warning: 'WARNING' as GitBuildStatusState,
|
|
108
|
+
OptionalActionRequired: 'OPTIONAL_ACTION_REQUIRED' as GitBuildStatusState,
|
|
109
|
+
} as const;
|
|
110
|
+
|
|
111
|
+
export const GitIssueState = {
|
|
112
|
+
Open: 'OPEN' as GitIssueState,
|
|
113
|
+
Closed: 'CLOSED' as GitIssueState,
|
|
114
|
+
} as const;
|
|
115
|
+
|
|
116
|
+
export const GitPullRequestState = {
|
|
117
|
+
Open: 'OPEN' as GitPullRequestState,
|
|
118
|
+
Closed: 'CLOSED' as GitPullRequestState,
|
|
119
|
+
Merged: 'MERGED' as GitPullRequestState,
|
|
120
|
+
} as const;
|
|
121
|
+
|
|
122
|
+
export const GitPullRequestReviewState = {
|
|
123
|
+
Approved: 'APPROVED' as GitPullRequestReviewState,
|
|
124
|
+
ChangesRequested: 'CHANGES_REQUESTED' as GitPullRequestReviewState,
|
|
125
|
+
Commented: 'COMMENTED' as GitPullRequestReviewState,
|
|
126
|
+
ReviewRequested: 'REVIEW_REQUESTED' as GitPullRequestReviewState,
|
|
127
|
+
} as const;
|
|
128
|
+
|
|
129
|
+
export const GitPullRequestMergeableState = {
|
|
130
|
+
Behind: 'BEHIND' as GitPullRequestMergeableState,
|
|
131
|
+
Blocked: 'BLOCKED' as GitPullRequestMergeableState,
|
|
132
|
+
Conflicts: 'CONFLICTS' as GitPullRequestMergeableState,
|
|
133
|
+
FailingChecks: 'FAILING_CHECKS' as GitPullRequestMergeableState,
|
|
134
|
+
Mergeable: 'MERGEABLE' as GitPullRequestMergeableState,
|
|
135
|
+
Unknown: 'UNKNOWN' as GitPullRequestMergeableState,
|
|
136
|
+
UnknownAndBlocked: 'UNKNOWN_AND_BLOCKED' as GitPullRequestMergeableState,
|
|
137
|
+
Unstable: 'UNSTABLE' as GitPullRequestMergeableState,
|
|
138
|
+
} as const;
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* Forward-only host type — the package only sets `EnrichablePullRequest.enrichable`
|
|
142
|
+
* for the host to consume. Typed as `any` to avoid duplicating the host's
|
|
143
|
+
* `EnrichableItem` shape.
|
|
144
|
+
*/
|
|
145
|
+
type EnrichableItem = any;
|
|
146
|
+
|
|
147
|
+
export type ProviderAccount = Account;
|
|
148
|
+
export type ProviderReposInput = (string | number)[] | GetRepoInput[];
|
|
149
|
+
export type ProviderRepoInput = GetRepoInput;
|
|
150
|
+
export type ProviderPullRequest = GitPullRequest;
|
|
151
|
+
export type ProviderRepository = GitRepository;
|
|
152
|
+
export type ProviderIssue = ProviderApiIssue;
|
|
153
|
+
export type ProviderEnterpriseOptions = EnterpriseOptions;
|
|
154
|
+
export type ProviderJiraProject = JiraProject;
|
|
155
|
+
export type ProviderJiraResource = JiraResource;
|
|
156
|
+
export type ProviderLinearTeam = LinearTeam;
|
|
157
|
+
export type ProviderLinearOrganization = LinearOrganization;
|
|
158
|
+
export type ProviderAzureProject = AzureProject;
|
|
159
|
+
export type ProviderAzureResource = AzureOrganization;
|
|
160
|
+
export type ProviderBitbucketResource = BitbucketWorkspaceStub;
|
|
161
|
+
export type ProviderGitHubOrganization = Organization;
|
|
162
|
+
export type ProviderGitLabGroup = GitLabGroup;
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* Returns an account-wide PR identity. Provider PR ids are commonly scoped to a repository or organization,
|
|
166
|
+
* so an id alone is never safe for deduplication across a multi-repository fan-out. Repository identity wins
|
|
167
|
+
* when available so the same row still deduplicates when a later facet adds or removes its URL.
|
|
168
|
+
*/
|
|
169
|
+
export function getProviderPullRequestIdentity(
|
|
170
|
+
pr: Pick<ProviderPullRequest, 'id' | 'repository' | 'url'>,
|
|
171
|
+
): string | undefined {
|
|
172
|
+
const repository = pr.repository as
|
|
173
|
+
| {
|
|
174
|
+
id?: string | number;
|
|
175
|
+
name?: string;
|
|
176
|
+
namespace?: string;
|
|
177
|
+
owner?: { login?: string } | string;
|
|
178
|
+
project?: string;
|
|
179
|
+
}
|
|
180
|
+
| undefined;
|
|
181
|
+
const urlIdentity = pr.url != null && pr.url.trim() !== '' ? `url:${pr.url}` : undefined;
|
|
182
|
+
if (repository == null) return urlIdentity;
|
|
183
|
+
|
|
184
|
+
const owner = typeof repository.owner === 'string' ? repository.owner : repository.owner?.login;
|
|
185
|
+
const repositoryId = repository.id != null ? String(repository.id).trim() : '';
|
|
186
|
+
if (repositoryId !== '') return `repository:${repositoryId}:pull-request:${pr.id}`;
|
|
187
|
+
|
|
188
|
+
const name = repository.name?.trim() ?? '';
|
|
189
|
+
const namespace = (repository.namespace ?? owner)?.trim() ?? '';
|
|
190
|
+
const project = repository.project?.trim() ?? '';
|
|
191
|
+
if (name !== '' && (namespace !== '' || project !== '')) {
|
|
192
|
+
return `repository:${namespace}/${project}/${name}:pull-request:${pr.id}`;
|
|
193
|
+
}
|
|
194
|
+
return urlIdentity;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
export type ProviderHierarchyResult<T> = PagedResult<T> & {
|
|
198
|
+
readonly truncated?: boolean;
|
|
199
|
+
/**
|
|
200
|
+
* SDK collection metadata merged across the drained pages. Independent from the local `truncated` backstop:
|
|
201
|
+
* a page-drain backstop stays visible even if every fetched page reported `complete`, and SDK
|
|
202
|
+
* incompleteness is preserved even when the drain finished within its page budget.
|
|
203
|
+
*/
|
|
204
|
+
readonly metadata?: CollectionMetadata;
|
|
205
|
+
};
|
|
206
|
+
|
|
207
|
+
/**
|
|
208
|
+
* A normalized {@link PagedResult} that additionally carries the SDK's collection {@link CollectionMetadata}
|
|
209
|
+
* (completeness + per-scope failures). Named to avoid colliding with the public ProviderBackend
|
|
210
|
+
* `ProviderPagedResult` in `results.ts`: this is the integration-local carrier between the `ProvidersApi`
|
|
211
|
+
* boundary and the code that maps metadata into warnings/truncation. `metadata` is optional so providers and
|
|
212
|
+
* test doubles that predate the SDK metadata contract keep behaving exactly as before.
|
|
213
|
+
*/
|
|
214
|
+
export type ProviderApiPagedResult<T> = PagedResult<T> & {
|
|
215
|
+
readonly metadata?: CollectionMetadata;
|
|
216
|
+
};
|
|
217
|
+
|
|
218
|
+
/**
|
|
219
|
+
* A non-paged collection result carrying SDK {@link CollectionMetadata}. Used for fan-out reads that return a
|
|
220
|
+
* flat set of values with completeness/failure metadata but no provider-native pagination (e.g. Jira project
|
|
221
|
+
* discovery across resources, Trello board search).
|
|
222
|
+
*/
|
|
223
|
+
export type ProviderApiCollectionResult<T> = {
|
|
224
|
+
readonly values: NonNullable<T>[];
|
|
225
|
+
readonly metadata?: CollectionMetadata;
|
|
226
|
+
};
|
|
227
|
+
|
|
228
|
+
export const ProviderPullRequestReviewState = GitPullRequestReviewState;
|
|
229
|
+
export const ProviderBuildStatusState = GitBuildStatusState;
|
|
230
|
+
export type ProviderRequestFunction = RequestFunction;
|
|
231
|
+
export type ProviderRequestResponse<T> = Response<T>;
|
|
232
|
+
export type ProviderRequestOptions = RequestOptions;
|
|
233
|
+
|
|
234
|
+
export enum PagingMode {
|
|
235
|
+
Project = 'project',
|
|
236
|
+
Repo = 'repo',
|
|
237
|
+
Repos = 'repos',
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
export interface PagingInput {
|
|
241
|
+
cursor?: string | null;
|
|
242
|
+
page?: number;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
export interface PagedRepoInput {
|
|
246
|
+
repo: GetRepoInput;
|
|
247
|
+
cursor?: string;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
export interface PagedProjectInput {
|
|
251
|
+
namespace: string;
|
|
252
|
+
project: string;
|
|
253
|
+
cursor?: string;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
export interface GetPullRequestsOptions {
|
|
257
|
+
authorLogin?: string;
|
|
258
|
+
assigneeLogins?: string[];
|
|
259
|
+
reviewRequestedLogin?: string;
|
|
260
|
+
// Reviewer filters keyed differently per provider: GitHub/GitLab use reviewRequestedLogin (login),
|
|
261
|
+
// Bitbucket/Azure DevOps use reviewerId (account id), Bitbucket Server uses reviewerLogin (login).
|
|
262
|
+
reviewerId?: string;
|
|
263
|
+
reviewerLogin?: string;
|
|
264
|
+
mentionLogin?: string;
|
|
265
|
+
// PR states to include; when omitted the provider returns its default (open only).
|
|
266
|
+
states?: GitPullRequestState[];
|
|
267
|
+
query?: string;
|
|
268
|
+
cursor?: string; // stringified JSON object of type { type: 'cursor' | 'page'; value: string | number } | {}
|
|
269
|
+
baseUrl?: string;
|
|
270
|
+
// 1-based page to request from numbered-page providers; takes precedence over a page-typed cursor.
|
|
271
|
+
page?: number;
|
|
272
|
+
// Items to request per page (numbered-page providers, plus GitHub's maxPageSize).
|
|
273
|
+
pageSize?: number;
|
|
274
|
+
// Opt in to repository remote metadata (clone URLs) when the PR payload lacks it. Only Azure DevOps
|
|
275
|
+
// acts on this today (extra API call); it is a no-op for the other providers.
|
|
276
|
+
includeRemoteInfo?: boolean;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
export interface GetPullRequestsForUserOptions {
|
|
280
|
+
includeFromArchivedRepos?: boolean;
|
|
281
|
+
cursor?: string; // stringified JSON object of type { type: 'cursor' | 'page'; value: string | number } | {}
|
|
282
|
+
baseUrl?: string;
|
|
283
|
+
// PR states to include; when omitted the provider returns its default (open only).
|
|
284
|
+
states?: GitPullRequestState[];
|
|
285
|
+
/**
|
|
286
|
+
* Items to request per page. Worth setting explicitly on an account-wide read that gets DRAINED: each
|
|
287
|
+
* provider falls back to its own historical page size when this is omitted, and GitHub's is 15
|
|
288
|
+
* (`MAX_PR_PAGE_SIZE`), so a drain pays ~7x the round trips of the 100 its search actually allows.
|
|
289
|
+
*/
|
|
290
|
+
pageSize?: number;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
export interface GetPullRequestsForUserInput extends GetPullRequestsForUserOptions {
|
|
294
|
+
userId: string;
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
export interface GetPullRequestsAssociatedWithUserInput extends GetPullRequestsForUserOptions {
|
|
298
|
+
username: string;
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
export interface GetPullRequestsForRepoInput extends GetPullRequestsOptions {
|
|
302
|
+
repo: GetRepoInput;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
export interface GetPullRequestsForReposInput extends GetPullRequestsOptions {
|
|
306
|
+
repos: GetRepoInput[];
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
export interface GetPullRequestsForRepoIdsInput extends GetPullRequestsOptions {
|
|
310
|
+
repoIds: (string | number)[];
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
export interface GetIssuesOptions {
|
|
314
|
+
authorLogin?: string;
|
|
315
|
+
assigneeLogins?: string[];
|
|
316
|
+
mentionLogin?: string;
|
|
317
|
+
// Issue states to include; when omitted the provider returns its default (open only).
|
|
318
|
+
states?: GitIssueState[];
|
|
319
|
+
cursor?: string; // stringified JSON object of type { type: 'cursor' | 'page'; value: string | number } | {}
|
|
320
|
+
baseUrl?: string;
|
|
321
|
+
// 1-based page to request from numbered-page providers; takes precedence over a page-typed cursor.
|
|
322
|
+
page?: number;
|
|
323
|
+
// Items to request per page (numbered-page providers, plus GitHub's maxPageSize).
|
|
324
|
+
pageSize?: number;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
export interface GetIssuesForRepoInput extends GetIssuesOptions {
|
|
328
|
+
repo: GetRepoInput;
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
export interface GetIssuesForReposInput extends GetIssuesOptions {
|
|
332
|
+
repos: GetRepoInput[];
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
export interface GetIssuesForRepoIdsInput extends GetIssuesOptions {
|
|
336
|
+
repoIds: (string | number)[];
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
export interface GetIssuesForProjectInput extends GetIssuesOptions {
|
|
340
|
+
project: string;
|
|
341
|
+
resourceId: string;
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
export interface GetIssuesForAzureProjectInput extends GetIssuesOptions {
|
|
345
|
+
namespace: string;
|
|
346
|
+
project: string;
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
export interface GetReposOptions {
|
|
350
|
+
cursor?: string; // stringified JSON object of type { type: 'cursor' | 'page'; value: string | number } | {}
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
export interface GetReposForAzureProjectInput {
|
|
354
|
+
namespace: string;
|
|
355
|
+
project: string;
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
export interface PageInfo {
|
|
359
|
+
hasNextPage: boolean;
|
|
360
|
+
endCursor?: string | null;
|
|
361
|
+
nextPage?: number | null;
|
|
362
|
+
// Numbered-page providers (Bitbucket, Bitbucket Server, Azure DevOps) additionally report these.
|
|
363
|
+
currentPage?: number | null;
|
|
364
|
+
totalPages?: number | null;
|
|
365
|
+
totalCount?: number | null;
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
export type GetRepoFn = (
|
|
369
|
+
input: ProviderRepoInput,
|
|
370
|
+
options?: EnterpriseOptions,
|
|
371
|
+
) => Promise<{ data: ProviderRepository }>;
|
|
372
|
+
export type GetRepoOfProjectFn = (
|
|
373
|
+
input: ProviderRepoInput & { project: string },
|
|
374
|
+
options?: EnterpriseOptions,
|
|
375
|
+
) => Promise<{ data: ProviderRepository }>;
|
|
376
|
+
|
|
377
|
+
export type GetPullRequestsForReposFn = (
|
|
378
|
+
input: (GetPullRequestsForReposInput | GetPullRequestsForRepoIdsInput) & PagingInput,
|
|
379
|
+
options?: EnterpriseOptions,
|
|
380
|
+
// `metadata` carries SDK collection completeness/failures for multi-repo fan-outs (Bitbucket, Azure DevOps,
|
|
381
|
+
// Bitbucket Server); `pageInfo` is present for the cursor-based aggregate (GitHub). Both are optional so
|
|
382
|
+
// each provider only sets what it actually reports.
|
|
383
|
+
) => Promise<{ data: ProviderPullRequest[]; pageInfo?: PageInfo; metadata?: CollectionMetadata }>;
|
|
384
|
+
|
|
385
|
+
export type GetPullRequestsForRepoFn = (
|
|
386
|
+
input: GetPullRequestsForRepoInput & PagingInput,
|
|
387
|
+
options?: EnterpriseOptions,
|
|
388
|
+
) => Promise<{ data: ProviderPullRequest[]; pageInfo?: PageInfo }>;
|
|
389
|
+
|
|
390
|
+
export type GetPullRequestsForUserFn = (
|
|
391
|
+
input: GetPullRequestsForUserInput | GetPullRequestsAssociatedWithUserInput,
|
|
392
|
+
options?: EnterpriseOptions,
|
|
393
|
+
) => Promise<{ data: ProviderPullRequest[]; pageInfo?: PageInfo }>;
|
|
394
|
+
|
|
395
|
+
export type GetPullRequestsForAzureProjectsFn = (
|
|
396
|
+
input: {
|
|
397
|
+
projects: { namespace: string; project: string }[];
|
|
398
|
+
authorLogin?: string;
|
|
399
|
+
assigneeLogins?: string[];
|
|
400
|
+
reviewerId?: string;
|
|
401
|
+
states?: GitPullRequestState[];
|
|
402
|
+
repo?: ProviderRepoInput;
|
|
403
|
+
},
|
|
404
|
+
options?: EnterpriseOptions,
|
|
405
|
+
// Aggregate multi-project fan-out: no `pageInfo` (call getPullRequestsForAzureProject for that), but SDK
|
|
406
|
+
// collection metadata reports per-project completeness/failures.
|
|
407
|
+
) => Promise<{ data: ProviderPullRequest[]; metadata?: CollectionMetadata }>;
|
|
408
|
+
|
|
409
|
+
/** Single Azure project PR read, paginated by number (unlike the aggregate {@link GetPullRequestsForAzureProjectsFn}). */
|
|
410
|
+
export type GetPullRequestsForAzureProjectFn = (
|
|
411
|
+
input: {
|
|
412
|
+
namespace: string;
|
|
413
|
+
project: string;
|
|
414
|
+
authorLogin?: string;
|
|
415
|
+
assigneeLogins?: string[];
|
|
416
|
+
reviewerId?: string;
|
|
417
|
+
states?: GitPullRequestState[];
|
|
418
|
+
repo?: ProviderRepoInput;
|
|
419
|
+
} & PagingInput,
|
|
420
|
+
options?: EnterpriseOptions,
|
|
421
|
+
) => Promise<{ data: ProviderPullRequest[]; pageInfo: { hasNextPage: boolean; nextPage: number | null } }>;
|
|
422
|
+
|
|
423
|
+
export type MergePullRequestFn =
|
|
424
|
+
| ((
|
|
425
|
+
input: {
|
|
426
|
+
pullRequest: {
|
|
427
|
+
headRef: {
|
|
428
|
+
oid: string | null;
|
|
429
|
+
} | null;
|
|
430
|
+
version?: number; // Used by BitbucketServer
|
|
431
|
+
} & SetPullRequestInput;
|
|
432
|
+
mergeStrategy?: GitMergeStrategy;
|
|
433
|
+
},
|
|
434
|
+
options?: EnterpriseOptions,
|
|
435
|
+
) => Promise<void>)
|
|
436
|
+
| ((
|
|
437
|
+
input: {
|
|
438
|
+
pullRequest: {
|
|
439
|
+
headRef: {
|
|
440
|
+
oid: string | null;
|
|
441
|
+
} | null;
|
|
442
|
+
} & SetPullRequestInput;
|
|
443
|
+
mergeStrategy?: GitMergeStrategy.Squash;
|
|
444
|
+
},
|
|
445
|
+
options?: EnterpriseOptions,
|
|
446
|
+
) => Promise<void>)
|
|
447
|
+
| ((
|
|
448
|
+
input: {
|
|
449
|
+
pullRequest: {
|
|
450
|
+
headRef: {
|
|
451
|
+
oid: string;
|
|
452
|
+
};
|
|
453
|
+
} & AzureSetPullRequestInput;
|
|
454
|
+
mergeStrategy?:
|
|
455
|
+
| GitMergeStrategy.MergeCommit
|
|
456
|
+
| GitMergeStrategy.Rebase
|
|
457
|
+
| GitMergeStrategy.RebaseThenMergeCommit
|
|
458
|
+
| GitMergeStrategy.Squash;
|
|
459
|
+
},
|
|
460
|
+
options?: EnterpriseOptions,
|
|
461
|
+
) => Promise<void>);
|
|
462
|
+
|
|
463
|
+
export type GetIssueFn = (
|
|
464
|
+
input:
|
|
465
|
+
| { resourceId: string; number: string } // jira
|
|
466
|
+
| { namespace: string; name: string; number: string }, // gitlab
|
|
467
|
+
options?: EnterpriseOptions,
|
|
468
|
+
) => Promise<{ data: ProviderIssue }>;
|
|
469
|
+
|
|
470
|
+
export type GetIssuesForReposFn = (
|
|
471
|
+
input: (GetIssuesForReposInput | GetIssuesForRepoIdsInput) & PagingInput,
|
|
472
|
+
options?: EnterpriseOptions,
|
|
473
|
+
) => Promise<{ data: ProviderIssue[]; pageInfo?: PageInfo }>;
|
|
474
|
+
|
|
475
|
+
export type GetIssuesForCurrentUserInput = PagingInput & {
|
|
476
|
+
// GitLab's account-wide REST read (`GET /issues`): `scope` controls breadth ('assigned_to_me' vs 'all') and
|
|
477
|
+
// the username fields independently narrow a broad read to a specific assignee or author. Other providers
|
|
478
|
+
// (Linear) ignore these and page purely off the cursor.
|
|
479
|
+
scope?: 'assigned_to_me' | 'all';
|
|
480
|
+
assigneeUsername?: string;
|
|
481
|
+
authorUsername?: string;
|
|
482
|
+
pageSize?: number;
|
|
483
|
+
};
|
|
484
|
+
|
|
485
|
+
export type GetIssuesForCurrentUserFn = (
|
|
486
|
+
input: GetIssuesForCurrentUserInput,
|
|
487
|
+
options?: EnterpriseOptions,
|
|
488
|
+
) => Promise<{ data: ProviderIssue[]; pageInfo?: PageInfo }>;
|
|
489
|
+
|
|
490
|
+
export type GetIssuesForRepoFn = (
|
|
491
|
+
input: GetIssuesForRepoInput & PagingInput,
|
|
492
|
+
options?: EnterpriseOptions,
|
|
493
|
+
) => Promise<{ data: ProviderIssue[]; pageInfo?: PageInfo }>;
|
|
494
|
+
|
|
495
|
+
export type GetIssuesForAzureProjectFn = (
|
|
496
|
+
input: GetIssuesForAzureProjectInput & PagingInput,
|
|
497
|
+
options?: EnterpriseOptions,
|
|
498
|
+
) => Promise<{ data: ProviderIssue[]; pageInfo?: PageInfo }>;
|
|
499
|
+
|
|
500
|
+
export type GetReposForAzureProjectFn = (
|
|
501
|
+
input: GetReposForAzureProjectInput & PagingInput,
|
|
502
|
+
options?: EnterpriseOptions,
|
|
503
|
+
) => Promise<{ data: ProviderRepository[]; pageInfo?: PageInfo }>;
|
|
504
|
+
|
|
505
|
+
export type GetOrgsForCurrentUserFn = (
|
|
506
|
+
input?: CursorPageInput,
|
|
507
|
+
options?: EnterpriseOptions,
|
|
508
|
+
) => Promise<{ data: ProviderGitHubOrganization[]; pageInfo?: PageInfo }>;
|
|
509
|
+
export type GetReposForOrgFn = (
|
|
510
|
+
input: { orgName: string } & PagingInput,
|
|
511
|
+
options?: EnterpriseOptions,
|
|
512
|
+
) => Promise<{ data: ProviderRepository[]; pageInfo?: PageInfo }>;
|
|
513
|
+
export type GetReposForWorkspaceFn = (
|
|
514
|
+
input: { workspace: string } & PagingInput,
|
|
515
|
+
options?: EnterpriseOptions,
|
|
516
|
+
) => Promise<{ data: ProviderRepository[]; pageInfo?: PageInfo }>;
|
|
517
|
+
export type GetReposForCurrentUserFn = (
|
|
518
|
+
// `affiliations` narrows GitHub's `/user/repos` read (owner/collaborator/organization_member);
|
|
519
|
+
// GitLab's equivalent read ignores it.
|
|
520
|
+
input: PagingInput & { affiliations?: ('owner' | 'collaborator' | 'organization_member')[] },
|
|
521
|
+
options?: EnterpriseOptions,
|
|
522
|
+
) => Promise<{ data: ProviderRepository[]; pageInfo?: PageInfo }>;
|
|
523
|
+
export type GetGroupsForCurrentUserFn = (
|
|
524
|
+
input?: { topLevelOnly?: boolean } & PagingInput,
|
|
525
|
+
options?: EnterpriseOptions,
|
|
526
|
+
) => Promise<{ data: ProviderGitLabGroup[]; pageInfo?: PageInfo }>;
|
|
527
|
+
|
|
528
|
+
export type GetCurrentUserFn = (
|
|
529
|
+
input: Record<string, never>,
|
|
530
|
+
options?: EnterpriseOptions,
|
|
531
|
+
) => Promise<{ data: ProviderAccount }>;
|
|
532
|
+
export type GetCurrentUserForInstanceFn = (
|
|
533
|
+
input: { namespace: string },
|
|
534
|
+
options?: EnterpriseOptions,
|
|
535
|
+
) => Promise<{ data: ProviderAccount }>;
|
|
536
|
+
export type GetCurrentUserForResourceFn = (
|
|
537
|
+
input: { resourceId: string },
|
|
538
|
+
options?: EnterpriseOptions,
|
|
539
|
+
) => Promise<{ data: ProviderAccount }>;
|
|
540
|
+
|
|
541
|
+
export type GetJiraResourcesForCurrentUserFn = (options?: EnterpriseOptions) => Promise<{ data: JiraResource[] }>;
|
|
542
|
+
export type GetLinearOrganizationFn = (options?: EnterpriseOptions) => Promise<{ data: LinearOrganization }>;
|
|
543
|
+
export type GetLinearTeamsForCurrentUserFn = (options?: EnterpriseOptions) => Promise<{ data: LinearTeam[] }>;
|
|
544
|
+
export type GetLinearIssuesFn = (
|
|
545
|
+
input: { teams?: string[]; projects?: string[]; labels?: string[] } & PagingInput,
|
|
546
|
+
options?: EnterpriseOptions,
|
|
547
|
+
) => Promise<{ data: ProviderIssue[]; pageInfo?: PageInfo }>;
|
|
548
|
+
/**
|
|
549
|
+
* Linear's current-user (viewer) query. Its raw `@linear/sdk` User isn't a `ProviderAccount` (no
|
|
550
|
+
* username/avatar/url), so it's typed with the minimal fields the viewer query actually returns rather than
|
|
551
|
+
* importing `@linear/sdk` (which is bundled in the SDK dist and not a resolvable top-level dependency).
|
|
552
|
+
*/
|
|
553
|
+
export type GetLinearCurrentUserFn = (
|
|
554
|
+
options?: EnterpriseOptions,
|
|
555
|
+
) => Promise<{ data: { id: string; name?: string | null; email?: string | null; displayName?: string | null } }>;
|
|
556
|
+
export type GetJiraProjectsForResourcesFn = (
|
|
557
|
+
input: { resourceIds: string[] },
|
|
558
|
+
options?: EnterpriseOptions,
|
|
559
|
+
// Fan-out across resources: preserves successful resources' projects and reports per-resource failures in
|
|
560
|
+
// SDK collection metadata instead of throwing when a single resource fails.
|
|
561
|
+
) => Promise<{ data: JiraProject[]; metadata?: CollectionMetadata }>;
|
|
562
|
+
export type GetJiraProjectsForResourceFn = (
|
|
563
|
+
input: { resourceId: string } & CursorPageInput,
|
|
564
|
+
options?: EnterpriseOptions,
|
|
565
|
+
) => Promise<{ data: JiraProject[]; pageInfo?: PageInfo; metadata?: CollectionMetadata }>;
|
|
566
|
+
export type GetGitLabPullRequestsForUserAssociationFn = (
|
|
567
|
+
input: {
|
|
568
|
+
username: string;
|
|
569
|
+
association: 'assigned' | 'authored' | 'reviewRequested';
|
|
570
|
+
includeFromArchivedRepos?: boolean;
|
|
571
|
+
labelNames?: string[];
|
|
572
|
+
repo?: ProviderRepoInput;
|
|
573
|
+
states?: GitPullRequestState[];
|
|
574
|
+
pageSize?: number;
|
|
575
|
+
} & CursorPageInput,
|
|
576
|
+
options?: EnterpriseOptions,
|
|
577
|
+
) => Promise<{ data: ProviderPullRequest[]; pageInfo?: PageInfo }>;
|
|
578
|
+
export type GetAzureResourcesForUserFn = (
|
|
579
|
+
input: { userId: string },
|
|
580
|
+
options?: EnterpriseOptions,
|
|
581
|
+
) => Promise<{ data: AzureOrganization[] }>;
|
|
582
|
+
export type GetAzureProjectsForResourceFn = (
|
|
583
|
+
input: { namespace: string; cursor?: string },
|
|
584
|
+
options?: EnterpriseOptions,
|
|
585
|
+
) => Promise<{ data: AzureProject[]; pageInfo?: PageInfo }>;
|
|
586
|
+
export type GetBitbucketResourcesForCurrentUserFn = (
|
|
587
|
+
input: { page?: number },
|
|
588
|
+
options?: EnterpriseOptions,
|
|
589
|
+
) => Promise<{ data: BitbucketWorkspaceStub[]; pageInfo?: PageInfo }>;
|
|
590
|
+
export type GetBitbucketPullRequestsAuthoredByUserForWorkspaceFn = (
|
|
591
|
+
input: {
|
|
592
|
+
userId: string;
|
|
593
|
+
workspaceSlug: string;
|
|
594
|
+
states?: GitPullRequestState[];
|
|
595
|
+
} & NumberedPageInput,
|
|
596
|
+
options?: EnterpriseOptions,
|
|
597
|
+
) => Promise<{
|
|
598
|
+
pageInfo: {
|
|
599
|
+
hasNextPage: boolean;
|
|
600
|
+
nextPage: number | null;
|
|
601
|
+
};
|
|
602
|
+
data: GitPullRequest[];
|
|
603
|
+
}>;
|
|
604
|
+
export type GetBitbucketServerPullRequestsForCurrentUserFn = (
|
|
605
|
+
input: { states?: GitPullRequestState[] } & NumberedPageInput,
|
|
606
|
+
options?: EnterpriseOptions,
|
|
607
|
+
) => Promise<{
|
|
608
|
+
pageInfo: {
|
|
609
|
+
hasNextPage: boolean;
|
|
610
|
+
nextPage: number | null;
|
|
611
|
+
};
|
|
612
|
+
data: GitPullRequest[];
|
|
613
|
+
}>;
|
|
614
|
+
export type GetIssuesForProjectFn = Jira['getIssuesForProject'];
|
|
615
|
+
export type GetIssuesForResourceForCurrentUserFn = (
|
|
616
|
+
input: { resourceId: string },
|
|
617
|
+
options?: EnterpriseOptions,
|
|
618
|
+
) => Promise<{ data: ProviderIssue[] }>;
|
|
619
|
+
|
|
620
|
+
// Trello reads (issues-capable provider). The Trello client is keyed by an `appKey` (the Trello app key from
|
|
621
|
+
// the cloud token exchange) alongside the OAuth token, so these mirror the client method shapes directly.
|
|
622
|
+
export type GetTrelloCurrentUserFn = Trello['getCurrentUser'];
|
|
623
|
+
export type GetTrelloBoardsForCurrentUserFn = Trello['getBoardsForCurrentUser'];
|
|
624
|
+
export type GetTrelloListsForBoardFn = Trello['getListsForTrelloBoard'];
|
|
625
|
+
export type GetTrelloAccountForIdFn = Trello['getAccountForId'];
|
|
626
|
+
export type GetTrelloIssuesForBoardFn = Trello['getIssuesForBoard'];
|
|
627
|
+
export type GetTrelloLabelsForBoardFn = Trello['getLabelsForBoard'];
|
|
628
|
+
|
|
629
|
+
export interface ProviderInfo extends ProviderMetadata {
|
|
630
|
+
provider: GitHub | GitLab | Bitbucket | BitbucketServer | Jira | Linear | Trello | AzureDevOps;
|
|
631
|
+
getRepoFn?: GetRepoFn;
|
|
632
|
+
getRepoOfProjectFn?: GetRepoOfProjectFn;
|
|
633
|
+
getPullRequestsForReposFn?: GetPullRequestsForReposFn;
|
|
634
|
+
getPullRequestsForRepoFn?: GetPullRequestsForRepoFn;
|
|
635
|
+
getPullRequestsForUserFn?: GetPullRequestsForUserFn;
|
|
636
|
+
getGitLabPullRequestsForUserAssociationFn?: GetGitLabPullRequestsForUserAssociationFn;
|
|
637
|
+
getPullRequestsForAzureProjectsFn?: GetPullRequestsForAzureProjectsFn;
|
|
638
|
+
getPullRequestsForAzureProjectFn?: GetPullRequestsForAzureProjectFn;
|
|
639
|
+
getIssueFn?: GetIssueFn;
|
|
640
|
+
getIssuesForReposFn?: GetIssuesForReposFn;
|
|
641
|
+
getIssuesForCurrentUserFn?: GetIssuesForCurrentUserFn;
|
|
642
|
+
getIssuesForRepoFn?: GetIssuesForRepoFn;
|
|
643
|
+
getIssuesForAzureProjectFn?: GetIssuesForAzureProjectFn;
|
|
644
|
+
getCurrentUserFn?: GetCurrentUserFn;
|
|
645
|
+
getCurrentUserForInstanceFn?: GetCurrentUserForInstanceFn;
|
|
646
|
+
getCurrentUserForResourceFn?: GetCurrentUserForResourceFn;
|
|
647
|
+
getJiraResourcesForCurrentUserFn?: GetJiraResourcesForCurrentUserFn;
|
|
648
|
+
getLinearOrganizationFn?: GetLinearOrganizationFn;
|
|
649
|
+
getLinearTeamsForCurrentUserFn?: GetLinearTeamsForCurrentUserFn;
|
|
650
|
+
getLinearIssuesFn?: GetLinearIssuesFn;
|
|
651
|
+
getLinearCurrentUserFn?: GetLinearCurrentUserFn;
|
|
652
|
+
getAzureResourcesForUserFn?: GetAzureResourcesForUserFn;
|
|
653
|
+
getBitbucketResourcesForCurrentUserFn?: GetBitbucketResourcesForCurrentUserFn;
|
|
654
|
+
getBitbucketPullRequestsAuthoredByUserForWorkspaceFn?: GetBitbucketPullRequestsAuthoredByUserForWorkspaceFn;
|
|
655
|
+
getBitbucketServerPullRequestsForCurrentUserFn?: GetBitbucketServerPullRequestsForCurrentUserFn;
|
|
656
|
+
getJiraProjectsForResourcesFn?: GetJiraProjectsForResourcesFn;
|
|
657
|
+
getJiraProjectsForResourceFn?: GetJiraProjectsForResourceFn;
|
|
658
|
+
getAzureProjectsForResourceFn?: GetAzureProjectsForResourceFn;
|
|
659
|
+
getIssuesForProjectFn?: GetIssuesForProjectFn;
|
|
660
|
+
getReposForAzureProjectFn?: GetReposForAzureProjectFn;
|
|
661
|
+
getIssuesForResourceForCurrentUserFn?: GetIssuesForResourceForCurrentUserFn;
|
|
662
|
+
mergePullRequestFn?: MergePullRequestFn;
|
|
663
|
+
getOrgsForCurrentUserFn?: GetOrgsForCurrentUserFn;
|
|
664
|
+
getReposForOrgFn?: GetReposForOrgFn;
|
|
665
|
+
getReposForWorkspaceFn?: GetReposForWorkspaceFn;
|
|
666
|
+
getReposForCurrentUserFn?: GetReposForCurrentUserFn;
|
|
667
|
+
getGroupsForCurrentUserFn?: GetGroupsForCurrentUserFn;
|
|
668
|
+
getTrelloCurrentUserFn?: GetTrelloCurrentUserFn;
|
|
669
|
+
getTrelloBoardsForCurrentUserFn?: GetTrelloBoardsForCurrentUserFn;
|
|
670
|
+
getTrelloListsForBoardFn?: GetTrelloListsForBoardFn;
|
|
671
|
+
getTrelloAccountForIdFn?: GetTrelloAccountForIdFn;
|
|
672
|
+
getTrelloIssuesForBoardFn?: GetTrelloIssuesForBoardFn;
|
|
673
|
+
getTrelloLabelsForBoardFn?: GetTrelloLabelsForBoardFn;
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
export interface ProviderMetadata {
|
|
677
|
+
domain: string;
|
|
678
|
+
id: IntegrationIds;
|
|
679
|
+
name: string;
|
|
680
|
+
type: IntegrationType;
|
|
681
|
+
/** Key for the `gl-provider-<iconKey>` glicon. Cloud self-managed variants reuse the base
|
|
682
|
+
* `'github-enterprise'`/`'gitlab-self-hosted'` icon (no enum member exists for those anymore). */
|
|
683
|
+
iconKey: string;
|
|
684
|
+
issuesPagingMode?: PagingMode;
|
|
685
|
+
pullRequestsPagingMode?: PagingMode;
|
|
686
|
+
scopes: string[];
|
|
687
|
+
supportedPullRequestFilters?: PullRequestFilter[];
|
|
688
|
+
/**
|
|
689
|
+
* Relationship filters the ACCOUNT-WIDE pull-request read can express as an exact OR union.
|
|
690
|
+
* This is independent from `supportedPullRequestFilters`, which describes repo-scoped reads.
|
|
691
|
+
*/
|
|
692
|
+
supportedAccountWidePullRequestFilters?: PullRequestFilter[];
|
|
693
|
+
/** Filters the REPO-scoped issue read can express. */
|
|
694
|
+
supportedIssueFilters?: IssueFilter[];
|
|
695
|
+
/**
|
|
696
|
+
* Filters the ACCOUNT-WIDE issue read can express, which is NOT the same set as
|
|
697
|
+
* {@link ProviderMetadata.supportedIssueFilters}: the two reads are different provider queries.
|
|
698
|
+
*
|
|
699
|
+
* Unfiltered, each provider's account-wide read is that provider's own definition of "my issues" — GitHub/GHE
|
|
700
|
+
* union authored + assigned + mentioned, Azure drains assigned + authored, and GitLab reads assigned-to-me.
|
|
701
|
+
* A consumer replacing a narrower tool (`gk`'s `assignee:@me`) must select the `Assignee` filter wherever the
|
|
702
|
+
* provider's default is wider.
|
|
703
|
+
*
|
|
704
|
+
* A filter listed here narrows that read server-side. Absent/empty means the read can't be narrowed at all,
|
|
705
|
+
* so the facade refuses a filtered request rather than serving the unnarrowed union as if it had been
|
|
706
|
+
* filtered. GitLab lists `Assignee` and `Author` because the SDK's account-wide input exposes both username
|
|
707
|
+
* axes; it omits `Mention` because that REST read has no first-class mention filter.
|
|
708
|
+
*/
|
|
709
|
+
supportedAccountWideIssueFilters?: IssueFilter[];
|
|
710
|
+
}
|
|
711
|
+
|
|
712
|
+
export type Providers = Record<IntegrationIds, ProviderInfo>;
|
|
713
|
+
export type ProvidersMetadata = Record<IntegrationIds, ProviderMetadata>;
|
|
714
|
+
|
|
715
|
+
export const providersMetadata: ProvidersMetadata = {
|
|
716
|
+
[GitCloudHostIntegrationId.GitHub]: {
|
|
717
|
+
domain: 'github.com',
|
|
718
|
+
id: GitCloudHostIntegrationId.GitHub,
|
|
719
|
+
name: 'GitHub',
|
|
720
|
+
type: 'git',
|
|
721
|
+
iconKey: GitCloudHostIntegrationId.GitHub,
|
|
722
|
+
issuesPagingMode: PagingMode.Repos,
|
|
723
|
+
pullRequestsPagingMode: PagingMode.Repos,
|
|
724
|
+
// Use 'username' property on account for PR filters
|
|
725
|
+
supportedPullRequestFilters: [
|
|
726
|
+
PullRequestFilter.Author,
|
|
727
|
+
PullRequestFilter.Assignee,
|
|
728
|
+
PullRequestFilter.ReviewRequested,
|
|
729
|
+
PullRequestFilter.Mention,
|
|
730
|
+
],
|
|
731
|
+
supportedAccountWidePullRequestFilters: [
|
|
732
|
+
PullRequestFilter.Author,
|
|
733
|
+
PullRequestFilter.Assignee,
|
|
734
|
+
PullRequestFilter.ReviewRequested,
|
|
735
|
+
PullRequestFilter.Mention,
|
|
736
|
+
],
|
|
737
|
+
// Use 'username' property on account for issue filters
|
|
738
|
+
supportedIssueFilters: [IssueFilter.Author, IssueFilter.Assignee, IssueFilter.Mention],
|
|
739
|
+
// The account-wide read is three independent searches (`author:@me`, `assignee:@me`, `mentions:@me`) behind
|
|
740
|
+
// one composite cursor, so any subset of them is expressible.
|
|
741
|
+
supportedAccountWideIssueFilters: [IssueFilter.Author, IssueFilter.Assignee, IssueFilter.Mention],
|
|
742
|
+
scopes: ['repo', 'read:user', 'user:email'],
|
|
743
|
+
},
|
|
744
|
+
[GitSelfManagedHostIntegrationId.CloudGitHubEnterprise]: {
|
|
745
|
+
domain: '',
|
|
746
|
+
id: GitSelfManagedHostIntegrationId.CloudGitHubEnterprise,
|
|
747
|
+
name: 'GitHub Enterprise',
|
|
748
|
+
type: 'git',
|
|
749
|
+
iconKey: 'github-enterprise',
|
|
750
|
+
issuesPagingMode: PagingMode.Repos,
|
|
751
|
+
pullRequestsPagingMode: PagingMode.Repos,
|
|
752
|
+
// Use 'username' property on account for PR filters
|
|
753
|
+
supportedPullRequestFilters: [
|
|
754
|
+
PullRequestFilter.Author,
|
|
755
|
+
PullRequestFilter.Assignee,
|
|
756
|
+
PullRequestFilter.ReviewRequested,
|
|
757
|
+
PullRequestFilter.Mention,
|
|
758
|
+
],
|
|
759
|
+
supportedAccountWidePullRequestFilters: [
|
|
760
|
+
PullRequestFilter.Author,
|
|
761
|
+
PullRequestFilter.Assignee,
|
|
762
|
+
PullRequestFilter.ReviewRequested,
|
|
763
|
+
PullRequestFilter.Mention,
|
|
764
|
+
],
|
|
765
|
+
// Use 'username' property on account for issue filters
|
|
766
|
+
supportedIssueFilters: [IssueFilter.Author, IssueFilter.Assignee, IssueFilter.Mention],
|
|
767
|
+
// The account-wide read is three independent searches (`author:@me`, `assignee:@me`, `mentions:@me`) behind
|
|
768
|
+
// one composite cursor, so any subset of them is expressible.
|
|
769
|
+
supportedAccountWideIssueFilters: [IssueFilter.Author, IssueFilter.Assignee, IssueFilter.Mention],
|
|
770
|
+
scopes: ['repo', 'read:user', 'user:email'],
|
|
771
|
+
},
|
|
772
|
+
[GitCloudHostIntegrationId.GitLab]: {
|
|
773
|
+
domain: 'gitlab.com',
|
|
774
|
+
id: GitCloudHostIntegrationId.GitLab,
|
|
775
|
+
name: 'GitLab',
|
|
776
|
+
type: 'git',
|
|
777
|
+
iconKey: GitCloudHostIntegrationId.GitLab,
|
|
778
|
+
issuesPagingMode: PagingMode.Repo,
|
|
779
|
+
pullRequestsPagingMode: PagingMode.Repo,
|
|
780
|
+
// Use 'username' property on account for PR filters
|
|
781
|
+
supportedPullRequestFilters: [
|
|
782
|
+
PullRequestFilter.Author,
|
|
783
|
+
PullRequestFilter.Assignee,
|
|
784
|
+
PullRequestFilter.ReviewRequested,
|
|
785
|
+
],
|
|
786
|
+
supportedAccountWidePullRequestFilters: [
|
|
787
|
+
PullRequestFilter.Author,
|
|
788
|
+
PullRequestFilter.Assignee,
|
|
789
|
+
PullRequestFilter.ReviewRequested,
|
|
790
|
+
],
|
|
791
|
+
// Use 'username' property on account for issue filters
|
|
792
|
+
supportedIssueFilters: [IssueFilter.Author, IssueFilter.Assignee],
|
|
793
|
+
// The account-wide read drains one `scope=assigned_to_me` pass and one `scope=all` + `authorUsername` pass,
|
|
794
|
+
// unioned, so either axis is expressible on its own. Mention is absent because GitLab's REST issue read has
|
|
795
|
+
// no first-class mention filter to narrow with.
|
|
796
|
+
supportedAccountWideIssueFilters: [IssueFilter.Assignee, IssueFilter.Author],
|
|
797
|
+
scopes: ['api', 'read_user', 'read_repository'],
|
|
798
|
+
},
|
|
799
|
+
[GitSelfManagedHostIntegrationId.CloudGitLabSelfHosted]: {
|
|
800
|
+
domain: '',
|
|
801
|
+
id: GitSelfManagedHostIntegrationId.CloudGitLabSelfHosted,
|
|
802
|
+
name: 'GitLab Self-Hosted',
|
|
803
|
+
type: 'git',
|
|
804
|
+
iconKey: 'gitlab-self-hosted',
|
|
805
|
+
issuesPagingMode: PagingMode.Repo,
|
|
806
|
+
pullRequestsPagingMode: PagingMode.Repo,
|
|
807
|
+
// Use 'username' property on account for PR filters
|
|
808
|
+
supportedPullRequestFilters: [
|
|
809
|
+
PullRequestFilter.Author,
|
|
810
|
+
PullRequestFilter.Assignee,
|
|
811
|
+
PullRequestFilter.ReviewRequested,
|
|
812
|
+
],
|
|
813
|
+
supportedAccountWidePullRequestFilters: [
|
|
814
|
+
PullRequestFilter.Author,
|
|
815
|
+
PullRequestFilter.Assignee,
|
|
816
|
+
PullRequestFilter.ReviewRequested,
|
|
817
|
+
],
|
|
818
|
+
// Use 'username' property on account for issue filters
|
|
819
|
+
supportedIssueFilters: [IssueFilter.Author, IssueFilter.Assignee],
|
|
820
|
+
// The account-wide read drains one `scope=assigned_to_me` pass and one `scope=all` + `authorUsername` pass,
|
|
821
|
+
// unioned, so either axis is expressible on its own. Mention is absent because GitLab's REST issue read has
|
|
822
|
+
// no first-class mention filter to narrow with.
|
|
823
|
+
supportedAccountWideIssueFilters: [IssueFilter.Assignee, IssueFilter.Author],
|
|
824
|
+
scopes: ['api', 'read_user', 'read_repository'],
|
|
825
|
+
},
|
|
826
|
+
[GitCloudHostIntegrationId.Bitbucket]: {
|
|
827
|
+
domain: 'bitbucket.org',
|
|
828
|
+
id: GitCloudHostIntegrationId.Bitbucket,
|
|
829
|
+
name: 'Bitbucket',
|
|
830
|
+
type: 'git',
|
|
831
|
+
iconKey: GitCloudHostIntegrationId.Bitbucket,
|
|
832
|
+
pullRequestsPagingMode: PagingMode.Repo,
|
|
833
|
+
// Use 'id' property on account for PR filters (reviewer filter keyed by account id / reviewerId)
|
|
834
|
+
supportedPullRequestFilters: [PullRequestFilter.Author, PullRequestFilter.ReviewRequested],
|
|
835
|
+
supportedAccountWidePullRequestFilters: [PullRequestFilter.Author, PullRequestFilter.ReviewRequested],
|
|
836
|
+
scopes: ['account:read', 'repository:read', 'pullrequest:read', 'issue:read'],
|
|
837
|
+
},
|
|
838
|
+
[GitSelfManagedHostIntegrationId.BitbucketServer]: {
|
|
839
|
+
domain: '',
|
|
840
|
+
id: GitSelfManagedHostIntegrationId.BitbucketServer,
|
|
841
|
+
name: 'Bitbucket Data Center',
|
|
842
|
+
type: 'git',
|
|
843
|
+
iconKey: GitSelfManagedHostIntegrationId.BitbucketServer,
|
|
844
|
+
supportedPullRequestFilters: [PullRequestFilter.Author, PullRequestFilter.ReviewRequested],
|
|
845
|
+
supportedAccountWidePullRequestFilters: [PullRequestFilter.Author, PullRequestFilter.ReviewRequested],
|
|
846
|
+
scopes: ['Project (Read)', 'Repository (Write)'],
|
|
847
|
+
},
|
|
848
|
+
[GitCloudHostIntegrationId.AzureDevOps]: {
|
|
849
|
+
domain: 'dev.azure.com',
|
|
850
|
+
id: GitCloudHostIntegrationId.AzureDevOps,
|
|
851
|
+
name: 'Azure DevOps',
|
|
852
|
+
type: 'git',
|
|
853
|
+
iconKey: GitCloudHostIntegrationId.AzureDevOps,
|
|
854
|
+
issuesPagingMode: PagingMode.Project,
|
|
855
|
+
pullRequestsPagingMode: PagingMode.Repo,
|
|
856
|
+
// Use 'id' property on account for PR filters (reviewer filter keyed by account id / reviewerId)
|
|
857
|
+
supportedPullRequestFilters: [
|
|
858
|
+
PullRequestFilter.Author,
|
|
859
|
+
PullRequestFilter.Assignee,
|
|
860
|
+
PullRequestFilter.ReviewRequested,
|
|
861
|
+
],
|
|
862
|
+
supportedAccountWidePullRequestFilters: [
|
|
863
|
+
PullRequestFilter.Author,
|
|
864
|
+
PullRequestFilter.Assignee,
|
|
865
|
+
PullRequestFilter.ReviewRequested,
|
|
866
|
+
],
|
|
867
|
+
// Use 'name' property on account for issue filters
|
|
868
|
+
supportedIssueFilters: [IssueFilter.Author, IssueFilter.Assignee, IssueFilter.Mention],
|
|
869
|
+
// The account-wide read drains one (project × assignee) and one (project × author) query per project, so
|
|
870
|
+
// either axis is expressible on its own. There is no mention query to narrow to.
|
|
871
|
+
supportedAccountWideIssueFilters: [IssueFilter.Author, IssueFilter.Assignee],
|
|
872
|
+
scopes: ['vso.code', 'vso.identity', 'vso.project', 'vso.profile', 'vso.work'],
|
|
873
|
+
},
|
|
874
|
+
[GitSelfManagedHostIntegrationId.AzureDevOpsServer]: {
|
|
875
|
+
domain: '',
|
|
876
|
+
id: GitSelfManagedHostIntegrationId.AzureDevOpsServer,
|
|
877
|
+
name: 'Azure DevOps Server',
|
|
878
|
+
type: 'git',
|
|
879
|
+
iconKey: GitCloudHostIntegrationId.AzureDevOps,
|
|
880
|
+
issuesPagingMode: PagingMode.Project,
|
|
881
|
+
pullRequestsPagingMode: PagingMode.Repo,
|
|
882
|
+
// Use 'id' property on account for PR filters (reviewer filter keyed by account id / reviewerId)
|
|
883
|
+
supportedPullRequestFilters: [
|
|
884
|
+
PullRequestFilter.Author,
|
|
885
|
+
PullRequestFilter.Assignee,
|
|
886
|
+
PullRequestFilter.ReviewRequested,
|
|
887
|
+
],
|
|
888
|
+
supportedAccountWidePullRequestFilters: [
|
|
889
|
+
PullRequestFilter.Author,
|
|
890
|
+
PullRequestFilter.Assignee,
|
|
891
|
+
PullRequestFilter.ReviewRequested,
|
|
892
|
+
],
|
|
893
|
+
// Use 'name' property on account for issue filters
|
|
894
|
+
supportedIssueFilters: [IssueFilter.Author, IssueFilter.Assignee, IssueFilter.Mention],
|
|
895
|
+
// The account-wide read drains one (project × assignee) and one (project × author) query per project, so
|
|
896
|
+
// either axis is expressible on its own. There is no mention query to narrow to.
|
|
897
|
+
supportedAccountWideIssueFilters: [IssueFilter.Author, IssueFilter.Assignee],
|
|
898
|
+
scopes: ['vso.code', 'vso.identity', 'vso.project', 'vso.profile', 'vso.work'],
|
|
899
|
+
},
|
|
900
|
+
[IssuesCloudHostIntegrationId.Jira]: {
|
|
901
|
+
domain: 'atlassian.net',
|
|
902
|
+
id: IssuesCloudHostIntegrationId.Jira,
|
|
903
|
+
name: 'Jira',
|
|
904
|
+
type: 'issues',
|
|
905
|
+
iconKey: IssuesCloudHostIntegrationId.Jira,
|
|
906
|
+
scopes: [
|
|
907
|
+
'read:status:jira',
|
|
908
|
+
'read:application-role:jira',
|
|
909
|
+
'write:attachment:jira',
|
|
910
|
+
'read:comment:jira',
|
|
911
|
+
'read:project-category:jira',
|
|
912
|
+
'read:project:jira',
|
|
913
|
+
'read:issue.vote:jira',
|
|
914
|
+
'read:field-configuration:jira',
|
|
915
|
+
'write:issue:jira',
|
|
916
|
+
'read:issue-security-level:jira',
|
|
917
|
+
'write:issue.property:jira',
|
|
918
|
+
'read:issue.changelog:jira',
|
|
919
|
+
'read:avatar:jira',
|
|
920
|
+
'read:issue-meta:jira',
|
|
921
|
+
'read:permission:jira',
|
|
922
|
+
'offline_access',
|
|
923
|
+
'read:issue:jira',
|
|
924
|
+
'read:me',
|
|
925
|
+
'read:audit-log:jira',
|
|
926
|
+
'read:project.component:jira',
|
|
927
|
+
'read:group:jira',
|
|
928
|
+
'read:project-role:jira',
|
|
929
|
+
'write:comment:jira',
|
|
930
|
+
'read:label:jira',
|
|
931
|
+
'write:comment.property:jira',
|
|
932
|
+
'read:issue-details:jira',
|
|
933
|
+
'read:issue-type-hierarchy:jira',
|
|
934
|
+
'read:issue.transition:jira',
|
|
935
|
+
'read:user:jira',
|
|
936
|
+
'read:field:jira',
|
|
937
|
+
'read:issue-type:jira',
|
|
938
|
+
'read:project.property:jira',
|
|
939
|
+
'read:comment.property:jira',
|
|
940
|
+
'read:project-version:jira',
|
|
941
|
+
],
|
|
942
|
+
supportedIssueFilters: [IssueFilter.Author, IssueFilter.Assignee, IssueFilter.Mention],
|
|
943
|
+
},
|
|
944
|
+
[IssuesCloudHostIntegrationId.Linear]: {
|
|
945
|
+
domain: 'linear.app',
|
|
946
|
+
id: IssuesCloudHostIntegrationId.Linear,
|
|
947
|
+
name: 'Linear',
|
|
948
|
+
type: 'issues',
|
|
949
|
+
iconKey: IssuesCloudHostIntegrationId.Linear,
|
|
950
|
+
scopes: [],
|
|
951
|
+
// Linear scopes "my issues" client-side by the viewer's assignee id; author/mention aren't supported.
|
|
952
|
+
supportedIssueFilters: [IssueFilter.Assignee],
|
|
953
|
+
},
|
|
954
|
+
[IssuesCloudHostIntegrationId.Trello]: {
|
|
955
|
+
domain: 'trello.com',
|
|
956
|
+
id: IssuesCloudHostIntegrationId.Trello,
|
|
957
|
+
name: 'Trello',
|
|
958
|
+
type: 'issues',
|
|
959
|
+
iconKey: IssuesCloudHostIntegrationId.Trello,
|
|
960
|
+
scopes: [],
|
|
961
|
+
// Trello cards are filtered by the assignee (member) only; author/mention have no Trello equivalent.
|
|
962
|
+
supportedIssueFilters: [IssueFilter.Assignee],
|
|
963
|
+
},
|
|
964
|
+
};
|
|
965
|
+
|
|
966
|
+
export function getReasonsForUserIssue(issue: ProviderIssue, userLogin: string): string[] {
|
|
967
|
+
const reasons: string[] = [];
|
|
968
|
+
let isAuthor = false;
|
|
969
|
+
let isAssignee = false;
|
|
970
|
+
if (issue.author?.username === userLogin || issue.author?.name === userLogin) {
|
|
971
|
+
reasons.push('authored');
|
|
972
|
+
isAuthor = true;
|
|
973
|
+
}
|
|
974
|
+
if (issue.assignees?.some(assignee => assignee.username === userLogin || assignee.name === userLogin)) {
|
|
975
|
+
reasons.push('assigned');
|
|
976
|
+
isAssignee = true;
|
|
977
|
+
}
|
|
978
|
+
|
|
979
|
+
// TODO: Impossible to denote all issues we are mentioned on given their properties. for now just
|
|
980
|
+
// assume we are mentioned on any of our issues we are not the author or assignee on
|
|
981
|
+
if (!isAuthor && !isAssignee) {
|
|
982
|
+
reasons.push('mentioned');
|
|
983
|
+
}
|
|
984
|
+
|
|
985
|
+
return reasons;
|
|
986
|
+
}
|
|
987
|
+
|
|
988
|
+
function toIssueIdentifier(value: string | number): string {
|
|
989
|
+
return String(value);
|
|
990
|
+
}
|
|
991
|
+
|
|
992
|
+
export function toIssueShape(issue: ProviderIssue, provider: ProviderReference): IssueShape | undefined {
|
|
993
|
+
// TODO: Add some protections/baselines rather than killing the transformation here
|
|
994
|
+
// `author` is intentionally not required: some providers have no per-item creator (e.g. Trello cards,
|
|
995
|
+
// which the SDK maps with `author: null`), and dropping every such item would discard the whole board.
|
|
996
|
+
// Fall back to an empty author instead so these issues still surface.
|
|
997
|
+
if (issue.updatedDate == null || issue.url == null) return undefined;
|
|
998
|
+
|
|
999
|
+
return {
|
|
1000
|
+
type: 'issue',
|
|
1001
|
+
provider: provider,
|
|
1002
|
+
// `id` is the provider's display number/key (GitHub number, Jira/Linear key, Trello idShort), NOT a
|
|
1003
|
+
// globally-unique id: it's rendered to users as `#{id}`, used to build branch names, and passed back
|
|
1004
|
+
// to the provider as the `getIssue`/cache lookup key, all of which expect the number. `nodeId` is the
|
|
1005
|
+
// provider-native stable id, but its uniqueness scope is provider-specific (Azure work-item ids are
|
|
1006
|
+
// organization-scoped), so cross-scope consumers must include provider/domain/container identity too.
|
|
1007
|
+
// provider-apis declares this as a string, but some providers (notably
|
|
1008
|
+
// Azure's broadened work-item path) return a number at runtime. Keep the
|
|
1009
|
+
// public IssueShape contract truthful for consumers that use string APIs.
|
|
1010
|
+
id: toIssueIdentifier(issue.number),
|
|
1011
|
+
nodeId: issue.graphQLId ?? issue.id,
|
|
1012
|
+
title: issue.title,
|
|
1013
|
+
url: issue.url,
|
|
1014
|
+
createdDate: issue.createdDate,
|
|
1015
|
+
updatedDate: issue.updatedDate,
|
|
1016
|
+
closedDate: issue.closedDate ?? undefined,
|
|
1017
|
+
closed: issue.closedDate != null,
|
|
1018
|
+
state: issue.closedDate != null ? 'closed' : 'opened',
|
|
1019
|
+
author: {
|
|
1020
|
+
id: issue.author?.id ?? '',
|
|
1021
|
+
// An absent name stays absent, matching {@link fromProviderAccount}; see `IssueMember.name`.
|
|
1022
|
+
name: issue.author?.name ?? undefined,
|
|
1023
|
+
avatarUrl: issue.author?.avatarUrl ?? undefined,
|
|
1024
|
+
url: issue.author?.url ?? undefined,
|
|
1025
|
+
},
|
|
1026
|
+
assignees:
|
|
1027
|
+
issue.assignees?.map(assignee => ({
|
|
1028
|
+
id: assignee.id ?? '',
|
|
1029
|
+
name: assignee.name ?? undefined,
|
|
1030
|
+
avatarUrl: assignee.avatarUrl ?? undefined,
|
|
1031
|
+
url: assignee.url ?? undefined,
|
|
1032
|
+
})) ?? [],
|
|
1033
|
+
project:
|
|
1034
|
+
issue.project?.id && issue.project.resourceId && issue.project.namespace
|
|
1035
|
+
? {
|
|
1036
|
+
id: issue.project.id,
|
|
1037
|
+
name: issue.project.name,
|
|
1038
|
+
resourceId: issue.project.resourceId,
|
|
1039
|
+
resourceName: issue.project.namespace,
|
|
1040
|
+
}
|
|
1041
|
+
: undefined,
|
|
1042
|
+
repository:
|
|
1043
|
+
issue.repository?.owner?.login != null
|
|
1044
|
+
? {
|
|
1045
|
+
owner: issue.repository.owner.login,
|
|
1046
|
+
repo: issue.repository.name,
|
|
1047
|
+
id: issue.repository.id,
|
|
1048
|
+
}
|
|
1049
|
+
: undefined,
|
|
1050
|
+
labels: issue.labels.map(label => ({ color: label.color ?? undefined, name: label.name })),
|
|
1051
|
+
commentsCount: issue.commentCount ?? undefined,
|
|
1052
|
+
thumbsUpCount: issue.upvoteCount ?? undefined,
|
|
1053
|
+
body: issue.description ?? undefined,
|
|
1054
|
+
issueType: issue.type ?? undefined,
|
|
1055
|
+
};
|
|
1056
|
+
}
|
|
1057
|
+
|
|
1058
|
+
/**
|
|
1059
|
+
* Maps a raw provider-apis {@link ProviderRepository} to the GitLens-owned {@link ProviderRepositoryShape}
|
|
1060
|
+
* the ProviderBackend `listRepos` facade surfaces, so consumers don't depend on the SDK repo type. The SDK's
|
|
1061
|
+
* nullable fields (`webUrl`/`httpsUrl`/`sshUrl`/`defaultBranch`) collapse to `undefined`, matching the
|
|
1062
|
+
* `?? undefined` convention in {@link toIssueShape}/{@link toAccount}.
|
|
1063
|
+
*/
|
|
1064
|
+
export function toProviderRepositoryShape(repo: ProviderRepository): ProviderRepositoryShape {
|
|
1065
|
+
return {
|
|
1066
|
+
id: repo.id,
|
|
1067
|
+
namespace: repo.namespace,
|
|
1068
|
+
name: repo.name,
|
|
1069
|
+
project: repo.project ?? undefined,
|
|
1070
|
+
url: repo.webUrl ?? undefined,
|
|
1071
|
+
cloneUrlHttps: repo.httpsUrl ?? undefined,
|
|
1072
|
+
cloneUrlSsh: repo.sshUrl ?? undefined,
|
|
1073
|
+
defaultBranch: repo.defaultBranch?.name ?? undefined,
|
|
1074
|
+
};
|
|
1075
|
+
}
|
|
1076
|
+
|
|
1077
|
+
export function issueFilterToReason(filter: IssueFilter): 'authored' | 'assigned' | 'mentioned' {
|
|
1078
|
+
switch (filter) {
|
|
1079
|
+
case IssueFilter.Author:
|
|
1080
|
+
return 'authored';
|
|
1081
|
+
case IssueFilter.Assignee:
|
|
1082
|
+
return 'assigned';
|
|
1083
|
+
case IssueFilter.Mention:
|
|
1084
|
+
return 'mentioned';
|
|
1085
|
+
}
|
|
1086
|
+
}
|
|
1087
|
+
|
|
1088
|
+
export function toAccount(account: ProviderAccount, provider: ProviderReference): UserAccount {
|
|
1089
|
+
return {
|
|
1090
|
+
provider: provider,
|
|
1091
|
+
id: account.id,
|
|
1092
|
+
name: account.name ?? undefined,
|
|
1093
|
+
email: account.email ?? undefined,
|
|
1094
|
+
avatarUrl: account.avatarUrl ?? undefined,
|
|
1095
|
+
username: account.username ?? undefined,
|
|
1096
|
+
};
|
|
1097
|
+
}
|
|
1098
|
+
|
|
1099
|
+
export const toProviderBuildStatusState = {
|
|
1100
|
+
[PullRequestStatusCheckRollupState.Success]: GitBuildStatusState.Success,
|
|
1101
|
+
[PullRequestStatusCheckRollupState.Failed]: GitBuildStatusState.Failed,
|
|
1102
|
+
[PullRequestStatusCheckRollupState.Pending]: GitBuildStatusState.Pending,
|
|
1103
|
+
};
|
|
1104
|
+
|
|
1105
|
+
export const fromProviderBuildStatusState = {
|
|
1106
|
+
[GitBuildStatusState.Success]: PullRequestStatusCheckRollupState.Success,
|
|
1107
|
+
[GitBuildStatusState.Failed]: PullRequestStatusCheckRollupState.Failed,
|
|
1108
|
+
[GitBuildStatusState.Pending]: PullRequestStatusCheckRollupState.Pending,
|
|
1109
|
+
[GitBuildStatusState.ActionRequired]: PullRequestStatusCheckRollupState.Failed,
|
|
1110
|
+
// TODO: The rest of these are defaulted because we don't have a matching state for them
|
|
1111
|
+
[GitBuildStatusState.Error]: undefined,
|
|
1112
|
+
[GitBuildStatusState.Cancelled]: undefined,
|
|
1113
|
+
[GitBuildStatusState.OptionalActionRequired]: undefined,
|
|
1114
|
+
[GitBuildStatusState.Skipped]: undefined,
|
|
1115
|
+
[GitBuildStatusState.Running]: undefined,
|
|
1116
|
+
[GitBuildStatusState.Warning]: undefined,
|
|
1117
|
+
};
|
|
1118
|
+
|
|
1119
|
+
export const toProviderPullRequestReviewState = {
|
|
1120
|
+
[PullRequestReviewState.Approved]: GitPullRequestReviewState.Approved,
|
|
1121
|
+
[PullRequestReviewState.ChangesRequested]: GitPullRequestReviewState.ChangesRequested,
|
|
1122
|
+
[PullRequestReviewState.Commented]: GitPullRequestReviewState.Commented,
|
|
1123
|
+
[PullRequestReviewState.ReviewRequested]: GitPullRequestReviewState.ReviewRequested,
|
|
1124
|
+
[PullRequestReviewState.Dismissed]: null,
|
|
1125
|
+
[PullRequestReviewState.Pending]: null,
|
|
1126
|
+
};
|
|
1127
|
+
|
|
1128
|
+
export const fromProviderPullRequestReviewState = {
|
|
1129
|
+
[GitPullRequestReviewState.Approved]: PullRequestReviewState.Approved,
|
|
1130
|
+
[GitPullRequestReviewState.ChangesRequested]: PullRequestReviewState.ChangesRequested,
|
|
1131
|
+
[GitPullRequestReviewState.Commented]: PullRequestReviewState.Commented,
|
|
1132
|
+
[GitPullRequestReviewState.ReviewRequested]: PullRequestReviewState.ReviewRequested,
|
|
1133
|
+
};
|
|
1134
|
+
|
|
1135
|
+
export const toProviderPullRequestMergeableState = {
|
|
1136
|
+
[PullRequestMergeableState.Mergeable]: GitPullRequestMergeableState.Mergeable,
|
|
1137
|
+
[PullRequestMergeableState.Conflicting]: GitPullRequestMergeableState.Conflicts,
|
|
1138
|
+
[PullRequestMergeableState.Unknown]: GitPullRequestMergeableState.Unknown,
|
|
1139
|
+
[PullRequestMergeableState.FailingChecks]: GitPullRequestMergeableState.FailingChecks,
|
|
1140
|
+
[PullRequestMergeableState.BlockedByPolicy]: GitPullRequestMergeableState.Blocked,
|
|
1141
|
+
};
|
|
1142
|
+
|
|
1143
|
+
export const fromProviderPullRequestMergeableState = {
|
|
1144
|
+
[GitPullRequestMergeableState.Mergeable]: PullRequestMergeableState.Mergeable,
|
|
1145
|
+
[GitPullRequestMergeableState.Conflicts]: PullRequestMergeableState.Conflicting,
|
|
1146
|
+
[GitPullRequestMergeableState.Blocked]: PullRequestMergeableState.BlockedByPolicy,
|
|
1147
|
+
[GitPullRequestMergeableState.FailingChecks]: PullRequestMergeableState.FailingChecks,
|
|
1148
|
+
[GitPullRequestMergeableState.Unknown]: PullRequestMergeableState.Unknown,
|
|
1149
|
+
[GitPullRequestMergeableState.Behind]: PullRequestMergeableState.Unknown,
|
|
1150
|
+
[GitPullRequestMergeableState.UnknownAndBlocked]: PullRequestMergeableState.Unknown,
|
|
1151
|
+
[GitPullRequestMergeableState.Unstable]: PullRequestMergeableState.Unknown,
|
|
1152
|
+
};
|
|
1153
|
+
|
|
1154
|
+
export function toProviderReviews(reviewers: PullRequestReviewer[]): ProviderPullRequest['reviews'] {
|
|
1155
|
+
return reviewers
|
|
1156
|
+
.filter(r => r.state !== PullRequestReviewState.Dismissed && r.state !== PullRequestReviewState.Pending)
|
|
1157
|
+
.map(reviewer => ({
|
|
1158
|
+
reviewer: toProviderAccount(reviewer.reviewer),
|
|
1159
|
+
state: toProviderPullRequestReviewState[reviewer.state] ?? GitPullRequestReviewState.ReviewRequested,
|
|
1160
|
+
}));
|
|
1161
|
+
}
|
|
1162
|
+
|
|
1163
|
+
export function toReviewRequests(reviews: ProviderPullRequest['reviews']): PullRequestReviewer[] | undefined {
|
|
1164
|
+
return reviews == null
|
|
1165
|
+
? undefined
|
|
1166
|
+
: reviews
|
|
1167
|
+
?.filter(r => r.state === GitPullRequestReviewState.ReviewRequested)
|
|
1168
|
+
.map(r => ({
|
|
1169
|
+
isCodeOwner: false, // TODO: Find this value, and implement in the shared lib if needed
|
|
1170
|
+
reviewer: fromProviderAccount(r.reviewer),
|
|
1171
|
+
state: PullRequestReviewState.ReviewRequested,
|
|
1172
|
+
}));
|
|
1173
|
+
}
|
|
1174
|
+
|
|
1175
|
+
export function toCompletedReviews(reviews: ProviderPullRequest['reviews']): PullRequestReviewer[] | undefined {
|
|
1176
|
+
return reviews == null
|
|
1177
|
+
? undefined
|
|
1178
|
+
: reviews
|
|
1179
|
+
?.filter(r => r.state !== GitPullRequestReviewState.ReviewRequested)
|
|
1180
|
+
.map(r => ({
|
|
1181
|
+
isCodeOwner: false, // TODO: Find this value, and implement in the shared lib if needed
|
|
1182
|
+
reviewer: fromProviderAccount(r.reviewer),
|
|
1183
|
+
state: fromProviderPullRequestReviewState[r.state],
|
|
1184
|
+
}));
|
|
1185
|
+
}
|
|
1186
|
+
|
|
1187
|
+
export function toProviderReviewDecision(
|
|
1188
|
+
reviewDecision?: PullRequestReviewDecision,
|
|
1189
|
+
reviewers?: PullRequestReviewer[],
|
|
1190
|
+
): GitPullRequestReviewState | null {
|
|
1191
|
+
switch (reviewDecision) {
|
|
1192
|
+
case PullRequestReviewDecision.Approved:
|
|
1193
|
+
return GitPullRequestReviewState.Approved;
|
|
1194
|
+
case PullRequestReviewDecision.ChangesRequested:
|
|
1195
|
+
return GitPullRequestReviewState.ChangesRequested;
|
|
1196
|
+
case PullRequestReviewDecision.ReviewRequired:
|
|
1197
|
+
return GitPullRequestReviewState.ReviewRequested;
|
|
1198
|
+
default: {
|
|
1199
|
+
if (reviewers?.some(r => r.state === PullRequestReviewState.ReviewRequested)) {
|
|
1200
|
+
return GitPullRequestReviewState.ReviewRequested;
|
|
1201
|
+
} else if (reviewers?.some(r => r.state === PullRequestReviewState.Commented)) {
|
|
1202
|
+
return GitPullRequestReviewState.Commented;
|
|
1203
|
+
}
|
|
1204
|
+
return null;
|
|
1205
|
+
}
|
|
1206
|
+
}
|
|
1207
|
+
}
|
|
1208
|
+
|
|
1209
|
+
export const fromPullRequestReviewDecision = {
|
|
1210
|
+
[GitPullRequestReviewState.Approved]: PullRequestReviewDecision.Approved,
|
|
1211
|
+
[GitPullRequestReviewState.ChangesRequested]: PullRequestReviewDecision.ChangesRequested,
|
|
1212
|
+
[GitPullRequestReviewState.Commented]: undefined,
|
|
1213
|
+
[GitPullRequestReviewState.ReviewRequested]: PullRequestReviewDecision.ReviewRequired,
|
|
1214
|
+
};
|
|
1215
|
+
|
|
1216
|
+
export function toProviderPullRequestState(state: PullRequestState): GitPullRequestState {
|
|
1217
|
+
return state === 'opened'
|
|
1218
|
+
? GitPullRequestState.Open
|
|
1219
|
+
: state === 'closed'
|
|
1220
|
+
? GitPullRequestState.Closed
|
|
1221
|
+
: GitPullRequestState.Merged;
|
|
1222
|
+
}
|
|
1223
|
+
|
|
1224
|
+
export function fromProviderPullRequestState(state: GitPullRequestState): PullRequestState {
|
|
1225
|
+
return state === GitPullRequestState.Open ? 'opened' : state === GitPullRequestState.Closed ? 'closed' : 'merged';
|
|
1226
|
+
}
|
|
1227
|
+
|
|
1228
|
+
type PullRequestStateInput = PullRequestState | PullRequestStateFilter;
|
|
1229
|
+
|
|
1230
|
+
function toProviderPullRequestStatesCore(state: PullRequestStateInput): GitPullRequestState[] {
|
|
1231
|
+
switch (state) {
|
|
1232
|
+
case 'open':
|
|
1233
|
+
case 'opened':
|
|
1234
|
+
return [GitPullRequestState.Open];
|
|
1235
|
+
case 'closed':
|
|
1236
|
+
return [GitPullRequestState.Closed];
|
|
1237
|
+
case 'merged':
|
|
1238
|
+
return [GitPullRequestState.Merged];
|
|
1239
|
+
case 'all':
|
|
1240
|
+
return [GitPullRequestState.Open, GitPullRequestState.Closed, GitPullRequestState.Merged];
|
|
1241
|
+
}
|
|
1242
|
+
}
|
|
1243
|
+
|
|
1244
|
+
/** Maps PR include/state filters to the SDK's `states` input. `undefined`/omitted preserves the open-only default. */
|
|
1245
|
+
export function toProviderPullRequestStates(
|
|
1246
|
+
state: PullRequestStateInput | PullRequestStateInput[] | undefined,
|
|
1247
|
+
): GitPullRequestState[] | undefined {
|
|
1248
|
+
if (state == null) return undefined;
|
|
1249
|
+
|
|
1250
|
+
const states = (Array.isArray(state) ? state : [state]).flatMap(s => toProviderPullRequestStatesCore(s));
|
|
1251
|
+
return states.length > 0 ? [...new Set(states)] : undefined;
|
|
1252
|
+
}
|
|
1253
|
+
|
|
1254
|
+
/** Maps an issue state filter to the SDK's `states` input. `undefined`/omitted preserves the open-only default. */
|
|
1255
|
+
export function toProviderIssueStates(state: IssueStateFilter | undefined): GitIssueState[] | undefined {
|
|
1256
|
+
switch (state) {
|
|
1257
|
+
case 'open':
|
|
1258
|
+
return [GitIssueState.Open];
|
|
1259
|
+
case 'closed':
|
|
1260
|
+
return [GitIssueState.Closed];
|
|
1261
|
+
case 'all':
|
|
1262
|
+
return [GitIssueState.Open, GitIssueState.Closed];
|
|
1263
|
+
default:
|
|
1264
|
+
return undefined;
|
|
1265
|
+
}
|
|
1266
|
+
}
|
|
1267
|
+
|
|
1268
|
+
/**
|
|
1269
|
+
* Resolves a normalized {@link ProviderScope} to the provider-appropriate read inputs, dispatching on the
|
|
1270
|
+
* provider's {@link PagingMode} (the authoritative per-provider scoping selector). Project-mode providers
|
|
1271
|
+
* (Azure issues, Jira) produce `projectInputs` from `org` + `project`; repo/repos-mode providers produce a
|
|
1272
|
+
* repo `GetRepoInput[]` from `scope.repos` (carrying `project` where relevant, e.g. Azure). This is the
|
|
1273
|
+
* single public entry point consumers can use instead of hand-building the three underlying representations.
|
|
1274
|
+
*/
|
|
1275
|
+
export function resolveProviderScope(
|
|
1276
|
+
scope: ProviderScope,
|
|
1277
|
+
pagingMode: PagingMode | undefined,
|
|
1278
|
+
): { reposInput?: GetRepoInput[]; projectInputs?: { namespace: string; project: string }[] } {
|
|
1279
|
+
if (pagingMode === PagingMode.Project) {
|
|
1280
|
+
if (scope.org != null && scope.project != null) {
|
|
1281
|
+
return { projectInputs: [{ namespace: scope.org, project: scope.project }] };
|
|
1282
|
+
}
|
|
1283
|
+
return {};
|
|
1284
|
+
}
|
|
1285
|
+
|
|
1286
|
+
const reposInput = scope.repos?.map(r => ({ namespace: r.owner, name: r.name, project: scope.project }));
|
|
1287
|
+
return { reposInput: reposInput };
|
|
1288
|
+
}
|
|
1289
|
+
|
|
1290
|
+
export function providerPullRequestMatchesSearch(pr: ProviderPullRequest, search: string): boolean {
|
|
1291
|
+
const term = search.trim().toLowerCase();
|
|
1292
|
+
if (term.length === 0) return true;
|
|
1293
|
+
|
|
1294
|
+
return pr.title.toLowerCase().includes(term) || (pr.description?.toLowerCase().includes(term) ?? false);
|
|
1295
|
+
}
|
|
1296
|
+
|
|
1297
|
+
function toProviderRemoteInfo(ref: PullRequestRef | undefined): GitRepositoryRemoteInfo | null {
|
|
1298
|
+
// Match the SDK convention: only populate remoteInfo when both clone URLs are known.
|
|
1299
|
+
return ref?.cloneHttps && ref?.cloneSsh ? { cloneUrlHTTPS: ref.cloneHttps, cloneUrlSSH: ref.cloneSsh } : null;
|
|
1300
|
+
}
|
|
1301
|
+
|
|
1302
|
+
export function toProviderPullRequest(pr: PullRequest): ProviderPullRequest {
|
|
1303
|
+
const prReviews = [...(pr.reviewRequests ?? []), ...(pr.latestReviews ?? [])];
|
|
1304
|
+
return {
|
|
1305
|
+
id: pr.id,
|
|
1306
|
+
graphQLId: pr.nodeId,
|
|
1307
|
+
number: pr.number ?? Number.parseInt(pr.id, 10),
|
|
1308
|
+
title: pr.title,
|
|
1309
|
+
description: pr.body ?? null,
|
|
1310
|
+
url: pr.url,
|
|
1311
|
+
state: toProviderPullRequestState(pr.state),
|
|
1312
|
+
isCrossRepository: pr.refs?.isCrossRepository ?? false,
|
|
1313
|
+
isDraft: pr.isDraft ?? false,
|
|
1314
|
+
createdDate: pr.createdDate,
|
|
1315
|
+
updatedDate: pr.updatedDate,
|
|
1316
|
+
closedDate: pr.closedDate ?? null,
|
|
1317
|
+
mergedDate: pr.mergedDate ?? null,
|
|
1318
|
+
commentCount: pr.commentsCount ?? null,
|
|
1319
|
+
upvoteCount: pr.thumbsUpCount ?? null,
|
|
1320
|
+
commitCount: null,
|
|
1321
|
+
fileCount: null,
|
|
1322
|
+
additions: pr.additions ?? null,
|
|
1323
|
+
deletions: pr.deletions ?? null,
|
|
1324
|
+
author: toProviderAccount(pr.author),
|
|
1325
|
+
assignees: pr.assignees?.map(toProviderAccount) ?? null,
|
|
1326
|
+
baseRef:
|
|
1327
|
+
pr.refs?.base == null
|
|
1328
|
+
? null
|
|
1329
|
+
: {
|
|
1330
|
+
name: pr.refs.base.branch,
|
|
1331
|
+
oid: pr.refs.base.sha,
|
|
1332
|
+
},
|
|
1333
|
+
headRef:
|
|
1334
|
+
pr.refs?.head == null
|
|
1335
|
+
? null
|
|
1336
|
+
: {
|
|
1337
|
+
name: pr.refs.head.branch,
|
|
1338
|
+
oid: pr.refs.head.sha,
|
|
1339
|
+
},
|
|
1340
|
+
reviews: toProviderReviews(prReviews),
|
|
1341
|
+
reviewDecision: toProviderReviewDecision(pr.reviewDecision, prReviews),
|
|
1342
|
+
repository:
|
|
1343
|
+
pr.repository != null
|
|
1344
|
+
? {
|
|
1345
|
+
id: pr.repository.id ?? '',
|
|
1346
|
+
name: pr.repository.repo,
|
|
1347
|
+
owner: {
|
|
1348
|
+
login: pr.repository.owner,
|
|
1349
|
+
},
|
|
1350
|
+
remoteInfo: toProviderRemoteInfo(pr.refs?.base),
|
|
1351
|
+
}
|
|
1352
|
+
: {
|
|
1353
|
+
id: '',
|
|
1354
|
+
name: '',
|
|
1355
|
+
owner: {
|
|
1356
|
+
login: '',
|
|
1357
|
+
},
|
|
1358
|
+
remoteInfo: null,
|
|
1359
|
+
},
|
|
1360
|
+
headRepository:
|
|
1361
|
+
pr.refs?.head != null
|
|
1362
|
+
? {
|
|
1363
|
+
id: pr.refs.head.repo,
|
|
1364
|
+
name: pr.refs.head.repo,
|
|
1365
|
+
owner: {
|
|
1366
|
+
login: pr.refs.head.owner,
|
|
1367
|
+
},
|
|
1368
|
+
remoteInfo: toProviderRemoteInfo(pr.refs.head),
|
|
1369
|
+
isFork: pr.refs.head.isFork,
|
|
1370
|
+
}
|
|
1371
|
+
: null,
|
|
1372
|
+
headCommit:
|
|
1373
|
+
pr.statusCheckRollupState != null
|
|
1374
|
+
? {
|
|
1375
|
+
buildStatuses: [
|
|
1376
|
+
{
|
|
1377
|
+
completedAt: null,
|
|
1378
|
+
description: '',
|
|
1379
|
+
name: '',
|
|
1380
|
+
state: toProviderBuildStatusState[pr.statusCheckRollupState],
|
|
1381
|
+
startedAt: null,
|
|
1382
|
+
stage: null,
|
|
1383
|
+
url: '',
|
|
1384
|
+
},
|
|
1385
|
+
],
|
|
1386
|
+
}
|
|
1387
|
+
: null,
|
|
1388
|
+
permissions:
|
|
1389
|
+
pr.viewerCanUpdate == null
|
|
1390
|
+
? null
|
|
1391
|
+
: {
|
|
1392
|
+
canMerge:
|
|
1393
|
+
pr.viewerCanUpdate === true &&
|
|
1394
|
+
pr.repository.accessLevel != null &&
|
|
1395
|
+
pr.repository.accessLevel >= RepositoryAccessLevel.Write,
|
|
1396
|
+
canMergeAndBypassProtections:
|
|
1397
|
+
pr.viewerCanUpdate === true &&
|
|
1398
|
+
pr.repository.accessLevel != null &&
|
|
1399
|
+
pr.repository.accessLevel >= RepositoryAccessLevel.Admin,
|
|
1400
|
+
},
|
|
1401
|
+
mergeableState: pr.mergeableState
|
|
1402
|
+
? toProviderPullRequestMergeableState[pr.mergeableState]
|
|
1403
|
+
: GitPullRequestMergeableState.Unknown,
|
|
1404
|
+
};
|
|
1405
|
+
}
|
|
1406
|
+
|
|
1407
|
+
export function fromProviderPullRequest(
|
|
1408
|
+
pr: ProviderPullRequest,
|
|
1409
|
+
provider: Provider,
|
|
1410
|
+
options?: { project?: IssueProject; currentAccountId?: string },
|
|
1411
|
+
): PullRequest {
|
|
1412
|
+
const repository = pr.repository;
|
|
1413
|
+
const repositoryName = repository?.name ?? '';
|
|
1414
|
+
const repositoryOwner = repository?.owner?.login ?? '';
|
|
1415
|
+
const repositoryRemoteInfo = repository?.remoteInfo;
|
|
1416
|
+
const headRepository = pr.headRepository;
|
|
1417
|
+
const headRepositoryRemoteInfo = headRepository?.remoteInfo;
|
|
1418
|
+
|
|
1419
|
+
return new PullRequest(
|
|
1420
|
+
provider,
|
|
1421
|
+
fromProviderAccount(pr.author),
|
|
1422
|
+
pr.id,
|
|
1423
|
+
pr.graphQLId || pr.id,
|
|
1424
|
+
pr.title,
|
|
1425
|
+
pr.url ?? '',
|
|
1426
|
+
{
|
|
1427
|
+
owner: repositoryOwner,
|
|
1428
|
+
repo: repositoryName,
|
|
1429
|
+
// This has to be here until we can take this information from ProviderPullRequest:
|
|
1430
|
+
accessLevel: RepositoryAccessLevel.Write,
|
|
1431
|
+
id: repository?.id ?? '',
|
|
1432
|
+
},
|
|
1433
|
+
fromProviderPullRequestState(pr.state),
|
|
1434
|
+
pr.createdDate,
|
|
1435
|
+
pr.updatedDate,
|
|
1436
|
+
pr.closedDate ?? undefined,
|
|
1437
|
+
pr.mergedDate ?? undefined,
|
|
1438
|
+
pr.mergeableState ? fromProviderPullRequestMergeableState[pr.mergeableState] : undefined,
|
|
1439
|
+
pr.permissions?.canMerge || pr.permissions?.canMergeAndBypassProtections ? true : undefined,
|
|
1440
|
+
{
|
|
1441
|
+
base: {
|
|
1442
|
+
branch: pr.baseRef?.name ?? '',
|
|
1443
|
+
sha: pr.baseRef?.oid ?? '',
|
|
1444
|
+
repo: repositoryName,
|
|
1445
|
+
owner: repositoryOwner,
|
|
1446
|
+
exists: pr.baseRef != null,
|
|
1447
|
+
url: repositoryRemoteInfo?.cloneUrlHTTPS
|
|
1448
|
+
? repositoryRemoteInfo.cloneUrlHTTPS.replace(gitSuffixRegex, '')
|
|
1449
|
+
: '',
|
|
1450
|
+
cloneHttps: repositoryRemoteInfo?.cloneUrlHTTPS || undefined,
|
|
1451
|
+
cloneSsh: repositoryRemoteInfo?.cloneUrlSSH || undefined,
|
|
1452
|
+
},
|
|
1453
|
+
head: {
|
|
1454
|
+
branch: pr.headRef?.name ?? '',
|
|
1455
|
+
sha: pr.headRef?.oid ?? '',
|
|
1456
|
+
repo: headRepository?.name ?? '',
|
|
1457
|
+
owner: headRepository?.owner?.login ?? '',
|
|
1458
|
+
exists: pr.headRef != null,
|
|
1459
|
+
url: headRepositoryRemoteInfo?.cloneUrlHTTPS
|
|
1460
|
+
? headRepositoryRemoteInfo.cloneUrlHTTPS.replace(gitSuffixRegex, '')
|
|
1461
|
+
: '',
|
|
1462
|
+
cloneHttps: headRepositoryRemoteInfo?.cloneUrlHTTPS || undefined,
|
|
1463
|
+
cloneSsh: headRepositoryRemoteInfo?.cloneUrlSSH || undefined,
|
|
1464
|
+
isFork: headRepository?.isFork,
|
|
1465
|
+
},
|
|
1466
|
+
isCrossRepository: pr.isCrossRepository,
|
|
1467
|
+
},
|
|
1468
|
+
pr.isDraft,
|
|
1469
|
+
pr.additions ?? undefined,
|
|
1470
|
+
pr.deletions ?? undefined,
|
|
1471
|
+
pr.commentCount ?? undefined,
|
|
1472
|
+
pr.upvoteCount ?? undefined,
|
|
1473
|
+
pr.reviewDecision ? fromPullRequestReviewDecision[pr.reviewDecision] : undefined,
|
|
1474
|
+
toReviewRequests(pr.reviews),
|
|
1475
|
+
toCompletedReviews(pr.reviews),
|
|
1476
|
+
pr.assignees?.map(fromProviderAccount) ?? undefined,
|
|
1477
|
+
pr.headCommit?.buildStatuses?.[0]?.state
|
|
1478
|
+
? fromProviderBuildStatusState[pr.headCommit.buildStatuses[0].state]
|
|
1479
|
+
: undefined,
|
|
1480
|
+
options?.project,
|
|
1481
|
+
pr.version,
|
|
1482
|
+
pr.description ?? undefined,
|
|
1483
|
+
pr.number,
|
|
1484
|
+
options?.currentAccountId != null ? pr.author?.id === options.currentAccountId : undefined,
|
|
1485
|
+
);
|
|
1486
|
+
}
|
|
1487
|
+
|
|
1488
|
+
export function fromProviderIssue(
|
|
1489
|
+
issue: ProviderIssue,
|
|
1490
|
+
integration: Integration,
|
|
1491
|
+
options?: { project?: IssueProject },
|
|
1492
|
+
): Issue {
|
|
1493
|
+
const identifier = toIssueIdentifier(issue.number);
|
|
1494
|
+
return new Issue(
|
|
1495
|
+
integration,
|
|
1496
|
+
identifier,
|
|
1497
|
+
issue.graphQLId ?? issue.id,
|
|
1498
|
+
issue.title,
|
|
1499
|
+
issue.url ?? '',
|
|
1500
|
+
issue.createdDate,
|
|
1501
|
+
issue.updatedDate ?? issue.closedDate ?? issue.createdDate,
|
|
1502
|
+
issue.closedDate != null,
|
|
1503
|
+
issue.closedDate != null ? 'closed' : 'opened',
|
|
1504
|
+
fromProviderAccount(issue.author),
|
|
1505
|
+
issue.assignees?.map(fromProviderAccount) ?? undefined,
|
|
1506
|
+
issue.repository != null
|
|
1507
|
+
? {
|
|
1508
|
+
owner: issue.repository.owner.login ?? '',
|
|
1509
|
+
repo: issue.repository.name,
|
|
1510
|
+
id: issue.repository.id,
|
|
1511
|
+
}
|
|
1512
|
+
: undefined,
|
|
1513
|
+
issue.closedDate ?? undefined,
|
|
1514
|
+
issue.labels?.map(label => ({ name: label.name, color: label.color ?? undefined })),
|
|
1515
|
+
issue.commentCount ?? undefined,
|
|
1516
|
+
issue.upvoteCount ?? undefined,
|
|
1517
|
+
issue.description ?? undefined,
|
|
1518
|
+
options?.project != null
|
|
1519
|
+
? {
|
|
1520
|
+
id: options.project.id,
|
|
1521
|
+
name: options.project.name,
|
|
1522
|
+
resourceId: options.project.resourceId,
|
|
1523
|
+
resourceName: options.project.resourceName,
|
|
1524
|
+
}
|
|
1525
|
+
: issue.project?.id && issue.project?.resourceId && issue.project?.namespace
|
|
1526
|
+
? {
|
|
1527
|
+
id: issue.project.id,
|
|
1528
|
+
name: issue.project.name,
|
|
1529
|
+
resourceId: issue.project.resourceId,
|
|
1530
|
+
resourceName: issue.project.namespace,
|
|
1531
|
+
}
|
|
1532
|
+
: undefined,
|
|
1533
|
+
identifier,
|
|
1534
|
+
issue.type ?? undefined,
|
|
1535
|
+
);
|
|
1536
|
+
}
|
|
1537
|
+
|
|
1538
|
+
export function toProviderPullRequestWithUniqueId(pr: PullRequest): PullRequestWithUniqueID {
|
|
1539
|
+
return {
|
|
1540
|
+
...toProviderPullRequest(pr),
|
|
1541
|
+
uuid: EntityIdentifierUtils.encode(getEntityIdentifierInput(pr)),
|
|
1542
|
+
};
|
|
1543
|
+
}
|
|
1544
|
+
|
|
1545
|
+
export function toProviderAccount(account: PullRequestMember | IssueMember): ProviderAccount {
|
|
1546
|
+
return {
|
|
1547
|
+
id: account.id ?? null,
|
|
1548
|
+
avatarUrl: account.avatarUrl ?? null,
|
|
1549
|
+
name: account.name ?? null,
|
|
1550
|
+
url: account.url ?? null,
|
|
1551
|
+
// TODO: Implement these in our own model
|
|
1552
|
+
email: '',
|
|
1553
|
+
username: account.name ?? null,
|
|
1554
|
+
};
|
|
1555
|
+
}
|
|
1556
|
+
|
|
1557
|
+
export function fromProviderAccount(account: ProviderAccount | null): PullRequestMember | IssueMember {
|
|
1558
|
+
return {
|
|
1559
|
+
id: account?.id ?? '',
|
|
1560
|
+
// An absent name stays absent. `'unknown'` was a display fallback invented in the provider layer, and a
|
|
1561
|
+
// consumer couldn't tell it apart from a member genuinely named that — so it couldn't be undone where a
|
|
1562
|
+
// name-shaped placeholder is wrong (rendering an avatar-only chip, or building an AI prompt, where
|
|
1563
|
+
// `Assignees: unknown` reads as a real assignee). It also disagreed with {@link toIssueShape}, which
|
|
1564
|
+
// collapsed the same absent name to `''` — same facade method, two fallbacks. Both now emit `undefined`.
|
|
1565
|
+
name: account?.name ?? undefined,
|
|
1566
|
+
avatarUrl: account?.avatarUrl ?? undefined,
|
|
1567
|
+
// `url` is optional, so an absent one must be `undefined`, not `''`. `''` passes a `!= null` presence
|
|
1568
|
+
// check and renders as a link to nowhere, and it disagreed with {@link toIssueShape} — which already
|
|
1569
|
+
// collapses to `undefined` — even though BOTH mappers feed `listIssuesPage` (the repo-scoped path goes
|
|
1570
|
+
// through `toIssueShape`, Azure's account-wide path through {@link fromProviderIssue}). Same facade
|
|
1571
|
+
// method, two shapes. Matches {@link toProviderRepositoryShape}, which collapses every absent optional.
|
|
1572
|
+
url: account?.url ?? undefined,
|
|
1573
|
+
};
|
|
1574
|
+
}
|
|
1575
|
+
|
|
1576
|
+
export type ProviderActionablePullRequest = ActionablePullRequest;
|
|
1577
|
+
|
|
1578
|
+
export type EnrichablePullRequest = ProviderPullRequest & {
|
|
1579
|
+
uuid: string;
|
|
1580
|
+
type: 'pullrequest';
|
|
1581
|
+
provider: ProviderReference;
|
|
1582
|
+
enrichable: EnrichableItem;
|
|
1583
|
+
repoIdentity: PullRequestRepositoryIdentityDescriptor;
|
|
1584
|
+
refs?: PullRequestRefs;
|
|
1585
|
+
underlyingPullRequest: PullRequest;
|
|
1586
|
+
};
|
|
1587
|
+
|
|
1588
|
+
export const getActionablePullRequests = GitProviderUtils.getActionablePullRequests;
|
|
1589
|
+
|
|
1590
|
+
export type GitConfigEntityIdentifier = AnyEntityIdentifierInput & {
|
|
1591
|
+
metadata: {
|
|
1592
|
+
id: string;
|
|
1593
|
+
owner: { key: string; name: string; id: string | undefined; owner: string | undefined };
|
|
1594
|
+
createdDate: string;
|
|
1595
|
+
isCloudEnterprise?: boolean;
|
|
1596
|
+
};
|
|
1597
|
+
};
|
|
1598
|
+
|
|
1599
|
+
export function isGitHubDotCom(domain: string | null | undefined): boolean {
|
|
1600
|
+
return equalsIgnoreCase(domain, 'github.com');
|
|
1601
|
+
}
|
|
1602
|
+
|
|
1603
|
+
export function isGitLabDotCom(domain: string | null | undefined): boolean {
|
|
1604
|
+
return equalsIgnoreCase(domain, 'gitlab.com');
|
|
1605
|
+
}
|
|
1606
|
+
|
|
1607
|
+
// Anchor the `visualstudio.com` alternative on a label boundary (`^` or `.`) rather than `\b`: `\b` treats a
|
|
1608
|
+
// hyphen as a word boundary, so `\bvisualstudio\.com$` matched attacker-controlled hosts like
|
|
1609
|
+
// `evil-visualstudio.com` and classified them as Azure cloud, changing their auth/URL handling.
|
|
1610
|
+
const azureCloudDomainRegex = /^dev\.azure\.com$|(?:^|\.)visualstudio\.com$/i;
|
|
1611
|
+
export function isAzureCloudDomain(domain: string | undefined): boolean {
|
|
1612
|
+
return domain != null && azureCloudDomainRegex.test(domain);
|
|
1613
|
+
}
|
|
1614
|
+
|
|
1615
|
+
const bitbucketCloudDomainRegex = /^bitbucket\.org$/i;
|
|
1616
|
+
export function isBitbucketCloudDomain(domain: string | undefined): boolean {
|
|
1617
|
+
return domain != null && bitbucketCloudDomainRegex.test(domain);
|
|
1618
|
+
}
|
|
1619
|
+
|
|
1620
|
+
export function supportsCodeSuggest(provider: ProviderReference): boolean {
|
|
1621
|
+
return isGitHubDotCom(provider.domain);
|
|
1622
|
+
}
|