@thetechfossil/auth2 1.2.14 → 1.2.16

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.
@@ -0,0 +1,566 @@
1
+ import { UpfilesClient } from '@thetechfossil/upfiles';
2
+ export { ConnectProjectDialog, ImageManager, ProjectFilesWidget, UpfilesClient, Uploader } from '@thetechfossil/upfiles';
3
+ import React, { ReactNode } from 'react';
4
+ import * as react_jsx_runtime from 'react/jsx-runtime';
5
+
6
+ interface LinkedAccount {
7
+ provider: 'google' | 'github';
8
+ providerId: string;
9
+ email: string;
10
+ avatar?: string;
11
+ }
12
+ interface User {
13
+ id: string;
14
+ _id?: string;
15
+ name: string;
16
+ email: string;
17
+ phoneNumber?: string;
18
+ avatar?: string;
19
+ role: string;
20
+ linkedAccounts?: LinkedAccount[];
21
+ createdAt: string;
22
+ updatedAt: string;
23
+ }
24
+ interface AuthResponse {
25
+ success: boolean;
26
+ message: string;
27
+ user?: User;
28
+ token?: string;
29
+ csrfToken?: string;
30
+ }
31
+ interface LoginData {
32
+ email?: string;
33
+ phoneNumber?: string;
34
+ password?: string;
35
+ otp?: string;
36
+ }
37
+ interface VerifyData {
38
+ email?: string;
39
+ phoneNumber?: string;
40
+ otp: string;
41
+ }
42
+ interface RegisterData {
43
+ name: string;
44
+ email?: string;
45
+ phoneNumber?: string;
46
+ password: string;
47
+ }
48
+ interface UpdateUserData {
49
+ name?: string;
50
+ avatar?: string;
51
+ email?: string;
52
+ username?: string;
53
+ phoneNumber?: string;
54
+ }
55
+ type OAuthProvider = 'google' | 'github';
56
+ interface OAuthConfig {
57
+ provider: OAuthProvider;
58
+ redirectUri?: string;
59
+ }
60
+ interface CsrfTokenResponse {
61
+ success: boolean;
62
+ csrfToken: string;
63
+ }
64
+ interface AuthConfig {
65
+ baseUrl: string;
66
+ localStorageKey?: string;
67
+ token?: string;
68
+ csrfEnabled?: boolean;
69
+ upfilesConfig?: UpfilesConfig;
70
+ }
71
+ interface UpfilesConfig {
72
+ baseUrl: string;
73
+ apiKey?: string;
74
+ apiKeyHeader?: 'authorization' | 'x-api-key' | 'x-up-api-key';
75
+ presignUrl?: string;
76
+ presignPath?: string;
77
+ folderPath?: string;
78
+ }
79
+ interface Session {
80
+ id: string;
81
+ userId?: string;
82
+ token?: string;
83
+ userAgent?: string;
84
+ ipAddress?: string;
85
+ expiresAt: string;
86
+ createdAt: string;
87
+ updatedAt?: string;
88
+ }
89
+ interface MFASetup {
90
+ success: boolean;
91
+ qrCode?: string;
92
+ secret?: string;
93
+ message: string;
94
+ }
95
+ interface AuditLog {
96
+ id: string;
97
+ userId: string;
98
+ action: string;
99
+ details?: any;
100
+ ipAddress?: string;
101
+ timestamp: string;
102
+ }
103
+ interface UseAuthReturn {
104
+ user: User | null;
105
+ isAuthenticated: boolean;
106
+ loading: boolean;
107
+ register: (data: RegisterData) => Promise<AuthResponse>;
108
+ login: (data: LoginData) => Promise<AuthResponse>;
109
+ loginWithOAuth: (provider: OAuthProvider) => void;
110
+ verify: (data: VerifyData) => Promise<AuthResponse>;
111
+ verifyEmailToken: (token: string) => Promise<AuthResponse>;
112
+ logout: () => Promise<void>;
113
+ updateProfile: (data: UpdateUserData) => Promise<AuthResponse>;
114
+ getProfile: () => Promise<User>;
115
+ getAllUsers: () => Promise<User[]>;
116
+ getUserById: (id: string) => Promise<User>;
117
+ linkOAuthProvider: (provider: OAuthProvider) => void;
118
+ unlinkOAuthProvider: (provider: OAuthProvider) => Promise<AuthResponse>;
119
+ csrfToken: string | null;
120
+ refreshCsrfToken: () => Promise<void>;
121
+ changePassword: (oldPassword: string, newPassword: string) => Promise<AuthResponse>;
122
+ updateAvatar: (avatar: string) => Promise<AuthResponse>;
123
+ uploadAndUpdateAvatar: (file: File) => Promise<AuthResponse>;
124
+ requestEmailChange: (newEmail: string) => Promise<AuthResponse>;
125
+ verifyEmailChange: (token: string) => Promise<AuthResponse>;
126
+ generate2FA: () => Promise<MFASetup>;
127
+ enable2FA: (token: string) => Promise<AuthResponse>;
128
+ disable2FA: (token: string) => Promise<AuthResponse>;
129
+ validate2FA: (token: string) => Promise<AuthResponse>;
130
+ getSessions: () => Promise<{
131
+ success: boolean;
132
+ sessions: Session[];
133
+ }>;
134
+ revokeSession: (sessionId: string) => Promise<AuthResponse>;
135
+ revokeAllSessions: () => Promise<AuthResponse>;
136
+ }
137
+
138
+ declare class AuthService {
139
+ private httpClient;
140
+ private config;
141
+ private token;
142
+ private upfilesClient;
143
+ constructor(config: AuthConfig);
144
+ private loadTokenFromStorage;
145
+ private saveTokenToStorage;
146
+ private removeTokenFromStorage;
147
+ isAuthenticated(): boolean;
148
+ getToken(): string | null;
149
+ getCurrentUser(): User | null;
150
+ refreshCsrfToken(): Promise<void>;
151
+ getCsrfToken(): string | null;
152
+ loginWithOAuth(provider: OAuthProvider): void;
153
+ linkOAuthProvider(provider: OAuthProvider): void;
154
+ unlinkOAuthProvider(provider: OAuthProvider): Promise<AuthResponse>;
155
+ login(data: LoginData): Promise<AuthResponse>;
156
+ register(data: RegisterData): Promise<AuthResponse>;
157
+ verify(data: VerifyData): Promise<AuthResponse>;
158
+ verifyEmailToken(token: string): Promise<AuthResponse>;
159
+ logout(): Promise<void>;
160
+ getProfile(): Promise<User>;
161
+ updateProfile(data: UpdateUserData): Promise<AuthResponse>;
162
+ getAllUsers(): Promise<User[]>;
163
+ getUserById(id: string): Promise<User>;
164
+ forgotPassword(email: string): Promise<AuthResponse>;
165
+ resetPassword(token: string, password: string): Promise<AuthResponse>;
166
+ changePassword(oldPassword: string, newPassword: string): Promise<AuthResponse>;
167
+ updateAvatar(avatar: string): Promise<AuthResponse>;
168
+ uploadAndUpdateAvatar(file: File): Promise<AuthResponse>;
169
+ getUpfilesClient(): UpfilesClient | null;
170
+ requestEmailChange(newEmail: string): Promise<AuthResponse>;
171
+ verifyEmailChange(token: string): Promise<AuthResponse>;
172
+ generate2FA(): Promise<{
173
+ success: boolean;
174
+ qrCode?: string;
175
+ secret?: string;
176
+ message: string;
177
+ }>;
178
+ enable2FA(token: string): Promise<AuthResponse>;
179
+ disable2FA(token: string): Promise<AuthResponse>;
180
+ validate2FA(token: string): Promise<AuthResponse>;
181
+ getSessions(): Promise<{
182
+ success: boolean;
183
+ sessions: any[];
184
+ }>;
185
+ revokeSession(sessionId: string): Promise<AuthResponse>;
186
+ revokeAllSessions(): Promise<AuthResponse>;
187
+ getAuditLogs(filters?: any): Promise<{
188
+ success: boolean;
189
+ logs: any[];
190
+ }>;
191
+ adminVerifyUser(userId: string): Promise<AuthResponse>;
192
+ adminForcePasswordReset(userId: string): Promise<AuthResponse>;
193
+ adminSuspendUser(userId: string): Promise<AuthResponse>;
194
+ adminActivateUser(userId: string): Promise<AuthResponse>;
195
+ }
196
+
197
+ declare class HttpClient {
198
+ private axiosInstance;
199
+ private csrfToken;
200
+ private frontendBaseUrl;
201
+ private baseUrl;
202
+ constructor(baseUrl: string, defaultHeaders?: Record<string, string>);
203
+ get<T>(endpoint: string, headers?: Record<string, string>): Promise<T>;
204
+ post<T>(endpoint: string, data?: any, headers?: Record<string, string>): Promise<T>;
205
+ put<T>(endpoint: string, data?: any, headers?: Record<string, string>): Promise<T>;
206
+ delete<T>(endpoint: string, headers?: Record<string, string>): Promise<T>;
207
+ setAuthToken(token: string): void;
208
+ removeAuthToken(): void;
209
+ setCsrfToken(token: string): void;
210
+ getCsrfToken(): string | null;
211
+ removeCsrfToken(): void;
212
+ setFrontendBaseUrl(url: string): void;
213
+ getFrontendBaseUrl(): string | null;
214
+ removeFrontendBaseUrl(): void;
215
+ private refreshCsrfToken;
216
+ }
217
+
218
+ interface AuthContextValue {
219
+ user: User | null;
220
+ isLoaded: boolean;
221
+ isSignedIn: boolean;
222
+ loading: boolean;
223
+ signIn: (data: LoginData) => Promise<AuthResponse>;
224
+ signUp: (data: RegisterData) => Promise<AuthResponse>;
225
+ signOut: () => Promise<void>;
226
+ verify: (data: VerifyData) => Promise<AuthResponse>;
227
+ verifyEmailToken: (token: string) => Promise<AuthResponse>;
228
+ updateProfile: (data: UpdateUserData) => Promise<AuthResponse>;
229
+ getProfile: () => Promise<User>;
230
+ signInWithOAuth: (provider: OAuthProvider) => void;
231
+ linkOAuthProvider: (provider: OAuthProvider) => void;
232
+ unlinkOAuthProvider: (provider: OAuthProvider) => Promise<AuthResponse>;
233
+ forgotPassword: (email: string) => Promise<AuthResponse>;
234
+ resetPassword: (token: string, password: string) => Promise<AuthResponse>;
235
+ changePassword: (oldPassword: string, newPassword: string) => Promise<AuthResponse>;
236
+ updateAvatar: (avatar: string) => Promise<AuthResponse>;
237
+ uploadAndUpdateAvatar: (file: File) => Promise<AuthResponse>;
238
+ requestEmailChange: (newEmail: string) => Promise<AuthResponse>;
239
+ verifyEmailChange: (token: string) => Promise<AuthResponse>;
240
+ generate2FA: () => Promise<any>;
241
+ enable2FA: (token: string) => Promise<AuthResponse>;
242
+ disable2FA: (token: string) => Promise<AuthResponse>;
243
+ validate2FA: (token: string) => Promise<AuthResponse>;
244
+ getSessions: () => Promise<any>;
245
+ revokeSession: (sessionId: string) => Promise<AuthResponse>;
246
+ revokeAllSessions: () => Promise<AuthResponse>;
247
+ authService: AuthService;
248
+ }
249
+ interface AuthProviderProps {
250
+ children: ReactNode;
251
+ config?: Partial<AuthConfig>;
252
+ }
253
+ declare const AuthProvider: React.FC<AuthProviderProps>;
254
+ declare const useAuth$1: () => AuthContextValue;
255
+
256
+ interface LoginFormProps {
257
+ onSuccess?: (response: {
258
+ message: string;
259
+ email?: string;
260
+ token?: string;
261
+ success: boolean;
262
+ user?: any;
263
+ }) => void;
264
+ onLoginSuccess?: (email: string, needsOtpVerification: boolean) => void;
265
+ onRegisterClick?: () => void;
266
+ showRegisterLink?: boolean;
267
+ config?: {
268
+ baseUrl?: string;
269
+ };
270
+ oauthProviders?: Array<'google' | 'github'>;
271
+ showOAuthButtons?: boolean;
272
+ }
273
+ declare const LoginForm: React.FC<LoginFormProps>;
274
+
275
+ interface RegisterFormProps {
276
+ onRegisterSuccess?: () => void;
277
+ onLoginClick?: () => void;
278
+ showLoginLink?: boolean;
279
+ authConfig?: AuthConfig;
280
+ oauthProviders?: Array<'google' | 'github'>;
281
+ showOAuthButtons?: boolean;
282
+ invitationToken?: string | null;
283
+ }
284
+ declare const RegisterForm: React.FC<RegisterFormProps>;
285
+
286
+ interface OtpFormProps {
287
+ email: string;
288
+ onVerifySuccess?: () => void;
289
+ onBackToLogin?: () => void;
290
+ baseUrl?: string;
291
+ }
292
+ declare const OtpForm: React.FC<OtpFormProps>;
293
+
294
+ type AuthStep = 'login' | 'register' | 'otp';
295
+ interface AuthFlowProps {
296
+ onAuthComplete?: () => void;
297
+ initialStep?: AuthStep;
298
+ showTitle?: boolean;
299
+ }
300
+ declare const AuthFlow: React.FC<AuthFlowProps>;
301
+
302
+ interface EmailVerificationPageProps {
303
+ token: string;
304
+ onVerificationSuccess?: () => void;
305
+ onVerificationError?: (error: string) => void;
306
+ baseUrl?: string;
307
+ }
308
+ declare const EmailVerificationPage: React.FC<EmailVerificationPageProps>;
309
+
310
+ interface SignInProps {
311
+ redirectUrl?: string;
312
+ appearance?: {
313
+ elements?: {
314
+ formButtonPrimary?: React.CSSProperties;
315
+ card?: React.CSSProperties;
316
+ headerTitle?: React.CSSProperties;
317
+ formFieldInput?: React.CSSProperties;
318
+ };
319
+ };
320
+ routing?: 'path' | 'virtual';
321
+ path?: string;
322
+ }
323
+ declare const SignIn: React.FC<SignInProps>;
324
+
325
+ interface SignUpProps {
326
+ redirectUrl?: string;
327
+ appearance?: {
328
+ elements?: {
329
+ formButtonPrimary?: React.CSSProperties;
330
+ card?: React.CSSProperties;
331
+ headerTitle?: React.CSSProperties;
332
+ formFieldInput?: React.CSSProperties;
333
+ };
334
+ };
335
+ }
336
+ declare const SignUp: React.FC<SignUpProps>;
337
+
338
+ interface SignOutProps {
339
+ redirectUrl?: string;
340
+ }
341
+ declare const SignOut: React.FC<SignOutProps>;
342
+
343
+ interface UserButtonProps {
344
+ showName?: boolean;
345
+ appearance?: {
346
+ elements?: {
347
+ userButtonBox?: React.CSSProperties;
348
+ userButtonTrigger?: React.CSSProperties;
349
+ userButtonPopoverCard?: React.CSSProperties;
350
+ };
351
+ };
352
+ }
353
+ declare const UserButton: React.FC<UserButtonProps>;
354
+
355
+ interface ProtectedRouteProps {
356
+ children: ReactNode;
357
+ fallback?: ReactNode;
358
+ redirectTo?: string;
359
+ }
360
+ declare const ProtectedRoute: React.FC<ProtectedRouteProps>;
361
+
362
+ interface PublicRouteProps {
363
+ children: ReactNode;
364
+ redirectTo?: string;
365
+ }
366
+ declare const PublicRoute: React.FC<PublicRouteProps>;
367
+
368
+ interface VerifyEmailProps {
369
+ token?: string;
370
+ onSuccess?: () => void;
371
+ onError?: (error: string) => void;
372
+ }
373
+ declare const VerifyEmail: React.FC<VerifyEmailProps>;
374
+
375
+ interface ForgotPasswordProps {
376
+ appearance?: {
377
+ elements?: {
378
+ formButtonPrimary?: React.CSSProperties;
379
+ card?: React.CSSProperties;
380
+ headerTitle?: React.CSSProperties;
381
+ formFieldInput?: React.CSSProperties;
382
+ };
383
+ };
384
+ }
385
+ declare const ForgotPassword: React.FC<ForgotPasswordProps>;
386
+
387
+ interface ResetPasswordProps {
388
+ token?: string;
389
+ appearance?: {
390
+ elements?: {
391
+ formButtonPrimary?: React.CSSProperties;
392
+ card?: React.CSSProperties;
393
+ headerTitle?: React.CSSProperties;
394
+ formFieldInput?: React.CSSProperties;
395
+ };
396
+ };
397
+ }
398
+ declare const ResetPassword: React.FC<ResetPasswordProps>;
399
+
400
+ interface ChangePasswordProps {
401
+ onSuccess?: () => void;
402
+ appearance?: {
403
+ elements?: {
404
+ formButtonPrimary?: React.CSSProperties;
405
+ card?: React.CSSProperties;
406
+ headerTitle?: React.CSSProperties;
407
+ formFieldInput?: React.CSSProperties;
408
+ };
409
+ };
410
+ }
411
+ declare const ChangePassword: React.FC<ChangePasswordProps>;
412
+
413
+ interface UserProfileProps {
414
+ showAvatar?: boolean;
415
+ showEmailChange?: boolean;
416
+ showPasswordChange?: boolean;
417
+ upfilesConfig?: {
418
+ baseUrl: string;
419
+ apiKey?: string;
420
+ apiKeyHeader?: 'authorization' | 'x-api-key' | 'x-up-api-key';
421
+ presignUrl?: string;
422
+ presignPath?: string;
423
+ folderPath?: string;
424
+ projectId?: string;
425
+ };
426
+ }
427
+ declare const UserProfile: React.FC<UserProfileProps>;
428
+
429
+ interface PhoneInputProps {
430
+ value: string;
431
+ onChange: (value: string) => void;
432
+ disabled?: boolean;
433
+ required?: boolean;
434
+ placeholder?: string;
435
+ id?: string;
436
+ style?: React.CSSProperties;
437
+ }
438
+ declare const PhoneInput: React.FC<PhoneInputProps>;
439
+
440
+ interface AvatarUploaderProps {
441
+ onUploadComplete?: (avatarUrl: string) => void;
442
+ onError?: (error: Error) => void;
443
+ className?: string;
444
+ buttonClassName?: string;
445
+ dropzoneClassName?: string;
446
+ maxFileSize?: number;
447
+ accept?: string[];
448
+ upfilesConfig: {
449
+ baseUrl: string;
450
+ apiKey?: string;
451
+ apiKeyHeader?: 'authorization' | 'x-api-key' | 'x-up-api-key';
452
+ presignUrl?: string;
453
+ presignPath?: string;
454
+ folderPath?: string;
455
+ projectId?: string;
456
+ };
457
+ buttonText?: string;
458
+ }
459
+ declare const AvatarUploader: React.FC<AvatarUploaderProps>;
460
+
461
+ interface AvatarManagerProps {
462
+ open: boolean;
463
+ onOpenChange: (open: boolean) => void;
464
+ onAvatarUpdated?: (avatarUrl: string) => void;
465
+ onError?: (error: Error) => void;
466
+ title?: string;
467
+ description?: string;
468
+ className?: string;
469
+ gridClassName?: string;
470
+ maxFileSize?: number;
471
+ maxFiles?: number;
472
+ mode?: 'full' | 'browse' | 'upload';
473
+ showDelete?: boolean;
474
+ autoRecordToDb?: boolean;
475
+ fetchThumbnails?: boolean;
476
+ projectId?: string;
477
+ deleteUrl?: string;
478
+ onDelete?: (key: string) => Promise<void>;
479
+ upfilesConfig: {
480
+ baseUrl: string;
481
+ apiKey?: string;
482
+ apiKeyHeader?: 'authorization' | 'x-api-key' | 'x-up-api-key';
483
+ presignUrl?: string;
484
+ presignPath?: string;
485
+ folderPath?: string;
486
+ headers?: Record<string, string>;
487
+ withCredentials?: boolean;
488
+ };
489
+ }
490
+ declare const AvatarManager: React.FC<AvatarManagerProps>;
491
+
492
+ interface UseAuthReturnBase {
493
+ user: User | null;
494
+ isAuthenticated: boolean;
495
+ loading: boolean;
496
+ register: (data: RegisterData) => Promise<AuthResponse>;
497
+ login: (data: LoginData) => Promise<AuthResponse>;
498
+ verify: (data: VerifyData) => Promise<AuthResponse>;
499
+ verifyEmailToken: (token: string) => Promise<AuthResponse>;
500
+ logout: () => Promise<void>;
501
+ updateProfile: (data: UpdateUserData) => Promise<AuthResponse>;
502
+ getProfile: () => Promise<User>;
503
+ getAllUsers: () => Promise<User[]>;
504
+ getUserById: (id: string) => Promise<User>;
505
+ uploadAndUpdateAvatar: (file: File) => Promise<AuthResponse>;
506
+ }
507
+ declare const useAuth: (config: AuthConfig) => UseAuthReturnBase;
508
+
509
+ type Theme = 'light' | 'dark';
510
+ interface ThemeContextType {
511
+ theme: Theme;
512
+ mounted: boolean;
513
+ }
514
+ declare function AuthThemeProvider({ children }: {
515
+ children: ReactNode;
516
+ }): react_jsx_runtime.JSX.Element;
517
+ declare function useAuthTheme(): ThemeContextType;
518
+
519
+ declare const index$1_AuthFlow: typeof AuthFlow;
520
+ declare const index$1_AuthProvider: typeof AuthProvider;
521
+ declare const index$1_AuthThemeProvider: typeof AuthThemeProvider;
522
+ declare const index$1_AvatarManager: typeof AvatarManager;
523
+ type index$1_AvatarManagerProps = AvatarManagerProps;
524
+ declare const index$1_AvatarUploader: typeof AvatarUploader;
525
+ type index$1_AvatarUploaderProps = AvatarUploaderProps;
526
+ declare const index$1_ChangePassword: typeof ChangePassword;
527
+ declare const index$1_EmailVerificationPage: typeof EmailVerificationPage;
528
+ declare const index$1_ForgotPassword: typeof ForgotPassword;
529
+ declare const index$1_LoginForm: typeof LoginForm;
530
+ declare const index$1_OtpForm: typeof OtpForm;
531
+ declare const index$1_PhoneInput: typeof PhoneInput;
532
+ declare const index$1_ProtectedRoute: typeof ProtectedRoute;
533
+ declare const index$1_PublicRoute: typeof PublicRoute;
534
+ declare const index$1_RegisterForm: typeof RegisterForm;
535
+ type index$1_RegisterFormProps = RegisterFormProps;
536
+ declare const index$1_ResetPassword: typeof ResetPassword;
537
+ declare const index$1_SignIn: typeof SignIn;
538
+ declare const index$1_SignOut: typeof SignOut;
539
+ declare const index$1_SignUp: typeof SignUp;
540
+ declare const index$1_UserButton: typeof UserButton;
541
+ declare const index$1_UserProfile: typeof UserProfile;
542
+ declare const index$1_VerifyEmail: typeof VerifyEmail;
543
+ declare const index$1_useAuthTheme: typeof useAuthTheme;
544
+ declare namespace index$1 {
545
+ export { index$1_AuthFlow as AuthFlow, index$1_AuthProvider as AuthProvider, index$1_AuthThemeProvider as AuthThemeProvider, index$1_AvatarManager as AvatarManager, type index$1_AvatarManagerProps as AvatarManagerProps, index$1_AvatarUploader as AvatarUploader, type index$1_AvatarUploaderProps as AvatarUploaderProps, index$1_ChangePassword as ChangePassword, index$1_EmailVerificationPage as EmailVerificationPage, index$1_ForgotPassword as ForgotPassword, index$1_LoginForm as LoginForm, index$1_OtpForm as OtpForm, index$1_PhoneInput as PhoneInput, index$1_ProtectedRoute as ProtectedRoute, index$1_PublicRoute as PublicRoute, index$1_RegisterForm as RegisterForm, type index$1_RegisterFormProps as RegisterFormProps, index$1_ResetPassword as ResetPassword, index$1_SignIn as SignIn, index$1_SignOut as SignOut, index$1_SignUp as SignUp, index$1_UserButton as UserButton, index$1_UserProfile as UserProfile, index$1_VerifyEmail as VerifyEmail, useAuth$1 as useAuth, useAuth as useAuthLegacy, index$1_useAuthTheme as useAuthTheme };
546
+ }
547
+
548
+ declare class AuthClient extends AuthService {
549
+ constructor(config: AuthConfig);
550
+ register(data: RegisterData): Promise<AuthResponse>;
551
+ login(data: LoginData): Promise<AuthResponse>;
552
+ verify(data: VerifyData): Promise<AuthResponse>;
553
+ logout(): Promise<void>;
554
+ getProfile(): Promise<User>;
555
+ getUserById(id: string): Promise<User>;
556
+ updateProfile(data: UpdateUserData): Promise<AuthResponse>;
557
+ getAllUsers(): Promise<User[]>;
558
+ }
559
+
560
+ type index_AuthClient = AuthClient;
561
+ declare const index_AuthClient: typeof AuthClient;
562
+ declare namespace index {
563
+ export { index_AuthClient as AuthClient };
564
+ }
565
+
566
+ export { type AuditLog, type AuthConfig, AuthFlow, AuthProvider, type AuthResponse, AuthService, AvatarManager, AvatarUploader, ChangePassword, type CsrfTokenResponse, EmailVerificationPage, ForgotPassword, HttpClient, type LinkedAccount, type LoginData, LoginForm, type MFASetup, type OAuthConfig, type OAuthProvider, OtpForm, ProtectedRoute, PublicRoute, type RegisterData, RegisterForm, ResetPassword, type Session, SignIn, SignOut, SignUp, type UpdateUserData, type UpfilesConfig, type UseAuthReturn, type User, UserButton, UserProfile, type VerifyData, VerifyEmail, index as node, index$1 as react, useAuth$1 as useAuth };
package/dist/index.d.ts CHANGED
@@ -468,8 +468,14 @@ interface AvatarManagerProps {
468
468
  className?: string;
469
469
  gridClassName?: string;
470
470
  maxFileSize?: number;
471
+ maxFiles?: number;
471
472
  mode?: 'full' | 'browse' | 'upload';
472
473
  showDelete?: boolean;
474
+ autoRecordToDb?: boolean;
475
+ fetchThumbnails?: boolean;
476
+ projectId?: string;
477
+ deleteUrl?: string;
478
+ onDelete?: (key: string) => Promise<void>;
473
479
  upfilesConfig: {
474
480
  baseUrl: string;
475
481
  apiKey?: string;
@@ -477,6 +483,8 @@ interface AvatarManagerProps {
477
483
  presignUrl?: string;
478
484
  presignPath?: string;
479
485
  folderPath?: string;
486
+ headers?: Record<string, string>;
487
+ withCredentials?: boolean;
480
488
  };
481
489
  }
482
490
  declare const AvatarManager: React.FC<AvatarManagerProps>;
@@ -534,35 +542,7 @@ declare const index$1_UserProfile: typeof UserProfile;
534
542
  declare const index$1_VerifyEmail: typeof VerifyEmail;
535
543
  declare const index$1_useAuthTheme: typeof useAuthTheme;
536
544
  declare namespace index$1 {
537
- export {
538
- index$1_AuthFlow as AuthFlow,
539
- index$1_AuthProvider as AuthProvider,
540
- index$1_AuthThemeProvider as AuthThemeProvider,
541
- index$1_AvatarManager as AvatarManager,
542
- index$1_AvatarManagerProps as AvatarManagerProps,
543
- index$1_AvatarUploader as AvatarUploader,
544
- index$1_AvatarUploaderProps as AvatarUploaderProps,
545
- index$1_ChangePassword as ChangePassword,
546
- index$1_EmailVerificationPage as EmailVerificationPage,
547
- index$1_ForgotPassword as ForgotPassword,
548
- index$1_LoginForm as LoginForm,
549
- index$1_OtpForm as OtpForm,
550
- index$1_PhoneInput as PhoneInput,
551
- index$1_ProtectedRoute as ProtectedRoute,
552
- index$1_PublicRoute as PublicRoute,
553
- index$1_RegisterForm as RegisterForm,
554
- index$1_RegisterFormProps as RegisterFormProps,
555
- index$1_ResetPassword as ResetPassword,
556
- index$1_SignIn as SignIn,
557
- index$1_SignOut as SignOut,
558
- index$1_SignUp as SignUp,
559
- index$1_UserButton as UserButton,
560
- index$1_UserProfile as UserProfile,
561
- index$1_VerifyEmail as VerifyEmail,
562
- useAuth$1 as useAuth,
563
- useAuth as useAuthLegacy,
564
- index$1_useAuthTheme as useAuthTheme,
565
- };
545
+ export { index$1_AuthFlow as AuthFlow, index$1_AuthProvider as AuthProvider, index$1_AuthThemeProvider as AuthThemeProvider, index$1_AvatarManager as AvatarManager, type index$1_AvatarManagerProps as AvatarManagerProps, index$1_AvatarUploader as AvatarUploader, type index$1_AvatarUploaderProps as AvatarUploaderProps, index$1_ChangePassword as ChangePassword, index$1_EmailVerificationPage as EmailVerificationPage, index$1_ForgotPassword as ForgotPassword, index$1_LoginForm as LoginForm, index$1_OtpForm as OtpForm, index$1_PhoneInput as PhoneInput, index$1_ProtectedRoute as ProtectedRoute, index$1_PublicRoute as PublicRoute, index$1_RegisterForm as RegisterForm, type index$1_RegisterFormProps as RegisterFormProps, index$1_ResetPassword as ResetPassword, index$1_SignIn as SignIn, index$1_SignOut as SignOut, index$1_SignUp as SignUp, index$1_UserButton as UserButton, index$1_UserProfile as UserProfile, index$1_VerifyEmail as VerifyEmail, useAuth$1 as useAuth, useAuth as useAuthLegacy, index$1_useAuthTheme as useAuthTheme };
566
546
  }
567
547
 
568
548
  declare class AuthClient extends AuthService {
@@ -580,9 +560,7 @@ declare class AuthClient extends AuthService {
580
560
  type index_AuthClient = AuthClient;
581
561
  declare const index_AuthClient: typeof AuthClient;
582
562
  declare namespace index {
583
- export {
584
- index_AuthClient as AuthClient,
585
- };
563
+ export { index_AuthClient as AuthClient };
586
564
  }
587
565
 
588
- export { AuditLog, AuthConfig, AuthFlow, AuthProvider, AuthResponse, AuthService, AvatarManager, AvatarUploader, ChangePassword, CsrfTokenResponse, EmailVerificationPage, ForgotPassword, HttpClient, LinkedAccount, LoginData, LoginForm, MFASetup, OAuthConfig, OAuthProvider, OtpForm, ProtectedRoute, PublicRoute, RegisterData, RegisterForm, ResetPassword, Session, SignIn, SignOut, SignUp, UpdateUserData, UpfilesConfig, UseAuthReturn, User, UserButton, UserProfile, VerifyData, VerifyEmail, index as node, index$1 as react, useAuth$1 as useAuth };
566
+ export { type AuditLog, type AuthConfig, AuthFlow, AuthProvider, type AuthResponse, AuthService, AvatarManager, AvatarUploader, ChangePassword, type CsrfTokenResponse, EmailVerificationPage, ForgotPassword, HttpClient, type LinkedAccount, type LoginData, LoginForm, type MFASetup, type OAuthConfig, type OAuthProvider, OtpForm, ProtectedRoute, PublicRoute, type RegisterData, RegisterForm, ResetPassword, type Session, SignIn, SignOut, SignUp, type UpdateUserData, type UpfilesConfig, type UseAuthReturn, type User, UserButton, UserProfile, type VerifyData, VerifyEmail, index as node, index$1 as react, useAuth$1 as useAuth };