AeThex-OS/temp-forge-extract/aethex-forge-main/client/api/devconnect-links.ts
MrPiglr b3c308b2c8 Add functional marketplace modules, bottom nav bar, root terminal, arcade games
- ModuleManager: Central tracking for installed marketplace modules
- DataAnalyzerWidget: Real-time CPU/RAM/Battery/Storage widget (unlocked by Data Analyzer module)
- BottomNavBar: Navigation bar for Projects/Chat/Marketplace/Settings
- RootShell: Real root command execution utility
- TerminalActivity: Full root shell with neofetch, sysinfo, real Linux commands
- Terminal Pro module: Adds aliases (ll, la, h), command history
- ArcadeActivity + SnakeGame: Pixel Arcade module unlocks retro games
- fade_in/fade_out animations for smooth transitions
2026-02-18 22:03:50 -07:00

49 lines
1.6 KiB
TypeScript

export interface DevConnectLink {
id: string;
aethex_creator_id: string;
devconnect_username: string;
devconnect_profile_url: string;
verified: boolean;
linked_at: string;
}
const API_BASE = import.meta.env.VITE_API_BASE || "";
export async function linkDevConnectAccount(data: {
devconnect_username: string;
devconnect_profile_url?: string;
}): Promise<DevConnectLink> {
const response = await fetch(`${API_BASE}/api/devconnect/link`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify(data),
});
if (!response.ok) throw new Error("Failed to link DevConnect account");
return response.json();
}
export async function getDevConnectLink(): Promise<DevConnectLink | null> {
const response = await fetch(`${API_BASE}/api/devconnect/link`);
if (!response.ok) throw new Error("Failed to fetch DevConnect link");
const data = await response.json();
return data.data;
}
export async function unlinkDevConnectAccount(): Promise<void> {
const response = await fetch(`${API_BASE}/api/devconnect/link`, {
method: "DELETE",
});
if (!response.ok) throw new Error("Failed to unlink DevConnect account");
}
export async function verifyDevConnectLink(
verificationCode: string,
): Promise<DevConnectLink> {
const response = await fetch(`${API_BASE}/api/devconnect/link/verify`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ verification_code: verificationCode }),
});
if (!response.ok) throw new Error("Failed to verify DevConnect link");
return response.json();
}