@fluxbase/sdk 0.0.1-rc.28 → 0.0.1-rc.30
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/index.cjs +67 -42
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +112 -39
- package/dist/index.d.ts +112 -39
- package/dist/index.js +67 -42
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -71,18 +71,55 @@ interface AuthResponse {
|
|
|
71
71
|
refresh_token: string;
|
|
72
72
|
expires_in: number;
|
|
73
73
|
}
|
|
74
|
-
|
|
74
|
+
/**
|
|
75
|
+
* MFA Factor (Supabase-compatible)
|
|
76
|
+
*/
|
|
77
|
+
interface Factor {
|
|
78
|
+
id: string;
|
|
79
|
+
type: 'totp' | 'phone';
|
|
80
|
+
status: 'verified' | 'unverified';
|
|
81
|
+
created_at: string;
|
|
82
|
+
updated_at: string;
|
|
83
|
+
friendly_name?: string;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* TOTP setup details (Supabase-compatible)
|
|
87
|
+
*/
|
|
88
|
+
interface TOTPSetup {
|
|
89
|
+
qr_code: string;
|
|
75
90
|
secret: string;
|
|
76
|
-
|
|
77
|
-
|
|
91
|
+
uri: string;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* MFA enroll response (Supabase-compatible)
|
|
95
|
+
*/
|
|
96
|
+
interface TwoFactorSetupResponse {
|
|
97
|
+
id: string;
|
|
98
|
+
type: 'totp';
|
|
99
|
+
totp: TOTPSetup;
|
|
78
100
|
}
|
|
101
|
+
/**
|
|
102
|
+
* MFA verify/enable response (Supabase-compatible)
|
|
103
|
+
*/
|
|
79
104
|
interface TwoFactorEnableResponse {
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
105
|
+
access_token: string;
|
|
106
|
+
refresh_token: string;
|
|
107
|
+
user: User;
|
|
108
|
+
token_type?: string;
|
|
109
|
+
expires_in?: number;
|
|
83
110
|
}
|
|
111
|
+
/**
|
|
112
|
+
* MFA status response (Supabase-compatible)
|
|
113
|
+
*/
|
|
84
114
|
interface TwoFactorStatusResponse {
|
|
85
|
-
|
|
115
|
+
all: Factor[];
|
|
116
|
+
totp: Factor[];
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* MFA unenroll response (Supabase-compatible)
|
|
120
|
+
*/
|
|
121
|
+
interface TwoFactorDisableResponse {
|
|
122
|
+
id: string;
|
|
86
123
|
}
|
|
87
124
|
interface TwoFactorVerifyRequest {
|
|
88
125
|
user_id: string;
|
|
@@ -304,21 +341,38 @@ interface Bucket {
|
|
|
304
341
|
created_at: string;
|
|
305
342
|
updated_at: string;
|
|
306
343
|
}
|
|
344
|
+
/**
|
|
345
|
+
* Password reset email sent response (Supabase-compatible)
|
|
346
|
+
* Returns OTP-style response similar to Supabase's AuthOtpResponse
|
|
347
|
+
*/
|
|
307
348
|
interface PasswordResetResponse {
|
|
308
|
-
|
|
349
|
+
user: null;
|
|
350
|
+
session: null;
|
|
351
|
+
messageId?: string;
|
|
309
352
|
}
|
|
353
|
+
/**
|
|
354
|
+
* Verify password reset token response (Fluxbase extension)
|
|
355
|
+
*/
|
|
310
356
|
interface VerifyResetTokenResponse {
|
|
311
357
|
valid: boolean;
|
|
312
358
|
message: string;
|
|
313
359
|
}
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
360
|
+
/**
|
|
361
|
+
* Reset password completion response (Supabase-compatible)
|
|
362
|
+
* Returns user and session after successful password reset
|
|
363
|
+
*/
|
|
364
|
+
type ResetPasswordResponse = AuthResponseData;
|
|
317
365
|
interface MagicLinkOptions {
|
|
318
366
|
redirect_to?: string;
|
|
319
367
|
}
|
|
368
|
+
/**
|
|
369
|
+
* Magic link sent response (Supabase-compatible)
|
|
370
|
+
* Returns OTP-style response similar to Supabase's AuthOtpResponse
|
|
371
|
+
*/
|
|
320
372
|
interface MagicLinkResponse {
|
|
321
|
-
|
|
373
|
+
user: null;
|
|
374
|
+
session: null;
|
|
375
|
+
messageId?: string;
|
|
322
376
|
}
|
|
323
377
|
interface OAuthProvidersResponse {
|
|
324
378
|
providers: OAuthProvider[];
|
|
@@ -1145,11 +1199,18 @@ type VoidResponse = {
|
|
|
1145
1199
|
error: Error | null;
|
|
1146
1200
|
};
|
|
1147
1201
|
/**
|
|
1148
|
-
*
|
|
1202
|
+
* Weak password information (Supabase-compatible)
|
|
1203
|
+
*/
|
|
1204
|
+
interface WeakPassword {
|
|
1205
|
+
reasons: string[];
|
|
1206
|
+
}
|
|
1207
|
+
/**
|
|
1208
|
+
* Auth response with user and session (Supabase-compatible)
|
|
1149
1209
|
*/
|
|
1150
1210
|
type AuthResponseData = {
|
|
1151
1211
|
user: User;
|
|
1152
|
-
session: AuthSession;
|
|
1212
|
+
session: AuthSession | null;
|
|
1213
|
+
weakPassword?: WeakPassword;
|
|
1153
1214
|
};
|
|
1154
1215
|
/**
|
|
1155
1216
|
* Fluxbase auth response
|
|
@@ -1535,18 +1596,20 @@ declare class FluxbaseAuth {
|
|
|
1535
1596
|
};
|
|
1536
1597
|
};
|
|
1537
1598
|
/**
|
|
1538
|
-
* Sign in with email and password
|
|
1539
|
-
* Returns
|
|
1599
|
+
* Sign in with email and password (Supabase-compatible)
|
|
1600
|
+
* Returns { user, session } if successful, or SignInWith2FAResponse if 2FA is required
|
|
1540
1601
|
*/
|
|
1541
|
-
signIn(credentials: SignInCredentials): Promise<FluxbaseResponse<
|
|
1602
|
+
signIn(credentials: SignInCredentials): Promise<FluxbaseResponse<AuthResponseData | SignInWith2FAResponse>>;
|
|
1542
1603
|
/**
|
|
1543
|
-
* Sign in with email and password
|
|
1604
|
+
* Sign in with email and password (Supabase-compatible)
|
|
1544
1605
|
* Alias for signIn() to maintain compatibility with common authentication patterns
|
|
1545
|
-
* Returns
|
|
1606
|
+
* Returns { user, session } if successful, or SignInWith2FAResponse if 2FA is required
|
|
1546
1607
|
*/
|
|
1547
|
-
signInWithPassword(credentials: SignInCredentials): Promise<FluxbaseResponse<
|
|
1608
|
+
signInWithPassword(credentials: SignInCredentials): Promise<FluxbaseResponse<AuthResponseData | SignInWith2FAResponse>>;
|
|
1548
1609
|
/**
|
|
1549
|
-
* Sign up with email and password
|
|
1610
|
+
* Sign up with email and password (Supabase-compatible)
|
|
1611
|
+
* Returns session when email confirmation is disabled
|
|
1612
|
+
* Returns null session when email confirmation is required
|
|
1550
1613
|
*/
|
|
1551
1614
|
signUp(credentials: SignUpCredentials): Promise<FluxbaseAuthResponse>;
|
|
1552
1615
|
/**
|
|
@@ -1558,8 +1621,8 @@ declare class FluxbaseAuth {
|
|
|
1558
1621
|
* Returns a new session with refreshed tokens
|
|
1559
1622
|
*/
|
|
1560
1623
|
refreshSession(): Promise<FluxbaseResponse<{
|
|
1561
|
-
session: AuthSession;
|
|
1562
1624
|
user: User;
|
|
1625
|
+
session: AuthSession;
|
|
1563
1626
|
}>>;
|
|
1564
1627
|
/**
|
|
1565
1628
|
* Get the current user from the server
|
|
@@ -1580,42 +1643,50 @@ declare class FluxbaseAuth {
|
|
|
1580
1643
|
refresh_token: string;
|
|
1581
1644
|
}): Promise<FluxbaseAuthResponse>;
|
|
1582
1645
|
/**
|
|
1583
|
-
* Setup 2FA for the current user
|
|
1584
|
-
*
|
|
1646
|
+
* Setup 2FA for the current user (Supabase-compatible)
|
|
1647
|
+
* Enrolls a new MFA factor and returns TOTP details
|
|
1648
|
+
* @returns Promise with factor id, type, and TOTP setup details
|
|
1585
1649
|
*/
|
|
1586
1650
|
setup2FA(): Promise<DataResponse<TwoFactorSetupResponse>>;
|
|
1587
1651
|
/**
|
|
1588
|
-
* Enable 2FA after verifying the TOTP code
|
|
1589
|
-
*
|
|
1652
|
+
* Enable 2FA after verifying the TOTP code (Supabase-compatible)
|
|
1653
|
+
* Verifies the TOTP code and returns new tokens with MFA session
|
|
1654
|
+
* @param code - TOTP code from authenticator app
|
|
1655
|
+
* @returns Promise with access_token, refresh_token, and user
|
|
1590
1656
|
*/
|
|
1591
1657
|
enable2FA(code: string): Promise<DataResponse<TwoFactorEnableResponse>>;
|
|
1592
1658
|
/**
|
|
1593
|
-
* Disable 2FA for the current user
|
|
1594
|
-
*
|
|
1659
|
+
* Disable 2FA for the current user (Supabase-compatible)
|
|
1660
|
+
* Unenrolls the MFA factor
|
|
1661
|
+
* @param password - User password for confirmation
|
|
1662
|
+
* @returns Promise with unenrolled factor id
|
|
1595
1663
|
*/
|
|
1596
|
-
disable2FA(password: string): Promise<DataResponse<
|
|
1597
|
-
success: boolean;
|
|
1598
|
-
message: string;
|
|
1599
|
-
}>>;
|
|
1664
|
+
disable2FA(password: string): Promise<DataResponse<TwoFactorDisableResponse>>;
|
|
1600
1665
|
/**
|
|
1601
|
-
* Check 2FA status for the current user
|
|
1666
|
+
* Check 2FA status for the current user (Supabase-compatible)
|
|
1667
|
+
* Lists all enrolled MFA factors
|
|
1668
|
+
* @returns Promise with all factors and TOTP factors
|
|
1602
1669
|
*/
|
|
1603
1670
|
get2FAStatus(): Promise<DataResponse<TwoFactorStatusResponse>>;
|
|
1604
1671
|
/**
|
|
1605
|
-
* Verify 2FA code during login
|
|
1672
|
+
* Verify 2FA code during login (Supabase-compatible)
|
|
1606
1673
|
* Call this after signIn returns requires_2fa: true
|
|
1674
|
+
* @param request - User ID and TOTP code
|
|
1675
|
+
* @returns Promise with access_token, refresh_token, and user
|
|
1607
1676
|
*/
|
|
1608
|
-
verify2FA(request: TwoFactorVerifyRequest): Promise<
|
|
1677
|
+
verify2FA(request: TwoFactorVerifyRequest): Promise<DataResponse<TwoFactorEnableResponse>>;
|
|
1609
1678
|
/**
|
|
1610
|
-
* Send password reset email
|
|
1679
|
+
* Send password reset email (Supabase-compatible)
|
|
1611
1680
|
* Sends a password reset link to the provided email address
|
|
1612
1681
|
* @param email - Email address to send reset link to
|
|
1682
|
+
* @returns Promise with OTP-style response
|
|
1613
1683
|
*/
|
|
1614
1684
|
sendPasswordReset(email: string): Promise<DataResponse<PasswordResetResponse>>;
|
|
1615
1685
|
/**
|
|
1616
1686
|
* Supabase-compatible alias for sendPasswordReset()
|
|
1617
1687
|
* @param email - Email address to send reset link to
|
|
1618
1688
|
* @param _options - Optional redirect configuration (currently not used)
|
|
1689
|
+
* @returns Promise with OTP-style response
|
|
1619
1690
|
*/
|
|
1620
1691
|
resetPasswordForEmail(email: string, _options?: {
|
|
1621
1692
|
redirectTo?: string;
|
|
@@ -1627,16 +1698,18 @@ declare class FluxbaseAuth {
|
|
|
1627
1698
|
*/
|
|
1628
1699
|
verifyResetToken(token: string): Promise<DataResponse<VerifyResetTokenResponse>>;
|
|
1629
1700
|
/**
|
|
1630
|
-
* Reset password with token
|
|
1701
|
+
* Reset password with token (Supabase-compatible)
|
|
1631
1702
|
* Complete the password reset process with a valid token
|
|
1632
1703
|
* @param token - Password reset token
|
|
1633
1704
|
* @param newPassword - New password to set
|
|
1705
|
+
* @returns Promise with user and new session
|
|
1634
1706
|
*/
|
|
1635
1707
|
resetPassword(token: string, newPassword: string): Promise<DataResponse<ResetPasswordResponse>>;
|
|
1636
1708
|
/**
|
|
1637
|
-
* Send magic link for passwordless authentication
|
|
1709
|
+
* Send magic link for passwordless authentication (Supabase-compatible)
|
|
1638
1710
|
* @param email - Email address to send magic link to
|
|
1639
1711
|
* @param options - Optional configuration for magic link
|
|
1712
|
+
* @returns Promise with OTP-style response
|
|
1640
1713
|
*/
|
|
1641
1714
|
sendMagicLink(email: string, options?: MagicLinkOptions): Promise<DataResponse<MagicLinkResponse>>;
|
|
1642
1715
|
/**
|
|
@@ -4694,4 +4767,4 @@ declare class FluxbaseClient<Database = any, _SchemaName extends string & keyof
|
|
|
4694
4767
|
*/
|
|
4695
4768
|
declare function createClient<Database = any, SchemaName extends string & keyof Database = any>(fluxbaseUrl: string, fluxbaseKey: string, options?: FluxbaseClientOptions): FluxbaseClient<Database, SchemaName>;
|
|
4696
4769
|
|
|
4697
|
-
export { type APIKey, APIKeysManager, type AcceptInvitationRequest, type AcceptInvitationResponse, type AdminAuthResponse, type AdminLoginRequest, type AdminMeResponse, type AdminRefreshRequest, type AdminRefreshResponse, type AdminSetupRequest, type AdminSetupStatusResponse, type AdminUser, type AppSettings, AppSettingsManager, type AuthResponse, type AuthSession, type AuthSettings, AuthSettingsManager, type AuthenticationSettings, type BroadcastCallback, type BroadcastMessage, type Column, type CreateAPIKeyRequest, type CreateAPIKeyResponse, type CreateColumnRequest, type CreateFunctionRequest, type CreateInvitationRequest, type CreateInvitationResponse, type CreateOAuthProviderRequest, type CreateOAuthProviderResponse, type CreateSchemaRequest, type CreateSchemaResponse, type CreateTableRequest, type CreateTableResponse, type CreateWebhookRequest, DDLManager, type DataResponse, type DeleteAPIKeyResponse, type DeleteOAuthProviderResponse, type DeleteTableResponse, type DeleteUserResponse, type DeleteWebhookResponse, type EdgeFunction, type EdgeFunctionExecution, type EmailSettings, type EmailTemplate, EmailTemplateManager, type EmailTemplateType, type EnrichedUser, type FeatureSettings, type FileObject, type FilterOperator, FluxbaseAdmin, FluxbaseAuth, type FluxbaseAuthResponse, FluxbaseClient, type FluxbaseClientOptions, type FluxbaseError, FluxbaseFetch, FluxbaseFunctions, FluxbaseManagement, FluxbaseOAuth, FluxbaseRealtime, type FluxbaseResponse, FluxbaseSettings, FluxbaseStorage, type FunctionInvokeOptions, type GetImpersonationResponse, type HttpMethod, type ImpersonateAnonRequest, type ImpersonateServiceRequest, type ImpersonateUserRequest, ImpersonationManager, type ImpersonationSession, type ImpersonationTargetUser, type ImpersonationType, type Invitation, InvitationsManager, type InviteUserRequest, type InviteUserResponse, type ListAPIKeysResponse, type ListEmailTemplatesResponse, type ListImpersonationSessionsOptions, type ListImpersonationSessionsResponse, type ListInvitationsOptions, type ListInvitationsResponse, type ListOAuthProvidersResponse, type ListOptions, type ListSchemasResponse, type ListSystemSettingsResponse, type ListTablesResponse, type ListUsersOptions, type ListUsersResponse, type ListWebhookDeliveriesResponse, type ListWebhooksResponse, type MailgunSettings, type OAuthProvider, OAuthProviderManager, type OrderBy, type OrderDirection, type PostgresChangesConfig, type PostgrestError, type PostgrestResponse, type PresenceCallback, type PresenceState, QueryBuilder, type QueryFilter, type RealtimeBroadcastPayload, type RealtimeCallback, type RealtimeChangePayload, RealtimeChannel, type RealtimeChannelConfig, type RealtimeMessage, type RealtimePostgresChangesPayload, type RealtimePresencePayload, type RequestOptions, type ResetUserPasswordResponse, type RevokeAPIKeyResponse, type RevokeInvitationResponse, type SESSettings, type SMTPSettings, type Schema, type SecuritySettings, type SendGridSettings, type SessionResponse, SettingsClient, type SignInCredentials, type SignInWith2FAResponse, type SignUpCredentials, type SignedUrlOptions, type StartImpersonationResponse, type StopImpersonationResponse, StorageBucket, type StorageObject, type SupabaseAuthResponse, type SupabaseResponse, type SystemSetting, SystemSettingsManager, type Table, type TestEmailTemplateRequest, type TestWebhookResponse, type TwoFactorEnableResponse, type TwoFactorSetupResponse, type TwoFactorStatusResponse, type TwoFactorVerifyRequest, type UpdateAPIKeyRequest, type UpdateAppSettingsRequest, type UpdateAuthSettingsRequest, type UpdateAuthSettingsResponse, type UpdateEmailTemplateRequest, type UpdateFunctionRequest, type UpdateOAuthProviderRequest, type UpdateOAuthProviderResponse, type UpdateSystemSettingRequest, type UpdateUserRoleRequest, type UpdateWebhookRequest, type UploadOptions, type UploadProgress, type User, type UserResponse, type ValidateInvitationResponse, type VoidResponse, type Webhook, type WebhookDelivery, WebhooksManager, createClient };
|
|
4770
|
+
export { type APIKey, APIKeysManager, type AcceptInvitationRequest, type AcceptInvitationResponse, type AdminAuthResponse, type AdminLoginRequest, type AdminMeResponse, type AdminRefreshRequest, type AdminRefreshResponse, type AdminSetupRequest, type AdminSetupStatusResponse, type AdminUser, type AppSettings, AppSettingsManager, type AuthResponse, type AuthResponseData, type AuthSession, type AuthSettings, AuthSettingsManager, type AuthenticationSettings, type BroadcastCallback, type BroadcastMessage, type Column, type CreateAPIKeyRequest, type CreateAPIKeyResponse, type CreateColumnRequest, type CreateFunctionRequest, type CreateInvitationRequest, type CreateInvitationResponse, type CreateOAuthProviderRequest, type CreateOAuthProviderResponse, type CreateSchemaRequest, type CreateSchemaResponse, type CreateTableRequest, type CreateTableResponse, type CreateWebhookRequest, DDLManager, type DataResponse, type DeleteAPIKeyResponse, type DeleteOAuthProviderResponse, type DeleteTableResponse, type DeleteUserResponse, type DeleteWebhookResponse, type EdgeFunction, type EdgeFunctionExecution, type EmailSettings, type EmailTemplate, EmailTemplateManager, type EmailTemplateType, type EnrichedUser, type FeatureSettings, type FileObject, type FilterOperator, FluxbaseAdmin, FluxbaseAuth, type FluxbaseAuthResponse, FluxbaseClient, type FluxbaseClientOptions, type FluxbaseError, FluxbaseFetch, FluxbaseFunctions, FluxbaseManagement, FluxbaseOAuth, FluxbaseRealtime, type FluxbaseResponse, FluxbaseSettings, FluxbaseStorage, type FunctionInvokeOptions, type GetImpersonationResponse, type HttpMethod, type ImpersonateAnonRequest, type ImpersonateServiceRequest, type ImpersonateUserRequest, ImpersonationManager, type ImpersonationSession, type ImpersonationTargetUser, type ImpersonationType, type Invitation, InvitationsManager, type InviteUserRequest, type InviteUserResponse, type ListAPIKeysResponse, type ListEmailTemplatesResponse, type ListImpersonationSessionsOptions, type ListImpersonationSessionsResponse, type ListInvitationsOptions, type ListInvitationsResponse, type ListOAuthProvidersResponse, type ListOptions, type ListSchemasResponse, type ListSystemSettingsResponse, type ListTablesResponse, type ListUsersOptions, type ListUsersResponse, type ListWebhookDeliveriesResponse, type ListWebhooksResponse, type MailgunSettings, type OAuthProvider, OAuthProviderManager, type OrderBy, type OrderDirection, type PostgresChangesConfig, type PostgrestError, type PostgrestResponse, type PresenceCallback, type PresenceState, QueryBuilder, type QueryFilter, type RealtimeBroadcastPayload, type RealtimeCallback, type RealtimeChangePayload, RealtimeChannel, type RealtimeChannelConfig, type RealtimeMessage, type RealtimePostgresChangesPayload, type RealtimePresencePayload, type RequestOptions, type ResetUserPasswordResponse, type RevokeAPIKeyResponse, type RevokeInvitationResponse, type SESSettings, type SMTPSettings, type Schema, type SecuritySettings, type SendGridSettings, type SessionResponse, SettingsClient, type SignInCredentials, type SignInWith2FAResponse, type SignUpCredentials, type SignedUrlOptions, type StartImpersonationResponse, type StopImpersonationResponse, StorageBucket, type StorageObject, type SupabaseAuthResponse, type SupabaseResponse, type SystemSetting, SystemSettingsManager, type Table, type TestEmailTemplateRequest, type TestWebhookResponse, type TwoFactorEnableResponse, type TwoFactorSetupResponse, type TwoFactorStatusResponse, type TwoFactorVerifyRequest, type UpdateAPIKeyRequest, type UpdateAppSettingsRequest, type UpdateAuthSettingsRequest, type UpdateAuthSettingsResponse, type UpdateEmailTemplateRequest, type UpdateFunctionRequest, type UpdateOAuthProviderRequest, type UpdateOAuthProviderResponse, type UpdateSystemSettingRequest, type UpdateUserRoleRequest, type UpdateWebhookRequest, type UploadOptions, type UploadProgress, type User, type UserResponse, type ValidateInvitationResponse, type VoidResponse, type WeakPassword, type Webhook, type WebhookDelivery, WebhooksManager, createClient };
|
package/dist/index.d.ts
CHANGED
|
@@ -71,18 +71,55 @@ interface AuthResponse {
|
|
|
71
71
|
refresh_token: string;
|
|
72
72
|
expires_in: number;
|
|
73
73
|
}
|
|
74
|
-
|
|
74
|
+
/**
|
|
75
|
+
* MFA Factor (Supabase-compatible)
|
|
76
|
+
*/
|
|
77
|
+
interface Factor {
|
|
78
|
+
id: string;
|
|
79
|
+
type: 'totp' | 'phone';
|
|
80
|
+
status: 'verified' | 'unverified';
|
|
81
|
+
created_at: string;
|
|
82
|
+
updated_at: string;
|
|
83
|
+
friendly_name?: string;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* TOTP setup details (Supabase-compatible)
|
|
87
|
+
*/
|
|
88
|
+
interface TOTPSetup {
|
|
89
|
+
qr_code: string;
|
|
75
90
|
secret: string;
|
|
76
|
-
|
|
77
|
-
|
|
91
|
+
uri: string;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* MFA enroll response (Supabase-compatible)
|
|
95
|
+
*/
|
|
96
|
+
interface TwoFactorSetupResponse {
|
|
97
|
+
id: string;
|
|
98
|
+
type: 'totp';
|
|
99
|
+
totp: TOTPSetup;
|
|
78
100
|
}
|
|
101
|
+
/**
|
|
102
|
+
* MFA verify/enable response (Supabase-compatible)
|
|
103
|
+
*/
|
|
79
104
|
interface TwoFactorEnableResponse {
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
105
|
+
access_token: string;
|
|
106
|
+
refresh_token: string;
|
|
107
|
+
user: User;
|
|
108
|
+
token_type?: string;
|
|
109
|
+
expires_in?: number;
|
|
83
110
|
}
|
|
111
|
+
/**
|
|
112
|
+
* MFA status response (Supabase-compatible)
|
|
113
|
+
*/
|
|
84
114
|
interface TwoFactorStatusResponse {
|
|
85
|
-
|
|
115
|
+
all: Factor[];
|
|
116
|
+
totp: Factor[];
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* MFA unenroll response (Supabase-compatible)
|
|
120
|
+
*/
|
|
121
|
+
interface TwoFactorDisableResponse {
|
|
122
|
+
id: string;
|
|
86
123
|
}
|
|
87
124
|
interface TwoFactorVerifyRequest {
|
|
88
125
|
user_id: string;
|
|
@@ -304,21 +341,38 @@ interface Bucket {
|
|
|
304
341
|
created_at: string;
|
|
305
342
|
updated_at: string;
|
|
306
343
|
}
|
|
344
|
+
/**
|
|
345
|
+
* Password reset email sent response (Supabase-compatible)
|
|
346
|
+
* Returns OTP-style response similar to Supabase's AuthOtpResponse
|
|
347
|
+
*/
|
|
307
348
|
interface PasswordResetResponse {
|
|
308
|
-
|
|
349
|
+
user: null;
|
|
350
|
+
session: null;
|
|
351
|
+
messageId?: string;
|
|
309
352
|
}
|
|
353
|
+
/**
|
|
354
|
+
* Verify password reset token response (Fluxbase extension)
|
|
355
|
+
*/
|
|
310
356
|
interface VerifyResetTokenResponse {
|
|
311
357
|
valid: boolean;
|
|
312
358
|
message: string;
|
|
313
359
|
}
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
360
|
+
/**
|
|
361
|
+
* Reset password completion response (Supabase-compatible)
|
|
362
|
+
* Returns user and session after successful password reset
|
|
363
|
+
*/
|
|
364
|
+
type ResetPasswordResponse = AuthResponseData;
|
|
317
365
|
interface MagicLinkOptions {
|
|
318
366
|
redirect_to?: string;
|
|
319
367
|
}
|
|
368
|
+
/**
|
|
369
|
+
* Magic link sent response (Supabase-compatible)
|
|
370
|
+
* Returns OTP-style response similar to Supabase's AuthOtpResponse
|
|
371
|
+
*/
|
|
320
372
|
interface MagicLinkResponse {
|
|
321
|
-
|
|
373
|
+
user: null;
|
|
374
|
+
session: null;
|
|
375
|
+
messageId?: string;
|
|
322
376
|
}
|
|
323
377
|
interface OAuthProvidersResponse {
|
|
324
378
|
providers: OAuthProvider[];
|
|
@@ -1145,11 +1199,18 @@ type VoidResponse = {
|
|
|
1145
1199
|
error: Error | null;
|
|
1146
1200
|
};
|
|
1147
1201
|
/**
|
|
1148
|
-
*
|
|
1202
|
+
* Weak password information (Supabase-compatible)
|
|
1203
|
+
*/
|
|
1204
|
+
interface WeakPassword {
|
|
1205
|
+
reasons: string[];
|
|
1206
|
+
}
|
|
1207
|
+
/**
|
|
1208
|
+
* Auth response with user and session (Supabase-compatible)
|
|
1149
1209
|
*/
|
|
1150
1210
|
type AuthResponseData = {
|
|
1151
1211
|
user: User;
|
|
1152
|
-
session: AuthSession;
|
|
1212
|
+
session: AuthSession | null;
|
|
1213
|
+
weakPassword?: WeakPassword;
|
|
1153
1214
|
};
|
|
1154
1215
|
/**
|
|
1155
1216
|
* Fluxbase auth response
|
|
@@ -1535,18 +1596,20 @@ declare class FluxbaseAuth {
|
|
|
1535
1596
|
};
|
|
1536
1597
|
};
|
|
1537
1598
|
/**
|
|
1538
|
-
* Sign in with email and password
|
|
1539
|
-
* Returns
|
|
1599
|
+
* Sign in with email and password (Supabase-compatible)
|
|
1600
|
+
* Returns { user, session } if successful, or SignInWith2FAResponse if 2FA is required
|
|
1540
1601
|
*/
|
|
1541
|
-
signIn(credentials: SignInCredentials): Promise<FluxbaseResponse<
|
|
1602
|
+
signIn(credentials: SignInCredentials): Promise<FluxbaseResponse<AuthResponseData | SignInWith2FAResponse>>;
|
|
1542
1603
|
/**
|
|
1543
|
-
* Sign in with email and password
|
|
1604
|
+
* Sign in with email and password (Supabase-compatible)
|
|
1544
1605
|
* Alias for signIn() to maintain compatibility with common authentication patterns
|
|
1545
|
-
* Returns
|
|
1606
|
+
* Returns { user, session } if successful, or SignInWith2FAResponse if 2FA is required
|
|
1546
1607
|
*/
|
|
1547
|
-
signInWithPassword(credentials: SignInCredentials): Promise<FluxbaseResponse<
|
|
1608
|
+
signInWithPassword(credentials: SignInCredentials): Promise<FluxbaseResponse<AuthResponseData | SignInWith2FAResponse>>;
|
|
1548
1609
|
/**
|
|
1549
|
-
* Sign up with email and password
|
|
1610
|
+
* Sign up with email and password (Supabase-compatible)
|
|
1611
|
+
* Returns session when email confirmation is disabled
|
|
1612
|
+
* Returns null session when email confirmation is required
|
|
1550
1613
|
*/
|
|
1551
1614
|
signUp(credentials: SignUpCredentials): Promise<FluxbaseAuthResponse>;
|
|
1552
1615
|
/**
|
|
@@ -1558,8 +1621,8 @@ declare class FluxbaseAuth {
|
|
|
1558
1621
|
* Returns a new session with refreshed tokens
|
|
1559
1622
|
*/
|
|
1560
1623
|
refreshSession(): Promise<FluxbaseResponse<{
|
|
1561
|
-
session: AuthSession;
|
|
1562
1624
|
user: User;
|
|
1625
|
+
session: AuthSession;
|
|
1563
1626
|
}>>;
|
|
1564
1627
|
/**
|
|
1565
1628
|
* Get the current user from the server
|
|
@@ -1580,42 +1643,50 @@ declare class FluxbaseAuth {
|
|
|
1580
1643
|
refresh_token: string;
|
|
1581
1644
|
}): Promise<FluxbaseAuthResponse>;
|
|
1582
1645
|
/**
|
|
1583
|
-
* Setup 2FA for the current user
|
|
1584
|
-
*
|
|
1646
|
+
* Setup 2FA for the current user (Supabase-compatible)
|
|
1647
|
+
* Enrolls a new MFA factor and returns TOTP details
|
|
1648
|
+
* @returns Promise with factor id, type, and TOTP setup details
|
|
1585
1649
|
*/
|
|
1586
1650
|
setup2FA(): Promise<DataResponse<TwoFactorSetupResponse>>;
|
|
1587
1651
|
/**
|
|
1588
|
-
* Enable 2FA after verifying the TOTP code
|
|
1589
|
-
*
|
|
1652
|
+
* Enable 2FA after verifying the TOTP code (Supabase-compatible)
|
|
1653
|
+
* Verifies the TOTP code and returns new tokens with MFA session
|
|
1654
|
+
* @param code - TOTP code from authenticator app
|
|
1655
|
+
* @returns Promise with access_token, refresh_token, and user
|
|
1590
1656
|
*/
|
|
1591
1657
|
enable2FA(code: string): Promise<DataResponse<TwoFactorEnableResponse>>;
|
|
1592
1658
|
/**
|
|
1593
|
-
* Disable 2FA for the current user
|
|
1594
|
-
*
|
|
1659
|
+
* Disable 2FA for the current user (Supabase-compatible)
|
|
1660
|
+
* Unenrolls the MFA factor
|
|
1661
|
+
* @param password - User password for confirmation
|
|
1662
|
+
* @returns Promise with unenrolled factor id
|
|
1595
1663
|
*/
|
|
1596
|
-
disable2FA(password: string): Promise<DataResponse<
|
|
1597
|
-
success: boolean;
|
|
1598
|
-
message: string;
|
|
1599
|
-
}>>;
|
|
1664
|
+
disable2FA(password: string): Promise<DataResponse<TwoFactorDisableResponse>>;
|
|
1600
1665
|
/**
|
|
1601
|
-
* Check 2FA status for the current user
|
|
1666
|
+
* Check 2FA status for the current user (Supabase-compatible)
|
|
1667
|
+
* Lists all enrolled MFA factors
|
|
1668
|
+
* @returns Promise with all factors and TOTP factors
|
|
1602
1669
|
*/
|
|
1603
1670
|
get2FAStatus(): Promise<DataResponse<TwoFactorStatusResponse>>;
|
|
1604
1671
|
/**
|
|
1605
|
-
* Verify 2FA code during login
|
|
1672
|
+
* Verify 2FA code during login (Supabase-compatible)
|
|
1606
1673
|
* Call this after signIn returns requires_2fa: true
|
|
1674
|
+
* @param request - User ID and TOTP code
|
|
1675
|
+
* @returns Promise with access_token, refresh_token, and user
|
|
1607
1676
|
*/
|
|
1608
|
-
verify2FA(request: TwoFactorVerifyRequest): Promise<
|
|
1677
|
+
verify2FA(request: TwoFactorVerifyRequest): Promise<DataResponse<TwoFactorEnableResponse>>;
|
|
1609
1678
|
/**
|
|
1610
|
-
* Send password reset email
|
|
1679
|
+
* Send password reset email (Supabase-compatible)
|
|
1611
1680
|
* Sends a password reset link to the provided email address
|
|
1612
1681
|
* @param email - Email address to send reset link to
|
|
1682
|
+
* @returns Promise with OTP-style response
|
|
1613
1683
|
*/
|
|
1614
1684
|
sendPasswordReset(email: string): Promise<DataResponse<PasswordResetResponse>>;
|
|
1615
1685
|
/**
|
|
1616
1686
|
* Supabase-compatible alias for sendPasswordReset()
|
|
1617
1687
|
* @param email - Email address to send reset link to
|
|
1618
1688
|
* @param _options - Optional redirect configuration (currently not used)
|
|
1689
|
+
* @returns Promise with OTP-style response
|
|
1619
1690
|
*/
|
|
1620
1691
|
resetPasswordForEmail(email: string, _options?: {
|
|
1621
1692
|
redirectTo?: string;
|
|
@@ -1627,16 +1698,18 @@ declare class FluxbaseAuth {
|
|
|
1627
1698
|
*/
|
|
1628
1699
|
verifyResetToken(token: string): Promise<DataResponse<VerifyResetTokenResponse>>;
|
|
1629
1700
|
/**
|
|
1630
|
-
* Reset password with token
|
|
1701
|
+
* Reset password with token (Supabase-compatible)
|
|
1631
1702
|
* Complete the password reset process with a valid token
|
|
1632
1703
|
* @param token - Password reset token
|
|
1633
1704
|
* @param newPassword - New password to set
|
|
1705
|
+
* @returns Promise with user and new session
|
|
1634
1706
|
*/
|
|
1635
1707
|
resetPassword(token: string, newPassword: string): Promise<DataResponse<ResetPasswordResponse>>;
|
|
1636
1708
|
/**
|
|
1637
|
-
* Send magic link for passwordless authentication
|
|
1709
|
+
* Send magic link for passwordless authentication (Supabase-compatible)
|
|
1638
1710
|
* @param email - Email address to send magic link to
|
|
1639
1711
|
* @param options - Optional configuration for magic link
|
|
1712
|
+
* @returns Promise with OTP-style response
|
|
1640
1713
|
*/
|
|
1641
1714
|
sendMagicLink(email: string, options?: MagicLinkOptions): Promise<DataResponse<MagicLinkResponse>>;
|
|
1642
1715
|
/**
|
|
@@ -4694,4 +4767,4 @@ declare class FluxbaseClient<Database = any, _SchemaName extends string & keyof
|
|
|
4694
4767
|
*/
|
|
4695
4768
|
declare function createClient<Database = any, SchemaName extends string & keyof Database = any>(fluxbaseUrl: string, fluxbaseKey: string, options?: FluxbaseClientOptions): FluxbaseClient<Database, SchemaName>;
|
|
4696
4769
|
|
|
4697
|
-
export { type APIKey, APIKeysManager, type AcceptInvitationRequest, type AcceptInvitationResponse, type AdminAuthResponse, type AdminLoginRequest, type AdminMeResponse, type AdminRefreshRequest, type AdminRefreshResponse, type AdminSetupRequest, type AdminSetupStatusResponse, type AdminUser, type AppSettings, AppSettingsManager, type AuthResponse, type AuthSession, type AuthSettings, AuthSettingsManager, type AuthenticationSettings, type BroadcastCallback, type BroadcastMessage, type Column, type CreateAPIKeyRequest, type CreateAPIKeyResponse, type CreateColumnRequest, type CreateFunctionRequest, type CreateInvitationRequest, type CreateInvitationResponse, type CreateOAuthProviderRequest, type CreateOAuthProviderResponse, type CreateSchemaRequest, type CreateSchemaResponse, type CreateTableRequest, type CreateTableResponse, type CreateWebhookRequest, DDLManager, type DataResponse, type DeleteAPIKeyResponse, type DeleteOAuthProviderResponse, type DeleteTableResponse, type DeleteUserResponse, type DeleteWebhookResponse, type EdgeFunction, type EdgeFunctionExecution, type EmailSettings, type EmailTemplate, EmailTemplateManager, type EmailTemplateType, type EnrichedUser, type FeatureSettings, type FileObject, type FilterOperator, FluxbaseAdmin, FluxbaseAuth, type FluxbaseAuthResponse, FluxbaseClient, type FluxbaseClientOptions, type FluxbaseError, FluxbaseFetch, FluxbaseFunctions, FluxbaseManagement, FluxbaseOAuth, FluxbaseRealtime, type FluxbaseResponse, FluxbaseSettings, FluxbaseStorage, type FunctionInvokeOptions, type GetImpersonationResponse, type HttpMethod, type ImpersonateAnonRequest, type ImpersonateServiceRequest, type ImpersonateUserRequest, ImpersonationManager, type ImpersonationSession, type ImpersonationTargetUser, type ImpersonationType, type Invitation, InvitationsManager, type InviteUserRequest, type InviteUserResponse, type ListAPIKeysResponse, type ListEmailTemplatesResponse, type ListImpersonationSessionsOptions, type ListImpersonationSessionsResponse, type ListInvitationsOptions, type ListInvitationsResponse, type ListOAuthProvidersResponse, type ListOptions, type ListSchemasResponse, type ListSystemSettingsResponse, type ListTablesResponse, type ListUsersOptions, type ListUsersResponse, type ListWebhookDeliveriesResponse, type ListWebhooksResponse, type MailgunSettings, type OAuthProvider, OAuthProviderManager, type OrderBy, type OrderDirection, type PostgresChangesConfig, type PostgrestError, type PostgrestResponse, type PresenceCallback, type PresenceState, QueryBuilder, type QueryFilter, type RealtimeBroadcastPayload, type RealtimeCallback, type RealtimeChangePayload, RealtimeChannel, type RealtimeChannelConfig, type RealtimeMessage, type RealtimePostgresChangesPayload, type RealtimePresencePayload, type RequestOptions, type ResetUserPasswordResponse, type RevokeAPIKeyResponse, type RevokeInvitationResponse, type SESSettings, type SMTPSettings, type Schema, type SecuritySettings, type SendGridSettings, type SessionResponse, SettingsClient, type SignInCredentials, type SignInWith2FAResponse, type SignUpCredentials, type SignedUrlOptions, type StartImpersonationResponse, type StopImpersonationResponse, StorageBucket, type StorageObject, type SupabaseAuthResponse, type SupabaseResponse, type SystemSetting, SystemSettingsManager, type Table, type TestEmailTemplateRequest, type TestWebhookResponse, type TwoFactorEnableResponse, type TwoFactorSetupResponse, type TwoFactorStatusResponse, type TwoFactorVerifyRequest, type UpdateAPIKeyRequest, type UpdateAppSettingsRequest, type UpdateAuthSettingsRequest, type UpdateAuthSettingsResponse, type UpdateEmailTemplateRequest, type UpdateFunctionRequest, type UpdateOAuthProviderRequest, type UpdateOAuthProviderResponse, type UpdateSystemSettingRequest, type UpdateUserRoleRequest, type UpdateWebhookRequest, type UploadOptions, type UploadProgress, type User, type UserResponse, type ValidateInvitationResponse, type VoidResponse, type Webhook, type WebhookDelivery, WebhooksManager, createClient };
|
|
4770
|
+
export { type APIKey, APIKeysManager, type AcceptInvitationRequest, type AcceptInvitationResponse, type AdminAuthResponse, type AdminLoginRequest, type AdminMeResponse, type AdminRefreshRequest, type AdminRefreshResponse, type AdminSetupRequest, type AdminSetupStatusResponse, type AdminUser, type AppSettings, AppSettingsManager, type AuthResponse, type AuthResponseData, type AuthSession, type AuthSettings, AuthSettingsManager, type AuthenticationSettings, type BroadcastCallback, type BroadcastMessage, type Column, type CreateAPIKeyRequest, type CreateAPIKeyResponse, type CreateColumnRequest, type CreateFunctionRequest, type CreateInvitationRequest, type CreateInvitationResponse, type CreateOAuthProviderRequest, type CreateOAuthProviderResponse, type CreateSchemaRequest, type CreateSchemaResponse, type CreateTableRequest, type CreateTableResponse, type CreateWebhookRequest, DDLManager, type DataResponse, type DeleteAPIKeyResponse, type DeleteOAuthProviderResponse, type DeleteTableResponse, type DeleteUserResponse, type DeleteWebhookResponse, type EdgeFunction, type EdgeFunctionExecution, type EmailSettings, type EmailTemplate, EmailTemplateManager, type EmailTemplateType, type EnrichedUser, type FeatureSettings, type FileObject, type FilterOperator, FluxbaseAdmin, FluxbaseAuth, type FluxbaseAuthResponse, FluxbaseClient, type FluxbaseClientOptions, type FluxbaseError, FluxbaseFetch, FluxbaseFunctions, FluxbaseManagement, FluxbaseOAuth, FluxbaseRealtime, type FluxbaseResponse, FluxbaseSettings, FluxbaseStorage, type FunctionInvokeOptions, type GetImpersonationResponse, type HttpMethod, type ImpersonateAnonRequest, type ImpersonateServiceRequest, type ImpersonateUserRequest, ImpersonationManager, type ImpersonationSession, type ImpersonationTargetUser, type ImpersonationType, type Invitation, InvitationsManager, type InviteUserRequest, type InviteUserResponse, type ListAPIKeysResponse, type ListEmailTemplatesResponse, type ListImpersonationSessionsOptions, type ListImpersonationSessionsResponse, type ListInvitationsOptions, type ListInvitationsResponse, type ListOAuthProvidersResponse, type ListOptions, type ListSchemasResponse, type ListSystemSettingsResponse, type ListTablesResponse, type ListUsersOptions, type ListUsersResponse, type ListWebhookDeliveriesResponse, type ListWebhooksResponse, type MailgunSettings, type OAuthProvider, OAuthProviderManager, type OrderBy, type OrderDirection, type PostgresChangesConfig, type PostgrestError, type PostgrestResponse, type PresenceCallback, type PresenceState, QueryBuilder, type QueryFilter, type RealtimeBroadcastPayload, type RealtimeCallback, type RealtimeChangePayload, RealtimeChannel, type RealtimeChannelConfig, type RealtimeMessage, type RealtimePostgresChangesPayload, type RealtimePresencePayload, type RequestOptions, type ResetUserPasswordResponse, type RevokeAPIKeyResponse, type RevokeInvitationResponse, type SESSettings, type SMTPSettings, type Schema, type SecuritySettings, type SendGridSettings, type SessionResponse, SettingsClient, type SignInCredentials, type SignInWith2FAResponse, type SignUpCredentials, type SignedUrlOptions, type StartImpersonationResponse, type StopImpersonationResponse, StorageBucket, type StorageObject, type SupabaseAuthResponse, type SupabaseResponse, type SystemSetting, SystemSettingsManager, type Table, type TestEmailTemplateRequest, type TestWebhookResponse, type TwoFactorEnableResponse, type TwoFactorSetupResponse, type TwoFactorStatusResponse, type TwoFactorVerifyRequest, type UpdateAPIKeyRequest, type UpdateAppSettingsRequest, type UpdateAuthSettingsRequest, type UpdateAuthSettingsResponse, type UpdateEmailTemplateRequest, type UpdateFunctionRequest, type UpdateOAuthProviderRequest, type UpdateOAuthProviderResponse, type UpdateSystemSettingRequest, type UpdateUserRoleRequest, type UpdateWebhookRequest, type UploadOptions, type UploadProgress, type User, type UserResponse, type ValidateInvitationResponse, type VoidResponse, type WeakPassword, type Webhook, type WebhookDelivery, WebhooksManager, createClient };
|