@spfn/auth 0.2.0-beta.87 → 0.2.0-beta.89

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