@firebase/firestore 3.8.0 → 3.8.1

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.
Files changed (44) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/firestore/src/api/reference_impl.d.ts +2 -1
  3. package/dist/firestore/src/lite-api/query.d.ts +14 -12
  4. package/dist/firestore/src/local/overlayed_document.d.ts +8 -4
  5. package/dist/firestore/test/unit/local/counting_query_engine.d.ts +12 -21
  6. package/dist/index.d.ts +2 -1
  7. package/dist/index.esm2017.js +36 -20
  8. package/dist/index.esm2017.js.map +1 -1
  9. package/dist/index.esm5.js +38 -20
  10. package/dist/index.esm5.js.map +1 -1
  11. package/dist/index.node.cjs.js +36 -17
  12. package/dist/index.node.cjs.js.map +1 -1
  13. package/dist/index.node.mjs +36 -17
  14. package/dist/index.node.mjs.map +1 -1
  15. package/dist/index.rn.js +36 -20
  16. package/dist/index.rn.js.map +1 -1
  17. package/dist/internal.d.ts +25 -18
  18. package/dist/lite/firestore/src/api/reference_impl.d.ts +2 -1
  19. package/dist/lite/firestore/src/lite-api/query.d.ts +14 -12
  20. package/dist/lite/firestore/src/local/overlayed_document.d.ts +8 -4
  21. package/dist/lite/firestore/test/unit/local/counting_query_engine.d.ts +12 -21
  22. package/dist/lite/index.browser.esm2017.js +16 -14
  23. package/dist/lite/index.browser.esm2017.js.map +1 -1
  24. package/dist/lite/index.browser.esm5.js +17 -15
  25. package/dist/lite/index.browser.esm5.js.map +1 -1
  26. package/dist/lite/index.node.cjs.js +16 -14
  27. package/dist/lite/index.node.cjs.js.map +1 -1
  28. package/dist/lite/index.node.mjs +16 -14
  29. package/dist/lite/index.node.mjs.map +1 -1
  30. package/dist/lite/index.rn.esm2017.js +16 -14
  31. package/dist/lite/index.rn.esm2017.js.map +1 -1
  32. package/dist/lite/internal.d.ts +15 -13
  33. package/dist/lite/packages/firestore/dist/lite/index.browser.esm2017.d.ts +15 -13
  34. package/dist/lite/packages/firestore/src/api/reference_impl.d.ts +2 -1
  35. package/dist/lite/packages/firestore/src/lite-api/query.d.ts +14 -12
  36. package/dist/lite/packages/firestore/src/local/overlayed_document.d.ts +8 -4
  37. package/dist/lite/packages/firestore/test/unit/local/counting_query_engine.d.ts +12 -21
  38. package/dist/packages/firestore/dist/index.esm2017.d.ts +17 -14
  39. package/dist/packages/firestore/src/api/reference_impl.d.ts +2 -1
  40. package/dist/packages/firestore/src/lite-api/query.d.ts +14 -12
  41. package/dist/packages/firestore/src/local/overlayed_document.d.ts +8 -4
  42. package/dist/packages/firestore/test/unit/local/counting_query_engine.d.ts +12 -21
  43. package/dist/private.d.ts +10 -5
  44. package/package.json +6 -6
@@ -33,7 +33,7 @@ var grpc__namespace = /*#__PURE__*/_interopNamespace(grpc);
33
33
  var protoLoader__namespace = /*#__PURE__*/_interopNamespace(protoLoader);
34
34
 
35
35
  const name = "@firebase/firestore";
36
- const version$1 = "3.8.0";
36
+ const version$1 = "3.8.1";
37
37
 
38
38
  /**
39
39
  * @license
@@ -86,7 +86,7 @@ User.GOOGLE_CREDENTIALS = new User('google-credentials-uid');
86
86
  User.FIRST_PARTY = new User('first-party-uid');
87
87
  User.MOCK_USER = new User('mock-user');
88
88
 
89
- const version = "9.15.0";
89
+ const version = "9.16.0";
90
90
 
91
91
  /**
92
92
  * @license
@@ -5618,6 +5618,15 @@ function canonifyFilter(filter) {
5618
5618
  filter.op.toString() +
5619
5619
  canonicalId(filter.value));
5620
5620
  }
5621
+ else if (compositeFilterIsFlatConjunction(filter)) {
5622
+ // Older SDK versions use an implicit AND operation between their filters.
5623
+ // In the new SDK versions, the developer may use an explicit AND filter.
5624
+ // To stay consistent with the old usages, we add a special case to ensure
5625
+ // the canonical ID for these two are the same. For example:
5626
+ // `col.whereEquals("a", 1).whereEquals("b", 2)` should have the same
5627
+ // canonical ID as `col.where(and(equals("a",1), equals("b",2)))`.
5628
+ return filter.filters.map(filter => canonifyFilter(filter)).join(',');
5629
+ }
5621
5630
  else {
5622
5631
  // filter instanceof CompositeFilter
5623
5632
  const canonicalIdsString = filter.filters
@@ -13396,8 +13405,10 @@ const SCHEMA_VERSION = 15;
13396
13405
  class OverlayedDocument {
13397
13406
  constructor(overlayedDocument,
13398
13407
  /**
13399
- * The fields that are locally mutated by patch mutations. If the overlayed
13400
- * document is from set or delete mutations, this returns null.
13408
+ * The fields that are locally mutated by patch mutations.
13409
+ *
13410
+ * If the overlayed document is from set or delete mutations, this is `null`.
13411
+ * If there is no overlay (mutation) for the document, this is an empty `FieldMask`.
13401
13412
  */
13402
13413
  mutatedFields) {
13403
13414
  this.overlayedDocument = overlayedDocument;
@@ -13549,6 +13560,11 @@ class LocalDocumentsView {
13549
13560
  mutatedFields.set(doc.key, overlay.mutation.getFieldMask());
13550
13561
  mutationApplyToLocalView(overlay.mutation, doc, overlay.mutation.getFieldMask(), Timestamp.now());
13551
13562
  }
13563
+ else {
13564
+ // no overlay exists
13565
+ // Using EMPTY to indicate there is no overlay for the document.
13566
+ mutatedFields.set(doc.key, FieldMask.empty());
13567
+ }
13552
13568
  });
13553
13569
  return this.recalculateAndSaveOverlays(transaction, recalculateDocuments).next(recalculatedFields => {
13554
13570
  recalculatedFields.forEach((documentKey, mask) => mutatedFields.set(documentKey, mask));
@@ -28742,13 +28758,14 @@ class QueryCompositeFilterConstraint extends AppliableConstraint {
28742
28758
  }
28743
28759
  }
28744
28760
  /**
28745
- * Creates a {@link QueryCompositeFilterConstraint} that performs a logical OR
28746
- * of all the provided {@link QueryFilterConstraint}s.
28761
+ * Creates a new {@link QueryCompositeFilterConstraint} that is a disjunction of
28762
+ * the given filter constraints. A disjunction filter includes a document if it
28763
+ * satisfies any of the given filters.
28747
28764
  *
28748
- * @param queryConstraints - Optional. The {@link QueryFilterConstraint}s
28749
- * for OR operation. These must be created with calls to {@link where},
28750
- * {@link or}, or {@link and}.
28751
- * @returns The created {@link QueryCompositeFilterConstraint}.
28765
+ * @param queryConstraints - Optional. The list of
28766
+ * {@link QueryFilterConstraint}s to perform a disjunction for. These must be
28767
+ * created with calls to {@link where}, {@link or}, or {@link and}.
28768
+ * @returns The newly created {@link QueryCompositeFilterConstraint}.
28752
28769
  * @internal TODO remove this internal tag with OR Query support in the server
28753
28770
  */
28754
28771
  function or(...queryConstraints) {
@@ -28757,13 +28774,14 @@ function or(...queryConstraints) {
28757
28774
  return QueryCompositeFilterConstraint._create("or" /* CompositeOperator.OR */, queryConstraints);
28758
28775
  }
28759
28776
  /**
28760
- * Creates a {@link QueryCompositeFilterConstraint} that performs a logical AND
28761
- * of all the provided {@link QueryFilterConstraint}s.
28777
+ * Creates a new {@link QueryCompositeFilterConstraint} that is a conjunction of
28778
+ * the given filter constraints. A conjunction filter includes a document if it
28779
+ * satisfies all of the given filters.
28762
28780
  *
28763
- * @param queryConstraints - Optional. The {@link QueryFilterConstraint}s
28764
- * for AND operation. These must be created with calls to {@link where},
28765
- * {@link or}, or {@link and}.
28766
- * @returns The created {@link QueryCompositeFilterConstraint}.
28781
+ * @param queryConstraints - Optional. The list of
28782
+ * {@link QueryFilterConstraint}s to perform a conjunction for. These must be
28783
+ * created with calls to {@link where}, {@link or}, or {@link and}.
28784
+ * @returns The newly created {@link QueryCompositeFilterConstraint}.
28767
28785
  * @internal TODO remove this internal tag with OR Query support in the server
28768
28786
  */
28769
28787
  function and(...queryConstraints) {
@@ -29806,7 +29824,8 @@ function getDocs(query) {
29806
29824
  }
29807
29825
  /**
29808
29826
  * Executes the query and returns the results as a `QuerySnapshot` from cache.
29809
- * Returns an error if the document is not currently cached.
29827
+ * Returns an empty result set if no documents matching the query are currently
29828
+ * cached.
29810
29829
  *
29811
29830
  * @returns A `Promise` that will be resolved with the results of the query.
29812
29831
  */