diff options
Diffstat (limited to 'packages')
| -rw-r--r-- | packages/db/schema.ts | 2 | ||||
| -rw-r--r-- | packages/shared/queues.ts | 2 | ||||
| -rw-r--r-- | packages/shared/types/webhooks.ts | 1 | ||||
| -rw-r--r-- | packages/trpc/routers/bookmarks.ts | 1 |
4 files changed, 4 insertions, 2 deletions
diff --git a/packages/db/schema.ts b/packages/db/schema.ts index 0e8167c7..5c109b76 100644 --- a/packages/db/schema.ts +++ b/packages/db/schema.ts @@ -419,7 +419,7 @@ export const webhooksTable = sqliteTable( .references(() => users.id, { onDelete: "cascade" }), events: text("events", { mode: "json" }) .notNull() - .$type<("created" | "edited" | "crawled" | "ai tagged")[]>(), + .$type<("created" | "edited" | "crawled" | "ai tagged" | "deleted")[]>(), token: text("token"), }, (bl) => [index("webhooks_userId_idx").on(bl.userId)], diff --git a/packages/shared/queues.ts b/packages/shared/queues.ts index bbf69428..a434414c 100644 --- a/packages/shared/queues.ts +++ b/packages/shared/queues.ts @@ -172,7 +172,7 @@ export const AssetPreprocessingQueue = // Webhook worker export const zWebhookRequestSchema = z.object({ bookmarkId: z.string(), - operation: z.enum(["crawled", "created", "edited", "ai tagged"]), + operation: z.enum(["crawled", "created", "edited", "ai tagged", "deleted"]), }); export type ZWebhookRequest = z.infer<typeof zWebhookRequestSchema>; export const WebhookQueue = new SqliteQueue<ZWebhookRequest>( diff --git a/packages/shared/types/webhooks.ts b/packages/shared/types/webhooks.ts index 819951ce..75980b70 100644 --- a/packages/shared/types/webhooks.ts +++ b/packages/shared/types/webhooks.ts @@ -8,6 +8,7 @@ export const zWebhookEventSchema = z.enum([ "edited", "crawled", "ai tagged", + "deleted", ]); export type ZWebhookEvent = z.infer<typeof zWebhookEventSchema>; diff --git a/packages/trpc/routers/bookmarks.ts b/packages/trpc/routers/bookmarks.ts index de5bd4c2..29a77d8c 100644 --- a/packages/trpc/routers/bookmarks.ts +++ b/packages/trpc/routers/bookmarks.ts @@ -660,6 +660,7 @@ export const bookmarksAppRouter = router({ ), ); await triggerSearchDeletion(input.bookmarkId); + await triggerWebhook(input.bookmarkId, "deleted"); if (deleted.changes > 0 && bookmark) { await cleanupAssetForBookmark({ asset: bookmark.asset, |
