feat: implement auth, projects, and frontend foundation

This commit is contained in:
2026-05-17 20:21:55 +00:00
parent e7819bfc82
commit 71d9fe6406
88 changed files with 10936 additions and 47 deletions
+51
View File
@@ -0,0 +1,51 @@
import { apiClient } from "./client";
import type { Project } from "../types";
export type ProjectCreateInput = {
name: string;
description?: string | null;
};
export type ProjectUpdateInput = {
name?: string | null;
description?: string | null;
};
export type SetDefaultSSHKeyInput = {
ssh_key_id: string;
};
export const listProjects = async (): Promise<Project[]> => {
const response = await apiClient.get<Project[]>("/projects");
return response.data;
};
export const createProject = async (
input: ProjectCreateInput
): Promise<Project> => {
const response = await apiClient.post<Project>("/projects", input);
return response.data;
};
export const updateProject = async (
projectId: string,
input: ProjectUpdateInput
): Promise<Project> => {
const response = await apiClient.patch<Project>(`/projects/${projectId}`, input);
return response.data;
};
export const deleteProject = async (projectId: string): Promise<void> => {
await apiClient.delete(`/projects/${projectId}`);
};
export const setDefaultSSHKey = async (
projectId: string,
input: SetDefaultSSHKeyInput
): Promise<Project> => {
const response = await apiClient.patch<Project>(
`/projects/${projectId}/default-ssh-key`,
input
);
return response.data;
};