@firebase/firestore 3.9.0-canary.ce79f7fe2 → 3.9.0-canary.f8a2c5865

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 (37) hide show
  1. package/dist/firestore/src/api.d.ts +1 -0
  2. package/dist/firestore/src/util/testing_hooks.d.ts +84 -0
  3. package/dist/firestore/test/integration/util/testing_hooks_util.d.ts +40 -0
  4. package/dist/index.cjs.js +1797 -1717
  5. package/dist/index.cjs.js.map +1 -1
  6. package/dist/index.esm2017.js +1705 -1626
  7. package/dist/index.esm2017.js.map +1 -1
  8. package/dist/index.esm5.js +1532 -1471
  9. package/dist/index.esm5.js.map +1 -1
  10. package/dist/index.node.cjs.js +91 -2
  11. package/dist/index.node.cjs.js.map +1 -1
  12. package/dist/index.node.mjs +91 -3
  13. package/dist/index.node.mjs.map +1 -1
  14. package/dist/index.rn.js +1477 -1398
  15. package/dist/index.rn.js.map +1 -1
  16. package/dist/internal.d.ts +87 -0
  17. package/dist/lite/firestore/src/api.d.ts +1 -0
  18. package/dist/lite/firestore/src/util/testing_hooks.d.ts +84 -0
  19. package/dist/lite/firestore/test/integration/util/testing_hooks_util.d.ts +40 -0
  20. package/dist/lite/index.browser.esm2017.js +2 -2
  21. package/dist/lite/index.browser.esm2017.js.map +1 -1
  22. package/dist/lite/index.browser.esm5.js +2 -2
  23. package/dist/lite/index.cjs.js +2 -2
  24. package/dist/lite/index.cjs.js.map +1 -1
  25. package/dist/lite/index.node.cjs.js +2 -2
  26. package/dist/lite/index.node.mjs +2 -2
  27. package/dist/lite/index.node.mjs.map +1 -1
  28. package/dist/lite/index.rn.esm2017.js +2 -2
  29. package/dist/lite/packages/firestore/src/api.d.ts +1 -0
  30. package/dist/lite/packages/firestore/src/util/testing_hooks.d.ts +84 -0
  31. package/dist/lite/packages/firestore/test/integration/util/testing_hooks_util.d.ts +40 -0
  32. package/dist/packages/firestore/dist/index.esm2017.d.ts +350 -289
  33. package/dist/packages/firestore/src/api.d.ts +1 -0
  34. package/dist/packages/firestore/src/util/testing_hooks.d.ts +84 -0
  35. package/dist/packages/firestore/test/integration/util/testing_hooks_util.d.ts +40 -0
  36. package/dist/private.d.ts +22 -0
  37. package/package.json +9 -9
@@ -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.9.0-canary.ce79f7fe2";
11
+ const version$1 = "3.9.0-canary.f8a2c5865";
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.18.0-canary.ce79f7fe2";
64
+ const version = "9.18.0-canary.f8a2c5865";
65
65
 
66
66
  /**
67
67
  * @license
@@ -7742,6 +7742,89 @@ function mapCodeFromRpcCode(code) {
7742
7742
  }
7743
7743
  }
7744
7744
 
7745
+ /**
7746
+ * @license
7747
+ * Copyright 2023 Google LLC
7748
+ *
7749
+ * Licensed under the Apache License, Version 2.0 (the "License");
7750
+ * you may not use this file except in compliance with the License.
7751
+ * You may obtain a copy of the License at
7752
+ *
7753
+ * http://www.apache.org/licenses/LICENSE-2.0
7754
+ *
7755
+ * Unless required by applicable law or agreed to in writing, software
7756
+ * distributed under the License is distributed on an "AS IS" BASIS,
7757
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
7758
+ * See the License for the specific language governing permissions and
7759
+ * limitations under the License.
7760
+ */
7761
+ /**
7762
+ * Manages "testing hooks", hooks into the internals of the SDK to verify
7763
+ * internal state and events during integration tests. Do not use this class
7764
+ * except for testing purposes.
7765
+ *
7766
+ * There are two ways to retrieve the global singleton instance of this class:
7767
+ * 1. The `instance` property, which returns null if the global singleton
7768
+ * instance has not been created. Use this property if the caller should
7769
+ * "do nothing" if there are no testing hooks registered, such as when
7770
+ * delivering an event to notify registered callbacks.
7771
+ * 2. The `getOrCreateInstance()` method, which creates the global singleton
7772
+ * instance if it has not been created. Use this method if the instance is
7773
+ * needed to, for example, register a callback.
7774
+ *
7775
+ * @internal
7776
+ */
7777
+ class TestingHooks {
7778
+ constructor() {
7779
+ this.onExistenceFilterMismatchCallbacks = new Map();
7780
+ }
7781
+ /**
7782
+ * Returns the singleton instance of this class, or null if it has not been
7783
+ * initialized.
7784
+ */
7785
+ static get instance() {
7786
+ return gTestingHooksSingletonInstance;
7787
+ }
7788
+ /**
7789
+ * Returns the singleton instance of this class, creating it if is has never
7790
+ * been created before.
7791
+ */
7792
+ static getOrCreateInstance() {
7793
+ if (gTestingHooksSingletonInstance === null) {
7794
+ gTestingHooksSingletonInstance = new TestingHooks();
7795
+ }
7796
+ return gTestingHooksSingletonInstance;
7797
+ }
7798
+ /**
7799
+ * Registers a callback to be notified when an existence filter mismatch
7800
+ * occurs in the Watch listen stream.
7801
+ *
7802
+ * The relative order in which callbacks are notified is unspecified; do not
7803
+ * rely on any particular ordering. If a given callback is registered multiple
7804
+ * times then it will be notified multiple times, once per registration.
7805
+ *
7806
+ * @param callback the callback to invoke upon existence filter mismatch.
7807
+ *
7808
+ * @return a function that, when called, unregisters the given callback; only
7809
+ * the first invocation of the returned function does anything; all subsequent
7810
+ * invocations do nothing.
7811
+ */
7812
+ onExistenceFilterMismatch(callback) {
7813
+ const key = Symbol();
7814
+ this.onExistenceFilterMismatchCallbacks.set(key, callback);
7815
+ return () => this.onExistenceFilterMismatchCallbacks.delete(key);
7816
+ }
7817
+ /**
7818
+ * Invokes all currently-registered `onExistenceFilterMismatch` callbacks.
7819
+ * @param info Information about the existence filter mismatch.
7820
+ */
7821
+ notifyOnExistenceFilterMismatch(info) {
7822
+ this.onExistenceFilterMismatchCallbacks.forEach(callback => callback(info));
7823
+ }
7824
+ }
7825
+ /** The global singleton instance of `TestingHooks`. */
7826
+ let gTestingHooksSingletonInstance = null;
7827
+
7745
7828
  /**
7746
7829
  * @license
7747
7830
  * Copyright 2017 Google LLC
@@ -8150,6 +8233,7 @@ class WatchChangeAggregator {
8150
8233
  * `pendingTargetResets`.
8151
8234
  */
8152
8235
  handleExistenceFilter(watchChange) {
8236
+ var _a;
8153
8237
  const targetId = watchChange.targetId;
8154
8238
  const expectedCount = watchChange.existenceFilter.count;
8155
8239
  const targetData = this.targetDataForActiveTarget(targetId);
@@ -8177,6 +8261,10 @@ class WatchChangeAggregator {
8177
8261
  // snapshot with `isFromCache:true`.
8178
8262
  this.resetTarget(targetId);
8179
8263
  this.pendingTargetResets = this.pendingTargetResets.add(targetId);
8264
+ (_a = TestingHooks.instance) === null || _a === void 0 ? void 0 : _a.notifyOnExistenceFilterMismatch({
8265
+ localCacheCount: currentSize,
8266
+ existenceFilterCount: watchChange.existenceFilter.count
8267
+ });
8180
8268
  }
8181
8269
  }
8182
8270
  }
@@ -30996,5 +31084,5 @@ function tryGetString(data, property) {
30996
31084
  */
30997
31085
  registerFirestore('node');
30998
31086
 
30999
- export { AbstractUserDataWriter, AggregateField, AggregateQuerySnapshot, Bytes, CACHE_SIZE_UNLIMITED, CollectionReference, DocumentReference, DocumentSnapshot, FieldPath, FieldValue, Firestore, FirestoreError, GeoPoint, LoadBundleTask, Query, QueryCompositeFilterConstraint, QueryConstraint, QueryDocumentSnapshot, QueryEndAtConstraint, QueryFieldFilterConstraint, QueryLimitConstraint, QueryOrderByConstraint, QuerySnapshot, QueryStartAtConstraint, SnapshotMetadata, Timestamp, Transaction, WriteBatch, DatabaseId as _DatabaseId, DocumentKey as _DocumentKey, EmptyAppCheckTokenProvider as _EmptyAppCheckTokenProvider, EmptyAuthCredentialsProvider as _EmptyAuthCredentialsProvider, FieldPath$1 as _FieldPath, cast as _cast, debugAssert as _debugAssert, isBase64Available as _isBase64Available, logWarn as _logWarn, validateIsNotUsedTogether as _validateIsNotUsedTogether, addDoc, aggregateFieldEqual, aggregateQuerySnapshotEqual, and, arrayRemove, arrayUnion, average, clearIndexedDbPersistence, collection, collectionGroup, connectFirestoreEmulator, count, deleteDoc, deleteField, disableNetwork, doc, documentId, enableIndexedDbPersistence, enableMultiTabIndexedDbPersistence, enableNetwork, endAt, endBefore, ensureFirestoreConfigured, executeWrite, getAggregateFromServer, getCountFromServer, getDoc, getDocFromCache, getDocFromServer, getDocs, getDocsFromCache, getDocsFromServer, getFirestore, increment, initializeFirestore, limit, limitToLast, loadBundle, memoryLocalCache, namedQuery, onSnapshot, onSnapshotsInSync, or, orderBy, persistentLocalCache, persistentMultipleTabManager, persistentSingleTabManager, query, queryEqual, refEqual, runTransaction, serverTimestamp, setDoc, setIndexConfiguration, setLogLevel, snapshotEqual, startAfter, startAt, sum, terminate, updateDoc, waitForPendingWrites, where, writeBatch };
31087
+ export { AbstractUserDataWriter, AggregateField, AggregateQuerySnapshot, Bytes, CACHE_SIZE_UNLIMITED, CollectionReference, DocumentReference, DocumentSnapshot, FieldPath, FieldValue, Firestore, FirestoreError, GeoPoint, LoadBundleTask, Query, QueryCompositeFilterConstraint, QueryConstraint, QueryDocumentSnapshot, QueryEndAtConstraint, QueryFieldFilterConstraint, QueryLimitConstraint, QueryOrderByConstraint, QuerySnapshot, QueryStartAtConstraint, SnapshotMetadata, Timestamp, Transaction, WriteBatch, DatabaseId as _DatabaseId, DocumentKey as _DocumentKey, EmptyAppCheckTokenProvider as _EmptyAppCheckTokenProvider, EmptyAuthCredentialsProvider as _EmptyAuthCredentialsProvider, FieldPath$1 as _FieldPath, TestingHooks as _TestingHooks, cast as _cast, debugAssert as _debugAssert, isBase64Available as _isBase64Available, logWarn as _logWarn, validateIsNotUsedTogether as _validateIsNotUsedTogether, addDoc, aggregateFieldEqual, aggregateQuerySnapshotEqual, and, arrayRemove, arrayUnion, average, clearIndexedDbPersistence, collection, collectionGroup, connectFirestoreEmulator, count, deleteDoc, deleteField, disableNetwork, doc, documentId, enableIndexedDbPersistence, enableMultiTabIndexedDbPersistence, enableNetwork, endAt, endBefore, ensureFirestoreConfigured, executeWrite, getAggregateFromServer, getCountFromServer, getDoc, getDocFromCache, getDocFromServer, getDocs, getDocsFromCache, getDocsFromServer, getFirestore, increment, initializeFirestore, limit, limitToLast, loadBundle, memoryLocalCache, namedQuery, onSnapshot, onSnapshotsInSync, or, orderBy, persistentLocalCache, persistentMultipleTabManager, persistentSingleTabManager, query, queryEqual, refEqual, runTransaction, serverTimestamp, setDoc, setIndexConfiguration, setLogLevel, snapshotEqual, startAfter, startAt, sum, terminate, updateDoc, waitForPendingWrites, where, writeBatch };
31000
31088
  //# sourceMappingURL=index.node.mjs.map