import * as gitApiHttp from '@openchamber/ui/lib/gitApiHttp'; import type { GitAPI, CreateGitCommitOptions, GitLogOptions, } from '@openchamber/ui/lib/api/types'; export const createWebGitAPI = (): GitAPI => ({ checkIsGitRepository: gitApiHttp.checkIsGitRepository, getGitStatus: gitApiHttp.getGitStatus, getGitDiff: gitApiHttp.getGitDiff, getGitFileDiff: gitApiHttp.getGitFileDiff, getGitRangeDiff: gitApiHttp.getGitRangeDiff, getGitRangeFiles: gitApiHttp.getGitRangeFiles, getBranchBase: gitApiHttp.getBranchBase, revertGitFile: gitApiHttp.revertGitFile, stageGitFile: gitApiHttp.stageGitFile, stageGitFiles: gitApiHttp.stageGitFiles, unstageGitFile: gitApiHttp.unstageGitFile, unstageGitFiles: gitApiHttp.unstageGitFiles, stageGitHunk: gitApiHttp.stageGitHunk, unstageGitHunk: gitApiHttp.unstageGitHunk, revertGitHunk: gitApiHttp.revertGitHunk, isLinkedWorktree: gitApiHttp.isLinkedWorktree, getGitBranches: gitApiHttp.getGitBranches, deleteGitBranch: gitApiHttp.deleteGitBranch as GitAPI['deleteGitBranch'], deleteRemoteBranch: gitApiHttp.deleteRemoteBranch as GitAPI['deleteRemoteBranch'], removeRemote: gitApiHttp.removeRemote as GitAPI['removeRemote'], generateCommitMessage: gitApiHttp.generateCommitMessage, generatePullRequestDescription: gitApiHttp.generatePullRequestDescription, listGitWorktrees: gitApiHttp.listGitWorktrees, validateGitWorktree: gitApiHttp.validateGitWorktree, createGitWorktree: gitApiHttp.createGitWorktree, deleteGitWorktree: gitApiHttp.deleteGitWorktree, validateWorktreeDirectory: gitApiHttp.validateWorktreeDirectory, canonicalizeWorktreeState: gitApiHttp.canonicalizeWorktreeState, createGitCommit(directory: string, message: string, options?: CreateGitCommitOptions) { return gitApiHttp.createGitCommit(directory, message, options); }, gitPush: gitApiHttp.gitPush, gitPull: gitApiHttp.gitPull, gitFetch: gitApiHttp.gitFetch, listGitStashes: gitApiHttp.listGitStashes, countGitStashFiles: gitApiHttp.countGitStashFiles, stashGitChanges: gitApiHttp.stashGitChanges, applyGitStash: gitApiHttp.applyGitStash, popGitStash: gitApiHttp.popGitStash, dropGitStash: gitApiHttp.dropGitStash, checkoutBranch: gitApiHttp.checkoutBranch, createBranch: gitApiHttp.createBranch, renameBranch: gitApiHttp.renameBranch, getGitLog(directory: string, options?: GitLogOptions) { return gitApiHttp.getGitLog(directory, options); }, getCommitFiles: gitApiHttp.getCommitFiles, getCurrentGitIdentity: gitApiHttp.getCurrentGitIdentity, hasLocalIdentity: gitApiHttp.hasLocalIdentity, setGitIdentity: gitApiHttp.setGitIdentity, getGitIdentities: gitApiHttp.getGitIdentities, createGitIdentity: gitApiHttp.createGitIdentity, updateGitIdentity: gitApiHttp.updateGitIdentity, deleteGitIdentity: gitApiHttp.deleteGitIdentity, getRemotes: gitApiHttp.getRemotes, rebase: gitApiHttp.rebase, abortRebase: gitApiHttp.abortRebase, continueRebase: gitApiHttp.continueRebase, merge: gitApiHttp.merge, abortMerge: gitApiHttp.abortMerge, continueMerge: gitApiHttp.continueMerge, checkoutCommit: gitApiHttp.checkoutCommit, cherryPick: gitApiHttp.cherryPick, revertCommit: gitApiHttp.revertCommit, resetToCommit: gitApiHttp.resetToCommit, stash: gitApiHttp.stash, stashPop: gitApiHttp.stashPop, getConflictDetails: gitApiHttp.getConflictDetails, worktree: { list: gitApiHttp.listGitWorktrees, validate: gitApiHttp.validateGitWorktree, bootstrapStatus: gitApiHttp.getGitWorktreeBootstrapStatus, preview: gitApiHttp.previewGitWorktree, create: gitApiHttp.createGitWorktree, remove: gitApiHttp.deleteGitWorktree, }, });