@firebase/firestore 3.4.0 → 3.4.1-canary.0db840a09
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 +8 -0
- package/dist/firestore/compat/index.d.ts +1 -1
- package/dist/firestore/src/model/collections.d.ts +1 -1
- package/dist/firestore/src/model/document.d.ts +3 -1
- package/dist/index.esm2017.js +159 -159
- package/dist/index.esm2017.js.map +1 -1
- package/dist/index.esm5.js +68 -68
- package/dist/index.esm5.js.map +1 -1
- package/dist/index.node.cjs.js +14 -21
- package/dist/index.node.cjs.js.map +1 -1
- package/dist/index.node.mjs +14 -17
- package/dist/index.node.mjs.map +1 -1
- package/dist/index.rn.js +852 -852
- package/dist/index.rn.js.map +1 -1
- package/dist/internal.d.ts +3 -1
- package/dist/lite/firestore/compat/index.d.ts +1 -1
- package/dist/lite/firestore/src/model/collections.d.ts +1 -1
- package/dist/lite/firestore/src/model/document.d.ts +3 -1
- package/dist/lite/index.browser.esm2017.js +4 -4
- package/dist/lite/index.browser.esm2017.js.map +1 -1
- package/dist/lite/index.browser.esm5.js +4 -4
- package/dist/lite/index.browser.esm5.js.map +1 -1
- package/dist/lite/index.node.cjs.js +4 -4
- package/dist/lite/index.node.cjs.js.map +1 -1
- package/dist/lite/index.node.mjs +4 -4
- package/dist/lite/index.node.mjs.map +1 -1
- package/dist/lite/index.rn.esm2017.js +61 -61
- package/dist/lite/index.rn.esm2017.js.map +1 -1
- package/dist/lite/internal.d.ts +67 -0
- package/dist/lite/packages/firestore/babel-register.d.ts +1 -0
- package/dist/lite/packages/firestore/compat/index.d.ts +1 -1
- package/dist/lite/packages/firestore/src/model/collections.d.ts +1 -1
- package/dist/lite/packages/firestore/src/model/document.d.ts +3 -1
- package/dist/lite/private.d.ts +67 -0
- package/dist/packages/firestore/babel-register.d.ts +1 -0
- package/dist/packages/firestore/compat/index.d.ts +1 -1
- package/dist/packages/firestore/dist/index.esm2017.d.ts +21 -21
- package/dist/packages/firestore/src/model/collections.d.ts +1 -1
- package/dist/packages/firestore/src/model/document.d.ts +3 -1
- package/dist/private.d.ts +3 -1
- package/package.json +10 -10
package/dist/index.esm2017.js
CHANGED
|
@@ -66,7 +66,7 @@ D.MOCK_USER = new D("mock-user");
|
|
|
66
66
|
* See the License for the specific language governing permissions and
|
|
67
67
|
* limitations under the License.
|
|
68
68
|
*/
|
|
69
|
-
let C = "9.6.
|
|
69
|
+
let C = "9.6.1-canary.0db840a09";
|
|
70
70
|
|
|
71
71
|
/**
|
|
72
72
|
* @license
|
|
@@ -1408,7 +1408,7 @@ function Rt(t) {
|
|
|
1408
1408
|
|
|
1409
1409
|
/**
|
|
1410
1410
|
* Returns the local time at which this timestamp was first set.
|
|
1411
|
-
*/ function
|
|
1411
|
+
*/ function bt(t) {
|
|
1412
1412
|
const e = Tt(t.mapValue.fields.__local_write_time__.timestampValue);
|
|
1413
1413
|
return new at(e.seconds, e.nanos);
|
|
1414
1414
|
}
|
|
@@ -1433,7 +1433,7 @@ function Rt(t) {
|
|
|
1433
1433
|
/**
|
|
1434
1434
|
* Returns whether a variable is either undefined or null.
|
|
1435
1435
|
*/
|
|
1436
|
-
function
|
|
1436
|
+
function Pt(t) {
|
|
1437
1437
|
return null == t;
|
|
1438
1438
|
}
|
|
1439
1439
|
|
|
@@ -1534,7 +1534,7 @@ function bt(t) {
|
|
|
1534
1534
|
return t.booleanValue === e.booleanValue;
|
|
1535
1535
|
|
|
1536
1536
|
case 4 /* ServerTimestampValue */ :
|
|
1537
|
-
return
|
|
1537
|
+
return bt(t).isEqual(bt(e));
|
|
1538
1538
|
|
|
1539
1539
|
case 3 /* TimestampValue */ :
|
|
1540
1540
|
return function(t, e) {
|
|
@@ -1614,7 +1614,7 @@ function kt(t, e) {
|
|
|
1614
1614
|
return xt(t.timestampValue, e.timestampValue);
|
|
1615
1615
|
|
|
1616
1616
|
case 4 /* ServerTimestampValue */ :
|
|
1617
|
-
return xt(
|
|
1617
|
+
return xt(bt(t), bt(e));
|
|
1618
1618
|
|
|
1619
1619
|
case 5 /* StringValue */ :
|
|
1620
1620
|
return it(t.stringValue, e.stringValue);
|
|
@@ -1997,7 +1997,7 @@ function Lt(t) {
|
|
|
1997
1997
|
isEqual(t) {
|
|
1998
1998
|
return t instanceof Wt && this.key.isEqual(t.key) && this.version.isEqual(t.version) && this.documentType === t.documentType && this.documentState === t.documentState && this.data.isEqual(t.data);
|
|
1999
1999
|
}
|
|
2000
|
-
|
|
2000
|
+
mutableCopy() {
|
|
2001
2001
|
return new Wt(this.key, this.documentType, this.version, this.data.clone(), this.documentState);
|
|
2002
2002
|
}
|
|
2003
2003
|
toString() {
|
|
@@ -2052,7 +2052,7 @@ function Ht(t) {
|
|
|
2052
2052
|
t += "|ob:", t += e.orderBy.map((t => function(t) {
|
|
2053
2053
|
// TODO(b/29183165): Make this collision robust.
|
|
2054
2054
|
return t.field.canonicalString() + t.dir;
|
|
2055
|
-
}(t))).join(","),
|
|
2055
|
+
}(t))).join(","), Pt(e.limit) || (t += "|l:", t += e.limit), e.startAt && (t += "|lb:",
|
|
2056
2056
|
t += he(e.startAt)), e.endAt && (t += "|ub:", t += he(e.endAt)), e.R = t;
|
|
2057
2057
|
}
|
|
2058
2058
|
return e.R;
|
|
@@ -2066,7 +2066,7 @@ function Jt(t) {
|
|
|
2066
2066
|
/** Returns a debug description for `filter`. */
|
|
2067
2067
|
var e;
|
|
2068
2068
|
/** Filter that matches on key fields (i.e. '__name__'). */ })).join(", ")}]`),
|
|
2069
|
-
|
|
2069
|
+
Pt(t.limit) || (e += ", limit: " + t.limit), t.orderBy.length > 0 && (e += `, orderBy: [${t.orderBy.map((t => function(t) {
|
|
2070
2070
|
return `${t.field.canonicalString()} (${t.dir})`;
|
|
2071
2071
|
}(t))).join(", ")}]`), t.startAt && (e += ", startAt: " + he(t.startAt)), t.endAt && (e += ", endAt: " + he(t.endAt)),
|
|
2072
2072
|
`Target(${e})`;
|
|
@@ -2327,11 +2327,11 @@ function we(t, e) {
|
|
|
2327
2327
|
* we have to split the query into a set of collection queries at multiple
|
|
2328
2328
|
* paths.
|
|
2329
2329
|
*/ function ye(t) {
|
|
2330
|
-
return !
|
|
2330
|
+
return !Pt(t.limit) && "F" /* First */ === t.limitType;
|
|
2331
2331
|
}
|
|
2332
2332
|
|
|
2333
2333
|
function pe(t) {
|
|
2334
|
-
return !
|
|
2334
|
+
return !Pt(t.limit) && "L" /* Last */ === t.limitType;
|
|
2335
2335
|
}
|
|
2336
2336
|
|
|
2337
2337
|
function Te(t) {
|
|
@@ -2401,11 +2401,11 @@ function Ie(t) {
|
|
|
2401
2401
|
return e.D;
|
|
2402
2402
|
}
|
|
2403
2403
|
|
|
2404
|
-
function
|
|
2404
|
+
function be(t, e, n) {
|
|
2405
2405
|
return new _e(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), e, n, t.startAt, t.endAt);
|
|
2406
2406
|
}
|
|
2407
2407
|
|
|
2408
|
-
function
|
|
2408
|
+
function Pe(t, e) {
|
|
2409
2409
|
return Yt(Re(t), Re(e)) && t.limitType === e.limitType;
|
|
2410
2410
|
}
|
|
2411
2411
|
|
|
@@ -3669,14 +3669,14 @@ function An() {
|
|
|
3669
3669
|
|
|
3670
3670
|
const Rn = new gn(St.comparator);
|
|
3671
3671
|
|
|
3672
|
-
function
|
|
3672
|
+
function bn() {
|
|
3673
3673
|
return Rn;
|
|
3674
3674
|
}
|
|
3675
3675
|
|
|
3676
|
-
const
|
|
3676
|
+
const Pn = new gn(St.comparator);
|
|
3677
3677
|
|
|
3678
3678
|
function vn() {
|
|
3679
|
-
return
|
|
3679
|
+
return Pn;
|
|
3680
3680
|
}
|
|
3681
3681
|
|
|
3682
3682
|
const Vn = new Tn(St.comparator);
|
|
@@ -4601,7 +4601,7 @@ function hs(t, e) {
|
|
|
4601
4601
|
}(e.orderBy);
|
|
4602
4602
|
r && (n.structuredQuery.orderBy = r);
|
|
4603
4603
|
const o = function(t, e) {
|
|
4604
|
-
return t.C ||
|
|
4604
|
+
return t.C || Pt(e) ? e : {
|
|
4605
4605
|
value: e
|
|
4606
4606
|
};
|
|
4607
4607
|
}
|
|
@@ -4645,7 +4645,7 @@ function ls(t) {
|
|
|
4645
4645
|
let a = null;
|
|
4646
4646
|
n.limit && (a = function(t) {
|
|
4647
4647
|
let e;
|
|
4648
|
-
return e = "object" == typeof t ? t.value : t,
|
|
4648
|
+
return e = "object" == typeof t ? t.value : t, Pt(e) ? null : e;
|
|
4649
4649
|
}(n.limit));
|
|
4650
4650
|
let c = null;
|
|
4651
4651
|
n.startAt && (c = _s(n.startAt));
|
|
@@ -4812,11 +4812,11 @@ function As(t) {
|
|
|
4812
4812
|
*/
|
|
4813
4813
|
function Rs(t) {
|
|
4814
4814
|
let e = "";
|
|
4815
|
-
for (let n = 0; n < t.length; n++) e.length > 0 && (e =
|
|
4816
|
-
return
|
|
4815
|
+
for (let n = 0; n < t.length; n++) e.length > 0 && (e = Ps(e)), e = bs(t.get(n), e);
|
|
4816
|
+
return Ps(e);
|
|
4817
4817
|
}
|
|
4818
4818
|
|
|
4819
|
-
/** Encodes a single segment of a resource path into the given result */ function
|
|
4819
|
+
/** Encodes a single segment of a resource path into the given result */ function bs(t, e) {
|
|
4820
4820
|
let n = e;
|
|
4821
4821
|
const s = t.length;
|
|
4822
4822
|
for (let e = 0; e < s; e++) {
|
|
@@ -4837,7 +4837,7 @@ function Rs(t) {
|
|
|
4837
4837
|
return n;
|
|
4838
4838
|
}
|
|
4839
4839
|
|
|
4840
|
-
/** Encodes a path separator into the given result */ function
|
|
4840
|
+
/** Encodes a path separator into the given result */ function Ps(t) {
|
|
4841
4841
|
return t + "";
|
|
4842
4842
|
}
|
|
4843
4843
|
|
|
@@ -5691,12 +5691,12 @@ class zs {
|
|
|
5691
5691
|
// bug we're checking for should exist in iOS >= 12.2 and < 13, but for
|
|
5692
5692
|
// whatever reason it's much harder to hit after 12.2 so we only proactively
|
|
5693
5693
|
// log on 12.2.
|
|
5694
|
-
12.2 === Hs.
|
|
5694
|
+
12.2 === Hs.bt(getUA()) && F("Firestore persistence suffers from a bug in iOS 12.2 Safari that may cause your app to stop working. See https://stackoverflow.com/q/56496296/110915 for details and a potential workaround.");
|
|
5695
5695
|
}
|
|
5696
5696
|
/** Deletes the specified database. */ static delete(t) {
|
|
5697
5697
|
return $("SimpleDb", "Removing database:", t), ti(window.indexedDB.deleteDatabase(t)).toPromise();
|
|
5698
5698
|
}
|
|
5699
|
-
/** Returns true if IndexedDB is available in the current environment. */ static
|
|
5699
|
+
/** Returns true if IndexedDB is available in the current environment. */ static Pt() {
|
|
5700
5700
|
if (!isIndexedDBAvailable()) return !1;
|
|
5701
5701
|
if (Hs.vt()) return !0;
|
|
5702
5702
|
// We extensively use indexed array values and compound keys,
|
|
@@ -5706,7 +5706,7 @@ class zs {
|
|
|
5706
5706
|
// For tracking support of this feature, see here:
|
|
5707
5707
|
// https://developer.microsoft.com/en-us/microsoft-edge/platform/status/indexeddbarraysandmultientrysupport/
|
|
5708
5708
|
// Check the UA string to find out the browser.
|
|
5709
|
-
const t = getUA(), e = Hs.
|
|
5709
|
+
const t = getUA(), e = Hs.bt(t), n = 0 < e && e < 10, s = Hs.Vt(t), i = 0 < s && s < 4.5;
|
|
5710
5710
|
// IE 10
|
|
5711
5711
|
// ua = 'Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; Trident/6.0)';
|
|
5712
5712
|
// IE 11
|
|
@@ -5729,7 +5729,7 @@ class zs {
|
|
|
5729
5729
|
}
|
|
5730
5730
|
// visible for testing
|
|
5731
5731
|
/** Parse User Agent to determine iOS version. Returns -1 if not found. */
|
|
5732
|
-
static
|
|
5732
|
+
static bt(t) {
|
|
5733
5733
|
const e = t.match(/i(?:phone|pad|pod) os ([\d_]+)/i), n = e ? e[1].split("_").slice(0, 2).join(".") : "-1";
|
|
5734
5734
|
return Number(n);
|
|
5735
5735
|
}
|
|
@@ -5999,7 +5999,7 @@ class zs {
|
|
|
5999
5999
|
let ei = !1;
|
|
6000
6000
|
|
|
6001
6001
|
function ni(t) {
|
|
6002
|
-
const e = Hs.
|
|
6002
|
+
const e = Hs.bt(getUA());
|
|
6003
6003
|
if (e >= 12.2 && e < 13) {
|
|
6004
6004
|
const e = "An internal error was encountered in the Indexed Database server";
|
|
6005
6005
|
if (t.message.indexOf(e) >= 0) {
|
|
@@ -6354,7 +6354,7 @@ function yi(t) {
|
|
|
6354
6354
|
parent: t.parent,
|
|
6355
6355
|
structuredQuery: t.structuredQuery
|
|
6356
6356
|
});
|
|
6357
|
-
return "LAST" === t.limitType ?
|
|
6357
|
+
return "LAST" === t.limitType ? be(e, e.limit, "L" /* Last */) : e;
|
|
6358
6358
|
}
|
|
6359
6359
|
|
|
6360
6360
|
/** Encodes a NamedQuery proto object to a NamedQuery model object. */
|
|
@@ -6526,7 +6526,7 @@ class pi {
|
|
|
6526
6526
|
collectionId: n,
|
|
6527
6527
|
parent: Rs(s)
|
|
6528
6528
|
};
|
|
6529
|
-
return
|
|
6529
|
+
return bi(t).put(i);
|
|
6530
6530
|
}
|
|
6531
6531
|
return Gs.resolve();
|
|
6532
6532
|
}
|
|
@@ -6534,7 +6534,7 @@ class pi {
|
|
|
6534
6534
|
const n = [], s = IDBKeyRange.bound([ e, "" ], [ ot(e), "" ],
|
|
6535
6535
|
/*lowerOpen=*/ !1,
|
|
6536
6536
|
/*upperOpen=*/ !0);
|
|
6537
|
-
return
|
|
6537
|
+
return bi(t).Bt(s).next((t => {
|
|
6538
6538
|
for (const s of t) {
|
|
6539
6539
|
// This collectionId guard shouldn't be necessary (and isn't as long
|
|
6540
6540
|
// as we're running in a real browser), but there's a bug in
|
|
@@ -6551,7 +6551,7 @@ class pi {
|
|
|
6551
6551
|
/**
|
|
6552
6552
|
* Helper to get a typed SimpleDbStore for the collectionParents
|
|
6553
6553
|
* document store.
|
|
6554
|
-
*/ function
|
|
6554
|
+
*/ function bi(t) {
|
|
6555
6555
|
return ii(t, Bs.store);
|
|
6556
6556
|
}
|
|
6557
6557
|
|
|
@@ -6570,7 +6570,7 @@ class pi {
|
|
|
6570
6570
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
6571
6571
|
* See the License for the specific language governing permissions and
|
|
6572
6572
|
* limitations under the License.
|
|
6573
|
-
*/ const
|
|
6573
|
+
*/ const Pi = {
|
|
6574
6574
|
didRun: !1,
|
|
6575
6575
|
sequenceNumbersCollected: 0,
|
|
6576
6576
|
targetsRemoved: 0,
|
|
@@ -7309,8 +7309,8 @@ class $i {
|
|
|
7309
7309
|
}
|
|
7310
7310
|
collect(t, e) {
|
|
7311
7311
|
return -1 === this.params.cacheSizeCollectionThreshold ? ($("LruGarbageCollector", "Garbage collection skipped; disabled"),
|
|
7312
|
-
Gs.resolve(
|
|
7313
|
-
|
|
7312
|
+
Gs.resolve(Pi)) : this.getCacheSize(t).next((n => n < this.params.cacheSizeCollectionThreshold ? ($("LruGarbageCollector", `Garbage collection skipped; Cache size ${n} is lower than threshold ${this.params.cacheSizeCollectionThreshold}`),
|
|
7313
|
+
Pi) : this.Te(t, e)));
|
|
7314
7314
|
}
|
|
7315
7315
|
getCacheSize(t) {
|
|
7316
7316
|
return this.ge.getCacheSize(t);
|
|
@@ -7682,23 +7682,23 @@ function Wi(t, e) {
|
|
|
7682
7682
|
return this.getMetadata(t).next((n => (n.byteSize += e, this.Re(t, n))));
|
|
7683
7683
|
}
|
|
7684
7684
|
getEntry(t, e) {
|
|
7685
|
-
return Xi(t).get(Zi(e)).next((t => this.
|
|
7685
|
+
return Xi(t).get(Zi(e)).next((t => this.be(e, t)));
|
|
7686
7686
|
}
|
|
7687
7687
|
/**
|
|
7688
7688
|
* Looks up an entry in the cache.
|
|
7689
7689
|
*
|
|
7690
7690
|
* @param documentKey - The key of the entry to look up.
|
|
7691
7691
|
* @returns The cached document entry and its size.
|
|
7692
|
-
*/
|
|
7692
|
+
*/ Pe(t, e) {
|
|
7693
7693
|
return Xi(t).get(Zi(e)).next((t => ({
|
|
7694
|
-
document: this.
|
|
7694
|
+
document: this.be(e, t),
|
|
7695
7695
|
size: Si(t)
|
|
7696
7696
|
})));
|
|
7697
7697
|
}
|
|
7698
7698
|
getEntries(t, e) {
|
|
7699
7699
|
let n = An();
|
|
7700
7700
|
return this.ve(t, e, ((t, e) => {
|
|
7701
|
-
const s = this.
|
|
7701
|
+
const s = this.be(t, e);
|
|
7702
7702
|
n = n.insert(t, s);
|
|
7703
7703
|
})).next((() => n));
|
|
7704
7704
|
}
|
|
@@ -7711,7 +7711,7 @@ function Wi(t, e) {
|
|
|
7711
7711
|
*/ Ve(t, e) {
|
|
7712
7712
|
let n = An(), s = new gn(St.comparator);
|
|
7713
7713
|
return this.ve(t, e, ((t, e) => {
|
|
7714
|
-
const i = this.
|
|
7714
|
+
const i = this.be(t, e);
|
|
7715
7715
|
n = n.insert(t, i), s = s.insert(t, Si(e));
|
|
7716
7716
|
})).next((() => ({
|
|
7717
7717
|
documents: n,
|
|
@@ -7781,7 +7781,7 @@ function Wi(t, e) {
|
|
|
7781
7781
|
/**
|
|
7782
7782
|
* Decodes `remoteDoc` and returns the document (or null, if the document
|
|
7783
7783
|
* corresponds to the format used for sentinel deletes).
|
|
7784
|
-
*/
|
|
7784
|
+
*/ be(t, e) {
|
|
7785
7785
|
if (e) {
|
|
7786
7786
|
const t = ui(this.k, e);
|
|
7787
7787
|
// Whether the document is a sentinel removal and should only be used in the
|
|
@@ -7840,7 +7840,7 @@ class Ji extends zi {
|
|
|
7840
7840
|
}
|
|
7841
7841
|
getFromCache(t, e) {
|
|
7842
7842
|
// Record the size of everything we load from the cache so we can compute a delta later.
|
|
7843
|
-
return this.De.
|
|
7843
|
+
return this.De.Pe(t, e).next((t => (this.Ce.set(e, t.size), t.document)));
|
|
7844
7844
|
}
|
|
7845
7845
|
getAllFromCache(t, e) {
|
|
7846
7846
|
// Record the size of everything we load from the cache so we can compute
|
|
@@ -8173,7 +8173,7 @@ class sr {
|
|
|
8173
8173
|
/** The last time we garbage collected the client metadata object store. */
|
|
8174
8174
|
this.Qe = Number.NEGATIVE_INFINITY,
|
|
8175
8175
|
/** A listener to notify on primary state changes. */
|
|
8176
|
-
this.We = t => Promise.resolve(), !sr.
|
|
8176
|
+
this.We = t => Promise.resolve(), !sr.Pt()) throw new j(K.UNIMPLEMENTED, "This platform is either missing IndexedDB or is known to have an incomplete implementation. Offline persistence has been disabled.");
|
|
8177
8177
|
this.referenceDelegate = new Qi(this, s), this.Ge = e + "main", this.k = new ci(a),
|
|
8178
8178
|
this.ze = new Hs(this.Ge, 11, new tr(this.k)), this.He = new Fi(this.referenceDelegate, this.k),
|
|
8179
8179
|
this.Jt = new Ri, this.Je = function(t, e) {
|
|
@@ -8429,8 +8429,8 @@ class sr {
|
|
|
8429
8429
|
const e = new Ss(this.clientId, this.allowTabSynchronization, Date.now());
|
|
8430
8430
|
return ir(t).put(Ss.key, e);
|
|
8431
8431
|
}
|
|
8432
|
-
static
|
|
8433
|
-
return Hs.
|
|
8432
|
+
static Pt() {
|
|
8433
|
+
return Hs.Pt();
|
|
8434
8434
|
}
|
|
8435
8435
|
/** Checks the primary lease and removes it if we are the current primary. */ an(t) {
|
|
8436
8436
|
const e = ir(t);
|
|
@@ -8593,9 +8593,9 @@ class ar {
|
|
|
8593
8593
|
* @returns Local view of the document or null if we don't have any cached
|
|
8594
8594
|
* state for it.
|
|
8595
8595
|
*/ Rn(t, e) {
|
|
8596
|
-
return this.An.getAllMutationBatchesAffectingDocumentKey(t, e).next((n => this.
|
|
8596
|
+
return this.An.getAllMutationBatchesAffectingDocumentKey(t, e).next((n => this.bn(t, e, n)));
|
|
8597
8597
|
}
|
|
8598
|
-
/** Internal version of `getDocument` that allows reusing batches. */
|
|
8598
|
+
/** Internal version of `getDocument` that allows reusing batches. */ bn(t, e, n) {
|
|
8599
8599
|
return this.Je.getEntry(t, e).next((t => {
|
|
8600
8600
|
for (const e of n) e.applyToLocalView(t);
|
|
8601
8601
|
return t;
|
|
@@ -8603,7 +8603,7 @@ class ar {
|
|
|
8603
8603
|
}
|
|
8604
8604
|
// Returns the view of the given `docs` as they would appear after applying
|
|
8605
8605
|
// all mutations in the given `batches`.
|
|
8606
|
-
|
|
8606
|
+
Pn(t, e) {
|
|
8607
8607
|
t.forEach(((t, n) => {
|
|
8608
8608
|
for (const t of e) t.applyToLocalView(n);
|
|
8609
8609
|
}));
|
|
@@ -8620,7 +8620,7 @@ class ar {
|
|
|
8620
8620
|
* Applies the local view the given `baseDocs` without retrieving documents
|
|
8621
8621
|
* from the local store.
|
|
8622
8622
|
*/ Vn(t, e) {
|
|
8623
|
-
return this.An.getAllMutationBatchesAffectingDocumentKeys(t, e).next((t => this.
|
|
8623
|
+
return this.An.getAllMutationBatchesAffectingDocumentKeys(t, e).next((t => this.Pn(e, t)));
|
|
8624
8624
|
}
|
|
8625
8625
|
/**
|
|
8626
8626
|
* Performs a query against the local view of all documents.
|
|
@@ -8641,13 +8641,13 @@ class ar {
|
|
|
8641
8641
|
Sn(t, e) {
|
|
8642
8642
|
// Just do a simple document lookup.
|
|
8643
8643
|
return this.Rn(t, new St(e)).next((t => {
|
|
8644
|
-
let e =
|
|
8644
|
+
let e = bn();
|
|
8645
8645
|
return t.isFoundDocument() && (e = e.insert(t.key, t)), e;
|
|
8646
8646
|
}));
|
|
8647
8647
|
}
|
|
8648
8648
|
Dn(t, e, n) {
|
|
8649
8649
|
const s = e.collectionGroup;
|
|
8650
|
-
let i =
|
|
8650
|
+
let i = bn();
|
|
8651
8651
|
return this.Jt.getCollectionParents(t, s).next((r => Gs.forEach(r, (r => {
|
|
8652
8652
|
const o = function(t, e) {
|
|
8653
8653
|
return new _e(e,
|
|
@@ -9279,7 +9279,7 @@ async function Rr(t) {
|
|
|
9279
9279
|
* LocalDocuments are re-calculated if there are remaining mutations in the
|
|
9280
9280
|
* queue.
|
|
9281
9281
|
*/
|
|
9282
|
-
async function
|
|
9282
|
+
async function br(t, e, n, s) {
|
|
9283
9283
|
const i = q(t);
|
|
9284
9284
|
let r = Sn(), o = An(), a = vn();
|
|
9285
9285
|
for (const t of n) {
|
|
@@ -9306,7 +9306,7 @@ async function Pr(t, e, n, s) {
|
|
|
9306
9306
|
/**
|
|
9307
9307
|
* Saves the given `NamedQuery` to local persistence.
|
|
9308
9308
|
*/
|
|
9309
|
-
async function
|
|
9309
|
+
async function Pr(t, e, n = Sn()) {
|
|
9310
9310
|
// Allocate a target for the named query such that it can be resumed
|
|
9311
9311
|
// from associated read time if users use it to listen.
|
|
9312
9312
|
// NOTE: this also means if no corresponding target exists, the new target
|
|
@@ -9669,7 +9669,7 @@ class Cr {
|
|
|
9669
9669
|
*/ addEntry(t, e, n) {
|
|
9670
9670
|
const s = e.key, i = this.docs.get(s), r = i ? i.size : 0, o = this.Ts(e);
|
|
9671
9671
|
return this.docs = this.docs.insert(s, {
|
|
9672
|
-
document: e.
|
|
9672
|
+
document: e.mutableCopy(),
|
|
9673
9673
|
size: o,
|
|
9674
9674
|
readTime: n
|
|
9675
9675
|
}), this.size += o - r, this.Jt.addToCollectionParentIndex(t, s.path.popLast());
|
|
@@ -9685,13 +9685,13 @@ class Cr {
|
|
|
9685
9685
|
}
|
|
9686
9686
|
getEntry(t, e) {
|
|
9687
9687
|
const n = this.docs.get(e);
|
|
9688
|
-
return Gs.resolve(n ? n.document.
|
|
9688
|
+
return Gs.resolve(n ? n.document.mutableCopy() : Wt.newInvalidDocument(e));
|
|
9689
9689
|
}
|
|
9690
9690
|
getEntries(t, e) {
|
|
9691
9691
|
let n = An();
|
|
9692
9692
|
return e.forEach((t => {
|
|
9693
9693
|
const e = this.docs.get(t);
|
|
9694
|
-
n = n.insert(t, e ? e.document.
|
|
9694
|
+
n = n.insert(t, e ? e.document.mutableCopy() : Wt.newInvalidDocument(t));
|
|
9695
9695
|
})), Gs.resolve(n);
|
|
9696
9696
|
}
|
|
9697
9697
|
getDocumentsMatchingQuery(t, e, n) {
|
|
@@ -9702,7 +9702,7 @@ class Cr {
|
|
|
9702
9702
|
for (;r.hasNext(); ) {
|
|
9703
9703
|
const {key: t, value: {document: i, readTime: o}} = r.getNext();
|
|
9704
9704
|
if (!e.path.isPrefixOf(t.path)) break;
|
|
9705
|
-
o.compareTo(n) <= 0 || Se(e, i) && (s = s.insert(i.key, i.
|
|
9705
|
+
o.compareTo(n) <= 0 || Se(e, i) && (s = s.insert(i.key, i.mutableCopy()));
|
|
9706
9706
|
}
|
|
9707
9707
|
return Gs.resolve(s);
|
|
9708
9708
|
}
|
|
@@ -9780,7 +9780,7 @@ class Nr extends zi {
|
|
|
9780
9780
|
* A ordered bidirectional mapping between documents and the remote target
|
|
9781
9781
|
* IDs.
|
|
9782
9782
|
*/
|
|
9783
|
-
this.Rs = new Vr, this.targetCount = 0, this.
|
|
9783
|
+
this.Rs = new Vr, this.targetCount = 0, this.bs = $i.ie();
|
|
9784
9784
|
}
|
|
9785
9785
|
forEachTarget(t, e) {
|
|
9786
9786
|
return this.Is.forEach(((t, n) => e(n))), Gs.resolve();
|
|
@@ -9792,7 +9792,7 @@ class Nr extends zi {
|
|
|
9792
9792
|
return Gs.resolve(this.As);
|
|
9793
9793
|
}
|
|
9794
9794
|
allocateTargetId(t) {
|
|
9795
|
-
return this.highestTargetId = this.
|
|
9795
|
+
return this.highestTargetId = this.bs.next(), Gs.resolve(this.highestTargetId);
|
|
9796
9796
|
}
|
|
9797
9797
|
setTargetsMetadata(t, e, n) {
|
|
9798
9798
|
return n && (this.lastRemoteSnapshotVersion = n), e > this.As && (this.As = e),
|
|
@@ -9801,7 +9801,7 @@ class Nr extends zi {
|
|
|
9801
9801
|
ce(t) {
|
|
9802
9802
|
this.Is.set(t.target, t);
|
|
9803
9803
|
const e = t.targetId;
|
|
9804
|
-
e > this.highestTargetId && (this.
|
|
9804
|
+
e > this.highestTargetId && (this.bs = new $i(e), this.highestTargetId = e), t.sequenceNumber > this.As && (this.As = t.sequenceNumber);
|
|
9805
9805
|
}
|
|
9806
9806
|
addTargetData(t, e) {
|
|
9807
9807
|
return this.ce(e), this.targetCount += 1, Gs.resolve();
|
|
@@ -9878,7 +9878,7 @@ class xr {
|
|
|
9878
9878
|
* checked or asserted on every access.
|
|
9879
9879
|
*/
|
|
9880
9880
|
constructor(t, e) {
|
|
9881
|
-
this.
|
|
9881
|
+
this.Ps = {}, this.Be = new et(0), this.Ue = !1, this.Ue = !0, this.referenceDelegate = t(this),
|
|
9882
9882
|
this.He = new kr(this);
|
|
9883
9883
|
this.Jt = new Ii, this.Je = function(t, e) {
|
|
9884
9884
|
return new Cr(t, e);
|
|
@@ -9904,8 +9904,8 @@ class xr {
|
|
|
9904
9904
|
return this.Jt;
|
|
9905
9905
|
}
|
|
9906
9906
|
getMutationQueue(t) {
|
|
9907
|
-
let e = this.
|
|
9908
|
-
return e || (e = new Dr(this.Jt, this.referenceDelegate), this.
|
|
9907
|
+
let e = this.Ps[t.toKey()];
|
|
9908
|
+
return e || (e = new Dr(this.Jt, this.referenceDelegate), this.Ps[t.toKey()] = e),
|
|
9909
9909
|
e;
|
|
9910
9910
|
}
|
|
9911
9911
|
getTargetCache() {
|
|
@@ -9924,7 +9924,7 @@ class xr {
|
|
|
9924
9924
|
t)));
|
|
9925
9925
|
}
|
|
9926
9926
|
Ds(t, e) {
|
|
9927
|
-
return Gs.or(Object.values(this.
|
|
9927
|
+
return Gs.or(Object.values(this.Ps).map((n => () => n.containsKey(t, e))));
|
|
9928
9928
|
}
|
|
9929
9929
|
}
|
|
9930
9930
|
|
|
@@ -10237,7 +10237,7 @@ class jr {
|
|
|
10237
10237
|
// mutations but before we observe WebStorage events.
|
|
10238
10238
|
this.window.addEventListener("storage", this.Us);
|
|
10239
10239
|
}
|
|
10240
|
-
/** Returns 'true' if WebStorage is available in the current environment. */ static
|
|
10240
|
+
/** Returns 'true' if WebStorage is available in the current environment. */ static Pt(t) {
|
|
10241
10241
|
return !(!t || !t.localStorage);
|
|
10242
10242
|
}
|
|
10243
10243
|
async start() {
|
|
@@ -10583,10 +10583,10 @@ class Wr {
|
|
|
10583
10583
|
*/
|
|
10584
10584
|
class zr {
|
|
10585
10585
|
constructor() {
|
|
10586
|
-
this.Ii = () => this.Ai(), this.Ri = () => this.
|
|
10586
|
+
this.Ii = () => this.Ai(), this.Ri = () => this.bi(), this.Pi = [], this.vi();
|
|
10587
10587
|
}
|
|
10588
10588
|
Ei(t) {
|
|
10589
|
-
this.
|
|
10589
|
+
this.Pi.push(t);
|
|
10590
10590
|
}
|
|
10591
10591
|
shutdown() {
|
|
10592
10592
|
window.removeEventListener("online", this.Ii), window.removeEventListener("offline", this.Ri);
|
|
@@ -10596,16 +10596,16 @@ class zr {
|
|
|
10596
10596
|
}
|
|
10597
10597
|
Ai() {
|
|
10598
10598
|
$("ConnectivityMonitor", "Network connectivity changed: AVAILABLE");
|
|
10599
|
-
for (const t of this.
|
|
10599
|
+
for (const t of this.Pi) t(0 /* AVAILABLE */);
|
|
10600
10600
|
}
|
|
10601
|
-
|
|
10601
|
+
bi() {
|
|
10602
10602
|
$("ConnectivityMonitor", "Network connectivity changed: UNAVAILABLE");
|
|
10603
|
-
for (const t of this.
|
|
10603
|
+
for (const t of this.Pi) t(1 /* UNAVAILABLE */);
|
|
10604
10604
|
}
|
|
10605
10605
|
// TODO(chenbrian): Consider passing in window either into this component or
|
|
10606
10606
|
// here for testing via FakeWindow.
|
|
10607
10607
|
/** Checks that all used attributes of window are available. */
|
|
10608
|
-
static
|
|
10608
|
+
static Pt() {
|
|
10609
10609
|
return "undefined" != typeof window && void 0 !== window.addEventListener && void 0 !== window.removeEventListener;
|
|
10610
10610
|
}
|
|
10611
10611
|
}
|
|
@@ -11327,14 +11327,14 @@ class no {
|
|
|
11327
11327
|
const e = t.targetChange;
|
|
11328
11328
|
return e.targetIds && e.targetIds.length ? ct.min() : e.readTime ? Gn(e.readTime) : ct.min();
|
|
11329
11329
|
}(t);
|
|
11330
|
-
return this.listener.
|
|
11330
|
+
return this.listener.br(e, n);
|
|
11331
11331
|
}
|
|
11332
11332
|
/**
|
|
11333
11333
|
* Registers interest in the results of the given target. If the target
|
|
11334
11334
|
* includes a resumeToken it will be included in the request. Results that
|
|
11335
11335
|
* affect the target will be streamed back as WatchChange messages that
|
|
11336
11336
|
* reference the targetId.
|
|
11337
|
-
*/
|
|
11337
|
+
*/ Pr(t) {
|
|
11338
11338
|
const e = {};
|
|
11339
11339
|
e.database = ts(this.k), e.addTarget = function(t, e) {
|
|
11340
11340
|
let n;
|
|
@@ -11683,7 +11683,7 @@ function ho(t, e) {
|
|
|
11683
11683
|
* We need to increment the the expected number of pending responses we're due
|
|
11684
11684
|
* from watch so we wait for the ack to process any messages from this target.
|
|
11685
11685
|
*/ function fo(t, e) {
|
|
11686
|
-
t.Yr.X(e.targetId), xo(t).
|
|
11686
|
+
t.Yr.X(e.targetId), xo(t).Pr(e);
|
|
11687
11687
|
}
|
|
11688
11688
|
|
|
11689
11689
|
/**
|
|
@@ -11841,13 +11841,13 @@ async function Eo(t, e, n) {
|
|
|
11841
11841
|
async function Ro(t) {
|
|
11842
11842
|
const e = q(t), n = $o(e);
|
|
11843
11843
|
let s = e.Qr.length > 0 ? e.Qr[e.Qr.length - 1].batchId : -1;
|
|
11844
|
-
for (;
|
|
11844
|
+
for (;bo(e); ) try {
|
|
11845
11845
|
const t = await yr(e.localStore, s);
|
|
11846
11846
|
if (null === t) {
|
|
11847
11847
|
0 === e.Qr.length && n._r();
|
|
11848
11848
|
break;
|
|
11849
11849
|
}
|
|
11850
|
-
s = t.batchId,
|
|
11850
|
+
s = t.batchId, Po(e, t);
|
|
11851
11851
|
} catch (t) {
|
|
11852
11852
|
await Io(e, t);
|
|
11853
11853
|
}
|
|
@@ -11857,14 +11857,14 @@ async function Ro(t) {
|
|
|
11857
11857
|
/**
|
|
11858
11858
|
* Returns true if we can add to the write pipeline (i.e. the network is
|
|
11859
11859
|
* enabled and the write pipeline is not full).
|
|
11860
|
-
*/ function
|
|
11860
|
+
*/ function bo(t) {
|
|
11861
11861
|
return go(t) && t.Qr.length < 10;
|
|
11862
11862
|
}
|
|
11863
11863
|
|
|
11864
11864
|
/**
|
|
11865
11865
|
* Queues additional writes to be sent to the write stream, sending them
|
|
11866
11866
|
* immediately if the write stream is established.
|
|
11867
|
-
*/ function
|
|
11867
|
+
*/ function Po(t, e) {
|
|
11868
11868
|
t.Qr.push(e);
|
|
11869
11869
|
const n = $o(t);
|
|
11870
11870
|
n.lr() && n.Sr && n.Dr(e.mutations);
|
|
@@ -11964,7 +11964,7 @@ async function ko(t, e) {
|
|
|
11964
11964
|
*/ (t.datastore, t.asyncQueue, {
|
|
11965
11965
|
Di: po.bind(null, t),
|
|
11966
11966
|
Ni: To.bind(null, t),
|
|
11967
|
-
|
|
11967
|
+
br: Eo.bind(null, t)
|
|
11968
11968
|
}), t.zr.push((async e => {
|
|
11969
11969
|
e ? (t.Xr.wr(), mo(t) ? _o(t) : t.Jr.set("Unknown" /* Unknown */)) : (await t.Xr.stop(),
|
|
11970
11970
|
yo(t));
|
|
@@ -12116,7 +12116,7 @@ class Fo {
|
|
|
12116
12116
|
// We are adding document key comparator to the end as it's the only
|
|
12117
12117
|
// guaranteed unique property of a document.
|
|
12118
12118
|
this.comparator = t ? (e, n) => t(e, n) || St.comparator(e.key, n.key) : (t, e) => St.comparator(t.key, e.key),
|
|
12119
|
-
this.keyedMap =
|
|
12119
|
+
this.keyedMap = bn(), this.sortedSet = new gn(this.comparator);
|
|
12120
12120
|
}
|
|
12121
12121
|
/**
|
|
12122
12122
|
* Returns an empty copy of the existing DocumentSet, using the same
|
|
@@ -12263,7 +12263,7 @@ class Bo {
|
|
|
12263
12263
|
return !this.mutatedKeys.isEmpty();
|
|
12264
12264
|
}
|
|
12265
12265
|
isEqual(t) {
|
|
12266
|
-
if (!(this.fromCache === t.fromCache && this.syncStateChanged === t.syncStateChanged && this.mutatedKeys.isEqual(t.mutatedKeys) &&
|
|
12266
|
+
if (!(this.fromCache === t.fromCache && this.syncStateChanged === t.syncStateChanged && this.mutatedKeys.isEqual(t.mutatedKeys) && Pe(this.query, t.query) && this.docs.isEqual(t.docs) && this.oldDocs.isEqual(t.oldDocs))) return !1;
|
|
12267
12267
|
const e = this.docChanges, n = t.docChanges;
|
|
12268
12268
|
if (e.length !== n.length) return !1;
|
|
12269
12269
|
for (let t = 0; t < e.length; t++) if (e[t].type !== n[t].type || !e[t].doc.isEqual(n[t].doc)) return !1;
|
|
@@ -12298,7 +12298,7 @@ class Bo {
|
|
|
12298
12298
|
|
|
12299
12299
|
class qo {
|
|
12300
12300
|
constructor() {
|
|
12301
|
-
this.queries = new Gi((t => ve(t)),
|
|
12301
|
+
this.queries = new Gi((t => ve(t)), Pe), this.onlineState = "Unknown" /* Unknown */ ,
|
|
12302
12302
|
this.io = new Set;
|
|
12303
12303
|
}
|
|
12304
12304
|
}
|
|
@@ -12531,8 +12531,8 @@ function Go(t) {
|
|
|
12531
12531
|
/**
|
|
12532
12532
|
* Update the progress to 'Success' and return the updated progress.
|
|
12533
12533
|
*/ async complete() {
|
|
12534
|
-
const t = await
|
|
12535
|
-
for (const t of this.queries) await
|
|
12534
|
+
const t = await br(this.localStore, new Jo(this.k), this.documents, this.mo.id), e = this.po(this.documents);
|
|
12535
|
+
for (const t of this.queries) await Pr(this.localStore, t, e.get(t.name));
|
|
12536
12536
|
return this.progress.taskState = "Success", new ar(Object.assign({}, this.progress), t);
|
|
12537
12537
|
}
|
|
12538
12538
|
}
|
|
@@ -12606,7 +12606,7 @@ class ta {
|
|
|
12606
12606
|
/**
|
|
12607
12607
|
* The set of remote documents that the server has told us belongs to the target associated with
|
|
12608
12608
|
* this view.
|
|
12609
|
-
*/ get
|
|
12609
|
+
*/ get bo() {
|
|
12610
12610
|
return this.To;
|
|
12611
12611
|
}
|
|
12612
12612
|
/**
|
|
@@ -12618,7 +12618,7 @@ class ta {
|
|
|
12618
12618
|
* @param previousChanges - If this is being called with a refill, then start
|
|
12619
12619
|
* with this set of docs and changes instead of the current view.
|
|
12620
12620
|
* @returns a new set of docs, changes, and refill flag.
|
|
12621
|
-
*/
|
|
12621
|
+
*/ Po(t, e) {
|
|
12622
12622
|
const n = e ? e.vo : new Lo, s = e ? e.Ro : this.Ro;
|
|
12623
12623
|
let i = e ? e.mutatedKeys : this.mutatedKeys, r = s, o = !1;
|
|
12624
12624
|
// Track the last doc in a (full) limit. This is necessary, because some
|
|
@@ -12826,7 +12826,7 @@ class ta {
|
|
|
12826
12826
|
// PORTING NOTE: Multi-tab only.
|
|
12827
12827
|
ko(t) {
|
|
12828
12828
|
this.To = t.zn, this.Io = Sn();
|
|
12829
|
-
const e = this.
|
|
12829
|
+
const e = this.Po(t.documents);
|
|
12830
12830
|
return this.applyChanges(e, /*updateLimboDocuments=*/ !0);
|
|
12831
12831
|
}
|
|
12832
12832
|
/**
|
|
@@ -12896,7 +12896,7 @@ class na {
|
|
|
12896
12896
|
// PORTING NOTE: Manages state synchronization in multi-tab environments.
|
|
12897
12897
|
s, i, r) {
|
|
12898
12898
|
this.localStore = t, this.remoteStore = e, this.eventManager = n, this.sharedClientState = s,
|
|
12899
|
-
this.currentUser = i, this.maxConcurrentLimboResolutions = r, this.Fo = {}, this.Oo = new Gi((t => ve(t)),
|
|
12899
|
+
this.currentUser = i, this.maxConcurrentLimboResolutions = r, this.Fo = {}, this.Oo = new Gi((t => ve(t)), Pe),
|
|
12900
12900
|
this.Mo = new Map,
|
|
12901
12901
|
/**
|
|
12902
12902
|
* The keys of documents that are in limbo for which we haven't yet started a
|
|
@@ -12963,19 +12963,19 @@ async function ra(t, e) {
|
|
|
12963
12963
|
// targets based on view changes. This allows us to only depend on Limbo
|
|
12964
12964
|
// changes when user code includes queries.
|
|
12965
12965
|
t.Go = (e, n, s) => async function(t, e, n, s) {
|
|
12966
|
-
let i = e.view.
|
|
12966
|
+
let i = e.view.Po(n);
|
|
12967
12967
|
i.Bn && (
|
|
12968
12968
|
// The query has a limit and some docs were removed, so we need
|
|
12969
12969
|
// to re-run the query against the local store to make sure we
|
|
12970
12970
|
// didn't lose any good docs that had been past the limit.
|
|
12971
12971
|
i = await Er(t.localStore, e.query,
|
|
12972
|
-
/* usePreviousResults= */ !1).then((({documents: t}) => e.view.
|
|
12972
|
+
/* usePreviousResults= */ !1).then((({documents: t}) => e.view.Po(t, i))));
|
|
12973
12973
|
const r = s && s.targetChanges.get(e.targetId), o = e.view.applyChanges(i,
|
|
12974
12974
|
/* updateLimboDocuments= */ t.isPrimaryClient, r);
|
|
12975
12975
|
return pa(t, e.targetId, o.Co), o.snapshot;
|
|
12976
12976
|
}(t, e, n, s);
|
|
12977
12977
|
const i = await Er(t.localStore, e,
|
|
12978
|
-
/* usePreviousResults= */ !0), r = new ea(e, i.zn), o = r.
|
|
12978
|
+
/* usePreviousResults= */ !0), r = new ea(e, i.zn), o = r.Po(i.documents), a = kn.createSynthesizedTargetChangeForCurrentChange(n, s && "Offline" /* Offline */ !== t.onlineState), c = r.applyChanges(o,
|
|
12979
12979
|
/* updateLimboDocuments= */ t.isPrimaryClient, a);
|
|
12980
12980
|
pa(t, n, c.Co);
|
|
12981
12981
|
const u = new na(e, n, r);
|
|
@@ -12984,7 +12984,7 @@ async function ra(t, e) {
|
|
|
12984
12984
|
|
|
12985
12985
|
/** Stops listening to the query. */ async function aa(t, e) {
|
|
12986
12986
|
const n = q(t), s = n.Oo.get(e), i = n.Mo.get(s.targetId);
|
|
12987
|
-
if (i.length > 1) return n.Mo.set(s.targetId, i.filter((t => !
|
|
12987
|
+
if (i.length > 1) return n.Mo.set(s.targetId, i.filter((t => !Pe(t, e)))), void n.Oo.delete(e);
|
|
12988
12988
|
// No other queries are mapped to the target, clean up the query and the target.
|
|
12989
12989
|
if (n.isPrimaryClient) {
|
|
12990
12990
|
// We need to remove the local query target first to allow us to verify
|
|
@@ -13099,7 +13099,7 @@ async function ra(t, e) {
|
|
|
13099
13099
|
// Run global snapshot listeners if a consistent snapshot has been emitted.
|
|
13100
13100
|
t.ro(e) && (s = !0);
|
|
13101
13101
|
})), s && Go(n);
|
|
13102
|
-
}(s.eventManager, e), t.length && s.Fo.
|
|
13102
|
+
}(s.eventManager, e), t.length && s.Fo.br(t), s.onlineState = e, s.isPrimaryClient && s.sharedClientState.setOnlineState(e);
|
|
13103
13103
|
}
|
|
13104
13104
|
}
|
|
13105
13105
|
|
|
@@ -13287,7 +13287,7 @@ async function Ia(t, e, n) {
|
|
|
13287
13287
|
r.push(e);
|
|
13288
13288
|
}
|
|
13289
13289
|
})));
|
|
13290
|
-
})), await Promise.all(o), s.Fo.
|
|
13290
|
+
})), await Promise.all(o), s.Fo.br(i), await async function(t, e) {
|
|
13291
13291
|
const n = q(t);
|
|
13292
13292
|
try {
|
|
13293
13293
|
await n.persistence.runTransaction("notifyLocalViewChanges", "readwrite", (t => Gs.forEach(e, (e => Gs.forEach(e.kn, (s => n.persistence.referenceDelegate.addReference(t, e.targetId, s))).next((() => Gs.forEach(e.xn, (s => n.persistence.referenceDelegate.removeReference(t, e.targetId, s)))))))));
|
|
@@ -13338,7 +13338,7 @@ function Ra(t, e) {
|
|
|
13338
13338
|
if (!s) return t;
|
|
13339
13339
|
for (const e of s) {
|
|
13340
13340
|
const s = n.Oo.get(e);
|
|
13341
|
-
t = t.unionWith(s.view.
|
|
13341
|
+
t = t.unionWith(s.view.bo);
|
|
13342
13342
|
}
|
|
13343
13343
|
return t;
|
|
13344
13344
|
}
|
|
@@ -13347,7 +13347,7 @@ function Ra(t, e) {
|
|
|
13347
13347
|
/**
|
|
13348
13348
|
* Reconcile the list of synced documents in an existing view with those
|
|
13349
13349
|
* from persistence.
|
|
13350
|
-
*/ async function
|
|
13350
|
+
*/ async function ba(t, e) {
|
|
13351
13351
|
const n = q(t), s = await Er(n.localStore, e.query,
|
|
13352
13352
|
/* usePreviousResults= */ !0), i = e.view.ko(s);
|
|
13353
13353
|
return n.isPrimaryClient && pa(n, e.targetId, i.Co), i;
|
|
@@ -13358,7 +13358,7 @@ function Ra(t, e) {
|
|
|
13358
13358
|
* snapshots if needed.
|
|
13359
13359
|
*/
|
|
13360
13360
|
// PORTING NOTE: Multi-Tab only.
|
|
13361
|
-
async function
|
|
13361
|
+
async function Pa(t) {
|
|
13362
13362
|
const e = q(t);
|
|
13363
13363
|
return Ar(e.localStore).then((t => Ia(e, t)));
|
|
13364
13364
|
}
|
|
@@ -13450,7 +13450,7 @@ async function Sa(t, e, n) {
|
|
|
13450
13450
|
// state (the list of syncedDocuments may have gotten out of sync).
|
|
13451
13451
|
e = await pr(s.localStore, Re(n[0]));
|
|
13452
13452
|
for (const t of n) {
|
|
13453
|
-
const e = s.Oo.get(t), n = await
|
|
13453
|
+
const e = s.Oo.get(t), n = await ba(s, e);
|
|
13454
13454
|
n.snapshot && r.push(n.snapshot);
|
|
13455
13455
|
}
|
|
13456
13456
|
} else {
|
|
@@ -13462,7 +13462,7 @@ async function Sa(t, e, n) {
|
|
|
13462
13462
|
}
|
|
13463
13463
|
i.push(e);
|
|
13464
13464
|
}
|
|
13465
|
-
return s.Fo.
|
|
13465
|
+
return s.Fo.br(r), i;
|
|
13466
13466
|
}
|
|
13467
13467
|
|
|
13468
13468
|
/**
|
|
@@ -13541,7 +13541,7 @@ async function Na(t, e, n, s) {
|
|
|
13541
13541
|
function xa(t) {
|
|
13542
13542
|
const e = q(t);
|
|
13543
13543
|
return e.remoteStore.remoteSyncer.applyRemoteEvent = ua.bind(null, e), e.remoteStore.remoteSyncer.getRemoteKeysForTarget = Ra.bind(null, e),
|
|
13544
|
-
e.remoteStore.remoteSyncer.rejectListen = la.bind(null, e), e.Fo.
|
|
13544
|
+
e.remoteStore.remoteSyncer.rejectListen = la.bind(null, e), e.Fo.br = Qo.bind(null, e.eventManager),
|
|
13545
13545
|
e.Fo.zo = Wo.bind(null, e.eventManager), e;
|
|
13546
13546
|
}
|
|
13547
13547
|
|
|
@@ -13705,7 +13705,7 @@ class Oa {
|
|
|
13705
13705
|
gi: Na.bind(null, e),
|
|
13706
13706
|
yi: ka.bind(null, e),
|
|
13707
13707
|
Tn: Ca.bind(null, e),
|
|
13708
|
-
_i:
|
|
13708
|
+
_i: Pa.bind(null, e)
|
|
13709
13709
|
}, await this.sharedClientState.start()),
|
|
13710
13710
|
// NOTE: This will immediately call the listener, so we make sure to
|
|
13711
13711
|
// set it after localStore / remoteStore are started.
|
|
@@ -13715,7 +13715,7 @@ class Oa {
|
|
|
13715
13715
|
}
|
|
13716
13716
|
Jo(t) {
|
|
13717
13717
|
const e = Xr();
|
|
13718
|
-
if (!Qr.
|
|
13718
|
+
if (!Qr.Pt(e)) throw new j(K.UNIMPLEMENTED, "IndexedDB persistence is only available on platforms that support LocalStorage.");
|
|
13719
13719
|
const n = or(t.databaseInfo.databaseId, t.databaseInfo.persistenceKey);
|
|
13720
13720
|
return new Qr(e, t.asyncQueue, n, t.clientId, t.initialUser);
|
|
13721
13721
|
}
|
|
@@ -13745,7 +13745,7 @@ class Oa {
|
|
|
13745
13745
|
}
|
|
13746
13746
|
createRemoteStore(t) {
|
|
13747
13747
|
return e = this.localStore, n = this.datastore, s = t.asyncQueue, i = t => ha(this.syncEngine, t, 0 /* RemoteStore */),
|
|
13748
|
-
r = zr.
|
|
13748
|
+
r = zr.Pt() ? new zr : new Gr, new ao(e, n, s, i, r);
|
|
13749
13749
|
var e, n, s, i, r;
|
|
13750
13750
|
/** Re-enables the network. Idempotent. */ }
|
|
13751
13751
|
createSyncEngine(t, e) {
|
|
@@ -14190,7 +14190,7 @@ class Qa {
|
|
|
14190
14190
|
da(t) {
|
|
14191
14191
|
try {
|
|
14192
14192
|
const e = this.updateFunction(t);
|
|
14193
|
-
return !
|
|
14193
|
+
return !Pt(e) && e.catch && e.then ? e : (this.deferred.reject(Error("Transaction callback must return a Promise")),
|
|
14194
14194
|
null);
|
|
14195
14195
|
} catch (t) {
|
|
14196
14196
|
// Do not retry errors thrown by user provided updateFunction.
|
|
@@ -14437,7 +14437,7 @@ function oc(t, e) {
|
|
|
14437
14437
|
return t.asyncQueue.enqueueAndForget((async () => async function(t, e, n) {
|
|
14438
14438
|
try {
|
|
14439
14439
|
const s = await Er(t, e,
|
|
14440
|
-
/* usePreviousResults= */ !0), i = new ea(e, s.zn), r = i.
|
|
14440
|
+
/* usePreviousResults= */ !0), i = new ea(e, s.zn), r = i.Po(s.documents), o = i.applyChanges(r,
|
|
14441
14441
|
/* updateLimboDocuments= */ !1);
|
|
14442
14442
|
n.resolve(o.snapshot);
|
|
14443
14443
|
} catch (t) {
|
|
@@ -14901,7 +14901,7 @@ function Rc(t, e, n, s = {}) {
|
|
|
14901
14901
|
* A `DocumentReference` refers to a document location in a Firestore database
|
|
14902
14902
|
* and can be used to write, read, or listen to the location. The document at
|
|
14903
14903
|
* the referenced location may or may not exist.
|
|
14904
|
-
*/ class
|
|
14904
|
+
*/ class bc {
|
|
14905
14905
|
/** @hideconstructor */
|
|
14906
14906
|
constructor(t,
|
|
14907
14907
|
/**
|
|
@@ -14932,14 +14932,14 @@ function Rc(t, e, n, s = {}) {
|
|
|
14932
14932
|
return new vc(this.firestore, this.converter, this._key.path.popLast());
|
|
14933
14933
|
}
|
|
14934
14934
|
withConverter(t) {
|
|
14935
|
-
return new
|
|
14935
|
+
return new bc(this.firestore, t, this._key);
|
|
14936
14936
|
}
|
|
14937
14937
|
}
|
|
14938
14938
|
|
|
14939
14939
|
/**
|
|
14940
14940
|
* A `Query` refers to a query which you can read or listen to. You can also
|
|
14941
14941
|
* construct refined `Query` objects by adding filters and ordering.
|
|
14942
|
-
*/ class
|
|
14942
|
+
*/ class Pc {
|
|
14943
14943
|
// This is the lite version of the Query class in the main SDK.
|
|
14944
14944
|
/** @hideconstructor protected */
|
|
14945
14945
|
constructor(t,
|
|
@@ -14952,14 +14952,14 @@ function Rc(t, e, n, s = {}) {
|
|
|
14952
14952
|
this.type = "query", this.firestore = t;
|
|
14953
14953
|
}
|
|
14954
14954
|
withConverter(t) {
|
|
14955
|
-
return new
|
|
14955
|
+
return new Pc(this.firestore, t, this._query);
|
|
14956
14956
|
}
|
|
14957
14957
|
}
|
|
14958
14958
|
|
|
14959
14959
|
/**
|
|
14960
14960
|
* A `CollectionReference` object can be used for adding documents, getting
|
|
14961
14961
|
* document references, and querying for documents (using {@link query}).
|
|
14962
|
-
*/ class vc extends
|
|
14962
|
+
*/ class vc extends Pc {
|
|
14963
14963
|
/** @hideconstructor */
|
|
14964
14964
|
constructor(t, e, n) {
|
|
14965
14965
|
super(t, e, ge(n)), this._path = n,
|
|
@@ -14980,7 +14980,7 @@ function Rc(t, e, n, s = {}) {
|
|
|
14980
14980
|
* subcollection. If this isn't a subcollection, the reference is null.
|
|
14981
14981
|
*/ get parent() {
|
|
14982
14982
|
const t = this._path.popLast();
|
|
14983
|
-
return t.isEmpty() ? null : new
|
|
14983
|
+
return t.isEmpty() ? null : new bc(this.firestore,
|
|
14984
14984
|
/* converter= */ null, new St(t));
|
|
14985
14985
|
}
|
|
14986
14986
|
withConverter(t) {
|
|
@@ -14994,7 +14994,7 @@ function Vc(t, e, ...n) {
|
|
|
14994
14994
|
return yc(s), new vc(t, /* converter= */ null, s);
|
|
14995
14995
|
}
|
|
14996
14996
|
{
|
|
14997
|
-
if (!(t instanceof
|
|
14997
|
+
if (!(t instanceof bc || t instanceof vc)) throw new j(K.INVALID_ARGUMENT, "Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");
|
|
14998
14998
|
const s = t._path.child(dt.fromString(e, ...n));
|
|
14999
14999
|
return yc(s), new vc(t.firestore,
|
|
15000
15000
|
/* converter= */ null, s);
|
|
@@ -15015,7 +15015,7 @@ function Vc(t, e, ...n) {
|
|
|
15015
15015
|
* @returns The created `Query`.
|
|
15016
15016
|
*/ function Sc(t, e) {
|
|
15017
15017
|
if (t = Tc(t, Ac), _c("collectionGroup", "collection id", e), e.indexOf("/") >= 0) throw new j(K.INVALID_ARGUMENT, `Invalid collection ID '${e}' passed to function collectionGroup(). Collection IDs must not contain '/'.`);
|
|
15018
|
-
return new
|
|
15018
|
+
return new Pc(t,
|
|
15019
15019
|
/* converter= */ null,
|
|
15020
15020
|
/**
|
|
15021
15021
|
* Creates a new Query for a collection group query that matches all documents
|
|
@@ -15032,13 +15032,13 @@ function Dc(t, e, ...n) {
|
|
|
15032
15032
|
// 'undefined' and 'null'.
|
|
15033
15033
|
1 === arguments.length && (e = st.A()), _c("doc", "path", e), t instanceof Ac) {
|
|
15034
15034
|
const s = dt.fromString(e, ...n);
|
|
15035
|
-
return gc(s), new
|
|
15035
|
+
return gc(s), new bc(t,
|
|
15036
15036
|
/* converter= */ null, new St(s));
|
|
15037
15037
|
}
|
|
15038
15038
|
{
|
|
15039
|
-
if (!(t instanceof
|
|
15039
|
+
if (!(t instanceof bc || t instanceof vc)) throw new j(K.INVALID_ARGUMENT, "Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");
|
|
15040
15040
|
const s = t._path.child(dt.fromString(e, ...n));
|
|
15041
|
-
return gc(s), new
|
|
15041
|
+
return gc(s), new bc(t.firestore, t instanceof vc ? t.converter : null, new St(s));
|
|
15042
15042
|
}
|
|
15043
15043
|
}
|
|
15044
15044
|
|
|
@@ -15050,7 +15050,7 @@ function Dc(t, e, ...n) {
|
|
|
15050
15050
|
* @returns true if the references point to the same location in the same
|
|
15051
15051
|
* Firestore database.
|
|
15052
15052
|
*/ function Cc(t, e) {
|
|
15053
|
-
return t = getModularInstance(t), e = getModularInstance(e), (t instanceof
|
|
15053
|
+
return t = getModularInstance(t), e = getModularInstance(e), (t instanceof bc || t instanceof vc) && (e instanceof bc || e instanceof vc) && (t.firestore === e.firestore && t.path === e.path && t.converter === e.converter);
|
|
15054
15054
|
}
|
|
15055
15055
|
|
|
15056
15056
|
/**
|
|
@@ -15062,7 +15062,7 @@ function Dc(t, e, ...n) {
|
|
|
15062
15062
|
* @returns true if the references point to the same location in the same
|
|
15063
15063
|
* Firestore database.
|
|
15064
15064
|
*/ function Nc(t, e) {
|
|
15065
|
-
return t = getModularInstance(t), e = getModularInstance(e), t instanceof
|
|
15065
|
+
return t = getModularInstance(t), e = getModularInstance(e), t instanceof Pc && e instanceof Pc && (t.firestore === e.firestore && Pe(t._query, e._query) && t.converter === e.converter);
|
|
15066
15066
|
}
|
|
15067
15067
|
|
|
15068
15068
|
/**
|
|
@@ -15125,9 +15125,9 @@ function Dc(t, e, ...n) {
|
|
|
15125
15125
|
this.enqueue(t);
|
|
15126
15126
|
}
|
|
15127
15127
|
enqueueAndForgetEvenWhileRestricted(t) {
|
|
15128
|
-
this.
|
|
15128
|
+
this.ba(),
|
|
15129
15129
|
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
15130
|
-
this.
|
|
15130
|
+
this.Pa(t);
|
|
15131
15131
|
}
|
|
15132
15132
|
enterRestrictedMode(t) {
|
|
15133
15133
|
if (!this.ya) {
|
|
@@ -15137,14 +15137,14 @@ function Dc(t, e, ...n) {
|
|
|
15137
15137
|
}
|
|
15138
15138
|
}
|
|
15139
15139
|
enqueue(t) {
|
|
15140
|
-
if (this.
|
|
15140
|
+
if (this.ba(), this.ya)
|
|
15141
15141
|
// Return a Promise which never resolves.
|
|
15142
15142
|
return new Promise((() => {}));
|
|
15143
15143
|
// Create a deferred Promise that we can return to the callee. This
|
|
15144
15144
|
// allows us to return a "hanging Promise" only to the callee and still
|
|
15145
15145
|
// advance the queue even when the operation is not run.
|
|
15146
15146
|
const e = new Q;
|
|
15147
|
-
return this.
|
|
15147
|
+
return this.Pa((() => this.ya && this.Ia ? Promise.resolve() : (t().then(e.resolve, e.reject),
|
|
15148
15148
|
e.promise))).then((() => e.promise));
|
|
15149
15149
|
}
|
|
15150
15150
|
enqueueRetryable(t) {
|
|
@@ -15176,7 +15176,7 @@ function Dc(t, e, ...n) {
|
|
|
15176
15176
|
this.ur.Zi((() => this.va()));
|
|
15177
15177
|
}
|
|
15178
15178
|
}
|
|
15179
|
-
|
|
15179
|
+
Pa(t) {
|
|
15180
15180
|
const e = this.ma.then((() => (this.Ea = !0, t().catch((t => {
|
|
15181
15181
|
this.Ta = t, this.Ea = !1;
|
|
15182
15182
|
const e =
|
|
@@ -15214,13 +15214,13 @@ function Dc(t, e, ...n) {
|
|
|
15214
15214
|
return this.ma = e, e;
|
|
15215
15215
|
}
|
|
15216
15216
|
enqueueAfterDelay(t, e, n) {
|
|
15217
|
-
this.
|
|
15217
|
+
this.ba(),
|
|
15218
15218
|
// Fast-forward delays for timerIds that have been overriden.
|
|
15219
15219
|
this.Aa.indexOf(t) > -1 && (e = 0);
|
|
15220
15220
|
const s = Fo.createAndSchedule(this, t, e, n, (t => this.Va(t)));
|
|
15221
15221
|
return this.pa.push(s), s;
|
|
15222
15222
|
}
|
|
15223
|
-
|
|
15223
|
+
ba() {
|
|
15224
15224
|
this.Ta && L();
|
|
15225
15225
|
}
|
|
15226
15226
|
verifyOperationInProgress() {}
|
|
@@ -15587,7 +15587,7 @@ function Qc(t) {
|
|
|
15587
15587
|
return t._queue.enqueueAndForgetEvenWhileRestricted((async () => {
|
|
15588
15588
|
try {
|
|
15589
15589
|
await async function(t) {
|
|
15590
|
-
if (!Hs.
|
|
15590
|
+
if (!Hs.Pt()) return Promise.resolve();
|
|
15591
15591
|
const e = t + "main";
|
|
15592
15592
|
await Hs.delete(e);
|
|
15593
15593
|
}(or(t._databaseId, t._persistenceKey)), e.resolve();
|
|
@@ -15686,7 +15686,7 @@ function Qc(t) {
|
|
|
15686
15686
|
* with resulting documents), and loaded to local cache using `loadBundle`. Once in local
|
|
15687
15687
|
* cache, use this method to extract a {@link Query} by name.
|
|
15688
15688
|
*/ function Yc(t, e) {
|
|
15689
|
-
return lc(Bc(t = Tc(t, Oc)), e).then((e => e ? new
|
|
15689
|
+
return lc(Bc(t = Tc(t, Oc)), e).then((e => e ? new Pc(t, null, e.query) : null));
|
|
15690
15690
|
}
|
|
15691
15691
|
|
|
15692
15692
|
function Xc(t) {
|
|
@@ -16091,7 +16091,7 @@ function hu(t) {
|
|
|
16091
16091
|
if (r.merge) c = new mt(o.fieldMask), u = o.fieldTransforms; else if (r.mergeFields) {
|
|
16092
16092
|
const t = [];
|
|
16093
16093
|
for (const s of r.mergeFields) {
|
|
16094
|
-
const i =
|
|
16094
|
+
const i = bu(e, s, n);
|
|
16095
16095
|
if (!o.contains(i)) throw new j(K.INVALID_ARGUMENT, `Field '${i}' is specified in your field mask but missing from your input data.`);
|
|
16096
16096
|
Su(t, i) || t.push(i);
|
|
16097
16097
|
}
|
|
@@ -16211,9 +16211,9 @@ class gu extends nu {
|
|
|
16211
16211
|
}
|
|
16212
16212
|
|
|
16213
16213
|
/** Parse update data from a list of field/value arguments. */ function pu(t, e, n, s, i, r) {
|
|
16214
|
-
const o = t.ja(1 /* Update */ , e, n), a = [
|
|
16214
|
+
const o = t.ja(1 /* Update */ , e, n), a = [ bu(e, s, n) ], c = [ i ];
|
|
16215
16215
|
if (r.length % 2 != 0) throw new j(K.INVALID_ARGUMENT, `Function ${e}() needs to be called with an even number of arguments that alternate between field names and values.`);
|
|
16216
|
-
for (let t = 0; t < r.length; t += 2) a.push(
|
|
16216
|
+
for (let t = 0; t < r.length; t += 2) a.push(bu(e, r[t])), c.push(r[t + 1]);
|
|
16217
16217
|
const u = [], h = jt.empty();
|
|
16218
16218
|
// We iterate in reverse order to pick the last value for a field if the
|
|
16219
16219
|
// user specified the field multiple times.
|
|
@@ -16350,7 +16350,7 @@ class gu extends nu {
|
|
|
16350
16350
|
if (t instanceof eu) return {
|
|
16351
16351
|
bytesValue: Qn(e.k, t._byteString)
|
|
16352
16352
|
};
|
|
16353
|
-
if (t instanceof
|
|
16353
|
+
if (t instanceof bc) {
|
|
16354
16354
|
const n = e.databaseId, s = t.firestore._databaseId;
|
|
16355
16355
|
if (!s.isEqual(n)) throw e.Ua(`Document reference is for database ${s.projectId}/${s.database} but should be for database ${n.projectId}/${n.database}`);
|
|
16356
16356
|
return {
|
|
@@ -16384,7 +16384,7 @@ function Iu(t, e) {
|
|
|
16384
16384
|
}
|
|
16385
16385
|
|
|
16386
16386
|
function Au(t) {
|
|
16387
|
-
return !("object" != typeof t || null === t || t instanceof Array || t instanceof Date || t instanceof at || t instanceof su || t instanceof eu || t instanceof
|
|
16387
|
+
return !("object" != typeof t || null === t || t instanceof Array || t instanceof Date || t instanceof at || t instanceof su || t instanceof eu || t instanceof bc || t instanceof nu);
|
|
16388
16388
|
}
|
|
16389
16389
|
|
|
16390
16390
|
function Ru(t, e, n) {
|
|
@@ -16398,7 +16398,7 @@ function Ru(t, e, n) {
|
|
|
16398
16398
|
|
|
16399
16399
|
/**
|
|
16400
16400
|
* Helper that calls fromDotSeparatedString() but wraps any error thrown.
|
|
16401
|
-
*/ function
|
|
16401
|
+
*/ function bu(t, e, n) {
|
|
16402
16402
|
if ((
|
|
16403
16403
|
// If required, replace the FieldPath Compat class with with the firestore-exp
|
|
16404
16404
|
// FieldPath.
|
|
@@ -16411,7 +16411,7 @@ function Ru(t, e, n) {
|
|
|
16411
16411
|
|
|
16412
16412
|
/**
|
|
16413
16413
|
* Matches any characters in a field path string that are reserved.
|
|
16414
|
-
*/ const
|
|
16414
|
+
*/ const Pu = new RegExp("[~\\*/\\[\\]]");
|
|
16415
16415
|
|
|
16416
16416
|
/**
|
|
16417
16417
|
* Wraps fromDotSeparatedString with an error message about the method that
|
|
@@ -16422,7 +16422,7 @@ function Ru(t, e, n) {
|
|
|
16422
16422
|
* @param targetDoc - The document against which the field path will be
|
|
16423
16423
|
* evaluated.
|
|
16424
16424
|
*/ function vu(t, e, n) {
|
|
16425
|
-
if (e.search(
|
|
16425
|
+
if (e.search(Pu) >= 0) throw Vu(`Invalid field path (${e}). Paths must not contain '~', '*', '/', '[', or ']'`, t,
|
|
16426
16426
|
/* hasConverter= */ !1,
|
|
16427
16427
|
/* path= */ void 0, n);
|
|
16428
16428
|
try {
|
|
@@ -16487,7 +16487,7 @@ function Vu(t, e, n, s, i) {
|
|
|
16487
16487
|
/**
|
|
16488
16488
|
* The `DocumentReference` for the document included in the `DocumentSnapshot`.
|
|
16489
16489
|
*/ get ref() {
|
|
16490
|
-
return new
|
|
16490
|
+
return new bc(this._firestore, this._converter, this._key);
|
|
16491
16491
|
}
|
|
16492
16492
|
/**
|
|
16493
16493
|
* Signals whether or not the document at the snapshot's location exists.
|
|
@@ -16911,7 +16911,7 @@ class qu extends Bu {
|
|
|
16911
16911
|
throw n === e.op ? new j(K.INVALID_ARGUMENT, `Invalid query. You cannot use more than one '${e.op.toString()}' filter.`) : new j(K.INVALID_ARGUMENT, `Invalid query. You cannot use '${e.op.toString()}' filters with '${n.toString()}' filters.`);
|
|
16912
16912
|
}(t, c), c;
|
|
16913
16913
|
}(t._query, "where", e, t.firestore._databaseId, this.Ga, this.za, this.Ha);
|
|
16914
|
-
return new
|
|
16914
|
+
return new Pc(t.firestore, t.converter, function(t, e) {
|
|
16915
16915
|
const n = t.filters.concat([ e ]);
|
|
16916
16916
|
return new _e(t.path, t.collectionGroup, t.explicitOrderBy.slice(), n, t.limit, t.limitType, t.startAt, t.endAt);
|
|
16917
16917
|
}(t._query, n));
|
|
@@ -16961,7 +16961,7 @@ class ju extends Bu {
|
|
|
16961
16961
|
* of the query or if any of the fields in the order by are an uncommitted
|
|
16962
16962
|
* server timestamp.
|
|
16963
16963
|
*/ (t._query, this.Ga, this.Ja);
|
|
16964
|
-
return new
|
|
16964
|
+
return new Pc(t.firestore, t.converter, function(t, e) {
|
|
16965
16965
|
// TODO(dimond): validate that orderBy does not list the same key twice.
|
|
16966
16966
|
const n = t.explicitOrderBy.concat([ e ]);
|
|
16967
16967
|
return new _e(t.path, t.collectionGroup, n, t.filters.slice(), t.limit, t.limitType, t.startAt, t.endAt);
|
|
@@ -16987,7 +16987,7 @@ class Wu extends Bu {
|
|
|
16987
16987
|
super(), this.type = t, this.Ya = e, this.Xa = n;
|
|
16988
16988
|
}
|
|
16989
16989
|
_apply(t) {
|
|
16990
|
-
return new
|
|
16990
|
+
return new Pc(t.firestore, t.converter, be(t._query, this.Ya, this.Xa));
|
|
16991
16991
|
}
|
|
16992
16992
|
}
|
|
16993
16993
|
|
|
@@ -17018,7 +17018,7 @@ class Hu extends Bu {
|
|
|
17018
17018
|
}
|
|
17019
17019
|
_apply(t) {
|
|
17020
17020
|
const e = eh(t, this.type, this.Za, this.tc);
|
|
17021
|
-
return new
|
|
17021
|
+
return new Pc(t.firestore, t.converter, function(t, e) {
|
|
17022
17022
|
return new _e(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), t.limit, t.limitType, e, t.endAt);
|
|
17023
17023
|
}(t._query, e));
|
|
17024
17024
|
}
|
|
@@ -17039,7 +17039,7 @@ class Xu extends Bu {
|
|
|
17039
17039
|
}
|
|
17040
17040
|
_apply(t) {
|
|
17041
17041
|
const e = eh(t, this.type, this.Za, this.tc);
|
|
17042
|
-
return new
|
|
17042
|
+
return new Pc(t.firestore, t.converter, function(t, e) {
|
|
17043
17043
|
return new _e(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), t.limit, t.limitType, t.startAt, e);
|
|
17044
17044
|
}(t._query, e));
|
|
17045
17045
|
}
|
|
@@ -17117,7 +17117,7 @@ function nh(t, e, n) {
|
|
|
17117
17117
|
if (!St.isDocumentKey(s)) throw new j(K.INVALID_ARGUMENT, `Invalid query. When querying a collection group by FieldPath.documentId(), the value provided must result in a valid document path, but '${s}' is not because it has an odd number of segments (${s.length}).`);
|
|
17118
17118
|
return Ot(t, new St(s));
|
|
17119
17119
|
}
|
|
17120
|
-
if (n instanceof
|
|
17120
|
+
if (n instanceof bc) return Ot(t, n._key);
|
|
17121
17121
|
throw new j(K.INVALID_ARGUMENT, `Invalid query. When querying with FieldPath.documentId(), you must provide a valid string or a DocumentReference, but it was: ${pc(n)}.`);
|
|
17122
17122
|
}
|
|
17123
17123
|
|
|
@@ -17213,7 +17213,7 @@ function ih(t, e, n) {
|
|
|
17213
17213
|
return null == n ? null : this.convertValue(n, e);
|
|
17214
17214
|
|
|
17215
17215
|
case "estimate":
|
|
17216
|
-
return this.convertTimestamp(
|
|
17216
|
+
return this.convertTimestamp(bt(t));
|
|
17217
17217
|
|
|
17218
17218
|
default:
|
|
17219
17219
|
return null;
|
|
@@ -17276,7 +17276,7 @@ class ah extends rh {
|
|
|
17276
17276
|
}
|
|
17277
17277
|
convertReference(t) {
|
|
17278
17278
|
const e = this.convertDocumentKey(t, this.firestore._databaseId);
|
|
17279
|
-
return new
|
|
17279
|
+
return new bc(this.firestore, /* converter= */ null, e);
|
|
17280
17280
|
}
|
|
17281
17281
|
}
|
|
17282
17282
|
|
|
@@ -17411,7 +17411,7 @@ function uh(t, e) {
|
|
|
17411
17411
|
* current document contents.
|
|
17412
17412
|
*/
|
|
17413
17413
|
function hh(t) {
|
|
17414
|
-
t = Tc(t,
|
|
17414
|
+
t = Tc(t, bc);
|
|
17415
17415
|
const e = Tc(t.firestore, Oc);
|
|
17416
17416
|
return rc(Bc(e), t._key).then((n => Rh(e, t, n)));
|
|
17417
17417
|
}
|
|
@@ -17425,7 +17425,7 @@ class lh extends rh {
|
|
|
17425
17425
|
}
|
|
17426
17426
|
convertReference(t) {
|
|
17427
17427
|
const e = this.convertDocumentKey(t, this.firestore._databaseId);
|
|
17428
|
-
return new
|
|
17428
|
+
return new bc(this.firestore, /* converter= */ null, e);
|
|
17429
17429
|
}
|
|
17430
17430
|
}
|
|
17431
17431
|
|
|
@@ -17436,7 +17436,7 @@ class lh extends rh {
|
|
|
17436
17436
|
* @returns A `Promise` resolved with a `DocumentSnapshot` containing the
|
|
17437
17437
|
* current document contents.
|
|
17438
17438
|
*/ function fh(t) {
|
|
17439
|
-
t = Tc(t,
|
|
17439
|
+
t = Tc(t, bc);
|
|
17440
17440
|
const e = Tc(t.firestore, Oc), n = Bc(e), s = new lh(e);
|
|
17441
17441
|
return ic(n, t._key).then((n => new xu(e, s, t._key, n, new ku(null !== n && n.hasLocalMutations,
|
|
17442
17442
|
/* fromCache= */ !0), t.converter)));
|
|
@@ -17449,7 +17449,7 @@ class lh extends rh {
|
|
|
17449
17449
|
* @returns A `Promise` resolved with a `DocumentSnapshot` containing the
|
|
17450
17450
|
* current document contents.
|
|
17451
17451
|
*/ function dh(t) {
|
|
17452
|
-
t = Tc(t,
|
|
17452
|
+
t = Tc(t, bc);
|
|
17453
17453
|
const e = Tc(t.firestore, Oc);
|
|
17454
17454
|
return rc(Bc(e), t._key, {
|
|
17455
17455
|
source: "server"
|
|
@@ -17466,7 +17466,7 @@ class lh extends rh {
|
|
|
17466
17466
|
*
|
|
17467
17467
|
* @returns A `Promise` that will be resolved with the results of the query.
|
|
17468
17468
|
*/ function wh(t) {
|
|
17469
|
-
t = Tc(t,
|
|
17469
|
+
t = Tc(t, Pc);
|
|
17470
17470
|
const e = Tc(t.firestore, Oc), n = Bc(e), s = new lh(e);
|
|
17471
17471
|
return Lu(t._query), ac(n, t._query).then((n => new Fu(e, s, t, n)));
|
|
17472
17472
|
}
|
|
@@ -17477,7 +17477,7 @@ class lh extends rh {
|
|
|
17477
17477
|
*
|
|
17478
17478
|
* @returns A `Promise` that will be resolved with the results of the query.
|
|
17479
17479
|
*/ function _h(t) {
|
|
17480
|
-
t = Tc(t,
|
|
17480
|
+
t = Tc(t, Pc);
|
|
17481
17481
|
const e = Tc(t.firestore, Oc), n = Bc(e), s = new lh(e);
|
|
17482
17482
|
return oc(n, t._query).then((n => new Fu(e, s, t, n)));
|
|
17483
17483
|
}
|
|
@@ -17488,7 +17488,7 @@ class lh extends rh {
|
|
|
17488
17488
|
*
|
|
17489
17489
|
* @returns A `Promise` that will be resolved with the results of the query.
|
|
17490
17490
|
*/ function mh(t) {
|
|
17491
|
-
t = Tc(t,
|
|
17491
|
+
t = Tc(t, Pc);
|
|
17492
17492
|
const e = Tc(t.firestore, Oc), n = Bc(e), s = new lh(e);
|
|
17493
17493
|
return ac(n, t._query, {
|
|
17494
17494
|
source: "server"
|
|
@@ -17496,13 +17496,13 @@ class lh extends rh {
|
|
|
17496
17496
|
}
|
|
17497
17497
|
|
|
17498
17498
|
function gh(t, e, n) {
|
|
17499
|
-
t = Tc(t,
|
|
17499
|
+
t = Tc(t, bc);
|
|
17500
17500
|
const s = Tc(t.firestore, Oc), i = oh(t.converter, e, n);
|
|
17501
17501
|
return Ah(s, [ lu(hu(s), "setDoc", t._key, i, null !== t.converter, n).toMutation(t._key, Je.none()) ]);
|
|
17502
17502
|
}
|
|
17503
17503
|
|
|
17504
17504
|
function yh(t, e, n, ...s) {
|
|
17505
|
-
t = Tc(t,
|
|
17505
|
+
t = Tc(t, bc);
|
|
17506
17506
|
const i = Tc(t.firestore, Oc), r = hu(i);
|
|
17507
17507
|
let o;
|
|
17508
17508
|
o = "string" == typeof (
|
|
@@ -17552,14 +17552,14 @@ function Eh(t, ...e) {
|
|
|
17552
17552
|
e[o + 2] = null === (i = t.complete) || void 0 === i ? void 0 : i.bind(t);
|
|
17553
17553
|
}
|
|
17554
17554
|
let c, u, h;
|
|
17555
|
-
if (t instanceof
|
|
17555
|
+
if (t instanceof bc) u = Tc(t.firestore, Oc), h = ge(t._key.path), c = {
|
|
17556
17556
|
next: n => {
|
|
17557
17557
|
e[o] && e[o](Rh(u, t, n));
|
|
17558
17558
|
},
|
|
17559
17559
|
error: e[o + 1],
|
|
17560
17560
|
complete: e[o + 2]
|
|
17561
17561
|
}; else {
|
|
17562
|
-
const n = Tc(t,
|
|
17562
|
+
const n = Tc(t, Pc);
|
|
17563
17563
|
u = Tc(n.firestore, Oc), h = n._query;
|
|
17564
17564
|
const s = new lh(u);
|
|
17565
17565
|
c = {
|
|
@@ -17624,7 +17624,7 @@ function Ih(t, e) {
|
|
|
17624
17624
|
* The `Transaction` object passed to a transaction's `updateFunction` provides
|
|
17625
17625
|
* the methods to read and write data within the transaction context. See
|
|
17626
17626
|
* {@link runTransaction}.
|
|
17627
|
-
*/ class
|
|
17627
|
+
*/ class bh extends class {
|
|
17628
17628
|
/** @hideconstructor */
|
|
17629
17629
|
constructor(t, e) {
|
|
17630
17630
|
this._firestore = t, this._transaction = e, this._dataReader = hu(t);
|
|
@@ -17701,8 +17701,8 @@ function Ih(t, e) {
|
|
|
17701
17701
|
* (the `updateFunction` returned a failed promise), the promise returned by the
|
|
17702
17702
|
* `updateFunction `is returned here. Otherwise, if the transaction failed, a
|
|
17703
17703
|
* rejected promise with the corresponding failure error is returned.
|
|
17704
|
-
*/ function
|
|
17705
|
-
return uc(Bc(t = Tc(t, Oc)), (n => e(new
|
|
17704
|
+
*/ function Ph(t, e) {
|
|
17705
|
+
return uc(Bc(t = Tc(t, Oc)), (n => e(new bh(t, n))));
|
|
17706
17706
|
}
|
|
17707
17707
|
|
|
17708
17708
|
/**
|
|
@@ -17832,10 +17832,10 @@ function Ih(t, e) {
|
|
|
17832
17832
|
return n = Object.assign({
|
|
17833
17833
|
useFetchStreams: e
|
|
17834
17834
|
}, n), i._setSettings(n), i;
|
|
17835
|
-
}), "PUBLIC"
|
|
17835
|
+
}), "PUBLIC")), registerVersion(S, "3.4.1-canary.0db840a09", t),
|
|
17836
17836
|
// BUILD_TARGET will be replaced by values like esm5, esm2017, cjs5, etc during the compilation
|
|
17837
|
-
registerVersion(S, "3.4.
|
|
17837
|
+
registerVersion(S, "3.4.1-canary.0db840a09", "esm2017");
|
|
17838
17838
|
}();
|
|
17839
17839
|
|
|
17840
|
-
export { rh as AbstractUserDataWriter, eu as Bytes, Fc as CACHE_SIZE_UNLIMITED, vc as CollectionReference,
|
|
17840
|
+
export { rh as AbstractUserDataWriter, eu as Bytes, Fc as CACHE_SIZE_UNLIMITED, vc as CollectionReference, bc as DocumentReference, xu as DocumentSnapshot, Zc as FieldPath, nu as FieldValue, Oc as Firestore, j as FirestoreError, su as GeoPoint, $c as LoadBundleTask, Pc as Query, Bu as QueryConstraint, $u as QueryDocumentSnapshot, Fu as QuerySnapshot, ku as SnapshotMetadata, at as Timestamp, bh as Transaction, ch as WriteBatch, dc as _DatabaseId, St as _DocumentKey, tt as _EmptyAppCheckTokenProvider, G as _EmptyAuthCredentialsProvider, _t as _FieldPath, Tc as _cast, U as _debugAssert, gt as _isBase64Available, O as _logWarn, mc as _validateIsNotUsedTogether, Th as addDoc, Dh as arrayRemove, Sh as arrayUnion, Qc as clearIndexedDbPersistence, Vc as collection, Sc as collectionGroup, Rc as connectFirestoreEmulator, ph as deleteDoc, vh as deleteField, zc as disableNetwork, Dc as doc, tu as documentId, qc as enableIndexedDbPersistence, Kc as enableMultiTabIndexedDbPersistence, Gc as enableNetwork, th as endAt, Zu as endBefore, Bc as ensureFirestoreConfigured, Ah as executeWrite, hh as getDoc, fh as getDocFromCache, dh as getDocFromServer, wh as getDocs, _h as getDocsFromCache, mh as getDocsFromServer, Lc as getFirestore, Ch as increment, Mc as initializeFirestore, Gu as limit, zu as limitToLast, Jc as loadBundle, Yc as namedQuery, Eh as onSnapshot, Ih as onSnapshotsInSync, Qu as orderBy, Uu as query, Nc as queryEqual, Cc as refEqual, Ph as runTransaction, Vh as serverTimestamp, gh as setDoc, x as setLogLevel, Mu as snapshotEqual, Yu as startAfter, Ju as startAt, Hc as terminate, yh as updateDoc, Wc as waitForPendingWrites, Ku as where, Nh as writeBatch };
|
|
17841
17841
|
//# sourceMappingURL=index.esm2017.js.map
|