feat: LinkedIn editorial, accesos agencia estables y deshacer en historial
Integra estrategias LinkedIn en calendarios (backlog publicado vs pendiente), unifica roles/cookies de vista agencia y permite deshacer cambios de brandbook dejando constancia en el historial. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
46
scripts/enrich_thin_dna.ts
Normal file
46
scripts/enrich_thin_dna.ts
Normal file
@@ -0,0 +1,46 @@
|
||||
/**
|
||||
* Force-seed enrich for DNA-thin brandbooks after calendar-generate-brand updates.
|
||||
*/
|
||||
import { config } from 'dotenv';
|
||||
import { resolve } from 'path';
|
||||
config({ path: resolve(process.cwd(), '.env.local') });
|
||||
|
||||
import { enrichTenantBrandbook } from '../src/lib/brandbook-enrich';
|
||||
|
||||
const THIN = [
|
||||
'delgado-abogados',
|
||||
'equinsa-parking',
|
||||
'fbm-abogados',
|
||||
'la-freseria',
|
||||
'virginia-molet',
|
||||
'wine-advisors',
|
||||
];
|
||||
|
||||
async function main() {
|
||||
const url = process.env.NEXT_PUBLIC_SUPABASE_URL!;
|
||||
const key = process.env.SUPABASE_SERVICE_ROLE_KEY!;
|
||||
const h = {
|
||||
apikey: key,
|
||||
Authorization: `Bearer ${key}`,
|
||||
};
|
||||
const tenants = (await fetch(
|
||||
`${url}/rest/v1/tenants?slug=in.(${THIN.join(',')})&select=id,slug`,
|
||||
{ headers: h }
|
||||
).then((r) => r.json())) as { id: string; slug: string }[];
|
||||
|
||||
for (const t of tenants) {
|
||||
const r = await enrichTenantBrandbook({ tenantId: t.id, forceSeed: true });
|
||||
console.log(
|
||||
t.slug,
|
||||
`${r.completenessBefore}→${r.completenessAfter}`,
|
||||
'filled',
|
||||
(r.filledFields || []).slice(0, 10).join(',') || '-',
|
||||
r.warning || ''
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
main().catch((e) => {
|
||||
console.error(e);
|
||||
process.exit(1);
|
||||
});
|
||||
Reference in New Issue
Block a user