Phase D
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 14:03:57 +02:00
parent ed8334328e
commit 333ad1cc7d
31 changed files with 964 additions and 15 deletions

View File

@@ -228,6 +228,10 @@ export {
whmcsServiceResponseSchema,
whmcsChangePackageRequestSchema,
whmcsSuspendRequestSchema,
whmcsCreateSsoRequestSchema,
whmcsCreateSsoResponseSchema,
ssoConsumeRequestSchema,
ssoConsumeResponseSchema,
type WhmcsHealthResponse,
type WhmcsPlanCatalogResponse,
type WhmcsProvisionServiceRequest,
@@ -235,4 +239,8 @@ export {
type WhmcsUpsertClientRequest,
type WhmcsUpsertClientResponse,
type WhmcsChangePackageRequest,
type WhmcsCreateSsoRequest,
type WhmcsCreateSsoResponse,
type SsoConsumeRequest,
type SsoConsumeResponse,
} from './whmcs';

View File

@@ -1,5 +1,6 @@
import { z } from 'zod';
import { authUserSchema } from './auth';
import { serverResponseSchema } from './servers';
export const whmcsHealthResponseSchema = z.object({
@@ -61,6 +62,40 @@ export const whmcsSuspendRequestSchema = z.object({
reason: z.string().max(256).optional(),
});
export const whmcsSsoRoleSchema = z.enum(['owner', 'admin']);
export const whmcsSsoKindSchema = z.enum(['service', 'admin']);
export const whmcsCreateSsoRequestSchema = z.object({
externalClientId: z.string().min(1).max(64),
externalUserId: z.string().min(1).max(64),
role: whmcsSsoRoleSchema.default('owner'),
kind: whmcsSsoKindSchema.default('service'),
targetPath: z.string().max(256).optional(),
});
export const whmcsCreateSsoResponseSchema = z.object({
ticketId: z.string().uuid(),
redirectUrl: z.string().url(),
expiresAt: z.string().datetime(),
targetPath: z.string(),
});
export const ssoConsumeRequestSchema = z.object({
ticket: z.string().min(32).max(256),
});
export const ssoImpersonationSchema = z.object({
isImpersonation: z.boolean(),
label: z.string().optional(),
});
export const ssoConsumeResponseSchema = z.object({
redirectPath: z.string(),
user: authUserSchema,
impersonation: ssoImpersonationSchema.optional(),
});
export type WhmcsHealthResponse = z.infer<typeof whmcsHealthResponseSchema>;
export type WhmcsPlanCatalogResponse = z.infer<typeof whmcsPlanCatalogResponseSchema>;
export type WhmcsUpsertClientRequest = z.infer<typeof whmcsUpsertClientRequestSchema>;
@@ -69,3 +104,7 @@ export type WhmcsProvisionServiceRequest = z.infer<typeof whmcsProvisionServiceR
export type WhmcsServiceResponse = z.infer<typeof whmcsServiceResponseSchema>;
export type WhmcsChangePackageRequest = z.infer<typeof whmcsChangePackageRequestSchema>;
export type WhmcsSuspendRequest = z.infer<typeof whmcsSuspendRequestSchema>;
export type WhmcsCreateSsoRequest = z.infer<typeof whmcsCreateSsoRequestSchema>;
export type WhmcsCreateSsoResponse = z.infer<typeof whmcsCreateSsoResponseSchema>;
export type SsoConsumeRequest = z.infer<typeof ssoConsumeRequestSchema>;
export type SsoConsumeResponse = z.infer<typeof ssoConsumeResponseSchema>;