The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.
TypeScript clickhousemysqlnextjsopen-sourceplanetscaleprismatailwindcsstinybirdtypescriptupstashvercel
add `event` discriminator for /events endpoint
Steven Teyed8f6e4c33a2
diff --git a/apps/web/lib/zod/schemas/clicks.ts b/apps/web/lib/zod/schemas/clicks.tsindex 1ac67a839d..8d7735d95a 100644--- a/apps/web/lib/zod/schemas/clicks.ts+++ b/apps/web/lib/zod/schemas/clicks.ts@@ -31,6 +31,7 @@ export const clickEventSchemaTB = z.object({export const clickEventEnrichedSchema = z.object({+ event: z.literal("click").default("click"),timestamp: z.string(),click_id: z.string(),link_id: z.string(),@@ -47,4 +48,4 @@ export const clickEventEnrichedSchema = zip: z.string().nullable(),qr: z.number().nullable(),})- .openapi({ ref: "ClickEvents" });+ .openapi({ ref: "ClickEvent" });diff --git a/apps/web/lib/zod/schemas/leads.ts b/apps/web/lib/zod/schemas/leads.tsindex d4c9f2071f..62fbe707bb 100644--- a/apps/web/lib/zod/schemas/leads.ts+++ b/apps/web/lib/zod/schemas/leads.ts@@ -72,6 +72,7 @@ export const leadEventSchemaTB = clickEventSchemaTBexport const leadEventEnrichedSchema = z.object({+ event: z.literal("lead").default("lead"),timestamp: z.string(),event_id: z.string(),event_name: z.string(),@@ -93,4 +94,4 @@ export const leadEventEnrichedSchema = zqr: z.number().nullable(),ip: z.string().nullable(),})- .openapi({ ref: "LeadEvents" });+ .openapi({ ref: "LeadEvent" });diff --git a/apps/web/lib/zod/schemas/sales.ts b/apps/web/lib/zod/schemas/sales.tsindex cf608a1c72..057ca20128 100644--- a/apps/web/lib/zod/schemas/sales.ts+++ b/apps/web/lib/zod/schemas/sales.ts@@ -74,6 +74,7 @@ export const saleEventSchemaTB = clickEventSchemaTBexport const saleEventEnrichedSchema = z.object({+ event: z.literal("sale").default("sale"),timestamp: z.string(),event_id: z.string(),event_name: z.string(),@@ -98,4 +99,4 @@ export const saleEventEnrichedSchema = zqr: z.number().nullable(),ip: z.string().nullable(),})- .openapi({ ref: "SaleEvents" });+ .openapi({ ref: "SaleEvent" });