import { z } from 'zod'; /** * UniFi Network API Type Definitions * * Comprehensive TypeScript types for UniFi Network Application API, * supporting both legacy firewall and Zone-Based Firewall (ZBF) systems. */ export declare enum DeviceType { GATEWAY = "ugw", SWITCH = "usw", ACCESS_POINT = "uap", PROTECT = "protect", CAMERA = "camera", DOORBELL = "doorbell", SENSOR = "sensor" } export declare enum DeviceStatus { ONLINE = "online", OFFLINE = "offline", UPGRADING = "upgrading", PROVISIONING = "provisioning", ADOPTING = "adopting", HEARTBEAT_MISSED = "heartbeat_missed" } export declare enum ClientType { WIRED = "wired", WIRELESS = "wireless", VPN = "vpn" } export declare enum FirewallAction { ALLOW = "allow", DENY = "deny", REJECT = "reject", DROP = "drop" } export declare enum Protocol { TCP = "tcp", UDP = "udp", ICMP = "icmp", ANY = "any", ALL = "all" } export declare enum NetworkPurpose { CORPORATE = "corporate", GUEST = "guest", WAN = "wan", VLAN_ONLY = "vlan-only", VPN = "vpn" } export declare const UniFiConfigSchema: z.ZodObject<{ gatewayIp: z.ZodString; apiKey: z.ZodString; siteId: z.ZodDefault; verifySSL: z.ZodDefault; timeout: z.ZodDefault; maxRetries: z.ZodDefault; port: z.ZodOptional; }, "strip", z.ZodTypeAny, { gatewayIp: string; apiKey: string; siteId: string; verifySSL: boolean; timeout: number; maxRetries: number; port?: number | undefined; }, { gatewayIp: string; apiKey: string; siteId?: string | undefined; verifySSL?: boolean | undefined; timeout?: number | undefined; maxRetries?: number | undefined; port?: number | undefined; }>; export type UniFiConfig = z.infer; export interface AuthenticationHeaders { 'X-API-KEY': string; 'Content-Type': 'application/json'; 'Accept': 'application/json'; [key: string]: string; } export interface SystemInfo { version: string; buildNumber: string; buildTimestamp: number; hostname: string; timezone: string; uptime: number; firewallMode: 'legacy' | 'zbf'; zbfSupported: boolean; hardwareModel: string; hardwareRevision: string; ubntNetworkApplicationVersion: string; } export interface VersionInfo { version: string; supportsZBF: boolean; supportedFeatures: string[]; deprecatedEndpoints: string[]; newEndpoints: string[]; } export declare const DeviceSchema: z.ZodObject<{ id: z.ZodString; name: z.ZodString; type: z.ZodNativeEnum; model: z.ZodString; version: z.ZodString; status: z.ZodNativeEnum; ipAddress: z.ZodOptional; macAddress: z.ZodString; adopted: z.ZodBoolean; lastSeen: z.ZodDate; uptime: z.ZodOptional; bytes: z.ZodOptional; txBytes: z.ZodOptional; rxBytes: z.ZodOptional; totalBytes: z.ZodOptional; }, "strip", z.ZodTypeAny, { type: DeviceType; status: DeviceStatus; id: string; name: string; model: string; version: string; macAddress: string; adopted: boolean; lastSeen: Date; ipAddress?: string | undefined; uptime?: number | undefined; bytes?: number | undefined; txBytes?: number | undefined; rxBytes?: number | undefined; totalBytes?: number | undefined; }, { type: DeviceType; status: DeviceStatus; id: string; name: string; model: string; version: string; macAddress: string; adopted: boolean; lastSeen: Date; ipAddress?: string | undefined; uptime?: number | undefined; bytes?: number | undefined; txBytes?: number | undefined; rxBytes?: number | undefined; totalBytes?: number | undefined; }>; export type Device = z.infer; export interface DeviceStats { cpuUsage: number; memoryUsage: number; temperature: number; uptime: number; bytesReceived: number; bytesTransmitted: number; packetsReceived: number; packetsTransmitted: number; lastUpdated: Date; } export interface DetailedDevice extends Device { serialNumber: string; firmwareVersion: string; configuredAt: Date; provisionedAt?: Date; connectedVia?: string; ports?: DevicePort[]; radioTable?: RadioInfo[]; stats?: DeviceStats; } export interface DevicePort { portIdx: number; name: string; enable: boolean; portPoe: boolean; poeMode: string; speed: number; fullDuplex: boolean; rxBytes: number; txBytes: number; rxPackets: number; txPackets: number; } export interface RadioInfo { name: string; radio: string; channel: number; ht: number; txPower: number; minRssi: number; maxRssi: number; nss: number; } export declare const ClientSchema: z.ZodObject<{ id: z.ZodString; mac: z.ZodString; name: z.ZodOptional; hostname: z.ZodOptional; ip: z.ZodOptional; networkId: z.ZodString; deviceMac: z.ZodOptional; type: z.ZodNativeEnum; connected: z.ZodBoolean; firstSeen: z.ZodDate; lastSeen: z.ZodDate; rxBytes: z.ZodNumber; txBytes: z.ZodNumber; blocked: z.ZodDefault; noted: z.ZodDefault; }, "strip", z.ZodTypeAny, { type: ClientType; id: string; lastSeen: Date; txBytes: number; rxBytes: number; mac: string; networkId: string; connected: boolean; firstSeen: Date; blocked: boolean; noted: boolean; name?: string | undefined; hostname?: string | undefined; ip?: string | undefined; deviceMac?: string | undefined; }, { type: ClientType; id: string; lastSeen: Date; txBytes: number; rxBytes: number; mac: string; networkId: string; connected: boolean; firstSeen: Date; name?: string | undefined; hostname?: string | undefined; ip?: string | undefined; deviceMac?: string | undefined; blocked?: boolean | undefined; noted?: boolean | undefined; }>; export type Client = z.infer; export interface DetailedClient extends Client { oui: string; os: string; osName: string; deviceName: string; usergroup: string; use_fixedip: boolean; fixed_ip: string; network: string; essid?: string; channel?: number; radio?: string; signal?: number; noise?: number; rssi?: number; ccq?: number; satisfaction?: number; anomalies?: number; uptime?: number; txRate?: number; rxRate?: number; powersave_enabled?: boolean; is_11r?: boolean; user_id?: string; vlan?: number; } export declare const NetworkSchema: z.ZodObject<{ id: z.ZodString; name: z.ZodString; purpose: z.ZodNativeEnum; vlanId: z.ZodOptional; subnet: z.ZodString; gateway: z.ZodString; dhcpEnabled: z.ZodDefault; dhcpRange: z.ZodOptional>; enabled: z.ZodDefault; isNat: z.ZodDefault; domainName: z.ZodOptional; networkGroup: z.ZodOptional; }, "strip", z.ZodTypeAny, { id: string; name: string; purpose: NetworkPurpose; subnet: string; gateway: string; dhcpEnabled: boolean; enabled: boolean; isNat: boolean; vlanId?: number | undefined; dhcpRange?: { start: string; end: string; } | undefined; domainName?: string | undefined; networkGroup?: string | undefined; }, { id: string; name: string; purpose: NetworkPurpose; subnet: string; gateway: string; vlanId?: number | undefined; dhcpEnabled?: boolean | undefined; dhcpRange?: { start: string; end: string; } | undefined; enabled?: boolean | undefined; isNat?: boolean | undefined; domainName?: string | undefined; networkGroup?: string | undefined; }>; export type Network = z.infer; export interface DetailedNetwork extends Network { upProfile?: string; wanNetworkgroup?: string; wanType?: string; wanIp?: string; wanGateway?: string; wanDns1?: string; wanDns2?: string; wanUsername?: string; vpnType?: string; radiusProfile?: string; xWanPassword?: string; lteApn?: string; internetAccessEnabled?: boolean; intraNetworkAccessEnabled?: boolean; dhcpServerEnabled?: boolean; dhcpLeaseTime?: number; dhcpDns1?: string; dhcpDns2?: string; dhcpNtp?: string; dhcpLeasetime?: number; ipv6InterfaceType?: string; ipv6RaEnabled?: boolean; dhcpv6Enabled?: boolean; } export declare const FirewallRuleSchema: z.ZodObject<{ id: z.ZodString; name: z.ZodString; enabled: z.ZodDefault; action: z.ZodNativeEnum; protocol: z.ZodNativeEnum; src: z.ZodString; dst: z.ZodString; srcPort: z.ZodOptional; dstPort: z.ZodOptional; priority: z.ZodDefault; logging: z.ZodDefault; state: z.ZodOptional>; }, "strip", z.ZodTypeAny, { id: string; name: string; enabled: boolean; action: FirewallAction; protocol: Protocol; src: string; dst: string; priority: number; logging: boolean; srcPort?: string | undefined; dstPort?: string | undefined; state?: "new" | "established" | "related" | "invalid" | undefined; }, { id: string; name: string; action: FirewallAction; protocol: Protocol; src: string; dst: string; enabled?: boolean | undefined; srcPort?: string | undefined; dstPort?: string | undefined; priority?: number | undefined; logging?: boolean | undefined; state?: "new" | "established" | "related" | "invalid" | undefined; }>; export type FirewallRule = z.infer; export interface DetailedFirewallRule extends FirewallRule { ruleIndex: number; ipsec: string; srcFirewallgroupIds: string[]; dstFirewallgroupIds: string[]; srcMacAddress: string; protocolMatchExcepted: boolean; icmpTypename: string; srcNetworkconfId: string; srcNetworkconfType: string; dstNetworkconfId: string; dstNetworkconfType: string; ruleSet: string; } export declare const FirewallZoneSchema: z.ZodObject<{ id: z.ZodString; name: z.ZodString; description: z.ZodOptional; predefined: z.ZodDefault; networks: z.ZodArray; interfaces: z.ZodArray; enabled: z.ZodDefault; localUser: z.ZodDefault; }, "strip", z.ZodTypeAny, { id: string; name: string; enabled: boolean; predefined: boolean; networks: string[]; interfaces: string[]; localUser: boolean; description?: string | undefined; }, { id: string; name: string; networks: string[]; interfaces: string[]; enabled?: boolean | undefined; description?: string | undefined; predefined?: boolean | undefined; localUser?: boolean | undefined; }>; export type FirewallZone = z.infer; export declare enum PredefinedZone { EXTERNAL = "external", INTERNAL = "internal", GATEWAY = "gateway", VPN = "vpn", HOTSPOT = "hotspot", DMZ = "dmz" } export declare const ZonePolicySchema: z.ZodObject<{ id: z.ZodString; sourceZone: z.ZodString; targetZone: z.ZodString; action: z.ZodNativeEnum; applications: z.ZodOptional>; ports: z.ZodOptional>; logging: z.ZodDefault; enabled: z.ZodDefault; priority: z.ZodDefault; }, "strip", z.ZodTypeAny, { id: string; enabled: boolean; action: FirewallAction; priority: number; logging: boolean; sourceZone: string; targetZone: string; applications?: string[] | undefined; ports?: string[] | undefined; }, { id: string; action: FirewallAction; sourceZone: string; targetZone: string; enabled?: boolean | undefined; priority?: number | undefined; logging?: boolean | undefined; applications?: string[] | undefined; ports?: string[] | undefined; }>; export type ZonePolicy = z.infer; export interface ZonePolicyMatrix { zones: string[]; policies: Record>; } export interface SimpleAppBlock { id: string; zoneId: string; appCategory: string; enabled: boolean; schedule?: { days: string[]; startTime: string; endTime: string; }; } export declare enum GroupType { ADDRESS_GROUP = "address-group", PORT_GROUP = "port-group", IPV6_ADDRESS_GROUP = "ipv6-address-group" } export declare const IPGroupSchema: z.ZodObject<{ id: z.ZodString; name: z.ZodString; type: z.ZodNativeEnum; members: z.ZodArray; description: z.ZodOptional; }, "strip", z.ZodTypeAny, { type: GroupType; id: string; name: string; members: string[]; description?: string | undefined; }, { type: GroupType; id: string; name: string; members: string[]; description?: string | undefined; }>; export type IPGroup = z.infer; export interface SiteStats { totalDevices: number; onlineDevices: number; offlineDevices: number; totalClients: number; wiredClients: number; wirelessClients: number; guestClients: number; totalBytes: number; totalPackets: number; totalUptime: number; internetLatency: number; internetDropRate: number; lastUpdated: Date; } export interface BandwidthUsage { entityId: string; entityType: 'client' | 'device' | 'network'; entityName: string; rxBytes: number; txBytes: number; rxRate: number; txRate: number; period: string; timestamp: Date; } export interface SystemEvent { id: string; timestamp: Date; type: string; severity: 'info' | 'warning' | 'error' | 'critical'; message: string; deviceId?: string; clientId?: string; key: string; subsystem: string; details?: Record; } export interface SystemAlert { id: string; timestamp: Date; type: string; severity: 'low' | 'medium' | 'high' | 'critical'; message: string; acknowledged: boolean; deviceId?: string; source: string; details?: Record; } export interface NetworkTopology { devices: Array<{ id: string; name: string; type: DeviceType; connections: Array<{ deviceId: string; port: string; linkSpeed: number; }>; }>; clients: Array<{ id: string; connectedTo: string; connectionType: ClientType; }>; } export interface WiFiInterference { apId: string; apName: string; radio: string; channel: number; utilization: number; interference: number; neighbors: Array<{ ssid: string; channel: number; signal: number; }>; timestamp: Date; } export interface ScheduleConfig { days: Array<'monday' | 'tuesday' | 'wednesday' | 'thursday' | 'friday' | 'saturday' | 'sunday'>; startTime: string; endTime: string; timezone?: string; } export interface DeviceBlockSchedule { id: string; deviceId: string; schedule: ScheduleConfig; enabled: boolean; description?: string; createdAt: Date; lastExecuted?: Date; } export interface EmergencyLockdown { id: string; enabled: boolean; activatedAt?: Date; activatedBy?: string; restrictions: { blockAllClients: boolean; blockInternetAccess: boolean; allowedDevices: string[]; allowedNetworks: string[]; customRules?: string[]; }; autoDisableAfter?: number; } export interface BulkOperation { id: string; operation: 'restart' | 'adopt' | 'upgrade' | 'block' | 'unblock'; deviceIds: string[]; status: 'pending' | 'in-progress' | 'completed' | 'failed'; results: Array<{ deviceId: string; success: boolean; error?: string; }>; startedAt: Date; completedAt?: Date; } export interface HealthCheck { timestamp: Date; overall: 'healthy' | 'warning' | 'critical'; checks: Array<{ name: string; status: 'pass' | 'warning' | 'fail'; message: string; details?: Record; }>; } export interface APIResponse { meta: { msg: string; rc: 'ok' | 'error'; }; data: T[]; } export interface APIError { meta: { msg: string; rc: 'error'; }; data: never[]; error?: { code: string; message: string; details?: any; }; } export declare const ConnectionParamsSchema: z.ZodObject<{ gatewayIp: z.ZodString; apiKey: z.ZodString; siteId: z.ZodDefault; }, "strip", z.ZodTypeAny, { gatewayIp: string; apiKey: string; siteId: string; }, { gatewayIp: string; apiKey: string; siteId?: string | undefined; }>; export declare const DeviceParamsSchema: z.ZodObject<{ deviceId: z.ZodOptional; deviceType: z.ZodOptional>; status: z.ZodOptional>; }, "strip", z.ZodTypeAny, { status?: DeviceStatus | undefined; deviceId?: string | undefined; deviceType?: DeviceType | undefined; }, { status?: DeviceStatus | undefined; deviceId?: string | undefined; deviceType?: DeviceType | undefined; }>; export declare const ClientParamsSchema: z.ZodObject<{ clientId: z.ZodOptional; activeOnly: z.ZodDefault; networkId: z.ZodOptional; clientType: z.ZodOptional>; blocked: z.ZodOptional; includeTraffic: z.ZodDefault; sortBy: z.ZodOptional>; sortOrder: z.ZodDefault>; limit: z.ZodDefault; }, "strip", z.ZodTypeAny, { activeOnly: boolean; includeTraffic: boolean; sortOrder: "asc" | "desc"; limit: number; networkId?: string | undefined; blocked?: boolean | undefined; clientId?: string | undefined; clientType?: ClientType | undefined; sortBy?: "name" | "lastSeen" | "txBytes" | "rxBytes" | "mac" | "ip" | undefined; }, { networkId?: string | undefined; blocked?: boolean | undefined; clientId?: string | undefined; activeOnly?: boolean | undefined; clientType?: ClientType | undefined; includeTraffic?: boolean | undefined; sortBy?: "name" | "lastSeen" | "txBytes" | "rxBytes" | "mac" | "ip" | undefined; sortOrder?: "asc" | "desc" | undefined; limit?: number | undefined; }>; export declare const FirewallRuleParamsSchema: z.ZodObject<{ ruleId: z.ZodOptional; enabledOnly: z.ZodDefault; }, "strip", z.ZodTypeAny, { enabledOnly: boolean; ruleId?: string | undefined; }, { ruleId?: string | undefined; enabledOnly?: boolean | undefined; }>; export declare const ZoneParamsSchema: z.ZodObject<{ zoneId: z.ZodOptional; sourceZone: z.ZodOptional; targetZone: z.ZodOptional; }, "strip", z.ZodTypeAny, { sourceZone?: string | undefined; targetZone?: string | undefined; zoneId?: string | undefined; }, { sourceZone?: string | undefined; targetZone?: string | undefined; zoneId?: string | undefined; }>; export declare const NetworkParamsSchema: z.ZodObject<{ networkId: z.ZodOptional; networkType: z.ZodOptional>; }, "strip", z.ZodTypeAny, { networkId?: string | undefined; networkType?: NetworkPurpose | undefined; }, { networkId?: string | undefined; networkType?: NetworkPurpose | undefined; }>; export declare const MonitoringParamsSchema: z.ZodObject<{ timeframe: z.ZodDefault>; entityType: z.ZodOptional>; entityId: z.ZodOptional; }, "strip", z.ZodTypeAny, { timeframe: "hour" | "day" | "week" | "month"; entityType?: "client" | "device" | "network" | undefined; entityId?: string | undefined; }, { timeframe?: "hour" | "day" | "week" | "month" | undefined; entityType?: "client" | "device" | "network" | undefined; entityId?: string | undefined; }>; //# sourceMappingURL=types.d.ts.map