Phase7
Some checks failed
CI / Node — lint, typecheck, test, build (push) Failing after 9s
CI / Go — node-agent tests (push) Failing after 8s
CI / Go — edge-gateway build (push) Successful in 14s

This commit is contained in:
smueller
2026-06-26 13:20:55 +02:00
parent 49a98ee31d
commit ab21f53cdd
86 changed files with 1207 additions and 63 deletions

View File

@@ -0,0 +1,30 @@
import { apiFetch } from "./auth";
export interface WalletResponse {
balance: number;
periodStart: string;
transactions: Array<{
id: string;
amount: number;
type: string;
referenceType: string | null;
referenceId: string | null;
createdAt: string;
}>;
}
export interface IdleStatusResponse {
enabled: boolean;
playerCount: number | null;
idleStopAt: string | null;
secondsRemaining: number | null;
lastPlayerSeenAt: string | null;
}
export async function getWallet(): Promise<WalletResponse> {
return apiFetch<WalletResponse>("/account/wallet");
}
export async function getServerIdleStatus(serverId: string): Promise<IdleStatusResponse> {
return apiFetch<IdleStatusResponse>(`/servers/${serverId}/idle`);
}

View File

@@ -5,9 +5,11 @@ export type GameServerStatus =
| "PROVISIONING"
| "INSTALLING"
| "STOPPED"
| "QUEUED"
| "STARTING"
| "RUNNING"
| "STOPPING"
| "UNKNOWN"
| "ERROR"
| "DELETING"
| "DELETED";
@@ -38,6 +40,8 @@ export interface Server {
containerId: string | null;
dataPath: string | null;
ramMb: number;
idleShutdownEnabled: boolean;
idleStopAt: string | null;
createdAt: string;
updatedAt: string;
}
@@ -49,6 +53,7 @@ export interface ServerListResponse {
export interface ServerActionResponse {
server: Server;
jobId?: string;
queuePosition?: number;
}
export interface CreateServerPayload {