@quickback-dev/cli 0.66.5 → 0.66.7

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 (109) hide show
  1. package/README.md +0 -1
  2. package/dist/index.js +1 -1
  3. package/dist/lib/api-client.d.ts +1 -1
  4. package/dist/lib/api-client.d.ts.map +1 -1
  5. package/dist/lib/api-client.js +13 -8
  6. package/dist/lib/api-client.js.map +1 -1
  7. package/dist/lib/api-client.test.js +47 -0
  8. package/dist/lib/api-client.test.js.map +1 -1
  9. package/dist/lib/migrations/drizzle.d.ts.map +1 -1
  10. package/dist/lib/migrations/drizzle.js +6 -1
  11. package/dist/lib/migrations/drizzle.js.map +1 -1
  12. package/dist/lib/migrations/drizzle.test.js +7 -0
  13. package/dist/lib/migrations/drizzle.test.js.map +1 -1
  14. package/dist/lib/migrations/executor.d.ts.map +1 -1
  15. package/dist/lib/migrations/executor.js +4 -0
  16. package/dist/lib/migrations/executor.js.map +1 -1
  17. package/dist/lib/migrations/postprocessors/better-auth-upgrade.d.ts +7 -0
  18. package/dist/lib/migrations/postprocessors/better-auth-upgrade.d.ts.map +1 -0
  19. package/dist/lib/migrations/postprocessors/better-auth-upgrade.js +149 -0
  20. package/dist/lib/migrations/postprocessors/better-auth-upgrade.js.map +1 -0
  21. package/dist/skill/SKILL.md +0 -2
  22. package/dist/skill/docs/api/openapi.md +1 -1
  23. package/dist/skill/docs/configure/auth.md +4 -5
  24. package/dist/skill/docs/configure/domains.md +1 -1
  25. package/dist/skill/docs/configure/index.md +4 -4
  26. package/dist/skill/docs/configure/security.md +3 -3
  27. package/dist/skill/docs/define/access.md +23 -3
  28. package/dist/skill/docs/define/actions/defining.md +2 -2
  29. package/dist/skill/docs/define/actions/index.md +6 -0
  30. package/dist/skill/docs/define/actions/record-and-standalone.md +1 -2
  31. package/dist/skill/docs/define/areas.md +14 -15
  32. package/dist/skill/docs/define/changesets.md +5 -0
  33. package/dist/skill/docs/define/diagnostics.md +2 -2
  34. package/dist/skill/docs/define/fga.md +1 -1
  35. package/dist/skill/docs/define/firewall.md +5 -5
  36. package/dist/skill/docs/define/guards.md +2 -1
  37. package/dist/skill/docs/define/masking.md +2 -2
  38. package/dist/skill/docs/define/relationships.md +8 -10
  39. package/dist/skill/docs/define/scopes.md +1 -1
  40. package/dist/skill/docs/define/transitions.md +11 -0
  41. package/dist/skill/docs/define/triggers.md +4 -0
  42. package/dist/skill/docs/index.md +0 -6
  43. package/dist/skill/docs/platform/auth/index.md +37 -0
  44. package/dist/skill/docs/platform/auth/jwt-optimization.md +2 -2
  45. package/dist/skill/docs/platform/queues/handlers.md +12 -0
  46. package/dist/skill/docs/platform/realtime/durable-objects.md +1 -1
  47. package/dist/skill/docs/platform/realtime/partyserver-rooms.md +4 -4
  48. package/dist/skill/docs/platform/schedules/index.md +3 -1
  49. package/dist/skill/docs/platform/webhooks/inbound.md +1 -1
  50. package/dist/skill/docs/tooling/claude-skill.md +0 -7
  51. package/dist/skill/docs/tooling/cloud-compiler/endpoints.md +11 -1
  52. package/dist/skill/docs/tooling/cloud-compiler/troubleshooting.md +16 -0
  53. package/dist/skill/docs/tooling/output.md +7 -6
  54. package/dist/skill/docs/ui/account/features/admin.md +1 -1
  55. package/dist/skill/docs/ui/account/features/organizations.md +1 -1
  56. package/dist/skill/docs/ui/admin/index.md +1 -1
  57. package/dist/skill/docs/ui/admin/owned-records.md +81 -0
  58. package/dist/skill/docs/ui/admin/schema-format.md +16 -0
  59. package/package.json +1 -1
  60. package/src/skill/SKILL.md +0 -2
  61. package/src/skill/docs/api/openapi.md +1 -1
  62. package/src/skill/docs/configure/auth.md +4 -5
  63. package/src/skill/docs/configure/domains.md +1 -1
  64. package/src/skill/docs/configure/index.md +4 -4
  65. package/src/skill/docs/configure/security.md +3 -3
  66. package/src/skill/docs/define/access.md +23 -3
  67. package/src/skill/docs/define/actions/defining.md +2 -2
  68. package/src/skill/docs/define/actions/index.md +6 -0
  69. package/src/skill/docs/define/actions/record-and-standalone.md +1 -2
  70. package/src/skill/docs/define/areas.md +14 -15
  71. package/src/skill/docs/define/changesets.md +5 -0
  72. package/src/skill/docs/define/diagnostics.md +2 -2
  73. package/src/skill/docs/define/fga.md +1 -1
  74. package/src/skill/docs/define/firewall.md +5 -5
  75. package/src/skill/docs/define/guards.md +2 -1
  76. package/src/skill/docs/define/masking.md +2 -2
  77. package/src/skill/docs/define/relationships.md +8 -10
  78. package/src/skill/docs/define/scopes.md +1 -1
  79. package/src/skill/docs/define/transitions.md +11 -0
  80. package/src/skill/docs/define/triggers.md +4 -0
  81. package/src/skill/docs/index.md +0 -6
  82. package/src/skill/docs/platform/auth/index.md +37 -0
  83. package/src/skill/docs/platform/auth/jwt-optimization.md +2 -2
  84. package/src/skill/docs/platform/queues/handlers.md +12 -0
  85. package/src/skill/docs/platform/realtime/durable-objects.md +1 -1
  86. package/src/skill/docs/platform/realtime/partyserver-rooms.md +4 -4
  87. package/src/skill/docs/platform/schedules/index.md +3 -1
  88. package/src/skill/docs/platform/webhooks/inbound.md +1 -1
  89. package/src/skill/docs/tooling/claude-skill.md +0 -7
  90. package/src/skill/docs/tooling/cloud-compiler/endpoints.md +11 -1
  91. package/src/skill/docs/tooling/cloud-compiler/troubleshooting.md +16 -0
  92. package/src/skill/docs/tooling/output.md +7 -6
  93. package/src/skill/docs/ui/account/features/admin.md +1 -1
  94. package/src/skill/docs/ui/account/features/organizations.md +1 -1
  95. package/src/skill/docs/ui/admin/index.md +1 -1
  96. package/src/skill/docs/ui/admin/owned-records.md +81 -0
  97. package/src/skill/docs/ui/admin/schema-format.md +16 -0
  98. package/dist/skill/docs/changelog/index.md +0 -945
  99. package/dist/skill/docs/changelog/v0.1x.md +0 -1202
  100. package/dist/skill/docs/changelog/v0.2x.md +0 -589
  101. package/dist/skill/docs/changelog/v0.3x.md +0 -1152
  102. package/dist/skill/docs/changelog/v0.4x.md +0 -1108
  103. package/dist/skill/docs/changelog/v0.5x.md +0 -885
  104. package/src/skill/docs/changelog/index.md +0 -945
  105. package/src/skill/docs/changelog/v0.1x.md +0 -1202
  106. package/src/skill/docs/changelog/v0.2x.md +0 -589
  107. package/src/skill/docs/changelog/v0.3x.md +0 -1152
  108. package/src/skill/docs/changelog/v0.4x.md +0 -1108
  109. package/src/skill/docs/changelog/v0.5x.md +0 -885
@@ -207,7 +207,7 @@ The gates that carry real data:
207
207
 
208
208
  Your resource API endpoints (`/api/v1/<resource>`) are **not** affected — they continue to use the per-resource `read`, `create`, `update`, `delete`, and `upsert` access rules you defined.
209
209
 
210
- > **Breaking in v0.62.** `cms.access` was renamed from `"admin" | "user"`, and both old values meant something different: `"admin"` admitted `appmanager`, and `"user"` admitted *any* authenticated caller — including one belonging to no organization, who then reached a CMS with nothing in it. The old spellings are rejected at compile time rather than aliased, because aliasing would preserve the old behaviour under a familiar name. Migrate `"admin"` → `"sysadmin"`, `"user"` → `"member"`.
210
+ > `cms.access` accepts `"sysadmin"` or `"member"`. The retired `"admin"` and `"user"` spellings are rejected at compile time; migrate `"admin"` → `"sysadmin"` and `"user"` → `"member"`.
211
211
 
212
212
 
213
213
  #### What a blocked caller actually sees
@@ -0,0 +1,81 @@
1
+ # Owned Records
2
+
3
+ A table that declares an [`owns` boundary](/define/changesets) gets its owned
4
+ children rendered **inline on the record page**: each relation appears as a
5
+ section below the record's fields, with a row table and Add / Edit / Delete
6
+ controls. Line items live on the expense report, not in a sidebar collection.
7
+
8
+ ## When a relation renders
9
+
10
+ All three must hold — a relation missing any of them is skipped:
11
+
12
+ 1. The relation is declared in the root's `owns`.
13
+ 2. The relation name is in the root's `read.include` allowlist — reads ride
14
+ `GET /:id?include=<relation>`, and a non-allowlisted include is a 400.
15
+ 3. The child table exists in the schema registry.
16
+
17
+ {/* doc-compile: skip — the fence is the owns + include wiring only; columns, firewall, guards, and the child table are elided. */}
18
+ ```ts title="quickback/features/expenseReports/expenseReports.ts"
19
+ export default feature("expenseReports", {
20
+ // ...columns, firewall, guards, crud...
21
+ owns: {
22
+ lineItems: { table: "lineItems", fk: "reportId", inherit: ["organizationId"] },
23
+ },
24
+ read: {
25
+ access: { roles: ["member+"] },
26
+ include: ["lineItems"], // without this, the CMS has no way to read the rows
27
+ },
28
+ });
29
+ ```
30
+
31
+ ## Writes go through the changeset engine
32
+
33
+ Every Add, Edit, and Delete is a single-op
34
+ [changeset](/define/changesets) `PATCH` on the **root** —
35
+ `Content-Type: application/vnd.quickback.changeset+json` — never a raw child
36
+ route. The generated aggregate engine enforces the child's own access,
37
+ guards, body schema, and firewall on every op, and stamps the spine FK and
38
+ `inherit` columns from the firewall-verified parent row.
39
+
40
+ Consequences in the UI:
41
+
42
+ - The child's `fk` and `inherit` columns are **excluded from the form** — the
43
+ engine stamps them, and a client-supplied value is rejected.
44
+ - The Add / Edit / Delete buttons gate on the **child table's** `create` /
45
+ `update` / `delete` access for the signed-in role, exactly like the child's
46
+ own raw routes would.
47
+ - Child deletes are soft (changeset v1 admits soft-delete children only).
48
+
49
+ ## `routes: false` children
50
+
51
+ The usual shape for a pure composition child — line items that only ever
52
+ exist inside a report — is `routes: false` on every op plus
53
+ `cms: { internal: true }`:
54
+
55
+ {/* doc-compile: skip — crud-op fragments without the surrounding table definition. */}
56
+ ```ts title="quickback/features/expenseReports/lineItems.ts"
57
+ read: { access: { roles: ["member+"] }, routes: false },
58
+ create: { access: { roles: ["member+"] }, routes: false },
59
+ update: { access: { roles: ["member+"] }, routes: false },
60
+ delete: { access: { roles: ["member+"] }, routes: false, mode: "soft" },
61
+
62
+ cms: { internal: true }, // no standalone sidebar entry
63
+ ```
64
+
65
+ `routes: false` keeps the access declared (it is the changeset admission
66
+ gate) but mounts no raw HTTP route. The CMS reads the registry's
67
+ `routesDisabled` list and suppresses every raw-CRUD affordance for those ops
68
+ — New button, row Edit/Delete, record-page Edit/Delete, and inline cell
69
+ editing — so it never renders a button whose request can only 405. The
70
+ owned-records section is unaffected: its writes are changeset ops, which
71
+ `routes: false` deliberately leaves open.
72
+
73
+ Note the child's `read` access above is what gates the embedded rows:
74
+ `?include=` inherits the **target's** read access, firewall, and masking. A
75
+ child readable only by `admin+` renders an empty section for members.
76
+
77
+ ## Next Steps
78
+
79
+ - **[Changesets](/define/changesets)** — the `owns` boundary and the wire contract
80
+ - **[Record Layouts](/ui/admin/record-layouts)** — grouping the root's own fields
81
+ - **[Schema Format](/ui/admin/schema-format)** — `ownsRelations`, `readInclude`, `routesDisabled`
@@ -62,6 +62,18 @@ interface TableMeta {
62
62
  inputHints?: Record<string, string>;
63
63
  layouts?: Record<string, CmsLayout>;
64
64
  internal?: boolean;
65
+ ownsRelations?: Record<string, OwnsRelation>;
66
+ ownedBy?: string;
67
+ readInclude?: string[];
68
+ routesDisabled?: string[];
69
+ }
70
+
71
+ interface OwnsRelation {
72
+ table: string; // owned child table (camelCase registry name)
73
+ fk: string; // FK on the child pointing at this root — compiler-stamped
74
+ inherit?: string[]; // parent columns copied onto inserted children — compiler-stamped
75
+ refs?: Record<string, string>; // client-supplied pointers at independent entities
76
+ owns?: Record<string, OwnsRelation>; // nested owned relations
65
77
  }
66
78
  ```
67
79
 
@@ -86,6 +98,10 @@ interface TableMeta {
86
98
  | `inputHints` | Map of column name to preferred CMS input type (e.g., `"richtext"`, `"select"`, `"textarea"`, `"checkbox"`) |
87
99
  | `layouts` | Named record page layouts keyed by layout name (see CmsLayout below) |
88
100
  | `internal` | When `true`, table is hidden from CMS sidebar |
101
+ | `ownsRelations` | The [`owns`](/define/changesets) config verbatim — the CMS renders these as inline [owned-records sections](/ui/admin/owned-records) on the root's record page |
102
+ | `ownedBy` | Set on owned children: the aggregate-root table that owns this table |
103
+ | `readInclude` | The `read.include` allowlist — tokens fetchable via `?include=` |
104
+ | `routesDisabled` | Ops declared `routes: false` — access exists (changeset admission) but no raw HTTP route, so the CMS suppresses New/Edit/Delete buttons and inline editing for them |
89
105
 
90
106
  ## ColumnMeta
91
107