2
0
Files
bot/packages/scripts/updateTypebot.ts
2024-01-08 07:38:58 +01:00

35 lines
713 B
TypeScript

import { PrismaClient } from '@typebot.io/prisma'
import { promptAndSetEnvironment } from './utils'
import * as p from '@clack/prompts'
const updateTypebot = async () => {
await promptAndSetEnvironment('production')
const prisma = new PrismaClient({
log: [{ emit: 'event', level: 'query' }, 'info', 'warn', 'error'],
})
prisma.$on('query', (e) => {
console.log(e.query)
console.log(e.params)
console.log(e.duration, 'ms')
})
const typebotId = (await p.text({
message: 'Typebot ID?',
})) as string
const typebot = await prisma.typebot.update({
where: {
id: typebotId,
},
data: {
riskLevel: -1,
},
})
console.log(typebot)
}
updateTypebot()