@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
@@ -8,7 +8,7 @@ import * as grpc from '@grpc/grpc-js';
8
8
  import * as protoLoader from '@grpc/proto-loader';
9
9
 
10
10
  const name = "@firebase/firestore";
11
- const version$1 = "3.8.0";
11
+ const version$1 = "3.8.1";
12
12
 
13
13
  /**
14
14
  * @license
@@ -61,7 +61,7 @@ User.GOOGLE_CREDENTIALS = new User('google-credentials-uid');
61
61
  User.FIRST_PARTY = new User('first-party-uid');
62
62
  User.MOCK_USER = new User('mock-user');
63
63
 
64
- const version = "9.15.0";
64
+ const version = "9.16.0";
65
65
 
66
66
  /**
67
67
  * @license
@@ -5593,6 +5593,15 @@ function canonifyFilter(filter) {
5593
5593
  filter.op.toString() +
5594
5594
  canonicalId(filter.value));
5595
5595
  }
5596
+ else if (compositeFilterIsFlatConjunction(filter)) {
5597
+ // Older SDK versions use an implicit AND operation between their filters.
5598
+ // In the new SDK versions, the developer may use an explicit AND filter.
5599
+ // To stay consistent with the old usages, we add a special case to ensure
5600
+ // the canonical ID for these two are the same. For example:
5601
+ // `col.whereEquals("a", 1).whereEquals("b", 2)` should have the same
5602
+ // canonical ID as `col.where(and(equals("a",1), equals("b",2)))`.
5603
+ return filter.filters.map(filter => canonifyFilter(filter)).join(',');
5604
+ }
5596
5605
  else {
5597
5606
  // filter instanceof CompositeFilter
5598
5607
  const canonicalIdsString = filter.filters
@@ -13371,8 +13380,10 @@ const SCHEMA_VERSION = 15;
13371
13380
  class OverlayedDocument {
13372
13381
  constructor(overlayedDocument,
13373
13382
  /**
13374
- * The fields that are locally mutated by patch mutations. If the overlayed
13375
- * document is from set or delete mutations, this returns null.
13383
+ * The fields that are locally mutated by patch mutations.
13384
+ *
13385
+ * If the overlayed document is from set or delete mutations, this is `null`.
13386
+ * If there is no overlay (mutation) for the document, this is an empty `FieldMask`.
13376
13387
  */
13377
13388
  mutatedFields) {
13378
13389
  this.overlayedDocument = overlayedDocument;
@@ -13524,6 +13535,11 @@ class LocalDocumentsView {
13524
13535
  mutatedFields.set(doc.key, overlay.mutation.getFieldMask());
13525
13536
  mutationApplyToLocalView(overlay.mutation, doc, overlay.mutation.getFieldMask(), Timestamp.now());
13526
13537
  }
13538
+ else {
13539
+ // no overlay exists
13540
+ // Using EMPTY to indicate there is no overlay for the document.
13541
+ mutatedFields.set(doc.key, FieldMask.empty());
13542
+ }
13527
13543
  });
13528
13544
  return this.recalculateAndSaveOverlays(transaction, recalculateDocuments).next(recalculatedFields => {
13529
13545
  recalculatedFields.forEach((documentKey, mask) => mutatedFields.set(documentKey, mask));
@@ -28717,13 +28733,14 @@ class QueryCompositeFilterConstraint extends AppliableConstraint {
28717
28733
  }
28718
28734
  }
28719
28735
  /**
28720
- * Creates a {@link QueryCompositeFilterConstraint} that performs a logical OR
28721
- * of all the provided {@link QueryFilterConstraint}s.
28736
+ * Creates a new {@link QueryCompositeFilterConstraint} that is a disjunction of
28737
+ * the given filter constraints. A disjunction filter includes a document if it
28738
+ * satisfies any of the given filters.
28722
28739
  *
28723
- * @param queryConstraints - Optional. The {@link QueryFilterConstraint}s
28724
- * for OR operation. These must be created with calls to {@link where},
28725
- * {@link or}, or {@link and}.
28726
- * @returns The created {@link QueryCompositeFilterConstraint}.
28740
+ * @param queryConstraints - Optional. The list of
28741
+ * {@link QueryFilterConstraint}s to perform a disjunction for. These must be
28742
+ * created with calls to {@link where}, {@link or}, or {@link and}.
28743
+ * @returns The newly created {@link QueryCompositeFilterConstraint}.
28727
28744
  * @internal TODO remove this internal tag with OR Query support in the server
28728
28745
  */
28729
28746
  function or(...queryConstraints) {
@@ -28732,13 +28749,14 @@ function or(...queryConstraints) {
28732
28749
  return QueryCompositeFilterConstraint._create("or" /* CompositeOperator.OR */, queryConstraints);
28733
28750
  }
28734
28751
  /**
28735
- * Creates a {@link QueryCompositeFilterConstraint} that performs a logical AND
28736
- * of all the provided {@link QueryFilterConstraint}s.
28752
+ * Creates a new {@link QueryCompositeFilterConstraint} that is a conjunction of
28753
+ * the given filter constraints. A conjunction filter includes a document if it
28754
+ * satisfies all of the given filters.
28737
28755
  *
28738
- * @param queryConstraints - Optional. The {@link QueryFilterConstraint}s
28739
- * for AND operation. These must be created with calls to {@link where},
28740
- * {@link or}, or {@link and}.
28741
- * @returns The created {@link QueryCompositeFilterConstraint}.
28756
+ * @param queryConstraints - Optional. The list of
28757
+ * {@link QueryFilterConstraint}s to perform a conjunction for. These must be
28758
+ * created with calls to {@link where}, {@link or}, or {@link and}.
28759
+ * @returns The newly created {@link QueryCompositeFilterConstraint}.
28742
28760
  * @internal TODO remove this internal tag with OR Query support in the server
28743
28761
  */
28744
28762
  function and(...queryConstraints) {
@@ -29781,7 +29799,8 @@ function getDocs(query) {
29781
29799
  }
29782
29800
  /**
29783
29801
  * Executes the query and returns the results as a `QuerySnapshot` from cache.
29784
- * Returns an error if the document is not currently cached.
29802
+ * Returns an empty result set if no documents matching the query are currently
29803
+ * cached.
29785
29804
  *
29786
29805
  * @returns A `Promise` that will be resolved with the results of the query.
29787
29806
  */