@react-native-firebase/firestore 19.2.1 → 19.3.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/CHANGELOG.md CHANGED
@@ -3,6 +3,21 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [19.3.0](https://github.com/invertase/react-native-firebase/compare/v19.2.2...v19.3.0) (2024-05-20)
7
+
8
+ ### Features
9
+
10
+ - **firestore:** export and test types for the modular API ([ad40ea2](https://github.com/invertase/react-native-firebase/commit/ad40ea2eb828a59451a619059bb4bef96277e23f))
11
+ - **firestore:** implement the getDoc modular api ([e90782b](https://github.com/invertase/react-native-firebase/commit/e90782b00702878204dd93d3a04c09c620cdf163))
12
+
13
+ ### Bug Fixes
14
+
15
+ - **firestore:** fix types for the `where` api in modular queries ([d874e15](https://github.com/invertase/react-native-firebase/commit/d874e15145086f59bba11fee4f23a8d9cc50cc68))
16
+
17
+ ## [19.2.2](https://github.com/invertase/react-native-firebase/compare/v19.2.1...v19.2.2) (2024-04-13)
18
+
19
+ **Note:** Version bump only for package @react-native-firebase/firestore
20
+
6
21
  ## [19.2.1](https://github.com/invertase/react-native-firebase/compare/v19.2.0...v19.2.1) (2024-04-12)
7
22
 
8
23
  **Note:** Version bump only for package @react-native-firebase/firestore
package/lib/index.d.ts CHANGED
@@ -2340,6 +2340,8 @@ export const firebase: ReactNativeFirebase.Module & {
2340
2340
  ): ReactNativeFirebase.FirebaseApp & { firestore(): FirebaseFirestoreTypes.Module };
2341
2341
  };
2342
2342
 
2343
+ export * from './modular';
2344
+
2343
2345
  export const Filter: FilterFunction;
2344
2346
 
2345
2347
  export default defaultExport;
@@ -532,3 +532,11 @@ export function namedQuery(firestore: Firestore, name: string): Query<DocumentDa
532
532
  * writes.
533
533
  */
534
534
  export function writeBatch(firestore: Firestore): FirebaseFirestoreTypes.WriteBatch;
535
+
536
+ export * from './query';
537
+ export * from './snapshot';
538
+ export * from './Bytes';
539
+ export * from './FieldPath';
540
+ export * from './FieldValue';
541
+ export * from './GeoPoint';
542
+ export * from './Timestamp';
@@ -40,7 +40,7 @@ export interface AppliableConstraint {
40
40
  * can then be passed to {@link (query:1)} to create a new query instance that
41
41
  * also contains this `QueryConstraint`.
42
42
  */
43
- export interface IQueryConstraint extends AppliableConstraint {
43
+ export interface QueryConstraint extends AppliableConstraint {
44
44
  /** The type of this query constraint */
45
45
  readonly type: QueryConstraintType;
46
46
 
@@ -239,6 +239,42 @@ export function startAfter<AppModelType, DbModelType extends DocumentData>(
239
239
  */
240
240
  export function limit(limit: number): QueryLimitConstraint;
241
241
 
242
+ /**
243
+ * Reads the document referred to by this `DocumentReference`.
244
+ *
245
+ * Note: `getDoc()` attempts to provide up-to-date data when possible by waiting
246
+ * for data from the server, but it may return cached data or fail if you are
247
+ * offline and the server cannot be reached. To specify this behavior, invoke
248
+ * {@link getDocFromCache} or {@link getDocFromServer}.
249
+ *
250
+ * @param reference - The reference of the document to fetch.
251
+ * @returns A Promise resolved with a `DocumentSnapshot` containing the
252
+ * current document contents.
253
+ */
254
+ export declare function getDoc<T>(reference: DocumentReference<T>): Promise<DocumentSnapshot<T>>;
255
+
256
+ /**
257
+ * Reads the document referred to by this `DocumentReference` from cache.
258
+ * Returns an error if the document is not currently cached.
259
+ *
260
+ * @returns A `Promise` resolved with a `DocumentSnapshot` containing the
261
+ * current document contents.
262
+ */
263
+ export declare function getDocFromCache<T>(
264
+ reference: DocumentReference<T>,
265
+ ): Promise<DocumentSnapshot<T>>;
266
+
267
+ /**
268
+ * Reads the document referred to by this `DocumentReference` from the server.
269
+ * Returns an error if the network is not available.
270
+ *
271
+ * @returns A `Promise` resolved with a `DocumentSnapshot` containing the
272
+ * current document contents.
273
+ */
274
+ export declare function getDocFromServer<T>(
275
+ reference: DocumentReference<T>,
276
+ ): Promise<DocumentSnapshot<T>>;
277
+
242
278
  /**
243
279
  * Executes the query and returns the results as a `QuerySnapshot`.
244
280
  *
@@ -169,6 +169,30 @@ export function limitToLast(limit) {
169
169
  return new QueryConstraint('limitToLast', limit);
170
170
  }
171
171
 
172
+ /**
173
+ * @param {DocumentReference} query
174
+ * @returns {Promise<DocumentSnapshot>}
175
+ */
176
+ export function getDoc(reference) {
177
+ return reference.get({ source: 'default' });
178
+ }
179
+
180
+ /**
181
+ * @param {DocumentReference} query
182
+ * @returns {Promise<DocumentSnapshot>}
183
+ */
184
+ export function getDocFromCache(reference) {
185
+ return reference.get({ source: 'cache' });
186
+ }
187
+
188
+ /**
189
+ * @param {DocumentReference} query
190
+ * @returns {Promise<DocumentSnapshot>}
191
+ */
192
+ export function getDocFromServer(reference) {
193
+ return reference.get({ source: 'server' });
194
+ }
195
+
172
196
  /**
173
197
  * @param {Query} query
174
198
  * @returns {Promise<QuerySnapshot>}
package/lib/version.js CHANGED
@@ -1,2 +1,2 @@
1
1
  // Generated by genversion.
2
- module.exports = '19.2.1';
2
+ module.exports = '19.3.0';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-native-firebase/firestore",
3
- "version": "19.2.1",
3
+ "version": "19.3.0",
4
4
  "author": "Invertase <oss@invertase.io> (http://invertase.io)",
5
5
  "description": "React Native Firebase - Cloud Firestore is a NoSQL cloud database to store and sync data between your React Native application and Firebase's database. The API matches the Firebase Web SDK whilst taking advantage of the native SDKs performance and offline capabilities.",
6
6
  "main": "lib/index.js",
@@ -27,10 +27,10 @@
27
27
  "firestore"
28
28
  ],
29
29
  "peerDependencies": {
30
- "@react-native-firebase/app": "19.2.1"
30
+ "@react-native-firebase/app": "19.3.0"
31
31
  },
32
32
  "publishConfig": {
33
33
  "access": "public"
34
34
  },
35
- "gitHead": "f36a26abe71d9c3222a32683739117a977fb7896"
35
+ "gitHead": "edac62269c1b3088cadf74586d48f68214d6e8e4"
36
36
  }