@shipfox/api-auth 17.0.0 → 19.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (99) hide show
  1. package/.turbo/turbo-build.log +1 -1
  2. package/CHANGELOG.md +44 -0
  3. package/README.md +24 -9
  4. package/dist/core/administration.d.ts +15 -0
  5. package/dist/core/administration.d.ts.map +1 -1
  6. package/dist/core/administration.js +44 -2
  7. package/dist/core/administration.js.map +1 -1
  8. package/dist/core/auth.d.ts.map +1 -1
  9. package/dist/core/auth.js +5 -3
  10. package/dist/core/auth.js.map +1 -1
  11. package/dist/core/entities/agent-access.d.ts +75 -0
  12. package/dist/core/entities/agent-access.d.ts.map +1 -0
  13. package/dist/core/entities/agent-access.js +3 -0
  14. package/dist/core/entities/agent-access.js.map +1 -0
  15. package/dist/core/errors.d.ts +3 -0
  16. package/dist/core/errors.d.ts.map +1 -1
  17. package/dist/core/errors.js +6 -0
  18. package/dist/core/errors.js.map +1 -1
  19. package/dist/core/runner-session-token.d.ts.map +1 -1
  20. package/dist/core/runner-session-token.js +2 -1
  21. package/dist/core/runner-session-token.js.map +1 -1
  22. package/dist/db/admin-user-moderation.d.ts.map +1 -1
  23. package/dist/db/admin-user-moderation.js +30 -26
  24. package/dist/db/admin-user-moderation.js.map +1 -1
  25. package/dist/db/admin-user-summary.d.ts +22 -0
  26. package/dist/db/admin-user-summary.d.ts.map +1 -1
  27. package/dist/db/admin-user-summary.js +75 -1
  28. package/dist/db/admin-user-summary.js.map +1 -1
  29. package/dist/db/admin-users.d.ts +11 -0
  30. package/dist/db/admin-users.d.ts.map +1 -1
  31. package/dist/db/admin-users.js +4 -1
  32. package/dist/db/admin-users.js.map +1 -1
  33. package/dist/db/agent-access.d.ts +159 -0
  34. package/dist/db/agent-access.d.ts.map +1 -0
  35. package/dist/db/agent-access.js +267 -0
  36. package/dist/db/agent-access.js.map +1 -0
  37. package/dist/db/db.d.ts +2604 -238
  38. package/dist/db/db.d.ts.map +1 -1
  39. package/dist/db/db.js +7 -0
  40. package/dist/db/db.js.map +1 -1
  41. package/dist/db/schema/agent-access.d.ts +1204 -0
  42. package/dist/db/schema/agent-access.d.ts.map +1 -0
  43. package/dist/db/schema/agent-access.js +267 -0
  44. package/dist/db/schema/agent-access.js.map +1 -0
  45. package/dist/db/schema/users.d.ts.map +1 -1
  46. package/dist/db/schema/users.js +8 -3
  47. package/dist/db/schema/users.js.map +1 -1
  48. package/dist/index.d.ts +3 -2
  49. package/dist/index.d.ts.map +1 -1
  50. package/dist/index.js +2 -2
  51. package/dist/index.js.map +1 -1
  52. package/dist/metrics/instance.d.ts +1 -1
  53. package/dist/metrics/instance.d.ts.map +1 -1
  54. package/dist/metrics/instance.js.map +1 -1
  55. package/dist/presentation/routes/administration.d.ts.map +1 -1
  56. package/dist/presentation/routes/administration.js +123 -20
  57. package/dist/presentation/routes/administration.js.map +1 -1
  58. package/dist/presentation/routes/email-verification/verify-email-resend.d.ts.map +1 -1
  59. package/dist/presentation/routes/email-verification/verify-email-resend.js +6 -1
  60. package/dist/presentation/routes/email-verification/verify-email-resend.js.map +1 -1
  61. package/dist/presentation/routes/rate-limit.d.ts.map +1 -1
  62. package/dist/presentation/routes/rate-limit.js +10 -0
  63. package/dist/presentation/routes/rate-limit.js.map +1 -1
  64. package/dist/presentation/routes/registration/signup.d.ts.map +1 -1
  65. package/dist/presentation/routes/registration/signup.js +59 -50
  66. package/dist/presentation/routes/registration/signup.js.map +1 -1
  67. package/dist/tsconfig.test.tsbuildinfo +1 -1
  68. package/drizzle/0003_brainy_luckman.sql +6 -0
  69. package/drizzle/0004_yummy_runaways.sql +110 -0
  70. package/drizzle/meta/0003_snapshot.json +844 -0
  71. package/drizzle/meta/0004_snapshot.json +1751 -0
  72. package/drizzle/meta/_journal.json +14 -0
  73. package/package.json +7 -7
  74. package/src/core/admin-role.test.ts +70 -0
  75. package/src/core/administration.ts +78 -1
  76. package/src/core/auth.ts +3 -5
  77. package/src/core/entities/agent-access.ts +80 -0
  78. package/src/core/errors.ts +7 -0
  79. package/src/core/runner-session-token.test.ts +2 -0
  80. package/src/core/runner-session-token.ts +1 -0
  81. package/src/db/admin-user-moderation.ts +53 -45
  82. package/src/db/admin-user-summary.test.ts +228 -0
  83. package/src/db/admin-user-summary.ts +143 -1
  84. package/src/db/admin-users.ts +21 -1
  85. package/src/db/agent-access.test.ts +370 -0
  86. package/src/db/agent-access.ts +629 -0
  87. package/src/db/db.ts +14 -0
  88. package/src/db/schema/agent-access.ts +273 -0
  89. package/src/db/schema/users.ts +9 -3
  90. package/src/index.ts +6 -0
  91. package/src/metrics/instance.ts +1 -0
  92. package/src/presentation/routes/administration.test.ts +359 -2
  93. package/src/presentation/routes/administration.ts +142 -20
  94. package/src/presentation/routes/email-verification/verify-email-resend.ts +7 -1
  95. package/src/presentation/routes/rate-limit.ts +4 -0
  96. package/src/presentation/routes/registration/signup.ts +52 -41
  97. package/test/globalSetup.ts +1 -1
  98. package/test/routes.ts +3 -1
  99. package/tsconfig.build.tsbuildinfo +1 -1
@@ -0,0 +1,844 @@
1
+ {
2
+ "id": "391db994-0ade-4426-b398-e47d8b4101cf",
3
+ "prevId": "49ca55f0-179d-429e-adaf-0d68a7927a7f",
4
+ "version": "7",
5
+ "dialect": "postgresql",
6
+ "tables": {
7
+ "public.auth_admin_command_results": {
8
+ "name": "auth_admin_command_results",
9
+ "schema": "",
10
+ "columns": {
11
+ "id": {
12
+ "name": "id",
13
+ "type": "uuid",
14
+ "primaryKey": true,
15
+ "notNull": true,
16
+ "default": "uuidv7()"
17
+ },
18
+ "actor_id": {
19
+ "name": "actor_id",
20
+ "type": "uuid",
21
+ "primaryKey": false,
22
+ "notNull": true
23
+ },
24
+ "idempotency_key_fingerprint": {
25
+ "name": "idempotency_key_fingerprint",
26
+ "type": "text",
27
+ "primaryKey": false,
28
+ "notNull": true
29
+ },
30
+ "command": {
31
+ "name": "command",
32
+ "type": "text",
33
+ "primaryKey": false,
34
+ "notNull": true
35
+ },
36
+ "request_fingerprint": {
37
+ "name": "request_fingerprint",
38
+ "type": "text",
39
+ "primaryKey": false,
40
+ "notNull": true
41
+ },
42
+ "result": {
43
+ "name": "result",
44
+ "type": "jsonb",
45
+ "primaryKey": false,
46
+ "notNull": true
47
+ },
48
+ "created_at": {
49
+ "name": "created_at",
50
+ "type": "timestamp with time zone",
51
+ "primaryKey": false,
52
+ "notNull": true,
53
+ "default": "now()"
54
+ }
55
+ },
56
+ "indexes": {
57
+ "auth_admin_command_results_actor_key_unique": {
58
+ "name": "auth_admin_command_results_actor_key_unique",
59
+ "columns": [
60
+ {
61
+ "expression": "actor_id",
62
+ "isExpression": false,
63
+ "asc": true,
64
+ "nulls": "last"
65
+ },
66
+ {
67
+ "expression": "idempotency_key_fingerprint",
68
+ "isExpression": false,
69
+ "asc": true,
70
+ "nulls": "last"
71
+ }
72
+ ],
73
+ "isUnique": true,
74
+ "concurrently": false,
75
+ "method": "btree",
76
+ "with": {}
77
+ }
78
+ },
79
+ "foreignKeys": {
80
+ "auth_admin_command_results_actor_id_auth_users_id_fk": {
81
+ "name": "auth_admin_command_results_actor_id_auth_users_id_fk",
82
+ "tableFrom": "auth_admin_command_results",
83
+ "tableTo": "auth_users",
84
+ "columnsFrom": ["actor_id"],
85
+ "columnsTo": ["id"],
86
+ "onDelete": "cascade",
87
+ "onUpdate": "no action"
88
+ }
89
+ },
90
+ "compositePrimaryKeys": {},
91
+ "uniqueConstraints": {},
92
+ "policies": {},
93
+ "checkConstraints": {},
94
+ "isRLSEnabled": false
95
+ },
96
+ "public.auth_admin_grants": {
97
+ "name": "auth_admin_grants",
98
+ "schema": "",
99
+ "columns": {
100
+ "id": {
101
+ "name": "id",
102
+ "type": "uuid",
103
+ "primaryKey": true,
104
+ "notNull": true,
105
+ "default": "uuidv7()"
106
+ },
107
+ "user_id": {
108
+ "name": "user_id",
109
+ "type": "uuid",
110
+ "primaryKey": false,
111
+ "notNull": true
112
+ },
113
+ "role": {
114
+ "name": "role",
115
+ "type": "auth_admin_role",
116
+ "typeSchema": "public",
117
+ "primaryKey": false,
118
+ "notNull": true
119
+ },
120
+ "revoked_at": {
121
+ "name": "revoked_at",
122
+ "type": "timestamp with time zone",
123
+ "primaryKey": false,
124
+ "notNull": false
125
+ },
126
+ "created_at": {
127
+ "name": "created_at",
128
+ "type": "timestamp with time zone",
129
+ "primaryKey": false,
130
+ "notNull": true,
131
+ "default": "now()"
132
+ },
133
+ "updated_at": {
134
+ "name": "updated_at",
135
+ "type": "timestamp with time zone",
136
+ "primaryKey": false,
137
+ "notNull": true,
138
+ "default": "now()"
139
+ }
140
+ },
141
+ "indexes": {
142
+ "auth_admin_grants_user_id_idx": {
143
+ "name": "auth_admin_grants_user_id_idx",
144
+ "columns": [
145
+ {
146
+ "expression": "user_id",
147
+ "isExpression": false,
148
+ "asc": true,
149
+ "nulls": "last"
150
+ }
151
+ ],
152
+ "isUnique": false,
153
+ "concurrently": false,
154
+ "method": "btree",
155
+ "with": {}
156
+ },
157
+ "auth_admin_grants_active_owners_idx": {
158
+ "name": "auth_admin_grants_active_owners_idx",
159
+ "columns": [
160
+ {
161
+ "expression": "user_id",
162
+ "isExpression": false,
163
+ "asc": true,
164
+ "nulls": "last"
165
+ }
166
+ ],
167
+ "isUnique": false,
168
+ "where": "\"auth_admin_grants\".\"role\" = 'admin-owner' AND \"auth_admin_grants\".\"revoked_at\" IS NULL",
169
+ "concurrently": false,
170
+ "method": "btree",
171
+ "with": {}
172
+ },
173
+ "auth_admin_grants_active_user_role_unique": {
174
+ "name": "auth_admin_grants_active_user_role_unique",
175
+ "columns": [
176
+ {
177
+ "expression": "user_id",
178
+ "isExpression": false,
179
+ "asc": true,
180
+ "nulls": "last"
181
+ },
182
+ {
183
+ "expression": "role",
184
+ "isExpression": false,
185
+ "asc": true,
186
+ "nulls": "last"
187
+ }
188
+ ],
189
+ "isUnique": true,
190
+ "where": "\"auth_admin_grants\".\"revoked_at\" IS NULL",
191
+ "concurrently": false,
192
+ "method": "btree",
193
+ "with": {}
194
+ }
195
+ },
196
+ "foreignKeys": {
197
+ "auth_admin_grants_user_id_auth_users_id_fk": {
198
+ "name": "auth_admin_grants_user_id_auth_users_id_fk",
199
+ "tableFrom": "auth_admin_grants",
200
+ "tableTo": "auth_users",
201
+ "columnsFrom": ["user_id"],
202
+ "columnsTo": ["id"],
203
+ "onDelete": "cascade",
204
+ "onUpdate": "no action"
205
+ }
206
+ },
207
+ "compositePrimaryKeys": {},
208
+ "uniqueConstraints": {},
209
+ "policies": {},
210
+ "checkConstraints": {},
211
+ "isRLSEnabled": false
212
+ },
213
+ "public.auth_outbox": {
214
+ "name": "auth_outbox",
215
+ "schema": "",
216
+ "columns": {
217
+ "id": {
218
+ "name": "id",
219
+ "type": "uuid",
220
+ "primaryKey": true,
221
+ "notNull": true,
222
+ "default": "uuidv7()"
223
+ },
224
+ "event_type": {
225
+ "name": "event_type",
226
+ "type": "text",
227
+ "primaryKey": false,
228
+ "notNull": true
229
+ },
230
+ "ordering_key": {
231
+ "name": "ordering_key",
232
+ "type": "text",
233
+ "primaryKey": false,
234
+ "notNull": false
235
+ },
236
+ "payload": {
237
+ "name": "payload",
238
+ "type": "jsonb",
239
+ "primaryKey": false,
240
+ "notNull": true
241
+ },
242
+ "created_at": {
243
+ "name": "created_at",
244
+ "type": "timestamp with time zone",
245
+ "primaryKey": false,
246
+ "notNull": true,
247
+ "default": "now()"
248
+ },
249
+ "dispatched_at": {
250
+ "name": "dispatched_at",
251
+ "type": "timestamp with time zone",
252
+ "primaryKey": false,
253
+ "notNull": false
254
+ },
255
+ "dispatch_attempts": {
256
+ "name": "dispatch_attempts",
257
+ "type": "integer",
258
+ "primaryKey": false,
259
+ "notNull": true,
260
+ "default": 0
261
+ },
262
+ "next_dispatch_at": {
263
+ "name": "next_dispatch_at",
264
+ "type": "timestamp with time zone",
265
+ "primaryKey": false,
266
+ "notNull": true,
267
+ "default": "now()"
268
+ },
269
+ "last_dispatch_error": {
270
+ "name": "last_dispatch_error",
271
+ "type": "jsonb",
272
+ "primaryKey": false,
273
+ "notNull": false
274
+ },
275
+ "last_dispatch_failed_at": {
276
+ "name": "last_dispatch_failed_at",
277
+ "type": "timestamp with time zone",
278
+ "primaryKey": false,
279
+ "notNull": false
280
+ },
281
+ "dead_lettered_at": {
282
+ "name": "dead_lettered_at",
283
+ "type": "timestamp with time zone",
284
+ "primaryKey": false,
285
+ "notNull": false
286
+ }
287
+ },
288
+ "indexes": {
289
+ "auth_outbox_pending_idx": {
290
+ "name": "auth_outbox_pending_idx",
291
+ "columns": [
292
+ {
293
+ "expression": "next_dispatch_at",
294
+ "isExpression": false,
295
+ "asc": true,
296
+ "nulls": "last"
297
+ },
298
+ {
299
+ "expression": "created_at",
300
+ "isExpression": false,
301
+ "asc": true,
302
+ "nulls": "last"
303
+ }
304
+ ],
305
+ "isUnique": false,
306
+ "where": "\"dispatched_at\" IS NULL AND \"dead_lettered_at\" IS NULL",
307
+ "concurrently": false,
308
+ "method": "btree",
309
+ "with": {}
310
+ },
311
+ "auth_outbox_dispatched_retention_idx": {
312
+ "name": "auth_outbox_dispatched_retention_idx",
313
+ "columns": [
314
+ {
315
+ "expression": "dispatched_at",
316
+ "isExpression": false,
317
+ "asc": true,
318
+ "nulls": "last"
319
+ },
320
+ {
321
+ "expression": "id",
322
+ "isExpression": false,
323
+ "asc": true,
324
+ "nulls": "last"
325
+ }
326
+ ],
327
+ "isUnique": false,
328
+ "where": "\"dispatched_at\" IS NOT NULL",
329
+ "concurrently": false,
330
+ "method": "btree",
331
+ "with": {}
332
+ }
333
+ },
334
+ "foreignKeys": {},
335
+ "compositePrimaryKeys": {},
336
+ "uniqueConstraints": {},
337
+ "policies": {},
338
+ "checkConstraints": {},
339
+ "isRLSEnabled": false
340
+ },
341
+ "public.auth_password_resets": {
342
+ "name": "auth_password_resets",
343
+ "schema": "",
344
+ "columns": {
345
+ "id": {
346
+ "name": "id",
347
+ "type": "uuid",
348
+ "primaryKey": true,
349
+ "notNull": true,
350
+ "default": "uuidv7()"
351
+ },
352
+ "user_id": {
353
+ "name": "user_id",
354
+ "type": "uuid",
355
+ "primaryKey": false,
356
+ "notNull": true
357
+ },
358
+ "hashed_token": {
359
+ "name": "hashed_token",
360
+ "type": "text",
361
+ "primaryKey": false,
362
+ "notNull": true
363
+ },
364
+ "expires_at": {
365
+ "name": "expires_at",
366
+ "type": "timestamp with time zone",
367
+ "primaryKey": false,
368
+ "notNull": true
369
+ },
370
+ "used_at": {
371
+ "name": "used_at",
372
+ "type": "timestamp with time zone",
373
+ "primaryKey": false,
374
+ "notNull": false
375
+ },
376
+ "created_at": {
377
+ "name": "created_at",
378
+ "type": "timestamp with time zone",
379
+ "primaryKey": false,
380
+ "notNull": true,
381
+ "default": "now()"
382
+ }
383
+ },
384
+ "indexes": {
385
+ "auth_password_resets_hashed_token_unique": {
386
+ "name": "auth_password_resets_hashed_token_unique",
387
+ "columns": [
388
+ {
389
+ "expression": "hashed_token",
390
+ "isExpression": false,
391
+ "asc": true,
392
+ "nulls": "last"
393
+ }
394
+ ],
395
+ "isUnique": true,
396
+ "concurrently": false,
397
+ "method": "btree",
398
+ "with": {}
399
+ },
400
+ "auth_password_resets_user_id_idx": {
401
+ "name": "auth_password_resets_user_id_idx",
402
+ "columns": [
403
+ {
404
+ "expression": "user_id",
405
+ "isExpression": false,
406
+ "asc": true,
407
+ "nulls": "last"
408
+ }
409
+ ],
410
+ "isUnique": false,
411
+ "concurrently": false,
412
+ "method": "btree",
413
+ "with": {}
414
+ }
415
+ },
416
+ "foreignKeys": {
417
+ "auth_password_resets_user_id_auth_users_id_fk": {
418
+ "name": "auth_password_resets_user_id_auth_users_id_fk",
419
+ "tableFrom": "auth_password_resets",
420
+ "tableTo": "auth_users",
421
+ "columnsFrom": ["user_id"],
422
+ "columnsTo": ["id"],
423
+ "onDelete": "cascade",
424
+ "onUpdate": "no action"
425
+ }
426
+ },
427
+ "compositePrimaryKeys": {},
428
+ "uniqueConstraints": {},
429
+ "policies": {},
430
+ "checkConstraints": {},
431
+ "isRLSEnabled": false
432
+ },
433
+ "public.auth_rate_limits": {
434
+ "name": "auth_rate_limits",
435
+ "schema": "",
436
+ "columns": {
437
+ "action": {
438
+ "name": "action",
439
+ "type": "text",
440
+ "primaryKey": false,
441
+ "notNull": true
442
+ },
443
+ "scope": {
444
+ "name": "scope",
445
+ "type": "text",
446
+ "primaryKey": false,
447
+ "notNull": true
448
+ },
449
+ "identifier_hmac": {
450
+ "name": "identifier_hmac",
451
+ "type": "text",
452
+ "primaryKey": false,
453
+ "notNull": true
454
+ },
455
+ "window_start": {
456
+ "name": "window_start",
457
+ "type": "timestamp with time zone",
458
+ "primaryKey": false,
459
+ "notNull": true
460
+ },
461
+ "count": {
462
+ "name": "count",
463
+ "type": "integer",
464
+ "primaryKey": false,
465
+ "notNull": true,
466
+ "default": 1
467
+ },
468
+ "expires_at": {
469
+ "name": "expires_at",
470
+ "type": "timestamp with time zone",
471
+ "primaryKey": false,
472
+ "notNull": true
473
+ },
474
+ "created_at": {
475
+ "name": "created_at",
476
+ "type": "timestamp with time zone",
477
+ "primaryKey": false,
478
+ "notNull": true,
479
+ "default": "now()"
480
+ },
481
+ "updated_at": {
482
+ "name": "updated_at",
483
+ "type": "timestamp with time zone",
484
+ "primaryKey": false,
485
+ "notNull": true,
486
+ "default": "now()"
487
+ }
488
+ },
489
+ "indexes": {
490
+ "auth_rate_limits_window_unique": {
491
+ "name": "auth_rate_limits_window_unique",
492
+ "columns": [
493
+ {
494
+ "expression": "action",
495
+ "isExpression": false,
496
+ "asc": true,
497
+ "nulls": "last"
498
+ },
499
+ {
500
+ "expression": "scope",
501
+ "isExpression": false,
502
+ "asc": true,
503
+ "nulls": "last"
504
+ },
505
+ {
506
+ "expression": "identifier_hmac",
507
+ "isExpression": false,
508
+ "asc": true,
509
+ "nulls": "last"
510
+ },
511
+ {
512
+ "expression": "window_start",
513
+ "isExpression": false,
514
+ "asc": true,
515
+ "nulls": "last"
516
+ }
517
+ ],
518
+ "isUnique": true,
519
+ "concurrently": false,
520
+ "method": "btree",
521
+ "with": {}
522
+ },
523
+ "auth_rate_limits_expires_at_idx": {
524
+ "name": "auth_rate_limits_expires_at_idx",
525
+ "columns": [
526
+ {
527
+ "expression": "expires_at",
528
+ "isExpression": false,
529
+ "asc": true,
530
+ "nulls": "last"
531
+ }
532
+ ],
533
+ "isUnique": false,
534
+ "concurrently": false,
535
+ "method": "btree",
536
+ "with": {}
537
+ }
538
+ },
539
+ "foreignKeys": {},
540
+ "compositePrimaryKeys": {},
541
+ "uniqueConstraints": {},
542
+ "policies": {},
543
+ "checkConstraints": {},
544
+ "isRLSEnabled": false
545
+ },
546
+ "public.auth_refresh_tokens": {
547
+ "name": "auth_refresh_tokens",
548
+ "schema": "",
549
+ "columns": {
550
+ "id": {
551
+ "name": "id",
552
+ "type": "uuid",
553
+ "primaryKey": true,
554
+ "notNull": true,
555
+ "default": "uuidv7()"
556
+ },
557
+ "session_id": {
558
+ "name": "session_id",
559
+ "type": "uuid",
560
+ "primaryKey": false,
561
+ "notNull": true,
562
+ "default": "uuidv7()"
563
+ },
564
+ "user_id": {
565
+ "name": "user_id",
566
+ "type": "uuid",
567
+ "primaryKey": false,
568
+ "notNull": true
569
+ },
570
+ "hashed_token": {
571
+ "name": "hashed_token",
572
+ "type": "text",
573
+ "primaryKey": false,
574
+ "notNull": true
575
+ },
576
+ "expires_at": {
577
+ "name": "expires_at",
578
+ "type": "timestamp with time zone",
579
+ "primaryKey": false,
580
+ "notNull": true
581
+ },
582
+ "revoked_at": {
583
+ "name": "revoked_at",
584
+ "type": "timestamp with time zone",
585
+ "primaryKey": false,
586
+ "notNull": false
587
+ },
588
+ "rotated_at": {
589
+ "name": "rotated_at",
590
+ "type": "timestamp with time zone",
591
+ "primaryKey": false,
592
+ "notNull": false
593
+ },
594
+ "last_used_at": {
595
+ "name": "last_used_at",
596
+ "type": "timestamp with time zone",
597
+ "primaryKey": false,
598
+ "notNull": false
599
+ },
600
+ "created_at": {
601
+ "name": "created_at",
602
+ "type": "timestamp with time zone",
603
+ "primaryKey": false,
604
+ "notNull": true,
605
+ "default": "now()"
606
+ },
607
+ "updated_at": {
608
+ "name": "updated_at",
609
+ "type": "timestamp with time zone",
610
+ "primaryKey": false,
611
+ "notNull": true,
612
+ "default": "now()"
613
+ }
614
+ },
615
+ "indexes": {
616
+ "auth_refresh_tokens_hashed_token_unique": {
617
+ "name": "auth_refresh_tokens_hashed_token_unique",
618
+ "columns": [
619
+ {
620
+ "expression": "hashed_token",
621
+ "isExpression": false,
622
+ "asc": true,
623
+ "nulls": "last"
624
+ }
625
+ ],
626
+ "isUnique": true,
627
+ "concurrently": false,
628
+ "method": "btree",
629
+ "with": {}
630
+ },
631
+ "auth_refresh_tokens_active_session_unique": {
632
+ "name": "auth_refresh_tokens_active_session_unique",
633
+ "columns": [
634
+ {
635
+ "expression": "user_id",
636
+ "isExpression": false,
637
+ "asc": true,
638
+ "nulls": "last"
639
+ },
640
+ {
641
+ "expression": "session_id",
642
+ "isExpression": false,
643
+ "asc": true,
644
+ "nulls": "last"
645
+ }
646
+ ],
647
+ "isUnique": true,
648
+ "where": "\"auth_refresh_tokens\".\"revoked_at\" IS NULL AND \"auth_refresh_tokens\".\"rotated_at\" IS NULL",
649
+ "concurrently": false,
650
+ "method": "btree",
651
+ "with": {}
652
+ },
653
+ "auth_refresh_tokens_user_id_idx": {
654
+ "name": "auth_refresh_tokens_user_id_idx",
655
+ "columns": [
656
+ {
657
+ "expression": "user_id",
658
+ "isExpression": false,
659
+ "asc": true,
660
+ "nulls": "last"
661
+ }
662
+ ],
663
+ "isUnique": false,
664
+ "concurrently": false,
665
+ "method": "btree",
666
+ "with": {}
667
+ }
668
+ },
669
+ "foreignKeys": {
670
+ "auth_refresh_tokens_user_id_auth_users_id_fk": {
671
+ "name": "auth_refresh_tokens_user_id_auth_users_id_fk",
672
+ "tableFrom": "auth_refresh_tokens",
673
+ "tableTo": "auth_users",
674
+ "columnsFrom": ["user_id"],
675
+ "columnsTo": ["id"],
676
+ "onDelete": "cascade",
677
+ "onUpdate": "no action"
678
+ }
679
+ },
680
+ "compositePrimaryKeys": {},
681
+ "uniqueConstraints": {},
682
+ "policies": {},
683
+ "checkConstraints": {},
684
+ "isRLSEnabled": false
685
+ },
686
+ "public.auth_users": {
687
+ "name": "auth_users",
688
+ "schema": "",
689
+ "columns": {
690
+ "id": {
691
+ "name": "id",
692
+ "type": "uuid",
693
+ "primaryKey": true,
694
+ "notNull": true,
695
+ "default": "uuidv7()"
696
+ },
697
+ "email": {
698
+ "name": "email",
699
+ "type": "text",
700
+ "primaryKey": false,
701
+ "notNull": true
702
+ },
703
+ "hashed_password": {
704
+ "name": "hashed_password",
705
+ "type": "text",
706
+ "primaryKey": false,
707
+ "notNull": false
708
+ },
709
+ "name": {
710
+ "name": "name",
711
+ "type": "text",
712
+ "primaryKey": false,
713
+ "notNull": false
714
+ },
715
+ "email_verified_at": {
716
+ "name": "email_verified_at",
717
+ "type": "timestamp with time zone",
718
+ "primaryKey": false,
719
+ "notNull": false
720
+ },
721
+ "status": {
722
+ "name": "status",
723
+ "type": "auth_user_status",
724
+ "typeSchema": "public",
725
+ "primaryKey": false,
726
+ "notNull": true,
727
+ "default": "'active'"
728
+ },
729
+ "created_at": {
730
+ "name": "created_at",
731
+ "type": "timestamp (3) with time zone",
732
+ "primaryKey": false,
733
+ "notNull": true,
734
+ "default": "now()"
735
+ },
736
+ "updated_at": {
737
+ "name": "updated_at",
738
+ "type": "timestamp with time zone",
739
+ "primaryKey": false,
740
+ "notNull": true,
741
+ "default": "now()"
742
+ }
743
+ },
744
+ "indexes": {
745
+ "auth_users_email_unique": {
746
+ "name": "auth_users_email_unique",
747
+ "columns": [
748
+ {
749
+ "expression": "email",
750
+ "isExpression": false,
751
+ "asc": true,
752
+ "nulls": "last"
753
+ }
754
+ ],
755
+ "isUnique": true,
756
+ "concurrently": false,
757
+ "method": "btree",
758
+ "with": {}
759
+ },
760
+ "auth_users_created_at_id_index": {
761
+ "name": "auth_users_created_at_id_index",
762
+ "columns": [
763
+ {
764
+ "expression": "\"created_at\" desc",
765
+ "asc": true,
766
+ "isExpression": true,
767
+ "nulls": "last"
768
+ },
769
+ {
770
+ "expression": "\"id\" desc",
771
+ "asc": true,
772
+ "isExpression": true,
773
+ "nulls": "last"
774
+ }
775
+ ],
776
+ "isUnique": false,
777
+ "concurrently": false,
778
+ "method": "btree",
779
+ "with": {}
780
+ },
781
+ "auth_users_name_trgm_index": {
782
+ "name": "auth_users_name_trgm_index",
783
+ "columns": [
784
+ {
785
+ "expression": "name",
786
+ "isExpression": false,
787
+ "asc": true,
788
+ "nulls": "last",
789
+ "opclass": "gin_trgm_ops"
790
+ }
791
+ ],
792
+ "isUnique": false,
793
+ "concurrently": false,
794
+ "method": "gin",
795
+ "with": {}
796
+ },
797
+ "auth_users_email_trgm_index": {
798
+ "name": "auth_users_email_trgm_index",
799
+ "columns": [
800
+ {
801
+ "expression": "email",
802
+ "isExpression": false,
803
+ "asc": true,
804
+ "nulls": "last",
805
+ "opclass": "gin_trgm_ops"
806
+ }
807
+ ],
808
+ "isUnique": false,
809
+ "concurrently": false,
810
+ "method": "gin",
811
+ "with": {}
812
+ }
813
+ },
814
+ "foreignKeys": {},
815
+ "compositePrimaryKeys": {},
816
+ "uniqueConstraints": {},
817
+ "policies": {},
818
+ "checkConstraints": {},
819
+ "isRLSEnabled": false
820
+ }
821
+ },
822
+ "enums": {
823
+ "public.auth_admin_role": {
824
+ "name": "auth_admin_role",
825
+ "schema": "public",
826
+ "values": ["admin-observer", "admin-operator", "admin-owner"]
827
+ },
828
+ "public.auth_user_status": {
829
+ "name": "auth_user_status",
830
+ "schema": "public",
831
+ "values": ["active", "suspended", "deleted"]
832
+ }
833
+ },
834
+ "schemas": {},
835
+ "sequences": {},
836
+ "roles": {},
837
+ "policies": {},
838
+ "views": {},
839
+ "_meta": {
840
+ "columns": {},
841
+ "schemas": {},
842
+ "tables": {}
843
+ }
844
+ }