2023-03-09 08:46:36 +01:00
|
|
|
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'
|
2023-08-29 10:01:28 +02:00
|
|
|
import { whatsAppCredentialsSchema } from './whatsapp'
|
2023-03-09 08:46:36 +01:00
|
|
|
|
|
|
|
export const credentialsSchema = z.discriminatedUnion('type', [
|
|
|
|
smtpCredentialsSchema,
|
|
|
|
googleSheetsCredentialsSchema,
|
|
|
|
stripeCredentialsSchema,
|
|
|
|
openAICredentialsSchema,
|
2023-08-29 10:01:28 +02:00
|
|
|
whatsAppCredentialsSchema,
|
2023-03-09 08:46:36 +01:00
|
|
|
])
|
|
|
|
|
|
|
|
export type Credentials = z.infer<typeof credentialsSchema>
|