feat: add Repos page with commit dialog, PR creation, and upstream badges
This commit is contained in:
@@ -117,6 +117,36 @@ export const api = {
|
||||
discardAll: () => request("/toolset/discard-all", { method: "POST" }),
|
||||
},
|
||||
|
||||
github: {
|
||||
validatePat: (pat: string) =>
|
||||
request<{ login: string }>("/github/validate-pat", {
|
||||
method: "POST",
|
||||
body: JSON.stringify({ pat }),
|
||||
}),
|
||||
fork: (repo: string) =>
|
||||
request("/github/fork", { method: "POST", body: JSON.stringify({ repo }) }),
|
||||
forks: () => request<Array<{ repo: string; forked: boolean }>>("/github/forks"),
|
||||
createPr: (repo: string, title: string, body: string, headBranch: string) =>
|
||||
request<{ number: number; url: string }>("/github/pr", {
|
||||
method: "POST",
|
||||
body: JSON.stringify({ repo, title, body, headBranch }),
|
||||
}),
|
||||
listPrs: (repo: string) =>
|
||||
request<Array<Record<string, unknown>>>(`/github/prs/${repo}`),
|
||||
},
|
||||
|
||||
repos: {
|
||||
list: () => request<Array<Record<string, unknown>>>("/repos"),
|
||||
status: (repo: string) => request<Record<string, unknown>>(`/repos/${repo}/status`),
|
||||
clone: (repo: string) =>
|
||||
request("/repos/clone", { method: "POST", body: JSON.stringify({ repo }) }),
|
||||
pull: (repo: string) => request(`/repos/${repo}/pull`, { method: "POST" }),
|
||||
commit: (repo: string, data: Record<string, unknown>) =>
|
||||
request(`/repos/${repo}/commit`, { method: "POST", body: JSON.stringify(data) }),
|
||||
push: (repo: string) => request(`/repos/${repo}/push`, { method: "POST" }),
|
||||
diff: (repo: string) => request<{ diff: string }>(`/repos/${repo}/diff`),
|
||||
},
|
||||
|
||||
docker: {
|
||||
containers: () => request<Array<Record<string, string>>>("/docker/containers"),
|
||||
pull: (image: string) =>
|
||||
|
||||
Reference in New Issue
Block a user