@firebase/firestore 3.4.7-canary.e9e5f6b3c → 3.4.8
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.
- package/CHANGELOG.md +10 -0
- package/dist/firestore/src/local/indexeddb_remote_document_cache.d.ts +9 -0
- package/dist/firestore/src/local/simple_db.d.ts +2 -0
- package/dist/firestore/test/unit/local/test_remote_document_cache.d.ts +0 -4
- package/dist/index.esm2017.js +153 -146
- package/dist/index.esm2017.js.map +1 -1
- package/dist/index.esm5.js +69 -65
- package/dist/index.esm5.js.map +1 -1
- package/dist/index.node.cjs.js +26 -9
- package/dist/index.node.cjs.js.map +1 -1
- package/dist/index.node.mjs +26 -9
- package/dist/index.node.mjs.map +1 -1
- package/dist/index.rn.js +14 -7
- package/dist/index.rn.js.map +1 -1
- package/dist/lite/firestore/src/local/indexeddb_remote_document_cache.d.ts +9 -0
- package/dist/lite/firestore/src/local/simple_db.d.ts +2 -0
- package/dist/lite/firestore/test/unit/local/test_remote_document_cache.d.ts +0 -4
- package/dist/lite/index.browser.esm2017.js +73 -73
- package/dist/lite/index.browser.esm2017.js.map +1 -1
- package/dist/lite/index.browser.esm5.js +8 -8
- package/dist/lite/index.browser.esm5.js.map +1 -1
- package/dist/lite/index.node.cjs.js +2 -2
- package/dist/lite/index.node.cjs.js.map +1 -1
- package/dist/lite/index.node.mjs +2 -2
- package/dist/lite/index.node.mjs.map +1 -1
- package/dist/lite/index.rn.esm2017.js +1112 -1112
- package/dist/lite/index.rn.esm2017.js.map +1 -1
- package/dist/lite/packages/firestore/dist/lite/index.browser.esm2017.d.ts +18 -18
- package/dist/lite/packages/firestore/src/local/indexeddb_remote_document_cache.d.ts +9 -0
- package/dist/lite/packages/firestore/src/local/simple_db.d.ts +2 -0
- package/dist/lite/packages/firestore/test/unit/local/test_remote_document_cache.d.ts +0 -4
- package/dist/packages/firestore/dist/index.esm2017.d.ts +8 -8
- package/dist/packages/firestore/src/local/indexeddb_remote_document_cache.d.ts +9 -0
- package/dist/packages/firestore/src/local/simple_db.d.ts +2 -0
- package/dist/packages/firestore/test/unit/local/test_remote_document_cache.d.ts +0 -4
- package/package.json +9 -9
package/dist/index.esm5.js
CHANGED
|
@@ -70,7 +70,7 @@ L.MOCK_USER = new L("mock-user");
|
|
|
70
70
|
* See the License for the specific language governing permissions and
|
|
71
71
|
* limitations under the License.
|
|
72
72
|
*/
|
|
73
|
-
var P = "9.6.
|
|
73
|
+
var P = "9.6.11", O = new l("@firebase/firestore");
|
|
74
74
|
|
|
75
75
|
/**
|
|
76
76
|
* @license
|
|
@@ -5210,7 +5210,7 @@ function Kr(t) {
|
|
|
5210
5210
|
}), t.prototype.abort = function(t) {
|
|
5211
5211
|
t && this.At.reject(t), this.aborted || (U("SimpleDb", "Aborting transaction:", t ? t.message : "Client-initiated abort"),
|
|
5212
5212
|
this.aborted = !0, this.transaction.abort());
|
|
5213
|
-
}, t.prototype.
|
|
5213
|
+
}, t.prototype.Pt = function() {
|
|
5214
5214
|
// If the browser supports V3 IndexedDB, we invoke commit() explicitly to
|
|
5215
5215
|
// speed up index DB processing if the event loop remains blocks.
|
|
5216
5216
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -5241,7 +5241,7 @@ function Kr(t) {
|
|
|
5241
5241
|
* objectstores.
|
|
5242
5242
|
*/
|
|
5243
5243
|
function t(e, n, r) {
|
|
5244
|
-
this.name = e, this.version = n, this.
|
|
5244
|
+
this.name = e, this.version = n, this.bt = r,
|
|
5245
5245
|
// NOTE: According to https://bugs.webkit.org/show_bug.cgi?id=197050, the
|
|
5246
5246
|
// bug we're checking for should exist in iOS >= 12.2 and < 13, but for
|
|
5247
5247
|
// whatever reason it's much harder to hit after 12.2 so we only proactively
|
|
@@ -5323,7 +5323,7 @@ function Kr(t) {
|
|
|
5323
5323
|
}, i.onupgradeneeded = function(t) {
|
|
5324
5324
|
U("SimpleDb", 'Database "' + n.name + '" requires upgrade from version:', t.oldVersion);
|
|
5325
5325
|
var e = t.target.result;
|
|
5326
|
-
n.
|
|
5326
|
+
n.bt.kt(e, i.transaction, t.oldVersion, n.version).next((function() {
|
|
5327
5327
|
U("SimpleDb", "Database upgrade to version " + n.version + " complete");
|
|
5328
5328
|
}));
|
|
5329
5329
|
};
|
|
@@ -5364,7 +5364,7 @@ function Kr(t) {
|
|
|
5364
5364
|
// fire), but still return the original transactionFnResult back to the
|
|
5365
5365
|
// caller.
|
|
5366
5366
|
return a.db = r.sent(), e = gi.open(a.db, t, n ? "readonly" : "readwrite", i), s = o(e).next((function(t) {
|
|
5367
|
-
return e.
|
|
5367
|
+
return e.Pt(), t;
|
|
5368
5368
|
})).catch((function(t) {
|
|
5369
5369
|
// Abort the transaction if there was an error.
|
|
5370
5370
|
return e.abort(t), mi.reject(t);
|
|
@@ -6346,8 +6346,8 @@ var $i = /** @class */ function() {
|
|
|
6346
6346
|
* Writes the "infinity" byte sequence that sorts after all other byte
|
|
6347
6347
|
* sequences written in ascending order.
|
|
6348
6348
|
*/
|
|
6349
|
-
t.prototype.
|
|
6350
|
-
this.
|
|
6349
|
+
t.prototype.Pe = function() {
|
|
6350
|
+
this.be(255), this.be(255);
|
|
6351
6351
|
},
|
|
6352
6352
|
/**
|
|
6353
6353
|
* Writes the "infinity" byte sequence that sorts before all other byte
|
|
@@ -6391,16 +6391,16 @@ var $i = /** @class */ function() {
|
|
|
6391
6391
|
},
|
|
6392
6392
|
/** Writes a single byte ascending to the buffer. */ t.prototype._e = function(t) {
|
|
6393
6393
|
var e = 255 & t;
|
|
6394
|
-
0 === e ? (this.
|
|
6394
|
+
0 === e ? (this.be(0), this.be(255)) : 255 === e ? (this.be(255), this.be(0)) : this.be(e);
|
|
6395
6395
|
},
|
|
6396
6396
|
/** Writes a single byte descending to the buffer. */ t.prototype.ge = function(t) {
|
|
6397
6397
|
var e = 255 & t;
|
|
6398
6398
|
0 === e ? (this.ve(0), this.ve(255)) : 255 === e ? (this.ve(255), this.ve(0)) : this.ve(t);
|
|
6399
6399
|
}, t.prototype.we = function() {
|
|
6400
|
-
this.
|
|
6400
|
+
this.be(0), this.be(1);
|
|
6401
6401
|
}, t.prototype.ye = function() {
|
|
6402
6402
|
this.ve(0), this.ve(1);
|
|
6403
|
-
}, t.prototype.
|
|
6403
|
+
}, t.prototype.be = function(t) {
|
|
6404
6404
|
this.Ae(1), this.buffer[this.position++] = t;
|
|
6405
6405
|
}, t.prototype.ve = function(t) {
|
|
6406
6406
|
this.Ae(1), this.buffer[this.position++] = ~t;
|
|
@@ -6428,7 +6428,7 @@ var $i = /** @class */ function() {
|
|
|
6428
6428
|
}, t.prototype.se = function(t) {
|
|
6429
6429
|
this.De.Te(t);
|
|
6430
6430
|
}, t.prototype.ee = function() {
|
|
6431
|
-
this.De.
|
|
6431
|
+
this.De.Pe();
|
|
6432
6432
|
}, t;
|
|
6433
6433
|
}(), to = /** @class */ function() {
|
|
6434
6434
|
function t(t) {
|
|
@@ -7880,10 +7880,10 @@ function Do(t) {
|
|
|
7880
7880
|
function t(t) {
|
|
7881
7881
|
this.An = t, this.buffer = new jn(Co), this.Rn = 0;
|
|
7882
7882
|
}
|
|
7883
|
-
return t.prototype.
|
|
7883
|
+
return t.prototype.Pn = function() {
|
|
7884
7884
|
return ++this.Rn;
|
|
7885
|
-
}, t.prototype.
|
|
7886
|
-
var e = [ t, this.
|
|
7885
|
+
}, t.prototype.bn = function(t) {
|
|
7886
|
+
var e = [ t, this.Pn() ];
|
|
7887
7887
|
if (this.buffer.size < this.An) this.buffer = this.buffer.add(e); else {
|
|
7888
7888
|
var n = this.buffer.last();
|
|
7889
7889
|
Co(e, n) < 0 && (this.buffer = this.buffer.delete(n).add(e));
|
|
@@ -7967,10 +7967,10 @@ function Do(t) {
|
|
|
7967
7967
|
if (0 === e) return mi.resolve(ut.A);
|
|
7968
7968
|
var r = new ko(e);
|
|
7969
7969
|
return this.Dn.forEachTarget(t, (function(t) {
|
|
7970
|
-
return r.
|
|
7970
|
+
return r.bn(t.sequenceNumber);
|
|
7971
7971
|
})).next((function() {
|
|
7972
7972
|
return n.Dn.xn(t, (function(t) {
|
|
7973
|
-
return r.
|
|
7973
|
+
return r.bn(t);
|
|
7974
7974
|
}));
|
|
7975
7975
|
})).next((function() {
|
|
7976
7976
|
return r.maxValue;
|
|
@@ -8545,11 +8545,15 @@ function Ko(t, e) {
|
|
|
8545
8545
|
|
|
8546
8546
|
/**
|
|
8547
8547
|
* Comparator that compares document keys according to the primary key sorting
|
|
8548
|
-
* used by the `DbRemoteDocumentDocument` store (by
|
|
8549
|
-
* document ID).
|
|
8548
|
+
* used by the `DbRemoteDocumentDocument` store (by prefix path, collection id
|
|
8549
|
+
* and then document ID).
|
|
8550
|
+
*
|
|
8551
|
+
* Visible for testing.
|
|
8550
8552
|
*/ function Go(t, e) {
|
|
8551
|
-
var n = t.path.
|
|
8552
|
-
|
|
8553
|
+
for (var n = t.path.toArray(), r = e.path.toArray(), i = 0, o = 0
|
|
8554
|
+
// The ordering is based on https://chromium.googlesource.com/chromium/blink/+/fe5c21fef94dae71c1c3344775b8d8a7f7e6d9ec/Source/modules/indexeddb/IDBKey.cpp#74
|
|
8555
|
+
; o < n.length - 2 && o < r.length - 2; ++o) if (i = ct(n[o], r[o])) return i;
|
|
8556
|
+
return (i = ct(n.length, r.length)) || ((i = ct(n[n.length - 2], r[r.length - 2])) || ct(n[n.length - 1], r[r.length - 1]));
|
|
8553
8557
|
}
|
|
8554
8558
|
|
|
8555
8559
|
/**
|
|
@@ -9009,7 +9013,7 @@ var Qo = "Failed to obtain exclusive access to the persistence layer. To allow s
|
|
|
9009
9013
|
})).next((function(n) {
|
|
9010
9014
|
return t.isPrimary && !n ? t.Rs(e).next((function() {
|
|
9011
9015
|
return !1;
|
|
9012
|
-
})) : !!n && t.
|
|
9016
|
+
})) : !!n && t.Ps(e).next((function() {
|
|
9013
9017
|
return !0;
|
|
9014
9018
|
}));
|
|
9015
9019
|
}));
|
|
@@ -9029,7 +9033,7 @@ var Qo = "Failed to obtain exclusive access to the persistence layer. To allow s
|
|
|
9029
9033
|
}, t.prototype.Es = function(t) {
|
|
9030
9034
|
var e = this;
|
|
9031
9035
|
return Ho(t).get("owner").next((function(t) {
|
|
9032
|
-
return mi.resolve(e.
|
|
9036
|
+
return mi.resolve(e.bs(t));
|
|
9033
9037
|
}));
|
|
9034
9038
|
}, t.prototype.Vs = function(t) {
|
|
9035
9039
|
return Yo(t).delete(this.clientId);
|
|
@@ -9092,7 +9096,7 @@ var Qo = "Failed to obtain exclusive access to the persistence layer. To allow s
|
|
|
9092
9096
|
}));
|
|
9093
9097
|
}));
|
|
9094
9098
|
},
|
|
9095
|
-
/** Checks whether `client` is the local client. */ t.prototype.
|
|
9099
|
+
/** Checks whether `client` is the local client. */ t.prototype.bs = function(t) {
|
|
9096
9100
|
return !!t && t.ownerId === this.clientId;
|
|
9097
9101
|
},
|
|
9098
9102
|
/**
|
|
@@ -9115,8 +9119,8 @@ var Qo = "Failed to obtain exclusive access to the persistence layer. To allow s
|
|
|
9115
9119
|
// the foreground.
|
|
9116
9120
|
// - the `forceOwningTab` setting was passed in.
|
|
9117
9121
|
if (null !== n && e.Ss(n.leaseTimestampMs, 5e3) && !e.xs(n.ownerId)) {
|
|
9118
|
-
if (e.
|
|
9119
|
-
if (!e.
|
|
9122
|
+
if (e.bs(n) && e.networkEnabled) return !0;
|
|
9123
|
+
if (!e.bs(n)) {
|
|
9120
9124
|
if (!n.allowTabSynchronization)
|
|
9121
9125
|
// Fail the `canActAsPrimary` check if the current leaseholder has
|
|
9122
9126
|
// not opted into multi-tab synchronization. If this happens at
|
|
@@ -9238,7 +9242,7 @@ var Qo = "Failed to obtain exclusive access to the persistence layer. To allow s
|
|
|
9238
9242
|
})), new Y(H.FAILED_PRECONDITION, yi);
|
|
9239
9243
|
return n(o);
|
|
9240
9244
|
})).next((function(t) {
|
|
9241
|
-
return r.
|
|
9245
|
+
return r.Ps(o).next((function() {
|
|
9242
9246
|
return t;
|
|
9243
9247
|
}));
|
|
9244
9248
|
})) : r.$s(o).next((function() {
|
|
@@ -9257,14 +9261,14 @@ var Qo = "Failed to obtain exclusive access to the persistence layer. To allow s
|
|
|
9257
9261
|
t.prototype.$s = function(t) {
|
|
9258
9262
|
var e = this;
|
|
9259
9263
|
return Ho(t).get("owner").next((function(t) {
|
|
9260
|
-
if (null !== t && e.Ss(t.leaseTimestampMs, 5e3) && !e.xs(t.ownerId) && !e.
|
|
9264
|
+
if (null !== t && e.Ss(t.leaseTimestampMs, 5e3) && !e.xs(t.ownerId) && !e.bs(t) && !(e.Zn || e.allowTabSynchronization && t.allowTabSynchronization)) throw new Y(H.FAILED_PRECONDITION, Qo);
|
|
9261
9265
|
}));
|
|
9262
9266
|
},
|
|
9263
9267
|
/**
|
|
9264
9268
|
* Obtains or extends the new primary lease for the local client. This
|
|
9265
9269
|
* method does not verify that the client is eligible for this lease.
|
|
9266
9270
|
*/
|
|
9267
|
-
t.prototype.
|
|
9271
|
+
t.prototype.Ps = function(t) {
|
|
9268
9272
|
var e = {
|
|
9269
9273
|
ownerId: this.clientId,
|
|
9270
9274
|
allowTabSynchronization: this.allowTabSynchronization,
|
|
@@ -9277,7 +9281,7 @@ var Qo = "Failed to obtain exclusive access to the persistence layer. To allow s
|
|
|
9277
9281
|
/** Checks the primary lease and removes it if we are the current primary. */ t.prototype.Rs = function(t) {
|
|
9278
9282
|
var e = this, n = Ho(t);
|
|
9279
9283
|
return n.get("owner").next((function(t) {
|
|
9280
|
-
return e.
|
|
9284
|
+
return e.bs(t) ? (U("IndexedDbPersistence", "Releasing primary lease."), n.delete("owner")) : mi.resolve();
|
|
9281
9285
|
}));
|
|
9282
9286
|
},
|
|
9283
9287
|
/** Verifies that `updateTimeMs` is within `maxAgeMs`. */ t.prototype.Ss = function(t, e) {
|
|
@@ -10344,12 +10348,12 @@ function du(t, e, n) {
|
|
|
10344
10348
|
* Clears all references with a given ID. Calls removeRef() for each key
|
|
10345
10349
|
* removed.
|
|
10346
10350
|
*/
|
|
10347
|
-
t.prototype.
|
|
10351
|
+
t.prototype.Pi = function(t) {
|
|
10348
10352
|
var e = this, n = new Pt(new gt([])), r = new wu(n, t), i = new wu(n, t + 1), o = [];
|
|
10349
10353
|
return this.Ii.forEachInRange([ r, i ], (function(t) {
|
|
10350
10354
|
e.Ai(t), o.push(t.key);
|
|
10351
10355
|
})), o;
|
|
10352
|
-
}, t.prototype.
|
|
10356
|
+
}, t.prototype.bi = function() {
|
|
10353
10357
|
var t = this;
|
|
10354
10358
|
this.yi.forEach((function(e) {
|
|
10355
10359
|
return t.Ai(e);
|
|
@@ -10640,7 +10644,7 @@ function du(t, e, n) {
|
|
|
10640
10644
|
}, t.prototype.updateTargetData = function(t, e) {
|
|
10641
10645
|
return this.Tn(e), mi.resolve();
|
|
10642
10646
|
}, t.prototype.removeTargetData = function(t, e) {
|
|
10643
|
-
return this.Fi.delete(e.target), this.Bi.
|
|
10647
|
+
return this.Fi.delete(e.target), this.Bi.Pi(e.targetId), this.targetCount -= 1,
|
|
10644
10648
|
mi.resolve();
|
|
10645
10649
|
}, t.prototype.removeTargets = function(t, e, n) {
|
|
10646
10650
|
var r = this, i = 0, o = [];
|
|
@@ -10664,7 +10668,7 @@ function du(t, e, n) {
|
|
|
10664
10668
|
i.push(r.markPotentiallyOrphaned(t, e));
|
|
10665
10669
|
})), mi.waitFor(i);
|
|
10666
10670
|
}, t.prototype.removeMatchingKeysForTargetId = function(t, e) {
|
|
10667
|
-
return this.Bi.
|
|
10671
|
+
return this.Bi.Pi(e), mi.resolve();
|
|
10668
10672
|
}, t.prototype.getMatchingKeysForTargetId = function(t, e) {
|
|
10669
10673
|
var n = this.Bi.Vi(e);
|
|
10670
10674
|
return mi.resolve(n);
|
|
@@ -10766,7 +10770,7 @@ function du(t, e, n) {
|
|
|
10766
10770
|
return this.Hi.add(e.toString()), mi.resolve();
|
|
10767
10771
|
}, t.prototype.removeTarget = function(t, e) {
|
|
10768
10772
|
var n = this;
|
|
10769
|
-
this.ji.
|
|
10773
|
+
this.ji.Pi(e.targetId).forEach((function(t) {
|
|
10770
10774
|
return n.Hi.add(t.toString());
|
|
10771
10775
|
}));
|
|
10772
10776
|
var r = this.persistence.getTargetCache();
|
|
@@ -11098,8 +11102,8 @@ var Cu = /** @class */ function() {
|
|
|
11098
11102
|
return r(this, (function(r) {
|
|
11099
11103
|
switch (r.label) {
|
|
11100
11104
|
case 0:
|
|
11101
|
-
return this.started ? null === i.key ? [ 3 /*break*/ , 7 ] : this.cr.test(i.key) ? null == i.newValue ? (t = this.
|
|
11102
|
-
[ 2 /*return*/ , this.
|
|
11105
|
+
return this.started ? null === i.key ? [ 3 /*break*/ , 7 ] : this.cr.test(i.key) ? null == i.newValue ? (t = this.Pr(i.key),
|
|
11106
|
+
[ 2 /*return*/ , this.br(t, null) ]) : (e = this.Vr(i.key, i.newValue)) ? [ 2 /*return*/ , this.br(e.clientId, e) ] : [ 3 /*break*/ , 7 ] : [ 3 /*break*/ , 1 ] : [ 3 /*break*/ , 8 ];
|
|
11103
11107
|
|
|
11104
11108
|
case 1:
|
|
11105
11109
|
return this.hr.test(i.key) ? null !== i.newValue && (n = this.vr(i.key, i.newValue)) ? [ 2 /*return*/ , this.Sr(n) ] : [ 3 /*break*/ , 7 ] : [ 3 /*break*/ , 2 ];
|
|
@@ -11174,7 +11178,7 @@ var Cu = /** @class */ function() {
|
|
|
11174
11178
|
* Parses a client state key in WebStorage. Returns null if the key does not
|
|
11175
11179
|
* match the expected key format.
|
|
11176
11180
|
*/
|
|
11177
|
-
t.prototype.
|
|
11181
|
+
t.prototype.Pr = function(t) {
|
|
11178
11182
|
var e = this.cr.exec(t);
|
|
11179
11183
|
return e ? e[1] : null;
|
|
11180
11184
|
},
|
|
@@ -11183,7 +11187,7 @@ var Cu = /** @class */ function() {
|
|
|
11183
11187
|
* be parsed.
|
|
11184
11188
|
*/
|
|
11185
11189
|
t.prototype.Vr = function(t, e) {
|
|
11186
|
-
var n = this.
|
|
11190
|
+
var n = this.Pr(t);
|
|
11187
11191
|
return Mu.Yi(n, e);
|
|
11188
11192
|
},
|
|
11189
11193
|
/**
|
|
@@ -11219,7 +11223,7 @@ var Cu = /** @class */ function() {
|
|
|
11219
11223
|
}));
|
|
11220
11224
|
}, t.prototype.Cr = function(t) {
|
|
11221
11225
|
return this.syncEngine.Or(t.targetId, t.state, t.error);
|
|
11222
|
-
}, t.prototype.
|
|
11226
|
+
}, t.prototype.br = function(t, e) {
|
|
11223
11227
|
var n = this, r = e ? this.ir.insert(t, e) : this.ir.remove(t), i = this.yr(this.ir), o = this.yr(r), u = [], s = [];
|
|
11224
11228
|
return o.forEach((function(t) {
|
|
11225
11229
|
i.has(t) || u.push(t);
|
|
@@ -11713,7 +11717,7 @@ function Ku() {
|
|
|
11713
11717
|
}, t;
|
|
11714
11718
|
}(), Qu = /** @class */ function() {
|
|
11715
11719
|
function t(t, e, n, r, i, o, u, s) {
|
|
11716
|
-
this.Yn = t, this.Ro = n, this.
|
|
11720
|
+
this.Yn = t, this.Ro = n, this.Po = r, this.bo = i, this.authCredentialsProvider = o,
|
|
11717
11721
|
this.appCheckCredentialsProvider = u, this.listener = s, this.state = 0 /* Initial */ ,
|
|
11718
11722
|
/**
|
|
11719
11723
|
* A close count that's incremented every time the stream is closed; used by
|
|
@@ -11896,7 +11900,7 @@ function Ku() {
|
|
|
11896
11900
|
var n = this, r = this.Uo(this.Vo);
|
|
11897
11901
|
this.stream = this.Go(t, e), this.stream.Hr((function() {
|
|
11898
11902
|
r((function() {
|
|
11899
|
-
return n.state = 2 /* Open */ , n.So = n.Yn.enqueueAfterDelay(n.
|
|
11903
|
+
return n.state = 2 /* Open */ , n.So = n.Yn.enqueueAfterDelay(n.Po, 1e4, (function() {
|
|
11900
11904
|
return n.xo() && (n.state = 3 /* Healthy */), Promise.resolve();
|
|
11901
11905
|
})), n.listener.Hr();
|
|
11902
11906
|
}));
|
|
@@ -11949,7 +11953,7 @@ function Ku() {
|
|
|
11949
11953
|
s;
|
|
11950
11954
|
}
|
|
11951
11955
|
return t(n, e), n.prototype.Go = function(t, e) {
|
|
11952
|
-
return this.
|
|
11956
|
+
return this.bo.lo("Listen", t, e);
|
|
11953
11957
|
}, n.prototype.onMessage = function(t) {
|
|
11954
11958
|
// A successful response means the stream is healthy
|
|
11955
11959
|
this.Do.reset();
|
|
@@ -12083,7 +12087,7 @@ function Ku() {
|
|
|
12083
12087
|
}, n.prototype.Lo = function() {
|
|
12084
12088
|
this.zo && this.Jo([]);
|
|
12085
12089
|
}, n.prototype.Go = function(t, e) {
|
|
12086
|
-
return this.
|
|
12090
|
+
return this.bo.lo("Write", t, e);
|
|
12087
12091
|
}, n.prototype.onMessage = function(t) {
|
|
12088
12092
|
if (
|
|
12089
12093
|
// Always capture the last stream token.
|
|
@@ -12137,7 +12141,7 @@ function Ku() {
|
|
|
12137
12141
|
function n(t, n, r, i) {
|
|
12138
12142
|
var o = this;
|
|
12139
12143
|
return (o = e.call(this) || this).authCredentials = t, o.appCheckCredentials = n,
|
|
12140
|
-
o.
|
|
12144
|
+
o.bo = r, o.M = i, o.tu = !1, o;
|
|
12141
12145
|
}
|
|
12142
12146
|
return t(n, e), n.prototype.eu = function() {
|
|
12143
12147
|
if (this.tu) throw new Y(H.FAILED_PRECONDITION, "The client has already been terminated.");
|
|
@@ -12146,7 +12150,7 @@ function Ku() {
|
|
|
12146
12150
|
var r = this;
|
|
12147
12151
|
return this.eu(), Promise.all([ this.authCredentials.getToken(), this.appCheckCredentials.getToken() ]).then((function(i) {
|
|
12148
12152
|
var o = i[0], u = i[1];
|
|
12149
|
-
return r.
|
|
12153
|
+
return r.bo.oo(t, e, n, o, u);
|
|
12150
12154
|
})).catch((function(t) {
|
|
12151
12155
|
throw "FirebaseError" === t.name ? (t.code === H.UNAUTHENTICATED && (r.authCredentials.invalidateToken(),
|
|
12152
12156
|
r.appCheckCredentials.invalidateToken()), t) : new Y(H.UNKNOWN, t.toString());
|
|
@@ -12156,7 +12160,7 @@ function Ku() {
|
|
|
12156
12160
|
var r = this;
|
|
12157
12161
|
return this.eu(), Promise.all([ this.authCredentials.getToken(), this.appCheckCredentials.getToken() ]).then((function(i) {
|
|
12158
12162
|
var o = i[0], u = i[1];
|
|
12159
|
-
return r.
|
|
12163
|
+
return r.bo.ho(t, e, n, o, u);
|
|
12160
12164
|
})).catch((function(t) {
|
|
12161
12165
|
throw "FirebaseError" === t.name ? (t.code === H.UNAUTHENTICATED && (r.authCredentials.invalidateToken(),
|
|
12162
12166
|
r.appCheckCredentials.invalidateToken()), t) : new Y(H.UNKNOWN, t.toString());
|
|
@@ -12920,7 +12924,7 @@ function bs(t, e) {
|
|
|
12920
12924
|
// Create stream (but note that it is not started yet).
|
|
12921
12925
|
t.gu = function(t, e, n) {
|
|
12922
12926
|
var r = W(t);
|
|
12923
|
-
return r.eu(), new Wu(e, r.
|
|
12927
|
+
return r.eu(), new Wu(e, r.bo, r.authCredentials, r.appCheckCredentials, r.M, n);
|
|
12924
12928
|
}(t.datastore, t.asyncQueue, {
|
|
12925
12929
|
Hr: as.bind(null, t),
|
|
12926
12930
|
Yr: cs.bind(null, t),
|
|
@@ -12960,7 +12964,7 @@ function Es(t) {
|
|
|
12960
12964
|
// Create stream (but note that it is not started yet).
|
|
12961
12965
|
t.yu = function(t, e, n) {
|
|
12962
12966
|
var r = W(t);
|
|
12963
|
-
return r.eu(), new Hu(e, r.
|
|
12967
|
+
return r.eu(), new Hu(e, r.bo, r.authCredentials, r.appCheckCredentials, r.M, n);
|
|
12964
12968
|
}(t.datastore, t.asyncQueue, {
|
|
12965
12969
|
Hr: vs.bind(null, t),
|
|
12966
12970
|
Yr: ws.bind(null, t),
|
|
@@ -13356,12 +13360,12 @@ function Ls(t) {
|
|
|
13356
13360
|
* It uses an Observer to dispatch events.
|
|
13357
13361
|
*/ var Ps = /** @class */ function() {
|
|
13358
13362
|
function t(t, e, n) {
|
|
13359
|
-
this.query = t, this.
|
|
13363
|
+
this.query = t, this.Pu = e,
|
|
13360
13364
|
/**
|
|
13361
13365
|
* Initial snapshots (e.g. from cache) may not be propagated to the wrapped
|
|
13362
13366
|
* observer. This flag is set to true once we've actually raised an event.
|
|
13363
13367
|
*/
|
|
13364
|
-
this.
|
|
13368
|
+
this.bu = !1, this.Vu = null, this.onlineState = "Unknown" /* Unknown */ , this.options = n || {}
|
|
13365
13369
|
/**
|
|
13366
13370
|
* Applies the new ViewSnapshot to this listener, raising a user-facing event
|
|
13367
13371
|
* if applicable (depending on what changed, whether the user has opted into
|
|
@@ -13381,15 +13385,15 @@ function Ls(t) {
|
|
|
13381
13385
|
/* excludesMetadataChanges= */ !0);
|
|
13382
13386
|
}
|
|
13383
13387
|
var o = !1;
|
|
13384
|
-
return this.
|
|
13388
|
+
return this.bu ? this.vu(t) && (this.Pu.next(t), o = !0) : this.Su(t, this.onlineState) && (this.Du(t),
|
|
13385
13389
|
o = !0), this.Vu = t, o;
|
|
13386
13390
|
}, t.prototype.onError = function(t) {
|
|
13387
|
-
this.
|
|
13391
|
+
this.Pu.error(t);
|
|
13388
13392
|
},
|
|
13389
13393
|
/** Returns whether a snapshot was raised. */ t.prototype.Au = function(t) {
|
|
13390
13394
|
this.onlineState = t;
|
|
13391
13395
|
var e = !1;
|
|
13392
|
-
return this.Vu && !this.
|
|
13396
|
+
return this.Vu && !this.bu && this.Su(this.Vu, t) && (this.Du(this.Vu), e = !0),
|
|
13393
13397
|
e;
|
|
13394
13398
|
}, t.prototype.Su = function(t, e) {
|
|
13395
13399
|
// Always raise the first event when we're synced
|
|
@@ -13413,8 +13417,8 @@ function Ls(t) {
|
|
|
13413
13417
|
// to get here if there were only metadata docChanges and they got
|
|
13414
13418
|
// stripped out.
|
|
13415
13419
|
}, t.prototype.Du = function(t) {
|
|
13416
|
-
t = As.fromInitialDocuments(t.query, t.docs, t.mutatedKeys, t.fromCache), this.
|
|
13417
|
-
this.
|
|
13420
|
+
t = As.fromInitialDocuments(t.query, t.docs, t.mutatedKeys, t.fromCache), this.bu = !0,
|
|
13421
|
+
this.Pu.next(t);
|
|
13418
13422
|
}, t;
|
|
13419
13423
|
}(), Os = /** @class */ function() {
|
|
13420
13424
|
function t(t,
|
|
@@ -14354,7 +14358,7 @@ function oa(t, e, n) {
|
|
|
14354
14358
|
var o = i[r];
|
|
14355
14359
|
t.ea.delete(o), n && t.ta.fa(o, n);
|
|
14356
14360
|
}
|
|
14357
|
-
t.na.delete(e), t.isPrimaryClient && t.oa.
|
|
14361
|
+
t.na.delete(e), t.isPrimaryClient && t.oa.Pi(e).forEach((function(e) {
|
|
14358
14362
|
t.oa.containsKey(e) ||
|
|
14359
14363
|
// We removed the last reference for this key
|
|
14360
14364
|
ua(t, e);
|
|
@@ -14647,7 +14651,7 @@ function va(t, e) {
|
|
|
14647
14651
|
var e = W(t);
|
|
14648
14652
|
e.ra.forEach((function(t, n) {
|
|
14649
14653
|
es(e.remoteStore, n);
|
|
14650
|
-
})), e.oa.
|
|
14654
|
+
})), e.oa.bi(), e.ra = new Map, e.ia = new Bn(Pt.comparator);
|
|
14651
14655
|
}(n), n.ha = !1, [ 4 /*yield*/ , Is(n.remoteStore, !1) ];
|
|
14652
14656
|
|
|
14653
14657
|
case 6:
|
|
@@ -15383,8 +15387,8 @@ function xa(t, e) {
|
|
|
15383
15387
|
|
|
15384
15388
|
case 1:
|
|
15385
15389
|
return null === (t = r.sent()) ? [ 2 /*return*/ , null ] : (e = this.Ea.decode(t),
|
|
15386
|
-
n = Number(e), isNaN(n) && this.
|
|
15387
|
-
[ 4 /*yield*/ , this.
|
|
15390
|
+
n = Number(e), isNaN(n) && this.Pa("length string (" + e + ") is not valid number"),
|
|
15391
|
+
[ 4 /*yield*/ , this.ba(n) ]);
|
|
15388
15392
|
|
|
15389
15393
|
case 2:
|
|
15390
15394
|
return i = r.sent(), [ 2 /*return*/ , new Os(JSON.parse(i), t.length + n) ];
|
|
@@ -15424,7 +15428,7 @@ function xa(t, e) {
|
|
|
15424
15428
|
return 0 === this.buffer.length ? [ 2 /*return*/ , null ] : (
|
|
15425
15429
|
// Broke out of the loop because underlying stream is closed, but still
|
|
15426
15430
|
// cannot find an open bracket.
|
|
15427
|
-
(t = this.Va()) < 0 && this.
|
|
15431
|
+
(t = this.Va()) < 0 && this.Pa("Reached the end of bundle when a length string is expected."),
|
|
15428
15432
|
e = this.buffer.slice(0, t), [ 2 /*return*/ , (this.buffer = this.buffer.slice(t),
|
|
15429
15433
|
e) ]);
|
|
15430
15434
|
}
|
|
@@ -15437,7 +15441,7 @@ function xa(t, e) {
|
|
|
15437
15441
|
*
|
|
15438
15442
|
* Returns a string decoded from the read bytes.
|
|
15439
15443
|
*/
|
|
15440
|
-
t.prototype.
|
|
15444
|
+
t.prototype.ba = function(t) {
|
|
15441
15445
|
return n(this, void 0, void 0, (function() {
|
|
15442
15446
|
var e;
|
|
15443
15447
|
return r(this, (function(n) {
|
|
@@ -15446,7 +15450,7 @@ function xa(t, e) {
|
|
|
15446
15450
|
return this.buffer.length < t ? [ 4 /*yield*/ , this.va() ] : [ 3 /*break*/ , 3 ];
|
|
15447
15451
|
|
|
15448
15452
|
case 1:
|
|
15449
|
-
n.sent() && this.
|
|
15453
|
+
n.sent() && this.Pa("Reached the end of bundle when more is expected."), n.label = 2;
|
|
15450
15454
|
|
|
15451
15455
|
case 2:
|
|
15452
15456
|
return [ 3 /*break*/ , 0 ];
|
|
@@ -15458,7 +15462,7 @@ function xa(t, e) {
|
|
|
15458
15462
|
}
|
|
15459
15463
|
}));
|
|
15460
15464
|
}));
|
|
15461
|
-
}, t.prototype.
|
|
15465
|
+
}, t.prototype.Pa = function(t) {
|
|
15462
15466
|
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
15463
15467
|
throw this.Ta.cancel(), new Error("Invalid bundle format: " + t);
|
|
15464
15468
|
},
|
|
@@ -19656,9 +19660,9 @@ function dh(t, e) {
|
|
|
19656
19660
|
return n = Object.assign({
|
|
19657
19661
|
useFetchStreams: rh
|
|
19658
19662
|
}, n), i._setSettings(n), i;
|
|
19659
|
-
}), "PUBLIC")), u(R, "3.4.
|
|
19663
|
+
}), "PUBLIC")), u(R, "3.4.8", void 0),
|
|
19660
19664
|
// BUILD_TARGET will be replaced by values like esm5, esm2017, cjs5, etc during the compilation
|
|
19661
|
-
u(R, "3.4.
|
|
19665
|
+
u(R, "3.4.8", "esm5");
|
|
19662
19666
|
|
|
19663
19667
|
export { Ol as AbstractUserDataWriter, Vc as Bytes, pc as CACHE_SIZE_UNLIMITED, oc as CollectionReference, rc as DocumentReference, fl as DocumentSnapshot, kc as FieldPath, Rc as FieldValue, yc as Firestore, Y as FirestoreError, Lc as GeoPoint, dc as LoadBundleTask, ic as Query, gl as QueryConstraint, dl as QueryDocumentSnapshot, pl as QuerySnapshot, hl as SnapshotMetadata, ft as Timestamp, ih as Transaction, Ul as WriteBatch, Mt as _DatabaseId, Pt as _DocumentKey, ot as _EmptyAppCheckTokenProvider, $ as _EmptyAuthCredentialsProvider, bt as _FieldPath, $a as _cast, Q as _debugAssert, Tt as _isBase64Available, K as _logWarn, fh as _setIndexConfiguration, Ha as _validateIsNotUsedTogether, $l as addDoc, ch as arrayRemove, ah as arrayUnion, Ec as clearIndexedDbPersistence, uc as collection, sc as collectionGroup, nc as connectFirestoreEmulator, Jl as deleteDoc, uh as deleteField, Dc as disableNetwork, ac as doc, Mc as documentId, bc as enableIndexedDbPersistence, Ic as enableMultiTabIndexedDbPersistence, _c as enableNetwork, Ml as endAt, kl as endBefore, gc as ensureFirestoreConfigured, eh as executeWrite, Kl as getDoc, jl as getDocFromCache, zl as getDocFromServer, Ql as getDocs, Wl as getDocsFromCache, Hl as getDocsFromServer, mc as getFirestore, lh as increment, vc as initializeFirestore, _l as limit, Dl as limitToLast, Ac as loadBundle, xc as namedQuery, Zl as onSnapshot, th as onSnapshotsInSync, El as orderBy, wl as query, lc as queryEqual, cc as refEqual, oh as runTransaction, sh as serverTimestamp, Yl as setDoc, q as setLogLevel, vl as snapshotEqual, xl as startAfter, Al as startAt, Nc as terminate, Xl as updateDoc, Sc as waitForPendingWrites, Il as where, hh as writeBatch };
|
|
19664
19668
|
//# sourceMappingURL=index.esm5.js.map
|