35 lines
776 B
TypeScript
35 lines
776 B
TypeScript
|
|
import { invoke } from "@tauri-apps/api/core";
|
||
|
|
import type { Project } from "./types";
|
||
|
|
|
||
|
|
export async function createProject(
|
||
|
|
name: string,
|
||
|
|
pathOrUrl: string,
|
||
|
|
baseBranch: string
|
||
|
|
): Promise<Project> {
|
||
|
|
return invoke("create_project", {
|
||
|
|
name,
|
||
|
|
pathOrUrl,
|
||
|
|
baseBranch,
|
||
|
|
});
|
||
|
|
}
|
||
|
|
|
||
|
|
export async function listProjects(): Promise<Project[]> {
|
||
|
|
return invoke("list_projects");
|
||
|
|
}
|
||
|
|
|
||
|
|
export async function getProject(id: string): Promise<Project> {
|
||
|
|
return invoke("get_project", { id });
|
||
|
|
}
|
||
|
|
|
||
|
|
export async function updateProject(
|
||
|
|
id: string,
|
||
|
|
name: string,
|
||
|
|
baseBranch: string
|
||
|
|
): Promise<void> {
|
||
|
|
return invoke("update_project", { id, name, baseBranch });
|
||
|
|
}
|
||
|
|
|
||
|
|
export async function deleteProject(id: string): Promise<void> {
|
||
|
|
return invoke("delete_project", { id });
|
||
|
|
}
|