🧐 Add data exploration scripts
This commit is contained in:
34
packages/scripts/updateTypebot.ts
Normal file
34
packages/scripts/updateTypebot.ts
Normal file
@ -0,0 +1,34 @@
|
||||
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()
|
Reference in New Issue
Block a user