@spfn/auth 0.2.0-beta.9 → 0.2.0-beta.91

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