@quickback-dev/cli 0.10.16 → 0.10.20

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 (249) hide show
  1. package/dist/commands/compile.d.ts.map +1 -1
  2. package/dist/commands/compile.js +40 -2
  3. package/dist/commands/compile.js.map +1 -1
  4. package/dist/docs/content.js +6 -6
  5. package/dist/docs/content.js.map +1 -1
  6. package/dist/index.js +1 -1
  7. package/dist/skill/SKILL.md +142 -1051
  8. package/dist/skill/agents/quickback-specialist/AGENT.md +36 -0
  9. package/dist/skill/docs/changelog.md +1192 -0
  10. package/dist/skill/docs/compiler/claude-code-skill.md +312 -0
  11. package/dist/skill/docs/compiler/cloud-compiler/authentication.md +63 -0
  12. package/dist/skill/docs/compiler/cloud-compiler/cli.md +307 -0
  13. package/dist/skill/docs/compiler/cloud-compiler/endpoints.md +78 -0
  14. package/dist/skill/docs/compiler/cloud-compiler/index.md +65 -0
  15. package/dist/skill/docs/compiler/cloud-compiler/local-compiler.md +115 -0
  16. package/dist/skill/docs/compiler/cloud-compiler/troubleshooting.md +76 -0
  17. package/dist/skill/docs/compiler/config/agents.md +144 -0
  18. package/dist/skill/docs/compiler/config/auth.md +109 -0
  19. package/dist/skill/docs/compiler/config/bindings.md +176 -0
  20. package/dist/skill/docs/compiler/config/domains.md +149 -0
  21. package/dist/skill/docs/compiler/config/index.md +419 -0
  22. package/dist/skill/docs/compiler/config/output.md +338 -0
  23. package/dist/skill/docs/compiler/config/providers.md +248 -0
  24. package/dist/skill/docs/compiler/config/security.md +255 -0
  25. package/dist/skill/docs/compiler/config/single-tenant.md +128 -0
  26. package/dist/skill/docs/compiler/config/variables.md +157 -0
  27. package/dist/skill/docs/compiler/definitions/access.md +445 -0
  28. package/dist/skill/docs/compiler/definitions/actions.md +884 -0
  29. package/dist/skill/docs/compiler/definitions/concepts.md +52 -0
  30. package/dist/skill/docs/compiler/definitions/feature.md +164 -0
  31. package/dist/skill/docs/compiler/definitions/firewall.md +285 -0
  32. package/dist/skill/docs/compiler/definitions/guards.md +241 -0
  33. package/dist/skill/docs/compiler/definitions/index.md +219 -0
  34. package/dist/skill/docs/compiler/definitions/masking.md +241 -0
  35. package/dist/skill/docs/compiler/definitions/read.md +220 -0
  36. package/dist/skill/docs/compiler/definitions/schema.md +697 -0
  37. package/dist/skill/docs/compiler/definitions/validation.md +35 -0
  38. package/dist/skill/docs/compiler/definitions/views.md +292 -0
  39. package/dist/skill/docs/compiler/getting-started/claude-code.md +126 -0
  40. package/dist/skill/docs/compiler/getting-started/full-example.md +431 -0
  41. package/dist/skill/docs/compiler/getting-started/hand-crafted.md +178 -0
  42. package/dist/skill/docs/compiler/getting-started/index.md +192 -0
  43. package/dist/skill/docs/compiler/getting-started/patterns.md +225 -0
  44. package/dist/skill/docs/compiler/getting-started/template-blog.md +280 -0
  45. package/dist/skill/docs/compiler/getting-started/template-cloudflare.md +260 -0
  46. package/dist/skill/docs/compiler/getting-started/template-empty.md +112 -0
  47. package/dist/skill/docs/compiler/getting-started/templates.md +111 -0
  48. package/dist/skill/docs/compiler/index.md +85 -0
  49. package/dist/skill/docs/compiler/targets/hono-api/cloudflare.md +94 -0
  50. package/dist/skill/docs/compiler/targets/hono-api/database/d1.md +246 -0
  51. package/dist/skill/docs/compiler/targets/hono-api/database/index.md +16 -0
  52. package/dist/skill/docs/compiler/targets/hono-api/database/neon.md +144 -0
  53. package/dist/skill/docs/compiler/targets/hono-api/database/using-d1.md +39 -0
  54. package/dist/skill/docs/compiler/targets/hono-api/index.md +37 -0
  55. package/dist/skill/docs/compiler/targets/hono-api/using-the-api/actions-api.md +323 -0
  56. package/dist/skill/docs/compiler/targets/hono-api/using-the-api/batch-operations.md +357 -0
  57. package/dist/skill/docs/compiler/targets/hono-api/using-the-api/caching.md +105 -0
  58. package/dist/skill/docs/compiler/targets/hono-api/using-the-api/crud.md +652 -0
  59. package/dist/skill/docs/compiler/targets/hono-api/using-the-api/errors.md +224 -0
  60. package/dist/skill/docs/compiler/targets/hono-api/using-the-api/index.md +37 -0
  61. package/dist/skill/docs/compiler/targets/hono-api/using-the-api/openapi.md +203 -0
  62. package/dist/skill/docs/compiler/targets/hono-api/using-the-api/query-params.md +199 -0
  63. package/dist/skill/docs/compiler/targets/hono-api/using-the-api/views-api.md +161 -0
  64. package/dist/skill/docs/compiler/targets/index.md +47 -0
  65. package/dist/skill/docs/compiler/targets/supabase-rls/index.md +55 -0
  66. package/dist/skill/docs/compiler/targets/supabase-rls/limitations.md +48 -0
  67. package/dist/skill/docs/compiler/targets/supabase-rls/mappings.md +99 -0
  68. package/dist/skill/docs/compiler/targets/supabase-rls/setup.md +88 -0
  69. package/dist/skill/docs/compiler/troubleshooting.md +120 -0
  70. package/dist/skill/docs/index.md +77 -0
  71. package/dist/skill/docs/stack/account-ui/customization.md +378 -0
  72. package/dist/skill/docs/stack/account-ui/environment-variables.md +325 -0
  73. package/dist/skill/docs/stack/account-ui/features/admin.md +76 -0
  74. package/dist/skill/docs/stack/account-ui/features/api-keys.md +22 -0
  75. package/dist/skill/docs/stack/account-ui/features/avatars.md +37 -0
  76. package/dist/skill/docs/stack/account-ui/features/cli-authorize.md +21 -0
  77. package/dist/skill/docs/stack/account-ui/features/index.md +291 -0
  78. package/dist/skill/docs/stack/account-ui/features/organizations.md +29 -0
  79. package/dist/skill/docs/stack/account-ui/features/passkeys.md +31 -0
  80. package/dist/skill/docs/stack/account-ui/features/passwordless.md +28 -0
  81. package/dist/skill/docs/stack/account-ui/features/sessions.md +20 -0
  82. package/dist/skill/docs/stack/account-ui/hooks.md +209 -0
  83. package/dist/skill/docs/stack/account-ui/index.md +147 -0
  84. package/dist/skill/docs/stack/account-ui/library-usage.md +257 -0
  85. package/dist/skill/docs/stack/account-ui/standalone.md +149 -0
  86. package/dist/skill/docs/stack/account-ui/with-quickback.md +160 -0
  87. package/dist/skill/docs/stack/account-ui/worker.md +362 -0
  88. package/dist/skill/docs/stack/auth/api-keys.md +15 -0
  89. package/dist/skill/docs/stack/auth/device-auth.md +14 -0
  90. package/dist/skill/docs/stack/auth/index.md +64 -0
  91. package/dist/skill/docs/stack/auth/jwt-optimization.md +245 -0
  92. package/dist/skill/docs/stack/auth/plugins/aws-ses.md +127 -0
  93. package/dist/skill/docs/stack/auth/plugins/combo-auth.md +74 -0
  94. package/dist/skill/docs/stack/auth/plugins/index.md +228 -0
  95. package/dist/skill/docs/stack/auth/plugins/upgrade-anonymous.md +155 -0
  96. package/dist/skill/docs/stack/auth/security.md +455 -0
  97. package/dist/skill/docs/stack/auth/using-auth.md +39 -0
  98. package/dist/skill/docs/stack/cms/actions.md +199 -0
  99. package/dist/skill/docs/stack/cms/components.md +479 -0
  100. package/dist/skill/docs/stack/cms/connecting.md +199 -0
  101. package/dist/skill/docs/stack/cms/dashboard.md +39 -0
  102. package/dist/skill/docs/stack/cms/index.md +158 -0
  103. package/dist/skill/docs/stack/cms/inline-editing.md +136 -0
  104. package/dist/skill/docs/stack/cms/pages.md +275 -0
  105. package/dist/skill/docs/stack/cms/record-layouts.md +151 -0
  106. package/dist/skill/docs/stack/cms/schema-format.md +437 -0
  107. package/dist/skill/docs/stack/cms/schema-registry.md +200 -0
  108. package/dist/skill/docs/stack/cms/security.md +203 -0
  109. package/dist/skill/docs/stack/cms/table-views.md +142 -0
  110. package/dist/skill/docs/stack/index.md +65 -0
  111. package/dist/skill/docs/stack/queues/handlers.md +317 -0
  112. package/dist/skill/docs/stack/queues/index.md +56 -0
  113. package/dist/skill/docs/stack/queues/using-queues.md +192 -0
  114. package/dist/skill/docs/stack/realtime/durable-objects.md +488 -0
  115. package/dist/skill/docs/stack/realtime/index.md +67 -0
  116. package/dist/skill/docs/stack/realtime/using-realtime.md +211 -0
  117. package/dist/skill/docs/stack/storage/index.md +17 -0
  118. package/dist/skill/docs/stack/storage/kv.md +204 -0
  119. package/dist/skill/docs/stack/storage/r2.md +232 -0
  120. package/dist/skill/docs/stack/storage/using-kv.md +70 -0
  121. package/dist/skill/docs/stack/storage/using-r2.md +55 -0
  122. package/dist/skill/docs/stack/vector/embeddings.md +554 -0
  123. package/dist/skill/docs/stack/vector/index.md +44 -0
  124. package/dist/skill/docs/stack/vector/using-embeddings.md +186 -0
  125. package/dist/skill/docs/stack/webhooks/inbound.md +186 -0
  126. package/dist/skill/docs/stack/webhooks/index.md +36 -0
  127. package/dist/skill/docs/stack/webhooks/outbound.md +281 -0
  128. package/package.json +1 -1
  129. package/src/skill/SKILL.md +142 -1051
  130. package/src/skill/agents/quickback-specialist/AGENT.md +36 -0
  131. package/src/skill/docs/changelog.md +1192 -0
  132. package/src/skill/docs/compiler/claude-code-skill.md +312 -0
  133. package/src/skill/docs/compiler/cloud-compiler/authentication.md +63 -0
  134. package/src/skill/docs/compiler/cloud-compiler/cli.md +307 -0
  135. package/src/skill/docs/compiler/cloud-compiler/endpoints.md +78 -0
  136. package/src/skill/docs/compiler/cloud-compiler/index.md +65 -0
  137. package/src/skill/docs/compiler/cloud-compiler/local-compiler.md +115 -0
  138. package/src/skill/docs/compiler/cloud-compiler/troubleshooting.md +76 -0
  139. package/src/skill/docs/compiler/config/agents.md +144 -0
  140. package/src/skill/docs/compiler/config/auth.md +109 -0
  141. package/src/skill/docs/compiler/config/bindings.md +176 -0
  142. package/src/skill/docs/compiler/config/domains.md +149 -0
  143. package/src/skill/docs/compiler/config/index.md +419 -0
  144. package/src/skill/docs/compiler/config/output.md +338 -0
  145. package/src/skill/docs/compiler/config/providers.md +248 -0
  146. package/src/skill/docs/compiler/config/security.md +255 -0
  147. package/src/skill/docs/compiler/config/single-tenant.md +128 -0
  148. package/src/skill/docs/compiler/config/variables.md +157 -0
  149. package/src/skill/docs/compiler/definitions/access.md +445 -0
  150. package/src/skill/docs/compiler/definitions/actions.md +884 -0
  151. package/src/skill/docs/compiler/definitions/concepts.md +52 -0
  152. package/src/skill/docs/compiler/definitions/feature.md +164 -0
  153. package/src/skill/docs/compiler/definitions/firewall.md +285 -0
  154. package/src/skill/docs/compiler/definitions/guards.md +241 -0
  155. package/src/skill/docs/compiler/definitions/index.md +219 -0
  156. package/src/skill/docs/compiler/definitions/masking.md +241 -0
  157. package/src/skill/docs/compiler/definitions/read.md +220 -0
  158. package/src/skill/docs/compiler/definitions/schema.md +697 -0
  159. package/src/skill/docs/compiler/definitions/validation.md +35 -0
  160. package/src/skill/docs/compiler/definitions/views.md +292 -0
  161. package/src/skill/docs/compiler/getting-started/claude-code.md +126 -0
  162. package/src/skill/docs/compiler/getting-started/full-example.md +431 -0
  163. package/src/skill/docs/compiler/getting-started/hand-crafted.md +178 -0
  164. package/src/skill/docs/compiler/getting-started/index.md +192 -0
  165. package/src/skill/docs/compiler/getting-started/patterns.md +225 -0
  166. package/src/skill/docs/compiler/getting-started/template-blog.md +280 -0
  167. package/src/skill/docs/compiler/getting-started/template-cloudflare.md +260 -0
  168. package/src/skill/docs/compiler/getting-started/template-empty.md +112 -0
  169. package/src/skill/docs/compiler/getting-started/templates.md +111 -0
  170. package/src/skill/docs/compiler/index.md +85 -0
  171. package/src/skill/docs/compiler/targets/hono-api/cloudflare.md +94 -0
  172. package/src/skill/docs/compiler/targets/hono-api/database/d1.md +246 -0
  173. package/src/skill/docs/compiler/targets/hono-api/database/index.md +16 -0
  174. package/src/skill/docs/compiler/targets/hono-api/database/neon.md +144 -0
  175. package/src/skill/docs/compiler/targets/hono-api/database/using-d1.md +39 -0
  176. package/src/skill/docs/compiler/targets/hono-api/index.md +37 -0
  177. package/src/skill/docs/compiler/targets/hono-api/using-the-api/actions-api.md +323 -0
  178. package/src/skill/docs/compiler/targets/hono-api/using-the-api/batch-operations.md +357 -0
  179. package/src/skill/docs/compiler/targets/hono-api/using-the-api/caching.md +105 -0
  180. package/src/skill/docs/compiler/targets/hono-api/using-the-api/crud.md +652 -0
  181. package/src/skill/docs/compiler/targets/hono-api/using-the-api/errors.md +224 -0
  182. package/src/skill/docs/compiler/targets/hono-api/using-the-api/index.md +37 -0
  183. package/src/skill/docs/compiler/targets/hono-api/using-the-api/openapi.md +203 -0
  184. package/src/skill/docs/compiler/targets/hono-api/using-the-api/query-params.md +199 -0
  185. package/src/skill/docs/compiler/targets/hono-api/using-the-api/views-api.md +161 -0
  186. package/src/skill/docs/compiler/targets/index.md +47 -0
  187. package/src/skill/docs/compiler/targets/supabase-rls/index.md +55 -0
  188. package/src/skill/docs/compiler/targets/supabase-rls/limitations.md +48 -0
  189. package/src/skill/docs/compiler/targets/supabase-rls/mappings.md +99 -0
  190. package/src/skill/docs/compiler/targets/supabase-rls/setup.md +88 -0
  191. package/src/skill/docs/compiler/troubleshooting.md +120 -0
  192. package/src/skill/docs/index.md +77 -0
  193. package/src/skill/docs/stack/account-ui/customization.md +378 -0
  194. package/src/skill/docs/stack/account-ui/environment-variables.md +325 -0
  195. package/src/skill/docs/stack/account-ui/features/admin.md +76 -0
  196. package/src/skill/docs/stack/account-ui/features/api-keys.md +22 -0
  197. package/src/skill/docs/stack/account-ui/features/avatars.md +37 -0
  198. package/src/skill/docs/stack/account-ui/features/cli-authorize.md +21 -0
  199. package/src/skill/docs/stack/account-ui/features/index.md +291 -0
  200. package/src/skill/docs/stack/account-ui/features/organizations.md +29 -0
  201. package/src/skill/docs/stack/account-ui/features/passkeys.md +31 -0
  202. package/src/skill/docs/stack/account-ui/features/passwordless.md +28 -0
  203. package/src/skill/docs/stack/account-ui/features/sessions.md +20 -0
  204. package/src/skill/docs/stack/account-ui/hooks.md +209 -0
  205. package/src/skill/docs/stack/account-ui/index.md +147 -0
  206. package/src/skill/docs/stack/account-ui/library-usage.md +257 -0
  207. package/src/skill/docs/stack/account-ui/standalone.md +149 -0
  208. package/src/skill/docs/stack/account-ui/with-quickback.md +160 -0
  209. package/src/skill/docs/stack/account-ui/worker.md +362 -0
  210. package/src/skill/docs/stack/auth/api-keys.md +15 -0
  211. package/src/skill/docs/stack/auth/device-auth.md +14 -0
  212. package/src/skill/docs/stack/auth/index.md +64 -0
  213. package/src/skill/docs/stack/auth/jwt-optimization.md +245 -0
  214. package/src/skill/docs/stack/auth/plugins/aws-ses.md +127 -0
  215. package/src/skill/docs/stack/auth/plugins/combo-auth.md +74 -0
  216. package/src/skill/docs/stack/auth/plugins/index.md +228 -0
  217. package/src/skill/docs/stack/auth/plugins/upgrade-anonymous.md +155 -0
  218. package/src/skill/docs/stack/auth/security.md +455 -0
  219. package/src/skill/docs/stack/auth/using-auth.md +39 -0
  220. package/src/skill/docs/stack/cms/actions.md +199 -0
  221. package/src/skill/docs/stack/cms/components.md +479 -0
  222. package/src/skill/docs/stack/cms/connecting.md +199 -0
  223. package/src/skill/docs/stack/cms/dashboard.md +39 -0
  224. package/src/skill/docs/stack/cms/index.md +158 -0
  225. package/src/skill/docs/stack/cms/inline-editing.md +136 -0
  226. package/src/skill/docs/stack/cms/pages.md +275 -0
  227. package/src/skill/docs/stack/cms/record-layouts.md +151 -0
  228. package/src/skill/docs/stack/cms/schema-format.md +437 -0
  229. package/src/skill/docs/stack/cms/schema-registry.md +200 -0
  230. package/src/skill/docs/stack/cms/security.md +203 -0
  231. package/src/skill/docs/stack/cms/table-views.md +142 -0
  232. package/src/skill/docs/stack/index.md +65 -0
  233. package/src/skill/docs/stack/queues/handlers.md +317 -0
  234. package/src/skill/docs/stack/queues/index.md +56 -0
  235. package/src/skill/docs/stack/queues/using-queues.md +192 -0
  236. package/src/skill/docs/stack/realtime/durable-objects.md +488 -0
  237. package/src/skill/docs/stack/realtime/index.md +67 -0
  238. package/src/skill/docs/stack/realtime/using-realtime.md +211 -0
  239. package/src/skill/docs/stack/storage/index.md +17 -0
  240. package/src/skill/docs/stack/storage/kv.md +204 -0
  241. package/src/skill/docs/stack/storage/r2.md +232 -0
  242. package/src/skill/docs/stack/storage/using-kv.md +70 -0
  243. package/src/skill/docs/stack/storage/using-r2.md +55 -0
  244. package/src/skill/docs/stack/vector/embeddings.md +554 -0
  245. package/src/skill/docs/stack/vector/index.md +44 -0
  246. package/src/skill/docs/stack/vector/using-embeddings.md +186 -0
  247. package/src/skill/docs/stack/webhooks/inbound.md +186 -0
  248. package/src/skill/docs/stack/webhooks/index.md +36 -0
  249. package/src/skill/docs/stack/webhooks/outbound.md +281 -0
@@ -0,0 +1,437 @@
1
+ # Schema Format Reference
2
+
3
+ The schema registry is a JSON file with a well-defined structure. Below are the complete TypeScript type definitions used by both the compiler (to generate) and the CMS (to consume).
4
+
5
+ ## SchemaRegistry
6
+
7
+ The top-level type:
8
+
9
+ ```typescript
10
+ interface SchemaRegistry {
11
+ generatedAt: string;
12
+ generatedBy: string;
13
+ version: string;
14
+ singleTenant?: boolean;
15
+ features: Record<string, string[]>;
16
+ tables: Record<string, TableMeta>;
17
+ tablesByFeature: Record<string, string[]>;
18
+ pages: Record<string, PageMeta>;
19
+ pagesByFeature: Record<string, string[]>;
20
+ }
21
+ ```
22
+
23
+ | Field | Description |
24
+ |-------|-------------|
25
+ | `generatedAt` | ISO 8601 timestamp of when the registry was generated |
26
+ | `generatedBy` | Always `"quickback-compiler"` |
27
+ | `version` | Compiler version string |
28
+ | `singleTenant` | When `true`, project has no organization layer (single-tenant mode) |
29
+ | `features` | Map of feature name to array of source file names |
30
+ | `tables` | Map of camelCase table name to full table metadata |
31
+ | `tablesByFeature` | Map of feature name to array of table names in that feature |
32
+ | `pages` | Map of page slug to full page metadata |
33
+ | `pagesByFeature` | Map of feature name to array of page slugs in that feature |
34
+
35
+ ## TableMeta
36
+
37
+ Full metadata for a single table:
38
+
39
+ ```typescript
40
+ interface TableMeta {
41
+ name: string;
42
+ dbName: string;
43
+ feature: string;
44
+ columns: ColumnMeta[];
45
+ firewall: Record<string, unknown>;
46
+ crud: Record<string, CrudConfig>;
47
+ guards: GuardsConfig;
48
+ masking: Record<string, MaskingRule>;
49
+ views: Record<string, ViewConfig>;
50
+ validation: Record<string, ValidationRule>;
51
+ actions: ActionMeta[];
52
+ displayColumn?: string;
53
+ defaultSort?: { field: string; order: 'asc' | 'desc' };
54
+ inputHints?: Record<string, string>;
55
+ layouts?: Record<string, CmsLayout>;
56
+ internal?: boolean;
57
+ }
58
+ ```
59
+
60
+ | Field | Description |
61
+ |-------|-------------|
62
+ | `name` | camelCase table name (e.g., `"accountCode"`) |
63
+ | `dbName` | Snake_case SQL table name (e.g., `"account_code"`) |
64
+ | `feature` | Parent feature name (e.g., `"accounting"`) |
65
+ | `columns` | Ordered array of column metadata |
66
+ | `firewall` | Tenant isolation config (organization, owner, softDelete, exception) |
67
+ | `crud` | Per-operation (create, read, update, delete) access config |
68
+ | `guards` | Field-level create/update/immutable/protected rules |
69
+ | `masking` | Per-field masking rules keyed by column name |
70
+ | `views` | Named column projections keyed by view name |
71
+ | `validation` | Per-field validation rules keyed by column name |
72
+ | `actions` | Array of action definitions for this table |
73
+ | `displayColumn` | Column used as human-readable label (auto-detected or explicit) |
74
+ | `defaultSort` | Default sort for CMS table list view (e.g., `{ field: "createdAt", order: "desc" }`) |
75
+ | `inputHints` | Map of column name to preferred CMS input type (e.g., `"richtext"`, `"select"`, `"textarea"`, `"checkbox"`) |
76
+ | `layouts` | Named record page layouts keyed by layout name (see CmsLayout below) |
77
+ | `internal` | When `true`, table is hidden from CMS sidebar |
78
+
79
+ ## ColumnMeta
80
+
81
+ Metadata for a single column:
82
+
83
+ ```typescript
84
+ interface ColumnMeta {
85
+ name: string;
86
+ dbName: string;
87
+ type: "text" | "integer" | "real" | "blob";
88
+ mode?: "boolean";
89
+ primaryKey: boolean;
90
+ notNull: boolean;
91
+ defaultValue?: string | number | boolean;
92
+ fkTarget?: string;
93
+ }
94
+ ```
95
+
96
+ | Field | Description |
97
+ |-------|-------------|
98
+ | `name` | camelCase property name |
99
+ | `dbName` | Snake_case SQL column name |
100
+ | `type` | SQLite storage type |
101
+ | `mode` | When `"boolean"`, an integer column represents true/false |
102
+ | `primaryKey` | Whether this column is the primary key |
103
+ | `notNull` | Whether the column has a NOT NULL constraint |
104
+ | `defaultValue` | Static default value (strings, numbers, or booleans) |
105
+ | `fkTarget` | Target table name for FK columns (e.g., `"contact"` for a `vendorId` column) |
106
+
107
+ ## CRUDConfig
108
+
109
+ Per-operation access control:
110
+
111
+ ```typescript
112
+ interface CrudConfig {
113
+ access?: AccessRule;
114
+ mode?: string;
115
+ }
116
+
117
+ interface AccessRule {
118
+ roles?: string[];
119
+ or?: Array<{
120
+ roles?: string[];
121
+ record?: Record<string, unknown>;
122
+ }>;
123
+ record?: Record<string, unknown>;
124
+ }
125
+ ```
126
+
127
+ | Field | Description |
128
+ |-------|-------------|
129
+ | `access.roles` | Array of roles allowed for this operation |
130
+ | `access.or` | Alternative access conditions (any must match) |
131
+ | `access.record` | Record-level conditions for access |
132
+ | `mode` | Operation mode (e.g., `"batch"` for bulk create) |
133
+
134
+ ## GuardsConfig
135
+
136
+ Field-level control for create and update operations:
137
+
138
+ ```typescript
139
+ interface GuardsConfig {
140
+ createable: string[];
141
+ updatable: string[];
142
+ immutable: string[];
143
+ protected: Record<string, string[]>;
144
+ }
145
+ ```
146
+
147
+ | Field | Description |
148
+ |-------|-------------|
149
+ | `createable` | Fields that can be set during record creation |
150
+ | `updatable` | Fields that can be modified on existing records |
151
+ | `immutable` | Fields that can be set on create but never changed |
152
+ | `protected` | Fields only modifiable via named actions (field name to action names) |
153
+
154
+ ## ActionMeta
155
+
156
+ Metadata for a custom action:
157
+
158
+ ```typescript
159
+ interface ActionMeta {
160
+ name: string;
161
+ description: string;
162
+ inputFields: ActionInputField[];
163
+ access?: {
164
+ roles: string[];
165
+ record?: Record<string, unknown>;
166
+ };
167
+ standalone?: boolean;
168
+ path?: string;
169
+ method?: string;
170
+ responseType?: string;
171
+ sideEffects?: string;
172
+ cms?: CmsConfig;
173
+ }
174
+
175
+ interface CmsConfig {
176
+ label?: string;
177
+ icon?: string;
178
+ confirm?: string | boolean;
179
+ destructive?: boolean;
180
+ category?: string;
181
+ hidden?: boolean;
182
+ successMessage?: string;
183
+ onSuccess?: 'refresh' | 'redirect:list' | 'close';
184
+ order?: number;
185
+ }
186
+
187
+ interface ActionInputField {
188
+ name: string;
189
+ type: string;
190
+ required: boolean;
191
+ default?: unknown;
192
+ }
193
+ ```
194
+
195
+ | Field | Description |
196
+ |-------|-------------|
197
+ | `name` | Action identifier (e.g., `"approve"`, `"applyPayment"`) |
198
+ | `description` | Human-readable description shown in dialog |
199
+ | `inputFields` | Array of input field definitions |
200
+ | `access.roles` | Roles allowed to execute this action |
201
+ | `access.record` | Record conditions (e.g., `{ status: { equals: "pending" } }`) |
202
+ | `standalone` | When `true`, action is not tied to a specific record |
203
+ | `path` | Custom API path (overrides default) |
204
+ | `method` | HTTP method (defaults to POST) |
205
+ | `responseType` | `"file"` for download responses |
206
+ | `sideEffects` | `"sync"` for actions with synchronous side effects |
207
+ | `cms` | Optional CMS rendering metadata (label, icon, confirm, destructive, category, hidden, successMessage, onSuccess, order) |
208
+
209
+ ### ActionInputField
210
+
211
+ | Field | Description |
212
+ |-------|-------------|
213
+ | `name` | Field identifier |
214
+ | `type` | Zod type string: `"string"`, `"number"`, `"boolean"`, `"array<string>"` |
215
+ | `required` | Whether the field must be provided |
216
+ | `default` | Default value pre-filled in the form |
217
+
218
+ ## ViewConfig
219
+
220
+ Named column projection with access control:
221
+
222
+ ```typescript
223
+ interface ViewConfig {
224
+ fields: string[];
225
+ access: AccessRule;
226
+ }
227
+ ```
228
+
229
+ | Field | Description |
230
+ |-------|-------------|
231
+ | `fields` | Array of column names to include in this view |
232
+ | `access` | Role-based access rules (same shape as CrudConfig access) |
233
+
234
+ ## CmsLayout
235
+
236
+ Named record page layout with ordered sections:
237
+
238
+ ```typescript
239
+ interface CmsLayout {
240
+ sections: CmsLayoutSection[];
241
+ }
242
+
243
+ interface CmsLayoutSection {
244
+ label: string;
245
+ fields: string[];
246
+ columns?: 1 | 2;
247
+ collapsed?: boolean;
248
+ }
249
+ ```
250
+
251
+ | Field | Description |
252
+ |-------|-------------|
253
+ | `sections` | Ordered array of field sections |
254
+
255
+ ### CmsLayoutSection
256
+
257
+ | Field | Description |
258
+ |-------|-------------|
259
+ | `label` | Section header text |
260
+ | `fields` | Array of column names to display in this section |
261
+ | `columns` | `1` (default) or `2` for two-column field layout |
262
+ | `collapsed` | When `true`, section starts collapsed with a toggle to expand |
263
+
264
+ Fields not assigned to any section in the active layout are collected into an "Other Fields" section.
265
+
266
+ ## MaskingRule
267
+
268
+ Per-field data masking:
269
+
270
+ ```typescript
271
+ interface MaskingRule {
272
+ type: "email" | "phone" | "ssn" | "redact";
273
+ show: {
274
+ roles: string[];
275
+ or?: string;
276
+ };
277
+ }
278
+ ```
279
+
280
+ | Field | Description |
281
+ |-------|-------------|
282
+ | `type` | Masking pattern to apply |
283
+ | `show.roles` | Roles that see the unmasked value |
284
+ | `show.or` | Alternative condition for showing unmasked value |
285
+
286
+ ### Masking Patterns
287
+
288
+ | Type | Input | Output |
289
+ |------|-------|--------|
290
+ | `email` | `john@acme.com` | `j***@acme.com` |
291
+ | `phone` | `(555) 123-4567` | `***-***-4567` |
292
+ | `ssn` | `123-45-6789` | `***-**-6789` |
293
+ | `redact` | Any string | `------` |
294
+
295
+ ## ValidationRule
296
+
297
+ Per-field validation constraints:
298
+
299
+ ```typescript
300
+ interface ValidationRule {
301
+ minLength?: number;
302
+ maxLength?: number;
303
+ min?: number;
304
+ max?: number;
305
+ enum?: string[];
306
+ email?: boolean;
307
+ }
308
+ ```
309
+
310
+ | Field | Description |
311
+ |-------|-------------|
312
+ | `minLength` | Minimum string length |
313
+ | `maxLength` | Maximum string length |
314
+ | `min` | Minimum numeric value |
315
+ | `max` | Maximum numeric value |
316
+ | `enum` | Array of allowed string values |
317
+ | `email` | When `true`, validates email format |
318
+
319
+ ## PageMeta
320
+
321
+ Full metadata for a custom page:
322
+
323
+ ```typescript
324
+ interface PageMeta {
325
+ slug: string;
326
+ title: string;
327
+ description?: string;
328
+ icon?: string;
329
+ feature: string;
330
+ access?: { roles: string[] };
331
+ dataSources: Record<string, PageDataSource>;
332
+ layout: PageLayout;
333
+ matching?: PageMatching;
334
+ pageActions?: Record<string, PageAction>;
335
+ }
336
+ ```
337
+
338
+ | Field | Description |
339
+ |-------|-------------|
340
+ | `slug` | URL-safe page identifier |
341
+ | `title` | Display title |
342
+ | `description` | Human-readable description |
343
+ | `icon` | Icon name for sidebar |
344
+ | `feature` | Parent feature name |
345
+ | `access` | Role-based access control |
346
+ | `dataSources` | Named data source bindings |
347
+ | `layout` | Layout configuration |
348
+ | `matching` | Matching/reconciliation rules |
349
+ | `pageActions` | Actions triggered from the page |
350
+
351
+ ### PageDataSource
352
+
353
+ ```typescript
354
+ interface PageDataSource {
355
+ table: string;
356
+ defaultFilters?: Record<string, unknown>;
357
+ defaultSort?: { field: string; order: 'asc' | 'desc' };
358
+ displayColumns?: string[];
359
+ }
360
+ ```
361
+
362
+ ### PageLayout
363
+
364
+ ```typescript
365
+ interface PageLayout {
366
+ type: 'split-panel';
367
+ panels: PagePanel[];
368
+ }
369
+
370
+ interface PagePanel {
371
+ id: string;
372
+ title: string;
373
+ dataSource: string;
374
+ position: 'left' | 'right';
375
+ features?: string[];
376
+ }
377
+ ```
378
+
379
+ Panel `features` can include `"drag-source"` and `"drop-target"` for drag-and-drop interactions.
380
+
381
+ ### PageMatching
382
+
383
+ ```typescript
384
+ interface PageMatching {
385
+ enabled: boolean;
386
+ rules: MatchingRule[];
387
+ confidenceThreshold?: number;
388
+ }
389
+
390
+ interface MatchingRule {
391
+ name: string;
392
+ weight: number;
393
+ condition: {
394
+ left: string;
395
+ right: string;
396
+ operator: 'abs-equals' | 'within-days' | 'fuzzy-match';
397
+ value?: number;
398
+ };
399
+ }
400
+ ```
401
+
402
+ | Field | Description |
403
+ |-------|-------------|
404
+ | `enabled` | Whether matching is active |
405
+ | `rules` | Array of matching rules with weights (0-1) |
406
+ | `confidenceThreshold` | Minimum score to display a match suggestion (0-1, default 0.5) |
407
+ | `condition.left` | Left field reference (`dataSourceName.fieldName`) |
408
+ | `condition.right` | Right field reference |
409
+ | `condition.operator` | Comparison operator |
410
+ | `condition.value` | Operator parameter (e.g., max days for `within-days`) |
411
+
412
+ ### PageAction
413
+
414
+ ```typescript
415
+ interface PageAction {
416
+ table: string;
417
+ action: string;
418
+ inputMapping: Record<string, string>;
419
+ label?: string;
420
+ icon?: string;
421
+ confirm?: string;
422
+ }
423
+ ```
424
+
425
+ | Field | Description |
426
+ |-------|-------------|
427
+ | `table` | Target table for the action |
428
+ | `action` | Action name on that table |
429
+ | `inputMapping` | Maps action input fields to data source field references (`"dataSourceName.$fieldName"`) |
430
+ | `label` | Button label (defaults to action name) |
431
+ | `icon` | Button icon name |
432
+ | `confirm` | Confirmation prompt shown before execution |
433
+
434
+ ## Next Steps
435
+
436
+ - **[Schema Registry](/stack/cms/schema-registry)** — How the registry is generated and used
437
+ - **[Components Reference](/stack/cms/components)** — All CMS React components
@@ -0,0 +1,200 @@
1
+ # Schema Registry
2
+
3
+ The schema registry is a static JSON file generated by the Quickback compiler. It contains full metadata about every table in your project — columns, types, guards, masking rules, views, actions, validation, and firewall config. The CMS reads this file to render its entire UI.
4
+
5
+ ## Generation
6
+
7
+ Schema registry generation is **enabled by default**. Run `quickback compile` and the compiler outputs `schema-registry.json` alongside your compiled API files.
8
+
9
+ To disable generation:
10
+
11
+ ```typescript title="quickback/quickback.config.ts"
12
+ export default defineConfig({
13
+ schemaRegistry: { generate: false },
14
+ // ... rest of your config
15
+ });
16
+ ```
17
+
18
+ ## Output Shape
19
+
20
+ The top-level structure of `schema-registry.json`:
21
+
22
+ ```json
23
+ {
24
+ "generatedAt": "2026-02-14T06:26:53.554Z",
25
+ "generatedBy": "quickback-compiler",
26
+ "version": "1.0.0",
27
+ "singleTenant": false,
28
+ "features": { ... },
29
+ "tables": { ... },
30
+ "tablesByFeature": { ... },
31
+ "pages": { ... },
32
+ "pagesByFeature": { ... }
33
+ }
34
+ ```
35
+
36
+ | Field | Type | Description |
37
+ |-------|------|-------------|
38
+ | `generatedAt` | `string` | ISO timestamp of generation |
39
+ | `generatedBy` | `string` | Always `"quickback-compiler"` |
40
+ | `version` | `string` | Compiler version used |
41
+ | `singleTenant` | `boolean?` | When `true`, no organization layer |
42
+ | `features` | `Record<string, string[]>` | Feature name to file list mapping |
43
+ | `tables` | `Record<string, TableMeta>` | Table name to full metadata |
44
+ | `tablesByFeature` | `Record<string, string[]>` | Feature name to table name list |
45
+ | `pages` | `Record<string, PageMeta>` | Page slug to full page metadata |
46
+ | `pagesByFeature` | `Record<string, string[]>` | Feature name to page slug list |
47
+
48
+ ## TableMeta
49
+
50
+ Each table entry contains everything the CMS needs to render its UI:
51
+
52
+ ```typescript
53
+ interface TableMeta {
54
+ name: string; // camelCase table name (e.g., "accountCode")
55
+ dbName: string; // SQL table name (e.g., "account_code")
56
+ feature: string; // Parent feature name
57
+ columns: ColumnMeta[]; // All columns including audit fields
58
+ firewall: Record<string, unknown>; // Tenant isolation config
59
+ crud: Record<string, CrudConfig>; // Per-operation access rules
60
+ guards: {
61
+ createable: string[]; // Fields allowed on create
62
+ updatable: string[]; // Fields allowed on update
63
+ immutable: string[]; // Fields locked after creation
64
+ protected: Record<string, string[]>; // Fields only updatable via actions
65
+ };
66
+ masking: Record<string, MaskingRule>; // Per-field masking rules
67
+ views: Record<string, ViewConfig>; // Named column projections
68
+ validation: Record<string, ValidationRule>; // Per-field validation
69
+ actions: ActionMeta[]; // Available actions for this table
70
+ displayColumn?: string; // Human-readable label column
71
+ internal?: boolean; // Hidden from CMS sidebar when true
72
+ }
73
+ ```
74
+
75
+ > **Internal Tables**
76
+ >
77
+ > Tables without a `defineTable()` resource config are marked `internal: true` and hidden from the CMS sidebar. These are typically join tables or system tables.
78
+
79
+
80
+ ## ColumnMeta
81
+
82
+ Each column in the `columns` array:
83
+
84
+ ```typescript
85
+ interface ColumnMeta {
86
+ name: string; // Property name (camelCase)
87
+ dbName: string; // SQL column name (snake_case)
88
+ type: "text" | "integer" | "real" | "blob"; // SQLite type
89
+ mode?: "boolean"; // When an integer represents a boolean
90
+ primaryKey: boolean;
91
+ notNull: boolean;
92
+ defaultValue?: string | number | boolean;
93
+ fkTarget?: string; // Target table name for FK columns
94
+ }
95
+ ```
96
+
97
+ The compiler automatically includes the system columns (`id`, `organizationId`), the audit fields (`createdAt`, `createdBy`, `modifiedAt`, `modifiedBy`), and the soft-delete pair (`deletedAt`, `deletedBy` — when soft delete is enabled) at the beginning of every table's column list.
98
+
99
+ ### fkTarget — FK Resolution
100
+
101
+ Columns ending in `Id` may have a `fkTarget` property indicating which table they reference. This is resolved in priority order:
102
+
103
+ 1. **Explicit `references`** — from your `defineTable()` config (highest priority)
104
+ 2. **Drizzle `.references()`** — parsed from schema source code
105
+ 3. **Convention** — strip `Id` suffix, match table name directly
106
+
107
+ ```json
108
+ {
109
+ "name": "vendorId",
110
+ "type": "text",
111
+ "fkTarget": "contact"
112
+ }
113
+ ```
114
+
115
+ The CMS uses `fkTarget` to render typeahead/lookup inputs that search the correct table instead of showing raw IDs.
116
+
117
+ ## Input Hints
118
+
119
+ Tables with `inputHints` configured in `defineTable()` include an `inputHints` map in their metadata:
120
+
121
+ ```json
122
+ {
123
+ "name": "invoice",
124
+ "inputHints": {
125
+ "status": "select",
126
+ "sortOrder": "radio",
127
+ "isPartialPaymentDisabled": "checkbox",
128
+ "headerMessage": "textarea",
129
+ "description": "richtext"
130
+ }
131
+ }
132
+ ```
133
+
134
+ The CMS reads these hints to render the appropriate form control for each field. The `"richtext"` hint renders a tiptap editor in edit mode and formatted HTML in view mode. See [Input Hints](/compiler/definitions/schema#input-hints) for the full list of supported values.
135
+
136
+ ## Display Column
137
+
138
+ The `displayColumn` field tells the CMS which column to use as a human-readable label for a record. This is used in:
139
+
140
+ - FK typeahead dropdowns (showing names instead of IDs)
141
+ - Record titles in detail views
142
+ - Breadcrumb labels
143
+
144
+ ### Auto-Detection
145
+
146
+ If you don't explicitly set `displayColumn` in your resource config, the compiler auto-detects it by scanning column names in priority order:
147
+
148
+ 1. `name`
149
+ 2. `title`
150
+ 3. `label`
151
+ 4. `headline`
152
+ 5. `subject`
153
+ 6. `code`
154
+ 7. `displayName`
155
+ 8. `fullName`
156
+ 9. `description`
157
+
158
+ The first match wins. If no candidate matches, the table has no display column and the CMS falls back to showing IDs.
159
+
160
+ ### Explicit Config
161
+
162
+ Set it explicitly in your table definition:
163
+
164
+ ```typescript
165
+ export default defineTable(contacts, {
166
+ displayColumn: "companyName",
167
+ // ...
168
+ });
169
+ ```
170
+
171
+ ## FK Label Resolution
172
+
173
+ When a table has foreign key columns (ending in `Id`), the API enriches list responses with `_label` fields. For example, a `roomTypeId` column gets a corresponding `roomType_label` field containing the display column value from the referenced table.
174
+
175
+ The CMS uses these `_label` fields to show human-readable names in table cells and FK typeahead dropdowns instead of raw UUIDs.
176
+
177
+ ```
178
+ roomTypeId: "rt_abc123" → displayed as "Master Bedroom"
179
+ accountCodeId: "ac_xyz789" → displayed as "4100 - Revenue"
180
+ ```
181
+
182
+ The FK target table is resolved from the `fkTarget` property on each column. For simple cases like `roomTypeId` → `roomType`, the compiler auto-detects it. For non-obvious mappings (e.g., `vendorId` → `contact`), use explicit [`references`](/compiler/definitions/schema#references) in your `defineTable()` config.
183
+
184
+ ## Pages
185
+
186
+ When features include `definePage()` files (in `features/{name}/pages/`), the compiler includes them in the registry under two fields:
187
+
188
+ - **`pages`** — Map of page slug to full `PageMeta` object (data sources, layout, matching rules, page actions)
189
+ - **`pagesByFeature`** — Map of feature name to array of page slugs belonging to that feature
190
+
191
+ The CMS reads these fields to render custom pages in the sidebar and route to the page renderer. See [Custom Pages](/stack/cms/pages) for the full `definePage()` API.
192
+
193
+ ## Single-Tenant Mode
194
+
195
+ When `singleTenant` is `true` in the registry (set when the project config has `features.organizations: false`), the CMS skips the organization gate and reads the user's role directly from `user.role` on the session instead of from organization membership.
196
+
197
+ ## Next Steps
198
+
199
+ - **[Connecting](/stack/cms/connecting)** — Demo mode vs. live mode setup
200
+ - **[Schema Format Reference](/stack/cms/schema-format)** — Full TypeScript types