@umituz/react-native-firebase 1.13.125 → 1.13.126
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.
|
|
3
|
+
"version": "1.13.126",
|
|
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",
|
package/src/firestore/index.ts
CHANGED
|
@@ -8,8 +8,8 @@ import { generateQueryKey } from '../../utils/deduplication/query-key-generator.
|
|
|
8
8
|
import { PendingQueryManager } from '../../utils/deduplication/pending-query-manager.util';
|
|
9
9
|
import { TimerManager } from '../../utils/deduplication/timer-manager.util';
|
|
10
10
|
|
|
11
|
-
const DEDUPLICATION_WINDOW_MS = 1000;
|
|
12
|
-
const CLEANUP_INTERVAL_MS = 5000;
|
|
11
|
+
const DEDUPLICATION_WINDOW_MS = 1000;
|
|
12
|
+
const CLEANUP_INTERVAL_MS = 5000;
|
|
13
13
|
|
|
14
14
|
export class QueryDeduplicationMiddleware {
|
|
15
15
|
private readonly queryManager: PendingQueryManager;
|
|
@@ -24,9 +24,6 @@ export class QueryDeduplicationMiddleware {
|
|
|
24
24
|
this.timerManager.start();
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
/**
|
|
28
|
-
* Deduplicate a query
|
|
29
|
-
*/
|
|
30
27
|
async deduplicate<T>(
|
|
31
28
|
queryKey: QueryKey,
|
|
32
29
|
queryFn: () => Promise<T>,
|
|
@@ -46,31 +43,20 @@ export class QueryDeduplicationMiddleware {
|
|
|
46
43
|
return promise;
|
|
47
44
|
}
|
|
48
45
|
|
|
49
|
-
/**
|
|
50
|
-
* Clear all pending queries
|
|
51
|
-
*/
|
|
52
46
|
clear(): void {
|
|
53
47
|
this.queryManager.clear();
|
|
54
48
|
}
|
|
55
49
|
|
|
56
|
-
/**
|
|
57
|
-
* Destroy middleware and cleanup resources
|
|
58
|
-
*/
|
|
59
50
|
destroy(): void {
|
|
60
51
|
this.timerManager.destroy();
|
|
61
52
|
this.queryManager.clear();
|
|
62
53
|
}
|
|
63
54
|
|
|
64
|
-
/**
|
|
65
|
-
* Get pending queries count
|
|
66
|
-
*/
|
|
67
55
|
getPendingCount(): number {
|
|
68
56
|
return this.queryManager.size();
|
|
69
57
|
}
|
|
70
58
|
}
|
|
71
59
|
|
|
72
60
|
export const queryDeduplicationMiddleware = new QueryDeduplicationMiddleware();
|
|
73
|
-
|
|
74
|
-
// Re-export types for convenience
|
|
75
61
|
export type { QueryKey };
|
|
76
62
|
|
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
|
|
6
6
|
export type { Firestore } from "../infrastructure/config/FirestoreClient";
|
|
7
7
|
|
|
8
|
-
// Re-export result utilities
|
|
9
8
|
export {
|
|
10
9
|
createErrorResult,
|
|
11
10
|
createSuccessResult,
|
|
@@ -16,12 +15,10 @@ export {
|
|
|
16
15
|
NO_DB_ERROR,
|
|
17
16
|
} from "./result/result.util";
|
|
18
17
|
|
|
19
|
-
// Re-export operation utilities
|
|
20
18
|
export {
|
|
21
19
|
withFirestore,
|
|
22
20
|
withFirestoreVoid,
|
|
23
21
|
withFirestoreBool,
|
|
24
22
|
} from "./operation/operation-executor.util";
|
|
25
23
|
|
|
26
|
-
// Re-export transaction utilities
|
|
27
24
|
export { runTransaction, serverTimestamp } from "./transaction/transaction.util";
|
|
@@ -20,9 +20,6 @@ export interface QueryBuilderOptions {
|
|
|
20
20
|
cursorValue?: number;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
/**
|
|
24
|
-
* Build Firestore query with advanced filtering support
|
|
25
|
-
*/
|
|
26
23
|
export function buildQuery(
|
|
27
24
|
db: Firestore,
|
|
28
25
|
options: QueryBuilderOptions,
|
|
@@ -39,12 +36,10 @@ export function buildQuery(
|
|
|
39
36
|
const collectionRef = collection(db, collectionName);
|
|
40
37
|
let q: Query = collectionRef;
|
|
41
38
|
|
|
42
|
-
// Apply base filters
|
|
43
39
|
for (const filter of baseFilters) {
|
|
44
40
|
q = applyFieldFilter(q, filter);
|
|
45
41
|
}
|
|
46
42
|
|
|
47
|
-
// Apply modifiers in correct order
|
|
48
43
|
q = applyDateRange(q, dateRange);
|
|
49
44
|
q = applySort(q, sort);
|
|
50
45
|
q = applyCursor(q, cursorValue);
|
|
@@ -53,6 +48,5 @@ export function buildQuery(
|
|
|
53
48
|
return q;
|
|
54
49
|
}
|
|
55
50
|
|
|
56
|
-
// Re-export filter utilities for convenience
|
|
57
51
|
export { createInFilter, createEqualFilter, createFieldFilter };
|
|
58
52
|
export type { FieldFilter, SortOptions, DateRangeOptions };
|