@simonecoelhosfo/optimizely-mcp-server
Version:
Optimizely MCP Server for AI assistants with integrated CLI tools
125 lines • 3.63 kB
TypeScript
/**
* Template Store
* @description SQLite storage for orchestration templates and execution history
* @author Optimizely MCP Server
* @version 1.0.0
*/
import { OrchestrationTemplate, ExecutionRecord, SystemTemplate } from '../types/index.js';
export declare class TemplateStore {
private logger;
private db;
private dbPath;
private initialized;
private validationMiddleware;
constructor();
/**
* Initialize the store - must be called before any operations
*/
initialize(): Promise<void>;
/**
* Initialize database connection and schema
*/
private initializeDatabase;
/**
* Initialize database schema
*/
private initializeSchema;
/**
* Run database migrations for existing databases
*/
private runMigrations;
/**
* Create database indexes
*/
private createIndexes;
/**
* Create orchestration template with validation
*/
createTemplate(template: Omit<OrchestrationTemplate, 'created_at' | 'updated_at'>, options?: {
skipValidation?: boolean;
autoFix?: boolean;
}): Promise<OrchestrationTemplate>;
/**
* Save orchestration template
*/
saveTemplate(template: OrchestrationTemplate): Promise<void>;
/**
* Get template by ID
*/
getTemplate(templateId: string): Promise<OrchestrationTemplate | null>;
/**
* Get template by name and version
*/
getTemplateByName(name: string, version?: string): Promise<OrchestrationTemplate | null>;
/**
* List templates with filters
*/
listTemplates(filters?: {
type?: 'user' | 'system';
platform?: 'feature' | 'web' | 'both';
author?: string;
tags?: string[];
}): Promise<OrchestrationTemplate[]>;
/**
* Update template
*/
updateTemplate(templateId: string, template: Partial<OrchestrationTemplate>): Promise<void>;
/**
* Delete template (soft delete)
*/
deleteTemplate(templateId: string): Promise<void>;
/**
* Save execution record
*/
saveExecution(execution: ExecutionRecord): Promise<void>;
/**
* Update execution status
*/
updateExecutionStatus(executionId: string, status: 'running' | 'completed' | 'failed' | 'cancelled', error?: string): Promise<void>;
/**
* Get execution by ID
*/
getExecution(executionId: string): Promise<ExecutionRecord | null>;
/**
* List executions with filters
*/
listExecutions(filters?: {
template_id?: string;
status?: string;
project_id?: string;
start_date?: string;
end_date?: string;
limit?: number;
}): Promise<ExecutionRecord[]>;
/**
* Register system template
*/
registerSystemTemplate(template: SystemTemplate): Promise<void>;
/**
* Get system template catalog
*/
getSystemTemplates(): Promise<SystemTemplate[]>;
/**
* Record execution metric
*/
recordMetric(executionId: string, metricName: string, metricValue: number): Promise<void>;
/**
* Get execution metrics
*/
getExecutionMetrics(executionId: string): Promise<Record<string, number>>;
/**
* Get template usage statistics
*/
getTemplateStats(templateId: string): Promise<{
total_executions: number;
successful_executions: number;
failed_executions: number;
avg_execution_time_ms: number;
last_execution_date: string | null;
}>;
/**
* Close database connection
*/
close(): void;
}
//# sourceMappingURL=TemplateStore.d.ts.map