@umituz/react-native-auth 4.3.80 → 4.3.82
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/package.json +4 -1
- package/src/index.ts +303 -6
- package/src/infrastructure/services/AnonymousModeService.ts +18 -8
- package/src/infrastructure/services/AuthService.ts +9 -4
- package/src/infrastructure/utils/AuthValidation.ts +2 -2
- package/src/infrastructure/utils/calculators/passwordStrengthCalculator.ts +2 -2
- package/src/infrastructure/utils/listener/anonymousSignIn/createAnonymousSignInHandler.ts +0 -1
- package/src/infrastructure/utils/listener/anonymousSignIn/types.ts +3 -1
- package/src/infrastructure/utils/listener/listenerState.util.ts +2 -1
- package/src/infrastructure/utils/validation/types.ts +2 -28
- package/src/presentation/components/PasswordStrengthIndicator.tsx +1 -1
- package/src/presentation/components/RegisterForm/RegisterForm.tsx +3 -1
- package/src/presentation/components/RegisterForm/RegisterFormFields.tsx +3 -2
- package/src/presentation/hooks/auth/types.ts +0 -1
- package/src/presentation/hooks/auth/useSocialAuthHandlers.ts +2 -2
- package/src/presentation/hooks/useAuthBottomSheet.ts +2 -2
- package/src/presentation/hooks/useAuthHandlers.ts +4 -2
- package/src/presentation/navigation/AuthNavigator.tsx +28 -7
- package/src/presentation/utils/form/usePasswordValidation.hook.ts +3 -3
- package/src/shared/error-handling/handlers/FormErrorHandler.ts +1 -6
- package/src/shared/error-handling/handlers/index.ts +1 -1
- package/src/shared/error-handling/mappers/ErrorMapper.ts +5 -1
- package/src/shared/error-handling/types/ErrorTypes.ts +5 -0
- package/src/shared/error-handling/types/index.ts +1 -0
- package/src/shared/form/builders/FieldBuilder.ts +1 -2
- package/src/shared/form/builders/FormBuilder.ts +1 -3
- package/src/shared/form/utils/formUtils.ts +1 -1
- package/src/shared/validation/rules/ValidationRule.ts +3 -3
- package/src/shared/validation/sanitizers/NameSanitizer.ts +22 -0
- package/src/shared/validation/sanitizers/index.ts +1 -0
- package/src/shared/validation/types.ts +1 -1
- package/src/shared/validation/validators/EmailValidator.ts +1 -1
- package/src/shared/validation/validators/NameValidator.ts +1 -1
- package/src/shared/validation/validators/PasswordValidator.ts +2 -2
- package/src/exports/domain.ts +0 -32
- package/src/exports/infrastructure.ts +0 -80
- package/src/exports/presentation.ts +0 -115
- package/src/exports/shared.ts +0 -92
- package/src/exports/utils.ts +0 -10
- package/src/shared/error-handling/index.ts +0 -19
- package/src/shared/form/index.ts +0 -51
- package/src/shared/form/utils/index.ts +0 -6
- package/src/shared/validation/index.ts +0 -23
|
@@ -38,18 +38,39 @@ export const AuthNavigator: React.FC<AuthNavigatorProps> = ({
|
|
|
38
38
|
>(undefined);
|
|
39
39
|
|
|
40
40
|
useEffect(() => {
|
|
41
|
+
let isMounted = true;
|
|
42
|
+
const abortController = new AbortController();
|
|
43
|
+
|
|
41
44
|
const checkInitialRoute = async () => {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
45
|
+
try {
|
|
46
|
+
const result = await storageRepository.getString(SHOW_REGISTER_KEY, "false");
|
|
47
|
+
// Check if component is still mounted before updating state
|
|
48
|
+
if (!isMounted || abortController.signal.aborted) return;
|
|
49
|
+
|
|
50
|
+
const value = unwrap(result, "false");
|
|
51
|
+
if (value === "true") {
|
|
52
|
+
setInitialRouteName("Register");
|
|
53
|
+
void storageRepository.removeItem(SHOW_REGISTER_KEY);
|
|
54
|
+
} else {
|
|
55
|
+
setInitialRouteName("Login");
|
|
56
|
+
}
|
|
57
|
+
} catch (error) {
|
|
58
|
+
// Silently fail - will default to Login screen
|
|
59
|
+
if (__DEV__) {
|
|
60
|
+
console.error('[AuthNavigator] Failed to check initial route:', error);
|
|
61
|
+
}
|
|
62
|
+
if (isMounted && !abortController.signal.aborted) {
|
|
63
|
+
setInitialRouteName("Login");
|
|
64
|
+
}
|
|
49
65
|
}
|
|
50
66
|
};
|
|
51
67
|
|
|
52
68
|
void checkInitialRoute();
|
|
69
|
+
|
|
70
|
+
return () => {
|
|
71
|
+
isMounted = false;
|
|
72
|
+
abortController.abort();
|
|
73
|
+
};
|
|
53
74
|
}, []);
|
|
54
75
|
|
|
55
76
|
// Memoize nested translation objects to prevent screen wrapper recreation
|
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import { useMemo } from "react";
|
|
8
|
-
import type { PasswordRequirements } from "
|
|
9
|
-
import type { PasswordConfig } from "
|
|
10
|
-
import { calculatePasswordValidation } from "
|
|
8
|
+
import type { PasswordRequirements } from "@shared/validation/types";
|
|
9
|
+
import type { PasswordConfig } from "@domain/value-objects/AuthConfig";
|
|
10
|
+
import { calculatePasswordValidation } from "@infrastructure/utils/calculators/passwordStrengthCalculator";
|
|
11
11
|
|
|
12
12
|
interface UsePasswordValidationResult {
|
|
13
13
|
passwordRequirements: PasswordRequirements;
|
|
@@ -3,15 +3,10 @@
|
|
|
3
3
|
* Handles form-specific error logic
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import type { FieldError, ErrorMap } from '../types/ErrorTypes';
|
|
6
|
+
import type { FieldError, ErrorMap, FormErrorHandlerConfig } from '../types/ErrorTypes';
|
|
7
7
|
import { ErrorHandler } from './ErrorHandler';
|
|
8
8
|
import { FieldErrorMapper } from '../mappers/FieldErrorMapper';
|
|
9
9
|
|
|
10
|
-
export interface FormErrorHandlerConfig {
|
|
11
|
-
translations?: ErrorMap;
|
|
12
|
-
errorMappings?: Partial<typeof DEFAULT_AUTH_ERROR_MAPPINGS>;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
10
|
export class FormErrorHandler extends ErrorHandler {
|
|
16
11
|
constructor(config: FormErrorHandlerConfig = {}) {
|
|
17
12
|
super(config.translations, config.errorMappings);
|
|
@@ -5,6 +5,10 @@
|
|
|
5
5
|
|
|
6
6
|
import type { ErrorMap, ErrorMappingConfig } from '../types/ErrorTypes';
|
|
7
7
|
|
|
8
|
+
interface ErrorWithCode extends Error {
|
|
9
|
+
code?: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
8
12
|
export class ErrorMapper {
|
|
9
13
|
private config: ErrorMappingConfig;
|
|
10
14
|
|
|
@@ -25,7 +29,7 @@ export class ErrorMapper {
|
|
|
25
29
|
return this.config.defaultKey!;
|
|
26
30
|
}
|
|
27
31
|
|
|
28
|
-
const code = (error as
|
|
32
|
+
const code = (error as ErrorWithCode).code;
|
|
29
33
|
const name = error.name;
|
|
30
34
|
|
|
31
35
|
// First check by error name (most specific)
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import { useCallback, useRef } from 'react';
|
|
7
|
-
import type {
|
|
7
|
+
import type { FieldChangeHandler, FormFieldConfig } from '../types/FormTypes';
|
|
8
8
|
|
|
9
9
|
export interface UseFieldOptions extends FormFieldConfig {
|
|
10
10
|
initialValue?: string;
|
|
@@ -31,7 +31,6 @@ export function useField(
|
|
|
31
31
|
): UseFieldResult {
|
|
32
32
|
const {
|
|
33
33
|
initialValue = '',
|
|
34
|
-
validateOnChange = false,
|
|
35
34
|
clearErrorOnChange = true,
|
|
36
35
|
onValueChange,
|
|
37
36
|
onErrorClear,
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import { useCallback, useRef } from 'react';
|
|
7
|
-
import type {
|
|
7
|
+
import type { FormConfig } from '../types/FormTypes';
|
|
8
8
|
|
|
9
9
|
export interface UseFormOptions<T extends Record<string, string>> extends FormConfig {
|
|
10
10
|
initialValues: T;
|
|
@@ -34,8 +34,6 @@ export function useForm<T extends Record<string, string>>(
|
|
|
34
34
|
): UseFormResult<T> {
|
|
35
35
|
const {
|
|
36
36
|
initialValues,
|
|
37
|
-
validateOnBlur = false,
|
|
38
|
-
clearErrorsOnSubmit = true,
|
|
39
37
|
onFieldChange,
|
|
40
38
|
onErrorsClear,
|
|
41
39
|
} = options;
|
|
@@ -16,7 +16,7 @@ export function sanitizeFormValues<T extends Record<string, string>>(
|
|
|
16
16
|
if (key in sanitized) {
|
|
17
17
|
const sanitizer = sanitizers[key];
|
|
18
18
|
if (sanitizer) {
|
|
19
|
-
sanitized[key] = sanitizer(sanitized[key]);
|
|
19
|
+
sanitized[key] = sanitizer(sanitized[key]) as T[Extract<keyof T, string>];
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
22
|
}
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
* Base class and common validation rules
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import type { ValidationResult
|
|
6
|
+
import type { ValidationResult } from '../types';
|
|
7
7
|
|
|
8
|
-
export abstract class BaseValidationRule<T =
|
|
8
|
+
export abstract class BaseValidationRule<T = unknown> {
|
|
9
9
|
abstract validate(value: T): ValidationResult;
|
|
10
10
|
}
|
|
11
11
|
|
|
@@ -19,7 +19,7 @@ export class RequiredRule extends BaseValidationRule<string | null | undefined>
|
|
|
19
19
|
|
|
20
20
|
validate(value: string | null | undefined): ValidationResult {
|
|
21
21
|
if (!value || value.trim() === '') {
|
|
22
|
-
return { isValid: false, error: `auth.validation.${thisFieldNameToKey()}.required` };
|
|
22
|
+
return { isValid: false, error: `auth.validation.${this.thisFieldNameToKey()}.required` };
|
|
23
23
|
}
|
|
24
24
|
return { isValid: true };
|
|
25
25
|
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Name Sanitizer
|
|
3
|
+
* Handles display name input sanitization
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
export class NameSanitizer {
|
|
7
|
+
/**
|
|
8
|
+
* Sanitize name input
|
|
9
|
+
* Trims whitespace and normalizes internal spaces
|
|
10
|
+
*/
|
|
11
|
+
static sanitize(name: string | null | undefined): string {
|
|
12
|
+
if (!name) return '';
|
|
13
|
+
return name.trim().replace(/\s+/g, ' ');
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Check if name is empty
|
|
18
|
+
*/
|
|
19
|
+
static isEmpty(name: string | null | undefined): boolean {
|
|
20
|
+
return !name || name.trim() === '';
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
* Handles password validation with strength requirements
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import type { PasswordStrengthResult, ValidationResult
|
|
7
|
-
import {
|
|
6
|
+
import type { PasswordStrengthResult, ValidationResult } from '../types';
|
|
7
|
+
import { RequiredRule } from '../rules/ValidationRule';
|
|
8
8
|
import { PasswordSanitizer } from '../sanitizers/PasswordSanitizer';
|
|
9
9
|
|
|
10
10
|
export interface PasswordConfig {
|
package/src/exports/domain.ts
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Domain Layer Exports
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
export type { AuthUser, AuthProviderType } from '../domain/entities/AuthUser';
|
|
6
|
-
export type { UserProfile, UpdateProfileParams } from '../domain/entities/UserProfile';
|
|
7
|
-
export {
|
|
8
|
-
AuthError,
|
|
9
|
-
AuthInitializationError,
|
|
10
|
-
AuthConfigurationError,
|
|
11
|
-
AuthValidationError,
|
|
12
|
-
AuthNetworkError,
|
|
13
|
-
AuthUserNotFoundError,
|
|
14
|
-
AuthWrongPasswordError,
|
|
15
|
-
AuthEmailAlreadyInUseError,
|
|
16
|
-
AuthWeakPasswordError,
|
|
17
|
-
AuthInvalidEmailError,
|
|
18
|
-
} from '../domain/errors/AuthError';
|
|
19
|
-
export type {
|
|
20
|
-
AuthConfig,
|
|
21
|
-
PasswordConfig,
|
|
22
|
-
SocialAuthConfig,
|
|
23
|
-
SocialProviderConfig,
|
|
24
|
-
GoogleAuthConfig,
|
|
25
|
-
AppleAuthConfig,
|
|
26
|
-
SocialAuthProvider,
|
|
27
|
-
} from '../domain/value-objects/AuthConfig';
|
|
28
|
-
export {
|
|
29
|
-
DEFAULT_AUTH_CONFIG,
|
|
30
|
-
DEFAULT_PASSWORD_CONFIG,
|
|
31
|
-
DEFAULT_SOCIAL_CONFIG,
|
|
32
|
-
} from '../domain/value-objects/AuthConfig';
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Infrastructure Layer Exports
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
export type { AuthCredentials, SignUpCredentials } from '../infrastructure/repositories/AuthRepository';
|
|
6
|
-
|
|
7
|
-
// Services
|
|
8
|
-
export {
|
|
9
|
-
AuthService,
|
|
10
|
-
initializeAuthService,
|
|
11
|
-
getAuthService,
|
|
12
|
-
resetAuthService,
|
|
13
|
-
} from '../infrastructure/services/AuthService';
|
|
14
|
-
export {
|
|
15
|
-
initializeAuth,
|
|
16
|
-
isAuthInitialized,
|
|
17
|
-
resetAuthInitialization,
|
|
18
|
-
} from '../infrastructure/services/initializeAuth';
|
|
19
|
-
export type { InitializeAuthOptions } from '../infrastructure/services/initializeAuth';
|
|
20
|
-
|
|
21
|
-
// Storage
|
|
22
|
-
export type { IStorageProvider } from '../infrastructure/types/Storage.types';
|
|
23
|
-
export {
|
|
24
|
-
createStorageProvider,
|
|
25
|
-
StorageProviderAdapter,
|
|
26
|
-
} from '../infrastructure/adapters/StorageProviderAdapter';
|
|
27
|
-
|
|
28
|
-
// Validation
|
|
29
|
-
export {
|
|
30
|
-
validateEmail,
|
|
31
|
-
validatePasswordForLogin,
|
|
32
|
-
validatePasswordForRegister,
|
|
33
|
-
validatePasswordConfirmation,
|
|
34
|
-
validateDisplayName,
|
|
35
|
-
} from '../infrastructure/utils/AuthValidation';
|
|
36
|
-
export type {
|
|
37
|
-
ValidationResult,
|
|
38
|
-
PasswordStrengthResult,
|
|
39
|
-
PasswordRequirements,
|
|
40
|
-
} from '../infrastructure/utils/AuthValidation';
|
|
41
|
-
export type {
|
|
42
|
-
FormValidationError,
|
|
43
|
-
FormValidationResult,
|
|
44
|
-
} from '../infrastructure/utils/validation/types';
|
|
45
|
-
export {
|
|
46
|
-
SECURITY_LIMITS,
|
|
47
|
-
sanitizeEmail,
|
|
48
|
-
sanitizePassword,
|
|
49
|
-
sanitizeName,
|
|
50
|
-
} from '../infrastructure/utils/validation/sanitization';
|
|
51
|
-
export type { SecurityLimitKey } from '../infrastructure/utils/validation/sanitization';
|
|
52
|
-
export {
|
|
53
|
-
isEmpty,
|
|
54
|
-
isEmptyEmail,
|
|
55
|
-
isEmptyPassword,
|
|
56
|
-
isEmptyName,
|
|
57
|
-
isNotEmpty,
|
|
58
|
-
hasContent,
|
|
59
|
-
} from '../infrastructure/utils/validation/validationHelpers';
|
|
60
|
-
export { safeCallback, safeCallbackSync } from '../infrastructure/utils/safeCallback';
|
|
61
|
-
|
|
62
|
-
// Calculators
|
|
63
|
-
export {
|
|
64
|
-
calculateUserId,
|
|
65
|
-
calculateHasFirebaseUser,
|
|
66
|
-
calculateIsAnonymous,
|
|
67
|
-
calculateIsAuthenticated,
|
|
68
|
-
calculateUserType,
|
|
69
|
-
calculateIsAuthReady,
|
|
70
|
-
calculateDerivedAuthState,
|
|
71
|
-
collectFieldErrors,
|
|
72
|
-
extractFieldError,
|
|
73
|
-
hasFieldErrors,
|
|
74
|
-
getFirstErrorMessage,
|
|
75
|
-
calculateUserProfileDisplay,
|
|
76
|
-
calculatePasswordRequirements,
|
|
77
|
-
calculatePasswordsMatch,
|
|
78
|
-
calculatePasswordValidation,
|
|
79
|
-
calculatePasswordStrength,
|
|
80
|
-
} from '../infrastructure/utils/calculators';
|
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Presentation Layer Exports
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
// Hooks
|
|
6
|
-
export { useAuth } from '../presentation/hooks/useAuth';
|
|
7
|
-
export type { UseAuthResult } from '../presentation/hooks/useAuth';
|
|
8
|
-
export { useLoginForm } from '../presentation/hooks/useLoginForm';
|
|
9
|
-
export type { UseLoginFormConfig, UseLoginFormResult } from '../presentation/hooks/useLoginForm';
|
|
10
|
-
export { useRegisterForm } from '../presentation/hooks/useRegisterForm';
|
|
11
|
-
export type {
|
|
12
|
-
UseRegisterFormConfig,
|
|
13
|
-
UseRegisterFormResult,
|
|
14
|
-
} from '../presentation/hooks/useRegisterForm';
|
|
15
|
-
export { useAuthRequired } from '../presentation/hooks/useAuthRequired';
|
|
16
|
-
export { useRequireAuth, useUserId } from '../presentation/hooks/useRequireAuth';
|
|
17
|
-
export { useUserProfile } from '../presentation/hooks/useUserProfile';
|
|
18
|
-
export type {
|
|
19
|
-
UserProfileData,
|
|
20
|
-
UseUserProfileParams,
|
|
21
|
-
} from '../presentation/hooks/useUserProfile';
|
|
22
|
-
export { useAccountManagement } from '../presentation/hooks/useAccountManagement';
|
|
23
|
-
export type {
|
|
24
|
-
UseAccountManagementReturn,
|
|
25
|
-
UseAccountManagementOptions,
|
|
26
|
-
} from '../presentation/hooks/useAccountManagement';
|
|
27
|
-
export { useAppleAuth } from '../presentation/hooks/useAppleAuth';
|
|
28
|
-
export type { UseAppleAuthResult } from '../presentation/hooks/useAppleAuth';
|
|
29
|
-
export { useAuthBottomSheet } from '../presentation/hooks/useAuthBottomSheet';
|
|
30
|
-
export type {
|
|
31
|
-
SocialAuthConfiguration,
|
|
32
|
-
} from '../presentation/hooks/useAuthBottomSheet';
|
|
33
|
-
export { useAuthHandlers } from '../presentation/hooks/useAuthHandlers';
|
|
34
|
-
export type {
|
|
35
|
-
AuthHandlersAppInfo,
|
|
36
|
-
AuthHandlersTranslations,
|
|
37
|
-
} from '../presentation/hooks/useAuthHandlers';
|
|
38
|
-
export { usePasswordPromptNavigation } from '../presentation/hooks/usePasswordPromptNavigation';
|
|
39
|
-
export type {
|
|
40
|
-
UsePasswordPromptNavigationOptions,
|
|
41
|
-
UsePasswordPromptNavigationReturn,
|
|
42
|
-
} from '../presentation/hooks/usePasswordPromptNavigation';
|
|
43
|
-
export { useAuthErrorHandler } from '../presentation/hooks/useAuthErrorHandler';
|
|
44
|
-
export type {
|
|
45
|
-
UseAuthErrorHandlerConfig,
|
|
46
|
-
UseAuthErrorHandlerResult,
|
|
47
|
-
} from '../presentation/hooks/useAuthErrorHandler';
|
|
48
|
-
export { useLocalError } from '../presentation/hooks/useLocalError';
|
|
49
|
-
export type { UseLocalErrorResult } from '../presentation/hooks/useLocalError';
|
|
50
|
-
|
|
51
|
-
// Components
|
|
52
|
-
export { AuthProvider } from '../presentation/providers/AuthProvider';
|
|
53
|
-
export type { ErrorFallbackProps } from '../presentation/providers/AuthProvider';
|
|
54
|
-
export { LoginScreen } from '../presentation/screens/LoginScreen';
|
|
55
|
-
export type { LoginScreenProps } from '../presentation/screens/LoginScreen';
|
|
56
|
-
export { RegisterScreen } from '../presentation/screens/RegisterScreen';
|
|
57
|
-
export type { RegisterScreenProps } from '../presentation/screens/RegisterScreen';
|
|
58
|
-
export { AccountScreen } from '../presentation/screens/AccountScreen';
|
|
59
|
-
export type {
|
|
60
|
-
AccountScreenProps,
|
|
61
|
-
AccountScreenConfig,
|
|
62
|
-
} from '../presentation/screens/AccountScreen';
|
|
63
|
-
export { EditProfileScreen } from '../presentation/screens/EditProfileScreen';
|
|
64
|
-
export type {
|
|
65
|
-
EditProfileScreenProps,
|
|
66
|
-
} from '../presentation/screens/EditProfileScreen';
|
|
67
|
-
export { PasswordPromptScreen } from '../presentation/screens/PasswordPromptScreen';
|
|
68
|
-
export type {
|
|
69
|
-
PasswordPromptScreenProps,
|
|
70
|
-
} from '../presentation/screens/PasswordPromptScreen';
|
|
71
|
-
export { AuthNavigator } from '../presentation/navigation/AuthNavigator';
|
|
72
|
-
export type { AuthStackParamList } from '../presentation/navigation/AuthNavigator';
|
|
73
|
-
export { AuthBottomSheet } from '../presentation/components/AuthBottomSheet';
|
|
74
|
-
export type {
|
|
75
|
-
AuthBottomSheetProps,
|
|
76
|
-
AuthBottomSheetTranslations,
|
|
77
|
-
} from '../presentation/components/AuthBottomSheet';
|
|
78
|
-
export { ProfileSection } from '../presentation/components/ProfileSection';
|
|
79
|
-
export type {
|
|
80
|
-
ProfileSectionProps,
|
|
81
|
-
ProfileSectionConfig,
|
|
82
|
-
} from '../presentation/components/ProfileSection';
|
|
83
|
-
|
|
84
|
-
// Stores
|
|
85
|
-
export { useAuthStore } from '../presentation/stores/authStore';
|
|
86
|
-
export { useAuthModalStore } from '../presentation/stores/authModalStore';
|
|
87
|
-
export {
|
|
88
|
-
initializeAuthListener,
|
|
89
|
-
resetAuthListener,
|
|
90
|
-
isAuthListenerInitialized,
|
|
91
|
-
} from '../presentation/stores/initializeAuthListener';
|
|
92
|
-
export type {
|
|
93
|
-
AuthState,
|
|
94
|
-
AuthActions,
|
|
95
|
-
UserType,
|
|
96
|
-
AuthListenerOptions,
|
|
97
|
-
} from '../types/auth-store.types';
|
|
98
|
-
export type { AuthModalMode } from '../presentation/stores/auth.selectors';
|
|
99
|
-
export {
|
|
100
|
-
selectUser,
|
|
101
|
-
selectLoading,
|
|
102
|
-
selectError,
|
|
103
|
-
selectSetLoading,
|
|
104
|
-
selectSetError,
|
|
105
|
-
selectSetIsAnonymous,
|
|
106
|
-
selectShowAuthModal,
|
|
107
|
-
selectUserId,
|
|
108
|
-
selectIsAuthenticated,
|
|
109
|
-
selectHasFirebaseUser,
|
|
110
|
-
selectIsAnonymous,
|
|
111
|
-
selectUserType,
|
|
112
|
-
selectIsAuthReady,
|
|
113
|
-
selectFirebaseUserId,
|
|
114
|
-
selectAuthState,
|
|
115
|
-
} from '../presentation/stores/auth.selectors';
|
package/src/exports/shared.ts
DELETED
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Shared Layer Exports
|
|
3
|
-
* New modular utilities
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
// Validation
|
|
7
|
-
export {
|
|
8
|
-
EmailValidator,
|
|
9
|
-
PasswordValidator,
|
|
10
|
-
NameValidator,
|
|
11
|
-
} from '../shared/validation/validators';
|
|
12
|
-
export type { PasswordConfig } from '../shared/validation/validators';
|
|
13
|
-
export {
|
|
14
|
-
EmailSanitizer,
|
|
15
|
-
PasswordSanitizer,
|
|
16
|
-
} from '../shared/validation/sanitizers';
|
|
17
|
-
export {
|
|
18
|
-
BaseValidationRule,
|
|
19
|
-
RequiredRule,
|
|
20
|
-
RegexRule,
|
|
21
|
-
MinLengthRule,
|
|
22
|
-
} from '../shared/validation/rules';
|
|
23
|
-
export type {
|
|
24
|
-
ValidationResult,
|
|
25
|
-
PasswordRequirements,
|
|
26
|
-
PasswordStrengthResult,
|
|
27
|
-
ValidationRule,
|
|
28
|
-
ValidatorConfig,
|
|
29
|
-
} from '../shared/validation/types';
|
|
30
|
-
|
|
31
|
-
// Error Handling
|
|
32
|
-
export {
|
|
33
|
-
ErrorMapper,
|
|
34
|
-
DEFAULT_AUTH_ERROR_MAPPINGS,
|
|
35
|
-
FieldErrorMapper,
|
|
36
|
-
} from '../shared/error-handling/mappers';
|
|
37
|
-
export { ErrorHandler, FormErrorHandler } from '../shared/error-handling/handlers';
|
|
38
|
-
export type {
|
|
39
|
-
FieldError,
|
|
40
|
-
FormFieldErrors,
|
|
41
|
-
ErrorMap,
|
|
42
|
-
ErrorMappingConfig,
|
|
43
|
-
FormErrorHandlerConfig,
|
|
44
|
-
} from '../shared/error-handling/types';
|
|
45
|
-
|
|
46
|
-
// Form
|
|
47
|
-
export { useField, useForm } from '../shared/form/builders';
|
|
48
|
-
export type {
|
|
49
|
-
UseFieldOptions,
|
|
50
|
-
UseFieldResult,
|
|
51
|
-
UseFormOptions,
|
|
52
|
-
UseFormResult,
|
|
53
|
-
} from '../shared/form/builders';
|
|
54
|
-
export {
|
|
55
|
-
isFormValid,
|
|
56
|
-
isFormDirty,
|
|
57
|
-
isFormTouched,
|
|
58
|
-
getFormErrors,
|
|
59
|
-
getFirstFormError,
|
|
60
|
-
countFormErrors,
|
|
61
|
-
getFieldError,
|
|
62
|
-
fieldHasError,
|
|
63
|
-
isFieldTouched,
|
|
64
|
-
resetFormState,
|
|
65
|
-
} from '../shared/form/state';
|
|
66
|
-
export {
|
|
67
|
-
sanitizeFormValues,
|
|
68
|
-
extractFields,
|
|
69
|
-
areRequiredFieldsFilled,
|
|
70
|
-
getEmptyRequiredFields,
|
|
71
|
-
createFieldOptions,
|
|
72
|
-
mergeFormErrors,
|
|
73
|
-
clearFieldErrors,
|
|
74
|
-
} from '../shared/form/utils/formUtils';
|
|
75
|
-
export {
|
|
76
|
-
createFieldChangeHandler,
|
|
77
|
-
createFieldBlurHandler,
|
|
78
|
-
debounceFieldChange,
|
|
79
|
-
isFieldValueEmpty,
|
|
80
|
-
sanitizeFieldValue,
|
|
81
|
-
formatFieldValue,
|
|
82
|
-
validateFieldValue,
|
|
83
|
-
getFieldDisplayValue,
|
|
84
|
-
truncateFieldValue,
|
|
85
|
-
} from '../shared/form/utils/fieldUtils';
|
|
86
|
-
export type {
|
|
87
|
-
FieldState,
|
|
88
|
-
FormState,
|
|
89
|
-
FieldChangeHandler,
|
|
90
|
-
FormFieldConfig,
|
|
91
|
-
FormConfig,
|
|
92
|
-
} from '../shared/form/types';
|
package/src/exports/utils.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Utilities & Init Exports
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
export {
|
|
6
|
-
getAuthErrorLocalizationKey,
|
|
7
|
-
resolveErrorMessage,
|
|
8
|
-
} from '../presentation/utils/getAuthErrorMessage';
|
|
9
|
-
export { createAuthInitModule } from '../init/createAuthInitModule';
|
|
10
|
-
export type { AuthInitModuleConfig } from '../init/createAuthInitModule';
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Error Handling Module Public API
|
|
3
|
-
* Centralized error handling system
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
// Types
|
|
7
|
-
export type {
|
|
8
|
-
FieldError,
|
|
9
|
-
FormFieldErrors,
|
|
10
|
-
ErrorMap,
|
|
11
|
-
ErrorMappingConfig,
|
|
12
|
-
} from './types';
|
|
13
|
-
|
|
14
|
-
// Mappers
|
|
15
|
-
export { ErrorMapper, DEFAULT_AUTH_ERROR_MAPPINGS, FieldErrorMapper } from './mappers';
|
|
16
|
-
|
|
17
|
-
// Handlers
|
|
18
|
-
export { ErrorHandler, FormErrorHandler } from './handlers';
|
|
19
|
-
export type { FormErrorHandlerConfig } from './handlers';
|
package/src/shared/form/index.ts
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Form Module Public API
|
|
3
|
-
* Centralized form state management system
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
// Types
|
|
7
|
-
export type {
|
|
8
|
-
FieldState,
|
|
9
|
-
FormState,
|
|
10
|
-
FieldChangeHandler,
|
|
11
|
-
FormFieldConfig,
|
|
12
|
-
FormConfig,
|
|
13
|
-
} from './types';
|
|
14
|
-
|
|
15
|
-
// Builders
|
|
16
|
-
export { useField, useForm } from './builders';
|
|
17
|
-
export type { UseFieldOptions, UseFieldResult, UseFormOptions, UseFormResult } from './builders';
|
|
18
|
-
|
|
19
|
-
// State utilities
|
|
20
|
-
export {
|
|
21
|
-
isFormValid,
|
|
22
|
-
isFormDirty,
|
|
23
|
-
isFormTouched,
|
|
24
|
-
getFormErrors,
|
|
25
|
-
getFirstFormError,
|
|
26
|
-
countFormErrors,
|
|
27
|
-
getFieldError,
|
|
28
|
-
fieldHasError,
|
|
29
|
-
isFieldTouched,
|
|
30
|
-
resetFormState,
|
|
31
|
-
} from './state';
|
|
32
|
-
|
|
33
|
-
// Utils
|
|
34
|
-
export {
|
|
35
|
-
sanitizeFormValues,
|
|
36
|
-
extractFields,
|
|
37
|
-
areRequiredFieldsFilled,
|
|
38
|
-
getEmptyRequiredFields,
|
|
39
|
-
createFieldOptions,
|
|
40
|
-
mergeFormErrors,
|
|
41
|
-
clearFieldErrors,
|
|
42
|
-
createFieldChangeHandler,
|
|
43
|
-
createFieldBlurHandler,
|
|
44
|
-
debounceFieldChange,
|
|
45
|
-
isFieldValueEmpty,
|
|
46
|
-
sanitizeFieldValue,
|
|
47
|
-
formatFieldValue,
|
|
48
|
-
validateFieldValue,
|
|
49
|
-
getFieldDisplayValue,
|
|
50
|
-
truncateFieldValue,
|
|
51
|
-
} from './utils';
|