2
0
Files
bot/packages/utils/typebotConversions.ts

16 lines
395 B
TypeScript
Raw Normal View History

2022-06-11 07:27:38 +02:00
import { Typebot } from 'models'
export const convertTypebotToV2 = (typebot: any): Typebot => {
const newTypebot = JSON.parse(
JSON.stringify(typebot)
.replace(/\"blocks\":/g, '"groups":')
.replace(/\"steps\":/g, '"blocks":')
.replace(/\"blockId\":/g, '"groupId":')
.replace(/\"blockId\":/g, '"blockId":')
)
return {
version: '2',
...newTypebot,
}
}