handoff-app 2.0.0-2 → 2.0.0-4

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 (163) hide show
  1. package/README.md +140 -83
  2. package/dist/app-builder/build.js +21 -4
  3. package/dist/app-builder/client-config.js +9 -8
  4. package/dist/cli/auth/browser.d.ts +2 -0
  5. package/dist/cli/auth/browser.js +33 -0
  6. package/dist/cli/auth/device.d.ts +11 -0
  7. package/dist/cli/auth/device.js +155 -0
  8. package/dist/cli/auth/store.d.ts +29 -0
  9. package/dist/cli/auth/store.js +146 -0
  10. package/dist/cli/scaffold.js +20 -154
  11. package/dist/cli.js +1 -1
  12. package/dist/commands/index.js +4 -0
  13. package/dist/commands/login/index.d.ts +8 -0
  14. package/dist/commands/login/index.js +53 -0
  15. package/dist/commands/logout/index.d.ts +7 -0
  16. package/dist/commands/logout/index.js +54 -0
  17. package/dist/config/entries.d.ts +47 -0
  18. package/dist/config/entries.js +162 -0
  19. package/dist/config/index.d.ts +2 -0
  20. package/dist/config/index.js +5 -1
  21. package/dist/config/runtime.d.ts +9 -9
  22. package/dist/config/runtime.js +15 -15
  23. package/dist/registry/auth/access-tokens.d.ts +46 -0
  24. package/dist/registry/auth/access-tokens.js +165 -0
  25. package/dist/registry/auth/action-tokens.d.ts +66 -0
  26. package/dist/registry/auth/action-tokens.js +178 -0
  27. package/dist/registry/auth/crypto.d.ts +4 -0
  28. package/dist/registry/auth/crypto.js +16 -0
  29. package/dist/registry/auth/database.d.ts +7 -0
  30. package/dist/registry/auth/database.js +22 -0
  31. package/dist/registry/auth/device-authorizations.d.ts +51 -0
  32. package/dist/registry/auth/device-authorizations.js +170 -0
  33. package/dist/registry/auth/gravatar.d.ts +1 -0
  34. package/dist/registry/auth/gravatar.js +8 -0
  35. package/dist/registry/auth/index.d.ts +11 -0
  36. package/dist/registry/auth/index.js +72 -0
  37. package/dist/registry/auth/installation.d.ts +42 -0
  38. package/dist/registry/auth/installation.js +105 -0
  39. package/dist/registry/auth/password.d.ts +12 -0
  40. package/dist/registry/auth/password.js +58 -0
  41. package/dist/registry/auth/rate-limits.d.ts +22 -0
  42. package/dist/registry/auth/rate-limits.js +75 -0
  43. package/dist/registry/auth/types.d.ts +26 -0
  44. package/dist/registry/auth/types.js +9 -0
  45. package/dist/registry/auth/user-record.d.ts +13 -0
  46. package/dist/registry/auth/user-record.js +16 -0
  47. package/dist/registry/auth/users.d.ts +31 -0
  48. package/dist/registry/auth/users.js +135 -0
  49. package/dist/registry/auth/validation.d.ts +3 -0
  50. package/dist/registry/auth/validation.js +28 -0
  51. package/dist/registry/checkout/assets.js +4 -2
  52. package/dist/registry/checkout/index.d.ts +1 -1
  53. package/dist/registry/checkout/index.js +101 -23
  54. package/dist/registry/checkout/tokens.js +4 -2
  55. package/dist/registry/connection.d.ts +9 -0
  56. package/dist/registry/connection.js +29 -1
  57. package/dist/registry/db/driver.d.ts +5 -4
  58. package/dist/registry/db/driver.js +5 -4
  59. package/dist/registry/db/index.d.ts +1 -1
  60. package/dist/registry/db/index.js +7 -1
  61. package/dist/registry/db/schema.d.ts +2521 -750
  62. package/dist/registry/db/schema.js +126 -1
  63. package/dist/registry/publish/assets.js +1 -1
  64. package/dist/registry/publish/errors.js +3 -3
  65. package/dist/registry/publish/index.d.ts +1 -1
  66. package/dist/registry/publish/index.js +9 -9
  67. package/dist/registry/publish/tokens.js +1 -1
  68. package/dist/types/config.d.ts +4 -1
  69. package/docs/cli.md +4 -0
  70. package/drizzle/0005_add_registry_auth.sql +95 -0
  71. package/drizzle/meta/0005_snapshot.json +1926 -0
  72. package/drizzle/meta/_journal.json +8 -1
  73. package/package.json +5 -4
  74. package/src/app/components/Auth/AccountLayout.tsx +87 -0
  75. package/src/app/components/Auth/AuthControls.tsx +99 -0
  76. package/src/app/components/Auth/AuthShell.tsx +73 -0
  77. package/src/app/components/Auth/RegistryInstallGate.tsx +23 -0
  78. package/src/app/components/Auth/RegistrySessionProvider.tsx +15 -0
  79. package/src/app/components/Auth/api.ts +20 -0
  80. package/src/app/components/Layout/Header.tsx +2 -0
  81. package/src/app/components/Navigation/MobileNav.tsx +2 -0
  82. package/src/app/lib/auth/api.ts +113 -0
  83. package/src/app/lib/auth/config.ts +175 -0
  84. package/src/app/lib/auth/email.ts +34 -0
  85. package/src/app/lib/docs-api/runtime-config.ts +0 -14
  86. package/src/app/lib/registry-api/auth.ts +29 -46
  87. package/src/app/lib/registry-api/errors.ts +2 -2
  88. package/src/app/lib/registry-api/handler.ts +19 -14
  89. package/src/app/lib/registry-api/token-transfer.ts +1 -1
  90. package/src/app/lib/registry-api/transfer.ts +4 -4
  91. package/src/app/next.config.mjs +12 -3
  92. package/src/app/pages/_app.tsx +10 -4
  93. package/src/app/pages/account/index.tsx +153 -0
  94. package/src/app/pages/account/tokens.tsx +230 -0
  95. package/src/app/pages/account/users.tsx +310 -0
  96. package/src/app/pages/api/account/index.ts +26 -0
  97. package/src/app/pages/api/account/tokens/[id].ts +17 -0
  98. package/src/app/pages/api/account/tokens/index.ts +44 -0
  99. package/src/app/pages/api/admin/users/[id]/[action].ts +89 -0
  100. package/src/app/pages/api/admin/users/index.ts +53 -0
  101. package/src/app/pages/api/auth/[...nextauth].ts +4 -0
  102. package/src/app/pages/api/auth/request-reset.ts +53 -0
  103. package/src/app/pages/api/auth/reset-password.ts +29 -0
  104. package/src/app/pages/api/install.ts +102 -0
  105. package/src/app/pages/api/oauth/device/approve.ts +23 -0
  106. package/src/app/pages/api/oauth/device/index.ts +41 -0
  107. package/src/app/pages/api/oauth/revoke.ts +24 -0
  108. package/src/app/pages/api/oauth/token.ts +31 -0
  109. package/src/app/pages/api/registry/health.ts +4 -3
  110. package/src/app/pages/api/registry/transfer/[kind]/[id].ts +3 -3
  111. package/src/app/pages/api/registry/transfer/assets/[collection].ts +2 -1
  112. package/src/app/pages/api/registry/transfer/assets/blobs/[hash].ts +2 -1
  113. package/src/app/pages/api/registry/transfer/tokens/[...setId].ts +2 -2
  114. package/src/app/pages/cli/device.tsx +143 -0
  115. package/src/app/pages/install.tsx +336 -0
  116. package/src/app/pages/login.tsx +117 -0
  117. package/src/app/pages/reset-password.tsx +159 -0
  118. package/src/app/types/next-auth.d.ts +27 -0
  119. package/src/app-builder/build.ts +22 -5
  120. package/src/app-builder/client-config.ts +10 -9
  121. package/src/cli/auth/browser.ts +29 -0
  122. package/src/cli/auth/device.ts +181 -0
  123. package/src/cli/auth/store.ts +137 -0
  124. package/src/cli/scaffold.ts +20 -197
  125. package/src/cli.ts +1 -1
  126. package/src/commands/index.ts +4 -0
  127. package/src/commands/login/index.ts +48 -0
  128. package/src/commands/logout/index.ts +51 -0
  129. package/src/config/entries.ts +175 -0
  130. package/src/config/index.ts +4 -0
  131. package/src/config/runtime.ts +15 -14
  132. package/src/registry/auth/access-tokens.ts +198 -0
  133. package/src/registry/auth/action-tokens.ts +225 -0
  134. package/src/registry/auth/crypto.ts +13 -0
  135. package/src/registry/auth/database.ts +15 -0
  136. package/src/registry/auth/device-authorizations.ts +223 -0
  137. package/src/registry/auth/gravatar.ts +6 -0
  138. package/src/registry/auth/index.ts +89 -0
  139. package/src/registry/auth/installation.ts +117 -0
  140. package/src/registry/auth/password.ts +46 -0
  141. package/src/registry/auth/rate-limits.ts +84 -0
  142. package/src/registry/auth/types.ts +34 -0
  143. package/src/registry/auth/user-record.ts +25 -0
  144. package/src/registry/auth/users.ts +145 -0
  145. package/src/registry/auth/validation.ts +24 -0
  146. package/src/registry/checkout/assets.ts +4 -2
  147. package/src/registry/checkout/index.ts +114 -24
  148. package/src/registry/checkout/tokens.ts +4 -2
  149. package/src/registry/connection.ts +23 -0
  150. package/src/registry/db/driver.ts +5 -4
  151. package/src/registry/db/index.ts +12 -0
  152. package/src/registry/db/schema.ts +174 -1
  153. package/src/registry/publish/assets.ts +1 -1
  154. package/src/registry/publish/errors.ts +3 -3
  155. package/src/registry/publish/index.ts +9 -9
  156. package/src/registry/publish/tokens.ts +1 -1
  157. package/src/types/config.ts +4 -1
  158. package/templates/default/README.md.tpl +18 -0
  159. package/templates/default/gitignore.tpl +1 -0
  160. package/templates/default/handoff.config.js.tpl +0 -1
  161. package/templates/default/handoff.config.ts.tpl +0 -1
  162. package/templates/default/handoff.config.with-examples.js.tpl +0 -1
  163. package/templates/default/handoff.config.with-examples.ts.tpl +0 -1
@@ -0,0 +1,1926 @@
1
+ {
2
+ "id": "bb8bb9ee-d480-4bdc-bbc9-89268bea7956",
3
+ "prevId": "1b8fa93a-55b1-41d3-b245-089c1f6b5158",
4
+ "version": "7",
5
+ "dialect": "postgresql",
6
+ "tables": {
7
+ "public.asset_blobs": {
8
+ "name": "asset_blobs",
9
+ "schema": "",
10
+ "columns": {
11
+ "hash": {
12
+ "name": "hash",
13
+ "type": "text",
14
+ "primaryKey": true,
15
+ "notNull": true
16
+ },
17
+ "storage_provider": {
18
+ "name": "storage_provider",
19
+ "type": "text",
20
+ "primaryKey": false,
21
+ "notNull": true
22
+ },
23
+ "content": {
24
+ "name": "content",
25
+ "type": "bytea",
26
+ "primaryKey": false,
27
+ "notNull": false
28
+ },
29
+ "storage_ref": {
30
+ "name": "storage_ref",
31
+ "type": "text",
32
+ "primaryKey": false,
33
+ "notNull": false
34
+ },
35
+ "content_type": {
36
+ "name": "content_type",
37
+ "type": "text",
38
+ "primaryKey": false,
39
+ "notNull": true
40
+ },
41
+ "size": {
42
+ "name": "size",
43
+ "type": "integer",
44
+ "primaryKey": false,
45
+ "notNull": true
46
+ },
47
+ "created_at": {
48
+ "name": "created_at",
49
+ "type": "timestamp with time zone",
50
+ "primaryKey": false,
51
+ "notNull": true,
52
+ "default": "now()"
53
+ }
54
+ },
55
+ "indexes": {},
56
+ "foreignKeys": {},
57
+ "compositePrimaryKeys": {},
58
+ "uniqueConstraints": {},
59
+ "policies": {},
60
+ "checkConstraints": {},
61
+ "isRLSEnabled": false
62
+ },
63
+ "public.asset_collections": {
64
+ "name": "asset_collections",
65
+ "schema": "",
66
+ "columns": {
67
+ "collection": {
68
+ "name": "collection",
69
+ "type": "text",
70
+ "primaryKey": true,
71
+ "notNull": true
72
+ },
73
+ "source_hash": {
74
+ "name": "source_hash",
75
+ "type": "text",
76
+ "primaryKey": false,
77
+ "notNull": false
78
+ },
79
+ "status": {
80
+ "name": "status",
81
+ "type": "text",
82
+ "primaryKey": false,
83
+ "notNull": false
84
+ },
85
+ "built_at": {
86
+ "name": "built_at",
87
+ "type": "timestamp with time zone",
88
+ "primaryKey": false,
89
+ "notNull": false
90
+ },
91
+ "builder_version": {
92
+ "name": "builder_version",
93
+ "type": "text",
94
+ "primaryKey": false,
95
+ "notNull": false
96
+ },
97
+ "metadata": {
98
+ "name": "metadata",
99
+ "type": "jsonb",
100
+ "primaryKey": false,
101
+ "notNull": false
102
+ },
103
+ "created_at": {
104
+ "name": "created_at",
105
+ "type": "timestamp with time zone",
106
+ "primaryKey": false,
107
+ "notNull": true,
108
+ "default": "now()"
109
+ },
110
+ "updated_at": {
111
+ "name": "updated_at",
112
+ "type": "timestamp with time zone",
113
+ "primaryKey": false,
114
+ "notNull": true,
115
+ "default": "now()"
116
+ }
117
+ },
118
+ "indexes": {},
119
+ "foreignKeys": {},
120
+ "compositePrimaryKeys": {},
121
+ "uniqueConstraints": {},
122
+ "policies": {},
123
+ "checkConstraints": {},
124
+ "isRLSEnabled": false
125
+ },
126
+ "public.assets": {
127
+ "name": "assets",
128
+ "schema": "",
129
+ "columns": {
130
+ "collection": {
131
+ "name": "collection",
132
+ "type": "text",
133
+ "primaryKey": false,
134
+ "notNull": true
135
+ },
136
+ "path": {
137
+ "name": "path",
138
+ "type": "text",
139
+ "primaryKey": false,
140
+ "notNull": true
141
+ },
142
+ "name": {
143
+ "name": "name",
144
+ "type": "text",
145
+ "primaryKey": false,
146
+ "notNull": true
147
+ },
148
+ "content_type": {
149
+ "name": "content_type",
150
+ "type": "text",
151
+ "primaryKey": false,
152
+ "notNull": true
153
+ },
154
+ "size": {
155
+ "name": "size",
156
+ "type": "integer",
157
+ "primaryKey": false,
158
+ "notNull": false
159
+ },
160
+ "content_hash": {
161
+ "name": "content_hash",
162
+ "type": "text",
163
+ "primaryKey": false,
164
+ "notNull": true
165
+ },
166
+ "metadata": {
167
+ "name": "metadata",
168
+ "type": "jsonb",
169
+ "primaryKey": false,
170
+ "notNull": false
171
+ },
172
+ "blob_hash": {
173
+ "name": "blob_hash",
174
+ "type": "text",
175
+ "primaryKey": false,
176
+ "notNull": true
177
+ },
178
+ "created_at": {
179
+ "name": "created_at",
180
+ "type": "timestamp with time zone",
181
+ "primaryKey": false,
182
+ "notNull": true,
183
+ "default": "now()"
184
+ },
185
+ "updated_at": {
186
+ "name": "updated_at",
187
+ "type": "timestamp with time zone",
188
+ "primaryKey": false,
189
+ "notNull": true,
190
+ "default": "now()"
191
+ }
192
+ },
193
+ "indexes": {},
194
+ "foreignKeys": {
195
+ "assets_collection_asset_collections_collection_fk": {
196
+ "name": "assets_collection_asset_collections_collection_fk",
197
+ "tableFrom": "assets",
198
+ "tableTo": "asset_collections",
199
+ "columnsFrom": [
200
+ "collection"
201
+ ],
202
+ "columnsTo": [
203
+ "collection"
204
+ ],
205
+ "onDelete": "cascade",
206
+ "onUpdate": "no action"
207
+ },
208
+ "assets_blob_hash_asset_blobs_hash_fk": {
209
+ "name": "assets_blob_hash_asset_blobs_hash_fk",
210
+ "tableFrom": "assets",
211
+ "tableTo": "asset_blobs",
212
+ "columnsFrom": [
213
+ "blob_hash"
214
+ ],
215
+ "columnsTo": [
216
+ "hash"
217
+ ],
218
+ "onDelete": "no action",
219
+ "onUpdate": "no action"
220
+ }
221
+ },
222
+ "compositePrimaryKeys": {
223
+ "assets_collection_path_pk": {
224
+ "name": "assets_collection_path_pk",
225
+ "columns": [
226
+ "collection",
227
+ "path"
228
+ ]
229
+ }
230
+ },
231
+ "uniqueConstraints": {},
232
+ "policies": {},
233
+ "checkConstraints": {},
234
+ "isRLSEnabled": false
235
+ },
236
+ "public.build_metadata": {
237
+ "name": "build_metadata",
238
+ "schema": "",
239
+ "columns": {
240
+ "entity_kind": {
241
+ "name": "entity_kind",
242
+ "type": "text",
243
+ "primaryKey": false,
244
+ "notNull": true
245
+ },
246
+ "entity_id": {
247
+ "name": "entity_id",
248
+ "type": "text",
249
+ "primaryKey": false,
250
+ "notNull": true
251
+ },
252
+ "status": {
253
+ "name": "status",
254
+ "type": "text",
255
+ "primaryKey": false,
256
+ "notNull": true
257
+ },
258
+ "built_at": {
259
+ "name": "built_at",
260
+ "type": "timestamp with time zone",
261
+ "primaryKey": false,
262
+ "notNull": false
263
+ },
264
+ "builder_version": {
265
+ "name": "builder_version",
266
+ "type": "text",
267
+ "primaryKey": false,
268
+ "notNull": false
269
+ },
270
+ "artifact_hash": {
271
+ "name": "artifact_hash",
272
+ "type": "text",
273
+ "primaryKey": false,
274
+ "notNull": false
275
+ },
276
+ "source_hash": {
277
+ "name": "source_hash",
278
+ "type": "text",
279
+ "primaryKey": false,
280
+ "notNull": false
281
+ },
282
+ "warnings": {
283
+ "name": "warnings",
284
+ "type": "jsonb",
285
+ "primaryKey": false,
286
+ "notNull": false
287
+ },
288
+ "error": {
289
+ "name": "error",
290
+ "type": "text",
291
+ "primaryKey": false,
292
+ "notNull": false
293
+ },
294
+ "created_at": {
295
+ "name": "created_at",
296
+ "type": "timestamp with time zone",
297
+ "primaryKey": false,
298
+ "notNull": true,
299
+ "default": "now()"
300
+ },
301
+ "updated_at": {
302
+ "name": "updated_at",
303
+ "type": "timestamp with time zone",
304
+ "primaryKey": false,
305
+ "notNull": true,
306
+ "default": "now()"
307
+ }
308
+ },
309
+ "indexes": {},
310
+ "foreignKeys": {},
311
+ "compositePrimaryKeys": {
312
+ "build_metadata_entity_kind_entity_id_pk": {
313
+ "name": "build_metadata_entity_kind_entity_id_pk",
314
+ "columns": [
315
+ "entity_kind",
316
+ "entity_id"
317
+ ]
318
+ }
319
+ },
320
+ "uniqueConstraints": {},
321
+ "policies": {},
322
+ "checkConstraints": {},
323
+ "isRLSEnabled": false
324
+ },
325
+ "public.component_files": {
326
+ "name": "component_files",
327
+ "schema": "",
328
+ "columns": {
329
+ "component_id": {
330
+ "name": "component_id",
331
+ "type": "text",
332
+ "primaryKey": false,
333
+ "notNull": true
334
+ },
335
+ "path": {
336
+ "name": "path",
337
+ "type": "text",
338
+ "primaryKey": false,
339
+ "notNull": true
340
+ },
341
+ "kind": {
342
+ "name": "kind",
343
+ "type": "text",
344
+ "primaryKey": false,
345
+ "notNull": true
346
+ },
347
+ "content": {
348
+ "name": "content",
349
+ "type": "text",
350
+ "primaryKey": false,
351
+ "notNull": false
352
+ },
353
+ "storage_ref": {
354
+ "name": "storage_ref",
355
+ "type": "text",
356
+ "primaryKey": false,
357
+ "notNull": false
358
+ },
359
+ "content_type": {
360
+ "name": "content_type",
361
+ "type": "text",
362
+ "primaryKey": false,
363
+ "notNull": true
364
+ },
365
+ "created_at": {
366
+ "name": "created_at",
367
+ "type": "timestamp with time zone",
368
+ "primaryKey": false,
369
+ "notNull": true,
370
+ "default": "now()"
371
+ },
372
+ "updated_at": {
373
+ "name": "updated_at",
374
+ "type": "timestamp with time zone",
375
+ "primaryKey": false,
376
+ "notNull": true,
377
+ "default": "now()"
378
+ }
379
+ },
380
+ "indexes": {},
381
+ "foreignKeys": {
382
+ "component_files_component_id_components_id_fk": {
383
+ "name": "component_files_component_id_components_id_fk",
384
+ "tableFrom": "component_files",
385
+ "tableTo": "components",
386
+ "columnsFrom": [
387
+ "component_id"
388
+ ],
389
+ "columnsTo": [
390
+ "id"
391
+ ],
392
+ "onDelete": "cascade",
393
+ "onUpdate": "no action"
394
+ }
395
+ },
396
+ "compositePrimaryKeys": {
397
+ "component_files_component_id_path_pk": {
398
+ "name": "component_files_component_id_path_pk",
399
+ "columns": [
400
+ "component_id",
401
+ "path"
402
+ ]
403
+ }
404
+ },
405
+ "uniqueConstraints": {},
406
+ "policies": {},
407
+ "checkConstraints": {
408
+ "component_files_kind_not_declaration": {
409
+ "name": "component_files_kind_not_declaration",
410
+ "value": "\"component_files\".\"kind\" <> 'declaration'"
411
+ }
412
+ },
413
+ "isRLSEnabled": false
414
+ },
415
+ "public.components": {
416
+ "name": "components",
417
+ "schema": "",
418
+ "columns": {
419
+ "id": {
420
+ "name": "id",
421
+ "type": "text",
422
+ "primaryKey": true,
423
+ "notNull": true
424
+ },
425
+ "path": {
426
+ "name": "path",
427
+ "type": "text",
428
+ "primaryKey": false,
429
+ "notNull": true
430
+ },
431
+ "title": {
432
+ "name": "title",
433
+ "type": "text",
434
+ "primaryKey": false,
435
+ "notNull": false
436
+ },
437
+ "description": {
438
+ "name": "description",
439
+ "type": "text",
440
+ "primaryKey": false,
441
+ "notNull": false
442
+ },
443
+ "group": {
444
+ "name": "group",
445
+ "type": "text",
446
+ "primaryKey": false,
447
+ "notNull": false
448
+ },
449
+ "type": {
450
+ "name": "type",
451
+ "type": "text",
452
+ "primaryKey": false,
453
+ "notNull": false
454
+ },
455
+ "renderer": {
456
+ "name": "renderer",
457
+ "type": "text",
458
+ "primaryKey": false,
459
+ "notNull": false
460
+ },
461
+ "tags": {
462
+ "name": "tags",
463
+ "type": "jsonb",
464
+ "primaryKey": false,
465
+ "notNull": false
466
+ },
467
+ "categories": {
468
+ "name": "categories",
469
+ "type": "jsonb",
470
+ "primaryKey": false,
471
+ "notNull": false
472
+ },
473
+ "record": {
474
+ "name": "record",
475
+ "type": "jsonb",
476
+ "primaryKey": false,
477
+ "notNull": true
478
+ },
479
+ "metadata": {
480
+ "name": "metadata",
481
+ "type": "jsonb",
482
+ "primaryKey": false,
483
+ "notNull": false
484
+ },
485
+ "created_at": {
486
+ "name": "created_at",
487
+ "type": "timestamp with time zone",
488
+ "primaryKey": false,
489
+ "notNull": true,
490
+ "default": "now()"
491
+ },
492
+ "updated_at": {
493
+ "name": "updated_at",
494
+ "type": "timestamp with time zone",
495
+ "primaryKey": false,
496
+ "notNull": true,
497
+ "default": "now()"
498
+ }
499
+ },
500
+ "indexes": {
501
+ "components_group_idx": {
502
+ "name": "components_group_idx",
503
+ "columns": [
504
+ {
505
+ "expression": "group",
506
+ "isExpression": false,
507
+ "asc": true,
508
+ "nulls": "last"
509
+ }
510
+ ],
511
+ "isUnique": false,
512
+ "concurrently": false,
513
+ "method": "btree",
514
+ "with": {}
515
+ }
516
+ },
517
+ "foreignKeys": {},
518
+ "compositePrimaryKeys": {},
519
+ "uniqueConstraints": {},
520
+ "policies": {},
521
+ "checkConstraints": {},
522
+ "isRLSEnabled": false
523
+ },
524
+ "public.docs_artifacts": {
525
+ "name": "docs_artifacts",
526
+ "schema": "",
527
+ "columns": {
528
+ "path": {
529
+ "name": "path",
530
+ "type": "text",
531
+ "primaryKey": true,
532
+ "notNull": true
533
+ },
534
+ "entity_kind": {
535
+ "name": "entity_kind",
536
+ "type": "text",
537
+ "primaryKey": false,
538
+ "notNull": true
539
+ },
540
+ "entity_id": {
541
+ "name": "entity_id",
542
+ "type": "text",
543
+ "primaryKey": false,
544
+ "notNull": false
545
+ },
546
+ "artifact_kind": {
547
+ "name": "artifact_kind",
548
+ "type": "text",
549
+ "primaryKey": false,
550
+ "notNull": true
551
+ },
552
+ "content": {
553
+ "name": "content",
554
+ "type": "text",
555
+ "primaryKey": false,
556
+ "notNull": false
557
+ },
558
+ "storage_ref": {
559
+ "name": "storage_ref",
560
+ "type": "text",
561
+ "primaryKey": false,
562
+ "notNull": false
563
+ },
564
+ "content_type": {
565
+ "name": "content_type",
566
+ "type": "text",
567
+ "primaryKey": false,
568
+ "notNull": true
569
+ },
570
+ "owner_kind": {
571
+ "name": "owner_kind",
572
+ "type": "text",
573
+ "primaryKey": false,
574
+ "notNull": false
575
+ },
576
+ "owner_id": {
577
+ "name": "owner_id",
578
+ "type": "text",
579
+ "primaryKey": false,
580
+ "notNull": false
581
+ },
582
+ "references": {
583
+ "name": "references",
584
+ "type": "jsonb",
585
+ "primaryKey": false,
586
+ "notNull": false
587
+ },
588
+ "format_version": {
589
+ "name": "format_version",
590
+ "type": "text",
591
+ "primaryKey": false,
592
+ "notNull": false
593
+ },
594
+ "build_id": {
595
+ "name": "build_id",
596
+ "type": "text",
597
+ "primaryKey": false,
598
+ "notNull": false
599
+ },
600
+ "hash": {
601
+ "name": "hash",
602
+ "type": "text",
603
+ "primaryKey": false,
604
+ "notNull": false
605
+ },
606
+ "size": {
607
+ "name": "size",
608
+ "type": "integer",
609
+ "primaryKey": false,
610
+ "notNull": false
611
+ },
612
+ "gzip_size": {
613
+ "name": "gzip_size",
614
+ "type": "integer",
615
+ "primaryKey": false,
616
+ "notNull": false
617
+ },
618
+ "created_at": {
619
+ "name": "created_at",
620
+ "type": "timestamp with time zone",
621
+ "primaryKey": false,
622
+ "notNull": true,
623
+ "default": "now()"
624
+ },
625
+ "updated_at": {
626
+ "name": "updated_at",
627
+ "type": "timestamp with time zone",
628
+ "primaryKey": false,
629
+ "notNull": true,
630
+ "default": "now()"
631
+ }
632
+ },
633
+ "indexes": {
634
+ "docs_artifacts_entity_idx": {
635
+ "name": "docs_artifacts_entity_idx",
636
+ "columns": [
637
+ {
638
+ "expression": "entity_kind",
639
+ "isExpression": false,
640
+ "asc": true,
641
+ "nulls": "last"
642
+ },
643
+ {
644
+ "expression": "entity_id",
645
+ "isExpression": false,
646
+ "asc": true,
647
+ "nulls": "last"
648
+ }
649
+ ],
650
+ "isUnique": false,
651
+ "concurrently": false,
652
+ "method": "btree",
653
+ "with": {}
654
+ },
655
+ "docs_artifacts_owner_idx": {
656
+ "name": "docs_artifacts_owner_idx",
657
+ "columns": [
658
+ {
659
+ "expression": "owner_kind",
660
+ "isExpression": false,
661
+ "asc": true,
662
+ "nulls": "last"
663
+ },
664
+ {
665
+ "expression": "owner_id",
666
+ "isExpression": false,
667
+ "asc": true,
668
+ "nulls": "last"
669
+ }
670
+ ],
671
+ "isUnique": false,
672
+ "concurrently": false,
673
+ "method": "btree",
674
+ "with": {}
675
+ }
676
+ },
677
+ "foreignKeys": {},
678
+ "compositePrimaryKeys": {},
679
+ "uniqueConstraints": {},
680
+ "policies": {},
681
+ "checkConstraints": {},
682
+ "isRLSEnabled": false
683
+ },
684
+ "public.page_files": {
685
+ "name": "page_files",
686
+ "schema": "",
687
+ "columns": {
688
+ "page_id": {
689
+ "name": "page_id",
690
+ "type": "text",
691
+ "primaryKey": false,
692
+ "notNull": true
693
+ },
694
+ "path": {
695
+ "name": "path",
696
+ "type": "text",
697
+ "primaryKey": false,
698
+ "notNull": true
699
+ },
700
+ "kind": {
701
+ "name": "kind",
702
+ "type": "text",
703
+ "primaryKey": false,
704
+ "notNull": true
705
+ },
706
+ "content": {
707
+ "name": "content",
708
+ "type": "text",
709
+ "primaryKey": false,
710
+ "notNull": false
711
+ },
712
+ "storage_ref": {
713
+ "name": "storage_ref",
714
+ "type": "text",
715
+ "primaryKey": false,
716
+ "notNull": false
717
+ },
718
+ "content_type": {
719
+ "name": "content_type",
720
+ "type": "text",
721
+ "primaryKey": false,
722
+ "notNull": true
723
+ },
724
+ "created_at": {
725
+ "name": "created_at",
726
+ "type": "timestamp with time zone",
727
+ "primaryKey": false,
728
+ "notNull": true,
729
+ "default": "now()"
730
+ },
731
+ "updated_at": {
732
+ "name": "updated_at",
733
+ "type": "timestamp with time zone",
734
+ "primaryKey": false,
735
+ "notNull": true,
736
+ "default": "now()"
737
+ }
738
+ },
739
+ "indexes": {},
740
+ "foreignKeys": {
741
+ "page_files_page_id_pages_id_fk": {
742
+ "name": "page_files_page_id_pages_id_fk",
743
+ "tableFrom": "page_files",
744
+ "tableTo": "pages",
745
+ "columnsFrom": [
746
+ "page_id"
747
+ ],
748
+ "columnsTo": [
749
+ "id"
750
+ ],
751
+ "onDelete": "cascade",
752
+ "onUpdate": "no action"
753
+ }
754
+ },
755
+ "compositePrimaryKeys": {
756
+ "page_files_page_id_path_pk": {
757
+ "name": "page_files_page_id_path_pk",
758
+ "columns": [
759
+ "page_id",
760
+ "path"
761
+ ]
762
+ }
763
+ },
764
+ "uniqueConstraints": {},
765
+ "policies": {},
766
+ "checkConstraints": {
767
+ "page_files_kind_not_declaration": {
768
+ "name": "page_files_kind_not_declaration",
769
+ "value": "\"page_files\".\"kind\" <> 'declaration'"
770
+ }
771
+ },
772
+ "isRLSEnabled": false
773
+ },
774
+ "public.pages": {
775
+ "name": "pages",
776
+ "schema": "",
777
+ "columns": {
778
+ "id": {
779
+ "name": "id",
780
+ "type": "text",
781
+ "primaryKey": true,
782
+ "notNull": true
783
+ },
784
+ "path": {
785
+ "name": "path",
786
+ "type": "text",
787
+ "primaryKey": false,
788
+ "notNull": true
789
+ },
790
+ "title": {
791
+ "name": "title",
792
+ "type": "text",
793
+ "primaryKey": false,
794
+ "notNull": false
795
+ },
796
+ "description": {
797
+ "name": "description",
798
+ "type": "text",
799
+ "primaryKey": false,
800
+ "notNull": false
801
+ },
802
+ "group": {
803
+ "name": "group",
804
+ "type": "text",
805
+ "primaryKey": false,
806
+ "notNull": false
807
+ },
808
+ "weight": {
809
+ "name": "weight",
810
+ "type": "integer",
811
+ "primaryKey": false,
812
+ "notNull": false
813
+ },
814
+ "record": {
815
+ "name": "record",
816
+ "type": "jsonb",
817
+ "primaryKey": false,
818
+ "notNull": true
819
+ },
820
+ "metadata": {
821
+ "name": "metadata",
822
+ "type": "jsonb",
823
+ "primaryKey": false,
824
+ "notNull": false
825
+ },
826
+ "created_at": {
827
+ "name": "created_at",
828
+ "type": "timestamp with time zone",
829
+ "primaryKey": false,
830
+ "notNull": true,
831
+ "default": "now()"
832
+ },
833
+ "updated_at": {
834
+ "name": "updated_at",
835
+ "type": "timestamp with time zone",
836
+ "primaryKey": false,
837
+ "notNull": true,
838
+ "default": "now()"
839
+ }
840
+ },
841
+ "indexes": {
842
+ "pages_group_idx": {
843
+ "name": "pages_group_idx",
844
+ "columns": [
845
+ {
846
+ "expression": "group",
847
+ "isExpression": false,
848
+ "asc": true,
849
+ "nulls": "last"
850
+ }
851
+ ],
852
+ "isUnique": false,
853
+ "concurrently": false,
854
+ "method": "btree",
855
+ "with": {}
856
+ }
857
+ },
858
+ "foreignKeys": {},
859
+ "compositePrimaryKeys": {},
860
+ "uniqueConstraints": {},
861
+ "policies": {},
862
+ "checkConstraints": {},
863
+ "isRLSEnabled": false
864
+ },
865
+ "public.pattern_files": {
866
+ "name": "pattern_files",
867
+ "schema": "",
868
+ "columns": {
869
+ "pattern_id": {
870
+ "name": "pattern_id",
871
+ "type": "text",
872
+ "primaryKey": false,
873
+ "notNull": true
874
+ },
875
+ "path": {
876
+ "name": "path",
877
+ "type": "text",
878
+ "primaryKey": false,
879
+ "notNull": true
880
+ },
881
+ "kind": {
882
+ "name": "kind",
883
+ "type": "text",
884
+ "primaryKey": false,
885
+ "notNull": true
886
+ },
887
+ "content": {
888
+ "name": "content",
889
+ "type": "text",
890
+ "primaryKey": false,
891
+ "notNull": false
892
+ },
893
+ "storage_ref": {
894
+ "name": "storage_ref",
895
+ "type": "text",
896
+ "primaryKey": false,
897
+ "notNull": false
898
+ },
899
+ "content_type": {
900
+ "name": "content_type",
901
+ "type": "text",
902
+ "primaryKey": false,
903
+ "notNull": true
904
+ },
905
+ "created_at": {
906
+ "name": "created_at",
907
+ "type": "timestamp with time zone",
908
+ "primaryKey": false,
909
+ "notNull": true,
910
+ "default": "now()"
911
+ },
912
+ "updated_at": {
913
+ "name": "updated_at",
914
+ "type": "timestamp with time zone",
915
+ "primaryKey": false,
916
+ "notNull": true,
917
+ "default": "now()"
918
+ }
919
+ },
920
+ "indexes": {},
921
+ "foreignKeys": {
922
+ "pattern_files_pattern_id_patterns_id_fk": {
923
+ "name": "pattern_files_pattern_id_patterns_id_fk",
924
+ "tableFrom": "pattern_files",
925
+ "tableTo": "patterns",
926
+ "columnsFrom": [
927
+ "pattern_id"
928
+ ],
929
+ "columnsTo": [
930
+ "id"
931
+ ],
932
+ "onDelete": "cascade",
933
+ "onUpdate": "no action"
934
+ }
935
+ },
936
+ "compositePrimaryKeys": {
937
+ "pattern_files_pattern_id_path_pk": {
938
+ "name": "pattern_files_pattern_id_path_pk",
939
+ "columns": [
940
+ "pattern_id",
941
+ "path"
942
+ ]
943
+ }
944
+ },
945
+ "uniqueConstraints": {},
946
+ "policies": {},
947
+ "checkConstraints": {
948
+ "pattern_files_kind_not_declaration": {
949
+ "name": "pattern_files_kind_not_declaration",
950
+ "value": "\"pattern_files\".\"kind\" <> 'declaration'"
951
+ }
952
+ },
953
+ "isRLSEnabled": false
954
+ },
955
+ "public.patterns": {
956
+ "name": "patterns",
957
+ "schema": "",
958
+ "columns": {
959
+ "id": {
960
+ "name": "id",
961
+ "type": "text",
962
+ "primaryKey": true,
963
+ "notNull": true
964
+ },
965
+ "path": {
966
+ "name": "path",
967
+ "type": "text",
968
+ "primaryKey": false,
969
+ "notNull": true
970
+ },
971
+ "title": {
972
+ "name": "title",
973
+ "type": "text",
974
+ "primaryKey": false,
975
+ "notNull": false
976
+ },
977
+ "description": {
978
+ "name": "description",
979
+ "type": "text",
980
+ "primaryKey": false,
981
+ "notNull": false
982
+ },
983
+ "group": {
984
+ "name": "group",
985
+ "type": "text",
986
+ "primaryKey": false,
987
+ "notNull": false
988
+ },
989
+ "tags": {
990
+ "name": "tags",
991
+ "type": "jsonb",
992
+ "primaryKey": false,
993
+ "notNull": false
994
+ },
995
+ "components": {
996
+ "name": "components",
997
+ "type": "jsonb",
998
+ "primaryKey": false,
999
+ "notNull": false
1000
+ },
1001
+ "record": {
1002
+ "name": "record",
1003
+ "type": "jsonb",
1004
+ "primaryKey": false,
1005
+ "notNull": true
1006
+ },
1007
+ "metadata": {
1008
+ "name": "metadata",
1009
+ "type": "jsonb",
1010
+ "primaryKey": false,
1011
+ "notNull": false
1012
+ },
1013
+ "created_at": {
1014
+ "name": "created_at",
1015
+ "type": "timestamp with time zone",
1016
+ "primaryKey": false,
1017
+ "notNull": true,
1018
+ "default": "now()"
1019
+ },
1020
+ "updated_at": {
1021
+ "name": "updated_at",
1022
+ "type": "timestamp with time zone",
1023
+ "primaryKey": false,
1024
+ "notNull": true,
1025
+ "default": "now()"
1026
+ }
1027
+ },
1028
+ "indexes": {
1029
+ "patterns_group_idx": {
1030
+ "name": "patterns_group_idx",
1031
+ "columns": [
1032
+ {
1033
+ "expression": "group",
1034
+ "isExpression": false,
1035
+ "asc": true,
1036
+ "nulls": "last"
1037
+ }
1038
+ ],
1039
+ "isUnique": false,
1040
+ "concurrently": false,
1041
+ "method": "btree",
1042
+ "with": {}
1043
+ }
1044
+ },
1045
+ "foreignKeys": {},
1046
+ "compositePrimaryKeys": {},
1047
+ "uniqueConstraints": {},
1048
+ "policies": {},
1049
+ "checkConstraints": {},
1050
+ "isRLSEnabled": false
1051
+ },
1052
+ "public.registry_access_tokens": {
1053
+ "name": "registry_access_tokens",
1054
+ "schema": "",
1055
+ "columns": {
1056
+ "id": {
1057
+ "name": "id",
1058
+ "type": "text",
1059
+ "primaryKey": true,
1060
+ "notNull": true
1061
+ },
1062
+ "user_id": {
1063
+ "name": "user_id",
1064
+ "type": "text",
1065
+ "primaryKey": false,
1066
+ "notNull": true
1067
+ },
1068
+ "name": {
1069
+ "name": "name",
1070
+ "type": "text",
1071
+ "primaryKey": false,
1072
+ "notNull": true
1073
+ },
1074
+ "secret_hash": {
1075
+ "name": "secret_hash",
1076
+ "type": "text",
1077
+ "primaryKey": false,
1078
+ "notNull": true
1079
+ },
1080
+ "scopes": {
1081
+ "name": "scopes",
1082
+ "type": "jsonb",
1083
+ "primaryKey": false,
1084
+ "notNull": true
1085
+ },
1086
+ "expires_at": {
1087
+ "name": "expires_at",
1088
+ "type": "timestamp with time zone",
1089
+ "primaryKey": false,
1090
+ "notNull": true
1091
+ },
1092
+ "last_used_at": {
1093
+ "name": "last_used_at",
1094
+ "type": "timestamp with time zone",
1095
+ "primaryKey": false,
1096
+ "notNull": false
1097
+ },
1098
+ "revoked_at": {
1099
+ "name": "revoked_at",
1100
+ "type": "timestamp with time zone",
1101
+ "primaryKey": false,
1102
+ "notNull": false
1103
+ },
1104
+ "created_at": {
1105
+ "name": "created_at",
1106
+ "type": "timestamp with time zone",
1107
+ "primaryKey": false,
1108
+ "notNull": true,
1109
+ "default": "now()"
1110
+ }
1111
+ },
1112
+ "indexes": {
1113
+ "registry_access_tokens_user_idx": {
1114
+ "name": "registry_access_tokens_user_idx",
1115
+ "columns": [
1116
+ {
1117
+ "expression": "user_id",
1118
+ "isExpression": false,
1119
+ "asc": true,
1120
+ "nulls": "last"
1121
+ }
1122
+ ],
1123
+ "isUnique": false,
1124
+ "concurrently": false,
1125
+ "method": "btree",
1126
+ "with": {}
1127
+ },
1128
+ "registry_access_tokens_expires_idx": {
1129
+ "name": "registry_access_tokens_expires_idx",
1130
+ "columns": [
1131
+ {
1132
+ "expression": "expires_at",
1133
+ "isExpression": false,
1134
+ "asc": true,
1135
+ "nulls": "last"
1136
+ }
1137
+ ],
1138
+ "isUnique": false,
1139
+ "concurrently": false,
1140
+ "method": "btree",
1141
+ "with": {}
1142
+ }
1143
+ },
1144
+ "foreignKeys": {
1145
+ "registry_access_tokens_user_id_registry_users_id_fk": {
1146
+ "name": "registry_access_tokens_user_id_registry_users_id_fk",
1147
+ "tableFrom": "registry_access_tokens",
1148
+ "tableTo": "registry_users",
1149
+ "columnsFrom": [
1150
+ "user_id"
1151
+ ],
1152
+ "columnsTo": [
1153
+ "id"
1154
+ ],
1155
+ "onDelete": "cascade",
1156
+ "onUpdate": "no action"
1157
+ }
1158
+ },
1159
+ "compositePrimaryKeys": {},
1160
+ "uniqueConstraints": {},
1161
+ "policies": {},
1162
+ "checkConstraints": {
1163
+ "registry_access_tokens_name_not_blank": {
1164
+ "name": "registry_access_tokens_name_not_blank",
1165
+ "value": "length(btrim(\"registry_access_tokens\".\"name\")) > 0"
1166
+ },
1167
+ "registry_access_tokens_scopes_array": {
1168
+ "name": "registry_access_tokens_scopes_array",
1169
+ "value": "jsonb_typeof(\"registry_access_tokens\".\"scopes\") = 'array'"
1170
+ }
1171
+ },
1172
+ "isRLSEnabled": false
1173
+ },
1174
+ "public.registry_auth_action_tokens": {
1175
+ "name": "registry_auth_action_tokens",
1176
+ "schema": "",
1177
+ "columns": {
1178
+ "id": {
1179
+ "name": "id",
1180
+ "type": "text",
1181
+ "primaryKey": true,
1182
+ "notNull": true
1183
+ },
1184
+ "user_id": {
1185
+ "name": "user_id",
1186
+ "type": "text",
1187
+ "primaryKey": false,
1188
+ "notNull": true
1189
+ },
1190
+ "purpose": {
1191
+ "name": "purpose",
1192
+ "type": "text",
1193
+ "primaryKey": false,
1194
+ "notNull": true
1195
+ },
1196
+ "token_hash": {
1197
+ "name": "token_hash",
1198
+ "type": "text",
1199
+ "primaryKey": false,
1200
+ "notNull": true
1201
+ },
1202
+ "expires_at": {
1203
+ "name": "expires_at",
1204
+ "type": "timestamp with time zone",
1205
+ "primaryKey": false,
1206
+ "notNull": true
1207
+ },
1208
+ "used_at": {
1209
+ "name": "used_at",
1210
+ "type": "timestamp with time zone",
1211
+ "primaryKey": false,
1212
+ "notNull": false
1213
+ },
1214
+ "created_at": {
1215
+ "name": "created_at",
1216
+ "type": "timestamp with time zone",
1217
+ "primaryKey": false,
1218
+ "notNull": true,
1219
+ "default": "now()"
1220
+ }
1221
+ },
1222
+ "indexes": {
1223
+ "registry_auth_action_tokens_hash_idx": {
1224
+ "name": "registry_auth_action_tokens_hash_idx",
1225
+ "columns": [
1226
+ {
1227
+ "expression": "token_hash",
1228
+ "isExpression": false,
1229
+ "asc": true,
1230
+ "nulls": "last"
1231
+ }
1232
+ ],
1233
+ "isUnique": true,
1234
+ "concurrently": false,
1235
+ "method": "btree",
1236
+ "with": {}
1237
+ },
1238
+ "registry_auth_action_tokens_user_purpose_idx": {
1239
+ "name": "registry_auth_action_tokens_user_purpose_idx",
1240
+ "columns": [
1241
+ {
1242
+ "expression": "user_id",
1243
+ "isExpression": false,
1244
+ "asc": true,
1245
+ "nulls": "last"
1246
+ },
1247
+ {
1248
+ "expression": "purpose",
1249
+ "isExpression": false,
1250
+ "asc": true,
1251
+ "nulls": "last"
1252
+ }
1253
+ ],
1254
+ "isUnique": false,
1255
+ "concurrently": false,
1256
+ "method": "btree",
1257
+ "with": {}
1258
+ }
1259
+ },
1260
+ "foreignKeys": {
1261
+ "registry_auth_action_tokens_user_id_registry_users_id_fk": {
1262
+ "name": "registry_auth_action_tokens_user_id_registry_users_id_fk",
1263
+ "tableFrom": "registry_auth_action_tokens",
1264
+ "tableTo": "registry_users",
1265
+ "columnsFrom": [
1266
+ "user_id"
1267
+ ],
1268
+ "columnsTo": [
1269
+ "id"
1270
+ ],
1271
+ "onDelete": "cascade",
1272
+ "onUpdate": "no action"
1273
+ }
1274
+ },
1275
+ "compositePrimaryKeys": {},
1276
+ "uniqueConstraints": {},
1277
+ "policies": {},
1278
+ "checkConstraints": {
1279
+ "registry_auth_action_tokens_purpose_valid": {
1280
+ "name": "registry_auth_action_tokens_purpose_valid",
1281
+ "value": "\"registry_auth_action_tokens\".\"purpose\" in ('invite', 'password_reset')"
1282
+ }
1283
+ },
1284
+ "isRLSEnabled": false
1285
+ },
1286
+ "public.registry_auth_rate_limits": {
1287
+ "name": "registry_auth_rate_limits",
1288
+ "schema": "",
1289
+ "columns": {
1290
+ "bucket": {
1291
+ "name": "bucket",
1292
+ "type": "text",
1293
+ "primaryKey": false,
1294
+ "notNull": true
1295
+ },
1296
+ "identifier_hash": {
1297
+ "name": "identifier_hash",
1298
+ "type": "text",
1299
+ "primaryKey": false,
1300
+ "notNull": true
1301
+ },
1302
+ "window_started_at": {
1303
+ "name": "window_started_at",
1304
+ "type": "timestamp with time zone",
1305
+ "primaryKey": false,
1306
+ "notNull": true
1307
+ },
1308
+ "attempts": {
1309
+ "name": "attempts",
1310
+ "type": "integer",
1311
+ "primaryKey": false,
1312
+ "notNull": true,
1313
+ "default": 1
1314
+ },
1315
+ "expires_at": {
1316
+ "name": "expires_at",
1317
+ "type": "timestamp with time zone",
1318
+ "primaryKey": false,
1319
+ "notNull": true
1320
+ },
1321
+ "updated_at": {
1322
+ "name": "updated_at",
1323
+ "type": "timestamp with time zone",
1324
+ "primaryKey": false,
1325
+ "notNull": true,
1326
+ "default": "now()"
1327
+ }
1328
+ },
1329
+ "indexes": {
1330
+ "registry_auth_rate_limits_expires_idx": {
1331
+ "name": "registry_auth_rate_limits_expires_idx",
1332
+ "columns": [
1333
+ {
1334
+ "expression": "expires_at",
1335
+ "isExpression": false,
1336
+ "asc": true,
1337
+ "nulls": "last"
1338
+ }
1339
+ ],
1340
+ "isUnique": false,
1341
+ "concurrently": false,
1342
+ "method": "btree",
1343
+ "with": {}
1344
+ }
1345
+ },
1346
+ "foreignKeys": {},
1347
+ "compositePrimaryKeys": {
1348
+ "registry_auth_rate_limits_bucket_identifier_hash_window_started_at_pk": {
1349
+ "name": "registry_auth_rate_limits_bucket_identifier_hash_window_started_at_pk",
1350
+ "columns": [
1351
+ "bucket",
1352
+ "identifier_hash",
1353
+ "window_started_at"
1354
+ ]
1355
+ }
1356
+ },
1357
+ "uniqueConstraints": {},
1358
+ "policies": {},
1359
+ "checkConstraints": {
1360
+ "registry_auth_rate_limits_bucket_valid": {
1361
+ "name": "registry_auth_rate_limits_bucket_valid",
1362
+ "value": "\"registry_auth_rate_limits\".\"bucket\" in ('login', 'password_reset', 'device')"
1363
+ },
1364
+ "registry_auth_rate_limits_attempts_positive": {
1365
+ "name": "registry_auth_rate_limits_attempts_positive",
1366
+ "value": "\"registry_auth_rate_limits\".\"attempts\" > 0"
1367
+ }
1368
+ },
1369
+ "isRLSEnabled": false
1370
+ },
1371
+ "public.registry_device_authorizations": {
1372
+ "name": "registry_device_authorizations",
1373
+ "schema": "",
1374
+ "columns": {
1375
+ "id": {
1376
+ "name": "id",
1377
+ "type": "text",
1378
+ "primaryKey": true,
1379
+ "notNull": true
1380
+ },
1381
+ "device_code_hash": {
1382
+ "name": "device_code_hash",
1383
+ "type": "text",
1384
+ "primaryKey": false,
1385
+ "notNull": true
1386
+ },
1387
+ "user_code": {
1388
+ "name": "user_code",
1389
+ "type": "text",
1390
+ "primaryKey": false,
1391
+ "notNull": true
1392
+ },
1393
+ "status": {
1394
+ "name": "status",
1395
+ "type": "text",
1396
+ "primaryKey": false,
1397
+ "notNull": true,
1398
+ "default": "'pending'"
1399
+ },
1400
+ "user_id": {
1401
+ "name": "user_id",
1402
+ "type": "text",
1403
+ "primaryKey": false,
1404
+ "notNull": false
1405
+ },
1406
+ "scopes": {
1407
+ "name": "scopes",
1408
+ "type": "jsonb",
1409
+ "primaryKey": false,
1410
+ "notNull": true
1411
+ },
1412
+ "expires_at": {
1413
+ "name": "expires_at",
1414
+ "type": "timestamp with time zone",
1415
+ "primaryKey": false,
1416
+ "notNull": true
1417
+ },
1418
+ "approved_at": {
1419
+ "name": "approved_at",
1420
+ "type": "timestamp with time zone",
1421
+ "primaryKey": false,
1422
+ "notNull": false
1423
+ },
1424
+ "consumed_at": {
1425
+ "name": "consumed_at",
1426
+ "type": "timestamp with time zone",
1427
+ "primaryKey": false,
1428
+ "notNull": false
1429
+ },
1430
+ "created_at": {
1431
+ "name": "created_at",
1432
+ "type": "timestamp with time zone",
1433
+ "primaryKey": false,
1434
+ "notNull": true,
1435
+ "default": "now()"
1436
+ }
1437
+ },
1438
+ "indexes": {
1439
+ "registry_device_authorizations_device_hash_idx": {
1440
+ "name": "registry_device_authorizations_device_hash_idx",
1441
+ "columns": [
1442
+ {
1443
+ "expression": "device_code_hash",
1444
+ "isExpression": false,
1445
+ "asc": true,
1446
+ "nulls": "last"
1447
+ }
1448
+ ],
1449
+ "isUnique": true,
1450
+ "concurrently": false,
1451
+ "method": "btree",
1452
+ "with": {}
1453
+ },
1454
+ "registry_device_authorizations_user_code_idx": {
1455
+ "name": "registry_device_authorizations_user_code_idx",
1456
+ "columns": [
1457
+ {
1458
+ "expression": "user_code",
1459
+ "isExpression": false,
1460
+ "asc": true,
1461
+ "nulls": "last"
1462
+ }
1463
+ ],
1464
+ "isUnique": true,
1465
+ "concurrently": false,
1466
+ "method": "btree",
1467
+ "with": {}
1468
+ },
1469
+ "registry_device_authorizations_expires_idx": {
1470
+ "name": "registry_device_authorizations_expires_idx",
1471
+ "columns": [
1472
+ {
1473
+ "expression": "expires_at",
1474
+ "isExpression": false,
1475
+ "asc": true,
1476
+ "nulls": "last"
1477
+ }
1478
+ ],
1479
+ "isUnique": false,
1480
+ "concurrently": false,
1481
+ "method": "btree",
1482
+ "with": {}
1483
+ }
1484
+ },
1485
+ "foreignKeys": {
1486
+ "registry_device_authorizations_user_id_registry_users_id_fk": {
1487
+ "name": "registry_device_authorizations_user_id_registry_users_id_fk",
1488
+ "tableFrom": "registry_device_authorizations",
1489
+ "tableTo": "registry_users",
1490
+ "columnsFrom": [
1491
+ "user_id"
1492
+ ],
1493
+ "columnsTo": [
1494
+ "id"
1495
+ ],
1496
+ "onDelete": "set null",
1497
+ "onUpdate": "no action"
1498
+ }
1499
+ },
1500
+ "compositePrimaryKeys": {},
1501
+ "uniqueConstraints": {},
1502
+ "policies": {},
1503
+ "checkConstraints": {
1504
+ "registry_device_authorizations_status_valid": {
1505
+ "name": "registry_device_authorizations_status_valid",
1506
+ "value": "\"registry_device_authorizations\".\"status\" in ('pending', 'approved', 'denied', 'consumed')"
1507
+ },
1508
+ "registry_device_authorizations_scopes_array": {
1509
+ "name": "registry_device_authorizations_scopes_array",
1510
+ "value": "jsonb_typeof(\"registry_device_authorizations\".\"scopes\") = 'array'"
1511
+ }
1512
+ },
1513
+ "isRLSEnabled": false
1514
+ },
1515
+ "public.registry_installations": {
1516
+ "name": "registry_installations",
1517
+ "schema": "",
1518
+ "columns": {
1519
+ "id": {
1520
+ "name": "id",
1521
+ "type": "text",
1522
+ "primaryKey": true,
1523
+ "notNull": true,
1524
+ "default": "'default'"
1525
+ },
1526
+ "status": {
1527
+ "name": "status",
1528
+ "type": "text",
1529
+ "primaryKey": false,
1530
+ "notNull": true,
1531
+ "default": "'installed'"
1532
+ },
1533
+ "schema_version": {
1534
+ "name": "schema_version",
1535
+ "type": "integer",
1536
+ "primaryKey": false,
1537
+ "notNull": true
1538
+ },
1539
+ "initial_admin_user_id": {
1540
+ "name": "initial_admin_user_id",
1541
+ "type": "text",
1542
+ "primaryKey": false,
1543
+ "notNull": true
1544
+ },
1545
+ "installed_at": {
1546
+ "name": "installed_at",
1547
+ "type": "timestamp with time zone",
1548
+ "primaryKey": false,
1549
+ "notNull": true,
1550
+ "default": "now()"
1551
+ }
1552
+ },
1553
+ "indexes": {},
1554
+ "foreignKeys": {
1555
+ "registry_installations_initial_admin_user_id_registry_users_id_fk": {
1556
+ "name": "registry_installations_initial_admin_user_id_registry_users_id_fk",
1557
+ "tableFrom": "registry_installations",
1558
+ "tableTo": "registry_users",
1559
+ "columnsFrom": [
1560
+ "initial_admin_user_id"
1561
+ ],
1562
+ "columnsTo": [
1563
+ "id"
1564
+ ],
1565
+ "onDelete": "restrict",
1566
+ "onUpdate": "no action"
1567
+ }
1568
+ },
1569
+ "compositePrimaryKeys": {},
1570
+ "uniqueConstraints": {},
1571
+ "policies": {},
1572
+ "checkConstraints": {
1573
+ "registry_installations_singleton": {
1574
+ "name": "registry_installations_singleton",
1575
+ "value": "\"registry_installations\".\"id\" = 'default'"
1576
+ },
1577
+ "registry_installations_status_valid": {
1578
+ "name": "registry_installations_status_valid",
1579
+ "value": "\"registry_installations\".\"status\" = 'installed'"
1580
+ },
1581
+ "registry_installations_schema_version_positive": {
1582
+ "name": "registry_installations_schema_version_positive",
1583
+ "value": "\"registry_installations\".\"schema_version\" > 0"
1584
+ }
1585
+ },
1586
+ "isRLSEnabled": false
1587
+ },
1588
+ "public.registry_users": {
1589
+ "name": "registry_users",
1590
+ "schema": "",
1591
+ "columns": {
1592
+ "id": {
1593
+ "name": "id",
1594
+ "type": "text",
1595
+ "primaryKey": true,
1596
+ "notNull": true
1597
+ },
1598
+ "email": {
1599
+ "name": "email",
1600
+ "type": "text",
1601
+ "primaryKey": false,
1602
+ "notNull": true
1603
+ },
1604
+ "name": {
1605
+ "name": "name",
1606
+ "type": "text",
1607
+ "primaryKey": false,
1608
+ "notNull": false
1609
+ },
1610
+ "image": {
1611
+ "name": "image",
1612
+ "type": "text",
1613
+ "primaryKey": false,
1614
+ "notNull": false
1615
+ },
1616
+ "role": {
1617
+ "name": "role",
1618
+ "type": "text",
1619
+ "primaryKey": false,
1620
+ "notNull": true,
1621
+ "default": "'member'"
1622
+ },
1623
+ "status": {
1624
+ "name": "status",
1625
+ "type": "text",
1626
+ "primaryKey": false,
1627
+ "notNull": true,
1628
+ "default": "'invited'"
1629
+ },
1630
+ "password_hash": {
1631
+ "name": "password_hash",
1632
+ "type": "text",
1633
+ "primaryKey": false,
1634
+ "notNull": false
1635
+ },
1636
+ "email_verified_at": {
1637
+ "name": "email_verified_at",
1638
+ "type": "timestamp with time zone",
1639
+ "primaryKey": false,
1640
+ "notNull": false
1641
+ },
1642
+ "auth_version": {
1643
+ "name": "auth_version",
1644
+ "type": "integer",
1645
+ "primaryKey": false,
1646
+ "notNull": true,
1647
+ "default": 1
1648
+ },
1649
+ "created_at": {
1650
+ "name": "created_at",
1651
+ "type": "timestamp with time zone",
1652
+ "primaryKey": false,
1653
+ "notNull": true,
1654
+ "default": "now()"
1655
+ },
1656
+ "updated_at": {
1657
+ "name": "updated_at",
1658
+ "type": "timestamp with time zone",
1659
+ "primaryKey": false,
1660
+ "notNull": true,
1661
+ "default": "now()"
1662
+ }
1663
+ },
1664
+ "indexes": {
1665
+ "registry_users_normalized_email_idx": {
1666
+ "name": "registry_users_normalized_email_idx",
1667
+ "columns": [
1668
+ {
1669
+ "expression": "lower(btrim(\"email\"))",
1670
+ "asc": true,
1671
+ "isExpression": true,
1672
+ "nulls": "last"
1673
+ }
1674
+ ],
1675
+ "isUnique": true,
1676
+ "concurrently": false,
1677
+ "method": "btree",
1678
+ "with": {}
1679
+ },
1680
+ "registry_users_status_role_idx": {
1681
+ "name": "registry_users_status_role_idx",
1682
+ "columns": [
1683
+ {
1684
+ "expression": "status",
1685
+ "isExpression": false,
1686
+ "asc": true,
1687
+ "nulls": "last"
1688
+ },
1689
+ {
1690
+ "expression": "role",
1691
+ "isExpression": false,
1692
+ "asc": true,
1693
+ "nulls": "last"
1694
+ }
1695
+ ],
1696
+ "isUnique": false,
1697
+ "concurrently": false,
1698
+ "method": "btree",
1699
+ "with": {}
1700
+ }
1701
+ },
1702
+ "foreignKeys": {},
1703
+ "compositePrimaryKeys": {},
1704
+ "uniqueConstraints": {},
1705
+ "policies": {},
1706
+ "checkConstraints": {
1707
+ "registry_users_email_normalized": {
1708
+ "name": "registry_users_email_normalized",
1709
+ "value": "\"registry_users\".\"email\" = lower(btrim(\"registry_users\".\"email\"))"
1710
+ },
1711
+ "registry_users_role_valid": {
1712
+ "name": "registry_users_role_valid",
1713
+ "value": "\"registry_users\".\"role\" in ('admin', 'member')"
1714
+ },
1715
+ "registry_users_status_valid": {
1716
+ "name": "registry_users_status_valid",
1717
+ "value": "\"registry_users\".\"status\" in ('invited', 'active', 'deactivated')"
1718
+ },
1719
+ "registry_users_auth_version_positive": {
1720
+ "name": "registry_users_auth_version_positive",
1721
+ "value": "\"registry_users\".\"auth_version\" > 0"
1722
+ }
1723
+ },
1724
+ "isRLSEnabled": false
1725
+ },
1726
+ "public.token_artifacts": {
1727
+ "name": "token_artifacts",
1728
+ "schema": "",
1729
+ "columns": {
1730
+ "token_set_id": {
1731
+ "name": "token_set_id",
1732
+ "type": "text",
1733
+ "primaryKey": false,
1734
+ "notNull": true
1735
+ },
1736
+ "path": {
1737
+ "name": "path",
1738
+ "type": "text",
1739
+ "primaryKey": false,
1740
+ "notNull": true
1741
+ },
1742
+ "format": {
1743
+ "name": "format",
1744
+ "type": "text",
1745
+ "primaryKey": false,
1746
+ "notNull": true
1747
+ },
1748
+ "content": {
1749
+ "name": "content",
1750
+ "type": "text",
1751
+ "primaryKey": false,
1752
+ "notNull": false
1753
+ },
1754
+ "storage_ref": {
1755
+ "name": "storage_ref",
1756
+ "type": "text",
1757
+ "primaryKey": false,
1758
+ "notNull": false
1759
+ },
1760
+ "content_type": {
1761
+ "name": "content_type",
1762
+ "type": "text",
1763
+ "primaryKey": false,
1764
+ "notNull": true
1765
+ },
1766
+ "hash": {
1767
+ "name": "hash",
1768
+ "type": "text",
1769
+ "primaryKey": false,
1770
+ "notNull": false
1771
+ },
1772
+ "size": {
1773
+ "name": "size",
1774
+ "type": "integer",
1775
+ "primaryKey": false,
1776
+ "notNull": false
1777
+ },
1778
+ "created_at": {
1779
+ "name": "created_at",
1780
+ "type": "timestamp with time zone",
1781
+ "primaryKey": false,
1782
+ "notNull": true,
1783
+ "default": "now()"
1784
+ },
1785
+ "updated_at": {
1786
+ "name": "updated_at",
1787
+ "type": "timestamp with time zone",
1788
+ "primaryKey": false,
1789
+ "notNull": true,
1790
+ "default": "now()"
1791
+ }
1792
+ },
1793
+ "indexes": {},
1794
+ "foreignKeys": {
1795
+ "token_artifacts_token_set_id_token_sets_id_fk": {
1796
+ "name": "token_artifacts_token_set_id_token_sets_id_fk",
1797
+ "tableFrom": "token_artifacts",
1798
+ "tableTo": "token_sets",
1799
+ "columnsFrom": [
1800
+ "token_set_id"
1801
+ ],
1802
+ "columnsTo": [
1803
+ "id"
1804
+ ],
1805
+ "onDelete": "cascade",
1806
+ "onUpdate": "no action"
1807
+ }
1808
+ },
1809
+ "compositePrimaryKeys": {
1810
+ "token_artifacts_token_set_id_path_pk": {
1811
+ "name": "token_artifacts_token_set_id_path_pk",
1812
+ "columns": [
1813
+ "token_set_id",
1814
+ "path"
1815
+ ]
1816
+ }
1817
+ },
1818
+ "uniqueConstraints": {},
1819
+ "policies": {},
1820
+ "checkConstraints": {},
1821
+ "isRLSEnabled": false
1822
+ },
1823
+ "public.token_sets": {
1824
+ "name": "token_sets",
1825
+ "schema": "",
1826
+ "columns": {
1827
+ "id": {
1828
+ "name": "id",
1829
+ "type": "text",
1830
+ "primaryKey": true,
1831
+ "notNull": true
1832
+ },
1833
+ "kind": {
1834
+ "name": "kind",
1835
+ "type": "text",
1836
+ "primaryKey": false,
1837
+ "notNull": true
1838
+ },
1839
+ "record": {
1840
+ "name": "record",
1841
+ "type": "jsonb",
1842
+ "primaryKey": false,
1843
+ "notNull": true
1844
+ },
1845
+ "source_hash": {
1846
+ "name": "source_hash",
1847
+ "type": "text",
1848
+ "primaryKey": false,
1849
+ "notNull": false
1850
+ },
1851
+ "status": {
1852
+ "name": "status",
1853
+ "type": "text",
1854
+ "primaryKey": false,
1855
+ "notNull": false
1856
+ },
1857
+ "built_at": {
1858
+ "name": "built_at",
1859
+ "type": "timestamp with time zone",
1860
+ "primaryKey": false,
1861
+ "notNull": false
1862
+ },
1863
+ "builder_version": {
1864
+ "name": "builder_version",
1865
+ "type": "text",
1866
+ "primaryKey": false,
1867
+ "notNull": false
1868
+ },
1869
+ "metadata": {
1870
+ "name": "metadata",
1871
+ "type": "jsonb",
1872
+ "primaryKey": false,
1873
+ "notNull": false
1874
+ },
1875
+ "created_at": {
1876
+ "name": "created_at",
1877
+ "type": "timestamp with time zone",
1878
+ "primaryKey": false,
1879
+ "notNull": true,
1880
+ "default": "now()"
1881
+ },
1882
+ "updated_at": {
1883
+ "name": "updated_at",
1884
+ "type": "timestamp with time zone",
1885
+ "primaryKey": false,
1886
+ "notNull": true,
1887
+ "default": "now()"
1888
+ }
1889
+ },
1890
+ "indexes": {
1891
+ "token_sets_kind_idx": {
1892
+ "name": "token_sets_kind_idx",
1893
+ "columns": [
1894
+ {
1895
+ "expression": "kind",
1896
+ "isExpression": false,
1897
+ "asc": true,
1898
+ "nulls": "last"
1899
+ }
1900
+ ],
1901
+ "isUnique": false,
1902
+ "concurrently": false,
1903
+ "method": "btree",
1904
+ "with": {}
1905
+ }
1906
+ },
1907
+ "foreignKeys": {},
1908
+ "compositePrimaryKeys": {},
1909
+ "uniqueConstraints": {},
1910
+ "policies": {},
1911
+ "checkConstraints": {},
1912
+ "isRLSEnabled": false
1913
+ }
1914
+ },
1915
+ "enums": {},
1916
+ "schemas": {},
1917
+ "sequences": {},
1918
+ "roles": {},
1919
+ "policies": {},
1920
+ "views": {},
1921
+ "_meta": {
1922
+ "columns": {},
1923
+ "schemas": {},
1924
+ "tables": {}
1925
+ }
1926
+ }