react-query-firebase 2.13.2 → 2.13.4
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/dist/index.d.ts +2 -0
- package/dist/index.js +4 -0
- package/dist/react-native/analytics/index.d.ts +3 -0
- package/dist/react-native/analytics/index.js +3 -0
- package/{react-native/analytics/useAnalytics.ts → dist/react-native/analytics/useAnalytics.js} +1 -3
- package/{react-native → dist/react-native}/analytics/useLogEvent.js +1 -1
- package/{react-native → dist/react-native}/analytics/useSetAnalyticsCollectionEnabled.js +1 -1
- package/dist/react-native/auth/index.d.ts +19 -0
- package/dist/react-native/auth/index.js +19 -0
- package/{react-native/auth/useAuth.ts → dist/react-native/auth/useAuth.js} +1 -3
- package/{react-native → dist/react-native}/auth/useAuthStateReady.js +1 -1
- package/{react-native → dist/react-native}/auth/useCreateUserWitEmailAndPasswordMutation.js +2 -2
- package/{react-native → dist/react-native}/auth/useCurrentUser.js +1 -1
- package/{react-native → dist/react-native}/auth/useIdToken.js +3 -3
- package/{react-native → dist/react-native}/auth/useLinkWithCredentialMutation.js +1 -1
- package/{react-native → dist/react-native}/auth/useReauthenticateWitCredentialMutation.js +1 -1
- package/{react-native → dist/react-native}/auth/useReauthenticateWitRedirectMutation.js +1 -1
- package/{react-native → dist/react-native}/auth/useSendEmailVerificationMutation.js +1 -1
- package/{react-native → dist/react-native}/auth/useSignInAnonymouslyMutation.js +2 -2
- package/{react-native → dist/react-native}/auth/useSignInWitEmailAndPasswordMutation.js +2 -2
- package/{react-native → dist/react-native}/auth/useSignInWitRedirectMutation.js +2 -2
- package/{react-native → dist/react-native}/auth/useSignInWithCredentialMutation.js +2 -2
- package/{react-native → dist/react-native}/auth/useSignOutMutation.js +2 -2
- package/{react-native → dist/react-native}/auth/useUpdateProfileMutation.js +1 -1
- package/{react-native → dist/react-native}/context/FirebaseContextProvider.js +2 -2
- package/dist/react-native/context/index.d.ts +1 -0
- package/dist/react-native/context/index.js +1 -0
- package/dist/react-native/firestore/index.d.ts +23 -0
- package/dist/react-native/firestore/index.js +23 -0
- package/{react-native → dist/react-native}/firestore/useAddDocMutation.d.ts +1 -1
- package/{react-native → dist/react-native}/firestore/useBatchWrite.js +1 -1
- package/{react-native → dist/react-native}/firestore/useCollectionReference.d.ts +1 -1
- package/{react-native → dist/react-native}/firestore/useCollectionReference.js +1 -1
- package/{react-native → dist/react-native}/firestore/useCompositeFilter.d.ts +2 -2
- package/{react-native → dist/react-native}/firestore/useCompositeFilter.js +1 -1
- package/{react-native → dist/react-native}/firestore/useCountQuery.d.ts +2 -2
- package/{react-native → dist/react-native}/firestore/useDeleteDocMutation.d.ts +1 -1
- package/{react-native → dist/react-native}/firestore/useDocReference.d.ts +3 -4
- package/{react-native → dist/react-native}/firestore/useDocReference.js +6 -8
- package/{react-native → dist/react-native}/firestore/useDocReferences.d.ts +2 -2
- package/{react-native → dist/react-native}/firestore/useDocReferences.js +2 -2
- package/{web → dist/react-native}/firestore/useEnsureDoc.d.ts +2 -2
- package/{react-native → dist/react-native}/firestore/useEnsureDoc.js +3 -3
- package/{react-native/firestore/useFirestore.ts → dist/react-native/firestore/useFirestore.js} +1 -2
- package/{react-native → dist/react-native}/firestore/useGetDocData.d.ts +2 -2
- package/{web → dist/react-native}/firestore/useGetDocData.js +2 -2
- package/{react-native → dist/react-native}/firestore/useGetRealtimeDocData.d.ts +1 -1
- package/{react-native → dist/react-native}/firestore/useGetRealtimeDocData.js +1 -1
- package/{react-native → dist/react-native}/firestore/useInfiniteQuery.d.ts +2 -2
- package/{react-native → dist/react-native}/firestore/useQuery.d.ts +2 -2
- package/{react-native → dist/react-native}/firestore/useQueryConstraints.d.ts +2 -2
- package/{react-native → dist/react-native}/firestore/useQueryConstraints.js +1 -1
- package/{react-native → dist/react-native}/firestore/useRunTransaction.js +1 -1
- package/{react-native → dist/react-native}/firestore/useSetDocMutation.d.ts +1 -1
- package/{react-native → dist/react-native}/firestore/useUpdateDocMutation.d.ts +1 -1
- package/{react-native → dist/react-native}/firestore/utils/buildCompositeFilter.d.ts +1 -1
- package/{react-native → dist/react-native}/firestore/utils/buildQueryConstraint.d.ts +1 -1
- package/{react-native → dist/react-native}/firestore/utils/getDocData.d.ts +2 -2
- package/{react-native → dist/react-native}/firestore/utils/getDocData.js +1 -1
- package/{react-native → dist/react-native}/firestore/utils/getDocRef.d.ts +1 -1
- package/{react-native → dist/react-native}/firestore/utils/getDocSnap.d.ts +2 -2
- package/{react-native → dist/react-native}/firestore/utils/getDocSnap.js +1 -1
- package/dist/react-native/index.d.ts +1 -0
- package/dist/react-native/index.js +1 -0
- package/dist/react-native/remoteConfig/index.d.ts +3 -0
- package/dist/react-native/remoteConfig/index.js +3 -0
- package/{react-native → dist/react-native}/remoteConfig/useFetchAndActivate.js +1 -1
- package/{react-native → dist/react-native}/remoteConfig/useGetValue.js +1 -1
- package/{react-native/remoteConfig/useRemoteConfig.ts → dist/react-native/remoteConfig/useRemoteConfig.js} +1 -2
- package/{types → dist/types}/QueryConstraints.d.ts +1 -1
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.js +2 -0
- package/dist/web/analytics/index.d.ts +3 -0
- package/dist/web/analytics/index.js +3 -0
- package/{web/analytics/useAnalytics.ts → dist/web/analytics/useAnalytics.js} +1 -3
- package/{web → dist/web}/analytics/useLogEvent.js +1 -1
- package/{web → dist/web}/analytics/useSetAnalyticsCollectionEnabled.js +1 -1
- package/dist/web/auth/index.d.ts +20 -0
- package/dist/web/auth/index.js +20 -0
- package/{web/auth/useAuth.ts → dist/web/auth/useAuth.js} +1 -3
- package/{web → dist/web}/auth/useAuthStateReady.js +4 -8
- package/{web → dist/web}/auth/useCreateUserWitEmailAndPasswordMutation.js +2 -2
- package/{web → dist/web}/auth/useCurrentUser.js +1 -1
- package/{web → dist/web}/auth/useGetRedirectResultMutation.js +2 -2
- package/{web → dist/web}/auth/useIdToken.js +3 -3
- package/{web → dist/web}/auth/useLinkWithCredentialMutation.js +1 -1
- package/{web → dist/web}/auth/useReauthenticateWitCredentialMutation.js +1 -1
- package/{web → dist/web}/auth/useReauthenticateWitRedirectMutation.js +1 -1
- package/{web → dist/web}/auth/useSendEmailVerificationMutation.js +1 -1
- package/{web → dist/web}/auth/useSignInAnonymouslyMutation.js +2 -2
- package/{web → dist/web}/auth/useSignInWitEmailAndPasswordMutation.js +2 -2
- package/{web → dist/web}/auth/useSignInWitRedirectMutation.js +2 -2
- package/{web → dist/web}/auth/useSignInWithCredentialMutation.js +2 -2
- package/{web → dist/web}/auth/useSignOutMutation.js +2 -2
- package/{web → dist/web}/auth/useUpdateProfileMutation.js +1 -1
- package/{web → dist/web}/context/FirebaseContextProvider.js +2 -2
- package/dist/web/context/index.d.ts +1 -0
- package/dist/web/context/index.js +1 -0
- package/dist/web/firestore/index.d.ts +23 -0
- package/dist/web/firestore/index.js +23 -0
- package/{web → dist/web}/firestore/useAddDocMutation.d.ts +1 -1
- package/{web → dist/web}/firestore/useBatchWrite.js +1 -1
- package/{web → dist/web}/firestore/useCollectionReference.d.ts +1 -1
- package/{web → dist/web}/firestore/useCollectionReference.js +1 -1
- package/{web → dist/web}/firestore/useCompositeFilter.d.ts +2 -2
- package/{web → dist/web}/firestore/useCompositeFilter.js +1 -1
- package/{web → dist/web}/firestore/useCountQuery.d.ts +2 -2
- package/{web → dist/web}/firestore/useDeleteDocMutation.d.ts +1 -1
- package/{web → dist/web}/firestore/useDocReference.d.ts +3 -4
- package/{web → dist/web}/firestore/useDocReference.js +6 -8
- package/{web → dist/web}/firestore/useDocReferences.d.ts +2 -2
- package/{web → dist/web}/firestore/useDocReferences.js +2 -2
- package/{react-native → dist/web}/firestore/useEnsureDoc.d.ts +2 -2
- package/{web → dist/web}/firestore/useEnsureDoc.js +3 -3
- package/{web/firestore/useFirestore.ts → dist/web/firestore/useFirestore.js} +1 -2
- package/{web → dist/web}/firestore/useGetDocData.d.ts +2 -2
- package/{react-native → dist/web}/firestore/useGetDocData.js +2 -2
- package/{web → dist/web}/firestore/useGetRealtimeDocData.d.ts +1 -1
- package/{web → dist/web}/firestore/useGetRealtimeDocData.js +1 -1
- package/{web → dist/web}/firestore/useInfiniteQuery.d.ts +2 -2
- package/{web → dist/web}/firestore/useQuery.d.ts +2 -2
- package/{web → dist/web}/firestore/useQueryConstraints.d.ts +2 -2
- package/{web → dist/web}/firestore/useQueryConstraints.js +1 -1
- package/{web → dist/web}/firestore/useRunTransaction.js +1 -1
- package/{web → dist/web}/firestore/useSetDocMutation.d.ts +1 -1
- package/{web → dist/web}/firestore/useUpdateDocMutation.d.ts +1 -1
- package/{web → dist/web}/firestore/utils/buildCompositeFilter.d.ts +1 -1
- package/{web → dist/web}/firestore/utils/buildQueryConstraint.d.ts +1 -1
- package/{web → dist/web}/firestore/utils/getDocData.d.ts +2 -2
- package/{web → dist/web}/firestore/utils/getDocData.js +1 -1
- package/{web → dist/web}/firestore/utils/getDocRef.d.ts +1 -1
- package/{web → dist/web}/firestore/utils/getDocSnap.d.ts +2 -2
- package/{web → dist/web}/firestore/utils/getDocSnap.js +1 -1
- package/dist/web/index.d.ts +1 -0
- package/dist/web/index.js +1 -0
- package/dist/web/remoteConfig/index.d.ts +3 -0
- package/dist/web/remoteConfig/index.js +3 -0
- package/{web → dist/web}/remoteConfig/useFetchAndActivate.js +1 -1
- package/{web → dist/web}/remoteConfig/useGetValue.js +1 -1
- package/{web/remoteConfig/useRemoteConfig.ts → dist/web/remoteConfig/useRemoteConfig.js} +1 -2
- package/package.json +45 -16
- package/react-native/analytics/index.d.ts +0 -3
- package/react-native/analytics/index.js +0 -3
- package/react-native/analytics/index.ts +0 -3
- package/react-native/analytics/useAnalytics.js +0 -10
- package/react-native/analytics/useLogEvent.ts +0 -34
- package/react-native/analytics/useSetAnalyticsCollectionEnabled.ts +0 -22
- package/react-native/auth/index.d.ts +0 -19
- package/react-native/auth/index.js +0 -19
- package/react-native/auth/index.ts +0 -19
- package/react-native/auth/mutation-keys.ts +0 -22
- package/react-native/auth/useAppleAuthProviderCredential.ts +0 -31
- package/react-native/auth/useAuth.js +0 -10
- package/react-native/auth/useAuthStateReady.ts +0 -39
- package/react-native/auth/useCreateUserWitEmailAndPasswordMutation.ts +0 -38
- package/react-native/auth/useCurrentUser.ts +0 -26
- package/react-native/auth/useEmailAuthProviderCredential.ts +0 -38
- package/react-native/auth/useFacebookAuthProviderCredential.ts +0 -31
- package/react-native/auth/useIdToken.ts +0 -83
- package/react-native/auth/useLinkWithCredentialMutation.ts +0 -35
- package/react-native/auth/useReauthenticateWitCredentialMutation.ts +0 -36
- package/react-native/auth/useReauthenticateWitRedirectMutation.ts +0 -42
- package/react-native/auth/useSendEmailVerificationMutation.ts +0 -33
- package/react-native/auth/useSignInAnonymouslyMutation.ts +0 -52
- package/react-native/auth/useSignInWitEmailAndPasswordMutation.ts +0 -39
- package/react-native/auth/useSignInWitRedirectMutation.ts +0 -38
- package/react-native/auth/useSignInWithCredentialMutation.ts +0 -36
- package/react-native/auth/useSignOutMutation.ts +0 -28
- package/react-native/auth/useUpdateProfileMutation.ts +0 -30
- package/react-native/context/FirebaseContext.ts +0 -25
- package/react-native/context/FirebaseContextProvider.tsx +0 -264
- package/react-native/context/index.d.ts +0 -1
- package/react-native/context/index.js +0 -1
- package/react-native/context/index.ts +0 -1
- package/react-native/firestore/index.d.ts +0 -23
- package/react-native/firestore/index.js +0 -23
- package/react-native/firestore/index.ts +0 -23
- package/react-native/firestore/useAddDocMutation.ts +0 -80
- package/react-native/firestore/useBatchWrite.ts +0 -58
- package/react-native/firestore/useCollectionReference.ts +0 -58
- package/react-native/firestore/useCompositeFilter.ts +0 -60
- package/react-native/firestore/useCountQuery.ts +0 -85
- package/react-native/firestore/useDeleteDocMutation.ts +0 -71
- package/react-native/firestore/useDocReference.ts +0 -50
- package/react-native/firestore/useDocReferences.ts +0 -40
- package/react-native/firestore/useEnsureDoc.ts +0 -79
- package/react-native/firestore/useFirestore.js +0 -13
- package/react-native/firestore/useGetDocData.ts +0 -52
- package/react-native/firestore/useGetRealtimeDocData.ts +0 -106
- package/react-native/firestore/useInfiniteQuery.ts +0 -115
- package/react-native/firestore/useQuery.ts +0 -89
- package/react-native/firestore/useQueryConstraints.ts +0 -44
- package/react-native/firestore/useRunTransaction.ts +0 -55
- package/react-native/firestore/useSetDocMutation.ts +0 -76
- package/react-native/firestore/useUpdateDocMutation.ts +0 -77
- package/react-native/firestore/utils/buildCompositeFilter.ts +0 -75
- package/react-native/firestore/utils/buildQueryConstraint.ts +0 -54
- package/react-native/firestore/utils/getDocData.ts +0 -33
- package/react-native/firestore/utils/getDocRef.ts +0 -41
- package/react-native/firestore/utils/getDocSnap.ts +0 -34
- package/react-native/index.d.ts +0 -1
- package/react-native/index.js +0 -1
- package/react-native/index.ts +0 -1
- package/react-native/remoteConfig/index.d.ts +0 -3
- package/react-native/remoteConfig/index.js +0 -3
- package/react-native/remoteConfig/index.ts +0 -3
- package/react-native/remoteConfig/useFetchAndActivate.ts +0 -36
- package/react-native/remoteConfig/useGetValue.ts +0 -16
- package/react-native/remoteConfig/useRemoteConfig.js +0 -10
- package/types/AppModel.ts +0 -10
- package/types/QueryConstraints.ts +0 -57
- package/types/index.d.ts +0 -2
- package/types/index.js +0 -2
- package/types/index.ts +0 -2
- package/web/analytics/index.d.ts +0 -3
- package/web/analytics/index.js +0 -3
- package/web/analytics/index.ts +0 -3
- package/web/analytics/useAnalytics.js +0 -10
- package/web/analytics/useLogEvent.ts +0 -34
- package/web/analytics/useSetAnalyticsCollectionEnabled.ts +0 -22
- package/web/auth/index.d.ts +0 -20
- package/web/auth/index.js +0 -20
- package/web/auth/index.ts +0 -20
- package/web/auth/mutation-keys.ts +0 -23
- package/web/auth/useAppleAuthProviderCredential.ts +0 -32
- package/web/auth/useAuth.js +0 -10
- package/web/auth/useAuthStateReady.ts +0 -35
- package/web/auth/useCreateUserWitEmailAndPasswordMutation.ts +0 -33
- package/web/auth/useCurrentUser.ts +0 -25
- package/web/auth/useEmailAuthProviderCredential.ts +0 -38
- package/web/auth/useFacebookAuthProviderCredential.ts +0 -31
- package/web/auth/useGetRedirectResultMutation.ts +0 -27
- package/web/auth/useIdToken.ts +0 -83
- package/web/auth/useLinkWithCredentialMutation.ts +0 -30
- package/web/auth/useReauthenticateWitCredentialMutation.ts +0 -31
- package/web/auth/useReauthenticateWitRedirectMutation.ts +0 -37
- package/web/auth/useSendEmailVerificationMutation.ts +0 -28
- package/web/auth/useSignInAnonymouslyMutation.ts +0 -49
- package/web/auth/useSignInWitEmailAndPasswordMutation.ts +0 -34
- package/web/auth/useSignInWitRedirectMutation.ts +0 -33
- package/web/auth/useSignInWithCredentialMutation.ts +0 -31
- package/web/auth/useSignOutMutation.ts +0 -25
- package/web/auth/useUpdateProfileMutation.ts +0 -30
- package/web/context/FirebaseContext.ts +0 -25
- package/web/context/FirebaseContextProvider.tsx +0 -263
- package/web/context/index.d.ts +0 -1
- package/web/context/index.js +0 -1
- package/web/context/index.ts +0 -1
- package/web/firestore/index.d.ts +0 -23
- package/web/firestore/index.js +0 -23
- package/web/firestore/index.ts +0 -23
- package/web/firestore/useAddDocMutation.ts +0 -74
- package/web/firestore/useBatchWrite.ts +0 -58
- package/web/firestore/useCollectionReference.ts +0 -58
- package/web/firestore/useCompositeFilter.ts +0 -55
- package/web/firestore/useCountQuery.ts +0 -90
- package/web/firestore/useDeleteDocMutation.ts +0 -69
- package/web/firestore/useDocReference.ts +0 -50
- package/web/firestore/useDocReferences.ts +0 -40
- package/web/firestore/useEnsureDoc.ts +0 -92
- package/web/firestore/useFirestore.js +0 -13
- package/web/firestore/useGetDocData.ts +0 -52
- package/web/firestore/useGetRealtimeDocData.ts +0 -105
- package/web/firestore/useInfiniteQuery.ts +0 -117
- package/web/firestore/useQuery.ts +0 -94
- package/web/firestore/useQueryConstraints.ts +0 -44
- package/web/firestore/useRunTransaction.ts +0 -56
- package/web/firestore/useSetDocMutation.ts +0 -77
- package/web/firestore/useUpdateDocMutation.ts +0 -78
- package/web/firestore/utils/buildCompositeFilter.ts +0 -73
- package/web/firestore/utils/buildQueryConstraint.ts +0 -55
- package/web/firestore/utils/getDocData.ts +0 -33
- package/web/firestore/utils/getDocRef.ts +0 -43
- package/web/firestore/utils/getDocSnap.ts +0 -34
- package/web/index.d.ts +0 -1
- package/web/index.js +0 -1
- package/web/index.ts +0 -1
- package/web/remoteConfig/index.d.ts +0 -3
- package/web/remoteConfig/index.js +0 -3
- package/web/remoteConfig/index.ts +0 -3
- package/web/remoteConfig/useFetchAndActivate.ts +0 -36
- package/web/remoteConfig/useGetValue.ts +0 -16
- package/web/remoteConfig/useRemoteConfig.js +0 -10
- /package/{react-native → dist/react-native}/analytics/useAnalytics.d.ts +0 -0
- /package/{react-native → dist/react-native}/analytics/useLogEvent.d.ts +0 -0
- /package/{react-native → dist/react-native}/analytics/useSetAnalyticsCollectionEnabled.d.ts +0 -0
- /package/{react-native → dist/react-native}/auth/mutation-keys.d.ts +0 -0
- /package/{react-native → dist/react-native}/auth/mutation-keys.js +0 -0
- /package/{react-native → dist/react-native}/auth/useAppleAuthProviderCredential.d.ts +0 -0
- /package/{react-native → dist/react-native}/auth/useAppleAuthProviderCredential.js +0 -0
- /package/{react-native → dist/react-native}/auth/useAuth.d.ts +0 -0
- /package/{react-native → dist/react-native}/auth/useAuthStateReady.d.ts +0 -0
- /package/{react-native → dist/react-native}/auth/useCreateUserWitEmailAndPasswordMutation.d.ts +0 -0
- /package/{react-native → dist/react-native}/auth/useCurrentUser.d.ts +0 -0
- /package/{react-native → dist/react-native}/auth/useEmailAuthProviderCredential.d.ts +0 -0
- /package/{react-native → dist/react-native}/auth/useEmailAuthProviderCredential.js +0 -0
- /package/{react-native → dist/react-native}/auth/useFacebookAuthProviderCredential.d.ts +0 -0
- /package/{react-native → dist/react-native}/auth/useFacebookAuthProviderCredential.js +0 -0
- /package/{react-native → dist/react-native}/auth/useIdToken.d.ts +0 -0
- /package/{react-native → dist/react-native}/auth/useLinkWithCredentialMutation.d.ts +0 -0
- /package/{react-native → dist/react-native}/auth/useReauthenticateWitCredentialMutation.d.ts +0 -0
- /package/{react-native → dist/react-native}/auth/useReauthenticateWitRedirectMutation.d.ts +0 -0
- /package/{react-native → dist/react-native}/auth/useSendEmailVerificationMutation.d.ts +0 -0
- /package/{react-native → dist/react-native}/auth/useSignInAnonymouslyMutation.d.ts +0 -0
- /package/{react-native → dist/react-native}/auth/useSignInWitEmailAndPasswordMutation.d.ts +0 -0
- /package/{react-native → dist/react-native}/auth/useSignInWitRedirectMutation.d.ts +0 -0
- /package/{react-native → dist/react-native}/auth/useSignInWithCredentialMutation.d.ts +0 -0
- /package/{react-native → dist/react-native}/auth/useSignOutMutation.d.ts +0 -0
- /package/{react-native → dist/react-native}/auth/useUpdateProfileMutation.d.ts +0 -0
- /package/{react-native → dist/react-native}/context/FirebaseContext.d.ts +0 -0
- /package/{react-native → dist/react-native}/context/FirebaseContext.js +0 -0
- /package/{react-native → dist/react-native}/context/FirebaseContextProvider.d.ts +0 -0
- /package/{react-native → dist/react-native}/firestore/useAddDocMutation.js +0 -0
- /package/{react-native → dist/react-native}/firestore/useBatchWrite.d.ts +0 -0
- /package/{react-native → dist/react-native}/firestore/useCountQuery.js +0 -0
- /package/{react-native → dist/react-native}/firestore/useDeleteDocMutation.js +0 -0
- /package/{react-native → dist/react-native}/firestore/useFirestore.d.ts +0 -0
- /package/{react-native → dist/react-native}/firestore/useInfiniteQuery.js +0 -0
- /package/{react-native → dist/react-native}/firestore/useQuery.js +0 -0
- /package/{react-native → dist/react-native}/firestore/useRunTransaction.d.ts +0 -0
- /package/{react-native → dist/react-native}/firestore/useSetDocMutation.js +0 -0
- /package/{react-native → dist/react-native}/firestore/useUpdateDocMutation.js +0 -0
- /package/{react-native → dist/react-native}/firestore/utils/buildCompositeFilter.js +0 -0
- /package/{react-native → dist/react-native}/firestore/utils/buildQueryConstraint.js +0 -0
- /package/{react-native → dist/react-native}/firestore/utils/getDocRef.js +0 -0
- /package/{react-native → dist/react-native}/remoteConfig/useFetchAndActivate.d.ts +0 -0
- /package/{react-native → dist/react-native}/remoteConfig/useGetValue.d.ts +0 -0
- /package/{react-native → dist/react-native}/remoteConfig/useRemoteConfig.d.ts +0 -0
- /package/{types → dist/types}/AppModel.d.ts +0 -0
- /package/{types → dist/types}/AppModel.js +0 -0
- /package/{types → dist/types}/QueryConstraints.js +0 -0
- /package/{web → dist/web}/analytics/useAnalytics.d.ts +0 -0
- /package/{web → dist/web}/analytics/useLogEvent.d.ts +0 -0
- /package/{web → dist/web}/analytics/useSetAnalyticsCollectionEnabled.d.ts +0 -0
- /package/{web → dist/web}/auth/mutation-keys.d.ts +0 -0
- /package/{web → dist/web}/auth/mutation-keys.js +0 -0
- /package/{web → dist/web}/auth/useAppleAuthProviderCredential.d.ts +0 -0
- /package/{web → dist/web}/auth/useAppleAuthProviderCredential.js +0 -0
- /package/{web → dist/web}/auth/useAuth.d.ts +0 -0
- /package/{web → dist/web}/auth/useAuthStateReady.d.ts +0 -0
- /package/{web → dist/web}/auth/useCreateUserWitEmailAndPasswordMutation.d.ts +0 -0
- /package/{web → dist/web}/auth/useCurrentUser.d.ts +0 -0
- /package/{web → dist/web}/auth/useEmailAuthProviderCredential.d.ts +0 -0
- /package/{web → dist/web}/auth/useEmailAuthProviderCredential.js +0 -0
- /package/{web → dist/web}/auth/useFacebookAuthProviderCredential.d.ts +0 -0
- /package/{web → dist/web}/auth/useFacebookAuthProviderCredential.js +0 -0
- /package/{web → dist/web}/auth/useGetRedirectResultMutation.d.ts +0 -0
- /package/{web → dist/web}/auth/useIdToken.d.ts +0 -0
- /package/{web → dist/web}/auth/useLinkWithCredentialMutation.d.ts +0 -0
- /package/{web → dist/web}/auth/useReauthenticateWitCredentialMutation.d.ts +0 -0
- /package/{web → dist/web}/auth/useReauthenticateWitRedirectMutation.d.ts +0 -0
- /package/{web → dist/web}/auth/useSendEmailVerificationMutation.d.ts +0 -0
- /package/{web → dist/web}/auth/useSignInAnonymouslyMutation.d.ts +0 -0
- /package/{web → dist/web}/auth/useSignInWitEmailAndPasswordMutation.d.ts +0 -0
- /package/{web → dist/web}/auth/useSignInWitRedirectMutation.d.ts +0 -0
- /package/{web → dist/web}/auth/useSignInWithCredentialMutation.d.ts +0 -0
- /package/{web → dist/web}/auth/useSignOutMutation.d.ts +0 -0
- /package/{web → dist/web}/auth/useUpdateProfileMutation.d.ts +0 -0
- /package/{web → dist/web}/context/FirebaseContext.d.ts +0 -0
- /package/{web → dist/web}/context/FirebaseContext.js +0 -0
- /package/{web → dist/web}/context/FirebaseContextProvider.d.ts +0 -0
- /package/{web → dist/web}/firestore/useAddDocMutation.js +0 -0
- /package/{web → dist/web}/firestore/useBatchWrite.d.ts +0 -0
- /package/{web → dist/web}/firestore/useCountQuery.js +0 -0
- /package/{web → dist/web}/firestore/useDeleteDocMutation.js +0 -0
- /package/{web → dist/web}/firestore/useFirestore.d.ts +0 -0
- /package/{web → dist/web}/firestore/useInfiniteQuery.js +0 -0
- /package/{web → dist/web}/firestore/useQuery.js +0 -0
- /package/{web → dist/web}/firestore/useRunTransaction.d.ts +0 -0
- /package/{web → dist/web}/firestore/useSetDocMutation.js +0 -0
- /package/{web → dist/web}/firestore/useUpdateDocMutation.js +0 -0
- /package/{web → dist/web}/firestore/utils/buildCompositeFilter.js +0 -0
- /package/{web → dist/web}/firestore/utils/buildQueryConstraint.js +0 -0
- /package/{web → dist/web}/firestore/utils/getDocRef.js +0 -0
- /package/{web → dist/web}/remoteConfig/useFetchAndActivate.d.ts +0 -0
- /package/{web → dist/web}/remoteConfig/useGetValue.d.ts +0 -0
- /package/{web → dist/web}/remoteConfig/useRemoteConfig.d.ts +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { GetDocDataOptions } from "./utils/getDocData";
|
|
2
1
|
import { UseQueryOptions } from "@tanstack/react-query";
|
|
3
|
-
import { AppModel } from "../../types";
|
|
2
|
+
import { AppModel } from "../../types/index.js";
|
|
3
|
+
import { GetDocDataOptions } from "./utils/getDocData.js";
|
|
4
4
|
/**
|
|
5
5
|
* @inline
|
|
6
6
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { useFirestore } from "./useFirestore";
|
|
2
|
-
import { getDocData } from "./utils/getDocData";
|
|
3
1
|
import { useQuery } from "@tanstack/react-query";
|
|
2
|
+
import { useFirestore } from "./useFirestore.js";
|
|
3
|
+
import { getDocData } from "./utils/getDocData.js";
|
|
4
4
|
/**
|
|
5
5
|
* Executes a query on a Firestore data source and returns the resulting document.
|
|
6
6
|
*
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { onSnapshot } from "firebase/firestore";
|
|
2
2
|
import { useEffect, useMemo, useState } from "react";
|
|
3
|
-
import { useDocReference } from "./useDocReference";
|
|
3
|
+
import { useDocReference } from "./useDocReference.js";
|
|
4
4
|
/**
|
|
5
5
|
* A hook to get realtime updates to a firestore document.
|
|
6
6
|
*
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CollectionReference, QueryConstraint, QueryNonFilterConstraint } from "firebase/firestore";
|
|
2
2
|
import { UseInfiniteQueryOptions as UseReactInfiniteQueryOptions, QueryKey, UseInfiniteQueryResult, InfiniteData } from "@tanstack/react-query";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { AppModel } from "../../types/index.js";
|
|
4
|
+
import { QueryFilterConstraint } from "./utils/buildCompositeFilter.js";
|
|
5
5
|
/**
|
|
6
6
|
* @inline
|
|
7
7
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CollectionReference, QueryConstraint, QueryNonFilterConstraint } from "firebase/firestore";
|
|
2
2
|
import { UseQueryResult, UseQueryOptions as UseReactQueryOptions } from "@tanstack/react-query";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { AppModel } from "../../types/index.js";
|
|
4
|
+
import { QueryFilterConstraint } from "./utils/buildCompositeFilter.js";
|
|
5
5
|
/**
|
|
6
6
|
* @inline
|
|
7
7
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { QueryNonFilterConstraint } from "firebase/firestore";
|
|
2
|
-
import { AppModel } from "../../types/AppModel";
|
|
3
|
-
import { NonFilterQueryConstraint } from "../../types/QueryConstraints";
|
|
2
|
+
import { AppModel } from "../../types/AppModel.js";
|
|
3
|
+
import { NonFilterQueryConstraint } from "../../types/QueryConstraints.js";
|
|
4
4
|
/**
|
|
5
5
|
* @inline
|
|
6
6
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useMemo } from "react";
|
|
2
|
-
import { buildQueryConstraint } from "./utils/buildQueryConstraint";
|
|
2
|
+
import { buildQueryConstraint } from "./utils/buildQueryConstraint.js";
|
|
3
3
|
/**
|
|
4
4
|
* A hook to build a list of non-filter query constraints for firebase queries.
|
|
5
5
|
* It uses buildQueryConstraint method and useMemo hook.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { UseMutationOptions } from "@tanstack/react-query";
|
|
2
2
|
import { DocumentReference, WithFieldValue } from "firebase/firestore";
|
|
3
3
|
import { FirebaseError } from "firebase/app";
|
|
4
|
-
import { AppModel } from "../../types";
|
|
4
|
+
import { AppModel } from "../../types/index.js";
|
|
5
5
|
/**
|
|
6
6
|
* @inline
|
|
7
7
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { UseMutationOptions } from "@tanstack/react-query";
|
|
2
2
|
import { DocumentReference, UpdateData } from "firebase/firestore";
|
|
3
3
|
import { FirebaseError } from "firebase/app";
|
|
4
|
-
import { AppModel } from "../../types";
|
|
4
|
+
import { AppModel } from "../../types/index.js";
|
|
5
5
|
/**
|
|
6
6
|
* @inline
|
|
7
7
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { QueryFilterConstraint as FBQueryFilterConstraint, QueryCompositeFilterConstraint as FBQueryCompositeFilterConstraint, WhereFilterOp } from "firebase/firestore";
|
|
2
|
-
import { AppModel } from "../../../types/AppModel";
|
|
2
|
+
import { AppModel } from "../../../types/AppModel.js";
|
|
3
3
|
export type QueryFilterConstraint = FBQueryFilterConstraint | FBQueryCompositeFilterConstraint;
|
|
4
4
|
export type QueryElement<AppModelType extends AppModel = AppModel> = {
|
|
5
5
|
operator?: "OR" | "AND";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { QueryNonFilterConstraint } from "firebase/firestore";
|
|
2
|
-
import { AppModel, NonFilterQueryConstraint } from "../../../types";
|
|
2
|
+
import { AppModel, NonFilterQueryConstraint } from "../../../types/index.js";
|
|
3
3
|
/**
|
|
4
4
|
* A generic mothod to build query constraints for firebase
|
|
5
5
|
*
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getDoc as firestoreGetDoc } from "firebase/firestore";
|
|
2
|
-
import { getDocRef } from "./getDocRef";
|
|
2
|
+
import { getDocRef } from "./getDocRef.js";
|
|
3
3
|
/**
|
|
4
4
|
* Asynchronously retrieves a document snapshot from Firestore using a specified document reference
|
|
5
5
|
* or path information. This function handles getting the appropriate document reference based on
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./context/index.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./context/index.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { useRemoteConfig } from "./useRemoteConfig";
|
|
2
1
|
import { ensureInitialized, fetchAndActivate } from "firebase/remote-config";
|
|
3
2
|
import { useCallback, useMemo, useState } from "react";
|
|
3
|
+
import { useRemoteConfig } from "./useRemoteConfig.js";
|
|
4
4
|
/**
|
|
5
5
|
* Custom hook to fetch and activate remote configuration settings.
|
|
6
6
|
* Initializes remote configuration, fetches, activates it, and tracks the fetch status.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getValue } from "firebase/remote-config";
|
|
2
|
-
import { useRemoteConfig } from "./useRemoteConfig";
|
|
3
2
|
import { useMemo } from "react";
|
|
3
|
+
import { useRemoteConfig } from "./useRemoteConfig.js";
|
|
4
4
|
/**
|
|
5
5
|
* Custom hook to retrieve a value associated with a specified key from remote configuration.
|
|
6
6
|
* Utilizes memoization to optimize performance by recalculating the result only if dependencies change.
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { useContext } from "react";
|
|
2
|
-
import { FirebaseContext } from "../context/FirebaseContext";
|
|
3
|
-
|
|
2
|
+
import { FirebaseContext } from "../context/FirebaseContext.js";
|
|
4
3
|
/**
|
|
5
4
|
* Hook to access the Firebase Remote Config instance from the context.
|
|
6
5
|
* @returns {RemoteConfig} The remoteConfig object from the Firebase context.
|
package/package.json
CHANGED
|
@@ -21,25 +21,34 @@
|
|
|
21
21
|
},
|
|
22
22
|
"description": "This module offers react hooks to work with Firebase on react-native and web platforms",
|
|
23
23
|
"devDependencies": {
|
|
24
|
-
"@
|
|
24
|
+
"@eslint-community/eslint-plugin-eslint-comments": "^4.5.0",
|
|
25
25
|
"@react-native-firebase/analytics": "^23.5.0",
|
|
26
26
|
"@react-native-firebase/app": "^23.5.0",
|
|
27
|
-
"@react-native-firebase/auth": "^23.
|
|
28
|
-
"@react-native-firebase/crashlytics": "^23.
|
|
29
|
-
"@react-native-firebase/firestore": "^23.
|
|
30
|
-
"@react-native-firebase/installations": "^23.
|
|
31
|
-
"@react-native-firebase/remote-config": "^23.
|
|
32
|
-
"@tanstack/react-query": "^5.90.
|
|
33
|
-
"@types/react": "^19.2.
|
|
27
|
+
"@react-native-firebase/auth": "^23.7.0",
|
|
28
|
+
"@react-native-firebase/crashlytics": "^23.7.0",
|
|
29
|
+
"@react-native-firebase/firestore": "^23.7.0",
|
|
30
|
+
"@react-native-firebase/installations": "^23.7.0",
|
|
31
|
+
"@react-native-firebase/remote-config": "^23.7.0",
|
|
32
|
+
"@tanstack/react-query": "^5.90.12",
|
|
33
|
+
"@types/react": "^19.2.7",
|
|
34
|
+
"eslint": "^9.39.1",
|
|
35
|
+
"eslint-config-prettier": "^10.1.8",
|
|
36
|
+
"eslint-plugin-import": "^2.32.0",
|
|
37
|
+
"eslint-plugin-jest": "^29.2.1",
|
|
38
|
+
"eslint-plugin-jsonc": "^2.21.0",
|
|
39
|
+
"eslint-plugin-prettier": "^5.5.4",
|
|
40
|
+
"eslint-plugin-react": "^7.37.5",
|
|
41
|
+
"eslint-plugin-react-hooks": "^7.0.1",
|
|
34
42
|
"firebase": "^12.5.0",
|
|
35
43
|
"husky": "^9.1.7",
|
|
36
|
-
"lint-staged": "^16.2.
|
|
37
|
-
"prettier": "^3.
|
|
38
|
-
"react": "^19.2.
|
|
39
|
-
"typedoc": "^0.28.
|
|
44
|
+
"lint-staged": "^16.2.7",
|
|
45
|
+
"prettier": "^3.7.4",
|
|
46
|
+
"react": "^19.2.3",
|
|
47
|
+
"typedoc": "^0.28.15",
|
|
40
48
|
"typedoc-plugin-markdown": "^4.9.0",
|
|
41
49
|
"typedoc-vitepress-theme": "^1.1.2",
|
|
42
50
|
"typescript": "^5.9.3",
|
|
51
|
+
"typescript-eslint": "^8.49.0",
|
|
43
52
|
"vitepress": "^1.6.4"
|
|
44
53
|
},
|
|
45
54
|
"homepage": "https://github.com/vpishuk/react-query-firebase",
|
|
@@ -55,10 +64,30 @@
|
|
|
55
64
|
"type": "git",
|
|
56
65
|
"url": "https://github.com/vpishuk/react-query-firebase.git"
|
|
57
66
|
},
|
|
67
|
+
"exports": {
|
|
68
|
+
".": {
|
|
69
|
+
"import": "./dist/index.js",
|
|
70
|
+
"require": "./dist/index.js",
|
|
71
|
+
"types": "./dist/index.d.ts"
|
|
72
|
+
},
|
|
73
|
+
"react-native": {
|
|
74
|
+
"import": "./dist/react-native/index.js",
|
|
75
|
+
"require": "./dist/react-native/index.js",
|
|
76
|
+
"types": "./dist/react-native/index.d.ts"
|
|
77
|
+
},
|
|
78
|
+
"web": {
|
|
79
|
+
"import": "./dist/web/index.js",
|
|
80
|
+
"require": "./dist/web/index.js",
|
|
81
|
+
"types": "./dist/web/index.d.ts"
|
|
82
|
+
},
|
|
83
|
+
"types": {
|
|
84
|
+
"import": "./dist/types/index.js",
|
|
85
|
+
"require": "./dist/types/index.js",
|
|
86
|
+
"types": "./dist/types/index.d.ts"
|
|
87
|
+
}
|
|
88
|
+
},
|
|
58
89
|
"files": [
|
|
59
|
-
"./
|
|
60
|
-
"./react-native/",
|
|
61
|
-
"./types",
|
|
90
|
+
"./dist/",
|
|
62
91
|
"package.json",
|
|
63
92
|
"package-lock.json",
|
|
64
93
|
"README.md",
|
|
@@ -75,5 +104,5 @@
|
|
|
75
104
|
"docs:build": "vitepress build docs",
|
|
76
105
|
"docs:preview": "vitepress preview docs"
|
|
77
106
|
},
|
|
78
|
-
"version": "2.13.
|
|
107
|
+
"version": "2.13.4"
|
|
79
108
|
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { useContext } from "react";
|
|
2
|
-
import { FirebaseContext } from "../context/FirebaseContext";
|
|
3
|
-
/**
|
|
4
|
-
* Hook to access Firebase analytics from the Firebase context.
|
|
5
|
-
* @returns {any} The analytics object from the Firebase context.
|
|
6
|
-
*/
|
|
7
|
-
export const useAnalytics = () => {
|
|
8
|
-
const { analytics } = useContext(FirebaseContext);
|
|
9
|
-
return analytics;
|
|
10
|
-
};
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { logEvent } from "@react-native-firebase/analytics";
|
|
2
|
-
import { useAnalytics } from "./useAnalytics";
|
|
3
|
-
import { useCallback, useMemo } from "react";
|
|
4
|
-
|
|
5
|
-
type UseLogEventOptions = {
|
|
6
|
-
eventName: string;
|
|
7
|
-
eventParams?: {
|
|
8
|
-
[key: string]: unknown;
|
|
9
|
-
};
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Custom hook to create a log event function that logs an analytics event with specified parameters.
|
|
14
|
-
* @param {Object} options - The options for the log event.
|
|
15
|
-
* @param {string} options.eventName - The name of the event to be logged.
|
|
16
|
-
* @param {Object} options.eventParams - The parameters to be sent along with the event.
|
|
17
|
-
* @returns {Object} An object containing a `logEvent` function that, when called, logs the event.
|
|
18
|
-
*/
|
|
19
|
-
export const useLogEvent = ({ eventName, eventParams }: UseLogEventOptions) => {
|
|
20
|
-
const analytics = useAnalytics();
|
|
21
|
-
|
|
22
|
-
const logEventCallback = useCallback(() => {
|
|
23
|
-
if (analytics) {
|
|
24
|
-
logEvent(analytics, eventName, eventParams);
|
|
25
|
-
}
|
|
26
|
-
}, [eventName, eventParams, analytics]);
|
|
27
|
-
|
|
28
|
-
return useMemo(
|
|
29
|
-
() => ({
|
|
30
|
-
logEvent: logEventCallback
|
|
31
|
-
}),
|
|
32
|
-
[logEventCallback]
|
|
33
|
-
);
|
|
34
|
-
};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { setAnalyticsCollectionEnabled } from "@react-native-firebase/analytics";
|
|
2
|
-
import { useAnalytics } from "./useAnalytics";
|
|
3
|
-
import { useEffect } from "react";
|
|
4
|
-
|
|
5
|
-
type UseSetAnalyticsCollectionEnabledOptions = {
|
|
6
|
-
enabled?: boolean;
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Custom hook to enable or disable analytics collection
|
|
11
|
-
* @param {Object} options - The options for hook.
|
|
12
|
-
* @param {string} options.enabled - Flag that identifies if analytics collection is enabled.
|
|
13
|
-
*/
|
|
14
|
-
export const useSetAnalyticsCollectionEnabled = ({ enabled = false }: UseSetAnalyticsCollectionEnabledOptions) => {
|
|
15
|
-
const analytics = useAnalytics();
|
|
16
|
-
|
|
17
|
-
useEffect(() => {
|
|
18
|
-
if (analytics) {
|
|
19
|
-
setAnalyticsCollectionEnabled(analytics, enabled);
|
|
20
|
-
}
|
|
21
|
-
}, [analytics, enabled]);
|
|
22
|
-
};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
export * from "./mutation-keys";
|
|
2
|
-
export * from "./useAuth";
|
|
3
|
-
export * from "./useCreateUserWitEmailAndPasswordMutation";
|
|
4
|
-
export * from "./useSendEmailVerificationMutation";
|
|
5
|
-
export * from "./useSignInWitEmailAndPasswordMutation";
|
|
6
|
-
export * from "./useCurrentUser";
|
|
7
|
-
export * from "./useSignInWitRedirectMutation";
|
|
8
|
-
export * from "./useUpdateProfileMutation";
|
|
9
|
-
export * from "./useSignOutMutation";
|
|
10
|
-
export * from "./useIdToken";
|
|
11
|
-
export * from "./useReauthenticateWitCredentialMutation";
|
|
12
|
-
export * from "./useReauthenticateWitRedirectMutation";
|
|
13
|
-
export * from "./useAuthStateReady";
|
|
14
|
-
export * from "./useSignInAnonymouslyMutation";
|
|
15
|
-
export * from "./useEmailAuthProviderCredential";
|
|
16
|
-
export * from "./useFacebookAuthProviderCredential";
|
|
17
|
-
export * from "./useAppleAuthProviderCredential";
|
|
18
|
-
export * from "./useLinkWithCredentialMutation";
|
|
19
|
-
export * from "./useSignInWithCredentialMutation";
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
export * from "./mutation-keys";
|
|
2
|
-
export * from "./useAuth";
|
|
3
|
-
export * from "./useCreateUserWitEmailAndPasswordMutation";
|
|
4
|
-
export * from "./useSendEmailVerificationMutation";
|
|
5
|
-
export * from "./useSignInWitEmailAndPasswordMutation";
|
|
6
|
-
export * from "./useCurrentUser";
|
|
7
|
-
export * from "./useSignInWitRedirectMutation";
|
|
8
|
-
export * from "./useUpdateProfileMutation";
|
|
9
|
-
export * from "./useSignOutMutation";
|
|
10
|
-
export * from "./useIdToken";
|
|
11
|
-
export * from "./useReauthenticateWitCredentialMutation";
|
|
12
|
-
export * from "./useReauthenticateWitRedirectMutation";
|
|
13
|
-
export * from "./useAuthStateReady";
|
|
14
|
-
export * from "./useSignInAnonymouslyMutation";
|
|
15
|
-
export * from "./useEmailAuthProviderCredential";
|
|
16
|
-
export * from "./useFacebookAuthProviderCredential";
|
|
17
|
-
export * from "./useAppleAuthProviderCredential";
|
|
18
|
-
export * from "./useLinkWithCredentialMutation";
|
|
19
|
-
export * from "./useSignInWithCredentialMutation";
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
export * from "./mutation-keys";
|
|
2
|
-
export * from "./useAuth";
|
|
3
|
-
export * from "./useCreateUserWitEmailAndPasswordMutation";
|
|
4
|
-
export * from "./useSendEmailVerificationMutation";
|
|
5
|
-
export * from "./useSignInWitEmailAndPasswordMutation";
|
|
6
|
-
export * from "./useCurrentUser";
|
|
7
|
-
export * from "./useSignInWitRedirectMutation";
|
|
8
|
-
export * from "./useUpdateProfileMutation";
|
|
9
|
-
export * from "./useSignOutMutation";
|
|
10
|
-
export * from "./useIdToken";
|
|
11
|
-
export * from "./useReauthenticateWitCredentialMutation";
|
|
12
|
-
export * from "./useReauthenticateWitRedirectMutation";
|
|
13
|
-
export * from "./useAuthStateReady";
|
|
14
|
-
export * from "./useSignInAnonymouslyMutation";
|
|
15
|
-
export * from "./useEmailAuthProviderCredential";
|
|
16
|
-
export * from "./useFacebookAuthProviderCredential";
|
|
17
|
-
export * from "./useAppleAuthProviderCredential";
|
|
18
|
-
export * from "./useLinkWithCredentialMutation";
|
|
19
|
-
export * from "./useSignInWithCredentialMutation";
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
export const CREATE_USER_WITH_EMAIL_AND_PASSWORD_MUTATION_KEY = [
|
|
2
|
-
"FIREBASE",
|
|
3
|
-
"AUTH",
|
|
4
|
-
"CREATE_USER_WITH_EMAIL_AND_PASSWORD_MUTATION"
|
|
5
|
-
] as const;
|
|
6
|
-
export const SEND_EMAIL_VERIFICATION_MUTATION_KEY = ["FIREBASE", "AUTH", "SEND_EMAIL_VERIFICATION_MUTATION"] as const;
|
|
7
|
-
export const SIGN_IN_ANONYMOUSLY_MUTATION_KEY = ["FIREBASE", "AUTH", "SIGN_IN_ANONYMOUSLY_MUTATION"] as const;
|
|
8
|
-
export const SIGN_IN_WITH_EMAIL_AND_PASSWORD_MUTATION_KEY = [
|
|
9
|
-
"FIREBASE",
|
|
10
|
-
"AUTH",
|
|
11
|
-
"SIGN_IN_WITH_EMAIL_AND_PASSWORD_MUTATION"
|
|
12
|
-
] as const;
|
|
13
|
-
export const SIGN_IN_WITH_REDIRECT_MUTATION_KEY = ["FIREBASE", "AUTH", "SIGN_IN_WITH_REDIRECT_MUTATION"] as const;
|
|
14
|
-
export const SIGN_IN_WITH_CREDENTIAL_MUTATION_KEY = ["FIREBASE", "AUTH", "SIGN_IN_WITH_CREDENTIAL_MUTATION"] as const;
|
|
15
|
-
export const LINK_WITH_CREDENTIAL_MUTATION_KEY = ["FIREBASE", "AUTH", "LINK_WITH_CREDENTIAL_MUTATION"] as const;
|
|
16
|
-
export const SIGN_OUT_MUTATION_KEY = ["FIREBASE", "AUTH", "SIGN_OUT"] as const;
|
|
17
|
-
export const REAUTHENTICATE_WITH_REDIRECT_MUTATION_KEY = ["FIREBASE", "AUTH", "REAUTHENTICATE_WITH_REDIRECT"] as const;
|
|
18
|
-
export const REAUTHENTICATE_WITH_CREDENTIAL_MUTATION_KEY = [
|
|
19
|
-
"FIREBASE",
|
|
20
|
-
"AUTH",
|
|
21
|
-
"REAUTHENTICATE_WITH_CREDENTIAL"
|
|
22
|
-
] as const;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { AppleAuthProvider, FirebaseAuthTypes } from "@react-native-firebase/auth";
|
|
2
|
-
import { useCallback } from "react";
|
|
3
|
-
|
|
4
|
-
type Credential = {
|
|
5
|
-
token: string;
|
|
6
|
-
nonce: string;
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* A custom hook that returns an auth credential for facebook.
|
|
11
|
-
*
|
|
12
|
-
* @group Hook
|
|
13
|
-
* @param {AuthProvider} provider alas of a provider
|
|
14
|
-
*
|
|
15
|
-
* @returns {AuthCredential}
|
|
16
|
-
*
|
|
17
|
-
* @example
|
|
18
|
-
* ```jsx
|
|
19
|
-
* export const MyComponent = () => {
|
|
20
|
-
* const getCredential = useAppleAuthProviderCredential();
|
|
21
|
-
* // ...
|
|
22
|
-
* getCredential({token, nonce: ''})
|
|
23
|
-
* };
|
|
24
|
-
* ```
|
|
25
|
-
*/
|
|
26
|
-
|
|
27
|
-
export const useAppleAuthProviderCredential = () => {
|
|
28
|
-
return useCallback((credential: Credential): FirebaseAuthTypes.AuthCredential => {
|
|
29
|
-
return AppleAuthProvider.credential(credential.token, credential.nonce);
|
|
30
|
-
}, []);
|
|
31
|
-
};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { useContext } from "react";
|
|
2
|
-
import { FirebaseContext } from "../context/FirebaseContext";
|
|
3
|
-
/**
|
|
4
|
-
* Custom hook to retrieve the authentication object from the Firebase context.
|
|
5
|
-
* @returns {Auth} The authentication object from the Firebase context.
|
|
6
|
-
*/
|
|
7
|
-
export const useAuth = () => {
|
|
8
|
-
const { auth } = useContext(FirebaseContext);
|
|
9
|
-
return auth;
|
|
10
|
-
};
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { onAuthStateChanged } from "@react-native-firebase/auth";
|
|
2
|
-
import { useAuth } from "./useAuth";
|
|
3
|
-
import { useEffect, useState } from "react";
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* A custom hook that determines if the Firebase authentication state is ready.
|
|
7
|
-
* It uses Firebase authentication to check if the auth state is ready and updates the state accordingly.
|
|
8
|
-
*
|
|
9
|
-
* @group Hook
|
|
10
|
-
*
|
|
11
|
-
* @returns {boolean}
|
|
12
|
-
*
|
|
13
|
-
* @example
|
|
14
|
-
* ```jsx
|
|
15
|
-
* export const MyComponent = () => {
|
|
16
|
-
* const isAuthStateReady = useAuthStateReady();
|
|
17
|
-
* console.log(isAuthStateReady);
|
|
18
|
-
* };
|
|
19
|
-
* ```
|
|
20
|
-
*/
|
|
21
|
-
export const useAuthStateReady = () => {
|
|
22
|
-
const firebaseAuth = useAuth();
|
|
23
|
-
|
|
24
|
-
const [isAuthStateReady, setIsAuthStateReady] = useState(false);
|
|
25
|
-
|
|
26
|
-
useEffect(() => {
|
|
27
|
-
const subscription = onAuthStateChanged(firebaseAuth, () => {
|
|
28
|
-
if (!isAuthStateReady) {
|
|
29
|
-
setIsAuthStateReady(true);
|
|
30
|
-
}
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
return () => {
|
|
34
|
-
subscription();
|
|
35
|
-
};
|
|
36
|
-
}, [firebaseAuth, isAuthStateReady]);
|
|
37
|
-
|
|
38
|
-
return isAuthStateReady;
|
|
39
|
-
};
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { useMutation, UseMutationOptions } from "@tanstack/react-query";
|
|
2
|
-
import { createUserWithEmailAndPassword, FirebaseAuthTypes } from "@react-native-firebase/auth";
|
|
3
|
-
import { useAuth } from "./useAuth";
|
|
4
|
-
import { ReactNativeFirebase } from "@react-native-firebase/app";
|
|
5
|
-
import { CREATE_USER_WITH_EMAIL_AND_PASSWORD_MUTATION_KEY } from "./mutation-keys";
|
|
6
|
-
|
|
7
|
-
export type UseCreateUserWitEmailAndPasswordMutationVariables = {
|
|
8
|
-
email: string;
|
|
9
|
-
password: string;
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Custom hook to initiate a user creation process using email and password with Firebase authentication.
|
|
14
|
-
* This hook utilizes the `useMutation` functionality to support creating new user credentials asynchronously.
|
|
15
|
-
*
|
|
16
|
-
* @param {Omit<UseMutationOptions<FirebaseAuthTypes.UserCredential, ReactNativeFirebase.NativeFirebaseError, UseCreateUserWitEmailAndPasswordMutationVariables, TContext>, "mutationKey" | "mutationFn">} options - Optional settings to customize the mutation behavior, excluding `mutationKey` and `mutationFn`.
|
|
17
|
-
* @returns {UseMutationResult<FirebaseAuthTypes.UserCredential, ReactNativeFirebase.NativeFirebaseError, UseCreateUserWitEmailAndPasswordMutationVariables, TContext>} The result of the mutation which includes status, user credentials, and error information if any.
|
|
18
|
-
*/
|
|
19
|
-
export const useCreateUserWitEmailAndPasswordMutation = <TContext = unknown>(
|
|
20
|
-
options: Omit<
|
|
21
|
-
UseMutationOptions<
|
|
22
|
-
FirebaseAuthTypes.UserCredential,
|
|
23
|
-
ReactNativeFirebase.NativeFirebaseError,
|
|
24
|
-
UseCreateUserWitEmailAndPasswordMutationVariables,
|
|
25
|
-
TContext
|
|
26
|
-
>,
|
|
27
|
-
"mutationKey" | "mutationFn"
|
|
28
|
-
> = {}
|
|
29
|
-
) => {
|
|
30
|
-
const firebaseAuth = useAuth();
|
|
31
|
-
|
|
32
|
-
return useMutation({
|
|
33
|
-
...options,
|
|
34
|
-
mutationFn: async ({ email, password }: UseCreateUserWitEmailAndPasswordMutationVariables) =>
|
|
35
|
-
await createUserWithEmailAndPassword(firebaseAuth, email, password),
|
|
36
|
-
mutationKey: CREATE_USER_WITH_EMAIL_AND_PASSWORD_MUTATION_KEY
|
|
37
|
-
});
|
|
38
|
-
};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { onAuthStateChanged } from "@react-native-firebase/auth";
|
|
2
|
-
import { useAuth } from "./useAuth";
|
|
3
|
-
import { useEffect, useState } from "react";
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Hook that provides the current authenticated user from Firebase Auth.
|
|
7
|
-
* It listens for changes in the authentication state and updates the user accordingly.
|
|
8
|
-
* @returns {Object|null} The current authenticated user object or null if no user is authenticated.
|
|
9
|
-
*/
|
|
10
|
-
export const useCurrentUser = () => {
|
|
11
|
-
const firebaseAuth = useAuth();
|
|
12
|
-
|
|
13
|
-
const [currentUser, setCurrentUser] = useState(firebaseAuth.currentUser);
|
|
14
|
-
|
|
15
|
-
useEffect(() => {
|
|
16
|
-
const unsubscribe = onAuthStateChanged(firebaseAuth, (user) => {
|
|
17
|
-
setCurrentUser(user);
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
return () => {
|
|
21
|
-
unsubscribe();
|
|
22
|
-
};
|
|
23
|
-
}, [firebaseAuth]);
|
|
24
|
-
|
|
25
|
-
return currentUser;
|
|
26
|
-
};
|