2
0

♻️ Re-organize telemetry package

This commit is contained in:
Baptiste Arnaud
2024-02-01 14:19:24 +01:00
parent 3fcb0081e5
commit 92a1d672fd
26 changed files with 102 additions and 206 deletions

View File

@ -5,7 +5,7 @@ import { promptAndSetEnvironment } from './utils'
import { Workspace } from '@typebot.io/schemas'
import { sendAlmostReachedChatsLimitEmail } from '@typebot.io/emails/src/emails/AlmostReachedChatsLimitEmail'
import { TelemetryEvent } from '@typebot.io/schemas/features/telemetry'
import { sendTelemetryEvents } from '@typebot.io/lib/telemetry/sendTelemetryEvent'
import { trackEvents } from '@typebot.io/lib/telemetry/trackEvents'
import Stripe from 'stripe'
import { createId } from '@paralleldrive/cuid2'
@ -222,7 +222,7 @@ export const checkAndReportChatsUsage = async () => {
`Send ${newResultsCollectedEvents.length} new results events and ${quarantineEvents.length} auto quarantine events...`
)
await sendTelemetryEvents(quarantineEvents.concat(newResultsCollectedEvents))
await trackEvents(quarantineEvents.concat(newResultsCollectedEvents))
}
const getSubscription = async (