import { ChannelCategory, DataTypeType, DeviceCategory, PermissionType, PropertyCategory } from '../devices.constants'; import { DeviceEntity } from '../entities/devices.entity'; import { DevicesService } from './devices.service'; export declare enum ValidationIssueSeverity { ERROR = "error", WARNING = "warning" } export declare enum ValidationIssueType { MISSING_CHANNEL = "missing_channel", MISSING_PROPERTY = "missing_property", INVALID_DATA_TYPE = "invalid_data_type", INVALID_PERMISSIONS = "invalid_permissions", INVALID_FORMAT = "invalid_format", UNKNOWN_CHANNEL = "unknown_channel", DUPLICATE_CHANNEL = "duplicate_channel", INVALID_PARENT = "invalid_parent", CONSTRAINT_ONE_OF_VIOLATION = "constraint_one_of_violation", CONSTRAINT_ONE_OR_MORE_OF_VIOLATION = "constraint_one_or_more_of_violation", CONSTRAINT_MUTUALLY_EXCLUSIVE_VIOLATION = "constraint_mutually_exclusive_violation" } export interface ValidationIssue { type: ValidationIssueType; severity: ValidationIssueSeverity; channelCategory?: ChannelCategory; channelId?: string; propertyCategory?: PropertyCategory; propertyId?: string; message: string; expected?: string; actual?: string; } export interface DeviceValidationResult { deviceId: string; deviceIdentifier: string | null; deviceName: string; deviceCategory: DeviceCategory; pluginType: string; isValid: boolean; issues: ValidationIssue[]; } export interface ValidationSummary { totalDevices: number; validDevices: number; invalidDevices: number; totalIssues: number; errorCount: number; warningCount: number; } export interface ValidationResponse { summary: ValidationSummary; devices: DeviceValidationResult[]; } export interface PropertyDataInput { category: PropertyCategory; dataType?: DataTypeType; permissions?: PermissionType[]; } export interface ChannelDataInput { id?: string; category: ChannelCategory; properties?: PropertyDataInput[]; parent?: string | null; } export interface DeviceDataInput { category: DeviceCategory; channels?: ChannelDataInput[]; } export interface PreSaveValidationResult { isValid: boolean; issues: ValidationIssue[]; } export declare class DeviceValidationService { private readonly devicesService; private readonly logger; constructor(devicesService: DevicesService); validateAllDevices(): Promise; validatePluginDevices(pluginType: string): Promise; validateDeviceById(deviceId: string): Promise; validateDevice(device: DeviceEntity): DeviceValidationResult; validateDeviceStructure(deviceData: DeviceDataInput): PreSaveValidationResult; isChannelAllowedForDevice(deviceCategory: DeviceCategory, channelCategory: ChannelCategory): boolean; getRequiredChannelsForDevice(deviceCategory: DeviceCategory): ChannelCategory[]; getRequiredPropertiesForChannel(channelCategory: ChannelCategory): PropertyCategory[]; private validateChannels; private validateDeviceChannelConstraints; private validateChannelProperties; private validatePropertyConstraints; private permissionSatisfied; private validatePropertyAgainstSpec; private calculateSummary; private validateChannelStructure; private validateDeviceChannelConstraintsStructure; private validateChannelPropertyStructure; private validatePropertyConstraintsStructure; private validatePropertyDataAgainstSpec; }