UNPKG

@simonecoelhosfo/optimizely-mcp-server

Version:

Optimizely MCP Server for AI assistants with integrated CLI tools

88 lines 3.29 kB
/** * Validate Template Handler * * Provides dry-run validation for orchestration templates without executing them. * Validates both template structure and entity data against API schemas. */ import { ValidationReport } from '../orchestration/core/ValidationMiddleware.js'; import { EntityName } from '../generated/fields.generated.js'; export interface ValidateTemplateParams { /** Template mode: 'entity' for single entity templates, 'orchestration' for full orchestration templates */ template_mode?: 'entity' | 'orchestration'; /** The entity type being created (required for entity mode) */ entity_type?: EntityName; /** The template data to validate (for entity mode) */ template_data?: Record<string, any>; /** Full orchestration template (for orchestration mode) */ orchestration_template?: any; /** The project ID for context (optional) */ project_id?: string; /** Platform type (optional, can be inferred from project) */ platform?: 'web' | 'feature'; /** Template parameters to substitute (optional) */ parameters?: Record<string, any>; /** Validation options */ options?: { /** Validate ModelFriendlyTemplate compliance (default: true) */ validate_model_friendly?: boolean; /** Include structure validation (default: true) */ validate_structure?: boolean; /** Include entity validation against API schemas (default: true) */ validate_entities?: boolean; /** Include suggested fixes for errors (default: true) */ include_fixes?: boolean; /** Verbose output with full error details (default: false) */ verbose?: boolean; }; } export interface ValidateTemplateResponse { /** Whether the template is valid */ valid: boolean; /** Summary of validation results */ summary: string; /** Detailed validation report */ validation_report: ValidationReport; /** Suggested fixes for errors (if requested) */ suggested_fixes?: string[]; /** Warnings that don't prevent execution */ warnings?: string[]; /** Critical errors that would prevent execution */ errors?: string[]; /** Processed template structure (for debugging) */ processed_template?: any; } export declare class ValidateTemplateHandler { private logger; private validationMiddleware; private directTemplateValidator; constructor(); /** * Validate a template without executing it */ validateTemplate(params: ValidateTemplateParams): Promise<ValidateTemplateResponse>; /** * Convert template data to orchestration template format */ private convertToOrchestrationTemplate; /** * Validate ModelFriendlyTemplate compliance */ private validateModelFriendlyCompliance; /** * Validate platform compatibility */ private validatePlatformCompatibility; /** * Generate complete summary including all validations */ private generateCompleteSummary; /** * Resolve parameters in full orchestration templates */ private resolveOrchestrationParameters; /** * Get nested parameter value using dot notation */ private getNestedParameterValue; } //# sourceMappingURL=ValidateTemplateHandler.d.ts.map