@umituz/react-native-firebase 2.4.17 → 2.4.19

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.4.17",
3
+ "version": "2.4.19",
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,6 +12,7 @@ import type { Firestore, CollectionReference, DocumentReference, DocumentData }
12
12
  import { getFirestore, collection, doc } from 'firebase/firestore';
13
13
  import { isQuotaError as checkQuotaError } from '../../utils/quota-error-detector.util';
14
14
  import { ERROR_MESSAGES } from '../../../../shared/domain/utils/error-handlers/error-messages';
15
+ import { quotaTrackingMiddleware } from '../middleware/QuotaTrackingMiddleware';
15
16
 
16
17
  export enum RepositoryState {
17
18
  ACTIVE = 'active',
@@ -101,6 +102,47 @@ export abstract class BaseRepository implements IPathResolver {
101
102
  }
102
103
  }
103
104
 
105
+ /**
106
+ * Track read operation for quota monitoring
107
+ *
108
+ * @param collection - Collection name
109
+ * @param count - Number of documents read
110
+ * @param cached - Whether the result is from cache
111
+ */
112
+ protected trackRead(
113
+ collection: string,
114
+ count: number = 1,
115
+ cached: boolean = false,
116
+ ): void {
117
+ quotaTrackingMiddleware.trackRead(collection, count, cached);
118
+ }
119
+
120
+ /**
121
+ * Track write operation for quota monitoring
122
+ *
123
+ * @param collection - Collection name
124
+ * @param count - Number of documents written
125
+ */
126
+ protected trackWrite(
127
+ collection: string,
128
+ count: number = 1,
129
+ ): void {
130
+ quotaTrackingMiddleware.trackWrite(collection, count);
131
+ }
132
+
133
+ /**
134
+ * Track delete operation for quota monitoring
135
+ *
136
+ * @param collection - Collection name
137
+ * @param count - Number of documents deleted
138
+ */
139
+ protected trackDelete(
140
+ collection: string,
141
+ count: number = 1,
142
+ ): void {
143
+ quotaTrackingMiddleware.trackDelete(collection, count);
144
+ }
145
+
104
146
  /**
105
147
  * Destroy the repository
106
148
  * Prevents further operations