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.

add dub.events.list

Kiran Ka8c79360c0ca
diff --git a/apps/web/lib/openapi/events/list-events.ts b/apps/web/lib/openapi/events/list-events.ts
new file mode 100644
index 0000000000..51ab5b54f0
--- /dev/null
+++ b/apps/web/lib/openapi/events/list-events.ts
@@ -0,0 +1,35 @@
+import { openApiErrorResponses } from "@/lib/openapi/responses";
+import z from "@/lib/zod";
+import { eventsQuerySchema } from "@/lib/zod/schemas/analytics";
+import { clickEventEnrichedSchema } from "@/lib/zod/schemas/clicks";
+import { leadEventEnrichedSchema } from "@/lib/zod/schemas/leads";
+import { saleEventEnrichedSchema } from "@/lib/zod/schemas/sales";
+import { ZodOpenApiOperationObject } from "zod-openapi";
+
+export const listEvents: ZodOpenApiOperationObject = {
+ operationId: "listEvents",
+ "x-speakeasy-name-override": "list",
+ summary: "Retrieve a list of events",
+ description:
+ "Retrieve a paginated list of events for the authenticated workspace.",
+ requestParams: {
+ query: eventsQuerySchema,
+ },
+ responses: {
+ "200": {
+ description: "A list of events",
+ content: {
+ "application/json": {
+ schema: z.union([
+ z.array(clickEventEnrichedSchema),
+ z.array(leadEventEnrichedSchema),
+ z.array(saleEventEnrichedSchema),
+ ]),
+ },
+ },
+ },
+ ...openApiErrorResponses,
+ },
+ tags: ["Events"],
+ security: [{ token: [] }],
+};