@firebase/firestore 3.4.14-canary.fcd4b8ac3 → 3.4.15

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 (54) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/firestore/src/api/database.d.ts +34 -3
  3. package/dist/firestore/src/core/database_info.d.ts +4 -0
  4. package/dist/firestore/src/lite-api/database.d.ts +51 -7
  5. package/dist/firestore/test/integration/api/provider.test.d.ts +17 -0
  6. package/dist/firestore/test/integration/util/firebase_export.d.ts +2 -1
  7. package/dist/firestore/test/integration/util/helpers.d.ts +1 -0
  8. package/dist/index.d.ts +14 -3
  9. package/dist/index.esm2017.js +67 -68
  10. package/dist/index.esm2017.js.map +1 -1
  11. package/dist/index.esm5.js +52 -55
  12. package/dist/index.esm5.js.map +1 -1
  13. package/dist/index.node.cjs.js +47 -42
  14. package/dist/index.node.cjs.js.map +1 -1
  15. package/dist/index.node.mjs +47 -42
  16. package/dist/index.node.mjs.map +1 -1
  17. package/dist/index.rn.js +67 -68
  18. package/dist/index.rn.js.map +1 -1
  19. package/dist/internal.d.ts +40 -6
  20. package/dist/lite/firestore/src/api/database.d.ts +34 -3
  21. package/dist/lite/firestore/src/core/database_info.d.ts +4 -0
  22. package/dist/lite/firestore/src/lite-api/database.d.ts +51 -7
  23. package/dist/lite/firestore/test/integration/api/provider.test.d.ts +17 -0
  24. package/dist/lite/firestore/test/integration/util/firebase_export.d.ts +2 -1
  25. package/dist/lite/firestore/test/integration/util/helpers.d.ts +1 -0
  26. package/dist/lite/index.browser.esm2017.js +43 -57
  27. package/dist/lite/index.browser.esm2017.js.map +1 -1
  28. package/dist/lite/index.browser.esm5.js +181 -184
  29. package/dist/lite/index.browser.esm5.js.map +1 -1
  30. package/dist/lite/index.d.ts +15 -4
  31. package/dist/lite/index.node.cjs.js +37 -45
  32. package/dist/lite/index.node.cjs.js.map +1 -1
  33. package/dist/lite/index.node.mjs +37 -45
  34. package/dist/lite/index.node.mjs.map +1 -1
  35. package/dist/lite/index.rn.esm2017.js +43 -57
  36. package/dist/lite/index.rn.esm2017.js.map +1 -1
  37. package/dist/lite/internal.d.ts +55 -7
  38. package/dist/lite/packages/firestore/dist/lite/index.browser.esm2017.d.ts +6 -43
  39. package/dist/lite/packages/firestore/src/api/database.d.ts +34 -3
  40. package/dist/lite/packages/firestore/src/core/database_info.d.ts +4 -0
  41. package/dist/lite/packages/firestore/src/lite-api/database.d.ts +51 -7
  42. package/dist/lite/packages/firestore/test/integration/api/provider.test.d.ts +17 -0
  43. package/dist/lite/packages/firestore/test/integration/util/firebase_export.d.ts +2 -1
  44. package/dist/lite/packages/firestore/test/integration/util/helpers.d.ts +1 -0
  45. package/dist/lite/private.d.ts +22 -7
  46. package/dist/packages/firestore/dist/index.esm2017.d.ts +20 -15
  47. package/dist/packages/firestore/src/api/database.d.ts +34 -3
  48. package/dist/packages/firestore/src/core/database_info.d.ts +4 -0
  49. package/dist/packages/firestore/src/lite-api/database.d.ts +51 -7
  50. package/dist/packages/firestore/test/integration/api/provider.test.d.ts +17 -0
  51. package/dist/packages/firestore/test/integration/util/firebase_export.d.ts +2 -1
  52. package/dist/packages/firestore/test/integration/util/helpers.d.ts +1 -0
  53. package/dist/private.d.ts +21 -7
  54. package/package.json +10 -9
package/dist/index.rn.js CHANGED
@@ -70,7 +70,7 @@ x.MOCK_USER = new x("mock-user");
70
70
  * See the License for the specific language governing permissions and
71
71
  * limitations under the License.
72
72
  */
73
- let N = "9.9.2-canary.fcd4b8ac3";
73
+ let N = "9.9.4";
74
74
 
75
75
  /**
76
76
  * @license
@@ -2974,23 +2974,6 @@ class ae {
2974
2974
  }
2975
2975
  }
2976
2976
 
2977
- /**
2978
- * @license
2979
- * Copyright 2017 Google LLC
2980
- *
2981
- * Licensed under the Apache License, Version 2.0 (the "License");
2982
- * you may not use this file except in compliance with the License.
2983
- * You may obtain a copy of the License at
2984
- *
2985
- * http://www.apache.org/licenses/LICENSE-2.0
2986
- *
2987
- * Unless required by applicable law or agreed to in writing, software
2988
- * distributed under the License is distributed on an "AS IS" BASIS,
2989
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2990
- * See the License for the specific language governing permissions and
2991
- * limitations under the License.
2992
- */
2993
- /** Sentinel value that sorts before any Mutation Batch ID. */
2994
2977
  /**
2995
2978
  * Returns whether a variable is either undefined or null.
2996
2979
  */
@@ -15949,7 +15932,7 @@ class Jc {
15949
15932
  let e;
15950
15933
  if (t.isFoundDocument()) e = t.version; else {
15951
15934
  if (!t.isNoDocument()) throw U();
15952
- // For deleted docs, we must use baseVersion 0 when we overwrite them.
15935
+ // Represent a deleted doc using SnapshotVersion.min().
15953
15936
  e = at.min();
15954
15937
  }
15955
15938
  const n = this.readVersions.get(t.key.toString());
@@ -15964,7 +15947,7 @@ class Jc {
15964
15947
  * as a precondition, or no precondition if it was not read.
15965
15948
  */ precondition(t) {
15966
15949
  const e = this.readVersions.get(t.toString());
15967
- return !this.writtenDocs.has(t.toString()) && e ? qn.updateTime(e) : qn.none();
15950
+ return !this.writtenDocs.has(t.toString()) && e ? e.isEqual(at.min()) ? qn.exists(!1) : qn.updateTime(e) : qn.none();
15968
15951
  }
15969
15952
  /**
15970
15953
  * Returns the precondition for a document if the operation is an update.
@@ -16556,30 +16539,14 @@ class Pa {
16556
16539
  * Do not call this constructor directly. Instead, use {@link getFirestore}.
16557
16540
  */ class va {
16558
16541
  /** @hideconstructor */
16559
- constructor(t, e, n) {
16560
- this._authCredentials = e, this._appCheckCredentials = n,
16542
+ constructor(t, e, n, s) {
16543
+ this._authCredentials = t, this._appCheckCredentials = e, this._databaseId = n,
16544
+ this._app = s,
16561
16545
  /**
16562
16546
  * Whether it's a Firestore or Firestore Lite instance.
16563
16547
  */
16564
16548
  this.type = "firestore-lite", this._persistenceKey = "(lite)", this._settings = new Pa({}),
16565
- this._settingsFrozen = !1, t instanceof ae ? this._databaseId = t : (this._app = t,
16566
- this._databaseId = function(t) {
16567
- if (!Object.prototype.hasOwnProperty.apply(t.options, [ "projectId" ])) throw new j(Q.INVALID_ARGUMENT, '"projectId" not provided in firebase.initializeApp.');
16568
- return new ae(t.options.projectId);
16569
- }
16570
- /**
16571
- * Modify this instance to communicate with the Cloud Firestore emulator.
16572
- *
16573
- * Note: This must be called before this instance has been used to do any
16574
- * operations.
16575
- *
16576
- * @param firestore - The `Firestore` instance to configure to connect to the
16577
- * emulator.
16578
- * @param host - the emulator host (ex: localhost).
16579
- * @param port - the emulator port (ex: 9000).
16580
- * @param options.mockUserToken - the mock auth token to use for unit testing
16581
- * Security Rules.
16582
- */ (t));
16549
+ this._settingsFrozen = !1;
16583
16550
  }
16584
16551
  /**
16585
16552
  * The {@link @firebase/app#FirebaseApp} associated with this `Firestore` service
@@ -16645,7 +16612,19 @@ class Pa {
16645
16612
  }
16646
16613
  }
16647
16614
 
16648
- function Va(t, e, n, s = {}) {
16615
+ /**
16616
+ * Modify this instance to communicate with the Cloud Firestore emulator.
16617
+ *
16618
+ * Note: This must be called before this instance has been used to do any
16619
+ * operations.
16620
+ *
16621
+ * @param firestore - The `Firestore` instance to configure to connect to the
16622
+ * emulator.
16623
+ * @param host - the emulator host (ex: localhost).
16624
+ * @param port - the emulator port (ex: 9000).
16625
+ * @param options.mockUserToken - the mock auth token to use for unit testing
16626
+ * Security Rules.
16627
+ */ function Va(t, e, n, s = {}) {
16649
16628
  var i;
16650
16629
  const r = (t = Ra(t, va))._getSettings();
16651
16630
  if ("firestore.googleapis.com" !== r.host && r.host !== e && B("Host has been set in both settings() and useEmulator(), emulator host will be used"),
@@ -17184,12 +17163,12 @@ class Ba {
17184
17163
  */
17185
17164
  class Ua extends va {
17186
17165
  /** @hideconstructor */
17187
- constructor(t, e, n) {
17188
- super(t, e, n),
17166
+ constructor(t, e, n, s) {
17167
+ super(t, e, n, s),
17189
17168
  /**
17190
17169
  * Whether it's a {@link Firestore} or Firestore Lite instance.
17191
17170
  */
17192
- this.type = "firestore", this._queue = new Fa, this._persistenceKey = "name" in t ? t.name : "[DEFAULT]";
17171
+ this.type = "firestore", this._queue = new Fa, this._persistenceKey = (null == s ? void 0 : s.name) || "[DEFAULT]";
17193
17172
  }
17194
17173
  _terminate() {
17195
17174
  return this._firestoreClient ||
@@ -17208,30 +17187,30 @@ class Ua extends va {
17208
17187
  * @param app - The {@link @firebase/app#FirebaseApp} with which the {@link Firestore} instance will
17209
17188
  * be associated.
17210
17189
  * @param settings - A settings object to configure the {@link Firestore} instance.
17190
+ * @param databaseId - The name of database.
17211
17191
  * @returns A newly initialized {@link Firestore} instance.
17212
- */ function qa(t, e) {
17213
- const n = _getProvider(t, "firestore");
17214
- if (n.isInitialized()) {
17215
- const t = n.getImmediate(), s = n.getOptions();
17216
- if (T(s, e)) return t;
17192
+ */ function qa(t, e, n) {
17193
+ n || (n = "(default)");
17194
+ const s = _getProvider(t, "firestore");
17195
+ if (s.isInitialized(n)) {
17196
+ const t = s.getImmediate({
17197
+ identifier: n
17198
+ }), i = s.getOptions(n);
17199
+ if (T(i, e)) return t;
17217
17200
  throw new j(Q.FAILED_PRECONDITION, "initializeFirestore() has already been called with different options. To avoid this error, call initializeFirestore() with the same options as when it was originally called, or call getFirestore() to return the already initialized instance.");
17218
17201
  }
17219
17202
  if (void 0 !== e.cacheSizeBytes && -1 !== e.cacheSizeBytes && e.cacheSizeBytes < 1048576) throw new j(Q.INVALID_ARGUMENT, "cacheSizeBytes must be at least 1048576");
17220
- return n.initialize({
17221
- options: e
17203
+ return s.initialize({
17204
+ options: e,
17205
+ instanceIdentifier: n
17222
17206
  });
17223
17207
  }
17224
17208
 
17225
- /**
17226
- * Returns the existing {@link Firestore} instance that is associated with the
17227
- * provided {@link @firebase/app#FirebaseApp}. If no instance exists, initializes a new
17228
- * instance with default settings.
17229
- *
17230
- * @param app - The {@link @firebase/app#FirebaseApp} instance that the returned {@link Firestore}
17231
- * instance is associated with.
17232
- * @returns The {@link Firestore} instance of the provided app.
17233
- */ function Ka(e = t()) {
17234
- return _getProvider(e, "firestore").getImmediate();
17209
+ function Ka(e, n) {
17210
+ const s = "object" == typeof e ? e : t(), i = "string" == typeof e ? e : n || "(default)";
17211
+ return _getProvider(s, "firestore").getImmediate({
17212
+ identifier: i
17213
+ });
17235
17214
  }
17236
17215
 
17237
17216
  /**
@@ -17480,7 +17459,7 @@ function Ha(t) {
17480
17459
  * @returns A `Promise` that is resolved when the instance has been successfully
17481
17460
  * terminated.
17482
17461
  */ function Za(t) {
17483
- return e(t.app, "firestore"), t._delete();
17462
+ return e(t.app, "firestore", t._databaseId.database), t._delete();
17484
17463
  }
17485
17464
 
17486
17465
  /**
@@ -19781,14 +19760,34 @@ function Bl(t, e) {
19781
19760
  */ !function(t, e = !0) {
19782
19761
  !function(t) {
19783
19762
  N = t;
19784
- }(i), n(new r("firestore", ((t, {options: n}) => {
19785
- const s = t.getProvider("app").getImmediate(), i = new Ua(s, new Y(t.getProvider("auth-internal")), new et(t.getProvider("app-check-internal")));
19786
- return n = Object.assign({
19763
+ }(i), n(new r("firestore", ((t, {instanceIdentifier: n, options: s}) => {
19764
+ const i = t.getProvider("app").getImmediate(), r = new Ua(new Y(t.getProvider("auth-internal")), new et(t.getProvider("app-check-internal")), function(t, e) {
19765
+ if (!Object.prototype.hasOwnProperty.apply(t.options, [ "projectId" ])) throw new j(Q.INVALID_ARGUMENT, '"projectId" not provided in firebase.initializeApp.');
19766
+ return new ae(t.options.projectId, e);
19767
+ }
19768
+ /**
19769
+ * @license
19770
+ * Copyright 2017 Google LLC
19771
+ *
19772
+ * Licensed under the Apache License, Version 2.0 (the "License");
19773
+ * you may not use this file except in compliance with the License.
19774
+ * You may obtain a copy of the License at
19775
+ *
19776
+ * http://www.apache.org/licenses/LICENSE-2.0
19777
+ *
19778
+ * Unless required by applicable law or agreed to in writing, software
19779
+ * distributed under the License is distributed on an "AS IS" BASIS,
19780
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19781
+ * See the License for the specific language governing permissions and
19782
+ * limitations under the License.
19783
+ */
19784
+ /** Sentinel value that sorts before any Mutation Batch ID. */ (i, n), i);
19785
+ return s = Object.assign({
19787
19786
  useFetchStreams: e
19788
- }, n), i._setSettings(n), i;
19789
- }), "PUBLIC")), s(C, "3.4.14-canary.fcd4b8ac3", t),
19787
+ }, s), r._setSettings(s), r;
19788
+ }), "PUBLIC").setMultipleInstances(!0)), s(C, "3.4.15", t),
19790
19789
  // BUILD_TARGET will be replaced by values like esm5, esm2017, cjs5, etc during the compilation
19791
- s(C, "3.4.14-canary.fcd4b8ac3", "esm2017");
19790
+ s(C, "3.4.15", "esm2017");
19792
19791
  }("rn", /* useFetchStreams= */ !1);
19793
19792
 
19794
19793
  export { hl as AbstractUserDataWriter, rh as Bytes, La as CACHE_SIZE_UNLIMITED, Ca as CollectionReference, Sa as DocumentReference, $h as DocumentSnapshot, sh as FieldPath, oh as FieldValue, Ua as Firestore, j as FirestoreError, uh as GeoPoint, Ba as LoadBundleTask, Da as Query, Gh as QueryConstraint, Bh as QueryDocumentSnapshot, Lh as QuerySnapshot, Fh as SnapshotMetadata, ct as Timestamp, Dl as Transaction, dl as WriteBatch, ae as _DatabaseId, _t as _DocumentKey, nt as _EmptyAppCheckTokenProvider, H as _EmptyAuthCredentialsProvider, dt as _FieldPath, Ra as _cast, K as _debugAssert, Zt as _isBase64Available, B as _logWarn, Ia as _validateIsNotUsedTogether, bl as addDoc, Ml as arrayRemove, kl as arrayUnion, Ha as clearIndexedDbPersistence, xa as collection, Na as collectionGroup, Va as connectFirestoreEmulator, Rl as deleteDoc, xl as deleteField, Xa as disableNetwork, ka as doc, ih as documentId, ja as enableIndexedDbPersistence, Wa as enableMultiTabIndexedDbPersistence, Ya as enableNetwork, il as endAt, sl as endBefore, Ga as ensureFirestoreConfigured, Vl as executeWrite, wl as getDoc, gl as getDocFromCache, yl as getDocFromServer, pl as getDocs, Il as getDocsFromCache, Tl as getDocsFromServer, Ka as getFirestore, Ol as increment, qa as initializeFirestore, Yh as limit, Xh as limitToLast, th as loadBundle, eh as namedQuery, Pl as onSnapshot, vl as onSnapshotsInSync, Hh as orderBy, Qh as query, Oa as queryEqual, Ma as refEqual, Cl as runTransaction, Nl as serverTimestamp, El as setDoc, $l as setIndexConfiguration, O as setLogLevel, qh as snapshotEqual, el as startAfter, tl as startAt, Za as terminate, Al as updateDoc, Ja as waitForPendingWrites, Wh as where, Fl as writeBatch };