diff --git a/apps/web/src/lib/schemas.ts b/apps/web/src/lib/schemas.ts index 39ea11b..40e3181 100644 --- a/apps/web/src/lib/schemas.ts +++ b/apps/web/src/lib/schemas.ts @@ -26,9 +26,9 @@ export const serviceGroupSchema = z.object({ type: serviceGroupTypeSchema.catch('custom'), icon: z.string().nullable(), domain: z.string().nullable(), - enabled: z.boolean(), + enabled: z.coerce.boolean(), lb_mode: z.enum(['round_robin', 'failover', 'weighted']).catch('round_robin'), - health_check_enabled: z.boolean().default(false), + health_check_enabled: z.coerce.boolean().default(false), health_check_type: z.enum(['tcp', 'http']).catch('tcp'), health_check_port: z.number().nullable(), health_check_path: z.string().nullable(), @@ -45,7 +45,7 @@ export const serviceSchema = z.object({ slug: z.string(), service_group_id: z.number().nullable().optional(), subdomain: z.string().optional(), - enabled: z.boolean().optional(), + enabled: z.coerce.boolean().optional(), computed_fqdn: z.string().nullable().optional(), lb_weight: z.number().default(1), lb_priority: z.number().default(1), @@ -67,7 +67,7 @@ export const serviceDomainBindingSchema = z target_ip_priorities: z.record(z.string(), z.number()).optional(), target_cname: z.string().nullable().optional(), lb_mode: z.enum(['round_robin', 'failover', 'weighted']).catch('round_robin'), - health_check_enabled: z.boolean().default(false), + health_check_enabled: z.coerce.boolean().default(false), health_check_type: z.enum(['tcp', 'http']).catch('tcp'), health_check_port: z.number().nullable(), health_check_path: z.string().nullable(), @@ -94,7 +94,7 @@ export const serviceDomainBindingSchema = z export const serviceViewSchema = serviceSchema.extend({ subdomain: z.string().default(''), - enabled: z.boolean().default(false), + enabled: z.coerce.boolean().default(false), ips: z.array(z.string()).default([]), domains: z.array(serviceDomainBindingSchema).default([]), }) @@ -142,7 +142,7 @@ export const serviceBindingSchema = z target_ip_weights: z.record(z.string(), z.number()).optional(), target_ip_priorities: z.record(z.string(), z.number()).optional(), lb_mode: z.enum(['round_robin', 'failover', 'weighted']).catch('round_robin'), - health_check_enabled: z.boolean().default(false), + health_check_enabled: z.coerce.boolean().default(false), health_check_type: z.enum(['tcp', 'http']).catch('tcp'), health_check_port: z.number().nullable(), health_check_path: z.string().nullable(), diff --git a/packages/shared/dist/index.d.ts b/packages/shared/dist/index.d.ts index 98180f5..8a886aa 100644 --- a/packages/shared/dist/index.d.ts +++ b/packages/shared/dist/index.d.ts @@ -284,13 +284,13 @@ declare const serviceGroupSchema: z.ZodObject<{ }>>; icon: z.ZodNullable; domain: z.ZodNullable; - enabled: z.ZodBoolean; + enabled: z.ZodCoercedBoolean; lb_mode: z.ZodCatch>; - health_check_enabled: z.ZodDefault; + health_check_enabled: z.ZodDefault>; health_check_type: z.ZodCatch>; subdomain: z.ZodOptional; - enabled: z.ZodOptional; + enabled: z.ZodOptional>; computed_fqdn: z.ZodOptional>; lb_weight: z.ZodDefault; lb_priority: z.ZodDefault; @@ -336,7 +336,7 @@ declare const serviceDomainBindingSchema: z.ZodPipe>; - health_check_enabled: z.ZodDefault; + health_check_enabled: z.ZodDefault>; health_check_type: z.ZodCatch; - enabled: z.ZodDefault; + enabled: z.ZodDefault>; ips: z.ZodDefault>; domains: z.ZodDefault>; - health_check_enabled: z.ZodDefault; + health_check_enabled: z.ZodDefault>; health_check_type: z.ZodCatch>; icon: z.ZodNullable; domain: z.ZodNullable; - enabled: z.ZodBoolean; + enabled: z.ZodCoercedBoolean; lb_mode: z.ZodCatch>; - health_check_enabled: z.ZodDefault; + health_check_enabled: z.ZodDefault>; health_check_type: z.ZodCatch; - enabled: z.ZodDefault; + enabled: z.ZodDefault>; ips: z.ZodDefault>; domains: z.ZodDefault>; - health_check_enabled: z.ZodDefault; + health_check_enabled: z.ZodDefault>; health_check_type: z.ZodCatch>; icon: z.ZodNullable; domain: z.ZodNullable; - enabled: z.ZodBoolean; + enabled: z.ZodCoercedBoolean; lb_mode: z.ZodCatch>; - health_check_enabled: z.ZodDefault; + health_check_enabled: z.ZodDefault>; health_check_type: z.ZodCatch; - enabled: z.ZodDefault; + enabled: z.ZodDefault>; ips: z.ZodDefault>; domains: z.ZodDefault>; - health_check_enabled: z.ZodDefault; + health_check_enabled: z.ZodDefault>; health_check_type: z.ZodCatch; - enabled: z.ZodDefault; + enabled: z.ZodDefault>; ips: z.ZodDefault>; domains: z.ZodDefault>; - health_check_enabled: z.ZodDefault; + health_check_enabled: z.ZodDefault>; health_check_type: z.ZodCatch>; - health_check_enabled: z.ZodDefault; + health_check_enabled: z.ZodDefault>; health_check_type: z.ZodCatch