@nhost/nhost-js 4.4.0 → 4.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/dist/client-BL0edWHv.cjs +2 -0
  2. package/dist/client-BL0edWHv.cjs.map +1 -0
  3. package/dist/client-BOrTAJrs.js +1304 -0
  4. package/dist/client-BOrTAJrs.js.map +1 -0
  5. package/dist/{middlewareWithAdminSession-BeIk-9HO.js → middlewareWithAdminSession-CcuYKs5Y.js} +2 -2
  6. package/dist/{middlewareWithAdminSession-BeIk-9HO.js.map → middlewareWithAdminSession-CcuYKs5Y.js.map} +1 -1
  7. package/dist/middlewareWithAdminSession-j70iKbBX.cjs +2 -0
  8. package/dist/{middlewareWithAdminSession-DDApoLkL.cjs.map → middlewareWithAdminSession-j70iKbBX.cjs.map} +1 -1
  9. package/dist/nhost-js/auth.cjs +1 -1
  10. package/dist/nhost-js/auth.cjs.map +1 -1
  11. package/dist/nhost-js/auth.js +29 -970
  12. package/dist/nhost-js/auth.js.map +1 -1
  13. package/dist/nhost-js/fetch.cjs +1 -1
  14. package/dist/nhost-js/fetch.js +1 -1
  15. package/dist/nhost-js/storage.cjs.map +1 -1
  16. package/dist/nhost-js/storage.js.map +1 -1
  17. package/dist/nhost-js.cjs +1 -1
  18. package/dist/nhost-js.cjs.map +1 -1
  19. package/dist/nhost-js.js +2 -2
  20. package/dist/nhost-js.umd.js +1 -1
  21. package/dist/nhost-js.umd.js.map +1 -1
  22. package/dist/src/auth/client.d.ts +753 -8
  23. package/dist/src/auth/client.d.ts.map +1 -1
  24. package/dist/src/auth/client.js +391 -0
  25. package/dist/src/auth/client.js.map +1 -1
  26. package/dist/src/auth/index.d.ts +1 -0
  27. package/dist/src/auth/index.d.ts.map +1 -1
  28. package/dist/src/auth/index.js +1 -0
  29. package/dist/src/auth/index.js.map +1 -1
  30. package/dist/src/auth/pkce.d.ts +22 -0
  31. package/dist/src/auth/pkce.d.ts.map +1 -0
  32. package/dist/src/auth/pkce.js +40 -0
  33. package/dist/src/auth/pkce.js.map +1 -0
  34. package/dist/src/fetch/middlewareUpdateSessionFromResponse.d.ts.map +1 -1
  35. package/dist/src/fetch/middlewareUpdateSessionFromResponse.js +1 -0
  36. package/dist/src/fetch/middlewareUpdateSessionFromResponse.js.map +1 -1
  37. package/dist/src/storage/client.d.ts +4 -4
  38. package/dist/tsconfig.tsbuildinfo +1 -1
  39. package/package.json +3 -1
  40. package/dist/middlewareWithAdminSession-DDApoLkL.cjs +0 -2
@@ -840,7 +840,11 @@ export interface SignInPATRequest {
840
840
  @property email (`string`) - A valid email
841
841
  * Example - `"john.smith@nhost.io"`
842
842
  * Format - email
843
- @property options? (`SignUpOptions`) - */
843
+ @property options? (`SignUpOptions`) -
844
+ @property codeChallenge? (`string`) - PKCE code challenge (S256). When provided, the verification redirect will contain an authorization code instead of a refresh token.
845
+ * Pattern - ^[A-Za-z0-9_-]{43}$
846
+ * MinLength - 43
847
+ * MaxLength - 43*/
844
848
  export interface SignInPasswordlessEmailRequest {
845
849
  /**
846
850
  * A valid email
@@ -852,6 +856,13 @@ export interface SignInPasswordlessEmailRequest {
852
856
  *
853
857
  */
854
858
  options?: SignUpOptions;
859
+ /**
860
+ * PKCE code challenge (S256). When provided, the verification redirect will contain an authorization code instead of a refresh token.
861
+ * Pattern - ^[A-Za-z0-9_-]{43}$
862
+ * MinLength - 43
863
+ * MaxLength - 43
864
+ */
865
+ codeChallenge?: string;
855
866
  }
856
867
  /**
857
868
  *
@@ -953,7 +964,11 @@ export interface SignOutRequest {
953
964
  * Example - `"Str0ngPassw#ord-94|%"`
954
965
  * MinLength - 3
955
966
  * MaxLength - 50
956
- @property options? (`SignUpOptions`) - */
967
+ @property options? (`SignUpOptions`) -
968
+ @property codeChallenge? (`string`) - PKCE code challenge (S256). When provided and email verification is required, the verification redirect will contain an authorization code instead of a refresh token.
969
+ * Pattern - ^[A-Za-z0-9_-]{43}$
970
+ * MinLength - 43
971
+ * MaxLength - 43*/
957
972
  export interface SignUpEmailPasswordRequest {
958
973
  /**
959
974
  * Email address for the new user account
@@ -972,6 +987,13 @@ export interface SignUpEmailPasswordRequest {
972
987
  *
973
988
  */
974
989
  options?: SignUpOptions;
990
+ /**
991
+ * PKCE code challenge (S256). When provided and email verification is required, the verification redirect will contain an authorization code instead of a refresh token.
992
+ * Pattern - ^[A-Za-z0-9_-]{43}$
993
+ * MinLength - 43
994
+ * MaxLength - 43
995
+ */
996
+ codeChallenge?: string;
975
997
  }
976
998
  /**
977
999
  *
@@ -1051,7 +1073,11 @@ export interface SignUpWebauthnRequest {
1051
1073
  *
1052
1074
  @property credential (`CredentialCreationResponse`) -
1053
1075
  @property options? (`SignUpOptions`) -
1054
- @property nickname? (`string`) - Nickname for the security key*/
1076
+ @property nickname? (`string`) - Nickname for the security key
1077
+ @property codeChallenge? (`string`) - PKCE code challenge (S256). When provided and email verification is required, the verification redirect will contain an authorization code instead of a refresh token.
1078
+ * Pattern - ^[A-Za-z0-9_-]{43}$
1079
+ * MinLength - 43
1080
+ * MaxLength - 43*/
1055
1081
  export interface SignUpWebauthnVerifyRequest {
1056
1082
  /**
1057
1083
  *
@@ -1065,6 +1091,31 @@ export interface SignUpWebauthnVerifyRequest {
1065
1091
  * Nickname for the security key
1066
1092
  */
1067
1093
  nickname?: string;
1094
+ /**
1095
+ * PKCE code challenge (S256). When provided and email verification is required, the verification redirect will contain an authorization code instead of a refresh token.
1096
+ * Pattern - ^[A-Za-z0-9_-]{43}$
1097
+ * MinLength - 43
1098
+ * MaxLength - 43
1099
+ */
1100
+ codeChallenge?: string;
1101
+ }
1102
+ /**
1103
+ * Request to exchange an authorization code for a session using PKCE
1104
+ @property code (`string`) - The authorization code received from the redirect
1105
+ @property codeVerifier (`string`) - The original PKCE code verifier (43-128 characters)
1106
+ * MinLength - 43
1107
+ * MaxLength - 128*/
1108
+ export interface TokenExchangeRequest {
1109
+ /**
1110
+ * The authorization code received from the redirect
1111
+ */
1112
+ code: string;
1113
+ /**
1114
+ * The original PKCE code verifier (43-128 characters)
1115
+ * MinLength - 43
1116
+ * MaxLength - 128
1117
+ */
1118
+ codeVerifier: string;
1068
1119
  }
1069
1120
  /**
1070
1121
  * Response containing TOTP setup information for MFA
@@ -1213,7 +1264,11 @@ export type UserDeanonymizeRequestSignInMethod = 'email-password' | 'passwordles
1213
1264
  * MinLength - 3
1214
1265
  * MaxLength - 50
1215
1266
  @property connection? (`string`) - Deprecated, will be ignored
1216
- @property options? (`SignUpOptions`) - */
1267
+ @property options? (`SignUpOptions`) -
1268
+ @property codeChallenge? (`string`) - PKCE code challenge (S256). When provided, the verification redirect will contain an authorization code instead of a refresh token.
1269
+ * Pattern - ^[A-Za-z0-9_-]{43}$
1270
+ * MinLength - 43
1271
+ * MaxLength - 43*/
1217
1272
  export interface UserDeanonymizeRequest {
1218
1273
  /**
1219
1274
  * Which sign-in method to use
@@ -1240,13 +1295,24 @@ export interface UserDeanonymizeRequest {
1240
1295
  *
1241
1296
  */
1242
1297
  options?: SignUpOptions;
1298
+ /**
1299
+ * PKCE code challenge (S256). When provided, the verification redirect will contain an authorization code instead of a refresh token.
1300
+ * Pattern - ^[A-Za-z0-9_-]{43}$
1301
+ * MinLength - 43
1302
+ * MaxLength - 43
1303
+ */
1304
+ codeChallenge?: string;
1243
1305
  }
1244
1306
  /**
1245
1307
  *
1246
1308
  @property newEmail (`string`) - A valid email
1247
1309
  * Example - `"john.smith@nhost.io"`
1248
1310
  * Format - email
1249
- @property options? (`OptionsRedirectTo`) - */
1311
+ @property options? (`OptionsRedirectTo`) -
1312
+ @property codeChallenge? (`string`) - PKCE code challenge (S256). When provided, the verification redirect will contain an authorization code instead of a refresh token.
1313
+ * Pattern - ^[A-Za-z0-9_-]{43}$
1314
+ * MinLength - 43
1315
+ * MaxLength - 43*/
1250
1316
  export interface UserEmailChangeRequest {
1251
1317
  /**
1252
1318
  * A valid email
@@ -1258,13 +1324,24 @@ export interface UserEmailChangeRequest {
1258
1324
  *
1259
1325
  */
1260
1326
  options?: OptionsRedirectTo;
1327
+ /**
1328
+ * PKCE code challenge (S256). When provided, the verification redirect will contain an authorization code instead of a refresh token.
1329
+ * Pattern - ^[A-Za-z0-9_-]{43}$
1330
+ * MinLength - 43
1331
+ * MaxLength - 43
1332
+ */
1333
+ codeChallenge?: string;
1261
1334
  }
1262
1335
  /**
1263
1336
  *
1264
1337
  @property email (`string`) - A valid email
1265
1338
  * Example - `"john.smith@nhost.io"`
1266
1339
  * Format - email
1267
- @property options? (`OptionsRedirectTo`) - */
1340
+ @property options? (`OptionsRedirectTo`) -
1341
+ @property codeChallenge? (`string`) - PKCE code challenge (S256). When provided, the verification redirect will contain an authorization code instead of a refresh token.
1342
+ * Pattern - ^[A-Za-z0-9_-]{43}$
1343
+ * MinLength - 43
1344
+ * MaxLength - 43*/
1268
1345
  export interface UserEmailSendVerificationEmailRequest {
1269
1346
  /**
1270
1347
  * A valid email
@@ -1276,6 +1353,13 @@ export interface UserEmailSendVerificationEmailRequest {
1276
1353
  *
1277
1354
  */
1278
1355
  options?: OptionsRedirectTo;
1356
+ /**
1357
+ * PKCE code challenge (S256). When provided, the verification redirect will contain an authorization code instead of a refresh token.
1358
+ * Pattern - ^[A-Za-z0-9_-]{43}$
1359
+ * MinLength - 43
1360
+ * MaxLength - 43
1361
+ */
1362
+ codeChallenge?: string;
1279
1363
  }
1280
1364
  /**
1281
1365
  *
@@ -1345,7 +1429,11 @@ export interface UserPasswordRequest {
1345
1429
  @property email (`string`) - A valid email
1346
1430
  * Example - `"john.smith@nhost.io"`
1347
1431
  * Format - email
1348
- @property options? (`OptionsRedirectTo`) - */
1432
+ @property options? (`OptionsRedirectTo`) -
1433
+ @property codeChallenge? (`string`) - PKCE code challenge (S256). When provided, the verification redirect will contain an authorization code instead of a refresh token.
1434
+ * Pattern - ^[A-Za-z0-9_-]{43}$
1435
+ * MinLength - 43
1436
+ * MaxLength - 43*/
1349
1437
  export interface UserPasswordResetRequest {
1350
1438
  /**
1351
1439
  * A valid email
@@ -1357,6 +1445,13 @@ export interface UserPasswordResetRequest {
1357
1445
  *
1358
1446
  */
1359
1447
  options?: OptionsRedirectTo;
1448
+ /**
1449
+ * PKCE code challenge (S256). When provided, the verification redirect will contain an authorization code instead of a refresh token.
1450
+ * Pattern - ^[A-Za-z0-9_-]{43}$
1451
+ * MinLength - 43
1452
+ * MaxLength - 43
1453
+ */
1454
+ codeChallenge?: string;
1360
1455
  }
1361
1456
  /**
1362
1457
  * A requirement for user verification for the operation
@@ -1401,6 +1496,397 @@ export interface VerifyTokenRequest {
1401
1496
  */
1402
1497
  token?: string;
1403
1498
  }
1499
+ /**
1500
+ *
1501
+ @property error (`string`) - OAuth2 error code
1502
+ @property error_description? (`string`) - Human-readable error description*/
1503
+ export interface OAuth2ErrorResponse {
1504
+ /**
1505
+ * OAuth2 error code
1506
+ */
1507
+ error: string;
1508
+ /**
1509
+ * Human-readable error description
1510
+ */
1511
+ error_description?: string;
1512
+ }
1513
+ /**
1514
+ *
1515
+ @property issuer (`string`) -
1516
+ @property authorization_endpoint (`string`) -
1517
+ @property token_endpoint (`string`) -
1518
+ @property userinfo_endpoint? (`string`) -
1519
+ @property jwks_uri (`string`) -
1520
+ @property revocation_endpoint? (`string`) -
1521
+ @property introspection_endpoint? (`string`) -
1522
+ @property scopes_supported? (`string[]`) -
1523
+ @property response_types_supported (`string[]`) -
1524
+ @property grant_types_supported? (`string[]`) -
1525
+ @property subject_types_supported? (`string[]`) -
1526
+ @property id_token_signing_alg_values_supported? (`string[]`) -
1527
+ @property token_endpoint_auth_methods_supported? (`string[]`) -
1528
+ @property code_challenge_methods_supported? (`string[]`) -
1529
+ @property claims_supported? (`string[]`) -
1530
+ @property request_parameter_supported? (`boolean`) -
1531
+ @property authorization_response_iss_parameter_supported? (`boolean`) -
1532
+ @property client_id_metadata_document_supported? (`boolean`) - */
1533
+ export interface OAuth2DiscoveryResponse {
1534
+ /**
1535
+ *
1536
+ */
1537
+ issuer: string;
1538
+ /**
1539
+ *
1540
+ */
1541
+ authorization_endpoint: string;
1542
+ /**
1543
+ *
1544
+ */
1545
+ token_endpoint: string;
1546
+ /**
1547
+ *
1548
+ */
1549
+ userinfo_endpoint?: string;
1550
+ /**
1551
+ *
1552
+ */
1553
+ jwks_uri: string;
1554
+ /**
1555
+ *
1556
+ */
1557
+ revocation_endpoint?: string;
1558
+ /**
1559
+ *
1560
+ */
1561
+ introspection_endpoint?: string;
1562
+ /**
1563
+ *
1564
+ */
1565
+ scopes_supported?: string[];
1566
+ /**
1567
+ *
1568
+ */
1569
+ response_types_supported: string[];
1570
+ /**
1571
+ *
1572
+ */
1573
+ grant_types_supported?: string[];
1574
+ /**
1575
+ *
1576
+ */
1577
+ subject_types_supported?: string[];
1578
+ /**
1579
+ *
1580
+ */
1581
+ id_token_signing_alg_values_supported?: string[];
1582
+ /**
1583
+ *
1584
+ */
1585
+ token_endpoint_auth_methods_supported?: string[];
1586
+ /**
1587
+ *
1588
+ */
1589
+ code_challenge_methods_supported?: string[];
1590
+ /**
1591
+ *
1592
+ */
1593
+ claims_supported?: string[];
1594
+ /**
1595
+ *
1596
+ */
1597
+ request_parameter_supported?: boolean;
1598
+ /**
1599
+ *
1600
+ */
1601
+ authorization_response_iss_parameter_supported?: boolean;
1602
+ /**
1603
+ *
1604
+ */
1605
+ client_id_metadata_document_supported?: boolean;
1606
+ }
1607
+ /**
1608
+ *
1609
+ */
1610
+ export type OAuth2TokenRequestGrant_type = 'authorization_code' | 'refresh_token';
1611
+ /**
1612
+ *
1613
+ @property grant_type (`OAuth2TokenRequestGrant_type`) -
1614
+ @property code? (`string`) -
1615
+ @property redirect_uri? (`string`) -
1616
+ @property client_id? (`string`) -
1617
+ @property client_secret? (`string`) -
1618
+ @property code_verifier? (`string`) -
1619
+ @property refresh_token? (`string`) -
1620
+ @property resource? (`string`) - */
1621
+ export interface OAuth2TokenRequest {
1622
+ /**
1623
+ *
1624
+ */
1625
+ grant_type: OAuth2TokenRequestGrant_type;
1626
+ /**
1627
+ *
1628
+ */
1629
+ code?: string;
1630
+ /**
1631
+ *
1632
+ */
1633
+ redirect_uri?: string;
1634
+ /**
1635
+ *
1636
+ */
1637
+ client_id?: string;
1638
+ /**
1639
+ *
1640
+ */
1641
+ client_secret?: string;
1642
+ /**
1643
+ *
1644
+ */
1645
+ code_verifier?: string;
1646
+ /**
1647
+ *
1648
+ */
1649
+ refresh_token?: string;
1650
+ /**
1651
+ *
1652
+ */
1653
+ resource?: string;
1654
+ }
1655
+ /**
1656
+ *
1657
+ @property access_token (`string`) -
1658
+ @property token_type (`string`) -
1659
+ @property expires_in (`number`) -
1660
+ @property refresh_token? (`string`) -
1661
+ @property id_token? (`string`) -
1662
+ @property scope? (`string`) - */
1663
+ export interface OAuth2TokenResponse {
1664
+ /**
1665
+ *
1666
+ */
1667
+ access_token: string;
1668
+ /**
1669
+ *
1670
+ */
1671
+ token_type: string;
1672
+ /**
1673
+ *
1674
+ */
1675
+ expires_in: number;
1676
+ /**
1677
+ *
1678
+ */
1679
+ refresh_token?: string;
1680
+ /**
1681
+ *
1682
+ */
1683
+ id_token?: string;
1684
+ /**
1685
+ *
1686
+ */
1687
+ scope?: string;
1688
+ }
1689
+ /**
1690
+ *
1691
+ @property sub (`string`) -
1692
+ @property name? (`string`) -
1693
+ @property email? (`string`) -
1694
+ @property email_verified? (`boolean`) -
1695
+ @property picture? (`string`) -
1696
+ @property locale? (`string`) -
1697
+ @property phone_number? (`string`) -
1698
+ @property phone_number_verified? (`boolean`) - */
1699
+ export interface OAuth2UserinfoResponse {
1700
+ /**
1701
+ *
1702
+ */
1703
+ sub: string;
1704
+ /**
1705
+ *
1706
+ */
1707
+ name?: string;
1708
+ /**
1709
+ *
1710
+ */
1711
+ email?: string;
1712
+ /**
1713
+ *
1714
+ */
1715
+ email_verified?: boolean;
1716
+ /**
1717
+ *
1718
+ */
1719
+ picture?: string;
1720
+ /**
1721
+ *
1722
+ */
1723
+ locale?: string;
1724
+ /**
1725
+ *
1726
+ */
1727
+ phone_number?: string;
1728
+ /**
1729
+ *
1730
+ */
1731
+ phone_number_verified?: boolean;
1732
+ }
1733
+ /**
1734
+ *
1735
+ @property keys (`JWK[]`) - */
1736
+ export interface OAuth2JWKSResponse {
1737
+ /**
1738
+ *
1739
+ */
1740
+ keys: JWK[];
1741
+ }
1742
+ /**
1743
+ *
1744
+ */
1745
+ export type OAuth2RevokeRequestToken_type_hint = 'access_token' | 'refresh_token';
1746
+ /**
1747
+ *
1748
+ @property token (`string`) -
1749
+ @property token_type_hint? (`OAuth2RevokeRequestToken_type_hint`) -
1750
+ @property client_id? (`string`) -
1751
+ @property client_secret? (`string`) - */
1752
+ export interface OAuth2RevokeRequest {
1753
+ /**
1754
+ *
1755
+ */
1756
+ token: string;
1757
+ /**
1758
+ *
1759
+ */
1760
+ token_type_hint?: OAuth2RevokeRequestToken_type_hint;
1761
+ /**
1762
+ *
1763
+ */
1764
+ client_id?: string;
1765
+ /**
1766
+ *
1767
+ */
1768
+ client_secret?: string;
1769
+ }
1770
+ /**
1771
+ *
1772
+ */
1773
+ export type OAuth2IntrospectRequestToken_type_hint = 'access_token' | 'refresh_token';
1774
+ /**
1775
+ *
1776
+ @property token (`string`) -
1777
+ @property token_type_hint? (`OAuth2IntrospectRequestToken_type_hint`) -
1778
+ @property client_id? (`string`) -
1779
+ @property client_secret? (`string`) - */
1780
+ export interface OAuth2IntrospectRequest {
1781
+ /**
1782
+ *
1783
+ */
1784
+ token: string;
1785
+ /**
1786
+ *
1787
+ */
1788
+ token_type_hint?: OAuth2IntrospectRequestToken_type_hint;
1789
+ /**
1790
+ *
1791
+ */
1792
+ client_id?: string;
1793
+ /**
1794
+ *
1795
+ */
1796
+ client_secret?: string;
1797
+ }
1798
+ /**
1799
+ *
1800
+ @property active (`boolean`) -
1801
+ @property scope? (`string`) -
1802
+ @property client_id? (`string`) -
1803
+ @property sub? (`string`) -
1804
+ @property exp? (`number`) -
1805
+ @property iat? (`number`) -
1806
+ @property iss? (`string`) -
1807
+ @property token_type? (`string`) - */
1808
+ export interface OAuth2IntrospectResponse {
1809
+ /**
1810
+ *
1811
+ */
1812
+ active: boolean;
1813
+ /**
1814
+ *
1815
+ */
1816
+ scope?: string;
1817
+ /**
1818
+ *
1819
+ */
1820
+ client_id?: string;
1821
+ /**
1822
+ *
1823
+ */
1824
+ sub?: string;
1825
+ /**
1826
+ *
1827
+ */
1828
+ exp?: number;
1829
+ /**
1830
+ *
1831
+ */
1832
+ iat?: number;
1833
+ /**
1834
+ *
1835
+ */
1836
+ iss?: string;
1837
+ /**
1838
+ *
1839
+ */
1840
+ token_type?: string;
1841
+ }
1842
+ /**
1843
+ *
1844
+ @property requestId (`string`) -
1845
+ * Format - uuid
1846
+ @property clientId (`string`) -
1847
+ @property scopes (`string[]`) -
1848
+ @property redirectUri (`string`) - */
1849
+ export interface OAuth2LoginResponse {
1850
+ /**
1851
+ *
1852
+ * Format - uuid
1853
+ */
1854
+ requestId: string;
1855
+ /**
1856
+ *
1857
+ */
1858
+ clientId: string;
1859
+ /**
1860
+ *
1861
+ */
1862
+ scopes: string[];
1863
+ /**
1864
+ *
1865
+ */
1866
+ redirectUri: string;
1867
+ }
1868
+ /**
1869
+ *
1870
+ @property requestId (`string`) -
1871
+ * Format - uuid*/
1872
+ export interface OAuth2LoginRequest {
1873
+ /**
1874
+ *
1875
+ * Format - uuid
1876
+ */
1877
+ requestId: string;
1878
+ }
1879
+ /**
1880
+ *
1881
+ @property redirectUri (`string`) -
1882
+ * Format - uri*/
1883
+ export interface OAuth2LoginCompleteResponse {
1884
+ /**
1885
+ *
1886
+ * Format - uri
1887
+ */
1888
+ redirectUri: string;
1889
+ }
1404
1890
  /**
1405
1891
  * Target URL for the redirect
1406
1892
  */
@@ -1428,6 +1914,64 @@ export interface GetVersionResponse200 {
1428
1914
  */
1429
1915
  version: string;
1430
1916
  }
1917
+ /**
1918
+ *
1919
+ */
1920
+ export type GetCode_challenge_method = 'S256';
1921
+ /**
1922
+ *
1923
+ @property client_id (`string`) -
1924
+ @property redirect_uri (`string`) -
1925
+ @property response_type (`string`) -
1926
+ @property scope? (`string`) -
1927
+ @property state? (`string`) -
1928
+ @property nonce? (`string`) -
1929
+ @property code_challenge? (`string`) -
1930
+ @property code_challenge_method? (`string`) - Only S256 is supported. The plain method is not allowed.
1931
+ @property resource? (`string`) -
1932
+ @property prompt? (`string`) - */
1933
+ export interface Oauth2AuthorizePostBody {
1934
+ /**
1935
+ *
1936
+ */
1937
+ client_id: string;
1938
+ /**
1939
+ *
1940
+ */
1941
+ redirect_uri: string;
1942
+ /**
1943
+ *
1944
+ */
1945
+ response_type: string;
1946
+ /**
1947
+ *
1948
+ */
1949
+ scope?: string;
1950
+ /**
1951
+ *
1952
+ */
1953
+ state?: string;
1954
+ /**
1955
+ *
1956
+ */
1957
+ nonce?: string;
1958
+ /**
1959
+ *
1960
+ */
1961
+ code_challenge?: string;
1962
+ /**
1963
+ * Only S256 is supported. The plain method is not allowed.
1964
+ */
1965
+ code_challenge_method?: string;
1966
+ /**
1967
+ *
1968
+ */
1969
+ resource?: string;
1970
+ /**
1971
+ *
1972
+ */
1973
+ prompt?: string;
1974
+ }
1431
1975
  /**
1432
1976
  * Parameters for the signInProvider method.
1433
1977
  @property allowedRoles? (string[]) - Array of allowed roles for the user
@@ -1447,6 +1991,8 @@ export interface GetVersionResponse200 {
1447
1991
  @property state? (string) - Opaque state value to be returned by the provider
1448
1992
 
1449
1993
  @property providerSpecificParams? (ProviderSpecificParams) - Additional provider-specific parameters
1994
+
1995
+ @property codeChallenge? (string) - PKCE code challenge (S256). When provided, the callback redirect will contain an authorization code instead of a refresh token.
1450
1996
  */
1451
1997
  export interface SignInProviderParams {
1452
1998
  /**
@@ -1494,6 +2040,11 @@ export interface SignInProviderParams {
1494
2040
 
1495
2041
  */
1496
2042
  providerSpecificParams?: ProviderSpecificParams;
2043
+ /**
2044
+ * PKCE code challenge (S256). When provided, the callback redirect will contain an authorization code instead of a refresh token.
2045
+
2046
+ */
2047
+ codeChallenge?: string;
1497
2048
  }
1498
2049
  /**
1499
2050
  * Parameters for the verifyTicket method.
@@ -1505,7 +2056,9 @@ export interface SignInProviderParams {
1505
2056
  * Type of the ticket
1506
2057
  @property redirectTo (RedirectToQuery) - Target URL for the redirect
1507
2058
 
1508
- * Target URL for the redirect*/
2059
+ * Target URL for the redirect
2060
+ @property codeChallenge? (string) - PKCE code challenge (S256). When present, the redirect will contain an authorization code instead of a refresh token.
2061
+ */
1509
2062
  export interface VerifyTicketParams {
1510
2063
  /**
1511
2064
  * Ticket
@@ -1525,6 +2078,96 @@ export interface VerifyTicketParams {
1525
2078
  * Target URL for the redirect
1526
2079
  */
1527
2080
  redirectTo: RedirectToQuery;
2081
+ /**
2082
+ * PKCE code challenge (S256). When present, the redirect will contain an authorization code instead of a refresh token.
2083
+
2084
+ */
2085
+ codeChallenge?: string;
2086
+ }
2087
+ /**
2088
+ * Parameters for the oauth2Authorize method.
2089
+ @property client_id (string) - The OAuth2 client identifier (RFC 6749 Section 2.2).
2090
+
2091
+ @property redirect_uri (string) - The URI to redirect the user-agent to after authorization (RFC 6749 Section 3.1.2).
2092
+
2093
+ @property response_type (string) - The authorization response type. Only 'code' is supported (RFC 6749 Section 3.1.1).
2094
+
2095
+ @property scope? (string) - Space-delimited list of requested scopes (RFC 6749 Section 3.3).
2096
+
2097
+ @property state? (string) - Opaque value used to maintain state between the request and callback (RFC 6749 Section 4.1.1).
2098
+
2099
+ @property nonce? (string) - String value used to associate a client session with an ID token (OpenID Connect Core Section 3.1.2.1).
2100
+
2101
+ @property code_challenge? (string) - PKCE code challenge derived from the code verifier (RFC 7636 Section 4.2).
2102
+
2103
+ @property code_challenge_method? (GetCode_challenge_method) - Only S256 is supported. The plain method is not allowed.
2104
+
2105
+ @property resource? (string) - Resource indicator for the target service (RFC 8707).
2106
+
2107
+ @property prompt? (string) - Space-delimited list of prompts to present to the user (OpenID Connect Core Section 3.1.2.1).
2108
+ */
2109
+ export interface Oauth2AuthorizeParams {
2110
+ /**
2111
+ * The OAuth2 client identifier (RFC 6749 Section 2.2).
2112
+
2113
+ */
2114
+ client_id: string;
2115
+ /**
2116
+ * The URI to redirect the user-agent to after authorization (RFC 6749 Section 3.1.2).
2117
+
2118
+ */
2119
+ redirect_uri: string;
2120
+ /**
2121
+ * The authorization response type. Only 'code' is supported (RFC 6749 Section 3.1.1).
2122
+
2123
+ */
2124
+ response_type: string;
2125
+ /**
2126
+ * Space-delimited list of requested scopes (RFC 6749 Section 3.3).
2127
+
2128
+ */
2129
+ scope?: string;
2130
+ /**
2131
+ * Opaque value used to maintain state between the request and callback (RFC 6749 Section 4.1.1).
2132
+
2133
+ */
2134
+ state?: string;
2135
+ /**
2136
+ * String value used to associate a client session with an ID token (OpenID Connect Core Section 3.1.2.1).
2137
+
2138
+ */
2139
+ nonce?: string;
2140
+ /**
2141
+ * PKCE code challenge derived from the code verifier (RFC 7636 Section 4.2).
2142
+
2143
+ */
2144
+ code_challenge?: string;
2145
+ /**
2146
+ * Only S256 is supported. The plain method is not allowed.
2147
+
2148
+ */
2149
+ code_challenge_method?: GetCode_challenge_method;
2150
+ /**
2151
+ * Resource indicator for the target service (RFC 8707).
2152
+
2153
+ */
2154
+ resource?: string;
2155
+ /**
2156
+ * Space-delimited list of prompts to present to the user (OpenID Connect Core Section 3.1.2.1).
2157
+
2158
+ */
2159
+ prompt?: string;
2160
+ }
2161
+ /**
2162
+ * Parameters for the oauth2LoginGet method.
2163
+ @property request_id (string) - The pending authorization request identifier.
2164
+ */
2165
+ export interface Oauth2LoginGetParams {
2166
+ /**
2167
+ * The pending authorization request identifier.
2168
+
2169
+ */
2170
+ request_id: string;
1528
2171
  }
1529
2172
  export interface Client {
1530
2173
  baseURL: string;
@@ -1835,6 +2478,14 @@ export interface Client {
1835
2478
  - 200: VerifyAddSecurityKeyResponse
1836
2479
  */
1837
2480
  verifyAddSecurityKey(body: VerifyAddSecurityKeyRequest, options?: RequestInit): Promise<FetchResponse<VerifyAddSecurityKeyResponse>>;
2481
+ /**
2482
+ Summary: Exchange authorization code for session
2483
+ Exchange an authorization code (obtained via PKCE flow) together with the original code_verifier for a session containing access and refresh tokens.
2484
+
2485
+ This method may return different T based on the response code:
2486
+ - 200: SessionPayload
2487
+ */
2488
+ tokenExchange(body: TokenExchangeRequest, options?: RequestInit): Promise<FetchResponse<SessionPayload>>;
1838
2489
  /**
1839
2490
  Summary: Verify email and authentication tickets
1840
2491
  Verify tickets created by email verification, magic link authentication, or password reset processes. Redirects the user to the appropriate destination upon successful verification.
@@ -1850,6 +2501,100 @@ export interface Client {
1850
2501
  - 200: GetVersionResponse200
1851
2502
  */
1852
2503
  getVersion(options?: RequestInit): Promise<FetchResponse<GetVersionResponse200>>;
2504
+ /**
2505
+ Summary: OpenID Connect Discovery
2506
+ Returns the OpenID Provider Metadata (RFC 8414)
2507
+
2508
+ This method may return different T based on the response code:
2509
+ - 200: OAuth2DiscoveryResponse
2510
+ */
2511
+ getOpenIDConfiguration(options?: RequestInit): Promise<FetchResponse<OAuth2DiscoveryResponse>>;
2512
+ /**
2513
+ Summary: OAuth2 Authorization Server Metadata
2514
+ Returns the Authorization Server Metadata (RFC 8414). Same content as OpenID Discovery.
2515
+
2516
+ This method may return different T based on the response code:
2517
+ - 200: OAuth2DiscoveryResponse
2518
+ */
2519
+ getOAuthAuthorizationServer(options?: RequestInit): Promise<FetchResponse<OAuth2DiscoveryResponse>>;
2520
+ /**
2521
+ Summary: OAuth2 Authorization Endpoint
2522
+ Initiates an OAuth2 authorization code flow. Validates the request and redirects to the login UI for user authentication and consent.
2523
+
2524
+ As this method is a redirect, it returns a URL string instead of a Promise
2525
+ */
2526
+ oauth2AuthorizeURL(params?: Oauth2AuthorizeParams, options?: RequestInit): string;
2527
+ /**
2528
+ Summary: OAuth2 Authorization Endpoint (POST)
2529
+ Initiates an OAuth2 authorization code flow via POST. Validates the request and redirects to the login UI for user authentication and consent.
2530
+
2531
+ As this method is a redirect, it returns a URL string instead of a Promise
2532
+ */
2533
+ oauth2AuthorizePostURL(body: Oauth2AuthorizePostBody, options?: RequestInit): string;
2534
+ /**
2535
+ Summary: OAuth2 Token Endpoint
2536
+ Exchange an authorization code for tokens, or refresh an existing token. Supports grant_type authorization_code and refresh_token.
2537
+
2538
+ This method may return different T based on the response code:
2539
+ - 200: OAuth2TokenResponse
2540
+ */
2541
+ oauth2Token(body: OAuth2TokenRequest, options?: RequestInit): Promise<FetchResponse<OAuth2TokenResponse>>;
2542
+ /**
2543
+ Summary: OpenID Connect UserInfo Endpoint (GET)
2544
+ Returns claims about the authenticated user based on the access token scopes.
2545
+
2546
+ This method may return different T based on the response code:
2547
+ - 200: OAuth2UserinfoResponse
2548
+ */
2549
+ oauth2UserinfoGet(options?: RequestInit): Promise<FetchResponse<OAuth2UserinfoResponse>>;
2550
+ /**
2551
+ Summary: OpenID Connect UserInfo Endpoint (POST)
2552
+ Returns claims about the authenticated user based on the access token scopes.
2553
+
2554
+ This method may return different T based on the response code:
2555
+ - 200: OAuth2UserinfoResponse
2556
+ */
2557
+ oauth2UserinfoPost(options?: RequestInit): Promise<FetchResponse<OAuth2UserinfoResponse>>;
2558
+ /**
2559
+ Summary: OAuth2 Provider JWKS Endpoint
2560
+ Returns the JSON Web Key Set containing public keys used for OAuth2/OIDC token signing.
2561
+
2562
+ This method may return different T based on the response code:
2563
+ - 200: OAuth2JWKSResponse
2564
+ */
2565
+ oauth2Jwks(options?: RequestInit): Promise<FetchResponse<OAuth2JWKSResponse>>;
2566
+ /**
2567
+ Summary: OAuth2 Token Revocation (RFC 7009)
2568
+ Revoke an access token or refresh token.
2569
+
2570
+ This method may return different T based on the response code:
2571
+ - 200: void
2572
+ */
2573
+ oauth2Revoke(body: OAuth2RevokeRequest, options?: RequestInit): Promise<FetchResponse<void>>;
2574
+ /**
2575
+ Summary: OAuth2 Token Introspection (RFC 7662)
2576
+ Introspect a token to determine its current state and metadata.
2577
+
2578
+ This method may return different T based on the response code:
2579
+ - 200: OAuth2IntrospectResponse
2580
+ */
2581
+ oauth2Introspect(body: OAuth2IntrospectRequest, options?: RequestInit): Promise<FetchResponse<OAuth2IntrospectResponse>>;
2582
+ /**
2583
+ Summary: Get authorization request details for consent screen
2584
+ Called by the consent UI to get details about the pending authorization request.
2585
+
2586
+ This method may return different T based on the response code:
2587
+ - 200: OAuth2LoginResponse
2588
+ */
2589
+ oauth2LoginGet(params?: Oauth2LoginGetParams, options?: RequestInit): Promise<FetchResponse<OAuth2LoginResponse>>;
2590
+ /**
2591
+ Summary: Complete login/consent for an authorization request
2592
+ Called by the consent UI after user authenticates and consents. Sets the user on the auth request and redirects back to the client with an authorization code.
2593
+
2594
+ This method may return different T based on the response code:
2595
+ - 200: OAuth2LoginCompleteResponse
2596
+ */
2597
+ oauth2LoginPost(body: OAuth2LoginRequest, options?: RequestInit): Promise<FetchResponse<OAuth2LoginCompleteResponse>>;
1853
2598
  }
1854
2599
  export declare const createAPIClient: (baseURL: string, chainFunctions?: ChainFunction[]) => Client;
1855
2600
  //# sourceMappingURL=client.d.ts.map