@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
@@ -1864,7 +1864,7 @@ export declare function vector(values?: number[]): VectorValue;
1864
1864
  */
1865
1865
  /**
1866
1866
  * Represents a vector type in Firestore documents.
1867
- * Create an instance with {@link FieldValue.vector}.
1867
+ * Create an instance with <code>{@link vector}</code>.
1868
1868
  *
1869
1869
  * @class VectorValue
1870
1870
  */
@@ -1875,7 +1875,7 @@ export declare class VectorValue {
1875
1875
  */
1876
1876
  toArray(): number[];
1877
1877
  /**
1878
- * Returns `true` if the two VectorValue has the same raw number arrays, returns `false` otherwise.
1878
+ * Returns `true` if the two `VectorValue` values have the same raw number arrays, returns `false` otherwise.
1879
1879
  */
1880
1880
  isEqual(other: VectorValue): boolean;
1881
1881
  }
@@ -10,7 +10,7 @@ var util = require('@firebase/util');
10
10
  var bloomBlob = require('@firebase/webchannel-wrapper/bloom-blob');
11
11
  var crypto = require('crypto');
12
12
 
13
- const version$1 = "4.7.8";
13
+ const version$1 = "4.7.9";
14
14
 
15
15
  /**
16
16
  * @license
@@ -63,7 +63,7 @@ User.GOOGLE_CREDENTIALS = new User('google-credentials-uid');
63
63
  User.FIRST_PARTY = new User('first-party-uid');
64
64
  User.MOCK_USER = new User('mock-user');
65
65
 
66
- const version = "11.3.1";
66
+ const version = "11.4.0";
67
67
 
68
68
  /**
69
69
  * @license
@@ -5678,6 +5678,7 @@ class Firestore {
5678
5678
  this._persistenceKey = '(lite)';
5679
5679
  this._settings = new FirestoreSettingsImpl({});
5680
5680
  this._settingsFrozen = false;
5681
+ this._emulatorOptions = {};
5681
5682
  // A task that is assigned when the terminate() is invoked and resolved when
5682
5683
  // all components have shut down. Otherwise, Firestore is not terminated,
5683
5684
  // which can mean either the FirestoreClient is in the process of starting,
@@ -5708,6 +5709,7 @@ class Firestore {
5708
5709
  'methods on a Firestore object.');
5709
5710
  }
5710
5711
  this._settings = new FirestoreSettingsImpl(settings);
5712
+ this._emulatorOptions = settings.emulatorOptions || {};
5711
5713
  if (settings.credentials !== undefined) {
5712
5714
  this._authCredentials = makeAuthCredentialsProvider(settings.credentials);
5713
5715
  }
@@ -5715,6 +5717,9 @@ class Firestore {
5715
5717
  _getSettings() {
5716
5718
  return this._settings;
5717
5719
  }
5720
+ _getEmulatorOptions() {
5721
+ return this._emulatorOptions;
5722
+ }
5718
5723
  _freezeSettings() {
5719
5724
  this._settingsFrozen = true;
5720
5725
  return this._settings;
@@ -5804,12 +5809,19 @@ function connectFirestoreEmulator(firestore, host, port, options = {}) {
5804
5809
  var _a;
5805
5810
  firestore = cast(firestore, Firestore);
5806
5811
  const settings = firestore._getSettings();
5812
+ const existingConfig = Object.assign(Object.assign({}, settings), { emulatorOptions: firestore._getEmulatorOptions() });
5807
5813
  const newHostSetting = `${host}:${port}`;
5808
5814
  if (settings.host !== DEFAULT_HOST && settings.host !== newHostSetting) {
5809
5815
  logWarn('Host has been set in both settings() and connectFirestoreEmulator(), emulator host ' +
5810
5816
  'will be used.');
5811
5817
  }
5812
- firestore._setSettings(Object.assign(Object.assign({}, settings), { host: newHostSetting, ssl: false }));
5818
+ const newConfig = Object.assign(Object.assign({}, settings), { host: newHostSetting, ssl: false, emulatorOptions: options });
5819
+ // No-op if the new configuration matches the current configuration. This supports SSR
5820
+ // enviornments which might call `connectFirestoreEmulator` multiple times as a standard practice.
5821
+ if (util.deepEqual(newConfig, existingConfig)) {
5822
+ return;
5823
+ }
5824
+ firestore._setSettings(newConfig);
5813
5825
  if (options.mockUserToken) {
5814
5826
  let token;
5815
5827
  let user;
@@ -6506,7 +6518,7 @@ function isPrimitiveArrayEqual(left, right) {
6506
6518
  */
6507
6519
  /**
6508
6520
  * Represents a vector type in Firestore documents.
6509
- * Create an instance with {@link FieldValue.vector}.
6521
+ * Create an instance with <code>{@link vector}</code>.
6510
6522
  *
6511
6523
  * @class VectorValue
6512
6524
  */
@@ -6526,7 +6538,7 @@ class VectorValue {
6526
6538
  return this._values.map(n => n);
6527
6539
  }
6528
6540
  /**
6529
- * Returns `true` if the two VectorValue has the same raw number arrays, returns `false` otherwise.
6541
+ * Returns `true` if the two `VectorValue` values have the same raw number arrays, returns `false` otherwise.
6530
6542
  */
6531
6543
  isEqual(other) {
6532
6544
  return isPrimitiveArrayEqual(this._values, other._values);