/** * Submit Feedback Helper * * Allows users to submit feedback on AI analysis findings. * This feedback is used to improve future analyses. */ import type { Issue } from '../../types/analysis.types'; /** * Feedback rating options */ export type FeedbackRating = 'helpful' | 'not_helpful' | 'inaccurate' | 'actionable'; /** * Feedback submission for a finding */ export interface FindingFeedback { findingId: string; resourceId: string; resourceType: string; issueSnippet: string; rating: FeedbackRating; comment?: string; wafPillar: string; severity: string; modelId?: string; timestamp: number; } /** * API response for feedback submission */ export interface FeedbackResponse { success: boolean; message?: string; } /** * Dependencies for the feedback submitter */ export interface SubmitFeedbackDependencies { apiClient: { post: (endpoint: string, body: unknown) => Promise<{ success: boolean; message?: string; }>; }; } /** * Generate a deterministic finding ID from the finding details */ export declare const generateFindingId: (issue: Issue) => string; /** * Create a feedback submitter */ export declare const createFeedbackSubmitter: (deps: SubmitFeedbackDependencies) => { /** * Submit feedback for a single finding */ submitFeedback(issue: Issue, rating: FeedbackRating, options?: { resourceType?: string; comment?: string; modelId?: string; }): Promise; /** * Submit feedback for multiple findings */ submitBatchFeedback(items: Array<{ issue: Issue; rating: FeedbackRating; resourceType?: string; comment?: string; }>, options?: { modelId?: string; }): Promise<{ successful: number; failed: number; }>; /** * Mark all findings in a report as helpful * (useful for quick positive feedback) */ markReportAsHelpful(issues: Issue[], resourceTypes?: Record): Promise<{ successful: number; failed: number; }>; }; export type FeedbackSubmitter = ReturnType;