@gitkraken/core-gitlens 0.5.116 → 0.7.0
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 +32 -1
- package/README.md +9 -2
- package/dist/_virtual/@oxc-project+runtime/helpers/esm/decorate.js +9 -0
- package/dist/_virtual/@oxc-project+runtime/helpers/esm/usingCtx.js +57 -0
- package/dist/git/cache.d.ts +297 -297
- package/dist/git/cache.js +948 -1276
- package/dist/git/cache.js.map +1 -1
- package/dist/git/context.d.ts +202 -197
- package/dist/git/context.js +12 -8
- package/dist/git/context.js.map +1 -1
- package/dist/git/errors.d.ts +268 -281
- package/dist/git/errors.js +928 -706
- package/dist/git/errors.js.map +1 -1
- package/dist/git/features.d.ts +3 -2
- package/dist/git/features.js +34 -55
- package/dist/git/features.js.map +1 -1
- package/dist/git/gitHealth.d.ts +88 -81
- package/dist/git/gitHealth.js +259 -329
- package/dist/git/gitHealth.js.map +1 -1
- package/dist/git/models/author.d.ts +12 -10
- package/dist/git/models/author.js +0 -2
- package/dist/git/models/autolink.d.ts +36 -37
- package/dist/git/models/autolink.js +0 -2
- package/dist/git/models/blame.d.ts +25 -23
- package/dist/git/models/blame.js +0 -2
- package/dist/git/models/branch.d.ts +74 -72
- package/dist/git/models/branch.js +132 -171
- package/dist/git/models/branch.js.map +1 -1
- package/dist/git/models/commit.d.ts +135 -133
- package/dist/git/models/commit.js +381 -484
- package/dist/git/models/commit.js.map +1 -1
- package/dist/git/models/contributor.d.ts +30 -29
- package/dist/git/models/contributor.js +56 -64
- package/dist/git/models/contributor.js.map +1 -1
- package/dist/git/models/defaultBranch.d.ts +5 -3
- package/dist/git/models/defaultBranch.js +0 -2
- package/dist/git/models/diff.d.ts +49 -47
- package/dist/git/models/diff.js +0 -2
- package/dist/git/models/file.d.ts +20 -18
- package/dist/git/models/file.js +0 -2
- package/dist/git/models/fileChange.d.ts +45 -43
- package/dist/git/models/fileChange.js +60 -66
- package/dist/git/models/fileChange.js.map +1 -1
- package/dist/git/models/fileStatus.d.ts +25 -23
- package/dist/git/models/fileStatus.js +30 -26
- package/dist/git/models/fileStatus.js.map +1 -1
- package/dist/git/models/graph.d.ts +328 -320
- package/dist/git/models/graph.js +31 -27
- package/dist/git/models/graph.js.map +1 -1
- package/dist/git/models/graphSearch.d.ts +37 -35
- package/dist/git/models/graphSearch.js +0 -2
- package/dist/git/models/graphSession.d.ts +158 -66
- package/dist/git/models/graphSession.js +72 -1
- package/dist/git/models/graphSession.js.map +1 -1
- package/dist/git/models/issue.d.ts +174 -140
- package/dist/git/models/issue.js +86 -84
- package/dist/git/models/issue.js.map +1 -1
- package/dist/git/models/issueOrPullRequest.d.ts +16 -14
- package/dist/git/models/issueOrPullRequest.js +0 -2
- package/dist/git/models/lineRange.d.ts +6 -4
- package/dist/git/models/lineRange.js +0 -2
- package/dist/git/models/log.d.ts +18 -16
- package/dist/git/models/log.js +0 -2
- package/dist/git/models/mergeConflicts.d.ts +17 -15
- package/dist/git/models/mergeConflicts.js +0 -2
- package/dist/git/models/patch.d.ts +14 -12
- package/dist/git/models/patch.js +0 -2
- package/dist/git/models/pausedOperationStatus.d.ts +42 -40
- package/dist/git/models/pausedOperationStatus.js +0 -2
- package/dist/git/models/pullRequest.d.ts +238 -230
- package/dist/git/models/pullRequest.js +151 -163
- package/dist/git/models/pullRequest.js.map +1 -1
- package/dist/git/models/rebase.d.ts +30 -28
- package/dist/git/models/rebase.js +0 -2
- package/dist/git/models/reference.d.ts +57 -55
- package/dist/git/models/reference.js +0 -2
- package/dist/git/models/reflog.d.ts +29 -27
- package/dist/git/models/reflog.js +63 -82
- package/dist/git/models/reflog.js.map +1 -1
- package/dist/git/models/remote.d.ts +34 -32
- package/dist/git/models/remote.js +74 -95
- package/dist/git/models/remote.js.map +1 -1
- package/dist/git/models/remoteProvider.d.ts +86 -84
- package/dist/git/models/remoteProvider.js +145 -150
- package/dist/git/models/remoteProvider.js.map +1 -1
- package/dist/git/models/remoteResource.d.ts +58 -56
- package/dist/git/models/remoteResource.js +15 -12
- package/dist/git/models/remoteResource.js.map +1 -1
- package/dist/git/models/repository.d.ts +144 -142
- package/dist/git/models/repository.js +358 -406
- package/dist/git/models/repository.js.map +1 -1
- package/dist/git/models/repositoryChangeEvent.d.ts +8 -6
- package/dist/git/models/repositoryChangeEvent.js +26 -24
- package/dist/git/models/repositoryChangeEvent.js.map +1 -1
- package/dist/git/models/repositoryIdentities.d.ts +50 -46
- package/dist/git/models/repositoryIdentities.js +7 -5
- package/dist/git/models/repositoryIdentities.js.map +1 -1
- package/dist/git/models/repositoryMetadata.d.ts +9 -7
- package/dist/git/models/repositoryMetadata.js +0 -2
- package/dist/git/models/resourceDescriptor.d.ts +11 -9
- package/dist/git/models/resourceDescriptor.js +0 -2
- package/dist/git/models/revision.d.ts +2 -0
- package/dist/git/models/revision.js +8 -5
- package/dist/git/models/revision.js.map +1 -1
- package/dist/git/models/search.d.ts +48 -47
- package/dist/git/models/search.js +53 -49
- package/dist/git/models/search.js.map +1 -1
- package/dist/git/models/shortlog.d.ts +5 -3
- package/dist/git/models/shortlog.js +0 -2
- package/dist/git/models/signature.d.ts +28 -26
- package/dist/git/models/signature.js +0 -2
- package/dist/git/models/staging.d.ts +18 -16
- package/dist/git/models/staging.js +0 -2
- package/dist/git/models/stash.d.ts +5 -3
- package/dist/git/models/stash.js +0 -2
- package/dist/git/models/status.d.ts +51 -49
- package/dist/git/models/status.js +172 -205
- package/dist/git/models/status.js.map +1 -1
- package/dist/git/models/statusFile.d.ts +35 -34
- package/dist/git/models/statusFile.js +112 -125
- package/dist/git/models/statusFile.js.map +1 -1
- package/dist/git/models/tag.d.ts +34 -32
- package/dist/git/models/tag.js +64 -77
- package/dist/git/models/tag.js.map +1 -1
- package/dist/git/models/tree.d.ts +8 -6
- package/dist/git/models/tree.js +0 -2
- package/dist/git/models/user.d.ts +6 -4
- package/dist/git/models/user.js +0 -2
- package/dist/git/models/worktree.d.ts +50 -48
- package/dist/git/models/worktree.js +102 -133
- package/dist/git/models/worktree.js.map +1 -1
- package/dist/git/parsers/diffParser.d.ts +7 -5
- package/dist/git/parsers/diffParser.js +438 -587
- package/dist/git/parsers/diffParser.js.map +1 -1
- package/dist/git/parsers/rebaseTodoParser.d.ts +3 -1
- package/dist/git/parsers/rebaseTodoParser.js +165 -208
- package/dist/git/parsers/rebaseTodoParser.js.map +1 -1
- package/dist/git/providers/blame.d.ts +12 -10
- package/dist/git/providers/blame.js +0 -2
- package/dist/git/providers/branches.d.ts +96 -94
- package/dist/git/providers/branches.js +0 -2
- package/dist/git/providers/commits.d.ts +105 -104
- package/dist/git/providers/commits.js +0 -2
- package/dist/git/providers/config.d.ts +80 -78
- package/dist/git/providers/config.js +0 -2
- package/dist/git/providers/contributors.d.ts +23 -21
- package/dist/git/providers/contributors.js +0 -2
- package/dist/git/providers/diff.d.ts +68 -66
- package/dist/git/providers/diff.js +0 -2
- package/dist/git/providers/graph.d.ts +73 -62
- package/dist/git/providers/graph.js +0 -2
- package/dist/git/providers/maintenance.d.ts +180 -178
- package/dist/git/providers/maintenance.js +0 -20
- package/dist/git/providers/operations.d.ts +114 -112
- package/dist/git/providers/operations.js +0 -2
- package/dist/git/providers/patch.d.ts +26 -24
- package/dist/git/providers/patch.js +0 -2
- package/dist/git/providers/pausedOperations.d.ts +19 -17
- package/dist/git/providers/pausedOperations.js +0 -2
- package/dist/git/providers/provider.d.ts +52 -50
- package/dist/git/providers/provider.js +0 -2
- package/dist/git/providers/refs.d.ts +42 -40
- package/dist/git/providers/refs.js +0 -2
- package/dist/git/providers/remotes.d.ts +24 -22
- package/dist/git/providers/remotes.js +0 -2
- package/dist/git/providers/revision.d.ts +25 -23
- package/dist/git/providers/revision.js +0 -2
- package/dist/git/providers/shared/remotes.d.ts +24 -22
- package/dist/git/providers/shared/remotes.js +52 -77
- package/dist/git/providers/shared/remotes.js.map +1 -1
- package/dist/git/providers/staging.d.ts +37 -35
- package/dist/git/providers/staging.js +0 -2
- package/dist/git/providers/stash.d.ts +38 -36
- package/dist/git/providers/stash.js +0 -2
- package/dist/git/providers/status.d.ts +32 -30
- package/dist/git/providers/status.js +0 -2
- package/dist/git/providers/tags.d.ts +20 -18
- package/dist/git/providers/tags.js +0 -2
- package/dist/git/providers/types.d.ts +19 -17
- package/dist/git/providers/types.js +0 -2
- package/dist/git/providers/worktrees.d.ts +26 -24
- package/dist/git/providers/worktrees.js +0 -2
- package/dist/git/remotes/azure-devops.d.ts +49 -38
- package/dist/git/remotes/azure-devops.js +254 -224
- package/dist/git/remotes/azure-devops.js.map +1 -1
- package/dist/git/remotes/bitbucket-server.d.ts +30 -29
- package/dist/git/remotes/bitbucket-server.js +141 -142
- package/dist/git/remotes/bitbucket-server.js.map +1 -1
- package/dist/git/remotes/bitbucket.d.ts +27 -26
- package/dist/git/remotes/bitbucket.js +114 -111
- package/dist/git/remotes/bitbucket.js.map +1 -1
- package/dist/git/remotes/custom.d.ts +26 -25
- package/dist/git/remotes/custom.js +130 -130
- package/dist/git/remotes/custom.js.map +1 -1
- package/dist/git/remotes/gerrit.d.ts +29 -28
- package/dist/git/remotes/gerrit.js +140 -143
- package/dist/git/remotes/gerrit.js.map +1 -1
- package/dist/git/remotes/gitea.d.ts +28 -27
- package/dist/git/remotes/gitea.js +141 -145
- package/dist/git/remotes/gitea.js.map +1 -1
- package/dist/git/remotes/github.d.ts +35 -34
- package/dist/git/remotes/github.js +196 -190
- package/dist/git/remotes/github.js.map +1 -1
- package/dist/git/remotes/gitlab.d.ts +31 -30
- package/dist/git/remotes/gitlab.js +245 -227
- package/dist/git/remotes/gitlab.js.map +1 -1
- package/dist/git/remotes/google-source.d.ts +16 -14
- package/dist/git/remotes/google-source.js +33 -31
- package/dist/git/remotes/google-source.js.map +1 -1
- package/dist/git/remotes/matcher.d.ts +16 -14
- package/dist/git/remotes/matcher.js +141 -124
- package/dist/git/remotes/matcher.js.map +1 -1
- package/dist/git/repositoryService.d.ts +47 -47
- package/dist/git/repositoryService.js +47 -44
- package/dist/git/repositoryService.js.map +1 -1
- package/dist/git/run.types.d.ts +91 -76
- package/dist/git/run.types.js +0 -2
- package/dist/git/service.d.ts +73 -71
- package/dist/git/service.js +286 -302
- package/dist/git/service.js.map +1 -1
- package/dist/git/utils/autolink.utils.d.ts +4 -2
- package/dist/git/utils/autolink.utils.js +103 -139
- package/dist/git/utils/autolink.utils.js.map +1 -1
- package/dist/git/utils/blame.utils.d.ts +22 -20
- package/dist/git/utils/blame.utils.js +196 -230
- package/dist/git/utils/blame.utils.js.map +1 -1
- package/dist/git/utils/branch.utils.d.ts +7 -9
- package/dist/git/utils/branch.utils.js +89 -115
- package/dist/git/utils/branch.utils.js.map +1 -1
- package/dist/git/utils/commit.utils.d.ts +10 -16
- package/dist/git/utils/commit.utils.js +28 -47
- package/dist/git/utils/commit.utils.js.map +1 -1
- package/dist/git/utils/config.utils.d.ts +2 -0
- package/dist/git/utils/config.utils.js +14 -5
- package/dist/git/utils/config.utils.js.map +1 -1
- package/dist/git/utils/conflictResolution.utils.d.ts +16 -13
- package/dist/git/utils/conflictResolution.utils.js +116 -113
- package/dist/git/utils/conflictResolution.utils.js.map +1 -1
- package/dist/git/utils/contributor.utils.d.ts +10 -8
- package/dist/git/utils/contributor.utils.js +47 -69
- package/dist/git/utils/contributor.utils.js.map +1 -1
- package/dist/git/utils/fetch.utils.d.ts +2 -0
- package/dist/git/utils/fetch.utils.js +33 -44
- package/dist/git/utils/fetch.utils.js.map +1 -1
- package/dist/git/utils/fileStatus.utils.d.ts +22 -21
- package/dist/git/utils/fileStatus.utils.js +59 -45
- package/dist/git/utils/fileStatus.utils.js.map +1 -1
- package/dist/git/utils/graph.utils.d.ts +19 -1
- package/dist/git/utils/graph.utils.js +60 -35
- package/dist/git/utils/graph.utils.js.map +1 -1
- package/dist/git/utils/issue.utils.d.ts +3 -1
- package/dist/git/utils/issue.utils.js +154 -149
- package/dist/git/utils/issue.utils.js.map +1 -1
- package/dist/git/utils/issueOrPullRequest.utils.d.ts +3 -1
- package/dist/git/utils/issueOrPullRequest.utils.js +23 -20
- package/dist/git/utils/issueOrPullRequest.utils.js.map +1 -1
- package/dist/git/utils/mergeConflicts.utils.d.ts +4 -1
- package/dist/git/utils/mergeConflicts.utils.js +28 -15
- package/dist/git/utils/mergeConflicts.utils.js.map +1 -1
- package/dist/git/utils/pausedOperationStatus.utils.d.ts +7 -42
- package/dist/git/utils/pausedOperationStatus.utils.js +83 -146
- package/dist/git/utils/pausedOperationStatus.utils.js.map +1 -1
- package/dist/git/utils/pullRequest.utils.d.ts +7 -5
- package/dist/git/utils/pullRequest.utils.js +180 -187
- package/dist/git/utils/pullRequest.utils.js.map +1 -1
- package/dist/git/utils/reachability.utils.d.ts +6 -6
- package/dist/git/utils/reachability.utils.js +120 -147
- package/dist/git/utils/reachability.utils.js.map +1 -1
- package/dist/git/utils/rebase.utils.d.ts +3 -1
- package/dist/git/utils/rebase.utils.js +87 -71
- package/dist/git/utils/rebase.utils.js.map +1 -1
- package/dist/git/utils/reference.utils.d.ts +33 -32
- package/dist/git/utils/reference.utils.js +152 -179
- package/dist/git/utils/reference.utils.js.map +1 -1
- package/dist/git/utils/remote.utils.d.ts +5 -3
- package/dist/git/utils/remote.utils.js +77 -116
- package/dist/git/utils/remote.utils.js.map +1 -1
- package/dist/git/utils/repository.utils.d.ts +3 -1
- package/dist/git/utils/repository.utils.js +12 -11
- package/dist/git/utils/repository.utils.js.map +1 -1
- package/dist/git/utils/resourceDescriptor.utils.d.ts +3 -1
- package/dist/git/utils/resourceDescriptor.utils.js +8 -14
- package/dist/git/utils/resourceDescriptor.utils.js.map +1 -1
- package/dist/git/utils/revision.utils.d.ts +11 -10
- package/dist/git/utils/revision.utils.js +69 -83
- package/dist/git/utils/revision.utils.js.map +1 -1
- package/dist/git/utils/search.utils.d.ts +5 -3
- package/dist/git/utils/search.utils.js +383 -522
- package/dist/git/utils/search.utils.js.map +1 -1
- package/dist/git/utils/sorting.d.ts +22 -20
- package/dist/git/utils/sorting.js +133 -227
- package/dist/git/utils/sorting.js.map +1 -1
- package/dist/git/utils/sshKey.utils.d.ts +2 -0
- package/dist/git/utils/sshKey.utils.js +10 -15
- package/dist/git/utils/sshKey.utils.js.map +1 -1
- package/dist/git/utils/status.utils.d.ts +20 -15
- package/dist/git/utils/status.utils.js +93 -79
- package/dist/git/utils/status.utils.js.map +1 -1
- package/dist/git/utils/statusFile.utils.d.ts +6 -4
- package/dist/git/utils/statusFile.utils.js +71 -72
- package/dist/git/utils/statusFile.utils.js.map +1 -1
- package/dist/git/utils/tag.utils.d.ts +4 -2
- package/dist/git/utils/tag.utils.js +10 -8
- package/dist/git/utils/tag.utils.js.map +1 -1
- package/dist/git/utils/tooltip.utils.d.ts +5 -2
- package/dist/git/utils/tooltip.utils.js +49 -24
- package/dist/git/utils/tooltip.utils.js.map +1 -1
- package/dist/git/utils/uriAuthority.d.ts +9 -7
- package/dist/git/utils/uriAuthority.js +19 -16
- package/dist/git/utils/uriAuthority.js.map +1 -1
- package/dist/git/utils/user.utils.d.ts +3 -1
- package/dist/git/utils/user.utils.js +6 -10
- package/dist/git/utils/user.utils.js.map +1 -1
- package/dist/git/utils/worktree.utils.d.ts +5 -3
- package/dist/git/utils/worktree.utils.js +14 -12
- package/dist/git/utils/worktree.utils.js.map +1 -1
- package/dist/git/watching/changeEvent.d.ts +38 -36
- package/dist/git/watching/changeEvent.js +60 -67
- package/dist/git/watching/changeEvent.js.map +1 -1
- package/dist/git/watching/classifyChange.d.ts +3 -1
- package/dist/git/watching/classifyChange.js +50 -79
- package/dist/git/watching/classifyChange.js.map +1 -1
- package/dist/git/watching/gitIgnoreFilter.d.ts +43 -41
- package/dist/git/watching/gitIgnoreFilter.js +92 -107
- package/dist/git/watching/gitIgnoreFilter.js.map +1 -1
- package/dist/git/watching/initWatcher.d.ts +22 -20
- package/dist/git/watching/initWatcher.js +58 -57
- package/dist/git/watching/initWatcher.js.map +1 -1
- package/dist/git/watching/provider.d.ts +8 -7
- package/dist/git/watching/provider.js +0 -2
- package/dist/git/watching/watchGroup.d.ts +29 -28
- package/dist/git/watching/watchGroup.js +105 -137
- package/dist/git/watching/watchGroup.js.map +1 -1
- package/dist/git/watching/watchService.d.ts +70 -68
- package/dist/git/watching/watchService.js +275 -339
- package/dist/git/watching/watchService.js.map +1 -1
- package/dist/git/watching/watchSession.d.ts +112 -111
- package/dist/git/watching/watchSession.js +260 -314
- package/dist/git/watching/watchSession.js.map +1 -1
- package/dist/git/watching/watcherPatterns.d.ts +4 -2
- package/dist/git/watching/watcherPatterns.js +21 -24
- package/dist/git/watching/watcherPatterns.js.map +1 -1
- package/dist/git-cli/cliGitProvider.d.ts +117 -114
- package/dist/git-cli/cliGitProvider.js +261 -283
- package/dist/git-cli/cliGitProvider.js.map +1 -1
- package/dist/git-cli/exec/eventLoopMonitor.d.ts +26 -0
- package/dist/git-cli/exec/eventLoopMonitor.js +61 -0
- package/dist/git-cli/exec/eventLoopMonitor.js.map +1 -0
- package/dist/git-cli/exec/exec.d.ts +3 -4
- package/dist/git-cli/exec/exec.errors.d.ts +2 -2
- package/dist/git-cli/exec/exec.errors.js +2 -2
- package/dist/git-cli/exec/exec.js +3 -3
- package/dist/git-cli/exec/exec.types.d.ts +2 -2
- package/dist/git-cli/exec/exec.types.js +0 -2
- package/dist/git-cli/exec/features.d.ts +2 -3
- package/dist/git-cli/exec/features.js +2 -2
- package/dist/git-cli/exec/git.d.ts +224 -205
- package/dist/git-cli/exec/git.js +834 -1042
- package/dist/git-cli/exec/git.js.map +1 -1
- package/dist/git-cli/exec/gitQueue.d.ts +51 -48
- package/dist/git-cli/exec/gitQueue.js +225 -260
- package/dist/git-cli/exec/gitQueue.js.map +1 -1
- package/dist/git-cli/exec/locator.d.ts +8 -6
- package/dist/git-cli/exec/locator.js +95 -121
- package/dist/git-cli/exec/locator.js.map +1 -1
- package/dist/git-cli/parsers/blameParser.d.ts +22 -20
- package/dist/git-cli/parsers/blameParser.js +238 -332
- package/dist/git-cli/parsers/blameParser.js.map +1 -1
- package/dist/git-cli/parsers/indexParser.d.ts +3 -1
- package/dist/git-cli/parsers/indexParser.js +146 -221
- package/dist/git-cli/parsers/indexParser.js.map +1 -1
- package/dist/git-cli/parsers/logParser.d.ts +103 -110
- package/dist/git-cli/parsers/logParser.js +998 -1199
- package/dist/git-cli/parsers/logParser.js.map +1 -1
- package/dist/git-cli/parsers/mergeTreeParser.d.ts +5 -3
- package/dist/git-cli/parsers/mergeTreeParser.js +28 -72
- package/dist/git-cli/parsers/mergeTreeParser.js.map +1 -1
- package/dist/git-cli/parsers/refParser.d.ts +5 -4
- package/dist/git-cli/parsers/refParser.js +92 -137
- package/dist/git-cli/parsers/refParser.js.map +1 -1
- package/dist/git-cli/parsers/reflogParser.d.ts +7 -6
- package/dist/git-cli/parsers/reflogParser.js +100 -173
- package/dist/git-cli/parsers/reflogParser.js.map +1 -1
- package/dist/git-cli/parsers/remoteParser.d.ts +4 -2
- package/dist/git-cli/parsers/remoteParser.js +74 -126
- package/dist/git-cli/parsers/remoteParser.js.map +1 -1
- package/dist/git-cli/parsers/shortlogParser.d.ts +4 -2
- package/dist/git-cli/parsers/shortlogParser.js +44 -49
- package/dist/git-cli/parsers/shortlogParser.js.map +1 -1
- package/dist/git-cli/parsers/signatureParser.d.ts +3 -1
- package/dist/git-cli/parsers/signatureParser.js +82 -124
- package/dist/git-cli/parsers/signatureParser.js.map +1 -1
- package/dist/git-cli/parsers/sshSignatureParser.d.ts +5 -3
- package/dist/git-cli/parsers/sshSignatureParser.js +55 -64
- package/dist/git-cli/parsers/sshSignatureParser.js.map +1 -1
- package/dist/git-cli/parsers/statusParser.d.ts +4 -2
- package/dist/git-cli/parsers/statusParser.js +148 -205
- package/dist/git-cli/parsers/statusParser.js.map +1 -1
- package/dist/git-cli/parsers/treeParser.d.ts +3 -1
- package/dist/git-cli/parsers/treeParser.js +57 -108
- package/dist/git-cli/parsers/treeParser.js.map +1 -1
- package/dist/git-cli/parsers/worktreeParser.d.ts +4 -3
- package/dist/git-cli/parsers/worktreeParser.js +76 -132
- package/dist/git-cli/parsers/worktreeParser.js.map +1 -1
- package/dist/git-cli/providers/blame.d.ts +25 -23
- package/dist/git-cli/providers/blame.js +404 -413
- package/dist/git-cli/providers/blame.js.map +1 -1
- package/dist/git-cli/providers/branches.d.ts +117 -116
- package/dist/git-cli/providers/branches.js +1132 -1468
- package/dist/git-cli/providers/branches.js.map +1 -1
- package/dist/git-cli/providers/commitFilesetUtils.d.ts +4 -2
- package/dist/git-cli/providers/commitFilesetUtils.js +36 -18
- package/dist/git-cli/providers/commitFilesetUtils.js.map +1 -1
- package/dist/git-cli/providers/commits.d.ts +58 -56
- package/dist/git-cli/providers/commits.js +1084 -1423
- package/dist/git-cli/providers/commits.js.map +1 -1
- package/dist/git-cli/providers/config.d.ts +129 -127
- package/dist/git-cli/providers/config.js +612 -831
- package/dist/git-cli/providers/config.js.map +1 -1
- package/dist/git-cli/providers/contributors.d.ts +29 -28
- package/dist/git-cli/providers/contributors.js +246 -351
- package/dist/git-cli/providers/contributors.js.map +1 -1
- package/dist/git-cli/providers/diff.d.ts +97 -94
- package/dist/git-cli/providers/diff.js +638 -845
- package/dist/git-cli/providers/diff.js.map +1 -1
- package/dist/git-cli/providers/graph.d.ts +66 -68
- package/dist/git-cli/providers/graph.js +1400 -1848
- package/dist/git-cli/providers/graph.js.map +1 -1
- package/dist/git-cli/providers/maintenance.d.ts +305 -303
- package/dist/git-cli/providers/maintenance.js +1526 -2078
- package/dist/git-cli/providers/maintenance.js.map +1 -1
- package/dist/git-cli/providers/operations.d.ts +96 -94
- package/dist/git-cli/providers/operations.js +664 -724
- package/dist/git-cli/providers/operations.js.map +1 -1
- package/dist/git-cli/providers/patch.d.ts +37 -35
- package/dist/git-cli/providers/patch.js +206 -307
- package/dist/git-cli/providers/patch.js.map +1 -1
- package/dist/git-cli/providers/pausedOperations.d.ts +30 -28
- package/dist/git-cli/providers/pausedOperations.js +475 -506
- package/dist/git-cli/providers/pausedOperations.js.map +1 -1
- package/dist/git-cli/providers/refs.d.ts +50 -48
- package/dist/git-cli/providers/refs.js +335 -479
- package/dist/git-cli/providers/refs.js.map +1 -1
- package/dist/git-cli/providers/remotes.d.ts +23 -21
- package/dist/git-cli/providers/remotes.js +71 -92
- package/dist/git-cli/providers/remotes.js.map +1 -1
- package/dist/git-cli/providers/revision.d.ts +27 -25
- package/dist/git-cli/providers/revision.js +288 -304
- package/dist/git-cli/providers/revision.js.map +1 -1
- package/dist/git-cli/providers/staging.d.ts +31 -29
- package/dist/git-cli/providers/staging.js +140 -189
- package/dist/git-cli/providers/staging.js.map +1 -1
- package/dist/git-cli/providers/stash.d.ts +44 -42
- package/dist/git-cli/providers/stash.js +288 -387
- package/dist/git-cli/providers/stash.js.map +1 -1
- package/dist/git-cli/providers/status.d.ts +61 -59
- package/dist/git-cli/providers/status.js +332 -453
- package/dist/git-cli/providers/status.js.map +1 -1
- package/dist/git-cli/providers/tags.d.ts +31 -29
- package/dist/git-cli/providers/tags.js +158 -215
- package/dist/git-cli/providers/tags.js.map +1 -1
- package/dist/git-cli/providers/worktrees.d.ts +35 -33
- package/dist/git-cli/providers/worktrees.js +178 -203
- package/dist/git-cli/providers/worktrees.js.map +1 -1
- package/dist/git-cli/service.d.ts +28 -26
- package/dist/git-cli/service.js +38 -40
- package/dist/git-cli/service.js.map +1 -1
- package/dist/ipc/discovery.d.ts +19 -17
- package/dist/ipc/discovery.js +104 -128
- package/dist/ipc/discovery.js.map +1 -1
- package/dist/ipc/ipcServer.d.ts +16 -14
- package/dist/ipc/ipcServer.js +139 -160
- package/dist/ipc/ipcServer.js.map +1 -1
- package/dist/plus/agents/agentCapabilities.d.ts +50 -37
- package/dist/plus/agents/agentCapabilities.js +138 -173
- package/dist/plus/agents/agentCapabilities.js.map +1 -1
- package/dist/plus/agents/providers/claudeCodeTranscript.d.ts +153 -151
- package/dist/plus/agents/providers/claudeCodeTranscript.js +605 -679
- package/dist/plus/agents/providers/claudeCodeTranscript.js.map +1 -1
- package/dist/plus/agents/providers/gkAgentProvider.d.ts +237 -240
- package/dist/plus/agents/providers/gkAgentProvider.js +2162 -3334
- package/dist/plus/agents/providers/gkAgentProvider.js.map +1 -1
- package/dist/plus/agents/sanitizePrompt.d.ts +2 -0
- package/dist/plus/agents/sanitizePrompt.js +58 -91
- package/dist/plus/agents/sanitizePrompt.js.map +1 -1
- package/dist/plus/agents/stateMachine.d.ts +7 -5
- package/dist/plus/agents/stateMachine.js +135 -163
- package/dist/plus/agents/stateMachine.js.map +1 -1
- package/dist/plus/agents/types.d.ts +333 -336
- package/dist/plus/agents/types.js +48 -48
- package/dist/plus/agents/types.js.map +1 -1
- package/dist/plus/ai/constants.d.ts +3 -1
- package/dist/plus/ai/constants.js +88 -84
- package/dist/plus/ai/constants.js.map +1 -1
- package/dist/plus/ai/errors.d.ts +22 -18
- package/dist/plus/ai/errors.js +158 -138
- package/dist/plus/ai/errors.js.map +1 -1
- package/dist/plus/ai/models/conversation.d.ts +11 -9
- package/dist/plus/ai/models/conversation.js +30 -26
- package/dist/plus/ai/models/conversation.js.map +1 -1
- package/dist/plus/ai/models/model.d.ts +29 -27
- package/dist/plus/ai/models/model.js +663 -471
- package/dist/plus/ai/models/model.js.map +1 -1
- package/dist/plus/ai/models/promptTemplates.d.ts +56 -55
- package/dist/plus/ai/models/promptTemplates.js +0 -2
- package/dist/plus/ai/models/provider.d.ts +79 -77
- package/dist/plus/ai/models/provider.js +0 -2
- package/dist/plus/ai/models/results.d.ts +27 -21
- package/dist/plus/ai/models/results.js +0 -2
- package/dist/plus/ai/prompts.d.ts +4 -2
- package/dist/plus/ai/prompts.js +301 -190
- package/dist/plus/ai/prompts.js.map +1 -1
- package/dist/plus/ai/providers/anthropicProvider.d.ts +33 -32
- package/dist/plus/ai/providers/anthropicProvider.js +484 -381
- package/dist/plus/ai/providers/anthropicProvider.js.map +1 -1
- package/dist/plus/ai/providers/azureProvider.d.ts +18 -16
- package/dist/plus/ai/providers/azureProvider.js +53 -53
- package/dist/plus/ai/providers/azureProvider.js.map +1 -1
- package/dist/plus/ai/providers/context.d.ts +23 -20
- package/dist/plus/ai/providers/context.js +0 -2
- package/dist/plus/ai/providers/deepSeekProvider.d.ts +17 -15
- package/dist/plus/ai/providers/deepSeekProvider.js +45 -39
- package/dist/plus/ai/providers/deepSeekProvider.js.map +1 -1
- package/dist/plus/ai/providers/geminiProvider.d.ts +16 -14
- package/dist/plus/ai/providers/geminiProvider.js +316 -230
- package/dist/plus/ai/providers/geminiProvider.js.map +1 -1
- package/dist/plus/ai/providers/gitkrakenProvider.d.ts +22 -20
- package/dist/plus/ai/providers/gitkrakenProvider.js +165 -260
- package/dist/plus/ai/providers/gitkrakenProvider.js.map +1 -1
- package/dist/plus/ai/providers/huggingFaceProvider.d.ts +16 -14
- package/dist/plus/ai/providers/huggingFaceProvider.js +45 -46
- package/dist/plus/ai/providers/huggingFaceProvider.js.map +1 -1
- package/dist/plus/ai/providers/mistralProvider.d.ts +22 -20
- package/dist/plus/ai/providers/mistralProvider.js +263 -195
- package/dist/plus/ai/providers/mistralProvider.js.map +1 -1
- package/dist/plus/ai/providers/ollamaProvider.d.ts +26 -24
- package/dist/plus/ai/providers/ollamaProvider.js +156 -189
- package/dist/plus/ai/providers/ollamaProvider.js.map +1 -1
- package/dist/plus/ai/providers/openAICompatibleProvider.d.ts +18 -16
- package/dist/plus/ai/providers/openAICompatibleProvider.js +50 -50
- package/dist/plus/ai/providers/openAICompatibleProvider.js.map +1 -1
- package/dist/plus/ai/providers/openAICompatibleProviderBase.d.ts +187 -185
- package/dist/plus/ai/providers/openAICompatibleProviderBase.js +356 -475
- package/dist/plus/ai/providers/openAICompatibleProviderBase.js.map +1 -1
- package/dist/plus/ai/providers/openRouterProvider.d.ts +20 -19
- package/dist/plus/ai/providers/openRouterProvider.js +60 -65
- package/dist/plus/ai/providers/openRouterProvider.js.map +1 -1
- package/dist/plus/ai/providers/openaiProvider.d.ts +17 -15
- package/dist/plus/ai/providers/openaiProvider.js +35 -34
- package/dist/plus/ai/providers/openaiProvider.js.map +1 -1
- package/dist/plus/ai/providers/responseFormatCache.d.ts +4 -2
- package/dist/plus/ai/providers/responseFormatCache.js +21 -17
- package/dist/plus/ai/providers/responseFormatCache.js.map +1 -1
- package/dist/plus/ai/providers/xaiProvider.d.ts +16 -14
- package/dist/plus/ai/providers/xaiProvider.js +61 -46
- package/dist/plus/ai/providers/xaiProvider.js.map +1 -1
- package/dist/plus/ai/utils/ai.utils.d.ts +4 -2
- package/dist/plus/ai/utils/ai.utils.js +50 -77
- package/dist/plus/ai/utils/ai.utils.js.map +1 -1
- package/dist/plus/ai/utils/results.utils.d.ts +7 -5
- package/dist/plus/ai/utils/results.utils.js +235 -269
- package/dist/plus/ai/utils/results.utils.js.map +1 -1
- package/dist/plus/ai/utils/truncation.utils.d.ts +3 -2
- package/dist/plus/ai/utils/truncation.utils.js +242 -205
- package/dist/plus/ai/utils/truncation.utils.js.map +1 -1
- package/dist/plus/git-github/api/config.d.ts +58 -56
- package/dist/plus/git-github/api/config.js +15 -11
- package/dist/plus/git-github/api/config.js.map +1 -1
- package/dist/plus/git-github/api/github.d.ts +500 -497
- package/dist/plus/git-github/api/github.js +2326 -3121
- package/dist/plus/git-github/api/github.js.map +1 -1
- package/dist/plus/git-github/api/github.utils.d.ts +5 -3
- package/dist/plus/git-github/api/github.utils.js +24 -19
- package/dist/plus/git-github/api/github.utils.js.map +1 -1
- package/dist/plus/git-github/api/issueSearchQuery.d.ts +5 -3
- package/dist/plus/git-github/api/issueSearchQuery.js +204 -221
- package/dist/plus/git-github/api/issueSearchQuery.js.map +1 -1
- package/dist/plus/git-github/api/pullRequestSearchQuery.d.ts +6 -5
- package/dist/plus/git-github/api/pullRequestSearchQuery.js +89 -116
- package/dist/plus/git-github/api/pullRequestSearchQuery.js.map +1 -1
- package/dist/plus/git-github/api/token.d.ts +10 -8
- package/dist/plus/git-github/api/token.js +0 -2
- package/dist/plus/git-github/api/tokenUtils.d.ts +4 -2
- package/dist/plus/git-github/api/tokenUtils.js +14 -10
- package/dist/plus/git-github/api/tokenUtils.js.map +1 -1
- package/dist/plus/git-github/api/types.d.ts +94 -92
- package/dist/plus/git-github/api/types.js +0 -2
- package/dist/plus/git-github/context.d.ts +65 -63
- package/dist/plus/git-github/context.js +13 -9
- package/dist/plus/git-github/context.js.map +1 -1
- package/dist/plus/git-github/models.d.ts +182 -182
- package/dist/plus/git-github/models.js +199 -265
- package/dist/plus/git-github/models.js.map +1 -1
- package/dist/plus/git-github/providers/github/blame.d.ts +32 -31
- package/dist/plus/git-github/providers/github/blame.js +137 -150
- package/dist/plus/git-github/providers/github/blame.js.map +1 -1
- package/dist/plus/git-github/providers/github/branches.d.ts +42 -40
- package/dist/plus/git-github/providers/github/branches.js +199 -274
- package/dist/plus/git-github/providers/github/branches.js.map +1 -1
- package/dist/plus/git-github/providers/github/commits.d.ts +35 -33
- package/dist/plus/git-github/providers/github/commits.js +527 -606
- package/dist/plus/git-github/providers/github/commits.js.map +1 -1
- package/dist/plus/git-github/providers/github/config.d.ts +10 -8
- package/dist/plus/git-github/providers/github/config.js +35 -45
- package/dist/plus/git-github/providers/github/config.js.map +1 -1
- package/dist/plus/git-github/providers/github/contributors.d.ts +25 -24
- package/dist/plus/git-github/providers/github/contributors.js +174 -216
- package/dist/plus/git-github/providers/github/contributors.js.map +1 -1
- package/dist/plus/git-github/providers/github/diff.d.ts +34 -32
- package/dist/plus/git-github/providers/github/diff.js +154 -194
- package/dist/plus/git-github/providers/github/diff.js.map +1 -1
- package/dist/plus/git-github/providers/github/graph.d.ts +33 -31
- package/dist/plus/git-github/providers/github/graph.js +400 -452
- package/dist/plus/git-github/providers/github/graph.js.map +1 -1
- package/dist/plus/git-github/providers/github/refs.d.ts +33 -31
- package/dist/plus/git-github/providers/github/refs.js +97 -131
- package/dist/plus/git-github/providers/github/refs.js.map +1 -1
- package/dist/plus/git-github/providers/github/remotes.d.ts +8 -6
- package/dist/plus/git-github/providers/github/remotes.js +30 -35
- package/dist/plus/git-github/providers/github/remotes.js.map +1 -1
- package/dist/plus/git-github/providers/github/revision.d.ts +13 -11
- package/dist/plus/git-github/providers/github/revision.js +106 -129
- package/dist/plus/git-github/providers/github/revision.js.map +1 -1
- package/dist/plus/git-github/providers/github/status.d.ts +24 -22
- package/dist/plus/git-github/providers/github/status.js +49 -47
- package/dist/plus/git-github/providers/github/status.js.map +1 -1
- package/dist/plus/git-github/providers/github/tags.d.ts +21 -19
- package/dist/plus/git-github/providers/github/tags.js +78 -103
- package/dist/plus/git-github/providers/github/tags.js.map +1 -1
- package/dist/plus/git-github/providers/githubGitProvider.d.ts +67 -64
- package/dist/plus/git-github/providers/githubGitProvider.js +131 -128
- package/dist/plus/git-github/providers/githubGitProvider.js.map +1 -1
- package/dist/plus/git-github/providers/githubProvider.d.ts +46 -44
- package/dist/plus/git-github/providers/githubProvider.js +0 -2
- package/dist/plus/integrations/authentication/cloudIntegrationService.d.ts +29 -27
- package/dist/plus/integrations/authentication/cloudIntegrationService.js +173 -208
- package/dist/plus/integrations/authentication/cloudIntegrationService.js.map +1 -1
- package/dist/plus/integrations/authentication/configuredIntegrationService.d.ts +126 -107
- package/dist/plus/integrations/authentication/configuredIntegrationService.js +399 -497
- package/dist/plus/integrations/authentication/configuredIntegrationService.js.map +1 -1
- package/dist/plus/integrations/authentication/integrationAuthenticationProvider.d.ts +73 -72
- package/dist/plus/integrations/authentication/integrationAuthenticationProvider.js +153 -232
- package/dist/plus/integrations/authentication/integrationAuthenticationProvider.js.map +1 -1
- package/dist/plus/integrations/authentication/integrationAuthenticationService.d.ts +61 -59
- package/dist/plus/integrations/authentication/integrationAuthenticationService.js +100 -124
- package/dist/plus/integrations/authentication/integrationAuthenticationService.js.map +1 -1
- package/dist/plus/integrations/authentication/manualTokenProvider.d.ts +14 -12
- package/dist/plus/integrations/authentication/manualTokenProvider.js +26 -51
- package/dist/plus/integrations/authentication/manualTokenProvider.js.map +1 -1
- package/dist/plus/integrations/authentication/models.d.ts +102 -85
- package/dist/plus/integrations/authentication/models.js +55 -54
- package/dist/plus/integrations/authentication/models.js.map +1 -1
- package/dist/plus/integrations/authentication/rejectedTokenTracker.d.ts +19 -17
- package/dist/plus/integrations/authentication/rejectedTokenTracker.js +53 -51
- package/dist/plus/integrations/authentication/rejectedTokenTracker.js.map +1 -1
- package/dist/plus/integrations/collectionMetadata.d.ts +12 -10
- package/dist/plus/integrations/collectionMetadata.js +204 -254
- package/dist/plus/integrations/collectionMetadata.js.map +1 -1
- package/dist/plus/integrations/constants.d.ts +60 -34
- package/dist/plus/integrations/constants.js +157 -132
- package/dist/plus/integrations/constants.js.map +1 -1
- package/dist/plus/integrations/context.d.ts +253 -252
- package/dist/plus/integrations/context.js +0 -2
- package/dist/plus/integrations/errors.d.ts +26 -25
- package/dist/plus/integrations/errors.js +116 -140
- package/dist/plus/integrations/errors.js.map +1 -1
- package/dist/plus/integrations/index.d.ts +36 -40
- package/dist/plus/integrations/index.js +46 -57
- package/dist/plus/integrations/index.js.map +1 -1
- package/dist/plus/integrations/integrationService.d.ts +445 -440
- package/dist/plus/integrations/integrationService.js +1054 -1324
- package/dist/plus/integrations/integrationService.js.map +1 -1
- package/dist/plus/integrations/lite.d.ts +33 -31
- package/dist/plus/integrations/lite.js +84 -122
- package/dist/plus/integrations/lite.js.map +1 -1
- package/dist/plus/integrations/manager.d.ts +592 -580
- package/dist/plus/integrations/manager.js +0 -2
- package/dist/plus/integrations/models/gitHostIntegration.d.ts +420 -415
- package/dist/plus/integrations/models/gitHostIntegration.js +1180 -1293
- package/dist/plus/integrations/models/gitHostIntegration.js.map +1 -1
- package/dist/plus/integrations/models/integration.d.ts +200 -190
- package/dist/plus/integrations/models/integration.js +577 -722
- package/dist/plus/integrations/models/integration.js.map +1 -1
- package/dist/plus/integrations/models/issueCache.d.ts +15 -13
- package/dist/plus/integrations/models/issueCache.js +9 -7
- package/dist/plus/integrations/models/issueCache.js.map +1 -1
- package/dist/plus/integrations/models/issueReads.d.ts +108 -85
- package/dist/plus/integrations/models/issueReads.js +0 -2
- package/dist/plus/integrations/models/issuesIntegration.d.ts +72 -71
- package/dist/plus/integrations/models/issuesIntegration.js +160 -186
- package/dist/plus/integrations/models/issuesIntegration.js.map +1 -1
- package/dist/plus/integrations/models/pullRequestReads.d.ts +9 -7
- package/dist/plus/integrations/models/pullRequestReads.js +0 -2
- package/dist/plus/integrations/providerFilters.d.ts +8 -20
- package/dist/plus/integrations/providerFilters.js +11 -7
- package/dist/plus/integrations/providerFilters.js.map +1 -1
- package/dist/plus/integrations/providers/accounts.d.ts +7 -5
- package/dist/plus/integrations/providers/accounts.js +21 -31
- package/dist/plus/integrations/providers/accounts.js.map +1 -1
- package/dist/plus/integrations/providers/apiClients.d.ts +13 -10
- package/dist/plus/integrations/providers/apiClients.js +51 -36
- package/dist/plus/integrations/providers/apiClients.js.map +1 -1
- package/dist/plus/integrations/providers/apiConfig.d.ts +31 -29
- package/dist/plus/integrations/providers/apiConfig.js +18 -16
- package/dist/plus/integrations/providers/apiConfig.js.map +1 -1
- package/dist/plus/integrations/providers/azure/azure.d.ts +69 -54
- package/dist/plus/integrations/providers/azure/azure.js +453 -515
- package/dist/plus/integrations/providers/azure/azure.js.map +1 -1
- package/dist/plus/integrations/providers/azure/models.d.ts +258 -229
- package/dist/plus/integrations/providers/azure/models.js +241 -203
- package/dist/plus/integrations/providers/azure/models.js.map +1 -1
- package/dist/plus/integrations/providers/azureDevOps.d.ts +132 -130
- package/dist/plus/integrations/providers/azureDevOps.js +775 -921
- package/dist/plus/integrations/providers/azureDevOps.js.map +1 -1
- package/dist/plus/integrations/providers/bitbucket/bitbucket.d.ts +50 -48
- package/dist/plus/integrations/providers/bitbucket/bitbucket.js +417 -585
- package/dist/plus/integrations/providers/bitbucket/bitbucket.js.map +1 -1
- package/dist/plus/integrations/providers/bitbucket/models.d.ts +179 -179
- package/dist/plus/integrations/providers/bitbucket/models.js +96 -144
- package/dist/plus/integrations/providers/bitbucket/models.js.map +1 -1
- package/dist/plus/integrations/providers/bitbucket-server/models.d.ts +111 -109
- package/dist/plus/integrations/providers/bitbucket-server/models.js +102 -121
- package/dist/plus/integrations/providers/bitbucket-server/models.js.map +1 -1
- package/dist/plus/integrations/providers/bitbucket-server.d.ts +79 -79
- package/dist/plus/integrations/providers/bitbucket-server.js +205 -241
- package/dist/plus/integrations/providers/bitbucket-server.js.map +1 -1
- package/dist/plus/integrations/providers/bitbucket.d.ts +80 -79
- package/dist/plus/integrations/providers/bitbucket.js +390 -477
- package/dist/plus/integrations/providers/bitbucket.js.map +1 -1
- package/dist/plus/integrations/providers/github/github.d.ts +5 -3
- package/dist/plus/integrations/providers/github/github.js +38 -45
- package/dist/plus/integrations/providers/github/github.js.map +1 -1
- package/dist/plus/integrations/providers/github/github.utils.d.ts +8 -5
- package/dist/plus/integrations/providers/github/github.utils.js +7 -4
- package/dist/plus/integrations/providers/github/github.utils.js.map +1 -1
- package/dist/plus/integrations/providers/github/models.d.ts +2 -3
- package/dist/plus/integrations/providers/github/models.js +2 -2
- package/dist/plus/integrations/providers/github.d.ts +174 -172
- package/dist/plus/integrations/providers/github.js +431 -523
- package/dist/plus/integrations/providers/github.js.map +1 -1
- package/dist/plus/integrations/providers/gitlab/gitlab.d.ts +67 -66
- package/dist/plus/integrations/providers/gitlab/gitlab.js +546 -757
- package/dist/plus/integrations/providers/gitlab/gitlab.js.map +1 -1
- package/dist/plus/integrations/providers/gitlab/gitlab.utils.d.ts +7 -5
- package/dist/plus/integrations/providers/gitlab/gitlab.utils.js +45 -46
- package/dist/plus/integrations/providers/gitlab/gitlab.utils.js.map +1 -1
- package/dist/plus/integrations/providers/gitlab/models.d.ts +109 -107
- package/dist/plus/integrations/providers/gitlab/models.js +74 -89
- package/dist/plus/integrations/providers/gitlab/models.js.map +1 -1
- package/dist/plus/integrations/providers/gitlab.d.ts +115 -114
- package/dist/plus/integrations/providers/gitlab.js +440 -528
- package/dist/plus/integrations/providers/gitlab.js.map +1 -1
- package/dist/plus/integrations/providers/issueSorts.d.ts +3 -1
- package/dist/plus/integrations/providers/issueSorts.js +66 -62
- package/dist/plus/integrations/providers/issueSorts.js.map +1 -1
- package/dist/plus/integrations/providers/jira-server.d.ts +90 -0
- package/dist/plus/integrations/providers/jira-server.js +322 -0
- package/dist/plus/integrations/providers/jira-server.js.map +1 -0
- package/dist/plus/integrations/providers/jira.d.ts +41 -39
- package/dist/plus/integrations/providers/jira.js +378 -440
- package/dist/plus/integrations/providers/jira.js.map +1 -1
- package/dist/plus/integrations/providers/jiraIssueByKey.d.ts +3 -1
- package/dist/plus/integrations/providers/jiraIssueByKey.js +85 -89
- package/dist/plus/integrations/providers/jiraIssueByKey.js.map +1 -1
- package/dist/plus/integrations/providers/linear.d.ts +63 -62
- package/dist/plus/integrations/providers/linear.js +315 -358
- package/dist/plus/integrations/providers/linear.js.map +1 -1
- package/dist/plus/integrations/providers/models.d.ts +514 -503
- package/dist/plus/integrations/providers/models.js +818 -856
- package/dist/plus/integrations/providers/models.js.map +1 -1
- package/dist/plus/integrations/providers/providerErrors.d.ts +35 -2
- package/dist/plus/integrations/providers/providerErrors.js +120 -81
- package/dist/plus/integrations/providers/providerErrors.js.map +1 -1
- package/dist/plus/integrations/providers/providersApi.d.ts +299 -271
- package/dist/plus/integrations/providers/providersApi.js +1048 -1001
- package/dist/plus/integrations/providers/providersApi.js.map +1 -1
- package/dist/plus/integrations/providers/pullRequestReviews.d.ts +21 -21
- package/dist/plus/integrations/providers/pullRequestReviews.js +64 -90
- package/dist/plus/integrations/providers/pullRequestReviews.js.map +1 -1
- package/dist/plus/integrations/providers/trello.d.ts +35 -34
- package/dist/plus/integrations/providers/trello.js +136 -143
- package/dist/plus/integrations/providers/trello.js.map +1 -1
- package/dist/plus/integrations/providers/utils/providerPaging.d.ts +4 -2
- package/dist/plus/integrations/providers/utils/providerPaging.js +131 -156
- package/dist/plus/integrations/providers/utils/providerPaging.js.map +1 -1
- package/dist/plus/integrations/providers/utils.d.ts +51 -50
- package/dist/plus/integrations/providers/utils.js +185 -296
- package/dist/plus/integrations/providers/utils.js.map +1 -1
- package/dist/plus/integrations/reads/broaden.d.ts +10 -8
- package/dist/plus/integrations/reads/broaden.js +320 -439
- package/dist/plus/integrations/reads/broaden.js.map +1 -1
- package/dist/plus/integrations/reads/context.d.ts +47 -45
- package/dist/plus/integrations/reads/context.js +0 -2
- package/dist/plus/integrations/reads/counts.d.ts +74 -72
- package/dist/plus/integrations/reads/counts.js +233 -314
- package/dist/plus/integrations/reads/counts.js.map +1 -1
- package/dist/plus/integrations/reads/cursors.d.ts +26 -24
- package/dist/plus/integrations/reads/cursors.js +80 -115
- package/dist/plus/integrations/reads/cursors.js.map +1 -1
- package/dist/plus/integrations/reads/drains.d.ts +24 -23
- package/dist/plus/integrations/reads/drains.js +225 -298
- package/dist/plus/integrations/reads/drains.js.map +1 -1
- package/dist/plus/integrations/reads/filters.d.ts +84 -80
- package/dist/plus/integrations/reads/filters.js +326 -414
- package/dist/plus/integrations/reads/filters.js.map +1 -1
- package/dist/plus/integrations/reads/hierarchy.d.ts +14 -12
- package/dist/plus/integrations/reads/hierarchy.js +248 -332
- package/dist/plus/integrations/reads/hierarchy.js.map +1 -1
- package/dist/plus/integrations/reads/hierarchy.utils.d.ts +11 -9
- package/dist/plus/integrations/reads/hierarchy.utils.js +109 -108
- package/dist/plus/integrations/reads/hierarchy.utils.js.map +1 -1
- package/dist/plus/integrations/reads/issueBatch.d.ts +28 -26
- package/dist/plus/integrations/reads/issueBatch.js +83 -85
- package/dist/plus/integrations/reads/issueBatch.js.map +1 -1
- package/dist/plus/integrations/reads/issueTracker.d.ts +42 -33
- package/dist/plus/integrations/reads/issueTracker.js +265 -386
- package/dist/plus/integrations/reads/issueTracker.js.map +1 -1
- package/dist/plus/integrations/reads/issues.d.ts +50 -47
- package/dist/plus/integrations/reads/issues.js +202 -331
- package/dist/plus/integrations/reads/issues.js.map +1 -1
- package/dist/plus/integrations/reads/ordering.d.ts +32 -30
- package/dist/plus/integrations/reads/ordering.js +47 -43
- package/dist/plus/integrations/reads/ordering.js.map +1 -1
- package/dist/plus/integrations/reads/paging.d.ts +59 -57
- package/dist/plus/integrations/reads/paging.js +244 -261
- package/dist/plus/integrations/reads/paging.js.map +1 -1
- package/dist/plus/integrations/reads/pullRequests.d.ts +37 -35
- package/dist/plus/integrations/reads/pullRequests.js +95 -148
- package/dist/plus/integrations/reads/pullRequests.js.map +1 -1
- package/dist/plus/integrations/reads/resolveRepository.d.ts +15 -13
- package/dist/plus/integrations/reads/resolveRepository.js +147 -229
- package/dist/plus/integrations/reads/resolveRepository.js.map +1 -1
- package/dist/plus/integrations/reads/searchIssues.d.ts +29 -27
- package/dist/plus/integrations/reads/searchIssues.js +104 -153
- package/dist/plus/integrations/reads/searchIssues.js.map +1 -1
- package/dist/plus/integrations/reads/searchPullRequests.d.ts +20 -18
- package/dist/plus/integrations/reads/searchPullRequests.js +91 -113
- package/dist/plus/integrations/reads/searchPullRequests.js.map +1 -1
- package/dist/plus/integrations/reads/sweeps.d.ts +6 -4
- package/dist/plus/integrations/reads/sweeps.js +143 -178
- package/dist/plus/integrations/reads/sweeps.js.map +1 -1
- package/dist/plus/integrations/reads/trackerIssue.d.ts +24 -16
- package/dist/plus/integrations/reads/trackerIssue.js +52 -49
- package/dist/plus/integrations/reads/trackerIssue.js.map +1 -1
- package/dist/plus/integrations/reads/warnings.d.ts +10 -7
- package/dist/plus/integrations/reads/warnings.js +264 -291
- package/dist/plus/integrations/reads/warnings.js.map +1 -1
- package/dist/plus/integrations/results.d.ts +201 -199
- package/dist/plus/integrations/results.js +105 -119
- package/dist/plus/integrations/results.js.map +1 -1
- package/dist/plus/integrations/telemetry.d.ts +7 -5
- package/dist/plus/integrations/telemetry.js +9 -9
- package/dist/plus/integrations/telemetry.js.map +1 -1
- package/dist/plus/integrations/utils/domain.utils.d.ts +21 -0
- package/dist/plus/integrations/utils/domain.utils.js +55 -22
- package/dist/plus/integrations/utils/domain.utils.js.map +1 -1
- package/dist/plus/integrations/utils/integration.utils.d.ts +30 -6
- package/dist/plus/integrations/utils/integration.utils.js +154 -161
- package/dist/plus/integrations/utils/integration.utils.js.map +1 -1
- package/dist/utils/array.d.ts +9 -7
- package/dist/utils/array.js +110 -126
- package/dist/utils/array.js.map +1 -1
- package/dist/utils/base64.d.ts +2 -2
- package/dist/utils/base64.js +2 -2
- package/dist/utils/brand.d.ts +4 -3
- package/dist/utils/brand.js +0 -2
- package/dist/utils/cancellation.d.ts +24 -24
- package/dist/utils/cancellation.js +152 -167
- package/dist/utils/cancellation.js.map +1 -1
- package/dist/utils/charCode.d.ts +31 -37
- package/dist/utils/charCode.js +41 -37
- package/dist/utils/charCode.js.map +1 -1
- package/dist/utils/coalescedRun.d.ts +10 -8
- package/dist/utils/coalescedRun.js +39 -41
- package/dist/utils/coalescedRun.js.map +1 -1
- package/dist/utils/color.d.ts +137 -135
- package/dist/utils/color.js +535 -660
- package/dist/utils/color.js.map +1 -1
- package/dist/utils/counter.d.ts +5 -3
- package/dist/utils/counter.js +19 -17
- package/dist/utils/counter.js.map +1 -1
- package/dist/utils/crypto.d.ts +2 -2
- package/dist/utils/crypto.js +2 -2
- package/dist/utils/date.d.ts +10 -9
- package/dist/utils/date.js +312 -350
- package/dist/utils/date.js.map +1 -1
- package/dist/utils/debounce.d.ts +45 -43
- package/dist/utils/debounce.js +175 -206
- package/dist/utils/debounce.js.map +1 -1
- package/dist/utils/decorators/debounce.d.ts +3 -1
- package/dist/utils/decorators/debounce.js +16 -19
- package/dist/utils/decorators/debounce.js.map +1 -1
- package/dist/utils/decorators/gate.d.ts +13 -11
- package/dist/utils/decorators/gate.js +97 -124
- package/dist/utils/decorators/gate.js.map +1 -1
- package/dist/utils/decorators/log.d.ts +25 -24
- package/dist/utils/decorators/log.js +166 -227
- package/dist/utils/decorators/log.js.map +1 -1
- package/dist/utils/decorators/memoize.d.ts +10 -8
- package/dist/utils/decorators/memoize.js +49 -57
- package/dist/utils/decorators/memoize.js.map +1 -1
- package/dist/utils/decorators/resolver.d.ts +2 -0
- package/dist/utils/decorators/resolver.js +64 -75
- package/dist/utils/decorators/resolver.js.map +1 -1
- package/dist/utils/decorators/sequentialize.d.ts +15 -14
- package/dist/utils/decorators/sequentialize.js +61 -80
- package/dist/utils/decorators/sequentialize.js.map +1 -1
- package/dist/utils/decorators/serializable.d.ts +2 -0
- package/dist/utils/decorators/serializable.js +30 -39
- package/dist/utils/decorators/serializable.js.map +1 -1
- package/dist/utils/dedupedAsyncCache.d.ts +23 -21
- package/dist/utils/dedupedAsyncCache.js +63 -66
- package/dist/utils/dedupedAsyncCache.js.map +1 -1
- package/dist/utils/diff.d.ts +2 -0
- package/dist/utils/diff.js +41 -51
- package/dist/utils/diff.js.map +1 -1
- package/dist/utils/disposable.d.ts +15 -13
- package/dist/utils/disposable.js +71 -80
- package/dist/utils/disposable.js.map +1 -1
- package/dist/utils/dom.d.ts +45 -0
- package/dist/utils/dom.js +106 -0
- package/dist/utils/dom.js.map +1 -0
- package/dist/utils/encoding.d.ts +2 -0
- package/dist/utils/encoding.js +7 -5
- package/dist/utils/encoding.js.map +1 -1
- package/dist/utils/env/browser/base64.d.ts +2 -0
- package/dist/utils/env/browser/base64.js +32 -34
- package/dist/utils/env/browser/base64.js.map +1 -1
- package/dist/utils/env/browser/crypto.d.ts +2 -0
- package/dist/utils/env/browser/crypto.js +17 -13
- package/dist/utils/env/browser/crypto.js.map +1 -1
- package/dist/utils/env/browser/fs.d.ts +2 -0
- package/dist/utils/env/browser/fs.js +6 -2
- package/dist/utils/env/browser/fs.js.map +1 -1
- package/dist/utils/env/browser/hex.d.ts +2 -0
- package/dist/utils/env/browser/hex.js +271 -29
- package/dist/utils/env/browser/hex.js.map +1 -1
- package/dist/utils/env/browser/hrtime.d.ts +2 -0
- package/dist/utils/env/browser/hrtime.js +17 -13
- package/dist/utils/env/browser/hrtime.js.map +1 -1
- package/dist/utils/env/browser/logScope.d.ts +3 -1
- package/dist/utils/env/browser/logScope.js +39 -43
- package/dist/utils/env/browser/logScope.js.map +1 -1
- package/dist/utils/env/browser/md5.d.ts +2 -0
- package/dist/utils/env/browser/md5.js +211 -184
- package/dist/utils/env/browser/md5.js.map +1 -1
- package/dist/utils/env/browser/platform.d.ts +3 -0
- package/dist/utils/env/browser/platform.js +11 -4
- package/dist/utils/env/browser/platform.js.map +1 -1
- package/dist/utils/env/node/base64.d.ts +2 -0
- package/dist/utils/env/node/base64.js +13 -11
- package/dist/utils/env/node/base64.js.map +1 -1
- package/dist/utils/env/node/crypto.d.ts +2 -0
- package/dist/utils/env/node/crypto.js +13 -9
- package/dist/utils/env/node/crypto.js.map +1 -1
- package/dist/utils/env/node/exec.d.ts +66 -65
- package/dist/utils/env/node/exec.js +255 -267
- package/dist/utils/env/node/exec.js.map +1 -1
- package/dist/utils/env/node/fs.d.ts +2 -0
- package/dist/utils/env/node/fs.js +7 -3
- package/dist/utils/env/node/fs.js.map +1 -1
- package/dist/utils/env/node/hex.d.ts +2 -0
- package/dist/utils/env/node/hex.js +10 -6
- package/dist/utils/env/node/hex.js.map +1 -1
- package/dist/utils/env/node/hrtime.d.ts +2 -2
- package/dist/utils/env/node/hrtime.js +2 -2
- package/dist/utils/env/node/logScope.d.ts +3 -1
- package/dist/utils/env/node/logScope.js +52 -42
- package/dist/utils/env/node/logScope.js.map +1 -1
- package/dist/utils/env/node/platform.d.ts +3 -0
- package/dist/utils/env/node/platform.js +11 -4
- package/dist/utils/env/node/platform.js.map +1 -1
- package/dist/utils/error.d.ts +8 -6
- package/dist/utils/error.js +16 -14
- package/dist/utils/error.js.map +1 -1
- package/dist/utils/event.d.ts +27 -25
- package/dist/utils/event.js +141 -170
- package/dist/utils/event.js.map +1 -1
- package/dist/utils/formatter.d.ts +15 -14
- package/dist/utils/formatter.js +96 -129
- package/dist/utils/formatter.js.map +1 -1
- package/dist/utils/fs.d.ts +2 -2
- package/dist/utils/fs.js +2 -2
- package/dist/utils/function.d.ts +5 -6
- package/dist/utils/function.js +73 -90
- package/dist/utils/function.js.map +1 -1
- package/dist/utils/fuzzy.d.ts +18 -16
- package/dist/utils/fuzzy.js +121 -127
- package/dist/utils/fuzzy.js.map +1 -1
- package/dist/utils/gitRefs.d.ts +11 -0
- package/dist/utils/gitRefs.js +21 -0
- package/dist/utils/gitRefs.js.map +1 -0
- package/dist/utils/hash.d.ts +2 -0
- package/dist/utils/hash.js +49 -47
- package/dist/utils/hash.js.map +1 -1
- package/dist/utils/hex.d.ts +2 -2
- package/dist/utils/hex.js +2 -2
- package/dist/utils/hostingServiceType.d.ts +8 -0
- package/dist/utils/hostingServiceType.js +0 -0
- package/dist/utils/hrtime.d.ts +4 -2
- package/dist/utils/hrtime.js +8 -5
- package/dist/utils/hrtime.js.map +1 -1
- package/dist/utils/iterable.d.ts +3 -1
- package/dist/utils/iterable.js +591 -616
- package/dist/utils/iterable.js.map +1 -1
- package/dist/utils/keys/chord.d.ts +27 -25
- package/dist/utils/keys/chord.js +108 -122
- package/dist/utils/keys/chord.js.map +1 -1
- package/dist/utils/keys/keybinding.d.ts +98 -22
- package/dist/utils/keys/keybinding.js +151 -53
- package/dist/utils/keys/keybinding.js.map +1 -1
- package/dist/utils/keys/keymapDispatcher.d.ts +66 -0
- package/dist/utils/keys/keymapDispatcher.js +187 -0
- package/dist/utils/keys/keymapDispatcher.js.map +1 -0
- package/dist/utils/lazy.d.ts +14 -12
- package/dist/utils/lazy.js +35 -36
- package/dist/utils/lazy.js.map +1 -1
- package/dist/utils/loggable.d.ts +3 -1
- package/dist/utils/loggable.js +6 -2
- package/dist/utils/loggable.js.map +1 -1
- package/dist/utils/logger.d.ts +48 -46
- package/dist/utils/logger.js +219 -304
- package/dist/utils/logger.js.map +1 -1
- package/dist/utils/logger.scoped.d.ts +30 -28
- package/dist/utils/logger.scoped.js +133 -147
- package/dist/utils/logger.scoped.js.map +1 -1
- package/dist/utils/lruMap.d.ts +34 -32
- package/dist/utils/lruMap.js +97 -101
- package/dist/utils/lruMap.js.map +1 -1
- package/dist/utils/markdown.d.ts +5 -3
- package/dist/utils/markdown.js +52 -88
- package/dist/utils/markdown.js.map +1 -1
- package/dist/utils/mru.d.ts +13 -11
- package/dist/utils/mru.js +57 -62
- package/dist/utils/mru.js.map +1 -1
- package/dist/utils/object.d.ts +9 -34
- package/dist/utils/object.js +132 -191
- package/dist/utils/object.js.map +1 -1
- package/dist/utils/paging.d.ts +36 -34
- package/dist/utils/paging.js +42 -45
- package/dist/utils/paging.js.map +1 -1
- package/dist/utils/path.d.ts +4 -1
- package/dist/utils/path.js +129 -162
- package/dist/utils/path.js.map +1 -1
- package/dist/utils/pausedOperation.d.ts +42 -0
- package/dist/utils/pausedOperation.js +62 -0
- package/dist/utils/pausedOperation.js.map +1 -0
- package/dist/utils/platform.d.ts +2 -2
- package/dist/utils/platform.js +2 -2
- package/dist/utils/plural.d.ts +21 -0
- package/dist/utils/plural.js +136 -0
- package/dist/utils/plural.js.map +1 -0
- package/dist/utils/promise.d.ts +19 -18
- package/dist/utils/promise.js +323 -360
- package/dist/utils/promise.js.map +1 -1
- package/dist/utils/promiseCache.d.ts +331 -330
- package/dist/utils/promiseCache.js +602 -717
- package/dist/utils/promiseCache.js.map +1 -1
- package/dist/utils/resourceUsage.d.ts +2 -0
- package/dist/utils/resourceUsage.js +0 -2
- package/dist/utils/searchTree.d.ts +51 -49
- package/dist/utils/searchTree.js +306 -396
- package/dist/utils/searchTree.js.map +1 -1
- package/dist/utils/stopwatch.d.ts +33 -32
- package/dist/utils/stopwatch.js +67 -81
- package/dist/utils/stopwatch.js.map +1 -1
- package/dist/utils/string.d.ts +17 -24
- package/dist/utils/string.js +787 -803
- package/dist/utils/string.js.map +1 -1
- package/dist/utils/subscriptionManager.d.ts +15 -14
- package/dist/utils/subscriptionManager.js +36 -33
- package/dist/utils/subscriptionManager.js.map +1 -1
- package/dist/utils/trie.d.ts +64 -62
- package/dist/utils/trie.js +438 -580
- package/dist/utils/trie.js.map +1 -1
- package/dist/utils/types.d.ts +8 -16
- package/dist/utils/types.js +0 -2
- package/dist/utils/uri.d.ts +27 -25
- package/dist/utils/uri.js +42 -42
- package/dist/utils/uri.js.map +1 -1
- package/dist/utils/validation.d.ts +13 -12
- package/dist/utils/validation.js +17 -23
- package/dist/utils/validation.js.map +1 -1
- package/dist/utils/version.d.ts +6 -5
- package/dist/utils/version.js +77 -104
- package/dist/utils/version.js.map +1 -1
- package/docs/integrations.md +101 -24
- package/docs/kepler-read-api-parity.md +15 -12
- package/package.json +18 -8
- package/dist/git/cache.d.ts.map +0 -1
- package/dist/git/context.d.ts.map +0 -1
- package/dist/git/errors.d.ts.map +0 -1
- package/dist/git/features.d.ts.map +0 -1
- package/dist/git/gitHealth.d.ts.map +0 -1
- package/dist/git/models/author.d.ts.map +0 -1
- package/dist/git/models/author.js.map +0 -1
- package/dist/git/models/autolink.d.ts.map +0 -1
- package/dist/git/models/autolink.js.map +0 -1
- package/dist/git/models/blame.d.ts.map +0 -1
- package/dist/git/models/blame.js.map +0 -1
- package/dist/git/models/branch.d.ts.map +0 -1
- package/dist/git/models/commit.d.ts.map +0 -1
- package/dist/git/models/contributor.d.ts.map +0 -1
- package/dist/git/models/defaultBranch.d.ts.map +0 -1
- package/dist/git/models/defaultBranch.js.map +0 -1
- package/dist/git/models/diff.d.ts.map +0 -1
- package/dist/git/models/diff.js.map +0 -1
- package/dist/git/models/file.d.ts.map +0 -1
- package/dist/git/models/file.js.map +0 -1
- package/dist/git/models/fileChange.d.ts.map +0 -1
- package/dist/git/models/fileStatus.d.ts.map +0 -1
- package/dist/git/models/graph.d.ts.map +0 -1
- package/dist/git/models/graphSearch.d.ts.map +0 -1
- package/dist/git/models/graphSearch.js.map +0 -1
- package/dist/git/models/graphSession.d.ts.map +0 -1
- package/dist/git/models/issue.d.ts.map +0 -1
- package/dist/git/models/issueOrPullRequest.d.ts.map +0 -1
- package/dist/git/models/issueOrPullRequest.js.map +0 -1
- package/dist/git/models/lineRange.d.ts.map +0 -1
- package/dist/git/models/lineRange.js.map +0 -1
- package/dist/git/models/log.d.ts.map +0 -1
- package/dist/git/models/log.js.map +0 -1
- package/dist/git/models/mergeConflicts.d.ts.map +0 -1
- package/dist/git/models/mergeConflicts.js.map +0 -1
- package/dist/git/models/patch.d.ts.map +0 -1
- package/dist/git/models/patch.js.map +0 -1
- package/dist/git/models/pausedOperationStatus.d.ts.map +0 -1
- package/dist/git/models/pausedOperationStatus.js.map +0 -1
- package/dist/git/models/pullRequest.d.ts.map +0 -1
- package/dist/git/models/rebase.d.ts.map +0 -1
- package/dist/git/models/rebase.js.map +0 -1
- package/dist/git/models/reference.d.ts.map +0 -1
- package/dist/git/models/reference.js.map +0 -1
- package/dist/git/models/reflog.d.ts.map +0 -1
- package/dist/git/models/remote.d.ts.map +0 -1
- package/dist/git/models/remoteProvider.d.ts.map +0 -1
- package/dist/git/models/remoteResource.d.ts.map +0 -1
- package/dist/git/models/repository.d.ts.map +0 -1
- package/dist/git/models/repositoryChangeEvent.d.ts.map +0 -1
- package/dist/git/models/repositoryIdentities.d.ts.map +0 -1
- package/dist/git/models/repositoryMetadata.d.ts.map +0 -1
- package/dist/git/models/repositoryMetadata.js.map +0 -1
- package/dist/git/models/resourceDescriptor.d.ts.map +0 -1
- package/dist/git/models/resourceDescriptor.js.map +0 -1
- package/dist/git/models/revision.d.ts.map +0 -1
- package/dist/git/models/search.d.ts.map +0 -1
- package/dist/git/models/shortlog.d.ts.map +0 -1
- package/dist/git/models/shortlog.js.map +0 -1
- package/dist/git/models/signature.d.ts.map +0 -1
- package/dist/git/models/signature.js.map +0 -1
- package/dist/git/models/staging.d.ts.map +0 -1
- package/dist/git/models/staging.js.map +0 -1
- package/dist/git/models/stash.d.ts.map +0 -1
- package/dist/git/models/stash.js.map +0 -1
- package/dist/git/models/status.d.ts.map +0 -1
- package/dist/git/models/statusFile.d.ts.map +0 -1
- package/dist/git/models/tag.d.ts.map +0 -1
- package/dist/git/models/tree.d.ts.map +0 -1
- package/dist/git/models/tree.js.map +0 -1
- package/dist/git/models/user.d.ts.map +0 -1
- package/dist/git/models/user.js.map +0 -1
- package/dist/git/models/worktree.d.ts.map +0 -1
- package/dist/git/parsers/diffParser.d.ts.map +0 -1
- package/dist/git/parsers/rebaseTodoParser.d.ts.map +0 -1
- package/dist/git/providers/blame.d.ts.map +0 -1
- package/dist/git/providers/blame.js.map +0 -1
- package/dist/git/providers/branches.d.ts.map +0 -1
- package/dist/git/providers/branches.js.map +0 -1
- package/dist/git/providers/commits.d.ts.map +0 -1
- package/dist/git/providers/commits.js.map +0 -1
- package/dist/git/providers/config.d.ts.map +0 -1
- package/dist/git/providers/config.js.map +0 -1
- package/dist/git/providers/contributors.d.ts.map +0 -1
- package/dist/git/providers/contributors.js.map +0 -1
- package/dist/git/providers/diff.d.ts.map +0 -1
- package/dist/git/providers/diff.js.map +0 -1
- package/dist/git/providers/graph.d.ts.map +0 -1
- package/dist/git/providers/graph.js.map +0 -1
- package/dist/git/providers/maintenance.d.ts.map +0 -1
- package/dist/git/providers/maintenance.js.map +0 -1
- package/dist/git/providers/operations.d.ts.map +0 -1
- package/dist/git/providers/operations.js.map +0 -1
- package/dist/git/providers/patch.d.ts.map +0 -1
- package/dist/git/providers/patch.js.map +0 -1
- package/dist/git/providers/pausedOperations.d.ts.map +0 -1
- package/dist/git/providers/pausedOperations.js.map +0 -1
- package/dist/git/providers/provider.d.ts.map +0 -1
- package/dist/git/providers/provider.js.map +0 -1
- package/dist/git/providers/refs.d.ts.map +0 -1
- package/dist/git/providers/refs.js.map +0 -1
- package/dist/git/providers/remotes.d.ts.map +0 -1
- package/dist/git/providers/remotes.js.map +0 -1
- package/dist/git/providers/revision.d.ts.map +0 -1
- package/dist/git/providers/revision.js.map +0 -1
- package/dist/git/providers/shared/remotes.d.ts.map +0 -1
- package/dist/git/providers/staging.d.ts.map +0 -1
- package/dist/git/providers/staging.js.map +0 -1
- package/dist/git/providers/stash.d.ts.map +0 -1
- package/dist/git/providers/stash.js.map +0 -1
- package/dist/git/providers/status.d.ts.map +0 -1
- package/dist/git/providers/status.js.map +0 -1
- package/dist/git/providers/tags.d.ts.map +0 -1
- package/dist/git/providers/tags.js.map +0 -1
- package/dist/git/providers/types.d.ts.map +0 -1
- package/dist/git/providers/types.js.map +0 -1
- package/dist/git/providers/worktrees.d.ts.map +0 -1
- package/dist/git/providers/worktrees.js.map +0 -1
- package/dist/git/remotes/azure-devops.d.ts.map +0 -1
- package/dist/git/remotes/bitbucket-server.d.ts.map +0 -1
- package/dist/git/remotes/bitbucket.d.ts.map +0 -1
- package/dist/git/remotes/custom.d.ts.map +0 -1
- package/dist/git/remotes/gerrit.d.ts.map +0 -1
- package/dist/git/remotes/gitea.d.ts.map +0 -1
- package/dist/git/remotes/github.d.ts.map +0 -1
- package/dist/git/remotes/gitlab.d.ts.map +0 -1
- package/dist/git/remotes/google-source.d.ts.map +0 -1
- package/dist/git/remotes/matcher.d.ts.map +0 -1
- package/dist/git/repositoryService.d.ts.map +0 -1
- package/dist/git/run.types.d.ts.map +0 -1
- package/dist/git/run.types.js.map +0 -1
- package/dist/git/service.d.ts.map +0 -1
- package/dist/git/utils/autolink.utils.d.ts.map +0 -1
- package/dist/git/utils/blame.utils.d.ts.map +0 -1
- package/dist/git/utils/branch.utils.d.ts.map +0 -1
- package/dist/git/utils/commit.utils.d.ts.map +0 -1
- package/dist/git/utils/config.utils.d.ts.map +0 -1
- package/dist/git/utils/conflictResolution.utils.d.ts.map +0 -1
- package/dist/git/utils/contributor.utils.d.ts.map +0 -1
- package/dist/git/utils/fetch.utils.d.ts.map +0 -1
- package/dist/git/utils/fileStatus.utils.d.ts.map +0 -1
- package/dist/git/utils/graph.utils.d.ts.map +0 -1
- package/dist/git/utils/issue.utils.d.ts.map +0 -1
- package/dist/git/utils/issueOrPullRequest.utils.d.ts.map +0 -1
- package/dist/git/utils/mergeConflicts.utils.d.ts.map +0 -1
- package/dist/git/utils/pausedOperationStatus.utils.d.ts.map +0 -1
- package/dist/git/utils/pullRequest.utils.d.ts.map +0 -1
- package/dist/git/utils/reachability.utils.d.ts.map +0 -1
- package/dist/git/utils/rebase.utils.d.ts.map +0 -1
- package/dist/git/utils/reference.utils.d.ts.map +0 -1
- package/dist/git/utils/remote.utils.d.ts.map +0 -1
- package/dist/git/utils/repository.utils.d.ts.map +0 -1
- package/dist/git/utils/resourceDescriptor.utils.d.ts.map +0 -1
- package/dist/git/utils/revision.utils.d.ts.map +0 -1
- package/dist/git/utils/search.utils.d.ts.map +0 -1
- package/dist/git/utils/sorting.d.ts.map +0 -1
- package/dist/git/utils/sshKey.utils.d.ts.map +0 -1
- package/dist/git/utils/status.utils.d.ts.map +0 -1
- package/dist/git/utils/statusFile.utils.d.ts.map +0 -1
- package/dist/git/utils/tag.utils.d.ts.map +0 -1
- package/dist/git/utils/tooltip.utils.d.ts.map +0 -1
- package/dist/git/utils/uriAuthority.d.ts.map +0 -1
- package/dist/git/utils/user.utils.d.ts.map +0 -1
- package/dist/git/utils/worktree.utils.d.ts.map +0 -1
- package/dist/git/watching/changeEvent.d.ts.map +0 -1
- package/dist/git/watching/classifyChange.d.ts.map +0 -1
- package/dist/git/watching/gitIgnoreFilter.d.ts.map +0 -1
- package/dist/git/watching/initWatcher.d.ts.map +0 -1
- package/dist/git/watching/provider.d.ts.map +0 -1
- package/dist/git/watching/provider.js.map +0 -1
- package/dist/git/watching/watchGroup.d.ts.map +0 -1
- package/dist/git/watching/watchService.d.ts.map +0 -1
- package/dist/git/watching/watchSession.d.ts.map +0 -1
- package/dist/git/watching/watcherPatterns.d.ts.map +0 -1
- package/dist/git-cli/cliGitProvider.d.ts.map +0 -1
- package/dist/git-cli/exec/exec.d.ts.map +0 -1
- package/dist/git-cli/exec/exec.errors.d.ts.map +0 -1
- package/dist/git-cli/exec/exec.errors.js.map +0 -1
- package/dist/git-cli/exec/exec.js.map +0 -1
- package/dist/git-cli/exec/exec.types.d.ts.map +0 -1
- package/dist/git-cli/exec/exec.types.js.map +0 -1
- package/dist/git-cli/exec/features.d.ts.map +0 -1
- package/dist/git-cli/exec/features.js.map +0 -1
- package/dist/git-cli/exec/git.d.ts.map +0 -1
- package/dist/git-cli/exec/gitQueue.d.ts.map +0 -1
- package/dist/git-cli/exec/locator.d.ts.map +0 -1
- package/dist/git-cli/parsers/blameParser.d.ts.map +0 -1
- package/dist/git-cli/parsers/indexParser.d.ts.map +0 -1
- package/dist/git-cli/parsers/logParser.d.ts.map +0 -1
- package/dist/git-cli/parsers/mergeTreeParser.d.ts.map +0 -1
- package/dist/git-cli/parsers/refParser.d.ts.map +0 -1
- package/dist/git-cli/parsers/reflogParser.d.ts.map +0 -1
- package/dist/git-cli/parsers/remoteParser.d.ts.map +0 -1
- package/dist/git-cli/parsers/shortlogParser.d.ts.map +0 -1
- package/dist/git-cli/parsers/signatureParser.d.ts.map +0 -1
- package/dist/git-cli/parsers/sshSignatureParser.d.ts.map +0 -1
- package/dist/git-cli/parsers/statusParser.d.ts.map +0 -1
- package/dist/git-cli/parsers/treeParser.d.ts.map +0 -1
- package/dist/git-cli/parsers/worktreeParser.d.ts.map +0 -1
- package/dist/git-cli/providers/blame.d.ts.map +0 -1
- package/dist/git-cli/providers/branches.d.ts.map +0 -1
- package/dist/git-cli/providers/commitFilesetUtils.d.ts.map +0 -1
- package/dist/git-cli/providers/commits.d.ts.map +0 -1
- package/dist/git-cli/providers/config.d.ts.map +0 -1
- package/dist/git-cli/providers/contributors.d.ts.map +0 -1
- package/dist/git-cli/providers/diff.d.ts.map +0 -1
- package/dist/git-cli/providers/graph.d.ts.map +0 -1
- package/dist/git-cli/providers/maintenance.d.ts.map +0 -1
- package/dist/git-cli/providers/operations.d.ts.map +0 -1
- package/dist/git-cli/providers/patch.d.ts.map +0 -1
- package/dist/git-cli/providers/pausedOperations.d.ts.map +0 -1
- package/dist/git-cli/providers/refs.d.ts.map +0 -1
- package/dist/git-cli/providers/remotes.d.ts.map +0 -1
- package/dist/git-cli/providers/revision.d.ts.map +0 -1
- package/dist/git-cli/providers/staging.d.ts.map +0 -1
- package/dist/git-cli/providers/stash.d.ts.map +0 -1
- package/dist/git-cli/providers/status.d.ts.map +0 -1
- package/dist/git-cli/providers/tags.d.ts.map +0 -1
- package/dist/git-cli/providers/worktrees.d.ts.map +0 -1
- package/dist/git-cli/service.d.ts.map +0 -1
- package/dist/ipc/discovery.d.ts.map +0 -1
- package/dist/ipc/ipcServer.d.ts.map +0 -1
- package/dist/plus/agents/agentCapabilities.d.ts.map +0 -1
- package/dist/plus/agents/providers/claudeCodeTranscript.d.ts.map +0 -1
- package/dist/plus/agents/providers/gkAgentProvider.d.ts.map +0 -1
- package/dist/plus/agents/sanitizePrompt.d.ts.map +0 -1
- package/dist/plus/agents/stateMachine.d.ts.map +0 -1
- package/dist/plus/agents/types.d.ts.map +0 -1
- package/dist/plus/ai/constants.d.ts.map +0 -1
- package/dist/plus/ai/errors.d.ts.map +0 -1
- package/dist/plus/ai/models/conversation.d.ts.map +0 -1
- package/dist/plus/ai/models/model.d.ts.map +0 -1
- package/dist/plus/ai/models/promptTemplates.d.ts.map +0 -1
- package/dist/plus/ai/models/promptTemplates.js.map +0 -1
- package/dist/plus/ai/models/provider.d.ts.map +0 -1
- package/dist/plus/ai/models/provider.js.map +0 -1
- package/dist/plus/ai/models/results.d.ts.map +0 -1
- package/dist/plus/ai/models/results.js.map +0 -1
- package/dist/plus/ai/prompts.d.ts.map +0 -1
- package/dist/plus/ai/providers/anthropicProvider.d.ts.map +0 -1
- package/dist/plus/ai/providers/azureProvider.d.ts.map +0 -1
- package/dist/plus/ai/providers/context.d.ts.map +0 -1
- package/dist/plus/ai/providers/context.js.map +0 -1
- package/dist/plus/ai/providers/deepSeekProvider.d.ts.map +0 -1
- package/dist/plus/ai/providers/geminiProvider.d.ts.map +0 -1
- package/dist/plus/ai/providers/gitkrakenProvider.d.ts.map +0 -1
- package/dist/plus/ai/providers/huggingFaceProvider.d.ts.map +0 -1
- package/dist/plus/ai/providers/mistralProvider.d.ts.map +0 -1
- package/dist/plus/ai/providers/ollamaProvider.d.ts.map +0 -1
- package/dist/plus/ai/providers/openAICompatibleProvider.d.ts.map +0 -1
- package/dist/plus/ai/providers/openAICompatibleProviderBase.d.ts.map +0 -1
- package/dist/plus/ai/providers/openRouterProvider.d.ts.map +0 -1
- package/dist/plus/ai/providers/openaiProvider.d.ts.map +0 -1
- package/dist/plus/ai/providers/responseFormatCache.d.ts.map +0 -1
- package/dist/plus/ai/providers/xaiProvider.d.ts.map +0 -1
- package/dist/plus/ai/utils/ai.utils.d.ts.map +0 -1
- package/dist/plus/ai/utils/results.utils.d.ts.map +0 -1
- package/dist/plus/ai/utils/truncation.utils.d.ts.map +0 -1
- package/dist/plus/git-github/api/config.d.ts.map +0 -1
- package/dist/plus/git-github/api/github.d.ts.map +0 -1
- package/dist/plus/git-github/api/github.utils.d.ts.map +0 -1
- package/dist/plus/git-github/api/issueSearchQuery.d.ts.map +0 -1
- package/dist/plus/git-github/api/pullRequestSearchQuery.d.ts.map +0 -1
- package/dist/plus/git-github/api/token.d.ts.map +0 -1
- package/dist/plus/git-github/api/token.js.map +0 -1
- package/dist/plus/git-github/api/tokenUtils.d.ts.map +0 -1
- package/dist/plus/git-github/api/types.d.ts.map +0 -1
- package/dist/plus/git-github/api/types.js.map +0 -1
- package/dist/plus/git-github/context.d.ts.map +0 -1
- package/dist/plus/git-github/models.d.ts.map +0 -1
- package/dist/plus/git-github/providers/github/blame.d.ts.map +0 -1
- package/dist/plus/git-github/providers/github/branches.d.ts.map +0 -1
- package/dist/plus/git-github/providers/github/commits.d.ts.map +0 -1
- package/dist/plus/git-github/providers/github/config.d.ts.map +0 -1
- package/dist/plus/git-github/providers/github/contributors.d.ts.map +0 -1
- package/dist/plus/git-github/providers/github/diff.d.ts.map +0 -1
- package/dist/plus/git-github/providers/github/graph.d.ts.map +0 -1
- package/dist/plus/git-github/providers/github/refs.d.ts.map +0 -1
- package/dist/plus/git-github/providers/github/remotes.d.ts.map +0 -1
- package/dist/plus/git-github/providers/github/revision.d.ts.map +0 -1
- package/dist/plus/git-github/providers/github/status.d.ts.map +0 -1
- package/dist/plus/git-github/providers/github/tags.d.ts.map +0 -1
- package/dist/plus/git-github/providers/githubGitProvider.d.ts.map +0 -1
- package/dist/plus/git-github/providers/githubProvider.d.ts.map +0 -1
- package/dist/plus/git-github/providers/githubProvider.js.map +0 -1
- package/dist/plus/integrations/authentication/cloudIntegrationService.d.ts.map +0 -1
- package/dist/plus/integrations/authentication/configuredIntegrationService.d.ts.map +0 -1
- package/dist/plus/integrations/authentication/integrationAuthenticationProvider.d.ts.map +0 -1
- package/dist/plus/integrations/authentication/integrationAuthenticationService.d.ts.map +0 -1
- package/dist/plus/integrations/authentication/manualTokenProvider.d.ts.map +0 -1
- package/dist/plus/integrations/authentication/models.d.ts.map +0 -1
- package/dist/plus/integrations/authentication/rejectedTokenTracker.d.ts.map +0 -1
- package/dist/plus/integrations/collectionMetadata.d.ts.map +0 -1
- package/dist/plus/integrations/constants.d.ts.map +0 -1
- package/dist/plus/integrations/context.d.ts.map +0 -1
- package/dist/plus/integrations/context.js.map +0 -1
- package/dist/plus/integrations/errors.d.ts.map +0 -1
- package/dist/plus/integrations/index.d.ts.map +0 -1
- package/dist/plus/integrations/integrationService.d.ts.map +0 -1
- package/dist/plus/integrations/lite.d.ts.map +0 -1
- package/dist/plus/integrations/manager.d.ts.map +0 -1
- package/dist/plus/integrations/manager.js.map +0 -1
- package/dist/plus/integrations/models/gitHostIntegration.d.ts.map +0 -1
- package/dist/plus/integrations/models/integration.d.ts.map +0 -1
- package/dist/plus/integrations/models/issueCache.d.ts.map +0 -1
- package/dist/plus/integrations/models/issueReads.d.ts.map +0 -1
- package/dist/plus/integrations/models/issueReads.js.map +0 -1
- package/dist/plus/integrations/models/issuesIntegration.d.ts.map +0 -1
- package/dist/plus/integrations/models/pullRequestReads.d.ts.map +0 -1
- package/dist/plus/integrations/models/pullRequestReads.js.map +0 -1
- package/dist/plus/integrations/providerFilters.d.ts.map +0 -1
- package/dist/plus/integrations/providers/accounts.d.ts.map +0 -1
- package/dist/plus/integrations/providers/apiClients.d.ts.map +0 -1
- package/dist/plus/integrations/providers/apiConfig.d.ts.map +0 -1
- package/dist/plus/integrations/providers/azure/azure.d.ts.map +0 -1
- package/dist/plus/integrations/providers/azure/models.d.ts.map +0 -1
- package/dist/plus/integrations/providers/azureDevOps.d.ts.map +0 -1
- package/dist/plus/integrations/providers/bitbucket/bitbucket.d.ts.map +0 -1
- package/dist/plus/integrations/providers/bitbucket/models.d.ts.map +0 -1
- package/dist/plus/integrations/providers/bitbucket-server/models.d.ts.map +0 -1
- package/dist/plus/integrations/providers/bitbucket-server.d.ts.map +0 -1
- package/dist/plus/integrations/providers/bitbucket.d.ts.map +0 -1
- package/dist/plus/integrations/providers/github/github.d.ts.map +0 -1
- package/dist/plus/integrations/providers/github/github.utils.d.ts.map +0 -1
- package/dist/plus/integrations/providers/github/models.d.ts.map +0 -1
- package/dist/plus/integrations/providers/github/models.js.map +0 -1
- package/dist/plus/integrations/providers/github.d.ts.map +0 -1
- package/dist/plus/integrations/providers/gitlab/gitlab.d.ts.map +0 -1
- package/dist/plus/integrations/providers/gitlab/gitlab.utils.d.ts.map +0 -1
- package/dist/plus/integrations/providers/gitlab/models.d.ts.map +0 -1
- package/dist/plus/integrations/providers/gitlab.d.ts.map +0 -1
- package/dist/plus/integrations/providers/issueSorts.d.ts.map +0 -1
- package/dist/plus/integrations/providers/jira.d.ts.map +0 -1
- package/dist/plus/integrations/providers/jiraIssueByKey.d.ts.map +0 -1
- package/dist/plus/integrations/providers/linear.d.ts.map +0 -1
- package/dist/plus/integrations/providers/models.d.ts.map +0 -1
- package/dist/plus/integrations/providers/providerErrors.d.ts.map +0 -1
- package/dist/plus/integrations/providers/providersApi.d.ts.map +0 -1
- package/dist/plus/integrations/providers/pullRequestReviews.d.ts.map +0 -1
- package/dist/plus/integrations/providers/trello.d.ts.map +0 -1
- package/dist/plus/integrations/providers/utils/providerPaging.d.ts.map +0 -1
- package/dist/plus/integrations/providers/utils.d.ts.map +0 -1
- package/dist/plus/integrations/reads/broaden.d.ts.map +0 -1
- package/dist/plus/integrations/reads/context.d.ts.map +0 -1
- package/dist/plus/integrations/reads/context.js.map +0 -1
- package/dist/plus/integrations/reads/counts.d.ts.map +0 -1
- package/dist/plus/integrations/reads/cursors.d.ts.map +0 -1
- package/dist/plus/integrations/reads/drains.d.ts.map +0 -1
- package/dist/plus/integrations/reads/filters.d.ts.map +0 -1
- package/dist/plus/integrations/reads/hierarchy.d.ts.map +0 -1
- package/dist/plus/integrations/reads/hierarchy.utils.d.ts.map +0 -1
- package/dist/plus/integrations/reads/issueBatch.d.ts.map +0 -1
- package/dist/plus/integrations/reads/issueTracker.d.ts.map +0 -1
- package/dist/plus/integrations/reads/issues.d.ts.map +0 -1
- package/dist/plus/integrations/reads/ordering.d.ts.map +0 -1
- package/dist/plus/integrations/reads/paging.d.ts.map +0 -1
- package/dist/plus/integrations/reads/pullRequests.d.ts.map +0 -1
- package/dist/plus/integrations/reads/resolveRepository.d.ts.map +0 -1
- package/dist/plus/integrations/reads/searchIssues.d.ts.map +0 -1
- package/dist/plus/integrations/reads/searchPullRequests.d.ts.map +0 -1
- package/dist/plus/integrations/reads/sweeps.d.ts.map +0 -1
- package/dist/plus/integrations/reads/trackerIssue.d.ts.map +0 -1
- package/dist/plus/integrations/reads/warnings.d.ts.map +0 -1
- package/dist/plus/integrations/results.d.ts.map +0 -1
- package/dist/plus/integrations/telemetry.d.ts.map +0 -1
- package/dist/plus/integrations/utils/domain.utils.d.ts.map +0 -1
- package/dist/plus/integrations/utils/integration.utils.d.ts.map +0 -1
- package/dist/utils/array.d.ts.map +0 -1
- package/dist/utils/base64.d.ts.map +0 -1
- package/dist/utils/base64.js.map +0 -1
- package/dist/utils/brand.d.ts.map +0 -1
- package/dist/utils/brand.js.map +0 -1
- package/dist/utils/cancellation.d.ts.map +0 -1
- package/dist/utils/charCode.d.ts.map +0 -1
- package/dist/utils/coalescedRun.d.ts.map +0 -1
- package/dist/utils/color.d.ts.map +0 -1
- package/dist/utils/counter.d.ts.map +0 -1
- package/dist/utils/crypto.d.ts.map +0 -1
- package/dist/utils/crypto.js.map +0 -1
- package/dist/utils/date.d.ts.map +0 -1
- package/dist/utils/debounce.d.ts.map +0 -1
- package/dist/utils/decorators/debounce.d.ts.map +0 -1
- package/dist/utils/decorators/gate.d.ts.map +0 -1
- package/dist/utils/decorators/log.d.ts.map +0 -1
- package/dist/utils/decorators/memoize.d.ts.map +0 -1
- package/dist/utils/decorators/resolver.d.ts.map +0 -1
- package/dist/utils/decorators/sequentialize.d.ts.map +0 -1
- package/dist/utils/decorators/serializable.d.ts.map +0 -1
- package/dist/utils/dedupedAsyncCache.d.ts.map +0 -1
- package/dist/utils/diff.d.ts.map +0 -1
- package/dist/utils/disposable.d.ts.map +0 -1
- package/dist/utils/encoding.d.ts.map +0 -1
- package/dist/utils/env/browser/base64.d.ts.map +0 -1
- package/dist/utils/env/browser/crypto.d.ts.map +0 -1
- package/dist/utils/env/browser/fs.d.ts.map +0 -1
- package/dist/utils/env/browser/hex.d.ts.map +0 -1
- package/dist/utils/env/browser/hrtime.d.ts.map +0 -1
- package/dist/utils/env/browser/logScope.d.ts.map +0 -1
- package/dist/utils/env/browser/md5.d.ts.map +0 -1
- package/dist/utils/env/browser/platform.d.ts.map +0 -1
- package/dist/utils/env/node/base64.d.ts.map +0 -1
- package/dist/utils/env/node/crypto.d.ts.map +0 -1
- package/dist/utils/env/node/exec.d.ts.map +0 -1
- package/dist/utils/env/node/fs.d.ts.map +0 -1
- package/dist/utils/env/node/hex.d.ts.map +0 -1
- package/dist/utils/env/node/hrtime.d.ts.map +0 -1
- package/dist/utils/env/node/hrtime.js.map +0 -1
- package/dist/utils/env/node/logScope.d.ts.map +0 -1
- package/dist/utils/env/node/platform.d.ts.map +0 -1
- package/dist/utils/error.d.ts.map +0 -1
- package/dist/utils/event.d.ts.map +0 -1
- package/dist/utils/formatter.d.ts.map +0 -1
- package/dist/utils/fs.d.ts.map +0 -1
- package/dist/utils/fs.js.map +0 -1
- package/dist/utils/function.d.ts.map +0 -1
- package/dist/utils/fuzzy.d.ts.map +0 -1
- package/dist/utils/hash.d.ts.map +0 -1
- package/dist/utils/hex.d.ts.map +0 -1
- package/dist/utils/hex.js.map +0 -1
- package/dist/utils/hrtime.d.ts.map +0 -1
- package/dist/utils/iterable.d.ts.map +0 -1
- package/dist/utils/keys/chord.d.ts.map +0 -1
- package/dist/utils/keys/keybinding.d.ts.map +0 -1
- package/dist/utils/lazy.d.ts.map +0 -1
- package/dist/utils/loggable.d.ts.map +0 -1
- package/dist/utils/logger.d.ts.map +0 -1
- package/dist/utils/logger.scoped.d.ts.map +0 -1
- package/dist/utils/lruMap.d.ts.map +0 -1
- package/dist/utils/markdown.d.ts.map +0 -1
- package/dist/utils/mru.d.ts.map +0 -1
- package/dist/utils/object.d.ts.map +0 -1
- package/dist/utils/paging.d.ts.map +0 -1
- package/dist/utils/path.d.ts.map +0 -1
- package/dist/utils/platform.d.ts.map +0 -1
- package/dist/utils/platform.js.map +0 -1
- package/dist/utils/promise.d.ts.map +0 -1
- package/dist/utils/promiseCache.d.ts.map +0 -1
- package/dist/utils/resourceUsage.d.ts.map +0 -1
- package/dist/utils/resourceUsage.js.map +0 -1
- package/dist/utils/searchTree.d.ts.map +0 -1
- package/dist/utils/stopwatch.d.ts.map +0 -1
- package/dist/utils/string.d.ts.map +0 -1
- package/dist/utils/subscriptionManager.d.ts.map +0 -1
- package/dist/utils/trie.d.ts.map +0 -1
- package/dist/utils/types.d.ts.map +0 -1
- package/dist/utils/types.js.map +0 -1
- package/dist/utils/uri.d.ts.map +0 -1
- package/dist/utils/validation.d.ts.map +0 -1
- package/dist/utils/version.d.ts.map +0 -1
- package/src/git/cache.ts +0 -1859
- package/src/git/context.ts +0 -301
- package/src/git/errors.ts +0 -1168
- package/src/git/features.ts +0 -98
- package/src/git/gitHealth.ts +0 -522
- package/src/git/models/author.ts +0 -19
- package/src/git/models/autolink.ts +0 -59
- package/src/git/models/blame.ts +0 -46
- package/src/git/models/branch.ts +0 -237
- package/src/git/models/commit.ts +0 -673
- package/src/git/models/contributor.ts +0 -84
- package/src/git/models/defaultBranch.ts +0 -6
- package/src/git/models/diff.ts +0 -74
- package/src/git/models/file.ts +0 -29
- package/src/git/models/fileChange.ts +0 -82
- package/src/git/models/fileStatus.ts +0 -36
- package/src/git/models/graph.ts +0 -444
- package/src/git/models/graphSearch.ts +0 -53
- package/src/git/models/graphSession.ts +0 -102
- package/src/git/models/issue.ts +0 -258
- package/src/git/models/issueOrPullRequest.ts +0 -20
- package/src/git/models/lineRange.ts +0 -7
- package/src/git/models/log.ts +0 -21
- package/src/git/models/mergeConflicts.ts +0 -19
- package/src/git/models/patch.ts +0 -25
- package/src/git/models/pausedOperationStatus.ts +0 -63
- package/src/git/models/pullRequest.ts +0 -353
- package/src/git/models/rebase.ts +0 -60
- package/src/git/models/reference.ts +0 -80
- package/src/git/models/reflog.ts +0 -88
- package/src/git/models/remote.ts +0 -100
- package/src/git/models/remoteProvider.ts +0 -291
- package/src/git/models/remoteResource.ts +0 -87
- package/src/git/models/repository.ts +0 -510
- package/src/git/models/repositoryChangeEvent.ts +0 -30
- package/src/git/models/repositoryIdentities.ts +0 -99
- package/src/git/models/repositoryMetadata.ts +0 -12
- package/src/git/models/resourceDescriptor.ts +0 -28
- package/src/git/models/revision.ts +0 -12
- package/src/git/models/search.ts +0 -138
- package/src/git/models/shortlog.ts +0 -6
- package/src/git/models/signature.ts +0 -45
- package/src/git/models/staging.ts +0 -27
- package/src/git/models/stash.ts +0 -6
- package/src/git/models/status.ts +0 -246
- package/src/git/models/statusFile.ts +0 -131
- package/src/git/models/tag.ts +0 -76
- package/src/git/models/tree.ts +0 -10
- package/src/git/models/user.ts +0 -7
- package/src/git/models/worktree.ts +0 -160
- package/src/git/parsers/diffParser.ts +0 -648
- package/src/git/parsers/rebaseTodoParser.ts +0 -169
- package/src/git/providers/blame.ts +0 -40
- package/src/git/providers/branches.ts +0 -143
- package/src/git/providers/commits.ts +0 -174
- package/src/git/providers/config.ts +0 -167
- package/src/git/providers/contributors.ts +0 -34
- package/src/git/providers/diff.ts +0 -133
- package/src/git/providers/graph.ts +0 -95
- package/src/git/providers/maintenance.ts +0 -224
- package/src/git/providers/operations.ts +0 -164
- package/src/git/providers/patch.ts +0 -31
- package/src/git/providers/pausedOperations.ts +0 -23
- package/src/git/providers/provider.ts +0 -64
- package/src/git/providers/refs.ts +0 -68
- package/src/git/providers/remotes.ts +0 -33
- package/src/git/providers/revision.ts +0 -32
- package/src/git/providers/shared/remotes.ts +0 -95
- package/src/git/providers/staging.ts +0 -36
- package/src/git/providers/stash.ts +0 -51
- package/src/git/providers/status.ts +0 -48
- package/src/git/providers/tags.ts +0 -29
- package/src/git/providers/types.ts +0 -33
- package/src/git/providers/worktrees.ts +0 -37
- package/src/git/remotes/azure-devops.ts +0 -307
- package/src/git/remotes/bitbucket-server.ts +0 -189
- package/src/git/remotes/bitbucket.ts +0 -142
- package/src/git/remotes/custom.ts +0 -162
- package/src/git/remotes/gerrit.ts +0 -186
- package/src/git/remotes/gitea.ts +0 -184
- package/src/git/remotes/github.ts +0 -236
- package/src/git/remotes/gitlab.ts +0 -270
- package/src/git/remotes/google-source.ts +0 -51
- package/src/git/remotes/matcher.ts +0 -215
- package/src/git/repositoryService.ts +0 -180
- package/src/git/run.types.ts +0 -156
- package/src/git/service.ts +0 -369
- package/src/git/utils/autolink.utils.ts +0 -202
- package/src/git/utils/blame.utils.ts +0 -298
- package/src/git/utils/branch.utils.ts +0 -165
- package/src/git/utils/commit.utils.ts +0 -89
- package/src/git/utils/config.utils.ts +0 -8
- package/src/git/utils/conflictResolution.utils.ts +0 -157
- package/src/git/utils/contributor.utils.ts +0 -105
- package/src/git/utils/fetch.utils.ts +0 -48
- package/src/git/utils/fileStatus.utils.ts +0 -62
- package/src/git/utils/graph.utils.ts +0 -46
- package/src/git/utils/issue.utils.ts +0 -177
- package/src/git/utils/issueOrPullRequest.utils.ts +0 -23
- package/src/git/utils/mergeConflicts.utils.ts +0 -21
- package/src/git/utils/pausedOperationStatus.utils.ts +0 -184
- package/src/git/utils/pullRequest.utils.ts +0 -244
- package/src/git/utils/reachability.utils.ts +0 -180
- package/src/git/utils/rebase.utils.ts +0 -128
- package/src/git/utils/reference.utils.ts +0 -267
- package/src/git/utils/remote.utils.ts +0 -146
- package/src/git/utils/repository.utils.ts +0 -18
- package/src/git/utils/resourceDescriptor.utils.ts +0 -26
- package/src/git/utils/revision.utils.ts +0 -149
- package/src/git/utils/search.utils.ts +0 -624
- package/src/git/utils/sorting.ts +0 -329
- package/src/git/utils/sshKey.utils.ts +0 -30
- package/src/git/utils/status.utils.ts +0 -115
- package/src/git/utils/statusFile.utils.ts +0 -182
- package/src/git/utils/tag.utils.ts +0 -17
- package/src/git/utils/tooltip.utils.ts +0 -37
- package/src/git/utils/uriAuthority.ts +0 -34
- package/src/git/utils/user.utils.ts +0 -20
- package/src/git/utils/worktree.utils.ts +0 -21
- package/src/git/watching/changeEvent.ts +0 -95
- package/src/git/watching/classifyChange.ts +0 -104
- package/src/git/watching/gitIgnoreFilter.ts +0 -134
- package/src/git/watching/initWatcher.ts +0 -81
- package/src/git/watching/provider.ts +0 -24
- package/src/git/watching/watchGroup.ts +0 -185
- package/src/git/watching/watchService.ts +0 -430
- package/src/git/watching/watchSession.ts +0 -439
- package/src/git/watching/watcherPatterns.ts +0 -51
- package/src/git-cli/cliGitProvider.ts +0 -461
- package/src/git-cli/exec/exec.errors.ts +0 -1
- package/src/git-cli/exec/exec.ts +0 -11
- package/src/git-cli/exec/exec.types.ts +0 -8
- package/src/git-cli/exec/features.ts +0 -2
- package/src/git-cli/exec/git.ts +0 -1371
- package/src/git-cli/exec/gitQueue.ts +0 -326
- package/src/git-cli/exec/locator.ts +0 -157
- package/src/git-cli/parsers/blameParser.ts +0 -374
- package/src/git-cli/parsers/indexParser.ts +0 -192
- package/src/git-cli/parsers/logParser.ts +0 -1365
- package/src/git-cli/parsers/mergeTreeParser.ts +0 -22
- package/src/git-cli/parsers/refParser.ts +0 -110
- package/src/git-cli/parsers/reflogParser.ts +0 -153
- package/src/git-cli/parsers/remoteParser.ts +0 -95
- package/src/git-cli/parsers/shortlogParser.ts +0 -59
- package/src/git-cli/parsers/signatureParser.ts +0 -162
- package/src/git-cli/parsers/sshSignatureParser.ts +0 -85
- package/src/git-cli/parsers/statusParser.ts +0 -209
- package/src/git-cli/parsers/treeParser.ts +0 -61
- package/src/git-cli/parsers/worktreeParser.ts +0 -111
- package/src/git-cli/providers/blame.ts +0 -598
- package/src/git-cli/providers/branches.ts +0 -1931
- package/src/git-cli/providers/commitFilesetUtils.ts +0 -45
- package/src/git-cli/providers/commits.ts +0 -1856
- package/src/git-cli/providers/config.ts +0 -1025
- package/src/git-cli/providers/contributors.ts +0 -360
- package/src/git-cli/providers/diff.ts +0 -1172
- package/src/git-cli/providers/graph.ts +0 -2237
- package/src/git-cli/providers/maintenance.ts +0 -2599
- package/src/git-cli/providers/operations.ts +0 -1016
- package/src/git-cli/providers/patch.ts +0 -305
- package/src/git-cli/providers/pausedOperations.ts +0 -670
- package/src/git-cli/providers/refs.ts +0 -486
- package/src/git-cli/providers/remotes.ts +0 -115
- package/src/git-cli/providers/revision.ts +0 -383
- package/src/git-cli/providers/staging.ts +0 -210
- package/src/git-cli/providers/stash.ts +0 -577
- package/src/git-cli/providers/status.ts +0 -568
- package/src/git-cli/providers/tags.ts +0 -224
- package/src/git-cli/providers/worktrees.ts +0 -285
- package/src/git-cli/service.ts +0 -82
- package/src/ipc/discovery.ts +0 -186
- package/src/ipc/ipcServer.ts +0 -171
- package/src/plus/agents/agentCapabilities.ts +0 -286
- package/src/plus/agents/providers/claudeCodeTranscript.ts +0 -867
- package/src/plus/agents/providers/gkAgentProvider.ts +0 -4036
- package/src/plus/agents/sanitizePrompt.ts +0 -109
- package/src/plus/agents/stateMachine.ts +0 -197
- package/src/plus/agents/types.ts +0 -500
- package/src/plus/ai/constants.ts +0 -121
- package/src/plus/ai/errors.ts +0 -152
- package/src/plus/ai/models/conversation.ts +0 -35
- package/src/plus/ai/models/model.ts +0 -528
- package/src/plus/ai/models/promptTemplates.ts +0 -171
- package/src/plus/ai/models/provider.ts +0 -125
- package/src/plus/ai/models/results.ts +0 -31
- package/src/plus/ai/prompts.ts +0 -849
- package/src/plus/ai/providers/anthropicProvider.ts +0 -458
- package/src/plus/ai/providers/azureProvider.ts +0 -74
- package/src/plus/ai/providers/context.ts +0 -29
- package/src/plus/ai/providers/deepSeekProvider.ts +0 -46
- package/src/plus/ai/providers/geminiProvider.ts +0 -245
- package/src/plus/ai/providers/gitkrakenProvider.ts +0 -347
- package/src/plus/ai/providers/huggingFaceProvider.ts +0 -64
- package/src/plus/ai/providers/mistralProvider.ts +0 -243
- package/src/plus/ai/providers/ollamaProvider.ts +0 -292
- package/src/plus/ai/providers/openAICompatibleProvider.ts +0 -64
- package/src/plus/ai/providers/openAICompatibleProviderBase.ts +0 -654
- package/src/plus/ai/providers/openRouterProvider.ts +0 -101
- package/src/plus/ai/providers/openaiProvider.ts +0 -47
- package/src/plus/ai/providers/responseFormatCache.ts +0 -39
- package/src/plus/ai/providers/xaiProvider.ts +0 -54
- package/src/plus/ai/utils/ai.utils.ts +0 -95
- package/src/plus/ai/utils/results.utils.ts +0 -407
- package/src/plus/ai/utils/truncation.utils.ts +0 -296
- package/src/plus/git-github/api/config.ts +0 -91
- package/src/plus/git-github/api/github.ts +0 -5462
- package/src/plus/git-github/api/github.utils.ts +0 -36
- package/src/plus/git-github/api/issueSearchQuery.ts +0 -273
- package/src/plus/git-github/api/pullRequestSearchQuery.ts +0 -154
- package/src/plus/git-github/api/token.ts +0 -15
- package/src/plus/git-github/api/tokenUtils.ts +0 -15
- package/src/plus/git-github/api/types.ts +0 -197
- package/src/plus/git-github/context.ts +0 -107
- package/src/plus/git-github/models.ts +0 -623
- package/src/plus/git-github/providers/github/blame.ts +0 -225
- package/src/plus/git-github/providers/github/branches.ts +0 -401
- package/src/plus/git-github/providers/github/commits.ts +0 -929
- package/src/plus/git-github/providers/github/config.ts +0 -47
- package/src/plus/git-github/providers/github/contributors.ts +0 -313
- package/src/plus/git-github/providers/github/diff.ts +0 -281
- package/src/plus/git-github/providers/github/graph.ts +0 -635
- package/src/plus/git-github/providers/github/refs.ts +0 -172
- package/src/plus/git-github/providers/github/remotes.ts +0 -44
- package/src/plus/git-github/providers/github/revision.ts +0 -140
- package/src/plus/git-github/providers/github/status.ts +0 -69
- package/src/plus/git-github/providers/github/tags.ts +0 -148
- package/src/plus/git-github/providers/githubGitProvider.ts +0 -168
- package/src/plus/git-github/providers/githubProvider.ts +0 -65
- package/src/plus/integrations/authentication/cloudIntegrationService.ts +0 -292
- package/src/plus/integrations/authentication/configuredIntegrationService.ts +0 -656
- package/src/plus/integrations/authentication/integrationAuthenticationProvider.ts +0 -385
- package/src/plus/integrations/authentication/integrationAuthenticationService.ts +0 -148
- package/src/plus/integrations/authentication/manualTokenProvider.ts +0 -79
- package/src/plus/integrations/authentication/models.ts +0 -202
- package/src/plus/integrations/authentication/rejectedTokenTracker.ts +0 -56
- package/src/plus/integrations/collectionMetadata.ts +0 -325
- package/src/plus/integrations/constants.ts +0 -190
- package/src/plus/integrations/context.ts +0 -386
- package/src/plus/integrations/errors.ts +0 -188
- package/src/plus/integrations/index.ts +0 -231
- package/src/plus/integrations/integrationService.ts +0 -2003
- package/src/plus/integrations/lite.ts +0 -233
- package/src/plus/integrations/manager.ts +0 -728
- package/src/plus/integrations/models/gitHostIntegration.ts +0 -1862
- package/src/plus/integrations/models/integration.ts +0 -1005
- package/src/plus/integrations/models/issueCache.ts +0 -29
- package/src/plus/integrations/models/issueReads.ts +0 -152
- package/src/plus/integrations/models/issuesIntegration.ts +0 -248
- package/src/plus/integrations/models/pullRequestReads.ts +0 -18
- package/src/plus/integrations/providerFilters.ts +0 -36
- package/src/plus/integrations/providers/accounts.ts +0 -38
- package/src/plus/integrations/providers/apiClients.ts +0 -69
- package/src/plus/integrations/providers/apiConfig.ts +0 -71
- package/src/plus/integrations/providers/azure/azure.ts +0 -822
- package/src/plus/integrations/providers/azure/models.ts +0 -621
- package/src/plus/integrations/providers/azureDevOps.ts +0 -1346
- package/src/plus/integrations/providers/bitbucket/bitbucket.ts +0 -904
- package/src/plus/integrations/providers/bitbucket/models.ts +0 -446
- package/src/plus/integrations/providers/bitbucket-server/models.ts +0 -283
- package/src/plus/integrations/providers/bitbucket-server.ts +0 -445
- package/src/plus/integrations/providers/bitbucket.ts +0 -793
- package/src/plus/integrations/providers/github/github.ts +0 -64
- package/src/plus/integrations/providers/github/github.utils.ts +0 -23
- package/src/plus/integrations/providers/github/models.ts +0 -29
- package/src/plus/integrations/providers/github.ts +0 -940
- package/src/plus/integrations/providers/gitlab/gitlab.ts +0 -1320
- package/src/plus/integrations/providers/gitlab/gitlab.utils.ts +0 -80
- package/src/plus/integrations/providers/gitlab/models.ts +0 -271
- package/src/plus/integrations/providers/gitlab.ts +0 -841
- package/src/plus/integrations/providers/issueSorts.ts +0 -89
- package/src/plus/integrations/providers/jira.ts +0 -596
- package/src/plus/integrations/providers/jiraIssueByKey.ts +0 -155
- package/src/plus/integrations/providers/linear.ts +0 -484
- package/src/plus/integrations/providers/models.ts +0 -1816
- package/src/plus/integrations/providers/providerErrors.ts +0 -115
- package/src/plus/integrations/providers/providersApi.ts +0 -1881
- package/src/plus/integrations/providers/pullRequestReviews.ts +0 -122
- package/src/plus/integrations/providers/trello.ts +0 -208
- package/src/plus/integrations/providers/utils/providerPaging.ts +0 -212
- package/src/plus/integrations/providers/utils.ts +0 -419
- package/src/plus/integrations/reads/broaden.ts +0 -704
- package/src/plus/integrations/reads/context.ts +0 -99
- package/src/plus/integrations/reads/counts.ts +0 -610
- package/src/plus/integrations/reads/cursors.ts +0 -224
- package/src/plus/integrations/reads/drains.ts +0 -420
- package/src/plus/integrations/reads/filters.ts +0 -614
- package/src/plus/integrations/reads/hierarchy.ts +0 -486
- package/src/plus/integrations/reads/hierarchy.utils.ts +0 -155
- package/src/plus/integrations/reads/issueBatch.ts +0 -197
- package/src/plus/integrations/reads/issueTracker.ts +0 -556
- package/src/plus/integrations/reads/issues.ts +0 -600
- package/src/plus/integrations/reads/ordering.ts +0 -124
- package/src/plus/integrations/reads/paging.ts +0 -379
- package/src/plus/integrations/reads/pullRequests.ts +0 -260
- package/src/plus/integrations/reads/resolveRepository.ts +0 -272
- package/src/plus/integrations/reads/searchIssues.ts +0 -274
- package/src/plus/integrations/reads/searchPullRequests.ts +0 -235
- package/src/plus/integrations/reads/sweeps.ts +0 -266
- package/src/plus/integrations/reads/trackerIssue.ts +0 -105
- package/src/plus/integrations/reads/warnings.ts +0 -535
- package/src/plus/integrations/results.ts +0 -443
- package/src/plus/integrations/telemetry.ts +0 -29
- package/src/plus/integrations/utils/domain.utils.ts +0 -26
- package/src/plus/integrations/utils/integration.utils.ts +0 -215
- package/src/utils/array.ts +0 -194
- package/src/utils/base64.ts +0 -1
- package/src/utils/brand.ts +0 -7
- package/src/utils/cancellation.ts +0 -199
- package/src/utils/charCode.ts +0 -38
- package/src/utils/coalescedRun.ts +0 -45
- package/src/utils/color.ts +0 -817
- package/src/utils/counter.ts +0 -21
- package/src/utils/crypto.ts +0 -1
- package/src/utils/date.ts +0 -474
- package/src/utils/debounce.ts +0 -303
- package/src/utils/decorators/debounce.ts +0 -31
- package/src/utils/decorators/gate.ts +0 -167
- package/src/utils/decorators/log.ts +0 -320
- package/src/utils/decorators/memoize.ts +0 -98
- package/src/utils/decorators/resolver.ts +0 -95
- package/src/utils/decorators/sequentialize.ts +0 -118
- package/src/utils/decorators/serializable.ts +0 -43
- package/src/utils/dedupedAsyncCache.ts +0 -74
- package/src/utils/diff.ts +0 -61
- package/src/utils/disposable.ts +0 -156
- package/src/utils/encoding.ts +0 -8
- package/src/utils/env/browser/base64.ts +0 -50
- package/src/utils/env/browser/crypto.ts +0 -21
- package/src/utils/env/browser/fs.ts +0 -3
- package/src/utils/env/browser/hex.ts +0 -41
- package/src/utils/env/browser/hrtime.ts +0 -14
- package/src/utils/env/browser/logScope.ts +0 -57
- package/src/utils/env/browser/md5.ts +0 -217
- package/src/utils/env/browser/platform.ts +0 -10
- package/src/utils/env/node/base64.ts +0 -19
- package/src/utils/env/node/crypto.ts +0 -17
- package/src/utils/env/node/exec.ts +0 -488
- package/src/utils/env/node/fs.ts +0 -5
- package/src/utils/env/node/hex.ts +0 -11
- package/src/utils/env/node/hrtime.ts +0 -1
- package/src/utils/env/node/logScope.ts +0 -63
- package/src/utils/env/node/platform.ts +0 -5
- package/src/utils/error.ts +0 -18
- package/src/utils/event.ts +0 -230
- package/src/utils/formatter.ts +0 -198
- package/src/utils/fs.ts +0 -1
- package/src/utils/function.ts +0 -141
- package/src/utils/fuzzy.ts +0 -185
- package/src/utils/hash.ts +0 -60
- package/src/utils/hex.ts +0 -1
- package/src/utils/hrtime.ts +0 -8
- package/src/utils/iterable.ts +0 -797
- package/src/utils/keys/chord.ts +0 -184
- package/src/utils/keys/keybinding.ts +0 -116
- package/src/utils/lazy.ts +0 -39
- package/src/utils/loggable.ts +0 -7
- package/src/utils/logger.scoped.ts +0 -237
- package/src/utils/logger.ts +0 -403
- package/src/utils/lruMap.ts +0 -112
- package/src/utils/markdown.ts +0 -115
- package/src/utils/mru.ts +0 -68
- package/src/utils/object.ts +0 -278
- package/src/utils/paging.ts +0 -97
- package/src/utils/path.ts +0 -204
- package/src/utils/platform.ts +0 -1
- package/src/utils/promise.ts +0 -657
- package/src/utils/promiseCache.ts +0 -908
- package/src/utils/resourceUsage.ts +0 -5
- package/src/utils/searchTree.ts +0 -444
- package/src/utils/stopwatch.ts +0 -125
- package/src/utils/string.ts +0 -1003
- package/src/utils/subscriptionManager.ts +0 -40
- package/src/utils/trie.ts +0 -740
- package/src/utils/types.ts +0 -31
- package/src/utils/uri.ts +0 -118
- package/src/utils/validation.ts +0 -38
- package/src/utils/version.ts +0 -128
|
@@ -1,1338 +1,1068 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { filterMap, flatten } from "../../utils/iterable.js";
|
|
2
|
+
import { getScopedLogger } from "../../utils/logger.scoped.js";
|
|
3
|
+
import { debug, trace } from "../../utils/decorators/log.js";
|
|
4
|
+
import __decorate from "../../_virtual/@oxc-project+runtime/helpers/esm/decorate.js";
|
|
5
|
+
import { fromDisposables } from "../../utils/disposable.js";
|
|
6
|
+
import { Emitter } from "../../utils/event.js";
|
|
7
|
+
import { gate } from "../../utils/decorators/gate.js";
|
|
8
|
+
import { GitCloudHostIntegrationId, GitSelfManagedHostIntegrationId, IssuesCloudHostIntegrationId, IssuesSelfManagedHostIntegrationId } from "./constants.js";
|
|
9
|
+
import { getSupportedCloudIntegrationIds, isSupportedCloudIntegrationId, toIntegrationId } from "./authentication/models.js";
|
|
10
|
+
import { CloudIntegrationService } from "./authentication/cloudIntegrationService.js";
|
|
11
|
+
import { convertRemoteProviderIdToIntegrationId, getIntegrationIdForRemote, isCloudSelfManagedHostIntegrationId, isGitCloudHostIntegrationId, isGitSelfManagedHostIntegrationId, isNonExpiringZeroTokenIntegrationId, isSelfManagedHostIntegrationId, remoteProviderTypeForConfig, remoteProviderTypeForIntegration } from "./utils/integration.utils.js";
|
|
12
|
+
import { providersMetadata } from "./providers/models.js";
|
|
13
|
+
import { hostFromDomain, sameConfiguredBaseUrl } from "./utils/domain.utils.js";
|
|
14
|
+
import { ConfiguredIntegrationService } from "./authentication/configuredIntegrationService.js";
|
|
15
|
+
import { IntegrationAuthenticationService } from "./authentication/integrationAuthenticationService.js";
|
|
16
|
+
import { createApiClients } from "./providers/apiClients.js";
|
|
17
|
+
import { noConnectionWarning } from "./reads/warnings.js";
|
|
18
|
+
import { getSupportedFilters } from "./reads/filters.js";
|
|
19
|
+
import { broadenIssues } from "./reads/broaden.js";
|
|
20
|
+
import { countIssues, countPullRequests } from "./reads/counts.js";
|
|
21
|
+
import { listOrgs, listProjects, listRepos } from "./reads/hierarchy.js";
|
|
22
|
+
import { getIssuesBatch } from "./reads/issueBatch.js";
|
|
23
|
+
import { listIssuesPage } from "./reads/issues.js";
|
|
24
|
+
import { listIssueTrackerIssuesPage } from "./reads/issueTracker.js";
|
|
25
|
+
import { listPullRequestsPage } from "./reads/pullRequests.js";
|
|
26
|
+
import { resolveRepository } from "./reads/resolveRepository.js";
|
|
27
|
+
import { searchIssuesPage } from "./reads/searchIssues.js";
|
|
28
|
+
import { searchPullRequestsPage } from "./reads/searchPullRequests.js";
|
|
29
|
+
import { sweepClosedPullRequests, sweepPullRequests } from "./reads/sweeps.js";
|
|
30
|
+
import { getTrackerIssue } from "./reads/trackerIssue.js";
|
|
31
|
+
//#region ../plus/integrations/src/integrationService.ts
|
|
32
|
+
const maxSmallIntegerV8 = 2 ** 30 - 1;
|
|
33
|
+
var IntegrationService = class {
|
|
34
|
+
authenticationService;
|
|
35
|
+
configuredIntegrationService;
|
|
36
|
+
ctx;
|
|
37
|
+
get onDidChange() {
|
|
38
|
+
return this.configuredIntegrationService.onDidChange;
|
|
39
|
+
}
|
|
40
|
+
_onDidChangeConnectionState = new Emitter();
|
|
41
|
+
get onDidChangeConnectionState() {
|
|
42
|
+
return this._onDidChangeConnectionState.event;
|
|
43
|
+
}
|
|
44
|
+
_connectedCache = /* @__PURE__ */ new Set();
|
|
45
|
+
_disposable;
|
|
46
|
+
_integrations = /* @__PURE__ */ new Map();
|
|
47
|
+
_onDidChangeIntegrationConnection = new Emitter();
|
|
48
|
+
_apiDisposables = [];
|
|
49
|
+
_apis;
|
|
50
|
+
/** The package-built, memoized per-provider API clients (was injected via the now-removed `ctx.apis`). */
|
|
51
|
+
get apis() {
|
|
52
|
+
return this._apis ??= createApiClients(this.ctx, this._apiDisposables);
|
|
53
|
+
}
|
|
54
|
+
/** The shared `GitHubApi` instance — also consumed by the host's GitHub git provider (one instance). */
|
|
55
|
+
get github() {
|
|
56
|
+
return this.apis.github;
|
|
57
|
+
}
|
|
58
|
+
constructor(authenticationService, configuredIntegrationService, ctx) {
|
|
59
|
+
this.authenticationService = authenticationService;
|
|
60
|
+
this.configuredIntegrationService = configuredIntegrationService;
|
|
61
|
+
this.ctx = ctx;
|
|
62
|
+
this._disposable = fromDisposables(ctx.config.onDidChange((e) => {
|
|
63
|
+
if (e.remotes) this._ignoreSSLErrors.clear();
|
|
64
|
+
}), ctx.account.onDidChangeSessions(this.onAuthenticationSessionsChanged, this), ctx.account.onDidCheckIn(this.onUserCheckedIn, this), ctx.account.onDidChange(this.onSubscriptionChanged, this), this._onDidChangeIntegrationConnection.event(this.onIntegrationConnectionChanged, this));
|
|
65
|
+
}
|
|
66
|
+
dispose() {
|
|
67
|
+
this._integrations.forEach((i) => i.dispose());
|
|
68
|
+
this._integrations.clear();
|
|
69
|
+
this._disposable?.dispose();
|
|
70
|
+
this.authenticationService.dispose();
|
|
71
|
+
this.configuredIntegrationService.dispose();
|
|
72
|
+
this._onDidChangeConnectionState.dispose();
|
|
73
|
+
this._onDidChangeIntegrationConnection.dispose();
|
|
74
|
+
this._apiDisposables.forEach((d) => d.dispose());
|
|
75
|
+
}
|
|
76
|
+
async connectCloudIntegrations(connect, source) {
|
|
77
|
+
const scope = getScopedLogger();
|
|
78
|
+
const integrationIds = connect?.integrationIds;
|
|
79
|
+
this.ctx.hooks?.connection?.onStarted?.({ integrationIds }, source);
|
|
80
|
+
const connectedIntegrations = /* @__PURE__ */ new Set();
|
|
81
|
+
if (integrationIds?.length) {
|
|
82
|
+
if (connect?.skipIfConnected && !connect?.skipPreSync) await this.syncCloudIntegrations(true);
|
|
83
|
+
for (const integrationId of integrationIds) try {
|
|
84
|
+
const integration = await this.get(integrationId);
|
|
85
|
+
if (integration == null) continue;
|
|
86
|
+
if (integration.maybeConnected ?? await integration.isConnected()) connectedIntegrations.add(integrationId);
|
|
87
|
+
} catch (ex) {
|
|
88
|
+
scope?.warn(`Failed to get integration ${integrationId} by its ID. Consider it as not-connected and ignore. Error message: ${ex.message}`, scope);
|
|
89
|
+
}
|
|
90
|
+
if (connect?.skipIfConnected && connectedIntegrations.size === integrationIds.length) return true;
|
|
91
|
+
}
|
|
92
|
+
if (!await this.ctx.account.connect({
|
|
93
|
+
integrationIds,
|
|
94
|
+
source
|
|
95
|
+
})) return false;
|
|
96
|
+
const connected = await this.syncCloudIntegrations(true);
|
|
97
|
+
this.ctx.hooks?.connection?.onCompleted?.({
|
|
98
|
+
integrationIds,
|
|
99
|
+
connectedIntegrationIds: connected != null ? [...connected.values()] : void 0
|
|
100
|
+
}, source);
|
|
101
|
+
if (integrationIds != null) {
|
|
102
|
+
for (const integrationId of integrationIds) {
|
|
103
|
+
const integration = await this.get(integrationId);
|
|
104
|
+
if (integration == null) continue;
|
|
105
|
+
if ((integration.maybeConnected ?? await integration.isConnected()) && !connectedIntegrations.has(integrationId)) return true;
|
|
106
|
+
}
|
|
107
|
+
return false;
|
|
108
|
+
}
|
|
109
|
+
return true;
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Starts the cloud connect flow without skipping an already-connected provider, allowing the host/GK Dev
|
|
113
|
+
* flow to add another account for that provider instead of treating the existing primary as sufficient.
|
|
114
|
+
* Returns whether a new connection was actually added (measured by a new cloud connection id appearing),
|
|
115
|
+
* since {@link connectCloudIntegrations} only reports provider-level success and can't detect a newly added
|
|
116
|
+
* secondary for an already-connected provider.
|
|
117
|
+
*/
|
|
118
|
+
async connectSecondary(id, source) {
|
|
119
|
+
const before = new Set(this.getConfigured(id, { cloud: true }).map((c) => c.id));
|
|
120
|
+
await this.connectCloudIntegrations({
|
|
121
|
+
integrationIds: [id],
|
|
122
|
+
skipIfConnected: false
|
|
123
|
+
}, source);
|
|
124
|
+
return this.getConfigured(id, { cloud: true }).some((c) => !before.has(c.id));
|
|
125
|
+
}
|
|
126
|
+
async get(id, domain) {
|
|
127
|
+
if (isSelfManagedHostIntegrationId(id)) domain = hostFromDomain(domain) ?? domain;
|
|
128
|
+
let integration = this.getCached(id, domain);
|
|
129
|
+
if (integration == null) {
|
|
130
|
+
switch (id) {
|
|
131
|
+
case "github":
|
|
132
|
+
integration = new (await (import(
|
|
133
|
+
/* webpackChunkName: "integrations" */
|
|
134
|
+
"./providers/github.js"
|
|
135
|
+
))).GitHubIntegration(this.ctx, this.authenticationService, this.getProvidersApi.bind(this), this._onDidChangeIntegrationConnection);
|
|
136
|
+
break;
|
|
137
|
+
case "cloud-github-enterprise":
|
|
138
|
+
if (domain == null) {
|
|
139
|
+
integration = this.findCachedById(id);
|
|
140
|
+
if (integration != null) return integration;
|
|
141
|
+
const configured = this.getConfigured("cloud-github-enterprise");
|
|
142
|
+
if (configured.length) {
|
|
143
|
+
const { domain: configuredDomain } = configured.find((c) => c.primary) ?? configured[0];
|
|
144
|
+
if (configuredDomain == null) throw new Error(`Domain is required for '${id}' integration`);
|
|
145
|
+
integration = new (await (import(
|
|
146
|
+
/* webpackChunkName: "integrations" */
|
|
147
|
+
"./providers/github.js"
|
|
148
|
+
))).GitHubEnterpriseIntegration(this.ctx, this.authenticationService, this.getProvidersApi.bind(this), this._onDidChangeIntegrationConnection, configuredDomain);
|
|
149
|
+
domain = configuredDomain;
|
|
150
|
+
break;
|
|
151
|
+
}
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
154
|
+
integration = new (await (import(
|
|
155
|
+
/* webpackChunkName: "integrations" */
|
|
156
|
+
"./providers/github.js"
|
|
157
|
+
))).GitHubEnterpriseIntegration(this.ctx, this.authenticationService, this.getProvidersApi.bind(this), this._onDidChangeIntegrationConnection, domain);
|
|
158
|
+
break;
|
|
159
|
+
case "gitlab":
|
|
160
|
+
integration = new (await (import(
|
|
161
|
+
/* webpackChunkName: "integrations" */
|
|
162
|
+
"./providers/gitlab.js"
|
|
163
|
+
))).GitLabIntegration(this.ctx, this.authenticationService, this.getProvidersApi.bind(this), this._onDidChangeIntegrationConnection);
|
|
164
|
+
break;
|
|
165
|
+
case "cloud-gitlab-self-hosted":
|
|
166
|
+
if (domain == null) {
|
|
167
|
+
integration = this.findCachedById(id);
|
|
168
|
+
if (integration != null) return integration;
|
|
169
|
+
const configured = this.getConfigured("cloud-gitlab-self-hosted");
|
|
170
|
+
if (configured.length) {
|
|
171
|
+
const { domain: configuredDomain } = configured.find((c) => c.primary) ?? configured[0];
|
|
172
|
+
if (configuredDomain == null) throw new Error(`Domain is required for '${id}' integration`);
|
|
173
|
+
integration = new (await (import(
|
|
174
|
+
/* webpackChunkName: "integrations" */
|
|
175
|
+
"./providers/gitlab.js"
|
|
176
|
+
))).GitLabSelfHostedIntegration(this.ctx, this.authenticationService, this.getProvidersApi.bind(this), this._onDidChangeIntegrationConnection, configuredDomain);
|
|
177
|
+
domain = configuredDomain;
|
|
178
|
+
break;
|
|
179
|
+
}
|
|
180
|
+
return;
|
|
181
|
+
}
|
|
182
|
+
integration = new (await (import(
|
|
183
|
+
/* webpackChunkName: "integrations" */
|
|
184
|
+
"./providers/gitlab.js"
|
|
185
|
+
))).GitLabSelfHostedIntegration(this.ctx, this.authenticationService, this.getProvidersApi.bind(this), this._onDidChangeIntegrationConnection, domain);
|
|
186
|
+
break;
|
|
187
|
+
case "bitbucket":
|
|
188
|
+
integration = new (await (import(
|
|
189
|
+
/* webpackChunkName: "integrations" */
|
|
190
|
+
"./providers/bitbucket.js"
|
|
191
|
+
))).BitbucketIntegration(this.ctx, this.authenticationService, this.getProvidersApi.bind(this), this._onDidChangeIntegrationConnection);
|
|
192
|
+
break;
|
|
193
|
+
case "bitbucket-server":
|
|
194
|
+
if (domain == null) {
|
|
195
|
+
integration = this.findCachedById(id);
|
|
196
|
+
if (integration != null) return integration;
|
|
197
|
+
const configured = this.getConfigured("bitbucket-server");
|
|
198
|
+
if (configured.length) {
|
|
199
|
+
const { domain: configuredDomain } = configured.find((c) => c.primary) ?? configured[0];
|
|
200
|
+
if (configuredDomain == null) throw new Error(`Domain is required for '${id}' integration`);
|
|
201
|
+
integration = new (await (import(
|
|
202
|
+
/* webpackChunkName: "integrations" */
|
|
203
|
+
"./providers/bitbucket-server.js"
|
|
204
|
+
))).BitbucketServerIntegration(this.ctx, this.authenticationService, this.getProvidersApi.bind(this), this._onDidChangeIntegrationConnection, configuredDomain);
|
|
205
|
+
domain = configuredDomain;
|
|
206
|
+
break;
|
|
207
|
+
}
|
|
208
|
+
return;
|
|
209
|
+
}
|
|
210
|
+
integration = new (await (import(
|
|
211
|
+
/* webpackChunkName: "integrations" */
|
|
212
|
+
"./providers/bitbucket-server.js"
|
|
213
|
+
))).BitbucketServerIntegration(this.ctx, this.authenticationService, this.getProvidersApi.bind(this), this._onDidChangeIntegrationConnection, domain);
|
|
214
|
+
break;
|
|
215
|
+
case "azureDevOps":
|
|
216
|
+
integration = new (await (import(
|
|
217
|
+
/* webpackChunkName: "integrations" */
|
|
218
|
+
"./providers/azureDevOps.js"
|
|
219
|
+
))).AzureDevOpsIntegration(this.ctx, this.authenticationService, this.getProvidersApi.bind(this), this._onDidChangeIntegrationConnection);
|
|
220
|
+
break;
|
|
221
|
+
case "azure-devops-server":
|
|
222
|
+
if (domain == null) {
|
|
223
|
+
integration = this.findCachedById(id);
|
|
224
|
+
if (integration != null) return integration;
|
|
225
|
+
const configured = this.getConfigured("azure-devops-server");
|
|
226
|
+
if (configured.length) {
|
|
227
|
+
const { domain: configuredDomain } = configured.find((c) => c.primary) ?? configured[0];
|
|
228
|
+
if (configuredDomain == null) throw new Error(`Domain is required for '${id}' integration`);
|
|
229
|
+
integration = new (await (import(
|
|
230
|
+
/* webpackChunkName: "integrations" */
|
|
231
|
+
"./providers/azureDevOps.js"
|
|
232
|
+
))).AzureDevOpsServerIntegration(this.ctx, this.authenticationService, this.getProvidersApi.bind(this), this._onDidChangeIntegrationConnection, configuredDomain);
|
|
233
|
+
domain = configuredDomain;
|
|
234
|
+
break;
|
|
235
|
+
}
|
|
236
|
+
return;
|
|
237
|
+
}
|
|
238
|
+
integration = new (await (import(
|
|
239
|
+
/* webpackChunkName: "integrations" */
|
|
240
|
+
"./providers/azureDevOps.js"
|
|
241
|
+
))).AzureDevOpsServerIntegration(this.ctx, this.authenticationService, this.getProvidersApi.bind(this), this._onDidChangeIntegrationConnection, domain);
|
|
242
|
+
break;
|
|
243
|
+
case "jira":
|
|
244
|
+
integration = new (await (import(
|
|
245
|
+
/* webpackChunkName: "integrations" */
|
|
246
|
+
"./providers/jira.js"
|
|
247
|
+
))).JiraIntegration(this.ctx, this.authenticationService, this.getProvidersApi.bind(this), this._onDidChangeIntegrationConnection);
|
|
248
|
+
break;
|
|
249
|
+
case "jira-server":
|
|
250
|
+
if (domain == null) {
|
|
251
|
+
integration = this.findCachedById(id);
|
|
252
|
+
if (integration != null) return integration;
|
|
253
|
+
const configured = this.getConfigured("jira-server");
|
|
254
|
+
if (configured.length) {
|
|
255
|
+
const { domain: configuredDomain } = configured.find((c) => c.primary) ?? configured[0];
|
|
256
|
+
if (configuredDomain == null) throw new Error(`Domain is required for '${id}' integration`);
|
|
257
|
+
integration = new (await (import(
|
|
258
|
+
/* webpackChunkName: "integrations" */
|
|
259
|
+
"./providers/jira-server.js"
|
|
260
|
+
))).JiraServerIntegration(this.ctx, this.authenticationService, this.getProvidersApi.bind(this), this._onDidChangeIntegrationConnection, configuredDomain);
|
|
261
|
+
domain = configuredDomain;
|
|
262
|
+
break;
|
|
263
|
+
}
|
|
264
|
+
return;
|
|
265
|
+
}
|
|
266
|
+
integration = new (await (import(
|
|
267
|
+
/* webpackChunkName: "integrations" */
|
|
268
|
+
"./providers/jira-server.js"
|
|
269
|
+
))).JiraServerIntegration(this.ctx, this.authenticationService, this.getProvidersApi.bind(this), this._onDidChangeIntegrationConnection, domain);
|
|
270
|
+
break;
|
|
271
|
+
case "linear":
|
|
272
|
+
integration = new (await (import(
|
|
273
|
+
/* webpackChunkName: "integrations" */
|
|
274
|
+
"./providers/linear.js"
|
|
275
|
+
))).LinearIntegration(this.ctx, this.authenticationService, this.getProvidersApi.bind(this), this._onDidChangeIntegrationConnection);
|
|
276
|
+
break;
|
|
277
|
+
case "trello":
|
|
278
|
+
integration = new (await (import(
|
|
279
|
+
/* webpackChunkName: "integrations" */
|
|
280
|
+
"./providers/trello.js"
|
|
281
|
+
))).TrelloIntegration(this.ctx, this.authenticationService, this.getProvidersApi.bind(this), this._onDidChangeIntegrationConnection);
|
|
282
|
+
break;
|
|
283
|
+
default: throw new Error(`Integration with '${id}' is not supported`);
|
|
284
|
+
}
|
|
285
|
+
this._integrations.set(this.getCacheKey(id, domain), integration);
|
|
286
|
+
}
|
|
287
|
+
return integration;
|
|
288
|
+
}
|
|
289
|
+
getConfigured(id, options) {
|
|
290
|
+
return this.configuredIntegrationService.getConfigured(id, options);
|
|
291
|
+
}
|
|
292
|
+
/**
|
|
293
|
+
* The filters this provider's reads accept — part of the public {@link IntegrationManager} contract, so it
|
|
294
|
+
* stays a method here even though it needs no instance state; see {@link getSupportedFilters} for the
|
|
295
|
+
* capability table itself and why a consumer should intersect against it before reading.
|
|
296
|
+
*/
|
|
297
|
+
getSupportedFilters(providerId) {
|
|
298
|
+
return getSupportedFilters(providerId);
|
|
299
|
+
}
|
|
300
|
+
/**
|
|
301
|
+
* Returns the connected integration for a `GitRemote`, if any.
|
|
302
|
+
* Internal counterpart to the host's `getRemoteIntegration(remote)` helper.
|
|
303
|
+
*/
|
|
304
|
+
async getByRemote(remote) {
|
|
305
|
+
if (remote?.provider == null) return void 0;
|
|
306
|
+
const integrationId = getIntegrationIdForRemote(remote.provider);
|
|
307
|
+
if (integrationId == null) return void 0;
|
|
308
|
+
const integration = await this.get(integrationId, remote.provider?.domain);
|
|
309
|
+
return integration?.type === "git" ? integration : void 0;
|
|
310
|
+
}
|
|
311
|
+
async getMyIssues(integrationIds, options) {
|
|
312
|
+
const integrations = /* @__PURE__ */ new Map();
|
|
313
|
+
const hostingIntegrationIds = integrationIds?.filter((id) => id in GitCloudHostIntegrationId || id in GitSelfManagedHostIntegrationId);
|
|
314
|
+
const openRemotesByIntegrationId = /* @__PURE__ */ new Map();
|
|
315
|
+
let hasOpenAzureRepository = false;
|
|
316
|
+
for (const remote of await this.ctx.repositories.getOpenRemotes()) {
|
|
317
|
+
const remoteIntegration = await this.getByRemote(remote);
|
|
318
|
+
if (remoteIntegration == null) continue;
|
|
319
|
+
if (remoteIntegration.id === "azureDevOps") hasOpenAzureRepository = true;
|
|
320
|
+
for (const integrationId of hostingIntegrationIds?.length ? hostingIntegrationIds : [...Object.values(GitCloudHostIntegrationId), ...Object.values(GitSelfManagedHostIntegrationId)]) if (remoteIntegration.id === integrationId && remote.provider?.owner != null && remote.provider?.repoName != null) {
|
|
321
|
+
const descriptor = {
|
|
322
|
+
key: `${remote.provider.owner}/${remote.provider.repoName}`,
|
|
323
|
+
owner: remote.provider.owner,
|
|
324
|
+
name: remote.provider.repoName
|
|
325
|
+
};
|
|
326
|
+
if (openRemotesByIntegrationId.has(integrationId)) openRemotesByIntegrationId.get(integrationId)?.push(descriptor);
|
|
327
|
+
else openRemotesByIntegrationId.set(integrationId, [descriptor]);
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
for (const integrationId of integrationIds?.length ? integrationIds : [
|
|
331
|
+
...Object.values(GitCloudHostIntegrationId),
|
|
332
|
+
...Object.values(IssuesCloudHostIntegrationId),
|
|
333
|
+
...Object.values(IssuesSelfManagedHostIntegrationId),
|
|
334
|
+
...Object.values(GitSelfManagedHostIntegrationId)
|
|
335
|
+
]) {
|
|
336
|
+
const integration = await this.get(integrationId);
|
|
337
|
+
const isInvalidIntegration = options?.openRepositoriesOnly && integrationId !== "azureDevOps" && (isGitCloudHostIntegrationId(integrationId) || isGitSelfManagedHostIntegrationId(integrationId)) && !openRemotesByIntegrationId.has(integrationId) || integrationId === "azureDevOps" && !hasOpenAzureRepository;
|
|
338
|
+
if (integration == null || isInvalidIntegration) continue;
|
|
339
|
+
integrations.set(integration, options?.openRepositoriesOnly && !isInvalidIntegration ? openRemotesByIntegrationId.get(integrationId) : void 0);
|
|
340
|
+
}
|
|
341
|
+
if (integrations.size === 0) return void 0;
|
|
342
|
+
return this.getMyIssuesCore(integrations, options?.cancellation);
|
|
343
|
+
}
|
|
344
|
+
async getMyIssuesCore(integrations, cancellation) {
|
|
345
|
+
const start = performance.now();
|
|
346
|
+
const promises = [];
|
|
347
|
+
for (const [integration, repos] of integrations) {
|
|
348
|
+
if (integration == null) continue;
|
|
349
|
+
promises.push(integration.searchMyIssuesResult(repos, cancellation));
|
|
350
|
+
}
|
|
351
|
+
const results = await Promise.allSettled(promises);
|
|
352
|
+
const successfulResults = [...flatten(filterMap(results, (r) => r.status === "fulfilled" && r.value?.value != null ? r.value.value : void 0))];
|
|
353
|
+
const errors = [...filterMap(results, (r) => r.status === "fulfilled" && r.value?.error != null ? r.value.error : void 0)];
|
|
354
|
+
return {
|
|
355
|
+
value: successfulResults,
|
|
356
|
+
error: errors.length === 0 ? void 0 : errors.length === 1 ? errors[0] : new AggregateError(errors, "Failed to get some issues"),
|
|
357
|
+
duration: performance.now() - start
|
|
358
|
+
};
|
|
359
|
+
}
|
|
360
|
+
async getMyIssuesForRemotes(remoteOrRemotes) {
|
|
361
|
+
if (!Array.isArray(remoteOrRemotes)) remoteOrRemotes = [remoteOrRemotes];
|
|
362
|
+
if (!remoteOrRemotes.length) return void 0;
|
|
363
|
+
if (remoteOrRemotes.length === 1) {
|
|
364
|
+
const [remote] = remoteOrRemotes;
|
|
365
|
+
if (remote?.provider == null) return void 0;
|
|
366
|
+
return (await this.getByRemote(remote))?.searchMyIssuesResult(remote.provider.repoDesc);
|
|
367
|
+
}
|
|
368
|
+
const integrations = /* @__PURE__ */ new Map();
|
|
369
|
+
for (const remote of remoteOrRemotes) {
|
|
370
|
+
if (remote?.provider == null) continue;
|
|
371
|
+
const integration = await this.getByRemote(remote);
|
|
372
|
+
if (integration == null) continue;
|
|
373
|
+
let repos = integrations.get(integration);
|
|
374
|
+
if (repos == null) {
|
|
375
|
+
repos = [];
|
|
376
|
+
integrations.set(integration, repos);
|
|
377
|
+
}
|
|
378
|
+
repos.push(remote.provider.repoDesc);
|
|
379
|
+
}
|
|
380
|
+
return this.getMyIssuesCore(integrations);
|
|
381
|
+
}
|
|
382
|
+
async getMyCurrentAccounts(integrationIds, connectionId) {
|
|
383
|
+
const accounts = /* @__PURE__ */ new Map();
|
|
384
|
+
await Promise.allSettled(integrationIds.map(async (integrationId) => {
|
|
385
|
+
const integration = await this.getIntegrationForRead(integrationId, connectionId);
|
|
386
|
+
if (integration == null) return;
|
|
387
|
+
const account = await integration.getCurrentAccount({ connectionId });
|
|
388
|
+
if (account) accounts.set(integrationId, account);
|
|
389
|
+
}));
|
|
390
|
+
return accounts;
|
|
391
|
+
}
|
|
392
|
+
async getMyPullRequests(integrationIds, cancellation, options) {
|
|
393
|
+
const integrations = /* @__PURE__ */ new Map();
|
|
394
|
+
for (const integrationId of integrationIds?.length ? integrationIds : Object.values(GitCloudHostIntegrationId)) {
|
|
395
|
+
let integration;
|
|
396
|
+
try {
|
|
397
|
+
integration = await this.get(integrationId);
|
|
398
|
+
} catch {}
|
|
399
|
+
if (integration == null) continue;
|
|
400
|
+
integrations.set(integration, void 0);
|
|
401
|
+
}
|
|
402
|
+
if (integrations.size === 0) return void 0;
|
|
403
|
+
return this.getMyPullRequestsCore(integrations, cancellation, options);
|
|
404
|
+
}
|
|
405
|
+
async getMyPullRequestsCore(integrations, cancellation, options) {
|
|
406
|
+
const start = performance.now();
|
|
407
|
+
const promises = [];
|
|
408
|
+
for (const [integration, repos] of integrations) {
|
|
409
|
+
if (integration == null) continue;
|
|
410
|
+
promises.push(integration.searchMyPullRequests(repos, cancellation, options));
|
|
411
|
+
}
|
|
412
|
+
const results = await Promise.allSettled(promises);
|
|
413
|
+
const successfulResults = [...flatten(filterMap(results, (r) => r.status === "fulfilled" && r.value?.value != null ? r.value.value : void 0))];
|
|
414
|
+
const errors = [...filterMap(results, (r) => r.status === "fulfilled" && r.value?.error != null ? r.value.error : void 0)];
|
|
415
|
+
return {
|
|
416
|
+
value: successfulResults,
|
|
417
|
+
error: errors.length === 0 ? void 0 : errors.length === 1 ? errors[0] : new AggregateError(errors, "Failed to get some pull requests"),
|
|
418
|
+
duration: performance.now() - start
|
|
419
|
+
};
|
|
420
|
+
}
|
|
421
|
+
async getMyPullRequestsForRemotes(remoteOrRemotes) {
|
|
422
|
+
if (!Array.isArray(remoteOrRemotes)) remoteOrRemotes = [remoteOrRemotes];
|
|
423
|
+
if (!remoteOrRemotes.length) return void 0;
|
|
424
|
+
if (remoteOrRemotes.length === 1) {
|
|
425
|
+
const [remote] = remoteOrRemotes;
|
|
426
|
+
if (remote?.provider == null) return void 0;
|
|
427
|
+
return (await this.getByRemote(remote))?.searchMyPullRequests(remote.provider.repoDesc);
|
|
428
|
+
}
|
|
429
|
+
const integrations = /* @__PURE__ */ new Map();
|
|
430
|
+
for (const remote of remoteOrRemotes) {
|
|
431
|
+
if (remote?.provider == null) continue;
|
|
432
|
+
const integration = await this.getByRemote(remote);
|
|
433
|
+
if (integration == null) continue;
|
|
434
|
+
let repos = integrations.get(integration);
|
|
435
|
+
if (repos == null) {
|
|
436
|
+
repos = [];
|
|
437
|
+
integrations.set(integration, repos);
|
|
438
|
+
}
|
|
439
|
+
repos.push(remote.provider.repoDesc);
|
|
440
|
+
}
|
|
441
|
+
return this.getMyPullRequestsCore(integrations);
|
|
442
|
+
}
|
|
443
|
+
/**
|
|
444
|
+
* Warnings for an early-returning read where the integration couldn't be resolved. When a specific
|
|
445
|
+
* `connectionId` or self-managed `domain` was requested, a missing integration means that target is
|
|
446
|
+
* unavailable — surface a `no-connection` warning + `fetchFailed` so the caller can tell it apart from
|
|
447
|
+
* a truly empty account. Without an explicit target, it's simply not connected, which stays a silent
|
|
448
|
+
* empty result.
|
|
449
|
+
*/
|
|
450
|
+
earlyReturnConnectionWarnings(id, connectionId, domain) {
|
|
451
|
+
const requestedDomain = isSelfManagedHostIntegrationId(id) ? domain : void 0;
|
|
452
|
+
const invalidDomain = this.isEmptyExplicitSelector(domain);
|
|
453
|
+
if (connectionId == null && requestedDomain == null && !invalidDomain) return {
|
|
454
|
+
warnings: [],
|
|
455
|
+
fetchFailed: false
|
|
456
|
+
};
|
|
457
|
+
const resolvedDomain = invalidDomain ? domain?.trim() : this.resolveDomainForRead(id, connectionId, requestedDomain);
|
|
458
|
+
return {
|
|
459
|
+
warnings: [noConnectionWarning(id, resolvedDomain, connectionId)],
|
|
460
|
+
fetchFailed: true
|
|
461
|
+
};
|
|
462
|
+
}
|
|
463
|
+
isEmptyExplicitSelector(value) {
|
|
464
|
+
return value?.trim().length === 0;
|
|
465
|
+
}
|
|
466
|
+
domainForRead(integration, id, connectionId, domain) {
|
|
467
|
+
if (!isSelfManagedHostIntegrationId(id)) return connectionId != null ? this.getConfiguredConnectionDomain(id, connectionId) : integration.domain;
|
|
468
|
+
return this.resolveDomainForRead(id, connectionId, domain) ?? integration.domain;
|
|
469
|
+
}
|
|
470
|
+
/**
|
|
471
|
+
* Resolves the right integration instance for a read. A configured connection domain takes precedence over
|
|
472
|
+
* an explicit fallback domain; the latter lets external/manual authentication providers address a
|
|
473
|
+
* self-managed host without persisting `ConfiguredIntegrationService` state.
|
|
474
|
+
*/
|
|
475
|
+
async getIntegrationForRead(id, connectionId, domain) {
|
|
476
|
+
if (this.isEmptyExplicitSelector(connectionId) || this.isEmptyExplicitSelector(domain)) return void 0;
|
|
477
|
+
const resolvedDomain = this.resolveDomainForRead(id, connectionId, domain);
|
|
478
|
+
try {
|
|
479
|
+
return await this.get(id, resolvedDomain);
|
|
480
|
+
} catch {
|
|
481
|
+
return;
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
resolveDomainForRead(id, connectionId, domain) {
|
|
485
|
+
if (!isSelfManagedHostIntegrationId(id)) return void 0;
|
|
486
|
+
return (connectionId != null ? this.getConfiguredConnectionDomain(id, connectionId) : void 0) ?? hostFromDomain(domain) ?? this.primaryConfiguredDomain(id);
|
|
487
|
+
}
|
|
488
|
+
/** The primary configured host for a self-managed provider (first configured when none is flagged primary). */
|
|
489
|
+
primaryConfiguredDomain(id) {
|
|
490
|
+
const configured = this.getConfigured(id);
|
|
491
|
+
return (configured.find((c) => c.primary) ?? configured[0])?.domain;
|
|
492
|
+
}
|
|
493
|
+
/**
|
|
494
|
+
* Forces a real session refresh before a read when `forceSync` is set, so the read consumes a freshly
|
|
495
|
+
* exchanged token rather than a possibly-stale cached one. Both paths refresh, by different mechanisms: a
|
|
496
|
+
* per-connection (`connectionId`) read syncs that specific connection's session directly through the auth
|
|
497
|
+
* provider (the integration's primary-only sync path would never reach a secondary account), while a
|
|
498
|
+
* primary read syncs via the integration's own cloud-connection machinery.
|
|
499
|
+
* Best-effort — a failed sync is swallowed so the read still proceeds (and surfaces its own warning).
|
|
500
|
+
*/
|
|
501
|
+
async forceRefreshIfRequested(integration, forceSync, connectionId) {
|
|
502
|
+
if (forceSync !== true) return;
|
|
503
|
+
try {
|
|
504
|
+
if (connectionId != null) {
|
|
505
|
+
const authProvider = await this.authenticationService.get(integration.authProvider.id);
|
|
506
|
+
const descriptor = {
|
|
507
|
+
...integration.authProviderDescriptor,
|
|
508
|
+
connectionId,
|
|
509
|
+
cloud: true
|
|
510
|
+
};
|
|
511
|
+
await authProvider?.deleteSession(descriptor);
|
|
512
|
+
await authProvider?.getSession(descriptor, { sync: true });
|
|
513
|
+
} else await integration.syncCloudConnection("connected", true);
|
|
514
|
+
} catch {}
|
|
515
|
+
}
|
|
516
|
+
/**
|
|
517
|
+
* Lists the orgs/workspaces/groups (and issue-tracker resources) visible to the user, unified into
|
|
518
|
+
* {@link ProviderOrganization}. Scoped to `providerId` when given, otherwise fanned out over every
|
|
519
|
+
* supported provider. `connectionId` only makes sense with a single `providerId`.
|
|
520
|
+
*/
|
|
521
|
+
async listOrgs(options) {
|
|
522
|
+
return listOrgs(this, options);
|
|
523
|
+
}
|
|
524
|
+
/**
|
|
525
|
+
* Lists the projects visible to the user, unified into the {@link ProviderOrganization}
|
|
526
|
+
* `{ providerId, id, name, org?, url }` shape. Covers issue-tracker providers (Jira/Linear, which expose
|
|
527
|
+
* projects under their resources) *and* git hosts that have a project tier (Azure DevOps, whose repos are
|
|
528
|
+
* org + project scoped). Scoped to `providerId` when given, else fanned out over both the supported issue
|
|
529
|
+
* trackers and Azure DevOps. Providers with no project tier (GitHub, GitLab, Bitbucket) contribute nothing.
|
|
530
|
+
*/
|
|
531
|
+
async listProjects(options) {
|
|
532
|
+
return listProjects(this, options);
|
|
533
|
+
}
|
|
534
|
+
/**
|
|
535
|
+
* Lists repositories under an org for a git-host provider, one page at a time. Pass `page` (1-based)
|
|
536
|
+
* to advance; the returned `cursor` is only meaningful for cursor-only hosts.
|
|
537
|
+
*/
|
|
538
|
+
async listRepos(options) {
|
|
539
|
+
return listRepos(this, options);
|
|
540
|
+
}
|
|
541
|
+
/**
|
|
542
|
+
* Reads one page of the user's pull requests for the given git-host provider. With `repos`, reads those
|
|
543
|
+
* repos' PRs (translating `page` ↔ the provider's opaque cursor) and maps the raw provider PRs to
|
|
544
|
+
* {@link PullRequestShape}. With no `repos`, reads the current user's PRs account-wide — the
|
|
545
|
+
* repo-scoped core rejects an empty `repos` input for GitHub/Bitbucket/Azure, so route to the
|
|
546
|
+
* account-wide `searchMyPullRequests` core instead (which is already user-scoped and returns shapes).
|
|
547
|
+
*/
|
|
548
|
+
async listPullRequestsPage(options) {
|
|
549
|
+
return listPullRequestsPage(this, options);
|
|
550
|
+
}
|
|
551
|
+
/** See {@link IntegrationManager.searchPullRequestsPage}. */
|
|
552
|
+
async searchPullRequestsPage(options) {
|
|
553
|
+
return searchPullRequestsPage(this, options);
|
|
554
|
+
}
|
|
555
|
+
async listIssuesPage(options) {
|
|
556
|
+
return listIssuesPage(this, options);
|
|
557
|
+
}
|
|
558
|
+
/**
|
|
559
|
+
* Issues matching structured criteria over a repository/org scope, with no forced relationship to the current
|
|
560
|
+
* user — see {@link IntegrationManager.searchIssuesPage} for the contract (mandatory scope, guaranteed
|
|
561
|
+
* most-recently-updated-first ordering, and the result-ceiling omission that carries the total match count).
|
|
562
|
+
*/
|
|
563
|
+
async searchIssuesPage(options) {
|
|
564
|
+
return searchIssuesPage(this, options);
|
|
565
|
+
}
|
|
566
|
+
/**
|
|
567
|
+
* How many issues match each scope, without fetching any — see {@link IntegrationManager.countIssues} for the
|
|
568
|
+
* cost model, the per-scope isolation rules, and why `count: undefined` must not be rendered as zero.
|
|
569
|
+
*/
|
|
570
|
+
async countIssues(options) {
|
|
571
|
+
return countIssues(this, options);
|
|
572
|
+
}
|
|
573
|
+
async getIssuesBatch(options) {
|
|
574
|
+
return getIssuesBatch(this, options);
|
|
575
|
+
}
|
|
576
|
+
async getTrackerIssue(options) {
|
|
577
|
+
return getTrackerIssue(this, options);
|
|
578
|
+
}
|
|
579
|
+
/**
|
|
580
|
+
* How many pull requests match each scope, without fetching any — the PR twin of {@link countIssues}. See
|
|
581
|
+
* {@link IntegrationManager.countPullRequests} for the cost model, the per-scope isolation rules, and why
|
|
582
|
+
* `count: undefined` must not be rendered as zero.
|
|
583
|
+
*/
|
|
584
|
+
async countPullRequests(options) {
|
|
585
|
+
return countPullRequests(this, options);
|
|
586
|
+
}
|
|
587
|
+
/**
|
|
588
|
+
* Reads the user's issues from an issue-tracker provider (Jira/Linear/Trello), whose issues live under
|
|
589
|
+
* resource → project (not repos), so they can't go through {@link listIssuesPage} (git-host, repo-scoped).
|
|
590
|
+
* Returns the normalized {@link IssueShape} these providers produce, aggregated across the projects of the
|
|
591
|
+
* given `org` (or every visible resource/project when omitted). `includeAllAssignees` drops the
|
|
592
|
+
* "assigned to me" scoping so unassigned issues are included. Best-effort: a per-step failure becomes a
|
|
593
|
+
* warning without failing the whole read.
|
|
594
|
+
*
|
|
595
|
+
* Paginated by project: these providers have no single cross-project issue cursor, so a page is a bounded
|
|
596
|
+
* window of projects (each drained by its own read). Pagination is opt-in — a caller that supplies none of
|
|
597
|
+
* `page`/`cursor`/`itemsPerPage` reads every matched project in one page (`hasMore: false`), preserving the
|
|
598
|
+
* "aggregate everything" contract for callers that don't page. When any of those is supplied, the read is
|
|
599
|
+
* windowed to `itemsPerPage` projects (default 20) advanced 1-based via `page`/`cursor`, with `hasMore`/
|
|
600
|
+
* `cursor` carrying the next window. Note: a project's own read has an internal page backstop (see the
|
|
601
|
+
* per-provider drains); if a single project exceeds it, its extra issues can't be paged from here, but that
|
|
602
|
+
* incompleteness IS surfaced as `page.truncated` (Jira/Linear report the backstop hit) rather than passed
|
|
603
|
+
* off as a complete read.
|
|
604
|
+
*
|
|
605
|
+
* `connectionId`/`domain` select which connection to read, as on the git-host reads. Both matter for a
|
|
606
|
+
* self-managed tracker ({@link IssuesSelfManagedHostIntegrationId}), where one provider id spans a
|
|
607
|
+
* connection per configured host; omitting them reads the primary. A cloud tracker has a single canonical
|
|
608
|
+
* host, so neither changes what it reads.
|
|
609
|
+
*/
|
|
610
|
+
async listIssueTrackerIssuesPage(options) {
|
|
611
|
+
return listIssueTrackerIssuesPage(this, options);
|
|
612
|
+
}
|
|
613
|
+
/**
|
|
614
|
+
* Sweeps the user's pull requests across providers by draining every page (an "all-pages" read),
|
|
615
|
+
* returning the neutral sweep result with per-provider warnings. `truncated` is set when a provider
|
|
616
|
+
* hit `maxPages` with more still available; `fetchFailed` when a drain aborted on a read error.
|
|
617
|
+
* `targets` selects a connection/domain independently for each provider. The legacy `connectionId` is
|
|
618
|
+
* honored only when `providerIds` resolves to a single provider (otherwise ambiguous).
|
|
619
|
+
*/
|
|
620
|
+
async sweepPullRequests(options) {
|
|
621
|
+
return sweepPullRequests(this, options);
|
|
622
|
+
}
|
|
623
|
+
/**
|
|
624
|
+
* Closed/merged counterpart of {@link sweepPullRequests}, feeding Kepler's Kanban "done" column. Applies
|
|
625
|
+
* the native cross-provider state filter (`Closed` + `Merged`) so it works beyond GitHub.
|
|
626
|
+
*/
|
|
627
|
+
async sweepClosedPullRequests(options) {
|
|
628
|
+
return sweepClosedPullRequests(this, options);
|
|
629
|
+
}
|
|
630
|
+
/**
|
|
631
|
+
* Broadens the user's issues by fanning out over the supplied orgs: for each org it lists the org's
|
|
632
|
+
* repositories, then reads that org's issues. A per-org failure becomes a warning without failing the
|
|
633
|
+
* whole fan-out. `broadenedProviderIds` lists the distinct providers whose issue read resolved (even
|
|
634
|
+
* if every issue duplicated a baseline). `failedProviderIds` identifies providers with no usable org;
|
|
635
|
+
* `incompleteProviderIds` identifies providers with both a usable org and a failed/truncated sibling.
|
|
636
|
+
* `fanOutCount` is the number of org work items spawned.
|
|
637
|
+
* Each org may carry its own `connectionId` (and, for a self-managed host with no configured connection, its
|
|
638
|
+
* own `domain`) to target a specific account — the fan-out spans providers, so the target is scoped per org
|
|
639
|
+
* rather than globally.
|
|
640
|
+
*/
|
|
641
|
+
async broadenIssues(options) {
|
|
642
|
+
return broadenIssues(this, options);
|
|
643
|
+
}
|
|
644
|
+
/**
|
|
645
|
+
* Resolves a repository from a remote URL to its provider identity, using core-gitlens' remote matcher
|
|
646
|
+
* plus the provider's `getRepo` (the equivalent of `gk repo resolve`). Supports every provider whose
|
|
647
|
+
* client exposes `getRepo`. Per-request outcomes preserve the distinctions consumers need for their
|
|
648
|
+
* canonicalization policy.
|
|
649
|
+
*/
|
|
650
|
+
async resolveRepository(options) {
|
|
651
|
+
return resolveRepository(this, options);
|
|
652
|
+
}
|
|
653
|
+
/** {@link RepositoryResolutionContext} seam: the user's `remotes` configs, for the remote matcher. */
|
|
654
|
+
getRemoteConfigs() {
|
|
655
|
+
return this.ctx.config.getRemoteConfigs();
|
|
656
|
+
}
|
|
657
|
+
/** {@link RepositoryResolutionContext} seam: instance lookup by host, for the cloud-host resolution branch. */
|
|
658
|
+
getIntegrationForDomain(id, domain) {
|
|
659
|
+
return this.get(id, domain);
|
|
660
|
+
}
|
|
661
|
+
_ignoreSSLErrors = /* @__PURE__ */ new Map();
|
|
662
|
+
ignoreSSLErrors(integration) {
|
|
663
|
+
if (this.ctx.http.isWeb) return false;
|
|
664
|
+
const cacheKey = `${integration.id}:${integration.domain ?? ""}`;
|
|
665
|
+
let ignoreSSLErrors = this._ignoreSSLErrors.get(cacheKey);
|
|
666
|
+
if (ignoreSSLErrors === void 0) {
|
|
667
|
+
const integrationRemoteType = remoteProviderTypeForIntegration(integration.id);
|
|
668
|
+
ignoreSSLErrors = this.ctx.config.getRemoteConfigs().find((remote) => {
|
|
669
|
+
if (integration.domain == null || integrationRemoteType == null) return false;
|
|
670
|
+
if (remoteProviderTypeForConfig(remote.type) !== integrationRemoteType) return false;
|
|
671
|
+
if (remote.domain != null) return remote.domain === integration.domain;
|
|
672
|
+
if (remote.regex) try {
|
|
673
|
+
return new RegExp(remote.regex, "i").test(integration.domain);
|
|
674
|
+
} catch {
|
|
675
|
+
return false;
|
|
676
|
+
}
|
|
677
|
+
return false;
|
|
678
|
+
})?.ignoreSSLErrors ?? false;
|
|
679
|
+
this._ignoreSSLErrors.set(cacheKey, ignoreSSLErrors);
|
|
680
|
+
}
|
|
681
|
+
return ignoreSSLErrors;
|
|
682
|
+
}
|
|
683
|
+
async manageCloudIntegrations(source) {
|
|
684
|
+
this.ctx.hooks?.connection?.onManaged?.(source);
|
|
685
|
+
if (!await this.ctx.account.openManagement(source)) return;
|
|
686
|
+
const connected = await this.syncCloudIntegrations(true);
|
|
687
|
+
this.ctx.hooks?.connection?.onCompleted?.({
|
|
688
|
+
integrationIds: void 0,
|
|
689
|
+
connectedIntegrationIds: connected != null ? [...connected.values()] : void 0
|
|
690
|
+
}, source);
|
|
691
|
+
}
|
|
692
|
+
async reset() {
|
|
693
|
+
for (const integration of this._integrations.values()) await integration.reset();
|
|
694
|
+
await this.authenticationService.reset();
|
|
695
|
+
await this.ctx.storage.deleteWithPrefix("provider:authentication:skip");
|
|
696
|
+
queueMicrotask(() => void this.syncCloudIntegrations(true));
|
|
697
|
+
}
|
|
698
|
+
supports(remoteProviderId) {
|
|
699
|
+
return convertRemoteProviderIdToIntegrationId(remoteProviderId) != null;
|
|
700
|
+
}
|
|
701
|
+
onAuthenticationSessionsChanged(e) {
|
|
702
|
+
for (const integration of this._integrations.values()) if (e.provider.id === integration.authProvider.id) integration.refresh();
|
|
703
|
+
}
|
|
704
|
+
onIntegrationConnectionChanged(e) {
|
|
705
|
+
const { integration, key, reason } = e;
|
|
706
|
+
if (reason === "connected") {
|
|
707
|
+
if (this._connectedCache.has(key)) return;
|
|
708
|
+
this._connectedCache.add(key);
|
|
709
|
+
} else this._connectedCache.delete(key);
|
|
710
|
+
const connected = reason === "connected";
|
|
711
|
+
if (integration.type === "git") this.ctx.hooks?.connection?.onStateChanged?.({
|
|
712
|
+
id: integration.id,
|
|
713
|
+
key,
|
|
714
|
+
connected,
|
|
715
|
+
kind: isSupportedCloudIntegrationId(integration.id) ? "hosting" : "remote"
|
|
716
|
+
});
|
|
717
|
+
else this.ctx.hooks?.connection?.onStateChanged?.({
|
|
718
|
+
id: integration.id,
|
|
719
|
+
key,
|
|
720
|
+
connected,
|
|
721
|
+
kind: "issue"
|
|
722
|
+
});
|
|
723
|
+
setTimeout(() => this._onDidChangeConnectionState.fire({
|
|
724
|
+
key,
|
|
725
|
+
reason
|
|
726
|
+
}), 250);
|
|
727
|
+
}
|
|
728
|
+
async onSubscriptionChanged() {
|
|
729
|
+
if (await this.ctx.account.getAccount() == null) this.syncCloudIntegrations(false);
|
|
730
|
+
}
|
|
731
|
+
onUserCheckedIn(e) {
|
|
732
|
+
this.syncCloudIntegrations(Boolean(e?.force));
|
|
733
|
+
}
|
|
734
|
+
_providersApi;
|
|
735
|
+
async getProvidersApi() {
|
|
736
|
+
if (this._providersApi == null) {
|
|
737
|
+
const authenticationService = this.authenticationService;
|
|
738
|
+
async function load() {
|
|
739
|
+
return new (await (import(
|
|
740
|
+
/* webpackChunkName: "integrations" */
|
|
741
|
+
"./providers/providersApi.js"
|
|
742
|
+
))).ProvidersApi(authenticationService);
|
|
743
|
+
}
|
|
744
|
+
const loading = this._providersApi = load();
|
|
745
|
+
loading.catch(() => {
|
|
746
|
+
if (this._providersApi === loading) this._providersApi = void 0;
|
|
747
|
+
});
|
|
748
|
+
}
|
|
749
|
+
return this._providersApi;
|
|
750
|
+
}
|
|
751
|
+
getCached(id, domain) {
|
|
752
|
+
return this._integrations.get(this.getCacheKey(id, domain));
|
|
753
|
+
}
|
|
754
|
+
getCacheKey(id, domain) {
|
|
755
|
+
return isSelfManagedHostIntegrationId(id) ? `${id}:${domain}` : id;
|
|
756
|
+
}
|
|
757
|
+
async *getSupportedCloudIntegrations(domainsById) {
|
|
758
|
+
for (const id of getSupportedCloudIntegrationIds()) {
|
|
759
|
+
if (isCloudSelfManagedHostIntegrationId(id)) {
|
|
760
|
+
const domains = new Set(domainsById.get(id) ?? []);
|
|
761
|
+
for (const domain of this.configuredIntegrationService.getConfigured(id, { cloud: true }).map((c) => c.domain).filter((domain) => domain != null && domain.length > 0)) domains.add(hostFromDomain(domain) ?? domain);
|
|
762
|
+
if (domains.size !== 0) {
|
|
763
|
+
for (const domain of domains) {
|
|
764
|
+
const integration = await this.get(id, domain);
|
|
765
|
+
if (integration != null) yield integration;
|
|
766
|
+
}
|
|
767
|
+
continue;
|
|
768
|
+
}
|
|
769
|
+
const integration = await this.get(id, void 0);
|
|
770
|
+
if (integration != null) yield integration;
|
|
771
|
+
continue;
|
|
772
|
+
}
|
|
773
|
+
const integration = await this.get(id);
|
|
774
|
+
if (integration != null) yield integration;
|
|
775
|
+
}
|
|
776
|
+
}
|
|
777
|
+
getCloudConnectionState(integration, connectedIntegrations, domainsById) {
|
|
778
|
+
if (isCloudSelfManagedHostIntegrationId(integration.id)) {
|
|
779
|
+
const host = hostFromDomain(integration.domain) ?? integration.domain;
|
|
780
|
+
return domainsById.get(integration.id)?.has(host) ? "connected" : "disconnected";
|
|
781
|
+
}
|
|
782
|
+
return connectedIntegrations.has(integration.id) ? "connected" : "disconnected";
|
|
783
|
+
}
|
|
784
|
+
findCachedById(id) {
|
|
785
|
+
const cached = this._integrations.get(id);
|
|
786
|
+
if (cached != null) return cached;
|
|
787
|
+
const key = `${id}:`;
|
|
788
|
+
for (const [k, integration] of this._integrations) if (k.startsWith(key)) return integration;
|
|
789
|
+
}
|
|
790
|
+
getCachedForDomain(id, domain) {
|
|
791
|
+
return isSelfManagedHostIntegrationId(id) ? this.getCached(id, domain) : this.findCachedById(id);
|
|
792
|
+
}
|
|
793
|
+
getConfiguredCloudConnection(id, connectionId) {
|
|
794
|
+
const connection = this.configuredIntegrationService.getConfigured(id, { cloud: true }).find((c) => c.id === connectionId);
|
|
795
|
+
if (connection == null) throw new Error(`Connection '${connectionId}' is not configured for '${id}'`);
|
|
796
|
+
return connection;
|
|
797
|
+
}
|
|
798
|
+
getConfiguredConnectionDomain(id, connectionId) {
|
|
799
|
+
if (!isSelfManagedHostIntegrationId(id)) return void 0;
|
|
800
|
+
return this.configuredIntegrationService.getConfigured(id).find((c) => c.id === connectionId)?.domain;
|
|
801
|
+
}
|
|
802
|
+
getCloudPrimaryConnectionIdsByDomain(id) {
|
|
803
|
+
const primaryByDomain = /* @__PURE__ */ new Map();
|
|
804
|
+
const fallbackByDomain = /* @__PURE__ */ new Map();
|
|
805
|
+
for (const descriptor of this.configuredIntegrationService.getConfigured(id, { cloud: true })) {
|
|
806
|
+
const domain = isSelfManagedHostIntegrationId(id) ? hostFromDomain(descriptor.domain) ?? descriptor.domain : void 0;
|
|
807
|
+
if (!fallbackByDomain.has(domain)) fallbackByDomain.set(domain, descriptor.id);
|
|
808
|
+
if (descriptor.primary && !primaryByDomain.has(domain)) primaryByDomain.set(domain, descriptor.id);
|
|
809
|
+
}
|
|
810
|
+
for (const [domain, connectionId] of fallbackByDomain) if (!primaryByDomain.has(domain)) primaryByDomain.set(domain, connectionId);
|
|
811
|
+
return primaryByDomain;
|
|
812
|
+
}
|
|
813
|
+
async syncCloudIntegrations(forceConnect) {
|
|
814
|
+
const scope = getScopedLogger();
|
|
815
|
+
const connectedIntegrations = /* @__PURE__ */ new Set();
|
|
816
|
+
const domainsById = /* @__PURE__ */ new Map();
|
|
817
|
+
const connectionsById = /* @__PURE__ */ new Map();
|
|
818
|
+
if (await this.ctx.account.getAccount() != null) {
|
|
819
|
+
const connections = await this.authenticationService.cloudIntegrations.getConnections();
|
|
820
|
+
if (connections == null) return;
|
|
821
|
+
for (const p of connections) {
|
|
822
|
+
const integrationId = toIntegrationId[p.provider];
|
|
823
|
+
if (integrationId == null) continue;
|
|
824
|
+
connectedIntegrations.add(integrationId);
|
|
825
|
+
const list = connectionsById.get(integrationId);
|
|
826
|
+
if (list != null) list.push(p);
|
|
827
|
+
else connectionsById.set(integrationId, [p]);
|
|
828
|
+
if (p.domain?.length > 0) {
|
|
829
|
+
const host = hostFromDomain(p.domain);
|
|
830
|
+
if (host != null) {
|
|
831
|
+
let domains = domainsById.get(integrationId);
|
|
832
|
+
if (domains == null) {
|
|
833
|
+
domains = /* @__PURE__ */ new Set();
|
|
834
|
+
domainsById.set(integrationId, domains);
|
|
835
|
+
}
|
|
836
|
+
domains.add(host);
|
|
837
|
+
} else scope?.warn(`Invalid domain for ${integrationId} integration: ${p.domain}. Ignoring.`);
|
|
838
|
+
}
|
|
839
|
+
}
|
|
840
|
+
}
|
|
841
|
+
const integrations = [];
|
|
842
|
+
for await (const integration of this.getSupportedCloudIntegrations(domainsById)) integrations.push(integration);
|
|
843
|
+
await Promise.all(integrations.map((integration) => integration.syncCloudConnection(this.getCloudConnectionState(integration, connectedIntegrations, domainsById), forceConnect)));
|
|
844
|
+
await Promise.all(Array.from(connectionsById, ([integrationId, connections]) => this.reconcileCloudConnections(integrationId, connections, forceConnect)));
|
|
845
|
+
this.ctx.hooks?.connection?.onConnectedChanged?.({ integrationIds: [...connectedIntegrations.values()] });
|
|
846
|
+
return connectedIntegrations;
|
|
847
|
+
}
|
|
848
|
+
/**
|
|
849
|
+
* Whether the user has locally disconnected this provider/host. Mirrors the integration model's
|
|
850
|
+
* `connected:${key}` workspace flag (key = id for cloud, `${id}:${domain}` for self-managed), which is
|
|
851
|
+
* set to `false` on a local disconnect and cleared on (re)connect.
|
|
852
|
+
*/
|
|
853
|
+
isLocallyDisconnected(id, host) {
|
|
854
|
+
const key = isSelfManagedHostIntegrationId(id) ? `connected:${id}:${host ?? ""}` : `connected:${id}`;
|
|
855
|
+
return this.ctx.storage.getWorkspace(key) === false;
|
|
856
|
+
}
|
|
857
|
+
/**
|
|
858
|
+
* Reconciles the locally stored connections for a provider with what the backend reports, so that
|
|
859
|
+
* multiple accounts on the same provider coexist. Only engages when the backend provides
|
|
860
|
+
* per-connection ids; otherwise the single-connection flow above already handled the primary.
|
|
861
|
+
*/
|
|
862
|
+
async reconcileCloudConnections(id, connections, forceConnect) {
|
|
863
|
+
const scope = getScopedLogger();
|
|
864
|
+
const identified = connections.filter((c) => c.id != null);
|
|
865
|
+
if (identified.length === 0) return;
|
|
866
|
+
const primaryBefore = this.getCloudPrimaryConnectionIdsByDomain(id);
|
|
867
|
+
const cloudIntegrations = this.authenticationService.cloudIntegrations;
|
|
868
|
+
const syncedIds = /* @__PURE__ */ new Set();
|
|
869
|
+
const syncEligibleIds = /* @__PURE__ */ new Set();
|
|
870
|
+
const syncedPrimaryIdsByDomain = /* @__PURE__ */ new Map();
|
|
871
|
+
const existingById = new Map(this.configuredIntegrationService.getConfigured(id, { cloud: true }).map((c) => [c.id, c]));
|
|
872
|
+
const repointedDomains = /* @__PURE__ */ new Set();
|
|
873
|
+
const preparedConnections = await Promise.all(identified.map(async (connection) => {
|
|
874
|
+
const host = hostFromDomain(connection.domain);
|
|
875
|
+
if (isSelfManagedHostIntegrationId(id) && !host) {
|
|
876
|
+
scope?.warn(`Skipping connection '${connection.id}' for ${id}: unresolved host from domain`);
|
|
877
|
+
return;
|
|
878
|
+
}
|
|
879
|
+
if (this.isLocallyDisconnected(id, host)) return void 0;
|
|
880
|
+
syncEligibleIds.add(connection.id);
|
|
881
|
+
const cached = existingById.get(connection.id);
|
|
882
|
+
const baseUrlChanged = isSelfManagedHostIntegrationId(id) && Boolean(connection.domain?.trim()) && !sameConfiguredBaseUrl(cached?.baseUrl, connection.domain);
|
|
883
|
+
if (!forceConnect && cached != null && !isDescriptorExpired(cached) && !baseUrlChanged) return {
|
|
884
|
+
kind: "cached",
|
|
885
|
+
connection,
|
|
886
|
+
host
|
|
887
|
+
};
|
|
888
|
+
if (baseUrlChanged && cached != null) repointedDomains.add(host);
|
|
889
|
+
try {
|
|
890
|
+
const session = await cloudIntegrations.getConnectionSession(id, void 0, connection.id);
|
|
891
|
+
if (session == null) return void 0;
|
|
892
|
+
let providerSession = toProviderSession(id, connection, session, host, cached?.baseUrl);
|
|
893
|
+
const existing = existingById.get(connection.id);
|
|
894
|
+
const accountName = normalizeAccountName(connection.accountName) ?? normalizeAccountName(existing?.accountName) ?? await this.resolveAccountName(id, host, providerSession);
|
|
895
|
+
if (accountName != null) providerSession = {
|
|
896
|
+
...providerSession,
|
|
897
|
+
account: {
|
|
898
|
+
...providerSession.account,
|
|
899
|
+
label: accountName
|
|
900
|
+
}
|
|
901
|
+
};
|
|
902
|
+
return {
|
|
903
|
+
kind: "fetched",
|
|
904
|
+
connection,
|
|
905
|
+
host,
|
|
906
|
+
providerSession
|
|
907
|
+
};
|
|
908
|
+
} catch (ex) {
|
|
909
|
+
scope?.warn(`Failed to sync connection '${connection.id}' for ${id}: ${ex instanceof Error ? ex.message : String(ex)}`);
|
|
910
|
+
return;
|
|
911
|
+
}
|
|
912
|
+
}));
|
|
913
|
+
for (const prepared of preparedConnections) {
|
|
914
|
+
if (prepared == null) continue;
|
|
915
|
+
if (prepared.kind === "fetched") await this.configuredIntegrationService.storeSession(id, prepared.providerSession);
|
|
916
|
+
syncedIds.add(prepared.connection.id);
|
|
917
|
+
if (prepared.connection.primary) {
|
|
918
|
+
const domain = isSelfManagedHostIntegrationId(id) ? prepared.host : void 0;
|
|
919
|
+
if (!syncedPrimaryIdsByDomain.has(domain)) syncedPrimaryIdsByDomain.set(domain, prepared.connection.id);
|
|
920
|
+
}
|
|
921
|
+
}
|
|
922
|
+
const prunedDomains = /* @__PURE__ */ new Set();
|
|
923
|
+
if ([...syncEligibleIds].every((connectionId) => syncedIds.has(connectionId))) {
|
|
924
|
+
const liveIds = new Set(identified.map((c) => c.id));
|
|
925
|
+
for (const descriptor of this.configuredIntegrationService.getConfigured(id, { cloud: true })) if (!liveIds.has(descriptor.id)) {
|
|
926
|
+
prunedDomains.add(isSelfManagedHostIntegrationId(id) ? descriptor.domain : void 0);
|
|
927
|
+
await this.configuredIntegrationService.deleteConnection(id, descriptor.id, true);
|
|
928
|
+
}
|
|
929
|
+
}
|
|
930
|
+
for (const connectionId of syncedPrimaryIdsByDomain.values()) await this.configuredIntegrationService.setPrimaryConnection(id, connectionId);
|
|
931
|
+
const primaryAfter = this.getCloudPrimaryConnectionIdsByDomain(id);
|
|
932
|
+
const domains = new Set(primaryBefore.keys());
|
|
933
|
+
for (const domain of primaryAfter.keys()) domains.add(domain);
|
|
934
|
+
for (const domain of prunedDomains) domains.add(domain);
|
|
935
|
+
for (const domain of repointedDomains) domains.add(domain);
|
|
936
|
+
for (const domain of domains) {
|
|
937
|
+
if (primaryBefore.get(domain) === primaryAfter.get(domain) && !prunedDomains.has(domain) && !repointedDomains.has(domain)) continue;
|
|
938
|
+
this.getCachedForDomain(id, domain)?.switchConnection();
|
|
939
|
+
}
|
|
940
|
+
}
|
|
941
|
+
/**
|
|
942
|
+
* Switches the default connection for a provider to `connectionId` (its backend token id). Performs
|
|
943
|
+
* the server-side primary switch first, then mirrors it locally and refreshes any warm model. Throws
|
|
944
|
+
* if the backend switch fails so the caller can surface it (local state stays untouched).
|
|
945
|
+
*/
|
|
946
|
+
async setPrimaryConnection(id, connectionId) {
|
|
947
|
+
const connection = this.getConfiguredCloudConnection(id, connectionId);
|
|
948
|
+
if (!await this.authenticationService.cloudIntegrations.setPrimaryConnection(id, connectionId)) throw new Error(`Failed to set primary connection '${connectionId}' for '${id}'`);
|
|
949
|
+
await this.configuredIntegrationService.setPrimaryConnection(id, connectionId);
|
|
950
|
+
this.getCachedForDomain(id, connection.domain)?.switchConnection();
|
|
951
|
+
}
|
|
952
|
+
/**
|
|
953
|
+
* Removes a single connection for a provider by its backend token id. The backend removes the
|
|
954
|
+
* connection (auto-promoting a secondary to primary when the removed one was primary); we then mirror
|
|
955
|
+
* that locally and refresh any warm model. Unlike {@link IntegrationBase.disconnect}, this targets one
|
|
956
|
+
* account. This always talks to the cloud backend, so the local mirror is cloud-scoped and preserves any
|
|
957
|
+
* local PAT that happens to share the same id.
|
|
958
|
+
* Throws if the backend delete fails so the caller can surface it (local state stays untouched).
|
|
959
|
+
*/
|
|
960
|
+
async deleteConnection(id, connectionId) {
|
|
961
|
+
const connection = this.getConfiguredCloudConnection(id, connectionId);
|
|
962
|
+
if (!await this.authenticationService.cloudIntegrations.disconnectConnection(id, connectionId)) throw new Error(`Failed to delete connection '${connectionId}' for '${id}'`);
|
|
963
|
+
await this.configuredIntegrationService.deleteConnection(id, connectionId, true);
|
|
964
|
+
this.getCachedForDomain(id, connection.domain)?.switchConnection();
|
|
965
|
+
}
|
|
966
|
+
/**
|
|
967
|
+
* Resolves a human-readable account handle (e.g. the GitHub login) for a connection by asking the
|
|
968
|
+
* provider API with that connection's token. The token backend doesn't expose it. Routes through the
|
|
969
|
+
* integration model so the correct provider API base URL (incl. self-managed domains) and auth type
|
|
970
|
+
* are used. Best-effort: returns undefined on any failure so callers degrade gracefully.
|
|
971
|
+
*/
|
|
972
|
+
async resolveAccountName(id, host, session) {
|
|
973
|
+
const scope = getScopedLogger();
|
|
974
|
+
try {
|
|
975
|
+
const account = await (await this.get(id, host))?.getProviderAccountForSession(session);
|
|
976
|
+
return account?.username ?? account?.name ?? void 0;
|
|
977
|
+
} catch (ex) {
|
|
978
|
+
scope?.warn(`Failed to resolve account name for '${id}': ${ex instanceof Error ? ex.message : String(ex)}`);
|
|
979
|
+
return;
|
|
980
|
+
}
|
|
981
|
+
}
|
|
982
|
+
/**
|
|
983
|
+
* Forces a refresh of connected cloud integrations from the backend (equivalent to a "--sync" list),
|
|
984
|
+
* reconciling local state (multi-account connections, primary flags, account names) so a subsequent
|
|
985
|
+
* {@link getConfigured} reflects the latest server-side connections. Intended for consumers that need
|
|
986
|
+
* an up-to-date connection list on demand. Rejects when the authoritative backend connection list cannot
|
|
987
|
+
* be read, so callers never mistake stale local state for a successful refresh.
|
|
988
|
+
*/
|
|
989
|
+
async refreshConnections() {
|
|
990
|
+
if (await this.syncCloudIntegrations(true) == null) throw new Error("Failed to refresh provider connections");
|
|
991
|
+
}
|
|
6
992
|
};
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
import { providersMetadata } from './providers/models.js';
|
|
20
|
-
import { broadenIssues } from './reads/broaden.js';
|
|
21
|
-
import { countIssues, countPullRequests } from './reads/counts.js';
|
|
22
|
-
import { getSupportedFilters } from './reads/filters.js';
|
|
23
|
-
import { listOrgs, listProjects, listRepos } from './reads/hierarchy.js';
|
|
24
|
-
import { getIssuesBatch } from './reads/issueBatch.js';
|
|
25
|
-
import { listIssuesPage } from './reads/issues.js';
|
|
26
|
-
import { listIssueTrackerIssuesPage } from './reads/issueTracker.js';
|
|
27
|
-
import { listPullRequestsPage } from './reads/pullRequests.js';
|
|
28
|
-
import { resolveRepository } from './reads/resolveRepository.js';
|
|
29
|
-
import { searchIssuesPage } from './reads/searchIssues.js';
|
|
30
|
-
import { searchPullRequestsPage } from './reads/searchPullRequests.js';
|
|
31
|
-
import { sweepClosedPullRequests, sweepPullRequests } from './reads/sweeps.js';
|
|
32
|
-
import { getTrackerIssue } from './reads/trackerIssue.js';
|
|
33
|
-
import { noConnectionWarning } from './reads/warnings.js';
|
|
34
|
-
import { hostFromDomain } from './utils/domain.utils.js';
|
|
35
|
-
import { convertRemoteProviderIdToIntegrationId, getIntegrationIdForRemote, isCloudGitSelfManagedHostIntegrationId, isGitCloudHostIntegrationId, isGitSelfManagedHostIntegrationId, isNonExpiringZeroTokenIntegrationId, remoteProviderTypeForConfig, remoteProviderTypeForIntegration, } from './utils/integration.utils.js';
|
|
36
|
-
const maxSmallIntegerV8 = 2 ** 30 - 1; // Max number that can be stored in V8's smis (small integers)
|
|
37
|
-
export class IntegrationService {
|
|
38
|
-
authenticationService;
|
|
39
|
-
configuredIntegrationService;
|
|
40
|
-
ctx;
|
|
41
|
-
get onDidChange() {
|
|
42
|
-
return this.configuredIntegrationService.onDidChange;
|
|
43
|
-
}
|
|
44
|
-
_onDidChangeConnectionState = new Emitter();
|
|
45
|
-
get onDidChangeConnectionState() {
|
|
46
|
-
return this._onDidChangeConnectionState.event;
|
|
47
|
-
}
|
|
48
|
-
_connectedCache = new Set();
|
|
49
|
-
_disposable;
|
|
50
|
-
_integrations = new Map();
|
|
51
|
-
_onDidChangeIntegrationConnection = new Emitter();
|
|
52
|
-
_apiDisposables = [];
|
|
53
|
-
_apis;
|
|
54
|
-
/** The package-built, memoized per-provider API clients (was injected via the now-removed `ctx.apis`). */
|
|
55
|
-
get apis() {
|
|
56
|
-
return (this._apis ??= createApiClients(this.ctx, this._apiDisposables));
|
|
57
|
-
}
|
|
58
|
-
/** The shared `GitHubApi` instance — also consumed by the host's GitHub git provider (one instance). */
|
|
59
|
-
get github() {
|
|
60
|
-
return this.apis.github;
|
|
61
|
-
}
|
|
62
|
-
constructor(authenticationService, configuredIntegrationService, ctx) {
|
|
63
|
-
this.authenticationService = authenticationService;
|
|
64
|
-
this.configuredIntegrationService = configuredIntegrationService;
|
|
65
|
-
this.ctx = ctx;
|
|
66
|
-
this._disposable = fromDisposables(ctx.config.onDidChange(e => {
|
|
67
|
-
if (e.remotes) {
|
|
68
|
-
this._ignoreSSLErrors.clear();
|
|
69
|
-
}
|
|
70
|
-
}), ctx.account.onDidChangeSessions(this.onAuthenticationSessionsChanged, this), ctx.account.onDidCheckIn(this.onUserCheckedIn, this), ctx.account.onDidChange(this.onSubscriptionChanged, this), this._onDidChangeIntegrationConnection.event(this.onIntegrationConnectionChanged, this));
|
|
71
|
-
}
|
|
72
|
-
dispose() {
|
|
73
|
-
this._integrations.forEach(i => i.dispose());
|
|
74
|
-
this._integrations.clear();
|
|
75
|
-
this._disposable?.dispose();
|
|
76
|
-
// The facade (`createIntegrationManager`) hands us sole ownership of these, so disposing the manager
|
|
77
|
-
// must tear them down too — otherwise cached auth providers (+ their host session listeners) and the
|
|
78
|
-
// configured-integrations emitter outlive the manager.
|
|
79
|
-
this.authenticationService.dispose();
|
|
80
|
-
this.configuredIntegrationService.dispose();
|
|
81
|
-
this._onDidChangeConnectionState.dispose();
|
|
82
|
-
this._onDidChangeIntegrationConnection.dispose();
|
|
83
|
-
this._apiDisposables.forEach(d => d.dispose());
|
|
84
|
-
}
|
|
85
|
-
async connectCloudIntegrations(connect, source) {
|
|
86
|
-
const scope = getScopedLogger();
|
|
87
|
-
const integrationIds = connect?.integrationIds;
|
|
88
|
-
this.ctx.hooks?.connection?.onStarted?.({ integrationIds: integrationIds }, source);
|
|
89
|
-
const connectedIntegrations = new Set();
|
|
90
|
-
if (integrationIds?.length) {
|
|
91
|
-
if (connect?.skipIfConnected && !connect?.skipPreSync) {
|
|
92
|
-
await this.syncCloudIntegrations(true);
|
|
93
|
-
}
|
|
94
|
-
for (const integrationId of integrationIds) {
|
|
95
|
-
try {
|
|
96
|
-
const integration = await this.get(integrationId);
|
|
97
|
-
if (integration == null)
|
|
98
|
-
continue;
|
|
99
|
-
if (integration.maybeConnected ?? (await integration.isConnected())) {
|
|
100
|
-
connectedIntegrations.add(integrationId);
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
catch (ex) {
|
|
104
|
-
scope?.warn(`Failed to get integration ${integrationId} by its ID. Consider it as not-connected and ignore. Error message: ${ex.message}`, scope);
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
if (connect?.skipIfConnected && connectedIntegrations.size === integrationIds.length) {
|
|
108
|
-
return true;
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
// The host owns the GK-Dev connect round-trip end-to-end (URL/query, exchange-token-vs-redirect,
|
|
112
|
-
// open, await its OAuth callback, sign-in + redeem). The package only orchestrates state/sync/hooks.
|
|
113
|
-
if (!(await this.ctx.account.connect({ integrationIds: integrationIds, source: source }))) {
|
|
114
|
-
return false;
|
|
115
|
-
}
|
|
116
|
-
const connected = await this.syncCloudIntegrations(true);
|
|
117
|
-
this.ctx.hooks?.connection?.onCompleted?.({
|
|
118
|
-
integrationIds: integrationIds,
|
|
119
|
-
connectedIntegrationIds: connected != null ? [...connected.values()] : undefined,
|
|
120
|
-
}, source);
|
|
121
|
-
if (integrationIds != null) {
|
|
122
|
-
for (const integrationId of integrationIds) {
|
|
123
|
-
const integration = await this.get(integrationId);
|
|
124
|
-
if (integration == null)
|
|
125
|
-
continue;
|
|
126
|
-
const connected = integration.maybeConnected ?? (await integration.isConnected());
|
|
127
|
-
if (connected && !connectedIntegrations.has(integrationId)) {
|
|
128
|
-
return true;
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
return false;
|
|
132
|
-
}
|
|
133
|
-
return true;
|
|
134
|
-
}
|
|
135
|
-
/**
|
|
136
|
-
* Starts the cloud connect flow without skipping an already-connected provider, allowing the host/GK Dev
|
|
137
|
-
* flow to add another account for that provider instead of treating the existing primary as sufficient.
|
|
138
|
-
* Returns whether a new connection was actually added (measured by a new cloud connection id appearing),
|
|
139
|
-
* since {@link connectCloudIntegrations} only reports provider-level success and can't detect a newly added
|
|
140
|
-
* secondary for an already-connected provider.
|
|
141
|
-
*/
|
|
142
|
-
async connectSecondary(id, source) {
|
|
143
|
-
const before = new Set(this.getConfigured(id, { cloud: true }).map(c => c.id));
|
|
144
|
-
await this.connectCloudIntegrations({ integrationIds: [id], skipIfConnected: false }, source);
|
|
145
|
-
return this.getConfigured(id, { cloud: true }).some(c => !before.has(c.id));
|
|
146
|
-
}
|
|
147
|
-
async get(id, domain) {
|
|
148
|
-
// Normalize to a bare host before anything keys off it. Callers pass a self-managed domain in both shapes
|
|
149
|
-
// — a full URL from a stored session/descriptor, a bare host from `hostFromDomain` — and the cache key is
|
|
150
|
-
// `${id}:${domain}`, so the same host arriving in two shapes would build two instances (and two
|
|
151
|
-
// "primaries") for one host.
|
|
152
|
-
if (isGitSelfManagedHostIntegrationId(id)) {
|
|
153
|
-
domain = hostFromDomain(domain) ?? domain;
|
|
154
|
-
}
|
|
155
|
-
let integration = this.getCached(id, domain);
|
|
156
|
-
if (integration == null) {
|
|
157
|
-
switch (id) {
|
|
158
|
-
case GitCloudHostIntegrationId.GitHub:
|
|
159
|
-
integration = new (await import(/* webpackChunkName: "integrations" */ './providers/github.js')).GitHubIntegration(this.ctx, this.authenticationService, this.getProvidersApi.bind(this), this._onDidChangeIntegrationConnection);
|
|
160
|
-
break;
|
|
161
|
-
case GitSelfManagedHostIntegrationId.CloudGitHubEnterprise:
|
|
162
|
-
if (domain == null) {
|
|
163
|
-
integration = this.findCachedById(id);
|
|
164
|
-
// return immediately in order to not to cache it after the "switch" block:
|
|
165
|
-
if (integration != null)
|
|
166
|
-
return integration;
|
|
167
|
-
const configured = this.getConfigured(GitSelfManagedHostIntegrationId.CloudGitHubEnterprise);
|
|
168
|
-
if (configured.length) {
|
|
169
|
-
const { domain: configuredDomain } = configured.find(c => c.primary) ?? configured[0];
|
|
170
|
-
if (configuredDomain == null)
|
|
171
|
-
throw new Error(`Domain is required for '${id}' integration`);
|
|
172
|
-
integration = new (await import(/* webpackChunkName: "integrations" */ './providers/github.js')).GitHubEnterpriseIntegration(this.ctx, this.authenticationService, this.getProvidersApi.bind(this), this._onDidChangeIntegrationConnection, configuredDomain);
|
|
173
|
-
// assign domain because it's part of caching key:
|
|
174
|
-
domain = configuredDomain;
|
|
175
|
-
break;
|
|
176
|
-
}
|
|
177
|
-
return undefined;
|
|
178
|
-
}
|
|
179
|
-
integration = new (await import(/* webpackChunkName: "integrations" */ './providers/github.js')).GitHubEnterpriseIntegration(this.ctx, this.authenticationService, this.getProvidersApi.bind(this), this._onDidChangeIntegrationConnection, domain);
|
|
180
|
-
break;
|
|
181
|
-
case GitCloudHostIntegrationId.GitLab:
|
|
182
|
-
integration = new (await import(/* webpackChunkName: "integrations" */ './providers/gitlab.js')).GitLabIntegration(this.ctx, this.authenticationService, this.getProvidersApi.bind(this), this._onDidChangeIntegrationConnection);
|
|
183
|
-
break;
|
|
184
|
-
case GitSelfManagedHostIntegrationId.CloudGitLabSelfHosted:
|
|
185
|
-
if (domain == null) {
|
|
186
|
-
integration = this.findCachedById(id);
|
|
187
|
-
// return immediately in order to not to cache it after the "switch" block:
|
|
188
|
-
if (integration != null)
|
|
189
|
-
return integration;
|
|
190
|
-
const configured = this.getConfigured(GitSelfManagedHostIntegrationId.CloudGitLabSelfHosted);
|
|
191
|
-
if (configured.length) {
|
|
192
|
-
const { domain: configuredDomain } = configured.find(c => c.primary) ?? configured[0];
|
|
193
|
-
if (configuredDomain == null)
|
|
194
|
-
throw new Error(`Domain is required for '${id}' integration`);
|
|
195
|
-
integration = new (await import(/* webpackChunkName: "integrations" */ './providers/gitlab.js')).GitLabSelfHostedIntegration(this.ctx, this.authenticationService, this.getProvidersApi.bind(this), this._onDidChangeIntegrationConnection, configuredDomain);
|
|
196
|
-
// assign domain because it's part of caching key:
|
|
197
|
-
domain = configuredDomain;
|
|
198
|
-
break;
|
|
199
|
-
}
|
|
200
|
-
return undefined;
|
|
201
|
-
}
|
|
202
|
-
integration = new (await import(/* webpackChunkName: "integrations" */ './providers/gitlab.js')).GitLabSelfHostedIntegration(this.ctx, this.authenticationService, this.getProvidersApi.bind(this), this._onDidChangeIntegrationConnection, domain);
|
|
203
|
-
break;
|
|
204
|
-
case GitCloudHostIntegrationId.Bitbucket:
|
|
205
|
-
integration = new (await import(/* webpackChunkName: "integrations" */ './providers/bitbucket.js')).BitbucketIntegration(this.ctx, this.authenticationService, this.getProvidersApi.bind(this), this._onDidChangeIntegrationConnection);
|
|
206
|
-
break;
|
|
207
|
-
case GitSelfManagedHostIntegrationId.BitbucketServer:
|
|
208
|
-
if (domain == null) {
|
|
209
|
-
integration = this.findCachedById(id);
|
|
210
|
-
// return immediately in order to not to cache it after the "switch" block:
|
|
211
|
-
if (integration != null)
|
|
212
|
-
return integration;
|
|
213
|
-
const configured = this.getConfigured(GitSelfManagedHostIntegrationId.BitbucketServer);
|
|
214
|
-
if (configured.length) {
|
|
215
|
-
const { domain: configuredDomain } = configured.find(c => c.primary) ?? configured[0];
|
|
216
|
-
if (configuredDomain == null)
|
|
217
|
-
throw new Error(`Domain is required for '${id}' integration`);
|
|
218
|
-
integration = new (await import(/* webpackChunkName: "integrations" */ './providers/bitbucket-server.js')).BitbucketServerIntegration(this.ctx, this.authenticationService, this.getProvidersApi.bind(this), this._onDidChangeIntegrationConnection, configuredDomain);
|
|
219
|
-
// assign domain because it's part of caching key:
|
|
220
|
-
domain = configuredDomain;
|
|
221
|
-
break;
|
|
222
|
-
}
|
|
223
|
-
return undefined;
|
|
224
|
-
}
|
|
225
|
-
integration = new (await import(/* webpackChunkName: "integrations" */ './providers/bitbucket-server.js')).BitbucketServerIntegration(this.ctx, this.authenticationService, this.getProvidersApi.bind(this), this._onDidChangeIntegrationConnection, domain);
|
|
226
|
-
break;
|
|
227
|
-
case GitCloudHostIntegrationId.AzureDevOps:
|
|
228
|
-
integration = new (await import(/* webpackChunkName: "integrations" */ './providers/azureDevOps.js')).AzureDevOpsIntegration(this.ctx, this.authenticationService, this.getProvidersApi.bind(this), this._onDidChangeIntegrationConnection);
|
|
229
|
-
break;
|
|
230
|
-
case GitSelfManagedHostIntegrationId.AzureDevOpsServer:
|
|
231
|
-
if (domain == null) {
|
|
232
|
-
integration = this.findCachedById(id);
|
|
233
|
-
// return immediately in order to not to cache it after the "switch" block:
|
|
234
|
-
if (integration != null)
|
|
235
|
-
return integration;
|
|
236
|
-
const configured = this.getConfigured(GitSelfManagedHostIntegrationId.AzureDevOpsServer);
|
|
237
|
-
if (configured.length) {
|
|
238
|
-
const { domain: configuredDomain } = configured.find(c => c.primary) ?? configured[0];
|
|
239
|
-
if (configuredDomain == null)
|
|
240
|
-
throw new Error(`Domain is required for '${id}' integration`);
|
|
241
|
-
integration = new (await import(/* webpackChunkName: "integrations" */ './providers/azureDevOps.js')).AzureDevOpsServerIntegration(this.ctx, this.authenticationService, this.getProvidersApi.bind(this), this._onDidChangeIntegrationConnection, configuredDomain);
|
|
242
|
-
// assign domain because it's part of caching key:
|
|
243
|
-
domain = configuredDomain;
|
|
244
|
-
break;
|
|
245
|
-
}
|
|
246
|
-
return undefined;
|
|
247
|
-
}
|
|
248
|
-
integration = new (await import(/* webpackChunkName: "integrations" */ './providers/azureDevOps.js')).AzureDevOpsServerIntegration(this.ctx, this.authenticationService, this.getProvidersApi.bind(this), this._onDidChangeIntegrationConnection, domain);
|
|
249
|
-
break;
|
|
250
|
-
case IssuesCloudHostIntegrationId.Jira:
|
|
251
|
-
integration = new (await import(/* webpackChunkName: "integrations" */ './providers/jira.js')).JiraIntegration(this.ctx, this.authenticationService, this.getProvidersApi.bind(this), this._onDidChangeIntegrationConnection);
|
|
252
|
-
break;
|
|
253
|
-
case IssuesCloudHostIntegrationId.Linear:
|
|
254
|
-
integration = new (await import(/* webpackChunkName: "integrations" */ './providers/linear.js')).LinearIntegration(this.ctx, this.authenticationService, this.getProvidersApi.bind(this), this._onDidChangeIntegrationConnection);
|
|
255
|
-
break;
|
|
256
|
-
case IssuesCloudHostIntegrationId.Trello:
|
|
257
|
-
integration = new (await import(/* webpackChunkName: "integrations" */ './providers/trello.js')).TrelloIntegration(this.ctx, this.authenticationService, this.getProvidersApi.bind(this), this._onDidChangeIntegrationConnection);
|
|
258
|
-
break;
|
|
259
|
-
default:
|
|
260
|
-
throw new Error(`Integration with '${id}' is not supported`);
|
|
261
|
-
}
|
|
262
|
-
this._integrations.set(this.getCacheKey(id, domain), integration);
|
|
263
|
-
}
|
|
264
|
-
return integration;
|
|
265
|
-
}
|
|
266
|
-
getConfigured(id, options) {
|
|
267
|
-
return this.configuredIntegrationService.getConfigured(id, options);
|
|
268
|
-
}
|
|
269
|
-
/**
|
|
270
|
-
* The filters this provider's reads accept — part of the public {@link IntegrationManager} contract, so it
|
|
271
|
-
* stays a method here even though it needs no instance state; see {@link getSupportedFilters} for the
|
|
272
|
-
* capability table itself and why a consumer should intersect against it before reading.
|
|
273
|
-
*/
|
|
274
|
-
getSupportedFilters(providerId) {
|
|
275
|
-
return getSupportedFilters(providerId);
|
|
276
|
-
}
|
|
277
|
-
/**
|
|
278
|
-
* Returns the connected integration for a `GitRemote`, if any.
|
|
279
|
-
* Internal counterpart to the host's `getRemoteIntegration(remote)` helper.
|
|
280
|
-
*/
|
|
281
|
-
async getByRemote(remote) {
|
|
282
|
-
if (remote?.provider == null)
|
|
283
|
-
return undefined;
|
|
284
|
-
const integrationId = getIntegrationIdForRemote(remote.provider);
|
|
285
|
-
if (integrationId == null)
|
|
286
|
-
return undefined;
|
|
287
|
-
const integration = await this.get(integrationId, remote.provider?.domain);
|
|
288
|
-
return integration?.type === 'git' ? integration : undefined;
|
|
289
|
-
}
|
|
290
|
-
async getMyIssues(integrationIds, options) {
|
|
291
|
-
const integrations = new Map();
|
|
292
|
-
const hostingIntegrationIds = integrationIds?.filter(id => id in GitCloudHostIntegrationId || id in GitSelfManagedHostIntegrationId);
|
|
293
|
-
const openRemotesByIntegrationId = new Map();
|
|
294
|
-
let hasOpenAzureRepository = false;
|
|
295
|
-
for (const remote of await this.ctx.repositories.getOpenRemotes()) {
|
|
296
|
-
const remoteIntegration = await this.getByRemote(remote);
|
|
297
|
-
if (remoteIntegration == null)
|
|
298
|
-
continue;
|
|
299
|
-
if (remoteIntegration.id === GitCloudHostIntegrationId.AzureDevOps) {
|
|
300
|
-
hasOpenAzureRepository = true;
|
|
301
|
-
}
|
|
302
|
-
for (const integrationId of hostingIntegrationIds?.length
|
|
303
|
-
? hostingIntegrationIds
|
|
304
|
-
: [...Object.values(GitCloudHostIntegrationId), ...Object.values(GitSelfManagedHostIntegrationId)]) {
|
|
305
|
-
if (remoteIntegration.id === integrationId &&
|
|
306
|
-
remote.provider?.owner != null &&
|
|
307
|
-
remote.provider?.repoName != null) {
|
|
308
|
-
const descriptor = {
|
|
309
|
-
key: `${remote.provider.owner}/${remote.provider.repoName}`,
|
|
310
|
-
owner: remote.provider.owner,
|
|
311
|
-
name: remote.provider.repoName,
|
|
312
|
-
};
|
|
313
|
-
if (openRemotesByIntegrationId.has(integrationId)) {
|
|
314
|
-
openRemotesByIntegrationId.get(integrationId)?.push(descriptor);
|
|
315
|
-
}
|
|
316
|
-
else {
|
|
317
|
-
openRemotesByIntegrationId.set(integrationId, [descriptor]);
|
|
318
|
-
}
|
|
319
|
-
}
|
|
320
|
-
}
|
|
321
|
-
}
|
|
322
|
-
for (const integrationId of integrationIds?.length
|
|
323
|
-
? integrationIds
|
|
324
|
-
: [
|
|
325
|
-
...Object.values(GitCloudHostIntegrationId),
|
|
326
|
-
...Object.values(IssuesCloudHostIntegrationId),
|
|
327
|
-
...Object.values(GitSelfManagedHostIntegrationId),
|
|
328
|
-
]) {
|
|
329
|
-
const integration = await this.get(integrationId);
|
|
330
|
-
const isInvalidIntegration = (options?.openRepositoriesOnly &&
|
|
331
|
-
integrationId !== GitCloudHostIntegrationId.AzureDevOps &&
|
|
332
|
-
(isGitCloudHostIntegrationId(integrationId) || isGitSelfManagedHostIntegrationId(integrationId)) &&
|
|
333
|
-
!openRemotesByIntegrationId.has(integrationId)) ||
|
|
334
|
-
(integrationId === GitCloudHostIntegrationId.AzureDevOps && !hasOpenAzureRepository);
|
|
335
|
-
if (integration == null || isInvalidIntegration) {
|
|
336
|
-
continue;
|
|
337
|
-
}
|
|
338
|
-
integrations.set(integration, options?.openRepositoriesOnly && !isInvalidIntegration
|
|
339
|
-
? openRemotesByIntegrationId.get(integrationId)
|
|
340
|
-
: undefined);
|
|
341
|
-
}
|
|
342
|
-
if (integrations.size === 0)
|
|
343
|
-
return undefined;
|
|
344
|
-
return this.getMyIssuesCore(integrations, options?.cancellation);
|
|
345
|
-
}
|
|
346
|
-
async getMyIssuesCore(integrations, cancellation) {
|
|
347
|
-
const start = performance.now();
|
|
348
|
-
const promises = [];
|
|
349
|
-
for (const [integration, repos] of integrations) {
|
|
350
|
-
if (integration == null)
|
|
351
|
-
continue;
|
|
352
|
-
promises.push(integration.searchMyIssuesResult(repos, cancellation));
|
|
353
|
-
}
|
|
354
|
-
const results = await Promise.allSettled(promises);
|
|
355
|
-
const successfulResults = [
|
|
356
|
-
...flatten(filterMap(results, r => r.status === 'fulfilled' && r.value?.value != null ? r.value.value : undefined)),
|
|
357
|
-
];
|
|
358
|
-
const errors = [
|
|
359
|
-
...filterMap(results, r => r.status === 'fulfilled' && r.value?.error != null ? r.value.error : undefined),
|
|
360
|
-
];
|
|
361
|
-
const error = errors.length === 0
|
|
362
|
-
? undefined
|
|
363
|
-
: errors.length === 1
|
|
364
|
-
? errors[0]
|
|
365
|
-
: new AggregateError(errors, 'Failed to get some issues');
|
|
366
|
-
return {
|
|
367
|
-
value: successfulResults,
|
|
368
|
-
error: error,
|
|
369
|
-
duration: performance.now() - start,
|
|
370
|
-
};
|
|
371
|
-
}
|
|
372
|
-
async getMyIssuesForRemotes(remoteOrRemotes) {
|
|
373
|
-
if (!Array.isArray(remoteOrRemotes)) {
|
|
374
|
-
remoteOrRemotes = [remoteOrRemotes];
|
|
375
|
-
}
|
|
376
|
-
if (!remoteOrRemotes.length)
|
|
377
|
-
return undefined;
|
|
378
|
-
if (remoteOrRemotes.length === 1) {
|
|
379
|
-
const [remote] = remoteOrRemotes;
|
|
380
|
-
if (remote?.provider == null)
|
|
381
|
-
return undefined;
|
|
382
|
-
const integration = await this.getByRemote(remote);
|
|
383
|
-
return integration?.searchMyIssuesResult(remote.provider.repoDesc);
|
|
384
|
-
}
|
|
385
|
-
const integrations = new Map();
|
|
386
|
-
for (const remote of remoteOrRemotes) {
|
|
387
|
-
if (remote?.provider == null)
|
|
388
|
-
continue;
|
|
389
|
-
const integration = await this.getByRemote(remote);
|
|
390
|
-
if (integration == null)
|
|
391
|
-
continue;
|
|
392
|
-
let repos = integrations.get(integration);
|
|
393
|
-
if (repos == null) {
|
|
394
|
-
repos = [];
|
|
395
|
-
integrations.set(integration, repos);
|
|
396
|
-
}
|
|
397
|
-
repos.push(remote.provider.repoDesc);
|
|
398
|
-
}
|
|
399
|
-
return this.getMyIssuesCore(integrations);
|
|
400
|
-
}
|
|
401
|
-
async getMyCurrentAccounts(integrationIds, connectionId) {
|
|
402
|
-
const accounts = new Map();
|
|
403
|
-
await Promise.allSettled(integrationIds.map(async (integrationId) => {
|
|
404
|
-
const integration = await this.getIntegrationForRead(integrationId, connectionId);
|
|
405
|
-
if (integration == null)
|
|
406
|
-
return;
|
|
407
|
-
const account = await integration.getCurrentAccount({ connectionId: connectionId });
|
|
408
|
-
if (account) {
|
|
409
|
-
accounts.set(integrationId, account);
|
|
410
|
-
}
|
|
411
|
-
}));
|
|
412
|
-
return accounts;
|
|
413
|
-
}
|
|
414
|
-
async getMyPullRequests(integrationIds, cancellation, options) {
|
|
415
|
-
const integrations = new Map();
|
|
416
|
-
for (const integrationId of integrationIds?.length
|
|
417
|
-
? integrationIds
|
|
418
|
-
: Object.values(GitCloudHostIntegrationId)) {
|
|
419
|
-
let integration;
|
|
420
|
-
try {
|
|
421
|
-
integration = await this.get(integrationId);
|
|
422
|
-
}
|
|
423
|
-
catch { }
|
|
424
|
-
if (integration == null)
|
|
425
|
-
continue;
|
|
426
|
-
integrations.set(integration, undefined);
|
|
427
|
-
}
|
|
428
|
-
if (integrations.size === 0)
|
|
429
|
-
return undefined;
|
|
430
|
-
return this.getMyPullRequestsCore(integrations, cancellation, options);
|
|
431
|
-
}
|
|
432
|
-
async getMyPullRequestsCore(integrations, cancellation, options) {
|
|
433
|
-
const start = performance.now();
|
|
434
|
-
const promises = [];
|
|
435
|
-
for (const [integration, repos] of integrations) {
|
|
436
|
-
if (integration == null)
|
|
437
|
-
continue;
|
|
438
|
-
promises.push(integration.searchMyPullRequests(repos, cancellation, options));
|
|
439
|
-
}
|
|
440
|
-
const results = await Promise.allSettled(promises);
|
|
441
|
-
const successfulResults = [
|
|
442
|
-
...flatten(filterMap(results, r => r.status === 'fulfilled' && r.value?.value != null ? r.value.value : undefined)),
|
|
443
|
-
];
|
|
444
|
-
const errors = [
|
|
445
|
-
...filterMap(results, r => r.status === 'fulfilled' && r.value?.error != null ? r.value.error : undefined),
|
|
446
|
-
];
|
|
447
|
-
const error = errors.length === 0
|
|
448
|
-
? undefined
|
|
449
|
-
: errors.length === 1
|
|
450
|
-
? errors[0]
|
|
451
|
-
: new AggregateError(errors, 'Failed to get some pull requests');
|
|
452
|
-
return {
|
|
453
|
-
value: successfulResults,
|
|
454
|
-
error: error,
|
|
455
|
-
duration: performance.now() - start,
|
|
456
|
-
};
|
|
457
|
-
}
|
|
458
|
-
async getMyPullRequestsForRemotes(remoteOrRemotes) {
|
|
459
|
-
if (!Array.isArray(remoteOrRemotes)) {
|
|
460
|
-
remoteOrRemotes = [remoteOrRemotes];
|
|
461
|
-
}
|
|
462
|
-
if (!remoteOrRemotes.length)
|
|
463
|
-
return undefined;
|
|
464
|
-
if (remoteOrRemotes.length === 1) {
|
|
465
|
-
const [remote] = remoteOrRemotes;
|
|
466
|
-
if (remote?.provider == null)
|
|
467
|
-
return undefined;
|
|
468
|
-
const integration = await this.getByRemote(remote);
|
|
469
|
-
return integration?.searchMyPullRequests(remote.provider.repoDesc);
|
|
470
|
-
}
|
|
471
|
-
const integrations = new Map();
|
|
472
|
-
for (const remote of remoteOrRemotes) {
|
|
473
|
-
if (remote?.provider == null)
|
|
474
|
-
continue;
|
|
475
|
-
const integration = await this.getByRemote(remote);
|
|
476
|
-
if (integration == null)
|
|
477
|
-
continue;
|
|
478
|
-
let repos = integrations.get(integration);
|
|
479
|
-
if (repos == null) {
|
|
480
|
-
repos = [];
|
|
481
|
-
integrations.set(integration, repos);
|
|
482
|
-
}
|
|
483
|
-
repos.push(remote.provider.repoDesc);
|
|
484
|
-
}
|
|
485
|
-
return this.getMyPullRequestsCore(integrations);
|
|
486
|
-
}
|
|
487
|
-
// #region ProviderBackend surface (#5438)
|
|
488
|
-
//
|
|
489
|
-
// Generic discovery (orgs/projects/repos) and page-oriented reads that Kepler's ProviderBackend
|
|
490
|
-
// adapter maps to its own DTOs. All results are neutral (`ProviderResult`/`ProviderPagedResult`) and
|
|
491
|
-
// carry per-provider warnings recovered from the read cores, so a single provider's auth/rate-limit
|
|
492
|
-
// failure degrades to a warning instead of failing the whole call. The reads are repo-scoped (they
|
|
493
|
-
// compose the git-host `*Result` cores); account-scoped fan-out is the adapter's responsibility.
|
|
494
|
-
/**
|
|
495
|
-
* Warnings for an early-returning read where the integration couldn't be resolved. When a specific
|
|
496
|
-
* `connectionId` or self-managed `domain` was requested, a missing integration means that target is
|
|
497
|
-
* unavailable — surface a `no-connection` warning + `fetchFailed` so the caller can tell it apart from
|
|
498
|
-
* a truly empty account. Without an explicit target, it's simply not connected, which stays a silent
|
|
499
|
-
* empty result.
|
|
500
|
-
*/
|
|
501
|
-
earlyReturnConnectionWarnings(id, connectionId, domain) {
|
|
502
|
-
const requestedDomain = isGitSelfManagedHostIntegrationId(id) ? domain : undefined;
|
|
503
|
-
const invalidDomain = this.isEmptyExplicitSelector(domain);
|
|
504
|
-
if (connectionId == null && requestedDomain == null && !invalidDomain) {
|
|
505
|
-
return { warnings: [], fetchFailed: false };
|
|
506
|
-
}
|
|
507
|
-
const resolvedDomain = invalidDomain
|
|
508
|
-
? domain?.trim()
|
|
509
|
-
: this.resolveDomainForRead(id, connectionId, requestedDomain);
|
|
510
|
-
return { warnings: [noConnectionWarning(id, resolvedDomain, connectionId)], fetchFailed: true };
|
|
511
|
-
}
|
|
512
|
-
isEmptyExplicitSelector(value) {
|
|
513
|
-
return value?.trim().length === 0;
|
|
514
|
-
}
|
|
515
|
-
domainForRead(integration, id, connectionId, domain) {
|
|
516
|
-
if (!isGitSelfManagedHostIntegrationId(id)) {
|
|
517
|
-
return connectionId != null ? this.getConfiguredConnectionDomain(id, connectionId) : integration.domain;
|
|
518
|
-
}
|
|
519
|
-
return this.resolveDomainForRead(id, connectionId, domain) ?? integration.domain;
|
|
520
|
-
}
|
|
521
|
-
/**
|
|
522
|
-
* Resolves the right integration instance for a read. A configured connection domain takes precedence over
|
|
523
|
-
* an explicit fallback domain; the latter lets external/manual authentication providers address a
|
|
524
|
-
* self-managed host without persisting `ConfiguredIntegrationService` state.
|
|
525
|
-
*/
|
|
526
|
-
async getIntegrationForRead(id, connectionId, domain) {
|
|
527
|
-
// Empty explicit selectors are invalid targets, not an instruction to fall back to the primary
|
|
528
|
-
// connection. Keep this at the common read boundary so every public surface behaves consistently.
|
|
529
|
-
if (this.isEmptyExplicitSelector(connectionId) || this.isEmptyExplicitSelector(domain))
|
|
530
|
-
return undefined;
|
|
531
|
-
const resolvedDomain = this.resolveDomainForRead(id, connectionId, domain);
|
|
532
|
-
try {
|
|
533
|
-
return await this.get(id, resolvedDomain);
|
|
534
|
-
}
|
|
535
|
-
catch {
|
|
536
|
-
return undefined;
|
|
537
|
-
}
|
|
538
|
-
}
|
|
539
|
-
resolveDomainForRead(id, connectionId, domain) {
|
|
540
|
-
if (!isGitSelfManagedHostIntegrationId(id))
|
|
541
|
-
return undefined;
|
|
542
|
-
return ((connectionId != null ? this.getConfiguredConnectionDomain(id, connectionId) : undefined) ??
|
|
543
|
-
hostFromDomain(domain) ??
|
|
544
|
-
// With no explicit target, pin the primary configured host rather than leaving the domain undefined:
|
|
545
|
-
// `get(id, undefined)` falls back to `findCachedById`, which returns the FIRST entry by Map insertion
|
|
546
|
-
// order. With two hosts of the same provider that makes the instance depend on which host happened to
|
|
547
|
-
// be constructed first, so orgs/repos could come from one host and PRs from another in the same UI.
|
|
548
|
-
this.primaryConfiguredDomain(id));
|
|
549
|
-
}
|
|
550
|
-
/** The primary configured host for a self-managed provider (first configured when none is flagged primary). */
|
|
551
|
-
primaryConfiguredDomain(id) {
|
|
552
|
-
const configured = this.getConfigured(id);
|
|
553
|
-
return (configured.find(c => c.primary) ?? configured[0])?.domain;
|
|
554
|
-
}
|
|
555
|
-
/**
|
|
556
|
-
* Forces a real session refresh before a read when `forceSync` is set, so the read consumes a freshly
|
|
557
|
-
* exchanged token rather than a possibly-stale cached one. Both paths refresh, by different mechanisms: a
|
|
558
|
-
* per-connection (`connectionId`) read syncs that specific connection's session directly through the auth
|
|
559
|
-
* provider (the integration's primary-only sync path would never reach a secondary account), while a
|
|
560
|
-
* primary read syncs via the integration's own cloud-connection machinery.
|
|
561
|
-
* Best-effort — a failed sync is swallowed so the read still proceeds (and surfaces its own warning).
|
|
562
|
-
*/
|
|
563
|
-
async forceRefreshIfRequested(integration, forceSync, connectionId) {
|
|
564
|
-
if (forceSync !== true)
|
|
565
|
-
return;
|
|
566
|
-
try {
|
|
567
|
-
if (connectionId != null) {
|
|
568
|
-
// Refresh the specific connection's session directly; the primary-only sync path below would not
|
|
569
|
-
// reach a secondary account. `cloud: true` is required for multi-account backend connections.
|
|
570
|
-
const authProvider = await this.authenticationService.get(integration.authProvider.id);
|
|
571
|
-
const descriptor = { ...integration.authProviderDescriptor, connectionId: connectionId, cloud: true };
|
|
572
|
-
await authProvider?.deleteSession(descriptor);
|
|
573
|
-
await authProvider?.getSession(descriptor, { sync: true });
|
|
574
|
-
}
|
|
575
|
-
else {
|
|
576
|
-
await integration.syncCloudConnection('connected', true);
|
|
577
|
-
}
|
|
578
|
-
}
|
|
579
|
-
catch { }
|
|
580
|
-
}
|
|
581
|
-
/**
|
|
582
|
-
* Lists the orgs/workspaces/groups (and issue-tracker resources) visible to the user, unified into
|
|
583
|
-
* {@link ProviderOrganization}. Scoped to `providerId` when given, otherwise fanned out over every
|
|
584
|
-
* supported provider. `connectionId` only makes sense with a single `providerId`.
|
|
585
|
-
*/
|
|
586
|
-
async listOrgs(options) {
|
|
587
|
-
return listOrgs(this, options);
|
|
588
|
-
}
|
|
589
|
-
/**
|
|
590
|
-
* Lists the projects visible to the user, unified into the {@link ProviderOrganization}
|
|
591
|
-
* `{ providerId, id, name, org?, url }` shape. Covers issue-tracker providers (Jira/Linear, which expose
|
|
592
|
-
* projects under their resources) *and* git hosts that have a project tier (Azure DevOps, whose repos are
|
|
593
|
-
* org + project scoped). Scoped to `providerId` when given, else fanned out over both the supported issue
|
|
594
|
-
* trackers and Azure DevOps. Providers with no project tier (GitHub, GitLab, Bitbucket) contribute nothing.
|
|
595
|
-
*/
|
|
596
|
-
async listProjects(options) {
|
|
597
|
-
return listProjects(this, options);
|
|
598
|
-
}
|
|
599
|
-
/**
|
|
600
|
-
* Lists repositories under an org for a git-host provider, one page at a time. Pass `page` (1-based)
|
|
601
|
-
* to advance; the returned `cursor` is only meaningful for cursor-only hosts.
|
|
602
|
-
*/
|
|
603
|
-
async listRepos(options) {
|
|
604
|
-
return listRepos(this, options);
|
|
605
|
-
}
|
|
606
|
-
/**
|
|
607
|
-
* Reads one page of the user's pull requests for the given git-host provider. With `repos`, reads those
|
|
608
|
-
* repos' PRs (translating `page` ↔ the provider's opaque cursor) and maps the raw provider PRs to
|
|
609
|
-
* {@link PullRequestShape}. With no `repos`, reads the current user's PRs account-wide — the
|
|
610
|
-
* repo-scoped core rejects an empty `repos` input for GitHub/Bitbucket/Azure, so route to the
|
|
611
|
-
* account-wide `searchMyPullRequests` core instead (which is already user-scoped and returns shapes).
|
|
612
|
-
*/
|
|
613
|
-
async listPullRequestsPage(options) {
|
|
614
|
-
return listPullRequestsPage(this, options);
|
|
615
|
-
}
|
|
616
|
-
/** See {@link IntegrationManager.searchPullRequestsPage}. */
|
|
617
|
-
async searchPullRequestsPage(options) {
|
|
618
|
-
return searchPullRequestsPage(this, options);
|
|
619
|
-
}
|
|
620
|
-
async listIssuesPage(options) {
|
|
621
|
-
return listIssuesPage(this, options);
|
|
622
|
-
}
|
|
623
|
-
/**
|
|
624
|
-
* Issues matching structured criteria over a repository/org scope, with no forced relationship to the current
|
|
625
|
-
* user — see {@link IntegrationManager.searchIssuesPage} for the contract (mandatory scope, guaranteed
|
|
626
|
-
* most-recently-updated-first ordering, and the result-ceiling omission that carries the total match count).
|
|
627
|
-
*/
|
|
628
|
-
async searchIssuesPage(options) {
|
|
629
|
-
return searchIssuesPage(this, options);
|
|
630
|
-
}
|
|
631
|
-
/**
|
|
632
|
-
* How many issues match each scope, without fetching any — see {@link IntegrationManager.countIssues} for the
|
|
633
|
-
* cost model, the per-scope isolation rules, and why `count: undefined` must not be rendered as zero.
|
|
634
|
-
*/
|
|
635
|
-
async countIssues(options) {
|
|
636
|
-
return countIssues(this, options);
|
|
637
|
-
}
|
|
638
|
-
async getIssuesBatch(options) {
|
|
639
|
-
return getIssuesBatch(this, options);
|
|
640
|
-
}
|
|
641
|
-
async getTrackerIssue(options) {
|
|
642
|
-
return getTrackerIssue(this, options);
|
|
643
|
-
}
|
|
644
|
-
/**
|
|
645
|
-
* How many pull requests match each scope, without fetching any — the PR twin of {@link countIssues}. See
|
|
646
|
-
* {@link IntegrationManager.countPullRequests} for the cost model, the per-scope isolation rules, and why
|
|
647
|
-
* `count: undefined` must not be rendered as zero.
|
|
648
|
-
*/
|
|
649
|
-
async countPullRequests(options) {
|
|
650
|
-
return countPullRequests(this, options);
|
|
651
|
-
}
|
|
652
|
-
/**
|
|
653
|
-
* Reads the user's issues from an issue-tracker provider (Jira/Linear/Trello), whose issues live under
|
|
654
|
-
* resource → project (not repos), so they can't go through {@link listIssuesPage} (git-host, repo-scoped).
|
|
655
|
-
* Returns the normalized {@link IssueShape} these providers produce, aggregated across the projects of the
|
|
656
|
-
* given `org` (or every visible resource/project when omitted). `includeAllAssignees` drops the
|
|
657
|
-
* "assigned to me" scoping so unassigned issues are included. Best-effort: a per-step failure becomes a
|
|
658
|
-
* warning without failing the whole read.
|
|
659
|
-
*
|
|
660
|
-
* Paginated by project: these providers have no single cross-project issue cursor, so a page is a bounded
|
|
661
|
-
* window of projects (each drained by its own read). Pagination is opt-in — a caller that supplies none of
|
|
662
|
-
* `page`/`cursor`/`itemsPerPage` reads every matched project in one page (`hasMore: false`), preserving the
|
|
663
|
-
* "aggregate everything" contract for callers that don't page. When any of those is supplied, the read is
|
|
664
|
-
* windowed to `itemsPerPage` projects (default 20) advanced 1-based via `page`/`cursor`, with `hasMore`/
|
|
665
|
-
* `cursor` carrying the next window. Note: a project's own read has an internal page backstop (see the
|
|
666
|
-
* per-provider drains); if a single project exceeds it, its extra issues can't be paged from here, but that
|
|
667
|
-
* incompleteness IS surfaced as `page.truncated` (Jira/Linear report the backstop hit) rather than passed
|
|
668
|
-
* off as a complete read.
|
|
669
|
-
*
|
|
670
|
-
* Takes no `domain`, unlike the git-host reads: every issue-tracker provider is cloud-only
|
|
671
|
-
* ({@link IssuesCloudHostIntegrationId}), so there is no self-managed host to address.
|
|
672
|
-
*/
|
|
673
|
-
async listIssueTrackerIssuesPage(options) {
|
|
674
|
-
return listIssueTrackerIssuesPage(this, options);
|
|
675
|
-
}
|
|
676
|
-
/**
|
|
677
|
-
* Sweeps the user's pull requests across providers by draining every page (an "all-pages" read),
|
|
678
|
-
* returning the neutral sweep result with per-provider warnings. `truncated` is set when a provider
|
|
679
|
-
* hit `maxPages` with more still available; `fetchFailed` when a drain aborted on a read error.
|
|
680
|
-
* `targets` selects a connection/domain independently for each provider. The legacy `connectionId` is
|
|
681
|
-
* honored only when `providerIds` resolves to a single provider (otherwise ambiguous).
|
|
682
|
-
*/
|
|
683
|
-
async sweepPullRequests(options) {
|
|
684
|
-
return sweepPullRequests(this, options);
|
|
685
|
-
}
|
|
686
|
-
/**
|
|
687
|
-
* Closed/merged counterpart of {@link sweepPullRequests}, feeding Kepler's Kanban "done" column. Applies
|
|
688
|
-
* the native cross-provider state filter (`Closed` + `Merged`) so it works beyond GitHub.
|
|
689
|
-
*/
|
|
690
|
-
async sweepClosedPullRequests(options) {
|
|
691
|
-
return sweepClosedPullRequests(this, options);
|
|
692
|
-
}
|
|
693
|
-
/**
|
|
694
|
-
* Broadens the user's issues by fanning out over the supplied orgs: for each org it lists the org's
|
|
695
|
-
* repositories, then reads that org's issues. A per-org failure becomes a warning without failing the
|
|
696
|
-
* whole fan-out. `broadenedProviderIds` lists the distinct providers whose issue read resolved (even
|
|
697
|
-
* if every issue duplicated a baseline). `failedProviderIds` identifies providers with no usable org;
|
|
698
|
-
* `incompleteProviderIds` identifies providers with both a usable org and a failed/truncated sibling.
|
|
699
|
-
* `fanOutCount` is the number of org work items spawned.
|
|
700
|
-
* Each org may carry its own `connectionId` (and, for a self-managed host with no configured connection, its
|
|
701
|
-
* own `domain`) to target a specific account — the fan-out spans providers, so the target is scoped per org
|
|
702
|
-
* rather than globally.
|
|
703
|
-
*/
|
|
704
|
-
async broadenIssues(options) {
|
|
705
|
-
return broadenIssues(this, options);
|
|
706
|
-
}
|
|
707
|
-
/**
|
|
708
|
-
* Resolves a repository from a remote URL to its provider identity, using core-gitlens' remote matcher
|
|
709
|
-
* plus the provider's `getRepo` (the equivalent of `gk repo resolve`). Supports every provider whose
|
|
710
|
-
* client exposes `getRepo`. Per-request outcomes preserve the distinctions consumers need for their
|
|
711
|
-
* canonicalization policy.
|
|
712
|
-
*/
|
|
713
|
-
async resolveRepository(options) {
|
|
714
|
-
return resolveRepository(this, options);
|
|
715
|
-
}
|
|
716
|
-
/** {@link RepositoryResolutionContext} seam: the user's `remotes` configs, for the remote matcher. */
|
|
717
|
-
getRemoteConfigs() {
|
|
718
|
-
return this.ctx.config.getRemoteConfigs();
|
|
719
|
-
}
|
|
720
|
-
/** {@link RepositoryResolutionContext} seam: instance lookup by host, for the cloud-host resolution branch. */
|
|
721
|
-
getIntegrationForDomain(id, domain) {
|
|
722
|
-
return this.get(id, domain);
|
|
723
|
-
}
|
|
724
|
-
// #endregion ProviderBackend surface (#5438)
|
|
725
|
-
_ignoreSSLErrors = new Map();
|
|
726
|
-
ignoreSSLErrors(integration) {
|
|
727
|
-
if (this.ctx.http.isWeb)
|
|
728
|
-
return false;
|
|
729
|
-
// Key by id + domain: the config lookup is domain-scoped, so a value computed for one self-managed
|
|
730
|
-
// domain must not be reused for another domain of the same provider.
|
|
731
|
-
const cacheKey = `${integration.id}:${integration.domain ?? ''}`;
|
|
732
|
-
let ignoreSSLErrors = this._ignoreSSLErrors.get(cacheKey);
|
|
733
|
-
if (ignoreSSLErrors === undefined) {
|
|
734
|
-
// Normalize both sides to a RemoteProviderId before comparing: a lowercased config type
|
|
735
|
-
// (e.g. `AzureDevOps` → `azuredevops`, `BitbucketServer` → `bitbucketserver`) does not equal the
|
|
736
|
-
// integration id (`azureDevOps`, `bitbucket-server`), so a plain `toLowerCase()` compare misses them.
|
|
737
|
-
const integrationRemoteType = remoteProviderTypeForIntegration(integration.id);
|
|
738
|
-
const cfg = this.ctx.config.getRemoteConfigs().find(remote => {
|
|
739
|
-
if (integration.domain == null || integrationRemoteType == null)
|
|
740
|
-
return false;
|
|
741
|
-
if (remoteProviderTypeForConfig(remote.type) !== integrationRemoteType)
|
|
742
|
-
return false;
|
|
743
|
-
// Match domain- and regex-based remotes alike, so `ignoreSSLErrors` applies to a regex-configured
|
|
744
|
-
// self-managed host too (mirrors the matcher's own regex handling).
|
|
745
|
-
if (remote.domain != null)
|
|
746
|
-
return remote.domain === integration.domain;
|
|
747
|
-
// Truthy (not just non-null): an empty regex would compile to a match-everything pattern.
|
|
748
|
-
if (remote.regex) {
|
|
749
|
-
try {
|
|
750
|
-
return new RegExp(remote.regex, 'i').test(integration.domain);
|
|
751
|
-
}
|
|
752
|
-
catch {
|
|
753
|
-
return false;
|
|
754
|
-
}
|
|
755
|
-
}
|
|
756
|
-
return false;
|
|
757
|
-
});
|
|
758
|
-
ignoreSSLErrors = cfg?.ignoreSSLErrors ?? false;
|
|
759
|
-
this._ignoreSSLErrors.set(cacheKey, ignoreSSLErrors);
|
|
760
|
-
}
|
|
761
|
-
return ignoreSSLErrors;
|
|
762
|
-
}
|
|
763
|
-
async manageCloudIntegrations(source) {
|
|
764
|
-
this.ctx.hooks?.connection?.onManaged?.(source);
|
|
765
|
-
// The host owns the GK-Dev manage interaction (sign-in if needed, open settings, wait for the user
|
|
766
|
-
// to return); it resolves `true` once they're back, then we re-sync + report.
|
|
767
|
-
if (!(await this.ctx.account.openManagement(source)))
|
|
768
|
-
return;
|
|
769
|
-
const connected = await this.syncCloudIntegrations(true);
|
|
770
|
-
this.ctx.hooks?.connection?.onCompleted?.({
|
|
771
|
-
integrationIds: undefined,
|
|
772
|
-
connectedIntegrationIds: connected != null ? [...connected.values()] : undefined,
|
|
773
|
-
}, source);
|
|
774
|
-
}
|
|
775
|
-
async reset() {
|
|
776
|
-
for (const integration of this._integrations.values()) {
|
|
777
|
-
await integration.reset();
|
|
778
|
-
}
|
|
779
|
-
await this.authenticationService.reset();
|
|
780
|
-
await this.ctx.storage.deleteWithPrefix('provider:authentication:skip');
|
|
781
|
-
queueMicrotask(() => void this.syncCloudIntegrations(true));
|
|
782
|
-
}
|
|
783
|
-
supports(remoteProviderId) {
|
|
784
|
-
return convertRemoteProviderIdToIntegrationId(remoteProviderId) != null;
|
|
785
|
-
}
|
|
786
|
-
onAuthenticationSessionsChanged(e) {
|
|
787
|
-
for (const integration of this._integrations.values()) {
|
|
788
|
-
if (e.provider.id === integration.authProvider.id) {
|
|
789
|
-
integration.refresh();
|
|
790
|
-
}
|
|
791
|
-
}
|
|
792
|
-
}
|
|
793
|
-
onIntegrationConnectionChanged(e) {
|
|
794
|
-
const { integration, key, reason } = e;
|
|
795
|
-
if (reason === 'connected') {
|
|
796
|
-
// Only fire events if the key is being connected for the first time
|
|
797
|
-
if (this._connectedCache.has(key))
|
|
798
|
-
return;
|
|
799
|
-
this._connectedCache.add(key);
|
|
800
|
-
}
|
|
801
|
-
else {
|
|
802
|
-
// Probably shouldn't bother to fire the event if we don't already think we are connected, but better to be safe
|
|
803
|
-
// if (!_connectedCache.has(key)) return;
|
|
804
|
-
this._connectedCache.delete(key);
|
|
805
|
-
}
|
|
806
|
-
const connected = reason === 'connected';
|
|
807
|
-
if (integration.type === 'git') {
|
|
808
|
-
this.ctx.hooks?.connection?.onStateChanged?.({
|
|
809
|
-
id: integration.id,
|
|
810
|
-
key: key,
|
|
811
|
-
connected: connected,
|
|
812
|
-
kind: isSupportedCloudIntegrationId(integration.id) ? 'hosting' : 'remote',
|
|
813
|
-
});
|
|
814
|
-
}
|
|
815
|
-
else {
|
|
816
|
-
this.ctx.hooks?.connection?.onStateChanged?.({
|
|
817
|
-
id: integration.id,
|
|
818
|
-
key: key,
|
|
819
|
-
connected: connected,
|
|
820
|
-
kind: 'issue',
|
|
821
|
-
});
|
|
822
|
-
}
|
|
823
|
-
setTimeout(() => this._onDidChangeConnectionState.fire({ key: key, reason: reason }), 250);
|
|
824
|
-
}
|
|
825
|
-
async onSubscriptionChanged() {
|
|
826
|
-
// When the account goes away, disconnect all connected cloud integrations. Mirrors the host's
|
|
827
|
-
// historical `account == null` check (the host forwards `onDidChange` without a payload).
|
|
828
|
-
if ((await this.ctx.account.getAccount()) == null) {
|
|
829
|
-
void this.syncCloudIntegrations(false);
|
|
830
|
-
}
|
|
831
|
-
}
|
|
832
|
-
onUserCheckedIn(e) {
|
|
833
|
-
void this.syncCloudIntegrations(Boolean(e?.force));
|
|
834
|
-
}
|
|
835
|
-
_providersApi;
|
|
836
|
-
async getProvidersApi() {
|
|
837
|
-
if (this._providersApi == null) {
|
|
838
|
-
const authenticationService = this.authenticationService;
|
|
839
|
-
async function load() {
|
|
840
|
-
return new (await import(/* webpackChunkName: "integrations" */ './providers/providersApi.js')).ProvidersApi(authenticationService);
|
|
841
|
-
}
|
|
842
|
-
// Never keep a rejected promise cached: a single failure (a module-resolution error, a transient
|
|
843
|
-
// construction failure) would otherwise poison every `ProvidersApi` read for the lifetime of the
|
|
844
|
-
// service, so consumers get instant empty results with no way to recover short of a restart.
|
|
845
|
-
const loading = (this._providersApi = load());
|
|
846
|
-
void loading.catch(() => {
|
|
847
|
-
// Only clear our own attempt, so a newer load already in flight isn't dropped
|
|
848
|
-
if (this._providersApi === loading) {
|
|
849
|
-
this._providersApi = undefined;
|
|
850
|
-
}
|
|
851
|
-
});
|
|
852
|
-
}
|
|
853
|
-
return this._providersApi;
|
|
854
|
-
}
|
|
855
|
-
getCached(id, domain) {
|
|
856
|
-
return this._integrations.get(this.getCacheKey(id, domain));
|
|
857
|
-
}
|
|
858
|
-
getCacheKey(id, domain) {
|
|
859
|
-
return isGitSelfManagedHostIntegrationId(id) ? `${id}:${domain}` : id;
|
|
860
|
-
}
|
|
861
|
-
async *getSupportedCloudIntegrations(domainsById) {
|
|
862
|
-
for (const id of getSupportedCloudIntegrationIds()) {
|
|
863
|
-
if (isCloudGitSelfManagedHostIntegrationId(id)) {
|
|
864
|
-
const domains = new Set(domainsById.get(id) ?? []);
|
|
865
|
-
for (const domain of this.configuredIntegrationService
|
|
866
|
-
.getConfigured(id, { cloud: true })
|
|
867
|
-
.map(c => c.domain)
|
|
868
|
-
.filter((domain) => domain != null && domain.length > 0)) {
|
|
869
|
-
domains.add(hostFromDomain(domain) ?? domain);
|
|
870
|
-
}
|
|
871
|
-
if (domains.size !== 0) {
|
|
872
|
-
for (const domain of domains) {
|
|
873
|
-
const integration = await this.get(id, domain);
|
|
874
|
-
if (integration != null) {
|
|
875
|
-
yield integration;
|
|
876
|
-
}
|
|
877
|
-
}
|
|
878
|
-
continue;
|
|
879
|
-
}
|
|
880
|
-
// Try getting whatever we have now because we will need to disconnect.
|
|
881
|
-
const integration = await this.get(id, undefined);
|
|
882
|
-
if (integration != null) {
|
|
883
|
-
yield integration;
|
|
884
|
-
}
|
|
885
|
-
continue;
|
|
886
|
-
}
|
|
887
|
-
const integration = await this.get(id);
|
|
888
|
-
if (integration != null) {
|
|
889
|
-
yield integration;
|
|
890
|
-
}
|
|
891
|
-
}
|
|
892
|
-
}
|
|
893
|
-
getCloudConnectionState(integration, connectedIntegrations, domainsById) {
|
|
894
|
-
if (isCloudGitSelfManagedHostIntegrationId(integration.id)) {
|
|
895
|
-
const host = hostFromDomain(integration.domain) ?? integration.domain;
|
|
896
|
-
return domainsById.get(integration.id)?.has(host) ? 'connected' : 'disconnected';
|
|
897
|
-
}
|
|
898
|
-
return connectedIntegrations.has(integration.id) ? 'connected' : 'disconnected';
|
|
899
|
-
}
|
|
900
|
-
findCachedById(id) {
|
|
901
|
-
const cached = this._integrations.get(id);
|
|
902
|
-
if (cached != null)
|
|
903
|
-
return cached;
|
|
904
|
-
const key = `${id}:`;
|
|
905
|
-
for (const [k, integration] of this._integrations) {
|
|
906
|
-
if (k.startsWith(key)) {
|
|
907
|
-
return integration;
|
|
908
|
-
}
|
|
909
|
-
}
|
|
910
|
-
return undefined;
|
|
911
|
-
}
|
|
912
|
-
getCachedForDomain(id, domain) {
|
|
913
|
-
return isGitSelfManagedHostIntegrationId(id) ? this.getCached(id, domain) : this.findCachedById(id);
|
|
914
|
-
}
|
|
915
|
-
getConfiguredCloudConnection(id, connectionId) {
|
|
916
|
-
const connection = this.configuredIntegrationService
|
|
917
|
-
.getConfigured(id, { cloud: true })
|
|
918
|
-
.find(c => c.id === connectionId);
|
|
919
|
-
if (connection == null) {
|
|
920
|
-
throw new Error(`Connection '${connectionId}' is not configured for '${id}'`);
|
|
921
|
-
}
|
|
922
|
-
return connection;
|
|
923
|
-
}
|
|
924
|
-
getConfiguredConnectionDomain(id, connectionId) {
|
|
925
|
-
if (!isGitSelfManagedHostIntegrationId(id))
|
|
926
|
-
return undefined;
|
|
927
|
-
return this.configuredIntegrationService.getConfigured(id).find(c => c.id === connectionId)?.domain;
|
|
928
|
-
}
|
|
929
|
-
getCloudPrimaryConnectionIdsByDomain(id) {
|
|
930
|
-
const primaryByDomain = new Map();
|
|
931
|
-
const fallbackByDomain = new Map();
|
|
932
|
-
for (const descriptor of this.configuredIntegrationService.getConfigured(id, { cloud: true })) {
|
|
933
|
-
const domain = isGitSelfManagedHostIntegrationId(id)
|
|
934
|
-
? (hostFromDomain(descriptor.domain) ?? descriptor.domain)
|
|
935
|
-
: undefined;
|
|
936
|
-
if (!fallbackByDomain.has(domain)) {
|
|
937
|
-
fallbackByDomain.set(domain, descriptor.id);
|
|
938
|
-
}
|
|
939
|
-
if (descriptor.primary && !primaryByDomain.has(domain)) {
|
|
940
|
-
primaryByDomain.set(domain, descriptor.id);
|
|
941
|
-
}
|
|
942
|
-
}
|
|
943
|
-
for (const [domain, connectionId] of fallbackByDomain) {
|
|
944
|
-
if (!primaryByDomain.has(domain)) {
|
|
945
|
-
primaryByDomain.set(domain, connectionId);
|
|
946
|
-
}
|
|
947
|
-
}
|
|
948
|
-
return primaryByDomain;
|
|
949
|
-
}
|
|
950
|
-
async syncCloudIntegrations(forceConnect) {
|
|
951
|
-
const scope = getScopedLogger();
|
|
952
|
-
const connectedIntegrations = new Set();
|
|
953
|
-
const domainsById = new Map();
|
|
954
|
-
const connectionsById = new Map();
|
|
955
|
-
const loggedIn = (await this.ctx.account.getAccount()) != null;
|
|
956
|
-
if (loggedIn) {
|
|
957
|
-
const connections = await this.authenticationService.cloudIntegrations.getConnections();
|
|
958
|
-
if (connections == null)
|
|
959
|
-
return;
|
|
960
|
-
for (const p of connections) {
|
|
961
|
-
const integrationId = toIntegrationId[p.provider];
|
|
962
|
-
// GKDev includes some integrations like "google" that we don't support
|
|
963
|
-
if (integrationId == null)
|
|
964
|
-
continue;
|
|
965
|
-
connectedIntegrations.add(integrationId);
|
|
966
|
-
const list = connectionsById.get(integrationId);
|
|
967
|
-
if (list != null) {
|
|
968
|
-
list.push(p);
|
|
969
|
-
}
|
|
970
|
-
else {
|
|
971
|
-
connectionsById.set(integrationId, [p]);
|
|
972
|
-
}
|
|
973
|
-
if (p.domain?.length > 0) {
|
|
974
|
-
const host = hostFromDomain(p.domain);
|
|
975
|
-
if (host != null) {
|
|
976
|
-
let domains = domainsById.get(integrationId);
|
|
977
|
-
if (domains == null) {
|
|
978
|
-
domains = new Set();
|
|
979
|
-
domainsById.set(integrationId, domains);
|
|
980
|
-
}
|
|
981
|
-
domains.add(host);
|
|
982
|
-
}
|
|
983
|
-
else {
|
|
984
|
-
scope?.warn(`Invalid domain for ${integrationId} integration: ${p.domain}. Ignoring.`);
|
|
985
|
-
}
|
|
986
|
-
}
|
|
987
|
-
}
|
|
988
|
-
}
|
|
989
|
-
// Concurrent, not serial: each `syncCloudConnection` is a cloud round trip (a forced sync deletes the
|
|
990
|
-
// stored session and refetches it), so a serial loop pays the SUM of every provider's latency on a
|
|
991
|
-
// path that gates EVERY provider read. `reconcileCloudConnections` below is already `Promise.all`.
|
|
992
|
-
//
|
|
993
|
-
// Safe because every shared mutable path is already serialized, which is why this can be a plain
|
|
994
|
-
// fan-out rather than needing per-provider grouping:
|
|
995
|
-
// - `ensureProvider` is `@gate()`d on `providerId`, so the two integrations a multi-host
|
|
996
|
-
// self-managed id yields (one per domain, see `getSupportedCloudIntegrations`) share one
|
|
997
|
-
// in-flight construction instead of racing to `providers.set`.
|
|
998
|
-
// - `ensureSession` is `@gate()`d per integration instance.
|
|
999
|
-
// - `addOrUpdateConfigured`/`removeConfigured` mutate `configured` in a synchronous critical
|
|
1000
|
-
// section (no `await` between read and `set`), and `storeConfigured` has its own write queue.
|
|
1001
|
-
// - Secrets and the `connected:` workspace flags are keyed by integration id + domain.
|
|
1002
|
-
const integrations = [];
|
|
1003
|
-
for await (const integration of this.getSupportedCloudIntegrations(domainsById)) {
|
|
1004
|
-
integrations.push(integration);
|
|
1005
|
-
}
|
|
1006
|
-
await Promise.all(integrations.map(integration => integration.syncCloudConnection(this.getCloudConnectionState(integration, connectedIntegrations, domainsById), forceConnect)));
|
|
1007
|
-
// Persist every account when the backend advertises per-connection identity (multi-account). This
|
|
1008
|
-
// is a strict no-op for backends that return a single, id-less connection per provider.
|
|
1009
|
-
await Promise.all(Array.from(connectionsById, ([integrationId, connections]) => this.reconcileCloudConnections(integrationId, connections, forceConnect)));
|
|
1010
|
-
this.ctx.hooks?.connection?.onConnectedChanged?.({
|
|
1011
|
-
integrationIds: [...connectedIntegrations.values()],
|
|
1012
|
-
});
|
|
1013
|
-
return connectedIntegrations;
|
|
1014
|
-
}
|
|
1015
|
-
/**
|
|
1016
|
-
* Whether the user has locally disconnected this provider/host. Mirrors the integration model's
|
|
1017
|
-
* `connected:${key}` workspace flag (key = id for cloud, `${id}:${domain}` for self-managed), which is
|
|
1018
|
-
* set to `false` on a local disconnect and cleared on (re)connect.
|
|
1019
|
-
*/
|
|
1020
|
-
isLocallyDisconnected(id, host) {
|
|
1021
|
-
const key = isGitSelfManagedHostIntegrationId(id) ? `connected:${id}:${host ?? ''}` : `connected:${id}`;
|
|
1022
|
-
return this.ctx.storage.getWorkspace(key) === false;
|
|
1023
|
-
}
|
|
1024
|
-
/**
|
|
1025
|
-
* Reconciles the locally stored connections for a provider with what the backend reports, so that
|
|
1026
|
-
* multiple accounts on the same provider coexist. Only engages when the backend provides
|
|
1027
|
-
* per-connection ids; otherwise the single-connection flow above already handled the primary.
|
|
1028
|
-
*/
|
|
1029
|
-
async reconcileCloudConnections(id, connections, forceConnect) {
|
|
1030
|
-
const scope = getScopedLogger();
|
|
1031
|
-
const identified = connections.filter((c) => c.id != null);
|
|
1032
|
-
if (identified.length === 0)
|
|
1033
|
-
return;
|
|
1034
|
-
// Capture the effective primary before any mutation (sync store, prune-driven promotion, or the
|
|
1035
|
-
// backend primary selection below) so we can tell whether it actually changed. The prune step can
|
|
1036
|
-
// promote a secondary to primary via removeConfigured, so sampling this after pruning would miss it.
|
|
1037
|
-
const primaryBefore = this.getCloudPrimaryConnectionIdsByDomain(id);
|
|
1038
|
-
const cloudIntegrations = this.authenticationService.cloudIntegrations;
|
|
1039
|
-
// Fetch + store each connection's session so getConfigured() reflects every account.
|
|
1040
|
-
const syncedIds = new Set();
|
|
1041
|
-
const syncEligibleIds = new Set();
|
|
1042
|
-
const syncedPrimaryIdsByDomain = new Map();
|
|
1043
|
-
// Snapshot existing cloud descriptors by id once, so the per-connection account-name lookup below is
|
|
1044
|
-
// O(1) instead of re-filtering the whole configured list each iteration (O(n²) with multi-account).
|
|
1045
|
-
// Each backend connection id is processed once, so reading the pre-loop snapshot is sufficient.
|
|
1046
|
-
const existingById = new Map(this.configuredIntegrationService.getConfigured(id, { cloud: true }).map(c => [c.id, c]));
|
|
1047
|
-
const preparedConnections = await Promise.all(identified.map(async (connection) => {
|
|
1048
|
-
// The wire `domain` is usually a full URL, though cloud providers can return a bare host.
|
|
1049
|
-
// Self-managed integrations are keyed/constructed by host.
|
|
1050
|
-
const host = hostFromDomain(connection.domain);
|
|
1051
|
-
// Self-managed connections are keyed by host, so an unparseable/empty domain would store the
|
|
1052
|
-
// session and descriptor under an empty host — producing ambiguous keys (`connected:<id>:`) that
|
|
1053
|
-
// break later resolution and local-disconnect checks. Skip such a connection rather than corrupt
|
|
1054
|
-
// state; cloud providers key off their canonical domain and are unaffected.
|
|
1055
|
-
if (isGitSelfManagedHostIntegrationId(id) && !host) {
|
|
1056
|
-
scope?.warn(`Skipping connection '${connection.id}' for ${id}: unresolved host from domain`);
|
|
1057
|
-
return undefined;
|
|
1058
|
-
}
|
|
1059
|
-
// Don't resurrect a connection the user disconnected locally: a host "disconnect" only clears
|
|
1060
|
-
// local state (the backend still lists the token), so without this the next non-forced sync would
|
|
1061
|
-
// re-store the secret/config. A forced reconnect clears this flag (in the sync loop above) before
|
|
1062
|
-
// reconcile runs, so it proceeds normally.
|
|
1063
|
-
if (this.isLocallyDisconnected(id, host))
|
|
1064
|
-
return undefined;
|
|
1065
|
-
syncEligibleIds.add(connection.id);
|
|
1066
|
-
// On a routine (non-forced) check-in, skip the token fetch + secret write for a connection we
|
|
1067
|
-
// already have stored and that hasn't expired: nothing to refresh, so avoid the extra GK API
|
|
1068
|
-
// traffic and secret churn. Still treat it as synced (so it doesn't trip the prune guard) and
|
|
1069
|
-
// record its primary below. Forced syncs, new connections, and expired tokens fall through and
|
|
1070
|
-
// fetch as before.
|
|
1071
|
-
const cached = existingById.get(connection.id);
|
|
1072
|
-
if (!forceConnect && cached != null && !isDescriptorExpired(cached)) {
|
|
1073
|
-
return { kind: 'cached', connection: connection, host: host };
|
|
1074
|
-
}
|
|
1075
|
-
try {
|
|
1076
|
-
const session = await cloudIntegrations.getConnectionSession(id, undefined, connection.id);
|
|
1077
|
-
if (session == null)
|
|
1078
|
-
return undefined;
|
|
1079
|
-
let providerSession = toProviderSession(id, connection, session, host);
|
|
1080
|
-
// Resolve a human-readable account handle with the same precedence as the gk CLI:
|
|
1081
|
-
// (1) the value the backend put on the connection, (2) a previously-resolved name cached in
|
|
1082
|
-
// our configured store (keyed by connection id), (3) a live provider-API lookup. This keeps
|
|
1083
|
-
// provider round-trips to the first sight of a connection; degrade to undefined on failure.
|
|
1084
|
-
const existing = existingById.get(connection.id);
|
|
1085
|
-
const accountName = normalizeAccountName(connection.accountName) ??
|
|
1086
|
-
normalizeAccountName(existing?.accountName) ??
|
|
1087
|
-
(await this.resolveAccountName(id, host, providerSession));
|
|
1088
|
-
if (accountName != null) {
|
|
1089
|
-
providerSession = {
|
|
1090
|
-
...providerSession,
|
|
1091
|
-
account: { ...providerSession.account, label: accountName },
|
|
1092
|
-
};
|
|
1093
|
-
}
|
|
1094
|
-
return {
|
|
1095
|
-
kind: 'fetched',
|
|
1096
|
-
connection: connection,
|
|
1097
|
-
host: host,
|
|
1098
|
-
providerSession: providerSession,
|
|
1099
|
-
};
|
|
1100
|
-
}
|
|
1101
|
-
catch (ex) {
|
|
1102
|
-
scope?.warn(`Failed to sync connection '${connection.id}' for ${id}: ${ex instanceof Error ? ex.message : String(ex)}`);
|
|
1103
|
-
return undefined;
|
|
1104
|
-
}
|
|
1105
|
-
}));
|
|
1106
|
-
// The remote work above is independent, but session persistence remains ordered because storage
|
|
1107
|
-
// implementations may update a shared configured-connections collection with read-modify-write.
|
|
1108
|
-
for (const prepared of preparedConnections) {
|
|
1109
|
-
if (prepared == null)
|
|
1110
|
-
continue;
|
|
1111
|
-
if (prepared.kind === 'fetched') {
|
|
1112
|
-
await this.configuredIntegrationService.storeSession(id, prepared.providerSession);
|
|
1113
|
-
}
|
|
1114
|
-
syncedIds.add(prepared.connection.id);
|
|
1115
|
-
if (prepared.connection.primary) {
|
|
1116
|
-
const domain = isGitSelfManagedHostIntegrationId(id) ? prepared.host : undefined;
|
|
1117
|
-
if (!syncedPrimaryIdsByDomain.has(domain)) {
|
|
1118
|
-
syncedPrimaryIdsByDomain.set(domain, prepared.connection.id);
|
|
1119
|
-
}
|
|
1120
|
-
}
|
|
1121
|
-
}
|
|
1122
|
-
// Prune stored cloud connections that no longer exist on the backend — but only when every backend
|
|
1123
|
-
// connection that should sync did sync this cycle. Otherwise a transient token fetch failure would
|
|
1124
|
-
// delete a still-valid connection with no replacement (e.g. a legacy single connection during the
|
|
1125
|
-
// backend id rollout); defer pruning to a later clean cycle. Deliberately skipped connections (local
|
|
1126
|
-
// disconnects or invalid self-managed hosts) don't block pruning of unrelated stale descriptors.
|
|
1127
|
-
// Scope deletes to cloud so a local PAT sharing the id survives.
|
|
1128
|
-
const prunedDomains = new Set();
|
|
1129
|
-
if ([...syncEligibleIds].every(connectionId => syncedIds.has(connectionId))) {
|
|
1130
|
-
const liveIds = new Set(identified.map(c => c.id));
|
|
1131
|
-
for (const descriptor of this.configuredIntegrationService.getConfigured(id, { cloud: true })) {
|
|
1132
|
-
if (!liveIds.has(descriptor.id)) {
|
|
1133
|
-
prunedDomains.add(isGitSelfManagedHostIntegrationId(id) ? descriptor.domain : undefined);
|
|
1134
|
-
await this.configuredIntegrationService.deleteConnection(id, descriptor.id, true);
|
|
1135
|
-
}
|
|
1136
|
-
}
|
|
1137
|
-
}
|
|
1138
|
-
// Apply the backend's primary selection, then refresh any warm model only when the effective primary
|
|
1139
|
-
// actually changed (vs the pre-reconcile value captured above). switchConnection() drops the in-memory
|
|
1140
|
-
// session and fires change events, so calling it on every check-in (when the primary is unchanged)
|
|
1141
|
-
// causes needless churn for multi-account providers. Self-managed providers can have one primary per
|
|
1142
|
-
// host, so apply and refresh by host scope rather than by provider id alone.
|
|
1143
|
-
for (const connectionId of syncedPrimaryIdsByDomain.values()) {
|
|
1144
|
-
await this.configuredIntegrationService.setPrimaryConnection(id, connectionId);
|
|
1145
|
-
}
|
|
1146
|
-
const primaryAfter = this.getCloudPrimaryConnectionIdsByDomain(id);
|
|
1147
|
-
const domains = new Set(primaryBefore.keys());
|
|
1148
|
-
for (const domain of primaryAfter.keys()) {
|
|
1149
|
-
domains.add(domain);
|
|
1150
|
-
}
|
|
1151
|
-
for (const domain of prunedDomains) {
|
|
1152
|
-
domains.add(domain);
|
|
1153
|
-
}
|
|
1154
|
-
for (const domain of domains) {
|
|
1155
|
-
if (primaryBefore.get(domain) === primaryAfter.get(domain) && !prunedDomains.has(domain))
|
|
1156
|
-
continue;
|
|
1157
|
-
this.getCachedForDomain(id, domain)?.switchConnection();
|
|
1158
|
-
}
|
|
1159
|
-
}
|
|
1160
|
-
/**
|
|
1161
|
-
* Switches the default connection for a provider to `connectionId` (its backend token id). Performs
|
|
1162
|
-
* the server-side primary switch first, then mirrors it locally and refreshes any warm model. Throws
|
|
1163
|
-
* if the backend switch fails so the caller can surface it (local state stays untouched).
|
|
1164
|
-
*/
|
|
1165
|
-
async setPrimaryConnection(id, connectionId) {
|
|
1166
|
-
const connection = this.getConfiguredCloudConnection(id, connectionId);
|
|
1167
|
-
if (!(await this.authenticationService.cloudIntegrations.setPrimaryConnection(id, connectionId))) {
|
|
1168
|
-
throw new Error(`Failed to set primary connection '${connectionId}' for '${id}'`);
|
|
1169
|
-
}
|
|
1170
|
-
await this.configuredIntegrationService.setPrimaryConnection(id, connectionId);
|
|
1171
|
-
this.getCachedForDomain(id, connection.domain)?.switchConnection();
|
|
1172
|
-
}
|
|
1173
|
-
/**
|
|
1174
|
-
* Removes a single connection for a provider by its backend token id. The backend removes the
|
|
1175
|
-
* connection (auto-promoting a secondary to primary when the removed one was primary); we then mirror
|
|
1176
|
-
* that locally and refresh any warm model. Unlike {@link IntegrationBase.disconnect}, this targets one
|
|
1177
|
-
* account. This always talks to the cloud backend, so the local mirror is cloud-scoped and preserves any
|
|
1178
|
-
* local PAT that happens to share the same id.
|
|
1179
|
-
* Throws if the backend delete fails so the caller can surface it (local state stays untouched).
|
|
1180
|
-
*/
|
|
1181
|
-
async deleteConnection(id, connectionId) {
|
|
1182
|
-
const connection = this.getConfiguredCloudConnection(id, connectionId);
|
|
1183
|
-
if (!(await this.authenticationService.cloudIntegrations.disconnectConnection(id, connectionId))) {
|
|
1184
|
-
throw new Error(`Failed to delete connection '${connectionId}' for '${id}'`);
|
|
1185
|
-
}
|
|
1186
|
-
await this.configuredIntegrationService.deleteConnection(id, connectionId, true);
|
|
1187
|
-
this.getCachedForDomain(id, connection.domain)?.switchConnection();
|
|
1188
|
-
}
|
|
1189
|
-
/**
|
|
1190
|
-
* Resolves a human-readable account handle (e.g. the GitHub login) for a connection by asking the
|
|
1191
|
-
* provider API with that connection's token. The token backend doesn't expose it. Routes through the
|
|
1192
|
-
* integration model so the correct provider API base URL (incl. self-managed domains) and auth type
|
|
1193
|
-
* are used. Best-effort: returns undefined on any failure so callers degrade gracefully.
|
|
1194
|
-
*/
|
|
1195
|
-
async resolveAccountName(id, host, session) {
|
|
1196
|
-
const scope = getScopedLogger();
|
|
1197
|
-
try {
|
|
1198
|
-
// Route through the integration so the correct provider API base URL (incl. the self-managed
|
|
1199
|
-
// host) and auth type are used. Cloud providers ignore the host.
|
|
1200
|
-
const integration = await this.get(id, host);
|
|
1201
|
-
const account = await integration?.getProviderAccountForSession(session);
|
|
1202
|
-
return account?.username ?? account?.name ?? undefined;
|
|
1203
|
-
}
|
|
1204
|
-
catch (ex) {
|
|
1205
|
-
scope?.warn(`Failed to resolve account name for '${id}': ${ex instanceof Error ? ex.message : String(ex)}`);
|
|
1206
|
-
return undefined;
|
|
1207
|
-
}
|
|
1208
|
-
}
|
|
1209
|
-
/**
|
|
1210
|
-
* Forces a refresh of connected cloud integrations from the backend (equivalent to a "--sync" list),
|
|
1211
|
-
* reconciling local state (multi-account connections, primary flags, account names) so a subsequent
|
|
1212
|
-
* {@link getConfigured} reflects the latest server-side connections. Intended for consumers that need
|
|
1213
|
-
* an up-to-date connection list on demand. Rejects when the authoritative backend connection list cannot
|
|
1214
|
-
* be read, so callers never mistake stale local state for a successful refresh.
|
|
1215
|
-
*/
|
|
1216
|
-
async refreshConnections() {
|
|
1217
|
-
const connected = await this.syncCloudIntegrations(true);
|
|
1218
|
-
if (connected == null) {
|
|
1219
|
-
throw new Error('Failed to refresh provider connections');
|
|
1220
|
-
}
|
|
1221
|
-
}
|
|
1222
|
-
}
|
|
1223
|
-
__decorate([
|
|
1224
|
-
debug()
|
|
1225
|
-
], IntegrationService.prototype, "connectCloudIntegrations", null);
|
|
1226
|
-
__decorate([
|
|
1227
|
-
debug({
|
|
1228
|
-
args: integrationIds => ({ integrationIds: integrationIds?.length ? integrationIds.join(',') : '<undefined>' }),
|
|
1229
|
-
})
|
|
1230
|
-
], IntegrationService.prototype, "getMyIssues", null);
|
|
1231
|
-
__decorate([
|
|
1232
|
-
trace({
|
|
1233
|
-
args: (remoteOrRemotes) => ({
|
|
1234
|
-
remoteOrRemotes: Array.isArray(remoteOrRemotes) ? remoteOrRemotes.map(rp => rp.name) : remoteOrRemotes.name,
|
|
1235
|
-
}),
|
|
1236
|
-
})
|
|
1237
|
-
], IntegrationService.prototype, "getMyIssuesForRemotes", null);
|
|
1238
|
-
__decorate([
|
|
1239
|
-
debug({
|
|
1240
|
-
args: (integrationIds, connectionId) => ({
|
|
1241
|
-
integrationIds: integrationIds?.length ? integrationIds.join(',') : '<undefined>',
|
|
1242
|
-
connectionId: connectionId ?? '<primary>',
|
|
1243
|
-
}),
|
|
1244
|
-
})
|
|
1245
|
-
], IntegrationService.prototype, "getMyCurrentAccounts", null);
|
|
1246
|
-
__decorate([
|
|
1247
|
-
debug({
|
|
1248
|
-
args: integrationIds => ({ integrationIds: integrationIds?.length ? integrationIds.join(',') : '<undefined>' }),
|
|
1249
|
-
})
|
|
1250
|
-
], IntegrationService.prototype, "getMyPullRequests", null);
|
|
1251
|
-
__decorate([
|
|
1252
|
-
trace({
|
|
1253
|
-
args: (remoteOrRemotes) => ({
|
|
1254
|
-
remoteOrRemotes: Array.isArray(remoteOrRemotes) ? remoteOrRemotes.map(rp => rp.name) : remoteOrRemotes.name,
|
|
1255
|
-
}),
|
|
1256
|
-
})
|
|
1257
|
-
], IntegrationService.prototype, "getMyPullRequestsForRemotes", null);
|
|
1258
|
-
__decorate([
|
|
1259
|
-
debug()
|
|
1260
|
-
], IntegrationService.prototype, "manageCloudIntegrations", null);
|
|
1261
|
-
__decorate([
|
|
1262
|
-
debug()
|
|
1263
|
-
], IntegrationService.prototype, "reset", null);
|
|
1264
|
-
__decorate([
|
|
1265
|
-
gate(),
|
|
1266
|
-
trace()
|
|
1267
|
-
], IntegrationService.prototype, "syncCloudIntegrations", null);
|
|
993
|
+
__decorate([debug()], IntegrationService.prototype, "connectCloudIntegrations", null);
|
|
994
|
+
__decorate([debug({ args: (integrationIds) => ({ integrationIds: integrationIds?.length ? integrationIds.join(",") : "<undefined>" }) })], IntegrationService.prototype, "getMyIssues", null);
|
|
995
|
+
__decorate([trace({ args: (remoteOrRemotes) => ({ remoteOrRemotes: Array.isArray(remoteOrRemotes) ? remoteOrRemotes.map((rp) => rp.name) : remoteOrRemotes.name }) })], IntegrationService.prototype, "getMyIssuesForRemotes", null);
|
|
996
|
+
__decorate([debug({ args: (integrationIds, connectionId) => ({
|
|
997
|
+
integrationIds: integrationIds?.length ? integrationIds.join(",") : "<undefined>",
|
|
998
|
+
connectionId: connectionId ?? "<primary>"
|
|
999
|
+
}) })], IntegrationService.prototype, "getMyCurrentAccounts", null);
|
|
1000
|
+
__decorate([debug({ args: (integrationIds) => ({ integrationIds: integrationIds?.length ? integrationIds.join(",") : "<undefined>" }) })], IntegrationService.prototype, "getMyPullRequests", null);
|
|
1001
|
+
__decorate([trace({ args: (remoteOrRemotes) => ({ remoteOrRemotes: Array.isArray(remoteOrRemotes) ? remoteOrRemotes.map((rp) => rp.name) : remoteOrRemotes.name }) })], IntegrationService.prototype, "getMyPullRequestsForRemotes", null);
|
|
1002
|
+
__decorate([debug()], IntegrationService.prototype, "manageCloudIntegrations", null);
|
|
1003
|
+
__decorate([debug()], IntegrationService.prototype, "reset", null);
|
|
1004
|
+
__decorate([gate(), trace()], IntegrationService.prototype, "syncCloudIntegrations", null);
|
|
1268
1005
|
/** Internal factory used by the GitLens host and integration tests that need the full service surface. */
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
return service;
|
|
1006
|
+
function createIntegrationService(ctx) {
|
|
1007
|
+
const configured = new ConfiguredIntegrationService(ctx);
|
|
1008
|
+
const cloud = new CloudIntegrationService(ctx);
|
|
1009
|
+
let service;
|
|
1010
|
+
service = new IntegrationService(new IntegrationAuthenticationService(configured, ctx, () => service, cloud), configured, ctx);
|
|
1011
|
+
purgeRetiredIntegrationStorage(ctx, configured);
|
|
1012
|
+
return service;
|
|
1277
1013
|
}
|
|
1278
|
-
const retiredIntegrationsStorageKey =
|
|
1014
|
+
const retiredIntegrationsStorageKey = "integrations:migrated:cloudOnly";
|
|
1279
1015
|
async function purgeRetiredIntegrationStorage(ctx, configured) {
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
}
|
|
1286
|
-
catch {
|
|
1287
|
-
// Best-effort cleanup retries on the next startup while the migration flag remains unset.
|
|
1288
|
-
}
|
|
1016
|
+
if (ctx.storage.get(retiredIntegrationsStorageKey)) return;
|
|
1017
|
+
try {
|
|
1018
|
+
await configured.purgeStoredConfiguration(["github-enterprise", "gitlab-self-hosted"]);
|
|
1019
|
+
await ctx.storage.store(retiredIntegrationsStorageKey, true);
|
|
1020
|
+
} catch {}
|
|
1289
1021
|
}
|
|
1290
1022
|
function protocolFromDomain(domain) {
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
catch {
|
|
1300
|
-
return undefined;
|
|
1301
|
-
}
|
|
1023
|
+
const value = domain?.trim();
|
|
1024
|
+
if (!value) return void 0;
|
|
1025
|
+
if (!/^[a-z][a-z\d+\-.]*:\/\//i.test(value)) return void 0;
|
|
1026
|
+
try {
|
|
1027
|
+
return new URL(value).protocol || void 0;
|
|
1028
|
+
} catch {
|
|
1029
|
+
return;
|
|
1030
|
+
}
|
|
1302
1031
|
}
|
|
1303
1032
|
function normalizeAccountName(accountName) {
|
|
1304
|
-
|
|
1305
|
-
|
|
1033
|
+
const value = accountName?.trim();
|
|
1034
|
+
return value ? value : void 0;
|
|
1306
1035
|
}
|
|
1307
1036
|
/**
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1037
|
+
* Whether a stored connection descriptor's token has expired. A missing `expiresAt` is treated as
|
|
1038
|
+
* not-expired (non-expiring/legacy tokens, e.g. GitHub and self-managed cloud, carry no meaningful
|
|
1039
|
+
* expiry), matching the session-expiry checks elsewhere.
|
|
1040
|
+
*/
|
|
1312
1041
|
function isDescriptorExpired(descriptor) {
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
return new Date(descriptor.expiresAt).getTime() < Date.now();
|
|
1042
|
+
if (descriptor.expiresAt == null) return false;
|
|
1043
|
+
return new Date(descriptor.expiresAt).getTime() < Date.now();
|
|
1316
1044
|
}
|
|
1317
|
-
function toProviderSession(id, connection, session, host) {
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
};
|
|
1045
|
+
function toProviderSession(id, connection, session, host, knownBaseUrl) {
|
|
1046
|
+
const expiresIn = session.expiresIn === 0 && isNonExpiringZeroTokenIntegrationId(id) ? maxSmallIntegerV8 : session.expiresIn;
|
|
1047
|
+
const protocol = protocolFromDomain(connection.domain);
|
|
1048
|
+
return {
|
|
1049
|
+
id: connection.id,
|
|
1050
|
+
accessToken: session.accessToken,
|
|
1051
|
+
account: {
|
|
1052
|
+
id: "",
|
|
1053
|
+
label: ""
|
|
1054
|
+
},
|
|
1055
|
+
scopes: session.scopes ? session.scopes.split(",") : [],
|
|
1056
|
+
cloud: true,
|
|
1057
|
+
type: session.type,
|
|
1058
|
+
expiresAt: new Date(expiresIn * 1e3 + Date.now()),
|
|
1059
|
+
domain: isSelfManagedHostIntegrationId(id) ? host ?? "" : providersMetadata[id]?.domain ?? "",
|
|
1060
|
+
...connection.domain ? { baseUrl: connection.domain } : knownBaseUrl ? { baseUrl: knownBaseUrl } : {},
|
|
1061
|
+
...protocol != null ? { protocol } : {},
|
|
1062
|
+
...session.appKey != null ? { appKey: session.appKey } : {}
|
|
1063
|
+
};
|
|
1337
1064
|
}
|
|
1065
|
+
//#endregion
|
|
1066
|
+
export { IntegrationService, createIntegrationService };
|
|
1067
|
+
|
|
1338
1068
|
//# sourceMappingURL=integrationService.js.map
|