/** * @factory/shared โ€” the PUBLIC webhook subscription catalog. * * Lives in its own dependency-free module (and NOT in `events.ts`) because * it is imported by `dto/webhook.dto.ts`, which is part of the * `@factory/shared/dto` barrel โ€” the browser-safe DTO surface that the web * bundle imports. `events.ts` imports `node:crypto` (for `generateId`), so a * dependency on it would pull `node:crypto` into the browser bundle and * fail the Next.js build with `UnhandledSchemeError`. Keep this module free * of Node builtins. * * `events.ts` re-exports both names, so existing import sites * (`import { WEBHOOK_EVENTS } from "../events.js"`) keep working unchanged. */ /** * Events a webhook can subscribe to (PRODUCT-SPEC ยง22 catalog). A subset of * the full domain catalog โ€” webhook-safe, tenant-scoped content events only. */ export const WEBHOOK_EVENTS = [ "page.created", "page.updated", "page.deleted", "database.created", "database.updated", "record.created", "record.updated", "comment.created", "form.submitted", "automation.executed", ] as const; export type WebhookEventName = (typeof WEBHOOK_EVENTS)[number];