feat(api, web): enhance health check and domain management features
Build, Test, and Push CFDM Docker Image / test (push) Successful in 3m3s
Build, Test, and Push CFDM Docker Image / build-and-push (push) Successful in 1m48s
Build, Test, and Push CFDM Docker Image / update-wiki (push) Successful in 6s
Build, Test, and Push CFDM Docker Image / create-release (push) Has been skipped

- Integrated domain monitoring routes and bulk update functionality for domains in the API.
- Improved health check service to include domain monitoring and logging of health status changes.
- Updated web components to reflect health status with new HealthCheckBadge and enhanced domain filtering options.
- Refactored domain service to support bulk updates and improved domain management capabilities.

Co-authored-by: Cursor <[email protected]>
This commit is contained in:
Denozordec
2026-07-17 02:25:12 +07:00
co-authored by Cursor
parent dd167a4fec
commit 64585ccd47
38 changed files with 4199 additions and 677 deletions
+156 -14
View File
@@ -152,7 +152,7 @@ interface JwtClaims {
exp: number;
}
type LbMode = "round_robin" | "failover" | "weighted";
type HealthCheckType = "tcp" | "http";
type HealthCheckType = "tcp" | "http" | "ping" | "dns";
type IpHealthState = "up" | "down" | "degraded" | "unknown";
type HealthCheckScope = "binding" | "group";
interface IpHealthStatus {
@@ -221,7 +221,21 @@ declare const lbModeSchema: z.ZodEnum<{
declare const healthCheckTypeSchema: z.ZodEnum<{
tcp: "tcp";
http: "http";
ping: "ping";
dns: "dns";
}>;
declare const domainEnvironmentSchema: z.ZodEnum<{
prod: "prod";
staging: "staging";
dev: "dev";
}>;
type DomainEnvironment = z.infer<typeof domainEnvironmentSchema>;
declare const domainMonitorTypeSchema: z.ZodEnum<{
http: "http";
ping: "ping";
dns: "dns";
}>;
type DomainMonitorType = z.infer<typeof domainMonitorTypeSchema>;
declare const ipHealthStateSchema: z.ZodEnum<{
unknown: "unknown";
up: "up";
@@ -294,6 +308,8 @@ declare const serviceGroupSchema: z.ZodObject<{
health_check_type: z.ZodCatch<z.ZodEnum<{
tcp: "tcp";
http: "http";
ping: "ping";
dns: "dns";
}>>;
health_check_port: z.ZodNullable<z.ZodNumber>;
health_check_path: z.ZodNullable<z.ZodString>;
@@ -340,6 +356,8 @@ declare const serviceDomainBindingSchema: z.ZodPipe<z.ZodObject<{
health_check_type: z.ZodCatch<z.ZodEnum<{
tcp: "tcp";
http: "http";
ping: "ping";
dns: "dns";
}>>;
health_check_port: z.ZodNullable<z.ZodNumber>;
health_check_path: z.ZodNullable<z.ZodString>;
@@ -360,7 +378,7 @@ declare const serviceDomainBindingSchema: z.ZodPipe<z.ZodObject<{
fqdn: string;
lb_mode: "round_robin" | "failover" | "weighted";
health_check_enabled: boolean;
health_check_type: "tcp" | "http";
health_check_type: "tcp" | "http" | "ping" | "dns";
health_check_port: number | null;
health_check_path: string | null;
health_check_expected_status: number | null;
@@ -377,7 +395,7 @@ declare const serviceDomainBindingSchema: z.ZodPipe<z.ZodObject<{
record_type: "A" | "CNAME";
lb_mode: "round_robin" | "failover" | "weighted";
health_check_enabled: boolean;
health_check_type: "tcp" | "http";
health_check_type: "tcp" | "http" | "ping" | "dns";
health_check_port: number | null;
health_check_path: string | null;
health_check_expected_status: number | null;
@@ -427,6 +445,8 @@ declare const serviceViewSchema: z.ZodObject<{
health_check_type: z.ZodCatch<z.ZodEnum<{
tcp: "tcp";
http: "http";
ping: "ping";
dns: "dns";
}>>;
health_check_port: z.ZodNullable<z.ZodNumber>;
health_check_path: z.ZodNullable<z.ZodString>;
@@ -447,7 +467,7 @@ declare const serviceViewSchema: z.ZodObject<{
fqdn: string;
lb_mode: "round_robin" | "failover" | "weighted";
health_check_enabled: boolean;
health_check_type: "tcp" | "http";
health_check_type: "tcp" | "http" | "ping" | "dns";
health_check_port: number | null;
health_check_path: string | null;
health_check_expected_status: number | null;
@@ -464,7 +484,7 @@ declare const serviceViewSchema: z.ZodObject<{
record_type: "A" | "CNAME";
lb_mode: "round_robin" | "failover" | "weighted";
health_check_enabled: boolean;
health_check_type: "tcp" | "http";
health_check_type: "tcp" | "http" | "ping" | "dns";
health_check_port: number | null;
health_check_path: string | null;
health_check_expected_status: number | null;
@@ -500,6 +520,8 @@ declare const serviceGroupViewSchema: z.ZodObject<{
health_check_type: z.ZodCatch<z.ZodEnum<{
tcp: "tcp";
http: "http";
ping: "ping";
dns: "dns";
}>>;
health_check_port: z.ZodNullable<z.ZodNumber>;
health_check_path: z.ZodNullable<z.ZodString>;
@@ -545,6 +567,8 @@ declare const serviceGroupViewSchema: z.ZodObject<{
health_check_type: z.ZodCatch<z.ZodEnum<{
tcp: "tcp";
http: "http";
ping: "ping";
dns: "dns";
}>>;
health_check_port: z.ZodNullable<z.ZodNumber>;
health_check_path: z.ZodNullable<z.ZodString>;
@@ -565,7 +589,7 @@ declare const serviceGroupViewSchema: z.ZodObject<{
fqdn: string;
lb_mode: "round_robin" | "failover" | "weighted";
health_check_enabled: boolean;
health_check_type: "tcp" | "http";
health_check_type: "tcp" | "http" | "ping" | "dns";
health_check_port: number | null;
health_check_path: string | null;
health_check_expected_status: number | null;
@@ -582,7 +606,7 @@ declare const serviceGroupViewSchema: z.ZodObject<{
record_type: "A" | "CNAME";
lb_mode: "round_robin" | "failover" | "weighted";
health_check_enabled: boolean;
health_check_type: "tcp" | "http";
health_check_type: "tcp" | "http" | "ping" | "dns";
health_check_port: number | null;
health_check_path: string | null;
health_check_expected_status: number | null;
@@ -620,6 +644,8 @@ declare const serviceGroupsResponseSchema: z.ZodObject<{
health_check_type: z.ZodCatch<z.ZodEnum<{
tcp: "tcp";
http: "http";
ping: "ping";
dns: "dns";
}>>;
health_check_port: z.ZodNullable<z.ZodNumber>;
health_check_path: z.ZodNullable<z.ZodString>;
@@ -665,6 +691,8 @@ declare const serviceGroupsResponseSchema: z.ZodObject<{
health_check_type: z.ZodCatch<z.ZodEnum<{
tcp: "tcp";
http: "http";
ping: "ping";
dns: "dns";
}>>;
health_check_port: z.ZodNullable<z.ZodNumber>;
health_check_path: z.ZodNullable<z.ZodString>;
@@ -685,7 +713,7 @@ declare const serviceGroupsResponseSchema: z.ZodObject<{
fqdn: string;
lb_mode: "round_robin" | "failover" | "weighted";
health_check_enabled: boolean;
health_check_type: "tcp" | "http";
health_check_type: "tcp" | "http" | "ping" | "dns";
health_check_port: number | null;
health_check_path: string | null;
health_check_expected_status: number | null;
@@ -702,7 +730,7 @@ declare const serviceGroupsResponseSchema: z.ZodObject<{
record_type: "A" | "CNAME";
lb_mode: "round_robin" | "failover" | "weighted";
health_check_enabled: boolean;
health_check_type: "tcp" | "http";
health_check_type: "tcp" | "http" | "ping" | "dns";
health_check_port: number | null;
health_check_path: string | null;
health_check_expected_status: number | null;
@@ -754,6 +782,8 @@ declare const serviceGroupsResponseSchema: z.ZodObject<{
health_check_type: z.ZodCatch<z.ZodEnum<{
tcp: "tcp";
http: "http";
ping: "ping";
dns: "dns";
}>>;
health_check_port: z.ZodNullable<z.ZodNumber>;
health_check_path: z.ZodNullable<z.ZodString>;
@@ -774,7 +804,7 @@ declare const serviceGroupsResponseSchema: z.ZodObject<{
fqdn: string;
lb_mode: "round_robin" | "failover" | "weighted";
health_check_enabled: boolean;
health_check_type: "tcp" | "http";
health_check_type: "tcp" | "http" | "ping" | "dns";
health_check_port: number | null;
health_check_path: string | null;
health_check_expected_status: number | null;
@@ -791,7 +821,7 @@ declare const serviceGroupsResponseSchema: z.ZodObject<{
record_type: "A" | "CNAME";
lb_mode: "round_robin" | "failover" | "weighted";
health_check_enabled: boolean;
health_check_type: "tcp" | "http";
health_check_type: "tcp" | "http" | "ping" | "dns";
health_check_port: number | null;
health_check_path: string | null;
health_check_expected_status: number | null;
@@ -817,6 +847,11 @@ declare const domainSchema: z.ZodObject<{
required: "required";
skipped: "skipped";
}>>;
environment: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodEnum<{
prod: "prod";
staging: "staging";
dev: "dev";
}>>>>;
last_synced_at: z.ZodNullable<z.ZodString>;
created_at: z.ZodString;
updated_at: z.ZodString;
@@ -832,11 +867,24 @@ declare const domainListItemSchema: z.ZodObject<{
required: "required";
skipped: "skipped";
}>>;
environment: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodEnum<{
prod: "prod";
staging: "staging";
dev: "dev";
}>>>>;
last_synced_at: z.ZodNullable<z.ZodString>;
created_at: z.ZodString;
updated_at: z.ZodString;
group_name: z.ZodNullable<z.ZodString>;
service_count: z.ZodNumber;
health_status: z.ZodDefault<z.ZodEnum<{
unknown: "unknown";
up: "up";
down: "down";
degraded: "degraded";
}>>;
health_latency_ms: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
tags: z.ZodDefault<z.ZodArray<z.ZodString>>;
}, z.core.$strip>;
declare const serviceBindingSchema: z.ZodPipe<z.ZodObject<{
id: z.ZodNumber;
@@ -862,6 +910,8 @@ declare const serviceBindingSchema: z.ZodPipe<z.ZodObject<{
health_check_type: z.ZodCatch<z.ZodEnum<{
tcp: "tcp";
http: "http";
ping: "ping";
dns: "dns";
}>>;
health_check_port: z.ZodNullable<z.ZodNumber>;
health_check_path: z.ZodNullable<z.ZodString>;
@@ -888,7 +938,7 @@ declare const serviceBindingSchema: z.ZodPipe<z.ZodObject<{
target_ip: string | null;
lb_mode: "round_robin" | "failover" | "weighted";
health_check_enabled: boolean;
health_check_type: "tcp" | "http";
health_check_type: "tcp" | "http" | "ping" | "dns";
health_check_port: number | null;
health_check_path: string | null;
health_check_expected_status: number | null;
@@ -911,7 +961,7 @@ declare const serviceBindingSchema: z.ZodPipe<z.ZodObject<{
target_ip: string | null;
lb_mode: "round_robin" | "failover" | "weighted";
health_check_enabled: boolean;
health_check_type: "tcp" | "http";
health_check_type: "tcp" | "http" | "ping" | "dns";
health_check_port: number | null;
health_check_path: string | null;
health_check_expected_status: number | null;
@@ -973,6 +1023,8 @@ declare const healthCheckConfigSchema: z.ZodObject<{
health_check_type: z.ZodOptional<z.ZodEnum<{
tcp: "tcp";
http: "http";
ping: "ping";
dns: "dns";
}>>;
health_check_port: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
health_check_path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -997,6 +1049,8 @@ declare const createServiceWithConfigSchema: z.ZodObject<{
health_check_type: z.ZodOptional<z.ZodEnum<{
tcp: "tcp";
http: "http";
ping: "ping";
dns: "dns";
}>>;
health_check_port: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
health_check_path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -1081,7 +1135,89 @@ declare const updateDomainSchema: z.ZodObject<{
required: "required";
skipped: "skipped";
}>>;
environment: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
prod: "prod";
staging: "staging";
dev: "dev";
}>>>;
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
}, z.core.$strip>;
declare const bulkUpdateDomainsSchema: z.ZodObject<{
ids: z.ZodArray<z.ZodNumber>;
group_id: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
environment: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
prod: "prod";
staging: "staging";
dev: "dev";
}>>>;
tags_add: z.ZodOptional<z.ZodArray<z.ZodString>>;
}, z.core.$strip>;
type BulkUpdateDomainsInput = z.infer<typeof bulkUpdateDomainsSchema>;
declare const domainMonitorSchema: z.ZodObject<{
id: z.ZodNumber;
domain_id: z.ZodNumber;
hostname: z.ZodString;
type: z.ZodEnum<{
http: "http";
ping: "ping";
dns: "dns";
}>;
enabled: z.ZodCoercedBoolean<unknown>;
interval_sec: z.ZodNumber;
timeout_ms: z.ZodNumber;
path: z.ZodNullable<z.ZodString>;
expected_status: z.ZodNullable<z.ZodNumber>;
last_status: z.ZodDefault<z.ZodEnum<{
unknown: "unknown";
up: "up";
down: "down";
degraded: "degraded";
}>>;
last_latency_ms: z.ZodNullable<z.ZodNumber>;
last_checked_at: z.ZodNullable<z.ZodString>;
last_error: z.ZodNullable<z.ZodString>;
created_at: z.ZodString;
updated_at: z.ZodString;
}, z.core.$strip>;
type DomainMonitor = z.infer<typeof domainMonitorSchema>;
declare const createDomainMonitorSchema: z.ZodObject<{
hostname: z.ZodString;
type: z.ZodEnum<{
http: "http";
ping: "ping";
dns: "dns";
}>;
enabled: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
interval_sec: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
timeout_ms: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
expected_status: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
}, z.core.$strip>;
type CreateDomainMonitorInput = z.infer<typeof createDomainMonitorSchema>;
declare const domainMonitorResultSchema: z.ZodObject<{
id: z.ZodNumber;
monitor_id: z.ZodNumber;
status: z.ZodEnum<{
unknown: "unknown";
up: "up";
down: "down";
degraded: "degraded";
}>;
latency_ms: z.ZodNullable<z.ZodNumber>;
error: z.ZodNullable<z.ZodString>;
checked_at: z.ZodString;
}, z.core.$strip>;
type DomainMonitorResult = z.infer<typeof domainMonitorResultSchema>;
declare const notificationLogSchema: z.ZodObject<{
id: z.ZodNumber;
kind: z.ZodString;
ref_type: z.ZodString;
ref_id: z.ZodNullable<z.ZodNumber>;
title: z.ZodString;
message: z.ZodString;
created_at: z.ZodString;
}, z.core.$strip>;
type NotificationLog = z.infer<typeof notificationLogSchema>;
type CreateSubdomainInput = z.infer<typeof createSubdomainSchema>;
type UpdateSubdomainInput = z.infer<typeof updateSubdomainSchema>;
type UpdateDomainInput = z.infer<typeof updateDomainSchema>;
@@ -1100,6 +1236,8 @@ declare const updateServiceConfigSchema: z.ZodObject<{
health_check_type: z.ZodOptional<z.ZodEnum<{
tcp: "tcp";
http: "http";
ping: "ping";
dns: "dns";
}>>;
health_check_port: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
health_check_path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -1124,6 +1262,8 @@ declare const createServiceGroupSchema: z.ZodObject<{
health_check_type: z.ZodOptional<z.ZodEnum<{
tcp: "tcp";
http: "http";
ping: "ping";
dns: "dns";
}>>;
health_check_port: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
health_check_path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -1151,6 +1291,8 @@ declare const updateServiceGroupSchema: z.ZodObject<{
health_check_type: z.ZodOptional<z.ZodEnum<{
tcp: "tcp";
http: "http";
ping: "ping";
dns: "dns";
}>>;
health_check_port: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
health_check_path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -1300,4 +1442,4 @@ declare const vpsTrackerEventSchema: z.ZodObject<{
}, z.core.$strip>;
type VpsTrackerEvent = z.infer<typeof vpsTrackerEventSchema>;
export { type AppSettingsPatch, type AppSwitcherConfig, type AppSwitcherEntry, CERT_ERROR, CERT_EXPIRED, CERT_MONITORING_VALUES, CERT_MONITOR_AUTO, CERT_MONITOR_REQUIRED, CERT_MONITOR_SKIPPED, CERT_OK, CERT_UNKNOWN, CERT_WARNING, type CertMonitoring, type Certificate, type CfDnsRecord, type CfZone, type CfdmBindingSyncItem, type CreateDnsRecordInput, type CreateDnsRecordPayload, type CreateDomainInput, type CreateGroupInput, type CreateServiceBindingInput, type CreateServiceGroupInput, type CreateServiceInput, type CreateServiceWithConfigInput, type CreateSubdomainInput, type DnsRecord, type Domain, type DomainListItem, type Group, type GroupWithStats, type HealthCheckConfig, type HealthCheckScope, type HealthCheckTarget, type HealthCheckType, type HealthStatusQuery, type IpHealthState, type IpHealthStatus, type JwtClaims, type LbMode, type LoginInput, type LoginRequest, type LoginResponse, type ParsedFqdn, type ReorderServicesInput, SYNC_CONFLICT, SYNC_ERROR, SYNC_PENDING_DELETE, SYNC_PENDING_PUSH, SYNC_SYNCED, type Service, type ServiceBinding, type ServiceBindingView, type ServiceDomainBinding, type ServiceDomainBindingView, type ServiceGroup, type ServiceGroupView, type ServiceGroupsResponse, type ServiceView, type Subdomain, type SubdomainRecord, type SyncJob, type ToggleEnabledInput, type UpdateDomainInput, type UpdateServiceConfigInput, type UpdateServiceGroupInput, type UpdateSubdomainInput, ValidationError, type VpsTrackerEvent, appSettingsPatchSchema, appSwitcherConfigSchema, appSwitcherEntrySchema, appSwitcherIconSchema, bindingToFqdn, certMonitoringSchema, certStatusFromExpiry, certificateSchema, cfdmBindingSyncItemSchema, cfdmSyncBindingsBodySchema, createDnsRecordSchema, createDomainSchema, createGroupSchema, createServiceBindingSchema, createServiceGroupSchema, createServiceSchema, createServiceWithConfigSchema, createSubdomainSchema, dnsNameToSubdomainLabel, dnsRecordNamesMatch, dnsRecordSchema, domainListItemSchema, domainSchema, fqdnToDisplay, groupSchema, groupWithStatsSchema, healthCheckConfigSchema, healthCheckScopeSchema, healthCheckTypeSchema, healthStatusQuerySchema, ipHealthStateSchema, ipHealthStatusSchema, isValidIpv4, lbModeSchema, loginSchema, normalizeDnsRecordName, parseFqdn, reorderServicesSchema, serviceBindingSchema, serviceDomainBindingSchema, serviceGroupSchema, serviceGroupTypeSchema, serviceGroupViewSchema, serviceGroupsResponseSchema, serviceSchema, serviceViewSchema, shouldMonitorService, subdomainLabelToFqdn, subdomainSchema, toggleEnabledSchema, updateDomainGroupSchema, updateDomainSchema, updateServiceConfigSchema, updateServiceGroupSchema, updateSubdomainSchema, validateDnsRecord, vpsTrackerEventSchema };
export { type AppSettingsPatch, type AppSwitcherConfig, type AppSwitcherEntry, type BulkUpdateDomainsInput, CERT_ERROR, CERT_EXPIRED, CERT_MONITORING_VALUES, CERT_MONITOR_AUTO, CERT_MONITOR_REQUIRED, CERT_MONITOR_SKIPPED, CERT_OK, CERT_UNKNOWN, CERT_WARNING, type CertMonitoring, type Certificate, type CfDnsRecord, type CfZone, type CfdmBindingSyncItem, type CreateDnsRecordInput, type CreateDnsRecordPayload, type CreateDomainInput, type CreateDomainMonitorInput, type CreateGroupInput, type CreateServiceBindingInput, type CreateServiceGroupInput, type CreateServiceInput, type CreateServiceWithConfigInput, type CreateSubdomainInput, type DnsRecord, type Domain, type DomainEnvironment, type DomainListItem, type DomainMonitor, type DomainMonitorResult, type DomainMonitorType, type Group, type GroupWithStats, type HealthCheckConfig, type HealthCheckScope, type HealthCheckTarget, type HealthCheckType, type HealthStatusQuery, type IpHealthState, type IpHealthStatus, type JwtClaims, type LbMode, type LoginInput, type LoginRequest, type LoginResponse, type NotificationLog, type ParsedFqdn, type ReorderServicesInput, SYNC_CONFLICT, SYNC_ERROR, SYNC_PENDING_DELETE, SYNC_PENDING_PUSH, SYNC_SYNCED, type Service, type ServiceBinding, type ServiceBindingView, type ServiceDomainBinding, type ServiceDomainBindingView, type ServiceGroup, type ServiceGroupView, type ServiceGroupsResponse, type ServiceView, type Subdomain, type SubdomainRecord, type SyncJob, type ToggleEnabledInput, type UpdateDomainInput, type UpdateServiceConfigInput, type UpdateServiceGroupInput, type UpdateSubdomainInput, ValidationError, type VpsTrackerEvent, appSettingsPatchSchema, appSwitcherConfigSchema, appSwitcherEntrySchema, appSwitcherIconSchema, bindingToFqdn, bulkUpdateDomainsSchema, certMonitoringSchema, certStatusFromExpiry, certificateSchema, cfdmBindingSyncItemSchema, cfdmSyncBindingsBodySchema, createDnsRecordSchema, createDomainMonitorSchema, createDomainSchema, createGroupSchema, createServiceBindingSchema, createServiceGroupSchema, createServiceSchema, createServiceWithConfigSchema, createSubdomainSchema, dnsNameToSubdomainLabel, dnsRecordNamesMatch, dnsRecordSchema, domainEnvironmentSchema, domainListItemSchema, domainMonitorResultSchema, domainMonitorSchema, domainMonitorTypeSchema, domainSchema, fqdnToDisplay, groupSchema, groupWithStatsSchema, healthCheckConfigSchema, healthCheckScopeSchema, healthCheckTypeSchema, healthStatusQuerySchema, ipHealthStateSchema, ipHealthStatusSchema, isValidIpv4, lbModeSchema, loginSchema, normalizeDnsRecordName, notificationLogSchema, parseFqdn, reorderServicesSchema, serviceBindingSchema, serviceDomainBindingSchema, serviceGroupSchema, serviceGroupTypeSchema, serviceGroupViewSchema, serviceGroupsResponseSchema, serviceSchema, serviceViewSchema, shouldMonitorService, subdomainLabelToFqdn, subdomainSchema, toggleEnabledSchema, updateDomainGroupSchema, updateDomainSchema, updateServiceConfigSchema, updateServiceGroupSchema, updateSubdomainSchema, validateDnsRecord, vpsTrackerEventSchema };
+67 -3
View File
@@ -161,7 +161,9 @@ function bindingToFqdn(binding) {
import { z } from "zod";
var certMonitoringSchema = z.enum(["auto", "required", "skipped"]);
var lbModeSchema = z.enum(["round_robin", "failover", "weighted"]);
var healthCheckTypeSchema = z.enum(["tcp", "http"]);
var healthCheckTypeSchema = z.enum(["tcp", "http", "ping", "dns"]);
var domainEnvironmentSchema = z.enum(["prod", "staging", "dev"]);
var domainMonitorTypeSchema = z.enum(["http", "ping", "dns"]);
var ipHealthStateSchema = z.enum(["up", "down", "degraded", "unknown"]);
var healthCheckScopeSchema = z.enum(["binding", "group"]);
var ipHealthStatusSchema = z.object({
@@ -271,13 +273,17 @@ var domainSchema = z.object({
cf_zone_id: z.string(),
status: z.string(),
cert_monitoring: certMonitoringSchema.default("auto"),
environment: domainEnvironmentSchema.nullable().optional().default(null),
last_synced_at: z.string().nullable(),
created_at: z.string(),
updated_at: z.string()
});
var domainListItemSchema = domainSchema.extend({
group_name: z.string().nullable(),
service_count: z.number()
service_count: z.number(),
health_status: ipHealthStateSchema.default("unknown"),
health_latency_ms: z.number().nullable().default(null),
tags: z.array(z.string()).default([])
});
var serviceBindingSchema = z.object({
id: z.number(),
@@ -440,7 +446,58 @@ var updateSubdomainSchema = z.object({
var updateDomainSchema = z.object({
group_id: z.number().nullable().optional(),
status: z.string().optional(),
cert_monitoring: certMonitoringSchema.optional()
cert_monitoring: certMonitoringSchema.optional(),
environment: domainEnvironmentSchema.nullable().optional(),
tags: z.array(z.string().min(1).max(64)).max(20).optional()
});
var bulkUpdateDomainsSchema = z.object({
ids: z.array(z.number().int().positive()).min(1),
group_id: z.number().nullable().optional(),
environment: domainEnvironmentSchema.nullable().optional(),
tags_add: z.array(z.string().min(1).max(64)).max(20).optional()
});
var domainMonitorSchema = z.object({
id: z.number(),
domain_id: z.number(),
hostname: z.string(),
type: domainMonitorTypeSchema,
enabled: z.coerce.boolean(),
interval_sec: z.number(),
timeout_ms: z.number(),
path: z.string().nullable(),
expected_status: z.number().nullable(),
last_status: ipHealthStateSchema.default("unknown"),
last_latency_ms: z.number().nullable(),
last_checked_at: z.string().nullable(),
last_error: z.string().nullable(),
created_at: z.string(),
updated_at: z.string()
});
var createDomainMonitorSchema = z.object({
hostname: z.string().min(1),
type: domainMonitorTypeSchema,
enabled: z.boolean().optional().default(true),
interval_sec: z.number().int().min(10).max(3600).optional().default(60),
timeout_ms: z.number().int().min(500).max(3e4).optional().default(5e3),
path: z.string().nullable().optional(),
expected_status: z.number().int().min(100).max(599).nullable().optional()
});
var domainMonitorResultSchema = z.object({
id: z.number(),
monitor_id: z.number(),
status: ipHealthStateSchema,
latency_ms: z.number().nullable(),
error: z.string().nullable(),
checked_at: z.string()
});
var notificationLogSchema = z.object({
id: z.number(),
kind: z.string(),
ref_type: z.string(),
ref_id: z.number().nullable(),
title: z.string(),
message: z.string(),
created_at: z.string()
});
var updateServiceConfigSchema = z.object({
name: z.string().min(1, "\u0423\u043A\u0430\u0436\u0438\u0442\u0435 \u043D\u0430\u0437\u0432\u0430\u043D\u0438\u0435").optional(),
@@ -555,12 +612,14 @@ export {
appSwitcherEntrySchema,
appSwitcherIconSchema,
bindingToFqdn,
bulkUpdateDomainsSchema,
certMonitoringSchema,
certStatusFromExpiry,
certificateSchema,
cfdmBindingSyncItemSchema,
cfdmSyncBindingsBodySchema,
createDnsRecordSchema,
createDomainMonitorSchema,
createDomainSchema,
createGroupSchema,
createServiceBindingSchema,
@@ -571,7 +630,11 @@ export {
dnsNameToSubdomainLabel,
dnsRecordNamesMatch,
dnsRecordSchema,
domainEnvironmentSchema,
domainListItemSchema,
domainMonitorResultSchema,
domainMonitorSchema,
domainMonitorTypeSchema,
domainSchema,
fqdnToDisplay,
groupSchema,
@@ -586,6 +649,7 @@ export {
lbModeSchema,
loginSchema,
normalizeDnsRecordName,
notificationLogSchema,
parseFqdn,
reorderServicesSchema,
serviceBindingSchema,
+77 -1
View File
@@ -7,9 +7,15 @@ export type CertMonitoring = z.infer<typeof certMonitoringSchema>
export const lbModeSchema = z.enum(['round_robin', 'failover', 'weighted'])
export type LbMode = z.infer<typeof lbModeSchema>
export const healthCheckTypeSchema = z.enum(['tcp', 'http'])
export const healthCheckTypeSchema = z.enum(['tcp', 'http', 'ping', 'dns'])
export type HealthCheckType = z.infer<typeof healthCheckTypeSchema>
export const domainEnvironmentSchema = z.enum(['prod', 'staging', 'dev'])
export type DomainEnvironment = z.infer<typeof domainEnvironmentSchema>
export const domainMonitorTypeSchema = z.enum(['http', 'ping', 'dns'])
export type DomainMonitorType = z.infer<typeof domainMonitorTypeSchema>
export const ipHealthStateSchema = z.enum(['up', 'down', 'degraded', 'unknown'])
export type IpHealthState = z.infer<typeof ipHealthStateSchema>
@@ -144,6 +150,7 @@ export const domainSchema = z.object({
cf_zone_id: z.string(),
status: z.string(),
cert_monitoring: certMonitoringSchema.default('auto'),
environment: domainEnvironmentSchema.nullable().optional().default(null),
last_synced_at: z.string().nullable(),
created_at: z.string(),
updated_at: z.string(),
@@ -152,6 +159,9 @@ export const domainSchema = z.object({
export const domainListItemSchema = domainSchema.extend({
group_name: z.string().nullable(),
service_count: z.number(),
health_status: ipHealthStateSchema.default('unknown'),
health_latency_ms: z.number().nullable().default(null),
tags: z.array(z.string()).default([]),
})
export const serviceBindingSchema = z
@@ -361,8 +371,74 @@ export const updateDomainSchema = z.object({
group_id: z.number().nullable().optional(),
status: z.string().optional(),
cert_monitoring: certMonitoringSchema.optional(),
environment: domainEnvironmentSchema.nullable().optional(),
tags: z.array(z.string().min(1).max(64)).max(20).optional(),
})
export const bulkUpdateDomainsSchema = z.object({
ids: z.array(z.number().int().positive()).min(1),
group_id: z.number().nullable().optional(),
environment: domainEnvironmentSchema.nullable().optional(),
tags_add: z.array(z.string().min(1).max(64)).max(20).optional(),
})
export type BulkUpdateDomainsInput = z.infer<typeof bulkUpdateDomainsSchema>
export const domainMonitorSchema = z.object({
id: z.number(),
domain_id: z.number(),
hostname: z.string(),
type: domainMonitorTypeSchema,
enabled: z.coerce.boolean(),
interval_sec: z.number(),
timeout_ms: z.number(),
path: z.string().nullable(),
expected_status: z.number().nullable(),
last_status: ipHealthStateSchema.default('unknown'),
last_latency_ms: z.number().nullable(),
last_checked_at: z.string().nullable(),
last_error: z.string().nullable(),
created_at: z.string(),
updated_at: z.string(),
})
export type DomainMonitor = z.infer<typeof domainMonitorSchema>
export const createDomainMonitorSchema = z.object({
hostname: z.string().min(1),
type: domainMonitorTypeSchema,
enabled: z.boolean().optional().default(true),
interval_sec: z.number().int().min(10).max(3600).optional().default(60),
timeout_ms: z.number().int().min(500).max(30000).optional().default(5000),
path: z.string().nullable().optional(),
expected_status: z.number().int().min(100).max(599).nullable().optional(),
})
export type CreateDomainMonitorInput = z.infer<typeof createDomainMonitorSchema>
export const domainMonitorResultSchema = z.object({
id: z.number(),
monitor_id: z.number(),
status: ipHealthStateSchema,
latency_ms: z.number().nullable(),
error: z.string().nullable(),
checked_at: z.string(),
})
export type DomainMonitorResult = z.infer<typeof domainMonitorResultSchema>
export const notificationLogSchema = z.object({
id: z.number(),
kind: z.string(),
ref_type: z.string(),
ref_id: z.number().nullable(),
title: z.string(),
message: z.string(),
created_at: z.string(),
})
export type NotificationLog = z.infer<typeof notificationLogSchema>
export type CreateSubdomainInput = z.infer<typeof createSubdomainSchema>
export type UpdateSubdomainInput = z.infer<typeof updateSubdomainSchema>
export type UpdateDomainInput = z.infer<typeof updateDomainSchema>
+9 -1
View File
@@ -55,6 +55,7 @@ export interface Domain {
cf_zone_id: string;
status: string;
cert_monitoring: string;
environment: DomainEnvironment | null;
last_synced_at: string | null;
created_at: string;
updated_at: string;
@@ -193,6 +194,9 @@ export interface GroupWithStats extends Group {
export interface DomainListItem extends Domain {
group_name: string | null;
service_count: number;
health_status: IpHealthState;
health_latency_ms: number | null;
tags: string[];
}
export interface SyncJob {
@@ -246,7 +250,11 @@ export interface JwtClaims {
export type LbMode = "round_robin" | "failover" | "weighted";
export type HealthCheckType = "tcp" | "http";
export type HealthCheckType = "tcp" | "http" | "ping" | "dns";
export type DomainEnvironment = "prod" | "staging" | "dev";
export type DomainMonitorType = "http" | "ping" | "dns";
export type IpHealthState = "up" | "down" | "degraded" | "unknown";