@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
@@ -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.9.0-canary.ce79f7fe2";
36
+ const version$1 = "3.9.0-canary.f8a2c5865";
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.18.0-canary.ce79f7fe2";
89
+ const version = "9.18.0-canary.f8a2c5865";
90
90
 
91
91
  /**
92
92
  * @license
@@ -7767,6 +7767,89 @@ function mapCodeFromRpcCode(code) {
7767
7767
  }
7768
7768
  }
7769
7769
 
7770
+ /**
7771
+ * @license
7772
+ * Copyright 2023 Google LLC
7773
+ *
7774
+ * Licensed under the Apache License, Version 2.0 (the "License");
7775
+ * you may not use this file except in compliance with the License.
7776
+ * You may obtain a copy of the License at
7777
+ *
7778
+ * http://www.apache.org/licenses/LICENSE-2.0
7779
+ *
7780
+ * Unless required by applicable law or agreed to in writing, software
7781
+ * distributed under the License is distributed on an "AS IS" BASIS,
7782
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
7783
+ * See the License for the specific language governing permissions and
7784
+ * limitations under the License.
7785
+ */
7786
+ /**
7787
+ * Manages "testing hooks", hooks into the internals of the SDK to verify
7788
+ * internal state and events during integration tests. Do not use this class
7789
+ * except for testing purposes.
7790
+ *
7791
+ * There are two ways to retrieve the global singleton instance of this class:
7792
+ * 1. The `instance` property, which returns null if the global singleton
7793
+ * instance has not been created. Use this property if the caller should
7794
+ * "do nothing" if there are no testing hooks registered, such as when
7795
+ * delivering an event to notify registered callbacks.
7796
+ * 2. The `getOrCreateInstance()` method, which creates the global singleton
7797
+ * instance if it has not been created. Use this method if the instance is
7798
+ * needed to, for example, register a callback.
7799
+ *
7800
+ * @internal
7801
+ */
7802
+ class TestingHooks {
7803
+ constructor() {
7804
+ this.onExistenceFilterMismatchCallbacks = new Map();
7805
+ }
7806
+ /**
7807
+ * Returns the singleton instance of this class, or null if it has not been
7808
+ * initialized.
7809
+ */
7810
+ static get instance() {
7811
+ return gTestingHooksSingletonInstance;
7812
+ }
7813
+ /**
7814
+ * Returns the singleton instance of this class, creating it if is has never
7815
+ * been created before.
7816
+ */
7817
+ static getOrCreateInstance() {
7818
+ if (gTestingHooksSingletonInstance === null) {
7819
+ gTestingHooksSingletonInstance = new TestingHooks();
7820
+ }
7821
+ return gTestingHooksSingletonInstance;
7822
+ }
7823
+ /**
7824
+ * Registers a callback to be notified when an existence filter mismatch
7825
+ * occurs in the Watch listen stream.
7826
+ *
7827
+ * The relative order in which callbacks are notified is unspecified; do not
7828
+ * rely on any particular ordering. If a given callback is registered multiple
7829
+ * times then it will be notified multiple times, once per registration.
7830
+ *
7831
+ * @param callback the callback to invoke upon existence filter mismatch.
7832
+ *
7833
+ * @return a function that, when called, unregisters the given callback; only
7834
+ * the first invocation of the returned function does anything; all subsequent
7835
+ * invocations do nothing.
7836
+ */
7837
+ onExistenceFilterMismatch(callback) {
7838
+ const key = Symbol();
7839
+ this.onExistenceFilterMismatchCallbacks.set(key, callback);
7840
+ return () => this.onExistenceFilterMismatchCallbacks.delete(key);
7841
+ }
7842
+ /**
7843
+ * Invokes all currently-registered `onExistenceFilterMismatch` callbacks.
7844
+ * @param info Information about the existence filter mismatch.
7845
+ */
7846
+ notifyOnExistenceFilterMismatch(info) {
7847
+ this.onExistenceFilterMismatchCallbacks.forEach(callback => callback(info));
7848
+ }
7849
+ }
7850
+ /** The global singleton instance of `TestingHooks`. */
7851
+ let gTestingHooksSingletonInstance = null;
7852
+
7770
7853
  /**
7771
7854
  * @license
7772
7855
  * Copyright 2017 Google LLC
@@ -8175,6 +8258,7 @@ class WatchChangeAggregator {
8175
8258
  * `pendingTargetResets`.
8176
8259
  */
8177
8260
  handleExistenceFilter(watchChange) {
8261
+ var _a;
8178
8262
  const targetId = watchChange.targetId;
8179
8263
  const expectedCount = watchChange.existenceFilter.count;
8180
8264
  const targetData = this.targetDataForActiveTarget(targetId);
@@ -8202,6 +8286,10 @@ class WatchChangeAggregator {
8202
8286
  // snapshot with `isFromCache:true`.
8203
8287
  this.resetTarget(targetId);
8204
8288
  this.pendingTargetResets = this.pendingTargetResets.add(targetId);
8289
+ (_a = TestingHooks.instance) === null || _a === void 0 ? void 0 : _a.notifyOnExistenceFilterMismatch({
8290
+ localCacheCount: currentSize,
8291
+ existenceFilterCount: watchChange.existenceFilter.count
8292
+ });
8205
8293
  }
8206
8294
  }
8207
8295
  }
@@ -31054,6 +31142,7 @@ exports._DocumentKey = DocumentKey;
31054
31142
  exports._EmptyAppCheckTokenProvider = EmptyAppCheckTokenProvider;
31055
31143
  exports._EmptyAuthCredentialsProvider = EmptyAuthCredentialsProvider;
31056
31144
  exports._FieldPath = FieldPath$1;
31145
+ exports._TestingHooks = TestingHooks;
31057
31146
  exports._cast = cast;
31058
31147
  exports._debugAssert = debugAssert;
31059
31148
  exports._isBase64Available = isBase64Available;