| |
| export interface CsvInputRow { |
| URL: string; |
| Page: string; |
| Keywords: string; |
| Recommended_Title: string; |
| Recommended_H1: string; |
| Internal_Links: string; |
| Copy: string; |
| } |
|
|
| |
| export type ApiInput = CsvInputRow; |
|
|
|
|
| |
| export interface ApiResponseOutput { |
| title: string; |
| h1: string; |
| copy: string; |
| meta: string; |
| qa_gaurd: string; |
| } |
|
|
| |
| export interface QueueItem { |
| id: number; |
| data: CsvInputRow; |
| status: 'pending' | 'processing' | 'completed' | 'failed'; |
| error?: string; |
| } |
|
|
| |
| export interface QaSectionResult { |
| grade: string; |
| pass: boolean; |
| errors: string[]; |
| corrected: string; |
| |
| detailedAssessment?: string; |
| keyStrengths?: string[]; |
| recommendations?: string[]; |
| explanations?: string; |
| rawContent?: string; |
| } |
|
|
| |
| export interface DetailedQaReport { |
| title: QaSectionResult; |
| meta: QaSectionResult; |
| h1: QaSectionResult; |
| copy: QaSectionResult; |
| overall: { |
| grade: string; |
| pass: boolean; |
| primaryIssue: string; |
| |
| detailedAssessment?: string; |
| keyStrengths?: string[]; |
| recommendations?: string[]; |
| explanations?: string; |
| rawContent?: string; |
| }; |
| |
| additionalSections?: { |
| [sectionName: string]: { |
| content: string; |
| type: 'assessment' | 'strengths' | 'recommendations' | 'explanations' | 'other'; |
| }; |
| }; |
| |
| completeRawReport?: string; |
| } |
|
|
|
|
| |
| export interface ProcessedResult { |
| generatedTitle: string; |
| generatedH1: string; |
| generatedCopy: string; |
| generatedMeta: string; |
| qaReport: string; |
| detailedQaReport?: DetailedQaReport; |
| overallPass: boolean; |
| overallGrade: string; |
| } |
|
|
| |
| export type ResultRow = CsvInputRow & ProcessedResult & { id: number }; |
|
|
| |
| export interface JobHistoryItem { |
| id: string; |
| filename: string; |
| date: string; |
| totalRows: number; |
| completedCount: number; |
| failedCount: number; |
| results?: ResultRow[]; |
| } |
|
|
|
|
| |
| export const REQUIRED_CSV_HEADERS: (keyof CsvInputRow)[] = [ |
| 'URL', |
| 'Page', |
| 'Keywords', |
| 'Recommended_Title', |
| 'Recommended_H1', |
| 'Internal_Links', |
| 'Copy' |
| ]; |
|
|
| |
| export interface BatchError { |
| row?: number; |
| code: string; |
| message: string; |
| suggestion?: string; |
| at?: 'csv' | 'network' | 'api' | 'stream' | 'parse' | 'unknown'; |
| debug?: string; |
| } |