@hogsend/db 0.8.0 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -22,10 +22,23 @@ export const webhookEndpoints = pgTable(
|
|
|
22
22
|
organizationId: text("organization_id"),
|
|
23
23
|
url: text("url").notNull(),
|
|
24
24
|
description: text("description"),
|
|
25
|
+
// The delivery adapter selector. "webhook" (the default) is the signed
|
|
26
|
+
// Standard-Webhooks POST that existing subscribers receive — byte-identical
|
|
27
|
+
// to before this column existed. Any other value (e.g. "posthog") selects a
|
|
28
|
+
// delivery-time TRANSFORM adapter that reuses the same durable delivery
|
|
29
|
+
// machinery but rewrites url/headers/body for a vendor destination.
|
|
30
|
+
kind: text("kind").notNull().default("webhook"),
|
|
31
|
+
// Per-destination configuration for keyed adapters (e.g. PostHog's
|
|
32
|
+
// `{ apiKey, host }`). Null for `kind="webhook"` (it reads `secret` instead).
|
|
33
|
+
// Keyed destinations keep their credentials HERE, not in a fake `whsec_`.
|
|
34
|
+
config: jsonb("config").$type<Record<string, unknown>>(),
|
|
25
35
|
// whsec_<base64url> PLAINTEXT (recoverable; re-signed every delivery).
|
|
26
|
-
|
|
27
|
-
//
|
|
28
|
-
|
|
36
|
+
// Nullable: only `kind="webhook"` carries a signing secret; keyed
|
|
37
|
+
// destinations authenticate via `config` and the webhook adapter is the only
|
|
38
|
+
// reader of this column.
|
|
39
|
+
secret: text("secret"),
|
|
40
|
+
// e.g. "whsec_AbCd" — safe to show on list/get. Nullable alongside `secret`.
|
|
41
|
+
secretPrefix: text("secret_prefix"),
|
|
29
42
|
eventTypes: jsonb("event_types")
|
|
30
43
|
.$type<WebhookEventType[]>()
|
|
31
44
|
.notNull()
|