2
0

📈 Track custom domain and WA enabled events

This commit is contained in:
Baptiste Arnaud
2024-02-02 14:49:41 +01:00
parent 4122d73908
commit b9183f9a36
4 changed files with 39 additions and 1 deletions

View File

@ -69,6 +69,21 @@ const publishedTypebotEventSchema = typebotEvent.merge(
})
)
const customDomainAddedEventSchema = workspaceEvent.merge(
z.object({
name: z.literal('Custom domain added'),
data: z.object({
domain: z.string(),
}),
})
)
const whatsAppCredentialsCreatedEventSchema = workspaceEvent.merge(
z.object({
name: z.literal('WhatsApp credentials created'),
})
)
const subscriptionUpdatedEventSchema = workspaceEvent.merge(
z.object({
name: z.literal('Subscription updated'),
@ -142,6 +157,8 @@ export const eventSchema = z.discriminatedUnion('name', [
workspacePastDueEventSchema,
workspaceNotPastDueEventSchema,
userUpdatedEventSchema,
customDomainAddedEventSchema,
whatsAppCredentialsCreatedEventSchema,
])
export type TelemetryEvent = z.infer<typeof eventSchema>

View File

@ -142,7 +142,7 @@ export const incomingMessageSchema = z.discriminatedUnion('type', [
type: z.literal('location'),
location: z.object({
latitude: z.number(),
longitude: z.number()
longitude: z.number(),
}),
timestamp: z.string(),
}),