@umituz/react-native-firebase 1.13.123 → 1.13.125

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": "1.13.123",
3
+ "version": "1.13.125",
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",
@@ -114,7 +114,6 @@ export {
114
114
 
115
115
  // Firestore Helper Utilities
116
116
  export {
117
- getDb,
118
117
  withFirestore,
119
118
  withFirestoreVoid,
120
119
  withFirestoreBool,
@@ -3,60 +3,25 @@
3
3
  * Provides common patterns for Firestore operations with error handling
4
4
  */
5
5
 
6
- import { getFirestore } from "../infrastructure/config/FirestoreClient";
7
- import type { Firestore } from "../infrastructure/config/FirestoreClient";
8
- import {
6
+ export type { Firestore } from "../infrastructure/config/FirestoreClient";
7
+
8
+ // Re-export result utilities
9
+ export {
9
10
  createErrorResult,
10
11
  createSuccessResult,
12
+ isSuccess,
13
+ isError,
11
14
  type FirestoreResult,
12
15
  type NoDbResult,
13
16
  NO_DB_ERROR,
14
17
  } from "./result/result.util";
15
- import {
16
- withFirestore as withFirestoreOp,
17
- withFirestoreVoid as withFirestoreVoidOp,
18
- withFirestoreBool as withFirestoreBoolOp,
19
- } from "./operation/operation-executor.util";
20
-
21
- /**
22
- * Get Firestore instance with null check
23
- */
24
- export function getDb(): Firestore | null {
25
- return getFirestore();
26
- }
27
-
28
- /**
29
- * Execute a Firestore operation with automatic null check
30
- * Returns error result if db is not available
31
- */
32
- export async function withFirestore<T>(
33
- operation: (db: Firestore) => Promise<FirestoreResult<T>>,
34
- ): Promise<FirestoreResult<T>> {
35
- return withFirestoreOp(operation);
36
- }
37
18
 
38
- /**
39
- * Execute a Firestore operation that returns void
40
- */
41
- export async function withFirestoreVoid(
42
- operation: (db: Firestore) => Promise<void>,
43
- ): Promise<void> {
44
- return withFirestoreVoidOp(operation);
45
- }
46
-
47
- /**
48
- * Execute a Firestore operation that returns boolean
49
- */
50
- export async function withFirestoreBool(
51
- operation: (db: Firestore) => Promise<boolean>,
52
- ): Promise<boolean> {
53
- return withFirestoreBoolOp(operation);
54
- }
55
-
56
- // Re-export result utilities
57
- export { createErrorResult, createSuccessResult, type FirestoreResult, type NoDbResult, NO_DB_ERROR };
58
- export { isSuccess, isError } from "./result/result.util";
19
+ // Re-export operation utilities
20
+ export {
21
+ withFirestore,
22
+ withFirestoreVoid,
23
+ withFirestoreBool,
24
+ } from "./operation/operation-executor.util";
59
25
 
60
26
  // Re-export transaction utilities
61
27
  export { runTransaction, serverTimestamp } from "./transaction/transaction.util";
62
-
@@ -4,7 +4,7 @@
4
4
  */
5
5
 
6
6
  import type { Firestore } from "../../infrastructure/config/FirestoreClient";
7
- import { getDb } from "../firestore-helper";
7
+ import { getFirestore } from "../../infrastructure/config/FirestoreClient";
8
8
  import type { FirestoreResult } from "../result/result.util";
9
9
  import { NO_DB_ERROR } from "../result/result.util";
10
10
 
@@ -15,7 +15,7 @@ import { NO_DB_ERROR } from "../result/result.util";
15
15
  export async function withFirestore<T>(
16
16
  operation: (db: Firestore) => Promise<FirestoreResult<T>>,
17
17
  ): Promise<FirestoreResult<T>> {
18
- const db = getDb();
18
+ const db = getFirestore();
19
19
  if (!db) {
20
20
  return NO_DB_ERROR as FirestoreResult<T>;
21
21
  }
@@ -28,7 +28,7 @@ export async function withFirestore<T>(
28
28
  export async function withFirestoreVoid(
29
29
  operation: (db: Firestore) => Promise<void>,
30
30
  ): Promise<void> {
31
- const db = getDb();
31
+ const db = getFirestore();
32
32
  if (!db) {
33
33
  return;
34
34
  }
@@ -41,7 +41,7 @@ export async function withFirestoreVoid(
41
41
  export async function withFirestoreBool(
42
42
  operation: (db: Firestore) => Promise<boolean>,
43
43
  ): Promise<boolean> {
44
- const db = getDb();
44
+ const db = getFirestore();
45
45
  if (!db) {
46
46
  return false;
47
47
  }
@@ -8,7 +8,7 @@ import {
8
8
  serverTimestamp as fbServerTimestamp,
9
9
  type Transaction,
10
10
  } from "firebase/firestore";
11
- import { getDb } from "../firestore-helper";
11
+ import { getFirestore } from "../../infrastructure/config/FirestoreClient";
12
12
  import type { Firestore } from "../../infrastructure/config/FirestoreClient";
13
13
 
14
14
  /**
@@ -18,7 +18,7 @@ import type { Firestore } from "../../infrastructure/config/FirestoreClient";
18
18
  export async function runTransaction<T>(
19
19
  updateFunction: (transaction: Transaction) => Promise<T>
20
20
  ): Promise<T> {
21
- const db = getDb();
21
+ const db = getFirestore();
22
22
  if (!db) {
23
23
  throw new Error("[runTransaction] Firestore database is not initialized. Please ensure Firebase is properly initialized before running transactions.");
24
24
  }
package/src/index.ts CHANGED
@@ -76,7 +76,6 @@ export type {
76
76
 
77
77
  // Firestore Helper Utilities
78
78
  export {
79
- getDb,
80
79
  withFirestore,
81
80
  withFirestoreVoid,
82
81
  withFirestoreBool,
@@ -1,13 +0,0 @@
1
- /**
2
- * Deduplication Utilities
3
- * Utilities for query deduplication
4
- */
5
-
6
- export { TimerManager } from './timer-manager.util';
7
- export type { TimerManagerOptions } from './timer-manager.util';
8
-
9
- export { generateQueryKey, createQueryKey } from './query-key-generator.util';
10
- export type { QueryKey } from './query-key-generator.util';
11
-
12
- export { PendingQueryManager } from './pending-query-manager.util';
13
- export type { PendingQuery } from './pending-query-manager.util';
@@ -1,8 +0,0 @@
1
- /**
2
- * Mapper Utilities
3
- * Utilities for document mapping and enrichment
4
- */
5
-
6
- export { mapDocuments, filterNull, extractDocumentData } from './base-mapper.util';
7
- export { mapWithEnrichment, mapWithBatchEnrichment } from './enrichment-mapper.util';
8
- export { mapWithMultipleEnrichments } from './multi-enrichment-mapper.util';
@@ -1,10 +0,0 @@
1
- /**
2
- * Query Utilities
3
- * Utilities for building Firestore queries
4
- */
5
-
6
- export { applyFieldFilter, createInFilter, createEqualFilter, createFieldFilter } from './filters.util';
7
- export type { FieldFilter } from './filters.util';
8
-
9
- export { applyDateRange, applySort, applyCursor, applyLimit } from './modifiers.util';
10
- export type { SortOptions, DateRangeOptions } from './modifiers.util';