import { get } from './client'; export type BlogPostStatus = 'draft' | 'scheduled' | 'published' | 'archived'; export type BlogPostCategory = 'industry' | 'technology' | 'guides' | 'news'; export interface BlogPost { id: string; title: string; slug: string; excerpt: string; content: string; coverImageUrl?: string; category: BlogPostCategory; tags: string[]; authorName: string; status: BlogPostStatus; isFeatured: boolean; publishedAt?: string; metaTitle?: string; metaDescription?: string; primaryKeyword?: string; secondaryKeywords: string[]; createdAt: string; updatedAt: string; } export interface BlogPostListResponse { posts: BlogPost[]; total: number; limit: number; offset: number; } export interface BlogPostFilters { category?: BlogPostCategory; search?: string; limit?: number; offset?: number; } export async function getBlogPosts(filters: BlogPostFilters = {}): Promise { const params = new URLSearchParams(); if (filters.category) params.set('category', filters.category); if (filters.search) params.set('search', filters.search); if (filters.limit) params.set('limit', String(filters.limit)); if (filters.offset) params.set('offset', String(filters.offset)); const query = params.toString(); return get(`/api/v1/blog${query ? `?${query}` : ''}`); } export async function getBlogPost(slug: string): Promise { return get(`/api/v1/blog/${slug}`); }