blob: ab4d684fdf0e9e4dec6fcd23ec8b0bba6402024e [file] [log] [blame]
gio43e0aad2025-08-01 16:17:27 +04001import { Machines, MachinesSchema } from "config";
2
3export class MachineManager {
4 constructor(private readonly apiAddr: string) {}
5
6 async getUserMachines(username: string): Promise<Machines> {
7 const response = await fetch(`${this.apiAddr}/user/${username}/node`);
8 return MachinesSchema.parse(await response.json());
9 }
10}