UNPKG

firewalla-mcp-server

Version:

Model Context Protocol (MCP) server for Firewalla MSP API - Provides real-time network monitoring, security analysis, and firewall management through 28 specialized tools compatible with any MCP client

79 lines 2.33 kB
/** * Operator Validator for Firewalla MCP Server * Provides operator compatibility checking with field types */ import { SEARCH_FIELDS } from '../search/types.js'; type EntityType = keyof typeof SEARCH_FIELDS; /** * Field data types for operator compatibility */ export type FieldType = 'string' | 'number' | 'boolean' | 'enum' | 'ip' | 'timestamp' | 'array'; /** * Query operators */ export type QueryOperator = ':' | '=' | '!=' | '>' | '<' | '>=' | '<=' | '~' | 'contains' | 'startswith' | 'endswith' | 'in' | 'not_in' | 'range'; /** * Operator validation result */ export interface OperatorValidation { isValid: boolean; error?: string; suggestion?: string; validOperators?: QueryOperator[]; fieldType?: FieldType; } export declare class OperatorValidator { private static readonly FIELD_TYPE_MAP; private static readonly OPERATOR_COMPATIBILITY; private static readonly OPERATOR_DESCRIPTIONS; /** * Validate operator compatibility with field */ static validateOperator(field: string, operator: string, entityType: EntityType): OperatorValidation; /** * Get field type for validation */ private static getFieldType; /** * Normalize operator to standard form */ private static normalizeOperator; /** * Create detailed compatibility error message */ private static createCompatibilityError; /** * Suggest alternative operators for field type */ private static suggestAlternativeOperators; /** * Get all valid operators */ private static getAllValidOperators; /** * Get detailed operator information */ static getOperatorInfo(operator: string): { description: string; examples: string[]; compatibleTypes: FieldType[]; } | null; /** * Generate usage examples for operator */ private static generateOperatorExamples; /** * Validate complex operator expressions */ static validateComplexExpression(expression: string, entityType: EntityType): { isValid: boolean; errors: string[]; suggestions: string[]; }; /** * Validate operator value compatibility */ private static validateOperatorValue; } export {}; //# sourceMappingURL=operator-validator.d.ts.map