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

This commit is contained in:
smueller
2026-06-26 13:33:03 +02:00
parent ab21f53cdd
commit b335f6a497
39 changed files with 1477 additions and 20 deletions

View File

@@ -0,0 +1,38 @@
import { z } from 'zod';
import { gameServerStatusSchema, serverEditionSchema } from './servers';
export const edgeBackendSchema = z.object({
host: z.string(),
port: z.number().int(),
});
export const edgeActionSchema = z.enum(['proxy', 'start', 'wait', 'reject']);
export const edgeResolveResponseSchema = z.object({
serverId: z.string().uuid(),
slug: z.string(),
status: gameServerStatusSchema,
joinToStartEnabled: z.boolean(),
edition: serverEditionSchema,
backend: edgeBackendSchema.nullable(),
action: edgeActionSchema,
message: z.string().optional(),
});
export const edgeStartRequestSchema = z.object({
clientIp: z.string().min(1).max(64),
});
export const edgeStartResponseSchema = z.object({
resolve: edgeResolveResponseSchema,
started: z.boolean(),
jobId: z.string().optional(),
queuePosition: z.number().int().optional(),
});
export type EdgeBackend = z.infer<typeof edgeBackendSchema>;
export type EdgeAction = z.infer<typeof edgeActionSchema>;
export type EdgeResolveResponse = z.infer<typeof edgeResolveResponseSchema>;
export type EdgeStartRequest = z.infer<typeof edgeStartRequestSchema>;
export type EdgeStartResponse = z.infer<typeof edgeStartResponseSchema>;