@simonecoelhosfo/optimizely-mcp-server
Version:
Optimizely MCP Server for AI assistants with integrated CLI tools
92 lines • 2.12 kB
TypeScript
/**
* Template Executor - Actually executes templates against Optimizely API
*/
import type { OrchestrationTemplate } from './types';
interface ExecutionContext {
projectId: string;
parameters: Record<string, any>;
results: Record<string, any>;
apiToken: string;
baseUrl?: string;
}
interface ExecutionResult {
success: boolean;
steps: StepResult[];
summary: {
total: number;
successful: number;
failed: number;
skipped: number;
};
errors: string[];
createdEntities: Array<{
stepId: string;
entityType: string;
entityId: string | number;
name?: string;
}>;
}
interface StepResult {
stepId: string;
status: 'success' | 'failed' | 'skipped';
action: string;
entityType?: string;
result?: any;
error?: string;
duration: number;
}
export declare class TemplateExecutor {
private apiClient;
private validator;
private resolver;
constructor();
/**
* Execute a template
*/
execute(template: OrchestrationTemplate, context: ExecutionContext, options?: {
dryRun?: boolean;
stopOnError?: boolean;
}): Promise<ExecutionResult>;
/**
* Execute a single step
*/
private executeStep;
/**
* Execute API call
*/
private executeApiCall;
/**
* Get API endpoint for entity and action
*/
private getApiEndpoint;
/**
* Get HTTP method for action
*/
private getHttpMethod;
/**
* Prepare request body
*/
private prepareRequestBody;
/**
* Resolve inputs with references
*/
private resolveInputs;
/**
* Extract entity type from system_template_id
*/
private extractEntityType;
/**
* Extract action from system_template_id
*/
private extractAction;
/**
* Get variation endpoint (special case)
*/
private getVariationEndpoint;
/**
* Format results for display
*/
formatResults(result: ExecutionResult): string;
}
export {};
//# sourceMappingURL=TemplateExecutor.d.ts.map