/** * Configuración del servicio de Feedback. */ export interface ValtechFeedbackConfig { /** URL base de la API */ apiUrl: string; /** ID de la aplicación (ej: 'my-valtech-app') */ appId: string; /** Prefijo para endpoints (default: '/v1/feedback') */ feedbackPrefix?: string; /** Número máximo de adjuntos (default: 5) */ maxAttachments?: number; /** Tamaño máximo por archivo en bytes (default: 10MB) */ maxFileSize?: number; /** Tipos de archivo permitidos (default: ['image/*', 'video/*', 'application/pdf']) */ allowedFileTypes?: string[]; /** Ruta en Firebase Storage para adjuntos (default: 'feedback') */ storagePath?: string; } /** * Tipos de feedback disponibles. */ export type FeedbackType = 'issue' | 'poor-content' | 'feedback' | 'suggestion' | 'reaction'; /** * Valor de reacción (para feedback tipo emoji). */ export type ReactionValue = 'negative' | 'neutral' | 'positive'; /** * Estado de un feedback. */ export type FeedbackStatus = 'new' | 'reviewed' | 'resolved'; /** * Tipos de contenido para referencia. */ export type ContentType = 'article' | 'faq' | 'news' | 'page' | 'product' | 'event' | 'other'; /** * Referencia a contenido específico. */ export interface ContentRef { contentId: string; contentType: ContentType; } /** * Referencia a entidad (para reactions y feedback de contenido). */ export interface EntityRef { /** Tipo de entidad: 'article', 'docs', 'feature', 'bug', etc. */ entityType: string; /** ID de la entidad */ entityId: string; } /** * Contexto del dispositivo del usuario. */ export interface DeviceContext { browser: string; os: string; viewport: string; language: string; userAgent: string; pageUrl: string; } /** * Entrada de feedback completa. */ export interface Feedback { feedbackId: string; appId: string; userId: string; type: FeedbackType; title: string; description: string; attachments: string[]; contentRef?: ContentRef; entityRef?: EntityRef; reactionValue?: ReactionValue; deviceContext: DeviceContext; status: FeedbackStatus; createdAt: string; updatedAt: string; } /** * Request para crear feedback. */ export interface CreateFeedbackRequest { type: FeedbackType; title?: string; description?: string; attachments?: string[]; contentRef?: ContentRef; entityRef?: EntityRef; reactionValue?: ReactionValue; deviceContext: DeviceContext; appId: string; } /** * Response al crear feedback. */ export interface CreateFeedbackResponse { operationId: string; feedbackId: string; status: FeedbackStatus; createdAt: string; } /** * Response al obtener feedback. */ export interface GetFeedbackResponse { operationId: string; feedback: Feedback; } /** * Opciones de tipo de feedback para UI. */ export interface FeedbackTypeOption { value: FeedbackType; label: string; description?: string; icon?: string; } /** * Configuración por defecto de tipos de feedback. */ export declare const DEFAULT_FEEDBACK_TYPE_OPTIONS: FeedbackTypeOption[]; /** * Response al verificar si existe feedback para una entidad. */ export interface CheckFeedbackResponse { operationId: string; hasFeedback: boolean; feedbackId?: string; type?: FeedbackType; reactionValue?: ReactionValue; createdAt?: string; } /** * Request para listar feedback (admin). */ export interface ListFeedbackRequest { appId?: string; type?: FeedbackType; status?: FeedbackStatus; entityType?: string; entityId?: string; userId?: string; dateFrom?: string; dateTo?: string; limit?: number; nextToken?: string; } /** * Response al listar feedback. */ export interface ListFeedbackResponse { operationId: string; feedbacks: Feedback[]; nextToken?: string; count: number; } /** * Documento de feedback en Firestore. * Usado para lectura rápida del estado de feedback del usuario. * * Path: apps/{appId}/feedback/{entityType}/{entityId}/{userId} */ export interface FeedbackFirestoreDoc { id?: string; feedbackId: string; type: string; reactionValue: string; createdAt?: Date; updatedAt?: Date; }