From cddaefd9420507318d71f56355ff5a6648dcd951 Mon Sep 17 00:00:00 2001 From: Mohamed Bassem Date: Sun, 19 Jan 2025 13:55:40 +0000 Subject: feat: Change webhooks to be configurable by users --- packages/shared/queues.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'packages/shared/queues.ts') diff --git a/packages/shared/queues.ts b/packages/shared/queues.ts index b0002a29..cbe58f8d 100644 --- a/packages/shared/queues.ts +++ b/packages/shared/queues.ts @@ -159,10 +159,10 @@ export const AssetPreprocessingQueue = }, ); -//Webhook worker +// Webhook worker export const zWebhookRequestSchema = z.object({ bookmarkId: z.string(), - operation: z.enum(["crawled"]), + operation: z.enum(["crawled", "created", "edited"]), }); export type ZWebhookRequest = z.infer; export const WebhookQueue = new SqliteQueue( @@ -176,9 +176,9 @@ export const WebhookQueue = new SqliteQueue( }, ); -export async function triggerWebhookWorker( +export async function triggerWebhook( bookmarkId: string, - operation: "crawled", + operation: ZWebhookRequest["operation"], ) { await WebhookQueue.enqueue({ bookmarkId, -- cgit v1.2.3-70-g09d2