@gitkraken/core-gitlens 0.4.0 → 0.4.100
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +71 -1
- package/README.md +9 -2
- package/dist/git/cache.d.ts +29 -2
- package/dist/git/cache.d.ts.map +1 -1
- package/dist/git/cache.js +67 -7
- package/dist/git/cache.js.map +1 -1
- package/dist/git/context.d.ts.map +1 -1
- package/dist/git/errors.d.ts +31 -1
- package/dist/git/errors.d.ts.map +1 -1
- package/dist/git/errors.js +29 -0
- package/dist/git/errors.js.map +1 -1
- package/dist/git/models/author.d.ts.map +1 -1
- package/dist/git/models/author.js.map +1 -1
- package/dist/git/models/autolink.d.ts.map +1 -1
- package/dist/git/models/autolink.js.map +1 -1
- package/dist/git/models/blame.d.ts.map +1 -1
- package/dist/git/models/blame.js.map +1 -1
- package/dist/git/models/branch.d.ts.map +1 -1
- package/dist/git/models/branch.js.map +1 -1
- package/dist/git/models/commit.d.ts.map +1 -1
- package/dist/git/models/commit.js +1 -1
- package/dist/git/models/commit.js.map +1 -1
- package/dist/git/models/contributor.d.ts.map +1 -1
- package/dist/git/models/contributor.js.map +1 -1
- package/dist/git/models/defaultBranch.d.ts.map +1 -1
- package/dist/git/models/defaultBranch.js.map +1 -1
- package/dist/git/models/diff.d.ts.map +1 -1
- package/dist/git/models/diff.js.map +1 -1
- package/dist/git/models/file.d.ts.map +1 -1
- package/dist/git/models/file.js.map +1 -1
- package/dist/git/models/fileChange.d.ts.map +1 -1
- package/dist/git/models/fileChange.js.map +1 -1
- package/dist/git/models/fileStatus.d.ts +22 -22
- package/dist/git/models/fileStatus.d.ts.map +1 -1
- package/dist/git/models/fileStatus.js.map +1 -1
- package/dist/git/models/graph.d.ts +122 -1
- package/dist/git/models/graph.d.ts.map +1 -1
- package/dist/git/models/graph.js +4 -0
- package/dist/git/models/graph.js.map +1 -1
- package/dist/git/models/graphSearch.d.ts.map +1 -1
- package/dist/git/models/graphSearch.js.map +1 -1
- package/dist/git/models/graphSession.d.ts +177 -0
- package/dist/git/models/graphSession.d.ts.map +1 -0
- package/dist/git/models/graphSession.js +7 -0
- package/dist/git/models/graphSession.js.map +1 -0
- package/dist/git/models/issue.d.ts +12 -2
- package/dist/git/models/issue.d.ts.map +1 -1
- package/dist/git/models/issue.js +3 -1
- package/dist/git/models/issue.js.map +1 -1
- package/dist/git/models/issueOrPullRequest.d.ts.map +1 -1
- package/dist/git/models/issueOrPullRequest.js.map +1 -1
- package/dist/git/models/lineRange.d.ts.map +1 -1
- package/dist/git/models/lineRange.js.map +1 -1
- package/dist/git/models/log.d.ts.map +1 -1
- package/dist/git/models/log.js.map +1 -1
- package/dist/git/models/mergeConflicts.d.ts.map +1 -1
- package/dist/git/models/mergeConflicts.js.map +1 -1
- package/dist/git/models/patch.d.ts.map +1 -1
- package/dist/git/models/patch.js.map +1 -1
- package/dist/git/models/pausedOperationStatus.d.ts.map +1 -1
- package/dist/git/models/pausedOperationStatus.js.map +1 -1
- package/dist/git/models/pullRequest.d.ts +27 -2
- package/dist/git/models/pullRequest.d.ts.map +1 -1
- package/dist/git/models/pullRequest.js +7 -1
- package/dist/git/models/pullRequest.js.map +1 -1
- package/dist/git/models/rebase.d.ts.map +1 -1
- package/dist/git/models/rebase.js.map +1 -1
- package/dist/git/models/reference.d.ts.map +1 -1
- package/dist/git/models/reference.js.map +1 -1
- package/dist/git/models/reflog.d.ts.map +1 -1
- package/dist/git/models/reflog.js.map +1 -1
- package/dist/git/models/remote.d.ts.map +1 -1
- package/dist/git/models/remote.js.map +1 -1
- package/dist/git/models/remoteProvider.d.ts.map +1 -1
- package/dist/git/models/remoteProvider.js.map +1 -1
- package/dist/git/models/remoteResource.d.ts.map +1 -1
- package/dist/git/models/remoteResource.js.map +1 -1
- package/dist/git/models/repository.d.ts +20 -2
- package/dist/git/models/repository.d.ts.map +1 -1
- package/dist/git/models/repository.js +19 -0
- package/dist/git/models/repository.js.map +1 -1
- package/dist/git/models/repositoryChangeEvent.d.ts.map +1 -1
- package/dist/git/models/repositoryChangeEvent.js.map +1 -1
- package/dist/git/models/repositoryIdentities.d.ts.map +1 -1
- package/dist/git/models/repositoryIdentities.js.map +1 -1
- package/dist/git/models/repositoryMetadata.d.ts.map +1 -1
- package/dist/git/models/repositoryMetadata.js.map +1 -1
- package/dist/git/models/resourceDescriptor.d.ts +16 -0
- package/dist/git/models/resourceDescriptor.d.ts.map +1 -1
- package/dist/git/models/resourceDescriptor.js.map +1 -1
- package/dist/git/models/revision.d.ts.map +1 -1
- package/dist/git/models/revision.js.map +1 -1
- package/dist/git/models/search.d.ts.map +1 -1
- package/dist/git/models/search.js.map +1 -1
- package/dist/git/models/shortlog.d.ts.map +1 -1
- package/dist/git/models/shortlog.js.map +1 -1
- package/dist/git/models/signature.d.ts +14 -0
- package/dist/git/models/signature.d.ts.map +1 -1
- package/dist/git/models/signature.js.map +1 -1
- package/dist/git/models/staging.d.ts.map +1 -1
- package/dist/git/models/staging.js.map +1 -1
- package/dist/git/models/stash.d.ts.map +1 -1
- package/dist/git/models/stash.js.map +1 -1
- package/dist/git/models/status.d.ts.map +1 -1
- package/dist/git/models/status.js.map +1 -1
- package/dist/git/models/statusFile.d.ts.map +1 -1
- package/dist/git/models/statusFile.js.map +1 -1
- package/dist/git/models/tag.d.ts +11 -1
- package/dist/git/models/tag.d.ts.map +1 -1
- package/dist/git/models/tag.js +9 -2
- package/dist/git/models/tag.js.map +1 -1
- package/dist/git/models/tree.d.ts.map +1 -1
- package/dist/git/models/tree.js.map +1 -1
- package/dist/git/models/user.d.ts.map +1 -1
- package/dist/git/models/user.js.map +1 -1
- package/dist/git/models/worktree.d.ts.map +1 -1
- package/dist/git/models/worktree.js.map +1 -1
- package/dist/git/parsers/diffParser.d.ts.map +1 -1
- package/dist/git/parsers/diffParser.js +1 -1
- package/dist/git/parsers/diffParser.js.map +1 -1
- package/dist/git/parsers/rebaseTodoParser.d.ts.map +1 -1
- package/dist/git/parsers/rebaseTodoParser.js.map +1 -1
- package/dist/git/providers/blame.d.ts.map +1 -1
- package/dist/git/providers/blame.js.map +1 -1
- package/dist/git/providers/branches.d.ts +8 -1
- package/dist/git/providers/branches.d.ts.map +1 -1
- package/dist/git/providers/branches.js.map +1 -1
- package/dist/git/providers/commits.d.ts +6 -1
- package/dist/git/providers/commits.d.ts.map +1 -1
- package/dist/git/providers/commits.js.map +1 -1
- package/dist/git/providers/config.d.ts +6 -2
- package/dist/git/providers/config.d.ts.map +1 -1
- package/dist/git/providers/config.js.map +1 -1
- package/dist/git/providers/contributors.d.ts.map +1 -1
- package/dist/git/providers/contributors.js.map +1 -1
- package/dist/git/providers/diff.d.ts.map +1 -1
- package/dist/git/providers/diff.js.map +1 -1
- package/dist/git/providers/graph.d.ts +55 -1
- package/dist/git/providers/graph.d.ts.map +1 -1
- package/dist/git/providers/graph.js.map +1 -1
- package/dist/git/providers/operations.d.ts.map +1 -1
- package/dist/git/providers/operations.js.map +1 -1
- package/dist/git/providers/patch.d.ts.map +1 -1
- package/dist/git/providers/patch.js.map +1 -1
- package/dist/git/providers/pausedOperations.d.ts.map +1 -1
- package/dist/git/providers/pausedOperations.js.map +1 -1
- package/dist/git/providers/provider.d.ts.map +1 -1
- package/dist/git/providers/provider.js.map +1 -1
- package/dist/git/providers/refs.d.ts.map +1 -1
- package/dist/git/providers/refs.js.map +1 -1
- package/dist/git/providers/remotes.d.ts.map +1 -1
- package/dist/git/providers/remotes.js.map +1 -1
- package/dist/git/providers/revision.d.ts.map +1 -1
- package/dist/git/providers/revision.js.map +1 -1
- package/dist/git/providers/shared/remotes.d.ts.map +1 -1
- package/dist/git/providers/shared/remotes.js.map +1 -1
- package/dist/git/providers/staging.d.ts.map +1 -1
- package/dist/git/providers/staging.js.map +1 -1
- package/dist/git/providers/stash.d.ts.map +1 -1
- package/dist/git/providers/stash.js.map +1 -1
- package/dist/git/providers/status.d.ts +1 -0
- package/dist/git/providers/status.d.ts.map +1 -1
- package/dist/git/providers/status.js.map +1 -1
- package/dist/git/providers/tags.d.ts.map +1 -1
- package/dist/git/providers/tags.js.map +1 -1
- package/dist/git/providers/types.d.ts.map +1 -1
- package/dist/git/providers/types.js.map +1 -1
- package/dist/git/providers/worktrees.d.ts +3 -1
- package/dist/git/providers/worktrees.d.ts.map +1 -1
- package/dist/git/providers/worktrees.js.map +1 -1
- package/dist/git/remotes/azure-devops.d.ts.map +1 -1
- package/dist/git/remotes/azure-devops.js +27 -31
- package/dist/git/remotes/azure-devops.js.map +1 -1
- package/dist/git/remotes/bitbucket-server.d.ts.map +1 -1
- package/dist/git/remotes/bitbucket-server.js +21 -23
- package/dist/git/remotes/bitbucket-server.js.map +1 -1
- package/dist/git/remotes/bitbucket.d.ts.map +1 -1
- package/dist/git/remotes/bitbucket.js +21 -23
- package/dist/git/remotes/bitbucket.js.map +1 -1
- package/dist/git/remotes/custom.d.ts.map +1 -1
- package/dist/git/remotes/custom.js.map +1 -1
- package/dist/git/remotes/gerrit.d.ts.map +1 -1
- package/dist/git/remotes/gerrit.js +11 -13
- package/dist/git/remotes/gerrit.js.map +1 -1
- package/dist/git/remotes/gitea.d.ts.map +1 -1
- package/dist/git/remotes/gitea.js +12 -14
- package/dist/git/remotes/gitea.js.map +1 -1
- package/dist/git/remotes/github.d.ts.map +1 -1
- package/dist/git/remotes/github.js +54 -56
- package/dist/git/remotes/github.js.map +1 -1
- package/dist/git/remotes/gitlab.d.ts.map +1 -1
- package/dist/git/remotes/gitlab.js +93 -95
- package/dist/git/remotes/gitlab.js.map +1 -1
- package/dist/git/remotes/google-source.d.ts.map +1 -1
- package/dist/git/remotes/google-source.js.map +1 -1
- package/dist/git/remotes/matcher.d.ts.map +1 -1
- package/dist/git/remotes/matcher.js.map +1 -1
- package/dist/git/run.types.d.ts +62 -3
- package/dist/git/run.types.d.ts.map +1 -1
- package/dist/git/service.d.ts.map +1 -1
- package/dist/git/utils/autolink.utils.d.ts.map +1 -1
- package/dist/git/utils/autolink.utils.js.map +1 -1
- package/dist/git/utils/blame.utils.d.ts.map +1 -1
- package/dist/git/utils/blame.utils.js.map +1 -1
- package/dist/git/utils/branch.utils.d.ts.map +1 -1
- package/dist/git/utils/branch.utils.js +12 -1
- package/dist/git/utils/branch.utils.js.map +1 -1
- package/dist/git/utils/commit.utils.d.ts.map +1 -1
- package/dist/git/utils/commit.utils.js.map +1 -1
- package/dist/git/utils/conflictResolution.utils.d.ts.map +1 -1
- package/dist/git/utils/conflictResolution.utils.js.map +1 -1
- package/dist/git/utils/contributor.utils.d.ts +1 -1
- package/dist/git/utils/contributor.utils.d.ts.map +1 -1
- package/dist/git/utils/contributor.utils.js +1 -2
- package/dist/git/utils/contributor.utils.js.map +1 -1
- package/dist/git/utils/fetch.utils.d.ts.map +1 -1
- package/dist/git/utils/fetch.utils.js.map +1 -1
- package/dist/git/utils/fileStatus.utils.d.ts +7 -0
- package/dist/git/utils/fileStatus.utils.d.ts.map +1 -1
- package/dist/git/utils/fileStatus.utils.js +6 -0
- package/dist/git/utils/fileStatus.utils.js.map +1 -1
- package/dist/git/utils/graph.utils.d.ts +20 -0
- package/dist/git/utils/graph.utils.d.ts.map +1 -0
- package/dist/git/utils/graph.utils.js +40 -0
- package/dist/git/utils/graph.utils.js.map +1 -0
- package/dist/git/utils/issue.utils.d.ts.map +1 -1
- package/dist/git/utils/issue.utils.js +1 -0
- package/dist/git/utils/issue.utils.js.map +1 -1
- package/dist/git/utils/issueOrPullRequest.utils.d.ts.map +1 -1
- package/dist/git/utils/issueOrPullRequest.utils.js.map +1 -1
- package/dist/git/utils/mergeConflicts.utils.d.ts.map +1 -1
- package/dist/git/utils/mergeConflicts.utils.js.map +1 -1
- package/dist/git/utils/pausedOperationStatus.utils.d.ts +13 -13
- package/dist/git/utils/pausedOperationStatus.utils.d.ts.map +1 -1
- package/dist/git/utils/pausedOperationStatus.utils.js.map +1 -1
- package/dist/git/utils/pullRequest.utils.d.ts.map +1 -1
- package/dist/git/utils/pullRequest.utils.js +9 -0
- package/dist/git/utils/pullRequest.utils.js.map +1 -1
- package/dist/git/utils/reachability.utils.d.ts +20 -2
- package/dist/git/utils/reachability.utils.d.ts.map +1 -1
- package/dist/git/utils/reachability.utils.js +68 -7
- package/dist/git/utils/reachability.utils.js.map +1 -1
- package/dist/git/utils/rebase.utils.d.ts.map +1 -1
- package/dist/git/utils/rebase.utils.js.map +1 -1
- package/dist/git/utils/reference.utils.d.ts.map +1 -1
- package/dist/git/utils/reference.utils.js.map +1 -1
- package/dist/git/utils/remote.utils.d.ts.map +1 -1
- package/dist/git/utils/remote.utils.js.map +1 -1
- package/dist/git/utils/repository.utils.d.ts.map +1 -1
- package/dist/git/utils/repository.utils.js.map +1 -1
- package/dist/git/utils/resourceDescriptor.utils.d.ts.map +1 -1
- package/dist/git/utils/resourceDescriptor.utils.js.map +1 -1
- package/dist/git/utils/revision.utils.d.ts.map +1 -1
- package/dist/git/utils/revision.utils.js.map +1 -1
- package/dist/git/utils/search.utils.d.ts.map +1 -1
- package/dist/git/utils/search.utils.js.map +1 -1
- package/dist/git/utils/sorting.d.ts.map +1 -1
- package/dist/git/utils/sorting.js.map +1 -1
- package/dist/git/utils/sshKey.utils.d.ts +7 -0
- package/dist/git/utils/sshKey.utils.d.ts.map +1 -0
- package/dist/git/utils/sshKey.utils.js +25 -0
- package/dist/git/utils/sshKey.utils.js.map +1 -0
- package/dist/git/utils/status.utils.d.ts.map +1 -1
- package/dist/git/utils/status.utils.js.map +1 -1
- package/dist/git/utils/statusFile.utils.d.ts.map +1 -1
- package/dist/git/utils/statusFile.utils.js.map +1 -1
- package/dist/git/utils/tag.utils.d.ts.map +1 -1
- package/dist/git/utils/tag.utils.js.map +1 -1
- package/dist/git/utils/tooltip.utils.d.ts.map +1 -1
- package/dist/git/utils/tooltip.utils.js.map +1 -1
- package/dist/git/utils/uriAuthority.d.ts.map +1 -1
- package/dist/git/utils/uriAuthority.js.map +1 -1
- package/dist/git/utils/user.utils.d.ts.map +1 -1
- package/dist/git/utils/user.utils.js.map +1 -1
- package/dist/git/utils/worktree.utils.d.ts.map +1 -1
- package/dist/git/utils/worktree.utils.js.map +1 -1
- package/dist/git/watching/changeEvent.d.ts.map +1 -1
- package/dist/git/watching/changeEvent.js.map +1 -1
- package/dist/git/watching/classifyChange.d.ts.map +1 -1
- package/dist/git/watching/classifyChange.js.map +1 -1
- package/dist/git/watching/gitIgnoreFilter.d.ts.map +1 -1
- package/dist/git/watching/gitIgnoreFilter.js.map +1 -1
- package/dist/git/watching/initWatcher.d.ts.map +1 -1
- package/dist/git/watching/initWatcher.js.map +1 -1
- package/dist/git/watching/provider.d.ts.map +1 -1
- package/dist/git/watching/provider.js.map +1 -1
- package/dist/git/watching/watchGroup.d.ts.map +1 -1
- package/dist/git/watching/watchGroup.js.map +1 -1
- package/dist/git/watching/watchService.d.ts +4 -0
- package/dist/git/watching/watchService.d.ts.map +1 -1
- package/dist/git/watching/watchService.js +15 -1
- package/dist/git/watching/watchService.js.map +1 -1
- package/dist/git/watching/watchSession.d.ts +7 -0
- package/dist/git/watching/watchSession.d.ts.map +1 -1
- package/dist/git/watching/watchSession.js +14 -2
- package/dist/git/watching/watchSession.js.map +1 -1
- package/dist/git/watching/watcherPatterns.d.ts.map +1 -1
- package/dist/git/watching/watcherPatterns.js.map +1 -1
- package/dist/git-cli/cliGitProvider.d.ts.map +1 -1
- package/dist/git-cli/exec/exec.d.ts.map +1 -1
- package/dist/git-cli/exec/exec.errors.d.ts.map +1 -1
- package/dist/git-cli/exec/exec.errors.js.map +1 -1
- package/dist/git-cli/exec/exec.js.map +1 -1
- package/dist/git-cli/exec/exec.types.d.ts.map +1 -1
- package/dist/git-cli/exec/exec.types.js.map +1 -1
- package/dist/git-cli/exec/features.d.ts.map +1 -1
- package/dist/git-cli/exec/features.js.map +1 -1
- package/dist/git-cli/exec/git.d.ts +19 -27
- package/dist/git-cli/exec/git.d.ts.map +1 -1
- package/dist/git-cli/exec/git.js +126 -34
- package/dist/git-cli/exec/git.js.map +1 -1
- package/dist/git-cli/exec/gitQueue.d.ts.map +1 -1
- package/dist/git-cli/exec/gitQueue.js.map +1 -1
- package/dist/git-cli/exec/locator.d.ts.map +1 -1
- package/dist/git-cli/exec/locator.js.map +1 -1
- package/dist/git-cli/parsers/blameParser.d.ts.map +1 -1
- package/dist/git-cli/parsers/blameParser.js.map +1 -1
- package/dist/git-cli/parsers/indexParser.d.ts.map +1 -1
- package/dist/git-cli/parsers/indexParser.js.map +1 -1
- package/dist/git-cli/parsers/logParser.d.ts +9 -1
- package/dist/git-cli/parsers/logParser.d.ts.map +1 -1
- package/dist/git-cli/parsers/logParser.js +141 -60
- package/dist/git-cli/parsers/logParser.js.map +1 -1
- package/dist/git-cli/parsers/mergeTreeParser.d.ts.map +1 -1
- package/dist/git-cli/parsers/mergeTreeParser.js.map +1 -1
- package/dist/git-cli/parsers/refParser.d.ts.map +1 -1
- package/dist/git-cli/parsers/refParser.js.map +1 -1
- package/dist/git-cli/parsers/reflogParser.d.ts.map +1 -1
- package/dist/git-cli/parsers/reflogParser.js.map +1 -1
- package/dist/git-cli/parsers/remoteParser.d.ts.map +1 -1
- package/dist/git-cli/parsers/remoteParser.js.map +1 -1
- package/dist/git-cli/parsers/shortlogParser.d.ts.map +1 -1
- package/dist/git-cli/parsers/shortlogParser.js.map +1 -1
- package/dist/git-cli/parsers/signatureParser.d.ts.map +1 -1
- package/dist/git-cli/parsers/signatureParser.js.map +1 -1
- package/dist/git-cli/parsers/sshSignatureParser.d.ts +21 -0
- package/dist/git-cli/parsers/sshSignatureParser.d.ts.map +1 -0
- package/dist/git-cli/parsers/sshSignatureParser.js +78 -0
- package/dist/git-cli/parsers/sshSignatureParser.js.map +1 -0
- package/dist/git-cli/parsers/statusParser.d.ts.map +1 -1
- package/dist/git-cli/parsers/statusParser.js.map +1 -1
- package/dist/git-cli/parsers/treeParser.d.ts.map +1 -1
- package/dist/git-cli/parsers/treeParser.js.map +1 -1
- package/dist/git-cli/parsers/worktreeParser.d.ts.map +1 -1
- package/dist/git-cli/parsers/worktreeParser.js +5 -7
- package/dist/git-cli/parsers/worktreeParser.js.map +1 -1
- package/dist/git-cli/providers/blame.d.ts.map +1 -1
- package/dist/git-cli/providers/blame.js.map +1 -1
- package/dist/git-cli/providers/branches.d.ts +1 -0
- package/dist/git-cli/providers/branches.d.ts.map +1 -1
- package/dist/git-cli/providers/branches.js +51 -32
- package/dist/git-cli/providers/branches.js.map +1 -1
- package/dist/git-cli/providers/commitFilesetUtils.d.ts.map +1 -1
- package/dist/git-cli/providers/commitFilesetUtils.js.map +1 -1
- package/dist/git-cli/providers/commits.d.ts +12 -1
- package/dist/git-cli/providers/commits.d.ts.map +1 -1
- package/dist/git-cli/providers/commits.js +89 -8
- package/dist/git-cli/providers/commits.js.map +1 -1
- package/dist/git-cli/providers/config.d.ts.map +1 -1
- package/dist/git-cli/providers/config.js.map +1 -1
- package/dist/git-cli/providers/contributors.d.ts.map +1 -1
- package/dist/git-cli/providers/contributors.js.map +1 -1
- package/dist/git-cli/providers/diff.d.ts.map +1 -1
- package/dist/git-cli/providers/diff.js.map +1 -1
- package/dist/git-cli/providers/graph.d.ts +35 -1
- package/dist/git-cli/providers/graph.d.ts.map +1 -1
- package/dist/git-cli/providers/graph.js +1434 -330
- package/dist/git-cli/providers/graph.js.map +1 -1
- package/dist/git-cli/providers/operations.d.ts.map +1 -1
- package/dist/git-cli/providers/operations.js.map +1 -1
- package/dist/git-cli/providers/patch.d.ts.map +1 -1
- package/dist/git-cli/providers/patch.js.map +1 -1
- package/dist/git-cli/providers/pausedOperations.d.ts.map +1 -1
- package/dist/git-cli/providers/pausedOperations.js +3 -3
- package/dist/git-cli/providers/pausedOperations.js.map +1 -1
- package/dist/git-cli/providers/refs.d.ts.map +1 -1
- package/dist/git-cli/providers/refs.js.map +1 -1
- package/dist/git-cli/providers/remotes.d.ts.map +1 -1
- package/dist/git-cli/providers/remotes.js.map +1 -1
- package/dist/git-cli/providers/revision.d.ts +1 -0
- package/dist/git-cli/providers/revision.d.ts.map +1 -1
- package/dist/git-cli/providers/revision.js +33 -0
- package/dist/git-cli/providers/revision.js.map +1 -1
- package/dist/git-cli/providers/staging.d.ts.map +1 -1
- package/dist/git-cli/providers/staging.js.map +1 -1
- package/dist/git-cli/providers/stash.d.ts.map +1 -1
- package/dist/git-cli/providers/stash.js.map +1 -1
- package/dist/git-cli/providers/status.d.ts +28 -0
- package/dist/git-cli/providers/status.d.ts.map +1 -1
- package/dist/git-cli/providers/status.js +240 -154
- package/dist/git-cli/providers/status.js.map +1 -1
- package/dist/git-cli/providers/tags.d.ts.map +1 -1
- package/dist/git-cli/providers/tags.js +2 -1
- package/dist/git-cli/providers/tags.js.map +1 -1
- package/dist/git-cli/providers/worktrees.d.ts +2 -1
- package/dist/git-cli/providers/worktrees.d.ts.map +1 -1
- package/dist/git-cli/providers/worktrees.js +28 -3
- package/dist/git-cli/providers/worktrees.js.map +1 -1
- package/dist/git-cli/service.d.ts.map +1 -1
- package/dist/git-cli/service.js +8 -0
- package/dist/git-cli/service.js.map +1 -1
- package/dist/ipc/ipcServer.d.ts.map +1 -1
- package/dist/ipc/ipcServer.js +1 -1
- package/dist/ipc/ipcServer.js.map +1 -1
- package/dist/plus/agents/providers/claudeCodeProvider.d.ts +6 -1
- package/dist/plus/agents/providers/claudeCodeProvider.d.ts.map +1 -1
- package/dist/plus/agents/providers/claudeCodeProvider.js +19 -0
- package/dist/plus/agents/providers/claudeCodeProvider.js.map +1 -1
- package/dist/plus/agents/providers/claudeCodeTranscript.d.ts +68 -0
- package/dist/plus/agents/providers/claudeCodeTranscript.d.ts.map +1 -1
- package/dist/plus/agents/providers/claudeCodeTranscript.js +262 -8
- package/dist/plus/agents/providers/claudeCodeTranscript.js.map +1 -1
- package/dist/plus/agents/types.d.ts +36 -2
- package/dist/plus/agents/types.d.ts.map +1 -1
- package/dist/plus/ai/constants.d.ts +1 -2
- package/dist/plus/ai/constants.d.ts.map +1 -1
- package/dist/plus/ai/constants.js +1 -8
- package/dist/plus/ai/constants.js.map +1 -1
- package/dist/plus/ai/errors.d.ts.map +1 -1
- package/dist/plus/ai/errors.js.map +1 -1
- package/dist/plus/ai/models/conversation.d.ts.map +1 -1
- package/dist/plus/ai/models/conversation.js.map +1 -1
- package/dist/plus/ai/models/model.d.ts +2 -1
- package/dist/plus/ai/models/model.d.ts.map +1 -1
- package/dist/plus/ai/models/model.js +50 -1
- package/dist/plus/ai/models/model.js.map +1 -1
- package/dist/plus/ai/models/promptTemplates.d.ts +5 -2
- package/dist/plus/ai/models/promptTemplates.d.ts.map +1 -1
- package/dist/plus/ai/models/promptTemplates.js.map +1 -1
- package/dist/plus/ai/models/provider.d.ts.map +1 -1
- package/dist/plus/ai/models/provider.js.map +1 -1
- package/dist/plus/ai/models/results.d.ts.map +1 -1
- package/dist/plus/ai/models/results.js.map +1 -1
- package/dist/plus/ai/prompts.d.ts +1 -1
- package/dist/plus/ai/prompts.d.ts.map +1 -1
- package/dist/plus/ai/prompts.js +15 -47
- package/dist/plus/ai/prompts.js.map +1 -1
- package/dist/plus/ai/providers/anthropicProvider.d.ts +5 -0
- package/dist/plus/ai/providers/anthropicProvider.d.ts.map +1 -1
- package/dist/plus/ai/providers/anthropicProvider.js +40 -3
- package/dist/plus/ai/providers/anthropicProvider.js.map +1 -1
- package/dist/plus/ai/providers/azureProvider.d.ts.map +1 -1
- package/dist/plus/ai/providers/azureProvider.js.map +1 -1
- package/dist/plus/ai/providers/context.d.ts.map +1 -1
- package/dist/plus/ai/providers/context.js.map +1 -1
- package/dist/plus/ai/providers/deepSeekProvider.d.ts.map +1 -1
- package/dist/plus/ai/providers/deepSeekProvider.js +17 -1
- package/dist/plus/ai/providers/deepSeekProvider.js.map +1 -1
- package/dist/plus/ai/providers/geminiProvider.d.ts.map +1 -1
- package/dist/plus/ai/providers/geminiProvider.js +25 -6
- package/dist/plus/ai/providers/geminiProvider.js.map +1 -1
- package/dist/plus/ai/providers/gitkrakenProvider.d.ts.map +1 -1
- package/dist/plus/ai/providers/gitkrakenProvider.js +1 -0
- package/dist/plus/ai/providers/gitkrakenProvider.js.map +1 -1
- package/dist/plus/ai/providers/huggingFaceProvider.d.ts +1 -1
- package/dist/plus/ai/providers/huggingFaceProvider.d.ts.map +1 -1
- package/dist/plus/ai/providers/huggingFaceProvider.js +21 -18
- package/dist/plus/ai/providers/huggingFaceProvider.js.map +1 -1
- package/dist/plus/ai/providers/mistralProvider.d.ts.map +1 -1
- package/dist/plus/ai/providers/mistralProvider.js.map +1 -1
- package/dist/plus/ai/providers/ollamaProvider.d.ts.map +1 -1
- package/dist/plus/ai/providers/ollamaProvider.js.map +1 -1
- package/dist/plus/ai/providers/openAICompatibleProvider.d.ts.map +1 -1
- package/dist/plus/ai/providers/openAICompatibleProvider.js.map +1 -1
- package/dist/plus/ai/providers/openAICompatibleProviderBase.d.ts +10 -1
- package/dist/plus/ai/providers/openAICompatibleProviderBase.d.ts.map +1 -1
- package/dist/plus/ai/providers/openAICompatibleProviderBase.js +9 -1
- package/dist/plus/ai/providers/openAICompatibleProviderBase.js.map +1 -1
- package/dist/plus/ai/providers/openRouterProvider.d.ts.map +1 -1
- package/dist/plus/ai/providers/openRouterProvider.js.map +1 -1
- package/dist/plus/ai/providers/openaiProvider.d.ts.map +1 -1
- package/dist/plus/ai/providers/openaiProvider.js.map +1 -1
- package/dist/plus/ai/providers/xaiProvider.d.ts.map +1 -1
- package/dist/plus/ai/providers/xaiProvider.js +14 -1
- package/dist/plus/ai/providers/xaiProvider.js.map +1 -1
- package/dist/plus/ai/utils/ai.utils.d.ts.map +1 -1
- package/dist/plus/ai/utils/ai.utils.js +0 -2
- package/dist/plus/ai/utils/ai.utils.js.map +1 -1
- package/dist/plus/ai/utils/results.utils.d.ts +3 -0
- package/dist/plus/ai/utils/results.utils.d.ts.map +1 -1
- package/dist/plus/ai/utils/results.utils.js +26 -0
- package/dist/plus/ai/utils/results.utils.js.map +1 -1
- package/dist/plus/ai/utils/truncation.utils.d.ts +1 -1
- package/dist/plus/ai/utils/truncation.utils.d.ts.map +1 -1
- package/dist/plus/ai/utils/truncation.utils.js.map +1 -1
- package/dist/plus/git-github/api/config.d.ts.map +1 -1
- package/dist/plus/git-github/api/config.js.map +1 -1
- package/dist/plus/git-github/api/github.d.ts +66 -3
- package/dist/plus/git-github/api/github.d.ts.map +1 -1
- package/dist/plus/git-github/api/github.js +345 -74
- package/dist/plus/git-github/api/github.js.map +1 -1
- package/dist/plus/git-github/api/github.utils.d.ts.map +1 -1
- package/dist/plus/git-github/api/github.utils.js.map +1 -1
- package/dist/plus/git-github/api/token.d.ts.map +1 -1
- package/dist/plus/git-github/api/token.js.map +1 -1
- package/dist/plus/git-github/api/tokenUtils.d.ts.map +1 -1
- package/dist/plus/git-github/api/tokenUtils.js.map +1 -1
- package/dist/plus/git-github/api/types.d.ts.map +1 -1
- package/dist/plus/git-github/api/types.js.map +1 -1
- package/dist/plus/git-github/context.d.ts.map +1 -1
- package/dist/plus/git-github/models.d.ts +5 -0
- package/dist/plus/git-github/models.d.ts.map +1 -1
- package/dist/plus/git-github/models.js +27 -2
- package/dist/plus/git-github/models.js.map +1 -1
- package/dist/plus/git-github/providers/github/blame.d.ts.map +1 -1
- package/dist/plus/git-github/providers/github/blame.js.map +1 -1
- package/dist/plus/git-github/providers/github/branches.d.ts +2 -1
- package/dist/plus/git-github/providers/github/branches.d.ts.map +1 -1
- package/dist/plus/git-github/providers/github/branches.js +7 -3
- package/dist/plus/git-github/providers/github/branches.js.map +1 -1
- package/dist/plus/git-github/providers/github/commits.d.ts.map +1 -1
- package/dist/plus/git-github/providers/github/commits.js.map +1 -1
- package/dist/plus/git-github/providers/github/config.d.ts.map +1 -1
- package/dist/plus/git-github/providers/github/config.js.map +1 -1
- package/dist/plus/git-github/providers/github/contributors.d.ts.map +1 -1
- package/dist/plus/git-github/providers/github/contributors.js.map +1 -1
- package/dist/plus/git-github/providers/github/diff.d.ts.map +1 -1
- package/dist/plus/git-github/providers/github/diff.js +2 -2
- package/dist/plus/git-github/providers/github/diff.js.map +1 -1
- package/dist/plus/git-github/providers/github/graph.d.ts +12 -1
- package/dist/plus/git-github/providers/github/graph.d.ts.map +1 -1
- package/dist/plus/git-github/providers/github/graph.js +85 -0
- package/dist/plus/git-github/providers/github/graph.js.map +1 -1
- package/dist/plus/git-github/providers/github/refs.d.ts.map +1 -1
- package/dist/plus/git-github/providers/github/refs.js.map +1 -1
- package/dist/plus/git-github/providers/github/remotes.d.ts.map +1 -1
- package/dist/plus/git-github/providers/github/remotes.js.map +1 -1
- package/dist/plus/git-github/providers/github/revision.d.ts.map +1 -1
- package/dist/plus/git-github/providers/github/revision.js.map +1 -1
- package/dist/plus/git-github/providers/github/status.d.ts.map +1 -1
- package/dist/plus/git-github/providers/github/status.js.map +1 -1
- package/dist/plus/git-github/providers/github/tags.d.ts.map +1 -1
- package/dist/plus/git-github/providers/github/tags.js +3 -1
- package/dist/plus/git-github/providers/github/tags.js.map +1 -1
- package/dist/plus/git-github/providers/githubGitProvider.d.ts.map +1 -1
- package/dist/plus/git-github/providers/githubGitProvider.js.map +1 -1
- package/dist/plus/git-github/providers/githubProvider.d.ts.map +1 -1
- package/dist/plus/git-github/providers/githubProvider.js.map +1 -1
- package/dist/plus/integrations/authentication/cloudIntegrationService.d.ts +20 -1
- package/dist/plus/integrations/authentication/cloudIntegrationService.d.ts.map +1 -1
- package/dist/plus/integrations/authentication/cloudIntegrationService.js +134 -10
- package/dist/plus/integrations/authentication/cloudIntegrationService.js.map +1 -1
- package/dist/plus/integrations/authentication/configuredIntegrationService.d.ts +52 -5
- package/dist/plus/integrations/authentication/configuredIntegrationService.d.ts.map +1 -1
- package/dist/plus/integrations/authentication/configuredIntegrationService.js +248 -46
- package/dist/plus/integrations/authentication/configuredIntegrationService.js.map +1 -1
- package/dist/plus/integrations/authentication/integrationAuthenticationProvider.d.ts +24 -4
- package/dist/plus/integrations/authentication/integrationAuthenticationProvider.d.ts.map +1 -1
- package/dist/plus/integrations/authentication/integrationAuthenticationProvider.js +58 -26
- package/dist/plus/integrations/authentication/integrationAuthenticationProvider.js.map +1 -1
- package/dist/plus/integrations/authentication/integrationAuthenticationService.d.ts.map +1 -1
- package/dist/plus/integrations/authentication/integrationAuthenticationService.js +7 -3
- package/dist/plus/integrations/authentication/integrationAuthenticationService.js.map +1 -1
- package/dist/plus/integrations/authentication/manualTokenProvider.d.ts +1 -0
- package/dist/plus/integrations/authentication/manualTokenProvider.d.ts.map +1 -1
- package/dist/plus/integrations/authentication/manualTokenProvider.js +9 -5
- package/dist/plus/integrations/authentication/manualTokenProvider.js.map +1 -1
- package/dist/plus/integrations/authentication/models.d.ts +33 -0
- package/dist/plus/integrations/authentication/models.d.ts.map +1 -1
- package/dist/plus/integrations/authentication/models.js.map +1 -1
- package/dist/plus/integrations/collectionMetadata.d.ts +21 -0
- package/dist/plus/integrations/collectionMetadata.d.ts.map +1 -0
- package/dist/plus/integrations/collectionMetadata.js +121 -0
- package/dist/plus/integrations/collectionMetadata.js.map +1 -0
- package/dist/plus/integrations/constants.d.ts +12 -2
- package/dist/plus/integrations/constants.d.ts.map +1 -1
- package/dist/plus/integrations/constants.js +10 -0
- package/dist/plus/integrations/constants.js.map +1 -1
- package/dist/plus/integrations/context.d.ts +10 -6
- package/dist/plus/integrations/context.d.ts.map +1 -1
- package/dist/plus/integrations/errors.d.ts +65 -0
- package/dist/plus/integrations/errors.d.ts.map +1 -1
- package/dist/plus/integrations/errors.js +131 -0
- package/dist/plus/integrations/errors.js.map +1 -1
- package/dist/plus/integrations/index.d.ts +57 -12
- package/dist/plus/integrations/index.d.ts.map +1 -1
- package/dist/plus/integrations/index.js +39 -37
- package/dist/plus/integrations/index.js.map +1 -1
- package/dist/plus/integrations/integrationService.d.ts +293 -12
- package/dist/plus/integrations/integrationService.d.ts.map +1 -1
- package/dist/plus/integrations/integrationService.js +1305 -37
- package/dist/plus/integrations/integrationService.js.map +1 -1
- package/dist/plus/integrations/lite.d.ts +47 -0
- package/dist/plus/integrations/lite.d.ts.map +1 -0
- package/dist/plus/integrations/lite.js +141 -0
- package/dist/plus/integrations/lite.js.map +1 -0
- package/dist/plus/integrations/manager.d.ts +332 -0
- package/dist/plus/integrations/manager.d.ts.map +1 -0
- package/dist/plus/integrations/manager.js +2 -0
- package/dist/plus/integrations/manager.js.map +1 -0
- package/dist/plus/integrations/models/gitHostIntegration.d.ts +269 -10
- package/dist/plus/integrations/models/gitHostIntegration.d.ts.map +1 -1
- package/dist/plus/integrations/models/gitHostIntegration.js +712 -88
- package/dist/plus/integrations/models/gitHostIntegration.js.map +1 -1
- package/dist/plus/integrations/models/integration.d.ts +88 -3
- package/dist/plus/integrations/models/integration.d.ts.map +1 -1
- package/dist/plus/integrations/models/integration.js +192 -21
- package/dist/plus/integrations/models/integration.js.map +1 -1
- package/dist/plus/integrations/models/issuesIntegration.d.ts +87 -7
- package/dist/plus/integrations/models/issuesIntegration.d.ts.map +1 -1
- package/dist/plus/integrations/models/issuesIntegration.js +148 -33
- package/dist/plus/integrations/models/issuesIntegration.js.map +1 -1
- package/dist/plus/integrations/providerFilters.d.ts +12 -0
- package/dist/plus/integrations/providerFilters.d.ts.map +1 -0
- package/dist/plus/integrations/providerFilters.js +14 -0
- package/dist/plus/integrations/providerFilters.js.map +1 -0
- package/dist/plus/integrations/providers/apiClients.d.ts.map +1 -1
- package/dist/plus/integrations/providers/apiClients.js +3 -3
- package/dist/plus/integrations/providers/apiClients.js.map +1 -1
- package/dist/plus/integrations/providers/apiConfig.d.ts +52 -0
- package/dist/plus/integrations/providers/apiConfig.d.ts.map +1 -0
- package/dist/plus/integrations/providers/apiConfig.js +19 -0
- package/dist/plus/integrations/providers/apiConfig.js.map +1 -0
- package/dist/plus/integrations/providers/azure/azure.d.ts +14 -2
- package/dist/plus/integrations/providers/azure/azure.d.ts.map +1 -1
- package/dist/plus/integrations/providers/azure/azure.js +107 -32
- package/dist/plus/integrations/providers/azure/azure.js.map +1 -1
- package/dist/plus/integrations/providers/azure/models.d.ts +16 -0
- package/dist/plus/integrations/providers/azure/models.d.ts.map +1 -1
- package/dist/plus/integrations/providers/azure/models.js +6 -6
- package/dist/plus/integrations/providers/azure/models.js.map +1 -1
- package/dist/plus/integrations/providers/azureDevOps.d.ts +55 -9
- package/dist/plus/integrations/providers/azureDevOps.d.ts.map +1 -1
- package/dist/plus/integrations/providers/azureDevOps.js +572 -79
- package/dist/plus/integrations/providers/azureDevOps.js.map +1 -1
- package/dist/plus/integrations/providers/bitbucket/bitbucket.d.ts +13 -2
- package/dist/plus/integrations/providers/bitbucket/bitbucket.d.ts.map +1 -1
- package/dist/plus/integrations/providers/bitbucket/bitbucket.js +108 -32
- package/dist/plus/integrations/providers/bitbucket/bitbucket.js.map +1 -1
- package/dist/plus/integrations/providers/bitbucket/models.d.ts.map +1 -1
- package/dist/plus/integrations/providers/bitbucket/models.js.map +1 -1
- package/dist/plus/integrations/providers/bitbucket-server/models.d.ts +19 -1
- package/dist/plus/integrations/providers/bitbucket-server/models.d.ts.map +1 -1
- package/dist/plus/integrations/providers/bitbucket-server/models.js +20 -1
- package/dist/plus/integrations/providers/bitbucket-server/models.js.map +1 -1
- package/dist/plus/integrations/providers/bitbucket-server.d.ts +28 -4
- package/dist/plus/integrations/providers/bitbucket-server.d.ts.map +1 -1
- package/dist/plus/integrations/providers/bitbucket-server.js +110 -6
- package/dist/plus/integrations/providers/bitbucket-server.js.map +1 -1
- package/dist/plus/integrations/providers/bitbucket.d.ts +38 -4
- package/dist/plus/integrations/providers/bitbucket.d.ts.map +1 -1
- package/dist/plus/integrations/providers/bitbucket.js +330 -34
- package/dist/plus/integrations/providers/bitbucket.js.map +1 -1
- package/dist/plus/integrations/providers/github/github.d.ts.map +1 -1
- package/dist/plus/integrations/providers/github/github.js +1 -1
- package/dist/plus/integrations/providers/github/github.js.map +1 -1
- package/dist/plus/integrations/providers/github/github.utils.d.ts.map +1 -1
- package/dist/plus/integrations/providers/github/github.utils.js.map +1 -1
- package/dist/plus/integrations/providers/github/models.d.ts.map +1 -1
- package/dist/plus/integrations/providers/github/models.js.map +1 -1
- package/dist/plus/integrations/providers/github.d.ts +49 -6
- package/dist/plus/integrations/providers/github.d.ts.map +1 -1
- package/dist/plus/integrations/providers/github.js +289 -4
- package/dist/plus/integrations/providers/github.js.map +1 -1
- package/dist/plus/integrations/providers/gitlab/gitlab.d.ts +11 -3
- package/dist/plus/integrations/providers/gitlab/gitlab.d.ts.map +1 -1
- package/dist/plus/integrations/providers/gitlab/gitlab.js +121 -47
- package/dist/plus/integrations/providers/gitlab/gitlab.js.map +1 -1
- package/dist/plus/integrations/providers/gitlab/gitlab.utils.d.ts +6 -0
- package/dist/plus/integrations/providers/gitlab/gitlab.utils.d.ts.map +1 -1
- package/dist/plus/integrations/providers/gitlab/gitlab.utils.js +8 -0
- package/dist/plus/integrations/providers/gitlab/gitlab.utils.js.map +1 -1
- package/dist/plus/integrations/providers/gitlab/models.d.ts +10 -0
- package/dist/plus/integrations/providers/gitlab/models.d.ts.map +1 -1
- package/dist/plus/integrations/providers/gitlab/models.js +8 -5
- package/dist/plus/integrations/providers/gitlab/models.js.map +1 -1
- package/dist/plus/integrations/providers/gitlab.d.ts +50 -5
- package/dist/plus/integrations/providers/gitlab.d.ts.map +1 -1
- package/dist/plus/integrations/providers/gitlab.js +274 -8
- package/dist/plus/integrations/providers/gitlab.js.map +1 -1
- package/dist/plus/integrations/providers/jira.d.ts +13 -2
- package/dist/plus/integrations/providers/jira.d.ts.map +1 -1
- package/dist/plus/integrations/providers/jira.js +200 -30
- package/dist/plus/integrations/providers/jira.js.map +1 -1
- package/dist/plus/integrations/providers/linear.d.ts +16 -5
- package/dist/plus/integrations/providers/linear.d.ts.map +1 -1
- package/dist/plus/integrations/providers/linear.js +127 -21
- package/dist/plus/integrations/providers/linear.js.map +1 -1
- package/dist/plus/integrations/providers/models.d.ts +339 -60
- package/dist/plus/integrations/providers/models.d.ts.map +1 -1
- package/dist/plus/integrations/providers/models.js +307 -59
- package/dist/plus/integrations/providers/models.js.map +1 -1
- package/dist/plus/integrations/providers/providersApi.d.ts +144 -11
- package/dist/plus/integrations/providers/providersApi.d.ts.map +1 -1
- package/dist/plus/integrations/providers/providersApi.js +486 -55
- package/dist/plus/integrations/providers/providersApi.js.map +1 -1
- package/dist/plus/integrations/providers/trello.d.ts +47 -0
- package/dist/plus/integrations/providers/trello.d.ts.map +1 -0
- package/dist/plus/integrations/providers/trello.js +141 -0
- package/dist/plus/integrations/providers/trello.js.map +1 -0
- package/dist/plus/integrations/providers/utils/providerPaging.d.ts +29 -0
- package/dist/plus/integrations/providers/utils/providerPaging.d.ts.map +1 -0
- package/dist/plus/integrations/providers/utils/providerPaging.js +154 -0
- package/dist/plus/integrations/providers/utils/providerPaging.js.map +1 -0
- package/dist/plus/integrations/providers/utils.d.ts +21 -0
- package/dist/plus/integrations/providers/utils.d.ts.map +1 -1
- package/dist/plus/integrations/providers/utils.js +57 -6
- package/dist/plus/integrations/providers/utils.js.map +1 -1
- package/dist/plus/integrations/reads/context.d.ts +52 -0
- package/dist/plus/integrations/reads/context.d.ts.map +1 -0
- package/dist/plus/integrations/reads/context.js +2 -0
- package/dist/plus/integrations/reads/context.js.map +1 -0
- package/dist/plus/integrations/reads/cursors.d.ts +66 -0
- package/dist/plus/integrations/reads/cursors.d.ts.map +1 -0
- package/dist/plus/integrations/reads/cursors.js +133 -0
- package/dist/plus/integrations/reads/cursors.js.map +1 -0
- package/dist/plus/integrations/reads/drains.d.ts +60 -0
- package/dist/plus/integrations/reads/drains.d.ts.map +1 -0
- package/dist/plus/integrations/reads/drains.js +255 -0
- package/dist/plus/integrations/reads/drains.js.map +1 -0
- package/dist/plus/integrations/reads/filters.d.ts +81 -0
- package/dist/plus/integrations/reads/filters.d.ts.map +1 -0
- package/dist/plus/integrations/reads/filters.js +87 -0
- package/dist/plus/integrations/reads/filters.js.map +1 -0
- package/dist/plus/integrations/reads/hierarchy.d.ts +17 -0
- package/dist/plus/integrations/reads/hierarchy.d.ts.map +1 -0
- package/dist/plus/integrations/reads/hierarchy.js +348 -0
- package/dist/plus/integrations/reads/hierarchy.js.map +1 -0
- package/dist/plus/integrations/reads/hierarchy.utils.d.ts +53 -0
- package/dist/plus/integrations/reads/hierarchy.utils.d.ts.map +1 -0
- package/dist/plus/integrations/reads/hierarchy.utils.js +85 -0
- package/dist/plus/integrations/reads/hierarchy.utils.js.map +1 -0
- package/dist/plus/integrations/reads/issueTracker.d.ts +19 -0
- package/dist/plus/integrations/reads/issueTracker.d.ts.map +1 -0
- package/dist/plus/integrations/reads/issueTracker.js +346 -0
- package/dist/plus/integrations/reads/issueTracker.js.map +1 -0
- package/dist/plus/integrations/reads/issues.d.ts +34 -0
- package/dist/plus/integrations/reads/issues.d.ts.map +1 -0
- package/dist/plus/integrations/reads/issues.js +244 -0
- package/dist/plus/integrations/reads/issues.js.map +1 -0
- package/dist/plus/integrations/reads/paging.d.ts +136 -0
- package/dist/plus/integrations/reads/paging.d.ts.map +1 -0
- package/dist/plus/integrations/reads/paging.js +221 -0
- package/dist/plus/integrations/reads/paging.js.map +1 -0
- package/dist/plus/integrations/reads/pullRequests.d.ts +32 -0
- package/dist/plus/integrations/reads/pullRequests.d.ts.map +1 -0
- package/dist/plus/integrations/reads/pullRequests.js +151 -0
- package/dist/plus/integrations/reads/pullRequests.js.map +1 -0
- package/dist/plus/integrations/reads/warnings.d.ts +47 -0
- package/dist/plus/integrations/reads/warnings.d.ts.map +1 -0
- package/dist/plus/integrations/reads/warnings.js +81 -0
- package/dist/plus/integrations/reads/warnings.js.map +1 -0
- package/dist/plus/integrations/results.d.ts +189 -0
- package/dist/plus/integrations/results.d.ts.map +1 -0
- package/dist/plus/integrations/results.js +62 -0
- package/dist/plus/integrations/results.js.map +1 -0
- package/dist/plus/integrations/utils/domain.utils.d.ts +5 -0
- package/dist/plus/integrations/utils/domain.utils.d.ts.map +1 -0
- package/dist/plus/integrations/utils/domain.utils.js +27 -0
- package/dist/plus/integrations/utils/domain.utils.js.map +1 -0
- package/dist/plus/integrations/utils/integration.utils.d.ts +27 -1
- package/dist/plus/integrations/utils/integration.utils.d.ts.map +1 -1
- package/dist/plus/integrations/utils/integration.utils.js +86 -15
- package/dist/plus/integrations/utils/integration.utils.js.map +1 -1
- package/dist/utils/array.d.ts.map +1 -1
- package/dist/utils/array.js.map +1 -1
- package/dist/utils/brand.d.ts.map +1 -1
- package/dist/utils/cancellation.d.ts +13 -0
- package/dist/utils/cancellation.d.ts.map +1 -1
- package/dist/utils/cancellation.js +52 -7
- package/dist/utils/cancellation.js.map +1 -1
- package/dist/utils/charCode.d.ts.map +1 -1
- package/dist/utils/coalescedRun.d.ts +16 -0
- package/dist/utils/coalescedRun.d.ts.map +1 -0
- package/dist/utils/coalescedRun.js +43 -0
- package/dist/utils/coalescedRun.js.map +1 -0
- package/dist/utils/color.d.ts.map +1 -1
- package/dist/utils/color.js +3 -3
- package/dist/utils/color.js.map +1 -1
- package/dist/utils/date.d.ts +24 -0
- package/dist/utils/date.d.ts.map +1 -1
- package/dist/utils/date.js +62 -0
- package/dist/utils/date.js.map +1 -1
- package/dist/utils/debounce.js +1 -1
- package/dist/utils/debounce.js.map +1 -1
- package/dist/utils/decorators/debounce.d.ts.map +1 -1
- package/dist/utils/decorators/debounce.js.map +1 -1
- package/dist/utils/decorators/gate.d.ts.map +1 -1
- package/dist/utils/decorators/gate.js +2 -2
- package/dist/utils/decorators/gate.js.map +1 -1
- package/dist/utils/decorators/log.d.ts.map +1 -1
- package/dist/utils/decorators/log.js +5 -5
- package/dist/utils/decorators/log.js.map +1 -1
- package/dist/utils/decorators/memoize.d.ts.map +1 -1
- package/dist/utils/decorators/memoize.js +2 -2
- package/dist/utils/decorators/memoize.js.map +1 -1
- package/dist/utils/decorators/resolver.d.ts.map +1 -1
- package/dist/utils/decorators/resolver.js.map +1 -1
- package/dist/utils/decorators/sequentialize.d.ts.map +1 -1
- package/dist/utils/decorators/sequentialize.js +2 -2
- package/dist/utils/decorators/sequentialize.js.map +1 -1
- package/dist/utils/decorators/serializable.d.ts.map +1 -1
- package/dist/utils/decorators/serializable.js +1 -1
- package/dist/utils/decorators/serializable.js.map +1 -1
- package/dist/utils/dedupedAsyncCache.d.ts.map +1 -1
- package/dist/utils/env/browser/base64.d.ts.map +1 -1
- package/dist/utils/env/browser/base64.js.map +1 -1
- package/dist/utils/env/browser/crypto.d.ts.map +1 -1
- package/dist/utils/env/browser/crypto.js.map +1 -1
- package/dist/utils/env/browser/fs.d.ts.map +1 -1
- package/dist/utils/env/browser/fs.js.map +1 -1
- package/dist/utils/env/browser/hex.d.ts.map +1 -1
- package/dist/utils/env/browser/hex.js.map +1 -1
- package/dist/utils/env/browser/hrtime.d.ts.map +1 -1
- package/dist/utils/env/browser/hrtime.js.map +1 -1
- package/dist/utils/env/browser/logScope.d.ts.map +1 -1
- package/dist/utils/env/browser/logScope.js.map +1 -1
- package/dist/utils/env/browser/md5.d.ts.map +1 -1
- package/dist/utils/env/browser/md5.js.map +1 -1
- package/dist/utils/env/browser/platform.d.ts.map +1 -1
- package/dist/utils/env/browser/platform.js.map +1 -1
- package/dist/utils/env/node/base64.d.ts.map +1 -1
- package/dist/utils/env/node/base64.js.map +1 -1
- package/dist/utils/env/node/crypto.d.ts.map +1 -1
- package/dist/utils/env/node/crypto.js.map +1 -1
- package/dist/utils/env/node/exec.d.ts +9 -1
- package/dist/utils/env/node/exec.d.ts.map +1 -1
- package/dist/utils/env/node/exec.js +11 -4
- package/dist/utils/env/node/exec.js.map +1 -1
- package/dist/utils/env/node/fs.d.ts.map +1 -1
- package/dist/utils/env/node/fs.js.map +1 -1
- package/dist/utils/env/node/hex.d.ts.map +1 -1
- package/dist/utils/env/node/hex.js.map +1 -1
- package/dist/utils/env/node/hrtime.d.ts.map +1 -1
- package/dist/utils/env/node/hrtime.js.map +1 -1
- package/dist/utils/env/node/logScope.d.ts.map +1 -1
- package/dist/utils/env/node/logScope.js.map +1 -1
- package/dist/utils/env/node/platform.d.ts.map +1 -1
- package/dist/utils/env/node/platform.js.map +1 -1
- package/dist/utils/event.d.ts.map +1 -1
- package/dist/utils/event.js +18 -22
- package/dist/utils/event.js.map +1 -1
- package/dist/utils/formatter.d.ts.map +1 -1
- package/dist/utils/formatter.js.map +1 -1
- package/dist/utils/function.d.ts.map +1 -1
- package/dist/utils/function.js +3 -3
- package/dist/utils/function.js.map +1 -1
- package/dist/utils/hash.js.map +1 -1
- package/dist/utils/iterable.d.ts.map +1 -1
- package/dist/utils/iterable.js +2 -6
- package/dist/utils/iterable.js.map +1 -1
- package/dist/utils/lazy.d.ts.map +1 -1
- package/dist/utils/lazy.js.map +1 -1
- package/dist/utils/logger.d.ts.map +1 -1
- package/dist/utils/logger.js +1 -1
- package/dist/utils/logger.js.map +1 -1
- package/dist/utils/logger.scoped.js +1 -1
- package/dist/utils/logger.scoped.js.map +1 -1
- package/dist/utils/lruMap.d.ts.map +1 -1
- package/dist/utils/lruMap.js.map +1 -1
- package/dist/utils/mru.d.ts.map +1 -1
- package/dist/utils/mru.js.map +1 -1
- package/dist/utils/object.js.map +1 -1
- package/dist/utils/paging.d.ts +29 -0
- package/dist/utils/paging.d.ts.map +1 -1
- package/dist/utils/paging.js +18 -0
- package/dist/utils/paging.js.map +1 -1
- package/dist/utils/path.js.map +1 -1
- package/dist/utils/promise.d.ts +10 -0
- package/dist/utils/promise.d.ts.map +1 -1
- package/dist/utils/promise.js +26 -3
- package/dist/utils/promise.js.map +1 -1
- package/dist/utils/promiseCache.d.ts +12 -2
- package/dist/utils/promiseCache.d.ts.map +1 -1
- package/dist/utils/promiseCache.js +80 -50
- package/dist/utils/promiseCache.js.map +1 -1
- package/dist/utils/searchTree.d.ts.map +1 -1
- package/dist/utils/searchTree.js +4 -1
- package/dist/utils/searchTree.js.map +1 -1
- package/dist/utils/stopwatch.d.ts.map +1 -1
- package/dist/utils/string.js +1 -1
- package/dist/utils/string.js.map +1 -1
- package/dist/utils/subscriptionManager.d.ts.map +1 -1
- package/dist/utils/subscriptionManager.js.map +1 -1
- package/dist/utils/trie.d.ts.map +1 -1
- package/dist/utils/trie.js +1 -0
- package/dist/utils/trie.js.map +1 -1
- package/docs/integrations.md +372 -0
- package/docs/kepler-read-api-parity.md +112 -0
- package/package.json +238 -213
- package/src/git/cache.ts +75 -8
- package/src/git/errors.ts +36 -1
- package/src/git/models/commit.ts +1 -1
- package/src/git/models/graph.ts +147 -0
- package/src/git/models/graphSession.ts +205 -0
- package/src/git/models/issue.ts +12 -1
- package/src/git/models/pullRequest.ts +27 -1
- package/src/git/models/repository.ts +24 -1
- package/src/git/models/resourceDescriptor.ts +17 -0
- package/src/git/models/signature.ts +16 -0
- package/src/git/models/tag.ts +6 -1
- package/src/git/parsers/diffParser.ts +1 -1
- package/src/git/providers/branches.ts +6 -1
- package/src/git/providers/commits.ts +6 -1
- package/src/git/providers/config.ts +5 -1
- package/src/git/providers/graph.ts +69 -2
- package/src/git/providers/status.ts +1 -1
- package/src/git/providers/worktrees.ts +3 -1
- package/src/git/remotes/azure-devops.ts +29 -33
- package/src/git/remotes/bitbucket-server.ts +23 -25
- package/src/git/remotes/bitbucket.ts +23 -25
- package/src/git/remotes/gerrit.ts +12 -14
- package/src/git/remotes/gitea.ts +13 -15
- package/src/git/remotes/github.ts +56 -58
- package/src/git/remotes/gitlab.ts +102 -104
- package/src/git/run.types.ts +54 -4
- package/src/git/utils/branch.utils.ts +12 -1
- package/src/git/utils/contributor.utils.ts +1 -1
- package/src/git/utils/fileStatus.utils.ts +7 -0
- package/src/git/utils/graph.utils.ts +46 -0
- package/src/git/utils/issue.utils.ts +1 -0
- package/src/git/utils/pullRequest.utils.ts +9 -0
- package/src/git/utils/reachability.utils.ts +79 -8
- package/src/git/utils/sshKey.utils.ts +30 -0
- package/src/git/watching/watchService.ts +16 -1
- package/src/git/watching/watchSession.ts +20 -2
- package/src/git-cli/exec/git.ts +144 -42
- package/src/git-cli/parsers/logParser.ts +83 -1
- package/src/git-cli/parsers/sshSignatureParser.ts +85 -0
- package/src/git-cli/parsers/worktreeParser.ts +5 -7
- package/src/git-cli/providers/branches.ts +60 -38
- package/src/git-cli/providers/commits.ts +102 -9
- package/src/git-cli/providers/graph.ts +1771 -393
- package/src/git-cli/providers/pausedOperations.ts +3 -3
- package/src/git-cli/providers/revision.ts +42 -0
- package/src/git-cli/providers/status.ts +333 -178
- package/src/git-cli/providers/tags.ts +2 -0
- package/src/git-cli/providers/worktrees.ts +40 -4
- package/src/git-cli/service.ts +9 -0
- package/src/ipc/ipcServer.ts +1 -1
- package/src/plus/agents/providers/claudeCodeProvider.ts +25 -0
- package/src/plus/agents/providers/claudeCodeTranscript.ts +320 -8
- package/src/plus/agents/types.ts +34 -0
- package/src/plus/ai/constants.ts +1 -9
- package/src/plus/ai/models/model.ts +53 -2
- package/src/plus/ai/models/promptTemplates.ts +9 -2
- package/src/plus/ai/prompts.ts +16 -48
- package/src/plus/ai/providers/anthropicProvider.ts +45 -3
- package/src/plus/ai/providers/deepSeekProvider.ts +17 -1
- package/src/plus/ai/providers/geminiProvider.ts +25 -6
- package/src/plus/ai/providers/gitkrakenProvider.ts +2 -0
- package/src/plus/ai/providers/huggingFaceProvider.ts +28 -21
- package/src/plus/ai/providers/openAICompatibleProviderBase.ts +16 -1
- package/src/plus/ai/providers/xaiProvider.ts +14 -1
- package/src/plus/ai/utils/ai.utils.ts +0 -2
- package/src/plus/ai/utils/results.utils.ts +32 -0
- package/src/plus/ai/utils/truncation.utils.ts +0 -1
- package/src/plus/git-github/api/github.ts +484 -104
- package/src/plus/git-github/models.ts +33 -0
- package/src/plus/git-github/providers/github/branches.ts +6 -3
- package/src/plus/git-github/providers/github/diff.ts +1 -1
- package/src/plus/git-github/providers/github/graph.ts +131 -0
- package/src/plus/git-github/providers/github/tags.ts +2 -0
- package/src/plus/integrations/authentication/cloudIntegrationService.ts +189 -17
- package/src/plus/integrations/authentication/configuredIntegrationService.ts +287 -50
- package/src/plus/integrations/authentication/integrationAuthenticationProvider.ts +105 -31
- package/src/plus/integrations/authentication/integrationAuthenticationService.ts +7 -3
- package/src/plus/integrations/authentication/manualTokenProvider.ts +12 -5
- package/src/plus/integrations/authentication/models.ts +35 -1
- package/src/plus/integrations/collectionMetadata.ts +143 -0
- package/src/plus/integrations/constants.ts +21 -0
- package/src/plus/integrations/context.ts +8 -9
- package/src/plus/integrations/errors.ts +149 -0
- package/src/plus/integrations/index.ts +148 -51
- package/src/plus/integrations/integrationService.ts +1714 -49
- package/src/plus/integrations/lite.ts +233 -0
- package/src/plus/integrations/manager.ts +359 -0
- package/src/plus/integrations/models/gitHostIntegration.ts +1014 -121
- package/src/plus/integrations/models/integration.ts +293 -24
- package/src/plus/integrations/models/issuesIntegration.ts +178 -38
- package/src/plus/integrations/providerFilters.ts +12 -0
- package/src/plus/integrations/providers/apiClients.ts +8 -11
- package/src/plus/integrations/providers/apiConfig.ts +71 -0
- package/src/plus/integrations/providers/azure/azure.ts +164 -33
- package/src/plus/integrations/providers/azure/models.ts +19 -6
- package/src/plus/integrations/providers/azureDevOps.ts +766 -101
- package/src/plus/integrations/providers/bitbucket/bitbucket.ts +164 -34
- package/src/plus/integrations/providers/bitbucket-server/models.ts +32 -1
- package/src/plus/integrations/providers/bitbucket-server.ts +173 -8
- package/src/plus/integrations/providers/bitbucket.ts +489 -45
- package/src/plus/integrations/providers/github/github.ts +2 -2
- package/src/plus/integrations/providers/github/github.utils.ts +1 -1
- package/src/plus/integrations/providers/github.ts +390 -6
- package/src/plus/integrations/providers/gitlab/gitlab.ts +170 -60
- package/src/plus/integrations/providers/gitlab/gitlab.utils.ts +9 -0
- package/src/plus/integrations/providers/gitlab/models.ts +19 -5
- package/src/plus/integrations/providers/gitlab.ts +369 -10
- package/src/plus/integrations/providers/jira.ts +247 -42
- package/src/plus/integrations/providers/linear.ts +154 -27
- package/src/plus/integrations/providers/models.ts +583 -75
- package/src/plus/integrations/providers/providersApi.ts +849 -86
- package/src/plus/integrations/providers/trello.ts +205 -0
- package/src/plus/integrations/providers/utils/providerPaging.ts +177 -0
- package/src/plus/integrations/providers/utils.ts +68 -8
- package/src/plus/integrations/reads/context.ts +75 -0
- package/src/plus/integrations/reads/cursors.ts +224 -0
- package/src/plus/integrations/reads/drains.ts +343 -0
- package/src/plus/integrations/reads/filters.ts +124 -0
- package/src/plus/integrations/reads/hierarchy.ts +493 -0
- package/src/plus/integrations/reads/hierarchy.utils.ts +106 -0
- package/src/plus/integrations/reads/issueTracker.ts +480 -0
- package/src/plus/integrations/reads/issues.ts +407 -0
- package/src/plus/integrations/reads/paging.ts +277 -0
- package/src/plus/integrations/reads/pullRequests.ts +267 -0
- package/src/plus/integrations/reads/warnings.ts +170 -0
- package/src/plus/integrations/results.ts +275 -0
- package/src/plus/integrations/utils/domain.utils.ts +26 -0
- package/src/plus/integrations/utils/integration.utils.ts +93 -16
- package/src/utils/brand.ts +0 -2
- package/src/utils/cancellation.ts +56 -7
- package/src/utils/coalescedRun.ts +45 -0
- package/src/utils/color.ts +3 -3
- package/src/utils/date.ts +72 -0
- package/src/utils/debounce.ts +1 -1
- package/src/utils/decorators/gate.ts +2 -2
- package/src/utils/decorators/log.ts +5 -5
- package/src/utils/decorators/memoize.ts +2 -2
- package/src/utils/decorators/sequentialize.ts +2 -2
- package/src/utils/decorators/serializable.ts +1 -1
- package/src/utils/env/node/exec.ts +20 -5
- package/src/utils/event.ts +19 -25
- package/src/utils/function.ts +3 -3
- package/src/utils/iterable.ts +2 -6
- package/src/utils/logger.scoped.ts +1 -1
- package/src/utils/logger.ts +1 -1
- package/src/utils/paging.ts +46 -0
- package/src/utils/promise.ts +33 -3
- package/src/utils/promiseCache.ts +81 -51
- package/src/utils/searchTree.ts +4 -2
- package/src/utils/string.ts +1 -1
- package/src/utils/trie.ts +1 -0
- package/dist/plus/ai/providers/githubModelsProvider.d.ts +0 -19
- package/dist/plus/ai/providers/githubModelsProvider.d.ts.map +0 -1
- package/dist/plus/ai/providers/githubModelsProvider.js +0 -51
- package/dist/plus/ai/providers/githubModelsProvider.js.map +0 -1
- package/src/plus/ai/providers/githubModelsProvider.ts +0 -92
|
@@ -1,25 +1,34 @@
|
|
|
1
|
+
import type { CollectionMetadata, CollectionScope, CollectionScopeFailure } from '@gitkraken/provider-apis';
|
|
1
2
|
import type { Account, UnidentifiedAuthor } from '../../../git/models/author.js';
|
|
2
3
|
import type { DefaultBranch } from '../../../git/models/defaultBranch.js';
|
|
3
4
|
import type { Issue, IssueShape } from '../../../git/models/issue.js';
|
|
4
5
|
import type { IssueOrPullRequest, IssueOrPullRequestType } from '../../../git/models/issueOrPullRequest.js';
|
|
5
|
-
import type {
|
|
6
|
+
import type {
|
|
7
|
+
PullRequest,
|
|
8
|
+
PullRequestMergeMethod,
|
|
9
|
+
PullRequestState,
|
|
10
|
+
PullRequestStateFilter,
|
|
11
|
+
} from '../../../git/models/pullRequest.js';
|
|
6
12
|
import type { RepositoryMetadata } from '../../../git/models/repositoryMetadata.js';
|
|
13
|
+
import type { ResourceDescriptor } from '../../../git/models/resourceDescriptor.js';
|
|
7
14
|
import { base64 } from '../../../utils/base64.js';
|
|
15
|
+
import { CancellationError } from '../../../utils/cancellation.js';
|
|
8
16
|
import type { Emitter } from '../../../utils/event.js';
|
|
9
|
-
import { flatSettled } from '../../../utils/promise.js';
|
|
10
17
|
import type { IntegrationAuthenticationProviderDescriptor } from '../authentication/integrationAuthenticationProvider.js';
|
|
11
18
|
import type { IntegrationAuthenticationService } from '../authentication/integrationAuthenticationService.js';
|
|
12
|
-
import type { IntegrationServiceContext } from '../context.js';
|
|
13
19
|
import type {
|
|
14
20
|
AuthenticationSessionLike as AuthenticationSession,
|
|
15
21
|
ProviderAuthenticationSession,
|
|
16
22
|
TokenWithInfo,
|
|
17
23
|
} from '../authentication/models.js';
|
|
18
24
|
import { toTokenWithInfo } from '../authentication/models.js';
|
|
25
|
+
import { toCollectionScopeFailure } from '../collectionMetadata.js';
|
|
19
26
|
import { GitCloudHostIntegrationId, GitSelfManagedHostIntegrationId } from '../constants.js';
|
|
27
|
+
import type { IntegrationServiceContext } from '../context.js';
|
|
20
28
|
import type { IntegrationConnectionChangeEvent } from '../integrationService.js';
|
|
29
|
+
import type { SearchMyPullRequestsOptions } from '../models/gitHostIntegration.js';
|
|
21
30
|
import { GitHostIntegration } from '../models/gitHostIntegration.js';
|
|
22
|
-
import type { IntegrationKey } from '../models/integration.js';
|
|
31
|
+
import type { AccountWideIssuesResult, IntegrationKey, SearchMyIssuesOptions } from '../models/integration.js';
|
|
23
32
|
import type {
|
|
24
33
|
AzureOrganizationDescriptor,
|
|
25
34
|
AzureProjectDescriptor,
|
|
@@ -27,9 +36,49 @@ import type {
|
|
|
27
36
|
AzureRemoteRepositoryDescriptor,
|
|
28
37
|
AzureRepositoryDescriptor,
|
|
29
38
|
} from './azure/models.js';
|
|
30
|
-
import type {
|
|
31
|
-
|
|
39
|
+
import type {
|
|
40
|
+
ProviderApiCollectionResult,
|
|
41
|
+
ProviderApiPagedResult,
|
|
42
|
+
ProviderHierarchyResult,
|
|
43
|
+
ProviderOrganization,
|
|
44
|
+
ProviderPullRequest,
|
|
45
|
+
ProviderRepoInput,
|
|
46
|
+
ProviderRepository,
|
|
47
|
+
} from './models.js';
|
|
48
|
+
import {
|
|
49
|
+
fromProviderIssue,
|
|
50
|
+
fromProviderPullRequest,
|
|
51
|
+
getProviderPullRequestIdentity,
|
|
52
|
+
IssueFilter,
|
|
53
|
+
providerPullRequestMatchesSearch,
|
|
54
|
+
providersMetadata,
|
|
55
|
+
PullRequestFilter,
|
|
56
|
+
toProviderPullRequestStates,
|
|
57
|
+
} from './models.js';
|
|
32
58
|
import type { ProvidersApi } from './providersApi.js';
|
|
59
|
+
import { collectProviderPagedResult, flatSettledOrThrow, mergeCollectionMetadata } from './utils/providerPaging.js';
|
|
60
|
+
|
|
61
|
+
function getAzureRepositoryIdentity(repo: Pick<AzureRepositoryDescriptor, 'owner' | 'name' | 'project'>): {
|
|
62
|
+
resourceName: string;
|
|
63
|
+
projectName?: string;
|
|
64
|
+
repositoryName: string;
|
|
65
|
+
} {
|
|
66
|
+
const match = /^([^/]+)\/_git\/([^/]+)$/i.exec(repo.name);
|
|
67
|
+
return {
|
|
68
|
+
resourceName: repo.owner,
|
|
69
|
+
projectName: repo.project ?? match?.[1],
|
|
70
|
+
repositoryName: match?.[2] ?? repo.name,
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Matches an org/project descriptor against a caller-supplied name, mirroring the facade's own
|
|
76
|
+
* key/id/name comparison so `listIssuesPage({ org, project })` narrows on the same identifiers a consumer
|
|
77
|
+
* already got back from `listOrgs`/`listProjects`.
|
|
78
|
+
*/
|
|
79
|
+
function azureResourceMatches(resource: { key?: string; id?: string; name?: string }, value: string): boolean {
|
|
80
|
+
return resource.key === value || resource.id === value || resource.name === value;
|
|
81
|
+
}
|
|
33
82
|
|
|
34
83
|
export abstract class AzureDevOpsIntegrationBase<
|
|
35
84
|
TIntegrationId extends GitCloudHostIntegrationId.AzureDevOps | GitSelfManagedHostIntegrationId.AzureDevOpsServer,
|
|
@@ -110,11 +159,19 @@ export abstract class AzureDevOpsIntegrationBase<
|
|
|
110
159
|
}
|
|
111
160
|
|
|
112
161
|
private _projects: Map<string, AzureProjectDescriptor[] | undefined> | undefined;
|
|
162
|
+
/**
|
|
163
|
+
* Discovers (and caches) each resource's projects. Only resources whose drain completed cleanly are cached;
|
|
164
|
+
* a rejected or backstop-truncated drain is left uncached (retried next call). When `failures` is supplied,
|
|
165
|
+
* a rejected resource is recorded there as a structured {@link CollectionScopeFailure} so an account-wide
|
|
166
|
+
* caller can surface the incomplete project set (a whole org's PRs/issues silently missing otherwise) as a
|
|
167
|
+
* scope-aware warning + `fetchFailed` rather than an all-pages success over a hole.
|
|
168
|
+
*/
|
|
113
169
|
private async getProviderProjectsForResources(
|
|
114
170
|
session: ProviderAuthenticationSession,
|
|
115
171
|
resources: AzureOrganizationDescriptor[],
|
|
116
172
|
force: boolean = false,
|
|
117
|
-
|
|
173
|
+
failures?: CollectionScopeFailure[],
|
|
174
|
+
): Promise<ProviderApiCollectionResult<AzureProjectDescriptor>> {
|
|
118
175
|
this._projects ??= new Map<string, AzureProjectDescriptor[] | undefined>();
|
|
119
176
|
const { accessToken } = session;
|
|
120
177
|
|
|
@@ -131,40 +188,115 @@ export abstract class AzureDevOpsIntegrationBase<
|
|
|
131
188
|
}
|
|
132
189
|
}
|
|
133
190
|
|
|
191
|
+
const allProjects: AzureProjectDescriptor[] = [];
|
|
192
|
+
let resultMetadata: CollectionMetadata | undefined;
|
|
193
|
+
|
|
134
194
|
if (resourcesWithoutProjects.length > 0) {
|
|
135
195
|
const api = await this.getProvidersApi();
|
|
136
196
|
const { tokenWithInfo, options } = this.getApiOptions(session);
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
197
|
+
// The projects API is paginated; a single call would drop every project past the first page (and
|
|
198
|
+
// with it their repos and PRs). Drain all pages per resource, threading the returned cursor.
|
|
199
|
+
// Per-resource (not a shared flatSettled) so a resource whose drain was truncated (hit the paging
|
|
200
|
+
// backstop) or rejected is NOT cached — caching a partial list here would make every later repo/PR/
|
|
201
|
+
// issue read for that org silently inherit an incomplete project set. Leaving it uncached means the
|
|
202
|
+
// next call retries it. The scope is passed so a page-level failure preserves the prefix already
|
|
203
|
+
// fetched and records a structured failure instead of re-throwing.
|
|
204
|
+
const drains = await Promise.allSettled(
|
|
205
|
+
resourcesWithoutProjects.map(async resource => ({
|
|
206
|
+
resource: resource,
|
|
207
|
+
result: await collectProviderPagedResult(
|
|
208
|
+
cursor =>
|
|
209
|
+
api.getAzureProjectsForResource(tokenWithInfo, resource.name, {
|
|
210
|
+
...options,
|
|
211
|
+
cursor: cursor,
|
|
212
|
+
}),
|
|
213
|
+
20,
|
|
214
|
+
{ providerId: this.id, resourceId: resource.id },
|
|
215
|
+
),
|
|
216
|
+
})),
|
|
142
217
|
);
|
|
143
218
|
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
key: p.id,
|
|
155
|
-
})),
|
|
219
|
+
// `allSettled` preserves order, so `drains[i]` is `resourcesWithoutProjects[i]`.
|
|
220
|
+
drains.forEach((drain, i) => {
|
|
221
|
+
// A rejected resource drain contributes nothing and is left uncached (retried next call). Record
|
|
222
|
+
// it as a structured failure so an account-wide caller can warn on the org whose projects (and
|
|
223
|
+
// thus PRs/issues) are missing, instead of silently narrowing the read.
|
|
224
|
+
if (drain.status !== 'fulfilled') {
|
|
225
|
+
const resource = resourcesWithoutProjects[i];
|
|
226
|
+
const failure = toCollectionScopeFailure(
|
|
227
|
+
{ providerId: this.id, resourceId: resource.id },
|
|
228
|
+
drain.reason,
|
|
156
229
|
);
|
|
230
|
+
failures?.push(failure);
|
|
231
|
+
resultMetadata = mergeCollectionMetadata(resultMetadata, {
|
|
232
|
+
completeness: 'partial',
|
|
233
|
+
failures: [failure],
|
|
234
|
+
});
|
|
235
|
+
return;
|
|
157
236
|
}
|
|
158
|
-
|
|
237
|
+
|
|
238
|
+
const { resource, result } = drain.value;
|
|
239
|
+
const projects = result.values
|
|
240
|
+
.filter(p => p.namespace === resource.name)
|
|
241
|
+
.map(p => ({
|
|
242
|
+
id: p.id,
|
|
243
|
+
name: p.name,
|
|
244
|
+
resourceId: resource.id,
|
|
245
|
+
resourceName: resource.name,
|
|
246
|
+
key: p.id,
|
|
247
|
+
}));
|
|
248
|
+
|
|
249
|
+
if (result.metadata != null) {
|
|
250
|
+
resultMetadata = mergeCollectionMetadata(resultMetadata, result.metadata);
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
const metadataIncomplete = result.metadata != null && result.metadata.completeness !== 'complete';
|
|
254
|
+
if (result.truncated || metadataIncomplete) {
|
|
255
|
+
// A truncated drain is an incomplete project set; include its partial values in the current
|
|
256
|
+
// result but don't cache it as if complete. Add a structured failure for the truncation unless
|
|
257
|
+
// the drain already recorded a page-level failure for this resource.
|
|
258
|
+
if (
|
|
259
|
+
result.truncated &&
|
|
260
|
+
!result.metadata?.failures?.some(
|
|
261
|
+
f => f.scope?.resourceId === resource.id && f.kind !== 'unknown',
|
|
262
|
+
)
|
|
263
|
+
) {
|
|
264
|
+
const failure = toCollectionScopeFailure(
|
|
265
|
+
{ providerId: this.id, resourceId: resource.id },
|
|
266
|
+
new Error('Project discovery was truncated before all pages were read'),
|
|
267
|
+
);
|
|
268
|
+
failures?.push(failure);
|
|
269
|
+
resultMetadata = mergeCollectionMetadata(resultMetadata, {
|
|
270
|
+
completeness: 'partial',
|
|
271
|
+
failures: [failure],
|
|
272
|
+
});
|
|
273
|
+
}
|
|
274
|
+
allProjects.push(...projects);
|
|
275
|
+
return;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
this._projects!.set(`${accessToken}:${resource.id}`, projects);
|
|
279
|
+
});
|
|
159
280
|
}
|
|
160
281
|
|
|
161
|
-
|
|
282
|
+
const cachedProjects = resources.reduce<AzureProjectDescriptor[]>((projects, resource) => {
|
|
162
283
|
const resourceProjects = this._projects!.get(`${accessToken}:${resource.id}`);
|
|
163
284
|
if (resourceProjects != null) {
|
|
164
285
|
projects.push(...resourceProjects);
|
|
165
286
|
}
|
|
166
287
|
return projects;
|
|
167
288
|
}, []);
|
|
289
|
+
allProjects.push(...cachedProjects);
|
|
290
|
+
|
|
291
|
+
const projectsByIdentity = new Map<string, AzureProjectDescriptor>();
|
|
292
|
+
for (const project of allProjects) {
|
|
293
|
+
const identity = `${project.resourceId}:${project.id}`;
|
|
294
|
+
if (!projectsByIdentity.has(identity)) {
|
|
295
|
+
projectsByIdentity.set(identity, project);
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
const values = [...projectsByIdentity.values()];
|
|
299
|
+
return resultMetadata != null ? { values: values, metadata: resultMetadata } : { values: values };
|
|
168
300
|
}
|
|
169
301
|
|
|
170
302
|
private async getRepoDescriptorsForProjects(
|
|
@@ -203,6 +335,124 @@ export abstract class AzureDevOpsIntegrationBase<
|
|
|
203
335
|
return descriptors;
|
|
204
336
|
}
|
|
205
337
|
|
|
338
|
+
protected override async getProviderOrganizationsForUser(
|
|
339
|
+
session: ProviderAuthenticationSession,
|
|
340
|
+
): Promise<ProviderHierarchyResult<ProviderOrganization> | undefined> {
|
|
341
|
+
const orgs = await this.getProviderResourcesForUser(session);
|
|
342
|
+
if (orgs == null) return undefined;
|
|
343
|
+
|
|
344
|
+
return {
|
|
345
|
+
values: orgs.map(o => ({
|
|
346
|
+
id: o.id,
|
|
347
|
+
providerId: this.id,
|
|
348
|
+
name: o.name,
|
|
349
|
+
url: `${this.apiBaseUrl}/${o.name}`,
|
|
350
|
+
})),
|
|
351
|
+
};
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
protected override async getProviderProjectsForOrg(
|
|
355
|
+
session: ProviderAuthenticationSession,
|
|
356
|
+
org?: string,
|
|
357
|
+
): Promise<ProviderHierarchyResult<ProviderOrganization> | undefined> {
|
|
358
|
+
// Azure is the one git host with a project tier: repos live under org (resource) → project. Enumerate
|
|
359
|
+
// the user's orgs (optionally scoped to `org`), read their projects, and surface each as an org-shaped
|
|
360
|
+
// entry so the ProviderBackend facade can list them uniformly.
|
|
361
|
+
const orgs = await this.getProviderResourcesForUser(session);
|
|
362
|
+
if (orgs == null) return undefined;
|
|
363
|
+
if (orgs.length === 0) {
|
|
364
|
+
return { values: [], paging: { cursor: '{}', more: false } };
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
const scopedOrgs = org != null ? orgs.filter(o => o.name === org || o.id === org) : orgs;
|
|
368
|
+
if (scopedOrgs.length === 0) return { values: [] };
|
|
369
|
+
|
|
370
|
+
const projects = await this.getProviderProjectsForResources(session, scopedOrgs);
|
|
371
|
+
if (projects.values.length === 0 && projects.metadata == null) return { values: [] };
|
|
372
|
+
|
|
373
|
+
return {
|
|
374
|
+
values: projects.values.map(p => ({
|
|
375
|
+
id: p.id,
|
|
376
|
+
providerId: this.id,
|
|
377
|
+
name: p.name,
|
|
378
|
+
org: p.resourceName,
|
|
379
|
+
url: `${this.apiBaseUrl}/${p.resourceName}/${p.name}`,
|
|
380
|
+
})),
|
|
381
|
+
...(projects.metadata != null ? { metadata: projects.metadata } : {}),
|
|
382
|
+
};
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
/**
|
|
386
|
+
* With `options.project`, returns one page of that project's repos (follow `paging.cursor` to page).
|
|
387
|
+
* Without a project it fans out across every project under `org` and returns them all at once — there's
|
|
388
|
+
* no single cursor to page a parallel merge — skipping any project that fails to list rather than
|
|
389
|
+
* failing the whole org. If any successful project drain hits the defensive page backstop, the merged
|
|
390
|
+
* result is marked `truncated` without exposing a synthetic cursor.
|
|
391
|
+
*/
|
|
392
|
+
protected override async getProviderRepositoriesForOrg(
|
|
393
|
+
session: ProviderAuthenticationSession,
|
|
394
|
+
org: string,
|
|
395
|
+
options?: { project?: string; cursor?: string },
|
|
396
|
+
): Promise<ProviderHierarchyResult<ProviderRepository> | undefined> {
|
|
397
|
+
const api = await this.getProvidersApi();
|
|
398
|
+
const { tokenWithInfo, options: apiOptions } = this.getApiOptions(session);
|
|
399
|
+
|
|
400
|
+
if (options?.project) {
|
|
401
|
+
return api.getReposForAzureProject(tokenWithInfo, org, options.project, {
|
|
402
|
+
...apiOptions,
|
|
403
|
+
cursor: options.cursor,
|
|
404
|
+
});
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
const orgDescriptor = (await this.getProviderResourcesForUser(session))?.find(o => o.name === org);
|
|
408
|
+
if (orgDescriptor == null) return undefined;
|
|
409
|
+
|
|
410
|
+
const discoveryFailures: CollectionScopeFailure[] = [];
|
|
411
|
+
const projects = await this.getProviderProjectsForResources(session, [orgDescriptor], false, discoveryFailures);
|
|
412
|
+
// An empty result is only proven-empty when discovery itself succeeded; a rejected project-discovery
|
|
413
|
+
// leaves the repo set unknowable, so surface the discovery metadata rather than publishing a hole as a
|
|
414
|
+
// complete list.
|
|
415
|
+
if (projects.values.length === 0) {
|
|
416
|
+
return { values: [], metadata: projects.metadata };
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
let repoMetadata: CollectionMetadata | undefined;
|
|
420
|
+
const results = await Promise.allSettled(
|
|
421
|
+
projects.values.map(p =>
|
|
422
|
+
collectProviderPagedResult(
|
|
423
|
+
cursor =>
|
|
424
|
+
api.getReposForAzureProject(tokenWithInfo, org, p.name, { ...apiOptions, cursor: cursor }),
|
|
425
|
+
20,
|
|
426
|
+
{ providerId: this.id, resourceId: org, projectId: p.name },
|
|
427
|
+
),
|
|
428
|
+
),
|
|
429
|
+
);
|
|
430
|
+
|
|
431
|
+
const values: ProviderRepository[] = [];
|
|
432
|
+
let truncated = false;
|
|
433
|
+
for (const result of results) {
|
|
434
|
+
// With a per-project scope, collectProviderPagedResult catches page-level failures itself and returns
|
|
435
|
+
// them as metadata rather than rejecting. A rejected promise here is an unexpected internal error.
|
|
436
|
+
if (result.status !== 'fulfilled') {
|
|
437
|
+
truncated = true;
|
|
438
|
+
continue;
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
values.push(...result.value.values);
|
|
442
|
+
if (result.value.metadata != null) {
|
|
443
|
+
repoMetadata = mergeCollectionMetadata(repoMetadata, result.value.metadata);
|
|
444
|
+
}
|
|
445
|
+
truncated ||= result.value.truncated === true;
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
const metadata = mergeCollectionMetadata(repoMetadata, projects.metadata);
|
|
449
|
+
return {
|
|
450
|
+
values: values,
|
|
451
|
+
...(metadata != null ? { metadata: metadata } : {}),
|
|
452
|
+
...(truncated || (metadata != null && metadata.completeness !== 'complete') ? { truncated: true } : {}),
|
|
453
|
+
};
|
|
454
|
+
}
|
|
455
|
+
|
|
206
456
|
protected override async mergeProviderPullRequest(
|
|
207
457
|
session: ProviderAuthenticationSession,
|
|
208
458
|
pr: PullRequest,
|
|
@@ -264,10 +514,18 @@ export abstract class AzureDevOpsIntegrationBase<
|
|
|
264
514
|
}
|
|
265
515
|
|
|
266
516
|
protected override async getProviderDefaultBranch(
|
|
267
|
-
|
|
268
|
-
|
|
517
|
+
session: ProviderAuthenticationSession,
|
|
518
|
+
repo: AzureRepositoryDescriptor,
|
|
519
|
+
cancellation?: AbortSignal,
|
|
269
520
|
): Promise<DefaultBranch | undefined> {
|
|
270
|
-
return
|
|
521
|
+
return (await this.authenticationService.apis.azure)?.getDefaultBranch(
|
|
522
|
+
this,
|
|
523
|
+
toTokenWithInfo(this.id, session),
|
|
524
|
+
repo.owner,
|
|
525
|
+
repo.name,
|
|
526
|
+
{ baseUrl: this.apiBaseUrl },
|
|
527
|
+
cancellation,
|
|
528
|
+
);
|
|
271
529
|
}
|
|
272
530
|
|
|
273
531
|
protected override async getProviderLinkedIssueOrPullRequest(
|
|
@@ -301,9 +559,9 @@ export abstract class AzureDevOpsIntegrationBase<
|
|
|
301
559
|
if (orgs == null || orgs.length === 0) return undefined;
|
|
302
560
|
|
|
303
561
|
const projects = await this.getProviderProjectsForResources(session, orgs);
|
|
304
|
-
if (projects
|
|
562
|
+
if (projects.values.length === 0) return undefined;
|
|
305
563
|
|
|
306
|
-
const matchingProject = projects.find(p => p.resourceName === project.owner && p.name === project.name);
|
|
564
|
+
const matchingProject = projects.values.find(p => p.resourceName === project.owner && p.name === project.name);
|
|
307
565
|
if (matchingProject == null) return undefined;
|
|
308
566
|
|
|
309
567
|
return (await this.authenticationService.apis.azure)?.getIssue(
|
|
@@ -356,26 +614,49 @@ export abstract class AzureDevOpsIntegrationBase<
|
|
|
356
614
|
public override async getRepoInfo(repo: {
|
|
357
615
|
owner: string;
|
|
358
616
|
name: string;
|
|
359
|
-
project
|
|
617
|
+
project?: string;
|
|
618
|
+
connectionId?: string;
|
|
360
619
|
}): Promise<ProviderRepository | undefined> {
|
|
620
|
+
const identity = getAzureRepositoryIdentity(repo);
|
|
621
|
+
if (identity.projectName == null) return undefined;
|
|
622
|
+
|
|
361
623
|
const api = await this.getProvidersApi();
|
|
362
|
-
|
|
624
|
+
// `connectionId` targets a specific account (multi-account); omitted reads the primary.
|
|
625
|
+
const session = await this.resolveReadSession(repo.connectionId, undefined);
|
|
626
|
+
if (session == null) return undefined;
|
|
363
627
|
|
|
364
|
-
const { tokenWithInfo, options } = this.getApiOptions(
|
|
365
|
-
return api.getRepo(
|
|
628
|
+
const { tokenWithInfo, options } = this.getApiOptions(session);
|
|
629
|
+
return api.getRepo(
|
|
630
|
+
tokenWithInfo,
|
|
631
|
+
identity.resourceName,
|
|
632
|
+
identity.repositoryName,
|
|
633
|
+
identity.projectName,
|
|
634
|
+
options,
|
|
635
|
+
);
|
|
366
636
|
}
|
|
367
637
|
|
|
368
638
|
protected override async getProviderRepositoryMetadata(
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
639
|
+
session: ProviderAuthenticationSession,
|
|
640
|
+
repo: AzureRepositoryDescriptor,
|
|
641
|
+
cancellation?: AbortSignal,
|
|
372
642
|
): Promise<RepositoryMetadata | undefined> {
|
|
373
|
-
return
|
|
643
|
+
return (await this.authenticationService.apis.azure)?.getRepositoryMetadata(
|
|
644
|
+
this,
|
|
645
|
+
toTokenWithInfo(this.id, session),
|
|
646
|
+
repo.owner,
|
|
647
|
+
repo.name,
|
|
648
|
+
{ baseUrl: this.apiBaseUrl },
|
|
649
|
+
cancellation,
|
|
650
|
+
);
|
|
374
651
|
}
|
|
375
652
|
|
|
376
653
|
protected override async searchProviderMyPullRequests(
|
|
377
654
|
session: ProviderAuthenticationSession,
|
|
378
655
|
repos?: AzureRepositoryDescriptor[],
|
|
656
|
+
_cancellation?: AbortSignal,
|
|
657
|
+
_silent?: boolean,
|
|
658
|
+
state?: PullRequestStateFilter,
|
|
659
|
+
_options?: SearchMyPullRequestsOptions,
|
|
379
660
|
): Promise<PullRequest[] | undefined> {
|
|
380
661
|
const api = await this.getProvidersApi();
|
|
381
662
|
if (repos != null) {
|
|
@@ -383,41 +664,50 @@ export abstract class AzureDevOpsIntegrationBase<
|
|
|
383
664
|
return undefined;
|
|
384
665
|
}
|
|
385
666
|
|
|
667
|
+
const states = toProviderPullRequestStates(state);
|
|
668
|
+
|
|
386
669
|
const user = await this.getProviderCurrentAccount(session);
|
|
387
|
-
|
|
670
|
+
// Azure filters key on the identity GUID (account id), not the display name — see
|
|
671
|
+
// getProviderMyPullRequestsForUser and the repo-scoped path in gitHostIntegration.ts.
|
|
672
|
+
if (user?.id == null) return undefined;
|
|
388
673
|
|
|
389
674
|
const orgs = await this.getProviderResourcesForUser(session);
|
|
390
675
|
if (orgs == null || orgs.length === 0) return undefined;
|
|
391
676
|
|
|
392
677
|
const projects = await this.getProviderProjectsForResources(session, orgs);
|
|
393
|
-
if (projects
|
|
678
|
+
if (projects.values.length === 0) return undefined;
|
|
394
679
|
|
|
395
680
|
const repoDescriptors = [
|
|
396
|
-
...((await this.getRepoDescriptorsForProjects(session, projects)) ?? new Map()).values(),
|
|
681
|
+
...((await this.getRepoDescriptorsForProjects(session, projects.values)) ?? new Map()).values(),
|
|
397
682
|
]
|
|
398
683
|
.filter(r => r != null)
|
|
399
684
|
.flat();
|
|
400
685
|
|
|
401
686
|
const { tokenWithInfo, options } = this.getApiOptions(session);
|
|
402
|
-
const projectInputs = projects.map(p => ({ namespace: p.resourceName, project: p.name }));
|
|
687
|
+
const projectInputs = projects.values.map(p => ({ namespace: p.resourceName, project: p.name }));
|
|
688
|
+
// Legacy array-returning path (Launchpad/focus view): unwrap `.values` from the SDK collection result.
|
|
689
|
+
// The metadata (partial/failures) isn't surfaced here because this path's return type has no warning
|
|
690
|
+
// channel; the metadata-aware ProviderBackend surface is getProviderMyPullRequestsForUser above.
|
|
403
691
|
const assignedPrs = (
|
|
404
692
|
await api.getPullRequestsForAzureProjects(tokenWithInfo, projectInputs, {
|
|
405
693
|
...options,
|
|
406
|
-
assigneeLogins: [user.
|
|
694
|
+
assigneeLogins: [user.id],
|
|
695
|
+
states: states,
|
|
407
696
|
})
|
|
408
|
-
)
|
|
697
|
+
).values.map(pr => this.fromAzureProviderPullRequest(pr, repoDescriptors, projects.values));
|
|
409
698
|
const authoredPrs = (
|
|
410
699
|
await api.getPullRequestsForAzureProjects(tokenWithInfo, projectInputs, {
|
|
411
700
|
...options,
|
|
412
|
-
authorLogin: user.
|
|
701
|
+
authorLogin: user.id,
|
|
702
|
+
states: states,
|
|
413
703
|
})
|
|
414
|
-
)
|
|
704
|
+
).values.map(pr => this.fromAzureProviderPullRequest(pr, repoDescriptors, projects.values));
|
|
415
705
|
const prsById = new Map<string, PullRequest>();
|
|
416
|
-
for (const pr of authoredPrs
|
|
706
|
+
for (const pr of authoredPrs) {
|
|
417
707
|
prsById.set(pr.id, pr);
|
|
418
708
|
}
|
|
419
709
|
|
|
420
|
-
for (const pr of assignedPrs
|
|
710
|
+
for (const pr of assignedPrs) {
|
|
421
711
|
const existing = prsById.get(pr.id);
|
|
422
712
|
if (existing == null) {
|
|
423
713
|
prsById.set(pr.id, pr);
|
|
@@ -427,64 +717,418 @@ export abstract class AzureDevOpsIntegrationBase<
|
|
|
427
717
|
return [...prsById.values()];
|
|
428
718
|
}
|
|
429
719
|
|
|
430
|
-
protected override async
|
|
720
|
+
protected override async getProviderMyPullRequestsForUser(
|
|
431
721
|
session: ProviderAuthenticationSession,
|
|
432
|
-
|
|
433
|
-
): Promise<
|
|
722
|
+
options?: { state?: PullRequestStateFilter[]; cursor?: string; filters?: PullRequestFilter[] },
|
|
723
|
+
): Promise<ProviderApiPagedResult<ProviderPullRequest> | undefined> {
|
|
434
724
|
const api = await this.getProvidersApi();
|
|
435
|
-
|
|
436
725
|
const user = await this.getProviderCurrentAccount(session);
|
|
437
|
-
|
|
726
|
+
// Azure routes authorLogin/assigneeLogins to `searchCriteria.creatorId`/`reviewerId`, which require the
|
|
727
|
+
// identity GUID (account id), not the display name — matching the repo-scoped path in
|
|
728
|
+
// gitHostIntegration.ts. Using `username` here would match nothing and return zero PRs.
|
|
729
|
+
if (user?.id == null) return undefined;
|
|
730
|
+
|
|
731
|
+
// Azure PRs are org + project scoped: enumerate the user's orgs and their projects, then read authored
|
|
732
|
+
// and assigned PRs across all of them. Return the raw provider shape (not the normalized model) so the
|
|
733
|
+
// ProviderBackend surface stays uniform with the other providers.
|
|
734
|
+
const orgs = await this.getProviderResourcesForUser(session);
|
|
735
|
+
if (orgs == null || orgs.length === 0) return undefined;
|
|
736
|
+
|
|
737
|
+
// Structured per-scope failures from BOTH project discovery (a whole org dropped) and the per-project PR
|
|
738
|
+
// drains, so the facade warns on the failed scope + sets `fetchFailed` instead of silently narrowing.
|
|
739
|
+
const failures: CollectionScopeFailure[] = [];
|
|
740
|
+
const projects = await this.getProviderProjectsForResources(session, orgs, false, failures);
|
|
741
|
+
if (projects.values.length === 0) {
|
|
742
|
+
// Project discovery itself was incomplete (e.g. a truncated org); surface the metadata so the facade
|
|
743
|
+
// can warn and set fetchFailed rather than reporting an empty account.
|
|
744
|
+
const incomplete = projects.metadata != null && projects.metadata.completeness !== 'complete';
|
|
745
|
+
return {
|
|
746
|
+
values: [],
|
|
747
|
+
paging: { cursor: '{}', more: false, truncated: incomplete || undefined },
|
|
748
|
+
...(projects.metadata != null ? { metadata: projects.metadata } : {}),
|
|
749
|
+
};
|
|
750
|
+
}
|
|
751
|
+
|
|
752
|
+
const { tokenWithInfo, options: apiOptions } = this.getApiOptions(session);
|
|
753
|
+
const states = toProviderPullRequestStates(options?.state);
|
|
754
|
+
const maxPagesPerProject = 20;
|
|
755
|
+
|
|
756
|
+
// Drain each project fully (numbered pages) for both the authored and assigned reads. Azure has no
|
|
757
|
+
// single cross-project cursor, so the aggregate is one page; `truncated` is set only if a project hit
|
|
758
|
+
// the backstop with more pages remaining.
|
|
759
|
+
let truncated = projects.metadata != null && projects.metadata.completeness !== 'complete';
|
|
760
|
+
// Drain one project's numbered pages, returning its PRs and any per-page failure. Returns per-project
|
|
761
|
+
// (not mutating shared state) so the fan-out below can be settled independently: one project's read
|
|
762
|
+
// failure must not discard every other project's already-drained PRs.
|
|
763
|
+
const drainProject = async (
|
|
764
|
+
project: { namespace: string; project: string },
|
|
765
|
+
scope: CollectionScope,
|
|
766
|
+
filter: { authorLogin?: string; assigneeLogins?: string[]; reviewerId?: string },
|
|
767
|
+
): Promise<{ prs: ProviderPullRequest[]; projectIdentity: string; failure?: CollectionScopeFailure }> => {
|
|
768
|
+
const collected: ProviderPullRequest[] = [];
|
|
769
|
+
const projectIdentity = `${project.namespace}/${project.project}`;
|
|
770
|
+
let page: number | undefined;
|
|
771
|
+
for (let i = 0; i < maxPagesPerProject; i++) {
|
|
772
|
+
try {
|
|
773
|
+
const result = await api.getPullRequestsForAzureProject(tokenWithInfo, project, {
|
|
774
|
+
...apiOptions,
|
|
775
|
+
...filter,
|
|
776
|
+
states: states,
|
|
777
|
+
page: page,
|
|
778
|
+
});
|
|
779
|
+
if (result == null) {
|
|
780
|
+
if (page == null) break;
|
|
781
|
+
|
|
782
|
+
truncated = true;
|
|
783
|
+
return {
|
|
784
|
+
prs: collected,
|
|
785
|
+
projectIdentity: projectIdentity,
|
|
786
|
+
failure: toCollectionScopeFailure(
|
|
787
|
+
scope,
|
|
788
|
+
new Error('Azure DevOps returned no page after advertising a continuation'),
|
|
789
|
+
),
|
|
790
|
+
};
|
|
791
|
+
}
|
|
792
|
+
|
|
793
|
+
collected.push(...result.data);
|
|
794
|
+
if (!result.hasMore) break;
|
|
795
|
+
if (result.nextPage == null || result.nextPage === page) {
|
|
796
|
+
truncated = true;
|
|
797
|
+
return {
|
|
798
|
+
prs: collected,
|
|
799
|
+
projectIdentity: projectIdentity,
|
|
800
|
+
failure: toCollectionScopeFailure(
|
|
801
|
+
scope,
|
|
802
|
+
new Error('Azure DevOps returned no advancing pull request continuation'),
|
|
803
|
+
),
|
|
804
|
+
};
|
|
805
|
+
}
|
|
806
|
+
|
|
807
|
+
page = result.nextPage;
|
|
808
|
+
if (i === maxPagesPerProject - 1) {
|
|
809
|
+
truncated = true;
|
|
810
|
+
}
|
|
811
|
+
} catch (ex) {
|
|
812
|
+
// A page failure after the first page leaves the already-drained prefix intact; record the
|
|
813
|
+
// failure at the project scope instead of re-throwing and discarding the prefix.
|
|
814
|
+
truncated = true;
|
|
815
|
+
return {
|
|
816
|
+
prs: collected,
|
|
817
|
+
projectIdentity: projectIdentity,
|
|
818
|
+
failure: toCollectionScopeFailure(scope, ex),
|
|
819
|
+
};
|
|
820
|
+
}
|
|
821
|
+
}
|
|
822
|
+
return { prs: collected, projectIdentity: projectIdentity };
|
|
823
|
+
};
|
|
824
|
+
|
|
825
|
+
// Settle per-project failures instead of rejecting the whole sweep. `drainProject` already catches its own
|
|
826
|
+
// page-level failures, so the structured failure (attributed to that project) is preserved rather than
|
|
827
|
+
// re-thrown — re-throwing an auth/rate-limit rejection would discard every other project's already-drained
|
|
828
|
+
// PRs. Auth/rate-limit stay actionable through the failure's kind (the facade maps it to an `auth`/`rate-limit`
|
|
829
|
+
// warning + `fetchFailed`), matching the SDK's model. `failures` was declared above so project-discovery
|
|
830
|
+
// failures and per-project drain failures share it.
|
|
831
|
+
const requested = options?.filters?.length ? new Set(options.filters) : undefined;
|
|
832
|
+
const wantAuthored = requested == null || requested.has(PullRequestFilter.Author);
|
|
833
|
+
// Azure has no assignee concept distinct from reviewer. Both neutral relationships map to reviewerId.
|
|
834
|
+
const wantReviewed =
|
|
835
|
+
requested == null ||
|
|
836
|
+
requested.has(PullRequestFilter.Assignee) ||
|
|
837
|
+
requested.has(PullRequestFilter.ReviewRequested);
|
|
838
|
+
const outcomes = await Promise.all(
|
|
839
|
+
projects.values.flatMap(p => {
|
|
840
|
+
const project = { namespace: p.resourceName, project: p.name };
|
|
841
|
+
const scope = { providerId: this.id, resourceId: p.resourceId, projectId: p.name };
|
|
842
|
+
const drains = [];
|
|
843
|
+
if (wantAuthored) {
|
|
844
|
+
drains.push(drainProject(project, scope, { authorLogin: user.id }));
|
|
845
|
+
}
|
|
846
|
+
if (wantReviewed) {
|
|
847
|
+
drains.push(drainProject(project, scope, { reviewerId: user.id }));
|
|
848
|
+
}
|
|
849
|
+
return drains;
|
|
850
|
+
}),
|
|
851
|
+
);
|
|
852
|
+
|
|
853
|
+
// Azure's `pullRequestId` is not account-global. Prefer repository + PR id, then the org-qualified URL.
|
|
854
|
+
// If neither is available, preserve the row instead of collapsing unrelated repositories by numeric id.
|
|
855
|
+
const prsByIdentity = new Map<string, ProviderPullRequest>();
|
|
856
|
+
for (const outcome of outcomes) {
|
|
857
|
+
if (outcome.failure != null) {
|
|
858
|
+
failures.push(outcome.failure);
|
|
859
|
+
}
|
|
860
|
+
for (const pr of outcome.prs) {
|
|
861
|
+
const key =
|
|
862
|
+
getProviderPullRequestIdentity(pr) ?? `project:${outcome.projectIdentity}:pull-request:${pr.id}`;
|
|
863
|
+
if (!prsByIdentity.has(key)) {
|
|
864
|
+
prsByIdentity.set(key, pr);
|
|
865
|
+
}
|
|
866
|
+
}
|
|
867
|
+
}
|
|
868
|
+
|
|
869
|
+
const metadata: CollectionMetadata | undefined = mergeCollectionMetadata(
|
|
870
|
+
failures.length > 0 ? { completeness: 'partial', failures: failures } : undefined,
|
|
871
|
+
projects.metadata,
|
|
872
|
+
);
|
|
873
|
+
|
|
874
|
+
return {
|
|
875
|
+
values: [...prsByIdentity.values()],
|
|
876
|
+
paging: { cursor: '{}', more: false, truncated: truncated || undefined },
|
|
877
|
+
metadata: metadata,
|
|
878
|
+
};
|
|
879
|
+
}
|
|
880
|
+
|
|
881
|
+
protected override async searchProviderPullRequests(
|
|
882
|
+
session: ProviderAuthenticationSession,
|
|
883
|
+
searchQuery: string,
|
|
884
|
+
repos?: AzureRepositoryDescriptor[],
|
|
885
|
+
cancellation?: AbortSignal,
|
|
886
|
+
options?: { include?: PullRequestState[] },
|
|
887
|
+
): Promise<PullRequest[] | undefined> {
|
|
888
|
+
if (cancellation?.aborted) throw new CancellationError();
|
|
438
889
|
|
|
439
890
|
const orgs = await this.getProviderResourcesForUser(session);
|
|
891
|
+
if (cancellation?.aborted) throw new CancellationError();
|
|
440
892
|
if (orgs == null || orgs.length === 0) return undefined;
|
|
441
893
|
|
|
442
|
-
|
|
443
|
-
|
|
894
|
+
// `getProviderProjectsForResources` returns a collection result ({ values, metadata }); this search
|
|
895
|
+
// path only needs the resolved projects, so read `.values`.
|
|
896
|
+
const projects = (await this.getProviderProjectsForResources(session, orgs)).values;
|
|
897
|
+
if (cancellation?.aborted) throw new CancellationError();
|
|
898
|
+
if (projects.length === 0) return undefined;
|
|
899
|
+
|
|
900
|
+
const repoDescriptorsByProject = await this.getRepoDescriptorsForProjects(session, projects);
|
|
901
|
+
if (cancellation?.aborted) throw new CancellationError();
|
|
902
|
+
|
|
903
|
+
const repoDescriptors = [...repoDescriptorsByProject.values()].filter(r => r != null).flat();
|
|
904
|
+
const requestedRepos = repos?.map(getAzureRepositoryIdentity);
|
|
905
|
+
const repoInputs =
|
|
906
|
+
requestedRepos == null
|
|
907
|
+
? undefined
|
|
908
|
+
: repoDescriptors.filter(r =>
|
|
909
|
+
requestedRepos.some(
|
|
910
|
+
repo =>
|
|
911
|
+
repo.resourceName === r.resourceName &&
|
|
912
|
+
repo.repositoryName === r.name &&
|
|
913
|
+
(repo.projectName == null || repo.projectName === r.projectName),
|
|
914
|
+
),
|
|
915
|
+
);
|
|
916
|
+
if (repoInputs?.length === 0) return [];
|
|
444
917
|
|
|
445
|
-
const
|
|
446
|
-
const
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
918
|
+
const api = await this.getProvidersApi();
|
|
919
|
+
const { tokenWithInfo, options: apiOptions } = this.getApiOptions(session);
|
|
920
|
+
const states = toProviderPullRequestStates(options?.include);
|
|
921
|
+
const searchScopes: { project: { namespace: string; project: string }; repo?: ProviderRepoInput }[] =
|
|
922
|
+
repoInputs != null
|
|
923
|
+
? repoInputs.flatMap(repo =>
|
|
924
|
+
repo.projectName == null
|
|
925
|
+
? []
|
|
926
|
+
: [
|
|
927
|
+
{
|
|
928
|
+
project: { namespace: repo.resourceName, project: repo.projectName },
|
|
929
|
+
repo: {
|
|
930
|
+
id: repo.id,
|
|
931
|
+
name: repo.name,
|
|
932
|
+
namespace: repo.resourceName,
|
|
933
|
+
project: repo.projectName,
|
|
934
|
+
},
|
|
935
|
+
},
|
|
936
|
+
],
|
|
937
|
+
)
|
|
938
|
+
: projects.map(project => ({
|
|
939
|
+
project: { namespace: project.resourceName, project: project.name },
|
|
940
|
+
}));
|
|
941
|
+
|
|
942
|
+
const providerPullRequests = await flatSettledOrThrow(
|
|
943
|
+
searchScopes.map(async scope => {
|
|
944
|
+
const values: ProviderPullRequest[] = [];
|
|
945
|
+
let page: number | undefined;
|
|
946
|
+
for (let i = 0; i < 20; i++) {
|
|
947
|
+
if (cancellation?.aborted) throw new CancellationError();
|
|
948
|
+
|
|
949
|
+
const result = await api.getPullRequestsForAzureProject(tokenWithInfo, scope.project, {
|
|
950
|
+
...apiOptions,
|
|
951
|
+
page: page,
|
|
952
|
+
repo: scope.repo,
|
|
953
|
+
states: states,
|
|
954
|
+
});
|
|
955
|
+
if (result == null) break;
|
|
956
|
+
|
|
957
|
+
values.push(...result.data);
|
|
958
|
+
if (!result.hasMore || result.nextPage == null) break;
|
|
959
|
+
|
|
960
|
+
page = result.nextPage;
|
|
961
|
+
}
|
|
962
|
+
return values;
|
|
455
963
|
}),
|
|
456
964
|
);
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
965
|
+
if (cancellation?.aborted) throw new CancellationError();
|
|
966
|
+
|
|
967
|
+
return [...new Map(providerPullRequests.map(pr => [pr.url ?? `${pr.repository.id}:${pr.id}`, pr])).values()]
|
|
968
|
+
.filter(pr => providerPullRequestMatchesSearch(pr, searchQuery))
|
|
969
|
+
.map(pr => this.fromAzureProviderPullRequest(pr, repoDescriptors, projects));
|
|
970
|
+
}
|
|
971
|
+
|
|
972
|
+
protected override async searchProviderMyIssues(
|
|
973
|
+
session: ProviderAuthenticationSession,
|
|
974
|
+
repos?: AzureRepositoryDescriptor[],
|
|
975
|
+
): Promise<IssueShape[] | undefined> {
|
|
976
|
+
return (await this.searchProviderMyIssuesWithTruncation(session, repos))?.values;
|
|
977
|
+
}
|
|
978
|
+
|
|
979
|
+
/**
|
|
980
|
+
* Account-wide "my issues" for Azure = the user's authored + assigned work items across every project of
|
|
981
|
+
* every org. Azure's issue read is numbered-page, so each (project × filter) read is drained to exhaustion
|
|
982
|
+
* (bounded by a defensive per-read backstop). Unlike a silent `flatSettled`, a project read that was
|
|
983
|
+
* truncated by the backstop or rejected outright is recorded as `truncated`, so the facade reports an
|
|
984
|
+
* incomplete read instead of publishing a partial list as complete.
|
|
985
|
+
*
|
|
986
|
+
* `searchOptions.org`/`.project` narrow the fan-out server-side (each drain is already a per-project read,
|
|
987
|
+
* so scoping just selects which projects to drain). Without this there was no way to ask for "work items in
|
|
988
|
+
* project P": a consumer had to filter the account-wide page client-side, which desynchronizes the filtered
|
|
989
|
+
* `items` from the `hasMore`/`currentPage` of the pre-filter read — a project-less page reads as "no issues"
|
|
990
|
+
* while `hasMore` is still true.
|
|
991
|
+
*/
|
|
992
|
+
protected override async searchProviderMyIssuesWithTruncation(
|
|
993
|
+
session: ProviderAuthenticationSession,
|
|
994
|
+
_resources?: ResourceDescriptor[],
|
|
995
|
+
_cancellation?: AbortSignal,
|
|
996
|
+
searchOptions?: SearchMyIssuesOptions,
|
|
997
|
+
): Promise<AccountWideIssuesResult | undefined> {
|
|
998
|
+
const api = await this.getProvidersApi();
|
|
999
|
+
|
|
1000
|
+
const user = await this.getProviderCurrentAccount(session);
|
|
1001
|
+
if (user?.username == null) return undefined;
|
|
1002
|
+
|
|
1003
|
+
const allOrgs = await this.getProviderResourcesForUser(session);
|
|
1004
|
+
if (allOrgs == null) return undefined;
|
|
1005
|
+
if (allOrgs.length === 0) return { values: [], truncated: false };
|
|
1006
|
+
|
|
1007
|
+
// Scope by org first so project discovery only fans out over the requested account. An org filter that
|
|
1008
|
+
// matches nothing is an empty-but-successful read, not an unsupported one: returning `undefined` here
|
|
1009
|
+
// would be reported as "account-wide issue search is not supported by this provider".
|
|
1010
|
+
const orgs =
|
|
1011
|
+
searchOptions?.org != null ? allOrgs.filter(o => azureResourceMatches(o, searchOptions.org!)) : allOrgs;
|
|
1012
|
+
if (orgs.length === 0) return { values: [], truncated: false };
|
|
1013
|
+
|
|
1014
|
+
// Structured per-scope failures from BOTH project discovery (a whole org dropped) and the per-project
|
|
1015
|
+
// issue drains, so the facade warns on the failed scope + sets `fetchFailed` instead of narrowing silently.
|
|
1016
|
+
const failures: CollectionScopeFailure[] = [];
|
|
1017
|
+
const discovered = await this.getProviderProjectsForResources(session, orgs, false, failures);
|
|
1018
|
+
const projects =
|
|
1019
|
+
searchOptions?.project != null
|
|
1020
|
+
? {
|
|
1021
|
+
...discovered,
|
|
1022
|
+
values: discovered.values.filter(p => azureResourceMatches(p, searchOptions.project!)),
|
|
1023
|
+
}
|
|
1024
|
+
: discovered;
|
|
1025
|
+
if (projects.values.length === 0) {
|
|
1026
|
+
// An explicitly-scoped read that found no matching project is an empty SUCCESS: `undefined` here is
|
|
1027
|
+
// reported as "account-wide issue search is not supported by this provider", which would send the
|
|
1028
|
+
// consumer down a repo-scoped fallback for what is simply an empty scope. Only an incomplete discovery
|
|
1029
|
+
// (which may itself have dropped the requested project) is truncated, and its metadata is forwarded so
|
|
1030
|
+
// the facade still warns on the failed scope.
|
|
1031
|
+
return projects.metadata != null
|
|
1032
|
+
? {
|
|
1033
|
+
values: [],
|
|
1034
|
+
truncated: projects.metadata.completeness !== 'complete',
|
|
1035
|
+
metadata: projects.metadata,
|
|
1036
|
+
}
|
|
1037
|
+
: { values: [], truncated: false };
|
|
1038
|
+
}
|
|
1039
|
+
|
|
1040
|
+
const { tokenWithInfo, options } = this.getApiOptions(session);
|
|
1041
|
+
|
|
1042
|
+
// Drain one (project × filter) read fully, threading the provider's paging cursor. The scope is passed so
|
|
1043
|
+
// a page-level failure preserves the already-drained prefix and records a structured failure instead of
|
|
1044
|
+
// re-throwing.
|
|
1045
|
+
const drain = async (
|
|
1046
|
+
p: AzureProjectDescriptor,
|
|
1047
|
+
filter: { assigneeLogins?: string[]; authorLogin?: string },
|
|
1048
|
+
): Promise<{
|
|
1049
|
+
issues: IssueShape[];
|
|
1050
|
+
projectKey: string;
|
|
1051
|
+
truncated: boolean;
|
|
1052
|
+
metadata?: CollectionMetadata;
|
|
1053
|
+
}> => {
|
|
1054
|
+
const result = await collectProviderPagedResult(
|
|
1055
|
+
cursor =>
|
|
1056
|
+
api.getIssuesForAzureProject(tokenWithInfo, p.resourceName, p.name, {
|
|
461
1057
|
...options,
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
1058
|
+
...filter,
|
|
1059
|
+
cursor: cursor,
|
|
1060
|
+
}),
|
|
1061
|
+
20,
|
|
1062
|
+
{ providerId: this.id, resourceId: p.resourceId, projectId: p.name },
|
|
1063
|
+
);
|
|
1064
|
+
return {
|
|
1065
|
+
issues: result.values.map(i => fromProviderIssue(i, this as any, { project: p })),
|
|
1066
|
+
// Azure work-item ids are organization-scoped. Include both org and project so the
|
|
1067
|
+
// assigned/authored passes dedupe the same item without collapsing another org's item.
|
|
1068
|
+
projectKey: `${p.resourceId}:${p.id}`,
|
|
1069
|
+
truncated: result.truncated ?? false,
|
|
1070
|
+
metadata: result.metadata,
|
|
1071
|
+
};
|
|
1072
|
+
};
|
|
1073
|
+
|
|
1074
|
+
// `includeAllAssignees` broadens to every issue in each project (any assignee, any author), so a single
|
|
1075
|
+
// unfiltered drain per project replaces the assigned+authored pair — an unfiltered assignee drain already
|
|
1076
|
+
// subsumes the authored one.
|
|
1077
|
+
//
|
|
1078
|
+
// `filters` narrows the other way: unfiltered, "my issues" here is assigned ∪ authored, which is wider than
|
|
1079
|
+
// `assignee:@me`. Selecting the drains is the only correct place to narrow — dropping authored-only items
|
|
1080
|
+
// from the returned page would leave them counted in the per-project paging that produced it.
|
|
1081
|
+
const filters = searchOptions?.filters;
|
|
1082
|
+
const wantAssigned = !filters?.length || filters.includes(IssueFilter.Assignee);
|
|
1083
|
+
const wantAuthored = !filters?.length || filters.includes(IssueFilter.Author);
|
|
1084
|
+
const outcomes = await Promise.all(
|
|
1085
|
+
projects.values.flatMap(p => {
|
|
1086
|
+
if (searchOptions?.includeAllAssignees) return [drain(p, {})];
|
|
1087
|
+
|
|
1088
|
+
const drains = [];
|
|
1089
|
+
if (wantAssigned) {
|
|
1090
|
+
drains.push(drain(p, { assigneeLogins: [user.username!] }));
|
|
1091
|
+
}
|
|
1092
|
+
if (wantAuthored) {
|
|
1093
|
+
drains.push(drain(p, { authorLogin: user.username! }));
|
|
1094
|
+
}
|
|
1095
|
+
return drains;
|
|
466
1096
|
}),
|
|
467
1097
|
);
|
|
468
|
-
// TODO: Add mentioned issues
|
|
469
|
-
const issuesById = new Map<string, IssueShape>();
|
|
470
1098
|
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
1099
|
+
const issuesById = new Map<string, IssueShape>();
|
|
1100
|
+
let truncated = projects.metadata != null && projects.metadata.completeness !== 'complete';
|
|
1101
|
+
let drainMetadata: CollectionMetadata | undefined;
|
|
1102
|
+
for (const outcome of outcomes) {
|
|
1103
|
+
if (outcome.truncated) {
|
|
1104
|
+
truncated = true;
|
|
1105
|
+
}
|
|
1106
|
+
if (outcome.metadata != null) {
|
|
1107
|
+
drainMetadata = mergeCollectionMetadata(drainMetadata, outcome.metadata);
|
|
1108
|
+
}
|
|
474
1109
|
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
1110
|
+
for (const issue of outcome.issues) {
|
|
1111
|
+
const key = `${outcome.projectKey}:${issue.nodeId ?? issue.id}`;
|
|
1112
|
+
if (!issuesById.has(key)) {
|
|
1113
|
+
issuesById.set(key, issue);
|
|
1114
|
+
}
|
|
479
1115
|
}
|
|
480
1116
|
}
|
|
481
1117
|
|
|
482
|
-
|
|
1118
|
+
const metadata: CollectionMetadata | undefined = mergeCollectionMetadata(
|
|
1119
|
+
failures.length > 0 ? { completeness: 'partial', failures: failures } : undefined,
|
|
1120
|
+
mergeCollectionMetadata(drainMetadata, projects.metadata),
|
|
1121
|
+
);
|
|
1122
|
+
|
|
1123
|
+
return { values: [...issuesById.values()], truncated: truncated, metadata: metadata };
|
|
483
1124
|
}
|
|
484
1125
|
|
|
485
1126
|
protected override async providerOnConnect(): Promise<void> {
|
|
486
1127
|
if (this._session == null) return;
|
|
487
1128
|
|
|
1129
|
+
const canHydrateStoredProjects = (metadata: CollectionMetadata | undefined): boolean =>
|
|
1130
|
+
metadata == null || metadata.completeness === 'complete';
|
|
1131
|
+
|
|
488
1132
|
const storedAccount = this.ctx.storage.get(`azure:${this._session.accessToken}:account`);
|
|
489
1133
|
const storedOrganizations = this.ctx.storage.get(`azure:${this._session.accessToken}:organizations`);
|
|
490
1134
|
const storedProjects = this.ctx.storage.get(`azure:${this._session.accessToken}:projects`);
|
|
@@ -492,7 +1136,20 @@ export abstract class AzureDevOpsIntegrationBase<
|
|
|
492
1136
|
|
|
493
1137
|
let organizations = storedOrganizations?.data?.map((o: AzureOrganizationDescriptor) => ({ ...o }));
|
|
494
1138
|
|
|
495
|
-
|
|
1139
|
+
const storedProjectsData = storedProjects?.data as
|
|
1140
|
+
| ProviderApiCollectionResult<AzureProjectDescriptor>
|
|
1141
|
+
| AzureProjectDescriptor[]
|
|
1142
|
+
| undefined;
|
|
1143
|
+
let projects: ProviderApiCollectionResult<AzureProjectDescriptor> | undefined;
|
|
1144
|
+
if (!Array.isArray(storedProjectsData) && Array.isArray(storedProjectsData?.values)) {
|
|
1145
|
+
const hydrated = {
|
|
1146
|
+
values: storedProjectsData.values.map((p: AzureProjectDescriptor) => ({ ...p })),
|
|
1147
|
+
...(storedProjectsData.metadata != null ? { metadata: storedProjectsData.metadata } : {}),
|
|
1148
|
+
};
|
|
1149
|
+
if (canHydrateStoredProjects(hydrated.metadata)) {
|
|
1150
|
+
projects = hydrated;
|
|
1151
|
+
}
|
|
1152
|
+
}
|
|
496
1153
|
|
|
497
1154
|
if (storedAccount == null) {
|
|
498
1155
|
account = await this.getProviderCurrentAccount(this._session);
|
|
@@ -528,23 +1185,29 @@ export abstract class AzureDevOpsIntegrationBase<
|
|
|
528
1185
|
this._organizations ??= new Map<string, AzureOrganizationDescriptor[] | undefined>();
|
|
529
1186
|
this._organizations.set(this._session.accessToken, organizations);
|
|
530
1187
|
|
|
531
|
-
if (
|
|
1188
|
+
if (projects == null && organizations?.length) {
|
|
532
1189
|
projects = await this.getProviderProjectsForResources(this._session, organizations);
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
1190
|
+
if (projects != null && canHydrateStoredProjects(projects.metadata)) {
|
|
1191
|
+
await this.ctx.storage.store(`azure:${this._session.accessToken}:projects`, {
|
|
1192
|
+
v: 2,
|
|
1193
|
+
timestamp: Date.now(),
|
|
1194
|
+
data: projects,
|
|
1195
|
+
});
|
|
1196
|
+
} else {
|
|
1197
|
+
await this.ctx.storage.delete(`azure:${this._session.accessToken}:projects`);
|
|
1198
|
+
}
|
|
538
1199
|
}
|
|
539
1200
|
|
|
540
1201
|
this._projects ??= new Map<string, AzureProjectDescriptor[] | undefined>();
|
|
541
|
-
|
|
542
|
-
const
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
projects.
|
|
1202
|
+
if (projects != null && canHydrateStoredProjects(projects.metadata)) {
|
|
1203
|
+
for (const project of projects.values) {
|
|
1204
|
+
const projectKey = `${this._session.accessToken}:${project.resourceId}`;
|
|
1205
|
+
const projects = this._projects.get(projectKey);
|
|
1206
|
+
if (projects == null) {
|
|
1207
|
+
this._projects.set(projectKey, [project]);
|
|
1208
|
+
} else if (!projects.some(p => p.id === project.id)) {
|
|
1209
|
+
projects.push(project);
|
|
1210
|
+
}
|
|
548
1211
|
}
|
|
549
1212
|
}
|
|
550
1213
|
}
|
|
@@ -560,10 +1223,10 @@ export abstract class AzureDevOpsIntegrationBase<
|
|
|
560
1223
|
repoDescriptors: AzureRemoteRepositoryDescriptor[],
|
|
561
1224
|
projectDescriptors: AzureProjectDescriptor[],
|
|
562
1225
|
): PullRequest {
|
|
563
|
-
const baseRepoDescriptor = repoDescriptors.find(r => r.
|
|
1226
|
+
const baseRepoDescriptor = repoDescriptors.find(r => r.id === azurePullRequest.repository.id);
|
|
564
1227
|
const headRepoDescriptor =
|
|
565
1228
|
azurePullRequest.headRepository != null
|
|
566
|
-
? repoDescriptors.find(r => r.
|
|
1229
|
+
? repoDescriptors.find(r => r.id === azurePullRequest.headRepository!.id)
|
|
567
1230
|
: undefined;
|
|
568
1231
|
let project: AzureProjectDescriptor | undefined;
|
|
569
1232
|
if (baseRepoDescriptor != null) {
|
|
@@ -591,7 +1254,9 @@ export abstract class AzureDevOpsIntegrationBase<
|
|
|
591
1254
|
}
|
|
592
1255
|
|
|
593
1256
|
if (baseRepoDescriptor?.projectName != null) {
|
|
594
|
-
project = projectDescriptors.find(
|
|
1257
|
+
project = projectDescriptors.find(
|
|
1258
|
+
p => p.resourceName === baseRepoDescriptor.resourceName && p.name === baseRepoDescriptor.projectName,
|
|
1259
|
+
);
|
|
595
1260
|
}
|
|
596
1261
|
return fromProviderPullRequest(azurePullRequest, this, { project: project });
|
|
597
1262
|
}
|