The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.
TypeScript clickhousemysqlnextjsopen-sourceplanetscaleprismatailwindcsstinybirdtypescriptupstashvercel
fix openapi
Steven Teyf37d30116316
diff --git a/apps/web/lib/openapi/events/index.ts b/apps/web/lib/openapi/events/index.tsindex 4d18e5a770..13ed1989e3 100644--- a/apps/web/lib/openapi/events/index.ts+++ b/apps/web/lib/openapi/events/index.ts@@ -21,9 +21,9 @@ export const listEvents: ZodOpenApiOperationObject = {content: {"application/json": {schema: z.union([- z.array(clickEventResponseSchema).openapi({ title: "ClickEvents" }),- z.array(leadEventResponseSchema).openapi({ title: "LeadEvents" }),- z.array(saleEventResponseSchema).openapi({ title: "SaleEvents" }),+ z.array(clickEventResponseSchema),+ z.array(leadEventResponseSchema),+ z.array(saleEventResponseSchema),]),},},diff --git a/apps/web/lib/zod/schemas/clicks.ts b/apps/web/lib/zod/schemas/clicks.tsindex c7e2ac279f..32b35e6e7c 100644--- a/apps/web/lib/zod/schemas/clicks.ts+++ b/apps/web/lib/zod/schemas/clicks.ts@@ -30,26 +30,24 @@ export const clickEventSchemaTB = z.object({qr: z.number().nullable(),});-export const clickEventEnrichedSchema = z- .object({- event: z.literal("click"),- timestamp: z.string(),- click_id: z.string(),- link_id: z.string(),- domain: z.string(),- key: z.string(),- url: z.string(),- continent: z.string().nullable(),- country: z.string().nullable(),- city: z.string().nullable(),- device: z.string().nullable(),- browser: z.string().nullable(),- os: z.string().nullable(),- referer: z.string().nullable(),- ip: z.string().nullable(),- qr: z.number().nullable(),- })- .openapi({ ref: "ClickEvent" });+export const clickEventEnrichedSchema = z.object({+ event: z.literal("click"),+ timestamp: z.string(),+ click_id: z.string(),+ link_id: z.string(),+ domain: z.string(),+ key: z.string(),+ url: z.string(),+ continent: z.string().nullable(),+ country: z.string().nullable(),+ city: z.string().nullable(),+ device: z.string().nullable(),+ browser: z.string().nullable(),+ os: z.string().nullable(),+ referer: z.string().nullable(),+ ip: z.string().nullable(),+ qr: z.number().nullable(),+});export const clickEventResponseSchema = clickEventEnrichedSchema.omit({@@ -63,4 +61,5 @@ export const clickEventResponseSchema = clickEventEnrichedSchema.describe("Deprecated. Use `link.id` instead.").openapi({ deprecated: true }),}),- );+ )+ .openapi({ ref: "ClickEvent" });diff --git a/apps/web/lib/zod/schemas/leads.ts b/apps/web/lib/zod/schemas/leads.tsindex 8b1b27b234..d7aab27878 100644--- a/apps/web/lib/zod/schemas/leads.ts+++ b/apps/web/lib/zod/schemas/leads.ts@@ -79,31 +79,29 @@ export const leadEventSchemaTB = clickEventSchemaTB}),);-export const leadEventEnrichedSchema = z- .object({- event: z.literal("lead"),- timestamp: z.string(),- event_id: z.string(),- event_name: z.string(),- customer_name: z.string(),- customer_email: z.string(),- customer_avatar: z.string(),- click_id: z.string(),- link_id: z.string(),- domain: z.string(),- key: z.string(),- url: z.string(),- continent: z.string().nullable(),- country: z.string().nullable(),- city: z.string().nullable(),- device: z.string().nullable(),- browser: z.string().nullable(),- os: z.string().nullable(),- referer: z.string().nullable(),- qr: z.number().nullable(),- ip: z.string().nullable(),- })- .openapi({ ref: "LeadEvent" });+export const leadEventEnrichedSchema = z.object({+ event: z.literal("lead"),+ timestamp: z.string(),+ event_id: z.string(),+ event_name: z.string(),+ customer_name: z.string(),+ customer_email: z.string(),+ customer_avatar: z.string(),+ click_id: z.string(),+ link_id: z.string(),+ domain: z.string(),+ key: z.string(),+ url: z.string(),+ continent: z.string().nullable(),+ country: z.string().nullable(),+ city: z.string().nullable(),+ device: z.string().nullable(),+ browser: z.string().nullable(),+ os: z.string().nullable(),+ referer: z.string().nullable(),+ qr: z.number().nullable(),+ ip: z.string().nullable(),+});export const leadEventResponseSchema = leadEventEnrichedSchema.omit({@@ -141,4 +139,5 @@ export const leadEventResponseSchema = leadEventEnrichedSchemaclick: clickEventSchema,customer: customerSchema,}),- );+ )+ .openapi({ ref: "LeadEvent" });diff --git a/apps/web/lib/zod/schemas/sales.ts b/apps/web/lib/zod/schemas/sales.tsindex 4d1f01cd89..dd34857e55 100644--- a/apps/web/lib/zod/schemas/sales.ts+++ b/apps/web/lib/zod/schemas/sales.ts@@ -82,34 +82,32 @@ export const saleEventSchemaTB = clickEventSchemaTB}),);-export const saleEventEnrichedSchema = z- .object({- event: z.literal("sale"),- timestamp: z.string(),- event_id: z.string(),- event_name: z.string(),- customer_name: z.string(),- customer_email: z.string(),- customer_avatar: z.string(),- payment_processor: z.string(),- invoice_id: z.string(),- saleAmount: z.number(),- click_id: z.string(),- link_id: z.string(),- domain: z.string(),- key: z.string(),- url: z.string(),- continent: z.string().nullable(),- country: z.string().nullable(),- city: z.string().nullable(),- device: z.string().nullable(),- browser: z.string().nullable(),- os: z.string().nullable(),- referer: z.string().nullable(),- qr: z.number().nullable(),- ip: z.string().nullable(),- })- .openapi({ ref: "SaleEvent" });+export const saleEventEnrichedSchema = z.object({+ event: z.literal("sale"),+ timestamp: z.string(),+ event_id: z.string(),+ event_name: z.string(),+ customer_name: z.string(),+ customer_email: z.string(),+ customer_avatar: z.string(),+ payment_processor: z.string(),+ invoice_id: z.string(),+ saleAmount: z.number(),+ click_id: z.string(),+ link_id: z.string(),+ domain: z.string(),+ key: z.string(),+ url: z.string(),+ continent: z.string().nullable(),+ country: z.string().nullable(),+ city: z.string().nullable(),+ device: z.string().nullable(),+ browser: z.string().nullable(),+ os: z.string().nullable(),+ referer: z.string().nullable(),+ qr: z.number().nullable(),+ ip: z.string().nullable(),+});export const saleEventResponseSchema = saleEventEnrichedSchema.omit({@@ -166,4 +164,5 @@ export const saleEventResponseSchema = saleEventEnrichedSchemapaymentProcessor: true,}),}),- );+ )+ .openapi({ ref: "SaleEvent" });