Phase6
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 13s

This commit is contained in:
smueller
2026-06-26 13:11:28 +02:00
parent d29a02f2a4
commit 49a98ee31d
81 changed files with 1462 additions and 53 deletions

View File

@@ -180,3 +180,17 @@ export {
type InstallAddonRequest,
type InstallAddonResponse,
} from './addons';
export {
gameNodeStatusSchema,
nodeSummarySchema,
nodeListResponseSchema,
startQueueStatusSchema,
startQueueEntrySchema,
startQueueResponseSchema,
type GameNodeStatus,
type NodeSummary,
type NodeListResponse,
type StartQueueEntry,
type StartQueueResponse,
} from './nodes';

View File

@@ -0,0 +1,57 @@
import { z } from 'zod';
export const gameNodeStatusSchema = z.enum([
'ONLINE',
'OFFLINE',
'MAINTENANCE',
'DRAINING',
'UNREACHABLE',
]);
export const nodeSummarySchema = z.object({
id: z.string().uuid(),
name: z.string(),
hostname: z.string(),
status: gameNodeStatusSchema,
maxServers: z.number().int(),
maxRamMb: z.number().int(),
platformRamMb: z.number().int(),
activeServers: z.number().int(),
reservedRamMb: z.number().int(),
availableRamMb: z.number().int(),
lastHeartbeatAt: z.string().datetime().nullable(),
agentVersion: z.string().nullable(),
drainRequestedAt: z.string().datetime().nullable(),
createdAt: z.string().datetime(),
});
export const nodeListResponseSchema = z.object({
nodes: z.array(nodeSummarySchema),
});
export const startQueueStatusSchema = z.enum([
'QUEUED',
'DISPATCHED',
'CANCELLED',
'EXPIRED',
]);
export const startQueueEntrySchema = z.object({
serverId: z.string().uuid(),
nodeId: z.string().uuid(),
status: startQueueStatusSchema,
priority: z.number().int(),
position: z.number().int().nullable(),
requestedAt: z.string().datetime(),
expiresAt: z.string().datetime().nullable(),
});
export const startQueueResponseSchema = z.object({
entry: startQueueEntrySchema.nullable(),
});
export type GameNodeStatus = z.infer<typeof gameNodeStatusSchema>;
export type NodeSummary = z.infer<typeof nodeSummarySchema>;
export type NodeListResponse = z.infer<typeof nodeListResponseSchema>;
export type StartQueueEntry = z.infer<typeof startQueueEntrySchema>;
export type StartQueueResponse = z.infer<typeof startQueueResponseSchema>;

View File

@@ -5,11 +5,13 @@ export const gameServerStatusSchema = z.enum([
'PROVISIONING',
'INSTALLING',
'STOPPED',
'QUEUED',
'STARTING',
'RUNNING',
'STOPPING',
'BACKING_UP',
'RESTORING',
'UNKNOWN',
'ERROR',
'DELETING',
'DELETED',
@@ -68,6 +70,7 @@ export const serverListResponseSchema = z.object({
export const serverActionResponseSchema = z.object({
server: serverResponseSchema,
jobId: z.string().optional(),
queuePosition: z.number().int().optional(),
});
export type GameServerStatus = z.infer<typeof gameServerStatusSchema>;