merge: integrate main restructuring into dev
- Resolve 57 merge conflicts from codebase restructure - Port dev feature code to new directory structure: * Update import paths to use @/ aliases * Add backward-compatible API signatures (createInstance, startInstance, deleteInstance) * Add missing type exports (ProjectWithRepos, InstanceHealth, Branch, BranchesResponse) * Extend Session and GitRepository types for dev features * Extend TerminalComponent props for mobile terminal wrapper * Add missing icon names (bell, drag, undo) Quality gates: tsc pass (0 errors), build pass, 127/131 tests pass (4 pre-existing failures unrelated to merge)
This commit is contained in:
@@ -0,0 +1,53 @@
|
||||
import { apiClient } from "./client";
|
||||
|
||||
export interface SSHKey {
|
||||
id: string;
|
||||
name: string;
|
||||
public_key: string;
|
||||
created_at: string;
|
||||
}
|
||||
|
||||
export interface SSHKeyCreate {
|
||||
name: string;
|
||||
}
|
||||
|
||||
export async function listSSHKeys(): Promise<SSHKey[]> {
|
||||
const response = await apiClient.get<SSHKey[]>("/ssh-keys");
|
||||
return response.data;
|
||||
}
|
||||
|
||||
export async function createSSHKey(data: SSHKeyCreate): Promise<SSHKey> {
|
||||
const response = await apiClient.post<SSHKey>("/ssh-keys", data);
|
||||
return response.data;
|
||||
}
|
||||
|
||||
export async function deleteSSHKey(keyId: string): Promise<void> {
|
||||
await apiClient.delete(`/ssh-keys/${keyId}`);
|
||||
}
|
||||
|
||||
export interface SignPayloadRequest {
|
||||
payload: string;
|
||||
}
|
||||
|
||||
export interface SignatureResponse {
|
||||
signature: string;
|
||||
}
|
||||
|
||||
export interface VerifySignatureRequest {
|
||||
payload: string;
|
||||
signature: string;
|
||||
}
|
||||
|
||||
export interface VerifySignatureResponse {
|
||||
valid: boolean;
|
||||
}
|
||||
|
||||
export async function signPayload(keyId: string, data: SignPayloadRequest): Promise<SignatureResponse> {
|
||||
const response = await apiClient.post<SignatureResponse>(`/ssh-keys/${keyId}/sign`, data);
|
||||
return response.data;
|
||||
}
|
||||
|
||||
export async function verifySignature(keyId: string, data: VerifySignatureRequest): Promise<VerifySignatureResponse> {
|
||||
const response = await apiClient.post<VerifySignatureResponse>(`/ssh-keys/${keyId}/verify`, data);
|
||||
return response.data;
|
||||
}
|
||||
Reference in New Issue
Block a user