2
0

♻️ (models) Change to features-centric folder structure

This commit is contained in:
Baptiste Arnaud
2022-11-15 11:02:26 +01:00
committed by Baptiste Arnaud
parent a9d04798bc
commit a5c8a8a95c
55 changed files with 37 additions and 43 deletions

View File

@ -1 +0,0 @@
export * from './types'

View File

@ -1,34 +0,0 @@
import { z } from 'zod'
import {
blockBaseSchema,
IntegrationBlockType,
} from '../../typebot/blocks/shared'
export const chatwootOptionsSchema = z.object({
baseUrl: z.string(),
websiteToken: z.string(),
user: z
.object({
id: z.string().optional(),
email: z.string().optional(),
name: z.string().optional(),
avatarUrl: z.string().optional(),
phoneNumber: z.string().optional(),
})
.optional(),
})
export const chatwootBlockSchema = blockBaseSchema.and(
z.object({
type: z.enum([IntegrationBlockType.CHATWOOT]),
options: chatwootOptionsSchema,
})
)
export const defaultChatwootOptions: ChatwootOptions = {
baseUrl: 'https://app.chatwoot.com',
websiteToken: '',
}
export type ChatwootBlock = z.infer<typeof chatwootBlockSchema>
export type ChatwootOptions = z.infer<typeof chatwootOptionsSchema>