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 components only

Steven Tey7942eed80bc3
diff --git a/apps/web/lib/openapi/index.ts b/apps/web/lib/openapi/index.ts
index fa8f1e82d2..0c4cd752c3 100644
--- a/apps/web/lib/openapi/index.ts
+++ b/apps/web/lib/openapi/index.ts
@@ -12,7 +12,7 @@ import { metatagsPath } from "./metatags";
import { qrCodePaths } from "./qr";
import { tagsPaths } from "./tags";
import { trackPaths } from "./track";
-import { webhooksPaths } from "./webhooks";
+import { LeadCreatedEvent, SaleCreatedEvent } from "./webhooks";
import { workspacesPaths } from "./workspaces";
export const document = createDocument({
@@ -55,6 +55,8 @@ export const document = createDocument({
WorkspaceSchema,
TagSchema,
DomainSchema,
+ LeadCreatedEvent,
+ SaleCreatedEvent,
},
securitySchemes: {
token: {
@@ -68,7 +70,4 @@ export const document = createDocument({
...openApiErrorResponses,
},
},
- webhooks: {
- ...webhooksPaths,
- },
});
diff --git a/apps/web/lib/openapi/webhooks/index.ts b/apps/web/lib/openapi/webhooks/index.ts
index 52c3030c73..fb11cdd5de 100644
--- a/apps/web/lib/openapi/webhooks/index.ts
+++ b/apps/web/lib/openapi/webhooks/index.ts
@@ -1,12 +1,2 @@
-import { ZodOpenApiPathsObject } from "zod-openapi";
-import { leadCreatedEvent } from "./lead-created";
-import { saleCreatedEvent } from "./sale-created";
-
-export const webhooksPaths: ZodOpenApiPathsObject = {
- leadCreated: {
- post: leadCreatedEvent,
- },
- saleCreated: {
- post: saleCreatedEvent,
- },
-};
+export * from "./lead-created";
+export * from "./sale-created";
diff --git a/apps/web/lib/openapi/webhooks/lead-created.ts b/apps/web/lib/openapi/webhooks/lead-created.ts
index 671cc0acf0..579ec7d267 100644
--- a/apps/web/lib/openapi/webhooks/lead-created.ts
+++ b/apps/web/lib/openapi/webhooks/lead-created.ts
@@ -1,10 +1,10 @@
import { leadWebhookEventSchema } from "@/lib/webhook/schemas";
import { ZodOpenApiOperationObject } from "zod-openapi";
-export const leadCreatedEvent: ZodOpenApiOperationObject = {
- operationId: "leadCreatedEvent",
- "x-speakeasy-name-override": "leadCreated",
- summary: "Lead created",
+export const LeadCreatedEvent: ZodOpenApiOperationObject = {
+ "x-speakeasy-include": true,
+ "x-speakeasy-name-override": "LeadCreatedEvent",
+ summary: "Lead created event",
description: "A webhook that is called when a lead is created.",
requestBody: {
description: "Details about the lead that was created.",
diff --git a/apps/web/lib/openapi/webhooks/sale-created.ts b/apps/web/lib/openapi/webhooks/sale-created.ts
index 6cc553e6a1..268e8ac397 100644
--- a/apps/web/lib/openapi/webhooks/sale-created.ts
+++ b/apps/web/lib/openapi/webhooks/sale-created.ts
@@ -1,9 +1,9 @@
import { saleWebhookEventSchema } from "@/lib/webhook/schemas";
import { ZodOpenApiOperationObject } from "zod-openapi";
-export const saleCreatedEvent: ZodOpenApiOperationObject = {
- operationId: "saleCreatedEvent",
- "x-speakeasy-name-override": "saleCreated",
+export const SaleCreatedEvent: ZodOpenApiOperationObject = {
+ "x-speakeasy-include": true,
+ "x-speakeasy-name-override": "SaleCreatedEvent",
summary: "Sale created",
description: "A webhook that is called when a sale is created.",
requestBody: {