@chem-po/firebase-native 0.0.51 → 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.
- package/lib/commonjs/adapter/auth.js +12 -5
- package/lib/commonjs/adapter/auth.js.map +1 -1
- package/lib/commonjs/adapter/db.js.map +1 -1
- package/lib/commonjs/adapter/index.js.map +1 -1
- package/lib/commonjs/adapter/storage.js.map +1 -1
- package/lib/commonjs/auth/functions.js.map +1 -1
- package/lib/commonjs/auth/index.js.map +1 -1
- package/lib/commonjs/components/AuthenticatorVerify.js +4 -2
- package/lib/commonjs/components/AuthenticatorVerify.js.map +1 -1
- package/lib/commonjs/components/FirebaseSignIn.js.map +1 -1
- package/lib/commonjs/components/PhoneVerify.js.map +1 -1
- package/lib/commonjs/components/TwoFactorAuthModal.js +3 -1
- package/lib/commonjs/components/TwoFactorAuthModal.js.map +1 -1
- package/lib/commonjs/components/index.js.map +1 -1
- package/lib/commonjs/contexts/FirebaseContext.js.map +1 -1
- package/lib/commonjs/contexts/index.js.map +1 -1
- package/lib/commonjs/db/index.js.map +1 -1
- package/lib/commonjs/db/utils.js.map +1 -1
- package/lib/commonjs/hooks/backend.js.map +1 -1
- package/lib/commonjs/hooks/index.js.map +1 -1
- package/lib/commonjs/hooks/useAuthenticatorVerify.js +19 -13
- package/lib/commonjs/hooks/useAuthenticatorVerify.js.map +1 -1
- package/lib/commonjs/hooks/usePhoneVerify.js +1 -1
- package/lib/commonjs/hooks/usePhoneVerify.js.map +1 -1
- package/lib/commonjs/icons/Apple.js.map +1 -1
- package/lib/commonjs/icons/Google.js.map +1 -1
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/storage/index.js.map +1 -1
- package/lib/commonjs/storage/utils.js.map +1 -1
- package/lib/commonjs/types/adapter.js.map +1 -1
- package/lib/commonjs/types/auth.js.map +1 -1
- package/lib/commonjs/types/db.js.map +1 -1
- package/lib/commonjs/types/functions.js.map +1 -1
- package/lib/commonjs/types/index.js.map +1 -1
- package/lib/commonjs/types/storage.js.map +1 -1
- package/lib/commonjs/utils/validation.js.map +1 -1
- package/lib/module/adapter/auth.js +13 -6
- package/lib/module/adapter/auth.js.map +1 -1
- package/lib/module/adapter/db.js.map +1 -1
- package/lib/module/adapter/index.js.map +1 -1
- package/lib/module/adapter/storage.js.map +1 -1
- package/lib/module/auth/functions.js.map +1 -1
- package/lib/module/auth/index.js.map +1 -1
- package/lib/module/components/AuthenticatorVerify.js +4 -2
- package/lib/module/components/AuthenticatorVerify.js.map +1 -1
- package/lib/module/components/FirebaseSignIn.js.map +1 -1
- package/lib/module/components/PhoneVerify.js.map +1 -1
- package/lib/module/components/TwoFactorAuthModal.js +3 -1
- package/lib/module/components/TwoFactorAuthModal.js.map +1 -1
- package/lib/module/components/index.js.map +1 -1
- package/lib/module/contexts/FirebaseContext.js.map +1 -1
- package/lib/module/contexts/index.js.map +1 -1
- package/lib/module/db/index.js.map +1 -1
- package/lib/module/db/utils.js.map +1 -1
- package/lib/module/hooks/backend.js.map +1 -1
- package/lib/module/hooks/index.js.map +1 -1
- package/lib/module/hooks/useAuthenticatorVerify.js +20 -14
- package/lib/module/hooks/useAuthenticatorVerify.js.map +1 -1
- package/lib/module/hooks/usePhoneVerify.js +1 -1
- package/lib/module/hooks/usePhoneVerify.js.map +1 -1
- package/lib/module/icons/Apple.js.map +1 -1
- package/lib/module/icons/Google.js.map +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/storage/index.js.map +1 -1
- package/lib/module/storage/utils.js.map +1 -1
- package/lib/module/types/adapter.js.map +1 -1
- package/lib/module/types/auth.js.map +1 -1
- package/lib/module/types/db.js.map +1 -1
- package/lib/module/types/functions.js.map +1 -1
- package/lib/module/types/index.js.map +1 -1
- package/lib/module/types/storage.js.map +1 -1
- package/lib/module/utils/validation.js.map +1 -1
- package/lib/typescript/adapter/auth.d.ts.map +1 -1
- package/lib/typescript/components/AuthenticatorVerify.d.ts +4 -1
- package/lib/typescript/components/AuthenticatorVerify.d.ts.map +1 -1
- package/lib/typescript/hooks/useAuthenticatorVerify.d.ts +2 -1
- package/lib/typescript/hooks/useAuthenticatorVerify.d.ts.map +1 -1
- package/package.json +6 -21
- package/src/adapter/auth.ts +0 -556
- package/src/adapter/db.ts +0 -146
- package/src/adapter/index.ts +0 -32
- package/src/adapter/storage.ts +0 -58
- package/src/auth/functions.ts +0 -7
- package/src/auth/index.ts +0 -1
- package/src/components/AuthenticatorVerify.tsx +0 -75
- package/src/components/FirebaseSignIn.tsx +0 -234
- package/src/components/PhoneVerify.tsx +0 -115
- package/src/components/TwoFactorAuthModal.tsx +0 -198
- package/src/components/index.ts +0 -2
- package/src/contexts/FirebaseContext.tsx +0 -50
- package/src/contexts/index.ts +0 -1
- package/src/db/index.ts +0 -1
- package/src/db/utils.ts +0 -142
- package/src/hooks/backend.ts +0 -4
- package/src/hooks/index.ts +0 -1
- package/src/hooks/useAuthenticatorVerify.ts +0 -45
- package/src/hooks/usePhoneVerify.ts +0 -87
- package/src/icons/Apple.tsx +0 -12
- package/src/icons/Google.tsx +0 -24
- package/src/index.ts +0 -9
- package/src/storage/index.ts +0 -1
- package/src/storage/utils.ts +0 -29
- package/src/types/adapter.ts +0 -13
- package/src/types/auth.ts +0 -13
- package/src/types/db.ts +0 -10
- package/src/types/functions.ts +0 -3
- package/src/types/index.ts +0 -29
- package/src/types/storage.ts +0 -3
- package/src/utils/validation.ts +0 -92
package/src/types/index.ts
DELETED
|
@@ -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
|
-
}
|
package/src/types/storage.ts
DELETED
package/src/utils/validation.ts
DELETED
|
@@ -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
|
-
}
|