@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
@@ -70,7 +70,7 @@ R.MOCK_USER = new R("mock-user");
70
70
  * See the License for the specific language governing permissions and
71
71
  * limitations under the License.
72
72
  */
73
- var M = "9.9.2-canary.fcd4b8ac3", P = new l("@firebase/firestore");
73
+ var M = "9.9.4", P = new l("@firebase/firestore");
74
74
 
75
75
  /**
76
76
  * @license
@@ -2866,23 +2866,6 @@ function(t, e, n, r, i, o, u, s) {
2866
2866
  * Represents the database ID a Firestore client is associated with.
2867
2867
  * @internal
2868
2868
  */
2869
- /**
2870
- * @license
2871
- * Copyright 2017 Google LLC
2872
- *
2873
- * Licensed under the Apache License, Version 2.0 (the "License");
2874
- * you may not use this file except in compliance with the License.
2875
- * You may obtain a copy of the License at
2876
- *
2877
- * http://www.apache.org/licenses/LICENSE-2.0
2878
- *
2879
- * Unless required by applicable law or agreed to in writing, software
2880
- * distributed under the License is distributed on an "AS IS" BASIS,
2881
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2882
- * See the License for the specific language governing permissions and
2883
- * limitations under the License.
2884
- */
2885
- /** Sentinel value that sorts before any Mutation Batch ID. */
2886
2869
  /**
2887
2870
  * Returns whether a variable is either undefined or null.
2888
2871
  */
@@ -16295,7 +16278,7 @@ function Ua(t, r) {
16295
16278
  var e;
16296
16279
  if (t.isFoundDocument()) e = t.version; else {
16297
16280
  if (!t.isNoDocument()) throw j();
16298
- // For deleted docs, we must use baseVersion 0 when we overwrite them.
16281
+ // Represent a deleted doc using SnapshotVersion.min().
16299
16282
  e = ft.min();
16300
16283
  }
16301
16284
  var n = this.readVersions.get(t.key.toString());
@@ -16311,7 +16294,7 @@ function Ua(t, r) {
16311
16294
  */
16312
16295
  t.prototype.precondition = function(t) {
16313
16296
  var e = this.readVersions.get(t.toString());
16314
- return !this.writtenDocs.has(t.toString()) && e ? Gn.updateTime(e) : Gn.none();
16297
+ return !this.writtenDocs.has(t.toString()) && e ? e.isEqual(ft.min()) ? Gn.exists(!1) : Gn.updateTime(e) : Gn.none();
16315
16298
  },
16316
16299
  /**
16317
16300
  * Returns the precondition for a document if the operation is an update.
@@ -16866,17 +16849,14 @@ function lc(t, e) {
16866
16849
  }, t;
16867
16850
  }(), fc = /** @class */ function() {
16868
16851
  /** @hideconstructor */
16869
- function t(t, e, n) {
16870
- this._authCredentials = e, this._appCheckCredentials = n,
16852
+ function t(t, e, n, r) {
16853
+ this._authCredentials = t, this._appCheckCredentials = e, this._databaseId = n,
16854
+ this._app = r,
16871
16855
  /**
16872
16856
  * Whether it's a Firestore or Firestore Lite instance.
16873
16857
  */
16874
16858
  this.type = "firestore-lite", this._persistenceKey = "(lite)", this._settings = new hc({}),
16875
- this._settingsFrozen = !1, t instanceof he ? this._databaseId = t : (this._app = t,
16876
- this._databaseId = function(t) {
16877
- if (!Object.prototype.hasOwnProperty.apply(t.options, [ "projectId" ])) throw new Y(H.INVALID_ARGUMENT, '"projectId" not provided in firebase.initializeApp.');
16878
- return new he(t.options.projectId);
16879
- }(t));
16859
+ this._settingsFrozen = !1;
16880
16860
  }
16881
16861
  return Object.defineProperty(t.prototype, "app", {
16882
16862
  /**
@@ -16969,7 +16949,21 @@ function lc(t, e) {
16969
16949
  * The Cloud Firestore service interface.
16970
16950
  *
16971
16951
  * Do not call this constructor directly. Instead, use {@link getFirestore}.
16972
- */ function dc(t, e, n, r) {
16952
+ */
16953
+ /**
16954
+ * Modify this instance to communicate with the Cloud Firestore emulator.
16955
+ *
16956
+ * Note: This must be called before this instance has been used to do any
16957
+ * operations.
16958
+ *
16959
+ * @param firestore - The `Firestore` instance to configure to connect to the
16960
+ * emulator.
16961
+ * @param host - the emulator host (ex: localhost).
16962
+ * @param port - the emulator port (ex: 9000).
16963
+ * @param options.mockUserToken - the mock auth token to use for unit testing
16964
+ * Security Rules.
16965
+ */
16966
+ function dc(t, e, n, r) {
16973
16967
  var i;
16974
16968
  void 0 === r && (r = {});
16975
16969
  var o = (t = cc(t, fc))._getSettings();
@@ -17530,13 +17524,13 @@ var Sc = /** @class */ function() {
17530
17524
  }, t;
17531
17525
  }(), Dc = -1, xc = /** @class */ function(e) {
17532
17526
  /** @hideconstructor */
17533
- function n(t, n, r) {
17534
- var i = this;
17527
+ function n(t, n, r, i) {
17528
+ var o = this;
17535
17529
  /**
17536
17530
  * Whether it's a {@link Firestore} or Firestore Lite instance.
17537
17531
  */
17538
- return (i = e.call(this, t, n, r) || this).type = "firestore", i._queue = new Ec,
17539
- i._persistenceKey = "name" in t ? t.name : "[DEFAULT]", i;
17532
+ return (o = e.call(this, t, n, r, i) || this).type = "firestore", o._queue = new Ec,
17533
+ o._persistenceKey = (null == i ? void 0 : i.name) || "[DEFAULT]", o;
17540
17534
  }
17541
17535
  return t(n, e), n.prototype._terminate = function() {
17542
17536
  return this._firestoreClient ||
@@ -17572,31 +17566,31 @@ var Sc = /** @class */ function() {
17572
17566
  * @param app - The {@link @firebase/app#FirebaseApp} with which the {@link Firestore} instance will
17573
17567
  * be associated.
17574
17568
  * @param settings - A settings object to configure the {@link Firestore} instance.
17569
+ * @param databaseId - The name of database.
17575
17570
  * @returns A newly initialized {@link Firestore} instance.
17576
17571
  */
17577
- function _c(t, e) {
17578
- var n = _getProvider(t, "firestore");
17579
- if (n.isInitialized()) {
17580
- var r = n.getImmediate(), i = n.getOptions();
17581
- if (T(i, e)) return r;
17572
+ function _c(t, e, n) {
17573
+ n || (n = "(default)");
17574
+ var r = _getProvider(t, "firestore");
17575
+ if (r.isInitialized(n)) {
17576
+ var i = r.getImmediate({
17577
+ identifier: n
17578
+ }), o = r.getOptions(n);
17579
+ if (T(o, e)) return i;
17582
17580
  throw new Y(H.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.");
17583
17581
  }
17584
17582
  if (void 0 !== e.cacheSizeBytes && -1 !== e.cacheSizeBytes && e.cacheSizeBytes < 1048576) throw new Y(H.INVALID_ARGUMENT, "cacheSizeBytes must be at least 1048576");
17585
- return n.initialize({
17586
- options: e
17583
+ return r.initialize({
17584
+ options: e,
17585
+ instanceIdentifier: n
17587
17586
  });
17588
17587
  }
17589
17588
 
17590
- /**
17591
- * Returns the existing {@link Firestore} instance that is associated with the
17592
- * provided {@link @firebase/app#FirebaseApp}. If no instance exists, initializes a new
17593
- * instance with default settings.
17594
- *
17595
- * @param app - The {@link @firebase/app#FirebaseApp} instance that the returned {@link Firestore}
17596
- * instance is associated with.
17597
- * @returns The {@link Firestore} instance of the provided app.
17598
- */ function Nc(t) {
17599
- return void 0 === t && (t = s()), _getProvider(t, "firestore").getImmediate();
17589
+ function Nc(t, e) {
17590
+ var n = "object" == typeof t ? t : s(), r = "string" == typeof t ? t : e || "(default)";
17591
+ return _getProvider(n, "firestore").getImmediate({
17592
+ identifier: r
17593
+ });
17600
17594
  }
17601
17595
 
17602
17596
  /**
@@ -17892,7 +17886,7 @@ function Rc(t) {
17892
17886
  * @returns A `Promise` that is resolved when the instance has been successfully
17893
17887
  * terminated.
17894
17888
  */ function Fc(t) {
17895
- return a(t.app, "firestore"), t._delete()
17889
+ return a(t.app, "firestore", t._databaseId.database), t._delete()
17896
17890
  /**
17897
17891
  * Loads a Firestore bundle into the local cache.
17898
17892
  *
@@ -20399,13 +20393,16 @@ function Dh(t, e) {
20399
20393
  *
20400
20394
  * @packageDocumentation
20401
20395
  */ void 0 === vh && (vh = !0), M = i, o(new c("firestore", (function(t, e) {
20402
- var n = e.options, r = t.getProvider("app").getImmediate(), i = new xc(r, new tt(t.getProvider("auth-internal")), new it(t.getProvider("app-check-internal")));
20403
- return n = Object.assign({
20396
+ var n = e.instanceIdentifier, r = e.options, i = t.getProvider("app").getImmediate(), o = new xc(new tt(t.getProvider("auth-internal")), new it(t.getProvider("app-check-internal")), function(t, e) {
20397
+ if (!Object.prototype.hasOwnProperty.apply(t.options, [ "projectId" ])) throw new Y(H.INVALID_ARGUMENT, '"projectId" not provided in firebase.initializeApp.');
20398
+ return new he(t.options.projectId, e);
20399
+ }(i, n), i);
20400
+ return r = Object.assign({
20404
20401
  useFetchStreams: vh
20405
- }, n), i._setSettings(n), i;
20406
- }), "PUBLIC")), u(L, "3.4.14-canary.fcd4b8ac3", void 0),
20402
+ }, r), o._setSettings(r), o;
20403
+ }), "PUBLIC").setMultipleInstances(!0)), u(L, "3.4.15", void 0),
20407
20404
  // BUILD_TARGET will be replaced by values like esm5, esm2017, cjs5, etc during the compilation
20408
- u(L, "3.4.14-canary.fcd4b8ac3", "esm5");
20405
+ u(L, "3.4.15", "esm5");
20409
20406
 
20410
20407
  export { Yl as AbstractUserDataWriter, jc as Bytes, Dc as CACHE_SIZE_UNLIMITED, yc as CollectionReference, pc as DocumentReference, Tl as DocumentSnapshot, Gc as FieldPath, Qc as FieldValue, xc as Firestore, Y as FirestoreError, zc as GeoPoint, Sc as LoadBundleTask, vc as Query, Al as QueryConstraint, Sl as QueryDocumentSnapshot, Dl as QuerySnapshot, El as SnapshotMetadata, ht as Timestamp, yh as Transaction, Jl as WriteBatch, he as _DatabaseId, mt as _DocumentKey, ot as _EmptyAppCheckTokenProvider, J as _EmptyAuthCredentialsProvider, yt as _FieldPath, cc as _cast, z as _debugAssert, ee as _isBase64Available, G as _logWarn, oc as _validateIsNotUsedTogether, lh as addDoc, Ih as arrayRemove, bh as arrayUnion, Lc as clearIndexedDbPersistence, mc as collection, gc as collectionGroup, dc as connectFirestoreEmulator, ch as deleteDoc, gh as deleteField, Pc as disableNetwork, wc as doc, Kc as documentId, kc as enableIndexedDbPersistence, Oc as enableMultiTabIndexedDbPersistence, Mc as enableNetwork, Kl as endAt, Gl as endBefore, Ac as ensureFirestoreConfigured, dh as executeWrite, th as getDoc, nh as getDocFromCache, rh as getDocFromServer, ih as getDocs, oh as getDocsFromCache, uh as getDocsFromServer, Nc as getFirestore, Eh as increment, _c as initializeFirestore, Ml as limit, Pl as limitToLast, qc as loadBundle, Uc as namedQuery, hh as onSnapshot, fh as onSnapshotsInSync, Ll as orderBy, Cl as query, Ic as queryEqual, bc as refEqual, mh as runTransaction, wh as serverTimestamp, sh as setDoc, Sh as setIndexConfiguration, q as setLogLevel, _l as snapshotEqual, Ul as startAfter, ql as startAt, Fc as terminate, ah as updateDoc, Rc as waitForPendingWrites, Ol as where, Th as writeBatch };
20411
20408
  //# sourceMappingURL=index.esm5.js.map