@firebase/firestore 4.7.1-canary.16d62d4fa → 4.7.1-canary.ca4dbcf3f
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/dist/index.cjs.js +84 -84
- package/dist/index.esm2017.js +84 -84
- package/dist/index.esm5.js +79 -79
- package/dist/index.node.cjs.js +2 -2
- package/dist/index.node.mjs +2 -2
- package/dist/index.rn.js +92 -92
- package/dist/lite/index.browser.esm2017.js +2 -2
- package/dist/lite/index.browser.esm5.js +2 -2
- package/dist/lite/index.cjs.js +2 -2
- package/dist/lite/index.node.cjs.js +2 -2
- package/dist/lite/index.node.mjs +2 -2
- package/dist/lite/index.rn.esm2017.js +2 -2
- package/dist/packages/firestore/dist/index.esm2017.d.ts +9 -9
- package/package.json +9 -9
package/dist/index.esm2017.js
CHANGED
|
@@ -67,7 +67,7 @@ User.MOCK_USER = new User("mock-user");
|
|
|
67
67
|
* See the License for the specific language governing permissions and
|
|
68
68
|
* limitations under the License.
|
|
69
69
|
*/
|
|
70
|
-
let b = "10.13.1-canary.
|
|
70
|
+
let b = "10.13.1-canary.ca4dbcf3f";
|
|
71
71
|
|
|
72
72
|
/**
|
|
73
73
|
* @license
|
|
@@ -5891,7 +5891,7 @@ class BloomFilter {
|
|
|
5891
5891
|
}
|
|
5892
5892
|
// Calculate the ith hash value based on the hashed 64bit integers,
|
|
5893
5893
|
// and calculate its corresponding bit index in the bitmap to be checked.
|
|
5894
|
-
|
|
5894
|
+
Ee(e, t, n) {
|
|
5895
5895
|
// Calculate hashed value h(i) = h1 + (i * h2).
|
|
5896
5896
|
let r = e.add(t.multiply(Integer.fromNumber(n)));
|
|
5897
5897
|
// Wrap if hash value overflow 64bit.
|
|
@@ -5899,7 +5899,7 @@ class BloomFilter {
|
|
|
5899
5899
|
r.modulo(this.Te).toNumber();
|
|
5900
5900
|
}
|
|
5901
5901
|
// Return whether the bit on the given index in the bitmap is set to 1.
|
|
5902
|
-
|
|
5902
|
+
de(e) {
|
|
5903
5903
|
return 0 != (this.bitmap[Math.floor(e / 8)] & 1 << e % 8);
|
|
5904
5904
|
}
|
|
5905
5905
|
mightContain(e) {
|
|
@@ -5907,8 +5907,8 @@ class BloomFilter {
|
|
|
5907
5907
|
if (0 === this.Ie) return !1;
|
|
5908
5908
|
const t = __PRIVATE_getMd5HashValue(e), [n, r] = __PRIVATE_get64BitUints(t);
|
|
5909
5909
|
for (let e = 0; e < this.hashCount; e++) {
|
|
5910
|
-
const t = this.
|
|
5911
|
-
if (!this.
|
|
5910
|
+
const t = this.Ee(n, r, e);
|
|
5911
|
+
if (!this.de(t)) return !1;
|
|
5912
5912
|
}
|
|
5913
5913
|
return !0;
|
|
5914
5914
|
}
|
|
@@ -5920,7 +5920,7 @@ class BloomFilter {
|
|
|
5920
5920
|
if (0 === this.Ie) return;
|
|
5921
5921
|
const t = __PRIVATE_getMd5HashValue(e), [n, r] = __PRIVATE_get64BitUints(t);
|
|
5922
5922
|
for (let e = 0; e < this.hashCount; e++) {
|
|
5923
|
-
const t = this.
|
|
5923
|
+
const t = this.Ee(n, r, e);
|
|
5924
5924
|
this.Ae(t);
|
|
5925
5925
|
}
|
|
5926
5926
|
}
|
|
@@ -6529,13 +6529,13 @@ function __PRIVATE_snapshotChangesMap() {
|
|
|
6529
6529
|
return new SortedMap(DocumentKey.comparator);
|
|
6530
6530
|
}
|
|
6531
6531
|
|
|
6532
|
-
const
|
|
6532
|
+
const Ee = (() => {
|
|
6533
6533
|
const e = {
|
|
6534
6534
|
asc: "ASCENDING",
|
|
6535
6535
|
desc: "DESCENDING"
|
|
6536
6536
|
};
|
|
6537
6537
|
return e;
|
|
6538
|
-
})(),
|
|
6538
|
+
})(), de = (() => {
|
|
6539
6539
|
const e = {
|
|
6540
6540
|
"<": "LESS_THAN",
|
|
6541
6541
|
"<=": "LESS_THAN_OR_EQUAL",
|
|
@@ -7121,11 +7121,11 @@ function __PRIVATE_fromFilter(e) {
|
|
|
7121
7121
|
}
|
|
7122
7122
|
|
|
7123
7123
|
function __PRIVATE_toDirection(e) {
|
|
7124
|
-
return
|
|
7124
|
+
return Ee[e];
|
|
7125
7125
|
}
|
|
7126
7126
|
|
|
7127
7127
|
function __PRIVATE_toOperatorName(e) {
|
|
7128
|
-
return
|
|
7128
|
+
return de[e];
|
|
7129
7129
|
}
|
|
7130
7130
|
|
|
7131
7131
|
function __PRIVATE_toCompositeOperatorName(e) {
|
|
@@ -7710,59 +7710,59 @@ class __PRIVATE_FirestoreIndexValueWriter {
|
|
|
7710
7710
|
this.Tt(e, t),
|
|
7711
7711
|
// Write separator to split index values
|
|
7712
7712
|
// (see go/firestore-storage-format#encodings).
|
|
7713
|
-
t.
|
|
7713
|
+
t.Et();
|
|
7714
7714
|
}
|
|
7715
7715
|
Tt(e, t) {
|
|
7716
|
-
if ("nullValue" in e) this.
|
|
7717
|
-
t.At(e.booleanValue ? 1 : 0); else if ("integerValue" in e) this.
|
|
7716
|
+
if ("nullValue" in e) this.dt(t, 5); else if ("booleanValue" in e) this.dt(t, 10),
|
|
7717
|
+
t.At(e.booleanValue ? 1 : 0); else if ("integerValue" in e) this.dt(t, 15), t.At(__PRIVATE_normalizeNumber(e.integerValue)); else if ("doubleValue" in e) {
|
|
7718
7718
|
const n = __PRIVATE_normalizeNumber(e.doubleValue);
|
|
7719
|
-
isNaN(n) ? this.
|
|
7719
|
+
isNaN(n) ? this.dt(t, 13) : (this.dt(t, 15), __PRIVATE_isNegativeZero(n) ?
|
|
7720
7720
|
// -0.0, 0 and 0.0 are all considered the same
|
|
7721
7721
|
t.At(0) : t.At(n));
|
|
7722
7722
|
} else if ("timestampValue" in e) {
|
|
7723
7723
|
let n = e.timestampValue;
|
|
7724
|
-
this.
|
|
7724
|
+
this.dt(t, 20), "string" == typeof n && (n = __PRIVATE_normalizeTimestamp(n)), t.Rt(`${n.seconds || ""}`),
|
|
7725
7725
|
t.At(n.nanos || 0);
|
|
7726
|
-
} else if ("stringValue" in e) this.Vt(e.stringValue, t), this.ft(t); else if ("bytesValue" in e) this.
|
|
7726
|
+
} else if ("stringValue" in e) this.Vt(e.stringValue, t), this.ft(t); else if ("bytesValue" in e) this.dt(t, 30),
|
|
7727
7727
|
t.gt(__PRIVATE_normalizeByteString(e.bytesValue)), this.ft(t); else if ("referenceValue" in e) this.yt(e.referenceValue, t); else if ("geoPointValue" in e) {
|
|
7728
7728
|
const n = e.geoPointValue;
|
|
7729
|
-
this.
|
|
7730
|
-
} else "mapValue" in e ? __PRIVATE_isMaxValue(e) ? this.
|
|
7729
|
+
this.dt(t, 45), t.At(n.latitude || 0), t.At(n.longitude || 0);
|
|
7730
|
+
} else "mapValue" in e ? __PRIVATE_isMaxValue(e) ? this.dt(t, Number.MAX_SAFE_INTEGER) : __PRIVATE_isVectorValue(e) ? this.wt(e.mapValue, t) : (this.St(e.mapValue, t),
|
|
7731
7731
|
this.ft(t)) : "arrayValue" in e ? (this.bt(e.arrayValue, t), this.ft(t)) : fail();
|
|
7732
7732
|
}
|
|
7733
7733
|
Vt(e, t) {
|
|
7734
|
-
this.
|
|
7734
|
+
this.dt(t, 25), this.Dt(e, t);
|
|
7735
7735
|
}
|
|
7736
7736
|
Dt(e, t) {
|
|
7737
7737
|
t.Rt(e);
|
|
7738
7738
|
}
|
|
7739
7739
|
St(e, t) {
|
|
7740
7740
|
const n = e.fields || {};
|
|
7741
|
-
this.
|
|
7741
|
+
this.dt(t, 55);
|
|
7742
7742
|
for (const e of Object.keys(n)) this.Vt(e, t), this.Tt(n[e], t);
|
|
7743
7743
|
}
|
|
7744
7744
|
wt(e, t) {
|
|
7745
7745
|
var n, r;
|
|
7746
7746
|
const i = e.fields || {};
|
|
7747
|
-
this.
|
|
7747
|
+
this.dt(t, 53);
|
|
7748
7748
|
// Vectors sort first by length
|
|
7749
7749
|
const s = "value", o = (null === (r = null === (n = i[s].arrayValue) || void 0 === n ? void 0 : n.values) || void 0 === r ? void 0 : r.length) || 0;
|
|
7750
|
-
this.
|
|
7750
|
+
this.dt(t, 15), t.At(__PRIVATE_normalizeNumber(o)),
|
|
7751
7751
|
// Vectors then sort by position value
|
|
7752
7752
|
this.Vt(s, t), this.Tt(i[s], t);
|
|
7753
7753
|
}
|
|
7754
7754
|
bt(e, t) {
|
|
7755
7755
|
const n = e.values || [];
|
|
7756
|
-
this.
|
|
7756
|
+
this.dt(t, 50);
|
|
7757
7757
|
for (const e of n) this.Tt(e, t);
|
|
7758
7758
|
}
|
|
7759
7759
|
yt(e, t) {
|
|
7760
|
-
this.
|
|
7760
|
+
this.dt(t, 37);
|
|
7761
7761
|
DocumentKey.fromName(e).path.forEach((e => {
|
|
7762
|
-
this.
|
|
7762
|
+
this.dt(t, 60), this.Dt(e, t);
|
|
7763
7763
|
}));
|
|
7764
7764
|
}
|
|
7765
|
-
|
|
7765
|
+
dt(e, t) {
|
|
7766
7766
|
e.At(t);
|
|
7767
7767
|
}
|
|
7768
7768
|
ft(e) {
|
|
@@ -7962,7 +7962,7 @@ class __PRIVATE_AscendingIndexByteEncoder {
|
|
|
7962
7962
|
At(e) {
|
|
7963
7963
|
this.jt.kt(e);
|
|
7964
7964
|
}
|
|
7965
|
-
|
|
7965
|
+
Et() {
|
|
7966
7966
|
this.jt.$t();
|
|
7967
7967
|
}
|
|
7968
7968
|
}
|
|
@@ -7980,7 +7980,7 @@ class __PRIVATE_DescendingIndexByteEncoder {
|
|
|
7980
7980
|
At(e) {
|
|
7981
7981
|
this.jt.Kt(e);
|
|
7982
7982
|
}
|
|
7983
|
-
|
|
7983
|
+
Et() {
|
|
7984
7984
|
this.jt.Wt();
|
|
7985
7985
|
}
|
|
7986
7986
|
}
|
|
@@ -8678,7 +8678,7 @@ class __PRIVATE_IndexedDbIndexManager {
|
|
|
8678
8678
|
n.push(t.value), r && (r = t.inclusive);
|
|
8679
8679
|
}
|
|
8680
8680
|
return new Bound(n, r);
|
|
8681
|
-
}(s, i), c = this.In(i, s, a), l = this.In(i, s, u), h = this.Tn(i, s, _), P = this.
|
|
8681
|
+
}(s, i), c = this.In(i, s, a), l = this.In(i, s, u), h = this.Tn(i, s, _), P = this.En(i.indexId, o, c, a.inclusive, l, u.inclusive, h);
|
|
8682
8682
|
return PersistencePromise.forEach(P, (i => n.G(i, t.limit).next((t => {
|
|
8683
8683
|
t.forEach((t => {
|
|
8684
8684
|
const n = DocumentKey.fromSegments(t.documentKey);
|
|
@@ -8701,14 +8701,14 @@ class __PRIVATE_IndexedDbIndexManager {
|
|
|
8701
8701
|
/**
|
|
8702
8702
|
* Constructs a key range query on `DbIndexEntryStore` that unions all
|
|
8703
8703
|
* bounds.
|
|
8704
|
-
*/
|
|
8704
|
+
*/ En(e, t, n, r, i, s, o) {
|
|
8705
8705
|
// The number of total index scans we union together. This is similar to a
|
|
8706
8706
|
// distributed normal form, but adapted for array values. We create a single
|
|
8707
8707
|
// index range per value in an ARRAY_CONTAINS or ARRAY_CONTAINS_ANY filter
|
|
8708
8708
|
// combined with the values from the query bounds.
|
|
8709
8709
|
const _ = (null != t ? t.length : 1) * Math.max(n.length, i.length), a = _ / (null != t ? t.length : 1), u = [];
|
|
8710
8710
|
for (let c = 0; c < _; ++c) {
|
|
8711
|
-
const _ = t ? this.
|
|
8711
|
+
const _ = t ? this.dn(t[c / a]) : Re, l = this.An(e, _, n[c % a], r), h = this.Rn(e, _, i[c % a], s), P = o.map((t => this.An(e, _, t,
|
|
8712
8712
|
/* inclusive= */ !0)));
|
|
8713
8713
|
u.push(...this.createRange(l, h, P));
|
|
8714
8714
|
}
|
|
@@ -8776,7 +8776,7 @@ class __PRIVATE_IndexedDbIndexManager {
|
|
|
8776
8776
|
}
|
|
8777
8777
|
return n.zt();
|
|
8778
8778
|
}
|
|
8779
|
-
/** Encodes a single value to the ascending index format. */
|
|
8779
|
+
/** Encodes a single value to the ascending index format. */ dn(e) {
|
|
8780
8780
|
const t = new __PRIVATE_IndexByteEncoder;
|
|
8781
8781
|
return __PRIVATE_FirestoreIndexValueWriter.vt.It(e, t.Yt(0 /* IndexKind.ASCENDING */)),
|
|
8782
8782
|
t.zt();
|
|
@@ -8904,7 +8904,7 @@ class __PRIVATE_IndexedDbIndexManager {
|
|
|
8904
8904
|
const i = __PRIVATE_fieldIndexGetArraySegment(t);
|
|
8905
8905
|
if (null != i) {
|
|
8906
8906
|
const s = e.data.field(i.fieldPath);
|
|
8907
|
-
if (isArray(s)) for (const i of s.arrayValue.values || []) n = n.add(new __PRIVATE_IndexEntry(t.indexId, e.key, this.
|
|
8907
|
+
if (isArray(s)) for (const i of s.arrayValue.values || []) n = n.add(new __PRIVATE_IndexEntry(t.indexId, e.key, this.dn(i), r));
|
|
8908
8908
|
} else n = n.add(new __PRIVATE_IndexEntry(t.indexId, e.key, Re, r));
|
|
8909
8909
|
return n;
|
|
8910
8910
|
}
|
|
@@ -10850,16 +10850,16 @@ class OverlayedDocument {
|
|
|
10850
10850
|
*/ class __PRIVATE_ReferenceSet {
|
|
10851
10851
|
constructor() {
|
|
10852
10852
|
// A set of outstanding references to a document sorted by key.
|
|
10853
|
-
this.Tr = new SortedSet(__PRIVATE_DocReference.
|
|
10853
|
+
this.Tr = new SortedSet(__PRIVATE_DocReference.Er),
|
|
10854
10854
|
// A set of outstanding references to a document sorted by target id.
|
|
10855
|
-
this.
|
|
10855
|
+
this.dr = new SortedSet(__PRIVATE_DocReference.Ar);
|
|
10856
10856
|
}
|
|
10857
10857
|
/** Returns true if the reference set contains no references. */ isEmpty() {
|
|
10858
10858
|
return this.Tr.isEmpty();
|
|
10859
10859
|
}
|
|
10860
10860
|
/** Adds a reference to the given document key for the given ID. */ addReference(e, t) {
|
|
10861
10861
|
const n = new __PRIVATE_DocReference(e, t);
|
|
10862
|
-
this.Tr = this.Tr.add(n), this.
|
|
10862
|
+
this.Tr = this.Tr.add(n), this.dr = this.dr.add(n);
|
|
10863
10863
|
}
|
|
10864
10864
|
/** Add references to the given document keys for the given ID. */ Rr(e, t) {
|
|
10865
10865
|
e.forEach((e => this.addReference(e, t)));
|
|
@@ -10878,7 +10878,7 @@ class OverlayedDocument {
|
|
|
10878
10878
|
* removed.
|
|
10879
10879
|
*/ gr(e) {
|
|
10880
10880
|
const t = new DocumentKey(new ResourcePath([])), n = new __PRIVATE_DocReference(t, e), r = new __PRIVATE_DocReference(t, e + 1), i = [];
|
|
10881
|
-
return this.
|
|
10881
|
+
return this.dr.forEachInRange([ n, r ], (e => {
|
|
10882
10882
|
this.Vr(e), i.push(e.key);
|
|
10883
10883
|
})), i;
|
|
10884
10884
|
}
|
|
@@ -10886,12 +10886,12 @@ class OverlayedDocument {
|
|
|
10886
10886
|
this.Tr.forEach((e => this.Vr(e)));
|
|
10887
10887
|
}
|
|
10888
10888
|
Vr(e) {
|
|
10889
|
-
this.Tr = this.Tr.delete(e), this.
|
|
10889
|
+
this.Tr = this.Tr.delete(e), this.dr = this.dr.delete(e);
|
|
10890
10890
|
}
|
|
10891
10891
|
yr(e) {
|
|
10892
10892
|
const t = new DocumentKey(new ResourcePath([])), n = new __PRIVATE_DocReference(t, e), r = new __PRIVATE_DocReference(t, e + 1);
|
|
10893
10893
|
let i = __PRIVATE_documentKeySet();
|
|
10894
|
-
return this.
|
|
10894
|
+
return this.dr.forEachInRange([ n, r ], (e => {
|
|
10895
10895
|
i = i.add(e.key);
|
|
10896
10896
|
})), i;
|
|
10897
10897
|
}
|
|
@@ -10905,7 +10905,7 @@ class __PRIVATE_DocReference {
|
|
|
10905
10905
|
constructor(e, t) {
|
|
10906
10906
|
this.key = e, this.wr = t;
|
|
10907
10907
|
}
|
|
10908
|
-
/** Compare by key then by ID */ static
|
|
10908
|
+
/** Compare by key then by ID */ static Er(e, t) {
|
|
10909
10909
|
return DocumentKey.comparator(e.key, t.key) || __PRIVATE_primitiveComparator(e.wr, t.wr);
|
|
10910
10910
|
}
|
|
10911
10911
|
/** Compare by ID then by key */ static Ar(e, t) {
|
|
@@ -10939,7 +10939,7 @@ class __PRIVATE_DocReference {
|
|
|
10939
10939
|
/** Next value to use when assigning sequential IDs to each mutation batch. */
|
|
10940
10940
|
this.Sr = 1,
|
|
10941
10941
|
/** An ordered mapping between documents and the mutations batch IDs. */
|
|
10942
|
-
this.br = new SortedSet(__PRIVATE_DocReference.
|
|
10942
|
+
this.br = new SortedSet(__PRIVATE_DocReference.Er);
|
|
10943
10943
|
}
|
|
10944
10944
|
checkEmpty(e) {
|
|
10945
10945
|
return PersistencePromise.resolve(0 === this.mutationQueue.length);
|
|
@@ -11915,9 +11915,9 @@ class __PRIVATE_IndexedDbPersistence {
|
|
|
11915
11915
|
/** The client metadata refresh task. */
|
|
11916
11916
|
this.Ti = null,
|
|
11917
11917
|
/** The last time we garbage collected the client metadata object store. */
|
|
11918
|
-
this.
|
|
11918
|
+
this.Ei = Number.NEGATIVE_INFINITY,
|
|
11919
11919
|
/** A listener to notify on primary state changes. */
|
|
11920
|
-
this.
|
|
11920
|
+
this.di = e => Promise.resolve(), !__PRIVATE_IndexedDbPersistence.D()) throw new FirestoreError(v.UNIMPLEMENTED, "This platform is either missing IndexedDB or is known to have an incomplete implementation. Offline persistence has been disabled.");
|
|
11921
11921
|
this.referenceDelegate = new __PRIVATE_IndexedDbLruDelegateImpl(this, r), this.Ai = t + "main",
|
|
11922
11922
|
this.serializer = new __PRIVATE_LocalSerializer(_), this.Ri = new __PRIVATE_SimpleDb(this.Ai, this.hi, new __PRIVATE_SchemaConverter(this.serializer)),
|
|
11923
11923
|
this.$r = new __PRIVATE_IndexedDbGlobalsCache, this.Ur = new __PRIVATE_IndexedDbTargetCache(this.referenceDelegate, this.serializer),
|
|
@@ -11952,7 +11952,7 @@ class __PRIVATE_IndexedDbPersistence {
|
|
|
11952
11952
|
*
|
|
11953
11953
|
* PORTING NOTE: This is only used for Web multi-tab.
|
|
11954
11954
|
*/ yi(e) {
|
|
11955
|
-
return this.
|
|
11955
|
+
return this.di = async t => {
|
|
11956
11956
|
if (this.started) return e(t);
|
|
11957
11957
|
}, e(this.isPrimary);
|
|
11958
11958
|
}
|
|
@@ -11993,7 +11993,7 @@ class __PRIVATE_IndexedDbPersistence {
|
|
|
11993
11993
|
inForeground: this.inForeground
|
|
11994
11994
|
}).next((() => {
|
|
11995
11995
|
if (this.isPrimary) return this.wi(e).next((e => {
|
|
11996
|
-
e || (this.isPrimary = !1, this.ui.enqueueRetryable((() => this.
|
|
11996
|
+
e || (this.isPrimary = !1, this.ui.enqueueRetryable((() => this.di(!1))));
|
|
11997
11997
|
}));
|
|
11998
11998
|
})).next((() => this.Si(e))).next((t => this.isPrimary && !t ? this.bi(e).next((() => !1)) : !!t && this.Di(e).next((() => !0)))))).catch((e => {
|
|
11999
11999
|
if (__PRIVATE_isIndexedDbTransactionError(e))
|
|
@@ -12005,7 +12005,7 @@ class __PRIVATE_IndexedDbPersistence {
|
|
|
12005
12005
|
return __PRIVATE_logDebug("IndexedDbPersistence", "Releasing owner lease after error during lease refresh", e),
|
|
12006
12006
|
/* isPrimary= */ !1;
|
|
12007
12007
|
})).then((e => {
|
|
12008
|
-
this.isPrimary !== e && this.ui.enqueueRetryable((() => this.
|
|
12008
|
+
this.isPrimary !== e && this.ui.enqueueRetryable((() => this.di(e))), this.isPrimary = e;
|
|
12009
12009
|
}));
|
|
12010
12010
|
}
|
|
12011
12011
|
wi(e) {
|
|
@@ -12019,8 +12019,8 @@ class __PRIVATE_IndexedDbPersistence {
|
|
|
12019
12019
|
* RemoteDocumentChanges and the ClientMetadata store based on the last update
|
|
12020
12020
|
* time of all clients.
|
|
12021
12021
|
*/ async Fi() {
|
|
12022
|
-
if (this.isPrimary && !this.Mi(this.
|
|
12023
|
-
this.
|
|
12022
|
+
if (this.isPrimary && !this.Mi(this.Ei, 18e5)) {
|
|
12023
|
+
this.Ei = Date.now();
|
|
12024
12024
|
const e = await this.runTransaction("maybeGarbageCollectMultiClientState", "readwrite-primary", (e => {
|
|
12025
12025
|
const t = __PRIVATE_getStore(e, "clientMetadata");
|
|
12026
12026
|
return t.U().next((e => {
|
|
@@ -12160,7 +12160,7 @@ class __PRIVATE_IndexedDbPersistence {
|
|
|
12160
12160
|
return this.Ri.runTransaction(e, r, i, (r => (s = new __PRIVATE_IndexedDbTransaction(r, this.Qr ? this.Qr.next() : __PRIVATE_ListenSequence.oe),
|
|
12161
12161
|
"readwrite-primary" === t ? this.wi(s).next((e => !!e || this.Si(s))).next((t => {
|
|
12162
12162
|
if (!t) throw __PRIVATE_logError(`Failed to obtain primary lease for action '${e}'.`),
|
|
12163
|
-
this.isPrimary = !1, this.ui.enqueueRetryable((() => this.
|
|
12163
|
+
this.isPrimary = !1, this.ui.enqueueRetryable((() => this.di(!1))), new FirestoreError(v.FAILED_PRECONDITION, F);
|
|
12164
12164
|
return n(s);
|
|
12165
12165
|
})).next((e => this.Di(s).next((() => e)))) : this.Ki(s).next((() => n(s)))))).then((e => (s.raiseOnCommittedEvent(),
|
|
12166
12166
|
e)));
|
|
@@ -13002,9 +13002,9 @@ async function __PRIVATE_localStoreApplyBundledDocuments(e, t, n, r) {
|
|
|
13002
13002
|
const i = __PRIVATE_debugCast(e);
|
|
13003
13003
|
let s = __PRIVATE_documentKeySet(), o = __PRIVATE_mutableDocumentMap();
|
|
13004
13004
|
for (const e of n) {
|
|
13005
|
-
const n = t.
|
|
13005
|
+
const n = t.Es(e.metadata.name);
|
|
13006
13006
|
e.document && (s = s.add(n));
|
|
13007
|
-
const r = t.
|
|
13007
|
+
const r = t.ds(e);
|
|
13008
13008
|
r.setReadTime(t.As(e.metadata.readTime)), o = o.insert(n, r);
|
|
13009
13009
|
}
|
|
13010
13010
|
const _ = i.cs.newChangeBuffer({
|
|
@@ -14413,7 +14413,7 @@ class __PRIVATE_PersistentStream {
|
|
|
14413
14413
|
})), this.stream.mo((e => {
|
|
14414
14414
|
n((() => this.I_(e)));
|
|
14415
14415
|
})), this.stream.onMessage((e => {
|
|
14416
|
-
n((() => 1 == ++this.e_ ? this.
|
|
14416
|
+
n((() => 1 == ++this.e_ ? this.E_(e) : this.onNext(e)));
|
|
14417
14417
|
}));
|
|
14418
14418
|
}
|
|
14419
14419
|
i_() {
|
|
@@ -14457,7 +14457,7 @@ class __PRIVATE_PersistentStream {
|
|
|
14457
14457
|
T_(e, t) {
|
|
14458
14458
|
return this.connection.Bo("Listen", e, t);
|
|
14459
14459
|
}
|
|
14460
|
-
|
|
14460
|
+
E_(e) {
|
|
14461
14461
|
return this.onNext(e);
|
|
14462
14462
|
}
|
|
14463
14463
|
onNext(e) {
|
|
@@ -14471,7 +14471,7 @@ class __PRIVATE_PersistentStream {
|
|
|
14471
14471
|
const t = e.targetChange;
|
|
14472
14472
|
return t.targetIds && t.targetIds.length ? SnapshotVersion.min() : t.readTime ? __PRIVATE_fromVersion(t.readTime) : SnapshotVersion.min();
|
|
14473
14473
|
}(e);
|
|
14474
|
-
return this.listener.
|
|
14474
|
+
return this.listener.d_(t, n);
|
|
14475
14475
|
}
|
|
14476
14476
|
/**
|
|
14477
14477
|
* Registers interest in the results of the given target. If the target
|
|
@@ -14551,7 +14551,7 @@ class __PRIVATE_PersistentStream {
|
|
|
14551
14551
|
T_(e, t) {
|
|
14552
14552
|
return this.connection.Bo("Write", e, t);
|
|
14553
14553
|
}
|
|
14554
|
-
|
|
14554
|
+
E_(e) {
|
|
14555
14555
|
// Always capture the last stream token.
|
|
14556
14556
|
return __PRIVATE_hardAssert(!!e.streamToken), this.lastStreamToken = e.streamToken,
|
|
14557
14557
|
// The first response is always the handshake response
|
|
@@ -15146,7 +15146,7 @@ async function __PRIVATE_remoteStoreHandleCredentialChange(e, t) {
|
|
|
15146
15146
|
Eo: __PRIVATE_onWatchStreamConnected.bind(null, e),
|
|
15147
15147
|
Ro: __PRIVATE_onWatchStreamOpen.bind(null, e),
|
|
15148
15148
|
mo: __PRIVATE_onWatchStreamClose.bind(null, e),
|
|
15149
|
-
|
|
15149
|
+
d_: __PRIVATE_onWatchStreamChange.bind(null, e)
|
|
15150
15150
|
}), e.B_.push((async t => {
|
|
15151
15151
|
t ? (e.K_.s_(), __PRIVATE_shouldStartWatchStream(e) ? __PRIVATE_startWatchStream(e) : e.q_.set("Unknown" /* OnlineState.Unknown */)) : (await e.K_.stop(),
|
|
15152
15152
|
__PRIVATE_cleanUpWatchStreamState(e));
|
|
@@ -15734,13 +15734,13 @@ class __PRIVATE_QueryListener {
|
|
|
15734
15734
|
constructor(e) {
|
|
15735
15735
|
this.serializer = e;
|
|
15736
15736
|
}
|
|
15737
|
-
|
|
15737
|
+
Es(e) {
|
|
15738
15738
|
return fromName(this.serializer, e);
|
|
15739
15739
|
}
|
|
15740
15740
|
/**
|
|
15741
15741
|
* Converts a BundleDocument to a MutableDocument.
|
|
15742
|
-
*/
|
|
15743
|
-
return e.metadata.exists ? __PRIVATE_fromDocument(this.serializer, e.document, !1) : MutableDocument.newNoDocument(this.
|
|
15742
|
+
*/ ds(e) {
|
|
15743
|
+
return e.metadata.exists ? __PRIVATE_fromDocument(this.serializer, e.document, !1) : MutableDocument.newNoDocument(this.Es(e.metadata.name), this.As(e.metadata.readTime));
|
|
15744
15744
|
}
|
|
15745
15745
|
As(e) {
|
|
15746
15746
|
return __PRIVATE_fromVersion(e);
|
|
@@ -15782,7 +15782,7 @@ class __PRIVATE_QueryListener {
|
|
|
15782
15782
|
ha(e) {
|
|
15783
15783
|
const t = new Map, n = new __PRIVATE_BundleConverterImpl(this.serializer);
|
|
15784
15784
|
for (const r of e) if (r.metadata.queries) {
|
|
15785
|
-
const e = n.
|
|
15785
|
+
const e = n.Es(r.metadata.name);
|
|
15786
15786
|
for (const n of r.metadata.queries) {
|
|
15787
15787
|
const r = (t.get(n) || __PRIVATE_documentKeySet()).add(e);
|
|
15788
15788
|
t.set(n, r);
|
|
@@ -15856,7 +15856,7 @@ class __PRIVATE_RemovedLimboDocument {
|
|
|
15856
15856
|
constructor(e,
|
|
15857
15857
|
/** Documents included in the remote target */
|
|
15858
15858
|
t) {
|
|
15859
|
-
this.query = e, this.Ta = t, this.
|
|
15859
|
+
this.query = e, this.Ta = t, this.Ea = null, this.hasCachedResults = !1,
|
|
15860
15860
|
/**
|
|
15861
15861
|
* A flag whether the view is current with the backend. A view is considered
|
|
15862
15862
|
* current after it has seen the current flag from the backend and did not
|
|
@@ -15865,7 +15865,7 @@ class __PRIVATE_RemovedLimboDocument {
|
|
|
15865
15865
|
*/
|
|
15866
15866
|
this.current = !1,
|
|
15867
15867
|
/** Documents in the view but not in the remote target */
|
|
15868
|
-
this.
|
|
15868
|
+
this.da = __PRIVATE_documentKeySet(),
|
|
15869
15869
|
/** Document Keys that have local changes */
|
|
15870
15870
|
this.mutatedKeys = __PRIVATE_documentKeySet(), this.Aa = __PRIVATE_newQueryComparator(e),
|
|
15871
15871
|
this.Ra = new DocumentSet(this.Aa);
|
|
@@ -16010,10 +16010,10 @@ class __PRIVATE_RemovedLimboDocument {
|
|
|
16010
16010
|
* See the License for the specific language governing permissions and
|
|
16011
16011
|
* limitations under the License.
|
|
16012
16012
|
*/ (e.type, t.type) || this.Aa(e.doc, t.doc))), this.pa(n), r = null != r && r;
|
|
16013
|
-
const o = t && !r ? this.ya() : [], _ = 0 === this.
|
|
16013
|
+
const o = t && !r ? this.ya() : [], _ = 0 === this.da.size && this.current && !r ? 1 /* SyncState.Synced */ : 0 /* SyncState.Local */ , a = _ !== this.Ea;
|
|
16014
16014
|
// We are at synced state if there is no limbo docs are waiting to be resolved, view is current
|
|
16015
16015
|
// with the backend, and the query is not pending to reset due to existence filter mismatch.
|
|
16016
|
-
if (this.
|
|
16016
|
+
if (this.Ea = _, 0 !== s.length || a) {
|
|
16017
16017
|
return {
|
|
16018
16018
|
snapshot: new ViewSnapshot(this.query, e.Ra, i, s, e.mutatedKeys, 0 /* SyncState.Local */ === _, a,
|
|
16019
16019
|
/* excludesMetadataChanges= */ !1, !!n && n.resumeToken.approximateByteSize() > 0),
|
|
@@ -16064,15 +16064,15 @@ class __PRIVATE_RemovedLimboDocument {
|
|
|
16064
16064
|
if (!this.current) return [];
|
|
16065
16065
|
// TODO(klimt): Do this incrementally so that it's not quadratic when
|
|
16066
16066
|
// updating many documents.
|
|
16067
|
-
const e = this.
|
|
16068
|
-
this.
|
|
16069
|
-
this.Sa(e.key) && (this.
|
|
16067
|
+
const e = this.da;
|
|
16068
|
+
this.da = __PRIVATE_documentKeySet(), this.Ra.forEach((e => {
|
|
16069
|
+
this.Sa(e.key) && (this.da = this.da.add(e.key));
|
|
16070
16070
|
}));
|
|
16071
16071
|
// Diff the new limbo docs with the old limbo docs.
|
|
16072
16072
|
const t = [];
|
|
16073
16073
|
return e.forEach((e => {
|
|
16074
|
-
this.
|
|
16075
|
-
})), this.
|
|
16074
|
+
this.da.has(e) || t.push(new __PRIVATE_RemovedLimboDocument(e));
|
|
16075
|
+
})), this.da.forEach((n => {
|
|
16076
16076
|
e.has(n) || t.push(new __PRIVATE_AddedLimboDocument(n));
|
|
16077
16077
|
})), t;
|
|
16078
16078
|
}
|
|
@@ -16097,7 +16097,7 @@ class __PRIVATE_RemovedLimboDocument {
|
|
|
16097
16097
|
*/
|
|
16098
16098
|
// PORTING NOTE: Multi-tab only.
|
|
16099
16099
|
ba(e) {
|
|
16100
|
-
this.Ta = e.Ts, this.
|
|
16100
|
+
this.Ta = e.Ts, this.da = __PRIVATE_documentKeySet();
|
|
16101
16101
|
const t = this.ma(e.documents);
|
|
16102
16102
|
return this.applyChanges(t, /* limboResolutionEnabled= */ !0);
|
|
16103
16103
|
}
|
|
@@ -16108,7 +16108,7 @@ class __PRIVATE_RemovedLimboDocument {
|
|
|
16108
16108
|
*/
|
|
16109
16109
|
// PORTING NOTE: Multi-tab only.
|
|
16110
16110
|
Da() {
|
|
16111
|
-
return ViewSnapshot.fromInitialDocuments(this.query, this.Ra, this.mutatedKeys, 0 /* SyncState.Local */ === this.
|
|
16111
|
+
return ViewSnapshot.fromInitialDocuments(this.query, this.Ra, this.mutatedKeys, 0 /* SyncState.Local */ === this.Ea, this.hasCachedResults);
|
|
16112
16112
|
}
|
|
16113
16113
|
}
|
|
16114
16114
|
|
|
@@ -16409,7 +16409,7 @@ async function __PRIVATE_allocateTargetAndMaybeListen(e, t, n, r) {
|
|
|
16409
16409
|
// Run global snapshot listeners if a consistent snapshot has been emitted.
|
|
16410
16410
|
e.Z_(t) && (r = !0);
|
|
16411
16411
|
})), r && __PRIVATE_raiseSnapshotsInSyncEvent(n);
|
|
16412
|
-
}(r.eventManager, t), e.length && r.Ca.
|
|
16412
|
+
}(r.eventManager, t), e.length && r.Ca.d_(e), r.onlineState = t, r.isPrimaryClient && r.sharedClientState.setOnlineState(t);
|
|
16413
16413
|
}
|
|
16414
16414
|
}
|
|
16415
16415
|
|
|
@@ -16613,7 +16613,7 @@ async function __PRIVATE_syncEngineEmitNewSnapsAndNotifyLocalStore(e, t, n) {
|
|
|
16613
16613
|
s.push(t);
|
|
16614
16614
|
}
|
|
16615
16615
|
})));
|
|
16616
|
-
})), await Promise.all(o), r.Ca.
|
|
16616
|
+
})), await Promise.all(o), r.Ca.d_(i), await async function __PRIVATE_localStoreNotifyLocalViewChanges(e, t) {
|
|
16617
16617
|
const n = __PRIVATE_debugCast(e);
|
|
16618
16618
|
try {
|
|
16619
16619
|
await n.persistence.runTransaction("notifyLocalViewChanges", "readwrite", (e => PersistencePromise.forEach(t, (t => PersistencePromise.forEach(t.$i, (r => n.persistence.referenceDelegate.addReference(e, t.targetId, r))).next((() => PersistencePromise.forEach(t.Ui, (r => n.persistence.referenceDelegate.removeReference(e, t.targetId, r)))))))));
|
|
@@ -16791,7 +16791,7 @@ async function __PRIVATE_synchronizeQueryViewsAndRaiseSnapshots(e, t, n) {
|
|
|
16791
16791
|
}
|
|
16792
16792
|
i.push(t);
|
|
16793
16793
|
}
|
|
16794
|
-
return r.Ca.
|
|
16794
|
+
return r.Ca.d_(s), i;
|
|
16795
16795
|
}
|
|
16796
16796
|
|
|
16797
16797
|
/**
|
|
@@ -16874,7 +16874,7 @@ function __PRIVATE_ensureWatchCallbacks(e) {
|
|
|
16874
16874
|
return t.remoteStore.remoteSyncer.applyRemoteEvent = __PRIVATE_syncEngineApplyRemoteEvent.bind(null, t),
|
|
16875
16875
|
t.remoteStore.remoteSyncer.getRemoteKeysForTarget = __PRIVATE_syncEngineGetRemoteKeysForTarget.bind(null, t),
|
|
16876
16876
|
t.remoteStore.remoteSyncer.rejectListen = __PRIVATE_syncEngineRejectListen.bind(null, t),
|
|
16877
|
-
t.Ca.
|
|
16877
|
+
t.Ca.d_ = __PRIVATE_eventManagerOnWatchChange.bind(null, t.eventManager), t.Ca.$a = __PRIVATE_eventManagerOnWatchError.bind(null, t.eventManager),
|
|
16878
16878
|
t;
|
|
16879
16879
|
}
|
|
16880
16880
|
|
|
@@ -18599,13 +18599,13 @@ function doc(e, t, ...n) {
|
|
|
18599
18599
|
// Visibility handler that triggers an immediate retry of all retryable
|
|
18600
18600
|
// operations. Meant to speed up recovery when we regain file system access
|
|
18601
18601
|
// after page comes into foreground.
|
|
18602
|
-
this.
|
|
18602
|
+
this.Eu = () => {
|
|
18603
18603
|
const e = getDocument();
|
|
18604
18604
|
e && __PRIVATE_logDebug("AsyncQueue", "Visibility state changed to " + e.visibilityState),
|
|
18605
18605
|
this.t_.jo();
|
|
18606
18606
|
};
|
|
18607
18607
|
const e = getDocument();
|
|
18608
|
-
e && "function" == typeof e.addEventListener && e.addEventListener("visibilitychange", this.
|
|
18608
|
+
e && "function" == typeof e.addEventListener && e.addEventListener("visibilitychange", this.Eu);
|
|
18609
18609
|
}
|
|
18610
18610
|
get isShuttingDown() {
|
|
18611
18611
|
return this.cu;
|
|
@@ -18618,7 +18618,7 @@ function doc(e, t, ...n) {
|
|
|
18618
18618
|
this.enqueue(e);
|
|
18619
18619
|
}
|
|
18620
18620
|
enqueueAndForgetEvenWhileRestricted(e) {
|
|
18621
|
-
this.
|
|
18621
|
+
this.du(),
|
|
18622
18622
|
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
18623
18623
|
this.Au(e);
|
|
18624
18624
|
}
|
|
@@ -18626,11 +18626,11 @@ function doc(e, t, ...n) {
|
|
|
18626
18626
|
if (!this.cu) {
|
|
18627
18627
|
this.cu = !0, this.Iu = e || !1;
|
|
18628
18628
|
const t = getDocument();
|
|
18629
|
-
t && "function" == typeof t.removeEventListener && t.removeEventListener("visibilitychange", this.
|
|
18629
|
+
t && "function" == typeof t.removeEventListener && t.removeEventListener("visibilitychange", this.Eu);
|
|
18630
18630
|
}
|
|
18631
18631
|
}
|
|
18632
18632
|
enqueue(e) {
|
|
18633
|
-
if (this.
|
|
18633
|
+
if (this.du(), this.cu)
|
|
18634
18634
|
// Return a Promise which never resolves.
|
|
18635
18635
|
return new Promise((() => {}));
|
|
18636
18636
|
// Create a deferred Promise that we can return to the callee. This
|
|
@@ -18707,13 +18707,13 @@ function doc(e, t, ...n) {
|
|
|
18707
18707
|
return this.au = t, t;
|
|
18708
18708
|
}
|
|
18709
18709
|
enqueueAfterDelay(e, t, n) {
|
|
18710
|
-
this.
|
|
18710
|
+
this.du(),
|
|
18711
18711
|
// Fast-forward delays for timerIds that have been overridden.
|
|
18712
18712
|
this.Tu.indexOf(e) > -1 && (t = 0);
|
|
18713
18713
|
const r = DelayedOperation.createAndSchedule(this, e, t, n, (e => this.Vu(e)));
|
|
18714
18714
|
return this.lu.push(r), r;
|
|
18715
18715
|
}
|
|
18716
|
-
|
|
18716
|
+
du() {
|
|
18717
18717
|
this.hu && fail();
|
|
18718
18718
|
}
|
|
18719
18719
|
verifyOperationInProgress() {}
|
|
@@ -22229,9 +22229,9 @@ let Me = null;
|
|
|
22229
22229
|
return r = Object.assign({
|
|
22230
22230
|
useFetchStreams: t
|
|
22231
22231
|
}, r), s._setSettings(r), s;
|
|
22232
|
-
}), "PUBLIC").setMultipleInstances(!0)), registerVersion(S, "4.7.1-canary.
|
|
22232
|
+
}), "PUBLIC").setMultipleInstances(!0)), registerVersion(S, "4.7.1-canary.ca4dbcf3f", e),
|
|
22233
22233
|
// BUILD_TARGET will be replaced by values like esm5, esm2017, cjs5, etc during the compilation
|
|
22234
|
-
registerVersion(S, "4.7.1-canary.
|
|
22234
|
+
registerVersion(S, "4.7.1-canary.ca4dbcf3f", "esm2017");
|
|
22235
22235
|
}();
|
|
22236
22236
|
|
|
22237
22237
|
export { AbstractUserDataWriter, AggregateField, AggregateQuerySnapshot, Bytes, be as CACHE_SIZE_UNLIMITED, CollectionReference, DocumentReference, DocumentSnapshot, FieldPath, FieldValue, Firestore, FirestoreError, GeoPoint, LoadBundleTask, PersistentCacheIndexManager, Query, QueryCompositeFilterConstraint, QueryConstraint, QueryDocumentSnapshot, QueryEndAtConstraint, QueryFieldFilterConstraint, QueryLimitConstraint, QueryOrderByConstraint, QuerySnapshot, QueryStartAtConstraint, SnapshotMetadata, Timestamp, Transaction, VectorValue, WriteBatch, __PRIVATE_AutoId as _AutoId, ByteString as _ByteString, DatabaseId as _DatabaseId, DocumentKey as _DocumentKey, __PRIVATE_EmptyAppCheckTokenProvider as _EmptyAppCheckTokenProvider, __PRIVATE_EmptyAuthCredentialsProvider as _EmptyAuthCredentialsProvider, FieldPath$1 as _FieldPath, TestingHooks as _TestingHooks, __PRIVATE_cast as _cast, __PRIVATE_debugAssert as _debugAssert, _internalAggregationQueryToProtoRunAggregationQueryRequest, _internalQueryToProtoQueryTarget, __PRIVATE_isBase64Available as _isBase64Available, __PRIVATE_logWarn as _logWarn, __PRIVATE_validateIsNotUsedTogether as _validateIsNotUsedTogether, addDoc, aggregateFieldEqual, aggregateQuerySnapshotEqual, and, arrayRemove, arrayUnion, average, clearIndexedDbPersistence, collection, collectionGroup, connectFirestoreEmulator, count, deleteAllPersistentCacheIndexes, deleteDoc, deleteField, disableNetwork, disablePersistentCacheIndexAutoCreation, doc, documentId, enableIndexedDbPersistence, enableMultiTabIndexedDbPersistence, enableNetwork, enablePersistentCacheIndexAutoCreation, endAt, endBefore, ensureFirestoreConfigured, executeWrite, getAggregateFromServer, getCountFromServer, getDoc, getDocFromCache, getDocFromServer, getDocs, getDocsFromCache, getDocsFromServer, getFirestore, getPersistentCacheIndexManager, increment, initializeFirestore, limit, limitToLast, loadBundle, memoryEagerGarbageCollector, memoryLocalCache, memoryLruGarbageCollector, namedQuery, onSnapshot, onSnapshotsInSync, or, orderBy, persistentLocalCache, persistentMultipleTabManager, persistentSingleTabManager, query, queryEqual, refEqual, runTransaction, serverTimestamp, setDoc, setIndexConfiguration, setLogLevel, snapshotEqual, startAfter, startAt, sum, terminate, updateDoc, vector, waitForPendingWrites, where, writeBatch };
|