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.

webhookSchema -> WebhookSchema

Kiran Kd2a5dcc9f393
diff --git a/apps/web/lib/types.ts b/apps/web/lib/types.ts
index 113e4941a2..881bf70ec3 100644
--- a/apps/web/lib/types.ts
+++ b/apps/web/lib/types.ts
@@ -54,7 +54,7 @@ import { usageResponse } from "./zod/schemas/usage";
import {
createWebhookSchema,
webhookEventSchemaTB,
- webhookSchema,
+ WebhookSchema,
} from "./zod/schemas/webhooks";
export type LinkProps = Link;
@@ -309,7 +309,7 @@ export type InstalledIntegrationInfoProps = Pick<
export type WebhookTrigger = keyof typeof WEBHOOK_TRIGGER_DESCRIPTIONS;
-export type WebhookProps = z.infer<typeof webhookSchema>;
+export type WebhookProps = z.infer<typeof WebhookSchema>;
export type NewWebhook = z.infer<typeof createWebhookSchema>;
diff --git a/apps/web/lib/webhook/transform.ts b/apps/web/lib/webhook/transform.ts
index 232bc0309d..90b4fddb37 100644
--- a/apps/web/lib/webhook/transform.ts
+++ b/apps/web/lib/webhook/transform.ts
@@ -8,7 +8,7 @@ import { ExpandedLink, transformLink } from "../api/links/utils/transform-link";
import { WebhookTrigger } from "../types";
import z from "../zod";
import { clickEventSchema, clickEventSchemaTB } from "../zod/schemas/clicks";
-import { webhookSchema } from "../zod/schemas/webhooks";
+import { WebhookSchema } from "../zod/schemas/webhooks";
import { WEBHOOK_EVENT_ID_PREFIX } from "./constants";
import { leadWebhookEventSchema, saleWebhookEventSchema } from "./schemas";
@@ -22,7 +22,7 @@ interface TransformWebhookProps
// This is the format we send webhook details to the client
export const transformWebhook = (webhook: TransformWebhookProps) => {
- return webhookSchema.parse({
+ return WebhookSchema.parse({
...webhook,
linkIds: webhook.links.map(({ linkId }) => linkId),
});
diff --git a/apps/web/lib/zod/schemas/webhooks.ts b/apps/web/lib/zod/schemas/webhooks.ts
index 8e3c2a4210..4b52facd54 100644
--- a/apps/web/lib/zod/schemas/webhooks.ts
+++ b/apps/web/lib/zod/schemas/webhooks.ts
@@ -1,7 +1,7 @@
import { WEBHOOK_TRIGGERS } from "@/lib/webhook/constants";
import { z } from "zod";
-export const webhookSchema = z.object({
+export const WebhookSchema = z.object({
id: z.string(),
name: z.string(),
url: z.string(),