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

@@ -130,6 +130,16 @@ function normalizePiece(
hook: str(raw.hook, 300),
body: cleanBody,
});
const slide_copy = Array.isArray(raw.slide_copy)
? (raw.slide_copy as { n?: unknown; label?: unknown; text?: unknown }[])
.map((s, i) => ({
n: Number(s.n) || i + 1,
label: s.label != null ? String(s.label).slice(0, 80) : undefined,
text: String(s.text || '').trim().slice(0, 800),
}))
.filter((s) => s.text)
: undefined;
return {
id: str(raw.id, 120) || newPieceId(date, title),
date,
@@ -151,6 +161,9 @@ function normalizePiece(
: /linkedin/i.test(enriched.platform || '')
? '#7C66B8'
: '#2071cf',
slide_copy: slide_copy?.length ? slide_copy : undefined,
reel_script: str(raw.reel_script, 6000) || undefined,
interactive_story: str(raw.interactive_story, 40) || undefined,
};
}