diff options
Diffstat (limited to 'packages')
| -rw-r--r-- | packages/db/schema.ts | 3 | ||||
| -rw-r--r-- | packages/shared/queues.ts | 2 | ||||
| -rw-r--r-- | packages/shared/types/webhooks.ts | 7 |
3 files changed, 8 insertions, 4 deletions
diff --git a/packages/db/schema.ts b/packages/db/schema.ts index 111081b8..ae694fc8 100644 --- a/packages/db/schema.ts +++ b/packages/db/schema.ts @@ -404,7 +404,7 @@ export const webhooksTable = sqliteTable( .references(() => users.id, { onDelete: "cascade" }), events: text("events", { mode: "json" }) .notNull() - .$type<("created" | "edited" | "crawled")[]>(), + .$type<("created" | "edited" | "crawled" | "ai tagged")[]>(), token: text("token"), }, (bl) => [index("webhooks_userId_idx").on(bl.userId)], @@ -536,7 +536,6 @@ export const bookmarksInListsRelations = relations( }), ); - export const webhooksRelations = relations(webhooksTable, ({ one }) => ({ user: one(users, { fields: [webhooksTable.userId], diff --git a/packages/shared/queues.ts b/packages/shared/queues.ts index 5484ffb2..624f2bca 100644 --- a/packages/shared/queues.ts +++ b/packages/shared/queues.ts @@ -170,7 +170,7 @@ export const AssetPreprocessingQueue = // Webhook worker export const zWebhookRequestSchema = z.object({ bookmarkId: z.string(), - operation: z.enum(["crawled", "created", "edited"]), + operation: z.enum(["crawled", "created", "edited", "ai tagged"]), }); 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 8d425ad9..819951ce 100644 --- a/packages/shared/types/webhooks.ts +++ b/packages/shared/types/webhooks.ts @@ -3,7 +3,12 @@ import { z } from "zod"; const MAX_WEBHOOK_URL_LENGTH = 500; const MAX_WEBHOOK_TOKEN_LENGTH = 100; -export const zWebhookEventSchema = z.enum(["created", "edited", "crawled"]); +export const zWebhookEventSchema = z.enum([ + "created", + "edited", + "crawled", + "ai tagged", +]); export type ZWebhookEvent = z.infer<typeof zWebhookEventSchema>; export const zWebhookSchema = z.object({ |
