feat(calendario): opciones de generación, regenerar y publish IG/FB

Cantidades posts/stories/reels, días, mix mismo día, instrucciones,
regenerar marcadas, texto por slide/guión reel, stories interactivas
y horarios IG/FB separados o iguales.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
4Ventures
2026-10-15 16:36:45 +02:00
parent 39b1f8ec02
commit 3b57cdce53
10 changed files with 791 additions and 120 deletions

View File

@@ -44,6 +44,8 @@ export async function POST(req: NextRequest) {
const body = (await req.json().catch(() => ({}))) as {
month?: string;
avoid_titles?: string[];
gen_options?: Record<string, unknown>;
options?: Record<string, unknown>;
};
const month = String(body.month || '').slice(0, 7);
if (!/^\d{4}-\d{2}$/.test(month)) {
@@ -55,6 +57,9 @@ export async function POST(req: NextRequest) {
.map((t) => t.trim().slice(0, 160))
.slice(0, 40)
: [];
const genOptions = (body.gen_options || body.options || null) as
| Record<string, unknown>
| null;
let slug = 'cliente';
const t = await restGet<{ slug?: string }[]>(
@@ -132,6 +137,7 @@ export async function POST(req: NextRequest) {
brandbook,
publishedPosts,
avoidTitles,
genOptions: genOptions || undefined,
});
return NextResponse.json({