"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.TruPulseAdapter = void 0;
class TruPulseAdapter {
    getDisplayName() {
        return 'TruPulse';
    }
    getDescription() {
        return 'Handles traces, spans, and sessions';
    }
    getAvailableFilters() {
        return [
            {
                name: 'applicationId',
                type: 'string',
                required: false,
                description: 'Filter by application ID',
            },
            {
                name: 'dateRange',
                type: 'dateRange',
                required: false,
                description: 'Date range filter (defaults to last 30 days)',
            },
            {
                name: 'status',
                type: 'enum',
                required: false,
                values: ['success', 'error', 'failed'],
                description: 'Filter by status',
            },
            {
                name: 'evaluationId',
                type: 'string',
                required: false,
                description: 'Filter by evaluation ID (for evaluation/security-related questions)',
            },
            {
                name: 'traceId',
                type: 'string',
                required: false,
                description: 'Filter by trace ID',
            },
            {
                name: 'spanId',
                type: 'string',
                required: false,
                description: 'Filter by span ID',
            },
            {
                name: 'sessionId',
                type: 'string',
                required: false,
                description: 'Filter by session ID',
            },
        ];
    }
    validateFilters(filters) {
        const errors = [];
        // Validate date range if provided
        if (filters.dateRange) {
            if (!filters.dateRange.start || !filters.dateRange.end) {
                errors.push('dateRange must have both start and end');
            }
            else {
                const start = new Date(filters.dateRange.start);
                const end = new Date(filters.dateRange.end);
                if (Number.isNaN(start.getTime()) || Number.isNaN(end.getTime())) {
                    errors.push('dateRange start and end must be valid dates');
                }
                if (start > end) {
                    errors.push('dateRange start must be before end');
                }
            }
        }
        // Validate status if provided
        if (filters.status && !['success', 'error', 'failed'].includes(filters.status)) {
            errors.push('status must be one of: success, error, failed');
        }
        return {
            valid: errors.length === 0,
            errors,
        };
    }
}
exports.TruPulseAdapter = TruPulseAdapter;
//# sourceMappingURL=truPulseAdapter.js.map