2
0
Files
bot/packages/models/features/blocks/integrations/schemas.ts

36 lines
1.2 KiB
TypeScript
Raw Normal View History

2022-06-11 07:27:38 +02:00
import { z } from 'zod'
import { chatwootBlockSchema, chatwootOptionsSchema } from './chatwoot'
2022-06-11 07:27:38 +02:00
import {
googleAnalyticsOptionsSchema,
googleAnalyticsBlockSchema,
} from './googleAnalytics'
import {
googleSheetsOptionsSchema,
googleSheetsBlockSchema,
} from './googleSheets/schemas'
2022-06-11 07:27:38 +02:00
import { makeComBlockSchema } from './makeCom'
import { pabblyConnectBlockSchema } from './pabblyConnect'
import { sendEmailOptionsSchema, sendEmailBlockSchema } from './sendEmail'
import { webhookOptionsSchema, webhookBlockSchema } from './webhook'
import { zapierBlockSchema } from './zapier'
const integrationBlockOptionsSchema = googleSheetsOptionsSchema
.or(googleAnalyticsOptionsSchema)
.or(webhookOptionsSchema)
.or(sendEmailOptionsSchema)
.or(chatwootOptionsSchema)
2022-06-11 07:27:38 +02:00
export const integrationBlockSchema = googleSheetsBlockSchema
.or(googleAnalyticsBlockSchema)
.or(webhookBlockSchema)
.or(sendEmailBlockSchema)
.or(zapierBlockSchema)
.or(makeComBlockSchema)
.or(pabblyConnectBlockSchema)
.or(chatwootBlockSchema)
2022-06-11 07:27:38 +02:00
export type IntegrationBlock = z.infer<typeof integrationBlockSchema>
export type IntegrationBlockOptions = z.infer<
typeof integrationBlockOptionsSchema
>