import { Machines, MachinesSchema } from "config";

export class MachineManager {
	constructor(private readonly apiAddr: string) {}

	async getUserMachines(username: string): Promise<Machines> {
		const response = await fetch(`${this.apiAddr}/user/${username}/node`);
		return MachinesSchema.parse(await response.json());
	}
}
