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
71 lines • 2.61 kB
TypeScript
/**
* Boolean Field Translator for Firewalla MCP Server
*
* Translates boolean field queries to backend-compatible format.
*
* The Firewalla API backend has limitations with boolean syntax:
* - "blocked:true" fails with "Bad Request: Invalid parameters"
* - "protocol:tcp" works fine
*
* This utility translates boolean field patterns to formats the backend accepts.
*/
/**
* Boolean field translator utility class
*/
export declare class BooleanFieldTranslator {
/**
* Translate boolean field queries to backend-compatible format
*
* @param query - Original query string (e.g., "blocked:true AND protocol:tcp")
* @param entityType - Entity type for field configuration
* @returns Translated query string
*/
static translateQuery(query: string, entityType: string): string;
/**
* Check if a query contains boolean field syntax that needs translation
*
* @param query - Query string to check
* @param entityType - Entity type for field configuration
* @returns True if translation is needed
*/
static needsTranslation(query: string, entityType: string): boolean;
/**
* Get all alternative translation formats for a query
* Useful for fallback attempts if primary translation fails
*
* @param query - Original query string
* @param entityType - Entity type for field configuration
* @returns Array of alternative translated queries
*/
static getAlternativeTranslations(query: string, entityType: string): string[];
/**
* Get debug information about boolean field translation
*
* @param query - Original query string
* @param entityType - Entity type
* @returns Debug information object
*/
static getTranslationDebugInfo(query: string, entityType: string): {
originalQuery: string;
translatedQuery: string;
needsTranslation: boolean;
entityType: string;
detectedBooleanFields: string[];
alternativeTranslations: string[];
};
/**
* Add support for new boolean fields at runtime
*
* @param entityType - Entity type to update
* @param fields - Additional boolean fields to support
*/
static addBooleanFields(entityType: string, fields: string[]): void;
/**
* Get supported boolean fields for an entity type
*
* @param entityType - Entity type to query
* @returns Array of supported boolean field names
*/
static getSupportedBooleanFields(entityType: string): string[];
}
//# sourceMappingURL=boolean-field-translator.d.ts.map