@firebase/firestore 4.7.8 → 4.7.9

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 (36) hide show
  1. package/dist/firestore/src/global_index.d.ts +9 -2
  2. package/dist/firestore/src/lite-api/database.d.ts +4 -0
  3. package/dist/firestore/src/lite-api/settings.d.ts +4 -0
  4. package/dist/firestore/src/lite-api/vector_value.d.ts +2 -2
  5. package/dist/firestore/test/integration/util/settings.d.ts +1 -0
  6. package/dist/index.cjs.js +108 -98
  7. package/dist/index.cjs.js.map +1 -1
  8. package/dist/index.d.ts +2 -2
  9. package/dist/index.esm2017.js +109 -99
  10. package/dist/index.esm2017.js.map +1 -1
  11. package/dist/index.node.cjs.js +17 -5
  12. package/dist/index.node.cjs.js.map +1 -1
  13. package/dist/index.node.mjs +18 -6
  14. package/dist/index.node.mjs.map +1 -1
  15. package/dist/index.rn.js +44 -34
  16. package/dist/index.rn.js.map +1 -1
  17. package/dist/internal.d.ts +9 -2
  18. package/dist/lite/firestore/src/lite-api/database.d.ts +4 -0
  19. package/dist/lite/firestore/src/lite-api/settings.d.ts +4 -0
  20. package/dist/lite/firestore/src/lite-api/vector_value.d.ts +2 -2
  21. package/dist/lite/firestore/test/integration/util/settings.d.ts +1 -0
  22. package/dist/lite/index.browser.esm2017.js +23 -13
  23. package/dist/lite/index.browser.esm2017.js.map +1 -1
  24. package/dist/lite/index.cjs.js +23 -13
  25. package/dist/lite/index.cjs.js.map +1 -1
  26. package/dist/lite/index.d.ts +2 -2
  27. package/dist/lite/index.node.cjs.js +17 -5
  28. package/dist/lite/index.node.cjs.js.map +1 -1
  29. package/dist/lite/index.node.mjs +18 -6
  30. package/dist/lite/index.node.mjs.map +1 -1
  31. package/dist/lite/index.rn.esm2017.js +43 -33
  32. package/dist/lite/index.rn.esm2017.js.map +1 -1
  33. package/dist/lite/internal.d.ts +9 -2
  34. package/dist/lite/private.d.ts +6 -2
  35. package/dist/private.d.ts +6 -2
  36. package/package.json +6 -6
@@ -1,10 +1,10 @@
1
1
  import { _registerComponent, registerVersion, _isFirebaseServerApp, _getProvider, getApp, _removeServiceInstance, SDK_VERSION } from '@firebase/app';
2
2
  import { Component } from '@firebase/component';
3
3
  import { Logger, LogLevel } from '@firebase/logger';
4
- import { FirebaseError, getDefaultEmulatorHostnameAndPort, createMockUserToken, getModularInstance, deepEqual } from '@firebase/util';
4
+ import { FirebaseError, getDefaultEmulatorHostnameAndPort, deepEqual, createMockUserToken, getModularInstance } from '@firebase/util';
5
5
  import { Integer } from '@firebase/webchannel-wrapper/bloom-blob';
6
6
 
7
- const E = "4.7.8";
7
+ const E = "4.7.9";
8
8
 
9
9
  /**
10
10
  * @license
@@ -65,7 +65,7 @@ User.MOCK_USER = new User("mock-user");
65
65
  * See the License for the specific language governing permissions and
66
66
  * limitations under the License.
67
67
  */
68
- let m = "11.3.1";
68
+ let m = "11.4.0";
69
69
 
70
70
  /**
71
71
  * @license
@@ -4278,7 +4278,7 @@ class Firestore {
4278
4278
  * Whether it's a Firestore or Firestore Lite instance.
4279
4279
  */
4280
4280
  this.type = "firestore-lite", this._persistenceKey = "(lite)", this._settings = new FirestoreSettingsImpl({}),
4281
- this._settingsFrozen = !1,
4281
+ this._settingsFrozen = !1, this._emulatorOptions = {},
4282
4282
  // A task that is assigned when the terminate() is invoked and resolved when
4283
4283
  // all components have shut down. Otherwise, Firestore is not terminated,
4284
4284
  // which can mean either the FirestoreClient is in the process of starting,
@@ -4300,7 +4300,8 @@ class Firestore {
4300
4300
  }
4301
4301
  _setSettings(t) {
4302
4302
  if (this._settingsFrozen) throw new FirestoreError(v, "Firestore has already been started and its settings can no longer be changed. You can only modify settings before calling any other methods on a Firestore object.");
4303
- this._settings = new FirestoreSettingsImpl(t), void 0 !== t.credentials && (this._authCredentials = function __PRIVATE_makeAuthCredentialsProvider(t) {
4303
+ this._settings = new FirestoreSettingsImpl(t), this._emulatorOptions = t.emulatorOptions || {},
4304
+ void 0 !== t.credentials && (this._authCredentials = function __PRIVATE_makeAuthCredentialsProvider(t) {
4304
4305
  if (!t) return new __PRIVATE_EmptyAuthCredentialsProvider;
4305
4306
  switch (t.type) {
4306
4307
  case "firstParty":
@@ -4317,6 +4318,9 @@ class Firestore {
4317
4318
  _getSettings() {
4318
4319
  return this._settings;
4319
4320
  }
4321
+ _getEmulatorOptions() {
4322
+ return this._emulatorOptions;
4323
+ }
4320
4324
  _freezeSettings() {
4321
4325
  return this._settingsFrozen = !0, this._settings;
4322
4326
  }
@@ -4388,12 +4392,18 @@ function getFirestore(t, r) {
4388
4392
  * Security Rules.
4389
4393
  */ function connectFirestoreEmulator(t, e, r, n = {}) {
4390
4394
  var i;
4391
- const s = (t = __PRIVATE_cast(t, Firestore))._getSettings(), o = `${e}:${r}`;
4392
- if (s.host !== nt && s.host !== o && __PRIVATE_logWarn("Host has been set in both settings() and connectFirestoreEmulator(), emulator host will be used."),
4393
- t._setSettings(Object.assign(Object.assign({}, s), {
4394
- host: o,
4395
- ssl: !1
4396
- })), n.mockUserToken) {
4395
+ const s = (t = __PRIVATE_cast(t, Firestore))._getSettings(), o = Object.assign(Object.assign({}, s), {
4396
+ emulatorOptions: t._getEmulatorOptions()
4397
+ }), a = `${e}:${r}`;
4398
+ s.host !== nt && s.host !== a && __PRIVATE_logWarn("Host has been set in both settings() and connectFirestoreEmulator(), emulator host will be used.");
4399
+ const u = Object.assign(Object.assign({}, s), {
4400
+ host: a,
4401
+ ssl: !1,
4402
+ emulatorOptions: n
4403
+ });
4404
+ // No-op if the new configuration matches the current configuration. This supports SSR
4405
+ // enviornments which might call `connectFirestoreEmulator` multiple times as a standard practice.
4406
+ if (!deepEqual(u, o) && (t._setSettings(u), n.mockUserToken)) {
4397
4407
  let e, r;
4398
4408
  if ("string" == typeof n.mockUserToken) e = n.mockUserToken, r = User.MOCK_USER; else {
4399
4409
  // Let createMockUserToken validate first (catches common mistakes like
@@ -4949,7 +4959,7 @@ function doc(t, e, ...r) {
4949
4959
  */
4950
4960
  /**
4951
4961
  * Represents a vector type in Firestore documents.
4952
- * Create an instance with {@link FieldValue.vector}.
4962
+ * Create an instance with <code>{@link vector}</code>.
4953
4963
  *
4954
4964
  * @class VectorValue
4955
4965
  */
@@ -4968,7 +4978,7 @@ class VectorValue {
4968
4978
  return this._values.map((t => t));
4969
4979
  }
4970
4980
  /**
4971
- * Returns `true` if the two VectorValue has the same raw number arrays, returns `false` otherwise.
4981
+ * Returns `true` if the two `VectorValue` values have the same raw number arrays, returns `false` otherwise.
4972
4982
  */ isEqual(t) {
4973
4983
  return function __PRIVATE_isPrimitiveArrayEqual(t, e) {
4974
4984
  if (t.length !== e.length) return !1;