import { z } from 'zod'; import { ConnectionParamsSchema, DeviceParamsSchema, ClientParamsSchema, MonitoringParamsSchema, FirewallRuleParamsSchema, ZoneParamsSchema } from '../unifi/types.js'; /** * Comprehensive Validation System for UniFi MCP Server * * Provides input validation, schema validation, and data sanitization * for all UniFi API interactions and tool parameters. */ export declare const IPAddressSchema: z.ZodEffects; export declare const MACAddressSchema: z.ZodEffects; export declare const PortSchema: z.ZodUnion<[z.ZodNumber, z.ZodEffects]>; export declare const PortRangeSchema: z.ZodEffects; export declare const CIDRSchema: z.ZodEffects; export declare const VLANIdSchema: z.ZodNumber; export declare const ScheduleTimeSchema: z.ZodEffects; export declare const DayOfWeekSchema: z.ZodEnum<["monday", "tuesday", "wednesday", "thursday", "friday", "saturday", "sunday"]>; export declare const ConnectToolParamsSchema: z.ZodObject<{ gatewayIp: z.ZodString; apiKey: z.ZodString; siteId: z.ZodDefault; } & { verifySSL: z.ZodDefault; timeout: z.ZodDefault; maxRetries: z.ZodDefault; }, "strip", z.ZodTypeAny, { gatewayIp: string; apiKey: string; siteId: string; verifySSL: boolean; timeout: number; maxRetries: number; }, { gatewayIp: string; apiKey: string; siteId?: string | undefined; verifySSL?: boolean | undefined; timeout?: number | undefined; maxRetries?: number | undefined; }>; export declare const DeviceManagementParamsSchema: z.ZodObject<{ deviceId: z.ZodOptional; deviceType: z.ZodOptional>; status: z.ZodOptional>; } & { includeStats: z.ZodDefault; includeClients: z.ZodDefault; }, "strip", z.ZodTypeAny, { includeStats: boolean; includeClients: boolean; status?: import("../unifi/types.js").DeviceStatus | undefined; deviceId?: string | undefined; deviceType?: import("../unifi/types.js").DeviceType | undefined; }, { status?: import("../unifi/types.js").DeviceStatus | undefined; deviceId?: string | undefined; deviceType?: import("../unifi/types.js").DeviceType | undefined; includeStats?: boolean | undefined; includeClients?: boolean | undefined; }>; export declare const ClientManagementParamsSchema: z.ZodObject<{ clientId: z.ZodOptional; activeOnly: z.ZodDefault; networkId: z.ZodOptional; clientType: z.ZodOptional>; blocked: z.ZodOptional; limit: z.ZodDefault; } & { includeTraffic: z.ZodDefault; sortBy: z.ZodOptional>; sortOrder: z.ZodDefault>; }, "strip", z.ZodTypeAny, { activeOnly: boolean; includeTraffic: boolean; sortOrder: "asc" | "desc"; limit: number; networkId?: string | undefined; blocked?: boolean | undefined; clientId?: string | undefined; clientType?: import("../unifi/types.js").ClientType | undefined; sortBy?: "name" | "lastSeen" | "txBytes" | "rxBytes" | "mac" | "ip" | undefined; }, { networkId?: string | undefined; blocked?: boolean | undefined; clientId?: string | undefined; activeOnly?: boolean | undefined; clientType?: import("../unifi/types.js").ClientType | undefined; includeTraffic?: boolean | undefined; sortBy?: "name" | "lastSeen" | "txBytes" | "rxBytes" | "mac" | "ip" | undefined; sortOrder?: "asc" | "desc" | undefined; limit?: number | undefined; }>; export declare const CreateFirewallRuleParamsSchema: z.ZodObject<{ name: z.ZodString; enabled: z.ZodDefault; action: z.ZodEnum<["allow", "deny", "reject"]>; protocol: z.ZodEnum<["tcp", "udp", "icmp", "any"]>; source: z.ZodUnion<[z.ZodEffects, z.ZodEffects, z.ZodLiteral<"any">]>; destination: z.ZodUnion<[z.ZodEffects, z.ZodEffects, z.ZodLiteral<"any">]>; sourcePort: z.ZodOptional>; destinationPort: z.ZodOptional>; priority: z.ZodDefault; logging: z.ZodDefault; description: z.ZodOptional; }, "strip", z.ZodTypeAny, { name: string; enabled: boolean; action: "allow" | "deny" | "reject"; protocol: "tcp" | "udp" | "icmp" | "any"; priority: number; logging: boolean; source: string; destination: string; description?: string | undefined; sourcePort?: string | undefined; destinationPort?: string | undefined; }, { name: string; action: "allow" | "deny" | "reject"; protocol: "tcp" | "udp" | "icmp" | "any"; source: string; destination: string; enabled?: boolean | undefined; priority?: number | undefined; logging?: boolean | undefined; description?: string | undefined; sourcePort?: string | undefined; destinationPort?: string | undefined; }>; export declare const CreateZoneParamsSchema: z.ZodObject<{ name: z.ZodEffects; description: z.ZodOptional; networks: z.ZodArray; interfaces: z.ZodDefault>; enabled: z.ZodDefault; }, "strip", z.ZodTypeAny, { name: string; enabled: boolean; networks: string[]; interfaces: string[]; description?: string | undefined; }, { name: string; networks: string[]; enabled?: boolean | undefined; description?: string | undefined; interfaces?: string[] | undefined; }>; export declare const CreateZonePolicyParamsSchema: z.ZodEffects; applications: z.ZodOptional>; ports: z.ZodOptional, "many">>; logging: z.ZodDefault; enabled: z.ZodDefault; priority: z.ZodDefault; description: z.ZodOptional; }, "strip", z.ZodTypeAny, { enabled: boolean; action: "allow" | "deny" | "reject"; priority: number; logging: boolean; sourceZone: string; targetZone: string; description?: string | undefined; applications?: string[] | undefined; ports?: string[] | undefined; }, { action: "allow" | "deny" | "reject"; sourceZone: string; targetZone: string; enabled?: boolean | undefined; priority?: number | undefined; logging?: boolean | undefined; description?: string | undefined; applications?: string[] | undefined; ports?: string[] | undefined; }>, { enabled: boolean; action: "allow" | "deny" | "reject"; priority: number; logging: boolean; sourceZone: string; targetZone: string; description?: string | undefined; applications?: string[] | undefined; ports?: string[] | undefined; }, { action: "allow" | "deny" | "reject"; sourceZone: string; targetZone: string; enabled?: boolean | undefined; priority?: number | undefined; logging?: boolean | undefined; description?: string | undefined; applications?: string[] | undefined; ports?: string[] | undefined; }>; export declare const CreateNetworkParamsSchema: z.ZodObject<{ name: z.ZodString; purpose: z.ZodEnum<["corporate", "guest", "wan", "vlan-only", "vpn"]>; vlanId: z.ZodOptional; subnet: z.ZodEffects; gateway: z.ZodEffects; dhcpEnabled: z.ZodDefault; dhcpRange: z.ZodOptional; end: z.ZodEffects; }, "strip", z.ZodTypeAny, { start: string; end: string; }, { start: string; end: string; }>>; domainName: z.ZodOptional; enabled: z.ZodDefault; }, "strip", z.ZodTypeAny, { name: string; purpose: "vpn" | "corporate" | "guest" | "wan" | "vlan-only"; subnet: string; gateway: string; dhcpEnabled: boolean; enabled: boolean; vlanId?: number | undefined; dhcpRange?: { start: string; end: string; } | undefined; domainName?: string | undefined; }, { name: string; purpose: "vpn" | "corporate" | "guest" | "wan" | "vlan-only"; subnet: string; gateway: string; vlanId?: number | undefined; dhcpEnabled?: boolean | undefined; dhcpRange?: { start: string; end: string; } | undefined; enabled?: boolean | undefined; domainName?: string | undefined; }>; export declare const CreateIPGroupParamsSchema: z.ZodObject<{ name: z.ZodString; type: z.ZodEnum<["address-group", "port-group", "ipv6-address-group"]>; members: z.ZodArray; description: z.ZodOptional; }, "strip", z.ZodTypeAny, { type: "address-group" | "port-group" | "ipv6-address-group"; name: string; members: string[]; description?: string | undefined; }, { type: "address-group" | "port-group" | "ipv6-address-group"; name: string; members: string[]; description?: string | undefined; }>; export declare const ScheduleParamsSchema: z.ZodEffects, "many">; startTime: z.ZodEffects; endTime: z.ZodEffects; timezone: z.ZodOptional; }, "strip", z.ZodTypeAny, { days: ("monday" | "tuesday" | "wednesday" | "thursday" | "friday" | "saturday" | "sunday")[]; startTime: string; endTime: string; timezone?: string | undefined; }, { days: ("monday" | "tuesday" | "wednesday" | "thursday" | "friday" | "saturday" | "sunday")[]; startTime: string; endTime: string; timezone?: string | undefined; }>, { days: ("monday" | "tuesday" | "wednesday" | "thursday" | "friday" | "saturday" | "sunday")[]; startTime: string; endTime: string; timezone?: string | undefined; }, { days: ("monday" | "tuesday" | "wednesday" | "thursday" | "friday" | "saturday" | "sunday")[]; startTime: string; endTime: string; timezone?: string | undefined; }>; export declare const BulkOperationParamsSchema: z.ZodObject<{ operation: z.ZodEnum<["restart", "adopt", "upgrade", "block", "unblock"]>; deviceIds: z.ZodArray; force: z.ZodDefault; description: z.ZodOptional; }, "strip", z.ZodTypeAny, { operation: "restart" | "adopt" | "upgrade" | "block" | "unblock"; deviceIds: string[]; force: boolean; description?: string | undefined; }, { operation: "restart" | "adopt" | "upgrade" | "block" | "unblock"; deviceIds: string[]; description?: string | undefined; force?: boolean | undefined; }>; export declare class ValidationService { /** * Validate and parse input data using a Zod schema */ static validate(schema: z.ZodSchema, data: unknown, context?: string): Promise; /** * Validate connection parameters */ static validateConnectionParams(params: unknown): Promise>; /** * Validate device management parameters */ static validateDeviceParams(params: unknown): Promise>; /** * Validate client management parameters */ static validateClientParams(params: unknown): Promise>; /** * Validate firewall rule creation parameters */ static validateCreateFirewallRuleParams(params: unknown): Promise>; /** * Validate zone creation parameters */ static validateCreateZoneParams(params: unknown): Promise>; /** * Validate zone policy creation parameters */ static validateCreateZonePolicyParams(params: unknown): Promise>; /** * Validate network creation parameters */ static validateCreateNetworkParams(params: unknown): Promise>; /** * Validate IP group creation parameters */ static validateCreateIPGroupParams(params: unknown): Promise>; /** * Validate schedule parameters */ static validateScheduleParams(params: unknown): Promise>; /** * Validate bulk operation parameters */ static validateBulkOperationParams(params: unknown): Promise>; /** * Validate monitoring parameters */ static validateMonitoringParams(params: unknown): Promise>; /** * Sanitize string input */ static sanitizeString(input: string, maxLength?: number): string; /** * Validate IP address */ static validateIPAddress(ip: string): boolean; /** * Validate MAC address */ static validateMACAddress(mac: string): boolean; /** * Validate CIDR notation */ static validateCIDR(cidr: string): boolean; /** * Validate port or port range */ static validatePort(port: string | number): boolean; /** * Validate VLAN ID */ static validateVLANId(vlanId: number): boolean; /** * Check if a network range contains an IP address */ static isIPInRange(ip: string, cidr: string): boolean; /** * Convert IP address to number for calculations */ private static ipToNumber; /** * Validate multiple items at once */ static validateMany(schema: z.ZodSchema, items: unknown[], context?: string): Promise; /** * Create a conditional validator that checks dependencies */ static createConditionalValidator(baseSchema: z.ZodSchema, conditions: Array<{ when: (data: any) => boolean; then: z.ZodSchema; message?: string; }>): z.ZodSchema; } export declare function isValidIPv4(ip: string): boolean; export declare function isValidMAC(mac: string): boolean; export declare function isValidCIDR(cidr: string): boolean; export declare function isValidPort(port: string | number): boolean; export declare function isValidVLAN(vlanId: number): boolean; export declare function normalizeMAC(mac: string): string; export declare function normalizeIP(ip: string): string; //# sourceMappingURL=validators.d.ts.map