import { config } from 'dotenv'; import { resolve } from 'path'; config({ path: resolve(process.cwd(), '.env.local') }); import { listDocs, bestDocForTenant, cleanClientDocName, } from '../src/lib/superhuman-docs'; import { scoreNameToTenant } from '../src/lib/match'; import { findSeguimientoGoogleDoc } from '../src/lib/superhuman-docs'; async function main() { const docs = await listDocs(); console.log('docs', docs.length); for (const d of docs) { const clean = cleanClientDocName(d.name); const s1 = scoreNameToTenant(clean, 'BPS', 'bps'); const s2 = scoreNameToTenant(clean, 'Blue Parrot School', 'blue-parrot'); if ( s1 >= 15 || s2 >= 15 || /parrot|bps|blue/i.test(d.name) ) { console.log({ name: d.name, clean, s1, s2, id: d.id }); } } console.log( 'best BPS', bestDocForTenant({ name: 'BPS', slug: 'bps' }, docs) ); console.log( 'best Blue Parrot School', bestDocForTenant( { name: 'Blue Parrot School', slug: 'blue-parrot-school' }, docs ) ); const drive = await findSeguimientoGoogleDoc([ 'Seguimiento Semanal BPS', 'Seguimiento Semanal Blue Parrot School', 'Seguimiento Semanal Blue Parrot', 'BPS', 'Blue Parrot School', ]); console.log('drive hit', drive); } main().catch((e) => { console.error(e); process.exit(1); });