@chem-po/firebase-native 0.0.52 → 0.0.53

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.
Files changed (37) hide show
  1. package/lib/commonjs/hooks/useAuthenticatorVerify.js +14 -5
  2. package/lib/commonjs/hooks/useAuthenticatorVerify.js.map +1 -1
  3. package/lib/module/hooks/useAuthenticatorVerify.js +15 -6
  4. package/lib/module/hooks/useAuthenticatorVerify.js.map +1 -1
  5. package/lib/typescript/hooks/useAuthenticatorVerify.d.ts.map +1 -1
  6. package/package.json +6 -21
  7. package/src/adapter/auth.ts +0 -562
  8. package/src/adapter/db.ts +0 -146
  9. package/src/adapter/index.ts +0 -32
  10. package/src/adapter/storage.ts +0 -58
  11. package/src/auth/functions.ts +0 -7
  12. package/src/auth/index.ts +0 -1
  13. package/src/components/AuthenticatorVerify.tsx +0 -76
  14. package/src/components/FirebaseSignIn.tsx +0 -234
  15. package/src/components/PhoneVerify.tsx +0 -115
  16. package/src/components/TwoFactorAuthModal.tsx +0 -198
  17. package/src/components/index.ts +0 -2
  18. package/src/contexts/FirebaseContext.tsx +0 -50
  19. package/src/contexts/index.ts +0 -1
  20. package/src/db/index.ts +0 -1
  21. package/src/db/utils.ts +0 -142
  22. package/src/hooks/backend.ts +0 -4
  23. package/src/hooks/index.ts +0 -1
  24. package/src/hooks/useAuthenticatorVerify.ts +0 -39
  25. package/src/hooks/usePhoneVerify.ts +0 -87
  26. package/src/icons/Apple.tsx +0 -12
  27. package/src/icons/Google.tsx +0 -24
  28. package/src/index.ts +0 -9
  29. package/src/storage/index.ts +0 -1
  30. package/src/storage/utils.ts +0 -29
  31. package/src/types/adapter.ts +0 -13
  32. package/src/types/auth.ts +0 -13
  33. package/src/types/db.ts +0 -10
  34. package/src/types/functions.ts +0 -3
  35. package/src/types/index.ts +0 -29
  36. package/src/types/storage.ts +0 -3
  37. package/src/utils/validation.ts +0 -92
@@ -1,29 +0,0 @@
1
- import { ReactNativeFirebase } from '@react-native-firebase/app'
2
- import { FirebaseAuthTypes } from '@react-native-firebase/auth'
3
- import { FirebaseFirestoreTypes } from '@react-native-firebase/firestore'
4
- import { FirebaseFunctionsTypes } from '@react-native-firebase/functions'
5
- import { FirebaseStorageTypes } from '@react-native-firebase/storage'
6
-
7
- export type FirebaseApp = ReactNativeFirebase.FirebaseApp
8
- export type FirebaseAuth = FirebaseAuthTypes.Module
9
- export type FirebaseFirestore = FirebaseFirestoreTypes.Module
10
- export type FirebaseStorage = FirebaseStorageTypes.Module
11
- export type FirebaseFunctions = FirebaseFunctionsTypes.Module
12
-
13
- export interface FirebaseConfig {
14
- apiKey: string
15
- authDomain: string
16
- projectId: string
17
- storageBucket: string
18
- messagingSenderId: string
19
- appId: string
20
- measurementId?: string
21
- }
22
-
23
- export interface FirebaseContextValue {
24
- app: ReactNativeFirebase.FirebaseApp
25
- auth: FirebaseAuth | null
26
- firestore: FirebaseFirestore | null
27
- storage: FirebaseStorage | null
28
- functions: FirebaseFunctions | null
29
- }
@@ -1,3 +0,0 @@
1
- import { getStorage } from '@react-native-firebase/storage'
2
-
3
- export type Storage = ReturnType<typeof getStorage>
@@ -1,92 +0,0 @@
1
- import { BaseAuthProvider, GoogleAuthProvider } from '@chem-po/core'
2
- import { Platform } from 'react-native'
3
-
4
- interface ValidationResult {
5
- isValid: boolean
6
- errors: string[]
7
- warnings: string[]
8
- }
9
-
10
- /**
11
- * Validates Firebase authentication configuration to help identify common setup issues
12
- */
13
- export const validateAuthConfiguration = (providers: BaseAuthProvider[]): ValidationResult => {
14
- const errors: string[] = []
15
- const warnings: string[] = []
16
-
17
- // Check for Google provider configuration
18
- const googleProvider = providers.find(p => p.name === 'google') as GoogleAuthProvider | undefined
19
-
20
- if (googleProvider) {
21
- if (!googleProvider.webClientId) {
22
- errors.push(
23
- 'Google provider is missing webClientId. ' +
24
- 'Get this from Firebase Console > Authentication > Sign-in method > Google > Web SDK configuration',
25
- )
26
- } else if (!googleProvider.webClientId.includes('.apps.googleusercontent.com')) {
27
- warnings.push(
28
- 'Google webClientId format looks incorrect. Expected format: "xxx.apps.googleusercontent.com"',
29
- )
30
- }
31
- if (Platform.OS === 'ios' && !googleProvider.iosClientId) {
32
- errors.push(
33
- 'Google provider is missing iosClientId. ' +
34
- 'Get this from Firebase Console > Authentication > Sign-in method > Google > iOS SDK configuration',
35
- )
36
- }
37
- }
38
-
39
- // Check environment
40
- if (typeof process === 'undefined') {
41
- warnings.push('Process environment is not available - some features may not work as expected')
42
- }
43
-
44
- // Check for Firebase configuration files (platform-specific warnings)
45
- const isExpo =
46
- typeof process !== 'undefined' && process.env?.EXPO_PUBLIC_ENVIRONMENT !== undefined
47
- if (!isExpo) {
48
- warnings.push(
49
- 'Ensure Firebase configuration files are present:\n' +
50
- '- iOS: GoogleService-Info.plist in ios/ directory\n' +
51
- '- Android: google-services.json in android/app/ directory',
52
- )
53
- }
54
-
55
- return {
56
- isValid: errors.length === 0,
57
- errors,
58
- warnings,
59
- }
60
- }
61
-
62
- /**
63
- * Logs validation results with appropriate console methods
64
- */
65
- export const logValidationResults = (
66
- result: ValidationResult,
67
- packageName = '@chem-po/firebase-native',
68
- ) => {
69
- if (result.errors.length > 0) {
70
- console.error(`[${packageName}] Configuration errors found:`)
71
- result.errors.forEach(error => console.error(` ❌ ${error}`))
72
- }
73
-
74
- if (result.warnings.length > 0) {
75
- console.warn(`[${packageName}] Configuration warnings:`)
76
- result.warnings.forEach(warning => console.warn(` ⚠️ ${warning}`))
77
- }
78
-
79
- if (result.isValid && result.warnings.length === 0) {
80
- console.log(`[${packageName}] ✅ Configuration validation passed`)
81
- }
82
- }
83
-
84
- /**
85
- * Validates and logs Firebase auth configuration
86
- * Call this during development to identify setup issues early
87
- */
88
- export const validateAndLogAuthConfig = (providers: BaseAuthProvider[]) => {
89
- const result = validateAuthConfiguration(providers)
90
- logValidationResults(result)
91
- return result
92
- }