2
0
Files
bot/packages/schemas/features/credentials.ts
Baptiste Arnaud b852b4af0b Add WhatsApp integration beta test (#722)
Related to #401
2023-08-29 10:05:24 +02:00

17 lines
657 B
TypeScript

import { z } from 'zod'
import { stripeCredentialsSchema } from './blocks/inputs/payment/schemas'
import { googleSheetsCredentialsSchema } from './blocks/integrations/googleSheets/schemas'
import { openAICredentialsSchema } from './blocks/integrations/openai'
import { smtpCredentialsSchema } from './blocks/integrations/sendEmail'
import { whatsAppCredentialsSchema } from './whatsapp'
export const credentialsSchema = z.discriminatedUnion('type', [
smtpCredentialsSchema,
googleSheetsCredentialsSchema,
stripeCredentialsSchema,
openAICredentialsSchema,
whatsAppCredentialsSchema,
])
export type Credentials = z.infer<typeof credentialsSchema>