@quickback-dev/cli 0.65.0 → 0.66.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.
Files changed (70) hide show
  1. package/dist/commands/compile.d.ts +1 -1
  2. package/dist/commands/compile.d.ts.map +1 -1
  3. package/dist/commands/compile.js +13 -0
  4. package/dist/commands/compile.js.map +1 -1
  5. package/dist/index.js +1 -1
  6. package/dist/lib/action-harvest.d.ts.map +1 -1
  7. package/dist/lib/action-harvest.js +14 -6
  8. package/dist/lib/action-harvest.js.map +1 -1
  9. package/dist/lib/action-harvest.test.js +26 -0
  10. package/dist/lib/action-harvest.test.js.map +1 -1
  11. package/dist/lib/migrations/drizzle.d.ts.map +1 -1
  12. package/dist/lib/migrations/drizzle.js +6 -1
  13. package/dist/lib/migrations/drizzle.js.map +1 -1
  14. package/dist/lib/migrations/drizzle.test.js +3 -0
  15. package/dist/lib/migrations/drizzle.test.js.map +1 -1
  16. package/dist/skill/docs/api/batch-operations.md +1 -1
  17. package/dist/skill/docs/api/crud.md +1 -1
  18. package/dist/skill/docs/api/index.md +1 -1
  19. package/dist/skill/docs/api/query-params.md +5 -8
  20. package/dist/skill/docs/changelog/index.md +109 -1
  21. package/dist/skill/docs/configure/auth.md +20 -12
  22. package/dist/skill/docs/configure/domains.md +11 -0
  23. package/dist/skill/docs/configure/index.md +16 -27
  24. package/dist/skill/docs/configure/providers.md +1 -1
  25. package/dist/skill/docs/define/actions/defining.md +2 -2
  26. package/dist/skill/docs/define/actions/record-and-standalone.md +1 -1
  27. package/dist/skill/docs/define/actions/scoped-db.md +1 -1
  28. package/dist/skill/docs/define/changesets.md +7 -8
  29. package/dist/skill/docs/define/feature.md +0 -1
  30. package/dist/skill/docs/define/read.md +2 -2
  31. package/dist/skill/docs/define/sealed-protocol.md +1 -1
  32. package/dist/skill/docs/platform/api-contract/index.md +52 -42
  33. package/dist/skill/docs/platform/auth/jwt-optimization.md +1 -1
  34. package/dist/skill/docs/platform/auth/plugins/index.md +9 -2
  35. package/dist/skill/docs/platform/database/neon.md +1 -1
  36. package/dist/skill/docs/platform/realtime/durable-objects.md +69 -36
  37. package/dist/skill/docs/platform/realtime/index.md +8 -10
  38. package/dist/skill/docs/platform/realtime/named-invalidations.md +23 -9
  39. package/dist/skill/docs/platform/realtime/using-realtime.md +58 -34
  40. package/dist/skill/docs/platform/webhooks/outbound.md +4 -5
  41. package/dist/skill/docs/tooling/output.md +1 -1
  42. package/dist/skill/docs/ui/account/hooks.md +0 -1
  43. package/package.json +1 -1
  44. package/src/skill/docs/api/batch-operations.md +1 -1
  45. package/src/skill/docs/api/crud.md +1 -1
  46. package/src/skill/docs/api/index.md +1 -1
  47. package/src/skill/docs/api/query-params.md +5 -8
  48. package/src/skill/docs/changelog/index.md +109 -1
  49. package/src/skill/docs/configure/auth.md +20 -12
  50. package/src/skill/docs/configure/domains.md +11 -0
  51. package/src/skill/docs/configure/index.md +16 -27
  52. package/src/skill/docs/configure/providers.md +1 -1
  53. package/src/skill/docs/define/actions/defining.md +2 -2
  54. package/src/skill/docs/define/actions/record-and-standalone.md +1 -1
  55. package/src/skill/docs/define/actions/scoped-db.md +1 -1
  56. package/src/skill/docs/define/changesets.md +7 -8
  57. package/src/skill/docs/define/feature.md +0 -1
  58. package/src/skill/docs/define/read.md +2 -2
  59. package/src/skill/docs/define/sealed-protocol.md +1 -1
  60. package/src/skill/docs/platform/api-contract/index.md +52 -42
  61. package/src/skill/docs/platform/auth/jwt-optimization.md +1 -1
  62. package/src/skill/docs/platform/auth/plugins/index.md +9 -2
  63. package/src/skill/docs/platform/database/neon.md +1 -1
  64. package/src/skill/docs/platform/realtime/durable-objects.md +69 -36
  65. package/src/skill/docs/platform/realtime/index.md +8 -10
  66. package/src/skill/docs/platform/realtime/named-invalidations.md +23 -9
  67. package/src/skill/docs/platform/realtime/using-realtime.md +58 -34
  68. package/src/skill/docs/platform/webhooks/outbound.md +4 -5
  69. package/src/skill/docs/tooling/output.md +1 -1
  70. package/src/skill/docs/ui/account/hooks.md +0 -1
@@ -212,16 +212,20 @@ await realtime.insert('applications', {
212
212
  Broadcasts:
213
213
  ```json
214
214
  {
215
- "type": "postgres_changes",
216
- "table": "applications",
217
- "eventType": "INSERT",
218
- "schema": "public",
219
- "new": {
220
- "id": "app_123",
221
- "candidateId": "cnd_456",
222
- "stage": "applied"
223
- },
224
- "old": null
215
+ "specversion": "1.0",
216
+ "id": "evt_…",
217
+ "source": "/broadcast/v1/websocket",
218
+ "type": "dev.quickback.myapp.applications.insert",
219
+ "time": "2026-08-17T10:04:11.921Z",
220
+ "datacontenttype": "application/json",
221
+ "qbframe": "postgres_changes",
222
+ "data": {
223
+ "table": "applications",
224
+ "schema": "public",
225
+ "eventType": "INSERT",
226
+ "new": { "id": "app_123", "candidateId": "cnd_456", "stage": "applied" },
227
+ "old": null
228
+ }
225
229
  }
226
230
  ```
227
231
 
@@ -238,12 +242,20 @@ await realtime.update('applications',
238
242
  Broadcasts:
239
243
  ```json
240
244
  {
241
- "type": "postgres_changes",
242
- "table": "applications",
243
- "eventType": "UPDATE",
244
- "schema": "public",
245
- "new": { "id": "app_123", "stage": "interview" },
246
- "old": { "id": "app_123", "stage": "screening" }
245
+ "specversion": "1.0",
246
+ "id": "evt_…",
247
+ "source": "/broadcast/v1/websocket",
248
+ "type": "dev.quickback.myapp.applications.update",
249
+ "time": "2026-08-17T10:04:11.921Z",
250
+ "datacontenttype": "application/json",
251
+ "qbframe": "postgres_changes",
252
+ "data": {
253
+ "table": "applications",
254
+ "schema": "public",
255
+ "eventType": "UPDATE",
256
+ "new": { "id": "app_123", "stage": "interview" },
257
+ "old": { "id": "app_123", "stage": "screening" }
258
+ }
247
259
  }
248
260
  ```
249
261
 
@@ -259,12 +271,20 @@ await realtime.delete('applications',
259
271
  Broadcasts:
260
272
  ```json
261
273
  {
262
- "type": "postgres_changes",
263
- "table": "applications",
264
- "eventType": "DELETE",
265
- "schema": "public",
266
- "new": null,
267
- "old": { "id": "app_123" }
274
+ "specversion": "1.0",
275
+ "id": "evt_…",
276
+ "source": "/broadcast/v1/websocket",
277
+ "type": "dev.quickback.myapp.applications.delete",
278
+ "time": "2026-08-17T10:04:11.921Z",
279
+ "datacontenttype": "application/json",
280
+ "qbframe": "postgres_changes",
281
+ "data": {
282
+ "table": "applications",
283
+ "schema": "public",
284
+ "eventType": "DELETE",
285
+ "new": null,
286
+ "old": { "id": "app_123" }
287
+ }
268
288
  }
269
289
  ```
270
290
 
@@ -290,9 +310,14 @@ subscriber) or `['PUBLIC']`.
290
310
  Broadcasts:
291
311
  ```json
292
312
  {
293
- "type": "broadcast",
294
- "event": "screening-complete",
295
- "payload": {
313
+ "specversion": "1.0",
314
+ "id": "evt_…",
315
+ "source": "/broadcast/v1/websocket",
316
+ "type": "screening-complete",
317
+ "time": "2026-08-17T10:04:11.921Z",
318
+ "datacontenttype": "application/json",
319
+ "qbframe": "broadcast",
320
+ "data": {
296
321
  "applicationId": "app_123",
297
322
  "candidateId": "cnd_456",
298
323
  "stage": "interview"
@@ -545,13 +570,16 @@ Tickets expire after 60 seconds, so fetch a fresh one before each connection or
545
570
 
546
571
  ### Handling Messages
547
572
 
573
+ Data frames are [CloudEvents 1.0 envelopes](/platform/realtime/using-realtime#cloudevents-envelopes).
574
+ Discriminate on `qbframe`, never on `type`, and read the body from `data`:
575
+
548
576
  ```typescript
549
577
  ws.onmessage = (event) => {
550
578
  const msg = JSON.parse(event.data);
551
579
 
552
580
  // Handle CRUD events
553
- if (msg.type === 'postgres_changes') {
554
- const { table, eventType, new: newRecord, old: oldRecord } = msg;
581
+ if (msg.qbframe === 'postgres_changes') {
582
+ const { table, eventType, new: newRecord, old: oldRecord } = msg.data;
555
583
 
556
584
  if (eventType === 'INSERT') {
557
585
  addRecord(table, newRecord);
@@ -562,9 +590,10 @@ ws.onmessage = (event) => {
562
590
  }
563
591
  }
564
592
 
565
- // Handle custom broadcasts
566
- if (msg.type === 'broadcast') {
567
- const { event, payload } = msg;
593
+ // Handle custom broadcasts — `type` is your wire name verbatim.
594
+ if (msg.qbframe === 'broadcast') {
595
+ const event = msg.type;
596
+ const payload = msg.data;
568
597
 
569
598
  if (event === 'screening-complete') {
570
599
  refreshApplication(payload.applicationId);
@@ -715,15 +744,19 @@ export const execute: ActionExecutor = async ({ ctx, input }) => {
715
744
 
716
745
  ### Event Format
717
746
 
718
- Custom namespace events use the `broadcast` type with namespaced event names:
747
+ Custom namespace events carry `qbframe: "broadcast"`; the namespaced event
748
+ name is the CloudEvents `type`, verbatim:
719
749
 
720
750
  ```json
721
751
  {
722
- "type": "broadcast",
723
- "event": "screening:started",
724
- "payload": {
725
- "applicationId": "app_123"
726
- }
752
+ "specversion": "1.0",
753
+ "id": "evt_…",
754
+ "source": "/broadcast/v1/websocket",
755
+ "type": "screening:started",
756
+ "time": "2026-08-17T10:04:11.921Z",
757
+ "datacontenttype": "application/json",
758
+ "qbframe": "broadcast",
759
+ "data": { "applicationId": "app_123" }
727
760
  }
728
761
  ```
729
762
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  Quickback ships **two parallel realtime primitives**, both backed by Cloudflare Durable Objects:
4
4
 
5
- - **`/broadcast/v1/*` — server fan-out.** One DO instance per subscription scope. Postgres-changes events from CRUD routes plus custom broadcast events flow out to every subscriber, with role filtering and per-role field masking applied. Best for "tell every client in this shared scope that something changed." The scope can be an organization, a specific user, or a compiler-resolved resource key like `events:evt_123`. The `/broadcast/v1` version segment tracks `contract.routes` — set it to `"v2"` and the same surface mounts at `/broadcast/v2` (no hidden v1 alias). `contract.version` selects the frame FORMAT, not the path: on v2 semantics (the default) frames are [CloudEvents 1.0](/platform/api-contract#contract-version-matrix) envelopes regardless of which prefix you serve them on. Documented on this page. For **typed, targeted "this changed — refresh" signals** fired from an action after commit (with optional per-recipient narrowing), see [Named invalidations](/platform/realtime/named-invalidations).
5
+ - **`/broadcast/v1/*` — server fan-out.** One DO instance per subscription scope. Postgres-changes events from CRUD routes plus custom broadcast events flow out to every subscriber, with role filtering and per-role field masking applied. Best for "tell every client in this shared scope that something changed." The scope can be an organization, a specific user, or a compiler-resolved resource key like `events:evt_123`. The `/broadcast/v1` version segment tracks `contract.routes` — set it to `"v2"` and the same surface mounts at `/broadcast/v2` (no hidden v1 alias). Framing is independent of the path: frames are [CloudEvents 1.0](/platform/realtime/using-realtime#cloudevents-envelopes) envelopes regardless of which prefix you serve them on. Documented on this page. For **typed, targeted "this changed — refresh" signals** fired from an action after commit (with optional per-recipient narrowing), see [Named invalidations](/platform/realtime/named-invalidations).
6
6
  - **`/realtime/<binding>/<room-id>` — bidirectional rooms.** One DO instance per room (per document, per interview, per game). Client↔client messages, presence, and CRDT-friendly state. Use these for collaborative editing. See [PartyServer rooms](/platform/realtime/partyserver-rooms).
7
7
 
8
8
  Both share the same auth model and ride on the same compiled worker; they solve different problems.
@@ -194,20 +194,18 @@ There are **three declarative emission surfaces** — pick by what did the write
194
194
  | A custom action | **`invalidates:`** on the action | [Named invalidations](/platform/realtime/named-invalidations) |
195
195
  | An [aggregate changeset](/define/changesets) (`owns`) | **`afterCommit`** on the aggregate root — one CloudEvent after commit | [changesets → afterCommit](/define/changesets#aftercommit--emit-a-realtime-signal-after-the-changeset-commits) |
196
196
 
197
- ## CloudEvents (contract v2) + AsyncAPI (any contract)
197
+ ## CloudEvents + AsyncAPI
198
198
 
199
- On the v2 contract, realtime data frames are delivered as CloudEvents 1.0
200
- envelopes (control frames stay raw); the path stays wherever `contract.routes`
201
- mounts it. See
202
- [Using Realtime](/platform/realtime/using-realtime#cloudevents-envelopes-contract-v2)
199
+ Realtime data frames are delivered as CloudEvents 1.0 envelopes (control
200
+ frames stay raw), on whatever path `contract.routes` mounts. Match frames on
201
+ the `qbframe` extension, never on `type`. See
202
+ [Using Realtime](/platform/realtime/using-realtime#cloudevents-envelopes)
203
203
  for the frame mapping.
204
204
 
205
205
  The project's event surface — realtime channels, named-invalidation events,
206
206
  and outbound webhook messages — is published as an AsyncAPI 3.0 document at
207
- `GET /asyncapi.json` (same auth gating as `/openapi.json`). The document is
208
- **contract-version-independent**: it is emitted for any project with realtime
209
- or webhooks (v1 included); only the message payload *schemas* are shaped by
210
- the pinned contract — raw frames on v1, CloudEvents envelopes on v2.
207
+ `GET /asyncapi.json` (same auth gating as `/openapi.json`), for any project
208
+ with realtime or webhooks.
211
209
 
212
210
  ## Realtime emit from actions
213
211
 
@@ -32,7 +32,7 @@ export const attendRealtime = defineRealtime({
32
32
  events: {
33
33
  mobileBundleChanged: {
34
34
  wireName: "event.mobile-bundle.changed", // clients listen for this
35
- version: 1, // contract version (baked into every frame)
35
+ version: 1, // event version (rides as qbversion)
36
36
  variants: {
37
37
  documentCreated: {
38
38
  reason: "document.created", // clients branch on this
@@ -121,26 +121,40 @@ Each `invalidate.<binding>.<variant>(payload)` call queues **one** after-commit
121
121
  - **After-commit, best-effort.** Calls queue frames that fire only after `execute` returns successfully; a `throw` or a `dryRun` discards them (they ride the after-commit effects collector). A rolled-back batch record fires nothing.
122
122
  - **Fail-closed targeting.** An unresolvable scope room or a missing recipient set delivers to nobody — never a broad fan-out.
123
123
  - **Projection.** The frame payload is projected to the variant's declared keys; undeclared fields never reach the wire.
124
- - **Contract fields.** `version` and `reason` are baked from the registry and always present.
124
+ - **Contract fields.** `version` and `reason` are baked from the registry and always present, riding as the `qbversion` / `qbreason` CloudEvents extensions.
125
125
 
126
126
  ## The wire frame
127
127
 
128
- Clients receive a broadcast frame on `/broadcast/v{n}` (the segment tracks `contract.routes`):
128
+ Clients receive a [CloudEvents 1.0](/platform/realtime/using-realtime#cloudevents-envelopes)
129
+ frame on `/broadcast/v{n}` (the segment tracks `contract.routes`):
129
130
 
130
131
  ```jsonc
131
132
  {
132
- "type": "broadcast",
133
- "event": "event.mobile-bundle.changed", // the wireName
134
- "payload": {
135
- "version": 1, // contract version → negotiation
136
- "reason": "document.created", // what changed → what to refresh
133
+ "specversion": "1.0",
134
+ "id": "evt_9f2…",
135
+ "source": "/broadcast/v1/websocket",
136
+ "type": "event.mobile-bundle.changed", // the wireName, VERBATIM
137
+ "time": "2026-08-17T10:04:11.921Z",
138
+ "datacontenttype": "application/json",
139
+ "qbframe": "broadcast", // the discriminator — match on this
140
+ "qbversion": 1, // event version → negotiation
141
+ "qbreason": "document.created", // what changed → what to refresh
142
+ "data": { // payload MINUS version/reason
137
143
  "eventId": "evt_1",
138
144
  "documentId": "doc_9"
139
145
  }
140
146
  }
141
147
  ```
142
148
 
143
- Subscribe to the `wireName`, use `version` for contract negotiation, and branch on `reason` to decide which query/cache to invalidate. Role gating (`targetRoles`) and — when a recipient resolver is used — identity narrowing (`targetTags`) are applied by the Broadcaster before the frame reaches any socket; the client just receives the frames meant for it.
149
+ `version` and `reason` ride as the `qbversion` / `qbreason` extension
150
+ attributes, not inside `data` — the projected payload keys are `data`'s only
151
+ contents. Your `wireName` is the `type` verbatim: author-supplied event names
152
+ are never reverse-DNS prefixed.
153
+
154
+ Match on `qbframe === "broadcast"` (never on `type`, whose shape is not a
155
+ stable contract), then dispatch on `type` for the wireName, use `qbversion` for
156
+ negotiation, and branch on `qbreason` to decide which query/cache to
157
+ invalidate. Role gating (`targetRoles`) and — when a recipient resolver is used — identity narrowing (`targetTags`) are applied by the Broadcaster before the frame reaches any socket; the client just receives the frames meant for it.
144
158
 
145
159
  ## Related
146
160
 
@@ -56,14 +56,16 @@ If the ticket is invalid or expired, the WebSocket upgrade is rejected with a 40
56
56
 
57
57
  ### CRUD Events
58
58
 
59
- CRUD events use the `postgres_changes` type:
59
+ Data frames are [CloudEvents 1.0 envelopes](#cloudevents-envelopes).
60
+ Discriminate on the `qbframe` extension — **never** on `type`, whose shape is
61
+ not a stable contract — and read the row from `data`:
60
62
 
61
63
  ```typescript
62
64
  ws.onmessage = (event) => {
63
65
  const msg = JSON.parse(event.data);
64
66
 
65
- if (msg.type === "postgres_changes") {
66
- const { table, eventType, new: newRecord, old: oldRecord } = msg;
67
+ if (msg.qbframe === "postgres_changes") {
68
+ const { table, eventType, new: newRecord, old: oldRecord } = msg.data;
67
69
 
68
70
  switch (eventType) {
69
71
  case "INSERT":
@@ -84,12 +86,20 @@ ws.onmessage = (event) => {
84
86
 
85
87
  ```json
86
88
  {
87
- "type": "postgres_changes",
88
- "table": "applications",
89
- "schema": "public",
90
- "eventType": "INSERT",
91
- "new": { "id": "app_123", "candidateId": "cnd_456", "stage": "interview" },
92
- "old": null
89
+ "specversion": "1.0",
90
+ "id": "evt_5b1c…",
91
+ "source": "/broadcast/v1/websocket",
92
+ "type": "dev.quickback.myapp.applications.insert",
93
+ "time": "2026-08-17T10:04:11.921Z",
94
+ "datacontenttype": "application/json",
95
+ "qbframe": "postgres_changes",
96
+ "data": {
97
+ "table": "applications",
98
+ "schema": "public",
99
+ "eventType": "INSERT",
100
+ "new": { "id": "app_123", "candidateId": "cnd_456", "stage": "interview" },
101
+ "old": null
102
+ }
93
103
  }
94
104
  ```
95
105
 
@@ -97,11 +107,13 @@ For UPDATE events, both `new` and `old` are populated. For DELETE events, only `
97
107
 
98
108
  ### Custom Broadcasts
99
109
 
100
- Custom events use the `broadcast` type:
110
+ Custom events carry `qbframe: "broadcast"`. Their `type` is your wire name
111
+ verbatim — author-supplied names are never prefixed:
101
112
 
102
113
  ```typescript
103
- if (msg.type === "broadcast") {
104
- const { event, payload } = msg;
114
+ if (msg.qbframe === "broadcast") {
115
+ const event = msg.type;
116
+ const payload = msg.data;
105
117
 
106
118
  if (event === "screening-complete") {
107
119
  refreshApplication(payload.applicationId);
@@ -115,9 +127,14 @@ if (msg.type === "broadcast") {
115
127
 
116
128
  ```json
117
129
  {
118
- "type": "broadcast",
119
- "event": "screening-complete",
120
- "payload": {
130
+ "specversion": "1.0",
131
+ "id": "evt_a71f…",
132
+ "source": "/broadcast/v1/websocket",
133
+ "type": "screening-complete",
134
+ "time": "2026-08-17T10:04:11.921Z",
135
+ "datacontenttype": "application/json",
136
+ "qbframe": "broadcast",
137
+ "data": {
121
138
  "applicationId": "app_123",
122
139
  "candidateId": "cnd_456",
123
140
  "stage": "interview"
@@ -125,6 +142,9 @@ if (msg.type === "broadcast") {
125
142
  }
126
143
  ```
127
144
 
145
+ `type` is your wire name verbatim — author-supplied event names are never
146
+ prefixed. Match on `qbframe`, not `type`.
147
+
128
148
  Custom namespaces (from `defineRealtime()`) use the format `namespace:event` — e.g., `screening:started`, `screening:progress`.
129
149
 
130
150
  ## Security
@@ -212,26 +232,32 @@ tag = "v1"
212
232
  new_classes = ["Broadcaster"]
213
233
  ```
214
234
 
215
- ## CloudEvents envelopes (contract v2)
235
+ ## CloudEvents envelopes
216
236
 
217
- On `contract: { version: "v2" }` every **data frame** is wrapped in a
218
- [CloudEvents 1.0](https://cloudevents.io) envelope at the Durable Object's
219
- send boundary. The endpoint does **not** move — the path segment tracks
220
- `contract.routes` (so `/broadcast/v1` unless you also set `routes: "v2"`);
221
- `version` changes only the frame format. Control frames (`pong`, `error`,
222
- `reauth_ok`) stay raw on both versions, and pinned-v1 projects keep the raw
223
- frames byte-identically.
237
+ Every **data frame** is wrapped in a [CloudEvents 1.0](https://cloudevents.io)
238
+ envelope at the Durable Object's send boundary. Control frames (`pong`,
239
+ `error`, `reauth_ok`) stay raw.
224
240
 
225
- | v1 frame | CloudEvents `type` | `data` | extensions |
241
+ The endpoint path is independent of the framing — it tracks `contract.routes`,
242
+ so `/broadcast/v1` unless you set `routes: "v2"`. Frames are CloudEvents on
243
+ either path.
244
+
245
+ | Frame | CloudEvents `type` | `data` | extensions |
226
246
  |---|---|---|---|
227
247
  | `broadcast` (named invalidation) | the wire name verbatim | payload minus `version`/`reason` | `qbframe: "broadcast"`, `qbversion`, `qbreason` |
228
- | `postgres_changes` | `<project>.<table>.<insert\|update\|delete>` | `{ table, schema, eventType, new, old }` | `qbframe: "postgres_changes"` |
229
- | `view_changes` | `<project>.view.<viewName>.changed` | `{ view, rootId, delta }` | `qbframe: "view_changes"`, `qbseq` (the per-surface monotonic seq — your reconnect/gap-detection contract) |
248
+ | `postgres_changes` | `dev.quickback.<project>.<table>.<insert\|update\|delete>` | `{ table, schema, eventType, new, old }` | `qbframe: "postgres_changes"` |
249
+ | `view_changes` | `dev.quickback.<project>.view.<viewName>.changed` | `{ view, rootId, delta }` | `qbframe: "view_changes"`, `qbseq` (the per-surface monotonic seq — your reconnect/gap-detection contract) |
250
+
251
+ **Discriminate frames on the `qbframe` extension.** Never on `type`, whose
252
+ shape is not a stable contract, and never on payload keys — named-invalidation
253
+ payloads are author-supplied maps, so a broadcast whose payload happens to
254
+ carry `view`/`delta` or `table`/`eventType` keys must not be mistaken for a
255
+ system frame.
230
256
 
231
- Discriminate frames on the `qbframe` extension, **never** on payload keys —
232
- named-invalidation payloads are author-supplied maps, so a broadcast whose
233
- payload happens to carry `view`/`delta` or `table`/`eventType` keys must not
234
- be mistaken for a system frame.
257
+ Compiler-defined types carry the `dev.quickback.` reverse-DNS prefix, per the
258
+ CloudEvents core spec: the prefixed domain names whoever defines the event's
259
+ semantics. Your own broadcast wire names are **not** prefixed — that vocabulary
260
+ is yours.
235
261
 
236
262
  A changeset's [`afterCommit`](/define/changesets#aftercommit--emit-a-realtime-signal-after-the-changeset-commits)
237
263
  broadcast rides the **same `broadcast` frame** (the referenced typed event's
@@ -254,10 +280,8 @@ as a normal `postgres_changes` frame on the table's room.
254
280
 
255
281
  The bundled CMS unwraps envelopes automatically. The full channel/message
256
282
  catalog ships as `GET /asyncapi.json` (AsyncAPI 3.0), served under the same
257
- auth gating as `/openapi.json`. The catalog itself is not v2-only — any
258
- project with realtime or webhooks serves it, on either contract version;
259
- what the pinned contract shapes is the message payload schemas it documents
260
- (raw frames on v1, the CloudEvents envelopes above on v2).
283
+ auth gating as `/openapi.json`. Any project with realtime or webhooks serves
284
+ it, and it documents the CloudEvents envelopes above.
261
285
 
262
286
  ## Cloudflare Only
263
287
 
@@ -339,11 +339,10 @@ format:
339
339
  | `webhook-timestamp` | unix seconds |
340
340
  | `webhook-signature` | `v1,<base64 HMAC-SHA256 over id.timestamp.body>` |
341
341
 
342
- On **contract v1** these are sent **in addition to** the legacy
343
- `X-Webhook-Signature` / `X-Webhook-Event` / `X-Webhook-Delivery` set, so
344
- existing receivers keep working during the migration window. On
345
- **contract v2** only the Standard Webhooks headers are sent — the legacy set
346
- (and its Stripe-format signature) is dropped.
342
+ These are the **only** signature headers sent. The legacy
343
+ `X-Webhook-Signature` / `X-Webhook-Event` / `X-Webhook-Delivery` set, and its
344
+ Stripe-format signature, are gone — a receiver still reading them sees no
345
+ signature at all, so move verification onto `webhook-signature` first.
347
346
 
348
347
  Receiver verification (any Standard Webhooks library works):
349
348
 
@@ -378,7 +378,7 @@ For each feature, the compiler generates a routes file at `src/features/{name}/r
378
378
  | `POST /{action}` | Standalone actions defined |
379
379
 
380
380
  Routes are mounted under `/api/v1/{feature}` by default, or
381
- `/api/v2/{feature}` when `contract: { routes: "v2" }` is set. `contract.version`
381
+ `/api/v2/{feature}` when `contract: { routes: "v2" }` is set. The standard API shape
382
382
  selects semantics and leaves these paths alone.
383
383
 
384
384
  ## Migrations
@@ -45,7 +45,6 @@ the business decision.
45
45
 
46
46
  This surface is deliberately explicit and narrow. It requires all of:
47
47
 
48
- - `contract.version: "v2"`
49
48
  - Cloudflare Workers
50
49
  - one Neon database using `connectionMode: "hyperdrive"`
51
50
  - the Better Auth `emailOtp` plugin with effective `disableSignUp: true`