@firebase/firestore 3.12.0-20230511201449 → 3.12.0

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.
@@ -63,7 +63,7 @@ d.MOCK_USER = new d("mock-user");
63
63
  * See the License for the specific language governing permissions and
64
64
  * limitations under the License.
65
65
  */
66
- let w = "9.22.0-20230511201449";
66
+ let w = "9.22.0";
67
67
 
68
68
  /**
69
69
  * @license
@@ -4869,7 +4869,7 @@ function Gn(t) {
4869
4869
  });
4870
4870
  }
4871
4871
  ct(t) {
4872
- return wr(t, this.settings.methodName, this.settings.at || !1, this.path, this.settings.ht);
4872
+ return wr(t, this.settings.methodName, this.settings.ht || !1, this.path, this.settings.lt);
4873
4873
  }
4874
4874
  /** Returns 'true' if 'fieldPath' was traversed when creating this context. */ contains(t) {
4875
4875
  return void 0 !== this.fieldMask.find((e => t.isPrefixOf(e))) || void 0 !== this.fieldTransforms.find((e => t.isPrefixOf(e.field)));
@@ -4892,14 +4892,14 @@ function Gn(t) {
4892
4892
  constructor(t, e, n) {
4893
4893
  this.databaseId = t, this.ignoreUndefinedProperties = e, this.serializer = n || wn(t);
4894
4894
  }
4895
- /** Creates a new top-level parse context. */ lt(t, e, n, r = !1) {
4895
+ /** Creates a new top-level parse context. */ ft(t, e, n, r = !1) {
4896
4896
  return new Kn({
4897
4897
  et: t,
4898
4898
  methodName: e,
4899
- ht: n,
4899
+ lt: n,
4900
4900
  path: nt.emptyPath(),
4901
4901
  st: !1,
4902
- at: r
4902
+ ht: r
4903
4903
  }, this.databaseId, this.serializer, this.ignoreUndefinedProperties);
4904
4904
  }
4905
4905
  }
@@ -4910,7 +4910,7 @@ function Hn(t) {
4910
4910
  }
4911
4911
 
4912
4912
  /** Parse document data from a set() call. */ function Jn(t, e, n, r, s, i = {}) {
4913
- const o = t.lt(i.merge || i.mergeFields ? 2 /* UserDataSource.MergeSet */ : 0 /* UserDataSource.Set */ , e, n, s);
4913
+ const o = t.ft(i.merge || i.mergeFields ? 2 /* UserDataSource.MergeSet */ : 0 /* UserDataSource.Set */ , e, n, s);
4914
4914
  hr("Data must be an object, but it was:", o, r);
4915
4915
  const u = cr(r, o);
4916
4916
  let c, a;
@@ -4956,7 +4956,7 @@ class Xn extends jn {
4956
4956
  */ function Zn(t, e, n) {
4957
4957
  return new Kn({
4958
4958
  et: 3 /* UserDataSource.Argument */ ,
4959
- ht: e.settings.ht,
4959
+ lt: e.settings.lt,
4960
4960
  methodName: t._methodName,
4961
4961
  st: n
4962
4962
  }, e.databaseId, e.serializer, e.ignoreUndefinedProperties);
@@ -4973,11 +4973,11 @@ class tr extends jn {
4973
4973
 
4974
4974
  class er extends jn {
4975
4975
  constructor(t, e) {
4976
- super(t), this.ft = e;
4976
+ super(t), this.dt = e;
4977
4977
  }
4978
4978
  _toFieldTransform(t) {
4979
4979
  const e = Zn(this, t,
4980
- /*array=*/ !0), n = this.ft.map((t => ur(t, e))), r = new xe(n);
4980
+ /*array=*/ !0), n = this.dt.map((t => ur(t, e))), r = new xe(n);
4981
4981
  return new Oe(t.path, r);
4982
4982
  }
4983
4983
  isEqual(t) {
@@ -4988,11 +4988,11 @@ class er extends jn {
4988
4988
 
4989
4989
  class nr extends jn {
4990
4990
  constructor(t, e) {
4991
- super(t), this.ft = e;
4991
+ super(t), this.dt = e;
4992
4992
  }
4993
4993
  _toFieldTransform(t) {
4994
4994
  const e = Zn(this, t,
4995
- /*array=*/ !0), n = this.ft.map((t => ur(t, e))), r = new Se(n);
4995
+ /*array=*/ !0), n = this.dt.map((t => ur(t, e))), r = new Se(n);
4996
4996
  return new Oe(t.path, r);
4997
4997
  }
4998
4998
  isEqual(t) {
@@ -5003,10 +5003,10 @@ class nr extends jn {
5003
5003
 
5004
5004
  class rr extends jn {
5005
5005
  constructor(t, e) {
5006
- super(t), this.dt = e;
5006
+ super(t), this.wt = e;
5007
5007
  }
5008
5008
  _toFieldTransform(t) {
5009
- const e = new qe(t.serializer, Ne(t.serializer, this.dt));
5009
+ const e = new qe(t.serializer, Ne(t.serializer, this.wt));
5010
5010
  return new Oe(t.path, e);
5011
5011
  }
5012
5012
  isEqual(t) {
@@ -5016,7 +5016,7 @@ class rr extends jn {
5016
5016
  }
5017
5017
 
5018
5018
  /** Parse update data from an update() call. */ function sr(t, e, n, r) {
5019
- const s = t.lt(1 /* UserDataSource.Update */ , e, n);
5019
+ const s = t.ft(1 /* UserDataSource.Update */ , e, n);
5020
5020
  hr("Data must be an object, but it was:", s, r);
5021
5021
  const i = [], o = ge.empty();
5022
5022
  Rt(r, ((t, r) => {
@@ -5037,7 +5037,7 @@ class rr extends jn {
5037
5037
  }
5038
5038
 
5039
5039
  /** Parse update data from a list of field/value arguments. */ function ir(t, e, n, r, s, i) {
5040
- const o = t.lt(1 /* UserDataSource.Update */ , e, n), u = [ lr(e, r, n) ], c = [ s ];
5040
+ const o = t.ft(1 /* UserDataSource.Update */ , e, n), u = [ lr(e, r, n) ], c = [ s ];
5041
5041
  if (i.length % 2 != 0) throw new U(P, `Function ${e}() needs to be called with an even number of arguments that alternate between field names and values.`);
5042
5042
  for (let t = 0; t < i.length; t += 2) u.push(lr(e, i[t])), c.push(i[t + 1]);
5043
5043
  const a = [], h = ge.empty();
@@ -5068,7 +5068,7 @@ class rr extends jn {
5068
5068
  * @param allowArrays - Whether the query value is an array that may directly
5069
5069
  * contain additional arrays (e.g. the operand of an `in` query).
5070
5070
  */ function or(t, e, n, r = !1) {
5071
- return ur(n, t.lt(r ? 4 /* UserDataSource.ArrayArgument */ : 3 /* UserDataSource.Argument */ , e));
5071
+ return ur(n, t.ft(r ? 4 /* UserDataSource.ArrayArgument */ : 3 /* UserDataSource.Argument */ , e));
5072
5072
  }
5073
5073
 
5074
5074
  /**
@@ -6631,26 +6631,26 @@ function ds(t, e) {
6631
6631
  class ys {
6632
6632
  constructor(t, e, n, r, s) {
6633
6633
  this.asyncQueue = t, this.datastore = e, this.options = n, this.updateFunction = r,
6634
- this.deferred = s, this.wt = n.maxAttempts, this.yt = new mn(this.asyncQueue, "transaction_retry" /* TimerId.TransactionRetry */);
6634
+ this.deferred = s, this.yt = n.maxAttempts, this.gt = new mn(this.asyncQueue, "transaction_retry" /* TimerId.TransactionRetry */);
6635
6635
  }
6636
6636
  /** Runs the transaction and sets the result on deferred. */ run() {
6637
- this.wt -= 1, this.gt();
6637
+ this.yt -= 1, this._t();
6638
6638
  }
6639
- gt() {
6640
- this.yt.K((async () => {
6641
- const t = new ms(this.datastore), e = this._t(t);
6639
+ _t() {
6640
+ this.gt.K((async () => {
6641
+ const t = new ms(this.datastore), e = this.vt(t);
6642
6642
  e && e.then((e => {
6643
6643
  this.asyncQueue.enqueueAndForget((() => t.commit().then((() => {
6644
6644
  this.deferred.resolve(e);
6645
6645
  })).catch((t => {
6646
- this.vt(t);
6646
+ this.bt(t);
6647
6647
  }))));
6648
6648
  })).catch((t => {
6649
- this.vt(t);
6649
+ this.bt(t);
6650
6650
  }));
6651
6651
  }));
6652
6652
  }
6653
- _t(t) {
6653
+ vt(t) {
6654
6654
  try {
6655
6655
  const e = this.updateFunction(t);
6656
6656
  return !dt(e) && e.catch && e.then ? e : (this.deferred.reject(Error("Transaction callback must return a Promise")),
@@ -6660,11 +6660,11 @@ class ys {
6660
6660
  return this.deferred.reject(t), null;
6661
6661
  }
6662
6662
  }
6663
- vt(t) {
6664
- this.wt > 0 && this.bt(t) ? (this.wt -= 1, this.asyncQueue.enqueueAndForget((() => (this.gt(),
6663
+ bt(t) {
6664
+ this.yt > 0 && this.Et(t) ? (this.yt -= 1, this.asyncQueue.enqueueAndForget((() => (this._t(),
6665
6665
  Promise.resolve())))) : this.deferred.reject(t);
6666
6666
  }
6667
- bt(t) {
6667
+ Et(t) {
6668
6668
  if ("FirebaseError" === t.name) {
6669
6669
  // In transactions, the backend will fail outdated reads with FAILED_PRECONDITION and
6670
6670
  // non-matching document versions with ABORTED. These errors should be retried.
@@ -6835,39 +6835,39 @@ class ys {
6835
6835
  */ class vs {
6836
6836
  constructor() {
6837
6837
  // The last promise in the queue.
6838
- this.Et = Promise.resolve(),
6838
+ this.It = Promise.resolve(),
6839
6839
  // A list of retryable operations. Retryable operations are run in order and
6840
6840
  // retried with backoff.
6841
- this.It = [],
6841
+ this.Tt = [],
6842
6842
  // Is this AsyncQueue being shut down? Once it is set to true, it will not
6843
6843
  // be changed again.
6844
- this.Tt = !1,
6844
+ this.At = !1,
6845
6845
  // Operations scheduled to be queued in the future. Operations are
6846
6846
  // automatically removed after they are run or canceled.
6847
- this.At = [],
6847
+ this.Rt = [],
6848
6848
  // visible for testing
6849
- this.Rt = null,
6849
+ this.Pt = null,
6850
6850
  // Flag set while there's an outstanding AsyncQueue operation, used for
6851
6851
  // assertion sanity-checks.
6852
- this.Pt = !1,
6853
- // Enabled during shutdown on Safari to prevent future access to IndexedDB.
6854
6852
  this.Vt = !1,
6853
+ // Enabled during shutdown on Safari to prevent future access to IndexedDB.
6854
+ this.$t = !1,
6855
6855
  // List of TimerIds to fast-forward delays for.
6856
- this.$t = [],
6856
+ this.Nt = [],
6857
6857
  // Backoff timer used to schedule retries for retryable operations
6858
- this.yt = new mn(this, "async_queue_retry" /* TimerId.AsyncQueueRetry */),
6858
+ this.gt = new mn(this, "async_queue_retry" /* TimerId.AsyncQueueRetry */),
6859
6859
  // Visibility handler that triggers an immediate retry of all retryable
6860
6860
  // operations. Meant to speed up recovery when we regain file system access
6861
6861
  // after page comes into foreground.
6862
- this.Nt = () => {
6862
+ this.Dt = () => {
6863
6863
  const t = gs();
6864
- t && y("AsyncQueue", "Visibility state changed to " + t.visibilityState), this.yt.H();
6864
+ t && y("AsyncQueue", "Visibility state changed to " + t.visibilityState), this.gt.H();
6865
6865
  };
6866
6866
  const t = gs();
6867
- t && "function" == typeof t.addEventListener && t.addEventListener("visibilitychange", this.Nt);
6867
+ t && "function" == typeof t.addEventListener && t.addEventListener("visibilitychange", this.Dt);
6868
6868
  }
6869
6869
  get isShuttingDown() {
6870
- return this.Tt;
6870
+ return this.At;
6871
6871
  }
6872
6872
  /**
6873
6873
  * Adds a new operation to the queue without waiting for it to complete (i.e.
@@ -6877,38 +6877,38 @@ class ys {
6877
6877
  this.enqueue(t);
6878
6878
  }
6879
6879
  enqueueAndForgetEvenWhileRestricted(t) {
6880
- this.Dt(),
6880
+ this.Ft(),
6881
6881
  // eslint-disable-next-line @typescript-eslint/no-floating-promises
6882
- this.Ft(t);
6882
+ this.xt(t);
6883
6883
  }
6884
6884
  enterRestrictedMode(t) {
6885
- if (!this.Tt) {
6886
- this.Tt = !0, this.Vt = t || !1;
6885
+ if (!this.At) {
6886
+ this.At = !0, this.$t = t || !1;
6887
6887
  const e = gs();
6888
- e && "function" == typeof e.removeEventListener && e.removeEventListener("visibilitychange", this.Nt);
6888
+ e && "function" == typeof e.removeEventListener && e.removeEventListener("visibilitychange", this.Dt);
6889
6889
  }
6890
6890
  }
6891
6891
  enqueue(t) {
6892
- if (this.Dt(), this.Tt)
6892
+ if (this.Ft(), this.At)
6893
6893
  // Return a Promise which never resolves.
6894
6894
  return new Promise((() => {}));
6895
6895
  // Create a deferred Promise that we can return to the callee. This
6896
6896
  // allows us to return a "hanging Promise" only to the callee and still
6897
6897
  // advance the queue even when the operation is not run.
6898
6898
  const e = new j;
6899
- return this.Ft((() => this.Tt && this.Vt ? Promise.resolve() : (t().then(e.resolve, e.reject),
6899
+ return this.xt((() => this.At && this.$t ? Promise.resolve() : (t().then(e.resolve, e.reject),
6900
6900
  e.promise))).then((() => e.promise));
6901
6901
  }
6902
6902
  enqueueRetryable(t) {
6903
- this.enqueueAndForget((() => (this.It.push(t), this.xt())));
6903
+ this.enqueueAndForget((() => (this.Tt.push(t), this.St())));
6904
6904
  }
6905
6905
  /**
6906
6906
  * Runs the next operation from the retryable queue. If the operation fails,
6907
6907
  * reschedules with backoff.
6908
- */ async xt() {
6909
- if (0 !== this.It.length) {
6908
+ */ async St() {
6909
+ if (0 !== this.Tt.length) {
6910
6910
  try {
6911
- await this.It[0](), this.It.shift(), this.yt.reset();
6911
+ await this.Tt[0](), this.Tt.shift(), this.gt.reset();
6912
6912
  } catch (t) {
6913
6913
  if (!
6914
6914
  /**
@@ -6952,7 +6952,7 @@ class ys {
6952
6952
  // Failure will be handled by AsyncQueue
6953
6953
  y("AsyncQueue", "Operation failed with retryable error: " + t);
6954
6954
  }
6955
- this.It.length > 0 &&
6955
+ this.Tt.length > 0 &&
6956
6956
  // If there are additional operations, we re-schedule `retryNextOp()`.
6957
6957
  // This is necessary to run retryable operations that failed during
6958
6958
  // their initial attempt since we don't know whether they are already
@@ -6963,12 +6963,12 @@ class ys {
6963
6963
  // Since `backoffAndRun()` cancels an existing backoff and schedules a
6964
6964
  // new backoff on every call, there is only ever a single additional
6965
6965
  // operation in the queue.
6966
- this.yt.K((() => this.xt()));
6966
+ this.gt.K((() => this.St()));
6967
6967
  }
6968
6968
  }
6969
- Ft(t) {
6970
- const e = this.Et.then((() => (this.Pt = !0, t().catch((t => {
6971
- this.Rt = t, this.Pt = !1;
6969
+ xt(t) {
6970
+ const e = this.It.then((() => (this.Vt = !0, t().catch((t => {
6971
+ this.Pt = t, this.Vt = !1;
6972
6972
  const e =
6973
6973
  /**
6974
6974
  * Chrome includes Error.message in Error.stack. Other browsers do not.
@@ -7009,38 +7009,38 @@ class ys {
7009
7009
  // all further attempts to chain (via .then) will just short-circuit
7010
7010
  // and return the rejected Promise.
7011
7011
  throw g("INTERNAL UNHANDLED ERROR: ", e), t;
7012
- })).then((t => (this.Pt = !1, t))))));
7013
- return this.Et = e, e;
7012
+ })).then((t => (this.Vt = !1, t))))));
7013
+ return this.It = e, e;
7014
7014
  }
7015
7015
  enqueueAfterDelay(t, e, n) {
7016
- this.Dt(),
7016
+ this.Ft(),
7017
7017
  // Fast-forward delays for timerIds that have been overriden.
7018
- this.$t.indexOf(t) > -1 && (e = 0);
7019
- const r = _s.createAndSchedule(this, t, e, n, (t => this.St(t)));
7020
- return this.At.push(r), r;
7018
+ this.Nt.indexOf(t) > -1 && (e = 0);
7019
+ const r = _s.createAndSchedule(this, t, e, n, (t => this.qt(t)));
7020
+ return this.Rt.push(r), r;
7021
7021
  }
7022
- Dt() {
7023
- this.Rt && b();
7022
+ Ft() {
7023
+ this.Pt && b();
7024
7024
  }
7025
7025
  verifyOperationInProgress() {}
7026
7026
  /**
7027
7027
  * Waits until all currently queued tasks are finished executing. Delayed
7028
7028
  * operations are not run.
7029
- */ async qt() {
7029
+ */ async Ot() {
7030
7030
  // Operations in the queue prior to draining may have enqueued additional
7031
7031
  // operations. Keep draining the queue until the tail is no longer advanced,
7032
7032
  // which indicates that no more new operations were enqueued and that all
7033
7033
  // operations were executed.
7034
7034
  let t;
7035
7035
  do {
7036
- t = this.Et, await t;
7037
- } while (t !== this.Et);
7036
+ t = this.It, await t;
7037
+ } while (t !== this.It);
7038
7038
  }
7039
7039
  /**
7040
7040
  * For Tests: Determine if a delayed operation with a particular TimerId
7041
7041
  * exists.
7042
- */ Ot(t) {
7043
- for (const e of this.At) if (e.timerId === t) return !0;
7042
+ */ kt(t) {
7043
+ for (const e of this.Rt) if (e.timerId === t) return !0;
7044
7044
  return !1;
7045
7045
  }
7046
7046
  /**
@@ -7049,24 +7049,24 @@ class ys {
7049
7049
  * @param lastTimerId - Delayed operations up to and including this TimerId
7050
7050
  * will be drained. Pass TimerId.All to run all delayed operations.
7051
7051
  * @returns a Promise that resolves once all operations have been run.
7052
- */ kt(t) {
7052
+ */ Ct(t) {
7053
7053
  // Note that draining may generate more delayed ops, so we do that first.
7054
- return this.qt().then((() => {
7054
+ return this.Ot().then((() => {
7055
7055
  // Run ops in the same order they'd run if they ran naturally.
7056
- this.At.sort(((t, e) => t.targetTimeMs - e.targetTimeMs));
7057
- for (const e of this.At) if (e.skipDelay(), "all" /* TimerId.All */ !== t && e.timerId === t) break;
7058
- return this.qt();
7056
+ this.Rt.sort(((t, e) => t.targetTimeMs - e.targetTimeMs));
7057
+ for (const e of this.Rt) if (e.skipDelay(), "all" /* TimerId.All */ !== t && e.timerId === t) break;
7058
+ return this.Ot();
7059
7059
  }));
7060
7060
  }
7061
7061
  /**
7062
7062
  * For Tests: Skip all subsequent delays for a timer id.
7063
- */ Ct(t) {
7064
- this.$t.push(t);
7063
+ */ Mt(t) {
7064
+ this.Nt.push(t);
7065
7065
  }
7066
- /** Called once a DelayedOperation is run or canceled. */ St(t) {
7066
+ /** Called once a DelayedOperation is run or canceled. */ qt(t) {
7067
7067
  // NOTE: indexOf / slice are O(n), but delayedOperations is expected to be small.
7068
- const e = this.At.indexOf(t);
7069
- this.At.splice(e, 1);
7068
+ const e = this.Rt.indexOf(t);
7069
+ this.Rt.splice(e, 1);
7070
7070
  }
7071
7071
  }
7072
7072
 
@@ -7173,7 +7173,7 @@ class bs {
7173
7173
  return n && s._setSettings(n), s;
7174
7174
  }), "PUBLIC").setMultipleInstances(!0)),
7175
7175
  // RUNTIME_ENV and BUILD_TARGET are replaced by real values during the compilation
7176
- registerVersion("firestore-lite", "3.12.0-20230511201449", ""), registerVersion("firestore-lite", "3.12.0-20230511201449", "esm2017");
7176
+ registerVersion("firestore-lite", "3.12.0", ""), registerVersion("firestore-lite", "3.12.0", "esm2017");
7177
7177
 
7178
7178
  export { $n as AggregateField, Nn as AggregateQuerySnapshot, Mn as Bytes, xn as CollectionReference, Dn as DocumentReference, pr as DocumentSnapshot, Ln as FieldPath, jn as FieldValue, Tn as Firestore, U as FirestoreError, Bn as GeoPoint, Fn as Query, Rr as QueryCompositeFilterConstraint, Er as QueryConstraint, yr as QueryDocumentSnapshot, kr as QueryEndAtConstraint, Tr as QueryFieldFilterConstraint, Dr as QueryLimitConstraint, $r as QueryOrderByConstraint, gr as QuerySnapshot, Sr as QueryStartAtConstraint, xt as Timestamp, bs as Transaction, fs as WriteBatch, Zr as addDoc, is as aggregateFieldEqual, os as aggregateQuerySnapshotEqual, Vr as and, hs as arrayRemove, as as arrayUnion, rs as average, Sn as collection, qn as collectionGroup, Pn as connectFirestoreEmulator, ss as count, Xr as deleteDoc, us as deleteField, On as doc, Un as documentId, Mr as endAt, Cr as endBefore, es as getAggregate, ts as getCount, Kr as getDoc, Yr as getDocs, Rn as getFirestore, ls as increment, An as initializeFirestore, Fr as limit, xr as limitToLast, Pr as or, Nr as orderBy, Ir as query, Cn as queryEqual, kn as refEqual, Es as runTransaction, cs as serverTimestamp, Hr as setDoc, p as setLogLevel, _r as snapshotEqual, Or as startAfter, qr as startAt, ns as sum, Vn as terminate, Jr as updateDoc, Ar as where, ws as writeBatch };
7179
7179
  //# sourceMappingURL=index.browser.esm2017.js.map