Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

Merge branch 'main' into conversions

Steven Teya0c15b862d85
diff --cc apps/web/lib/zod/schemas/analytics.ts
index 1f665efa29,1c9e2dcabb..6a9b6edad3
--- a/apps/web/lib/zod/schemas/analytics.ts
+++ b/apps/web/lib/zod/schemas/analytics.ts
@@@ -219,20 -232,16 +219,30 @@@ export const analyticsQuerySchema =
.describe(
"Filter sales by type: 'new' for first-time purchases, 'recurring' for repeat purchases. If undefined, returns both.",
),
+ query: z
+ .string()
+ .max(10000)
+ .optional()
+ .describe(
+ "Search the events by a custom metadata value. Only available for lead and sale events.",
+ )
+ .openapi({
+ example: "metadata['key']:'value'",
+ }),
+ // deprecated fields
+ tagId: z
+ .string()
+ .optional()
+ .describe(
+ "Deprecated: Use `tagIds` instead. The tag ID to retrieve analytics for.",
+ )
+ .openapi({ deprecated: true }),
+ qr: booleanQuerySchema
+ .optional()
+ .describe(
+ "Deprecated: Use the `trigger` field instead. Filter for QR code scans. If true, filter for QR codes only. If false, filter for links only. If undefined, return both.",
+ )
+ .openapi({ deprecated: true }),
})
.merge(utmTagsSchema);
diff --cc apps/web/lib/zod/schemas/sales.ts
index 89e4791a5a,54b9c4a44e..d21a11f93e
--- a/apps/web/lib/zod/schemas/sales.ts
+++ b/apps/web/lib/zod/schemas/sales.ts
@@@ -150,9 -149,15 +149,15 @@@ export const saleEventResponseSchema =
invoiceId: true,
paymentProcessor: true,
}),
+ metadata: z.any().nullish(),
+ // nested objects
+ link: linkEventSchema,
+ click: clickEventSchema,
+ customer: CustomerSchema,
+ // deprecated fields
saleAmount: z
.number()
- .describe("Deprecated. Use `sale.amount` instead.")
+ .describe("Deprecated: Use `sale.amount` instead.")
.openapi({ deprecated: true }),
invoice_id: z
.string()