@gitkraken/core-gitlens 0.3.1 → 0.4.100
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +83 -1
- package/README.md +22 -12
- package/dist/git/cache.d.ts +29 -2
- package/dist/git/cache.d.ts.map +1 -1
- package/dist/git/cache.js +67 -7
- package/dist/git/cache.js.map +1 -1
- package/dist/git/context.d.ts +4 -3
- package/dist/git/context.d.ts.map +1 -1
- package/dist/git/context.js.map +1 -1
- package/dist/git/errors.d.ts +31 -1
- package/dist/git/errors.d.ts.map +1 -1
- package/dist/git/errors.js +29 -0
- package/dist/git/errors.js.map +1 -1
- package/dist/git/models/author.d.ts.map +1 -1
- package/dist/git/models/author.js.map +1 -1
- package/dist/git/models/autolink.d.ts.map +1 -1
- package/dist/git/models/autolink.js.map +1 -1
- package/dist/git/models/blame.d.ts.map +1 -1
- package/dist/git/models/blame.js.map +1 -1
- package/dist/git/models/branch.d.ts.map +1 -1
- package/dist/git/models/branch.js.map +1 -1
- package/dist/git/models/commit.d.ts.map +1 -1
- package/dist/git/models/commit.js +1 -1
- package/dist/git/models/commit.js.map +1 -1
- package/dist/git/models/contributor.d.ts.map +1 -1
- package/dist/git/models/contributor.js.map +1 -1
- package/dist/git/models/defaultBranch.d.ts.map +1 -1
- package/dist/git/models/defaultBranch.js.map +1 -1
- package/dist/git/models/diff.d.ts.map +1 -1
- package/dist/git/models/diff.js.map +1 -1
- package/dist/git/models/file.d.ts.map +1 -1
- package/dist/git/models/file.js.map +1 -1
- package/dist/git/models/fileChange.d.ts.map +1 -1
- package/dist/git/models/fileChange.js.map +1 -1
- package/dist/git/models/fileStatus.d.ts +22 -22
- package/dist/git/models/fileStatus.d.ts.map +1 -1
- package/dist/git/models/fileStatus.js.map +1 -1
- package/dist/git/models/graph.d.ts +122 -1
- package/dist/git/models/graph.d.ts.map +1 -1
- package/dist/git/models/graph.js +4 -0
- package/dist/git/models/graph.js.map +1 -1
- package/dist/git/models/graphSearch.d.ts.map +1 -1
- package/dist/git/models/graphSearch.js.map +1 -1
- package/dist/git/models/graphSession.d.ts +177 -0
- package/dist/git/models/graphSession.d.ts.map +1 -0
- package/dist/git/models/graphSession.js +7 -0
- package/dist/git/models/graphSession.js.map +1 -0
- package/dist/git/models/issue.d.ts +12 -2
- package/dist/git/models/issue.d.ts.map +1 -1
- package/dist/git/models/issue.js +3 -1
- package/dist/git/models/issue.js.map +1 -1
- package/dist/git/models/issueOrPullRequest.d.ts.map +1 -1
- package/dist/git/models/issueOrPullRequest.js.map +1 -1
- package/dist/git/models/lineRange.d.ts.map +1 -1
- package/dist/git/models/lineRange.js.map +1 -1
- package/dist/git/models/log.d.ts.map +1 -1
- package/dist/git/models/log.js.map +1 -1
- package/dist/git/models/mergeConflicts.d.ts.map +1 -1
- package/dist/git/models/mergeConflicts.js.map +1 -1
- package/dist/git/models/patch.d.ts.map +1 -1
- package/dist/git/models/patch.js.map +1 -1
- package/dist/git/models/pausedOperationStatus.d.ts.map +1 -1
- package/dist/git/models/pausedOperationStatus.js.map +1 -1
- package/dist/git/models/pullRequest.d.ts +27 -2
- package/dist/git/models/pullRequest.d.ts.map +1 -1
- package/dist/git/models/pullRequest.js +7 -1
- package/dist/git/models/pullRequest.js.map +1 -1
- package/dist/git/models/rebase.d.ts.map +1 -1
- package/dist/git/models/rebase.js.map +1 -1
- package/dist/git/models/reference.d.ts.map +1 -1
- package/dist/git/models/reference.js.map +1 -1
- package/dist/git/models/reflog.d.ts.map +1 -1
- package/dist/git/models/reflog.js.map +1 -1
- package/dist/git/models/remote.d.ts.map +1 -1
- package/dist/git/models/remote.js.map +1 -1
- package/dist/git/models/remoteProvider.d.ts.map +1 -1
- package/dist/git/models/remoteProvider.js.map +1 -1
- package/dist/git/models/remoteResource.d.ts.map +1 -1
- package/dist/git/models/remoteResource.js.map +1 -1
- package/dist/git/models/repository.d.ts +20 -2
- package/dist/git/models/repository.d.ts.map +1 -1
- package/dist/git/models/repository.js +19 -0
- package/dist/git/models/repository.js.map +1 -1
- package/dist/git/models/repositoryChangeEvent.d.ts.map +1 -1
- package/dist/git/models/repositoryChangeEvent.js.map +1 -1
- package/dist/git/models/repositoryIdentities.d.ts.map +1 -1
- package/dist/git/models/repositoryIdentities.js.map +1 -1
- package/dist/git/models/repositoryMetadata.d.ts.map +1 -1
- package/dist/git/models/repositoryMetadata.js.map +1 -1
- package/dist/git/models/resourceDescriptor.d.ts +16 -0
- package/dist/git/models/resourceDescriptor.d.ts.map +1 -1
- package/dist/git/models/resourceDescriptor.js.map +1 -1
- package/dist/git/models/revision.d.ts.map +1 -1
- package/dist/git/models/revision.js.map +1 -1
- package/dist/git/models/search.d.ts.map +1 -1
- package/dist/git/models/search.js.map +1 -1
- package/dist/git/models/shortlog.d.ts.map +1 -1
- package/dist/git/models/shortlog.js.map +1 -1
- package/dist/git/models/signature.d.ts +14 -0
- package/dist/git/models/signature.d.ts.map +1 -1
- package/dist/git/models/signature.js.map +1 -1
- package/dist/git/models/staging.d.ts.map +1 -1
- package/dist/git/models/staging.js.map +1 -1
- package/dist/git/models/stash.d.ts.map +1 -1
- package/dist/git/models/stash.js.map +1 -1
- package/dist/git/models/status.d.ts.map +1 -1
- package/dist/git/models/status.js.map +1 -1
- package/dist/git/models/statusFile.d.ts.map +1 -1
- package/dist/git/models/statusFile.js.map +1 -1
- package/dist/git/models/tag.d.ts +11 -1
- package/dist/git/models/tag.d.ts.map +1 -1
- package/dist/git/models/tag.js +9 -2
- package/dist/git/models/tag.js.map +1 -1
- package/dist/git/models/tree.d.ts.map +1 -1
- package/dist/git/models/tree.js.map +1 -1
- package/dist/git/models/user.d.ts.map +1 -1
- package/dist/git/models/user.js.map +1 -1
- package/dist/git/models/worktree.d.ts.map +1 -1
- package/dist/git/models/worktree.js.map +1 -1
- package/dist/git/parsers/diffParser.d.ts.map +1 -1
- package/dist/git/parsers/diffParser.js +1 -1
- package/dist/git/parsers/diffParser.js.map +1 -1
- package/dist/git/parsers/rebaseTodoParser.d.ts.map +1 -1
- package/dist/git/parsers/rebaseTodoParser.js.map +1 -1
- package/dist/git/providers/blame.d.ts.map +1 -1
- package/dist/git/providers/blame.js.map +1 -1
- package/dist/git/providers/branches.d.ts +8 -1
- package/dist/git/providers/branches.d.ts.map +1 -1
- package/dist/git/providers/branches.js.map +1 -1
- package/dist/git/providers/commits.d.ts +6 -1
- package/dist/git/providers/commits.d.ts.map +1 -1
- package/dist/git/providers/commits.js.map +1 -1
- package/dist/git/providers/config.d.ts +6 -2
- package/dist/git/providers/config.d.ts.map +1 -1
- package/dist/git/providers/config.js.map +1 -1
- package/dist/git/providers/contributors.d.ts.map +1 -1
- package/dist/git/providers/contributors.js.map +1 -1
- package/dist/git/providers/diff.d.ts.map +1 -1
- package/dist/git/providers/diff.js.map +1 -1
- package/dist/git/providers/graph.d.ts +55 -1
- package/dist/git/providers/graph.d.ts.map +1 -1
- package/dist/git/providers/graph.js.map +1 -1
- package/dist/git/providers/operations.d.ts +1 -0
- package/dist/git/providers/operations.d.ts.map +1 -1
- package/dist/git/providers/operations.js.map +1 -1
- package/dist/git/providers/patch.d.ts.map +1 -1
- package/dist/git/providers/patch.js.map +1 -1
- package/dist/git/providers/pausedOperations.d.ts.map +1 -1
- package/dist/git/providers/pausedOperations.js.map +1 -1
- package/dist/git/providers/provider.d.ts.map +1 -1
- package/dist/git/providers/provider.js.map +1 -1
- package/dist/git/providers/refs.d.ts.map +1 -1
- package/dist/git/providers/refs.js.map +1 -1
- package/dist/git/providers/remotes.d.ts.map +1 -1
- package/dist/git/providers/remotes.js.map +1 -1
- package/dist/git/providers/revision.d.ts.map +1 -1
- package/dist/git/providers/revision.js.map +1 -1
- package/dist/git/providers/shared/remotes.d.ts.map +1 -1
- package/dist/git/providers/shared/remotes.js.map +1 -1
- package/dist/git/providers/staging.d.ts.map +1 -1
- package/dist/git/providers/staging.js.map +1 -1
- package/dist/git/providers/stash.d.ts.map +1 -1
- package/dist/git/providers/stash.js.map +1 -1
- package/dist/git/providers/status.d.ts +1 -0
- package/dist/git/providers/status.d.ts.map +1 -1
- package/dist/git/providers/status.js.map +1 -1
- package/dist/git/providers/tags.d.ts.map +1 -1
- package/dist/git/providers/tags.js.map +1 -1
- package/dist/git/providers/types.d.ts.map +1 -1
- package/dist/git/providers/types.js.map +1 -1
- package/dist/git/providers/worktrees.d.ts +5 -1
- package/dist/git/providers/worktrees.d.ts.map +1 -1
- package/dist/git/providers/worktrees.js.map +1 -1
- package/dist/git/remotes/azure-devops.d.ts.map +1 -1
- package/dist/git/remotes/azure-devops.js +27 -31
- package/dist/git/remotes/azure-devops.js.map +1 -1
- package/dist/git/remotes/bitbucket-server.d.ts.map +1 -1
- package/dist/git/remotes/bitbucket-server.js +21 -23
- package/dist/git/remotes/bitbucket-server.js.map +1 -1
- package/dist/git/remotes/bitbucket.d.ts.map +1 -1
- package/dist/git/remotes/bitbucket.js +21 -23
- package/dist/git/remotes/bitbucket.js.map +1 -1
- package/dist/git/remotes/custom.d.ts.map +1 -1
- package/dist/git/remotes/custom.js.map +1 -1
- package/dist/git/remotes/gerrit.d.ts.map +1 -1
- package/dist/git/remotes/gerrit.js +11 -13
- package/dist/git/remotes/gerrit.js.map +1 -1
- package/dist/git/remotes/gitea.d.ts.map +1 -1
- package/dist/git/remotes/gitea.js +12 -14
- package/dist/git/remotes/gitea.js.map +1 -1
- package/dist/git/remotes/github.d.ts.map +1 -1
- package/dist/git/remotes/github.js +54 -56
- package/dist/git/remotes/github.js.map +1 -1
- package/dist/git/remotes/gitlab.d.ts.map +1 -1
- package/dist/git/remotes/gitlab.js +93 -95
- package/dist/git/remotes/gitlab.js.map +1 -1
- package/dist/git/remotes/google-source.d.ts.map +1 -1
- package/dist/git/remotes/google-source.js.map +1 -1
- package/dist/git/remotes/matcher.d.ts.map +1 -1
- package/dist/git/remotes/matcher.js.map +1 -1
- package/dist/git/run.types.d.ts +62 -3
- package/dist/git/run.types.d.ts.map +1 -1
- package/dist/git/service.d.ts.map +1 -1
- package/dist/git/utils/autolink.utils.d.ts.map +1 -1
- package/dist/git/utils/autolink.utils.js.map +1 -1
- package/dist/git/utils/blame.utils.d.ts.map +1 -1
- package/dist/git/utils/blame.utils.js.map +1 -1
- package/dist/git/utils/branch.utils.d.ts.map +1 -1
- package/dist/git/utils/branch.utils.js +12 -1
- package/dist/git/utils/branch.utils.js.map +1 -1
- package/dist/git/utils/commit.utils.d.ts.map +1 -1
- package/dist/git/utils/commit.utils.js.map +1 -1
- package/dist/git/utils/conflictResolution.utils.d.ts +32 -0
- package/dist/git/utils/conflictResolution.utils.d.ts.map +1 -1
- package/dist/git/utils/conflictResolution.utils.js +95 -0
- package/dist/git/utils/conflictResolution.utils.js.map +1 -1
- package/dist/git/utils/contributor.utils.d.ts +1 -1
- package/dist/git/utils/contributor.utils.d.ts.map +1 -1
- package/dist/git/utils/contributor.utils.js +1 -2
- package/dist/git/utils/contributor.utils.js.map +1 -1
- package/dist/git/utils/fetch.utils.d.ts.map +1 -1
- package/dist/git/utils/fetch.utils.js.map +1 -1
- package/dist/git/utils/fileStatus.utils.d.ts +7 -0
- package/dist/git/utils/fileStatus.utils.d.ts.map +1 -1
- package/dist/git/utils/fileStatus.utils.js +6 -0
- package/dist/git/utils/fileStatus.utils.js.map +1 -1
- package/dist/git/utils/graph.utils.d.ts +20 -0
- package/dist/git/utils/graph.utils.d.ts.map +1 -0
- package/dist/git/utils/graph.utils.js +40 -0
- package/dist/git/utils/graph.utils.js.map +1 -0
- package/dist/git/utils/issue.utils.d.ts.map +1 -1
- package/dist/git/utils/issue.utils.js +1 -0
- package/dist/git/utils/issue.utils.js.map +1 -1
- package/dist/git/utils/issueOrPullRequest.utils.d.ts.map +1 -1
- package/dist/git/utils/issueOrPullRequest.utils.js.map +1 -1
- package/dist/git/utils/mergeConflicts.utils.d.ts.map +1 -1
- package/dist/git/utils/mergeConflicts.utils.js.map +1 -1
- package/dist/git/utils/pausedOperationStatus.utils.d.ts +13 -13
- package/dist/git/utils/pausedOperationStatus.utils.d.ts.map +1 -1
- package/dist/git/utils/pausedOperationStatus.utils.js.map +1 -1
- package/dist/git/utils/pullRequest.utils.d.ts.map +1 -1
- package/dist/git/utils/pullRequest.utils.js +9 -0
- package/dist/git/utils/pullRequest.utils.js.map +1 -1
- package/dist/git/utils/reachability.utils.d.ts +20 -2
- package/dist/git/utils/reachability.utils.d.ts.map +1 -1
- package/dist/git/utils/reachability.utils.js +68 -7
- package/dist/git/utils/reachability.utils.js.map +1 -1
- package/dist/git/utils/rebase.utils.d.ts.map +1 -1
- package/dist/git/utils/rebase.utils.js.map +1 -1
- package/dist/git/utils/reference.utils.d.ts.map +1 -1
- package/dist/git/utils/reference.utils.js.map +1 -1
- package/dist/git/utils/remote.utils.d.ts.map +1 -1
- package/dist/git/utils/remote.utils.js.map +1 -1
- package/dist/git/utils/repository.utils.d.ts.map +1 -1
- package/dist/git/utils/repository.utils.js.map +1 -1
- package/dist/git/utils/resourceDescriptor.utils.d.ts.map +1 -1
- package/dist/git/utils/resourceDescriptor.utils.js.map +1 -1
- package/dist/git/utils/revision.utils.d.ts.map +1 -1
- package/dist/git/utils/revision.utils.js.map +1 -1
- package/dist/git/utils/search.utils.d.ts.map +1 -1
- package/dist/git/utils/search.utils.js.map +1 -1
- package/dist/git/utils/sorting.d.ts.map +1 -1
- package/dist/git/utils/sorting.js.map +1 -1
- package/dist/git/utils/sshKey.utils.d.ts +7 -0
- package/dist/git/utils/sshKey.utils.d.ts.map +1 -0
- package/dist/git/utils/sshKey.utils.js +25 -0
- package/dist/git/utils/sshKey.utils.js.map +1 -0
- package/dist/git/utils/status.utils.d.ts.map +1 -1
- package/dist/git/utils/status.utils.js.map +1 -1
- package/dist/git/utils/statusFile.utils.d.ts.map +1 -1
- package/dist/git/utils/statusFile.utils.js.map +1 -1
- package/dist/git/utils/tag.utils.d.ts.map +1 -1
- package/dist/git/utils/tag.utils.js.map +1 -1
- package/dist/git/utils/tooltip.utils.d.ts.map +1 -1
- package/dist/git/utils/tooltip.utils.js.map +1 -1
- package/dist/git/utils/uriAuthority.d.ts.map +1 -1
- package/dist/git/utils/uriAuthority.js.map +1 -1
- package/dist/git/utils/user.utils.d.ts.map +1 -1
- package/dist/git/utils/user.utils.js.map +1 -1
- package/dist/git/utils/worktree.utils.d.ts.map +1 -1
- package/dist/git/utils/worktree.utils.js.map +1 -1
- package/dist/git/watching/changeEvent.d.ts.map +1 -1
- package/dist/git/watching/changeEvent.js.map +1 -1
- package/dist/git/watching/classifyChange.d.ts.map +1 -1
- package/dist/git/watching/classifyChange.js.map +1 -1
- package/dist/git/watching/gitIgnoreFilter.d.ts.map +1 -1
- package/dist/git/watching/gitIgnoreFilter.js.map +1 -1
- package/dist/git/watching/initWatcher.d.ts.map +1 -1
- package/dist/git/watching/initWatcher.js.map +1 -1
- package/dist/git/watching/provider.d.ts.map +1 -1
- package/dist/git/watching/provider.js.map +1 -1
- package/dist/git/watching/watchGroup.d.ts.map +1 -1
- package/dist/git/watching/watchGroup.js.map +1 -1
- package/dist/git/watching/watchService.d.ts +4 -0
- package/dist/git/watching/watchService.d.ts.map +1 -1
- package/dist/git/watching/watchService.js +15 -1
- package/dist/git/watching/watchService.js.map +1 -1
- package/dist/git/watching/watchSession.d.ts +7 -0
- package/dist/git/watching/watchSession.d.ts.map +1 -1
- package/dist/git/watching/watchSession.js +14 -2
- package/dist/git/watching/watchSession.js.map +1 -1
- package/dist/git/watching/watcherPatterns.d.ts.map +1 -1
- package/dist/git/watching/watcherPatterns.js.map +1 -1
- package/dist/git-cli/cliGitProvider.d.ts.map +1 -1
- package/dist/git-cli/exec/exec.d.ts.map +1 -1
- package/dist/git-cli/exec/exec.errors.d.ts.map +1 -1
- package/dist/git-cli/exec/exec.errors.js.map +1 -1
- package/dist/git-cli/exec/exec.js.map +1 -1
- package/dist/git-cli/exec/exec.types.d.ts.map +1 -1
- package/dist/git-cli/exec/exec.types.js.map +1 -1
- package/dist/git-cli/exec/features.d.ts.map +1 -1
- package/dist/git-cli/exec/features.js.map +1 -1
- package/dist/git-cli/exec/git.d.ts +19 -27
- package/dist/git-cli/exec/git.d.ts.map +1 -1
- package/dist/git-cli/exec/git.js +126 -34
- package/dist/git-cli/exec/git.js.map +1 -1
- package/dist/git-cli/exec/gitQueue.d.ts.map +1 -1
- package/dist/git-cli/exec/gitQueue.js.map +1 -1
- package/dist/git-cli/exec/locator.d.ts.map +1 -1
- package/dist/git-cli/exec/locator.js.map +1 -1
- package/dist/git-cli/parsers/blameParser.d.ts.map +1 -1
- package/dist/git-cli/parsers/blameParser.js.map +1 -1
- package/dist/git-cli/parsers/indexParser.d.ts.map +1 -1
- package/dist/git-cli/parsers/indexParser.js.map +1 -1
- package/dist/git-cli/parsers/logParser.d.ts +9 -1
- package/dist/git-cli/parsers/logParser.d.ts.map +1 -1
- package/dist/git-cli/parsers/logParser.js +141 -60
- package/dist/git-cli/parsers/logParser.js.map +1 -1
- package/dist/git-cli/parsers/mergeTreeParser.d.ts.map +1 -1
- package/dist/git-cli/parsers/mergeTreeParser.js.map +1 -1
- package/dist/git-cli/parsers/refParser.d.ts.map +1 -1
- package/dist/git-cli/parsers/refParser.js.map +1 -1
- package/dist/git-cli/parsers/reflogParser.d.ts.map +1 -1
- package/dist/git-cli/parsers/reflogParser.js.map +1 -1
- package/dist/git-cli/parsers/remoteParser.d.ts.map +1 -1
- package/dist/git-cli/parsers/remoteParser.js.map +1 -1
- package/dist/git-cli/parsers/shortlogParser.d.ts.map +1 -1
- package/dist/git-cli/parsers/shortlogParser.js.map +1 -1
- package/dist/git-cli/parsers/signatureParser.d.ts.map +1 -1
- package/dist/git-cli/parsers/signatureParser.js.map +1 -1
- package/dist/git-cli/parsers/sshSignatureParser.d.ts +21 -0
- package/dist/git-cli/parsers/sshSignatureParser.d.ts.map +1 -0
- package/dist/git-cli/parsers/sshSignatureParser.js +78 -0
- package/dist/git-cli/parsers/sshSignatureParser.js.map +1 -0
- package/dist/git-cli/parsers/statusParser.d.ts.map +1 -1
- package/dist/git-cli/parsers/statusParser.js.map +1 -1
- package/dist/git-cli/parsers/treeParser.d.ts.map +1 -1
- package/dist/git-cli/parsers/treeParser.js.map +1 -1
- package/dist/git-cli/parsers/worktreeParser.d.ts.map +1 -1
- package/dist/git-cli/parsers/worktreeParser.js +5 -7
- package/dist/git-cli/parsers/worktreeParser.js.map +1 -1
- package/dist/git-cli/providers/blame.d.ts.map +1 -1
- package/dist/git-cli/providers/blame.js.map +1 -1
- package/dist/git-cli/providers/branches.d.ts +1 -0
- package/dist/git-cli/providers/branches.d.ts.map +1 -1
- package/dist/git-cli/providers/branches.js +51 -32
- package/dist/git-cli/providers/branches.js.map +1 -1
- package/dist/git-cli/providers/commitFilesetUtils.d.ts.map +1 -1
- package/dist/git-cli/providers/commitFilesetUtils.js.map +1 -1
- package/dist/git-cli/providers/commits.d.ts +12 -1
- package/dist/git-cli/providers/commits.d.ts.map +1 -1
- package/dist/git-cli/providers/commits.js +89 -8
- package/dist/git-cli/providers/commits.js.map +1 -1
- package/dist/git-cli/providers/config.d.ts.map +1 -1
- package/dist/git-cli/providers/config.js.map +1 -1
- package/dist/git-cli/providers/contributors.d.ts.map +1 -1
- package/dist/git-cli/providers/contributors.js.map +1 -1
- package/dist/git-cli/providers/diff.d.ts.map +1 -1
- package/dist/git-cli/providers/diff.js.map +1 -1
- package/dist/git-cli/providers/graph.d.ts +35 -1
- package/dist/git-cli/providers/graph.d.ts.map +1 -1
- package/dist/git-cli/providers/graph.js +1434 -330
- package/dist/git-cli/providers/graph.js.map +1 -1
- package/dist/git-cli/providers/operations.d.ts +1 -0
- package/dist/git-cli/providers/operations.d.ts.map +1 -1
- package/dist/git-cli/providers/operations.js +22 -1
- package/dist/git-cli/providers/operations.js.map +1 -1
- package/dist/git-cli/providers/patch.d.ts.map +1 -1
- package/dist/git-cli/providers/patch.js.map +1 -1
- package/dist/git-cli/providers/pausedOperations.d.ts.map +1 -1
- package/dist/git-cli/providers/pausedOperations.js +3 -3
- package/dist/git-cli/providers/pausedOperations.js.map +1 -1
- package/dist/git-cli/providers/refs.d.ts.map +1 -1
- package/dist/git-cli/providers/refs.js.map +1 -1
- package/dist/git-cli/providers/remotes.d.ts.map +1 -1
- package/dist/git-cli/providers/remotes.js.map +1 -1
- package/dist/git-cli/providers/revision.d.ts +1 -0
- package/dist/git-cli/providers/revision.d.ts.map +1 -1
- package/dist/git-cli/providers/revision.js +33 -0
- package/dist/git-cli/providers/revision.js.map +1 -1
- package/dist/git-cli/providers/staging.d.ts.map +1 -1
- package/dist/git-cli/providers/staging.js.map +1 -1
- package/dist/git-cli/providers/stash.d.ts.map +1 -1
- package/dist/git-cli/providers/stash.js.map +1 -1
- package/dist/git-cli/providers/status.d.ts +28 -0
- package/dist/git-cli/providers/status.d.ts.map +1 -1
- package/dist/git-cli/providers/status.js +240 -154
- package/dist/git-cli/providers/status.js.map +1 -1
- package/dist/git-cli/providers/tags.d.ts.map +1 -1
- package/dist/git-cli/providers/tags.js +2 -1
- package/dist/git-cli/providers/tags.js.map +1 -1
- package/dist/git-cli/providers/worktrees.d.ts +4 -1
- package/dist/git-cli/providers/worktrees.d.ts.map +1 -1
- package/dist/git-cli/providers/worktrees.js +31 -3
- package/dist/git-cli/providers/worktrees.js.map +1 -1
- package/dist/git-cli/service.d.ts.map +1 -1
- package/dist/git-cli/service.js +8 -0
- package/dist/git-cli/service.js.map +1 -1
- package/dist/ipc/ipcServer.d.ts.map +1 -1
- package/dist/ipc/ipcServer.js +1 -1
- package/dist/ipc/ipcServer.js.map +1 -1
- package/dist/plus/agents/providers/claudeCodeProvider.d.ts +6 -1
- package/dist/plus/agents/providers/claudeCodeProvider.d.ts.map +1 -1
- package/dist/plus/agents/providers/claudeCodeProvider.js +19 -0
- package/dist/plus/agents/providers/claudeCodeProvider.js.map +1 -1
- package/dist/plus/agents/providers/claudeCodeTranscript.d.ts +68 -0
- package/dist/plus/agents/providers/claudeCodeTranscript.d.ts.map +1 -1
- package/dist/plus/agents/providers/claudeCodeTranscript.js +262 -8
- package/dist/plus/agents/providers/claudeCodeTranscript.js.map +1 -1
- package/dist/plus/agents/types.d.ts +36 -2
- package/dist/plus/agents/types.d.ts.map +1 -1
- package/dist/plus/ai/constants.d.ts +1 -2
- package/dist/plus/ai/constants.d.ts.map +1 -1
- package/dist/plus/ai/constants.js +1 -8
- package/dist/plus/ai/constants.js.map +1 -1
- package/dist/plus/ai/errors.d.ts.map +1 -1
- package/dist/plus/ai/errors.js.map +1 -1
- package/dist/plus/ai/models/conversation.d.ts.map +1 -1
- package/dist/plus/ai/models/conversation.js.map +1 -1
- package/dist/plus/ai/models/model.d.ts +2 -1
- package/dist/plus/ai/models/model.d.ts.map +1 -1
- package/dist/plus/ai/models/model.js +50 -1
- package/dist/plus/ai/models/model.js.map +1 -1
- package/dist/plus/ai/models/promptTemplates.d.ts +5 -2
- package/dist/plus/ai/models/promptTemplates.d.ts.map +1 -1
- package/dist/plus/ai/models/promptTemplates.js.map +1 -1
- package/dist/plus/ai/models/provider.d.ts.map +1 -1
- package/dist/plus/ai/models/provider.js.map +1 -1
- package/dist/plus/ai/models/results.d.ts.map +1 -1
- package/dist/plus/ai/models/results.js.map +1 -1
- package/dist/plus/ai/prompts.d.ts +1 -1
- package/dist/plus/ai/prompts.d.ts.map +1 -1
- package/dist/plus/ai/prompts.js +15 -47
- package/dist/plus/ai/prompts.js.map +1 -1
- package/dist/plus/ai/providers/anthropicProvider.d.ts +5 -0
- package/dist/plus/ai/providers/anthropicProvider.d.ts.map +1 -1
- package/dist/plus/ai/providers/anthropicProvider.js +40 -3
- package/dist/plus/ai/providers/anthropicProvider.js.map +1 -1
- package/dist/plus/ai/providers/azureProvider.d.ts.map +1 -1
- package/dist/plus/ai/providers/azureProvider.js.map +1 -1
- package/dist/plus/ai/providers/context.d.ts.map +1 -1
- package/dist/plus/ai/providers/context.js.map +1 -1
- package/dist/plus/ai/providers/deepSeekProvider.d.ts.map +1 -1
- package/dist/plus/ai/providers/deepSeekProvider.js +17 -1
- package/dist/plus/ai/providers/deepSeekProvider.js.map +1 -1
- package/dist/plus/ai/providers/geminiProvider.d.ts.map +1 -1
- package/dist/plus/ai/providers/geminiProvider.js +25 -6
- package/dist/plus/ai/providers/geminiProvider.js.map +1 -1
- package/dist/plus/ai/providers/gitkrakenProvider.d.ts.map +1 -1
- package/dist/plus/ai/providers/gitkrakenProvider.js +1 -0
- package/dist/plus/ai/providers/gitkrakenProvider.js.map +1 -1
- package/dist/plus/ai/providers/huggingFaceProvider.d.ts +1 -1
- package/dist/plus/ai/providers/huggingFaceProvider.d.ts.map +1 -1
- package/dist/plus/ai/providers/huggingFaceProvider.js +21 -18
- package/dist/plus/ai/providers/huggingFaceProvider.js.map +1 -1
- package/dist/plus/ai/providers/mistralProvider.d.ts.map +1 -1
- package/dist/plus/ai/providers/mistralProvider.js.map +1 -1
- package/dist/plus/ai/providers/ollamaProvider.d.ts.map +1 -1
- package/dist/plus/ai/providers/ollamaProvider.js.map +1 -1
- package/dist/plus/ai/providers/openAICompatibleProvider.d.ts.map +1 -1
- package/dist/plus/ai/providers/openAICompatibleProvider.js.map +1 -1
- package/dist/plus/ai/providers/openAICompatibleProviderBase.d.ts +10 -1
- package/dist/plus/ai/providers/openAICompatibleProviderBase.d.ts.map +1 -1
- package/dist/plus/ai/providers/openAICompatibleProviderBase.js +9 -1
- package/dist/plus/ai/providers/openAICompatibleProviderBase.js.map +1 -1
- package/dist/plus/ai/providers/openRouterProvider.d.ts.map +1 -1
- package/dist/plus/ai/providers/openRouterProvider.js.map +1 -1
- package/dist/plus/ai/providers/openaiProvider.d.ts.map +1 -1
- package/dist/plus/ai/providers/openaiProvider.js.map +1 -1
- package/dist/plus/ai/providers/xaiProvider.d.ts.map +1 -1
- package/dist/plus/ai/providers/xaiProvider.js +14 -1
- package/dist/plus/ai/providers/xaiProvider.js.map +1 -1
- package/dist/plus/ai/utils/ai.utils.d.ts.map +1 -1
- package/dist/plus/ai/utils/ai.utils.js +5 -7
- package/dist/plus/ai/utils/ai.utils.js.map +1 -1
- package/dist/plus/ai/utils/results.utils.d.ts +3 -0
- package/dist/plus/ai/utils/results.utils.d.ts.map +1 -1
- package/dist/plus/ai/utils/results.utils.js +26 -0
- package/dist/plus/ai/utils/results.utils.js.map +1 -1
- package/dist/plus/ai/utils/truncation.utils.d.ts +1 -1
- package/dist/plus/ai/utils/truncation.utils.d.ts.map +1 -1
- package/dist/plus/ai/utils/truncation.utils.js.map +1 -1
- package/dist/plus/git-github/api/config.d.ts.map +1 -1
- package/dist/plus/git-github/api/config.js.map +1 -1
- package/dist/plus/git-github/api/github.d.ts +71 -15
- package/dist/plus/git-github/api/github.d.ts.map +1 -1
- package/dist/plus/git-github/api/github.js +350 -84
- package/dist/plus/git-github/api/github.js.map +1 -1
- package/dist/plus/git-github/api/github.utils.d.ts.map +1 -1
- package/dist/plus/git-github/api/github.utils.js.map +1 -1
- package/dist/plus/git-github/api/token.d.ts.map +1 -1
- package/dist/plus/git-github/api/token.js.map +1 -1
- package/dist/plus/git-github/api/tokenUtils.d.ts.map +1 -1
- package/dist/plus/git-github/api/tokenUtils.js.map +1 -1
- package/dist/plus/git-github/api/types.d.ts.map +1 -1
- package/dist/plus/git-github/api/types.js.map +1 -1
- package/dist/plus/git-github/context.d.ts.map +1 -1
- package/dist/plus/git-github/models.d.ts +5 -0
- package/dist/plus/git-github/models.d.ts.map +1 -1
- package/dist/plus/git-github/models.js +27 -2
- package/dist/plus/git-github/models.js.map +1 -1
- package/dist/plus/git-github/providers/github/blame.d.ts.map +1 -1
- package/dist/plus/git-github/providers/github/blame.js.map +1 -1
- package/dist/plus/git-github/providers/github/branches.d.ts +2 -1
- package/dist/plus/git-github/providers/github/branches.d.ts.map +1 -1
- package/dist/plus/git-github/providers/github/branches.js +7 -3
- package/dist/plus/git-github/providers/github/branches.js.map +1 -1
- package/dist/plus/git-github/providers/github/commits.d.ts.map +1 -1
- package/dist/plus/git-github/providers/github/commits.js.map +1 -1
- package/dist/plus/git-github/providers/github/config.d.ts.map +1 -1
- package/dist/plus/git-github/providers/github/config.js.map +1 -1
- package/dist/plus/git-github/providers/github/contributors.d.ts.map +1 -1
- package/dist/plus/git-github/providers/github/contributors.js.map +1 -1
- package/dist/plus/git-github/providers/github/diff.d.ts.map +1 -1
- package/dist/plus/git-github/providers/github/diff.js +2 -2
- package/dist/plus/git-github/providers/github/diff.js.map +1 -1
- package/dist/plus/git-github/providers/github/graph.d.ts +12 -1
- package/dist/plus/git-github/providers/github/graph.d.ts.map +1 -1
- package/dist/plus/git-github/providers/github/graph.js +85 -0
- package/dist/plus/git-github/providers/github/graph.js.map +1 -1
- package/dist/plus/git-github/providers/github/refs.d.ts.map +1 -1
- package/dist/plus/git-github/providers/github/refs.js.map +1 -1
- package/dist/plus/git-github/providers/github/remotes.d.ts.map +1 -1
- package/dist/plus/git-github/providers/github/remotes.js.map +1 -1
- package/dist/plus/git-github/providers/github/revision.d.ts.map +1 -1
- package/dist/plus/git-github/providers/github/revision.js.map +1 -1
- package/dist/plus/git-github/providers/github/status.d.ts.map +1 -1
- package/dist/plus/git-github/providers/github/status.js.map +1 -1
- package/dist/plus/git-github/providers/github/tags.d.ts.map +1 -1
- package/dist/plus/git-github/providers/github/tags.js +3 -1
- package/dist/plus/git-github/providers/github/tags.js.map +1 -1
- package/dist/plus/git-github/providers/githubGitProvider.d.ts.map +1 -1
- package/dist/plus/git-github/providers/githubGitProvider.js.map +1 -1
- package/dist/plus/git-github/providers/githubProvider.d.ts.map +1 -1
- package/dist/plus/git-github/providers/githubProvider.js.map +1 -1
- package/dist/plus/integrations/authentication/cloudIntegrationService.d.ts +30 -0
- package/dist/plus/integrations/authentication/cloudIntegrationService.d.ts.map +1 -0
- package/dist/plus/integrations/authentication/cloudIntegrationService.js +214 -0
- package/dist/plus/integrations/authentication/cloudIntegrationService.js.map +1 -0
- package/dist/plus/integrations/authentication/configuredIntegrationService.d.ts +114 -0
- package/dist/plus/integrations/authentication/configuredIntegrationService.d.ts.map +1 -0
- package/dist/plus/integrations/authentication/configuredIntegrationService.js +497 -0
- package/dist/plus/integrations/authentication/configuredIntegrationService.js.map +1 -0
- package/dist/plus/integrations/authentication/integrationAuthenticationProvider.d.ts +112 -0
- package/dist/plus/integrations/authentication/integrationAuthenticationProvider.d.ts.map +1 -0
- package/dist/plus/integrations/authentication/integrationAuthenticationProvider.js +217 -0
- package/dist/plus/integrations/authentication/integrationAuthenticationProvider.js.map +1 -0
- package/dist/plus/integrations/authentication/integrationAuthenticationService.d.ts +62 -0
- package/dist/plus/integrations/authentication/integrationAuthenticationService.d.ts.map +1 -0
- package/dist/plus/integrations/authentication/integrationAuthenticationService.js +126 -0
- package/dist/plus/integrations/authentication/integrationAuthenticationService.js.map +1 -0
- package/dist/plus/integrations/authentication/manualTokenProvider.d.ts +16 -0
- package/dist/plus/integrations/authentication/manualTokenProvider.d.ts.map +1 -0
- package/dist/plus/integrations/authentication/manualTokenProvider.js +53 -0
- package/dist/plus/integrations/authentication/manualTokenProvider.js.map +1 -0
- package/dist/plus/integrations/authentication/models.d.ts +120 -0
- package/dist/plus/integrations/authentication/models.d.ts.map +1 -0
- package/dist/plus/integrations/authentication/models.js +64 -0
- package/dist/plus/integrations/authentication/models.js.map +1 -0
- package/dist/plus/integrations/collectionMetadata.d.ts +21 -0
- package/dist/plus/integrations/collectionMetadata.d.ts.map +1 -0
- package/dist/plus/integrations/collectionMetadata.js +121 -0
- package/dist/plus/integrations/collectionMetadata.js.map +1 -0
- package/dist/plus/integrations/constants.d.ts +57 -0
- package/dist/plus/integrations/constants.d.ts.map +1 -0
- package/dist/plus/integrations/constants.js +138 -0
- package/dist/plus/integrations/constants.js.map +1 -0
- package/dist/plus/integrations/context.d.ts +358 -0
- package/dist/plus/integrations/context.d.ts.map +1 -0
- package/dist/plus/integrations/context.js +2 -0
- package/dist/plus/integrations/context.js.map +1 -0
- package/dist/plus/integrations/errors.d.ts +79 -0
- package/dist/plus/integrations/errors.d.ts.map +1 -0
- package/dist/plus/integrations/errors.js +150 -0
- package/dist/plus/integrations/errors.js.map +1 -0
- package/dist/plus/integrations/index.d.ts +77 -0
- package/dist/plus/integrations/index.d.ts.map +1 -0
- package/dist/plus/integrations/index.js +64 -0
- package/dist/plus/integrations/index.js.map +1 -0
- package/dist/plus/integrations/integrationService.d.ts +379 -0
- package/dist/plus/integrations/integrationService.d.ts.map +1 -0
- package/dist/plus/integrations/integrationService.js +1895 -0
- package/dist/plus/integrations/integrationService.js.map +1 -0
- package/dist/plus/integrations/lite.d.ts +47 -0
- package/dist/plus/integrations/lite.d.ts.map +1 -0
- package/dist/plus/integrations/lite.js +141 -0
- package/dist/plus/integrations/lite.js.map +1 -0
- package/dist/plus/integrations/manager.d.ts +332 -0
- package/dist/plus/integrations/manager.d.ts.map +1 -0
- package/dist/plus/integrations/manager.js +2 -0
- package/dist/plus/integrations/manager.js.map +1 -0
- package/dist/plus/integrations/models/gitHostIntegration.d.ts +341 -0
- package/dist/plus/integrations/models/gitHostIntegration.d.ts.map +1 -0
- package/dist/plus/integrations/models/gitHostIntegration.js +1146 -0
- package/dist/plus/integrations/models/gitHostIntegration.js.map +1 -0
- package/dist/plus/integrations/models/integration.d.ts +212 -0
- package/dist/plus/integrations/models/integration.d.ts.map +1 -0
- package/dist/plus/integrations/models/integration.js +627 -0
- package/dist/plus/integrations/models/integration.js.map +1 -0
- package/dist/plus/integrations/models/issuesIntegration.d.ts +108 -0
- package/dist/plus/integrations/models/issuesIntegration.d.ts.map +1 -0
- package/dist/plus/integrations/models/issuesIntegration.js +216 -0
- package/dist/plus/integrations/models/issuesIntegration.js.map +1 -0
- package/dist/plus/integrations/providerFilters.d.ts +12 -0
- package/dist/plus/integrations/providerFilters.d.ts.map +1 -0
- package/dist/plus/integrations/providerFilters.js +14 -0
- package/dist/plus/integrations/providerFilters.js.map +1 -0
- package/dist/plus/integrations/providers/apiClients.d.ts +25 -0
- package/dist/plus/integrations/providers/apiClients.d.ts.map +1 -0
- package/dist/plus/integrations/providers/apiClients.js +39 -0
- package/dist/plus/integrations/providers/apiClients.js.map +1 -0
- package/dist/plus/integrations/providers/apiConfig.d.ts +52 -0
- package/dist/plus/integrations/providers/apiConfig.d.ts.map +1 -0
- package/dist/plus/integrations/providers/apiConfig.js +19 -0
- package/dist/plus/integrations/providers/apiConfig.js.map +1 -0
- package/dist/plus/integrations/providers/azure/azure.d.ts +59 -0
- package/dist/plus/integrations/providers/azure/azure.d.ts.map +1 -0
- package/dist/plus/integrations/providers/azure/azure.js +519 -0
- package/dist/plus/integrations/providers/azure/azure.js.map +1 -0
- package/dist/plus/integrations/providers/azure/models.d.ts +302 -0
- package/dist/plus/integrations/providers/azure/models.d.ts.map +1 -0
- package/dist/plus/integrations/providers/azure/models.js +203 -0
- package/dist/plus/integrations/providers/azure/models.js.map +1 -0
- package/dist/plus/integrations/providers/azureDevOps.d.ts +141 -0
- package/dist/plus/integrations/providers/azureDevOps.d.ts.map +1 -0
- package/dist/plus/integrations/providers/azureDevOps.js +925 -0
- package/dist/plus/integrations/providers/azureDevOps.js.map +1 -0
- package/dist/plus/integrations/providers/bitbucket/bitbucket.d.ts +53 -0
- package/dist/plus/integrations/providers/bitbucket/bitbucket.d.ts.map +1 -0
- package/dist/plus/integrations/providers/bitbucket/bitbucket.js +589 -0
- package/dist/plus/integrations/providers/bitbucket/bitbucket.js.map +1 -0
- package/dist/plus/integrations/providers/bitbucket/models.d.ts +222 -0
- package/dist/plus/integrations/providers/bitbucket/models.d.ts.map +1 -0
- package/dist/plus/integrations/providers/bitbucket/models.js +158 -0
- package/dist/plus/integrations/providers/bitbucket/models.js.map +1 -0
- package/dist/plus/integrations/providers/bitbucket-server/models.d.ts +138 -0
- package/dist/plus/integrations/providers/bitbucket-server/models.d.ts.map +1 -0
- package/dist/plus/integrations/providers/bitbucket-server/models.js +130 -0
- package/dist/plus/integrations/providers/bitbucket-server/models.js.map +1 -0
- package/dist/plus/integrations/providers/bitbucket-server.d.ts +84 -0
- package/dist/plus/integrations/providers/bitbucket-server.d.ts.map +1 -0
- package/dist/plus/integrations/providers/bitbucket-server.js +242 -0
- package/dist/plus/integrations/providers/bitbucket-server.js.map +1 -0
- package/dist/plus/integrations/providers/bitbucket.d.ts +84 -0
- package/dist/plus/integrations/providers/bitbucket.d.ts.map +1 -0
- package/dist/plus/integrations/providers/bitbucket.js +477 -0
- package/dist/plus/integrations/providers/bitbucket.js.map +1 -0
- package/dist/plus/integrations/providers/github/github.d.ts +5 -0
- package/dist/plus/integrations/providers/github/github.d.ts.map +1 -0
- package/dist/plus/integrations/providers/github/github.js +47 -0
- package/dist/plus/integrations/providers/github/github.js.map +1 -0
- package/dist/plus/integrations/providers/github/github.utils.d.ts +11 -0
- package/dist/plus/integrations/providers/github/github.utils.d.ts.map +1 -0
- package/dist/plus/integrations/providers/github/github.utils.js +6 -0
- package/dist/plus/integrations/providers/github/github.utils.js.map +1 -0
- package/dist/plus/integrations/providers/github/models.d.ts +3 -0
- package/dist/plus/integrations/providers/github/models.d.ts.map +1 -0
- package/dist/plus/integrations/providers/github/models.js +2 -0
- package/dist/plus/integrations/providers/github/models.js.map +1 -0
- package/dist/plus/integrations/providers/github.d.ts +116 -0
- package/dist/plus/integrations/providers/github.d.ts.map +1 -0
- package/dist/plus/integrations/providers/github.js +445 -0
- package/dist/plus/integrations/providers/github.js.map +1 -0
- package/dist/plus/integrations/providers/gitlab/gitlab.d.ts +71 -0
- package/dist/plus/integrations/providers/gitlab/gitlab.d.ts.map +1 -0
- package/dist/plus/integrations/providers/gitlab/gitlab.js +902 -0
- package/dist/plus/integrations/providers/gitlab/gitlab.js.map +1 -0
- package/dist/plus/integrations/providers/gitlab/gitlab.utils.d.ts +27 -0
- package/dist/plus/integrations/providers/gitlab/gitlab.utils.d.ts.map +1 -0
- package/dist/plus/integrations/providers/gitlab/gitlab.utils.js +53 -0
- package/dist/plus/integrations/providers/gitlab/gitlab.utils.js.map +1 -0
- package/dist/plus/integrations/providers/gitlab/models.d.ts +138 -0
- package/dist/plus/integrations/providers/gitlab/models.d.ts.map +1 -0
- package/dist/plus/integrations/providers/gitlab/models.js +99 -0
- package/dist/plus/integrations/providers/gitlab/models.js.map +1 -0
- package/dist/plus/integrations/providers/gitlab.d.ts +124 -0
- package/dist/plus/integrations/providers/gitlab.d.ts.map +1 -0
- package/dist/plus/integrations/providers/gitlab.js +519 -0
- package/dist/plus/integrations/providers/gitlab.js.map +1 -0
- package/dist/plus/integrations/providers/jira.d.ts +57 -0
- package/dist/plus/integrations/providers/jira.d.ts.map +1 -0
- package/dist/plus/integrations/providers/jira.js +425 -0
- package/dist/plus/integrations/providers/jira.js.map +1 -0
- package/dist/plus/integrations/providers/linear.d.ts +58 -0
- package/dist/plus/integrations/providers/linear.d.ts.map +1 -0
- package/dist/plus/integrations/providers/linear.js +304 -0
- package/dist/plus/integrations/providers/linear.js.map +1 -0
- package/dist/plus/integrations/providers/models.d.ts +712 -0
- package/dist/plus/integrations/providers/models.d.ts.map +1 -0
- package/dist/plus/integrations/providers/models.js +850 -0
- package/dist/plus/integrations/providers/models.js.map +1 -0
- package/dist/plus/integrations/providers/providersApi.d.ts +262 -0
- package/dist/plus/integrations/providers/providersApi.d.ts.map +1 -0
- package/dist/plus/integrations/providers/providersApi.js +1033 -0
- package/dist/plus/integrations/providers/providersApi.js.map +1 -0
- package/dist/plus/integrations/providers/trello.d.ts +47 -0
- package/dist/plus/integrations/providers/trello.d.ts.map +1 -0
- package/dist/plus/integrations/providers/trello.js +141 -0
- package/dist/plus/integrations/providers/trello.js.map +1 -0
- package/dist/plus/integrations/providers/utils/providerPaging.d.ts +29 -0
- package/dist/plus/integrations/providers/utils/providerPaging.d.ts.map +1 -0
- package/dist/plus/integrations/providers/utils/providerPaging.js +154 -0
- package/dist/plus/integrations/providers/utils/providerPaging.js.map +1 -0
- package/dist/plus/integrations/providers/utils.d.ts +75 -0
- package/dist/plus/integrations/providers/utils.d.ts.map +1 -0
- package/dist/plus/integrations/providers/utils.js +313 -0
- package/dist/plus/integrations/providers/utils.js.map +1 -0
- package/dist/plus/integrations/reads/context.d.ts +52 -0
- package/dist/plus/integrations/reads/context.d.ts.map +1 -0
- package/dist/plus/integrations/reads/context.js +2 -0
- package/dist/plus/integrations/reads/context.js.map +1 -0
- package/dist/plus/integrations/reads/cursors.d.ts +66 -0
- package/dist/plus/integrations/reads/cursors.d.ts.map +1 -0
- package/dist/plus/integrations/reads/cursors.js +133 -0
- package/dist/plus/integrations/reads/cursors.js.map +1 -0
- package/dist/plus/integrations/reads/drains.d.ts +60 -0
- package/dist/plus/integrations/reads/drains.d.ts.map +1 -0
- package/dist/plus/integrations/reads/drains.js +255 -0
- package/dist/plus/integrations/reads/drains.js.map +1 -0
- package/dist/plus/integrations/reads/filters.d.ts +81 -0
- package/dist/plus/integrations/reads/filters.d.ts.map +1 -0
- package/dist/plus/integrations/reads/filters.js +87 -0
- package/dist/plus/integrations/reads/filters.js.map +1 -0
- package/dist/plus/integrations/reads/hierarchy.d.ts +17 -0
- package/dist/plus/integrations/reads/hierarchy.d.ts.map +1 -0
- package/dist/plus/integrations/reads/hierarchy.js +348 -0
- package/dist/plus/integrations/reads/hierarchy.js.map +1 -0
- package/dist/plus/integrations/reads/hierarchy.utils.d.ts +53 -0
- package/dist/plus/integrations/reads/hierarchy.utils.d.ts.map +1 -0
- package/dist/plus/integrations/reads/hierarchy.utils.js +85 -0
- package/dist/plus/integrations/reads/hierarchy.utils.js.map +1 -0
- package/dist/plus/integrations/reads/issueTracker.d.ts +19 -0
- package/dist/plus/integrations/reads/issueTracker.d.ts.map +1 -0
- package/dist/plus/integrations/reads/issueTracker.js +346 -0
- package/dist/plus/integrations/reads/issueTracker.js.map +1 -0
- package/dist/plus/integrations/reads/issues.d.ts +34 -0
- package/dist/plus/integrations/reads/issues.d.ts.map +1 -0
- package/dist/plus/integrations/reads/issues.js +244 -0
- package/dist/plus/integrations/reads/issues.js.map +1 -0
- package/dist/plus/integrations/reads/paging.d.ts +136 -0
- package/dist/plus/integrations/reads/paging.d.ts.map +1 -0
- package/dist/plus/integrations/reads/paging.js +221 -0
- package/dist/plus/integrations/reads/paging.js.map +1 -0
- package/dist/plus/integrations/reads/pullRequests.d.ts +32 -0
- package/dist/plus/integrations/reads/pullRequests.d.ts.map +1 -0
- package/dist/plus/integrations/reads/pullRequests.js +151 -0
- package/dist/plus/integrations/reads/pullRequests.js.map +1 -0
- package/dist/plus/integrations/reads/warnings.d.ts +47 -0
- package/dist/plus/integrations/reads/warnings.d.ts.map +1 -0
- package/dist/plus/integrations/reads/warnings.js +81 -0
- package/dist/plus/integrations/reads/warnings.js.map +1 -0
- package/dist/plus/integrations/results.d.ts +189 -0
- package/dist/plus/integrations/results.d.ts.map +1 -0
- package/dist/plus/integrations/results.js +62 -0
- package/dist/plus/integrations/results.js.map +1 -0
- package/dist/plus/integrations/telemetry.d.ts +26 -0
- package/dist/plus/integrations/telemetry.d.ts.map +1 -0
- package/dist/plus/integrations/telemetry.js +11 -0
- package/dist/plus/integrations/telemetry.js.map +1 -0
- package/dist/plus/integrations/utils/domain.utils.d.ts +5 -0
- package/dist/plus/integrations/utils/domain.utils.d.ts.map +1 -0
- package/dist/plus/integrations/utils/domain.utils.js +27 -0
- package/dist/plus/integrations/utils/domain.utils.js.map +1 -0
- package/dist/plus/integrations/utils/integration.utils.d.ts +40 -0
- package/dist/plus/integrations/utils/integration.utils.d.ts.map +1 -0
- package/dist/plus/integrations/utils/integration.utils.js +182 -0
- package/dist/plus/integrations/utils/integration.utils.js.map +1 -0
- package/dist/utils/array.d.ts.map +1 -1
- package/dist/utils/array.js.map +1 -1
- package/dist/utils/brand.d.ts.map +1 -1
- package/dist/utils/cancellation.d.ts +13 -0
- package/dist/utils/cancellation.d.ts.map +1 -1
- package/dist/utils/cancellation.js +52 -7
- package/dist/utils/cancellation.js.map +1 -1
- package/dist/utils/charCode.d.ts.map +1 -1
- package/dist/utils/coalescedRun.d.ts +16 -0
- package/dist/utils/coalescedRun.d.ts.map +1 -0
- package/dist/utils/coalescedRun.js +43 -0
- package/dist/utils/coalescedRun.js.map +1 -0
- package/dist/utils/color.d.ts.map +1 -1
- package/dist/utils/color.js +3 -3
- package/dist/utils/color.js.map +1 -1
- package/dist/utils/date.d.ts +24 -0
- package/dist/utils/date.d.ts.map +1 -1
- package/dist/utils/date.js +62 -0
- package/dist/utils/date.js.map +1 -1
- package/dist/utils/debounce.js +1 -1
- package/dist/utils/debounce.js.map +1 -1
- package/dist/utils/decorators/debounce.d.ts.map +1 -1
- package/dist/utils/decorators/debounce.js.map +1 -1
- package/dist/utils/decorators/gate.d.ts.map +1 -1
- package/dist/utils/decorators/gate.js +2 -2
- package/dist/utils/decorators/gate.js.map +1 -1
- package/dist/utils/decorators/log.d.ts.map +1 -1
- package/dist/utils/decorators/log.js +5 -5
- package/dist/utils/decorators/log.js.map +1 -1
- package/dist/utils/decorators/memoize.d.ts.map +1 -1
- package/dist/utils/decorators/memoize.js +2 -2
- package/dist/utils/decorators/memoize.js.map +1 -1
- package/dist/utils/decorators/resolver.d.ts.map +1 -1
- package/dist/utils/decorators/resolver.js.map +1 -1
- package/dist/utils/decorators/sequentialize.d.ts.map +1 -1
- package/dist/utils/decorators/sequentialize.js +2 -2
- package/dist/utils/decorators/sequentialize.js.map +1 -1
- package/dist/utils/decorators/serializable.d.ts.map +1 -1
- package/dist/utils/decorators/serializable.js +1 -1
- package/dist/utils/decorators/serializable.js.map +1 -1
- package/dist/utils/dedupedAsyncCache.d.ts.map +1 -1
- package/dist/utils/disposable.d.ts +15 -2
- package/dist/utils/disposable.d.ts.map +1 -1
- package/dist/utils/disposable.js.map +1 -1
- package/dist/utils/env/browser/base64.d.ts.map +1 -1
- package/dist/utils/env/browser/base64.js.map +1 -1
- package/dist/utils/env/browser/crypto.d.ts.map +1 -1
- package/dist/utils/env/browser/crypto.js.map +1 -1
- package/dist/utils/env/browser/fs.d.ts.map +1 -1
- package/dist/utils/env/browser/fs.js.map +1 -1
- package/dist/utils/env/browser/hex.d.ts.map +1 -1
- package/dist/utils/env/browser/hex.js.map +1 -1
- package/dist/utils/env/browser/hrtime.d.ts.map +1 -1
- package/dist/utils/env/browser/hrtime.js.map +1 -1
- package/dist/utils/env/browser/logScope.d.ts.map +1 -1
- package/dist/utils/env/browser/logScope.js.map +1 -1
- package/dist/utils/env/browser/md5.d.ts.map +1 -1
- package/dist/utils/env/browser/md5.js.map +1 -1
- package/dist/utils/env/browser/platform.d.ts.map +1 -1
- package/dist/utils/env/browser/platform.js.map +1 -1
- package/dist/utils/env/node/base64.d.ts.map +1 -1
- package/dist/utils/env/node/base64.js.map +1 -1
- package/dist/utils/env/node/crypto.d.ts.map +1 -1
- package/dist/utils/env/node/crypto.js.map +1 -1
- package/dist/utils/env/node/exec.d.ts +9 -1
- package/dist/utils/env/node/exec.d.ts.map +1 -1
- package/dist/utils/env/node/exec.js +11 -4
- package/dist/utils/env/node/exec.js.map +1 -1
- package/dist/utils/env/node/fs.d.ts.map +1 -1
- package/dist/utils/env/node/fs.js.map +1 -1
- package/dist/utils/env/node/hex.d.ts.map +1 -1
- package/dist/utils/env/node/hex.js.map +1 -1
- package/dist/utils/env/node/hrtime.d.ts.map +1 -1
- package/dist/utils/env/node/hrtime.js.map +1 -1
- package/dist/utils/env/node/logScope.d.ts.map +1 -1
- package/dist/utils/env/node/logScope.js.map +1 -1
- package/dist/utils/env/node/platform.d.ts.map +1 -1
- package/dist/utils/env/node/platform.js.map +1 -1
- package/dist/utils/event.d.ts.map +1 -1
- package/dist/utils/event.js +18 -22
- package/dist/utils/event.js.map +1 -1
- package/dist/utils/formatter.d.ts.map +1 -1
- package/dist/utils/formatter.js.map +1 -1
- package/dist/utils/function.d.ts.map +1 -1
- package/dist/utils/function.js +3 -3
- package/dist/utils/function.js.map +1 -1
- package/dist/utils/hash.js.map +1 -1
- package/dist/utils/iterable.d.ts.map +1 -1
- package/dist/utils/iterable.js +2 -6
- package/dist/utils/iterable.js.map +1 -1
- package/dist/utils/lazy.d.ts.map +1 -1
- package/dist/utils/lazy.js.map +1 -1
- package/dist/utils/logger.d.ts.map +1 -1
- package/dist/utils/logger.js +1 -1
- package/dist/utils/logger.js.map +1 -1
- package/dist/utils/logger.scoped.js +1 -1
- package/dist/utils/logger.scoped.js.map +1 -1
- package/dist/utils/lruMap.d.ts.map +1 -1
- package/dist/utils/lruMap.js.map +1 -1
- package/dist/utils/mru.d.ts.map +1 -1
- package/dist/utils/mru.js.map +1 -1
- package/dist/utils/object.js.map +1 -1
- package/dist/utils/paging.d.ts +29 -0
- package/dist/utils/paging.d.ts.map +1 -1
- package/dist/utils/paging.js +18 -0
- package/dist/utils/paging.js.map +1 -1
- package/dist/utils/path.js.map +1 -1
- package/dist/utils/promise.d.ts +10 -0
- package/dist/utils/promise.d.ts.map +1 -1
- package/dist/utils/promise.js +26 -3
- package/dist/utils/promise.js.map +1 -1
- package/dist/utils/promiseCache.d.ts +12 -2
- package/dist/utils/promiseCache.d.ts.map +1 -1
- package/dist/utils/promiseCache.js +80 -50
- package/dist/utils/promiseCache.js.map +1 -1
- package/dist/utils/searchTree.d.ts.map +1 -1
- package/dist/utils/searchTree.js +4 -1
- package/dist/utils/searchTree.js.map +1 -1
- package/dist/utils/stopwatch.d.ts.map +1 -1
- package/dist/utils/string.js +1 -1
- package/dist/utils/string.js.map +1 -1
- package/dist/utils/subscriptionManager.d.ts.map +1 -1
- package/dist/utils/subscriptionManager.js.map +1 -1
- package/dist/utils/trie.d.ts.map +1 -1
- package/dist/utils/trie.js +1 -0
- package/dist/utils/trie.js.map +1 -1
- package/docs/integrations.md +372 -0
- package/docs/kepler-read-api-parity.md +112 -0
- package/package.json +238 -172
- package/src/git/cache.ts +75 -8
- package/src/git/context.ts +4 -3
- package/src/git/errors.ts +36 -1
- package/src/git/models/commit.ts +1 -1
- package/src/git/models/graph.ts +147 -0
- package/src/git/models/graphSession.ts +205 -0
- package/src/git/models/issue.ts +12 -1
- package/src/git/models/pullRequest.ts +27 -1
- package/src/git/models/repository.ts +24 -1
- package/src/git/models/resourceDescriptor.ts +17 -0
- package/src/git/models/signature.ts +16 -0
- package/src/git/models/tag.ts +6 -1
- package/src/git/parsers/diffParser.ts +1 -1
- package/src/git/providers/branches.ts +6 -1
- package/src/git/providers/commits.ts +6 -1
- package/src/git/providers/config.ts +5 -1
- package/src/git/providers/graph.ts +69 -2
- package/src/git/providers/operations.ts +1 -1
- package/src/git/providers/status.ts +1 -1
- package/src/git/providers/worktrees.ts +17 -3
- package/src/git/remotes/azure-devops.ts +29 -33
- package/src/git/remotes/bitbucket-server.ts +23 -25
- package/src/git/remotes/bitbucket.ts +23 -25
- package/src/git/remotes/gerrit.ts +12 -14
- package/src/git/remotes/gitea.ts +13 -15
- package/src/git/remotes/github.ts +56 -58
- package/src/git/remotes/gitlab.ts +102 -104
- package/src/git/run.types.ts +54 -4
- package/src/git/utils/branch.utils.ts +12 -1
- package/src/git/utils/conflictResolution.utils.ts +126 -0
- package/src/git/utils/contributor.utils.ts +1 -1
- package/src/git/utils/fileStatus.utils.ts +7 -0
- package/src/git/utils/graph.utils.ts +46 -0
- package/src/git/utils/issue.utils.ts +1 -0
- package/src/git/utils/pullRequest.utils.ts +9 -0
- package/src/git/utils/reachability.utils.ts +79 -8
- package/src/git/utils/sshKey.utils.ts +30 -0
- package/src/git/watching/watchService.ts +16 -1
- package/src/git/watching/watchSession.ts +20 -2
- package/src/git-cli/exec/git.ts +144 -42
- package/src/git-cli/parsers/logParser.ts +83 -1
- package/src/git-cli/parsers/sshSignatureParser.ts +85 -0
- package/src/git-cli/parsers/worktreeParser.ts +5 -7
- package/src/git-cli/providers/branches.ts +60 -38
- package/src/git-cli/providers/commits.ts +102 -9
- package/src/git-cli/providers/graph.ts +1771 -393
- package/src/git-cli/providers/operations.ts +22 -2
- package/src/git-cli/providers/pausedOperations.ts +3 -3
- package/src/git-cli/providers/revision.ts +42 -0
- package/src/git-cli/providers/status.ts +333 -178
- package/src/git-cli/providers/tags.ts +2 -0
- package/src/git-cli/providers/worktrees.ts +57 -6
- package/src/git-cli/service.ts +9 -0
- package/src/ipc/ipcServer.ts +1 -1
- package/src/plus/agents/providers/claudeCodeProvider.ts +25 -0
- package/src/plus/agents/providers/claudeCodeTranscript.ts +320 -8
- package/src/plus/agents/types.ts +34 -0
- package/src/plus/ai/constants.ts +1 -9
- package/src/plus/ai/models/model.ts +53 -2
- package/src/plus/ai/models/promptTemplates.ts +9 -2
- package/src/plus/ai/prompts.ts +16 -48
- package/src/plus/ai/providers/anthropicProvider.ts +45 -3
- package/src/plus/ai/providers/deepSeekProvider.ts +17 -1
- package/src/plus/ai/providers/geminiProvider.ts +25 -6
- package/src/plus/ai/providers/gitkrakenProvider.ts +2 -0
- package/src/plus/ai/providers/huggingFaceProvider.ts +28 -21
- package/src/plus/ai/providers/openAICompatibleProviderBase.ts +16 -1
- package/src/plus/ai/providers/xaiProvider.ts +14 -1
- package/src/plus/ai/utils/ai.utils.ts +5 -7
- package/src/plus/ai/utils/results.utils.ts +32 -0
- package/src/plus/ai/utils/truncation.utils.ts +0 -1
- package/src/plus/git-github/api/github.ts +497 -129
- package/src/plus/git-github/models.ts +33 -0
- package/src/plus/git-github/providers/github/branches.ts +6 -3
- package/src/plus/git-github/providers/github/diff.ts +1 -1
- package/src/plus/git-github/providers/github/graph.ts +131 -0
- package/src/plus/git-github/providers/github/tags.ts +2 -0
- package/src/plus/integrations/authentication/cloudIntegrationService.ts +292 -0
- package/src/plus/integrations/authentication/configuredIntegrationService.ts +651 -0
- package/src/plus/integrations/authentication/integrationAuthenticationProvider.ts +363 -0
- package/src/plus/integrations/authentication/integrationAuthenticationService.ts +148 -0
- package/src/plus/integrations/authentication/manualTokenProvider.ts +79 -0
- package/src/plus/integrations/authentication/models.ts +202 -0
- package/src/plus/integrations/collectionMetadata.ts +143 -0
- package/src/plus/integrations/constants.ts +190 -0
- package/src/plus/integrations/context.ts +382 -0
- package/src/plus/integrations/errors.ts +184 -0
- package/src/plus/integrations/index.ts +216 -0
- package/src/plus/integrations/integrationService.ts +2589 -0
- package/src/plus/integrations/lite.ts +233 -0
- package/src/plus/integrations/manager.ts +359 -0
- package/src/plus/integrations/models/gitHostIntegration.ts +1631 -0
- package/src/plus/integrations/models/integration.ts +926 -0
- package/src/plus/integrations/models/issuesIntegration.ts +264 -0
- package/src/plus/integrations/providerFilters.ts +12 -0
- package/src/plus/integrations/providers/apiClients.ts +69 -0
- package/src/plus/integrations/providers/apiConfig.ts +71 -0
- package/src/plus/integrations/providers/azure/azure.ts +822 -0
- package/src/plus/integrations/providers/azure/models.ts +618 -0
- package/src/plus/integrations/providers/azureDevOps.ts +1342 -0
- package/src/plus/integrations/providers/bitbucket/bitbucket.ts +904 -0
- package/src/plus/integrations/providers/bitbucket/models.ts +445 -0
- package/src/plus/integrations/providers/bitbucket-server/models.ts +283 -0
- package/src/plus/integrations/providers/bitbucket-server.ts +447 -0
- package/src/plus/integrations/providers/bitbucket.ts +794 -0
- package/src/plus/integrations/providers/github/github.ts +64 -0
- package/src/plus/integrations/providers/github/github.utils.ts +23 -0
- package/src/plus/integrations/providers/github/models.ts +29 -0
- package/src/plus/integrations/providers/github.ts +750 -0
- package/src/plus/integrations/providers/gitlab/gitlab.ts +1320 -0
- package/src/plus/integrations/providers/gitlab/gitlab.utils.ts +80 -0
- package/src/plus/integrations/providers/gitlab/models.ts +271 -0
- package/src/plus/integrations/providers/gitlab.ts +832 -0
- package/src/plus/integrations/providers/jira.ts +564 -0
- package/src/plus/integrations/providers/linear.ts +402 -0
- package/src/plus/integrations/providers/models.ts +1622 -0
- package/src/plus/integrations/providers/providersApi.ts +1889 -0
- package/src/plus/integrations/providers/trello.ts +205 -0
- package/src/plus/integrations/providers/utils/providerPaging.ts +177 -0
- package/src/plus/integrations/providers/utils.ts +419 -0
- package/src/plus/integrations/reads/context.ts +75 -0
- package/src/plus/integrations/reads/cursors.ts +224 -0
- package/src/plus/integrations/reads/drains.ts +343 -0
- package/src/plus/integrations/reads/filters.ts +124 -0
- package/src/plus/integrations/reads/hierarchy.ts +493 -0
- package/src/plus/integrations/reads/hierarchy.utils.ts +106 -0
- package/src/plus/integrations/reads/issueTracker.ts +480 -0
- package/src/plus/integrations/reads/issues.ts +407 -0
- package/src/plus/integrations/reads/paging.ts +277 -0
- package/src/plus/integrations/reads/pullRequests.ts +267 -0
- package/src/plus/integrations/reads/warnings.ts +170 -0
- package/src/plus/integrations/results.ts +275 -0
- package/src/plus/integrations/telemetry.ts +29 -0
- package/src/plus/integrations/utils/domain.utils.ts +26 -0
- package/src/plus/integrations/utils/integration.utils.ts +215 -0
- package/src/utils/brand.ts +0 -2
- package/src/utils/cancellation.ts +56 -7
- package/src/utils/coalescedRun.ts +45 -0
- package/src/utils/color.ts +3 -3
- package/src/utils/date.ts +72 -0
- package/src/utils/debounce.ts +1 -1
- package/src/utils/decorators/gate.ts +2 -2
- package/src/utils/decorators/log.ts +5 -5
- package/src/utils/decorators/memoize.ts +2 -2
- package/src/utils/decorators/sequentialize.ts +2 -2
- package/src/utils/decorators/serializable.ts +1 -1
- package/src/utils/disposable.ts +15 -2
- package/src/utils/env/node/exec.ts +20 -5
- package/src/utils/event.ts +19 -25
- package/src/utils/function.ts +3 -3
- package/src/utils/iterable.ts +2 -6
- package/src/utils/logger.scoped.ts +1 -1
- package/src/utils/logger.ts +1 -1
- package/src/utils/paging.ts +46 -0
- package/src/utils/promise.ts +33 -3
- package/src/utils/promiseCache.ts +81 -51
- package/src/utils/searchTree.ts +4 -2
- package/src/utils/string.ts +1 -1
- package/src/utils/trie.ts +1 -0
- package/dist/plus/ai/providers/githubModelsProvider.d.ts +0 -19
- package/dist/plus/ai/providers/githubModelsProvider.d.ts.map +0 -1
- package/dist/plus/ai/providers/githubModelsProvider.js +0 -51
- package/dist/plus/ai/providers/githubModelsProvider.js.map +0 -1
- package/src/plus/ai/providers/githubModelsProvider.ts +0 -92
|
@@ -0,0 +1,925 @@
|
|
|
1
|
+
import { base64 } from '../../../utils/base64.js';
|
|
2
|
+
import { CancellationError } from '../../../utils/cancellation.js';
|
|
3
|
+
import { toTokenWithInfo } from '../authentication/models.js';
|
|
4
|
+
import { toCollectionScopeFailure } from '../collectionMetadata.js';
|
|
5
|
+
import { GitCloudHostIntegrationId, GitSelfManagedHostIntegrationId } from '../constants.js';
|
|
6
|
+
import { GitHostIntegration } from '../models/gitHostIntegration.js';
|
|
7
|
+
import { fromProviderIssue, fromProviderPullRequest, getProviderPullRequestIdentity, IssueFilter, providerPullRequestMatchesSearch, providersMetadata, PullRequestFilter, toProviderPullRequestStates, } from './models.js';
|
|
8
|
+
import { collectProviderPagedResult, flatSettledOrThrow, mergeCollectionMetadata } from './utils/providerPaging.js';
|
|
9
|
+
function getAzureRepositoryIdentity(repo) {
|
|
10
|
+
const match = /^([^/]+)\/_git\/([^/]+)$/i.exec(repo.name);
|
|
11
|
+
return {
|
|
12
|
+
resourceName: repo.owner,
|
|
13
|
+
projectName: repo.project ?? match?.[1],
|
|
14
|
+
repositoryName: match?.[2] ?? repo.name,
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Matches an org/project descriptor against a caller-supplied name, mirroring the facade's own
|
|
19
|
+
* key/id/name comparison so `listIssuesPage({ org, project })` narrows on the same identifiers a consumer
|
|
20
|
+
* already got back from `listOrgs`/`listProjects`.
|
|
21
|
+
*/
|
|
22
|
+
function azureResourceMatches(resource, value) {
|
|
23
|
+
return resource.key === value || resource.id === value || resource.name === value;
|
|
24
|
+
}
|
|
25
|
+
export class AzureDevOpsIntegrationBase extends GitHostIntegration {
|
|
26
|
+
getApiOptions(session, doNotConvertToPat = false) {
|
|
27
|
+
const usePat = !doNotConvertToPat;
|
|
28
|
+
const accessToken = usePat ? convertTokentoPAT(session.accessToken) : session.accessToken;
|
|
29
|
+
const tokenWithInfo = toTokenWithInfo(this.id, session, accessToken);
|
|
30
|
+
return {
|
|
31
|
+
tokenWithInfo: tokenWithInfo,
|
|
32
|
+
options: { isPAT: usePat },
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
_accounts;
|
|
36
|
+
async getProviderCurrentAccount(session) {
|
|
37
|
+
const { accessToken } = session;
|
|
38
|
+
this._accounts ??= new Map();
|
|
39
|
+
const cachedAccount = this._accounts.get(accessToken);
|
|
40
|
+
if (cachedAccount == null) {
|
|
41
|
+
const user = await this._requestForCurrentUser(session);
|
|
42
|
+
this._accounts.set(accessToken, user);
|
|
43
|
+
}
|
|
44
|
+
return this._accounts.get(accessToken);
|
|
45
|
+
}
|
|
46
|
+
async _requestForCurrentUser(session) {
|
|
47
|
+
const api = await this.getProvidersApi();
|
|
48
|
+
const { tokenWithInfo, options } = this.getApiOptions(session, true);
|
|
49
|
+
const user = await api.getCurrentUser(tokenWithInfo, options);
|
|
50
|
+
return user
|
|
51
|
+
? {
|
|
52
|
+
provider: this,
|
|
53
|
+
id: user.id,
|
|
54
|
+
name: user.name ?? undefined,
|
|
55
|
+
email: user.email ?? undefined,
|
|
56
|
+
avatarUrl: user.avatarUrl ?? undefined,
|
|
57
|
+
username: user.username ?? undefined,
|
|
58
|
+
}
|
|
59
|
+
: undefined;
|
|
60
|
+
}
|
|
61
|
+
_organizations;
|
|
62
|
+
async getProviderResourcesForUser(session, force = false) {
|
|
63
|
+
this._organizations ??= new Map();
|
|
64
|
+
const { accessToken } = session;
|
|
65
|
+
const cachedResources = this._organizations.get(accessToken);
|
|
66
|
+
if (cachedResources == null || force) {
|
|
67
|
+
const api = await this.getProvidersApi();
|
|
68
|
+
const account = await this.getProviderCurrentAccount(session);
|
|
69
|
+
if (account?.id == null)
|
|
70
|
+
return undefined;
|
|
71
|
+
const { tokenWithInfo, options } = this.getApiOptions(session);
|
|
72
|
+
const resources = await api.getAzureResourcesForUser(tokenWithInfo, account.id, options);
|
|
73
|
+
this._organizations.set(accessToken, resources != null ? resources.map(r => ({ ...r, key: r.id })) : undefined);
|
|
74
|
+
}
|
|
75
|
+
return this._organizations.get(accessToken);
|
|
76
|
+
}
|
|
77
|
+
_projects;
|
|
78
|
+
/**
|
|
79
|
+
* Discovers (and caches) each resource's projects. Only resources whose drain completed cleanly are cached;
|
|
80
|
+
* a rejected or backstop-truncated drain is left uncached (retried next call). When `failures` is supplied,
|
|
81
|
+
* a rejected resource is recorded there as a structured {@link CollectionScopeFailure} so an account-wide
|
|
82
|
+
* caller can surface the incomplete project set (a whole org's PRs/issues silently missing otherwise) as a
|
|
83
|
+
* scope-aware warning + `fetchFailed` rather than an all-pages success over a hole.
|
|
84
|
+
*/
|
|
85
|
+
async getProviderProjectsForResources(session, resources, force = false, failures) {
|
|
86
|
+
this._projects ??= new Map();
|
|
87
|
+
const { accessToken } = session;
|
|
88
|
+
let resourcesWithoutProjects = [];
|
|
89
|
+
if (force) {
|
|
90
|
+
resourcesWithoutProjects = resources;
|
|
91
|
+
}
|
|
92
|
+
else {
|
|
93
|
+
for (const resource of resources) {
|
|
94
|
+
const resourceKey = `${accessToken}:${resource.id}`;
|
|
95
|
+
const cachedProjects = this._projects.get(resourceKey);
|
|
96
|
+
if (cachedProjects == null) {
|
|
97
|
+
resourcesWithoutProjects.push(resource);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
const allProjects = [];
|
|
102
|
+
let resultMetadata;
|
|
103
|
+
if (resourcesWithoutProjects.length > 0) {
|
|
104
|
+
const api = await this.getProvidersApi();
|
|
105
|
+
const { tokenWithInfo, options } = this.getApiOptions(session);
|
|
106
|
+
// The projects API is paginated; a single call would drop every project past the first page (and
|
|
107
|
+
// with it their repos and PRs). Drain all pages per resource, threading the returned cursor.
|
|
108
|
+
// Per-resource (not a shared flatSettled) so a resource whose drain was truncated (hit the paging
|
|
109
|
+
// backstop) or rejected is NOT cached — caching a partial list here would make every later repo/PR/
|
|
110
|
+
// issue read for that org silently inherit an incomplete project set. Leaving it uncached means the
|
|
111
|
+
// next call retries it. The scope is passed so a page-level failure preserves the prefix already
|
|
112
|
+
// fetched and records a structured failure instead of re-throwing.
|
|
113
|
+
const drains = await Promise.allSettled(resourcesWithoutProjects.map(async (resource) => ({
|
|
114
|
+
resource: resource,
|
|
115
|
+
result: await collectProviderPagedResult(cursor => api.getAzureProjectsForResource(tokenWithInfo, resource.name, {
|
|
116
|
+
...options,
|
|
117
|
+
cursor: cursor,
|
|
118
|
+
}), 20, { providerId: this.id, resourceId: resource.id }),
|
|
119
|
+
})));
|
|
120
|
+
// `allSettled` preserves order, so `drains[i]` is `resourcesWithoutProjects[i]`.
|
|
121
|
+
drains.forEach((drain, i) => {
|
|
122
|
+
// A rejected resource drain contributes nothing and is left uncached (retried next call). Record
|
|
123
|
+
// it as a structured failure so an account-wide caller can warn on the org whose projects (and
|
|
124
|
+
// thus PRs/issues) are missing, instead of silently narrowing the read.
|
|
125
|
+
if (drain.status !== 'fulfilled') {
|
|
126
|
+
const resource = resourcesWithoutProjects[i];
|
|
127
|
+
const failure = toCollectionScopeFailure({ providerId: this.id, resourceId: resource.id }, drain.reason);
|
|
128
|
+
failures?.push(failure);
|
|
129
|
+
resultMetadata = mergeCollectionMetadata(resultMetadata, {
|
|
130
|
+
completeness: 'partial',
|
|
131
|
+
failures: [failure],
|
|
132
|
+
});
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
135
|
+
const { resource, result } = drain.value;
|
|
136
|
+
const projects = result.values
|
|
137
|
+
.filter(p => p.namespace === resource.name)
|
|
138
|
+
.map(p => ({
|
|
139
|
+
id: p.id,
|
|
140
|
+
name: p.name,
|
|
141
|
+
resourceId: resource.id,
|
|
142
|
+
resourceName: resource.name,
|
|
143
|
+
key: p.id,
|
|
144
|
+
}));
|
|
145
|
+
if (result.metadata != null) {
|
|
146
|
+
resultMetadata = mergeCollectionMetadata(resultMetadata, result.metadata);
|
|
147
|
+
}
|
|
148
|
+
const metadataIncomplete = result.metadata != null && result.metadata.completeness !== 'complete';
|
|
149
|
+
if (result.truncated || metadataIncomplete) {
|
|
150
|
+
// A truncated drain is an incomplete project set; include its partial values in the current
|
|
151
|
+
// result but don't cache it as if complete. Add a structured failure for the truncation unless
|
|
152
|
+
// the drain already recorded a page-level failure for this resource.
|
|
153
|
+
if (result.truncated &&
|
|
154
|
+
!result.metadata?.failures?.some(f => f.scope?.resourceId === resource.id && f.kind !== 'unknown')) {
|
|
155
|
+
const failure = toCollectionScopeFailure({ providerId: this.id, resourceId: resource.id }, new Error('Project discovery was truncated before all pages were read'));
|
|
156
|
+
failures?.push(failure);
|
|
157
|
+
resultMetadata = mergeCollectionMetadata(resultMetadata, {
|
|
158
|
+
completeness: 'partial',
|
|
159
|
+
failures: [failure],
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
allProjects.push(...projects);
|
|
163
|
+
return;
|
|
164
|
+
}
|
|
165
|
+
this._projects.set(`${accessToken}:${resource.id}`, projects);
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
const cachedProjects = resources.reduce((projects, resource) => {
|
|
169
|
+
const resourceProjects = this._projects.get(`${accessToken}:${resource.id}`);
|
|
170
|
+
if (resourceProjects != null) {
|
|
171
|
+
projects.push(...resourceProjects);
|
|
172
|
+
}
|
|
173
|
+
return projects;
|
|
174
|
+
}, []);
|
|
175
|
+
allProjects.push(...cachedProjects);
|
|
176
|
+
const projectsByIdentity = new Map();
|
|
177
|
+
for (const project of allProjects) {
|
|
178
|
+
const identity = `${project.resourceId}:${project.id}`;
|
|
179
|
+
if (!projectsByIdentity.has(identity)) {
|
|
180
|
+
projectsByIdentity.set(identity, project);
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
const values = [...projectsByIdentity.values()];
|
|
184
|
+
return resultMetadata != null ? { values: values, metadata: resultMetadata } : { values: values };
|
|
185
|
+
}
|
|
186
|
+
async getRepoDescriptorsForProjects(session, projects) {
|
|
187
|
+
const descriptors = new Map();
|
|
188
|
+
if (projects.length === 0)
|
|
189
|
+
return descriptors;
|
|
190
|
+
const api = await this.getProvidersApi();
|
|
191
|
+
const { tokenWithInfo, options } = this.getApiOptions(session);
|
|
192
|
+
await Promise.all(projects.map(async (project) => {
|
|
193
|
+
const repos = (await api.getReposForAzureProject(tokenWithInfo, project.resourceName, project.name, options))?.values;
|
|
194
|
+
if (repos != null && repos.length > 0) {
|
|
195
|
+
descriptors.set(project.id, repos.map(r => ({
|
|
196
|
+
id: r.id,
|
|
197
|
+
nodeId: r.graphQLId ?? undefined,
|
|
198
|
+
resourceName: project.resourceName,
|
|
199
|
+
name: r.name,
|
|
200
|
+
projectName: project.name,
|
|
201
|
+
url: r.webUrl ?? undefined,
|
|
202
|
+
cloneUrlHttps: r.httpsUrl ?? undefined,
|
|
203
|
+
cloneUrlSsh: r.sshUrl ?? undefined,
|
|
204
|
+
key: r.id,
|
|
205
|
+
})));
|
|
206
|
+
}
|
|
207
|
+
}));
|
|
208
|
+
return descriptors;
|
|
209
|
+
}
|
|
210
|
+
async getProviderOrganizationsForUser(session) {
|
|
211
|
+
const orgs = await this.getProviderResourcesForUser(session);
|
|
212
|
+
if (orgs == null)
|
|
213
|
+
return undefined;
|
|
214
|
+
return {
|
|
215
|
+
values: orgs.map(o => ({
|
|
216
|
+
id: o.id,
|
|
217
|
+
providerId: this.id,
|
|
218
|
+
name: o.name,
|
|
219
|
+
url: `${this.apiBaseUrl}/${o.name}`,
|
|
220
|
+
})),
|
|
221
|
+
};
|
|
222
|
+
}
|
|
223
|
+
async getProviderProjectsForOrg(session, org) {
|
|
224
|
+
// Azure is the one git host with a project tier: repos live under org (resource) → project. Enumerate
|
|
225
|
+
// the user's orgs (optionally scoped to `org`), read their projects, and surface each as an org-shaped
|
|
226
|
+
// entry so the ProviderBackend facade can list them uniformly.
|
|
227
|
+
const orgs = await this.getProviderResourcesForUser(session);
|
|
228
|
+
if (orgs == null)
|
|
229
|
+
return undefined;
|
|
230
|
+
if (orgs.length === 0) {
|
|
231
|
+
return { values: [], paging: { cursor: '{}', more: false } };
|
|
232
|
+
}
|
|
233
|
+
const scopedOrgs = org != null ? orgs.filter(o => o.name === org || o.id === org) : orgs;
|
|
234
|
+
if (scopedOrgs.length === 0)
|
|
235
|
+
return { values: [] };
|
|
236
|
+
const projects = await this.getProviderProjectsForResources(session, scopedOrgs);
|
|
237
|
+
if (projects.values.length === 0 && projects.metadata == null)
|
|
238
|
+
return { values: [] };
|
|
239
|
+
return {
|
|
240
|
+
values: projects.values.map(p => ({
|
|
241
|
+
id: p.id,
|
|
242
|
+
providerId: this.id,
|
|
243
|
+
name: p.name,
|
|
244
|
+
org: p.resourceName,
|
|
245
|
+
url: `${this.apiBaseUrl}/${p.resourceName}/${p.name}`,
|
|
246
|
+
})),
|
|
247
|
+
...(projects.metadata != null ? { metadata: projects.metadata } : {}),
|
|
248
|
+
};
|
|
249
|
+
}
|
|
250
|
+
/**
|
|
251
|
+
* With `options.project`, returns one page of that project's repos (follow `paging.cursor` to page).
|
|
252
|
+
* Without a project it fans out across every project under `org` and returns them all at once — there's
|
|
253
|
+
* no single cursor to page a parallel merge — skipping any project that fails to list rather than
|
|
254
|
+
* failing the whole org. If any successful project drain hits the defensive page backstop, the merged
|
|
255
|
+
* result is marked `truncated` without exposing a synthetic cursor.
|
|
256
|
+
*/
|
|
257
|
+
async getProviderRepositoriesForOrg(session, org, options) {
|
|
258
|
+
const api = await this.getProvidersApi();
|
|
259
|
+
const { tokenWithInfo, options: apiOptions } = this.getApiOptions(session);
|
|
260
|
+
if (options?.project) {
|
|
261
|
+
return api.getReposForAzureProject(tokenWithInfo, org, options.project, {
|
|
262
|
+
...apiOptions,
|
|
263
|
+
cursor: options.cursor,
|
|
264
|
+
});
|
|
265
|
+
}
|
|
266
|
+
const orgDescriptor = (await this.getProviderResourcesForUser(session))?.find(o => o.name === org);
|
|
267
|
+
if (orgDescriptor == null)
|
|
268
|
+
return undefined;
|
|
269
|
+
const discoveryFailures = [];
|
|
270
|
+
const projects = await this.getProviderProjectsForResources(session, [orgDescriptor], false, discoveryFailures);
|
|
271
|
+
// An empty result is only proven-empty when discovery itself succeeded; a rejected project-discovery
|
|
272
|
+
// leaves the repo set unknowable, so surface the discovery metadata rather than publishing a hole as a
|
|
273
|
+
// complete list.
|
|
274
|
+
if (projects.values.length === 0) {
|
|
275
|
+
return { values: [], metadata: projects.metadata };
|
|
276
|
+
}
|
|
277
|
+
let repoMetadata;
|
|
278
|
+
const results = await Promise.allSettled(projects.values.map(p => collectProviderPagedResult(cursor => api.getReposForAzureProject(tokenWithInfo, org, p.name, { ...apiOptions, cursor: cursor }), 20, { providerId: this.id, resourceId: org, projectId: p.name })));
|
|
279
|
+
const values = [];
|
|
280
|
+
let truncated = false;
|
|
281
|
+
for (const result of results) {
|
|
282
|
+
// With a per-project scope, collectProviderPagedResult catches page-level failures itself and returns
|
|
283
|
+
// them as metadata rather than rejecting. A rejected promise here is an unexpected internal error.
|
|
284
|
+
if (result.status !== 'fulfilled') {
|
|
285
|
+
truncated = true;
|
|
286
|
+
continue;
|
|
287
|
+
}
|
|
288
|
+
values.push(...result.value.values);
|
|
289
|
+
if (result.value.metadata != null) {
|
|
290
|
+
repoMetadata = mergeCollectionMetadata(repoMetadata, result.value.metadata);
|
|
291
|
+
}
|
|
292
|
+
truncated ||= result.value.truncated === true;
|
|
293
|
+
}
|
|
294
|
+
const metadata = mergeCollectionMetadata(repoMetadata, projects.metadata);
|
|
295
|
+
return {
|
|
296
|
+
values: values,
|
|
297
|
+
...(metadata != null ? { metadata: metadata } : {}),
|
|
298
|
+
...(truncated || (metadata != null && metadata.completeness !== 'complete') ? { truncated: true } : {}),
|
|
299
|
+
};
|
|
300
|
+
}
|
|
301
|
+
async mergeProviderPullRequest(session, pr, options) {
|
|
302
|
+
const api = await this.getProvidersApi();
|
|
303
|
+
if (pr.refs == null || pr.project == null)
|
|
304
|
+
return false;
|
|
305
|
+
const { tokenWithInfo, options: apiOptions } = this.getApiOptions(session);
|
|
306
|
+
try {
|
|
307
|
+
const merged = await api.mergePullRequest(tokenWithInfo, pr, {
|
|
308
|
+
...options,
|
|
309
|
+
...apiOptions,
|
|
310
|
+
});
|
|
311
|
+
return merged;
|
|
312
|
+
}
|
|
313
|
+
catch (ex) {
|
|
314
|
+
this.showMergeErrorMessage(ex);
|
|
315
|
+
return false;
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
showMergeErrorMessage(ex) {
|
|
319
|
+
this.ctx.hooks?.ui?.onError?.(`${ex.message}. Check branch policies, and ensure you have the necessary permissions to merge the pull request.`);
|
|
320
|
+
}
|
|
321
|
+
async getProviderAccountForCommit(session, repo, rev, options) {
|
|
322
|
+
return (await this.authenticationService.apis.azure)?.getAccountForCommit(this, toTokenWithInfo(this.id, session), repo.owner, repo.name, rev, this.apiBaseUrl, options);
|
|
323
|
+
}
|
|
324
|
+
async getProviderAccountForEmail(_session, _repo, _email, _options) {
|
|
325
|
+
return Promise.resolve(undefined);
|
|
326
|
+
}
|
|
327
|
+
async getProviderDefaultBranch(session, repo, cancellation) {
|
|
328
|
+
return (await this.authenticationService.apis.azure)?.getDefaultBranch(this, toTokenWithInfo(this.id, session), repo.owner, repo.name, { baseUrl: this.apiBaseUrl }, cancellation);
|
|
329
|
+
}
|
|
330
|
+
async getProviderLinkedIssueOrPullRequest(session, repo, { id }, type) {
|
|
331
|
+
return (await this.authenticationService.apis.azure)?.getIssueOrPullRequest(this, toTokenWithInfo(this.id, session), repo.owner, repo.name, id, {
|
|
332
|
+
baseUrl: this.apiBaseUrl,
|
|
333
|
+
type: type,
|
|
334
|
+
});
|
|
335
|
+
}
|
|
336
|
+
async getProviderIssue(session, project, id) {
|
|
337
|
+
const user = await this.getProviderCurrentAccount(session);
|
|
338
|
+
if (user?.username == null)
|
|
339
|
+
return undefined;
|
|
340
|
+
const orgs = await this.getProviderResourcesForUser(session);
|
|
341
|
+
if (orgs == null || orgs.length === 0)
|
|
342
|
+
return undefined;
|
|
343
|
+
const projects = await this.getProviderProjectsForResources(session, orgs);
|
|
344
|
+
if (projects.values.length === 0)
|
|
345
|
+
return undefined;
|
|
346
|
+
const matchingProject = projects.values.find(p => p.resourceName === project.owner && p.name === project.name);
|
|
347
|
+
if (matchingProject == null)
|
|
348
|
+
return undefined;
|
|
349
|
+
return (await this.authenticationService.apis.azure)?.getIssue(this, toTokenWithInfo(this.id, session), matchingProject, id, {
|
|
350
|
+
baseUrl: this.apiBaseUrl,
|
|
351
|
+
});
|
|
352
|
+
}
|
|
353
|
+
async getProviderPullRequestForBranch(session, repo, branch, _options) {
|
|
354
|
+
return (await this.authenticationService.apis.azure)?.getPullRequestForBranch(this, toTokenWithInfo(this.id, session), repo.owner, repo.name, branch, {
|
|
355
|
+
baseUrl: this.apiBaseUrl,
|
|
356
|
+
});
|
|
357
|
+
}
|
|
358
|
+
async getProviderPullRequestForCommit(session, repo, rev) {
|
|
359
|
+
return (await this.authenticationService.apis.azure)?.getPullRequestForCommit(this, toTokenWithInfo(this.id, session), repo.owner, repo.name, rev, this.apiBaseUrl);
|
|
360
|
+
}
|
|
361
|
+
async getRepoInfo(repo) {
|
|
362
|
+
const identity = getAzureRepositoryIdentity(repo);
|
|
363
|
+
if (identity.projectName == null)
|
|
364
|
+
return undefined;
|
|
365
|
+
const api = await this.getProvidersApi();
|
|
366
|
+
// `connectionId` targets a specific account (multi-account); omitted reads the primary.
|
|
367
|
+
const session = await this.resolveReadSession(repo.connectionId, undefined);
|
|
368
|
+
if (session == null)
|
|
369
|
+
return undefined;
|
|
370
|
+
const { tokenWithInfo, options } = this.getApiOptions(session);
|
|
371
|
+
return api.getRepo(tokenWithInfo, identity.resourceName, identity.repositoryName, identity.projectName, options);
|
|
372
|
+
}
|
|
373
|
+
async getProviderRepositoryMetadata(session, repo, cancellation) {
|
|
374
|
+
return (await this.authenticationService.apis.azure)?.getRepositoryMetadata(this, toTokenWithInfo(this.id, session), repo.owner, repo.name, { baseUrl: this.apiBaseUrl }, cancellation);
|
|
375
|
+
}
|
|
376
|
+
async searchProviderMyPullRequests(session, repos, _cancellation, _silent, state, _options) {
|
|
377
|
+
const api = await this.getProvidersApi();
|
|
378
|
+
if (repos != null) {
|
|
379
|
+
// TODO: implement repos version
|
|
380
|
+
return undefined;
|
|
381
|
+
}
|
|
382
|
+
const states = toProviderPullRequestStates(state);
|
|
383
|
+
const user = await this.getProviderCurrentAccount(session);
|
|
384
|
+
// Azure filters key on the identity GUID (account id), not the display name — see
|
|
385
|
+
// getProviderMyPullRequestsForUser and the repo-scoped path in gitHostIntegration.ts.
|
|
386
|
+
if (user?.id == null)
|
|
387
|
+
return undefined;
|
|
388
|
+
const orgs = await this.getProviderResourcesForUser(session);
|
|
389
|
+
if (orgs == null || orgs.length === 0)
|
|
390
|
+
return undefined;
|
|
391
|
+
const projects = await this.getProviderProjectsForResources(session, orgs);
|
|
392
|
+
if (projects.values.length === 0)
|
|
393
|
+
return undefined;
|
|
394
|
+
const repoDescriptors = [
|
|
395
|
+
...((await this.getRepoDescriptorsForProjects(session, projects.values)) ?? new Map()).values(),
|
|
396
|
+
]
|
|
397
|
+
.filter(r => r != null)
|
|
398
|
+
.flat();
|
|
399
|
+
const { tokenWithInfo, options } = this.getApiOptions(session);
|
|
400
|
+
const projectInputs = projects.values.map(p => ({ namespace: p.resourceName, project: p.name }));
|
|
401
|
+
// Legacy array-returning path (Launchpad/focus view): unwrap `.values` from the SDK collection result.
|
|
402
|
+
// The metadata (partial/failures) isn't surfaced here because this path's return type has no warning
|
|
403
|
+
// channel; the metadata-aware ProviderBackend surface is getProviderMyPullRequestsForUser above.
|
|
404
|
+
const assignedPrs = (await api.getPullRequestsForAzureProjects(tokenWithInfo, projectInputs, {
|
|
405
|
+
...options,
|
|
406
|
+
assigneeLogins: [user.id],
|
|
407
|
+
states: states,
|
|
408
|
+
})).values.map(pr => this.fromAzureProviderPullRequest(pr, repoDescriptors, projects.values));
|
|
409
|
+
const authoredPrs = (await api.getPullRequestsForAzureProjects(tokenWithInfo, projectInputs, {
|
|
410
|
+
...options,
|
|
411
|
+
authorLogin: user.id,
|
|
412
|
+
states: states,
|
|
413
|
+
})).values.map(pr => this.fromAzureProviderPullRequest(pr, repoDescriptors, projects.values));
|
|
414
|
+
const prsById = new Map();
|
|
415
|
+
for (const pr of authoredPrs) {
|
|
416
|
+
prsById.set(pr.id, pr);
|
|
417
|
+
}
|
|
418
|
+
for (const pr of assignedPrs) {
|
|
419
|
+
const existing = prsById.get(pr.id);
|
|
420
|
+
if (existing == null) {
|
|
421
|
+
prsById.set(pr.id, pr);
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
return [...prsById.values()];
|
|
425
|
+
}
|
|
426
|
+
async getProviderMyPullRequestsForUser(session, options) {
|
|
427
|
+
const api = await this.getProvidersApi();
|
|
428
|
+
const user = await this.getProviderCurrentAccount(session);
|
|
429
|
+
// Azure routes authorLogin/assigneeLogins to `searchCriteria.creatorId`/`reviewerId`, which require the
|
|
430
|
+
// identity GUID (account id), not the display name — matching the repo-scoped path in
|
|
431
|
+
// gitHostIntegration.ts. Using `username` here would match nothing and return zero PRs.
|
|
432
|
+
if (user?.id == null)
|
|
433
|
+
return undefined;
|
|
434
|
+
// Azure PRs are org + project scoped: enumerate the user's orgs and their projects, then read authored
|
|
435
|
+
// and assigned PRs across all of them. Return the raw provider shape (not the normalized model) so the
|
|
436
|
+
// ProviderBackend surface stays uniform with the other providers.
|
|
437
|
+
const orgs = await this.getProviderResourcesForUser(session);
|
|
438
|
+
if (orgs == null || orgs.length === 0)
|
|
439
|
+
return undefined;
|
|
440
|
+
// Structured per-scope failures from BOTH project discovery (a whole org dropped) and the per-project PR
|
|
441
|
+
// drains, so the facade warns on the failed scope + sets `fetchFailed` instead of silently narrowing.
|
|
442
|
+
const failures = [];
|
|
443
|
+
const projects = await this.getProviderProjectsForResources(session, orgs, false, failures);
|
|
444
|
+
if (projects.values.length === 0) {
|
|
445
|
+
// Project discovery itself was incomplete (e.g. a truncated org); surface the metadata so the facade
|
|
446
|
+
// can warn and set fetchFailed rather than reporting an empty account.
|
|
447
|
+
const incomplete = projects.metadata != null && projects.metadata.completeness !== 'complete';
|
|
448
|
+
return {
|
|
449
|
+
values: [],
|
|
450
|
+
paging: { cursor: '{}', more: false, truncated: incomplete || undefined },
|
|
451
|
+
...(projects.metadata != null ? { metadata: projects.metadata } : {}),
|
|
452
|
+
};
|
|
453
|
+
}
|
|
454
|
+
const { tokenWithInfo, options: apiOptions } = this.getApiOptions(session);
|
|
455
|
+
const states = toProviderPullRequestStates(options?.state);
|
|
456
|
+
const maxPagesPerProject = 20;
|
|
457
|
+
// Drain each project fully (numbered pages) for both the authored and assigned reads. Azure has no
|
|
458
|
+
// single cross-project cursor, so the aggregate is one page; `truncated` is set only if a project hit
|
|
459
|
+
// the backstop with more pages remaining.
|
|
460
|
+
let truncated = projects.metadata != null && projects.metadata.completeness !== 'complete';
|
|
461
|
+
// Drain one project's numbered pages, returning its PRs and any per-page failure. Returns per-project
|
|
462
|
+
// (not mutating shared state) so the fan-out below can be settled independently: one project's read
|
|
463
|
+
// failure must not discard every other project's already-drained PRs.
|
|
464
|
+
const drainProject = async (project, scope, filter) => {
|
|
465
|
+
const collected = [];
|
|
466
|
+
const projectIdentity = `${project.namespace}/${project.project}`;
|
|
467
|
+
let page;
|
|
468
|
+
for (let i = 0; i < maxPagesPerProject; i++) {
|
|
469
|
+
try {
|
|
470
|
+
const result = await api.getPullRequestsForAzureProject(tokenWithInfo, project, {
|
|
471
|
+
...apiOptions,
|
|
472
|
+
...filter,
|
|
473
|
+
states: states,
|
|
474
|
+
page: page,
|
|
475
|
+
});
|
|
476
|
+
if (result == null) {
|
|
477
|
+
if (page == null)
|
|
478
|
+
break;
|
|
479
|
+
truncated = true;
|
|
480
|
+
return {
|
|
481
|
+
prs: collected,
|
|
482
|
+
projectIdentity: projectIdentity,
|
|
483
|
+
failure: toCollectionScopeFailure(scope, new Error('Azure DevOps returned no page after advertising a continuation')),
|
|
484
|
+
};
|
|
485
|
+
}
|
|
486
|
+
collected.push(...result.data);
|
|
487
|
+
if (!result.hasMore)
|
|
488
|
+
break;
|
|
489
|
+
if (result.nextPage == null || result.nextPage === page) {
|
|
490
|
+
truncated = true;
|
|
491
|
+
return {
|
|
492
|
+
prs: collected,
|
|
493
|
+
projectIdentity: projectIdentity,
|
|
494
|
+
failure: toCollectionScopeFailure(scope, new Error('Azure DevOps returned no advancing pull request continuation')),
|
|
495
|
+
};
|
|
496
|
+
}
|
|
497
|
+
page = result.nextPage;
|
|
498
|
+
if (i === maxPagesPerProject - 1) {
|
|
499
|
+
truncated = true;
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
catch (ex) {
|
|
503
|
+
// A page failure after the first page leaves the already-drained prefix intact; record the
|
|
504
|
+
// failure at the project scope instead of re-throwing and discarding the prefix.
|
|
505
|
+
truncated = true;
|
|
506
|
+
return {
|
|
507
|
+
prs: collected,
|
|
508
|
+
projectIdentity: projectIdentity,
|
|
509
|
+
failure: toCollectionScopeFailure(scope, ex),
|
|
510
|
+
};
|
|
511
|
+
}
|
|
512
|
+
}
|
|
513
|
+
return { prs: collected, projectIdentity: projectIdentity };
|
|
514
|
+
};
|
|
515
|
+
// Settle per-project failures instead of rejecting the whole sweep. `drainProject` already catches its own
|
|
516
|
+
// page-level failures, so the structured failure (attributed to that project) is preserved rather than
|
|
517
|
+
// re-thrown — re-throwing an auth/rate-limit rejection would discard every other project's already-drained
|
|
518
|
+
// PRs. Auth/rate-limit stay actionable through the failure's kind (the facade maps it to an `auth`/`rate-limit`
|
|
519
|
+
// warning + `fetchFailed`), matching the SDK's model. `failures` was declared above so project-discovery
|
|
520
|
+
// failures and per-project drain failures share it.
|
|
521
|
+
const requested = options?.filters?.length ? new Set(options.filters) : undefined;
|
|
522
|
+
const wantAuthored = requested == null || requested.has(PullRequestFilter.Author);
|
|
523
|
+
// Azure has no assignee concept distinct from reviewer. Both neutral relationships map to reviewerId.
|
|
524
|
+
const wantReviewed = requested == null ||
|
|
525
|
+
requested.has(PullRequestFilter.Assignee) ||
|
|
526
|
+
requested.has(PullRequestFilter.ReviewRequested);
|
|
527
|
+
const outcomes = await Promise.all(projects.values.flatMap(p => {
|
|
528
|
+
const project = { namespace: p.resourceName, project: p.name };
|
|
529
|
+
const scope = { providerId: this.id, resourceId: p.resourceId, projectId: p.name };
|
|
530
|
+
const drains = [];
|
|
531
|
+
if (wantAuthored) {
|
|
532
|
+
drains.push(drainProject(project, scope, { authorLogin: user.id }));
|
|
533
|
+
}
|
|
534
|
+
if (wantReviewed) {
|
|
535
|
+
drains.push(drainProject(project, scope, { reviewerId: user.id }));
|
|
536
|
+
}
|
|
537
|
+
return drains;
|
|
538
|
+
}));
|
|
539
|
+
// Azure's `pullRequestId` is not account-global. Prefer repository + PR id, then the org-qualified URL.
|
|
540
|
+
// If neither is available, preserve the row instead of collapsing unrelated repositories by numeric id.
|
|
541
|
+
const prsByIdentity = new Map();
|
|
542
|
+
for (const outcome of outcomes) {
|
|
543
|
+
if (outcome.failure != null) {
|
|
544
|
+
failures.push(outcome.failure);
|
|
545
|
+
}
|
|
546
|
+
for (const pr of outcome.prs) {
|
|
547
|
+
const key = getProviderPullRequestIdentity(pr) ?? `project:${outcome.projectIdentity}:pull-request:${pr.id}`;
|
|
548
|
+
if (!prsByIdentity.has(key)) {
|
|
549
|
+
prsByIdentity.set(key, pr);
|
|
550
|
+
}
|
|
551
|
+
}
|
|
552
|
+
}
|
|
553
|
+
const metadata = mergeCollectionMetadata(failures.length > 0 ? { completeness: 'partial', failures: failures } : undefined, projects.metadata);
|
|
554
|
+
return {
|
|
555
|
+
values: [...prsByIdentity.values()],
|
|
556
|
+
paging: { cursor: '{}', more: false, truncated: truncated || undefined },
|
|
557
|
+
metadata: metadata,
|
|
558
|
+
};
|
|
559
|
+
}
|
|
560
|
+
async searchProviderPullRequests(session, searchQuery, repos, cancellation, options) {
|
|
561
|
+
if (cancellation?.aborted)
|
|
562
|
+
throw new CancellationError();
|
|
563
|
+
const orgs = await this.getProviderResourcesForUser(session);
|
|
564
|
+
if (cancellation?.aborted)
|
|
565
|
+
throw new CancellationError();
|
|
566
|
+
if (orgs == null || orgs.length === 0)
|
|
567
|
+
return undefined;
|
|
568
|
+
// `getProviderProjectsForResources` returns a collection result ({ values, metadata }); this search
|
|
569
|
+
// path only needs the resolved projects, so read `.values`.
|
|
570
|
+
const projects = (await this.getProviderProjectsForResources(session, orgs)).values;
|
|
571
|
+
if (cancellation?.aborted)
|
|
572
|
+
throw new CancellationError();
|
|
573
|
+
if (projects.length === 0)
|
|
574
|
+
return undefined;
|
|
575
|
+
const repoDescriptorsByProject = await this.getRepoDescriptorsForProjects(session, projects);
|
|
576
|
+
if (cancellation?.aborted)
|
|
577
|
+
throw new CancellationError();
|
|
578
|
+
const repoDescriptors = [...repoDescriptorsByProject.values()].filter(r => r != null).flat();
|
|
579
|
+
const requestedRepos = repos?.map(getAzureRepositoryIdentity);
|
|
580
|
+
const repoInputs = requestedRepos == null
|
|
581
|
+
? undefined
|
|
582
|
+
: repoDescriptors.filter(r => requestedRepos.some(repo => repo.resourceName === r.resourceName &&
|
|
583
|
+
repo.repositoryName === r.name &&
|
|
584
|
+
(repo.projectName == null || repo.projectName === r.projectName)));
|
|
585
|
+
if (repoInputs?.length === 0)
|
|
586
|
+
return [];
|
|
587
|
+
const api = await this.getProvidersApi();
|
|
588
|
+
const { tokenWithInfo, options: apiOptions } = this.getApiOptions(session);
|
|
589
|
+
const states = toProviderPullRequestStates(options?.include);
|
|
590
|
+
const searchScopes = repoInputs != null
|
|
591
|
+
? repoInputs.flatMap(repo => repo.projectName == null
|
|
592
|
+
? []
|
|
593
|
+
: [
|
|
594
|
+
{
|
|
595
|
+
project: { namespace: repo.resourceName, project: repo.projectName },
|
|
596
|
+
repo: {
|
|
597
|
+
id: repo.id,
|
|
598
|
+
name: repo.name,
|
|
599
|
+
namespace: repo.resourceName,
|
|
600
|
+
project: repo.projectName,
|
|
601
|
+
},
|
|
602
|
+
},
|
|
603
|
+
])
|
|
604
|
+
: projects.map(project => ({
|
|
605
|
+
project: { namespace: project.resourceName, project: project.name },
|
|
606
|
+
}));
|
|
607
|
+
const providerPullRequests = await flatSettledOrThrow(searchScopes.map(async (scope) => {
|
|
608
|
+
const values = [];
|
|
609
|
+
let page;
|
|
610
|
+
for (let i = 0; i < 20; i++) {
|
|
611
|
+
if (cancellation?.aborted)
|
|
612
|
+
throw new CancellationError();
|
|
613
|
+
const result = await api.getPullRequestsForAzureProject(tokenWithInfo, scope.project, {
|
|
614
|
+
...apiOptions,
|
|
615
|
+
page: page,
|
|
616
|
+
repo: scope.repo,
|
|
617
|
+
states: states,
|
|
618
|
+
});
|
|
619
|
+
if (result == null)
|
|
620
|
+
break;
|
|
621
|
+
values.push(...result.data);
|
|
622
|
+
if (!result.hasMore || result.nextPage == null)
|
|
623
|
+
break;
|
|
624
|
+
page = result.nextPage;
|
|
625
|
+
}
|
|
626
|
+
return values;
|
|
627
|
+
}));
|
|
628
|
+
if (cancellation?.aborted)
|
|
629
|
+
throw new CancellationError();
|
|
630
|
+
return [...new Map(providerPullRequests.map(pr => [pr.url ?? `${pr.repository.id}:${pr.id}`, pr])).values()]
|
|
631
|
+
.filter(pr => providerPullRequestMatchesSearch(pr, searchQuery))
|
|
632
|
+
.map(pr => this.fromAzureProviderPullRequest(pr, repoDescriptors, projects));
|
|
633
|
+
}
|
|
634
|
+
async searchProviderMyIssues(session, repos) {
|
|
635
|
+
return (await this.searchProviderMyIssuesWithTruncation(session, repos))?.values;
|
|
636
|
+
}
|
|
637
|
+
/**
|
|
638
|
+
* Account-wide "my issues" for Azure = the user's authored + assigned work items across every project of
|
|
639
|
+
* every org. Azure's issue read is numbered-page, so each (project × filter) read is drained to exhaustion
|
|
640
|
+
* (bounded by a defensive per-read backstop). Unlike a silent `flatSettled`, a project read that was
|
|
641
|
+
* truncated by the backstop or rejected outright is recorded as `truncated`, so the facade reports an
|
|
642
|
+
* incomplete read instead of publishing a partial list as complete.
|
|
643
|
+
*
|
|
644
|
+
* `searchOptions.org`/`.project` narrow the fan-out server-side (each drain is already a per-project read,
|
|
645
|
+
* so scoping just selects which projects to drain). Without this there was no way to ask for "work items in
|
|
646
|
+
* project P": a consumer had to filter the account-wide page client-side, which desynchronizes the filtered
|
|
647
|
+
* `items` from the `hasMore`/`currentPage` of the pre-filter read — a project-less page reads as "no issues"
|
|
648
|
+
* while `hasMore` is still true.
|
|
649
|
+
*/
|
|
650
|
+
async searchProviderMyIssuesWithTruncation(session, _resources, _cancellation, searchOptions) {
|
|
651
|
+
const api = await this.getProvidersApi();
|
|
652
|
+
const user = await this.getProviderCurrentAccount(session);
|
|
653
|
+
if (user?.username == null)
|
|
654
|
+
return undefined;
|
|
655
|
+
const allOrgs = await this.getProviderResourcesForUser(session);
|
|
656
|
+
if (allOrgs == null)
|
|
657
|
+
return undefined;
|
|
658
|
+
if (allOrgs.length === 0)
|
|
659
|
+
return { values: [], truncated: false };
|
|
660
|
+
// Scope by org first so project discovery only fans out over the requested account. An org filter that
|
|
661
|
+
// matches nothing is an empty-but-successful read, not an unsupported one: returning `undefined` here
|
|
662
|
+
// would be reported as "account-wide issue search is not supported by this provider".
|
|
663
|
+
const orgs = searchOptions?.org != null ? allOrgs.filter(o => azureResourceMatches(o, searchOptions.org)) : allOrgs;
|
|
664
|
+
if (orgs.length === 0)
|
|
665
|
+
return { values: [], truncated: false };
|
|
666
|
+
// Structured per-scope failures from BOTH project discovery (a whole org dropped) and the per-project
|
|
667
|
+
// issue drains, so the facade warns on the failed scope + sets `fetchFailed` instead of narrowing silently.
|
|
668
|
+
const failures = [];
|
|
669
|
+
const discovered = await this.getProviderProjectsForResources(session, orgs, false, failures);
|
|
670
|
+
const projects = searchOptions?.project != null
|
|
671
|
+
? {
|
|
672
|
+
...discovered,
|
|
673
|
+
values: discovered.values.filter(p => azureResourceMatches(p, searchOptions.project)),
|
|
674
|
+
}
|
|
675
|
+
: discovered;
|
|
676
|
+
if (projects.values.length === 0) {
|
|
677
|
+
// An explicitly-scoped read that found no matching project is an empty SUCCESS: `undefined` here is
|
|
678
|
+
// reported as "account-wide issue search is not supported by this provider", which would send the
|
|
679
|
+
// consumer down a repo-scoped fallback for what is simply an empty scope. Only an incomplete discovery
|
|
680
|
+
// (which may itself have dropped the requested project) is truncated, and its metadata is forwarded so
|
|
681
|
+
// the facade still warns on the failed scope.
|
|
682
|
+
return projects.metadata != null
|
|
683
|
+
? {
|
|
684
|
+
values: [],
|
|
685
|
+
truncated: projects.metadata.completeness !== 'complete',
|
|
686
|
+
metadata: projects.metadata,
|
|
687
|
+
}
|
|
688
|
+
: { values: [], truncated: false };
|
|
689
|
+
}
|
|
690
|
+
const { tokenWithInfo, options } = this.getApiOptions(session);
|
|
691
|
+
// Drain one (project × filter) read fully, threading the provider's paging cursor. The scope is passed so
|
|
692
|
+
// a page-level failure preserves the already-drained prefix and records a structured failure instead of
|
|
693
|
+
// re-throwing.
|
|
694
|
+
const drain = async (p, filter) => {
|
|
695
|
+
const result = await collectProviderPagedResult(cursor => api.getIssuesForAzureProject(tokenWithInfo, p.resourceName, p.name, {
|
|
696
|
+
...options,
|
|
697
|
+
...filter,
|
|
698
|
+
cursor: cursor,
|
|
699
|
+
}), 20, { providerId: this.id, resourceId: p.resourceId, projectId: p.name });
|
|
700
|
+
return {
|
|
701
|
+
issues: result.values.map(i => fromProviderIssue(i, this, { project: p })),
|
|
702
|
+
// Azure work-item ids are organization-scoped. Include both org and project so the
|
|
703
|
+
// assigned/authored passes dedupe the same item without collapsing another org's item.
|
|
704
|
+
projectKey: `${p.resourceId}:${p.id}`,
|
|
705
|
+
truncated: result.truncated ?? false,
|
|
706
|
+
metadata: result.metadata,
|
|
707
|
+
};
|
|
708
|
+
};
|
|
709
|
+
// `includeAllAssignees` broadens to every issue in each project (any assignee, any author), so a single
|
|
710
|
+
// unfiltered drain per project replaces the assigned+authored pair — an unfiltered assignee drain already
|
|
711
|
+
// subsumes the authored one.
|
|
712
|
+
//
|
|
713
|
+
// `filters` narrows the other way: unfiltered, "my issues" here is assigned ∪ authored, which is wider than
|
|
714
|
+
// `assignee:@me`. Selecting the drains is the only correct place to narrow — dropping authored-only items
|
|
715
|
+
// from the returned page would leave them counted in the per-project paging that produced it.
|
|
716
|
+
const filters = searchOptions?.filters;
|
|
717
|
+
const wantAssigned = !filters?.length || filters.includes(IssueFilter.Assignee);
|
|
718
|
+
const wantAuthored = !filters?.length || filters.includes(IssueFilter.Author);
|
|
719
|
+
const outcomes = await Promise.all(projects.values.flatMap(p => {
|
|
720
|
+
if (searchOptions?.includeAllAssignees)
|
|
721
|
+
return [drain(p, {})];
|
|
722
|
+
const drains = [];
|
|
723
|
+
if (wantAssigned) {
|
|
724
|
+
drains.push(drain(p, { assigneeLogins: [user.username] }));
|
|
725
|
+
}
|
|
726
|
+
if (wantAuthored) {
|
|
727
|
+
drains.push(drain(p, { authorLogin: user.username }));
|
|
728
|
+
}
|
|
729
|
+
return drains;
|
|
730
|
+
}));
|
|
731
|
+
const issuesById = new Map();
|
|
732
|
+
let truncated = projects.metadata != null && projects.metadata.completeness !== 'complete';
|
|
733
|
+
let drainMetadata;
|
|
734
|
+
for (const outcome of outcomes) {
|
|
735
|
+
if (outcome.truncated) {
|
|
736
|
+
truncated = true;
|
|
737
|
+
}
|
|
738
|
+
if (outcome.metadata != null) {
|
|
739
|
+
drainMetadata = mergeCollectionMetadata(drainMetadata, outcome.metadata);
|
|
740
|
+
}
|
|
741
|
+
for (const issue of outcome.issues) {
|
|
742
|
+
const key = `${outcome.projectKey}:${issue.nodeId ?? issue.id}`;
|
|
743
|
+
if (!issuesById.has(key)) {
|
|
744
|
+
issuesById.set(key, issue);
|
|
745
|
+
}
|
|
746
|
+
}
|
|
747
|
+
}
|
|
748
|
+
const metadata = mergeCollectionMetadata(failures.length > 0 ? { completeness: 'partial', failures: failures } : undefined, mergeCollectionMetadata(drainMetadata, projects.metadata));
|
|
749
|
+
return { values: [...issuesById.values()], truncated: truncated, metadata: metadata };
|
|
750
|
+
}
|
|
751
|
+
async providerOnConnect() {
|
|
752
|
+
if (this._session == null)
|
|
753
|
+
return;
|
|
754
|
+
const canHydrateStoredProjects = (metadata) => metadata == null || metadata.completeness === 'complete';
|
|
755
|
+
const storedAccount = this.ctx.storage.get(`azure:${this._session.accessToken}:account`);
|
|
756
|
+
const storedOrganizations = this.ctx.storage.get(`azure:${this._session.accessToken}:organizations`);
|
|
757
|
+
const storedProjects = this.ctx.storage.get(`azure:${this._session.accessToken}:projects`);
|
|
758
|
+
let account = storedAccount?.data ? { ...storedAccount.data, provider: this } : undefined;
|
|
759
|
+
let organizations = storedOrganizations?.data?.map((o) => ({ ...o }));
|
|
760
|
+
const storedProjectsData = storedProjects?.data;
|
|
761
|
+
let projects;
|
|
762
|
+
if (!Array.isArray(storedProjectsData) && Array.isArray(storedProjectsData?.values)) {
|
|
763
|
+
const hydrated = {
|
|
764
|
+
values: storedProjectsData.values.map((p) => ({ ...p })),
|
|
765
|
+
...(storedProjectsData.metadata != null ? { metadata: storedProjectsData.metadata } : {}),
|
|
766
|
+
};
|
|
767
|
+
if (canHydrateStoredProjects(hydrated.metadata)) {
|
|
768
|
+
projects = hydrated;
|
|
769
|
+
}
|
|
770
|
+
}
|
|
771
|
+
if (storedAccount == null) {
|
|
772
|
+
account = await this.getProviderCurrentAccount(this._session);
|
|
773
|
+
if (account != null) {
|
|
774
|
+
// Clear all other stored organizations and projects and accounts when our session changes
|
|
775
|
+
await this.ctx.storage.deleteWithPrefix('azure');
|
|
776
|
+
await this.ctx.storage.store(`azure:${this._session.accessToken}:account`, {
|
|
777
|
+
v: 1,
|
|
778
|
+
timestamp: Date.now(),
|
|
779
|
+
data: {
|
|
780
|
+
id: account.id,
|
|
781
|
+
name: account.name,
|
|
782
|
+
email: account.email,
|
|
783
|
+
avatarUrl: account.avatarUrl,
|
|
784
|
+
username: account.username,
|
|
785
|
+
},
|
|
786
|
+
});
|
|
787
|
+
}
|
|
788
|
+
}
|
|
789
|
+
this._accounts ??= new Map();
|
|
790
|
+
this._accounts.set(this._session.accessToken, account);
|
|
791
|
+
if (storedOrganizations == null) {
|
|
792
|
+
organizations = await this.getProviderResourcesForUser(this._session, true);
|
|
793
|
+
await this.ctx.storage.store(`azure:${this._session.accessToken}:organizations`, {
|
|
794
|
+
v: 1,
|
|
795
|
+
timestamp: Date.now(),
|
|
796
|
+
data: organizations,
|
|
797
|
+
});
|
|
798
|
+
}
|
|
799
|
+
this._organizations ??= new Map();
|
|
800
|
+
this._organizations.set(this._session.accessToken, organizations);
|
|
801
|
+
if (projects == null && organizations?.length) {
|
|
802
|
+
projects = await this.getProviderProjectsForResources(this._session, organizations);
|
|
803
|
+
if (projects != null && canHydrateStoredProjects(projects.metadata)) {
|
|
804
|
+
await this.ctx.storage.store(`azure:${this._session.accessToken}:projects`, {
|
|
805
|
+
v: 2,
|
|
806
|
+
timestamp: Date.now(),
|
|
807
|
+
data: projects,
|
|
808
|
+
});
|
|
809
|
+
}
|
|
810
|
+
else {
|
|
811
|
+
await this.ctx.storage.delete(`azure:${this._session.accessToken}:projects`);
|
|
812
|
+
}
|
|
813
|
+
}
|
|
814
|
+
this._projects ??= new Map();
|
|
815
|
+
if (projects != null && canHydrateStoredProjects(projects.metadata)) {
|
|
816
|
+
for (const project of projects.values) {
|
|
817
|
+
const projectKey = `${this._session.accessToken}:${project.resourceId}`;
|
|
818
|
+
const projects = this._projects.get(projectKey);
|
|
819
|
+
if (projects == null) {
|
|
820
|
+
this._projects.set(projectKey, [project]);
|
|
821
|
+
}
|
|
822
|
+
else if (!projects.some(p => p.id === project.id)) {
|
|
823
|
+
projects.push(project);
|
|
824
|
+
}
|
|
825
|
+
}
|
|
826
|
+
}
|
|
827
|
+
}
|
|
828
|
+
providerOnDisconnect() {
|
|
829
|
+
this._organizations = undefined;
|
|
830
|
+
this._projects = undefined;
|
|
831
|
+
this._accounts = undefined;
|
|
832
|
+
}
|
|
833
|
+
fromAzureProviderPullRequest(azurePullRequest, repoDescriptors, projectDescriptors) {
|
|
834
|
+
const baseRepoDescriptor = repoDescriptors.find(r => r.id === azurePullRequest.repository.id);
|
|
835
|
+
const headRepoDescriptor = azurePullRequest.headRepository != null
|
|
836
|
+
? repoDescriptors.find(r => r.id === azurePullRequest.headRepository.id)
|
|
837
|
+
: undefined;
|
|
838
|
+
let project;
|
|
839
|
+
if (baseRepoDescriptor != null) {
|
|
840
|
+
azurePullRequest.repository.remoteInfo = {
|
|
841
|
+
...azurePullRequest.repository.remoteInfo,
|
|
842
|
+
cloneUrlHTTPS: baseRepoDescriptor.cloneUrlHttps ?? '',
|
|
843
|
+
cloneUrlSSH: baseRepoDescriptor.cloneUrlSsh ?? '',
|
|
844
|
+
};
|
|
845
|
+
}
|
|
846
|
+
if (headRepoDescriptor != null) {
|
|
847
|
+
azurePullRequest.headRepository = {
|
|
848
|
+
...azurePullRequest.headRepository,
|
|
849
|
+
id: azurePullRequest.headRepository?.id ?? headRepoDescriptor.id,
|
|
850
|
+
name: azurePullRequest.headRepository?.name ?? headRepoDescriptor.name,
|
|
851
|
+
owner: {
|
|
852
|
+
login: azurePullRequest.headRepository?.owner.login ?? headRepoDescriptor.resourceName,
|
|
853
|
+
},
|
|
854
|
+
remoteInfo: {
|
|
855
|
+
...azurePullRequest.headRepository?.remoteInfo,
|
|
856
|
+
cloneUrlHTTPS: headRepoDescriptor.cloneUrlHttps ?? '',
|
|
857
|
+
cloneUrlSSH: headRepoDescriptor.cloneUrlSsh ?? '',
|
|
858
|
+
},
|
|
859
|
+
};
|
|
860
|
+
}
|
|
861
|
+
if (baseRepoDescriptor?.projectName != null) {
|
|
862
|
+
project = projectDescriptors.find(p => p.resourceName === baseRepoDescriptor.resourceName && p.name === baseRepoDescriptor.projectName);
|
|
863
|
+
}
|
|
864
|
+
return fromProviderPullRequest(azurePullRequest, this, { project: project });
|
|
865
|
+
}
|
|
866
|
+
}
|
|
867
|
+
const cloudMetadata = providersMetadata[GitCloudHostIntegrationId.AzureDevOps];
|
|
868
|
+
const cloudAuthProvider = Object.freeze({ id: cloudMetadata.id, scopes: cloudMetadata.scopes });
|
|
869
|
+
export class AzureDevOpsIntegration extends AzureDevOpsIntegrationBase {
|
|
870
|
+
authProvider = cloudAuthProvider;
|
|
871
|
+
id = GitCloudHostIntegrationId.AzureDevOps;
|
|
872
|
+
key = this.id;
|
|
873
|
+
name = 'Azure DevOps';
|
|
874
|
+
get domain() {
|
|
875
|
+
return cloudMetadata.domain;
|
|
876
|
+
}
|
|
877
|
+
get apiBaseUrl() {
|
|
878
|
+
return 'https://dev.azure.com';
|
|
879
|
+
}
|
|
880
|
+
}
|
|
881
|
+
const serverMetadata = providersMetadata[GitSelfManagedHostIntegrationId.AzureDevOpsServer];
|
|
882
|
+
const serverAuthProvider = Object.freeze({ id: serverMetadata.id, scopes: serverMetadata.scopes });
|
|
883
|
+
export class AzureDevOpsServerIntegration extends AzureDevOpsIntegrationBase {
|
|
884
|
+
domain;
|
|
885
|
+
authProvider = serverAuthProvider;
|
|
886
|
+
id = GitSelfManagedHostIntegrationId.AzureDevOpsServer;
|
|
887
|
+
key;
|
|
888
|
+
name = 'Azure DevOps Server';
|
|
889
|
+
constructor(ctx, authenticationService, getProvidersApi, didChangeConnection, domain) {
|
|
890
|
+
super(ctx, authenticationService, getProvidersApi, didChangeConnection);
|
|
891
|
+
this.domain = domain;
|
|
892
|
+
this.key = `${this.id}:${this.domain}`;
|
|
893
|
+
}
|
|
894
|
+
get apiBaseUrl() {
|
|
895
|
+
const protocol = this._session?.protocol ?? 'https:';
|
|
896
|
+
return `${protocol}//${this.domain}`;
|
|
897
|
+
}
|
|
898
|
+
getApiOptions(session, doNotConvertToPat = false) {
|
|
899
|
+
const { options, ...rest } = super.getApiOptions(session, doNotConvertToPat);
|
|
900
|
+
return {
|
|
901
|
+
...rest,
|
|
902
|
+
options: { ...options, baseUrl: this.apiBaseUrl },
|
|
903
|
+
};
|
|
904
|
+
}
|
|
905
|
+
async _requestForCurrentUser(session) {
|
|
906
|
+
const azure = await this.authenticationService.apis.azure;
|
|
907
|
+
const user = azure
|
|
908
|
+
? await azure.getCurrentUserOnServer(this, toTokenWithInfo(this.id, session), this.apiBaseUrl)
|
|
909
|
+
: undefined;
|
|
910
|
+
return user
|
|
911
|
+
? {
|
|
912
|
+
provider: this,
|
|
913
|
+
id: user.id,
|
|
914
|
+
name: user.name ?? undefined,
|
|
915
|
+
email: user.email ?? undefined,
|
|
916
|
+
avatarUrl: user.avatarUrl ?? undefined,
|
|
917
|
+
username: user.username ?? undefined,
|
|
918
|
+
}
|
|
919
|
+
: undefined;
|
|
920
|
+
}
|
|
921
|
+
}
|
|
922
|
+
export function convertTokentoPAT(accessToken) {
|
|
923
|
+
return base64(`PAT:${accessToken}`);
|
|
924
|
+
}
|
|
925
|
+
//# sourceMappingURL=azureDevOps.js.map
|