@firebase/firestore 3.4.2-canary.d0c8bfe72 → 3.4.3-202201219200
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 +6 -0
- package/dist/index.esm2017.js +3 -3
- package/dist/index.esm2017.js.map +1 -1
- package/dist/index.esm5.js +3 -3
- package/dist/index.esm5.js.map +1 -1
- package/dist/index.node.cjs.js +2 -2
- package/dist/index.node.mjs +2 -2
- package/dist/index.node.mjs.map +1 -1
- package/dist/index.rn.js +158 -158
- package/dist/index.rn.js.map +1 -1
- package/dist/lite/index.browser.esm2017.js +74 -74
- package/dist/lite/index.browser.esm2017.js.map +1 -1
- package/dist/lite/index.browser.esm5.js +8 -8
- package/dist/lite/index.browser.esm5.js.map +1 -1
- package/dist/lite/index.node.cjs.js +2 -2
- package/dist/lite/index.node.mjs +2 -2
- package/dist/lite/index.node.mjs.map +1 -1
- package/dist/lite/index.rn.esm2017.js +82 -82
- package/dist/lite/index.rn.esm2017.js.map +1 -1
- package/dist/lite/packages/firestore/dist/lite/index.browser.esm2017.d.ts +19 -19
- package/package.json +9 -9
package/dist/index.rn.js
CHANGED
|
@@ -6,7 +6,7 @@ import { Logger as o, LogLevel as a } from "@firebase/logger";
|
|
|
6
6
|
|
|
7
7
|
import { FirebaseError as c, base64 as u, getUA as h, isIndexedDBAvailable as l, isSafari as f, isMobileCordova as d, isReactNative as w, isElectron as _, isIE as m, isUWP as g, isBrowserExtension as y, createMockUserToken as p, getModularInstance as T, deepEqual as E } from "@firebase/util";
|
|
8
8
|
|
|
9
|
-
import { XhrIo as I, EventType as A, ErrorCode as R, createWebChannelTransport as
|
|
9
|
+
import { XhrIo as I, EventType as A, ErrorCode as R, createWebChannelTransport as P, getStatEventTarget as b, FetchXmlHttpFactory as v, WebChannel as V, Event as S, Stat as D } from "@firebase/webchannel-wrapper";
|
|
10
10
|
|
|
11
11
|
const C = "@firebase/firestore";
|
|
12
12
|
|
|
@@ -70,7 +70,7 @@ N.MOCK_USER = new N("mock-user");
|
|
|
70
70
|
* See the License for the specific language governing permissions and
|
|
71
71
|
* limitations under the License.
|
|
72
72
|
*/
|
|
73
|
-
let k = "9.6.
|
|
73
|
+
let k = "9.6.3-202201219200";
|
|
74
74
|
|
|
75
75
|
/**
|
|
76
76
|
* @license
|
|
@@ -1377,7 +1377,7 @@ const It = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
|
|
|
1377
1377
|
return "number" == typeof t ? t : "string" == typeof t ? Number(t) : 0;
|
|
1378
1378
|
}
|
|
1379
1379
|
|
|
1380
|
-
/** Converts the possible Proto types for Blobs into a ByteString. */ function
|
|
1380
|
+
/** Converts the possible Proto types for Blobs into a ByteString. */ function Pt(t) {
|
|
1381
1381
|
return "string" == typeof t ? Et.fromBase64String(t) : Et.fromUint8Array(t);
|
|
1382
1382
|
}
|
|
1383
1383
|
|
|
@@ -1414,7 +1414,7 @@ const It = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
|
|
|
1414
1414
|
* FieldValueOptions to value().
|
|
1415
1415
|
* - With respect to other ServerTimestampValues, they sort by their
|
|
1416
1416
|
* localWriteTime.
|
|
1417
|
-
*/ function
|
|
1417
|
+
*/ function bt(t) {
|
|
1418
1418
|
var e, n;
|
|
1419
1419
|
return "server_timestamp" === (null === (n = ((null === (e = null == t ? void 0 : t.mapValue) || void 0 === e ? void 0 : e.fields) || {}).__type__) || void 0 === n ? void 0 : n.stringValue);
|
|
1420
1420
|
}
|
|
@@ -1430,7 +1430,7 @@ const It = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
|
|
|
1430
1430
|
*/
|
|
1431
1431
|
function vt(t) {
|
|
1432
1432
|
const e = t.mapValue.fields.__previous_value__;
|
|
1433
|
-
return
|
|
1433
|
+
return bt(e) ? vt(e) : e;
|
|
1434
1434
|
}
|
|
1435
1435
|
|
|
1436
1436
|
/**
|
|
@@ -1547,7 +1547,7 @@ function St(t) {
|
|
|
1547
1547
|
* limitations under the License.
|
|
1548
1548
|
*/
|
|
1549
1549
|
/** Extracts the backend's type order for the provided value. */ function kt(t) {
|
|
1550
|
-
return "nullValue" in t ? 0 /* NullValue */ : "booleanValue" in t ? 1 /* BooleanValue */ : "integerValue" in t || "doubleValue" in t ? 2 /* NumberValue */ : "timestampValue" in t ? 3 /* TimestampValue */ : "stringValue" in t ? 5 /* StringValue */ : "bytesValue" in t ? 6 /* BlobValue */ : "referenceValue" in t ? 7 /* RefValue */ : "geoPointValue" in t ? 8 /* GeoPointValue */ : "arrayValue" in t ? 9 /* ArrayValue */ : "mapValue" in t ?
|
|
1550
|
+
return "nullValue" in t ? 0 /* NullValue */ : "booleanValue" in t ? 1 /* BooleanValue */ : "integerValue" in t || "doubleValue" in t ? 2 /* NumberValue */ : "timestampValue" in t ? 3 /* TimestampValue */ : "stringValue" in t ? 5 /* StringValue */ : "bytesValue" in t ? 6 /* BlobValue */ : "referenceValue" in t ? 7 /* RefValue */ : "geoPointValue" in t ? 8 /* GeoPointValue */ : "arrayValue" in t ? 9 /* ArrayValue */ : "mapValue" in t ? bt(t) ? 4 /* ServerTimestampValue */ : 10 /* ObjectValue */ : U();
|
|
1551
1551
|
}
|
|
1552
1552
|
|
|
1553
1553
|
/** Tests `left` and `right` for equality based on the backend semantics. */ function xt(t, e) {
|
|
@@ -1578,7 +1578,7 @@ function St(t) {
|
|
|
1578
1578
|
|
|
1579
1579
|
case 6 /* BlobValue */ :
|
|
1580
1580
|
return function(t, e) {
|
|
1581
|
-
return
|
|
1581
|
+
return Pt(t.bytesValue).isEqual(Pt(e.bytesValue));
|
|
1582
1582
|
}(t, e);
|
|
1583
1583
|
|
|
1584
1584
|
case 7 /* RefValue */ :
|
|
@@ -1650,7 +1650,7 @@ function Ot(t, e) {
|
|
|
1650
1650
|
|
|
1651
1651
|
case 6 /* BlobValue */ :
|
|
1652
1652
|
return function(t, e) {
|
|
1653
|
-
const n =
|
|
1653
|
+
const n = Pt(t), s = Pt(e);
|
|
1654
1654
|
return n.compareTo(s);
|
|
1655
1655
|
}(t.bytesValue, e.bytesValue);
|
|
1656
1656
|
|
|
@@ -1721,7 +1721,7 @@ function Lt(t) {
|
|
|
1721
1721
|
return "nullValue" in t ? "null" : "booleanValue" in t ? "" + t.booleanValue : "integerValue" in t ? "" + t.integerValue : "doubleValue" in t ? "" + t.doubleValue : "timestampValue" in t ? function(t) {
|
|
1722
1722
|
const e = At(t);
|
|
1723
1723
|
return `time(${e.seconds},${e.nanos})`;
|
|
1724
|
-
}(t.timestampValue) : "stringValue" in t ? t.stringValue : "bytesValue" in t ?
|
|
1724
|
+
}(t.timestampValue) : "stringValue" in t ? t.stringValue : "bytesValue" in t ? Pt(t.bytesValue).toBase64() : "referenceValue" in t ? (n = t.referenceValue,
|
|
1725
1725
|
Nt.fromName(n).toString()) : "geoPointValue" in t ? `geo(${(e = t.geoPointValue).latitude},${e.longitude})` : "arrayValue" in t ? function(t) {
|
|
1726
1726
|
let e = "[", n = !0;
|
|
1727
1727
|
for (const s of t.values || []) n ? n = !1 : e += ",", e += Lt(s);
|
|
@@ -2380,7 +2380,7 @@ function Re(t) {
|
|
|
2380
2380
|
* Returns whether the query matches a collection group rather than a specific
|
|
2381
2381
|
* collection.
|
|
2382
2382
|
*/
|
|
2383
|
-
function
|
|
2383
|
+
function Pe(t) {
|
|
2384
2384
|
return null !== t.collectionGroup;
|
|
2385
2385
|
}
|
|
2386
2386
|
|
|
@@ -2388,7 +2388,7 @@ function be(t) {
|
|
|
2388
2388
|
* Returns the implicit order by constraint that is used to execute the Query,
|
|
2389
2389
|
* which can be different from the order by constraints the user provided (e.g.
|
|
2390
2390
|
* the SDK and backend always orders by `__name__`).
|
|
2391
|
-
*/ function
|
|
2391
|
+
*/ function be(t) {
|
|
2392
2392
|
const e = j(t);
|
|
2393
2393
|
if (null === e.S) {
|
|
2394
2394
|
e.S = [];
|
|
@@ -2415,10 +2415,10 @@ function be(t) {
|
|
|
2415
2415
|
* Converts this `Query` instance to it's corresponding `Target` representation.
|
|
2416
2416
|
*/ function ve(t) {
|
|
2417
2417
|
const e = j(t);
|
|
2418
|
-
if (!e.D) if ("F" /* First */ === e.limitType) e.D = Yt(e.path, e.collectionGroup,
|
|
2418
|
+
if (!e.D) if ("F" /* First */ === e.limitType) e.D = Yt(e.path, e.collectionGroup, be(e), e.filters, e.limit, e.startAt, e.endAt); else {
|
|
2419
2419
|
// Flip the orderBy directions since we want the last results
|
|
2420
2420
|
const t = [];
|
|
2421
|
-
for (const n of
|
|
2421
|
+
for (const n of be(e)) {
|
|
2422
2422
|
const e = "desc" /* DESCENDING */ === n.dir ? "asc" /* ASCENDING */ : "desc" /* DESCENDING */;
|
|
2423
2423
|
t.push(new we(n.field, e));
|
|
2424
2424
|
}
|
|
@@ -2467,8 +2467,8 @@ function Ce(t) {
|
|
|
2467
2467
|
return !0;
|
|
2468
2468
|
}
|
|
2469
2469
|
/** Makes sure a document is within the bounds, if provided. */ (t, e) && function(t, e) {
|
|
2470
|
-
if (t.startAt && !me(t.startAt,
|
|
2471
|
-
if (t.endAt && me(t.endAt,
|
|
2470
|
+
if (t.startAt && !me(t.startAt, be(t), e)) return !1;
|
|
2471
|
+
if (t.endAt && me(t.endAt, be(t), e)) return !1;
|
|
2472
2472
|
return !0;
|
|
2473
2473
|
}
|
|
2474
2474
|
/**
|
|
@@ -2480,7 +2480,7 @@ function Ce(t) {
|
|
|
2480
2480
|
function ke(t) {
|
|
2481
2481
|
return (e, n) => {
|
|
2482
2482
|
let s = !1;
|
|
2483
|
-
for (const i of
|
|
2483
|
+
for (const i of be(t)) {
|
|
2484
2484
|
const t = xe(i, e, n);
|
|
2485
2485
|
if (0 !== t) return t;
|
|
2486
2486
|
s = s || i.field.isKeyField();
|
|
@@ -3690,10 +3690,10 @@ class Rn {
|
|
|
3690
3690
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
3691
3691
|
* See the License for the specific language governing permissions and
|
|
3692
3692
|
* limitations under the License.
|
|
3693
|
-
*/ const
|
|
3693
|
+
*/ const Pn = new Tn(Nt.comparator);
|
|
3694
3694
|
|
|
3695
|
-
function
|
|
3696
|
-
return
|
|
3695
|
+
function bn() {
|
|
3696
|
+
return Pn;
|
|
3697
3697
|
}
|
|
3698
3698
|
|
|
3699
3699
|
const vn = new Tn(Nt.comparator);
|
|
@@ -3778,7 +3778,7 @@ function xn() {
|
|
|
3778
3778
|
// PORTING NOTE: Multi-tab only
|
|
3779
3779
|
static createSynthesizedRemoteEventForCurrentChange(t, e) {
|
|
3780
3780
|
const n = new Map;
|
|
3781
|
-
return n.set(t, On.createSynthesizedTargetChangeForCurrentChange(t, e)), new $n(ht.min(), n, xn(),
|
|
3781
|
+
return n.set(t, On.createSynthesizedTargetChangeForCurrentChange(t, e)), new $n(ht.min(), n, xn(), bn(), Nn());
|
|
3782
3782
|
}
|
|
3783
3783
|
}
|
|
3784
3784
|
|
|
@@ -3998,7 +3998,7 @@ class Un {
|
|
|
3998
3998
|
/** The internal state of all tracked targets. */
|
|
3999
3999
|
this.nt = new Map,
|
|
4000
4000
|
/** Keeps track of the documents to update since the last raised snapshot. */
|
|
4001
|
-
this.st =
|
|
4001
|
+
this.st = bn(),
|
|
4002
4002
|
/** A mapping of document keys to their set of target IDs. */
|
|
4003
4003
|
this.it = qn(),
|
|
4004
4004
|
/**
|
|
@@ -4128,7 +4128,7 @@ class Un {
|
|
|
4128
4128
|
})), s && (n = n.add(t));
|
|
4129
4129
|
}));
|
|
4130
4130
|
const s = new $n(t, e, this.rt, this.st, n);
|
|
4131
|
-
return this.st =
|
|
4131
|
+
return this.st = bn(), this.it = qn(), this.rt = new An(ot), s;
|
|
4132
4132
|
}
|
|
4133
4133
|
/**
|
|
4134
4134
|
* Adds the provided document to the internal list of document updates and
|
|
@@ -4322,7 +4322,7 @@ function Yn(t, e) {
|
|
|
4322
4322
|
|
|
4323
4323
|
function Xn(t) {
|
|
4324
4324
|
const e = _t.fromString(t);
|
|
4325
|
-
return q(
|
|
4325
|
+
return q(bs(e)), e;
|
|
4326
4326
|
}
|
|
4327
4327
|
|
|
4328
4328
|
function Zn(t, e) {
|
|
@@ -4456,7 +4456,7 @@ function us(t, e) {
|
|
|
4456
4456
|
delete: Zn(t, e.key)
|
|
4457
4457
|
}; else if (e instanceof un) n = {
|
|
4458
4458
|
update: rs(t, e.key, e.data),
|
|
4459
|
-
updateMask:
|
|
4459
|
+
updateMask: Ps(e.fieldMask)
|
|
4460
4460
|
}; else {
|
|
4461
4461
|
if (!(e instanceof wn)) return U();
|
|
4462
4462
|
n = {
|
|
@@ -4808,14 +4808,14 @@ function Rs(t) {
|
|
|
4808
4808
|
}
|
|
4809
4809
|
}
|
|
4810
4810
|
|
|
4811
|
-
function
|
|
4811
|
+
function Ps(t) {
|
|
4812
4812
|
const e = [];
|
|
4813
4813
|
return t.fields.forEach((t => e.push(t.canonicalString()))), {
|
|
4814
4814
|
fieldPaths: e
|
|
4815
4815
|
};
|
|
4816
4816
|
}
|
|
4817
4817
|
|
|
4818
|
-
function
|
|
4818
|
+
function bs(t) {
|
|
4819
4819
|
// Resource names have at least 4 components (project ID, database ID)
|
|
4820
4820
|
return t.length >= 4 && "projects" === t.get(0) && "databases" === t.get(2);
|
|
4821
4821
|
}
|
|
@@ -5720,12 +5720,12 @@ class Ys {
|
|
|
5720
5720
|
// bug we're checking for should exist in iOS >= 12.2 and < 13, but for
|
|
5721
5721
|
// whatever reason it's much harder to hit after 12.2 so we only proactively
|
|
5722
5722
|
// log on 12.2.
|
|
5723
|
-
12.2 === Xs.
|
|
5723
|
+
12.2 === Xs.Pt(h()) && M("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.");
|
|
5724
5724
|
}
|
|
5725
5725
|
/** Deletes the specified database. */ static delete(t) {
|
|
5726
5726
|
return F("SimpleDb", "Removing database:", t), si(window.indexedDB.deleteDatabase(t)).toPromise();
|
|
5727
5727
|
}
|
|
5728
|
-
/** Returns true if IndexedDB is available in the current environment. */ static
|
|
5728
|
+
/** Returns true if IndexedDB is available in the current environment. */ static bt() {
|
|
5729
5729
|
if (!l()) return !1;
|
|
5730
5730
|
if (Xs.vt()) return !0;
|
|
5731
5731
|
// We extensively use indexed array values and compound keys,
|
|
@@ -5735,7 +5735,7 @@ class Ys {
|
|
|
5735
5735
|
// For tracking support of this feature, see here:
|
|
5736
5736
|
// https://developer.microsoft.com/en-us/microsoft-edge/platform/status/indexeddbarraysandmultientrysupport/
|
|
5737
5737
|
// Check the UA string to find out the browser.
|
|
5738
|
-
const t = h(), e = Xs.
|
|
5738
|
+
const t = h(), e = Xs.Pt(t), n = 0 < e && e < 10, s = Xs.Vt(t), i = 0 < s && s < 4.5;
|
|
5739
5739
|
// IE 10
|
|
5740
5740
|
// ua = 'Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; Trident/6.0)';
|
|
5741
5741
|
// IE 11
|
|
@@ -5758,7 +5758,7 @@ class Ys {
|
|
|
5758
5758
|
}
|
|
5759
5759
|
// visible for testing
|
|
5760
5760
|
/** Parse User Agent to determine iOS version. Returns -1 if not found. */
|
|
5761
|
-
static
|
|
5761
|
+
static Pt(t) {
|
|
5762
5762
|
const e = t.match(/i(?:phone|pad|pod) os ([\d_]+)/i), n = e ? e[1].split("_").slice(0, 2).join(".") : "-1";
|
|
5763
5763
|
return Number(n);
|
|
5764
5764
|
}
|
|
@@ -6028,7 +6028,7 @@ class Ys {
|
|
|
6028
6028
|
let ii = !1;
|
|
6029
6029
|
|
|
6030
6030
|
function ri(t) {
|
|
6031
|
-
const e = Xs.
|
|
6031
|
+
const e = Xs.Pt(h());
|
|
6032
6032
|
if (e >= 12.2 && e < 13) {
|
|
6033
6033
|
const e = "An internal error was encountered in the Indexed Database server";
|
|
6034
6034
|
if (t.message.indexOf(e) >= 0) {
|
|
@@ -6474,9 +6474,9 @@ class Ii {
|
|
|
6474
6474
|
*/
|
|
6475
6475
|
/**
|
|
6476
6476
|
* An in-memory implementation of IndexManager.
|
|
6477
|
-
*/ class
|
|
6477
|
+
*/ class Pi {
|
|
6478
6478
|
constructor() {
|
|
6479
|
-
this.zt = new
|
|
6479
|
+
this.zt = new bi;
|
|
6480
6480
|
}
|
|
6481
6481
|
addToCollectionParentIndex(t, e) {
|
|
6482
6482
|
return this.zt.add(e), Js.resolve();
|
|
@@ -6490,7 +6490,7 @@ class Ii {
|
|
|
6490
6490
|
* Internal implementation of the collection-parent index exposed by MemoryIndexManager.
|
|
6491
6491
|
* Also used for in-memory caching by IndexedDbIndexManager and initial index population
|
|
6492
6492
|
* in indexeddb_schema.ts
|
|
6493
|
-
*/ class
|
|
6493
|
+
*/ class bi {
|
|
6494
6494
|
constructor() {
|
|
6495
6495
|
this.index = {};
|
|
6496
6496
|
}
|
|
@@ -6535,7 +6535,7 @@ class Ii {
|
|
|
6535
6535
|
* This is *NOT* a complete cache of what's in persistence and so can never be used to
|
|
6536
6536
|
* satisfy reads.
|
|
6537
6537
|
*/
|
|
6538
|
-
this.Ht = new
|
|
6538
|
+
this.Ht = new bi;
|
|
6539
6539
|
}
|
|
6540
6540
|
/**
|
|
6541
6541
|
* Adds a new entry to the collection parent index.
|
|
@@ -7711,23 +7711,23 @@ function Hi(t, e) {
|
|
|
7711
7711
|
return this.getMetadata(t).next((n => (n.byteSize += e, this.Re(t, n))));
|
|
7712
7712
|
}
|
|
7713
7713
|
getEntry(t, e) {
|
|
7714
|
-
return er(t).get(nr(e)).next((t => this.
|
|
7714
|
+
return er(t).get(nr(e)).next((t => this.Pe(e, t)));
|
|
7715
7715
|
}
|
|
7716
7716
|
/**
|
|
7717
7717
|
* Looks up an entry in the cache.
|
|
7718
7718
|
*
|
|
7719
7719
|
* @param documentKey - The key of the entry to look up.
|
|
7720
7720
|
* @returns The cached document entry and its size.
|
|
7721
|
-
*/
|
|
7721
|
+
*/ be(t, e) {
|
|
7722
7722
|
return er(t).get(nr(e)).next((t => ({
|
|
7723
|
-
document: this.
|
|
7723
|
+
document: this.Pe(e, t),
|
|
7724
7724
|
size: Ni(t)
|
|
7725
7725
|
})));
|
|
7726
7726
|
}
|
|
7727
7727
|
getEntries(t, e) {
|
|
7728
|
-
let n =
|
|
7728
|
+
let n = bn();
|
|
7729
7729
|
return this.ve(t, e, ((t, e) => {
|
|
7730
|
-
const s = this.
|
|
7730
|
+
const s = this.Pe(t, e);
|
|
7731
7731
|
n = n.insert(t, s);
|
|
7732
7732
|
})).next((() => n));
|
|
7733
7733
|
}
|
|
@@ -7738,9 +7738,9 @@ function Hi(t, e) {
|
|
|
7738
7738
|
* @returns A map of documents indexed by key and a map of sizes indexed by
|
|
7739
7739
|
* key (zero if the document does not exist).
|
|
7740
7740
|
*/ Ve(t, e) {
|
|
7741
|
-
let n =
|
|
7741
|
+
let n = bn(), s = new Tn(Nt.comparator);
|
|
7742
7742
|
return this.ve(t, e, ((t, e) => {
|
|
7743
|
-
const i = this.
|
|
7743
|
+
const i = this.Pe(t, e);
|
|
7744
7744
|
n = n.insert(t, i), s = s.insert(t, Ni(e));
|
|
7745
7745
|
})).next((() => ({
|
|
7746
7746
|
documents: n,
|
|
@@ -7769,7 +7769,7 @@ function Hi(t, e) {
|
|
|
7769
7769
|
}));
|
|
7770
7770
|
}
|
|
7771
7771
|
getDocumentsMatchingQuery(t, e, n) {
|
|
7772
|
-
let s =
|
|
7772
|
+
let s = bn();
|
|
7773
7773
|
const i = e.path.length + 1, r = {};
|
|
7774
7774
|
if (n.isEqual(ht.min())) {
|
|
7775
7775
|
// Documents are ordered by key, so we can use a prefix scan to narrow
|
|
@@ -7810,7 +7810,7 @@ function Hi(t, e) {
|
|
|
7810
7810
|
/**
|
|
7811
7811
|
* Decodes `remoteDoc` and returns the document (or null, if the document
|
|
7812
7812
|
* corresponds to the format used for sentinel deletes).
|
|
7813
|
-
*/
|
|
7813
|
+
*/ Pe(t, e) {
|
|
7814
7814
|
if (e) {
|
|
7815
7815
|
const t = fi(this.k, e);
|
|
7816
7816
|
// Whether the document is a sentinel removal and should only be used in the
|
|
@@ -7869,7 +7869,7 @@ class Zi extends Yi {
|
|
|
7869
7869
|
}
|
|
7870
7870
|
getFromCache(t, e) {
|
|
7871
7871
|
// Record the size of everything we load from the cache so we can compute a delta later.
|
|
7872
|
-
return this.De.
|
|
7872
|
+
return this.De.be(t, e).next((t => (this.Ce.set(e, t.size), t.document)));
|
|
7873
7873
|
}
|
|
7874
7874
|
getAllFromCache(t, e) {
|
|
7875
7875
|
// Record the size of everything we load from the cache so we can compute
|
|
@@ -8080,7 +8080,7 @@ function nr(t) {
|
|
|
8080
8080
|
t.createObjectStore(Ks.store, {
|
|
8081
8081
|
keyPath: Ks.keyPath
|
|
8082
8082
|
});
|
|
8083
|
-
const n = e.store(Ks.store), s = new
|
|
8083
|
+
const n = e.store(Ks.store), s = new bi, i = t => {
|
|
8084
8084
|
if (s.add(t)) {
|
|
8085
8085
|
const e = t.lastSegment(), s = t.popLast();
|
|
8086
8086
|
return n.put({
|
|
@@ -8202,7 +8202,7 @@ class or {
|
|
|
8202
8202
|
/** The last time we garbage collected the client metadata object store. */
|
|
8203
8203
|
this.Qe = Number.NEGATIVE_INFINITY,
|
|
8204
8204
|
/** A listener to notify on primary state changes. */
|
|
8205
|
-
this.We = t => Promise.resolve(), !or.
|
|
8205
|
+
this.We = t => Promise.resolve(), !or.bt()) throw new W(Q.UNIMPLEMENTED, "This platform is either missing IndexedDB or is known to have an incomplete implementation. Offline persistence has been disabled.");
|
|
8206
8206
|
this.referenceDelegate = new zi(this, s), this.Ge = e + "main", this.k = new li(a),
|
|
8207
8207
|
this.ze = new Xs(this.Ge, 11, new sr(this.k)), this.He = new Li(this.referenceDelegate, this.k),
|
|
8208
8208
|
this.Jt = new vi, this.Je = function(t, e) {
|
|
@@ -8458,8 +8458,8 @@ class or {
|
|
|
8458
8458
|
const e = new Ns(this.clientId, this.allowTabSynchronization, Date.now());
|
|
8459
8459
|
return ar(t).put(Ns.key, e);
|
|
8460
8460
|
}
|
|
8461
|
-
static
|
|
8462
|
-
return Xs.
|
|
8461
|
+
static bt() {
|
|
8462
|
+
return Xs.bt();
|
|
8463
8463
|
}
|
|
8464
8464
|
/** Checks the primary lease and removes it if we are the current primary. */ an(t) {
|
|
8465
8465
|
const e = ar(t);
|
|
@@ -8622,9 +8622,9 @@ class hr {
|
|
|
8622
8622
|
* @returns Local view of the document or null if we don't have any cached
|
|
8623
8623
|
* state for it.
|
|
8624
8624
|
*/ Rn(t, e) {
|
|
8625
|
-
return this.An.getAllMutationBatchesAffectingDocumentKey(t, e).next((n => this.
|
|
8625
|
+
return this.An.getAllMutationBatchesAffectingDocumentKey(t, e).next((n => this.Pn(t, e, n)));
|
|
8626
8626
|
}
|
|
8627
|
-
/** Internal version of `getDocument` that allows reusing batches. */
|
|
8627
|
+
/** Internal version of `getDocument` that allows reusing batches. */ Pn(t, e, n) {
|
|
8628
8628
|
return this.Je.getEntry(t, e).next((t => {
|
|
8629
8629
|
for (const e of n) e.applyToLocalView(t);
|
|
8630
8630
|
return t;
|
|
@@ -8632,7 +8632,7 @@ class hr {
|
|
|
8632
8632
|
}
|
|
8633
8633
|
// Returns the view of the given `docs` as they would appear after applying
|
|
8634
8634
|
// all mutations in the given `batches`.
|
|
8635
|
-
|
|
8635
|
+
bn(t, e) {
|
|
8636
8636
|
t.forEach(((t, n) => {
|
|
8637
8637
|
for (const t of e) t.applyToLocalView(n);
|
|
8638
8638
|
}));
|
|
@@ -8649,7 +8649,7 @@ class hr {
|
|
|
8649
8649
|
* Applies the local view the given `baseDocs` without retrieving documents
|
|
8650
8650
|
* from the local store.
|
|
8651
8651
|
*/ Vn(t, e) {
|
|
8652
|
-
return this.An.getAllMutationBatchesAffectingDocumentKeys(t, e).next((t => this.
|
|
8652
|
+
return this.An.getAllMutationBatchesAffectingDocumentKeys(t, e).next((t => this.bn(e, t)));
|
|
8653
8653
|
}
|
|
8654
8654
|
/**
|
|
8655
8655
|
* Performs a query against the local view of all documents.
|
|
@@ -8665,7 +8665,7 @@ class hr {
|
|
|
8665
8665
|
*/
|
|
8666
8666
|
return function(t) {
|
|
8667
8667
|
return Nt.isDocumentKey(t.path) && null === t.collectionGroup && 0 === t.filters.length;
|
|
8668
|
-
}(e) ? this.Sn(t, e.path) :
|
|
8668
|
+
}(e) ? this.Sn(t, e.path) : Pe(e) ? this.Dn(t, e, n) : this.Cn(t, e, n);
|
|
8669
8669
|
}
|
|
8670
8670
|
Sn(t, e) {
|
|
8671
8671
|
// Just do a simple document lookup.
|
|
@@ -9076,7 +9076,7 @@ function yr(t) {
|
|
|
9076
9076
|
* Notifies local store of the changed views to locally pin documents.
|
|
9077
9077
|
*/ (c, u, r) && o.push(n.He.updateTargetData(t, u));
|
|
9078
9078
|
}));
|
|
9079
|
-
let a =
|
|
9079
|
+
let a = bn();
|
|
9080
9080
|
// HACK: The only reason we allow a null snapshot version is so that we
|
|
9081
9081
|
// can synthesize remote events when we get permission denied errors while
|
|
9082
9082
|
// trying to resolve the state of a locally cached document that is in
|
|
@@ -9117,7 +9117,7 @@ function yr(t) {
|
|
|
9117
9117
|
i) {
|
|
9118
9118
|
let r = Nn();
|
|
9119
9119
|
return n.forEach((t => r = r.add(t))), e.getEntries(t, r).next((t => {
|
|
9120
|
-
let r =
|
|
9120
|
+
let r = bn();
|
|
9121
9121
|
return n.forEach(((n, o) => {
|
|
9122
9122
|
const a = t.get(n), c = (null == i ? void 0 : i.get(n)) || s;
|
|
9123
9123
|
// Note: The order of the steps below is important, since we want
|
|
@@ -9230,7 +9230,7 @@ async function Ar(t, e, n) {
|
|
|
9230
9230
|
}
|
|
9231
9231
|
|
|
9232
9232
|
// PORTING NOTE: Multi-Tab only.
|
|
9233
|
-
function
|
|
9233
|
+
function Pr(t, e) {
|
|
9234
9234
|
const n = j(t), s = j(n.He), i = n.qn.get(e);
|
|
9235
9235
|
return i ? Promise.resolve(i.target) : n.persistence.runTransaction("Get target data", "readonly", (t => s.Et(t, e).next((t => t ? t.target : null))));
|
|
9236
9236
|
}
|
|
@@ -9242,11 +9242,11 @@ function br(t, e) {
|
|
|
9242
9242
|
* since the prior call.
|
|
9243
9243
|
*/
|
|
9244
9244
|
// PORTING NOTE: Multi-Tab only.
|
|
9245
|
-
function
|
|
9245
|
+
function br(t) {
|
|
9246
9246
|
const e = j(t);
|
|
9247
9247
|
return e.persistence.runTransaction("Get new document changes", "readonly", (t => function(t, e, n) {
|
|
9248
9248
|
const s = j(t);
|
|
9249
|
-
let i =
|
|
9249
|
+
let i = bn(), r = wi(n);
|
|
9250
9250
|
const o = er(e), a = IDBKeyRange.lowerBound(r, !0);
|
|
9251
9251
|
return o.jt({
|
|
9252
9252
|
index: Ms.readTimeIndex,
|
|
@@ -9307,7 +9307,7 @@ async function vr(t) {
|
|
|
9307
9307
|
*/
|
|
9308
9308
|
async function Vr(t, e, n, s) {
|
|
9309
9309
|
const i = j(t);
|
|
9310
|
-
let r = Nn(), o =
|
|
9310
|
+
let r = Nn(), o = bn(), a = Dn();
|
|
9311
9311
|
for (const t of n) {
|
|
9312
9312
|
const n = e.Hn(t.metadata.name);
|
|
9313
9313
|
t.document && (r = r.add(n)), o = o.insert(n, e.Jn(t)), a = a.insert(n, e.Yn(t.metadata.readTime));
|
|
@@ -9714,14 +9714,14 @@ class xr {
|
|
|
9714
9714
|
return Js.resolve(n ? n.document.mutableCopy() : Ht.newInvalidDocument(e));
|
|
9715
9715
|
}
|
|
9716
9716
|
getEntries(t, e) {
|
|
9717
|
-
let n =
|
|
9717
|
+
let n = bn();
|
|
9718
9718
|
return e.forEach((t => {
|
|
9719
9719
|
const e = this.docs.get(t);
|
|
9720
9720
|
n = n.insert(t, e ? e.document.mutableCopy() : Ht.newInvalidDocument(t));
|
|
9721
9721
|
})), Js.resolve(n);
|
|
9722
9722
|
}
|
|
9723
9723
|
getDocumentsMatchingQuery(t, e, n) {
|
|
9724
|
-
let s =
|
|
9724
|
+
let s = bn();
|
|
9725
9725
|
// Documents are ordered by key, so we can use a prefix scan to narrow down
|
|
9726
9726
|
// the documents we need to match the query against.
|
|
9727
9727
|
const i = new Nt(e.path.child("")), r = this.docs.getIteratorFrom(i);
|
|
@@ -9806,7 +9806,7 @@ class $r extends Yi {
|
|
|
9806
9806
|
* A ordered bidirectional mapping between documents and the remote target
|
|
9807
9807
|
* IDs.
|
|
9808
9808
|
*/
|
|
9809
|
-
this.Rs = new Cr, this.targetCount = 0, this.
|
|
9809
|
+
this.Rs = new Cr, this.targetCount = 0, this.Ps = Mi.ie();
|
|
9810
9810
|
}
|
|
9811
9811
|
forEachTarget(t, e) {
|
|
9812
9812
|
return this.Is.forEach(((t, n) => e(n))), Js.resolve();
|
|
@@ -9818,7 +9818,7 @@ class $r extends Yi {
|
|
|
9818
9818
|
return Js.resolve(this.As);
|
|
9819
9819
|
}
|
|
9820
9820
|
allocateTargetId(t) {
|
|
9821
|
-
return this.highestTargetId = this.
|
|
9821
|
+
return this.highestTargetId = this.Ps.next(), Js.resolve(this.highestTargetId);
|
|
9822
9822
|
}
|
|
9823
9823
|
setTargetsMetadata(t, e, n) {
|
|
9824
9824
|
return n && (this.lastRemoteSnapshotVersion = n), e > this.As && (this.As = e),
|
|
@@ -9827,7 +9827,7 @@ class $r extends Yi {
|
|
|
9827
9827
|
ce(t) {
|
|
9828
9828
|
this.Is.set(t.target, t);
|
|
9829
9829
|
const e = t.targetId;
|
|
9830
|
-
e > this.highestTargetId && (this.
|
|
9830
|
+
e > this.highestTargetId && (this.Ps = new Mi(e), this.highestTargetId = e), t.sequenceNumber > this.As && (this.As = t.sequenceNumber);
|
|
9831
9831
|
}
|
|
9832
9832
|
addTargetData(t, e) {
|
|
9833
9833
|
return this.ce(e), this.targetCount += 1, Js.resolve();
|
|
@@ -9904,9 +9904,9 @@ class Fr {
|
|
|
9904
9904
|
* checked or asserted on every access.
|
|
9905
9905
|
*/
|
|
9906
9906
|
constructor(t, e) {
|
|
9907
|
-
this.
|
|
9907
|
+
this.bs = {}, this.Be = new st(0), this.Ue = !1, this.Ue = !0, this.referenceDelegate = t(this),
|
|
9908
9908
|
this.He = new Or(this);
|
|
9909
|
-
this.Jt = new
|
|
9909
|
+
this.Jt = new Pi, this.Je = function(t, e) {
|
|
9910
9910
|
return new xr(t, e);
|
|
9911
9911
|
}(this.Jt, (t => this.referenceDelegate.vs(t))), this.k = new li(e), this.Ye = new Dr(this.k);
|
|
9912
9912
|
}
|
|
@@ -9930,8 +9930,8 @@ class Fr {
|
|
|
9930
9930
|
return this.Jt;
|
|
9931
9931
|
}
|
|
9932
9932
|
getMutationQueue(t) {
|
|
9933
|
-
let e = this.
|
|
9934
|
-
return e || (e = new kr(this.Jt, this.referenceDelegate), this.
|
|
9933
|
+
let e = this.bs[t.toKey()];
|
|
9934
|
+
return e || (e = new kr(this.Jt, this.referenceDelegate), this.bs[t.toKey()] = e),
|
|
9935
9935
|
e;
|
|
9936
9936
|
}
|
|
9937
9937
|
getTargetCache() {
|
|
@@ -9950,7 +9950,7 @@ class Fr {
|
|
|
9950
9950
|
t)));
|
|
9951
9951
|
}
|
|
9952
9952
|
Ds(t, e) {
|
|
9953
|
-
return Js.or(Object.values(this.
|
|
9953
|
+
return Js.or(Object.values(this.bs).map((n => () => n.containsKey(t, e))));
|
|
9954
9954
|
}
|
|
9955
9955
|
}
|
|
9956
9956
|
|
|
@@ -10263,7 +10263,7 @@ class Gr {
|
|
|
10263
10263
|
// mutations but before we observe WebStorage events.
|
|
10264
10264
|
this.window.addEventListener("storage", this.Us);
|
|
10265
10265
|
}
|
|
10266
|
-
/** Returns 'true' if WebStorage is available in the current environment. */ static
|
|
10266
|
+
/** Returns 'true' if WebStorage is available in the current environment. */ static bt(t) {
|
|
10267
10267
|
return !(!t || !t.localStorage);
|
|
10268
10268
|
}
|
|
10269
10269
|
async start() {
|
|
@@ -10609,10 +10609,10 @@ class Hr {
|
|
|
10609
10609
|
*/
|
|
10610
10610
|
class Yr {
|
|
10611
10611
|
constructor() {
|
|
10612
|
-
this.Ii = () => this.Ai(), this.Ri = () => this.
|
|
10612
|
+
this.Ii = () => this.Ai(), this.Ri = () => this.Pi(), this.bi = [], this.vi();
|
|
10613
10613
|
}
|
|
10614
10614
|
Ei(t) {
|
|
10615
|
-
this.
|
|
10615
|
+
this.bi.push(t);
|
|
10616
10616
|
}
|
|
10617
10617
|
shutdown() {
|
|
10618
10618
|
window.removeEventListener("online", this.Ii), window.removeEventListener("offline", this.Ri);
|
|
@@ -10622,16 +10622,16 @@ class Yr {
|
|
|
10622
10622
|
}
|
|
10623
10623
|
Ai() {
|
|
10624
10624
|
F("ConnectivityMonitor", "Network connectivity changed: AVAILABLE");
|
|
10625
|
-
for (const t of this.
|
|
10625
|
+
for (const t of this.bi) t(0 /* AVAILABLE */);
|
|
10626
10626
|
}
|
|
10627
|
-
|
|
10627
|
+
Pi() {
|
|
10628
10628
|
F("ConnectivityMonitor", "Network connectivity changed: UNAVAILABLE");
|
|
10629
|
-
for (const t of this.
|
|
10629
|
+
for (const t of this.bi) t(1 /* UNAVAILABLE */);
|
|
10630
10630
|
}
|
|
10631
10631
|
// TODO(chenbrian): Consider passing in window either into this component or
|
|
10632
10632
|
// here for testing via FakeWindow.
|
|
10633
10633
|
/** Checks that all used attributes of window are available. */
|
|
10634
|
-
static
|
|
10634
|
+
static bt() {
|
|
10635
10635
|
return "undefined" != typeof window && void 0 !== window.addEventListener && void 0 !== window.removeEventListener;
|
|
10636
10636
|
}
|
|
10637
10637
|
}
|
|
@@ -10820,7 +10820,7 @@ class {
|
|
|
10820
10820
|
}));
|
|
10821
10821
|
}
|
|
10822
10822
|
Qi(t, e, n) {
|
|
10823
|
-
const s = [ this.Mi, "/", "google.firestore.v1.Firestore", "/", t, "/channel" ], i =
|
|
10823
|
+
const s = [ this.Mi, "/", "google.firestore.v1.Firestore", "/", t, "/channel" ], i = P(), r = b(), o = {
|
|
10824
10824
|
// Required for backend stickiness, routing behavior is based on this
|
|
10825
10825
|
// parameter.
|
|
10826
10826
|
httpSessionIdParam: "gsessionid",
|
|
@@ -11353,14 +11353,14 @@ class ro {
|
|
|
11353
11353
|
const e = t.targetChange;
|
|
11354
11354
|
return e.targetIds && e.targetIds.length ? ht.min() : e.readTime ? Jn(e.readTime) : ht.min();
|
|
11355
11355
|
}(t);
|
|
11356
|
-
return this.listener.
|
|
11356
|
+
return this.listener.Pr(e, n);
|
|
11357
11357
|
}
|
|
11358
11358
|
/**
|
|
11359
11359
|
* Registers interest in the results of the given target. If the target
|
|
11360
11360
|
* includes a resumeToken it will be included in the request. Results that
|
|
11361
11361
|
* affect the target will be streamed back as WatchChange messages that
|
|
11362
11362
|
* reference the targetId.
|
|
11363
|
-
*/
|
|
11363
|
+
*/ br(t) {
|
|
11364
11364
|
const e = {};
|
|
11365
11365
|
e.database = ss(this.k), e.addTarget = function(t, e) {
|
|
11366
11366
|
let n;
|
|
@@ -11709,7 +11709,7 @@ function wo(t, e) {
|
|
|
11709
11709
|
* We need to increment the the expected number of pending responses we're due
|
|
11710
11710
|
* from watch so we wait for the ack to process any messages from this target.
|
|
11711
11711
|
*/ function mo(t, e) {
|
|
11712
|
-
t.Yr.X(e.targetId), Fo(t).
|
|
11712
|
+
t.Yr.X(e.targetId), Fo(t).br(e);
|
|
11713
11713
|
}
|
|
11714
11714
|
|
|
11715
11715
|
/**
|
|
@@ -11783,7 +11783,7 @@ async function Ro(t, e, n) {
|
|
|
11783
11783
|
*/ (t, e);
|
|
11784
11784
|
} catch (n) {
|
|
11785
11785
|
F("RemoteStore", "Failed to remove targets %s: %s ", e.targetIds.join(","), n),
|
|
11786
|
-
await
|
|
11786
|
+
await Po(t, n);
|
|
11787
11787
|
} else if (e instanceof Fn ? t.Yr.ot(e) : e instanceof Mn ? t.Yr.dt(e) : t.Yr.ut(e),
|
|
11788
11788
|
!n.isEqual(ht.min())) try {
|
|
11789
11789
|
const e = await yr(t.localStore);
|
|
@@ -11829,7 +11829,7 @@ async function Ro(t, e, n) {
|
|
|
11829
11829
|
})), t.remoteSyncer.applyRemoteEvent(n);
|
|
11830
11830
|
}(t, n);
|
|
11831
11831
|
} catch (e) {
|
|
11832
|
-
F("RemoteStore", "Failed to raise snapshot:", e), await
|
|
11832
|
+
F("RemoteStore", "Failed to raise snapshot:", e), await Po(t, e);
|
|
11833
11833
|
}
|
|
11834
11834
|
}
|
|
11835
11835
|
|
|
@@ -11841,7 +11841,7 @@ async function Ro(t, e, n) {
|
|
|
11841
11841
|
*
|
|
11842
11842
|
* The returned Promise is resolved once the network is disabled and before
|
|
11843
11843
|
* any retry attempt.
|
|
11844
|
-
*/ async function
|
|
11844
|
+
*/ async function Po(t, e, n) {
|
|
11845
11845
|
if (!ei(e)) throw e;
|
|
11846
11846
|
t.Gr.add(1 /* IndexedDbFailed */),
|
|
11847
11847
|
// Disable network and raise offline snapshots
|
|
@@ -11860,8 +11860,8 @@ async function Ro(t, e, n) {
|
|
|
11860
11860
|
/**
|
|
11861
11861
|
* Executes `op`. If `op` fails, takes the network offline until `op`
|
|
11862
11862
|
* succeeds. Returns after the first attempt.
|
|
11863
|
-
*/ function
|
|
11864
|
-
return e().catch((n =>
|
|
11863
|
+
*/ function bo(t, e) {
|
|
11864
|
+
return e().catch((n => Po(t, n, e)));
|
|
11865
11865
|
}
|
|
11866
11866
|
|
|
11867
11867
|
async function vo(t) {
|
|
@@ -11875,7 +11875,7 @@ async function vo(t) {
|
|
|
11875
11875
|
}
|
|
11876
11876
|
s = t.batchId, So(e, t);
|
|
11877
11877
|
} catch (t) {
|
|
11878
|
-
await
|
|
11878
|
+
await Po(e, t);
|
|
11879
11879
|
}
|
|
11880
11880
|
Do(e) && Co(e);
|
|
11881
11881
|
}
|
|
@@ -11916,7 +11916,7 @@ async function ko(t) {
|
|
|
11916
11916
|
|
|
11917
11917
|
async function xo(t, e, n) {
|
|
11918
11918
|
const s = t.Qr.shift(), i = ui.from(s, e, n);
|
|
11919
|
-
await
|
|
11919
|
+
await bo(t, (() => t.remoteSyncer.applySuccessfulWrite(i))),
|
|
11920
11920
|
// It's possible that with the completion of this mutation another
|
|
11921
11921
|
// slot has freed up.
|
|
11922
11922
|
await vo(t);
|
|
@@ -11937,7 +11937,7 @@ async function $o(t, e) {
|
|
|
11937
11937
|
// In this case it's also unlikely that the server itself is melting
|
|
11938
11938
|
// down -- this was just a bad request so inhibit backoff on the next
|
|
11939
11939
|
// restart.
|
|
11940
|
-
Mo(t).wr(), await
|
|
11940
|
+
Mo(t).wr(), await bo(t, (() => t.remoteSyncer.rejectFailedWrite(n.batchId, e))),
|
|
11941
11941
|
// It's possible that with the completion of this mutation
|
|
11942
11942
|
// another slot has freed up.
|
|
11943
11943
|
await vo(t);
|
|
@@ -11990,7 +11990,7 @@ async function Oo(t, e) {
|
|
|
11990
11990
|
*/ (t.datastore, t.asyncQueue, {
|
|
11991
11991
|
Di: Io.bind(null, t),
|
|
11992
11992
|
Ni: Ao.bind(null, t),
|
|
11993
|
-
|
|
11993
|
+
Pr: Ro.bind(null, t)
|
|
11994
11994
|
}), t.zr.push((async e => {
|
|
11995
11995
|
e ? (t.Xr.wr(), po(t) ? yo(t) : t.Jr.set("Unknown" /* Unknown */)) : (await t.Xr.stop(),
|
|
11996
11996
|
Eo(t));
|
|
@@ -12632,7 +12632,7 @@ class sa {
|
|
|
12632
12632
|
/**
|
|
12633
12633
|
* The set of remote documents that the server has told us belongs to the target associated with
|
|
12634
12634
|
* this view.
|
|
12635
|
-
*/ get
|
|
12635
|
+
*/ get Po() {
|
|
12636
12636
|
return this.To;
|
|
12637
12637
|
}
|
|
12638
12638
|
/**
|
|
@@ -12644,7 +12644,7 @@ class sa {
|
|
|
12644
12644
|
* @param previousChanges - If this is being called with a refill, then start
|
|
12645
12645
|
* with this set of docs and changes instead of the current view.
|
|
12646
12646
|
* @returns a new set of docs, changes, and refill flag.
|
|
12647
|
-
*/
|
|
12647
|
+
*/ bo(t, e) {
|
|
12648
12648
|
const n = e ? e.vo : new qo, s = e ? e.Ro : this.Ro;
|
|
12649
12649
|
let i = e ? e.mutatedKeys : this.mutatedKeys, r = s, o = !1;
|
|
12650
12650
|
// Track the last doc in a (full) limit. This is necessary, because some
|
|
@@ -12852,7 +12852,7 @@ class sa {
|
|
|
12852
12852
|
// PORTING NOTE: Multi-tab only.
|
|
12853
12853
|
ko(t) {
|
|
12854
12854
|
this.To = t.zn, this.Io = Nn();
|
|
12855
|
-
const e = this.
|
|
12855
|
+
const e = this.bo(t.documents);
|
|
12856
12856
|
return this.applyChanges(e, /*updateLimboDocuments=*/ !0);
|
|
12857
12857
|
}
|
|
12858
12858
|
/**
|
|
@@ -12989,19 +12989,19 @@ async function ca(t, e) {
|
|
|
12989
12989
|
// targets based on view changes. This allows us to only depend on Limbo
|
|
12990
12990
|
// changes when user code includes queries.
|
|
12991
12991
|
t.Go = (e, n, s) => async function(t, e, n, s) {
|
|
12992
|
-
let i = e.view.
|
|
12992
|
+
let i = e.view.bo(n);
|
|
12993
12993
|
i.Bn && (
|
|
12994
12994
|
// The query has a limit and some docs were removed, so we need
|
|
12995
12995
|
// to re-run the query against the local store to make sure we
|
|
12996
12996
|
// didn't lose any good docs that had been past the limit.
|
|
12997
12997
|
i = await Rr(t.localStore, e.query,
|
|
12998
|
-
/* usePreviousResults= */ !1).then((({documents: t}) => e.view.
|
|
12998
|
+
/* usePreviousResults= */ !1).then((({documents: t}) => e.view.bo(t, i))));
|
|
12999
12999
|
const r = s && s.targetChanges.get(e.targetId), o = e.view.applyChanges(i,
|
|
13000
13000
|
/* updateLimboDocuments= */ t.isPrimaryClient, r);
|
|
13001
13001
|
return Ia(t, e.targetId, o.Co), o.snapshot;
|
|
13002
13002
|
}(t, e, n, s);
|
|
13003
13003
|
const i = await Rr(t.localStore, e,
|
|
13004
|
-
/* usePreviousResults= */ !0), r = new ia(e, i.zn), o = r.
|
|
13004
|
+
/* usePreviousResults= */ !0), r = new ia(e, i.zn), o = r.bo(i.documents), a = On.createSynthesizedTargetChangeForCurrentChange(n, s && "Offline" /* Offline */ !== t.onlineState), c = r.applyChanges(o,
|
|
13005
13005
|
/* updateLimboDocuments= */ t.isPrimaryClient, a);
|
|
13006
13006
|
Ia(t, n, c.Co);
|
|
13007
13007
|
const u = new ra(e, n, r);
|
|
@@ -13070,7 +13070,7 @@ async function ca(t, e) {
|
|
|
13070
13070
|
/**
|
|
13071
13071
|
* Resolves or rejects the user callback for the given batch and then discards
|
|
13072
13072
|
* it.
|
|
13073
|
-
*/ (s, t.batchId, n), await
|
|
13073
|
+
*/ (s, t.batchId, n), await Pa(s, t.changes), await vo(s.remoteStore);
|
|
13074
13074
|
} catch (t) {
|
|
13075
13075
|
// If we can't persist the mutation, we reject the user callback and
|
|
13076
13076
|
// don't send the mutation. The user can then retry the write.
|
|
@@ -13096,7 +13096,7 @@ async function ca(t, e) {
|
|
|
13096
13096
|
q(t.addedDocuments.size + t.modifiedDocuments.size + t.removedDocuments.size <= 1),
|
|
13097
13097
|
t.addedDocuments.size > 0 ? s.$o = !0 : t.modifiedDocuments.size > 0 ? q(s.$o) : t.removedDocuments.size > 0 && (q(s.$o),
|
|
13098
13098
|
s.$o = !1));
|
|
13099
|
-
})), await
|
|
13099
|
+
})), await Pa(n, t, e);
|
|
13100
13100
|
} catch (t) {
|
|
13101
13101
|
await Ki(t);
|
|
13102
13102
|
}
|
|
@@ -13125,7 +13125,7 @@ async function ca(t, e) {
|
|
|
13125
13125
|
// Run global snapshot listeners if a consistent snapshot has been emitted.
|
|
13126
13126
|
t.ro(e) && (s = !0);
|
|
13127
13127
|
})), s && Jo(n);
|
|
13128
|
-
}(s.eventManager, e), t.length && s.Oo.
|
|
13128
|
+
}(s.eventManager, e), t.length && s.Oo.Pr(t), s.onlineState = e, s.isPrimaryClient && s.sharedClientState.setOnlineState(e);
|
|
13129
13129
|
}
|
|
13130
13130
|
}
|
|
13131
13131
|
|
|
@@ -13176,7 +13176,7 @@ async function _a(t, e) {
|
|
|
13176
13176
|
// up), so we raise user callbacks first so that they consistently happen
|
|
13177
13177
|
// before listen events.
|
|
13178
13178
|
pa(n, s, /*error=*/ null), ya(n, s), n.sharedClientState.updateMutationState(s, "acknowledged"),
|
|
13179
|
-
await
|
|
13179
|
+
await Pa(n, t);
|
|
13180
13180
|
} catch (t) {
|
|
13181
13181
|
await Ki(t);
|
|
13182
13182
|
}
|
|
@@ -13203,7 +13203,7 @@ async function ma(t, e, n) {
|
|
|
13203
13203
|
// so we raise user callbacks first so that they consistently happen before
|
|
13204
13204
|
// listen events.
|
|
13205
13205
|
pa(s, e, n), ya(s, e), s.sharedClientState.updateMutationState(e, "rejected", n),
|
|
13206
|
-
await
|
|
13206
|
+
await Pa(s, t);
|
|
13207
13207
|
} catch (n) {
|
|
13208
13208
|
await Ki(n);
|
|
13209
13209
|
}
|
|
@@ -13302,7 +13302,7 @@ function Aa(t, e) {
|
|
|
13302
13302
|
}
|
|
13303
13303
|
}
|
|
13304
13304
|
|
|
13305
|
-
async function
|
|
13305
|
+
async function Pa(t, e, n) {
|
|
13306
13306
|
const s = j(t), i = [], r = [], o = [];
|
|
13307
13307
|
s.Fo.isEmpty() || (s.Fo.forEach(((t, a) => {
|
|
13308
13308
|
o.push(s.Go(a, e, n).then((t => {
|
|
@@ -13313,7 +13313,7 @@ async function ba(t, e, n) {
|
|
|
13313
13313
|
r.push(e);
|
|
13314
13314
|
}
|
|
13315
13315
|
})));
|
|
13316
|
-
})), await Promise.all(o), s.Oo.
|
|
13316
|
+
})), await Promise.all(o), s.Oo.Pr(i), await async function(t, e) {
|
|
13317
13317
|
const n = j(t);
|
|
13318
13318
|
try {
|
|
13319
13319
|
await n.persistence.runTransaction("notifyLocalViewChanges", "readwrite", (t => Js.forEach(e, (e => Js.forEach(e.kn, (s => n.persistence.referenceDelegate.addReference(t, e.targetId, s))).next((() => Js.forEach(e.xn, (s => n.persistence.referenceDelegate.removeReference(t, e.targetId, s)))))))));
|
|
@@ -13336,7 +13336,7 @@ async function ba(t, e, n) {
|
|
|
13336
13336
|
}(s.localStore, r));
|
|
13337
13337
|
}
|
|
13338
13338
|
|
|
13339
|
-
async function
|
|
13339
|
+
async function ba(t, e) {
|
|
13340
13340
|
const n = j(t);
|
|
13341
13341
|
if (!n.currentUser.isEqual(e)) {
|
|
13342
13342
|
F("SyncEngine", "User change. New user:", e.toKey());
|
|
@@ -13351,7 +13351,7 @@ async function Pa(t, e) {
|
|
|
13351
13351
|
})), t.jo.clear();
|
|
13352
13352
|
}(n, "'waitForPendingWrites' promise is rejected due to a user change."),
|
|
13353
13353
|
// TODO(b/114226417): Consider calling this only in the primary tab.
|
|
13354
|
-
n.sharedClientState.handleUserChange(e, t.removedBatchIds, t.addedBatchIds), await
|
|
13354
|
+
n.sharedClientState.handleUserChange(e, t.removedBatchIds, t.addedBatchIds), await Pa(n, t.Gn);
|
|
13355
13355
|
}
|
|
13356
13356
|
}
|
|
13357
13357
|
|
|
@@ -13364,7 +13364,7 @@ function va(t, e) {
|
|
|
13364
13364
|
if (!s) return t;
|
|
13365
13365
|
for (const e of s) {
|
|
13366
13366
|
const s = n.Fo.get(e);
|
|
13367
|
-
t = t.unionWith(s.view.
|
|
13367
|
+
t = t.unionWith(s.view.Po);
|
|
13368
13368
|
}
|
|
13369
13369
|
return t;
|
|
13370
13370
|
}
|
|
@@ -13386,7 +13386,7 @@ function va(t, e) {
|
|
|
13386
13386
|
// PORTING NOTE: Multi-Tab only.
|
|
13387
13387
|
async function Sa(t) {
|
|
13388
13388
|
const e = j(t);
|
|
13389
|
-
return
|
|
13389
|
+
return br(e.localStore).then((t => Pa(e, t)));
|
|
13390
13390
|
}
|
|
13391
13391
|
|
|
13392
13392
|
/** Applies a mutation state to an existing batch. */
|
|
@@ -13409,7 +13409,7 @@ async function Da(t, e, n, s) {
|
|
|
13409
13409
|
j(j(t).An).ee(e);
|
|
13410
13410
|
}
|
|
13411
13411
|
// PORTING NOTE: Multi-Tab only.
|
|
13412
|
-
(i.localStore, e)) : U(), await
|
|
13412
|
+
(i.localStore, e)) : U(), await Pa(i, r)) :
|
|
13413
13413
|
// A throttled tab may not have seen the mutation before it was completed
|
|
13414
13414
|
// and removed from the mutation queue, in which case we won't have cached
|
|
13415
13415
|
// the affected documents. In this case we can safely ignore the update
|
|
@@ -13482,13 +13482,13 @@ async function Na(t, e, n) {
|
|
|
13482
13482
|
} else {
|
|
13483
13483
|
// For queries that never executed on this client, we need to
|
|
13484
13484
|
// allocate the target in LocalStore and initialize a new View.
|
|
13485
|
-
const n = await
|
|
13485
|
+
const n = await Pr(s.localStore, t);
|
|
13486
13486
|
e = await Ir(s.localStore, n), await ua(s, ka(n), t,
|
|
13487
13487
|
/*current=*/ !1);
|
|
13488
13488
|
}
|
|
13489
13489
|
i.push(e);
|
|
13490
13490
|
}
|
|
13491
|
-
return s.Oo.
|
|
13491
|
+
return s.Oo.Pr(r), i;
|
|
13492
13492
|
}
|
|
13493
13493
|
|
|
13494
13494
|
/**
|
|
@@ -13524,8 +13524,8 @@ async function $a(t, e, n, s) {
|
|
|
13524
13524
|
case "current":
|
|
13525
13525
|
case "not-current":
|
|
13526
13526
|
{
|
|
13527
|
-
const t = await
|
|
13528
|
-
await
|
|
13527
|
+
const t = await br(i.localStore), s = $n.createSynthesizedRemoteEventForCurrentChange(e, "current" === n);
|
|
13528
|
+
await Pa(i, t, s);
|
|
13529
13529
|
break;
|
|
13530
13530
|
}
|
|
13531
13531
|
|
|
@@ -13548,7 +13548,7 @@ async function $a(t, e, n, s) {
|
|
|
13548
13548
|
F("SyncEngine", "Adding an already active target " + t);
|
|
13549
13549
|
continue;
|
|
13550
13550
|
}
|
|
13551
|
-
const e = await
|
|
13551
|
+
const e = await Pr(s.localStore, t), n = await Ir(s.localStore, e);
|
|
13552
13552
|
await ua(s, ka(e), n.targetId,
|
|
13553
13553
|
/*current=*/ !1), wo(s.remoteStore, n);
|
|
13554
13554
|
}
|
|
@@ -13567,7 +13567,7 @@ async function $a(t, e, n, s) {
|
|
|
13567
13567
|
function Fa(t) {
|
|
13568
13568
|
const e = j(t);
|
|
13569
13569
|
return e.remoteStore.remoteSyncer.applyRemoteEvent = fa.bind(null, e), e.remoteStore.remoteSyncer.getRemoteKeysForTarget = va.bind(null, e),
|
|
13570
|
-
e.remoteStore.remoteSyncer.rejectListen = wa.bind(null, e), e.Oo.
|
|
13570
|
+
e.remoteStore.remoteSyncer.rejectListen = wa.bind(null, e), e.Oo.Pr = zo.bind(null, e.eventManager),
|
|
13571
13571
|
e.Oo.zo = Ho.bind(null, e.eventManager), e;
|
|
13572
13572
|
}
|
|
13573
13573
|
|
|
@@ -13616,7 +13616,7 @@ function Ma(t) {
|
|
|
13616
13616
|
// TODO(b/160876443): This currently raises snapshots with
|
|
13617
13617
|
// `fromCache=false` if users already listen to some queries and bundles
|
|
13618
13618
|
// has newer version.
|
|
13619
|
-
await
|
|
13619
|
+
await Pa(t, o.In,
|
|
13620
13620
|
/* remoteEvent */ void 0),
|
|
13621
13621
|
// Save metadata, so loading the same bundle will skip.
|
|
13622
13622
|
await function(t, e) {
|
|
@@ -13741,7 +13741,7 @@ class Ba {
|
|
|
13741
13741
|
}
|
|
13742
13742
|
Jo(t) {
|
|
13743
13743
|
const e = eo();
|
|
13744
|
-
if (!zr.
|
|
13744
|
+
if (!zr.bt(e)) throw new W(Q.UNIMPLEMENTED, "IndexedDB persistence is only available on platforms that support LocalStorage.");
|
|
13745
13745
|
const n = ur(t.databaseInfo.databaseId, t.databaseInfo.persistenceKey);
|
|
13746
13746
|
return new zr(e, t.asyncQueue, n, t.clientId, t.initialUser);
|
|
13747
13747
|
}
|
|
@@ -13756,7 +13756,7 @@ class Ba {
|
|
|
13756
13756
|
this.datastore = this.createDatastore(e), this.remoteStore = this.createRemoteStore(e),
|
|
13757
13757
|
this.eventManager = this.createEventManager(e), this.syncEngine = this.createSyncEngine(e,
|
|
13758
13758
|
/* startAsPrimary=*/ !t.synchronizeTabs), this.sharedClientState.onlineStateHandler = t => da(this.syncEngine, t, 1 /* SharedClientState */),
|
|
13759
|
-
this.remoteStore.remoteSyncer.handleCredentialChange =
|
|
13759
|
+
this.remoteStore.remoteSyncer.handleCredentialChange = ba.bind(null, this.syncEngine),
|
|
13760
13760
|
await Oo(this.remoteStore, this.syncEngine.isPrimaryClient));
|
|
13761
13761
|
}
|
|
13762
13762
|
createEventManager(t) {
|
|
@@ -13771,7 +13771,7 @@ class Ba {
|
|
|
13771
13771
|
}
|
|
13772
13772
|
createRemoteStore(t) {
|
|
13773
13773
|
return e = this.localStore, n = this.datastore, s = t.asyncQueue, i = t => da(this.syncEngine, t, 0 /* RemoteStore */),
|
|
13774
|
-
r = Yr.
|
|
13774
|
+
r = Yr.bt() ? new Yr : new Jr, new ho(e, n, s, i, r);
|
|
13775
13775
|
var e, n, s, i, r;
|
|
13776
13776
|
/** Re-enables the network. Idempotent. */ }
|
|
13777
13777
|
createSyncEngine(t, e) {
|
|
@@ -14463,7 +14463,7 @@ function uc(t, e) {
|
|
|
14463
14463
|
return t.asyncQueue.enqueueAndForget((async () => async function(t, e, n) {
|
|
14464
14464
|
try {
|
|
14465
14465
|
const s = await Rr(t, e,
|
|
14466
|
-
/* usePreviousResults= */ !0), i = new ia(e, s.zn), r = i.
|
|
14466
|
+
/* usePreviousResults= */ !0), i = new ia(e, s.zn), r = i.bo(s.documents), o = i.applyChanges(r,
|
|
14467
14467
|
/* updateLimboDocuments= */ !1);
|
|
14468
14468
|
n.resolve(o.snapshot);
|
|
14469
14469
|
} catch (t) {
|
|
@@ -14753,7 +14753,7 @@ function Rc(t, e) {
|
|
|
14753
14753
|
* user-supplied `FirestoreSettings` object. This is a separate type so that
|
|
14754
14754
|
* defaults can be supplied and the value can be checked for equality.
|
|
14755
14755
|
*/
|
|
14756
|
-
class
|
|
14756
|
+
class Pc {
|
|
14757
14757
|
constructor(t) {
|
|
14758
14758
|
var e;
|
|
14759
14759
|
if (void 0 === t.host) {
|
|
@@ -14793,14 +14793,14 @@ class bc {
|
|
|
14793
14793
|
* The Cloud Firestore service interface.
|
|
14794
14794
|
*
|
|
14795
14795
|
* Do not call this constructor directly. Instead, use {@link getFirestore}.
|
|
14796
|
-
*/ class
|
|
14796
|
+
*/ class bc {
|
|
14797
14797
|
/** @hideconstructor */
|
|
14798
14798
|
constructor(t, e, n) {
|
|
14799
14799
|
this._authCredentials = e, this._appCheckCredentials = n,
|
|
14800
14800
|
/**
|
|
14801
14801
|
* Whether it's a Firestore or Firestore Lite instance.
|
|
14802
14802
|
*/
|
|
14803
|
-
this.type = "firestore-lite", this._persistenceKey = "(lite)", this._settings = new
|
|
14803
|
+
this.type = "firestore-lite", this._persistenceKey = "(lite)", this._settings = new Pc({}),
|
|
14804
14804
|
this._settingsFrozen = !1, t instanceof mc ? this._databaseId = t : (this._app = t,
|
|
14805
14805
|
this._databaseId = function(t) {
|
|
14806
14806
|
if (!Object.prototype.hasOwnProperty.apply(t.options, [ "projectId" ])) throw new W(Q.INVALID_ARGUMENT, '"projectId" not provided in firebase.initializeApp.');
|
|
@@ -14835,7 +14835,7 @@ class bc {
|
|
|
14835
14835
|
}
|
|
14836
14836
|
_setSettings(t) {
|
|
14837
14837
|
if (this._settingsFrozen) throw new W(Q.FAILED_PRECONDITION, "Firestore has already been started and its settings can no longer be changed. You can only modify settings before calling any other methods on a Firestore object.");
|
|
14838
|
-
this._settings = new
|
|
14838
|
+
this._settings = new Pc(t), void 0 !== t.credentials && (this._authCredentials = function(t) {
|
|
14839
14839
|
if (!t) return new H;
|
|
14840
14840
|
switch (t.type) {
|
|
14841
14841
|
case "gapi":
|
|
@@ -14888,7 +14888,7 @@ class bc {
|
|
|
14888
14888
|
|
|
14889
14889
|
function vc(t, e, n, s = {}) {
|
|
14890
14890
|
var i;
|
|
14891
|
-
const r = (t = Ac(t,
|
|
14891
|
+
const r = (t = Ac(t, bc))._getSettings();
|
|
14892
14892
|
if ("firestore.googleapis.com" !== r.host && r.host !== e && L("Host has been set in both settings() and useEmulator(), emulator host will be used"),
|
|
14893
14893
|
t._setSettings(Object.assign(Object.assign({}, r), {
|
|
14894
14894
|
host: `${e}:${n}`,
|
|
@@ -15015,7 +15015,7 @@ function vc(t, e, n, s = {}) {
|
|
|
15015
15015
|
}
|
|
15016
15016
|
|
|
15017
15017
|
function Cc(t, e, ...n) {
|
|
15018
|
-
if (t = T(t), yc("collection", "path", e), t instanceof
|
|
15018
|
+
if (t = T(t), yc("collection", "path", e), t instanceof bc) {
|
|
15019
15019
|
const s = _t.fromString(e, ...n);
|
|
15020
15020
|
return Ec(s), new Dc(t, /* converter= */ null, s);
|
|
15021
15021
|
}
|
|
@@ -15040,7 +15040,7 @@ function Cc(t, e, ...n) {
|
|
|
15040
15040
|
* will be included. Cannot contain a slash.
|
|
15041
15041
|
* @returns The created `Query`.
|
|
15042
15042
|
*/ function Nc(t, e) {
|
|
15043
|
-
if (t = Ac(t,
|
|
15043
|
+
if (t = Ac(t, bc), yc("collectionGroup", "collection id", e), e.indexOf("/") >= 0) throw new W(Q.INVALID_ARGUMENT, `Invalid collection ID '${e}' passed to function collectionGroup(). Collection IDs must not contain '/'.`);
|
|
15044
15044
|
return new Sc(t,
|
|
15045
15045
|
/* converter= */ null,
|
|
15046
15046
|
/**
|
|
@@ -15056,7 +15056,7 @@ function kc(t, e, ...n) {
|
|
|
15056
15056
|
if (t = T(t),
|
|
15057
15057
|
// We allow omission of 'pathString' but explicitly prohibit passing in both
|
|
15058
15058
|
// 'undefined' and 'null'.
|
|
15059
|
-
1 === arguments.length && (e = rt.A()), yc("doc", "path", e), t instanceof
|
|
15059
|
+
1 === arguments.length && (e = rt.A()), yc("doc", "path", e), t instanceof bc) {
|
|
15060
15060
|
const s = _t.fromString(e, ...n);
|
|
15061
15061
|
return Tc(s), new Vc(t,
|
|
15062
15062
|
/* converter= */ null, new Nt(s));
|
|
@@ -15151,9 +15151,9 @@ function kc(t, e, ...n) {
|
|
|
15151
15151
|
this.enqueue(t);
|
|
15152
15152
|
}
|
|
15153
15153
|
enqueueAndForgetEvenWhileRestricted(t) {
|
|
15154
|
-
this.
|
|
15154
|
+
this.Pa(),
|
|
15155
15155
|
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
15156
|
-
this.
|
|
15156
|
+
this.ba(t);
|
|
15157
15157
|
}
|
|
15158
15158
|
enterRestrictedMode(t) {
|
|
15159
15159
|
if (!this.ya) {
|
|
@@ -15163,14 +15163,14 @@ function kc(t, e, ...n) {
|
|
|
15163
15163
|
}
|
|
15164
15164
|
}
|
|
15165
15165
|
enqueue(t) {
|
|
15166
|
-
if (this.
|
|
15166
|
+
if (this.Pa(), this.ya)
|
|
15167
15167
|
// Return a Promise which never resolves.
|
|
15168
15168
|
return new Promise((() => {}));
|
|
15169
15169
|
// Create a deferred Promise that we can return to the callee. This
|
|
15170
15170
|
// allows us to return a "hanging Promise" only to the callee and still
|
|
15171
15171
|
// advance the queue even when the operation is not run.
|
|
15172
15172
|
const e = new G;
|
|
15173
|
-
return this.
|
|
15173
|
+
return this.ba((() => this.ya && this.Ia ? Promise.resolve() : (t().then(e.resolve, e.reject),
|
|
15174
15174
|
e.promise))).then((() => e.promise));
|
|
15175
15175
|
}
|
|
15176
15176
|
enqueueRetryable(t) {
|
|
@@ -15202,7 +15202,7 @@ function kc(t, e, ...n) {
|
|
|
15202
15202
|
this.ur.Zi((() => this.va()));
|
|
15203
15203
|
}
|
|
15204
15204
|
}
|
|
15205
|
-
|
|
15205
|
+
ba(t) {
|
|
15206
15206
|
const e = this.ma.then((() => (this.Ea = !0, t().catch((t => {
|
|
15207
15207
|
this.Ta = t, this.Ea = !1;
|
|
15208
15208
|
const e =
|
|
@@ -15240,13 +15240,13 @@ function kc(t, e, ...n) {
|
|
|
15240
15240
|
return this.ma = e, e;
|
|
15241
15241
|
}
|
|
15242
15242
|
enqueueAfterDelay(t, e, n) {
|
|
15243
|
-
this.
|
|
15243
|
+
this.Pa(),
|
|
15244
15244
|
// Fast-forward delays for timerIds that have been overriden.
|
|
15245
15245
|
this.Aa.indexOf(t) > -1 && (e = 0);
|
|
15246
15246
|
const s = Lo.createAndSchedule(this, t, e, n, (t => this.Va(t)));
|
|
15247
15247
|
return this.pa.push(s), s;
|
|
15248
15248
|
}
|
|
15249
|
-
|
|
15249
|
+
Pa() {
|
|
15250
15250
|
this.Ta && U();
|
|
15251
15251
|
}
|
|
15252
15252
|
verifyOperationInProgress() {}
|
|
@@ -15423,7 +15423,7 @@ class Mc {
|
|
|
15423
15423
|
*
|
|
15424
15424
|
* Do not call this constructor directly. Instead, use {@link getFirestore}.
|
|
15425
15425
|
*/
|
|
15426
|
-
class Bc extends
|
|
15426
|
+
class Bc extends bc {
|
|
15427
15427
|
/** @hideconstructor */
|
|
15428
15428
|
constructor(t, e, n) {
|
|
15429
15429
|
super(t, e, n),
|
|
@@ -15613,7 +15613,7 @@ function zc(t) {
|
|
|
15613
15613
|
return t._queue.enqueueAndForgetEvenWhileRestricted((async () => {
|
|
15614
15614
|
try {
|
|
15615
15615
|
await async function(t) {
|
|
15616
|
-
if (!Xs.
|
|
15616
|
+
if (!Xs.bt()) return Promise.resolve();
|
|
15617
15617
|
const e = t + "main";
|
|
15618
15618
|
await Xs.delete(e);
|
|
15619
15619
|
}(ur(t._databaseId, t._persistenceKey)), e.resolve();
|
|
@@ -16112,7 +16112,7 @@ function du(t) {
|
|
|
16112
16112
|
/** Parse document data from a set() call. */ function wu(t, e, n, s, i, r = {}) {
|
|
16113
16113
|
const o = t.ja(r.merge || r.mergeFields ? 2 /* MergeSet */ : 0 /* Set */ , e, n, i);
|
|
16114
16114
|
vu("Data must be an object, but it was:", o, s);
|
|
16115
|
-
const a =
|
|
16115
|
+
const a = Pu(s, o);
|
|
16116
16116
|
let c, u;
|
|
16117
16117
|
if (r.merge) c = new yt(o.fieldMask), u = o.fieldTransforms; else if (r.mergeFields) {
|
|
16118
16118
|
const t = [];
|
|
@@ -16280,10 +16280,10 @@ class Tu extends ru {
|
|
|
16280
16280
|
* @returns The parsed value, or null if the value was a FieldValue sentinel
|
|
16281
16281
|
* that should not be included in the resulting parsed data.
|
|
16282
16282
|
*/ function Ru(t, e) {
|
|
16283
|
-
if (
|
|
16283
|
+
if (bu(
|
|
16284
16284
|
// Unwrap the API type from the Compat SDK. This will return the API type
|
|
16285
16285
|
// from firestore-exp.
|
|
16286
|
-
t = T(t))) return vu("Unsupported field value:", e, t),
|
|
16286
|
+
t = T(t))) return vu("Unsupported field value:", e, t), Pu(t, e);
|
|
16287
16287
|
if (t instanceof ru)
|
|
16288
16288
|
// FieldValues usually parse into transforms (except FieldValue.delete())
|
|
16289
16289
|
// in which case we do not want to include this field in our parsed data
|
|
@@ -16394,7 +16394,7 @@ class Tu extends ru {
|
|
|
16394
16394
|
*/ (t, e);
|
|
16395
16395
|
}
|
|
16396
16396
|
|
|
16397
|
-
function
|
|
16397
|
+
function Pu(t, e) {
|
|
16398
16398
|
const n = {};
|
|
16399
16399
|
return dt(t) ?
|
|
16400
16400
|
// If we encounter an empty object, we explicitly add it to the update
|
|
@@ -16409,12 +16409,12 @@ function bu(t, e) {
|
|
|
16409
16409
|
};
|
|
16410
16410
|
}
|
|
16411
16411
|
|
|
16412
|
-
function
|
|
16412
|
+
function bu(t) {
|
|
16413
16413
|
return !("object" != typeof t || null === t || t instanceof Array || t instanceof Date || t instanceof ut || t instanceof ou || t instanceof iu || t instanceof Vc || t instanceof ru);
|
|
16414
16414
|
}
|
|
16415
16415
|
|
|
16416
16416
|
function vu(t, e, n) {
|
|
16417
|
-
if (!
|
|
16417
|
+
if (!bu(n) || !function(t) {
|
|
16418
16418
|
return "object" == typeof t && null !== t && (Object.getPrototypeOf(t) === Object.prototype || null === Object.getPrototypeOf(t));
|
|
16419
16419
|
}(n)) {
|
|
16420
16420
|
const s = Ic(n);
|
|
@@ -17090,9 +17090,9 @@ function sh(...t) {
|
|
|
17090
17090
|
// the provided document. Without the key (by using the explicit sort
|
|
17091
17091
|
// orders), multiple documents could match the position, yielding duplicate
|
|
17092
17092
|
// results.
|
|
17093
|
-
for (const n of
|
|
17093
|
+
for (const n of be(t)) if (n.field.isKeyField()) r.push(Bt(e, s.key)); else {
|
|
17094
17094
|
const t = s.data.field(n.field);
|
|
17095
|
-
if (
|
|
17095
|
+
if (bt(t)) throw new W(Q.INVALID_ARGUMENT, 'Invalid query. You are trying to start or end a query using a document for which the field "' + n.field + '" is an uncommitted server timestamp. (Since the value of this field is unknown, you cannot start/end a query with it.)');
|
|
17096
17096
|
if (null === t) {
|
|
17097
17097
|
const t = n.field.canonicalString();
|
|
17098
17098
|
throw new W(Q.INVALID_ARGUMENT, `Invalid query. You are trying to start or end a query using a document for which the field '${t}' (used as the orderBy) does not exist.`);
|
|
@@ -17115,7 +17115,7 @@ function sh(...t) {
|
|
|
17115
17115
|
const c = i[r];
|
|
17116
17116
|
if (o[r].field.isKeyField()) {
|
|
17117
17117
|
if ("string" != typeof c) throw new W(Q.INVALID_ARGUMENT, `Invalid query. Expected a string for document ID in ${s}(), but got a ${typeof c}`);
|
|
17118
|
-
if (!
|
|
17118
|
+
if (!Pe(t) && -1 !== c.indexOf("/")) throw new W(Q.INVALID_ARGUMENT, `Invalid query. When querying a collection and ordering by FieldPath.documentId(), the value passed to ${s}() must be a plain document ID, but '${c}' contains a slash.`);
|
|
17119
17119
|
const n = t.path.child(_t.fromString(c));
|
|
17120
17120
|
if (!Nt.isDocumentKey(n)) throw new W(Q.INVALID_ARGUMENT, `Invalid query. When querying a collection group and ordering by FieldPath.documentId(), the value passed to ${s}() must result in a valid document path, but '${n}' is not because it contains an odd number of segments.`);
|
|
17121
17121
|
const i = new Nt(n);
|
|
@@ -17138,7 +17138,7 @@ function sh(...t) {
|
|
|
17138
17138
|
function rh(t, e, n) {
|
|
17139
17139
|
if ("string" == typeof (n = T(n))) {
|
|
17140
17140
|
if ("" === n) throw new W(Q.INVALID_ARGUMENT, "Invalid query. When querying with FieldPath.documentId(), you must provide a valid document ID, but it was an empty string.");
|
|
17141
|
-
if (!
|
|
17141
|
+
if (!Pe(e) && -1 !== n.indexOf("/")) throw new W(Q.INVALID_ARGUMENT, `Invalid query. When querying a collection by FieldPath.documentId(), you must provide a plain document ID, but '${n}' contains a '/' character.`);
|
|
17142
17142
|
const s = e.path.child(_t.fromString(n));
|
|
17143
17143
|
if (!Nt.isDocumentKey(s)) throw new W(Q.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}).`);
|
|
17144
17144
|
return Bt(t, new Nt(s));
|
|
@@ -17202,7 +17202,7 @@ function ah(t, e, n) {
|
|
|
17202
17202
|
return t.stringValue;
|
|
17203
17203
|
|
|
17204
17204
|
case 6 /* BlobValue */ :
|
|
17205
|
-
return this.convertBytes(
|
|
17205
|
+
return this.convertBytes(Pt(t.bytesValue));
|
|
17206
17206
|
|
|
17207
17207
|
case 7 /* RefValue */ :
|
|
17208
17208
|
return this.convertReference(t.referenceValue);
|
|
@@ -17251,7 +17251,7 @@ function ah(t, e, n) {
|
|
|
17251
17251
|
}
|
|
17252
17252
|
convertDocumentKey(t, e) {
|
|
17253
17253
|
const n = _t.fromString(t);
|
|
17254
|
-
q(
|
|
17254
|
+
q(bs(n));
|
|
17255
17255
|
const s = new mc(n.get(1), n.get(3)), i = new Nt(n.popFirst(5));
|
|
17256
17256
|
return s.isEqual(e) ||
|
|
17257
17257
|
// TODO(b/64130202): Somehow support foreign references.
|
|
@@ -17524,7 +17524,7 @@ class wh extends ch {
|
|
|
17524
17524
|
function Th(t, e, n) {
|
|
17525
17525
|
t = Ac(t, Vc);
|
|
17526
17526
|
const s = Ac(t.firestore, Bc), i = uh(t.converter, e, n);
|
|
17527
|
-
return
|
|
17527
|
+
return bh(s, [ wu(du(s), "setDoc", t._key, i, null !== t.converter, n).toMutation(t._key, Ze.none()) ]);
|
|
17528
17528
|
}
|
|
17529
17529
|
|
|
17530
17530
|
function Eh(t, e, n, ...s) {
|
|
@@ -17535,7 +17535,7 @@ function Eh(t, e, n, ...s) {
|
|
|
17535
17535
|
// For Compat types, we have to "extract" the underlying types before
|
|
17536
17536
|
// performing validation.
|
|
17537
17537
|
e = T(e)) || e instanceof nu ? Iu(r, "updateDoc", t._key, e, n, s) : Eu(r, "updateDoc", t._key, e);
|
|
17538
|
-
return
|
|
17538
|
+
return bh(i, [ o.toMutation(t._key, Ze.exists(!0)) ]);
|
|
17539
17539
|
}
|
|
17540
17540
|
|
|
17541
17541
|
/**
|
|
@@ -17545,7 +17545,7 @@ function Eh(t, e, n, ...s) {
|
|
|
17545
17545
|
* @returns A Promise resolved once the document has been successfully
|
|
17546
17546
|
* deleted from the backend (note that it won't resolve while you're offline).
|
|
17547
17547
|
*/ function Ih(t) {
|
|
17548
|
-
return
|
|
17548
|
+
return bh(Ac(t.firestore, Bc), [ new dn(t._key, Ze.none()) ]);
|
|
17549
17549
|
}
|
|
17550
17550
|
|
|
17551
17551
|
/**
|
|
@@ -17559,7 +17559,7 @@ function Eh(t, e, n, ...s) {
|
|
|
17559
17559
|
* won't resolve while you're offline).
|
|
17560
17560
|
*/ function Ah(t, e) {
|
|
17561
17561
|
const n = Ac(t.firestore, Bc), s = kc(t), i = uh(t.converter, e);
|
|
17562
|
-
return
|
|
17562
|
+
return bh(n, [ wu(du(t.firestore), "addDoc", s._key, i, null !== t.converter, {}).toMutation(s._key, Ze.exists(!1)) ]).then((() => s));
|
|
17563
17563
|
}
|
|
17564
17564
|
|
|
17565
17565
|
function Rh(t, ...e) {
|
|
@@ -17604,7 +17604,7 @@ function Rh(t, ...e) {
|
|
|
17604
17604
|
}(Kc(u), h, a, c);
|
|
17605
17605
|
}
|
|
17606
17606
|
|
|
17607
|
-
function
|
|
17607
|
+
function Ph(t, e) {
|
|
17608
17608
|
return lc(Kc(t = Ac(t, Bc)), Fc(e) ? e : {
|
|
17609
17609
|
next: e
|
|
17610
17610
|
});
|
|
@@ -17613,7 +17613,7 @@ function bh(t, e) {
|
|
|
17613
17613
|
/**
|
|
17614
17614
|
* Locally writes `mutations` on the async queue.
|
|
17615
17615
|
* @internal
|
|
17616
|
-
*/ function
|
|
17616
|
+
*/ function bh(t, e) {
|
|
17617
17617
|
return function(t, e) {
|
|
17618
17618
|
const n = new G;
|
|
17619
17619
|
return t.asyncQueue.enqueueAndForget((async () => la(await sc(t), e, n))), n.promise;
|
|
@@ -17843,7 +17843,7 @@ function bh(t, e) {
|
|
|
17843
17843
|
* @returns A {@link WriteBatch} that can be used to atomically execute multiple
|
|
17844
17844
|
* writes.
|
|
17845
17845
|
*/ function $h(t) {
|
|
17846
|
-
return Kc(t = Ac(t, Bc)), new lh(t, (e =>
|
|
17846
|
+
return Kc(t = Ac(t, Bc)), new lh(t, (e => bh(t, e)));
|
|
17847
17847
|
}
|
|
17848
17848
|
|
|
17849
17849
|
/**
|
|
@@ -17869,10 +17869,10 @@ function bh(t, e) {
|
|
|
17869
17869
|
return n = Object.assign({
|
|
17870
17870
|
useFetchStreams: e
|
|
17871
17871
|
}, n), i._setSettings(n), i;
|
|
17872
|
-
}), "PUBLIC")), s(C, "3.4.
|
|
17872
|
+
}), "PUBLIC")), s(C, "3.4.3-202201219200", t),
|
|
17873
17873
|
// BUILD_TARGET will be replaced by values like esm5, esm2017, cjs5, etc during the compilation
|
|
17874
|
-
s(C, "3.4.
|
|
17874
|
+
s(C, "3.4.3-202201219200", "esm2017");
|
|
17875
17875
|
}("rn", /* useFetchStreams= */ !1);
|
|
17876
17876
|
|
|
17877
|
-
export { ch as AbstractUserDataWriter, iu as Bytes, Lc as CACHE_SIZE_UNLIMITED, Dc as CollectionReference, Vc as DocumentReference, Fu as DocumentSnapshot, nu as FieldPath, ru as FieldValue, Bc as Firestore, W as FirestoreError, ou as GeoPoint, Mc as LoadBundleTask, Sc as Query, Ku as QueryConstraint, Mu as QueryDocumentSnapshot, Lu as QuerySnapshot, Ou as SnapshotMetadata, ut as Timestamp, Vh as Transaction, lh as WriteBatch, mc as _DatabaseId, Nt as _DocumentKey, nt as _EmptyAppCheckTokenProvider, H as _EmptyAuthCredentialsProvider, gt as _FieldPath, Ac as _cast, K as _debugAssert, Tt as _isBase64Available, L as _logWarn, pc as _validateIsNotUsedTogether, Ah as addDoc, kh as arrayRemove, Nh as arrayUnion, zc as clearIndexedDbPersistence, Cc as collection, Nc as collectionGroup, vc as connectFirestoreEmulator, Ih as deleteDoc, Dh as deleteField, Yc as disableNetwork, kc as doc, su as documentId, Qc as enableIndexedDbPersistence, Wc as enableMultiTabIndexedDbPersistence, Jc as enableNetwork, sh as endAt, nh as endBefore, Kc as ensureFirestoreConfigured,
|
|
17877
|
+
export { ch as AbstractUserDataWriter, iu as Bytes, Lc as CACHE_SIZE_UNLIMITED, Dc as CollectionReference, Vc as DocumentReference, Fu as DocumentSnapshot, nu as FieldPath, ru as FieldValue, Bc as Firestore, W as FirestoreError, ou as GeoPoint, Mc as LoadBundleTask, Sc as Query, Ku as QueryConstraint, Mu as QueryDocumentSnapshot, Lu as QuerySnapshot, Ou as SnapshotMetadata, ut as Timestamp, Vh as Transaction, lh as WriteBatch, mc as _DatabaseId, Nt as _DocumentKey, nt as _EmptyAppCheckTokenProvider, H as _EmptyAuthCredentialsProvider, gt as _FieldPath, Ac as _cast, K as _debugAssert, Tt as _isBase64Available, L as _logWarn, pc as _validateIsNotUsedTogether, Ah as addDoc, kh as arrayRemove, Nh as arrayUnion, zc as clearIndexedDbPersistence, Cc as collection, Nc as collectionGroup, vc as connectFirestoreEmulator, Ih as deleteDoc, Dh as deleteField, Yc as disableNetwork, kc as doc, su as documentId, Qc as enableIndexedDbPersistence, Wc as enableMultiTabIndexedDbPersistence, Jc as enableNetwork, sh as endAt, nh as endBefore, Kc as ensureFirestoreConfigured, bh as executeWrite, dh as getDoc, _h as getDocFromCache, mh as getDocFromServer, gh as getDocs, yh as getDocsFromCache, ph as getDocsFromServer, qc as getFirestore, xh as increment, Uc as initializeFirestore, Ju as limit, Yu as limitToLast, Zc as loadBundle, tu as namedQuery, Rh as onSnapshot, Ph as onSnapshotsInSync, zu as orderBy, ju as query, $c as queryEqual, xc as refEqual, Sh as runTransaction, Ch as serverTimestamp, Th as setDoc, O as setLogLevel, Uu as snapshotEqual, th as startAfter, Zu as startAt, Xc as terminate, Eh as updateDoc, Hc as waitForPendingWrites, Wu as where, $h as writeBatch };
|
|
17878
17878
|
//# sourceMappingURL=index.rn.js.map
|