react-query-firebase 2.13.3 → 2.14.0
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 +2 -2
- 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 +1 -1
- 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 +2 -2
- package/{react-native → dist/react-native}/firestore/useDocReference.js +2 -2
- 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 +5 -0
- package/dist/react-native/index.js +5 -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 +1 -1
- 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 +2 -2
- 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 +1 -1
- 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 +2 -2
- package/{web → dist/web}/firestore/useDocReference.js +2 -2
- 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 +5 -0
- package/dist/web/index.js +5 -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 +37 -17
- 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 -42
- 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 -30
- 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 -43
- 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,83 +0,0 @@
|
|
|
1
|
-
import { useCallback, useEffect, useState } from "react";
|
|
2
|
-
import { onIdTokenChanged, FirebaseAuthTypes, getIdToken } from "@react-native-firebase/auth";
|
|
3
|
-
import { useCurrentUser } from "./useCurrentUser";
|
|
4
|
-
import { useAuth } from "./useAuth";
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* @inline
|
|
8
|
-
*/
|
|
9
|
-
export type UseIdTokenResult = {
|
|
10
|
-
idToken: string;
|
|
11
|
-
refresh: () => Promise<string | undefined>;
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* A hook to manage the ID token.
|
|
16
|
-
* It monitors changes to the ID token and provides the token itself along with a refresh method to update the token when needed.
|
|
17
|
-
*
|
|
18
|
-
* @group Hook
|
|
19
|
-
*
|
|
20
|
-
* @returns {UseIdTokenResult}
|
|
21
|
-
*
|
|
22
|
-
* @example
|
|
23
|
-
* ```jsx
|
|
24
|
-
* export const MyComponent = () => {
|
|
25
|
-
* const result = useIdToken();
|
|
26
|
-
* useEffect(() => {
|
|
27
|
-
* const timeout = setTimeout(() => {
|
|
28
|
-
* result.refresh();
|
|
29
|
-
* }, 5000);
|
|
30
|
-
* return () => clearTimeout();
|
|
31
|
-
* }, [])
|
|
32
|
-
* console.log(resilt.idToken);
|
|
33
|
-
* };
|
|
34
|
-
* ```
|
|
35
|
-
*/
|
|
36
|
-
export const useIdToken = (): UseIdTokenResult => {
|
|
37
|
-
const auth = useAuth();
|
|
38
|
-
|
|
39
|
-
const currentUser = useCurrentUser();
|
|
40
|
-
const [idToken, setIdToken] = useState("");
|
|
41
|
-
|
|
42
|
-
const callback = useCallback(async () => {
|
|
43
|
-
if (!currentUser) {
|
|
44
|
-
setIdToken("");
|
|
45
|
-
return;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
const idToken = await getIdToken(currentUser);
|
|
49
|
-
setIdToken(idToken);
|
|
50
|
-
}, [currentUser]);
|
|
51
|
-
|
|
52
|
-
const refresh = useCallback(async () => {
|
|
53
|
-
if (!currentUser) {
|
|
54
|
-
return;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
const idToken = await getIdToken(currentUser, true);
|
|
58
|
-
return idToken;
|
|
59
|
-
}, [currentUser]);
|
|
60
|
-
|
|
61
|
-
useEffect(() => {
|
|
62
|
-
setTimeout(callback, 0);
|
|
63
|
-
}, [callback]);
|
|
64
|
-
|
|
65
|
-
useEffect(() => {
|
|
66
|
-
const unsubscribe = onIdTokenChanged(auth, (user: FirebaseAuthTypes.User | null) => {
|
|
67
|
-
if (user) {
|
|
68
|
-
getIdToken(user).then((idToken) => {
|
|
69
|
-
setIdToken(idToken);
|
|
70
|
-
});
|
|
71
|
-
} else {
|
|
72
|
-
setIdToken("");
|
|
73
|
-
}
|
|
74
|
-
});
|
|
75
|
-
|
|
76
|
-
return () => unsubscribe();
|
|
77
|
-
}, [auth]);
|
|
78
|
-
|
|
79
|
-
return {
|
|
80
|
-
idToken,
|
|
81
|
-
refresh
|
|
82
|
-
};
|
|
83
|
-
};
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { useMutation, UseMutationOptions } from "@tanstack/react-query";
|
|
2
|
-
import { linkWithCredential, FirebaseAuthTypes } from "@react-native-firebase/auth";
|
|
3
|
-
|
|
4
|
-
import { ReactNativeFirebase } from "@react-native-firebase/app";
|
|
5
|
-
import { LINK_WITH_CREDENTIAL_MUTATION_KEY } from "./mutation-keys";
|
|
6
|
-
|
|
7
|
-
export type UseLinkWitCredentialMutationVariables = {
|
|
8
|
-
user: FirebaseAuthTypes.User;
|
|
9
|
-
credential: FirebaseAuthTypes.AuthCredential;
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Custom hook for handling linking of Firebase account to auth provider using credential
|
|
14
|
-
* This hook utilizes the `useMutation` mechanism to perform the sign-in operation.
|
|
15
|
-
* @param {Omit<UseMutationOptions<FirebaseAuthTypes.UserCredential, ReactNativeFirebase.NativeFirebaseError, UseLinkWitCredentialMutationVariables, TContext>, "mutationKey" | "mutationFn">} options - Optional configurations for the mutation, omitting the mutationKey and mutationFn properties.
|
|
16
|
-
* @returns {UseMutationResult<FirebaseAuthTypes.UserCredential, ReactNativeFirebase.NativeFirebaseError, UseLinkWitCredentialMutationVariables, TContext>} The result object from the useMutation hook, containing the mutation function and its current state.
|
|
17
|
-
*/
|
|
18
|
-
export const useLinkWithCredentialMutation = <TContext = unknown>(
|
|
19
|
-
options: Omit<
|
|
20
|
-
UseMutationOptions<
|
|
21
|
-
FirebaseAuthTypes.UserCredential,
|
|
22
|
-
ReactNativeFirebase.NativeFirebaseError,
|
|
23
|
-
UseLinkWitCredentialMutationVariables,
|
|
24
|
-
TContext
|
|
25
|
-
>,
|
|
26
|
-
"mutationKey" | "mutationFn"
|
|
27
|
-
> = {}
|
|
28
|
-
) => {
|
|
29
|
-
return useMutation({
|
|
30
|
-
...options,
|
|
31
|
-
mutationFn: async ({ user, credential }: UseLinkWitCredentialMutationVariables) =>
|
|
32
|
-
linkWithCredential(user, credential),
|
|
33
|
-
mutationKey: LINK_WITH_CREDENTIAL_MUTATION_KEY
|
|
34
|
-
});
|
|
35
|
-
};
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { useMutation, UseMutationOptions } from "@tanstack/react-query";
|
|
2
|
-
import { reauthenticateWithCredential, FirebaseAuthTypes } from "@react-native-firebase/auth";
|
|
3
|
-
import { ReactNativeFirebase } from "@react-native-firebase/app";
|
|
4
|
-
import { REAUTHENTICATE_WITH_CREDENTIAL_MUTATION_KEY } from "./mutation-keys";
|
|
5
|
-
|
|
6
|
-
export type UseReauthenticateWitCredentialMutationVariables = {
|
|
7
|
-
credential: FirebaseAuthTypes.AuthCredential;
|
|
8
|
-
user: FirebaseAuthTypes.User;
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Custom hook to create a mutation for re-authenticating a user with a given credential.
|
|
13
|
-
* This hook utilizes useMutation from React Query to manage the asynchronous re-authentication
|
|
14
|
-
* process with Firebase credentials. It omits the default "mutationKey" and "mutationFn" options.
|
|
15
|
-
*
|
|
16
|
-
* @param {Omit<UseMutationOptions<FirebaseAuthTypes.UserCredential, ReactNativeFirebase.NativeFirebaseError, UseReauthenticateWitCredentialMutationVariables, TContext>, "mutationKey" | "mutationFn">} options - Optional mutation options excluding "mutationKey" and "mutationFn".
|
|
17
|
-
* @returns {UseMutationResult<FirebaseAuthTypes.UserCredential, ReactNativeFirebase.NativeFirebaseError, UseReauthenticateWitCredentialMutationVariables, TContext>} A useMutation result object managing the loading, error, and result state of the re-authentication mutation.
|
|
18
|
-
*/
|
|
19
|
-
export const useReauthenticateWitCredentialMutation = <TContext = unknown>(
|
|
20
|
-
options: Omit<
|
|
21
|
-
UseMutationOptions<
|
|
22
|
-
FirebaseAuthTypes.UserCredential,
|
|
23
|
-
ReactNativeFirebase.NativeFirebaseError,
|
|
24
|
-
UseReauthenticateWitCredentialMutationVariables,
|
|
25
|
-
TContext
|
|
26
|
-
>,
|
|
27
|
-
"mutationKey" | "mutationFn"
|
|
28
|
-
> = {}
|
|
29
|
-
) => {
|
|
30
|
-
return useMutation({
|
|
31
|
-
...options,
|
|
32
|
-
mutationFn: async ({ credential, user }: UseReauthenticateWitCredentialMutationVariables) =>
|
|
33
|
-
reauthenticateWithCredential(user, credential),
|
|
34
|
-
mutationKey: REAUTHENTICATE_WITH_CREDENTIAL_MUTATION_KEY
|
|
35
|
-
});
|
|
36
|
-
};
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { useMutation, UseMutationOptions } from "@tanstack/react-query";
|
|
2
|
-
import { reauthenticateWithRedirect, FirebaseAuthTypes, PopupRedirectResolver } from "@react-native-firebase/auth";
|
|
3
|
-
|
|
4
|
-
import { ReactNativeFirebase } from "@react-native-firebase/app";
|
|
5
|
-
import { REAUTHENTICATE_WITH_REDIRECT_MUTATION_KEY } from "./mutation-keys";
|
|
6
|
-
|
|
7
|
-
export type UseReauthenticateWitRedirectMutationVariables = {
|
|
8
|
-
authProvider: FirebaseAuthTypes.AuthProvider;
|
|
9
|
-
popupRedirectResolver?: PopupRedirectResolver;
|
|
10
|
-
user: FirebaseAuthTypes.User;
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Custom hook that provides a mutation to reauthenticate a user with a given authentication provider using redirection.
|
|
15
|
-
* This hook uses the `useMutation` hook from the React Query library to handle async mutation logic.
|
|
16
|
-
*
|
|
17
|
-
* @param {Omit<UseMutationOptions<void, ReactNativeFirebase.NativeFirebaseError, UseReauthenticateWitRedirectMutationVariables, TContext>, "mutationKey" | "mutationFn">} options - Optional configuration object for the mutation. It provides the ability to pass options to customize the behavior of the mutation.
|
|
18
|
-
* @template TContext - The type of any additional context you wish to pass to the mutation.
|
|
19
|
-
* @returns {UseMutationResult<void, ReactNativeFirebase.NativeFirebaseError, UseReauthenticateWitRedirectMutationVariables, TContext>} A mutation result object containing methods and state of the mutation.
|
|
20
|
-
*/
|
|
21
|
-
export const useReauthenticateWitRedirectMutation = <TContext = unknown>(
|
|
22
|
-
options: Omit<
|
|
23
|
-
UseMutationOptions<
|
|
24
|
-
void,
|
|
25
|
-
ReactNativeFirebase.NativeFirebaseError,
|
|
26
|
-
UseReauthenticateWitRedirectMutationVariables,
|
|
27
|
-
TContext
|
|
28
|
-
>,
|
|
29
|
-
"mutationKey" | "mutationFn"
|
|
30
|
-
> = {}
|
|
31
|
-
) => {
|
|
32
|
-
return useMutation({
|
|
33
|
-
...options,
|
|
34
|
-
mutationFn: async ({
|
|
35
|
-
authProvider,
|
|
36
|
-
user,
|
|
37
|
-
popupRedirectResolver
|
|
38
|
-
}: UseReauthenticateWitRedirectMutationVariables) =>
|
|
39
|
-
reauthenticateWithRedirect(user, authProvider, popupRedirectResolver),
|
|
40
|
-
mutationKey: REAUTHENTICATE_WITH_REDIRECT_MUTATION_KEY
|
|
41
|
-
});
|
|
42
|
-
};
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { useMutation, UseMutationOptions } from "@tanstack/react-query";
|
|
2
|
-
import { sendEmailVerification, FirebaseAuthTypes } from "@react-native-firebase/auth";
|
|
3
|
-
|
|
4
|
-
import { ReactNativeFirebase } from "@react-native-firebase/app";
|
|
5
|
-
import { SEND_EMAIL_VERIFICATION_MUTATION_KEY } from "./mutation-keys";
|
|
6
|
-
|
|
7
|
-
export type UseSendEmailVerificationMutationVariables = {
|
|
8
|
-
user: FirebaseAuthTypes.User;
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* A custom hook to create a mutation for sending an email verification to a user using Firebase.
|
|
13
|
-
* This uses the `useMutation` hook from a query library and wraps it with specific configuration options.
|
|
14
|
-
* @param {Omit<UseMutationOptions<void, ReactNativeFirebase.NativeReactNativeFirebase.NativeFirebaseError, UseSendEmailVerificationMutationVariables, TContext>, "queryKey" | "queryFn">} options - Configuration options for the mutation, excluding `queryKey` and `queryFn`.
|
|
15
|
-
* @returns {UseMutationResult<void, NativeReactNativeFirebase.NativeFirebaseError, UseSendEmailVerificationMutationVariables, TContext>} An object containing mutation state and functions for managing the mutation lifecycle.
|
|
16
|
-
*/
|
|
17
|
-
export const useSendEmailVerificationMutation = <TContext = unknown>(
|
|
18
|
-
options: Omit<
|
|
19
|
-
UseMutationOptions<
|
|
20
|
-
void,
|
|
21
|
-
ReactNativeFirebase.NativeFirebaseError,
|
|
22
|
-
UseSendEmailVerificationMutationVariables,
|
|
23
|
-
TContext
|
|
24
|
-
>,
|
|
25
|
-
"queryKey" | "queryFn"
|
|
26
|
-
> = {}
|
|
27
|
-
) => {
|
|
28
|
-
return useMutation({
|
|
29
|
-
...options,
|
|
30
|
-
mutationFn: async ({ user }) => await sendEmailVerification(user),
|
|
31
|
-
mutationKey: SEND_EMAIL_VERIFICATION_MUTATION_KEY
|
|
32
|
-
});
|
|
33
|
-
};
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { useMutation, UseMutationOptions } from "@tanstack/react-query";
|
|
2
|
-
import { signInAnonymously, FirebaseAuthTypes } from "@react-native-firebase/auth";
|
|
3
|
-
|
|
4
|
-
import { ReactNativeFirebase } from "@react-native-firebase/app";
|
|
5
|
-
import { useAuth } from "./useAuth";
|
|
6
|
-
import { SIGN_IN_ANONYMOUSLY_MUTATION_KEY } from "./mutation-keys";
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* @inline
|
|
10
|
-
*/
|
|
11
|
-
export type UseSignInAnonymouslyMutationOptions = {
|
|
12
|
-
/**
|
|
13
|
-
* Options for useMutation hook excluding mutationFn. MutationKey will be equal to reference.path by default.
|
|
14
|
-
*/
|
|
15
|
-
options?: Omit<
|
|
16
|
-
UseMutationOptions<FirebaseAuthTypes.UserCredential, ReactNativeFirebase.NativeFirebaseError, void>,
|
|
17
|
-
"mutationFn"
|
|
18
|
-
>;
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* Executes a mutation and returns users credentials
|
|
23
|
-
*
|
|
24
|
-
* @group Hook
|
|
25
|
-
*
|
|
26
|
-
* @param {useSignInAnonymouslyMutation} options - Configuration options for the mutation.
|
|
27
|
-
*
|
|
28
|
-
* @returns {UseMutationResult<AppModelType, Error, UseAddDocMutationValues<AppModelType>, TContext>} A mutation result
|
|
29
|
-
*
|
|
30
|
-
* @example
|
|
31
|
-
* ```jsx
|
|
32
|
-
* export const MyComponent = () => {
|
|
33
|
-
* const {mutate} = useSignInAnonymouslyMutation({
|
|
34
|
-
* options: {
|
|
35
|
-
* },
|
|
36
|
-
* });
|
|
37
|
-
*
|
|
38
|
-
* // ....
|
|
39
|
-
* mutate();
|
|
40
|
-
* // ....
|
|
41
|
-
* };
|
|
42
|
-
* ```
|
|
43
|
-
*/
|
|
44
|
-
export const useSignInAnonymouslyMutation = ({ options = {} }: UseSignInAnonymouslyMutationOptions = {}) => {
|
|
45
|
-
const firebaseAuth = useAuth();
|
|
46
|
-
|
|
47
|
-
return useMutation({
|
|
48
|
-
...options,
|
|
49
|
-
mutationKey: SIGN_IN_ANONYMOUSLY_MUTATION_KEY,
|
|
50
|
-
mutationFn: async () => signInAnonymously(firebaseAuth)
|
|
51
|
-
});
|
|
52
|
-
};
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { useMutation, UseMutationOptions } from "@tanstack/react-query";
|
|
2
|
-
import { signInWithEmailAndPassword, FirebaseAuthTypes } from "@react-native-firebase/auth";
|
|
3
|
-
|
|
4
|
-
import { ReactNativeFirebase } from "@react-native-firebase/app";
|
|
5
|
-
import { useAuth } from "./useAuth";
|
|
6
|
-
import { SIGN_IN_WITH_EMAIL_AND_PASSWORD_MUTATION_KEY } from "./mutation-keys";
|
|
7
|
-
|
|
8
|
-
export type UseSignInWitEmailAndPasswordMutationVariables = {
|
|
9
|
-
email: string;
|
|
10
|
-
password: string;
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Custom hook to perform a sign-in operation using email and password with Firebase Authentication.
|
|
15
|
-
* It utilizes the `useMutation` hook to manage the asynchronous operation and its state.
|
|
16
|
-
*
|
|
17
|
-
* @param {Omit<UseMutationOptions<FirebaseAuthTypes.UserCredential, ReactNativeFirebase.NativeFirebaseError, UseSignInWitEmailAndPasswordMutationVariables, TContext>, 'mutationKey' | 'mutationFn'>} options - Options to configure the mutation, excluding 'mutationKey' and 'mutationFn'.
|
|
18
|
-
* @returns {MutationResult} A mutation object containing the result of the sign-in process and helper functions.
|
|
19
|
-
*/
|
|
20
|
-
export const useSignInWitEmailAndPasswordMutation = <TContext = unknown>(
|
|
21
|
-
options: Omit<
|
|
22
|
-
UseMutationOptions<
|
|
23
|
-
FirebaseAuthTypes.UserCredential,
|
|
24
|
-
ReactNativeFirebase.NativeFirebaseError,
|
|
25
|
-
UseSignInWitEmailAndPasswordMutationVariables,
|
|
26
|
-
TContext
|
|
27
|
-
>,
|
|
28
|
-
"mutationKey" | "mutationFn"
|
|
29
|
-
> = {}
|
|
30
|
-
) => {
|
|
31
|
-
const firebaseAuth = useAuth();
|
|
32
|
-
|
|
33
|
-
return useMutation({
|
|
34
|
-
...options,
|
|
35
|
-
mutationFn: async ({ email, password }: UseSignInWitEmailAndPasswordMutationVariables) =>
|
|
36
|
-
signInWithEmailAndPassword(firebaseAuth, email, password),
|
|
37
|
-
mutationKey: SIGN_IN_WITH_EMAIL_AND_PASSWORD_MUTATION_KEY
|
|
38
|
-
});
|
|
39
|
-
};
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { useMutation, UseMutationOptions } from "@tanstack/react-query";
|
|
2
|
-
import { signInWithRedirect, FirebaseAuthTypes, PopupRedirectResolver } from "@react-native-firebase/auth";
|
|
3
|
-
|
|
4
|
-
import { ReactNativeFirebase } from "@react-native-firebase/app";
|
|
5
|
-
import { useAuth } from "./useAuth";
|
|
6
|
-
import { SIGN_IN_WITH_REDIRECT_MUTATION_KEY } from "./mutation-keys";
|
|
7
|
-
|
|
8
|
-
export type UseSignInWitRedirectMutationVariables = {
|
|
9
|
-
authProvider: FirebaseAuthTypes.AuthProvider;
|
|
10
|
-
popupRedirectResolver?: PopupRedirectResolver;
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Custom hook for handling Firebase authentication using sign-in with redirect functionality.
|
|
15
|
-
* This hook utilizes the `useMutation` mechanism to perform the sign-in operation.
|
|
16
|
-
* @param {Omit<UseMutationOptions<void, ReactNativeFirebase.NativeFirebaseError, UseSignInWitRedirectMutationVariables, TContext>, "mutationKey" | "mutationFn">} options - Optional configurations for the mutation, omitting the mutationKey and mutationFn properties.
|
|
17
|
-
* @returns {UseMutationResult<void, ReactNativeFirebase.NativeFirebaseError, UseSignInWitRedirectMutationVariables, TContext>} The result object from the useMutation hook, containing the mutation function and its current state.
|
|
18
|
-
*/
|
|
19
|
-
export const useSignInWitRedirectMutation = <TContext = unknown>(
|
|
20
|
-
options: Omit<
|
|
21
|
-
UseMutationOptions<
|
|
22
|
-
void,
|
|
23
|
-
ReactNativeFirebase.NativeFirebaseError,
|
|
24
|
-
UseSignInWitRedirectMutationVariables,
|
|
25
|
-
TContext
|
|
26
|
-
>,
|
|
27
|
-
"mutationKey" | "mutationFn"
|
|
28
|
-
> = {}
|
|
29
|
-
) => {
|
|
30
|
-
const firebaseAuth = useAuth();
|
|
31
|
-
|
|
32
|
-
return useMutation({
|
|
33
|
-
...options,
|
|
34
|
-
mutationFn: async ({ authProvider, popupRedirectResolver }: UseSignInWitRedirectMutationVariables) =>
|
|
35
|
-
signInWithRedirect(firebaseAuth, authProvider, popupRedirectResolver),
|
|
36
|
-
mutationKey: SIGN_IN_WITH_REDIRECT_MUTATION_KEY
|
|
37
|
-
});
|
|
38
|
-
};
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { useMutation, UseMutationOptions } from "@tanstack/react-query";
|
|
2
|
-
import { FirebaseAuthTypes, signInWithCredential } from "@react-native-firebase/auth";
|
|
3
|
-
|
|
4
|
-
import { ReactNativeFirebase } from "@react-native-firebase/app";
|
|
5
|
-
import { SIGN_IN_WITH_CREDENTIAL_MUTATION_KEY } from "./mutation-keys";
|
|
6
|
-
import { useAuth } from "./useAuth";
|
|
7
|
-
|
|
8
|
-
export type UseSignInWithCredentialMutationVariables = {
|
|
9
|
-
credential: FirebaseAuthTypes.AuthCredential;
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Custom hook for handling sign in using credential
|
|
14
|
-
* This hook utilizes the `useMutation` mechanism to perform the sign-in operation.
|
|
15
|
-
* @param {Omit<UseMutationOptions<FirebaseAuthTypes.UserCredential, FirebaseError, UseSignInWithCredentialMutationVariables, TContext>, "mutationKey" | "mutationFn">} options - Optional configurations for the mutation, omitting the mutationKey and mutationFn properties.
|
|
16
|
-
* @returns {UseMutationResult<FirebaseAuthTypes.UserCredential, FirebaseError, UseSignInWithCredentialMutationVariables, TContext>} The result object from the useMutation hook, containing the mutation function and its current state.
|
|
17
|
-
*/
|
|
18
|
-
export const useSignInWithCredentialMutation = <TContext = unknown>(
|
|
19
|
-
options: Omit<
|
|
20
|
-
UseMutationOptions<
|
|
21
|
-
FirebaseAuthTypes.UserCredential,
|
|
22
|
-
ReactNativeFirebase.NativeFirebaseError,
|
|
23
|
-
UseSignInWithCredentialMutationVariables,
|
|
24
|
-
TContext
|
|
25
|
-
>,
|
|
26
|
-
"mutationKey" | "mutationFn"
|
|
27
|
-
> = {}
|
|
28
|
-
) => {
|
|
29
|
-
const auth = useAuth();
|
|
30
|
-
return useMutation({
|
|
31
|
-
...options,
|
|
32
|
-
mutationFn: async ({ credential }: UseSignInWithCredentialMutationVariables) =>
|
|
33
|
-
signInWithCredential(auth, credential),
|
|
34
|
-
mutationKey: SIGN_IN_WITH_CREDENTIAL_MUTATION_KEY
|
|
35
|
-
});
|
|
36
|
-
};
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { useMutation, UseMutationOptions } from "@tanstack/react-query";
|
|
2
|
-
import { signOut } from "@react-native-firebase/auth";
|
|
3
|
-
|
|
4
|
-
import { ReactNativeFirebase } from "@react-native-firebase/app";
|
|
5
|
-
import { SIGN_OUT_MUTATION_KEY } from "./mutation-keys";
|
|
6
|
-
import { useAuth } from "./useAuth";
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Custom hook for handling the sign-out mutation using Firebase authentication.
|
|
10
|
-
* It wraps the useMutation hook to provide a sign-out function with Firebase.
|
|
11
|
-
*
|
|
12
|
-
* @param {Omit<UseMutationOptions<void, ReactNativeFirebase.NativeFirebaseError, void, TContext>, "queryKey" | "queryFn">} options - Configuration options for the mutation, excluding "queryKey" and "queryFn".
|
|
13
|
-
* @returns {UseMutationResult<void, ReactNativeFirebase.NativeFirebaseError, void, TContext>} A mutation object for handling the sign-out process, including methods for mutating and state tracking.
|
|
14
|
-
*/
|
|
15
|
-
export const useSignOutMutation = <TContext = unknown>(
|
|
16
|
-
options: Omit<
|
|
17
|
-
UseMutationOptions<void, ReactNativeFirebase.NativeFirebaseError, void, TContext>,
|
|
18
|
-
"queryKey" | "queryFn"
|
|
19
|
-
> = {}
|
|
20
|
-
) => {
|
|
21
|
-
const firebaseAuth = useAuth();
|
|
22
|
-
|
|
23
|
-
return useMutation({
|
|
24
|
-
...options,
|
|
25
|
-
mutationFn: async () => await signOut(firebaseAuth),
|
|
26
|
-
mutationKey: SIGN_OUT_MUTATION_KEY
|
|
27
|
-
});
|
|
28
|
-
};
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { useMutation, UseMutationOptions } from "@tanstack/react-query";
|
|
2
|
-
import { updateProfile, FirebaseAuthTypes } from "@react-native-firebase/auth";
|
|
3
|
-
import { ReactNativeFirebase } from "@react-native-firebase/app";
|
|
4
|
-
import { CREATE_USER_WITH_EMAIL_AND_PASSWORD_MUTATION_KEY } from "./mutation-keys";
|
|
5
|
-
|
|
6
|
-
export type UseUpdateProfileMutationVariables = {
|
|
7
|
-
displayName?: string;
|
|
8
|
-
user: FirebaseAuthTypes.User;
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Custom hook to manage the mutation for updating a user's profile.
|
|
13
|
-
* Utilizes Firebase for updating the user's display name.
|
|
14
|
-
*
|
|
15
|
-
* @param {Omit<UseMutationOptions<void, ReactNativeFirebase.NativeFirebaseError, UseUpdateProfileMutationVariables, TContext>, "mutationKey" | "mutationFn">} options - Configuration options for the mutation, excluding mutationKey and mutationFn.
|
|
16
|
-
* @returns {UseMutationResult<void, ReactNativeFirebase.NativeFirebaseError, UseUpdateProfileMutationVariables, TContext>} The result of the mutation operation including statuses, data, and error information.
|
|
17
|
-
*/
|
|
18
|
-
export const useUpdateProfileMutation = <TContext = unknown>(
|
|
19
|
-
options: Omit<
|
|
20
|
-
UseMutationOptions<void, ReactNativeFirebase.NativeFirebaseError, UseUpdateProfileMutationVariables, TContext>,
|
|
21
|
-
"mutationKey" | "mutationFn"
|
|
22
|
-
> = {}
|
|
23
|
-
) => {
|
|
24
|
-
return useMutation({
|
|
25
|
-
...options,
|
|
26
|
-
mutationFn: async ({ displayName, user }: UseUpdateProfileMutationVariables) =>
|
|
27
|
-
await updateProfile(user, { displayName }),
|
|
28
|
-
mutationKey: CREATE_USER_WITH_EMAIL_AND_PASSWORD_MUTATION_KEY
|
|
29
|
-
});
|
|
30
|
-
};
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import { createContext } from "react";
|
|
4
|
-
|
|
5
|
-
import { type ReactNativeFirebase } from "@react-native-firebase/app";
|
|
6
|
-
import { type FirebaseAuthTypes } from "@react-native-firebase/auth";
|
|
7
|
-
import { type FirebaseAnalyticsTypes } from "@react-native-firebase/analytics";
|
|
8
|
-
import { type FirebaseRemoteConfigTypes } from "@react-native-firebase/remote-config";
|
|
9
|
-
import { type FirebaseFirestoreTypes } from "@react-native-firebase/firestore";
|
|
10
|
-
|
|
11
|
-
export type FirebaseContextValue = {
|
|
12
|
-
auth: FirebaseAuthTypes.Module;
|
|
13
|
-
analytics: FirebaseAnalyticsTypes.Module;
|
|
14
|
-
firebase: ReactNativeFirebase.FirebaseApp;
|
|
15
|
-
remoteConfig: FirebaseRemoteConfigTypes.Module;
|
|
16
|
-
firestore: FirebaseFirestoreTypes.Module;
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* FirebaseContext is a shared context across children that provides access to firebase features
|
|
21
|
-
*
|
|
22
|
-
* @internal
|
|
23
|
-
*/
|
|
24
|
-
|
|
25
|
-
export const FirebaseContext = createContext<FirebaseContextValue>({} as FirebaseContextValue);
|