import { createDb } from "../packages/db/src/index.js"; async function run() { const { prisma } = createDb("postgres://ingowagner@127.0.0.1:5432/evoo"); const events = await prisma.event.findMany({ where: { createdAt: { gte: new Date(Date.now() - 60_000) }, }, orderBy: { createdAt: "desc" }, take: 15, }); console.log(`Events in the last 60s: ${events.length}`); for (const e of events.reverse()) { console.log( `[${e.createdAt.toISOString()}] Bot: ${e.botId} | Type: ${e.type} | Text/Data: ${JSON.stringify(e.payload || e.data).slice(0, 100)}`, ); } } run() .catch(console.error) .finally(() => process.exit(0));