import { apiClient } from './client'; export interface BranchStatus { branch_name: string; base_branch: string; has_changes: boolean; last_push_at: string; edited_files: string[]; hours_since_push: number; has_draft_content: boolean; } export interface PublishParams { owner: string; repo: string; commit_message: string; pr_title?: string; pr_description?: string; files?: string[]; } export interface PullRequest { number: number; url: string; html_url: string; title: string; } export interface PublishResponse { success: boolean; branch: string; commit_sha: string; pull_request?: PullRequest; error?: string; } export const branchApi = { async getBranchStatus(owner: string, repo: string): Promise { const response = await apiClient.get( `/api/repos/${owner}/${repo}/branch/status` ); return response.data; }, async publish(params: PublishParams): Promise { const { owner, repo, ...body } = params; const response = await apiClient.post( `/api/repos/${owner}/${repo}/publish`, body ); return response.data; }, };