@simonecoelhosfo/optimizely-mcp-server
Version:
Optimizely MCP Server for AI assistants with integrated CLI tools
64 lines • 1.93 kB
TypeScript
/**
* Template Entity Validator
*
* Extracts all entities from orchestration templates and validates them
* against API schemas before template storage or execution.
*/
import { OrchestrationTemplate } from '../orchestration/types/index.js';
import { SchemaCache } from './SchemaCache.js';
import { EntityName } from '../generated/fields.generated.js';
export interface ExtractedEntity {
stepId: string;
entityType: EntityName;
operation: string;
data: any;
resolvedData?: any;
}
export interface TemplateValidationResult {
valid: boolean;
errors: Array<{
stepId: string;
entityType: string;
errors: string[];
}>;
warnings: Array<{
stepId: string;
entityType: string;
warnings: string[];
}>;
entities: ExtractedEntity[];
}
export declare class TemplateEntityValidator {
private logger;
private schemaValidator;
constructor(schemaCache?: SchemaCache);
/**
* Validate all entities in a template
*/
validateTemplate(template: OrchestrationTemplate, parameters?: Record<string, any>): Promise<TemplateValidationResult>;
/**
* Extract all entities from template steps
*/
private extractEntitiesFromTemplate;
/**
* Extract entity type from system template ID
*/
private extractEntityType;
/**
* Resolve template parameters in entity data
*/
private resolveParameters;
/**
* Get nested value from object using dot notation
*/
private getNestedValue;
/**
* Pre-execution validation with full parameter resolution
*/
validateBeforeExecution(template: OrchestrationTemplate, parameters: Record<string, any>): Promise<TemplateValidationResult>;
/**
* Get a detailed validation report
*/
generateValidationReport(result: TemplateValidationResult): string;
}
//# sourceMappingURL=TemplateEntityValidator.d.ts.map