2
0

📈 Track workspace limit reached event

This commit is contained in:
Baptiste Arnaud
2023-04-17 17:19:44 +02:00
parent 7e937e1c7c
commit c203a4e792
2 changed files with 133 additions and 6 deletions

View File

@ -78,6 +78,18 @@ const newResultsCollectedEventSchema = typebotEvent.merge(
})
)
const workspaceLimitReachedEventSchema = workspaceEvent.merge(
z.object({
name: z.literal('Workspace limit reached'),
data: z.object({
chatsLimit: z.number(),
storageLimit: z.number(),
totalChatsUsed: z.number(),
totalStorageUsed: z.number(),
}),
})
)
export const eventSchema = z.discriminatedUnion('name', [
workspaceCreatedEventSchema,
userCreatedEventSchema,
@ -85,6 +97,7 @@ export const eventSchema = z.discriminatedUnion('name', [
publishedTypebotEventSchema,
subscriptionUpdatedEventSchema,
newResultsCollectedEventSchema,
workspaceLimitReachedEventSchema,
])
export type TelemetryEvent = z.infer<typeof eventSchema>