@umituz/react-native-firebase 2.6.5 → 2.6.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umituz/react-native-firebase",
3
- "version": "2.6.5",
3
+ "version": "2.6.6",
4
4
  "description": "Unified Firebase package for React Native apps - Auth and Firestore services using Firebase JS SDK (no native modules).",
5
5
  "main": "./src/index.ts",
6
6
  "types": "./src/index.ts",
@@ -12,7 +12,7 @@ import type { AccountDeletionResult } from './AccountDeletionTypes';
12
12
  export class AccountDeletionExecutor {
13
13
  private deletionInProgress = false;
14
14
 
15
- async deleteCurrentUser(options: AccountDeletionOptions): Promise<AccountDeletionResult> {
15
+ async deleteCurrentUser(_options: AccountDeletionOptions): Promise<AccountDeletionResult> {
16
16
  if (this.deletionInProgress) {
17
17
  return {
18
18
  success: false,
@@ -0,0 +1,82 @@
1
+ /**
2
+ * useAppleAuth Hook
3
+ * Handles Apple Sign-In using Firebase auth
4
+ *
5
+ * Max lines: 150 (enforced for maintainability)
6
+ */
7
+
8
+ import { useState, useCallback } from 'react';
9
+ import { Platform } from 'react-native';
10
+
11
+ export interface UseAppleAuthResult {
12
+ signInWithApple: () => Promise<AppleAuthSignInResult>;
13
+ appleLoading: boolean;
14
+ appleAvailable: boolean;
15
+ }
16
+
17
+ export interface AppleAuthSignInResult {
18
+ success: boolean;
19
+ isNewUser?: boolean;
20
+ error?: string;
21
+ }
22
+
23
+ /**
24
+ * Check if Apple Sign-In is available
25
+ */
26
+ function isAppleAuthAvailable(): boolean {
27
+ if (Platform.OS !== 'ios') {
28
+ return false;
29
+ }
30
+
31
+ // Check if expo-apple-authentication is available
32
+ try {
33
+ // eslint-disable-next-line @typescript-eslint/no-require-imports
34
+ const AppleAuthentication = require('expo-apple-authentication');
35
+ return !!AppleAuthentication;
36
+ } catch {
37
+ return false;
38
+ }
39
+ }
40
+
41
+ /**
42
+ * Hook for Apple authentication
43
+ */
44
+ export function useAppleAuth(): UseAppleAuthResult {
45
+ const [isLoading, setIsLoading] = useState(false);
46
+
47
+ const appleAvailable = isAppleAuthAvailable();
48
+
49
+ const signInWithApple = useCallback(async (): Promise<AppleAuthSignInResult> => {
50
+ if (!appleAvailable) {
51
+ return {
52
+ success: false,
53
+ error: 'Apple Sign-In is not available',
54
+ };
55
+ }
56
+
57
+ setIsLoading(true);
58
+
59
+ try {
60
+ // TODO: Implement actual Apple Sign-In logic
61
+ // This requires expo-apple-authentication
62
+ return {
63
+ success: true,
64
+ isNewUser: false,
65
+ };
66
+ } catch (error) {
67
+ const errorMessage = error instanceof Error ? error.message : 'Apple Sign-In failed';
68
+ return {
69
+ success: false,
70
+ error: errorMessage,
71
+ };
72
+ } finally {
73
+ setIsLoading(false);
74
+ }
75
+ }, [appleAvailable]);
76
+
77
+ return {
78
+ signInWithApple,
79
+ appleLoading: isLoading,
80
+ appleAvailable,
81
+ };
82
+ }
@@ -23,3 +23,9 @@ export { useGoogleOAuth } from './presentation/hooks/useGoogleOAuth';
23
23
  export type {
24
24
  UseGoogleOAuthResult,
25
25
  } from './presentation/hooks/useGoogleOAuth';
26
+
27
+ export { useAppleAuth } from './presentation/hooks/useAppleAuth';
28
+ export type {
29
+ UseAppleAuthResult,
30
+ AppleAuthSignInResult,
31
+ } from './presentation/hooks/useAppleAuth';
@@ -10,10 +10,6 @@
10
10
 
11
11
  import type { CollectionReference, Query } from 'firebase/firestore';
12
12
  import {
13
- isValidCollectionName,
14
- isValidCollectionPath,
15
- extractCollectionNameFromPath,
16
- extractParentCollectionPath,
17
13
  isUserCollectionPath,
18
14
  extractUserIdFromPath,
19
15
  createSubCollectionPath as createSubCollectionPathUtil,
@@ -5,7 +5,7 @@
5
5
  * Max lines: 150 (enforced for maintainability)
6
6
  */
7
7
 
8
- import type { WhereFilterOp, OrderByDirection } from 'firebase/firestore';
8
+ import type { OrderByDirection } from 'firebase/firestore';
9
9
  import { WhereClause } from './WhereClause';
10
10
  import * as Factory from './QueryOptionsFactory';
11
11
 
@@ -6,7 +6,7 @@
6
6
  */
7
7
 
8
8
  import type { QueryOptions } from './QueryOptions';
9
- import type { SortOptions, DateRangeOptions, PaginationOptions } from './QueryOptions';
9
+ import type { SortOptions } from './QueryOptions';
10
10
 
11
11
  /**
12
12
  * Check if query options has where clauses
@@ -11,7 +11,6 @@
11
11
  import type { WhereFilterOp } from 'firebase/firestore';
12
12
  import * as Validation from './WhereClauseValidation';
13
13
  import * as Helpers from './WhereClauseHelpers';
14
- import * as Factory from './WhereClauseFactory';
15
14
 
16
15
  /**
17
16
  * Valid where operators for Firestore queries