UNPKG

@simonecoelhosfo/optimizely-mcp-server

Version:

Optimizely MCP Server for AI assistants with integrated CLI tools

86 lines 3.26 kB
/** * Project filtering utility for Optimizely MCP Server * @description Handles filtering and validation of projects based on configuration */ import { MCPServerConfig } from './ConfigManager.js'; /** * Project filtering service that applies configuration-based project selection * @description Ensures only authorized projects are synced based on user configuration */ export declare class ProjectFilter { private projectConfig; /** * Creates a new ProjectFilter instance * @param projectConfig - Project configuration from the main config */ constructor(projectConfig: MCPServerConfig['optimizely']['projects']); /** * Filters a list of projects based on the configuration * @param allProjects - Array of all projects from the API * @returns Promise resolving to filtered array of projects * @throws {Error} When filtering results in no projects or exceeds limits */ filterProjects(allProjects: any[]): Promise<any[]>; /** * Checks if a project name matches a pattern (supports basic wildcards) * @param projectName - The project name to test * @param pattern - The pattern to match against (supports * wildcard) * @returns True if the name matches the pattern * @private */ private matchesPattern; /** * Removes duplicate projects based on ID * @param projects - Array of projects that may contain duplicates * @returns Array of unique projects * @private */ private removeDuplicates; /** * Gets a summary of the current configuration for error messages * @returns String describing the current filter configuration * @private */ private getConfigurationSummary; /** * Validates the project configuration before use * @throws {Error} When configuration is invalid */ validateConfiguration(): void; /** * Gets the maximum number of projects that should be processed * @returns The configured maximum number of projects, or 0 for unlimited */ getMaxProjects(): number; /** * Checks if auto-discover mode is enabled * @returns True if auto-discover is enabled */ isAutoDiscoverEnabled(): boolean; /** * DIAGNOSTIC: Gets current in-memory filter state for debugging * @returns Current filter configuration and state */ getFilterDiagnostics(): { allowedIds: string[]; allowedNames: string[]; autoDiscoverAll: boolean; maxProjects: number; hasFilters: boolean; instanceInfo: string; }; /** * Gets the allowed project IDs for filtering * @returns Array of allowed project IDs, or empty array if none configured */ getAllowedProjectIds(): string[]; /** * Dynamically adds a new project ID to the allowed list * @param projectId - The project ID to add to the allowed list * @description This method allows runtime addition of project IDs to the filter, * which is useful for automatically including locally-created projects * regardless of the initial OPTIMIZELY_PROJECT_IDS configuration. */ addAllowedProjectId(projectId: string | number): void; } //# sourceMappingURL=ProjectFilter.d.ts.map