@gitkraken/core-gitlens 0.1.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 +16 -0
- package/LICENSE +30 -0
- package/LICENSE.plus +40 -0
- package/README.md +54 -0
- package/dist/git/cache.d.ts +140 -0
- package/dist/git/cache.d.ts.map +1 -0
- package/dist/git/cache.js +765 -0
- package/dist/git/cache.js.map +1 -0
- package/dist/git/context.d.ts +238 -0
- package/dist/git/context.d.ts.map +1 -0
- package/dist/git/context.js +11 -0
- package/dist/git/context.js.map +1 -0
- package/dist/git/errors.d.ts +419 -0
- package/dist/git/errors.d.ts.map +1 -0
- package/dist/git/errors.js +681 -0
- package/dist/git/errors.js.map +1 -0
- package/dist/git/exec.types.d.ts +66 -0
- package/dist/git/exec.types.d.ts.map +1 -0
- package/dist/git/exec.types.js +2 -0
- package/dist/git/exec.types.js.map +1 -0
- package/dist/git/features.d.ts +8 -0
- package/dist/git/features.d.ts.map +1 -0
- package/dist/git/features.js +18 -0
- package/dist/git/features.js.map +1 -0
- package/dist/git/models/author.d.ts +17 -0
- package/dist/git/models/author.d.ts.map +1 -0
- package/dist/git/models/author.js +2 -0
- package/dist/git/models/author.js.map +1 -0
- package/dist/git/models/autolink.d.ts +51 -0
- package/dist/git/models/autolink.d.ts.map +1 -0
- package/dist/git/models/autolink.js +2 -0
- package/dist/git/models/autolink.js.map +1 -0
- package/dist/git/models/blame.d.ts +41 -0
- package/dist/git/models/blame.d.ts.map +1 -0
- package/dist/git/models/blame.js +2 -0
- package/dist/git/models/blame.js.map +1 -0
- package/dist/git/models/branch.d.ts +85 -0
- package/dist/git/models/branch.d.ts.map +1 -0
- package/dist/git/models/branch.js +174 -0
- package/dist/git/models/branch.js.map +1 -0
- package/dist/git/models/commit.d.ts +163 -0
- package/dist/git/models/commit.d.ts.map +1 -0
- package/dist/git/models/commit.js +496 -0
- package/dist/git/models/commit.js.map +1 -0
- package/dist/git/models/contributor.d.ts +40 -0
- package/dist/git/models/contributor.d.ts.map +1 -0
- package/dist/git/models/contributor.js +67 -0
- package/dist/git/models/contributor.js.map +1 -0
- package/dist/git/models/defaultBranch.d.ts +6 -0
- package/dist/git/models/defaultBranch.d.ts.map +1 -0
- package/dist/git/models/defaultBranch.js +2 -0
- package/dist/git/models/defaultBranch.js.map +1 -0
- package/dist/git/models/diff.d.ts +73 -0
- package/dist/git/models/diff.d.ts.map +1 -0
- package/dist/git/models/diff.js +2 -0
- package/dist/git/models/diff.js.map +1 -0
- package/dist/git/models/file.d.ts +23 -0
- package/dist/git/models/file.d.ts.map +1 -0
- package/dist/git/models/file.js +2 -0
- package/dist/git/models/file.js.map +1 -0
- package/dist/git/models/fileChange.d.ts +50 -0
- package/dist/git/models/fileChange.d.ts.map +1 -0
- package/dist/git/models/fileChange.js +69 -0
- package/dist/git/models/fileChange.js.map +1 -0
- package/dist/git/models/fileStatus.d.ts +33 -0
- package/dist/git/models/fileStatus.d.ts.map +1 -0
- package/dist/git/models/fileStatus.js +29 -0
- package/dist/git/models/fileStatus.js.map +1 -0
- package/dist/git/models/graph.d.ts +171 -0
- package/dist/git/models/graph.d.ts.map +1 -0
- package/dist/git/models/graph.js +2 -0
- package/dist/git/models/graph.js.map +1 -0
- package/dist/git/models/graphSearch.d.ts +48 -0
- package/dist/git/models/graphSearch.d.ts.map +1 -0
- package/dist/git/models/graphSearch.js +2 -0
- package/dist/git/models/graphSearch.js.map +1 -0
- package/dist/git/models/issue.d.ts +69 -0
- package/dist/git/models/issue.d.ts.map +1 -0
- package/dist/git/models/issue.js +68 -0
- package/dist/git/models/issue.js.map +1 -0
- package/dist/git/models/issueOrPullRequest.d.ts +19 -0
- package/dist/git/models/issueOrPullRequest.d.ts.map +1 -0
- package/dist/git/models/issueOrPullRequest.js +2 -0
- package/dist/git/models/issueOrPullRequest.js.map +1 -0
- package/dist/git/models/lineRange.d.ts +8 -0
- package/dist/git/models/lineRange.d.ts.map +1 -0
- package/dist/git/models/lineRange.js +2 -0
- package/dist/git/models/lineRange.js.map +1 -0
- package/dist/git/models/log.d.ts +19 -0
- package/dist/git/models/log.d.ts.map +1 -0
- package/dist/git/models/log.js +2 -0
- package/dist/git/models/log.js.map +1 -0
- package/dist/git/models/mergeConflicts.d.ts +23 -0
- package/dist/git/models/mergeConflicts.d.ts.map +1 -0
- package/dist/git/models/mergeConflicts.js +2 -0
- package/dist/git/models/mergeConflicts.js.map +1 -0
- package/dist/git/models/patch.d.ts +22 -0
- package/dist/git/models/patch.d.ts.map +1 -0
- package/dist/git/models/patch.js +2 -0
- package/dist/git/models/patch.js.map +1 -0
- package/dist/git/models/pausedOperationStatus.d.ts +52 -0
- package/dist/git/models/pausedOperationStatus.d.ts.map +1 -0
- package/dist/git/models/pausedOperationStatus.js +2 -0
- package/dist/git/models/pausedOperationStatus.js.map +1 -0
- package/dist/git/models/pullRequest.d.ts +125 -0
- package/dist/git/models/pullRequest.d.ts.map +1 -0
- package/dist/git/models/pullRequest.js +127 -0
- package/dist/git/models/pullRequest.js.map +1 -0
- package/dist/git/models/rebase.d.ts +51 -0
- package/dist/git/models/rebase.d.ts.map +1 -0
- package/dist/git/models/rebase.js +2 -0
- package/dist/git/models/rebase.js.map +1 -0
- package/dist/git/models/reference.d.ts +48 -0
- package/dist/git/models/reference.d.ts.map +1 -0
- package/dist/git/models/reference.js +2 -0
- package/dist/git/models/reference.js.map +1 -0
- package/dist/git/models/reflog.d.ts +33 -0
- package/dist/git/models/reflog.d.ts.map +1 -0
- package/dist/git/models/reflog.js +85 -0
- package/dist/git/models/reflog.js.map +1 -0
- package/dist/git/models/remote.d.ts +37 -0
- package/dist/git/models/remote.d.ts.map +1 -0
- package/dist/git/models/remote.js +98 -0
- package/dist/git/models/remote.js.map +1 -0
- package/dist/git/models/remoteProvider.d.ts +112 -0
- package/dist/git/models/remoteProvider.d.ts.map +1 -0
- package/dist/git/models/remoteProvider.js +154 -0
- package/dist/git/models/remoteProvider.js.map +1 -0
- package/dist/git/models/remoteResource.d.ts +78 -0
- package/dist/git/models/remoteResource.d.ts.map +1 -0
- package/dist/git/models/remoteResource.js +13 -0
- package/dist/git/models/remoteResource.js.map +1 -0
- package/dist/git/models/repository.d.ts +106 -0
- package/dist/git/models/repository.d.ts.map +1 -0
- package/dist/git/models/repository.js +324 -0
- package/dist/git/models/repository.js.map +1 -0
- package/dist/git/models/repositoryChangeEvent.d.ts +17 -0
- package/dist/git/models/repositoryChangeEvent.d.ts.map +1 -0
- package/dist/git/models/repositoryChangeEvent.js +26 -0
- package/dist/git/models/repositoryChangeEvent.js.map +1 -0
- package/dist/git/models/repositoryIdentities.d.ts +72 -0
- package/dist/git/models/repositoryIdentities.d.ts.map +1 -0
- package/dist/git/models/repositoryIdentities.js +7 -0
- package/dist/git/models/repositoryIdentities.js.map +1 -0
- package/dist/git/models/repositoryMetadata.d.ts +12 -0
- package/dist/git/models/repositoryMetadata.d.ts.map +1 -0
- package/dist/git/models/repositoryMetadata.js +2 -0
- package/dist/git/models/repositoryMetadata.js.map +1 -0
- package/dist/git/models/resourceDescriptor.d.ts +12 -0
- package/dist/git/models/resourceDescriptor.d.ts.map +1 -0
- package/dist/git/models/resourceDescriptor.js +2 -0
- package/dist/git/models/resourceDescriptor.js.map +1 -0
- package/dist/git/models/revision.d.ts +7 -0
- package/dist/git/models/revision.d.ts.map +1 -0
- package/dist/git/models/revision.js +6 -0
- package/dist/git/models/revision.js.map +1 -0
- package/dist/git/models/search.d.ts +66 -0
- package/dist/git/models/search.d.ts.map +1 -0
- package/dist/git/models/search.js +48 -0
- package/dist/git/models/search.js.map +1 -0
- package/dist/git/models/shortlog.d.ts +6 -0
- package/dist/git/models/shortlog.d.ts.map +1 -0
- package/dist/git/models/shortlog.js +2 -0
- package/dist/git/models/shortlog.js.map +1 -0
- package/dist/git/models/signature.d.ts +26 -0
- package/dist/git/models/signature.d.ts.map +1 -0
- package/dist/git/models/signature.js +2 -0
- package/dist/git/models/signature.js.map +1 -0
- package/dist/git/models/staging.d.ts +24 -0
- package/dist/git/models/staging.d.ts.map +1 -0
- package/dist/git/models/staging.js +2 -0
- package/dist/git/models/staging.js.map +1 -0
- package/dist/git/models/stash.d.ts +6 -0
- package/dist/git/models/stash.d.ts.map +1 -0
- package/dist/git/models/stash.js +2 -0
- package/dist/git/models/stash.js.map +1 -0
- package/dist/git/models/status.d.ts +55 -0
- package/dist/git/models/status.d.ts.map +1 -0
- package/dist/git/models/status.js +208 -0
- package/dist/git/models/status.js.map +1 -0
- package/dist/git/models/statusFile.d.ts +28 -0
- package/dist/git/models/statusFile.d.ts.map +1 -0
- package/dist/git/models/statusFile.js +114 -0
- package/dist/git/models/statusFile.js.map +1 -0
- package/dist/git/models/tag.d.ts +26 -0
- package/dist/git/models/tag.d.ts.map +1 -0
- package/dist/git/models/tag.js +73 -0
- package/dist/git/models/tag.js.map +1 -0
- package/dist/git/models/tree.d.ts +10 -0
- package/dist/git/models/tree.d.ts.map +1 -0
- package/dist/git/models/tree.js +2 -0
- package/dist/git/models/tree.js.map +1 -0
- package/dist/git/models/user.d.ts +7 -0
- package/dist/git/models/user.d.ts.map +1 -0
- package/dist/git/models/user.js +2 -0
- package/dist/git/models/user.js.map +1 -0
- package/dist/git/models/worktree.d.ts +51 -0
- package/dist/git/models/worktree.d.ts.map +1 -0
- package/dist/git/models/worktree.js +136 -0
- package/dist/git/models/worktree.js.map +1 -0
- package/dist/git/parsers/diffParser.d.ts +45 -0
- package/dist/git/parsers/diffParser.d.ts.map +1 -0
- package/dist/git/parsers/diffParser.js +628 -0
- package/dist/git/parsers/diffParser.js.map +1 -0
- package/dist/git/parsers/rebaseTodoParser.d.ts +15 -0
- package/dist/git/parsers/rebaseTodoParser.d.ts.map +1 -0
- package/dist/git/parsers/rebaseTodoParser.js +215 -0
- package/dist/git/parsers/rebaseTodoParser.js.map +1 -0
- package/dist/git/providers/blame.d.ts +15 -0
- package/dist/git/providers/blame.d.ts.map +1 -0
- package/dist/git/providers/blame.js +2 -0
- package/dist/git/providers/blame.js.map +1 -0
- package/dist/git/providers/branches.d.ts +80 -0
- package/dist/git/providers/branches.d.ts.map +1 -0
- package/dist/git/providers/branches.js +2 -0
- package/dist/git/providers/branches.js.map +1 -0
- package/dist/git/providers/commits.d.ts +102 -0
- package/dist/git/providers/commits.d.ts.map +1 -0
- package/dist/git/providers/commits.js +2 -0
- package/dist/git/providers/commits.js.map +1 -0
- package/dist/git/providers/config.d.ts +64 -0
- package/dist/git/providers/config.d.ts.map +1 -0
- package/dist/git/providers/config.js +2 -0
- package/dist/git/providers/config.js.map +1 -0
- package/dist/git/providers/contributors.d.ts +26 -0
- package/dist/git/providers/contributors.d.ts.map +1 -0
- package/dist/git/providers/contributors.js +2 -0
- package/dist/git/providers/contributors.js.map +1 -0
- package/dist/git/providers/diff.d.ts +73 -0
- package/dist/git/providers/diff.d.ts.map +1 -0
- package/dist/git/providers/diff.js +2 -0
- package/dist/git/providers/diff.js.map +1 -0
- package/dist/git/providers/graph.d.ts +20 -0
- package/dist/git/providers/graph.d.ts.map +1 -0
- package/dist/git/providers/graph.js +2 -0
- package/dist/git/providers/graph.js.map +1 -0
- package/dist/git/providers/operations.d.ts +65 -0
- package/dist/git/providers/operations.d.ts.map +1 -0
- package/dist/git/providers/operations.js +2 -0
- package/dist/git/providers/operations.js.map +1 -0
- package/dist/git/providers/patch.d.ts +27 -0
- package/dist/git/providers/patch.d.ts.map +1 -0
- package/dist/git/providers/patch.js +2 -0
- package/dist/git/providers/patch.js.map +1 -0
- package/dist/git/providers/pausedOperations.d.ts +11 -0
- package/dist/git/providers/pausedOperations.d.ts.map +1 -0
- package/dist/git/providers/pausedOperations.js +2 -0
- package/dist/git/providers/pausedOperations.js.map +1 -0
- package/dist/git/providers/provider.d.ts +57 -0
- package/dist/git/providers/provider.d.ts.map +1 -0
- package/dist/git/providers/provider.js +2 -0
- package/dist/git/providers/provider.js.map +1 -0
- package/dist/git/providers/refs.d.ts +22 -0
- package/dist/git/providers/refs.d.ts.map +1 -0
- package/dist/git/providers/refs.js +2 -0
- package/dist/git/providers/refs.js.map +1 -0
- package/dist/git/providers/remotes.d.ts +25 -0
- package/dist/git/providers/remotes.d.ts.map +1 -0
- package/dist/git/providers/remotes.js +2 -0
- package/dist/git/providers/remotes.js.map +1 -0
- package/dist/git/providers/revision.d.ts +28 -0
- package/dist/git/providers/revision.d.ts.map +1 -0
- package/dist/git/providers/revision.js +2 -0
- package/dist/git/providers/revision.js.map +1 -0
- package/dist/git/providers/shared/remotes.d.ts +25 -0
- package/dist/git/providers/shared/remotes.d.ts.map +1 -0
- package/dist/git/providers/shared/remotes.js +79 -0
- package/dist/git/providers/shared/remotes.js.map +1 -0
- package/dist/git/providers/staging.d.ts +22 -0
- package/dist/git/providers/staging.d.ts.map +1 -0
- package/dist/git/providers/staging.js +2 -0
- package/dist/git/providers/staging.js.map +1 -0
- package/dist/git/providers/stash.d.ts +41 -0
- package/dist/git/providers/stash.d.ts.map +1 -0
- package/dist/git/providers/stash.js +2 -0
- package/dist/git/providers/stash.js.map +1 -0
- package/dist/git/providers/status.d.ts +30 -0
- package/dist/git/providers/status.d.ts.map +1 -0
- package/dist/git/providers/status.js +2 -0
- package/dist/git/providers/status.js.map +1 -0
- package/dist/git/providers/tags.d.ts +18 -0
- package/dist/git/providers/tags.d.ts.map +1 -0
- package/dist/git/providers/tags.js +2 -0
- package/dist/git/providers/tags.js.map +1 -0
- package/dist/git/providers/types.d.ts +28 -0
- package/dist/git/providers/types.d.ts.map +1 -0
- package/dist/git/providers/types.js +2 -0
- package/dist/git/providers/types.js.map +1 -0
- package/dist/git/providers/worktrees.d.ts +23 -0
- package/dist/git/providers/worktrees.d.ts.map +1 -0
- package/dist/git/providers/worktrees.js +2 -0
- package/dist/git/providers/worktrees.js.map +1 -0
- package/dist/git/remotes/azure-devops.d.ts +43 -0
- package/dist/git/remotes/azure-devops.d.ts.map +1 -0
- package/dist/git/remotes/azure-devops.js +248 -0
- package/dist/git/remotes/azure-devops.js.map +1 -0
- package/dist/git/remotes/bitbucket-server.d.ts +32 -0
- package/dist/git/remotes/bitbucket-server.d.ts.map +1 -0
- package/dist/git/remotes/bitbucket-server.js +145 -0
- package/dist/git/remotes/bitbucket-server.js.map +1 -0
- package/dist/git/remotes/bitbucket.d.ts +29 -0
- package/dist/git/remotes/bitbucket.d.ts.map +1 -0
- package/dist/git/remotes/bitbucket.js +114 -0
- package/dist/git/remotes/bitbucket.js.map +1 -0
- package/dist/git/remotes/custom.d.ts +26 -0
- package/dist/git/remotes/custom.d.ts.map +1 -0
- package/dist/git/remotes/custom.js +111 -0
- package/dist/git/remotes/custom.js.map +1 -0
- package/dist/git/remotes/gerrit.d.ts +31 -0
- package/dist/git/remotes/gerrit.d.ts.map +1 -0
- package/dist/git/remotes/gerrit.js +146 -0
- package/dist/git/remotes/gerrit.js.map +1 -0
- package/dist/git/remotes/gitea.d.ts +30 -0
- package/dist/git/remotes/gitea.d.ts.map +1 -0
- package/dist/git/remotes/gitea.js +148 -0
- package/dist/git/remotes/gitea.js.map +1 -0
- package/dist/git/remotes/github.d.ts +41 -0
- package/dist/git/remotes/github.d.ts.map +1 -0
- package/dist/git/remotes/github.js +198 -0
- package/dist/git/remotes/github.js.map +1 -0
- package/dist/git/remotes/gitlab.d.ts +35 -0
- package/dist/git/remotes/gitlab.d.ts.map +1 -0
- package/dist/git/remotes/gitlab.js +232 -0
- package/dist/git/remotes/gitlab.js.map +1 -0
- package/dist/git/remotes/google-source.d.ts +17 -0
- package/dist/git/remotes/google-source.d.ts.map +1 -0
- package/dist/git/remotes/google-source.js +32 -0
- package/dist/git/remotes/google-source.js.map +1 -0
- package/dist/git/remotes/matcher.d.ts +35 -0
- package/dist/git/remotes/matcher.d.ts.map +1 -0
- package/dist/git/remotes/matcher.js +140 -0
- package/dist/git/remotes/matcher.js.map +1 -0
- package/dist/git/repositoryService.d.ts +127 -0
- package/dist/git/repositoryService.d.ts.map +1 -0
- package/dist/git/repositoryService.js +54 -0
- package/dist/git/repositoryService.js.map +1 -0
- package/dist/git/service.d.ts +112 -0
- package/dist/git/service.d.ts.map +1 -0
- package/dist/git/service.js +303 -0
- package/dist/git/service.js.map +1 -0
- package/dist/git/utils/autolink.utils.d.ts +13 -0
- package/dist/git/utils/autolink.utils.d.ts.map +1 -0
- package/dist/git/utils/autolink.utils.js +147 -0
- package/dist/git/utils/autolink.utils.js.map +1 -0
- package/dist/git/utils/blame.utils.d.ts +47 -0
- package/dist/git/utils/blame.utils.d.ts.map +1 -0
- package/dist/git/utils/blame.utils.js +239 -0
- package/dist/git/utils/blame.utils.js.map +1 -0
- package/dist/git/utils/branch.utils.d.ts +22 -0
- package/dist/git/utils/branch.utils.d.ts.map +1 -0
- package/dist/git/utils/branch.utils.js +122 -0
- package/dist/git/utils/branch.utils.js.map +1 -0
- package/dist/git/utils/commit.utils.d.ts +26 -0
- package/dist/git/utils/commit.utils.d.ts.map +1 -0
- package/dist/git/utils/commit.utils.js +54 -0
- package/dist/git/utils/commit.utils.js.map +1 -0
- package/dist/git/utils/contributor.utils.d.ts +15 -0
- package/dist/git/utils/contributor.utils.d.ts.map +1 -0
- package/dist/git/utils/contributor.utils.js +55 -0
- package/dist/git/utils/contributor.utils.js.map +1 -0
- package/dist/git/utils/fetch.utils.d.ts +20 -0
- package/dist/git/utils/fetch.utils.d.ts.map +1 -0
- package/dist/git/utils/fetch.utils.js +47 -0
- package/dist/git/utils/fetch.utils.js.map +1 -0
- package/dist/git/utils/fileStatus.utils.d.ts +24 -0
- package/dist/git/utils/fileStatus.utils.d.ts.map +1 -0
- package/dist/git/utils/fileStatus.utils.js +45 -0
- package/dist/git/utils/fileStatus.utils.js.map +1 -0
- package/dist/git/utils/issue.utils.d.ts +4 -0
- package/dist/git/utils/issue.utils.d.ts.map +1 -0
- package/dist/git/utils/issue.utils.js +76 -0
- package/dist/git/utils/issue.utils.js.map +1 -0
- package/dist/git/utils/issueOrPullRequest.utils.d.ts +3 -0
- package/dist/git/utils/issueOrPullRequest.utils.d.ts.map +1 -0
- package/dist/git/utils/issueOrPullRequest.utils.js +22 -0
- package/dist/git/utils/issueOrPullRequest.utils.js.map +1 -0
- package/dist/git/utils/mergeConflicts.utils.d.ts +3 -0
- package/dist/git/utils/mergeConflicts.utils.d.ts.map +1 -0
- package/dist/git/utils/mergeConflicts.utils.js +19 -0
- package/dist/git/utils/mergeConflicts.utils.js.map +1 -0
- package/dist/git/utils/pausedOperationStatus.utils.d.ts +58 -0
- package/dist/git/utils/pausedOperationStatus.utils.d.ts.map +1 -0
- package/dist/git/utils/pausedOperationStatus.utils.js +133 -0
- package/dist/git/utils/pausedOperationStatus.utils.js.map +1 -0
- package/dist/git/utils/pullRequest.utils.d.ts +12 -0
- package/dist/git/utils/pullRequest.utils.d.ts.map +1 -0
- package/dist/git/utils/pullRequest.utils.js +124 -0
- package/dist/git/utils/pullRequest.utils.js.map +1 -0
- package/dist/git/utils/rebase.utils.d.ts +19 -0
- package/dist/git/utils/rebase.utils.d.ts.map +1 -0
- package/dist/git/utils/rebase.utils.js +93 -0
- package/dist/git/utils/rebase.utils.js.map +1 -0
- package/dist/git/utils/reference.utils.d.ts +56 -0
- package/dist/git/utils/reference.utils.d.ts.map +1 -0
- package/dist/git/utils/reference.utils.js +191 -0
- package/dist/git/utils/reference.utils.js.map +1 -0
- package/dist/git/utils/remote.utils.d.ts +17 -0
- package/dist/git/utils/remote.utils.d.ts.map +1 -0
- package/dist/git/utils/remote.utils.js +124 -0
- package/dist/git/utils/remote.utils.js.map +1 -0
- package/dist/git/utils/repository.utils.d.ts +5 -0
- package/dist/git/utils/repository.utils.d.ts.map +1 -0
- package/dist/git/utils/repository.utils.js +15 -0
- package/dist/git/utils/repository.utils.js.map +1 -0
- package/dist/git/utils/resourceDescriptor.utils.d.ts +4 -0
- package/dist/git/utils/resourceDescriptor.utils.d.ts.map +1 -0
- package/dist/git/utils/resourceDescriptor.utils.js +17 -0
- package/dist/git/utils/resourceDescriptor.utils.js.map +1 -0
- package/dist/git/utils/revision.utils.d.ts +36 -0
- package/dist/git/utils/revision.utils.d.ts.map +1 -0
- package/dist/git/utils/revision.utils.js +114 -0
- package/dist/git/utils/revision.utils.js.map +1 -0
- package/dist/git/utils/search.utils.d.ts +15 -0
- package/dist/git/utils/search.utils.d.ts.map +1 -0
- package/dist/git/utils/search.utils.js +422 -0
- package/dist/git/utils/search.utils.js.map +1 -0
- package/dist/git/utils/sorting.d.ts +34 -0
- package/dist/git/utils/sorting.d.ts.map +1 -0
- package/dist/git/utils/sorting.js +203 -0
- package/dist/git/utils/sorting.js.map +1 -0
- package/dist/git/utils/status.utils.d.ts +20 -0
- package/dist/git/utils/status.utils.d.ts.map +1 -0
- package/dist/git/utils/status.utils.js +82 -0
- package/dist/git/utils/status.utils.js.map +1 -0
- package/dist/git/utils/statusFile.utils.d.ts +8 -0
- package/dist/git/utils/statusFile.utils.d.ts.map +1 -0
- package/dist/git/utils/statusFile.utils.js +76 -0
- package/dist/git/utils/statusFile.utils.js.map +1 -0
- package/dist/git/utils/tag.utils.d.ts +7 -0
- package/dist/git/utils/tag.utils.d.ts.map +1 -0
- package/dist/git/utils/tag.utils.js +13 -0
- package/dist/git/utils/tag.utils.js.map +1 -0
- package/dist/git/utils/tooltip.utils.d.ts +14 -0
- package/dist/git/utils/tooltip.utils.d.ts.map +1 -0
- package/dist/git/utils/tooltip.utils.js +29 -0
- package/dist/git/utils/tooltip.utils.js.map +1 -0
- package/dist/git/utils/uriAuthority.d.ts +16 -0
- package/dist/git/utils/uriAuthority.d.ts.map +1 -0
- package/dist/git/utils/uriAuthority.js +20 -0
- package/dist/git/utils/uriAuthority.js.map +1 -0
- package/dist/git/utils/user.utils.d.ts +3 -0
- package/dist/git/utils/user.utils.d.ts.map +1 -0
- package/dist/git/utils/user.utils.js +12 -0
- package/dist/git/utils/user.utils.js.map +1 -0
- package/dist/git/utils/worktree.utils.d.ts +7 -0
- package/dist/git/utils/worktree.utils.d.ts.map +1 -0
- package/dist/git/utils/worktree.utils.js +15 -0
- package/dist/git/utils/worktree.utils.js.map +1 -0
- package/dist/git/watching/changeEvent.d.ts +47 -0
- package/dist/git/watching/changeEvent.d.ts.map +1 -0
- package/dist/git/watching/changeEvent.js +69 -0
- package/dist/git/watching/changeEvent.js.map +1 -0
- package/dist/git/watching/classifyChange.d.ts +16 -0
- package/dist/git/watching/classifyChange.d.ts.map +1 -0
- package/dist/git/watching/classifyChange.js +61 -0
- package/dist/git/watching/classifyChange.js.map +1 -0
- package/dist/git/watching/gitIgnoreFilter.d.ts +58 -0
- package/dist/git/watching/gitIgnoreFilter.d.ts.map +1 -0
- package/dist/git/watching/gitIgnoreFilter.js +109 -0
- package/dist/git/watching/gitIgnoreFilter.js.map +1 -0
- package/dist/git/watching/initWatcher.d.ts +33 -0
- package/dist/git/watching/initWatcher.d.ts.map +1 -0
- package/dist/git/watching/initWatcher.js +59 -0
- package/dist/git/watching/initWatcher.js.map +1 -0
- package/dist/git/watching/provider.d.ts +23 -0
- package/dist/git/watching/provider.d.ts.map +1 -0
- package/dist/git/watching/provider.js +2 -0
- package/dist/git/watching/provider.js.map +1 -0
- package/dist/git/watching/watchGroup.d.ts +54 -0
- package/dist/git/watching/watchGroup.d.ts.map +1 -0
- package/dist/git/watching/watchGroup.js +139 -0
- package/dist/git/watching/watchGroup.js.map +1 -0
- package/dist/git/watching/watchService.d.ts +79 -0
- package/dist/git/watching/watchService.d.ts.map +1 -0
- package/dist/git/watching/watchService.js +282 -0
- package/dist/git/watching/watchService.js.map +1 -0
- package/dist/git/watching/watchSession.d.ts +118 -0
- package/dist/git/watching/watchSession.d.ts.map +1 -0
- package/dist/git/watching/watchSession.js +274 -0
- package/dist/git/watching/watchSession.js.map +1 -0
- package/dist/git/watching/watcherPatterns.d.ts +21 -0
- package/dist/git/watching/watcherPatterns.d.ts.map +1 -0
- package/dist/git/watching/watcherPatterns.js +36 -0
- package/dist/git/watching/watcherPatterns.js.map +1 -0
- package/dist/git-cli/cliGitProvider.d.ts +133 -0
- package/dist/git-cli/cliGitProvider.d.ts.map +1 -0
- package/dist/git-cli/cliGitProvider.js +273 -0
- package/dist/git-cli/cliGitProvider.js.map +1 -0
- package/dist/git-cli/exec/exec.d.ts +4 -0
- package/dist/git-cli/exec/exec.d.ts.map +1 -0
- package/dist/git-cli/exec/exec.errors.d.ts +2 -0
- package/dist/git-cli/exec/exec.errors.d.ts.map +1 -0
- package/dist/git-cli/exec/exec.errors.js +2 -0
- package/dist/git-cli/exec/exec.errors.js.map +1 -0
- package/dist/git-cli/exec/exec.js +3 -0
- package/dist/git-cli/exec/exec.js.map +1 -0
- package/dist/git-cli/exec/exec.types.d.ts +2 -0
- package/dist/git-cli/exec/exec.types.d.ts.map +1 -0
- package/dist/git-cli/exec/exec.types.js +2 -0
- package/dist/git-cli/exec/exec.types.js.map +1 -0
- package/dist/git-cli/exec/features.d.ts +3 -0
- package/dist/git-cli/exec/features.d.ts.map +1 -0
- package/dist/git-cli/exec/features.js +2 -0
- package/dist/git-cli/exec/features.js.map +1 -0
- package/dist/git-cli/exec/git.d.ts +228 -0
- package/dist/git-cli/exec/git.d.ts.map +1 -0
- package/dist/git-cli/exec/git.js +823 -0
- package/dist/git-cli/exec/git.js.map +1 -0
- package/dist/git-cli/exec/gitQueue.d.ts +68 -0
- package/dist/git-cli/exec/gitQueue.d.ts.map +1 -0
- package/dist/git-cli/exec/gitQueue.js +207 -0
- package/dist/git-cli/exec/gitQueue.js.map +1 -0
- package/dist/git-cli/exec/locator.d.ts +14 -0
- package/dist/git-cli/exec/locator.d.ts.map +1 -0
- package/dist/git-cli/exec/locator.js +133 -0
- package/dist/git-cli/exec/locator.js.map +1 -0
- package/dist/git-cli/parsers/blameParser.d.ts +30 -0
- package/dist/git-cli/parsers/blameParser.d.ts.map +1 -0
- package/dist/git-cli/parsers/blameParser.js +339 -0
- package/dist/git-cli/parsers/blameParser.js.map +1 -0
- package/dist/git-cli/parsers/indexParser.d.ts +4 -0
- package/dist/git-cli/parsers/indexParser.d.ts.map +1 -0
- package/dist/git-cli/parsers/indexParser.js +226 -0
- package/dist/git-cli/parsers/indexParser.js.map +1 -0
- package/dist/git-cli/parsers/logParser.d.ts +178 -0
- package/dist/git-cli/parsers/logParser.d.ts.map +1 -0
- package/dist/git-cli/parsers/logParser.js +1166 -0
- package/dist/git-cli/parsers/logParser.js.map +1 -0
- package/dist/git-cli/parsers/mergeTreeParser.d.ts +7 -0
- package/dist/git-cli/parsers/mergeTreeParser.d.ts.map +1 -0
- package/dist/git-cli/parsers/mergeTreeParser.js +74 -0
- package/dist/git-cli/parsers/mergeTreeParser.js.map +1 -0
- package/dist/git-cli/parsers/refParser.d.ts +34 -0
- package/dist/git-cli/parsers/refParser.d.ts.map +1 -0
- package/dist/git-cli/parsers/refParser.js +148 -0
- package/dist/git-cli/parsers/refParser.js.map +1 -0
- package/dist/git-cli/parsers/reflogParser.d.ts +12 -0
- package/dist/git-cli/parsers/reflogParser.d.ts.map +1 -0
- package/dist/git-cli/parsers/reflogParser.js +181 -0
- package/dist/git-cli/parsers/reflogParser.js.map +1 -0
- package/dist/git-cli/parsers/remoteParser.d.ts +4 -0
- package/dist/git-cli/parsers/remoteParser.d.ts.map +1 -0
- package/dist/git-cli/parsers/remoteParser.js +128 -0
- package/dist/git-cli/parsers/remoteParser.js.map +1 -0
- package/dist/git-cli/parsers/shortlogParser.d.ts +4 -0
- package/dist/git-cli/parsers/shortlogParser.d.ts.map +1 -0
- package/dist/git-cli/parsers/shortlogParser.js +51 -0
- package/dist/git-cli/parsers/shortlogParser.js.map +1 -0
- package/dist/git-cli/parsers/signatureParser.d.ts +21 -0
- package/dist/git-cli/parsers/signatureParser.d.ts.map +1 -0
- package/dist/git-cli/parsers/signatureParser.js +139 -0
- package/dist/git-cli/parsers/signatureParser.js.map +1 -0
- package/dist/git-cli/parsers/statusParser.d.ts +4 -0
- package/dist/git-cli/parsers/statusParser.d.ts.map +1 -0
- package/dist/git-cli/parsers/statusParser.js +216 -0
- package/dist/git-cli/parsers/statusParser.js.map +1 -0
- package/dist/git-cli/parsers/treeParser.d.ts +3 -0
- package/dist/git-cli/parsers/treeParser.d.ts.map +1 -0
- package/dist/git-cli/parsers/treeParser.js +110 -0
- package/dist/git-cli/parsers/treeParser.js.map +1 -0
- package/dist/git-cli/parsers/worktreeParser.d.ts +5 -0
- package/dist/git-cli/parsers/worktreeParser.d.ts.map +1 -0
- package/dist/git-cli/parsers/worktreeParser.js +136 -0
- package/dist/git-cli/parsers/worktreeParser.js.map +1 -0
- package/dist/git-cli/providers/blame.d.ts +26 -0
- package/dist/git-cli/providers/blame.d.ts.map +1 -0
- package/dist/git-cli/providers/blame.js +426 -0
- package/dist/git-cli/providers/blame.js.map +1 -0
- package/dist/git-cli/providers/branches.d.ts +87 -0
- package/dist/git-cli/providers/branches.d.ts.map +1 -0
- package/dist/git-cli/providers/branches.js +1153 -0
- package/dist/git-cli/providers/branches.js.map +1 -0
- package/dist/git-cli/providers/commitFilesetUtils.d.ts +4 -0
- package/dist/git-cli/providers/commitFilesetUtils.d.ts.map +1 -0
- package/dist/git-cli/providers/commitFilesetUtils.js +20 -0
- package/dist/git-cli/providers/commitFilesetUtils.js.map +1 -0
- package/dist/git-cli/providers/commits.d.ts +49 -0
- package/dist/git-cli/providers/commits.d.ts.map +1 -0
- package/dist/git-cli/providers/commits.js +1151 -0
- package/dist/git-cli/providers/commits.js.map +1 -0
- package/dist/git-cli/providers/config.d.ts +74 -0
- package/dist/git-cli/providers/config.d.ts.map +1 -0
- package/dist/git-cli/providers/config.js +588 -0
- package/dist/git-cli/providers/config.js.map +1 -0
- package/dist/git-cli/providers/contributors.d.ts +31 -0
- package/dist/git-cli/providers/contributors.d.ts.map +1 -0
- package/dist/git-cli/providers/contributors.js +350 -0
- package/dist/git-cli/providers/contributors.js.map +1 -0
- package/dist/git-cli/providers/diff.d.ts +99 -0
- package/dist/git-cli/providers/diff.d.ts.map +1 -0
- package/dist/git-cli/providers/diff.js +786 -0
- package/dist/git-cli/providers/diff.js.map +1 -0
- package/dist/git-cli/providers/graph.d.ts +31 -0
- package/dist/git-cli/providers/graph.d.ts.map +1 -0
- package/dist/git-cli/providers/graph.js +703 -0
- package/dist/git-cli/providers/graph.js.map +1 -0
- package/dist/git-cli/providers/operations.d.ts +75 -0
- package/dist/git-cli/providers/operations.d.ts.map +1 -0
- package/dist/git-cli/providers/operations.js +564 -0
- package/dist/git-cli/providers/operations.js.map +1 -0
- package/dist/git-cli/providers/patch.d.ts +38 -0
- package/dist/git-cli/providers/patch.d.ts.map +1 -0
- package/dist/git-cli/providers/patch.js +324 -0
- package/dist/git-cli/providers/patch.js.map +1 -0
- package/dist/git-cli/providers/pausedOperations.d.ts +22 -0
- package/dist/git-cli/providers/pausedOperations.d.ts.map +1 -0
- package/dist/git-cli/providers/pausedOperations.js +411 -0
- package/dist/git-cli/providers/pausedOperations.js.map +1 -0
- package/dist/git-cli/providers/refs.d.ts +32 -0
- package/dist/git-cli/providers/refs.d.ts.map +1 -0
- package/dist/git-cli/providers/refs.js +149 -0
- package/dist/git-cli/providers/refs.js.map +1 -0
- package/dist/git-cli/providers/remotes.d.ts +24 -0
- package/dist/git-cli/providers/remotes.d.ts.map +1 -0
- package/dist/git-cli/providers/remotes.js +94 -0
- package/dist/git-cli/providers/remotes.js.map +1 -0
- package/dist/git-cli/providers/revision.d.ts +27 -0
- package/dist/git-cli/providers/revision.d.ts.map +1 -0
- package/dist/git-cli/providers/revision.js +269 -0
- package/dist/git-cli/providers/revision.js.map +1 -0
- package/dist/git-cli/providers/staging.d.ts +24 -0
- package/dist/git-cli/providers/staging.d.ts.map +1 -0
- package/dist/git-cli/providers/staging.js +138 -0
- package/dist/git-cli/providers/staging.js.map +1 -0
- package/dist/git-cli/providers/stash.d.ts +55 -0
- package/dist/git-cli/providers/stash.d.ts.map +1 -0
- package/dist/git-cli/providers/stash.js +430 -0
- package/dist/git-cli/providers/stash.js.map +1 -0
- package/dist/git-cli/providers/status.d.ts +38 -0
- package/dist/git-cli/providers/status.d.ts.map +1 -0
- package/dist/git-cli/providers/status.js +352 -0
- package/dist/git-cli/providers/status.js.map +1 -0
- package/dist/git-cli/providers/tags.d.ts +29 -0
- package/dist/git-cli/providers/tags.d.ts.map +1 -0
- package/dist/git-cli/providers/tags.js +190 -0
- package/dist/git-cli/providers/tags.js.map +1 -0
- package/dist/git-cli/providers/worktrees.d.ts +33 -0
- package/dist/git-cli/providers/worktrees.d.ts.map +1 -0
- package/dist/git-cli/providers/worktrees.js +175 -0
- package/dist/git-cli/providers/worktrees.js.map +1 -0
- package/dist/git-cli/service.d.ts +52 -0
- package/dist/git-cli/service.d.ts.map +1 -0
- package/dist/git-cli/service.js +35 -0
- package/dist/git-cli/service.js.map +1 -0
- package/dist/plus/ai/constants.d.ts +21 -0
- package/dist/plus/ai/constants.d.ts.map +1 -0
- package/dist/plus/ai/constants.js +99 -0
- package/dist/plus/ai/constants.js.map +1 -0
- package/dist/plus/ai/errors.d.ts +25 -0
- package/dist/plus/ai/errors.d.ts.map +1 -0
- package/dist/plus/ai/errors.js +76 -0
- package/dist/plus/ai/errors.js.map +1 -0
- package/dist/plus/ai/models/conversation.d.ts +12 -0
- package/dist/plus/ai/models/conversation.d.ts.map +1 -0
- package/dist/plus/ai/models/conversation.js +27 -0
- package/dist/plus/ai/models/conversation.js.map +1 -0
- package/dist/plus/ai/models/model.d.ts +34 -0
- package/dist/plus/ai/models/model.d.ts.map +1 -0
- package/dist/plus/ai/models/model.js +379 -0
- package/dist/plus/ai/models/model.js.map +1 -0
- package/dist/plus/ai/models/promptTemplates.d.ts +74 -0
- package/dist/plus/ai/models/promptTemplates.d.ts.map +1 -0
- package/dist/plus/ai/models/promptTemplates.js +2 -0
- package/dist/plus/ai/models/promptTemplates.js.map +1 -0
- package/dist/plus/ai/models/provider.d.ts +46 -0
- package/dist/plus/ai/models/provider.d.ts.map +1 -0
- package/dist/plus/ai/models/provider.js +2 -0
- package/dist/plus/ai/models/provider.js.map +1 -0
- package/dist/plus/ai/models/results.d.ts +5 -0
- package/dist/plus/ai/models/results.d.ts.map +1 -0
- package/dist/plus/ai/models/results.js +2 -0
- package/dist/plus/ai/models/results.js.map +1 -0
- package/dist/plus/ai/prompts.d.ts +13 -0
- package/dist/plus/ai/prompts.d.ts.map +1 -0
- package/dist/plus/ai/prompts.js +517 -0
- package/dist/plus/ai/prompts.js.map +1 -0
- package/dist/plus/ai/providers/anthropicProvider.d.ts +21 -0
- package/dist/plus/ai/providers/anthropicProvider.d.ts.map +1 -0
- package/dist/plus/ai/providers/anthropicProvider.js +257 -0
- package/dist/plus/ai/providers/anthropicProvider.js.map +1 -0
- package/dist/plus/ai/providers/azureProvider.d.ts +18 -0
- package/dist/plus/ai/providers/azureProvider.d.ts.map +1 -0
- package/dist/plus/ai/providers/azureProvider.js +54 -0
- package/dist/plus/ai/providers/azureProvider.js.map +1 -0
- package/dist/plus/ai/providers/context.d.ts +23 -0
- package/dist/plus/ai/providers/context.d.ts.map +1 -0
- package/dist/plus/ai/providers/context.js +2 -0
- package/dist/plus/ai/providers/context.js.map +1 -0
- package/dist/plus/ai/providers/deepSeekProvider.d.ts +15 -0
- package/dist/plus/ai/providers/deepSeekProvider.d.ts.map +1 -0
- package/dist/plus/ai/providers/deepSeekProvider.js +35 -0
- package/dist/plus/ai/providers/deepSeekProvider.js.map +1 -0
- package/dist/plus/ai/providers/geminiProvider.d.ts +15 -0
- package/dist/plus/ai/providers/geminiProvider.d.ts.map +1 -0
- package/dist/plus/ai/providers/geminiProvider.js +195 -0
- package/dist/plus/ai/providers/geminiProvider.js.map +1 -0
- package/dist/plus/ai/providers/githubModelsProvider.d.ts +19 -0
- package/dist/plus/ai/providers/githubModelsProvider.d.ts.map +1 -0
- package/dist/plus/ai/providers/githubModelsProvider.js +51 -0
- package/dist/plus/ai/providers/githubModelsProvider.js.map +1 -0
- package/dist/plus/ai/providers/gitkrakenProvider.d.ts +18 -0
- package/dist/plus/ai/providers/gitkrakenProvider.d.ts.map +1 -0
- package/dist/plus/ai/providers/gitkrakenProvider.js +151 -0
- package/dist/plus/ai/providers/gitkrakenProvider.js.map +1 -0
- package/dist/plus/ai/providers/huggingFaceProvider.d.ts +15 -0
- package/dist/plus/ai/providers/huggingFaceProvider.d.ts.map +1 -0
- package/dist/plus/ai/providers/huggingFaceProvider.js +39 -0
- package/dist/plus/ai/providers/huggingFaceProvider.js.map +1 -0
- package/dist/plus/ai/providers/mistralProvider.d.ts +20 -0
- package/dist/plus/ai/providers/mistralProvider.d.ts.map +1 -0
- package/dist/plus/ai/providers/mistralProvider.js +118 -0
- package/dist/plus/ai/providers/mistralProvider.js.map +1 -0
- package/dist/plus/ai/providers/ollamaProvider.d.ts +25 -0
- package/dist/plus/ai/providers/ollamaProvider.d.ts.map +1 -0
- package/dist/plus/ai/providers/ollamaProvider.js +155 -0
- package/dist/plus/ai/providers/ollamaProvider.js.map +1 -0
- package/dist/plus/ai/providers/openAICompatibleProvider.d.ts +17 -0
- package/dist/plus/ai/providers/openAICompatibleProvider.d.ts.map +1 -0
- package/dist/plus/ai/providers/openAICompatibleProvider.js +47 -0
- package/dist/plus/ai/providers/openAICompatibleProvider.js.map +1 -0
- package/dist/plus/ai/providers/openAICompatibleProviderBase.d.ts +39 -0
- package/dist/plus/ai/providers/openAICompatibleProviderBase.d.ts.map +1 -0
- package/dist/plus/ai/providers/openAICompatibleProviderBase.js +218 -0
- package/dist/plus/ai/providers/openAICompatibleProviderBase.js.map +1 -0
- package/dist/plus/ai/providers/openRouterProvider.d.ts +17 -0
- package/dist/plus/ai/providers/openRouterProvider.d.ts.map +1 -0
- package/dist/plus/ai/providers/openRouterProvider.js +57 -0
- package/dist/plus/ai/providers/openRouterProvider.js.map +1 -0
- package/dist/plus/ai/providers/openaiProvider.d.ts +16 -0
- package/dist/plus/ai/providers/openaiProvider.d.ts.map +1 -0
- package/dist/plus/ai/providers/openaiProvider.js +34 -0
- package/dist/plus/ai/providers/openaiProvider.js.map +1 -0
- package/dist/plus/ai/providers/xaiProvider.d.ts +15 -0
- package/dist/plus/ai/providers/xaiProvider.d.ts.map +1 -0
- package/dist/plus/ai/providers/xaiProvider.js +27 -0
- package/dist/plus/ai/providers/xaiProvider.js.map +1 -0
- package/dist/plus/ai/utils/ai.utils.d.ts +18 -0
- package/dist/plus/ai/utils/ai.utils.d.ts.map +1 -0
- package/dist/plus/ai/utils/ai.utils.js +70 -0
- package/dist/plus/ai/utils/ai.utils.js.map +1 -0
- package/dist/plus/ai/utils/results.utils.d.ts +9 -0
- package/dist/plus/ai/utils/results.utils.d.ts.map +1 -0
- package/dist/plus/ai/utils/results.utils.js +44 -0
- package/dist/plus/ai/utils/results.utils.js.map +1 -0
- package/dist/plus/ai/utils/truncation.utils.d.ts +13 -0
- package/dist/plus/ai/utils/truncation.utils.d.ts.map +1 -0
- package/dist/plus/ai/utils/truncation.utils.js +228 -0
- package/dist/plus/ai/utils/truncation.utils.js.map +1 -0
- package/dist/plus/git-github/api/config.d.ts +66 -0
- package/dist/plus/git-github/api/config.d.ts.map +1 -0
- package/dist/plus/git-github/api/config.js +2 -0
- package/dist/plus/git-github/api/config.js.map +1 -0
- package/dist/plus/git-github/api/github.d.ts +178 -0
- package/dist/plus/git-github/api/github.d.ts.map +1 -0
- package/dist/plus/git-github/api/github.js +2360 -0
- package/dist/plus/git-github/api/github.js.map +1 -0
- package/dist/plus/git-github/api/github.utils.d.ts +9 -0
- package/dist/plus/git-github/api/github.utils.d.ts.map +1 -0
- package/dist/plus/git-github/api/github.utils.js +22 -0
- package/dist/plus/git-github/api/github.utils.js.map +1 -0
- package/dist/plus/git-github/api/token.d.ts +16 -0
- package/dist/plus/git-github/api/token.d.ts.map +1 -0
- package/dist/plus/git-github/api/token.js +2 -0
- package/dist/plus/git-github/api/token.js.map +1 -0
- package/dist/plus/git-github/api/tokenUtils.d.ts +7 -0
- package/dist/plus/git-github/api/tokenUtils.d.ts.map +1 -0
- package/dist/plus/git-github/api/tokenUtils.js +13 -0
- package/dist/plus/git-github/api/tokenUtils.js.map +1 -0
- package/dist/plus/git-github/api/types.d.ts +100 -0
- package/dist/plus/git-github/api/types.d.ts.map +1 -0
- package/dist/plus/git-github/api/types.js +2 -0
- package/dist/plus/git-github/api/types.js.map +1 -0
- package/dist/plus/git-github/context.d.ts +102 -0
- package/dist/plus/git-github/context.d.ts.map +1 -0
- package/dist/plus/git-github/context.js +12 -0
- package/dist/plus/git-github/context.js.map +1 -0
- package/dist/plus/git-github/models.d.ts +204 -0
- package/dist/plus/git-github/models.d.ts.map +1 -0
- package/dist/plus/git-github/models.js +229 -0
- package/dist/plus/git-github/models.js.map +1 -0
- package/dist/plus/git-github/providers/github/blame.d.ts +34 -0
- package/dist/plus/git-github/providers/github/blame.d.ts.map +1 -0
- package/dist/plus/git-github/providers/github/blame.js +155 -0
- package/dist/plus/git-github/providers/github/blame.js.map +1 -0
- package/dist/plus/git-github/providers/github/branches.d.ts +38 -0
- package/dist/plus/git-github/providers/github/branches.d.ts.map +1 -0
- package/dist/plus/git-github/providers/github/branches.js +234 -0
- package/dist/plus/git-github/providers/github/branches.js.map +1 -0
- package/dist/plus/git-github/providers/github/commits.d.ts +36 -0
- package/dist/plus/git-github/providers/github/commits.d.ts.map +1 -0
- package/dist/plus/git-github/providers/github/commits.js +560 -0
- package/dist/plus/git-github/providers/github/commits.js.map +1 -0
- package/dist/plus/git-github/providers/github/config.d.ts +11 -0
- package/dist/plus/git-github/providers/github/config.d.ts.map +1 -0
- package/dist/plus/git-github/providers/github/config.js +47 -0
- package/dist/plus/git-github/providers/github/config.js.map +1 -0
- package/dist/plus/git-github/providers/github/contributors.d.ts +27 -0
- package/dist/plus/git-github/providers/github/contributors.d.ts.map +1 -0
- package/dist/plus/git-github/providers/github/contributors.js +218 -0
- package/dist/plus/git-github/providers/github/contributors.js.map +1 -0
- package/dist/plus/git-github/providers/github/diff.d.ts +33 -0
- package/dist/plus/git-github/providers/github/diff.d.ts.map +1 -0
- package/dist/plus/git-github/providers/github/diff.js +184 -0
- package/dist/plus/git-github/providers/github/diff.js.map +1 -0
- package/dist/plus/git-github/providers/github/graph.d.ts +25 -0
- package/dist/plus/git-github/providers/github/graph.d.ts.map +1 -0
- package/dist/plus/git-github/providers/github/graph.js +372 -0
- package/dist/plus/git-github/providers/github/graph.js.map +1 -0
- package/dist/plus/git-github/providers/github/refs.d.ts +26 -0
- package/dist/plus/git-github/providers/github/refs.d.ts.map +1 -0
- package/dist/plus/git-github/providers/github/refs.js +108 -0
- package/dist/plus/git-github/providers/github/refs.js.map +1 -0
- package/dist/plus/git-github/providers/github/remotes.d.ts +9 -0
- package/dist/plus/git-github/providers/github/remotes.d.ts.map +1 -0
- package/dist/plus/git-github/providers/github/remotes.js +37 -0
- package/dist/plus/git-github/providers/github/remotes.js.map +1 -0
- package/dist/plus/git-github/providers/github/revision.d.ts +14 -0
- package/dist/plus/git-github/providers/github/revision.d.ts.map +1 -0
- package/dist/plus/git-github/providers/github/revision.js +132 -0
- package/dist/plus/git-github/providers/github/revision.js.map +1 -0
- package/dist/plus/git-github/providers/github/status.d.ts +21 -0
- package/dist/plus/git-github/providers/github/status.d.ts.map +1 -0
- package/dist/plus/git-github/providers/github/status.js +49 -0
- package/dist/plus/git-github/providers/github/status.js.map +1 -0
- package/dist/plus/git-github/providers/github/tags.d.ts +22 -0
- package/dist/plus/git-github/providers/github/tags.d.ts.map +1 -0
- package/dist/plus/git-github/providers/github/tags.js +104 -0
- package/dist/plus/git-github/providers/github/tags.js.map +1 -0
- package/dist/plus/git-github/providers/githubGitProvider.d.ts +85 -0
- package/dist/plus/git-github/providers/githubGitProvider.d.ts.map +1 -0
- package/dist/plus/git-github/providers/githubGitProvider.js +130 -0
- package/dist/plus/git-github/providers/githubGitProvider.js.map +1 -0
- package/dist/plus/git-github/providers/githubProvider.d.ts +55 -0
- package/dist/plus/git-github/providers/githubProvider.d.ts.map +1 -0
- package/dist/plus/git-github/providers/githubProvider.js +2 -0
- package/dist/plus/git-github/providers/githubProvider.js.map +1 -0
- package/dist/utils/array.d.ts +27 -0
- package/dist/utils/array.d.ts.map +1 -0
- package/dist/utils/array.js +142 -0
- package/dist/utils/array.js.map +1 -0
- package/dist/utils/base64.d.ts +2 -0
- package/dist/utils/base64.d.ts.map +1 -0
- package/dist/utils/base64.js +2 -0
- package/dist/utils/base64.js.map +1 -0
- package/dist/utils/brand.d.ts +11 -0
- package/dist/utils/brand.d.ts.map +1 -0
- package/dist/utils/brand.js +2 -0
- package/dist/utils/brand.js.map +1 -0
- package/dist/utils/cancellation.d.ts +54 -0
- package/dist/utils/cancellation.d.ts.map +1 -0
- package/dist/utils/cancellation.js +133 -0
- package/dist/utils/cancellation.js.map +1 -0
- package/dist/utils/charCode.d.ts +39 -0
- package/dist/utils/charCode.d.ts.map +1 -0
- package/dist/utils/charCode.js +39 -0
- package/dist/utils/charCode.js.map +1 -0
- package/dist/utils/color.d.ts +177 -0
- package/dist/utils/color.d.ts.map +1 -0
- package/dist/utils/color.js +693 -0
- package/dist/utils/color.js.map +1 -0
- package/dist/utils/counter.d.ts +7 -0
- package/dist/utils/counter.d.ts.map +1 -0
- package/dist/utils/counter.js +19 -0
- package/dist/utils/counter.js.map +1 -0
- package/dist/utils/crypto.d.ts +2 -0
- package/dist/utils/crypto.d.ts.map +1 -0
- package/dist/utils/crypto.js +2 -0
- package/dist/utils/crypto.js.map +1 -0
- package/dist/utils/date.d.ts +20 -0
- package/dist/utils/date.d.ts.map +1 -0
- package/dist/utils/date.js +313 -0
- package/dist/utils/date.js.map +1 -0
- package/dist/utils/debounce.d.ts +108 -0
- package/dist/utils/debounce.d.ts.map +1 -0
- package/dist/utils/debounce.js +209 -0
- package/dist/utils/debounce.js.map +1 -0
- package/dist/utils/decorators/debounce.d.ts +3 -0
- package/dist/utils/decorators/debounce.d.ts.map +1 -0
- package/dist/utils/decorators/debounce.js +21 -0
- package/dist/utils/decorators/debounce.js.map +1 -0
- package/dist/utils/decorators/gate.d.ts +15 -0
- package/dist/utils/decorators/gate.d.ts.map +1 -0
- package/dist/utils/decorators/gate.js +129 -0
- package/dist/utils/decorators/gate.js.map +1 -0
- package/dist/utils/decorators/log.d.ts +46 -0
- package/dist/utils/decorators/log.d.ts.map +1 -0
- package/dist/utils/decorators/log.js +238 -0
- package/dist/utils/decorators/log.js.map +1 -0
- package/dist/utils/decorators/memoize.d.ts +17 -0
- package/dist/utils/decorators/memoize.d.ts.map +1 -0
- package/dist/utils/decorators/memoize.js +63 -0
- package/dist/utils/decorators/memoize.js.map +1 -0
- package/dist/utils/decorators/resolver.d.ts +12 -0
- package/dist/utils/decorators/resolver.d.ts.map +1 -0
- package/dist/utils/decorators/resolver.js +85 -0
- package/dist/utils/decorators/resolver.js.map +1 -0
- package/dist/utils/decorators/sequentialize.d.ts +29 -0
- package/dist/utils/decorators/sequentialize.d.ts.map +1 -0
- package/dist/utils/decorators/sequentialize.js +81 -0
- package/dist/utils/decorators/sequentialize.js.map +1 -0
- package/dist/utils/decorators/serializable.d.ts +13 -0
- package/dist/utils/decorators/serializable.d.ts.map +1 -0
- package/dist/utils/decorators/serializable.js +42 -0
- package/dist/utils/decorators/serializable.js.map +1 -0
- package/dist/utils/disposable.d.ts +40 -0
- package/dist/utils/disposable.d.ts.map +1 -0
- package/dist/utils/disposable.js +87 -0
- package/dist/utils/disposable.js.map +1 -0
- package/dist/utils/encoding.d.ts +3 -0
- package/dist/utils/encoding.d.ts.map +1 -0
- package/dist/utils/encoding.js +7 -0
- package/dist/utils/encoding.js.map +1 -0
- package/dist/utils/env/browser/base64.d.ts +9 -0
- package/dist/utils/env/browser/base64.d.ts.map +1 -0
- package/dist/utils/env/browser/base64.js +42 -0
- package/dist/utils/env/browser/base64.js.map +1 -0
- package/dist/utils/env/browser/crypto.d.ts +5 -0
- package/dist/utils/env/browser/crypto.d.ts.map +1 -0
- package/dist/utils/env/browser/crypto.js +18 -0
- package/dist/utils/env/browser/crypto.js.map +1 -0
- package/dist/utils/env/browser/fs.d.ts +2 -0
- package/dist/utils/env/browser/fs.d.ts.map +1 -0
- package/dist/utils/env/browser/fs.js +4 -0
- package/dist/utils/env/browser/fs.js.map +1 -0
- package/dist/utils/env/browser/hex.d.ts +4 -0
- package/dist/utils/env/browser/hex.d.ts.map +1 -0
- package/dist/utils/env/browser/hex.js +38 -0
- package/dist/utils/env/browser/hex.js.map +1 -0
- package/dist/utils/env/browser/hrtime.d.ts +2 -0
- package/dist/utils/env/browser/hrtime.d.ts.map +1 -0
- package/dist/utils/env/browser/hrtime.js +15 -0
- package/dist/utils/env/browser/hrtime.js.map +1 -0
- package/dist/utils/env/browser/logScope.d.ts +25 -0
- package/dist/utils/env/browser/logScope.d.ts.map +1 -0
- package/dist/utils/env/browser/logScope.js +53 -0
- package/dist/utils/env/browser/logScope.js.map +1 -0
- package/dist/utils/env/browser/md5.d.ts +2 -0
- package/dist/utils/env/browser/md5.d.ts.map +1 -0
- package/dist/utils/env/browser/md5.js +199 -0
- package/dist/utils/env/browser/md5.js.map +1 -0
- package/dist/utils/env/browser/platform.d.ts +4 -0
- package/dist/utils/env/browser/platform.d.ts.map +1 -0
- package/dist/utils/env/browser/platform.js +6 -0
- package/dist/utils/env/browser/platform.js.map +1 -0
- package/dist/utils/env/node/base64.d.ts +9 -0
- package/dist/utils/env/node/base64.d.ts.map +1 -0
- package/dist/utils/env/node/base64.js +14 -0
- package/dist/utils/env/node/base64.js.map +1 -0
- package/dist/utils/env/node/crypto.d.ts +5 -0
- package/dist/utils/env/node/crypto.d.ts.map +1 -0
- package/dist/utils/env/node/crypto.js +14 -0
- package/dist/utils/env/node/crypto.js.map +1 -0
- package/dist/utils/env/node/exec.d.ts +89 -0
- package/dist/utils/env/node/exec.d.ts.map +1 -0
- package/dist/utils/env/node/exec.js +277 -0
- package/dist/utils/env/node/exec.js.map +1 -0
- package/dist/utils/env/node/fs.d.ts +2 -0
- package/dist/utils/env/node/fs.d.ts.map +1 -0
- package/dist/utils/env/node/fs.js +5 -0
- package/dist/utils/env/node/fs.js.map +1 -0
- package/dist/utils/env/node/hex.d.ts +4 -0
- package/dist/utils/env/node/hex.d.ts.map +1 -0
- package/dist/utils/env/node/hex.js +10 -0
- package/dist/utils/env/node/hex.js.map +1 -0
- package/dist/utils/env/node/hrtime.d.ts +2 -0
- package/dist/utils/env/node/hrtime.d.ts.map +1 -0
- package/dist/utils/env/node/hrtime.js +2 -0
- package/dist/utils/env/node/hrtime.js.map +1 -0
- package/dist/utils/env/node/logScope.d.ts +34 -0
- package/dist/utils/env/node/logScope.d.ts.map +1 -0
- package/dist/utils/env/node/logScope.js +52 -0
- package/dist/utils/env/node/logScope.js.map +1 -0
- package/dist/utils/env/node/platform.d.ts +4 -0
- package/dist/utils/env/node/platform.d.ts.map +1 -0
- package/dist/utils/env/node/platform.js +5 -0
- package/dist/utils/env/node/platform.js.map +1 -0
- package/dist/utils/error.d.ts +18 -0
- package/dist/utils/error.d.ts.map +1 -0
- package/dist/utils/error.js +19 -0
- package/dist/utils/error.js.map +1 -0
- package/dist/utils/event.d.ts +59 -0
- package/dist/utils/event.d.ts.map +1 -0
- package/dist/utils/event.js +183 -0
- package/dist/utils/event.js.map +1 -0
- package/dist/utils/formatter.d.ts +21 -0
- package/dist/utils/formatter.d.ts.map +1 -0
- package/dist/utils/formatter.js +139 -0
- package/dist/utils/formatter.js.map +1 -0
- package/dist/utils/fs.d.ts +2 -0
- package/dist/utils/fs.d.ts.map +1 -0
- package/dist/utils/fs.js +2 -0
- package/dist/utils/fs.js.map +1 -0
- package/dist/utils/function.d.ts +24 -0
- package/dist/utils/function.d.ts.map +1 -0
- package/dist/utils/function.js +103 -0
- package/dist/utils/function.js.map +1 -0
- package/dist/utils/fuzzy.d.ts +68 -0
- package/dist/utils/fuzzy.d.ts.map +1 -0
- package/dist/utils/fuzzy.js +134 -0
- package/dist/utils/fuzzy.js.map +1 -0
- package/dist/utils/hash.d.ts +32 -0
- package/dist/utils/hash.d.ts.map +1 -0
- package/dist/utils/hash.js +53 -0
- package/dist/utils/hash.js.map +1 -0
- package/dist/utils/hex.d.ts +2 -0
- package/dist/utils/hex.d.ts.map +1 -0
- package/dist/utils/hex.js +2 -0
- package/dist/utils/hex.js.map +1 -0
- package/dist/utils/hrtime.d.ts +4 -0
- package/dist/utils/hrtime.d.ts.map +1 -0
- package/dist/utils/hrtime.js +7 -0
- package/dist/utils/hrtime.js.map +1 -0
- package/dist/utils/iterable.d.ts +65 -0
- package/dist/utils/iterable.d.ts.map +1 -0
- package/dist/utils/iterable.js +635 -0
- package/dist/utils/iterable.js.map +1 -0
- package/dist/utils/lazy.d.ts +18 -0
- package/dist/utils/lazy.d.ts.map +1 -0
- package/dist/utils/lazy.js +40 -0
- package/dist/utils/lazy.js.map +1 -0
- package/dist/utils/loggable.d.ts +5 -0
- package/dist/utils/loggable.d.ts.map +1 -0
- package/dist/utils/loggable.js +4 -0
- package/dist/utils/loggable.js.map +1 -0
- package/dist/utils/logger.d.ts +63 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +316 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/logger.scoped.d.ts +56 -0
- package/dist/utils/logger.scoped.d.ts.map +1 -0
- package/dist/utils/logger.scoped.js +166 -0
- package/dist/utils/logger.scoped.js.map +1 -0
- package/dist/utils/markdown.d.ts +9 -0
- package/dist/utils/markdown.d.ts.map +1 -0
- package/dist/utils/markdown.js +100 -0
- package/dist/utils/markdown.js.map +1 -0
- package/dist/utils/mru.d.ts +14 -0
- package/dist/utils/mru.d.ts.map +1 -0
- package/dist/utils/mru.js +63 -0
- package/dist/utils/mru.js.map +1 -0
- package/dist/utils/object.d.ts +62 -0
- package/dist/utils/object.d.ts.map +1 -0
- package/dist/utils/object.js +151 -0
- package/dist/utils/object.js.map +1 -0
- package/dist/utils/paging.d.ts +19 -0
- package/dist/utils/paging.d.ts.map +1 -0
- package/dist/utils/paging.js +32 -0
- package/dist/utils/paging.js.map +1 -0
- package/dist/utils/path.d.ts +17 -0
- package/dist/utils/path.d.ts.map +1 -0
- package/dist/utils/path.js +156 -0
- package/dist/utils/path.js.map +1 -0
- package/dist/utils/platform.d.ts +2 -0
- package/dist/utils/platform.d.ts.map +1 -0
- package/dist/utils/platform.js +2 -0
- package/dist/utils/platform.js.map +1 -0
- package/dist/utils/promise.d.ts +61 -0
- package/dist/utils/promise.d.ts.map +1 -0
- package/dist/utils/promise.js +337 -0
- package/dist/utils/promise.js.map +1 -0
- package/dist/utils/promiseCache.d.ts +337 -0
- package/dist/utils/promiseCache.d.ts.map +1 -0
- package/dist/utils/promiseCache.js +634 -0
- package/dist/utils/promiseCache.js.map +1 -0
- package/dist/utils/searchTree.d.ts +58 -0
- package/dist/utils/searchTree.d.ts.map +1 -0
- package/dist/utils/searchTree.js +394 -0
- package/dist/utils/searchTree.js.map +1 -0
- package/dist/utils/stopwatch.d.ts +41 -0
- package/dist/utils/stopwatch.d.ts.map +1 -0
- package/dist/utils/stopwatch.js +83 -0
- package/dist/utils/stopwatch.js.map +1 -0
- package/dist/utils/string.d.ts +91 -0
- package/dist/utils/string.d.ts.map +1 -0
- package/dist/utils/string.js +803 -0
- package/dist/utils/string.js.map +1 -0
- package/dist/utils/subscriptionManager.d.ts +18 -0
- package/dist/utils/subscriptionManager.d.ts.map +1 -0
- package/dist/utils/subscriptionManager.js +34 -0
- package/dist/utils/subscriptionManager.js.map +1 -0
- package/dist/utils/trie.d.ts +76 -0
- package/dist/utils/trie.d.ts.map +1 -0
- package/dist/utils/trie.js +584 -0
- package/dist/utils/trie.js.map +1 -0
- package/dist/utils/types.d.ts +21 -0
- package/dist/utils/types.d.ts.map +1 -0
- package/dist/utils/types.js +2 -0
- package/dist/utils/types.js.map +1 -0
- package/dist/utils/uri.d.ts +69 -0
- package/dist/utils/uri.d.ts.map +1 -0
- package/dist/utils/uri.js +66 -0
- package/dist/utils/uri.js.map +1 -0
- package/dist/utils/validation.d.ts +14 -0
- package/dist/utils/validation.d.ts.map +1 -0
- package/dist/utils/validation.js +26 -0
- package/dist/utils/validation.js.map +1 -0
- package/dist/utils/version.d.ts +15 -0
- package/dist/utils/version.d.ts.map +1 -0
- package/dist/utils/version.js +66 -0
- package/dist/utils/version.js.map +1 -0
- package/package.json +161 -0
- package/src/git/cache.ts +1152 -0
- package/src/git/context.ts +248 -0
- package/src/git/errors.ts +1121 -0
- package/src/git/exec.types.ts +78 -0
- package/src/git/features.ts +45 -0
- package/src/git/models/author.ts +19 -0
- package/src/git/models/autolink.ts +59 -0
- package/src/git/models/blame.ts +46 -0
- package/src/git/models/branch.ts +236 -0
- package/src/git/models/commit.ts +688 -0
- package/src/git/models/contributor.ts +84 -0
- package/src/git/models/defaultBranch.ts +6 -0
- package/src/git/models/diff.ts +74 -0
- package/src/git/models/file.ts +29 -0
- package/src/git/models/fileChange.ts +82 -0
- package/src/git/models/fileStatus.ts +35 -0
- package/src/git/models/graph.ts +184 -0
- package/src/git/models/graphSearch.ts +53 -0
- package/src/git/models/issue.ts +88 -0
- package/src/git/models/issueOrPullRequest.ts +20 -0
- package/src/git/models/lineRange.ts +7 -0
- package/src/git/models/log.ts +21 -0
- package/src/git/models/mergeConflicts.ts +18 -0
- package/src/git/models/patch.ts +25 -0
- package/src/git/models/pausedOperationStatus.ts +63 -0
- package/src/git/models/pullRequest.ts +161 -0
- package/src/git/models/rebase.ts +60 -0
- package/src/git/models/reference.ts +47 -0
- package/src/git/models/reflog.ts +88 -0
- package/src/git/models/remote.ts +99 -0
- package/src/git/models/remoteProvider.ts +290 -0
- package/src/git/models/remoteResource.ts +87 -0
- package/src/git/models/repository.ts +417 -0
- package/src/git/models/repositoryChangeEvent.ts +30 -0
- package/src/git/models/repositoryIdentities.ts +99 -0
- package/src/git/models/repositoryMetadata.ts +12 -0
- package/src/git/models/resourceDescriptor.ts +11 -0
- package/src/git/models/revision.ts +12 -0
- package/src/git/models/search.ts +123 -0
- package/src/git/models/shortlog.ts +6 -0
- package/src/git/models/signature.ts +29 -0
- package/src/git/models/staging.ts +27 -0
- package/src/git/models/stash.ts +6 -0
- package/src/git/models/status.ts +246 -0
- package/src/git/models/statusFile.ts +116 -0
- package/src/git/models/tag.ts +71 -0
- package/src/git/models/tree.ts +10 -0
- package/src/git/models/user.ts +7 -0
- package/src/git/models/worktree.ts +152 -0
- package/src/git/parsers/diffParser.ts +660 -0
- package/src/git/parsers/rebaseTodoParser.ts +169 -0
- package/src/git/providers/blame.ts +40 -0
- package/src/git/providers/branches.ts +111 -0
- package/src/git/providers/commits.ts +147 -0
- package/src/git/providers/config.ts +104 -0
- package/src/git/providers/contributors.ts +34 -0
- package/src/git/providers/diff.ts +127 -0
- package/src/git/providers/graph.ts +30 -0
- package/src/git/providers/operations.ts +82 -0
- package/src/git/providers/patch.ts +31 -0
- package/src/git/providers/pausedOperations.ts +10 -0
- package/src/git/providers/provider.ts +62 -0
- package/src/git/providers/refs.ts +39 -0
- package/src/git/providers/remotes.ts +33 -0
- package/src/git/providers/revision.ts +28 -0
- package/src/git/providers/shared/remotes.ts +95 -0
- package/src/git/providers/staging.ts +22 -0
- package/src/git/providers/stash.ts +51 -0
- package/src/git/providers/status.ts +42 -0
- package/src/git/providers/tags.ts +28 -0
- package/src/git/providers/types.ts +33 -0
- package/src/git/providers/worktrees.ts +23 -0
- package/src/git/remotes/azure-devops.ts +309 -0
- package/src/git/remotes/bitbucket-server.ts +191 -0
- package/src/git/remotes/bitbucket.ts +144 -0
- package/src/git/remotes/custom.ts +139 -0
- package/src/git/remotes/gerrit.ts +188 -0
- package/src/git/remotes/gitea.ts +186 -0
- package/src/git/remotes/github.ts +238 -0
- package/src/git/remotes/gitlab.ts +272 -0
- package/src/git/remotes/google-source.ts +51 -0
- package/src/git/remotes/matcher.ts +215 -0
- package/src/git/repositoryService.ts +179 -0
- package/src/git/service.ts +365 -0
- package/src/git/utils/autolink.utils.ts +201 -0
- package/src/git/utils/blame.utils.ts +296 -0
- package/src/git/utils/branch.utils.ts +154 -0
- package/src/git/utils/commit.utils.ts +89 -0
- package/src/git/utils/contributor.utils.ts +81 -0
- package/src/git/utils/fetch.utils.ts +48 -0
- package/src/git/utils/fileStatus.utils.ts +49 -0
- package/src/git/utils/issue.utils.ts +81 -0
- package/src/git/utils/issueOrPullRequest.utils.ts +23 -0
- package/src/git/utils/mergeConflicts.utils.ts +21 -0
- package/src/git/utils/pausedOperationStatus.utils.ts +156 -0
- package/src/git/utils/pullRequest.utils.ts +149 -0
- package/src/git/utils/rebase.utils.ts +128 -0
- package/src/git/utils/reference.utils.ts +267 -0
- package/src/git/utils/remote.utils.ts +140 -0
- package/src/git/utils/repository.utils.ts +18 -0
- package/src/git/utils/resourceDescriptor.utils.ts +26 -0
- package/src/git/utils/revision.utils.ts +149 -0
- package/src/git/utils/search.utils.ts +498 -0
- package/src/git/utils/sorting.ts +291 -0
- package/src/git/utils/status.utils.ts +114 -0
- package/src/git/utils/statusFile.utils.ts +182 -0
- package/src/git/utils/tag.utils.ts +17 -0
- package/src/git/utils/tooltip.utils.ts +37 -0
- package/src/git/utils/uriAuthority.ts +34 -0
- package/src/git/utils/user.utils.ts +20 -0
- package/src/git/utils/worktree.utils.ts +21 -0
- package/src/git/watching/changeEvent.ts +90 -0
- package/src/git/watching/classifyChange.ts +81 -0
- package/src/git/watching/gitIgnoreFilter.ts +134 -0
- package/src/git/watching/initWatcher.ts +79 -0
- package/src/git/watching/provider.ts +24 -0
- package/src/git/watching/watchGroup.ts +182 -0
- package/src/git/watching/watchService.ts +350 -0
- package/src/git/watching/watchSession.ts +370 -0
- package/src/git/watching/watcherPatterns.ts +51 -0
- package/src/git-cli/cliGitProvider.ts +436 -0
- package/src/git-cli/exec/exec.errors.ts +1 -0
- package/src/git-cli/exec/exec.ts +11 -0
- package/src/git-cli/exec/exec.types.ts +8 -0
- package/src/git-cli/exec/features.ts +2 -0
- package/src/git-cli/exec/git.ts +1092 -0
- package/src/git-cli/exec/gitQueue.ts +251 -0
- package/src/git-cli/exec/locator.ts +157 -0
- package/src/git-cli/parsers/blameParser.ts +373 -0
- package/src/git-cli/parsers/indexParser.ts +192 -0
- package/src/git-cli/parsers/logParser.ts +1275 -0
- package/src/git-cli/parsers/mergeTreeParser.ts +22 -0
- package/src/git-cli/parsers/refParser.ts +111 -0
- package/src/git-cli/parsers/reflogParser.ts +153 -0
- package/src/git-cli/parsers/remoteParser.ts +95 -0
- package/src/git-cli/parsers/shortlogParser.ts +59 -0
- package/src/git-cli/parsers/signatureParser.ts +162 -0
- package/src/git-cli/parsers/statusParser.ts +209 -0
- package/src/git-cli/parsers/treeParser.ts +61 -0
- package/src/git-cli/parsers/worktreeParser.ts +113 -0
- package/src/git-cli/providers/blame.ts +602 -0
- package/src/git-cli/providers/branches.ts +1491 -0
- package/src/git-cli/providers/commitFilesetUtils.ts +45 -0
- package/src/git-cli/providers/commits.ts +1517 -0
- package/src/git-cli/providers/config.ts +724 -0
- package/src/git-cli/providers/contributors.ts +361 -0
- package/src/git-cli/providers/diff.ts +1084 -0
- package/src/git-cli/providers/graph.ts +799 -0
- package/src/git-cli/providers/operations.ts +776 -0
- package/src/git-cli/providers/patch.ts +326 -0
- package/src/git-cli/providers/pausedOperations.ts +538 -0
- package/src/git-cli/providers/refs.ts +193 -0
- package/src/git-cli/providers/remotes.ts +115 -0
- package/src/git-cli/providers/revision.ts +334 -0
- package/src/git-cli/providers/staging.ts +160 -0
- package/src/git-cli/providers/stash.ts +626 -0
- package/src/git-cli/providers/status.ts +373 -0
- package/src/git-cli/providers/tags.ts +188 -0
- package/src/git-cli/providers/worktrees.ts +229 -0
- package/src/git-cli/service.ts +74 -0
- package/src/plus/ai/constants.ts +121 -0
- package/src/plus/ai/errors.ts +82 -0
- package/src/plus/ai/models/conversation.ts +35 -0
- package/src/plus/ai/models/model.ts +425 -0
- package/src/plus/ai/models/promptTemplates.ts +122 -0
- package/src/plus/ai/models/provider.ts +52 -0
- package/src/plus/ai/models/results.ts +1 -0
- package/src/plus/ai/prompts.ts +528 -0
- package/src/plus/ai/providers/anthropicProvider.ts +308 -0
- package/src/plus/ai/providers/azureProvider.ts +74 -0
- package/src/plus/ai/providers/context.ts +29 -0
- package/src/plus/ai/providers/deepSeekProvider.ts +40 -0
- package/src/plus/ai/providers/geminiProvider.ts +207 -0
- package/src/plus/ai/providers/githubModelsProvider.ts +92 -0
- package/src/plus/ai/providers/gitkrakenProvider.ts +218 -0
- package/src/plus/ai/providers/huggingFaceProvider.ts +51 -0
- package/src/plus/ai/providers/mistralProvider.ts +160 -0
- package/src/plus/ai/providers/ollamaProvider.ts +241 -0
- package/src/plus/ai/providers/openAICompatibleProvider.ts +59 -0
- package/src/plus/ai/providers/openAICompatibleProviderBase.ts +279 -0
- package/src/plus/ai/providers/openRouterProvider.ts +84 -0
- package/src/plus/ai/providers/openaiProvider.ts +46 -0
- package/src/plus/ai/providers/xaiProvider.ts +32 -0
- package/src/plus/ai/utils/ai.utils.ts +79 -0
- package/src/plus/ai/utils/results.utils.ts +50 -0
- package/src/plus/ai/utils/truncation.utils.ts +295 -0
- package/src/plus/git-github/api/config.ts +78 -0
- package/src/plus/git-github/api/github.ts +3424 -0
- package/src/plus/git-github/api/github.utils.ts +36 -0
- package/src/plus/git-github/api/token.ts +15 -0
- package/src/plus/git-github/api/tokenUtils.ts +15 -0
- package/src/plus/git-github/api/types.ts +182 -0
- package/src/plus/git-github/context.ts +107 -0
- package/src/plus/git-github/models.ts +524 -0
- package/src/plus/git-github/providers/github/blame.ts +222 -0
- package/src/plus/git-github/providers/github/branches.ts +356 -0
- package/src/plus/git-github/providers/github/commits.ts +858 -0
- package/src/plus/git-github/providers/github/config.ts +47 -0
- package/src/plus/git-github/providers/github/contributors.ts +313 -0
- package/src/plus/git-github/providers/github/diff.ts +267 -0
- package/src/plus/git-github/providers/github/graph.ts +511 -0
- package/src/plus/git-github/providers/github/refs.ts +137 -0
- package/src/plus/git-github/providers/github/remotes.ts +44 -0
- package/src/plus/git-github/providers/github/revision.ts +141 -0
- package/src/plus/git-github/providers/github/status.ts +63 -0
- package/src/plus/git-github/providers/github/tags.ts +147 -0
- package/src/plus/git-github/providers/githubGitProvider.ts +167 -0
- package/src/plus/git-github/providers/githubProvider.ts +65 -0
- package/src/utils/array.ts +194 -0
- package/src/utils/base64.ts +1 -0
- package/src/utils/brand.ts +9 -0
- package/src/utils/cancellation.ts +150 -0
- package/src/utils/charCode.ts +38 -0
- package/src/utils/color.ts +815 -0
- package/src/utils/counter.ts +21 -0
- package/src/utils/crypto.ts +1 -0
- package/src/utils/date.ts +394 -0
- package/src/utils/debounce.ts +303 -0
- package/src/utils/decorators/debounce.ts +31 -0
- package/src/utils/decorators/gate.ts +167 -0
- package/src/utils/decorators/log.ts +320 -0
- package/src/utils/decorators/memoize.ts +98 -0
- package/src/utils/decorators/resolver.ts +95 -0
- package/src/utils/decorators/sequentialize.ts +116 -0
- package/src/utils/decorators/serializable.ts +42 -0
- package/src/utils/disposable.ts +141 -0
- package/src/utils/encoding.ts +8 -0
- package/src/utils/env/browser/base64.ts +50 -0
- package/src/utils/env/browser/crypto.ts +21 -0
- package/src/utils/env/browser/fs.ts +3 -0
- package/src/utils/env/browser/hex.ts +41 -0
- package/src/utils/env/browser/hrtime.ts +14 -0
- package/src/utils/env/browser/logScope.ts +57 -0
- package/src/utils/env/browser/md5.ts +217 -0
- package/src/utils/env/browser/platform.ts +10 -0
- package/src/utils/env/node/base64.ts +17 -0
- package/src/utils/env/node/crypto.ts +17 -0
- package/src/utils/env/node/exec.ts +471 -0
- package/src/utils/env/node/fs.ts +5 -0
- package/src/utils/env/node/hex.ts +11 -0
- package/src/utils/env/node/hrtime.ts +1 -0
- package/src/utils/env/node/logScope.ts +63 -0
- package/src/utils/env/node/platform.ts +5 -0
- package/src/utils/error.ts +17 -0
- package/src/utils/event.ts +236 -0
- package/src/utils/formatter.ts +205 -0
- package/src/utils/fs.ts +1 -0
- package/src/utils/function.ts +141 -0
- package/src/utils/fuzzy.ts +185 -0
- package/src/utils/hash.ts +60 -0
- package/src/utils/hex.ts +1 -0
- package/src/utils/hrtime.ts +8 -0
- package/src/utils/iterable.ts +787 -0
- package/src/utils/lazy.ts +39 -0
- package/src/utils/loggable.ts +7 -0
- package/src/utils/logger.scoped.ts +237 -0
- package/src/utils/logger.ts +402 -0
- package/src/utils/markdown.ts +114 -0
- package/src/utils/mru.ts +66 -0
- package/src/utils/object.ts +227 -0
- package/src/utils/paging.ts +51 -0
- package/src/utils/path.ts +189 -0
- package/src/utils/platform.ts +1 -0
- package/src/utils/promise.ts +590 -0
- package/src/utils/promiseCache.ts +803 -0
- package/src/utils/searchTree.ts +442 -0
- package/src/utils/stopwatch.ts +125 -0
- package/src/utils/string.ts +964 -0
- package/src/utils/subscriptionManager.ts +40 -0
- package/src/utils/trie.ts +739 -0
- package/src/utils/types.ts +31 -0
- package/src/utils/uri.ts +117 -0
- package/src/utils/validation.ts +38 -0
- package/src/utils/version.ts +79 -0
|
@@ -0,0 +1,2360 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { AuthenticationError, AuthenticationErrorReason, RequestClientError, RequestNotFoundError, RequestRateLimitError, } from '../../../git/errors.js';
|
|
8
|
+
import { PullRequestMergeMethod } from '../../../git/models/pullRequest.js';
|
|
9
|
+
import { getGitHubNoReplyAddressParts } from '../../../git/remotes/github.js';
|
|
10
|
+
import { createRevisionRange, getRevisionRangeParts, isRevisionRange, isSha, } from '../../../git/utils/revision.utils.js';
|
|
11
|
+
import { base64 } from '../../../utils/base64.js';
|
|
12
|
+
import { CancellationError } from '../../../utils/cancellation.js';
|
|
13
|
+
import { trace } from '../../../utils/decorators/log.js';
|
|
14
|
+
import { Emitter } from '../../../utils/event.js';
|
|
15
|
+
import { uniqueBy } from '../../../utils/iterable.js';
|
|
16
|
+
import { Logger } from '../../../utils/logger.js';
|
|
17
|
+
import { getScopedLogger } from '../../../utils/logger.scoped.js';
|
|
18
|
+
import { maybeStopWatch } from '../../../utils/stopwatch.js';
|
|
19
|
+
import { parseUri } from '../../../utils/uri.js';
|
|
20
|
+
import { fromString, satisfies } from '../../../utils/version.js';
|
|
21
|
+
import { graphql, GraphqlResponseError } from '@octokit/graphql';
|
|
22
|
+
import { request } from '@octokit/request';
|
|
23
|
+
import { RequestError } from '@octokit/request-error';
|
|
24
|
+
import { fromGitHubIssue, fromGitHubIssueOrPullRequestState, fromGitHubPullRequest, fromGitHubPullRequestLite, } from '../models.js';
|
|
25
|
+
const emptyPagedResult = Object.freeze({ values: [] });
|
|
26
|
+
const emptyBlameResult = Object.freeze({ ranges: [] });
|
|
27
|
+
const gqlIssueOrPullRequestFragment = `
|
|
28
|
+
closed
|
|
29
|
+
closedAt
|
|
30
|
+
createdAt
|
|
31
|
+
id
|
|
32
|
+
number
|
|
33
|
+
state
|
|
34
|
+
title
|
|
35
|
+
updatedAt
|
|
36
|
+
url
|
|
37
|
+
`;
|
|
38
|
+
const gqlPullRequestLiteFragment = `
|
|
39
|
+
${gqlIssueOrPullRequestFragment}
|
|
40
|
+
author {
|
|
41
|
+
login
|
|
42
|
+
avatarUrl(size: $avatarSize)
|
|
43
|
+
url
|
|
44
|
+
}
|
|
45
|
+
baseRefName
|
|
46
|
+
baseRefOid
|
|
47
|
+
headRefName
|
|
48
|
+
headRefOid
|
|
49
|
+
headRepository {
|
|
50
|
+
name
|
|
51
|
+
owner {
|
|
52
|
+
login
|
|
53
|
+
}
|
|
54
|
+
url
|
|
55
|
+
}
|
|
56
|
+
isCrossRepository
|
|
57
|
+
isDraft
|
|
58
|
+
mergedAt
|
|
59
|
+
permalink
|
|
60
|
+
repository {
|
|
61
|
+
isFork
|
|
62
|
+
name
|
|
63
|
+
owner {
|
|
64
|
+
login
|
|
65
|
+
}
|
|
66
|
+
url
|
|
67
|
+
viewerPermission
|
|
68
|
+
}
|
|
69
|
+
`;
|
|
70
|
+
const gqlPullRequestFragment = `
|
|
71
|
+
${gqlPullRequestLiteFragment}
|
|
72
|
+
additions
|
|
73
|
+
assignees(first: 10) {
|
|
74
|
+
nodes {
|
|
75
|
+
login
|
|
76
|
+
avatarUrl(size: $avatarSize)
|
|
77
|
+
url
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
checksUrl
|
|
81
|
+
deletions
|
|
82
|
+
mergeable
|
|
83
|
+
mergedBy {
|
|
84
|
+
login
|
|
85
|
+
}
|
|
86
|
+
reviewDecision
|
|
87
|
+
latestReviews(first: 10) {
|
|
88
|
+
nodes {
|
|
89
|
+
author {
|
|
90
|
+
login
|
|
91
|
+
avatarUrl(size: $avatarSize)
|
|
92
|
+
url
|
|
93
|
+
}
|
|
94
|
+
state
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
reviewRequests(first: 10) {
|
|
98
|
+
nodes {
|
|
99
|
+
asCodeOwner
|
|
100
|
+
id
|
|
101
|
+
requestedReviewer {
|
|
102
|
+
... on User {
|
|
103
|
+
login
|
|
104
|
+
avatarUrl(size: $avatarSize)
|
|
105
|
+
url
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
commits(last: 1) {
|
|
111
|
+
nodes {
|
|
112
|
+
commit {
|
|
113
|
+
statusCheckRollup {
|
|
114
|
+
state
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
totalCommentsCount
|
|
120
|
+
viewerCanUpdate
|
|
121
|
+
`;
|
|
122
|
+
const gqIssueFragment = `
|
|
123
|
+
${gqlIssueOrPullRequestFragment}
|
|
124
|
+
assignees(first: 100) {
|
|
125
|
+
nodes {
|
|
126
|
+
login
|
|
127
|
+
url
|
|
128
|
+
avatarUrl(size: $avatarSize)
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
author {
|
|
132
|
+
login
|
|
133
|
+
avatarUrl
|
|
134
|
+
url
|
|
135
|
+
}
|
|
136
|
+
comments {
|
|
137
|
+
totalCount
|
|
138
|
+
}
|
|
139
|
+
labels(first: 20) {
|
|
140
|
+
nodes {
|
|
141
|
+
color
|
|
142
|
+
name
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
reactions(content: THUMBS_UP) {
|
|
146
|
+
totalCount
|
|
147
|
+
}
|
|
148
|
+
repository {
|
|
149
|
+
name
|
|
150
|
+
owner {
|
|
151
|
+
login
|
|
152
|
+
}
|
|
153
|
+
viewerPermission
|
|
154
|
+
url
|
|
155
|
+
}
|
|
156
|
+
`;
|
|
157
|
+
export class GitHubApi {
|
|
158
|
+
config;
|
|
159
|
+
_onDidReauthenticate = new Emitter();
|
|
160
|
+
get onDidReauthenticate() {
|
|
161
|
+
return this._onDidReauthenticate.event;
|
|
162
|
+
}
|
|
163
|
+
_disposables = [];
|
|
164
|
+
constructor(config) {
|
|
165
|
+
this.config = config;
|
|
166
|
+
this._disposables.push(this._onDidReauthenticate);
|
|
167
|
+
if (config.onConfigChanged != null) {
|
|
168
|
+
this._disposables.push(config.onConfigChanged(() => {
|
|
169
|
+
this.resetCaches();
|
|
170
|
+
}));
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
dispose() {
|
|
174
|
+
for (const d of this._disposables) {
|
|
175
|
+
d.dispose();
|
|
176
|
+
}
|
|
177
|
+
this._disposables.length = 0;
|
|
178
|
+
}
|
|
179
|
+
resetCaches() {
|
|
180
|
+
this._defaults.clear();
|
|
181
|
+
this._enterpriseVersions.clear();
|
|
182
|
+
}
|
|
183
|
+
async getCurrentAccount(provider, token, options) {
|
|
184
|
+
const scope = getScopedLogger();
|
|
185
|
+
try {
|
|
186
|
+
const query = `query getCurrentAccount($avatarSize: Int) {
|
|
187
|
+
viewer {
|
|
188
|
+
name
|
|
189
|
+
email
|
|
190
|
+
login
|
|
191
|
+
avatarUrl(size: $avatarSize)
|
|
192
|
+
}
|
|
193
|
+
}`;
|
|
194
|
+
const rsp = await this.graphql(provider, token, query, { ...options }, scope);
|
|
195
|
+
if (rsp?.viewer?.login == null)
|
|
196
|
+
return undefined;
|
|
197
|
+
return {
|
|
198
|
+
provider: provider,
|
|
199
|
+
id: rsp.viewer.login,
|
|
200
|
+
name: rsp.viewer.name ?? undefined,
|
|
201
|
+
email: rsp.viewer.email ?? undefined,
|
|
202
|
+
// If we are GitHub Enterprise, we may need to convert the avatar URL since it might require authentication
|
|
203
|
+
avatarUrl: !rsp.viewer.avatarUrl || isGitHubDotCom(options)
|
|
204
|
+
? (rsp.viewer.avatarUrl ?? undefined)
|
|
205
|
+
: rsp.viewer.email && options?.baseUrl != null
|
|
206
|
+
? await this.createEnterpriseAvatarUrl(provider, token, options.baseUrl, rsp.viewer.email, options.avatarSize)
|
|
207
|
+
: undefined,
|
|
208
|
+
username: rsp.viewer.login ?? undefined,
|
|
209
|
+
};
|
|
210
|
+
}
|
|
211
|
+
catch (ex) {
|
|
212
|
+
if (ex instanceof RequestNotFoundError)
|
|
213
|
+
return undefined;
|
|
214
|
+
throw this.handleException(ex, provider, scope);
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
async getAccountForCommit(provider, token, owner, repo, rev, options) {
|
|
218
|
+
const scope = getScopedLogger();
|
|
219
|
+
try {
|
|
220
|
+
const query = `query getAccountForCommit(
|
|
221
|
+
$owner: String!
|
|
222
|
+
$repo: String!
|
|
223
|
+
$rev: GitObjectID!
|
|
224
|
+
$avatarSize: Int
|
|
225
|
+
) {
|
|
226
|
+
repository(name: $repo, owner: $owner) {
|
|
227
|
+
object(oid: $rev) {
|
|
228
|
+
... on Commit {
|
|
229
|
+
author {
|
|
230
|
+
name
|
|
231
|
+
email
|
|
232
|
+
avatarUrl(size: $avatarSize)
|
|
233
|
+
user {
|
|
234
|
+
login
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
}`;
|
|
241
|
+
const rsp = await this.graphql(provider, token, query, {
|
|
242
|
+
...options,
|
|
243
|
+
owner: owner,
|
|
244
|
+
repo: repo,
|
|
245
|
+
rev: rev,
|
|
246
|
+
}, scope);
|
|
247
|
+
const author = rsp?.repository?.object?.author;
|
|
248
|
+
if (author == null)
|
|
249
|
+
return undefined;
|
|
250
|
+
return {
|
|
251
|
+
provider: provider,
|
|
252
|
+
...(author?.user?.login != null
|
|
253
|
+
? {
|
|
254
|
+
id: author.user.login,
|
|
255
|
+
username: author.user.login,
|
|
256
|
+
}
|
|
257
|
+
: {
|
|
258
|
+
id: undefined,
|
|
259
|
+
username: undefined,
|
|
260
|
+
}),
|
|
261
|
+
name: author.name ?? undefined,
|
|
262
|
+
email: author.email ?? undefined,
|
|
263
|
+
// If we are GitHub Enterprise, we may need to convert the avatar URL since it might require authentication
|
|
264
|
+
avatarUrl: !author.avatarUrl || isGitHubDotCom(options)
|
|
265
|
+
? (author.avatarUrl ?? undefined)
|
|
266
|
+
: author.email && options?.baseUrl != null
|
|
267
|
+
? await this.createEnterpriseAvatarUrl(provider, token, options.baseUrl, author.email, options.avatarSize)
|
|
268
|
+
: undefined,
|
|
269
|
+
};
|
|
270
|
+
}
|
|
271
|
+
catch (ex) {
|
|
272
|
+
if (ex instanceof RequestNotFoundError)
|
|
273
|
+
return undefined;
|
|
274
|
+
if (ex.message.includes('Variable $rev of type GitObjectID! was provided invalid value')) {
|
|
275
|
+
return undefined;
|
|
276
|
+
}
|
|
277
|
+
throw this.handleException(ex, provider, scope);
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
async getAccountForEmail(provider, token, owner, repo, email, options) {
|
|
281
|
+
const scope = getScopedLogger();
|
|
282
|
+
try {
|
|
283
|
+
const query = `query getAccountForEmail(
|
|
284
|
+
$emailQuery: String!
|
|
285
|
+
$avatarSize: Int
|
|
286
|
+
) {
|
|
287
|
+
search(type: USER, query: $emailQuery, first: 1) {
|
|
288
|
+
nodes {
|
|
289
|
+
... on User {
|
|
290
|
+
name
|
|
291
|
+
email
|
|
292
|
+
avatarUrl(size: $avatarSize)
|
|
293
|
+
login
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
}`;
|
|
298
|
+
const rsp = await this.graphql(provider, token, query, {
|
|
299
|
+
...options,
|
|
300
|
+
owner: owner,
|
|
301
|
+
repo: repo,
|
|
302
|
+
emailQuery: `in:email ${email}`,
|
|
303
|
+
}, scope);
|
|
304
|
+
const author = rsp?.search?.nodes?.[0];
|
|
305
|
+
if (author?.login == null)
|
|
306
|
+
return undefined;
|
|
307
|
+
return {
|
|
308
|
+
provider: provider,
|
|
309
|
+
id: author.login,
|
|
310
|
+
name: author.name ?? undefined,
|
|
311
|
+
email: author.email ?? undefined,
|
|
312
|
+
// If we are GitHub Enterprise, we may need to convert the avatar URL since it might require authentication
|
|
313
|
+
avatarUrl: !author.avatarUrl || isGitHubDotCom(options)
|
|
314
|
+
? (author.avatarUrl ?? undefined)
|
|
315
|
+
: author.email && options?.baseUrl != null
|
|
316
|
+
? await this.createEnterpriseAvatarUrl(provider, token, options.baseUrl, author.email, options.avatarSize)
|
|
317
|
+
: undefined,
|
|
318
|
+
username: author.login ?? undefined,
|
|
319
|
+
};
|
|
320
|
+
}
|
|
321
|
+
catch (ex) {
|
|
322
|
+
if (ex instanceof RequestNotFoundError)
|
|
323
|
+
return undefined;
|
|
324
|
+
throw this.handleException(ex, provider, scope);
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
async getDefaultBranch(provider, token, owner, repo, options) {
|
|
328
|
+
const scope = getScopedLogger();
|
|
329
|
+
try {
|
|
330
|
+
const query = `query getDefaultBranch(
|
|
331
|
+
$owner: String!
|
|
332
|
+
$repo: String!
|
|
333
|
+
) {
|
|
334
|
+
repository(name: $repo, owner: $owner) {
|
|
335
|
+
defaultBranchRef {
|
|
336
|
+
name
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
}`;
|
|
340
|
+
const rsp = await this.graphql(provider, token, query, {
|
|
341
|
+
...options,
|
|
342
|
+
owner: owner,
|
|
343
|
+
repo: repo,
|
|
344
|
+
}, scope);
|
|
345
|
+
const defaultBranch = rsp?.repository?.defaultBranchRef?.name ?? undefined;
|
|
346
|
+
if (defaultBranch == null)
|
|
347
|
+
return undefined;
|
|
348
|
+
return {
|
|
349
|
+
provider: provider,
|
|
350
|
+
name: defaultBranch,
|
|
351
|
+
};
|
|
352
|
+
}
|
|
353
|
+
catch (ex) {
|
|
354
|
+
if (ex instanceof RequestNotFoundError)
|
|
355
|
+
return undefined;
|
|
356
|
+
throw this.handleException(ex, provider, scope);
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
async getIssueOrPullRequest(provider, token, owner, repo, number, options) {
|
|
360
|
+
const scope = getScopedLogger();
|
|
361
|
+
try {
|
|
362
|
+
const query = `query getIssueOrPullRequest(
|
|
363
|
+
$owner: String!
|
|
364
|
+
$repo: String!
|
|
365
|
+
$number: Int!
|
|
366
|
+
) {
|
|
367
|
+
repository(name: $repo, owner: $owner) {
|
|
368
|
+
issueOrPullRequest(number: $number) {
|
|
369
|
+
__typename
|
|
370
|
+
... on Issue {
|
|
371
|
+
${gqlIssueOrPullRequestFragment}
|
|
372
|
+
}
|
|
373
|
+
... on PullRequest {
|
|
374
|
+
${gqlIssueOrPullRequestFragment}
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
}`;
|
|
379
|
+
const rsp = await this.graphql(provider, token, query, {
|
|
380
|
+
...options,
|
|
381
|
+
owner: owner,
|
|
382
|
+
repo: repo,
|
|
383
|
+
number: number,
|
|
384
|
+
}, scope);
|
|
385
|
+
const issue = rsp?.repository?.issueOrPullRequest;
|
|
386
|
+
if (issue == null)
|
|
387
|
+
return undefined;
|
|
388
|
+
return {
|
|
389
|
+
provider: provider,
|
|
390
|
+
type: issue.__typename === 'PullRequest' ? 'pullrequest' : 'issue',
|
|
391
|
+
id: String(issue.number),
|
|
392
|
+
nodeId: issue.id,
|
|
393
|
+
createdDate: new Date(issue.createdAt),
|
|
394
|
+
updatedDate: new Date(issue.updatedAt),
|
|
395
|
+
title: issue.title,
|
|
396
|
+
closed: issue.closed,
|
|
397
|
+
closedDate: issue.closedAt == null ? undefined : new Date(issue.closedAt),
|
|
398
|
+
url: issue.url,
|
|
399
|
+
state: fromGitHubIssueOrPullRequestState(issue.state),
|
|
400
|
+
};
|
|
401
|
+
}
|
|
402
|
+
catch (ex) {
|
|
403
|
+
if (ex instanceof RequestNotFoundError)
|
|
404
|
+
return undefined;
|
|
405
|
+
throw this.handleException(ex, provider, scope);
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
async getIssue(provider, token, owner, repo, number, options) {
|
|
409
|
+
const scope = getScopedLogger();
|
|
410
|
+
try {
|
|
411
|
+
const query = `query getIssue(
|
|
412
|
+
$owner: String!
|
|
413
|
+
$repo: String!
|
|
414
|
+
$number: Int!
|
|
415
|
+
$avatarSize: Int
|
|
416
|
+
) {
|
|
417
|
+
repository(name: $repo, owner: $owner) {
|
|
418
|
+
issue(number: $number) {
|
|
419
|
+
${gqIssueFragment}${options?.includeBody
|
|
420
|
+
? `
|
|
421
|
+
body
|
|
422
|
+
`
|
|
423
|
+
: ''}
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
}`;
|
|
427
|
+
const rsp = await this.graphql(provider, token, query, {
|
|
428
|
+
...options,
|
|
429
|
+
owner: owner,
|
|
430
|
+
repo: repo,
|
|
431
|
+
number: number,
|
|
432
|
+
}, scope);
|
|
433
|
+
if (rsp?.repository?.issue == null)
|
|
434
|
+
return undefined;
|
|
435
|
+
return fromGitHubIssue(rsp.repository.issue, provider);
|
|
436
|
+
}
|
|
437
|
+
catch (ex) {
|
|
438
|
+
if (ex instanceof RequestNotFoundError)
|
|
439
|
+
return undefined;
|
|
440
|
+
throw this.handleException(ex, provider, scope);
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
async getPullRequest(provider, token, owner, repo, number, options) {
|
|
444
|
+
const scope = getScopedLogger();
|
|
445
|
+
try {
|
|
446
|
+
const query = `query getPullRequest(
|
|
447
|
+
$owner: String!
|
|
448
|
+
$repo: String!
|
|
449
|
+
$number: Int!
|
|
450
|
+
$avatarSize: Int
|
|
451
|
+
) {
|
|
452
|
+
repository(name: $repo, owner: $owner) {
|
|
453
|
+
pullRequest(number: $number) {
|
|
454
|
+
${gqlPullRequestFragment}
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
}`;
|
|
458
|
+
const rsp = await this.graphql(provider, token, query, {
|
|
459
|
+
...options,
|
|
460
|
+
owner: owner,
|
|
461
|
+
repo: repo,
|
|
462
|
+
number: number,
|
|
463
|
+
}, scope);
|
|
464
|
+
if (rsp?.repository?.pullRequest == null)
|
|
465
|
+
return undefined;
|
|
466
|
+
return fromGitHubPullRequestLite(rsp.repository.pullRequest, provider);
|
|
467
|
+
}
|
|
468
|
+
catch (ex) {
|
|
469
|
+
if (ex instanceof RequestNotFoundError)
|
|
470
|
+
return undefined;
|
|
471
|
+
throw this.handleException(ex, provider, scope);
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
async getPullRequestForBranch(provider, token, owner, repo, branch, options) {
|
|
475
|
+
const scope = getScopedLogger();
|
|
476
|
+
try {
|
|
477
|
+
const query = `query getPullRequestForBranch(
|
|
478
|
+
$owner: String!
|
|
479
|
+
$repo: String!
|
|
480
|
+
$branch: String!
|
|
481
|
+
$limit: Int!
|
|
482
|
+
$include: [PullRequestState!]
|
|
483
|
+
$avatarSize: Int
|
|
484
|
+
) {
|
|
485
|
+
repository(name: $repo, owner: $owner) {
|
|
486
|
+
ref(qualifiedName: $branch) {
|
|
487
|
+
associatedPullRequests(first: $limit, orderBy: {field: UPDATED_AT, direction: DESC}, states: $include) {
|
|
488
|
+
nodes {
|
|
489
|
+
${gqlPullRequestLiteFragment}
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
}
|
|
494
|
+
}`;
|
|
495
|
+
const rsp = await this.graphql(provider, token, query, {
|
|
496
|
+
...options,
|
|
497
|
+
owner: owner,
|
|
498
|
+
repo: repo,
|
|
499
|
+
branch: `refs/heads/${branch}`,
|
|
500
|
+
// Since GitHub sort doesn't seem to really work, look for a max of 10 PRs and then sort them ourselves
|
|
501
|
+
limit: 10,
|
|
502
|
+
}, scope);
|
|
503
|
+
// If the pr is not from a fork, keep it e.g. show root pr's on forks, otherwise, ensure the repo owners match
|
|
504
|
+
const prs = rsp?.repository?.ref?.associatedPullRequests?.nodes?.filter(pr => pr != null && (!pr.repository.isFork || pr.repository.owner.login === owner));
|
|
505
|
+
if (prs == null || prs.length === 0)
|
|
506
|
+
return undefined;
|
|
507
|
+
if (prs.length > 1) {
|
|
508
|
+
prs.sort((a, b) => (a.repository.owner.login === owner ? -1 : 1) - (b.repository.owner.login === owner ? -1 : 1) ||
|
|
509
|
+
(a.state === 'OPEN' ? -1 : 1) - (b.state === 'OPEN' ? -1 : 1) ||
|
|
510
|
+
new Date(b.updatedAt).getTime() - new Date(a.updatedAt).getTime());
|
|
511
|
+
}
|
|
512
|
+
return fromGitHubPullRequestLite(prs[0], provider);
|
|
513
|
+
}
|
|
514
|
+
catch (ex) {
|
|
515
|
+
if (ex instanceof RequestNotFoundError)
|
|
516
|
+
return undefined;
|
|
517
|
+
throw this.handleException(ex, provider, scope);
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
async getPullRequestForCommit(provider, token, owner, repo, rev, options, cancellation) {
|
|
521
|
+
const scope = getScopedLogger();
|
|
522
|
+
try {
|
|
523
|
+
const query = `query getPullRequestForCommit(
|
|
524
|
+
$owner: String!
|
|
525
|
+
$repo: String!
|
|
526
|
+
$rev: GitObjectID!
|
|
527
|
+
$avatarSize: Int
|
|
528
|
+
) {
|
|
529
|
+
repository(name: $repo, owner: $owner) {
|
|
530
|
+
object(oid: $rev) {
|
|
531
|
+
... on Commit {
|
|
532
|
+
associatedPullRequests(first: 2, orderBy: {field: UPDATED_AT, direction: DESC}) {
|
|
533
|
+
nodes {
|
|
534
|
+
${gqlPullRequestLiteFragment}
|
|
535
|
+
}
|
|
536
|
+
}
|
|
537
|
+
}
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
}`;
|
|
541
|
+
const rsp = await this.graphql(provider, token, query, {
|
|
542
|
+
...options,
|
|
543
|
+
owner: owner,
|
|
544
|
+
repo: repo,
|
|
545
|
+
rev: rev,
|
|
546
|
+
}, scope, cancellation);
|
|
547
|
+
// If the pr is not from a fork, keep it e.g. show root pr's on forks, otherwise, ensure the repo owners match
|
|
548
|
+
const prs = rsp?.repository?.object?.associatedPullRequests?.nodes?.filter(pr => pr != null && (!pr.repository.isFork || pr.repository.owner.login === owner));
|
|
549
|
+
if (prs == null || prs.length === 0)
|
|
550
|
+
return undefined;
|
|
551
|
+
if (prs.length > 1) {
|
|
552
|
+
prs.sort((a, b) => (a.repository.owner.login === owner ? -1 : 1) - (b.repository.owner.login === owner ? -1 : 1) ||
|
|
553
|
+
(a.state === 'MERGED' ? -1 : 1) - (b.state === 'MERGED' ? -1 : 1) ||
|
|
554
|
+
new Date(b.updatedAt).getTime() - new Date(a.updatedAt).getTime());
|
|
555
|
+
}
|
|
556
|
+
return fromGitHubPullRequestLite(prs[0], provider);
|
|
557
|
+
}
|
|
558
|
+
catch (ex) {
|
|
559
|
+
if (ex instanceof RequestNotFoundError)
|
|
560
|
+
return undefined;
|
|
561
|
+
throw this.handleException(ex, provider, scope);
|
|
562
|
+
}
|
|
563
|
+
}
|
|
564
|
+
async getRepositoryMetadata(provider, token, owner, repo, options, cancellation) {
|
|
565
|
+
const scope = getScopedLogger();
|
|
566
|
+
try {
|
|
567
|
+
const query = `query getRepositoryMetadata(
|
|
568
|
+
$owner: String!
|
|
569
|
+
$repo: String!
|
|
570
|
+
) {
|
|
571
|
+
repository(name: $repo, owner: $owner) {
|
|
572
|
+
owner {
|
|
573
|
+
login
|
|
574
|
+
}
|
|
575
|
+
name
|
|
576
|
+
parent {
|
|
577
|
+
owner {
|
|
578
|
+
login
|
|
579
|
+
}
|
|
580
|
+
name
|
|
581
|
+
}
|
|
582
|
+
}
|
|
583
|
+
}`;
|
|
584
|
+
const rsp = await this.graphql(provider, token, query, {
|
|
585
|
+
...options,
|
|
586
|
+
owner: owner,
|
|
587
|
+
repo: repo,
|
|
588
|
+
}, scope, cancellation);
|
|
589
|
+
const r = rsp?.repository ?? undefined;
|
|
590
|
+
if (r == null)
|
|
591
|
+
return undefined;
|
|
592
|
+
return {
|
|
593
|
+
provider: provider,
|
|
594
|
+
owner: r.owner.login,
|
|
595
|
+
name: r.name,
|
|
596
|
+
isFork: r.parent != null,
|
|
597
|
+
parent: r.parent != null
|
|
598
|
+
? {
|
|
599
|
+
owner: r.parent.owner.login,
|
|
600
|
+
name: r.parent.name,
|
|
601
|
+
}
|
|
602
|
+
: undefined,
|
|
603
|
+
};
|
|
604
|
+
}
|
|
605
|
+
catch (ex) {
|
|
606
|
+
if (ex instanceof RequestNotFoundError)
|
|
607
|
+
return undefined;
|
|
608
|
+
throw this.handleException(ex, provider, scope);
|
|
609
|
+
}
|
|
610
|
+
}
|
|
611
|
+
async getBlame(token, owner, repo, ref, path) {
|
|
612
|
+
const scope = getScopedLogger();
|
|
613
|
+
try {
|
|
614
|
+
const query = `query getBlameRanges(
|
|
615
|
+
$owner: String!
|
|
616
|
+
$repo: String!
|
|
617
|
+
$ref: String!
|
|
618
|
+
$path: String!
|
|
619
|
+
) {
|
|
620
|
+
viewer { name }
|
|
621
|
+
repository(owner: $owner, name: $repo) {
|
|
622
|
+
object(expression: $ref) {
|
|
623
|
+
...on Commit {
|
|
624
|
+
blame(path: $path) {
|
|
625
|
+
ranges {
|
|
626
|
+
startingLine
|
|
627
|
+
endingLine
|
|
628
|
+
commit {
|
|
629
|
+
oid
|
|
630
|
+
parents(first: 3) { nodes { oid } }
|
|
631
|
+
message
|
|
632
|
+
additions
|
|
633
|
+
changedFiles
|
|
634
|
+
deletions
|
|
635
|
+
author {
|
|
636
|
+
avatarUrl
|
|
637
|
+
date
|
|
638
|
+
email
|
|
639
|
+
name
|
|
640
|
+
}
|
|
641
|
+
committer {
|
|
642
|
+
date
|
|
643
|
+
email
|
|
644
|
+
name
|
|
645
|
+
}
|
|
646
|
+
}
|
|
647
|
+
}
|
|
648
|
+
}
|
|
649
|
+
}
|
|
650
|
+
}
|
|
651
|
+
}
|
|
652
|
+
}`;
|
|
653
|
+
const rsp = await this.graphql(undefined, token, query, {
|
|
654
|
+
owner: owner,
|
|
655
|
+
repo: repo,
|
|
656
|
+
ref: ref,
|
|
657
|
+
path: path,
|
|
658
|
+
}, scope);
|
|
659
|
+
if (rsp == null)
|
|
660
|
+
return emptyBlameResult;
|
|
661
|
+
const ranges = rsp.repository?.object?.blame?.ranges;
|
|
662
|
+
if (ranges == null || ranges.length === 0)
|
|
663
|
+
return { ranges: [], viewer: rsp.viewer?.name };
|
|
664
|
+
return { ranges: ranges, viewer: rsp.viewer?.name };
|
|
665
|
+
}
|
|
666
|
+
catch (ex) {
|
|
667
|
+
if (ex instanceof RequestNotFoundError)
|
|
668
|
+
return emptyBlameResult;
|
|
669
|
+
throw this.handleException(ex, undefined, scope);
|
|
670
|
+
}
|
|
671
|
+
}
|
|
672
|
+
async getBranches(token, owner, repo, options) {
|
|
673
|
+
const scope = getScopedLogger();
|
|
674
|
+
try {
|
|
675
|
+
const query = `query getBranches(
|
|
676
|
+
$owner: String!
|
|
677
|
+
$repo: String!
|
|
678
|
+
$branchQuery: String
|
|
679
|
+
$cursor: String
|
|
680
|
+
$limit: Int = 100
|
|
681
|
+
) {
|
|
682
|
+
repository(owner: $owner, name: $repo) {
|
|
683
|
+
refs(query: $branchQuery, refPrefix: "refs/heads/", first: $limit, after: $cursor) {
|
|
684
|
+
pageInfo {
|
|
685
|
+
endCursor
|
|
686
|
+
hasNextPage
|
|
687
|
+
}
|
|
688
|
+
nodes {
|
|
689
|
+
name
|
|
690
|
+
target {
|
|
691
|
+
oid
|
|
692
|
+
...on Commit {
|
|
693
|
+
authoredDate
|
|
694
|
+
committedDate
|
|
695
|
+
}
|
|
696
|
+
}
|
|
697
|
+
}
|
|
698
|
+
}
|
|
699
|
+
}
|
|
700
|
+
}`;
|
|
701
|
+
const rsp = await this.graphql(undefined, token, query, {
|
|
702
|
+
owner: owner,
|
|
703
|
+
repo: repo,
|
|
704
|
+
branchQuery: options?.query,
|
|
705
|
+
cursor: options?.cursor,
|
|
706
|
+
limit: Math.min(100, options?.limit ?? 100),
|
|
707
|
+
}, scope);
|
|
708
|
+
if (rsp == null)
|
|
709
|
+
return emptyPagedResult;
|
|
710
|
+
const refs = rsp.repository?.refs;
|
|
711
|
+
if (refs == null)
|
|
712
|
+
return emptyPagedResult;
|
|
713
|
+
return {
|
|
714
|
+
paging: {
|
|
715
|
+
cursor: refs.pageInfo.endCursor,
|
|
716
|
+
more: refs.pageInfo.hasNextPage,
|
|
717
|
+
},
|
|
718
|
+
values: refs.nodes,
|
|
719
|
+
};
|
|
720
|
+
}
|
|
721
|
+
catch (ex) {
|
|
722
|
+
if (ex instanceof RequestNotFoundError)
|
|
723
|
+
return emptyPagedResult;
|
|
724
|
+
throw this.handleException(ex, undefined, scope);
|
|
725
|
+
}
|
|
726
|
+
}
|
|
727
|
+
async getCommit(token, owner, repo, ref) {
|
|
728
|
+
const scope = getScopedLogger();
|
|
729
|
+
try {
|
|
730
|
+
const rsp = await this.request(undefined, token, 'GET /repos/{owner}/{repo}/commits/{ref}', {
|
|
731
|
+
owner: owner,
|
|
732
|
+
repo: repo,
|
|
733
|
+
ref: ref,
|
|
734
|
+
}, scope);
|
|
735
|
+
const result = rsp?.data;
|
|
736
|
+
if (result == null)
|
|
737
|
+
return undefined;
|
|
738
|
+
const { commit } = result;
|
|
739
|
+
return {
|
|
740
|
+
oid: result.sha,
|
|
741
|
+
parents: { nodes: result.parents.map(p => ({ oid: p.sha })) },
|
|
742
|
+
message: commit.message,
|
|
743
|
+
additions: result.stats?.additions,
|
|
744
|
+
changedFiles: result.files?.length,
|
|
745
|
+
deletions: result.stats?.deletions,
|
|
746
|
+
author: {
|
|
747
|
+
avatarUrl: result.author?.avatar_url ?? undefined,
|
|
748
|
+
date: commit.author?.date ?? new Date().toString(),
|
|
749
|
+
email: commit.author?.email ?? undefined,
|
|
750
|
+
name: commit.author?.name ?? '',
|
|
751
|
+
},
|
|
752
|
+
committer: {
|
|
753
|
+
date: commit.committer?.date ?? new Date().toString(),
|
|
754
|
+
email: commit.committer?.email ?? undefined,
|
|
755
|
+
name: commit.committer?.name ?? '',
|
|
756
|
+
},
|
|
757
|
+
files: result.files,
|
|
758
|
+
};
|
|
759
|
+
}
|
|
760
|
+
catch (ex) {
|
|
761
|
+
if (ex instanceof RequestNotFoundError)
|
|
762
|
+
return undefined;
|
|
763
|
+
throw this.handleException(ex, undefined, scope);
|
|
764
|
+
}
|
|
765
|
+
// const results = await this.getCommits(token, owner, repo, ref, { limit: 1 });
|
|
766
|
+
// if (results.values.length === 0) return undefined;
|
|
767
|
+
// return { ...results.values[0], viewer: results.viewer };
|
|
768
|
+
}
|
|
769
|
+
async getCommitForFile(token, owner, repo, ref, path) {
|
|
770
|
+
if (isSha(ref))
|
|
771
|
+
return this.getCommit(token, owner, repo, ref);
|
|
772
|
+
// TODO: optimize this -- only need to get the sha for the ref
|
|
773
|
+
const results = await this.getCommits(token, owner, repo, ref, { limit: 1, path: path });
|
|
774
|
+
if (results.values.length === 0)
|
|
775
|
+
return undefined;
|
|
776
|
+
const commit = await this.getCommit(token, owner, repo, results.values[0].oid);
|
|
777
|
+
return { ...(commit ?? results.values[0]), viewer: results.viewer };
|
|
778
|
+
}
|
|
779
|
+
async getBranchesWithCommits(token, owner, repo, refs, mode, date) {
|
|
780
|
+
const scope = getScopedLogger();
|
|
781
|
+
const limit = mode === 'contains' ? 10 : 1;
|
|
782
|
+
try {
|
|
783
|
+
const query = `query getBranchesWithCommits(
|
|
784
|
+
$owner: String!
|
|
785
|
+
$repo: String!
|
|
786
|
+
$since: GitTimestamp!
|
|
787
|
+
$until: GitTimestamp!
|
|
788
|
+
) {
|
|
789
|
+
repository(owner: $owner, name: $repo) {
|
|
790
|
+
refs(first: 20, refPrefix: "refs/heads/") {
|
|
791
|
+
nodes {
|
|
792
|
+
name
|
|
793
|
+
target {
|
|
794
|
+
... on Commit {
|
|
795
|
+
history(first: ${limit}, since: $since until: $until) {
|
|
796
|
+
nodes { oid }
|
|
797
|
+
}
|
|
798
|
+
}
|
|
799
|
+
}
|
|
800
|
+
}
|
|
801
|
+
}
|
|
802
|
+
}
|
|
803
|
+
}`;
|
|
804
|
+
const rsp = await this.graphql(undefined, token, query, {
|
|
805
|
+
owner: owner,
|
|
806
|
+
repo: repo,
|
|
807
|
+
since: date?.toISOString(),
|
|
808
|
+
until: date?.toISOString(),
|
|
809
|
+
}, scope);
|
|
810
|
+
const nodes = rsp?.repository?.refs?.nodes;
|
|
811
|
+
if (nodes == null)
|
|
812
|
+
return [];
|
|
813
|
+
const branches = [];
|
|
814
|
+
for (const branch of nodes) {
|
|
815
|
+
for (const commit of branch.target.history.nodes) {
|
|
816
|
+
if (refs.includes(commit.oid)) {
|
|
817
|
+
branches.push(branch.name);
|
|
818
|
+
break;
|
|
819
|
+
}
|
|
820
|
+
}
|
|
821
|
+
}
|
|
822
|
+
return branches;
|
|
823
|
+
}
|
|
824
|
+
catch (ex) {
|
|
825
|
+
if (ex instanceof RequestNotFoundError)
|
|
826
|
+
return [];
|
|
827
|
+
throw this.handleException(ex, undefined, scope);
|
|
828
|
+
}
|
|
829
|
+
}
|
|
830
|
+
async getCommitCount(token, owner, repo, ref) {
|
|
831
|
+
const scope = getScopedLogger();
|
|
832
|
+
try {
|
|
833
|
+
const query = `query getCommitCount(
|
|
834
|
+
$owner: String!
|
|
835
|
+
$repo: String!
|
|
836
|
+
$ref: String!
|
|
837
|
+
) {
|
|
838
|
+
repository(owner: $owner, name: $repo) {
|
|
839
|
+
ref(qualifiedName: $ref) {
|
|
840
|
+
target {
|
|
841
|
+
... on Commit {
|
|
842
|
+
history(first: 1) {
|
|
843
|
+
totalCount
|
|
844
|
+
}
|
|
845
|
+
}
|
|
846
|
+
}
|
|
847
|
+
}
|
|
848
|
+
}
|
|
849
|
+
}`;
|
|
850
|
+
const rsp = await this.graphql(undefined, token, query, {
|
|
851
|
+
owner: owner,
|
|
852
|
+
repo: repo,
|
|
853
|
+
ref: ref,
|
|
854
|
+
}, scope);
|
|
855
|
+
const count = rsp?.repository?.ref?.target.history.totalCount;
|
|
856
|
+
return count;
|
|
857
|
+
}
|
|
858
|
+
catch (ex) {
|
|
859
|
+
if (ex instanceof RequestNotFoundError)
|
|
860
|
+
return undefined;
|
|
861
|
+
throw this.handleException(ex, undefined, scope);
|
|
862
|
+
}
|
|
863
|
+
}
|
|
864
|
+
async getBranchWithCommit(token, owner, repo, branch, refs, mode, date) {
|
|
865
|
+
const scope = getScopedLogger();
|
|
866
|
+
const limit = mode === 'contains' ? 100 : 1;
|
|
867
|
+
try {
|
|
868
|
+
const query = `query getBranchWithCommit(
|
|
869
|
+
$owner: String!
|
|
870
|
+
$repo: String!
|
|
871
|
+
$ref: String!
|
|
872
|
+
$since: GitTimestamp!
|
|
873
|
+
$until: GitTimestamp!
|
|
874
|
+
) {
|
|
875
|
+
repository(owner: $owner, name: $repo) {
|
|
876
|
+
ref(qualifiedName: $ref) {
|
|
877
|
+
target {
|
|
878
|
+
... on Commit {
|
|
879
|
+
history(first: ${limit}, since: $since until: $until) {
|
|
880
|
+
nodes { oid }
|
|
881
|
+
}
|
|
882
|
+
}
|
|
883
|
+
}
|
|
884
|
+
}
|
|
885
|
+
}
|
|
886
|
+
}`;
|
|
887
|
+
const rsp = await this.graphql(undefined, token, query, {
|
|
888
|
+
owner: owner,
|
|
889
|
+
repo: repo,
|
|
890
|
+
ref: `refs/heads/${branch}`,
|
|
891
|
+
since: date?.toISOString(),
|
|
892
|
+
until: date?.toISOString(),
|
|
893
|
+
}, scope);
|
|
894
|
+
const nodes = rsp?.repository?.ref?.target?.history?.nodes;
|
|
895
|
+
if (nodes == null)
|
|
896
|
+
return [];
|
|
897
|
+
const branches = [];
|
|
898
|
+
for (const commit of nodes) {
|
|
899
|
+
if (refs.includes(commit.oid)) {
|
|
900
|
+
branches.push(branch);
|
|
901
|
+
break;
|
|
902
|
+
}
|
|
903
|
+
}
|
|
904
|
+
return branches;
|
|
905
|
+
}
|
|
906
|
+
catch (ex) {
|
|
907
|
+
if (ex instanceof RequestNotFoundError)
|
|
908
|
+
return [];
|
|
909
|
+
throw this.handleException(ex, undefined, scope);
|
|
910
|
+
}
|
|
911
|
+
}
|
|
912
|
+
async getCommits(token, owner, repo, ref, options) {
|
|
913
|
+
const scope = getScopedLogger();
|
|
914
|
+
if (options?.limit === 1 && options?.path == null) {
|
|
915
|
+
return this.getCommitsCoreSingle(token, owner, repo, ref);
|
|
916
|
+
}
|
|
917
|
+
if (isRevisionRange(ref)) {
|
|
918
|
+
return this.getCommitsCoreRange(token, owner, repo, ref);
|
|
919
|
+
}
|
|
920
|
+
try {
|
|
921
|
+
const query = `query getCommits(
|
|
922
|
+
$owner: String!
|
|
923
|
+
$repo: String!
|
|
924
|
+
$ref: String!
|
|
925
|
+
$path: String
|
|
926
|
+
$author: CommitAuthor
|
|
927
|
+
$after: String
|
|
928
|
+
$before: String
|
|
929
|
+
$limit: Int = 100
|
|
930
|
+
$since: GitTimestamp
|
|
931
|
+
$until: GitTimestamp
|
|
932
|
+
) {
|
|
933
|
+
viewer { name }
|
|
934
|
+
repository(name: $repo, owner: $owner) {
|
|
935
|
+
object(expression: $ref) {
|
|
936
|
+
... on Commit {
|
|
937
|
+
history(first: $limit, author: $author, path: $path, after: $after, before: $before, since: $since, until: $until) {
|
|
938
|
+
pageInfo {
|
|
939
|
+
startCursor
|
|
940
|
+
endCursor
|
|
941
|
+
hasNextPage
|
|
942
|
+
hasPreviousPage
|
|
943
|
+
}
|
|
944
|
+
nodes {
|
|
945
|
+
... on Commit {
|
|
946
|
+
oid
|
|
947
|
+
message
|
|
948
|
+
parents(first: 3) { nodes { oid } }
|
|
949
|
+
additions
|
|
950
|
+
changedFiles
|
|
951
|
+
deletions
|
|
952
|
+
author {
|
|
953
|
+
avatarUrl
|
|
954
|
+
date
|
|
955
|
+
email
|
|
956
|
+
name
|
|
957
|
+
}
|
|
958
|
+
committer {
|
|
959
|
+
date
|
|
960
|
+
email
|
|
961
|
+
name
|
|
962
|
+
}
|
|
963
|
+
}
|
|
964
|
+
}
|
|
965
|
+
}
|
|
966
|
+
}
|
|
967
|
+
}
|
|
968
|
+
}
|
|
969
|
+
}`;
|
|
970
|
+
let authors;
|
|
971
|
+
if (options?.authors != null) {
|
|
972
|
+
if (options.authors.length === 1) {
|
|
973
|
+
const [author] = options.authors;
|
|
974
|
+
authors = {
|
|
975
|
+
id: author.id,
|
|
976
|
+
emails: author.email ? [author.email] : undefined,
|
|
977
|
+
};
|
|
978
|
+
}
|
|
979
|
+
else {
|
|
980
|
+
const emails = options.authors.filter(a => a.email).map(a => a.email);
|
|
981
|
+
authors = emails.length ? { emails: emails } : undefined;
|
|
982
|
+
}
|
|
983
|
+
}
|
|
984
|
+
const rsp = await this.graphql(undefined, token, query, {
|
|
985
|
+
owner: owner,
|
|
986
|
+
repo: repo,
|
|
987
|
+
ref: ref,
|
|
988
|
+
after: options?.after,
|
|
989
|
+
before: options?.before,
|
|
990
|
+
path: options?.path,
|
|
991
|
+
author: authors,
|
|
992
|
+
limit: Math.min(100, options?.limit ?? 100),
|
|
993
|
+
since: typeof options?.since === 'string' ? options?.since : options?.since?.toISOString(),
|
|
994
|
+
until: typeof options?.until === 'string' ? options?.until : options?.until?.toISOString(),
|
|
995
|
+
}, scope);
|
|
996
|
+
const history = rsp?.repository?.object?.history;
|
|
997
|
+
if (history == null)
|
|
998
|
+
return emptyPagedResult;
|
|
999
|
+
return {
|
|
1000
|
+
paging: history.pageInfo.endCursor != null
|
|
1001
|
+
? {
|
|
1002
|
+
cursor: history.pageInfo.endCursor ?? undefined,
|
|
1003
|
+
more: history.pageInfo.hasNextPage,
|
|
1004
|
+
}
|
|
1005
|
+
: undefined,
|
|
1006
|
+
values: history.nodes,
|
|
1007
|
+
viewer: rsp?.viewer.name,
|
|
1008
|
+
};
|
|
1009
|
+
}
|
|
1010
|
+
catch (ex) {
|
|
1011
|
+
if (ex instanceof RequestNotFoundError)
|
|
1012
|
+
return emptyPagedResult;
|
|
1013
|
+
throw this.handleException(ex, undefined, scope);
|
|
1014
|
+
}
|
|
1015
|
+
}
|
|
1016
|
+
async getCommitsCoreRange(token, owner, repo, range) {
|
|
1017
|
+
const scope = getScopedLogger();
|
|
1018
|
+
try {
|
|
1019
|
+
const result = await this.getComparison(token, owner, repo, range);
|
|
1020
|
+
if (result == null)
|
|
1021
|
+
return emptyPagedResult;
|
|
1022
|
+
return {
|
|
1023
|
+
values: result.commits
|
|
1024
|
+
?.map(r => ({
|
|
1025
|
+
oid: r.sha,
|
|
1026
|
+
parents: { nodes: r.parents.map(p => ({ oid: p.sha })) },
|
|
1027
|
+
message: r.commit.message,
|
|
1028
|
+
author: {
|
|
1029
|
+
avatarUrl: r.author?.avatar_url ?? undefined,
|
|
1030
|
+
date: r.commit.author?.date ?? r.commit.committer?.date ?? new Date().toString(),
|
|
1031
|
+
email: r.author?.email ?? r.commit.author?.email ?? undefined,
|
|
1032
|
+
name: r.author?.name ?? r.commit.author?.name ?? '',
|
|
1033
|
+
},
|
|
1034
|
+
committer: {
|
|
1035
|
+
date: r.commit.committer?.date ?? new Date().toString(),
|
|
1036
|
+
email: r.committer?.email ?? r.commit.committer?.email ?? undefined,
|
|
1037
|
+
name: r.committer?.name ?? r.commit.committer?.name ?? '',
|
|
1038
|
+
},
|
|
1039
|
+
}))
|
|
1040
|
+
.reverse(),
|
|
1041
|
+
};
|
|
1042
|
+
}
|
|
1043
|
+
catch (ex) {
|
|
1044
|
+
if (ex instanceof RequestNotFoundError)
|
|
1045
|
+
return emptyPagedResult;
|
|
1046
|
+
throw this.handleException(ex, undefined, scope);
|
|
1047
|
+
}
|
|
1048
|
+
}
|
|
1049
|
+
async getCommitsCoreSingle(token, owner, repo, ref) {
|
|
1050
|
+
const scope = getScopedLogger();
|
|
1051
|
+
try {
|
|
1052
|
+
const query = `query getCommit(
|
|
1053
|
+
$owner: String!
|
|
1054
|
+
$repo: String!
|
|
1055
|
+
$ref: String!
|
|
1056
|
+
) {
|
|
1057
|
+
viewer { name }
|
|
1058
|
+
repository(name: $repo owner: $owner) {
|
|
1059
|
+
object(expression: $ref) {
|
|
1060
|
+
...on Commit {
|
|
1061
|
+
oid
|
|
1062
|
+
parents(first: 3) { nodes { oid } }
|
|
1063
|
+
message
|
|
1064
|
+
additions
|
|
1065
|
+
changedFiles
|
|
1066
|
+
deletions
|
|
1067
|
+
author {
|
|
1068
|
+
avatarUrl
|
|
1069
|
+
date
|
|
1070
|
+
email
|
|
1071
|
+
name
|
|
1072
|
+
}
|
|
1073
|
+
committer {
|
|
1074
|
+
date
|
|
1075
|
+
email
|
|
1076
|
+
name
|
|
1077
|
+
}
|
|
1078
|
+
}
|
|
1079
|
+
}
|
|
1080
|
+
}
|
|
1081
|
+
}`;
|
|
1082
|
+
const rsp = await this.graphql(undefined, token, query, {
|
|
1083
|
+
owner: owner,
|
|
1084
|
+
repo: repo,
|
|
1085
|
+
ref: ref,
|
|
1086
|
+
}, scope);
|
|
1087
|
+
if (rsp == null)
|
|
1088
|
+
return emptyPagedResult;
|
|
1089
|
+
const commit = rsp.repository?.object;
|
|
1090
|
+
return commit != null ? { values: [commit], viewer: rsp.viewer.name } : emptyPagedResult;
|
|
1091
|
+
}
|
|
1092
|
+
catch (ex) {
|
|
1093
|
+
if (ex instanceof RequestNotFoundError)
|
|
1094
|
+
return emptyPagedResult;
|
|
1095
|
+
throw this.handleException(ex, undefined, scope);
|
|
1096
|
+
}
|
|
1097
|
+
}
|
|
1098
|
+
async getCommitRefs(token, owner, repo, ref, options) {
|
|
1099
|
+
const scope = getScopedLogger();
|
|
1100
|
+
try {
|
|
1101
|
+
const query = `query getCommitRefs(
|
|
1102
|
+
$owner: String!
|
|
1103
|
+
$repo: String!
|
|
1104
|
+
$ref: String!
|
|
1105
|
+
$after: String
|
|
1106
|
+
$before: String
|
|
1107
|
+
$first: Int
|
|
1108
|
+
$last: Int
|
|
1109
|
+
$path: String
|
|
1110
|
+
$since: GitTimestamp
|
|
1111
|
+
$until: GitTimestamp
|
|
1112
|
+
) {
|
|
1113
|
+
repository(name: $repo, owner: $owner) {
|
|
1114
|
+
object(expression: $ref) {
|
|
1115
|
+
... on Commit {
|
|
1116
|
+
history(first: $first, last: $last, path: $path, since: $since, until: $until, after: $after, before: $before) {
|
|
1117
|
+
pageInfo { startCursor, endCursor, hasNextPage, hasPreviousPage }
|
|
1118
|
+
totalCount
|
|
1119
|
+
nodes { oid }
|
|
1120
|
+
}
|
|
1121
|
+
}
|
|
1122
|
+
}
|
|
1123
|
+
}
|
|
1124
|
+
}`;
|
|
1125
|
+
const rsp = await this.graphql(undefined, token, query, {
|
|
1126
|
+
owner: owner,
|
|
1127
|
+
repo: repo,
|
|
1128
|
+
ref: ref,
|
|
1129
|
+
path: options?.path,
|
|
1130
|
+
first: options?.first,
|
|
1131
|
+
last: options?.last,
|
|
1132
|
+
after: options?.after,
|
|
1133
|
+
before: options?.before,
|
|
1134
|
+
since: options?.since,
|
|
1135
|
+
until: options?.until,
|
|
1136
|
+
}, scope);
|
|
1137
|
+
const history = rsp?.repository?.object?.history;
|
|
1138
|
+
if (history == null)
|
|
1139
|
+
return undefined;
|
|
1140
|
+
return {
|
|
1141
|
+
pageInfo: history.pageInfo,
|
|
1142
|
+
totalCount: history.totalCount,
|
|
1143
|
+
values: history.nodes,
|
|
1144
|
+
};
|
|
1145
|
+
}
|
|
1146
|
+
catch (ex) {
|
|
1147
|
+
if (ex instanceof RequestNotFoundError)
|
|
1148
|
+
return undefined;
|
|
1149
|
+
throw this.handleException(ex, undefined, scope);
|
|
1150
|
+
}
|
|
1151
|
+
}
|
|
1152
|
+
async getTagsWithCommit(token, owner, repo, ref, date) {
|
|
1153
|
+
const scope = getScopedLogger();
|
|
1154
|
+
try {
|
|
1155
|
+
const query = `query getTagsWithCommit(
|
|
1156
|
+
$owner: String!
|
|
1157
|
+
$repo: String!
|
|
1158
|
+
$since: GitTimestamp!
|
|
1159
|
+
$until: GitTimestamp!
|
|
1160
|
+
) {
|
|
1161
|
+
repository(owner: $owner, name: $repo) {
|
|
1162
|
+
refs(first: 20, refPrefix: "refs/tags/") {
|
|
1163
|
+
nodes {
|
|
1164
|
+
name
|
|
1165
|
+
target {
|
|
1166
|
+
... on Commit {
|
|
1167
|
+
history(first: 3, since: $since until: $until) {
|
|
1168
|
+
nodes { oid }
|
|
1169
|
+
}
|
|
1170
|
+
}
|
|
1171
|
+
}
|
|
1172
|
+
}
|
|
1173
|
+
}
|
|
1174
|
+
}
|
|
1175
|
+
}`;
|
|
1176
|
+
const rsp = await this.graphql(undefined, token, query, {
|
|
1177
|
+
owner: owner,
|
|
1178
|
+
repo: repo,
|
|
1179
|
+
since: date.toISOString(),
|
|
1180
|
+
until: date.toISOString(),
|
|
1181
|
+
}, scope);
|
|
1182
|
+
const nodes = rsp?.repository?.refs?.nodes;
|
|
1183
|
+
if (nodes == null)
|
|
1184
|
+
return [];
|
|
1185
|
+
const tags = [];
|
|
1186
|
+
for (const tag of nodes) {
|
|
1187
|
+
for (const commit of tag.target.history.nodes) {
|
|
1188
|
+
if (commit.oid === ref) {
|
|
1189
|
+
tags.push(tag.name);
|
|
1190
|
+
break;
|
|
1191
|
+
}
|
|
1192
|
+
}
|
|
1193
|
+
}
|
|
1194
|
+
return tags;
|
|
1195
|
+
}
|
|
1196
|
+
catch (ex) {
|
|
1197
|
+
if (ex instanceof RequestNotFoundError)
|
|
1198
|
+
return [];
|
|
1199
|
+
throw this.handleException(ex, undefined, scope);
|
|
1200
|
+
}
|
|
1201
|
+
}
|
|
1202
|
+
async getNextCommitRefs(token, owner, repo, ref, path, sha) {
|
|
1203
|
+
// Get the commit date of the current commit
|
|
1204
|
+
const commitDate = await this.getCommitDate(token, owner, repo, sha);
|
|
1205
|
+
if (commitDate == null)
|
|
1206
|
+
return [];
|
|
1207
|
+
// Get a resultset (just need the cursor and totals), to get the page info we need to construct a cursor to page backwards
|
|
1208
|
+
let result = await this.getCommitRefs(token, owner, repo, ref, { path: path, first: 1, since: commitDate });
|
|
1209
|
+
if (result == null)
|
|
1210
|
+
return [];
|
|
1211
|
+
// Construct a cursor to allow use to walk backwards in time (starting at the tip going back in time until the commit date)
|
|
1212
|
+
const cursor = `${result.pageInfo.startCursor.split(' ', 1)[0]} ${result.totalCount}`;
|
|
1213
|
+
let last;
|
|
1214
|
+
[, last] = cursor.split(' ', 2);
|
|
1215
|
+
// We can't ask for more commits than are left in the cursor (but try to get more to be safe, since the date isn't exact enough)
|
|
1216
|
+
last = Math.min(parseInt(last, 10), 5);
|
|
1217
|
+
// Get the set of refs before the cursor
|
|
1218
|
+
result = await this.getCommitRefs(token, owner, repo, ref, { path: path, last: last, before: cursor });
|
|
1219
|
+
if (result == null)
|
|
1220
|
+
return [];
|
|
1221
|
+
const nexts = [];
|
|
1222
|
+
for (const { oid } of result.values) {
|
|
1223
|
+
if (oid === sha)
|
|
1224
|
+
break;
|
|
1225
|
+
nexts.push(oid);
|
|
1226
|
+
}
|
|
1227
|
+
return nexts.reverse();
|
|
1228
|
+
}
|
|
1229
|
+
async getCommitDate(token, owner, repo, sha) {
|
|
1230
|
+
const scope = getScopedLogger();
|
|
1231
|
+
try {
|
|
1232
|
+
const query = `query getCommitDate(
|
|
1233
|
+
$owner: String!
|
|
1234
|
+
$repo: String!
|
|
1235
|
+
$sha: GitObjectID!
|
|
1236
|
+
) {
|
|
1237
|
+
repository(name: $repo, owner: $owner) {
|
|
1238
|
+
object(oid: $sha) {
|
|
1239
|
+
... on Commit { committer { date } }
|
|
1240
|
+
}
|
|
1241
|
+
}
|
|
1242
|
+
}`;
|
|
1243
|
+
const rsp = await this.graphql(undefined, token, query, {
|
|
1244
|
+
owner: owner,
|
|
1245
|
+
repo: repo,
|
|
1246
|
+
sha: sha,
|
|
1247
|
+
}, scope);
|
|
1248
|
+
const date = rsp?.repository?.object?.committer.date;
|
|
1249
|
+
return date;
|
|
1250
|
+
}
|
|
1251
|
+
catch (ex) {
|
|
1252
|
+
if (ex instanceof RequestNotFoundError)
|
|
1253
|
+
return undefined;
|
|
1254
|
+
throw this.handleException(ex, undefined, scope);
|
|
1255
|
+
}
|
|
1256
|
+
}
|
|
1257
|
+
async getContributors(token, owner, repo) {
|
|
1258
|
+
const scope = getScopedLogger();
|
|
1259
|
+
// TODO@eamodio implement pagination
|
|
1260
|
+
try {
|
|
1261
|
+
const rsp = await this.request(undefined, token, 'GET /repos/{owner}/{repo}/contributors', {
|
|
1262
|
+
owner: owner,
|
|
1263
|
+
repo: repo,
|
|
1264
|
+
per_page: 100,
|
|
1265
|
+
}, scope);
|
|
1266
|
+
const result = rsp?.data;
|
|
1267
|
+
if (result == null)
|
|
1268
|
+
return [];
|
|
1269
|
+
return rsp.data;
|
|
1270
|
+
}
|
|
1271
|
+
catch (ex) {
|
|
1272
|
+
if (ex instanceof RequestNotFoundError)
|
|
1273
|
+
return [];
|
|
1274
|
+
throw this.handleException(ex, undefined, scope);
|
|
1275
|
+
}
|
|
1276
|
+
}
|
|
1277
|
+
async getDefaultBranchName(token, owner, repo) {
|
|
1278
|
+
const scope = getScopedLogger();
|
|
1279
|
+
try {
|
|
1280
|
+
const query = `query getDefaultBranch(
|
|
1281
|
+
$owner: String!
|
|
1282
|
+
$repo: String!
|
|
1283
|
+
) {
|
|
1284
|
+
repository(owner: $owner, name: $repo) {
|
|
1285
|
+
defaultBranchRef {
|
|
1286
|
+
name
|
|
1287
|
+
}
|
|
1288
|
+
}
|
|
1289
|
+
}`;
|
|
1290
|
+
const rsp = await this.graphql(undefined, token, query, {
|
|
1291
|
+
owner: owner,
|
|
1292
|
+
repo: repo,
|
|
1293
|
+
}, scope);
|
|
1294
|
+
if (rsp == null)
|
|
1295
|
+
return undefined;
|
|
1296
|
+
return rsp.repository?.defaultBranchRef?.name ?? undefined;
|
|
1297
|
+
}
|
|
1298
|
+
catch (ex) {
|
|
1299
|
+
if (ex instanceof RequestNotFoundError)
|
|
1300
|
+
return undefined;
|
|
1301
|
+
throw this.handleException(ex, undefined, scope);
|
|
1302
|
+
}
|
|
1303
|
+
}
|
|
1304
|
+
async getCurrentUser(token, owner, repo) {
|
|
1305
|
+
const scope = getScopedLogger();
|
|
1306
|
+
try {
|
|
1307
|
+
const query = `query getCurrentUser(
|
|
1308
|
+
$owner: String!
|
|
1309
|
+
$repo: String!
|
|
1310
|
+
) {
|
|
1311
|
+
viewer { name, email, login, id }
|
|
1312
|
+
repository(owner: $owner, name: $repo) { viewerPermission }
|
|
1313
|
+
}`;
|
|
1314
|
+
const rsp = await this.graphql(undefined, token, query, {
|
|
1315
|
+
owner: owner,
|
|
1316
|
+
repo: repo,
|
|
1317
|
+
}, scope);
|
|
1318
|
+
if (rsp == null)
|
|
1319
|
+
return undefined;
|
|
1320
|
+
return {
|
|
1321
|
+
name: rsp.viewer?.name,
|
|
1322
|
+
email: rsp.viewer?.email,
|
|
1323
|
+
username: rsp.viewer?.login,
|
|
1324
|
+
id: rsp.viewer?.id,
|
|
1325
|
+
};
|
|
1326
|
+
}
|
|
1327
|
+
catch (ex) {
|
|
1328
|
+
if (ex instanceof RequestNotFoundError)
|
|
1329
|
+
return undefined;
|
|
1330
|
+
throw this.handleException(ex, undefined, scope);
|
|
1331
|
+
}
|
|
1332
|
+
}
|
|
1333
|
+
async getComparison(token, owner, repo, range) {
|
|
1334
|
+
const scope = getScopedLogger();
|
|
1335
|
+
if (!isRevisionRange(range, 'qualified-triple-dot')) {
|
|
1336
|
+
// GitHub doesn't support the `..` range notation, so convert it to `...` since it will work for many of our usages
|
|
1337
|
+
const parts = getRevisionRangeParts(range);
|
|
1338
|
+
range = createRevisionRange(parts?.left || 'HEAD', parts?.right || 'HEAD', '...');
|
|
1339
|
+
}
|
|
1340
|
+
try {
|
|
1341
|
+
const rsp = await this.request(undefined, token, 'GET /repos/{owner}/{repo}/compare/{basehead}', {
|
|
1342
|
+
owner: owner,
|
|
1343
|
+
repo: repo,
|
|
1344
|
+
basehead: range,
|
|
1345
|
+
}, scope);
|
|
1346
|
+
const result = rsp?.data;
|
|
1347
|
+
if (result == null)
|
|
1348
|
+
return undefined;
|
|
1349
|
+
return result;
|
|
1350
|
+
}
|
|
1351
|
+
catch (ex) {
|
|
1352
|
+
if (ex instanceof RequestNotFoundError)
|
|
1353
|
+
return undefined;
|
|
1354
|
+
throw this.handleException(ex, undefined, scope);
|
|
1355
|
+
}
|
|
1356
|
+
}
|
|
1357
|
+
async getRepositoryVisibility(token, owner, repo) {
|
|
1358
|
+
const scope = getScopedLogger();
|
|
1359
|
+
try {
|
|
1360
|
+
const query = `query getRepositoryVisibility(
|
|
1361
|
+
$owner: String!
|
|
1362
|
+
$repo: String!
|
|
1363
|
+
) {
|
|
1364
|
+
repository(owner: $owner, name: $repo) {
|
|
1365
|
+
visibility
|
|
1366
|
+
}
|
|
1367
|
+
}`;
|
|
1368
|
+
const rsp = await this.graphql(undefined, token, query, {
|
|
1369
|
+
owner: owner,
|
|
1370
|
+
repo: repo,
|
|
1371
|
+
}, scope);
|
|
1372
|
+
if (rsp?.repository?.visibility == null)
|
|
1373
|
+
return undefined;
|
|
1374
|
+
return rsp.repository.visibility === 'PUBLIC' ? 'public' : 'private';
|
|
1375
|
+
}
|
|
1376
|
+
catch (ex) {
|
|
1377
|
+
if (ex instanceof RequestNotFoundError)
|
|
1378
|
+
return undefined;
|
|
1379
|
+
throw this.handleException(ex, undefined, scope);
|
|
1380
|
+
}
|
|
1381
|
+
}
|
|
1382
|
+
async getTags(token, owner, repo, options) {
|
|
1383
|
+
const scope = getScopedLogger();
|
|
1384
|
+
try {
|
|
1385
|
+
const query = `query getTags(
|
|
1386
|
+
$owner: String!
|
|
1387
|
+
$repo: String!
|
|
1388
|
+
$tagQuery: String
|
|
1389
|
+
$cursor: String
|
|
1390
|
+
$limit: Int = 100
|
|
1391
|
+
) {
|
|
1392
|
+
repository(owner: $owner, name: $repo) {
|
|
1393
|
+
refs(query: $tagQuery, refPrefix: "refs/tags/", first: $limit, after: $cursor, orderBy: { field: TAG_COMMIT_DATE, direction: DESC }) {
|
|
1394
|
+
pageInfo {
|
|
1395
|
+
endCursor
|
|
1396
|
+
hasNextPage
|
|
1397
|
+
}
|
|
1398
|
+
nodes {
|
|
1399
|
+
name
|
|
1400
|
+
target {
|
|
1401
|
+
oid
|
|
1402
|
+
...on Tag {
|
|
1403
|
+
message
|
|
1404
|
+
tagger { date }
|
|
1405
|
+
target {
|
|
1406
|
+
...on Commit {
|
|
1407
|
+
oid
|
|
1408
|
+
authoredDate
|
|
1409
|
+
committedDate
|
|
1410
|
+
message
|
|
1411
|
+
}
|
|
1412
|
+
}
|
|
1413
|
+
}
|
|
1414
|
+
}
|
|
1415
|
+
}
|
|
1416
|
+
}
|
|
1417
|
+
}
|
|
1418
|
+
}`;
|
|
1419
|
+
const rsp = await this.graphql(undefined, token, query, {
|
|
1420
|
+
owner: owner,
|
|
1421
|
+
repo: repo,
|
|
1422
|
+
tagQuery: options?.query,
|
|
1423
|
+
cursor: options?.cursor,
|
|
1424
|
+
limit: Math.min(100, options?.limit ?? 100),
|
|
1425
|
+
}, scope);
|
|
1426
|
+
if (rsp == null)
|
|
1427
|
+
return emptyPagedResult;
|
|
1428
|
+
const refs = rsp.repository?.refs;
|
|
1429
|
+
if (refs == null)
|
|
1430
|
+
return emptyPagedResult;
|
|
1431
|
+
return {
|
|
1432
|
+
paging: {
|
|
1433
|
+
cursor: refs.pageInfo.endCursor,
|
|
1434
|
+
more: refs.pageInfo.hasNextPage,
|
|
1435
|
+
},
|
|
1436
|
+
values: refs.nodes,
|
|
1437
|
+
};
|
|
1438
|
+
}
|
|
1439
|
+
catch (ex) {
|
|
1440
|
+
if (ex instanceof RequestNotFoundError)
|
|
1441
|
+
return emptyPagedResult;
|
|
1442
|
+
throw this.handleException(ex, undefined, scope);
|
|
1443
|
+
}
|
|
1444
|
+
}
|
|
1445
|
+
async resolveReference(token, owner, repo, ref, path) {
|
|
1446
|
+
const scope = getScopedLogger();
|
|
1447
|
+
try {
|
|
1448
|
+
if (!path) {
|
|
1449
|
+
const query = `query resolveReference(
|
|
1450
|
+
$owner: String!
|
|
1451
|
+
$repo: String!
|
|
1452
|
+
$ref: String!
|
|
1453
|
+
) {
|
|
1454
|
+
repository(owner: $owner, name: $repo) {
|
|
1455
|
+
object(expression: $ref) {
|
|
1456
|
+
oid
|
|
1457
|
+
}
|
|
1458
|
+
}
|
|
1459
|
+
}`;
|
|
1460
|
+
const rsp = await this.graphql(undefined, token, query, {
|
|
1461
|
+
owner: owner,
|
|
1462
|
+
repo: repo,
|
|
1463
|
+
ref: ref,
|
|
1464
|
+
}, scope);
|
|
1465
|
+
return rsp?.repository?.object?.oid ?? undefined;
|
|
1466
|
+
}
|
|
1467
|
+
const query = `query resolveReference(
|
|
1468
|
+
$owner: String!
|
|
1469
|
+
$repo: String!
|
|
1470
|
+
$ref: String!
|
|
1471
|
+
$path: String!
|
|
1472
|
+
) {
|
|
1473
|
+
repository(owner: $owner, name: $repo) {
|
|
1474
|
+
object(expression: $ref) {
|
|
1475
|
+
... on Commit {
|
|
1476
|
+
history(first: 1, path: $path) {
|
|
1477
|
+
nodes { oid }
|
|
1478
|
+
}
|
|
1479
|
+
}
|
|
1480
|
+
}
|
|
1481
|
+
}
|
|
1482
|
+
}`;
|
|
1483
|
+
const rsp = await this.graphql(undefined, token, query, {
|
|
1484
|
+
owner: owner,
|
|
1485
|
+
repo: repo,
|
|
1486
|
+
ref: ref,
|
|
1487
|
+
path: path,
|
|
1488
|
+
}, scope);
|
|
1489
|
+
return rsp?.repository?.object?.history.nodes?.[0]?.oid ?? undefined;
|
|
1490
|
+
}
|
|
1491
|
+
catch (ex) {
|
|
1492
|
+
if (ex instanceof RequestNotFoundError)
|
|
1493
|
+
return undefined;
|
|
1494
|
+
throw this.handleException(ex, undefined, scope);
|
|
1495
|
+
}
|
|
1496
|
+
}
|
|
1497
|
+
async searchCommits(token, query, options) {
|
|
1498
|
+
const scope = getScopedLogger();
|
|
1499
|
+
const limit = Math.min(100, options?.limit ?? 100);
|
|
1500
|
+
let page;
|
|
1501
|
+
let pageSize;
|
|
1502
|
+
let previousCount;
|
|
1503
|
+
if (options?.cursor != null) {
|
|
1504
|
+
[page, pageSize, previousCount] = options.cursor.split(' ', 3);
|
|
1505
|
+
page = parseInt(page, 10);
|
|
1506
|
+
// TODO@eamodio need to figure out how allow different page sizes if the limit changes
|
|
1507
|
+
pageSize = parseInt(pageSize, 10);
|
|
1508
|
+
previousCount = parseInt(previousCount, 10);
|
|
1509
|
+
}
|
|
1510
|
+
else {
|
|
1511
|
+
page = 1;
|
|
1512
|
+
pageSize = limit;
|
|
1513
|
+
previousCount = 0;
|
|
1514
|
+
}
|
|
1515
|
+
try {
|
|
1516
|
+
const rsp = await this.request(undefined, token, 'GET /search/commits', {
|
|
1517
|
+
q: query,
|
|
1518
|
+
sort: options?.sort,
|
|
1519
|
+
order: options?.order,
|
|
1520
|
+
per_page: pageSize,
|
|
1521
|
+
page: page,
|
|
1522
|
+
}, scope);
|
|
1523
|
+
const data = rsp?.data;
|
|
1524
|
+
if (data == null || data.items.length === 0)
|
|
1525
|
+
return undefined;
|
|
1526
|
+
const commits = data.items.map(result => ({
|
|
1527
|
+
oid: result.sha,
|
|
1528
|
+
parents: { nodes: result.parents.map(p => ({ oid: p.sha })) },
|
|
1529
|
+
message: result.commit.message,
|
|
1530
|
+
author: {
|
|
1531
|
+
avatarUrl: result.author?.avatar_url ?? undefined,
|
|
1532
|
+
date: result.commit.author?.date ?? result.commit.committer?.date ?? new Date().toString(),
|
|
1533
|
+
email: result.author?.email ?? result.commit.author?.email ?? undefined,
|
|
1534
|
+
name: result.author?.name ?? result.commit.author?.name ?? '',
|
|
1535
|
+
},
|
|
1536
|
+
committer: {
|
|
1537
|
+
date: result.commit.committer?.date ?? result.committer?.date ?? new Date().toString(),
|
|
1538
|
+
email: result.committer?.email ?? result.commit.committer?.email ?? undefined,
|
|
1539
|
+
name: result.committer?.name ?? result.commit.committer?.name ?? '',
|
|
1540
|
+
},
|
|
1541
|
+
}));
|
|
1542
|
+
const count = previousCount + data.items.length;
|
|
1543
|
+
const hasMore = data.incomplete_results || data.total_count > count;
|
|
1544
|
+
return {
|
|
1545
|
+
pageInfo: {
|
|
1546
|
+
startCursor: `${page} ${pageSize} ${previousCount}`,
|
|
1547
|
+
endCursor: hasMore ? `${page + 1} ${pageSize} ${count}` : undefined,
|
|
1548
|
+
hasPreviousPage: data.total_count > 0 && page > 1,
|
|
1549
|
+
hasNextPage: hasMore,
|
|
1550
|
+
},
|
|
1551
|
+
totalCount: data.total_count,
|
|
1552
|
+
values: commits,
|
|
1553
|
+
};
|
|
1554
|
+
}
|
|
1555
|
+
catch (ex) {
|
|
1556
|
+
if (ex instanceof RequestNotFoundError)
|
|
1557
|
+
return undefined;
|
|
1558
|
+
throw this.handleException(ex, undefined, scope);
|
|
1559
|
+
}
|
|
1560
|
+
}
|
|
1561
|
+
async searchCommitShas(token, query, options) {
|
|
1562
|
+
const scope = getScopedLogger();
|
|
1563
|
+
const limit = Math.min(100, options?.limit ?? 100);
|
|
1564
|
+
let page;
|
|
1565
|
+
let pageSize;
|
|
1566
|
+
let previousCount;
|
|
1567
|
+
if (options?.cursor != null) {
|
|
1568
|
+
[page, pageSize, previousCount] = options.cursor.split(' ', 3);
|
|
1569
|
+
page = parseInt(page, 10);
|
|
1570
|
+
// TODO@eamodio need to figure out how allow different page sizes if the limit changes
|
|
1571
|
+
pageSize = parseInt(pageSize, 10);
|
|
1572
|
+
previousCount = parseInt(previousCount, 10);
|
|
1573
|
+
}
|
|
1574
|
+
else {
|
|
1575
|
+
page = 1;
|
|
1576
|
+
pageSize = limit;
|
|
1577
|
+
previousCount = 0;
|
|
1578
|
+
}
|
|
1579
|
+
try {
|
|
1580
|
+
const rsp = await this.request(undefined, token, 'GET /search/commits', {
|
|
1581
|
+
q: query,
|
|
1582
|
+
sort: options?.sort,
|
|
1583
|
+
order: options?.order,
|
|
1584
|
+
per_page: pageSize,
|
|
1585
|
+
page: page,
|
|
1586
|
+
}, scope);
|
|
1587
|
+
const data = rsp?.data;
|
|
1588
|
+
if (data == null || data.items.length === 0)
|
|
1589
|
+
return undefined;
|
|
1590
|
+
const count = previousCount + data.items.length;
|
|
1591
|
+
const hasMore = data.incomplete_results || data.total_count > count;
|
|
1592
|
+
return {
|
|
1593
|
+
pageInfo: {
|
|
1594
|
+
startCursor: `${page} ${pageSize} ${previousCount}`,
|
|
1595
|
+
endCursor: hasMore ? `${page + 1} ${pageSize} ${count}` : undefined,
|
|
1596
|
+
hasPreviousPage: data.total_count > 0 && page > 1,
|
|
1597
|
+
hasNextPage: hasMore,
|
|
1598
|
+
},
|
|
1599
|
+
totalCount: data.total_count,
|
|
1600
|
+
values: data.items.map(r => ({
|
|
1601
|
+
sha: r.sha,
|
|
1602
|
+
authorDate: new Date(r.commit.author.date).getTime(),
|
|
1603
|
+
committerDate: new Date(r.commit.committer?.date ?? r.commit.author.date).getTime(),
|
|
1604
|
+
})),
|
|
1605
|
+
};
|
|
1606
|
+
}
|
|
1607
|
+
catch (ex) {
|
|
1608
|
+
if (ex instanceof RequestNotFoundError)
|
|
1609
|
+
return undefined;
|
|
1610
|
+
throw this.handleException(ex, undefined, scope);
|
|
1611
|
+
}
|
|
1612
|
+
}
|
|
1613
|
+
_enterpriseVersions = new Map();
|
|
1614
|
+
async getEnterpriseVersion(provider, token, options) {
|
|
1615
|
+
const { accessToken } = token;
|
|
1616
|
+
let version = this._enterpriseVersions.get(accessToken);
|
|
1617
|
+
if (version != null)
|
|
1618
|
+
return version;
|
|
1619
|
+
if (version === null)
|
|
1620
|
+
return undefined;
|
|
1621
|
+
const scope = getScopedLogger();
|
|
1622
|
+
try {
|
|
1623
|
+
const rsp = await this.request(provider, token, 'GET /meta', options, scope);
|
|
1624
|
+
const v = rsp?.data?.installed_version;
|
|
1625
|
+
version = v ? fromString(v) : null;
|
|
1626
|
+
}
|
|
1627
|
+
catch (_ex) {
|
|
1628
|
+
debugger;
|
|
1629
|
+
version = null;
|
|
1630
|
+
}
|
|
1631
|
+
this._enterpriseVersions.set(accessToken, version);
|
|
1632
|
+
return version ?? undefined;
|
|
1633
|
+
}
|
|
1634
|
+
async graphql(provider, token, query, variables, scope, cancellation) {
|
|
1635
|
+
const { accessToken, ...tokenInfo } = token;
|
|
1636
|
+
try {
|
|
1637
|
+
let aborter;
|
|
1638
|
+
if (cancellation != null) {
|
|
1639
|
+
if (cancellation.isCancellationRequested)
|
|
1640
|
+
throw new CancellationError();
|
|
1641
|
+
aborter = new AbortController();
|
|
1642
|
+
cancellation.onCancellationRequested(() => aborter.abort());
|
|
1643
|
+
variables = {
|
|
1644
|
+
...variables,
|
|
1645
|
+
request: { ...variables?.request, signal: aborter.signal },
|
|
1646
|
+
};
|
|
1647
|
+
}
|
|
1648
|
+
return await this.config.wrapForForcedInsecureSSL(provider?.getIgnoreSSLErrors() ?? false, () => this.getDefaults(accessToken, graphql)(query, variables));
|
|
1649
|
+
}
|
|
1650
|
+
catch (ex) {
|
|
1651
|
+
if (ex instanceof GraphqlResponseError) {
|
|
1652
|
+
switch (ex.errors?.[0]?.type) {
|
|
1653
|
+
case 'NOT_FOUND':
|
|
1654
|
+
throw new RequestNotFoundError(ex);
|
|
1655
|
+
case 'FORBIDDEN':
|
|
1656
|
+
throw new AuthenticationError(tokenInfo, AuthenticationErrorReason.Forbidden, ex);
|
|
1657
|
+
case 'RATE_LIMITED': {
|
|
1658
|
+
let resetAt;
|
|
1659
|
+
const reset = ex.headers?.['x-ratelimit-reset'];
|
|
1660
|
+
if (reset != null) {
|
|
1661
|
+
resetAt = parseInt(reset, 10);
|
|
1662
|
+
if (Number.isNaN(resetAt)) {
|
|
1663
|
+
resetAt = undefined;
|
|
1664
|
+
}
|
|
1665
|
+
}
|
|
1666
|
+
throw new RequestRateLimitError(ex, accessToken, resetAt);
|
|
1667
|
+
}
|
|
1668
|
+
}
|
|
1669
|
+
if (Logger.isDebugging) {
|
|
1670
|
+
this.config.onDebugError?.(`GitHub request failed: ${ex.errors?.[0]?.message ?? ex.message}`);
|
|
1671
|
+
}
|
|
1672
|
+
}
|
|
1673
|
+
else if (ex instanceof RequestError || ex.name === 'AbortError') {
|
|
1674
|
+
this.handleRequestError(provider, token, ex, scope);
|
|
1675
|
+
}
|
|
1676
|
+
else if (Logger.isDebugging) {
|
|
1677
|
+
this.config.onDebugError?.(`GitHub request failed: ${ex.message}`);
|
|
1678
|
+
}
|
|
1679
|
+
throw ex;
|
|
1680
|
+
}
|
|
1681
|
+
}
|
|
1682
|
+
async request(provider, token, route, options, scope, cancellation) {
|
|
1683
|
+
const { accessToken } = token;
|
|
1684
|
+
try {
|
|
1685
|
+
if (cancellation != null) {
|
|
1686
|
+
if (cancellation.isCancellationRequested)
|
|
1687
|
+
throw new CancellationError();
|
|
1688
|
+
const aborter = new AbortController();
|
|
1689
|
+
cancellation.onCancellationRequested(() => aborter.abort());
|
|
1690
|
+
options = { ...options, request: { ...options?.request, signal: aborter.signal } };
|
|
1691
|
+
}
|
|
1692
|
+
return (await this.config.wrapForForcedInsecureSSL(provider?.getIgnoreSSLErrors() ?? false, () => this.getDefaults(accessToken, request)(route, options)));
|
|
1693
|
+
}
|
|
1694
|
+
catch (ex) {
|
|
1695
|
+
if (ex instanceof RequestError || ex.name === 'AbortError') {
|
|
1696
|
+
this.handleRequestError(provider, token, ex, scope);
|
|
1697
|
+
}
|
|
1698
|
+
else if (Logger.isDebugging) {
|
|
1699
|
+
this.config.onDebugError?.(`GitHub request failed: ${ex.message}`);
|
|
1700
|
+
}
|
|
1701
|
+
throw ex;
|
|
1702
|
+
}
|
|
1703
|
+
}
|
|
1704
|
+
_defaults = new Map();
|
|
1705
|
+
getDefaults(token, requestOrGraphQL) {
|
|
1706
|
+
let map = this._defaults.get(requestOrGraphQL);
|
|
1707
|
+
if (map == null) {
|
|
1708
|
+
map = new Map();
|
|
1709
|
+
this._defaults.set(requestOrGraphQL, map);
|
|
1710
|
+
}
|
|
1711
|
+
let defaults = map.get(token);
|
|
1712
|
+
if (defaults == null) {
|
|
1713
|
+
const configFetch = this.config.fetch;
|
|
1714
|
+
const configIsWeb = this.config.isWeb;
|
|
1715
|
+
defaults = requestOrGraphQL.defaults({
|
|
1716
|
+
headers: {
|
|
1717
|
+
authorization: `token ${token}`,
|
|
1718
|
+
},
|
|
1719
|
+
request: {
|
|
1720
|
+
fetch: configIsWeb
|
|
1721
|
+
? (url, options) => {
|
|
1722
|
+
if (options.headers != null) {
|
|
1723
|
+
// Strip out the user-agent (since it causes warnings in a webworker)
|
|
1724
|
+
const { 'user-agent': userAgent, ...headers } = options.headers;
|
|
1725
|
+
if (userAgent) {
|
|
1726
|
+
options.headers = headers;
|
|
1727
|
+
}
|
|
1728
|
+
}
|
|
1729
|
+
return configFetch(url, options);
|
|
1730
|
+
}
|
|
1731
|
+
: configFetch,
|
|
1732
|
+
hook: Logger.enabled('trace') || Logger.isDebugging
|
|
1733
|
+
? async (rqst, options) => {
|
|
1734
|
+
const sw = maybeStopWatch(`[GITHUB] ${options.method} ${options.url}`, {
|
|
1735
|
+
log: { onlyExit: true },
|
|
1736
|
+
});
|
|
1737
|
+
try {
|
|
1738
|
+
return await rqst(options);
|
|
1739
|
+
}
|
|
1740
|
+
finally {
|
|
1741
|
+
let message;
|
|
1742
|
+
try {
|
|
1743
|
+
if (typeof options.query === 'string') {
|
|
1744
|
+
const match = /(^[^({\n]+)/.exec(options.query);
|
|
1745
|
+
message = ` ${match?.[1].trim() ?? options.query}`;
|
|
1746
|
+
}
|
|
1747
|
+
}
|
|
1748
|
+
catch { }
|
|
1749
|
+
sw?.stop({ message: message });
|
|
1750
|
+
}
|
|
1751
|
+
}
|
|
1752
|
+
: undefined,
|
|
1753
|
+
},
|
|
1754
|
+
});
|
|
1755
|
+
map.set(token, defaults);
|
|
1756
|
+
}
|
|
1757
|
+
return defaults;
|
|
1758
|
+
}
|
|
1759
|
+
handleRequestError(provider, token, ex, scope) {
|
|
1760
|
+
if (ex.name === 'AbortError')
|
|
1761
|
+
throw new CancellationError(ex);
|
|
1762
|
+
const { accessToken, ...tokenInfo } = token;
|
|
1763
|
+
switch (ex.status) {
|
|
1764
|
+
case 404: // Not found
|
|
1765
|
+
case 410: // Gone
|
|
1766
|
+
case 422: // Unprocessable Entity
|
|
1767
|
+
throw new RequestNotFoundError(ex);
|
|
1768
|
+
// case 429: //Too Many Requests
|
|
1769
|
+
case 401: // Unauthorized
|
|
1770
|
+
throw new AuthenticationError(tokenInfo, AuthenticationErrorReason.Unauthorized, ex);
|
|
1771
|
+
case 403: // Forbidden
|
|
1772
|
+
if (ex.message.includes('rate limit')) {
|
|
1773
|
+
let resetAt;
|
|
1774
|
+
const reset = ex.response?.headers?.['x-ratelimit-reset'];
|
|
1775
|
+
if (reset != null) {
|
|
1776
|
+
resetAt = parseInt(reset, 10);
|
|
1777
|
+
if (Number.isNaN(resetAt)) {
|
|
1778
|
+
resetAt = undefined;
|
|
1779
|
+
}
|
|
1780
|
+
}
|
|
1781
|
+
throw new RequestRateLimitError(ex, accessToken, resetAt);
|
|
1782
|
+
}
|
|
1783
|
+
throw new AuthenticationError(tokenInfo, AuthenticationErrorReason.Forbidden, ex);
|
|
1784
|
+
case 500: // Internal Server Error
|
|
1785
|
+
scope?.error(ex);
|
|
1786
|
+
if (ex.response != null) {
|
|
1787
|
+
provider?.trackRequestException();
|
|
1788
|
+
this.config.onRequestError?.(provider, `${provider?.name ?? 'GitHub'} failed to respond and might be experiencing issues.${provider == null || provider.id === 'github'
|
|
1789
|
+
? ' Please visit the [GitHub status page](https://githubstatus.com) for more information.'
|
|
1790
|
+
: ''}`);
|
|
1791
|
+
}
|
|
1792
|
+
return;
|
|
1793
|
+
case 502: // Bad Gateway
|
|
1794
|
+
scope?.error(ex);
|
|
1795
|
+
// GitHub seems to return this status code for timeouts
|
|
1796
|
+
if (ex.message.includes('timeout')) {
|
|
1797
|
+
provider?.trackRequestException();
|
|
1798
|
+
this.config.onRequestError?.(provider, `${provider?.name ?? 'GitHub'} request timed out`);
|
|
1799
|
+
return;
|
|
1800
|
+
}
|
|
1801
|
+
break;
|
|
1802
|
+
case 503: // Service Unavailable
|
|
1803
|
+
scope?.error(ex);
|
|
1804
|
+
provider?.trackRequestException();
|
|
1805
|
+
this.config.onRequestError?.(provider, `${provider?.name ?? 'GitHub'} failed to respond and might be experiencing issues.${provider == null || provider.id === 'github'
|
|
1806
|
+
? ' Please visit the [GitHub status page](https://githubstatus.com) for more information.'
|
|
1807
|
+
: ''}`);
|
|
1808
|
+
return;
|
|
1809
|
+
default:
|
|
1810
|
+
if (ex.status >= 400 && ex.status < 500)
|
|
1811
|
+
throw new RequestClientError(ex);
|
|
1812
|
+
break;
|
|
1813
|
+
}
|
|
1814
|
+
scope?.error(ex);
|
|
1815
|
+
if (Logger.isDebugging) {
|
|
1816
|
+
this.config.onDebugError?.(`GitHub request failed: ${ex.response?.errors?.[0]?.message ?? ex.message}`);
|
|
1817
|
+
}
|
|
1818
|
+
}
|
|
1819
|
+
handleException(ex, provider, scope, silent) {
|
|
1820
|
+
scope?.error(ex);
|
|
1821
|
+
// debugger;
|
|
1822
|
+
if (ex instanceof AuthenticationError && !silent) {
|
|
1823
|
+
void this.showAuthenticationErrorMessage(ex, provider);
|
|
1824
|
+
}
|
|
1825
|
+
return ex;
|
|
1826
|
+
}
|
|
1827
|
+
async showAuthenticationErrorMessage(ex, provider) {
|
|
1828
|
+
if (ex.reason === AuthenticationErrorReason.Unauthorized || ex.reason === AuthenticationErrorReason.Forbidden) {
|
|
1829
|
+
const reauthenticated = await this.config.onAuthenticationFailure?.(ex, provider);
|
|
1830
|
+
if (reauthenticated) {
|
|
1831
|
+
this.resetCaches();
|
|
1832
|
+
this._onDidReauthenticate.fire();
|
|
1833
|
+
}
|
|
1834
|
+
}
|
|
1835
|
+
}
|
|
1836
|
+
async createEnterpriseAvatarUrl(provider, token, baseUrl, email, avatarSize) {
|
|
1837
|
+
avatarSize = avatarSize ?? 16;
|
|
1838
|
+
const { accessToken } = token;
|
|
1839
|
+
const version = await this.getEnterpriseVersion(provider, token, { baseUrl: baseUrl });
|
|
1840
|
+
if (satisfies(version, '>= 3.0.0')) {
|
|
1841
|
+
let url;
|
|
1842
|
+
const parts = getGitHubNoReplyAddressParts(email);
|
|
1843
|
+
if (parts != null) {
|
|
1844
|
+
if (parseUri(baseUrl).authority === parts.authority) {
|
|
1845
|
+
if (parts.userId != null) {
|
|
1846
|
+
url = `${baseUrl}/enterprise/avatars/u/${encodeURIComponent(parts.userId)}?s=${avatarSize}`;
|
|
1847
|
+
}
|
|
1848
|
+
else if (parts.login != null) {
|
|
1849
|
+
url = `${baseUrl}/enterprise/avatars/${encodeURIComponent(parts.login)}?s=${avatarSize}`;
|
|
1850
|
+
}
|
|
1851
|
+
}
|
|
1852
|
+
}
|
|
1853
|
+
url ??= `${baseUrl}/enterprise/avatars/u/e?email=${encodeURIComponent(email)}&s=${avatarSize}`;
|
|
1854
|
+
const configFetch = this.config.fetch;
|
|
1855
|
+
const rsp = await this.config.wrapForForcedInsecureSSL(provider?.getIgnoreSSLErrors() ?? false, () => configFetch(url, { method: 'GET', headers: { Authorization: `Bearer ${accessToken}` } }));
|
|
1856
|
+
if (rsp.ok) {
|
|
1857
|
+
const data = base64(new Uint8Array(await rsp.arrayBuffer()));
|
|
1858
|
+
const mimeType = rsp.headers.get('content-type');
|
|
1859
|
+
return `data:${mimeType};base64,${data}`;
|
|
1860
|
+
}
|
|
1861
|
+
}
|
|
1862
|
+
// The /u/e endpoint automatically falls back to gravatar if not found
|
|
1863
|
+
return `https://avatars.githubusercontent.com/u/e?email=${encodeURIComponent(email)}&s=${avatarSize}`;
|
|
1864
|
+
}
|
|
1865
|
+
async searchMyPullRequests(provider, token, options, cancellation) {
|
|
1866
|
+
const scope = getScopedLogger();
|
|
1867
|
+
const limit = Math.min(100, this.config.getLaunchpadQueryLimit?.() ?? 100);
|
|
1868
|
+
try {
|
|
1869
|
+
const query = `query searchMyPullRequests(
|
|
1870
|
+
$search: String!
|
|
1871
|
+
$avatarSize: Int
|
|
1872
|
+
) {
|
|
1873
|
+
search(first: ${limit}, query: $search, type: ISSUE) {
|
|
1874
|
+
issueCount
|
|
1875
|
+
nodes {
|
|
1876
|
+
...on PullRequest {
|
|
1877
|
+
${gqlPullRequestFragment}
|
|
1878
|
+
}
|
|
1879
|
+
}
|
|
1880
|
+
}
|
|
1881
|
+
viewer {
|
|
1882
|
+
login
|
|
1883
|
+
}
|
|
1884
|
+
}`;
|
|
1885
|
+
let search = options?.search?.trim() ?? '';
|
|
1886
|
+
if (options?.user) {
|
|
1887
|
+
search += ` user:${options.user}`;
|
|
1888
|
+
}
|
|
1889
|
+
if (options?.repos?.length) {
|
|
1890
|
+
search += ` repo:${options.repos.join(' repo:')}`;
|
|
1891
|
+
}
|
|
1892
|
+
// Hack for now, ultimately this should be passed in
|
|
1893
|
+
const ignoredRepos = this.config.getLaunchpadIgnoredRepositories?.() ?? [];
|
|
1894
|
+
if (ignoredRepos.length) {
|
|
1895
|
+
search += ` -repo:${ignoredRepos.join(' -repo:')}`;
|
|
1896
|
+
}
|
|
1897
|
+
// Hack for now, ultimately this should be passed in
|
|
1898
|
+
const enabledOrgs = this.config.getLaunchpadIncludedOrganizations?.() ?? [];
|
|
1899
|
+
if (enabledOrgs.length) {
|
|
1900
|
+
search += ` org:${enabledOrgs.join(' org:')}`;
|
|
1901
|
+
}
|
|
1902
|
+
else {
|
|
1903
|
+
// Hack for now, ultimately this should be passed in
|
|
1904
|
+
const ignoredOrgs = this.config.getLaunchpadIgnoredOrganizations?.() ?? [];
|
|
1905
|
+
if (ignoredOrgs.length) {
|
|
1906
|
+
search += ` -org:${ignoredOrgs.join(' -org:')}`;
|
|
1907
|
+
}
|
|
1908
|
+
}
|
|
1909
|
+
const rsp = await this.graphql(provider, token, query, {
|
|
1910
|
+
search: `is:open is:pr involves:@me archived:false ${search}`.trim(),
|
|
1911
|
+
baseUrl: options?.baseUrl,
|
|
1912
|
+
avatarSize: options?.avatarSize,
|
|
1913
|
+
}, scope, cancellation);
|
|
1914
|
+
if (rsp == null)
|
|
1915
|
+
return [];
|
|
1916
|
+
const viewer = rsp.viewer.login;
|
|
1917
|
+
function toQueryResult(pr) {
|
|
1918
|
+
const reasons = [];
|
|
1919
|
+
if (pr.author.login === viewer) {
|
|
1920
|
+
reasons.push('authored');
|
|
1921
|
+
}
|
|
1922
|
+
if (pr.assignees.nodes.some(a => a.login === viewer)) {
|
|
1923
|
+
reasons.push('assigned');
|
|
1924
|
+
}
|
|
1925
|
+
if (pr.reviewRequests.nodes.some(r => r.requestedReviewer?.login === viewer)) {
|
|
1926
|
+
reasons.push('review-requested');
|
|
1927
|
+
}
|
|
1928
|
+
if (reasons.length === 0) {
|
|
1929
|
+
reasons.push('mentioned');
|
|
1930
|
+
}
|
|
1931
|
+
return fromGitHubPullRequest(pr, provider);
|
|
1932
|
+
}
|
|
1933
|
+
const results = rsp.search.nodes.map(pr => toQueryResult(pr));
|
|
1934
|
+
return results;
|
|
1935
|
+
}
|
|
1936
|
+
catch (ex) {
|
|
1937
|
+
throw this.handleException(ex, provider, scope, options?.silent);
|
|
1938
|
+
}
|
|
1939
|
+
}
|
|
1940
|
+
async searchMyIssues(provider, token, options, cancellation) {
|
|
1941
|
+
const scope = getScopedLogger();
|
|
1942
|
+
const issueFragement = `${gqIssueFragment}${options?.includeBody
|
|
1943
|
+
? `
|
|
1944
|
+
body
|
|
1945
|
+
`
|
|
1946
|
+
: ''}`;
|
|
1947
|
+
const query = `query searchMyIssues(
|
|
1948
|
+
$authored: String!
|
|
1949
|
+
$assigned: String!
|
|
1950
|
+
$mentioned: String!
|
|
1951
|
+
$avatarSize: Int
|
|
1952
|
+
) {
|
|
1953
|
+
authored: search(first: 100, query: $authored, type: ISSUE) {
|
|
1954
|
+
nodes {
|
|
1955
|
+
... on Issue {
|
|
1956
|
+
${issueFragement}
|
|
1957
|
+
}
|
|
1958
|
+
}
|
|
1959
|
+
}
|
|
1960
|
+
assigned: search(first: 100, query: $assigned, type: ISSUE) {
|
|
1961
|
+
nodes {
|
|
1962
|
+
... on Issue {
|
|
1963
|
+
${issueFragement}
|
|
1964
|
+
}
|
|
1965
|
+
}
|
|
1966
|
+
}
|
|
1967
|
+
mentioned: search(first: 100, query: $mentioned, type: ISSUE) {
|
|
1968
|
+
nodes {
|
|
1969
|
+
... on Issue {
|
|
1970
|
+
${issueFragement}
|
|
1971
|
+
}
|
|
1972
|
+
}
|
|
1973
|
+
}
|
|
1974
|
+
}`;
|
|
1975
|
+
let search = options?.search?.trim() ?? '';
|
|
1976
|
+
if (options?.user) {
|
|
1977
|
+
search += ` user:${options.user}`;
|
|
1978
|
+
}
|
|
1979
|
+
if (options?.repos != null && options.repos.length > 0) {
|
|
1980
|
+
const repo = ' repo:';
|
|
1981
|
+
search += `${repo}${options.repos.join(repo)}`;
|
|
1982
|
+
}
|
|
1983
|
+
const baseFilters = 'type:issue is:open archived:false';
|
|
1984
|
+
try {
|
|
1985
|
+
const rsp = await this.graphql(provider, token, query, {
|
|
1986
|
+
authored: `${search} ${baseFilters} author:@me`.trim(),
|
|
1987
|
+
assigned: `${search} ${baseFilters} assignee:@me`.trim(),
|
|
1988
|
+
mentioned: `${search} ${baseFilters} mentions:@me`.trim(),
|
|
1989
|
+
baseUrl: options?.baseUrl,
|
|
1990
|
+
avatarSize: options?.avatarSize,
|
|
1991
|
+
}, scope, cancellation);
|
|
1992
|
+
function toQueryResult(issue) {
|
|
1993
|
+
return fromGitHubIssue(issue, provider);
|
|
1994
|
+
}
|
|
1995
|
+
if (rsp == null)
|
|
1996
|
+
return [];
|
|
1997
|
+
const results = uniqueBy([...rsp.assigned.nodes, ...rsp.mentioned.nodes, ...rsp.authored.nodes].map(toQueryResult), r => r.url, (original, _current) => original);
|
|
1998
|
+
return [...results];
|
|
1999
|
+
}
|
|
2000
|
+
catch (ex) {
|
|
2001
|
+
throw this.handleException(ex, provider, scope);
|
|
2002
|
+
}
|
|
2003
|
+
}
|
|
2004
|
+
async searchPullRequests(provider, token, options, cancellation) {
|
|
2005
|
+
const scope = getScopedLogger();
|
|
2006
|
+
try {
|
|
2007
|
+
const query = `query searchPullRequests(
|
|
2008
|
+
$searchQuery: String!
|
|
2009
|
+
$avatarSize: Int
|
|
2010
|
+
) {
|
|
2011
|
+
search(first: 10, query: $searchQuery, type: ISSUE) {
|
|
2012
|
+
nodes {
|
|
2013
|
+
...on PullRequest {
|
|
2014
|
+
${gqlPullRequestFragment}
|
|
2015
|
+
}
|
|
2016
|
+
}
|
|
2017
|
+
}
|
|
2018
|
+
}`;
|
|
2019
|
+
let search = options?.search?.trim() ?? '';
|
|
2020
|
+
if (options?.user) {
|
|
2021
|
+
search += ` user:${options.user}`;
|
|
2022
|
+
}
|
|
2023
|
+
if (options?.repos != null && options.repos.length > 0) {
|
|
2024
|
+
const repo = ' repo:';
|
|
2025
|
+
search += `${repo}${options.repos.join(repo)}`;
|
|
2026
|
+
}
|
|
2027
|
+
const rsp = await this.graphql(provider, token, query, {
|
|
2028
|
+
searchQuery: `is:pr is:open archived:false ${search.trim()}`,
|
|
2029
|
+
baseUrl: options?.baseUrl,
|
|
2030
|
+
avatarSize: options?.avatarSize,
|
|
2031
|
+
}, scope, cancellation);
|
|
2032
|
+
if (rsp == null)
|
|
2033
|
+
return [];
|
|
2034
|
+
const results = rsp.search.nodes.map(pr => fromGitHubPullRequest(pr, provider));
|
|
2035
|
+
return results;
|
|
2036
|
+
}
|
|
2037
|
+
catch (ex) {
|
|
2038
|
+
throw this.handleException(ex, provider, scope);
|
|
2039
|
+
}
|
|
2040
|
+
}
|
|
2041
|
+
async mergePullRequest(provider, token, nodeId, expectedSourceSha, options, cancellation) {
|
|
2042
|
+
const scope = getScopedLogger();
|
|
2043
|
+
let githubMergeStrategy;
|
|
2044
|
+
switch (options?.mergeMethod) {
|
|
2045
|
+
case PullRequestMergeMethod.Merge: {
|
|
2046
|
+
githubMergeStrategy = 'MERGE';
|
|
2047
|
+
break;
|
|
2048
|
+
}
|
|
2049
|
+
case PullRequestMergeMethod.Rebase: {
|
|
2050
|
+
githubMergeStrategy = 'REBASE';
|
|
2051
|
+
break;
|
|
2052
|
+
}
|
|
2053
|
+
case PullRequestMergeMethod.Squash: {
|
|
2054
|
+
githubMergeStrategy = 'SQUASH';
|
|
2055
|
+
break;
|
|
2056
|
+
}
|
|
2057
|
+
}
|
|
2058
|
+
try {
|
|
2059
|
+
const query = `mutation mergePullRequest(
|
|
2060
|
+
$id: ID!
|
|
2061
|
+
$expectedSourceSha: GitObjectID!
|
|
2062
|
+
$mergeMethod: PullRequestMergeMethod
|
|
2063
|
+
) {
|
|
2064
|
+
mergePullRequest(input: { pullRequestId: $id, expectedHeadOid: $expectedSourceSha, mergeMethod: $mergeMethod }) {
|
|
2065
|
+
pullRequest {
|
|
2066
|
+
id
|
|
2067
|
+
}
|
|
2068
|
+
}
|
|
2069
|
+
}`;
|
|
2070
|
+
const rsp = await this.graphql(provider, token, query, {
|
|
2071
|
+
id: nodeId,
|
|
2072
|
+
expectedSourceSha: expectedSourceSha,
|
|
2073
|
+
mergeMethod: githubMergeStrategy,
|
|
2074
|
+
baseUrl: options?.baseUrl,
|
|
2075
|
+
}, scope, cancellation);
|
|
2076
|
+
return rsp?.pullRequest?.id === nodeId;
|
|
2077
|
+
}
|
|
2078
|
+
catch (ex) {
|
|
2079
|
+
throw this.handleException(ex, provider, scope);
|
|
2080
|
+
}
|
|
2081
|
+
}
|
|
2082
|
+
}
|
|
2083
|
+
__decorate([
|
|
2084
|
+
trace({
|
|
2085
|
+
args: (provider, token, owner, repo, rev) => ({
|
|
2086
|
+
provider: provider.name,
|
|
2087
|
+
token: `<token:${token.microHash}>`,
|
|
2088
|
+
owner: owner,
|
|
2089
|
+
repo: repo,
|
|
2090
|
+
rev: rev,
|
|
2091
|
+
}),
|
|
2092
|
+
})
|
|
2093
|
+
], GitHubApi.prototype, "getAccountForCommit", null);
|
|
2094
|
+
__decorate([
|
|
2095
|
+
trace({
|
|
2096
|
+
args: (provider, token, owner, repo, email) => ({
|
|
2097
|
+
provider: provider.name,
|
|
2098
|
+
token: `<token:${token.microHash}>`,
|
|
2099
|
+
owner: owner,
|
|
2100
|
+
repo: repo,
|
|
2101
|
+
email: email,
|
|
2102
|
+
}),
|
|
2103
|
+
})
|
|
2104
|
+
], GitHubApi.prototype, "getAccountForEmail", null);
|
|
2105
|
+
__decorate([
|
|
2106
|
+
trace({
|
|
2107
|
+
args: (provider, token, owner, repo) => ({
|
|
2108
|
+
provider: provider.name,
|
|
2109
|
+
token: `<token:${token.microHash}>`,
|
|
2110
|
+
owner: owner,
|
|
2111
|
+
repo: repo,
|
|
2112
|
+
}),
|
|
2113
|
+
})
|
|
2114
|
+
], GitHubApi.prototype, "getDefaultBranch", null);
|
|
2115
|
+
__decorate([
|
|
2116
|
+
trace({
|
|
2117
|
+
args: (provider, token, owner, repo, number) => ({
|
|
2118
|
+
provider: provider.name,
|
|
2119
|
+
token: `<token:${token.microHash}>`,
|
|
2120
|
+
owner: owner,
|
|
2121
|
+
repo: repo,
|
|
2122
|
+
number: number,
|
|
2123
|
+
}),
|
|
2124
|
+
})
|
|
2125
|
+
], GitHubApi.prototype, "getIssueOrPullRequest", null);
|
|
2126
|
+
__decorate([
|
|
2127
|
+
trace({
|
|
2128
|
+
args: (provider, token, owner, repo, number) => ({
|
|
2129
|
+
provider: provider.name,
|
|
2130
|
+
token: `<token:${token.microHash}>`,
|
|
2131
|
+
owner: owner,
|
|
2132
|
+
repo: repo,
|
|
2133
|
+
number: number,
|
|
2134
|
+
}),
|
|
2135
|
+
})
|
|
2136
|
+
], GitHubApi.prototype, "getIssue", null);
|
|
2137
|
+
__decorate([
|
|
2138
|
+
trace({
|
|
2139
|
+
args: (provider, token, owner, repo, number) => ({
|
|
2140
|
+
provider: provider.name,
|
|
2141
|
+
token: `<token:${token.microHash}>`,
|
|
2142
|
+
owner: owner,
|
|
2143
|
+
repo: repo,
|
|
2144
|
+
number: number,
|
|
2145
|
+
}),
|
|
2146
|
+
})
|
|
2147
|
+
], GitHubApi.prototype, "getPullRequest", null);
|
|
2148
|
+
__decorate([
|
|
2149
|
+
trace({
|
|
2150
|
+
args: (provider, token, owner, repo, branch) => ({
|
|
2151
|
+
provider: provider.name,
|
|
2152
|
+
token: `<token:${token.microHash}>`,
|
|
2153
|
+
owner: owner,
|
|
2154
|
+
repo: repo,
|
|
2155
|
+
branch: branch,
|
|
2156
|
+
}),
|
|
2157
|
+
})
|
|
2158
|
+
], GitHubApi.prototype, "getPullRequestForBranch", null);
|
|
2159
|
+
__decorate([
|
|
2160
|
+
trace({
|
|
2161
|
+
args: (provider, token, owner, repo, rev) => ({
|
|
2162
|
+
provider: provider.name,
|
|
2163
|
+
token: `<token:${token.microHash}>`,
|
|
2164
|
+
owner: owner,
|
|
2165
|
+
repo: repo,
|
|
2166
|
+
rev: rev,
|
|
2167
|
+
}),
|
|
2168
|
+
})
|
|
2169
|
+
], GitHubApi.prototype, "getPullRequestForCommit", null);
|
|
2170
|
+
__decorate([
|
|
2171
|
+
trace({
|
|
2172
|
+
args: (provider, token, owner, repo) => ({
|
|
2173
|
+
provider: provider.name,
|
|
2174
|
+
token: `<token:${token.microHash}>`,
|
|
2175
|
+
owner: owner,
|
|
2176
|
+
repo: repo,
|
|
2177
|
+
}),
|
|
2178
|
+
})
|
|
2179
|
+
], GitHubApi.prototype, "getRepositoryMetadata", null);
|
|
2180
|
+
__decorate([
|
|
2181
|
+
trace({
|
|
2182
|
+
args: (token, owner, repo, ref, path) => ({
|
|
2183
|
+
token: `<token:${token.microHash}>`,
|
|
2184
|
+
owner: owner,
|
|
2185
|
+
repo: repo,
|
|
2186
|
+
ref: ref,
|
|
2187
|
+
path: path,
|
|
2188
|
+
}),
|
|
2189
|
+
})
|
|
2190
|
+
], GitHubApi.prototype, "getBlame", null);
|
|
2191
|
+
__decorate([
|
|
2192
|
+
trace({ args: (token, owner, repo) => ({ token: `<token:${token.microHash}>`, owner: owner, repo: repo }) })
|
|
2193
|
+
], GitHubApi.prototype, "getBranches", null);
|
|
2194
|
+
__decorate([
|
|
2195
|
+
trace({
|
|
2196
|
+
args: (token, owner, repo, ref) => ({
|
|
2197
|
+
token: `<token:${token.microHash}>`,
|
|
2198
|
+
owner: owner,
|
|
2199
|
+
repo: repo,
|
|
2200
|
+
ref: ref,
|
|
2201
|
+
}),
|
|
2202
|
+
})
|
|
2203
|
+
], GitHubApi.prototype, "getCommit", null);
|
|
2204
|
+
__decorate([
|
|
2205
|
+
trace({
|
|
2206
|
+
args: (token, owner, repo, ref, path) => ({
|
|
2207
|
+
token: `<token:${token.microHash}>`,
|
|
2208
|
+
owner: owner,
|
|
2209
|
+
repo: repo,
|
|
2210
|
+
ref: ref,
|
|
2211
|
+
path: path,
|
|
2212
|
+
}),
|
|
2213
|
+
})
|
|
2214
|
+
], GitHubApi.prototype, "getCommitForFile", null);
|
|
2215
|
+
__decorate([
|
|
2216
|
+
trace({
|
|
2217
|
+
args: (token, owner, repo, refs, mode, date) => ({
|
|
2218
|
+
token: `<token:${token.microHash}>`,
|
|
2219
|
+
owner: owner,
|
|
2220
|
+
repo: repo,
|
|
2221
|
+
refs: refs,
|
|
2222
|
+
mode: mode,
|
|
2223
|
+
date: date,
|
|
2224
|
+
}),
|
|
2225
|
+
})
|
|
2226
|
+
], GitHubApi.prototype, "getBranchesWithCommits", null);
|
|
2227
|
+
__decorate([
|
|
2228
|
+
trace({
|
|
2229
|
+
args: (token, owner, repo, ref) => ({
|
|
2230
|
+
token: `<token:${token.microHash}>`,
|
|
2231
|
+
owner: owner,
|
|
2232
|
+
repo: repo,
|
|
2233
|
+
ref: ref,
|
|
2234
|
+
}),
|
|
2235
|
+
})
|
|
2236
|
+
], GitHubApi.prototype, "getCommitCount", null);
|
|
2237
|
+
__decorate([
|
|
2238
|
+
trace({
|
|
2239
|
+
args: (token, owner, repo, branch, refs, mode, date) => ({
|
|
2240
|
+
token: `<token:${token.microHash}>`,
|
|
2241
|
+
owner: owner,
|
|
2242
|
+
repo: repo,
|
|
2243
|
+
branch: branch,
|
|
2244
|
+
refs: refs,
|
|
2245
|
+
mode: mode,
|
|
2246
|
+
date: date,
|
|
2247
|
+
}),
|
|
2248
|
+
})
|
|
2249
|
+
], GitHubApi.prototype, "getBranchWithCommit", null);
|
|
2250
|
+
__decorate([
|
|
2251
|
+
trace({
|
|
2252
|
+
args: (token, owner, repo, ref) => ({
|
|
2253
|
+
token: `<token:${token.microHash}>`,
|
|
2254
|
+
owner: owner,
|
|
2255
|
+
repo: repo,
|
|
2256
|
+
ref: ref,
|
|
2257
|
+
}),
|
|
2258
|
+
})
|
|
2259
|
+
], GitHubApi.prototype, "getCommits", null);
|
|
2260
|
+
__decorate([
|
|
2261
|
+
trace({
|
|
2262
|
+
args: (token, owner, repo, ref) => ({
|
|
2263
|
+
token: `<token:${token.microHash}>`,
|
|
2264
|
+
owner: owner,
|
|
2265
|
+
repo: repo,
|
|
2266
|
+
ref: ref,
|
|
2267
|
+
}),
|
|
2268
|
+
})
|
|
2269
|
+
], GitHubApi.prototype, "getCommitRefs", null);
|
|
2270
|
+
__decorate([
|
|
2271
|
+
trace({
|
|
2272
|
+
args: (token, owner, repo, ref, date) => ({
|
|
2273
|
+
token: `<token:${token.microHash}>`,
|
|
2274
|
+
owner: owner,
|
|
2275
|
+
repo: repo,
|
|
2276
|
+
ref: ref,
|
|
2277
|
+
date: date,
|
|
2278
|
+
}),
|
|
2279
|
+
})
|
|
2280
|
+
], GitHubApi.prototype, "getTagsWithCommit", null);
|
|
2281
|
+
__decorate([
|
|
2282
|
+
trace({
|
|
2283
|
+
args: (token, owner, repo, ref, path, sha) => ({
|
|
2284
|
+
token: `<token:${token.microHash}>`,
|
|
2285
|
+
owner: owner,
|
|
2286
|
+
repo: repo,
|
|
2287
|
+
ref: ref,
|
|
2288
|
+
path: path,
|
|
2289
|
+
sha: sha,
|
|
2290
|
+
}),
|
|
2291
|
+
})
|
|
2292
|
+
], GitHubApi.prototype, "getNextCommitRefs", null);
|
|
2293
|
+
__decorate([
|
|
2294
|
+
trace({ args: (token, owner, repo) => ({ token: `<token:${token.microHash}>`, owner: owner, repo: repo }) })
|
|
2295
|
+
], GitHubApi.prototype, "getContributors", null);
|
|
2296
|
+
__decorate([
|
|
2297
|
+
trace({ args: (token, owner, repo) => ({ token: `<token:${token.microHash}>`, owner: owner, repo: repo }) })
|
|
2298
|
+
], GitHubApi.prototype, "getDefaultBranchName", null);
|
|
2299
|
+
__decorate([
|
|
2300
|
+
trace({ args: (token, owner, repo) => ({ token: `<token:${token.microHash}>`, owner: owner, repo: repo }) })
|
|
2301
|
+
], GitHubApi.prototype, "getCurrentUser", null);
|
|
2302
|
+
__decorate([
|
|
2303
|
+
trace({
|
|
2304
|
+
args: (token, owner, repo, range) => ({
|
|
2305
|
+
token: `<token:${token.microHash}>`,
|
|
2306
|
+
owner: owner,
|
|
2307
|
+
repo: repo,
|
|
2308
|
+
range: range,
|
|
2309
|
+
}),
|
|
2310
|
+
})
|
|
2311
|
+
], GitHubApi.prototype, "getComparison", null);
|
|
2312
|
+
__decorate([
|
|
2313
|
+
trace({ args: (token, owner, repo) => ({ token: `<token:${token.microHash}>`, owner: owner, repo: repo }) })
|
|
2314
|
+
], GitHubApi.prototype, "getRepositoryVisibility", null);
|
|
2315
|
+
__decorate([
|
|
2316
|
+
trace({ args: (token, owner, repo) => ({ token: `<token:${token.microHash}>`, owner: owner, repo: repo }) })
|
|
2317
|
+
], GitHubApi.prototype, "getTags", null);
|
|
2318
|
+
__decorate([
|
|
2319
|
+
trace({
|
|
2320
|
+
args: (token, owner, repo, ref, path) => ({
|
|
2321
|
+
token: `<token:${token.microHash}>`,
|
|
2322
|
+
owner: owner,
|
|
2323
|
+
repo: repo,
|
|
2324
|
+
ref: ref,
|
|
2325
|
+
path: path,
|
|
2326
|
+
}),
|
|
2327
|
+
})
|
|
2328
|
+
], GitHubApi.prototype, "resolveReference", null);
|
|
2329
|
+
__decorate([
|
|
2330
|
+
trace({ args: (token, query) => ({ token: `<token:${token.microHash}>`, query: query }) })
|
|
2331
|
+
], GitHubApi.prototype, "searchCommits", null);
|
|
2332
|
+
__decorate([
|
|
2333
|
+
trace({ args: (token, query) => ({ token: `<token:${token.microHash}>`, query: query }) })
|
|
2334
|
+
], GitHubApi.prototype, "searchCommitShas", null);
|
|
2335
|
+
__decorate([
|
|
2336
|
+
trace({ args: (provider, token) => ({ provider: provider?.name, token: `<token:${token.microHash}>` }) })
|
|
2337
|
+
], GitHubApi.prototype, "getEnterpriseVersion", null);
|
|
2338
|
+
__decorate([
|
|
2339
|
+
trace({ args: (provider, token) => ({ provider: provider.name, token: `<token:${token.microHash}>` }) })
|
|
2340
|
+
], GitHubApi.prototype, "searchMyPullRequests", null);
|
|
2341
|
+
__decorate([
|
|
2342
|
+
trace({ args: (provider, token) => ({ provider: provider.name, token: `<token:${token.microHash}>` }) })
|
|
2343
|
+
], GitHubApi.prototype, "searchMyIssues", null);
|
|
2344
|
+
__decorate([
|
|
2345
|
+
trace({ args: (provider, token) => ({ provider: provider.name, token: `<token:${token.microHash}>` }) })
|
|
2346
|
+
], GitHubApi.prototype, "searchPullRequests", null);
|
|
2347
|
+
__decorate([
|
|
2348
|
+
trace({
|
|
2349
|
+
args: (provider, token, nodeId, expectedSourceSha) => ({
|
|
2350
|
+
provider: provider.name,
|
|
2351
|
+
token: `<token:${token.microHash}>`,
|
|
2352
|
+
nodeId: nodeId,
|
|
2353
|
+
expectedSourceSha: expectedSourceSha,
|
|
2354
|
+
}),
|
|
2355
|
+
})
|
|
2356
|
+
], GitHubApi.prototype, "mergePullRequest", null);
|
|
2357
|
+
function isGitHubDotCom(options) {
|
|
2358
|
+
return options?.baseUrl == null || options.baseUrl === 'https://api.github.com';
|
|
2359
|
+
}
|
|
2360
|
+
//# sourceMappingURL=github.js.map
|