feat(insta): replace Blog Lab page with Insta cards UI

/blog-lab → /insta route. New InstaCards page consumes insta-lab API
(news/keywords/slates + 10-page card preview + prompt template editor).
25개 blog-marketing API helper 제거, 13개 insta helper 추가.
This commit is contained in:
2026-05-16 02:47:19 +09:00
parent f261a80d52
commit a8e411ec22
8 changed files with 689 additions and 955 deletions

View File

@@ -479,113 +479,69 @@ export function deleteBlogPost(id) {
return apiDelete(`/api/blog/posts/${id}`);
}
// ── 블로그 마케팅 API ────────────────────────────────────────────────────────
// ── insta-lab ────────────────────────────────────────────────────────────────
export function getBlogMarketingStatus() {
return apiGet('/api/blog-marketing/status');
export function getInstaStatus() {
return apiGet('/api/insta/status');
}
export function startResearch(keyword) {
return apiPost('/api/blog-marketing/research', { keyword });
export function instaCollectNews(categories) {
return apiPost('/api/insta/news/collect', categories ? { categories } : {});
}
export function getResearchHistory(limit = 30) {
return apiGet(`/api/blog-marketing/research/history?limit=${limit}`);
export function getInstaArticles({ category, days = 7 } = {}) {
const q = new URLSearchParams();
if (category) q.set('category', category);
q.set('days', String(days));
return apiGet(`/api/insta/news/articles?${q.toString()}`);
}
export function getResearchDetail(id) {
return apiGet(`/api/blog-marketing/research/${id}`);
export function instaExtractKeywords(categories) {
return apiPost('/api/insta/keywords/extract', categories ? { categories } : {});
}
export function deleteResearch(id) {
return apiDelete(`/api/blog-marketing/research/${id}`);
export function getInstaKeywords({ category, used } = {}) {
const q = new URLSearchParams();
if (category) q.set('category', category);
if (used !== undefined) q.set('used', used ? 'true' : 'false');
const qs = q.toString();
return apiGet(`/api/insta/keywords${qs ? '?' + qs : ''}`);
}
export function getBlogMarketingTask(taskId) {
return apiGet(`/api/blog-marketing/task/${encodeURIComponent(taskId)}`);
export function createInstaSlate({ keyword, category, keyword_id }) {
return apiPost('/api/insta/slates', { keyword, category, keyword_id });
}
export function startGenerate(keywordId) {
return apiPost('/api/blog-marketing/generate', { keyword_id: keywordId });
export function getInstaSlates(limit = 50) {
return apiGet(`/api/insta/slates?limit=${limit}`);
}
export function startReview(postId) {
return apiPost(`/api/blog-marketing/review/${postId}`);
export function getInstaSlate(id) {
return apiGet(`/api/insta/slates/${id}`);
}
export function startRegenerate(postId) {
return apiPost(`/api/blog-marketing/regenerate/${postId}`);
export function renderInstaSlate(id) {
return apiPost(`/api/insta/slates/${id}/render`);
}
export function getBlogMarketingPosts(status, limit = 50) {
const qs = new URLSearchParams();
if (status) qs.set('status', status);
if (limit) qs.set('limit', String(limit));
const q = qs.toString();
return apiGet(`/api/blog-marketing/posts${q ? '?' + q : ''}`);
export function deleteInstaSlate(id) {
return apiDelete(`/api/insta/slates/${id}`);
}
export function getBlogMarketingPost(id) {
return apiGet(`/api/blog-marketing/posts/${id}`);
export function getInstaAssetUrl(slateId, page) {
return `/api/insta/slates/${slateId}/assets/${page}`;
}
export function updateBlogMarketingPost(id, data) {
return apiPut(`/api/blog-marketing/posts/${id}`, data);
export function getInstaTask(taskId) {
return apiGet(`/api/insta/tasks/${encodeURIComponent(taskId)}`);
}
export function deleteBlogMarketingPost(id) {
return apiDelete(`/api/blog-marketing/posts/${id}`);
export function getInstaPrompt(name) {
return apiGet(`/api/insta/templates/prompts/${encodeURIComponent(name)}`);
}
export function publishBlogMarketingPost(id, naverUrl) {
return apiPost(`/api/blog-marketing/posts/${id}/publish`, { naver_url: naverUrl || '' });
}
export function getBlogMarketingCommissions(postId) {
const qs = postId ? `?post_id=${postId}` : '';
return apiGet(`/api/blog-marketing/commissions${qs}`);
}
export function addBlogMarketingCommission(data) {
return apiPost('/api/blog-marketing/commissions', data);
}
export function updateBlogMarketingCommission(id, data) {
return apiPut(`/api/blog-marketing/commissions/${id}`, data);
}
export function deleteBlogMarketingCommission(id) {
return apiDelete(`/api/blog-marketing/commissions/${id}`);
}
export function getBlogMarketingDashboard() {
return apiGet('/api/blog-marketing/dashboard');
}
// 마케터 단계
export function startMarket(postId) {
return apiPost(`/api/blog-marketing/market/${postId}`);
}
// 브랜드커넥트 링크 CRUD
export function getBrandLinks(params = {}) {
const qs = new URLSearchParams();
if (params.post_id) qs.set('post_id', String(params.post_id));
if (params.keyword_id) qs.set('keyword_id', String(params.keyword_id));
const q = qs.toString();
return apiGet(`/api/blog-marketing/links${q ? '?' + q : ''}`);
}
export function createBrandLink(data) {
return apiPost('/api/blog-marketing/links', data);
}
export function updateBrandLink(id, data) {
return apiPut(`/api/blog-marketing/links/${id}`, data);
}
export function deleteBrandLink(id) {
return apiDelete(`/api/blog-marketing/links/${id}`);
export function putInstaPrompt(name, template, description = '') {
return apiPut(`/api/insta/templates/prompts/${encodeURIComponent(name)}`, { template, description });
}
// ── Agent Office ──────────────────────────────────