@simonecoelhosfo/optimizely-mcp-server
Version:
Optimizely MCP Server for AI assistants with integrated CLI tools
52 lines • 1.51 kB
TypeScript
/**
* Intelligent Response Parser
* @description Automatically normalizes API responses to consistent format regardless of source complexity
*
* This parser handles the reverse direction of IntelligentPayloadParser:
* - IntelligentPayloadParser: AI payloads → API format
* - IntelligentResponseParser: API responses → Normalized format
*/
export interface NormalizedResponse<T = any> {
success: boolean;
data: T;
metadata?: {
total_count?: number;
project_id?: string;
operation?: string;
timestamp?: string;
};
error?: {
message: string;
code?: string;
};
_usage_guidance?: any;
}
export interface ResponseParseOptions {
expectedType: 'array' | 'object' | 'any';
entityType?: string;
operation?: string;
allowEmpty?: boolean;
}
export declare class IntelligentResponseParser {
/**
* Parse any API response into normalized format
*/
parseResponse<T = any>(response: any, options: ResponseParseOptions): NormalizedResponse<T>;
/**
* Parse object responses with intelligent format detection
*/
private parseObjectResponse;
/**
* Process array data with entity-specific filtering
*/
private processArrayData;
/**
* Create standardized success response
*/
private createSuccessResponse;
/**
* Create standardized error response
*/
private createErrorResponse;
}
//# sourceMappingURL=IntelligentResponseParser.d.ts.map