@supabase/gotrue-js 2.77.0 → 2.77.1-canary.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.
- package/dist/main/GoTrueAdminApi.d.ts +7 -0
- package/dist/main/GoTrueAdminApi.d.ts.map +1 -1
- package/dist/main/GoTrueAdminApi.js +24 -0
- package/dist/main/GoTrueAdminApi.js.map +1 -1
- package/dist/main/GoTrueClient.d.ts +26 -1
- package/dist/main/GoTrueClient.d.ts.map +1 -1
- package/dist/main/GoTrueClient.js +109 -0
- package/dist/main/GoTrueClient.js.map +1 -1
- package/dist/main/lib/types.d.ts +117 -0
- package/dist/main/lib/types.d.ts.map +1 -1
- package/dist/main/lib/version.d.ts +1 -1
- package/dist/main/lib/version.d.ts.map +1 -1
- package/dist/main/lib/version.js +1 -1
- package/dist/main/lib/version.js.map +1 -1
- package/dist/module/GoTrueAdminApi.d.ts +7 -0
- package/dist/module/GoTrueAdminApi.d.ts.map +1 -1
- package/dist/module/GoTrueAdminApi.js +24 -0
- package/dist/module/GoTrueAdminApi.js.map +1 -1
- package/dist/module/GoTrueClient.d.ts +26 -1
- package/dist/module/GoTrueClient.d.ts.map +1 -1
- package/dist/module/GoTrueClient.js +109 -0
- package/dist/module/GoTrueClient.js.map +1 -1
- package/dist/module/lib/types.d.ts +117 -0
- package/dist/module/lib/types.d.ts.map +1 -1
- package/dist/module/lib/version.d.ts +1 -1
- package/dist/module/lib/version.d.ts.map +1 -1
- package/dist/module/lib/version.js +1 -1
- package/dist/module/lib/version.js.map +1 -1
- package/dist/tsconfig.module.tsbuildinfo +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/GoTrueAdminApi.ts +34 -12
- package/src/GoTrueClient.ts +167 -0
- package/src/lib/types.ts +128 -0
- package/src/lib/version.ts +1 -1
package/src/lib/types.ts
CHANGED
|
@@ -1492,6 +1492,8 @@ export type OAuthClient = {
|
|
|
1492
1492
|
registration_type: OAuthClientRegistrationType
|
|
1493
1493
|
/** URI of the OAuth client */
|
|
1494
1494
|
client_uri?: string
|
|
1495
|
+
/** URI of the OAuth client's logo */
|
|
1496
|
+
logo_uri?: string
|
|
1495
1497
|
/** Array of allowed redirect URIs */
|
|
1496
1498
|
redirect_uris: string[]
|
|
1497
1499
|
/** Array of allowed grant types */
|
|
@@ -1525,6 +1527,24 @@ export type CreateOAuthClientParams = {
|
|
|
1525
1527
|
scope?: string
|
|
1526
1528
|
}
|
|
1527
1529
|
|
|
1530
|
+
/**
|
|
1531
|
+
* Parameters for updating an existing OAuth client.
|
|
1532
|
+
* All fields are optional. Only provided fields will be updated.
|
|
1533
|
+
* Only relevant when the OAuth 2.1 server is enabled in Supabase Auth.
|
|
1534
|
+
*/
|
|
1535
|
+
export type UpdateOAuthClientParams = {
|
|
1536
|
+
/** Human-readable name of the OAuth client */
|
|
1537
|
+
client_name?: string
|
|
1538
|
+
/** URI of the OAuth client */
|
|
1539
|
+
client_uri?: string
|
|
1540
|
+
/** URI of the OAuth client's logo */
|
|
1541
|
+
logo_uri?: string
|
|
1542
|
+
/** Array of allowed redirect URIs */
|
|
1543
|
+
redirect_uris?: string[]
|
|
1544
|
+
/** Array of allowed grant types */
|
|
1545
|
+
grant_types?: OAuthClientGrantType[]
|
|
1546
|
+
}
|
|
1547
|
+
|
|
1528
1548
|
/**
|
|
1529
1549
|
* Response type for OAuth client operations.
|
|
1530
1550
|
* Only relevant when the OAuth 2.1 server is enabled in Supabase Auth.
|
|
@@ -1574,6 +1594,14 @@ export interface GoTrueAdminOAuthApi {
|
|
|
1574
1594
|
*/
|
|
1575
1595
|
getClient(clientId: string): Promise<OAuthClientResponse>
|
|
1576
1596
|
|
|
1597
|
+
/**
|
|
1598
|
+
* Updates an existing OAuth client.
|
|
1599
|
+
* Only relevant when the OAuth 2.1 server is enabled in Supabase Auth.
|
|
1600
|
+
*
|
|
1601
|
+
* This function should only be called on a server. Never expose your `service_role` key in the browser.
|
|
1602
|
+
*/
|
|
1603
|
+
updateClient(clientId: string, params: UpdateOAuthClientParams): Promise<OAuthClientResponse>
|
|
1604
|
+
|
|
1577
1605
|
/**
|
|
1578
1606
|
* Deletes an OAuth client.
|
|
1579
1607
|
* Only relevant when the OAuth 2.1 server is enabled in Supabase Auth.
|
|
@@ -1590,3 +1618,103 @@ export interface GoTrueAdminOAuthApi {
|
|
|
1590
1618
|
*/
|
|
1591
1619
|
regenerateClientSecret(clientId: string): Promise<OAuthClientResponse>
|
|
1592
1620
|
}
|
|
1621
|
+
|
|
1622
|
+
/**
|
|
1623
|
+
* OAuth client details in an authorization request.
|
|
1624
|
+
* Only relevant when the OAuth 2.1 server is enabled in Supabase Auth.
|
|
1625
|
+
*/
|
|
1626
|
+
export type OAuthAuthorizationClient = {
|
|
1627
|
+
/** Unique identifier for the OAuth client (UUID) */
|
|
1628
|
+
client_id: string
|
|
1629
|
+
/** Human-readable name of the OAuth client */
|
|
1630
|
+
client_name: string
|
|
1631
|
+
/** URI of the OAuth client's website */
|
|
1632
|
+
client_uri: string
|
|
1633
|
+
/** URI of the OAuth client's logo */
|
|
1634
|
+
logo_uri: string
|
|
1635
|
+
}
|
|
1636
|
+
|
|
1637
|
+
/**
|
|
1638
|
+
* OAuth authorization details for the consent flow.
|
|
1639
|
+
* Only relevant when the OAuth 2.1 server is enabled in Supabase Auth.
|
|
1640
|
+
*/
|
|
1641
|
+
export type OAuthAuthorizationDetails = {
|
|
1642
|
+
/** The authorization ID */
|
|
1643
|
+
authorization_id: string
|
|
1644
|
+
/** Redirect URI - present if user already consented (can be used to trigger immediate redirect) */
|
|
1645
|
+
redirect_uri?: string
|
|
1646
|
+
/** OAuth client requesting authorization */
|
|
1647
|
+
client: OAuthAuthorizationClient
|
|
1648
|
+
/** User object associated with the authorization */
|
|
1649
|
+
user: {
|
|
1650
|
+
/** User ID (UUID) */
|
|
1651
|
+
id: string
|
|
1652
|
+
/** User email */
|
|
1653
|
+
email: string
|
|
1654
|
+
}
|
|
1655
|
+
/** Space-separated list of requested scopes */
|
|
1656
|
+
scope: string
|
|
1657
|
+
}
|
|
1658
|
+
|
|
1659
|
+
/**
|
|
1660
|
+
* Response type for getting OAuth authorization details.
|
|
1661
|
+
* Only relevant when the OAuth 2.1 server is enabled in Supabase Auth.
|
|
1662
|
+
*/
|
|
1663
|
+
export type AuthOAuthAuthorizationDetailsResponse = RequestResult<OAuthAuthorizationDetails>
|
|
1664
|
+
|
|
1665
|
+
/**
|
|
1666
|
+
* Response type for OAuth consent decision (approve/deny).
|
|
1667
|
+
* Only relevant when the OAuth 2.1 server is enabled in Supabase Auth.
|
|
1668
|
+
*/
|
|
1669
|
+
export type AuthOAuthConsentResponse = RequestResult<{
|
|
1670
|
+
/** URL to redirect the user back to the OAuth client */
|
|
1671
|
+
redirect_url: string
|
|
1672
|
+
}>
|
|
1673
|
+
|
|
1674
|
+
/**
|
|
1675
|
+
* Contains all OAuth 2.1 authorization server user-facing methods.
|
|
1676
|
+
* Only relevant when the OAuth 2.1 server is enabled in Supabase Auth.
|
|
1677
|
+
*
|
|
1678
|
+
* These methods are used to implement the consent page.
|
|
1679
|
+
*/
|
|
1680
|
+
export interface AuthOAuthServerApi {
|
|
1681
|
+
/**
|
|
1682
|
+
* Retrieves details about an OAuth authorization request.
|
|
1683
|
+
* Used to display consent information to the user.
|
|
1684
|
+
* Only relevant when the OAuth 2.1 server is enabled in Supabase Auth.
|
|
1685
|
+
*
|
|
1686
|
+
* This method returns authorization details including client info, scopes, and user information.
|
|
1687
|
+
* If the response includes a redirect_uri, it means consent was already given - the caller
|
|
1688
|
+
* should handle the redirect manually if needed.
|
|
1689
|
+
*
|
|
1690
|
+
* @param authorizationId - The authorization ID from the authorization request
|
|
1691
|
+
* @returns Authorization details including client info and requested scopes
|
|
1692
|
+
*/
|
|
1693
|
+
getAuthorizationDetails(authorizationId: string): Promise<AuthOAuthAuthorizationDetailsResponse>
|
|
1694
|
+
|
|
1695
|
+
/**
|
|
1696
|
+
* Approves an OAuth authorization request.
|
|
1697
|
+
* Only relevant when the OAuth 2.1 server is enabled in Supabase Auth.
|
|
1698
|
+
*
|
|
1699
|
+
* @param authorizationId - The authorization ID to approve
|
|
1700
|
+
* @param options - Optional parameters including skipBrowserRedirect
|
|
1701
|
+
* @returns Redirect URL to send the user back to the OAuth client
|
|
1702
|
+
*/
|
|
1703
|
+
approveAuthorization(
|
|
1704
|
+
authorizationId: string,
|
|
1705
|
+
options?: { skipBrowserRedirect?: boolean }
|
|
1706
|
+
): Promise<AuthOAuthConsentResponse>
|
|
1707
|
+
|
|
1708
|
+
/**
|
|
1709
|
+
* Denies an OAuth authorization request.
|
|
1710
|
+
* Only relevant when the OAuth 2.1 server is enabled in Supabase Auth.
|
|
1711
|
+
*
|
|
1712
|
+
* @param authorizationId - The authorization ID to deny
|
|
1713
|
+
* @param options - Optional parameters including skipBrowserRedirect
|
|
1714
|
+
* @returns Redirect URL to send the user back to the OAuth client
|
|
1715
|
+
*/
|
|
1716
|
+
denyAuthorization(
|
|
1717
|
+
authorizationId: string,
|
|
1718
|
+
options?: { skipBrowserRedirect?: boolean }
|
|
1719
|
+
): Promise<AuthOAuthConsentResponse>
|
|
1720
|
+
}
|
package/src/lib/version.ts
CHANGED
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
// - Debugging and support (identifying which version is running)
|
|
5
5
|
// - Telemetry and logging (version reporting in errors/analytics)
|
|
6
6
|
// - Ensuring build artifacts match the published package version
|
|
7
|
-
export const version = '2.77.0'
|
|
7
|
+
export const version = '2.77.1-canary.0'
|