export interface ContentGeneratorProduct { row_index: number; title: string; description: string; product_url: string; sku: string; tags: string; product_id: string; category: string; } export interface ContentGenerateFields { titles: boolean; descriptions: boolean; tags: boolean; faq: boolean; } export interface FieldPrompts { titles: string; descriptions: string; tags: string; faq: string; } export interface ContentGeneratorConfig { platform: 'woocommerce'; tone: string; language: string; temperature: number; generate_fields: ContentGenerateFields; field_prompts: FieldPrompts; faq_in_description?: boolean; } export interface ContentGeneratorRequest { products: ContentGeneratorProduct[]; config: ContentGeneratorConfig; email: string; plan: string; } /** Per-product catalog-quality action modes (synchronous, inline result). */ export type InlineGenerateMode = 'gap' | 'faq' | 'custom' | 'rewrite'; /** Body for the per-product inline-generate endpoint. */ export interface InlineGenerateRequest { mode: InlineGenerateMode; /** Required when `mode === "custom"`, optional steering for faq. */ custom_prompt?: string; /** Optional title steering for gap / rewrite. */ title_prompt?: string; /** Optional description steering for gap / rewrite. */ description_prompt?: string; /** Language override; falls back to the audit's detected language. */ language?: string; /** LLM creativity (0.1-1.0). */ temperature?: number; /** How many Q&A pairs to write; faq mode only. */ faq_count?: number; } /** Ready-to-paste copy returned by the inline-generate endpoint. */ export interface InlineGenerateResponse { content: string; } /** Optional tuning for the per-product "Replace title + description" email job. */ export interface ReplaceFromContentCheckRequest { custom_prompt?: string; language?: string; temperature?: number; } /** * Body for the "Bulk improve" endpoint. Platform + language are resolved * server-side (merchant row + audit's detected language), so they are absent. */ export interface BulkFromContentCheckRequest { generate_fields: ContentGenerateFields; field_prompts?: Partial; tone: string; custom_tone?: string; temperature?: number; faq_in_description?: boolean; faq_count?: number; /** Scope the run to one audited SKU (per-row Replace) instead of every product. */ sku?: string; } export interface ContentGeneratorJobResponse { job_id: string; product_count: number; } export interface ContentGeneratorStatusResponse { job_id: string; state: 'pending' | 'processing' | 'completed' | 'failed'; progress: number; total_count: number; processed_count: number; current_step?: string; error?: string | null; } /** * Response payload for `GET /content-generator/active`. * * - `active=false, status=null` → no job in flight (caller must clear any * cached `job_id` from `localStorage`). * - `active=true, status=…` → live status snapshot, ready to hydrate the * progress UI without a separate `/status?job_id=…` round-trip. */ export interface ContentGeneratorActiveJobResponse { active: boolean; status: ContentGeneratorStatusResponse | null; } export interface ContentGeneratorUsage { used: number; limit: number; plan: string; remaining: number; } export interface ImprovePromptResponse { improved_prompt: string; } export interface BaseAgentResponse { message: string; status: number; errors: boolean; data?: T; error?: string; } export interface PromptTemplate { template_id: string; name: string; description: string; language: string; titles_prompt: string; descriptions_prompt: string; tags_prompt: string; faq_prompt: string; tone: string; custom_tone: string; temperature: number; created_at: string | null; updated_at: string | null; } export interface PromptTemplateListData { templates: PromptTemplate[]; next_cursor: string | null; } export interface PromptTemplateCreateRequest { name: string; description?: string; language?: string; titles_prompt?: string; descriptions_prompt?: string; tags_prompt?: string; faq_prompt?: string; tone?: string; custom_tone?: string; temperature?: number; } export interface PromptTemplateUpdateRequest extends PromptTemplateCreateRequest {} export interface PromptTemplateDeleteData { deleted: boolean; template_id: string; } export interface DetectColumnsRequest { headers: string[]; sample_rows: Record[]; } export interface DetectColumnsResponse { title: string | null; description: string | null; tags: string | null; sku: string | null; handle: string | null; collection: string | null; price: string | null; brand: string | null; } export type PromptTemplateApiResponse = BaseAgentResponse; export type PromptTemplateListApiResponse = BaseAgentResponse; export type PromptTemplateDeleteApiResponse = BaseAgentResponse; export type DetectColumnsApiResponse = BaseAgentResponse;