Phase9
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 17s

This commit is contained in:
smueller
2026-06-26 13:46:25 +02:00
parent b335f6a497
commit ed8334328e
49 changed files with 2219 additions and 16 deletions

View File

@@ -0,0 +1,71 @@
import { z } from 'zod';
import { serverResponseSchema } from './servers';
export const whmcsHealthResponseSchema = z.object({
status: z.literal('ok'),
integrationId: z.string(),
billingProvider: z.string(),
});
export const whmcsPlanCatalogItemSchema = z.object({
id: z.string().uuid(),
slug: z.string(),
name: z.string(),
maxRamMb: z.number().int(),
isFree: z.boolean(),
});
export const whmcsPlanCatalogResponseSchema = z.object({
plans: z.array(whmcsPlanCatalogItemSchema),
});
export const whmcsUpsertClientRequestSchema = z.object({
email: z.string().email(),
username: z.string().min(3).max(32),
displayName: z.string().max(64).optional(),
});
export const whmcsUpsertClientResponseSchema = z.object({
userId: z.string().uuid(),
externalClientId: z.string(),
created: z.boolean(),
});
export const whmcsProvisionServiceRequestSchema = z.object({
externalServiceId: z.string().min(1).max(64),
externalClientId: z.string().min(1).max(64),
externalProductId: z.string().max(64).optional(),
planSlug: z.string().min(1).max(64),
serverName: z.string().min(1).max(64),
minecraftVersion: z.string().min(1).max(32).default('1.21.1'),
softwareFamily: z
.enum(['VANILLA', 'PAPER', 'PURPUR', 'FABRIC', 'FORGE', 'NEOFORGE', 'QUILT', 'BEDROCK_DEDICATED'])
.default('VANILLA'),
edition: z.enum(['JAVA', 'BEDROCK']).default('JAVA'),
eulaAccepted: z.literal(true),
});
export const whmcsServiceResponseSchema = z.object({
externalServiceId: z.string(),
status: z.enum(['PENDING', 'ACTIVE', 'SUSPENDED', 'TERMINATED']),
server: serverResponseSchema,
});
export const whmcsChangePackageRequestSchema = z.object({
planSlug: z.string().min(1).max(64),
ramMb: z.number().int().min(512).max(65536).optional(),
});
export const whmcsSuspendRequestSchema = z.object({
reason: z.string().max(256).optional(),
});
export type WhmcsHealthResponse = z.infer<typeof whmcsHealthResponseSchema>;
export type WhmcsPlanCatalogResponse = z.infer<typeof whmcsPlanCatalogResponseSchema>;
export type WhmcsUpsertClientRequest = z.infer<typeof whmcsUpsertClientRequestSchema>;
export type WhmcsUpsertClientResponse = z.infer<typeof whmcsUpsertClientResponseSchema>;
export type WhmcsProvisionServiceRequest = z.infer<typeof whmcsProvisionServiceRequestSchema>;
export type WhmcsServiceResponse = z.infer<typeof whmcsServiceResponseSchema>;
export type WhmcsChangePackageRequest = z.infer<typeof whmcsChangePackageRequestSchema>;
export type WhmcsSuspendRequest = z.infer<typeof whmcsSuspendRequestSchema>;