@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.
@@ -134,6 +134,13 @@
134
134
  "when": 1780855021994,
135
135
  "tag": "0018_webhooks",
136
136
  "breakpoints": true
137
+ },
138
+ {
139
+ "idx": 19,
140
+ "version": "7",
141
+ "when": 1780907482971,
142
+ "tag": "0019_flippant_songbird",
143
+ "breakpoints": true
137
144
  }
138
145
  ]
139
146
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hogsend/db",
3
- "version": "0.8.0",
3
+ "version": "0.9.0",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -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
- secret: text("secret").notNull(),
27
- // e.g. "whsec_AbCd" safe to show on list/get.
28
- secretPrefix: text("secret_prefix").notNull(),
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()