feat(integration): ✨ Add Google Sheets integration
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
import { InputStepType, PublicTypebot, Typebot } from 'models'
|
||||
import { Plan, PrismaClient } from 'db'
|
||||
import { CredentialsType, Plan, PrismaClient } from 'db'
|
||||
import { parseTestTypebot } from './utils'
|
||||
import { userIds } from './data'
|
||||
|
||||
@ -7,9 +7,10 @@ const prisma = new PrismaClient()
|
||||
|
||||
const teardownTestData = async () => prisma.user.deleteMany()
|
||||
|
||||
export const seedDb = async () => {
|
||||
export const seedDb = async (googleRefreshToken: string) => {
|
||||
await teardownTestData()
|
||||
await createUsers()
|
||||
await createCredentials(googleRefreshToken)
|
||||
await createFolders()
|
||||
await createTypebots()
|
||||
await createResults()
|
||||
@ -33,6 +34,23 @@ const createUsers = () =>
|
||||
],
|
||||
})
|
||||
|
||||
const createCredentials = (refresh_token: string) =>
|
||||
prisma.credentials.createMany({
|
||||
data: [
|
||||
{
|
||||
name: 'test2@gmail.com',
|
||||
ownerId: userIds[1],
|
||||
type: CredentialsType.GOOGLE_SHEETS,
|
||||
data: {
|
||||
expiry_date: 1642441058842,
|
||||
access_token:
|
||||
'ya29.A0ARrdaM--PV_87ebjywDJpXKb77NBFJl16meVUapYdfNv6W6ZzqqC47fNaPaRjbDbOIIcp6f49cMaX5ndK9TAFnKwlVqz3nrK9nLKqgyDIhYsIq47smcAIZkK56SWPx3X3DwAFqRu2UPojpd2upWwo-3uJrod',
|
||||
refresh_token,
|
||||
},
|
||||
},
|
||||
],
|
||||
})
|
||||
|
||||
const createFolders = () =>
|
||||
prisma.dashboardFolder.createMany({
|
||||
data: [{ ownerId: userIds[1], name: 'Folder #1', id: 'folder1' }],
|
||||
|
Reference in New Issue
Block a user