@yielded/auth 0.1.0-beta.4 → 0.1.0-beta.5

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 (63) hide show
  1. package/dist/DrizzleD1.d.mts +49 -0
  2. package/dist/DrizzleLibsql.d.mts +59 -10
  3. package/dist/DrizzleMysql2.d.mts +53 -4
  4. package/dist/DrizzlePglite.d.mts +53 -4
  5. package/dist/DrizzlePostgres.d.mts +51 -2
  6. package/dist/DrizzleSqliteBun.d.mts +53 -4
  7. package/dist/DrizzleSqliteDo.d.mts +59 -10
  8. package/dist/DrizzleSqliteNode.d.mts +53 -4
  9. package/dist/DrizzleSqliteWasm.d.mts +51 -2
  10. package/dist/GitHub.d.mts +2 -1
  11. package/dist/GitHub.mjs +2 -1
  12. package/dist/OpenIdClient.d.mts +2 -1
  13. package/dist/OpenIdClient.mjs +2 -1
  14. package/dist/drizzle/d1-oauth.d.mts +2 -2
  15. package/dist/drizzle/oauth-connected-state.d.mts +1 -1
  16. package/dist/drizzle/oauth-registration.d.mts +1 -1
  17. package/dist/drizzle/oauth-registration.mjs +3 -2
  18. package/dist/drizzle/oauth-registration.mjs.map +1 -1
  19. package/dist/oauth/OAuthConnectedRevocations.d.mts +10 -0
  20. package/dist/oauth/OAuthRegistrationIntents.d.mts +9 -0
  21. package/dist/oauth/accountsModels.d.mts +5 -0
  22. package/dist/oauth/connected.d.mts +22 -0
  23. package/dist/oauth/connectedModels.d.mts +115 -0
  24. package/dist/oauth/definition.d.mts +111 -3
  25. package/dist/oauth/github/identity.mjs +11 -9
  26. package/dist/oauth/github/identity.mjs.map +1 -1
  27. package/dist/oauth/github/profile.d.mts +61 -0
  28. package/dist/oauth/github/profile.mjs +72 -0
  29. package/dist/oauth/github/profile.mjs.map +1 -0
  30. package/dist/oauth/openid-client/connected/protocol.mjs +3 -0
  31. package/dist/oauth/openid-client/connected/protocol.mjs.map +1 -1
  32. package/dist/oauth/openid-client/profile.d.mts +39 -0
  33. package/dist/oauth/openid-client/profile.mjs +58 -0
  34. package/dist/oauth/openid-client/profile.mjs.map +1 -0
  35. package/dist/oauth/openid-client/protocol.mjs +3 -0
  36. package/dist/oauth/openid-client/protocol.mjs.map +1 -1
  37. package/dist/oauth/registrationModels.d.mts +22 -0
  38. package/dist/oauth/registrationModels.mjs +4 -1
  39. package/dist/oauth/registrationModels.mjs.map +1 -1
  40. package/dist/oauth/registrationSecrets.mjs +1 -0
  41. package/dist/oauth/registrationSecrets.mjs.map +1 -1
  42. package/dist/oauth/signInModels.d.mts +18 -0
  43. package/dist/oauth/signInModels.mjs +11 -1
  44. package/dist/oauth/signInModels.mjs.map +1 -1
  45. package/dist/oauth/signInModule.d.mts +43 -4
  46. package/dist/oauth/signInModule.mjs +1 -1
  47. package/dist/oauth/signInModule.mjs.map +1 -1
  48. package/dist/oauth/signInSnapshot.mjs +1 -1
  49. package/dist/oauth/signInSnapshot.mjs.map +1 -1
  50. package/package.json +1 -1
  51. package/src/GitHub.ts +1 -0
  52. package/src/OpenIdClient.ts +2 -0
  53. package/src/drizzle/oauth-registration.ts +4 -0
  54. package/src/oauth/github/identity.ts +11 -7
  55. package/src/oauth/github/profile.ts +64 -0
  56. package/src/oauth/openid-client/connected/protocol.ts +4 -0
  57. package/src/oauth/openid-client/profile.ts +68 -0
  58. package/src/oauth/openid-client/protocol.ts +4 -0
  59. package/src/oauth/registrationModels.ts +4 -0
  60. package/src/oauth/registrationSecrets.ts +1 -0
  61. package/src/oauth/signInModels.ts +18 -0
  62. package/src/oauth/signInModule.ts +4 -0
  63. package/src/oauth/signInSnapshot.ts +2 -1
@@ -781,8 +781,6 @@ declare const makeOAuthAccountsServices: <S extends AnySQLiteTable<{
781
781
  readonly _tag: "Rejected";
782
782
  } | {
783
783
  readonly _tag: "Conflict";
784
- } | {
785
- readonly _tag: "LastSignInMethod";
786
784
  } | {
787
785
  readonly _tag: "Unlinked";
788
786
  readonly result: {
@@ -796,6 +794,8 @@ declare const makeOAuthAccountsServices: <S extends AnySQLiteTable<{
796
794
  };
797
795
  };
798
796
  readonly replayed: boolean;
797
+ } | {
798
+ readonly _tag: "LastSignInMethod";
799
799
  }, A>) => import("effect/Effect").Effect<PreparedCommit<A>, OAuthUnavailable>;
800
800
  readonly cleanup: <A>(input: OAuthCleanupInput, prepare: PrepareOAuthCommit<{
801
801
  readonly terminalized: number;
@@ -1070,6 +1070,8 @@ declare const makeOAuthAccountsServices: <S extends AnySQLiteTable<{
1070
1070
  readonly flow: OAuthConnectedPendingFlow;
1071
1071
  readonly authorization: OAuthConnectedActionAuthorization;
1072
1072
  }, prepare: PrepareOAuthCommit<{
1073
+ readonly _tag: "Rejected";
1074
+ } | {
1073
1075
  readonly _tag: "Issued";
1074
1076
  readonly flow: {
1075
1077
  readonly context: {
@@ -1161,8 +1163,6 @@ declare const makeOAuthAccountsServices: <S extends AnySQLiteTable<{
1161
1163
  };
1162
1164
  readonly retentionUntilMillis: number;
1163
1165
  };
1164
- } | {
1165
- readonly _tag: "Rejected";
1166
1166
  }, A>) => import("effect/Effect").Effect<PreparedCommit<A>, OAuthUnavailable, never>;
1167
1167
  readonly preflight: (input: OAuthConnectedAccess) => import("effect/Effect").Effect<OAuthConnectedPendingFlow | undefined, OAuthUnavailable>;
1168
1168
  readonly claim: <A>(input: {
@@ -1353,6 +1353,13 @@ declare const makeOAuthAccountsServices: <S extends AnySQLiteTable<{
1353
1353
  readonly profile?: {
1354
1354
  readonly displayName?: string | undefined;
1355
1355
  readonly handle?: string | undefined;
1356
+ readonly avatarUrl?: string | undefined;
1357
+ readonly profileUrl?: string | undefined;
1358
+ readonly email?: string | undefined;
1359
+ readonly emailVerified?: boolean | undefined;
1360
+ readonly providerData?: {
1361
+ readonly [x: string]: import("effect/Schema").Json;
1362
+ } | undefined;
1356
1363
  } | undefined;
1357
1364
  };
1358
1365
  };
@@ -1383,6 +1390,13 @@ declare const makeOAuthAccountsServices: <S extends AnySQLiteTable<{
1383
1390
  readonly profile?: {
1384
1391
  readonly displayName?: string | undefined;
1385
1392
  readonly handle?: string | undefined;
1393
+ readonly avatarUrl?: string | undefined;
1394
+ readonly profileUrl?: string | undefined;
1395
+ readonly email?: string | undefined;
1396
+ readonly emailVerified?: boolean | undefined;
1397
+ readonly providerData?: {
1398
+ readonly [x: string]: import("effect/Schema").Json;
1399
+ } | undefined;
1386
1400
  } | undefined;
1387
1401
  readonly remoteRevocation: "Confirmed" | "Pending" | "Unknown" | "Unsupported";
1388
1402
  }[];
@@ -1449,6 +1463,13 @@ declare const makeOAuthAccountsServices: <S extends AnySQLiteTable<{
1449
1463
  readonly profile?: {
1450
1464
  readonly displayName?: string | undefined;
1451
1465
  readonly handle?: string | undefined;
1466
+ readonly avatarUrl?: string | undefined;
1467
+ readonly profileUrl?: string | undefined;
1468
+ readonly email?: string | undefined;
1469
+ readonly emailVerified?: boolean | undefined;
1470
+ readonly providerData?: {
1471
+ readonly [x: string]: import("effect/Schema").Json;
1472
+ } | undefined;
1452
1473
  } | undefined;
1453
1474
  };
1454
1475
  };
@@ -1554,6 +1575,13 @@ declare const makeOAuthAccountsServices: <S extends AnySQLiteTable<{
1554
1575
  readonly profile?: {
1555
1576
  readonly displayName?: string | undefined;
1556
1577
  readonly handle?: string | undefined;
1578
+ readonly avatarUrl?: string | undefined;
1579
+ readonly profileUrl?: string | undefined;
1580
+ readonly email?: string | undefined;
1581
+ readonly emailVerified?: boolean | undefined;
1582
+ readonly providerData?: {
1583
+ readonly [x: string]: import("effect/Schema").Json;
1584
+ } | undefined;
1557
1585
  } | undefined;
1558
1586
  };
1559
1587
  };
@@ -1631,6 +1659,13 @@ declare const makeOAuthAccountsServices: <S extends AnySQLiteTable<{
1631
1659
  readonly profile?: {
1632
1660
  readonly displayName?: string | undefined;
1633
1661
  readonly handle?: string | undefined;
1662
+ readonly avatarUrl?: string | undefined;
1663
+ readonly profileUrl?: string | undefined;
1664
+ readonly email?: string | undefined;
1665
+ readonly emailVerified?: boolean | undefined;
1666
+ readonly providerData?: {
1667
+ readonly [x: string]: import("effect/Schema").Json;
1668
+ } | undefined;
1634
1669
  } | undefined;
1635
1670
  };
1636
1671
  };
@@ -1706,6 +1741,13 @@ declare const makeOAuthAccountsServices: <S extends AnySQLiteTable<{
1706
1741
  readonly profile?: {
1707
1742
  readonly displayName?: string | undefined;
1708
1743
  readonly handle?: string | undefined;
1744
+ readonly avatarUrl?: string | undefined;
1745
+ readonly profileUrl?: string | undefined;
1746
+ readonly email?: string | undefined;
1747
+ readonly emailVerified?: boolean | undefined;
1748
+ readonly providerData?: {
1749
+ readonly [x: string]: import("effect/Schema").Json;
1750
+ } | undefined;
1709
1751
  } | undefined;
1710
1752
  };
1711
1753
  };
@@ -1817,6 +1859,13 @@ declare const makeOAuthAccountsServices: <S extends AnySQLiteTable<{
1817
1859
  readonly profile?: {
1818
1860
  readonly displayName?: string | undefined;
1819
1861
  readonly handle?: string | undefined;
1862
+ readonly avatarUrl?: string | undefined;
1863
+ readonly profileUrl?: string | undefined;
1864
+ readonly email?: string | undefined;
1865
+ readonly emailVerified?: boolean | undefined;
1866
+ readonly providerData?: {
1867
+ readonly [x: string]: import("effect/Schema").Json;
1868
+ } | undefined;
1820
1869
  } | undefined;
1821
1870
  };
1822
1871
  };
@@ -756,11 +756,11 @@ declare const makeOAuthAccountsServices: <S extends AnySQLiteTable<{
756
756
  }, prepare: PrepareOAuthCommit<{
757
757
  readonly _tag: "Rejected";
758
758
  } | {
759
- readonly _tag: "Conflict";
759
+ readonly _tag: "Ambiguous";
760
760
  } | {
761
761
  readonly _tag: "Cancelled";
762
762
  } | {
763
- readonly _tag: "Ambiguous";
763
+ readonly _tag: "Conflict";
764
764
  } | {
765
765
  readonly _tag: "Linked";
766
766
  readonly credential: {
@@ -837,8 +837,6 @@ declare const makeOAuthAccountsServices: <S extends AnySQLiteTable<{
837
837
  readonly _tag: "Rejected";
838
838
  } | {
839
839
  readonly _tag: "Conflict";
840
- } | {
841
- readonly _tag: "LastSignInMethod";
842
840
  } | {
843
841
  readonly _tag: "Unlinked";
844
842
  readonly result: {
@@ -852,6 +850,8 @@ declare const makeOAuthAccountsServices: <S extends AnySQLiteTable<{
852
850
  };
853
851
  };
854
852
  readonly replayed: boolean;
853
+ } | {
854
+ readonly _tag: "LastSignInMethod";
855
855
  }, A>) => Effect.Effect<PreparedCommit<A>, OAuthUnavailable>;
856
856
  readonly cleanup: <A>(input: OAuthCleanupInput, prepare: PrepareOAuthCommit<{
857
857
  readonly terminalized: number;
@@ -1126,6 +1126,8 @@ declare const makeOAuthAccountsServices: <S extends AnySQLiteTable<{
1126
1126
  readonly flow: OAuthConnectedPendingFlow;
1127
1127
  readonly authorization: OAuthConnectedActionAuthorization;
1128
1128
  }, prepare: PrepareOAuthCommit<{
1129
+ readonly _tag: "Rejected";
1130
+ } | {
1129
1131
  readonly _tag: "Issued";
1130
1132
  readonly flow: {
1131
1133
  readonly context: {
@@ -1217,8 +1219,6 @@ declare const makeOAuthAccountsServices: <S extends AnySQLiteTable<{
1217
1219
  };
1218
1220
  readonly retentionUntilMillis: number;
1219
1221
  };
1220
- } | {
1221
- readonly _tag: "Rejected";
1222
1222
  }, A>) => Effect.Effect<PreparedCommit<A>, OAuthUnavailable, never>;
1223
1223
  readonly preflight: (input: OAuthConnectedAccess) => Effect.Effect<OAuthConnectedPendingFlow | undefined, OAuthUnavailable>;
1224
1224
  readonly claim: <A>(input: {
@@ -1336,14 +1336,14 @@ declare const makeOAuthAccountsServices: <S extends AnySQLiteTable<{
1336
1336
  };
1337
1337
  }) => Effect.Effect<{
1338
1338
  readonly _tag: "Rejected";
1339
+ } | {
1340
+ readonly _tag: "Conflict";
1339
1341
  } | {
1340
1342
  readonly _tag: "Target";
1341
1343
  readonly cohortGeneration: string & import("effect/Brand").Brand<"effect-auth/SecurityRevision">;
1342
1344
  } | {
1343
1345
  readonly _tag: "Quarantine";
1344
1346
  readonly cohortGeneration: string & import("effect/Brand").Brand<"effect-auth/SecurityRevision">;
1345
- } | {
1346
- readonly _tag: "Conflict";
1347
1347
  }, OAuthUnavailable>;
1348
1348
  readonly settle: <A>(input: {
1349
1349
  readonly claim: OAuthConnectedClaim;
@@ -1353,11 +1353,11 @@ declare const makeOAuthAccountsServices: <S extends AnySQLiteTable<{
1353
1353
  }, prepare: PrepareOAuthCommit<{
1354
1354
  readonly _tag: "Rejected";
1355
1355
  } | {
1356
- readonly _tag: "Conflict";
1356
+ readonly _tag: "Ambiguous";
1357
1357
  } | {
1358
1358
  readonly _tag: "Cancelled";
1359
1359
  } | {
1360
- readonly _tag: "Ambiguous";
1360
+ readonly _tag: "Conflict";
1361
1361
  } | {
1362
1362
  readonly _tag: "Connected";
1363
1363
  readonly grant: {
@@ -1409,6 +1409,13 @@ declare const makeOAuthAccountsServices: <S extends AnySQLiteTable<{
1409
1409
  readonly profile?: {
1410
1410
  readonly displayName?: string | undefined;
1411
1411
  readonly handle?: string | undefined;
1412
+ readonly avatarUrl?: string | undefined;
1413
+ readonly profileUrl?: string | undefined;
1414
+ readonly email?: string | undefined;
1415
+ readonly emailVerified?: boolean | undefined;
1416
+ readonly providerData?: {
1417
+ readonly [x: string]: import("effect/Schema").Json;
1418
+ } | undefined;
1412
1419
  } | undefined;
1413
1420
  };
1414
1421
  };
@@ -1439,6 +1446,13 @@ declare const makeOAuthAccountsServices: <S extends AnySQLiteTable<{
1439
1446
  readonly profile?: {
1440
1447
  readonly displayName?: string | undefined;
1441
1448
  readonly handle?: string | undefined;
1449
+ readonly avatarUrl?: string | undefined;
1450
+ readonly profileUrl?: string | undefined;
1451
+ readonly email?: string | undefined;
1452
+ readonly emailVerified?: boolean | undefined;
1453
+ readonly providerData?: {
1454
+ readonly [x: string]: import("effect/Schema").Json;
1455
+ } | undefined;
1442
1456
  } | undefined;
1443
1457
  readonly remoteRevocation: "Confirmed" | "Pending" | "Unknown" | "Unsupported";
1444
1458
  }[];
@@ -1505,6 +1519,13 @@ declare const makeOAuthAccountsServices: <S extends AnySQLiteTable<{
1505
1519
  readonly profile?: {
1506
1520
  readonly displayName?: string | undefined;
1507
1521
  readonly handle?: string | undefined;
1522
+ readonly avatarUrl?: string | undefined;
1523
+ readonly profileUrl?: string | undefined;
1524
+ readonly email?: string | undefined;
1525
+ readonly emailVerified?: boolean | undefined;
1526
+ readonly providerData?: {
1527
+ readonly [x: string]: import("effect/Schema").Json;
1528
+ } | undefined;
1508
1529
  } | undefined;
1509
1530
  };
1510
1531
  };
@@ -1610,6 +1631,13 @@ declare const makeOAuthAccountsServices: <S extends AnySQLiteTable<{
1610
1631
  readonly profile?: {
1611
1632
  readonly displayName?: string | undefined;
1612
1633
  readonly handle?: string | undefined;
1634
+ readonly avatarUrl?: string | undefined;
1635
+ readonly profileUrl?: string | undefined;
1636
+ readonly email?: string | undefined;
1637
+ readonly emailVerified?: boolean | undefined;
1638
+ readonly providerData?: {
1639
+ readonly [x: string]: import("effect/Schema").Json;
1640
+ } | undefined;
1613
1641
  } | undefined;
1614
1642
  };
1615
1643
  };
@@ -1687,6 +1715,13 @@ declare const makeOAuthAccountsServices: <S extends AnySQLiteTable<{
1687
1715
  readonly profile?: {
1688
1716
  readonly displayName?: string | undefined;
1689
1717
  readonly handle?: string | undefined;
1718
+ readonly avatarUrl?: string | undefined;
1719
+ readonly profileUrl?: string | undefined;
1720
+ readonly email?: string | undefined;
1721
+ readonly emailVerified?: boolean | undefined;
1722
+ readonly providerData?: {
1723
+ readonly [x: string]: import("effect/Schema").Json;
1724
+ } | undefined;
1690
1725
  } | undefined;
1691
1726
  };
1692
1727
  };
@@ -1762,6 +1797,13 @@ declare const makeOAuthAccountsServices: <S extends AnySQLiteTable<{
1762
1797
  readonly profile?: {
1763
1798
  readonly displayName?: string | undefined;
1764
1799
  readonly handle?: string | undefined;
1800
+ readonly avatarUrl?: string | undefined;
1801
+ readonly profileUrl?: string | undefined;
1802
+ readonly email?: string | undefined;
1803
+ readonly emailVerified?: boolean | undefined;
1804
+ readonly providerData?: {
1805
+ readonly [x: string]: import("effect/Schema").Json;
1806
+ } | undefined;
1765
1807
  } | undefined;
1766
1808
  };
1767
1809
  };
@@ -1873,6 +1915,13 @@ declare const makeOAuthAccountsServices: <S extends AnySQLiteTable<{
1873
1915
  readonly profile?: {
1874
1916
  readonly displayName?: string | undefined;
1875
1917
  readonly handle?: string | undefined;
1918
+ readonly avatarUrl?: string | undefined;
1919
+ readonly profileUrl?: string | undefined;
1920
+ readonly email?: string | undefined;
1921
+ readonly emailVerified?: boolean | undefined;
1922
+ readonly providerData?: {
1923
+ readonly [x: string]: import("effect/Schema").Json;
1924
+ } | undefined;
1876
1925
  } | undefined;
1877
1926
  };
1878
1927
  };
@@ -699,12 +699,12 @@ declare const makeOAuthAccountsServices: <S extends AnySQLiteTable<{
699
699
  readonly nowMillis: number;
700
700
  }, prepare: PrepareOAuthCommit<{
701
701
  readonly _tag: "Rejected";
702
- } | {
703
- readonly _tag: "Ambiguous";
704
702
  } | {
705
703
  readonly _tag: "Conflict";
706
704
  } | {
707
705
  readonly _tag: "Cancelled";
706
+ } | {
707
+ readonly _tag: "Ambiguous";
708
708
  } | {
709
709
  readonly _tag: "Linked";
710
710
  readonly credential: {
@@ -1296,12 +1296,12 @@ declare const makeOAuthAccountsServices: <S extends AnySQLiteTable<{
1296
1296
  readonly nowMillis: number;
1297
1297
  }, prepare: PrepareOAuthCommit<{
1298
1298
  readonly _tag: "Rejected";
1299
- } | {
1300
- readonly _tag: "Ambiguous";
1301
1299
  } | {
1302
1300
  readonly _tag: "Conflict";
1303
1301
  } | {
1304
1302
  readonly _tag: "Cancelled";
1303
+ } | {
1304
+ readonly _tag: "Ambiguous";
1305
1305
  } | {
1306
1306
  readonly _tag: "Connected";
1307
1307
  readonly grant: {
@@ -1353,6 +1353,13 @@ declare const makeOAuthAccountsServices: <S extends AnySQLiteTable<{
1353
1353
  readonly profile?: {
1354
1354
  readonly displayName?: string | undefined;
1355
1355
  readonly handle?: string | undefined;
1356
+ readonly avatarUrl?: string | undefined;
1357
+ readonly profileUrl?: string | undefined;
1358
+ readonly email?: string | undefined;
1359
+ readonly emailVerified?: boolean | undefined;
1360
+ readonly providerData?: {
1361
+ readonly [x: string]: import("effect/Schema").Json;
1362
+ } | undefined;
1356
1363
  } | undefined;
1357
1364
  };
1358
1365
  };
@@ -1383,6 +1390,13 @@ declare const makeOAuthAccountsServices: <S extends AnySQLiteTable<{
1383
1390
  readonly profile?: {
1384
1391
  readonly displayName?: string | undefined;
1385
1392
  readonly handle?: string | undefined;
1393
+ readonly avatarUrl?: string | undefined;
1394
+ readonly profileUrl?: string | undefined;
1395
+ readonly email?: string | undefined;
1396
+ readonly emailVerified?: boolean | undefined;
1397
+ readonly providerData?: {
1398
+ readonly [x: string]: import("effect/Schema").Json;
1399
+ } | undefined;
1386
1400
  } | undefined;
1387
1401
  readonly remoteRevocation: "Confirmed" | "Pending" | "Unknown" | "Unsupported";
1388
1402
  }[];
@@ -1449,6 +1463,13 @@ declare const makeOAuthAccountsServices: <S extends AnySQLiteTable<{
1449
1463
  readonly profile?: {
1450
1464
  readonly displayName?: string | undefined;
1451
1465
  readonly handle?: string | undefined;
1466
+ readonly avatarUrl?: string | undefined;
1467
+ readonly profileUrl?: string | undefined;
1468
+ readonly email?: string | undefined;
1469
+ readonly emailVerified?: boolean | undefined;
1470
+ readonly providerData?: {
1471
+ readonly [x: string]: import("effect/Schema").Json;
1472
+ } | undefined;
1452
1473
  } | undefined;
1453
1474
  };
1454
1475
  };
@@ -1554,6 +1575,13 @@ declare const makeOAuthAccountsServices: <S extends AnySQLiteTable<{
1554
1575
  readonly profile?: {
1555
1576
  readonly displayName?: string | undefined;
1556
1577
  readonly handle?: string | undefined;
1578
+ readonly avatarUrl?: string | undefined;
1579
+ readonly profileUrl?: string | undefined;
1580
+ readonly email?: string | undefined;
1581
+ readonly emailVerified?: boolean | undefined;
1582
+ readonly providerData?: {
1583
+ readonly [x: string]: import("effect/Schema").Json;
1584
+ } | undefined;
1557
1585
  } | undefined;
1558
1586
  };
1559
1587
  };
@@ -1631,6 +1659,13 @@ declare const makeOAuthAccountsServices: <S extends AnySQLiteTable<{
1631
1659
  readonly profile?: {
1632
1660
  readonly displayName?: string | undefined;
1633
1661
  readonly handle?: string | undefined;
1662
+ readonly avatarUrl?: string | undefined;
1663
+ readonly profileUrl?: string | undefined;
1664
+ readonly email?: string | undefined;
1665
+ readonly emailVerified?: boolean | undefined;
1666
+ readonly providerData?: {
1667
+ readonly [x: string]: import("effect/Schema").Json;
1668
+ } | undefined;
1634
1669
  } | undefined;
1635
1670
  };
1636
1671
  };
@@ -1706,6 +1741,13 @@ declare const makeOAuthAccountsServices: <S extends AnySQLiteTable<{
1706
1741
  readonly profile?: {
1707
1742
  readonly displayName?: string | undefined;
1708
1743
  readonly handle?: string | undefined;
1744
+ readonly avatarUrl?: string | undefined;
1745
+ readonly profileUrl?: string | undefined;
1746
+ readonly email?: string | undefined;
1747
+ readonly emailVerified?: boolean | undefined;
1748
+ readonly providerData?: {
1749
+ readonly [x: string]: import("effect/Schema").Json;
1750
+ } | undefined;
1709
1751
  } | undefined;
1710
1752
  };
1711
1753
  };
@@ -1817,6 +1859,13 @@ declare const makeOAuthAccountsServices: <S extends AnySQLiteTable<{
1817
1859
  readonly profile?: {
1818
1860
  readonly displayName?: string | undefined;
1819
1861
  readonly handle?: string | undefined;
1862
+ readonly avatarUrl?: string | undefined;
1863
+ readonly profileUrl?: string | undefined;
1864
+ readonly email?: string | undefined;
1865
+ readonly emailVerified?: boolean | undefined;
1866
+ readonly providerData?: {
1867
+ readonly [x: string]: import("effect/Schema").Json;
1868
+ } | undefined;
1820
1869
  } | undefined;
1821
1870
  };
1822
1871
  };
@@ -781,6 +781,8 @@ declare const makeOAuthAccountsServices: <S extends AnySQLiteTable<{
781
781
  readonly _tag: "Rejected";
782
782
  } | {
783
783
  readonly _tag: "Conflict";
784
+ } | {
785
+ readonly _tag: "LastSignInMethod";
784
786
  } | {
785
787
  readonly _tag: "Unlinked";
786
788
  readonly result: {
@@ -794,8 +796,6 @@ declare const makeOAuthAccountsServices: <S extends AnySQLiteTable<{
794
796
  };
795
797
  };
796
798
  readonly replayed: boolean;
797
- } | {
798
- readonly _tag: "LastSignInMethod";
799
799
  }, A>) => import("effect/Effect").Effect<PreparedCommit<A>, OAuthUnavailable>;
800
800
  readonly cleanup: <A>(input: OAuthCleanupInput, prepare: PrepareOAuthCommit<{
801
801
  readonly terminalized: number;
@@ -1353,6 +1353,13 @@ declare const makeOAuthAccountsServices: <S extends AnySQLiteTable<{
1353
1353
  readonly profile?: {
1354
1354
  readonly displayName?: string | undefined;
1355
1355
  readonly handle?: string | undefined;
1356
+ readonly avatarUrl?: string | undefined;
1357
+ readonly profileUrl?: string | undefined;
1358
+ readonly email?: string | undefined;
1359
+ readonly emailVerified?: boolean | undefined;
1360
+ readonly providerData?: {
1361
+ readonly [x: string]: import("effect/Schema").Json;
1362
+ } | undefined;
1356
1363
  } | undefined;
1357
1364
  };
1358
1365
  };
@@ -1383,6 +1390,13 @@ declare const makeOAuthAccountsServices: <S extends AnySQLiteTable<{
1383
1390
  readonly profile?: {
1384
1391
  readonly displayName?: string | undefined;
1385
1392
  readonly handle?: string | undefined;
1393
+ readonly avatarUrl?: string | undefined;
1394
+ readonly profileUrl?: string | undefined;
1395
+ readonly email?: string | undefined;
1396
+ readonly emailVerified?: boolean | undefined;
1397
+ readonly providerData?: {
1398
+ readonly [x: string]: import("effect/Schema").Json;
1399
+ } | undefined;
1386
1400
  } | undefined;
1387
1401
  readonly remoteRevocation: "Confirmed" | "Pending" | "Unknown" | "Unsupported";
1388
1402
  }[];
@@ -1449,6 +1463,13 @@ declare const makeOAuthAccountsServices: <S extends AnySQLiteTable<{
1449
1463
  readonly profile?: {
1450
1464
  readonly displayName?: string | undefined;
1451
1465
  readonly handle?: string | undefined;
1466
+ readonly avatarUrl?: string | undefined;
1467
+ readonly profileUrl?: string | undefined;
1468
+ readonly email?: string | undefined;
1469
+ readonly emailVerified?: boolean | undefined;
1470
+ readonly providerData?: {
1471
+ readonly [x: string]: import("effect/Schema").Json;
1472
+ } | undefined;
1452
1473
  } | undefined;
1453
1474
  };
1454
1475
  };
@@ -1554,6 +1575,13 @@ declare const makeOAuthAccountsServices: <S extends AnySQLiteTable<{
1554
1575
  readonly profile?: {
1555
1576
  readonly displayName?: string | undefined;
1556
1577
  readonly handle?: string | undefined;
1578
+ readonly avatarUrl?: string | undefined;
1579
+ readonly profileUrl?: string | undefined;
1580
+ readonly email?: string | undefined;
1581
+ readonly emailVerified?: boolean | undefined;
1582
+ readonly providerData?: {
1583
+ readonly [x: string]: import("effect/Schema").Json;
1584
+ } | undefined;
1557
1585
  } | undefined;
1558
1586
  };
1559
1587
  };
@@ -1631,6 +1659,13 @@ declare const makeOAuthAccountsServices: <S extends AnySQLiteTable<{
1631
1659
  readonly profile?: {
1632
1660
  readonly displayName?: string | undefined;
1633
1661
  readonly handle?: string | undefined;
1662
+ readonly avatarUrl?: string | undefined;
1663
+ readonly profileUrl?: string | undefined;
1664
+ readonly email?: string | undefined;
1665
+ readonly emailVerified?: boolean | undefined;
1666
+ readonly providerData?: {
1667
+ readonly [x: string]: import("effect/Schema").Json;
1668
+ } | undefined;
1634
1669
  } | undefined;
1635
1670
  };
1636
1671
  };
@@ -1706,6 +1741,13 @@ declare const makeOAuthAccountsServices: <S extends AnySQLiteTable<{
1706
1741
  readonly profile?: {
1707
1742
  readonly displayName?: string | undefined;
1708
1743
  readonly handle?: string | undefined;
1744
+ readonly avatarUrl?: string | undefined;
1745
+ readonly profileUrl?: string | undefined;
1746
+ readonly email?: string | undefined;
1747
+ readonly emailVerified?: boolean | undefined;
1748
+ readonly providerData?: {
1749
+ readonly [x: string]: import("effect/Schema").Json;
1750
+ } | undefined;
1709
1751
  } | undefined;
1710
1752
  };
1711
1753
  };
@@ -1817,6 +1859,13 @@ declare const makeOAuthAccountsServices: <S extends AnySQLiteTable<{
1817
1859
  readonly profile?: {
1818
1860
  readonly displayName?: string | undefined;
1819
1861
  readonly handle?: string | undefined;
1862
+ readonly avatarUrl?: string | undefined;
1863
+ readonly profileUrl?: string | undefined;
1864
+ readonly email?: string | undefined;
1865
+ readonly emailVerified?: boolean | undefined;
1866
+ readonly providerData?: {
1867
+ readonly [x: string]: import("effect/Schema").Json;
1868
+ } | undefined;
1820
1869
  } | undefined;
1821
1870
  };
1822
1871
  };
package/dist/GitHub.d.mts CHANGED
@@ -2,4 +2,5 @@ import { OpenIdClientConfigurationError } from "./oauth/openid-client/models.mjs
2
2
  import { GitHubOAuthAppConnectedProtocolOptions, GitHubOAuthAppGeneration, GitHubOAuthAppProtocolOptions } from "./oauth/github/models.mjs";
3
3
  import { gitHubOAuthAppConnectedProtocolLayer, gitHubOAuthAppProtocolLayer, gitHubOAuthAppProvider, makeGitHubOAuthAppConnectedProtocol, makeGitHubOAuthAppProtocol } from "./oauth/github/protocol.mjs";
4
4
  import { gitHubOAuthAppProviderKey } from "./oauth/github/identity.mjs";
5
- export { type GitHubOAuthAppConnectedProtocolOptions, type GitHubOAuthAppGeneration, type GitHubOAuthAppProtocolOptions, OpenIdClientConfigurationError, gitHubOAuthAppConnectedProtocolLayer, gitHubOAuthAppProtocolLayer, gitHubOAuthAppProvider, gitHubOAuthAppProviderKey, makeGitHubOAuthAppConnectedProtocol, makeGitHubOAuthAppProtocol };
5
+ import { GitHubUserProfile } from "./oauth/github/profile.mjs";
6
+ export { type GitHubOAuthAppConnectedProtocolOptions, type GitHubOAuthAppGeneration, type GitHubOAuthAppProtocolOptions, GitHubUserProfile, OpenIdClientConfigurationError, gitHubOAuthAppConnectedProtocolLayer, gitHubOAuthAppProtocolLayer, gitHubOAuthAppProvider, gitHubOAuthAppProviderKey, makeGitHubOAuthAppConnectedProtocol, makeGitHubOAuthAppProtocol };
package/dist/GitHub.mjs CHANGED
@@ -1,4 +1,5 @@
1
1
  import { OpenIdClientConfigurationError } from "./oauth/openid-client/models.mjs";
2
+ import { GitHubUserProfile } from "./oauth/github/profile.mjs";
2
3
  import { gitHubOAuthAppProviderKey } from "./oauth/github/identity.mjs";
3
4
  import { gitHubOAuthAppConnectedProtocolLayer, gitHubOAuthAppProtocolLayer, gitHubOAuthAppProvider, makeGitHubOAuthAppConnectedProtocol, makeGitHubOAuthAppProtocol } from "./oauth/github/protocol.mjs";
4
- export { OpenIdClientConfigurationError, gitHubOAuthAppConnectedProtocolLayer, gitHubOAuthAppProtocolLayer, gitHubOAuthAppProvider, gitHubOAuthAppProviderKey, makeGitHubOAuthAppConnectedProtocol, makeGitHubOAuthAppProtocol };
5
+ export { GitHubUserProfile, OpenIdClientConfigurationError, gitHubOAuthAppConnectedProtocolLayer, gitHubOAuthAppProtocolLayer, gitHubOAuthAppProvider, gitHubOAuthAppProviderKey, makeGitHubOAuthAppConnectedProtocol, makeGitHubOAuthAppProtocol };
@@ -1,3 +1,4 @@
1
1
  import { OpenIdClientAuthentication, OpenIdClientConfigurationError, OpenIdClientOAuthProtocolOptions, OpenIdClientOAuthProvider, OpenIdClientOidcProvider, PlainOAuthIdentity } from "./oauth/openid-client/models.mjs";
2
2
  import { makeOpenIdClientOAuthProtocol, openIdClientOAuthProtocolLayer } from "./oauth/openid-client/protocol.mjs";
3
- export { type OpenIdClientAuthentication, OpenIdClientConfigurationError, type OpenIdClientOAuthProtocolOptions, type OpenIdClientOAuthProvider, type OpenIdClientOidcProvider, type PlainOAuthIdentity, makeOpenIdClientOAuthProtocol, openIdClientOAuthProtocolLayer };
3
+ import { OidcUserProfile } from "./oauth/openid-client/profile.mjs";
4
+ export { OidcUserProfile, type OpenIdClientAuthentication, OpenIdClientConfigurationError, type OpenIdClientOAuthProtocolOptions, type OpenIdClientOAuthProvider, type OpenIdClientOidcProvider, type PlainOAuthIdentity, makeOpenIdClientOAuthProtocol, openIdClientOAuthProtocolLayer };
@@ -1,3 +1,4 @@
1
1
  import { OpenIdClientConfigurationError } from "./oauth/openid-client/models.mjs";
2
+ import { OidcUserProfile } from "./oauth/openid-client/profile.mjs";
2
3
  import { makeOpenIdClientOAuthProtocol, openIdClientOAuthProtocolLayer } from "./oauth/openid-client/protocol.mjs";
3
- export { OpenIdClientConfigurationError, makeOpenIdClientOAuthProtocol, openIdClientOAuthProtocolLayer };
4
+ export { OidcUserProfile, OpenIdClientConfigurationError, makeOpenIdClientOAuthProtocol, openIdClientOAuthProtocolLayer };
@@ -229,8 +229,6 @@ declare const makeD1OAuthAccountsServices: <S extends SQLiteTable, O extends SQL
229
229
  readonly _tag: "Rejected";
230
230
  } | {
231
231
  readonly _tag: "Conflict";
232
- } | {
233
- readonly _tag: "LastSignInMethod";
234
232
  } | {
235
233
  readonly _tag: "Unlinked";
236
234
  readonly result: {
@@ -244,6 +242,8 @@ declare const makeD1OAuthAccountsServices: <S extends SQLiteTable, O extends SQL
244
242
  };
245
243
  };
246
244
  readonly replayed: boolean;
245
+ } | {
246
+ readonly _tag: "LastSignInMethod";
247
247
  }, A>) => Effect.Effect<PreparedCommit<A>, OAuthUnavailable>;
248
248
  readonly cleanup: <A>(input: OAuthCleanupInput, prepare: PrepareOAuthCommit<{
249
249
  readonly terminalized: number;
@@ -6,7 +6,7 @@ import "../OAuth.mjs";
6
6
  import "./transaction-owner.mjs";
7
7
  import "./oauth-owner.mjs";
8
8
  import "./oauth-flow.mjs";
9
- import { DateTime, Effect } from "effect";
9
+ import { DateTime, Effect, Schema } from "effect";
10
10
  import { SQL, Table } from "drizzle-orm";
11
11
  //#region src/drizzle/oauth-connected-state.d.ts
12
12
  type Mapping = OAuthConnectedMapping<any, any, any, any, any, any, any, any, any, any, any, any>;
@@ -5,4 +5,4 @@ import "./oauth-model.mjs";
5
5
  import "../OAuth.mjs";
6
6
  import "./transaction-owner.mjs";
7
7
  import "./oauth-owner.mjs";
8
- import { Effect } from "effect";
8
+ import { Effect, Schema } from "effect";
@@ -1,4 +1,4 @@
1
- import { OAuthCredentialSnapshot, OAuthSignInTransactionContext } from "../oauth/signInModels.mjs";
1
+ import { OAuthCredentialSnapshot, OAuthDisplayProfile, OAuthSignInTransactionContext } from "../oauth/signInModels.mjs";
2
2
  import { OAuthRegistrationAccess, OAuthRegistrationDecision, OAuthRegistrationFingerprint, OAuthRegistrationInspection, OAuthRegistrationIntent } from "../oauth/registrationModels.mjs";
3
3
  import { snapshotOAuthSync } from "../oauth/signInSnapshot.mjs";
4
4
  import { invariant, oauthIdentityKey, sameIdentity, storage } from "./oauth-state.mjs";
@@ -11,6 +11,7 @@ import { eq, sql } from "drizzle-orm";
11
11
  const intentStorage = storage(OAuthRegistrationIntent);
12
12
  const decisionStorage = storage(OAuthRegistrationDecision);
13
13
  const contextStorage = storage(OAuthSignInTransactionContext);
14
+ const profileStorage = storage(Schema.NullOr(OAuthDisplayProfile));
14
15
  const reservationStorage = storage(Schema.Struct({
15
16
  moduleId: Schema.String,
16
17
  reference: Schema.String,
@@ -107,7 +108,7 @@ const settleRegistrationIntent = (mapping, input) => Effect.flatMap(CurrentOAuth
107
108
  if (!found.owned && tuple?.row[mapping.ownership.tuple.state] === "Unowned" && input.intent !== void 0) {
108
109
  const intent = snapshotOAuthSync(OAuthRegistrationIntent, input.intent);
109
110
  const c = intent.context;
110
- invariant(sameIdentity(intent.identity, identity) && intent.claimId === input.claim.claimId && intent.claimedAtMillis === input.claim.claimedAtMillis && contextStorage.encode(c) === contextStorage.encode(context));
111
+ invariant(sameIdentity(intent.identity, identity) && profileStorage.encode(intent.profile ?? null) === profileStorage.encode(input.identity.profile ?? null) && intent.claimId === input.claim.claimId && intent.claimedAtMillis === input.claim.claimedAtMillis && contextStorage.encode(c) === contextStorage.encode(context));
111
112
  if (intent.issuedAtMillis >= intent.claimedAtMillis && intent.verifiedAtMillis <= intent.issuedAtMillis && intent.issuedAtMillis <= exact.now && exact.now < intent.expiresAtMillis && intent.expiresAtMillis <= c.requestBindingExpiresAtMillis && intent.retentionUntilMillis >= intent.expiresAtMillis && (yield* owner.check(mapping.eligibility.condition({ intent })))) {
112
113
  const i = mapping.intent, encode = mapping.signIn.clock.encodeInstant;
113
114
  const key = {