@simonecoelhosfo/optimizely-mcp-server
Version:
Optimizely MCP Server for AI assistants with integrated CLI tools
94 lines • 2.62 kB
TypeScript
/**
* Field Catalog - Universal Field Resolution System
*
* The Field Catalog is responsible for discovering and resolving field locations
* across different data models. It maintains a registry of all known fields and
* their physical locations (SQL columns, JSON paths, related tables, etc.).
*/
import { ViewOnlyFieldResolver } from '../robust-parser/ViewOnlyFieldResolver.js';
import type { FieldLocation, DataModelAdapter } from './types.js';
/**
* Configuration for Field Catalog
*/
export interface FieldCatalogConfig {
cacheSize?: number;
cacheTTL?: number;
autoDiscovery?: boolean;
discoveryInterval?: number;
}
/**
* Field Catalog implementation
*/
export declare class FieldCatalog {
private config;
private catalog;
private discoveryCache;
private adapters;
private discoveryPromises;
private lastDiscovery;
fieldResolver: ViewOnlyFieldResolver;
constructor(config?: FieldCatalogConfig);
/**
* Register a data model adapter
*/
registerAdapter(adapter: DataModelAdapter): void;
/**
* Resolve a field to its physical location
*/
resolveField(entity: string, field: string): Promise<FieldLocation>;
/**
* Get field information if it exists (non-throwing version)
*/
getFieldInfo(fieldPath: string): FieldLocation | null;
/**
* Manually register a field location
*/
registerField(entity: string, field: string, location: FieldLocation): void;
/**
* Discover all fields for an adapter
*/
private discoverAllFields;
/**
* Discover fields for a specific entity
*/
private discoverEntityFields;
/**
* Create field location from field definition
*/
private createFieldLocation;
/**
* Process discovered relationships
*/
private processRelationships;
/**
* Auto-discover a single field
*/
private discoverField;
/**
* Get available fields for an entity
*/
private getAvailableFields;
/**
* Get appropriate JSON extract function for entity type
*/
private getJSONExtractFunction;
/**
* Clear all cached data
*/
clearCache(): void;
/**
* Get catalog statistics
*/
getStatistics(): {
catalogSize: number;
cacheSize: number;
adapters: string[];
};
}
export declare class FieldResolutionError extends Error {
field: string;
entity: string;
details?: any | undefined;
constructor(field: string, entity: string, details?: any | undefined);
}
//# sourceMappingURL=FieldCatalog.d.ts.map