@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.
package/README.md CHANGED
File without changes
@@ -0,0 +1,255 @@
1
+ import React, { ReactNode } from 'react';
2
+
3
+ interface LoginFormProps {
4
+ onSuccess?: (response: {
5
+ message: string;
6
+ email?: string;
7
+ token?: string;
8
+ success: boolean;
9
+ user?: any;
10
+ }) => void;
11
+ onLoginSuccess?: (email: string, needsOtpVerification: boolean) => void;
12
+ onRegisterClick?: () => void;
13
+ showRegisterLink?: boolean;
14
+ config?: {
15
+ baseUrl?: string;
16
+ };
17
+ oauthProviders?: Array<'google' | 'github'>;
18
+ showOAuthButtons?: boolean;
19
+ }
20
+ declare const LoginForm: React.FC<LoginFormProps>;
21
+
22
+ interface AuthConfig {
23
+ baseUrl: string;
24
+ localStorageKey?: string;
25
+ token?: string;
26
+ csrfEnabled?: boolean;
27
+ upfilesConfig?: UpfilesConfig;
28
+ }
29
+ interface UpfilesConfig {
30
+ baseUrl: string;
31
+ apiKey?: string;
32
+ apiKeyHeader?: 'authorization' | 'x-api-key' | 'x-up-api-key';
33
+ presignUrl?: string;
34
+ presignPath?: string;
35
+ folderPath?: string;
36
+ }
37
+
38
+ interface RegisterFormProps {
39
+ onRegisterSuccess?: () => void;
40
+ onLoginClick?: () => void;
41
+ showLoginLink?: boolean;
42
+ authConfig?: AuthConfig;
43
+ oauthProviders?: Array<'google' | 'github'>;
44
+ showOAuthButtons?: boolean;
45
+ invitationToken?: string | null;
46
+ }
47
+ declare const RegisterForm: React.FC<RegisterFormProps>;
48
+
49
+ interface OtpFormProps {
50
+ email: string;
51
+ onVerifySuccess?: () => void;
52
+ onBackToLogin?: () => void;
53
+ baseUrl?: string;
54
+ }
55
+ declare const OtpForm: React.FC<OtpFormProps>;
56
+
57
+ type AuthStep = 'login' | 'register' | 'otp';
58
+ interface AuthFlowProps {
59
+ onAuthComplete?: () => void;
60
+ initialStep?: AuthStep;
61
+ showTitle?: boolean;
62
+ }
63
+ declare const AuthFlow: React.FC<AuthFlowProps>;
64
+
65
+ interface EmailVerificationPageProps {
66
+ token: string;
67
+ onVerificationSuccess?: () => void;
68
+ onVerificationError?: (error: string) => void;
69
+ baseUrl?: string;
70
+ }
71
+ declare const EmailVerificationPage: React.FC<EmailVerificationPageProps>;
72
+
73
+ interface SignInProps {
74
+ redirectUrl?: string;
75
+ appearance?: {
76
+ elements?: {
77
+ formButtonPrimary?: React.CSSProperties;
78
+ card?: React.CSSProperties;
79
+ headerTitle?: React.CSSProperties;
80
+ formFieldInput?: React.CSSProperties;
81
+ };
82
+ };
83
+ routing?: 'path' | 'virtual';
84
+ path?: string;
85
+ }
86
+ declare const SignIn: React.FC<SignInProps>;
87
+
88
+ interface SignUpProps {
89
+ redirectUrl?: string;
90
+ appearance?: {
91
+ elements?: {
92
+ formButtonPrimary?: React.CSSProperties;
93
+ card?: React.CSSProperties;
94
+ headerTitle?: React.CSSProperties;
95
+ formFieldInput?: React.CSSProperties;
96
+ };
97
+ };
98
+ }
99
+ declare const SignUp: React.FC<SignUpProps>;
100
+
101
+ interface SignOutProps {
102
+ redirectUrl?: string;
103
+ }
104
+ declare const SignOut: React.FC<SignOutProps>;
105
+
106
+ interface UserButtonProps {
107
+ showName?: boolean;
108
+ appearance?: {
109
+ elements?: {
110
+ userButtonBox?: React.CSSProperties;
111
+ userButtonTrigger?: React.CSSProperties;
112
+ userButtonPopoverCard?: React.CSSProperties;
113
+ };
114
+ };
115
+ }
116
+ declare const UserButton: React.FC<UserButtonProps>;
117
+
118
+ interface ProtectedRouteProps {
119
+ children: ReactNode;
120
+ fallback?: ReactNode;
121
+ redirectTo?: string;
122
+ }
123
+ declare const ProtectedRoute: React.FC<ProtectedRouteProps>;
124
+
125
+ interface PublicRouteProps {
126
+ children: ReactNode;
127
+ redirectTo?: string;
128
+ }
129
+ declare const PublicRoute: React.FC<PublicRouteProps>;
130
+
131
+ interface VerifyEmailProps {
132
+ token?: string;
133
+ onSuccess?: () => void;
134
+ onError?: (error: string) => void;
135
+ }
136
+ declare const VerifyEmail: React.FC<VerifyEmailProps>;
137
+
138
+ interface ForgotPasswordProps {
139
+ appearance?: {
140
+ elements?: {
141
+ formButtonPrimary?: React.CSSProperties;
142
+ card?: React.CSSProperties;
143
+ headerTitle?: React.CSSProperties;
144
+ formFieldInput?: React.CSSProperties;
145
+ };
146
+ };
147
+ }
148
+ declare const ForgotPassword: React.FC<ForgotPasswordProps>;
149
+
150
+ interface ResetPasswordProps {
151
+ token?: string;
152
+ appearance?: {
153
+ elements?: {
154
+ formButtonPrimary?: React.CSSProperties;
155
+ card?: React.CSSProperties;
156
+ headerTitle?: React.CSSProperties;
157
+ formFieldInput?: React.CSSProperties;
158
+ };
159
+ };
160
+ }
161
+ declare const ResetPassword: React.FC<ResetPasswordProps>;
162
+
163
+ interface ChangePasswordProps {
164
+ onSuccess?: () => void;
165
+ appearance?: {
166
+ elements?: {
167
+ formButtonPrimary?: React.CSSProperties;
168
+ card?: React.CSSProperties;
169
+ headerTitle?: React.CSSProperties;
170
+ formFieldInput?: React.CSSProperties;
171
+ };
172
+ };
173
+ }
174
+ declare const ChangePassword: React.FC<ChangePasswordProps>;
175
+
176
+ interface UserProfileProps {
177
+ showAvatar?: boolean;
178
+ showEmailChange?: boolean;
179
+ showPasswordChange?: boolean;
180
+ upfilesConfig?: {
181
+ baseUrl: string;
182
+ apiKey?: string;
183
+ apiKeyHeader?: 'authorization' | 'x-api-key' | 'x-up-api-key';
184
+ presignUrl?: string;
185
+ presignPath?: string;
186
+ folderPath?: string;
187
+ projectId?: string;
188
+ };
189
+ }
190
+ declare const UserProfile: React.FC<UserProfileProps>;
191
+
192
+ interface PhoneInputProps {
193
+ value: string;
194
+ onChange: (value: string) => void;
195
+ disabled?: boolean;
196
+ required?: boolean;
197
+ placeholder?: string;
198
+ id?: string;
199
+ style?: React.CSSProperties;
200
+ }
201
+ declare const PhoneInput: React.FC<PhoneInputProps>;
202
+
203
+ interface AvatarUploaderProps {
204
+ onUploadComplete?: (avatarUrl: string) => void;
205
+ onError?: (error: Error) => void;
206
+ className?: string;
207
+ buttonClassName?: string;
208
+ dropzoneClassName?: string;
209
+ maxFileSize?: number;
210
+ accept?: string[];
211
+ upfilesConfig: {
212
+ baseUrl: string;
213
+ apiKey?: string;
214
+ apiKeyHeader?: 'authorization' | 'x-api-key' | 'x-up-api-key';
215
+ presignUrl?: string;
216
+ presignPath?: string;
217
+ folderPath?: string;
218
+ projectId?: string;
219
+ };
220
+ buttonText?: string;
221
+ }
222
+ declare const AvatarUploader: React.FC<AvatarUploaderProps>;
223
+
224
+ interface AvatarManagerProps {
225
+ open: boolean;
226
+ onOpenChange: (open: boolean) => void;
227
+ onAvatarUpdated?: (avatarUrl: string) => void;
228
+ onError?: (error: Error) => void;
229
+ title?: string;
230
+ description?: string;
231
+ className?: string;
232
+ gridClassName?: string;
233
+ maxFileSize?: number;
234
+ maxFiles?: number;
235
+ mode?: 'full' | 'browse' | 'upload';
236
+ showDelete?: boolean;
237
+ autoRecordToDb?: boolean;
238
+ fetchThumbnails?: boolean;
239
+ projectId?: string;
240
+ deleteUrl?: string;
241
+ onDelete?: (key: string) => Promise<void>;
242
+ upfilesConfig: {
243
+ baseUrl: string;
244
+ apiKey?: string;
245
+ apiKeyHeader?: 'authorization' | 'x-api-key' | 'x-up-api-key';
246
+ presignUrl?: string;
247
+ presignPath?: string;
248
+ folderPath?: string;
249
+ headers?: Record<string, string>;
250
+ withCredentials?: boolean;
251
+ };
252
+ }
253
+ declare const AvatarManager: React.FC<AvatarManagerProps>;
254
+
255
+ export { AuthFlow, AvatarManager, type AvatarManagerProps, AvatarUploader, type AvatarUploaderProps, ChangePassword, EmailVerificationPage, ForgotPassword, LoginForm, OtpForm, PhoneInput, ProtectedRoute, PublicRoute, RegisterForm, type RegisterFormProps, ResetPassword, SignIn, SignOut, SignUp, UserButton, UserProfile, VerifyEmail };
@@ -231,8 +231,14 @@ interface AvatarManagerProps {
231
231
  className?: string;
232
232
  gridClassName?: string;
233
233
  maxFileSize?: number;
234
+ maxFiles?: number;
234
235
  mode?: 'full' | 'browse' | 'upload';
235
236
  showDelete?: boolean;
237
+ autoRecordToDb?: boolean;
238
+ fetchThumbnails?: boolean;
239
+ projectId?: string;
240
+ deleteUrl?: string;
241
+ onDelete?: (key: string) => Promise<void>;
236
242
  upfilesConfig: {
237
243
  baseUrl: string;
238
244
  apiKey?: string;
@@ -240,8 +246,10 @@ interface AvatarManagerProps {
240
246
  presignUrl?: string;
241
247
  presignPath?: string;
242
248
  folderPath?: string;
249
+ headers?: Record<string, string>;
250
+ withCredentials?: boolean;
243
251
  };
244
252
  }
245
253
  declare const AvatarManager: React.FC<AvatarManagerProps>;
246
254
 
247
- export { AuthFlow, AvatarManager, AvatarManagerProps, AvatarUploader, AvatarUploaderProps, ChangePassword, EmailVerificationPage, ForgotPassword, LoginForm, OtpForm, PhoneInput, ProtectedRoute, PublicRoute, RegisterForm, RegisterFormProps, ResetPassword, SignIn, SignOut, SignUp, UserButton, UserProfile, VerifyEmail };
255
+ export { AuthFlow, AvatarManager, type AvatarManagerProps, AvatarUploader, type AvatarUploaderProps, ChangePassword, EmailVerificationPage, ForgotPassword, LoginForm, OtpForm, PhoneInput, ProtectedRoute, PublicRoute, RegisterForm, type RegisterFormProps, ResetPassword, SignIn, SignOut, SignUp, UserButton, UserProfile, VerifyEmail };