feat: add webhook logs (#2237)

This commit is contained in:
David Nguyen
2025-11-25 16:03:52 +11:00
committed by GitHub
parent 11a56f3228
commit d857dfdb38
17 changed files with 1663 additions and 411 deletions

View File

@@ -1,12 +1,6 @@
import { WebhookTriggerEvents } from '@prisma/client';
import { z } from 'zod';
export const ZGetTeamWebhooksRequestSchema = z.object({
teamId: z.number(),
});
export type TGetTeamWebhooksRequestSchema = z.infer<typeof ZGetTeamWebhooksRequestSchema>;
export const ZCreateWebhookRequestSchema = z.object({
webhookUrl: z.string().url(),
eventTriggers: z
@@ -14,14 +8,12 @@ export const ZCreateWebhookRequestSchema = z.object({
.min(1, { message: 'At least one event trigger is required' }),
secret: z.string().nullable(),
enabled: z.boolean(),
teamId: z.number(),
});
export type TCreateWebhookFormSchema = z.infer<typeof ZCreateWebhookRequestSchema>;
export const ZGetWebhookByIdRequestSchema = z.object({
id: z.string(),
teamId: z.number(),
});
export type TGetWebhookByIdRequestSchema = z.infer<typeof ZGetWebhookByIdRequestSchema>;
@@ -34,7 +26,6 @@ export type TEditWebhookRequestSchema = z.infer<typeof ZEditWebhookRequestSchema
export const ZDeleteWebhookRequestSchema = z.object({
id: z.string(),
teamId: z.number(),
});
export type TDeleteWebhookRequestSchema = z.infer<typeof ZDeleteWebhookRequestSchema>;
@@ -42,7 +33,6 @@ export type TDeleteWebhookRequestSchema = z.infer<typeof ZDeleteWebhookRequestSc
export const ZTriggerTestWebhookRequestSchema = z.object({
id: z.string(),
event: z.nativeEnum(WebhookTriggerEvents),
teamId: z.number(),
});
export type TTriggerTestWebhookRequestSchema = z.infer<typeof ZTriggerTestWebhookRequestSchema>;