@firebase/firestore 3.7.1 → 3.7.2-canary.457fc2eeb
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 +12 -0
- package/dist/index.esm2017.js +249 -243
- package/dist/index.esm2017.js.map +1 -1
- package/dist/index.esm5.js +637 -633
- package/dist/index.esm5.js.map +1 -1
- package/dist/index.node.cjs.js +38 -36
- package/dist/index.node.cjs.js.map +1 -1
- package/dist/index.node.mjs +5 -3
- package/dist/index.node.mjs.map +1 -1
- package/dist/index.rn.js +249 -243
- package/dist/index.rn.js.map +1 -1
- package/dist/lite/index.browser.esm2017.js +186 -180
- package/dist/lite/index.browser.esm2017.js.map +1 -1
- package/dist/lite/index.browser.esm5.js +350 -344
- package/dist/lite/index.browser.esm5.js.map +1 -1
- package/dist/lite/index.node.cjs.js +10 -3
- package/dist/lite/index.node.cjs.js.map +1 -1
- package/dist/lite/index.node.mjs +10 -3
- package/dist/lite/index.node.mjs.map +1 -1
- package/dist/lite/index.rn.esm2017.js +192 -186
- package/dist/lite/index.rn.esm2017.js.map +1 -1
- package/dist/lite/packages/firestore/dist/lite/index.browser.esm2017.d.ts +26 -26
- package/dist/packages/firestore/dist/index.esm2017.d.ts +1 -1
- package/package.json +11 -11
- package/dist/firestore/test/integration/api_internal/aggregation.test.d.ts +0 -17
- package/dist/lite/firestore/test/integration/api_internal/aggregation.test.d.ts +0 -17
- package/dist/lite/packages/firestore/test/integration/api_internal/aggregation.test.d.ts +0 -17
- package/dist/packages/firestore/test/integration/api_internal/aggregation.test.d.ts +0 -17
|
@@ -67,7 +67,7 @@ v.MOCK_USER = new v("mock-user");
|
|
|
67
67
|
* See the License for the specific language governing permissions and
|
|
68
68
|
* limitations under the License.
|
|
69
69
|
*/
|
|
70
|
-
var g = "9.
|
|
70
|
+
var g = "9.13.0-canary.457fc2eeb", w = new l("@firebase/firestore");
|
|
71
71
|
|
|
72
72
|
/**
|
|
73
73
|
* @license
|
|
@@ -105,7 +105,7 @@ function b(t) {
|
|
|
105
105
|
function _(t) {
|
|
106
106
|
for (var e = [], n = 1; n < arguments.length; n++) e[n - 1] = arguments[n];
|
|
107
107
|
if (w.logLevel <= f.DEBUG) {
|
|
108
|
-
var i = e.map(
|
|
108
|
+
var i = e.map(k);
|
|
109
109
|
w.debug.apply(w, r([ "Firestore (" + g + "): " + t ], i));
|
|
110
110
|
}
|
|
111
111
|
}
|
|
@@ -113,7 +113,7 @@ function _(t) {
|
|
|
113
113
|
function T(t) {
|
|
114
114
|
for (var e = [], n = 1; n < arguments.length; n++) e[n - 1] = arguments[n];
|
|
115
115
|
if (w.logLevel <= f.ERROR) {
|
|
116
|
-
var i = e.map(
|
|
116
|
+
var i = e.map(k);
|
|
117
117
|
w.error.apply(w, r([ "Firestore (" + g + "): " + t ], i));
|
|
118
118
|
}
|
|
119
119
|
}
|
|
@@ -123,14 +123,14 @@ function T(t) {
|
|
|
123
123
|
*/ function E(t) {
|
|
124
124
|
for (var e = [], n = 1; n < arguments.length; n++) e[n - 1] = arguments[n];
|
|
125
125
|
if (w.logLevel <= f.WARN) {
|
|
126
|
-
var i = e.map(
|
|
126
|
+
var i = e.map(k);
|
|
127
127
|
w.warn.apply(w, r([ "Firestore (" + g + "): " + t ], i));
|
|
128
128
|
}
|
|
129
129
|
}
|
|
130
130
|
|
|
131
131
|
/**
|
|
132
132
|
* Converts an additional log parameter to a string representation.
|
|
133
|
-
*/ function
|
|
133
|
+
*/ function k(t) {
|
|
134
134
|
if ("string" == typeof t) return t;
|
|
135
135
|
try {
|
|
136
136
|
return e = t, JSON.stringify(e);
|
|
@@ -180,7 +180,7 @@ function T(t) {
|
|
|
180
180
|
* Returns `never` and can be used in expressions:
|
|
181
181
|
* @example
|
|
182
182
|
* let futureVar = fail('not implemented yet');
|
|
183
|
-
*/ function
|
|
183
|
+
*/ function S(t) {
|
|
184
184
|
void 0 === t && (t = "Unexpected state");
|
|
185
185
|
// Log the failure in addition to throw an exception, just in case the
|
|
186
186
|
// exception is swallowed.
|
|
@@ -197,14 +197,14 @@ function T(t) {
|
|
|
197
197
|
*/;
|
|
198
198
|
}
|
|
199
199
|
|
|
200
|
-
function
|
|
201
|
-
t ||
|
|
200
|
+
function A(t, e) {
|
|
201
|
+
t || S();
|
|
202
202
|
}
|
|
203
203
|
|
|
204
204
|
/**
|
|
205
205
|
* Casts `obj` to `T`. In non-production builds, verifies that `obj` is an
|
|
206
206
|
* instance of `T` before casting.
|
|
207
|
-
*/ function
|
|
207
|
+
*/ function I(t,
|
|
208
208
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
209
209
|
e) {
|
|
210
210
|
return t;
|
|
@@ -225,7 +225,7 @@ e) {
|
|
|
225
225
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
226
226
|
* See the License for the specific language governing permissions and
|
|
227
227
|
* limitations under the License.
|
|
228
|
-
*/ var V = "cancelled", P = "unknown", D = "invalid-argument",
|
|
228
|
+
*/ var V = "cancelled", P = "unknown", D = "invalid-argument", F = "deadline-exceeded", N = "not-found", O = "permission-denied", R = "unauthenticated", q = "resource-exhausted", L = "failed-precondition", x = "aborted", C = "out-of-range", j = "unimplemented", M = "internal", U = "unavailable", B = /** @class */ function(e) {
|
|
229
229
|
/** @hideconstructor */
|
|
230
230
|
function n(
|
|
231
231
|
/**
|
|
@@ -251,9 +251,9 @@ e) {
|
|
|
251
251
|
this.promise = new Promise((function(e, n) {
|
|
252
252
|
t.resolve = e, t.reject = n;
|
|
253
253
|
}));
|
|
254
|
-
},
|
|
254
|
+
}, K = function(t, e) {
|
|
255
255
|
this.user = e, this.type = "OAuth", this.headers = new Map, this.headers.set("Authorization", "Bearer " + t);
|
|
256
|
-
},
|
|
256
|
+
}, G = /** @class */ function() {
|
|
257
257
|
function t() {}
|
|
258
258
|
return t.prototype.getToken = function() {
|
|
259
259
|
return Promise.resolve(null);
|
|
@@ -295,7 +295,7 @@ e) {
|
|
|
295
295
|
return t.prototype.getToken = function() {
|
|
296
296
|
var t = this;
|
|
297
297
|
return this.auth ? this.auth.getToken().then((function(e) {
|
|
298
|
-
return e ? (
|
|
298
|
+
return e ? (A("string" == typeof e.accessToken), new K(e.accessToken, new v(t.auth.getUid()))) : null;
|
|
299
299
|
})) : Promise.resolve(null);
|
|
300
300
|
}, t.prototype.invalidateToken = function() {}, t.prototype.start = function(t, e) {},
|
|
301
301
|
t.prototype.shutdown = function() {}, t;
|
|
@@ -308,7 +308,7 @@ e) {
|
|
|
308
308
|
return t.prototype.l = function() {
|
|
309
309
|
return this.u ? this.u() : (
|
|
310
310
|
// Make sure this really is a Gapi client.
|
|
311
|
-
|
|
311
|
+
A(!("object" != typeof this.t || null === this.t || !this.t.auth || !this.t.auth.getAuthHeaderValueForFirstParty)),
|
|
312
312
|
this.t.auth.getAuthHeaderValueForFirstParty([]));
|
|
313
313
|
}, Object.defineProperty(t.prototype, "headers", {
|
|
314
314
|
get: function() {
|
|
@@ -345,11 +345,11 @@ e) {
|
|
|
345
345
|
}
|
|
346
346
|
return t.prototype.getToken = function() {
|
|
347
347
|
return this.appCheck ? this.appCheck.getToken().then((function(t) {
|
|
348
|
-
return t ? (
|
|
348
|
+
return t ? (A("string" == typeof t.token), new X(t.token)) : null;
|
|
349
349
|
})) : Promise.resolve(null);
|
|
350
350
|
}, t.prototype.invalidateToken = function() {}, t.prototype.start = function(t, e) {},
|
|
351
351
|
t.prototype.shutdown = function() {}, t;
|
|
352
|
-
}(),
|
|
352
|
+
}(), $ =
|
|
353
353
|
/**
|
|
354
354
|
* Constructs a DatabaseInfo using the provided host, databaseId and
|
|
355
355
|
* persistenceKey.
|
|
@@ -370,7 +370,7 @@ e) {
|
|
|
370
370
|
function(t, e, n, r, i, o, a, u) {
|
|
371
371
|
this.databaseId = t, this.appId = e, this.persistenceKey = n, this.host = r, this.ssl = i,
|
|
372
372
|
this.forceLongPolling = o, this.autoDetectLongPolling = a, this.useFetchStreams = u;
|
|
373
|
-
},
|
|
373
|
+
}, Z = /** @class */ function() {
|
|
374
374
|
function t(t, e) {
|
|
375
375
|
this.projectId = t, this.database = e || "(default)";
|
|
376
376
|
}
|
|
@@ -387,7 +387,7 @@ function(t, e, n, r, i, o, a, u) {
|
|
|
387
387
|
}, t;
|
|
388
388
|
}(), tt = /** @class */ function() {
|
|
389
389
|
function t(t, e, n) {
|
|
390
|
-
void 0 === e ? e = 0 : e > t.length &&
|
|
390
|
+
void 0 === e ? e = 0 : e > t.length && S(), void 0 === n ? n = t.length - e : n > t.length - e && S(),
|
|
391
391
|
this.segments = t, this.offset = e, this.len = n;
|
|
392
392
|
}
|
|
393
393
|
return Object.defineProperty(t.prototype, "length", {
|
|
@@ -638,7 +638,7 @@ function ot(t, e, n) {
|
|
|
638
638
|
}(t);
|
|
639
639
|
return e ? "a custom " + e + " object" : "an object";
|
|
640
640
|
}
|
|
641
|
-
return "function" == typeof t ? "a function" :
|
|
641
|
+
return "function" == typeof t ? "a function" : S();
|
|
642
642
|
}
|
|
643
643
|
|
|
644
644
|
function ct(t,
|
|
@@ -776,7 +776,7 @@ function mt(t) {
|
|
|
776
776
|
|
|
777
777
|
case 403:
|
|
778
778
|
// Forbidden
|
|
779
|
-
return
|
|
779
|
+
return O;
|
|
780
780
|
|
|
781
781
|
case 404:
|
|
782
782
|
// Not Found
|
|
@@ -817,7 +817,7 @@ function mt(t) {
|
|
|
817
817
|
|
|
818
818
|
case 504:
|
|
819
819
|
// Gateway Timeout
|
|
820
|
-
return
|
|
820
|
+
return F;
|
|
821
821
|
|
|
822
822
|
default:
|
|
823
823
|
return t >= 200 && t < 300 ? "ok" : t >= 400 && t < 500 ? L : t >= 500 && t < 600 ? M : P;
|
|
@@ -869,28 +869,34 @@ var vt = /** @class */ function(r) {
|
|
|
869
869
|
throw new Error("Not supported by FetchConnection");
|
|
870
870
|
}, i.prototype.R = function(t, r, i, o) {
|
|
871
871
|
return e(this, void 0, void 0, (function() {
|
|
872
|
-
var t, e, a;
|
|
872
|
+
var t, e, a, u, s, c;
|
|
873
873
|
return n(this, (function(n) {
|
|
874
874
|
switch (n.label) {
|
|
875
875
|
case 0:
|
|
876
|
-
|
|
876
|
+
e = JSON.stringify(o), n.label = 1;
|
|
877
877
|
|
|
878
878
|
case 1:
|
|
879
879
|
return n.trys.push([ 1, 3, , 4 ]), [ 4 /*yield*/ , this.V(r, {
|
|
880
880
|
method: "POST",
|
|
881
881
|
headers: i,
|
|
882
|
-
body:
|
|
882
|
+
body: e
|
|
883
883
|
}) ];
|
|
884
884
|
|
|
885
885
|
case 2:
|
|
886
|
-
return
|
|
886
|
+
return a = n.sent(), [ 3 /*break*/ , 4 ];
|
|
887
887
|
|
|
888
888
|
case 3:
|
|
889
|
-
throw
|
|
889
|
+
throw u = n.sent(), new B(mt(u.status), "Request failed with error: " + u.statusText);
|
|
890
890
|
|
|
891
891
|
case 4:
|
|
892
|
-
|
|
893
|
-
|
|
892
|
+
return a.ok ? [ 3 /*break*/ , 6 ] : [ 4 /*yield*/ , a.json() ];
|
|
893
|
+
|
|
894
|
+
case 5:
|
|
895
|
+
throw s = n.sent(), Array.isArray(s) && (s = s[0]), c = null === (t = null == s ? void 0 : s.error) || void 0 === t ? void 0 : t.message,
|
|
896
|
+
new B(mt(a.status), "Request failed with error: " + (null != c ? c : a.statusText));
|
|
897
|
+
|
|
898
|
+
case 6:
|
|
899
|
+
return [ 2 /*return*/ , a.json() ];
|
|
894
900
|
}
|
|
895
901
|
}));
|
|
896
902
|
}));
|
|
@@ -1011,7 +1017,7 @@ var vt = /** @class */ function(r) {
|
|
|
1011
1017
|
* limitations under the License.
|
|
1012
1018
|
*/ var wt = /** @class */ function() {
|
|
1013
1019
|
function t() {}
|
|
1014
|
-
return t
|
|
1020
|
+
return t.$ = function() {
|
|
1015
1021
|
for (
|
|
1016
1022
|
// Alphanumeric characters
|
|
1017
1023
|
var t = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", e = Math.floor(256 / t.length) * t.length, n = ""
|
|
@@ -1239,13 +1245,13 @@ function bt(t, e) {
|
|
|
1239
1245
|
* See the License for the specific language governing permissions and
|
|
1240
1246
|
* limitations under the License.
|
|
1241
1247
|
*/
|
|
1242
|
-
function
|
|
1248
|
+
function kt(t) {
|
|
1243
1249
|
var e = 0;
|
|
1244
1250
|
for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && e++;
|
|
1245
1251
|
return e;
|
|
1246
1252
|
}
|
|
1247
1253
|
|
|
1248
|
-
function
|
|
1254
|
+
function St(t, e) {
|
|
1249
1255
|
for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && e(n, t[n]);
|
|
1250
1256
|
}
|
|
1251
1257
|
|
|
@@ -1267,7 +1273,7 @@ function kt(t, e) {
|
|
|
1267
1273
|
*/
|
|
1268
1274
|
// An immutable sorted map implementation, based on a Left-leaning Red-Black
|
|
1269
1275
|
// tree.
|
|
1270
|
-
var
|
|
1276
|
+
var At = /** @class */ function() {
|
|
1271
1277
|
function t(t, e) {
|
|
1272
1278
|
this.comparator = t, this.root = e || Vt.EMPTY;
|
|
1273
1279
|
}
|
|
@@ -1346,15 +1352,15 @@ var It = /** @class */ function() {
|
|
|
1346
1352
|
},
|
|
1347
1353
|
// Returns an iterator over the SortedMap.
|
|
1348
1354
|
t.prototype.getIterator = function() {
|
|
1349
|
-
return new
|
|
1355
|
+
return new It(this.root, null, this.comparator, !1);
|
|
1350
1356
|
}, t.prototype.getIteratorFrom = function(t) {
|
|
1351
|
-
return new
|
|
1357
|
+
return new It(this.root, t, this.comparator, !1);
|
|
1352
1358
|
}, t.prototype.getReverseIterator = function() {
|
|
1353
|
-
return new
|
|
1359
|
+
return new It(this.root, null, this.comparator, !0);
|
|
1354
1360
|
}, t.prototype.getReverseIteratorFrom = function(t) {
|
|
1355
|
-
return new
|
|
1361
|
+
return new It(this.root, t, this.comparator, !0);
|
|
1356
1362
|
}, t;
|
|
1357
|
-
}(),
|
|
1363
|
+
}(), It = /** @class */ function() {
|
|
1358
1364
|
function t(t, e, n, r) {
|
|
1359
1365
|
this.isReverse = r, this.nodeStack = [];
|
|
1360
1366
|
for (var i = 1; !t.isEmpty(); ) if (i = e ? n(t.key, e) : 1,
|
|
@@ -1483,10 +1489,10 @@ var It = /** @class */ function() {
|
|
|
1483
1489
|
// In a balanced RB tree, the black-depth (number of black nodes) from root to
|
|
1484
1490
|
// leaves is equal on both sides. This function verifies that or asserts.
|
|
1485
1491
|
t.prototype.check = function() {
|
|
1486
|
-
if (this.isRed() && this.left.isRed()) throw
|
|
1487
|
-
if (this.right.isRed()) throw
|
|
1492
|
+
if (this.isRed() && this.left.isRed()) throw S();
|
|
1493
|
+
if (this.right.isRed()) throw S();
|
|
1488
1494
|
var t = this.left.check();
|
|
1489
|
-
if (t !== this.right.check()) throw
|
|
1495
|
+
if (t !== this.right.check()) throw S();
|
|
1490
1496
|
return t + (this.isRed() ? 0 : 1);
|
|
1491
1497
|
}, t;
|
|
1492
1498
|
}();
|
|
@@ -1504,31 +1510,31 @@ Vt.EMPTY = new (/** @class */ function() {
|
|
|
1504
1510
|
}
|
|
1505
1511
|
return Object.defineProperty(t.prototype, "key", {
|
|
1506
1512
|
get: function() {
|
|
1507
|
-
throw
|
|
1513
|
+
throw S();
|
|
1508
1514
|
},
|
|
1509
1515
|
enumerable: !1,
|
|
1510
1516
|
configurable: !0
|
|
1511
1517
|
}), Object.defineProperty(t.prototype, "value", {
|
|
1512
1518
|
get: function() {
|
|
1513
|
-
throw
|
|
1519
|
+
throw S();
|
|
1514
1520
|
},
|
|
1515
1521
|
enumerable: !1,
|
|
1516
1522
|
configurable: !0
|
|
1517
1523
|
}), Object.defineProperty(t.prototype, "color", {
|
|
1518
1524
|
get: function() {
|
|
1519
|
-
throw
|
|
1525
|
+
throw S();
|
|
1520
1526
|
},
|
|
1521
1527
|
enumerable: !1,
|
|
1522
1528
|
configurable: !0
|
|
1523
1529
|
}), Object.defineProperty(t.prototype, "left", {
|
|
1524
1530
|
get: function() {
|
|
1525
|
-
throw
|
|
1531
|
+
throw S();
|
|
1526
1532
|
},
|
|
1527
1533
|
enumerable: !1,
|
|
1528
1534
|
configurable: !0
|
|
1529
1535
|
}), Object.defineProperty(t.prototype, "right", {
|
|
1530
1536
|
get: function() {
|
|
1531
|
-
throw
|
|
1537
|
+
throw S();
|
|
1532
1538
|
},
|
|
1533
1539
|
enumerable: !1,
|
|
1534
1540
|
configurable: !0
|
|
@@ -1590,7 +1596,7 @@ Vt.EMPTY = new (/** @class */ function() {
|
|
|
1590
1596
|
*/
|
|
1591
1597
|
var Pt = /** @class */ function() {
|
|
1592
1598
|
function t(t) {
|
|
1593
|
-
this.comparator = t, this.data = new
|
|
1599
|
+
this.comparator = t, this.data = new At(this.comparator);
|
|
1594
1600
|
}
|
|
1595
1601
|
return t.prototype.has = function(t) {
|
|
1596
1602
|
return null !== this.data.get(t);
|
|
@@ -1678,7 +1684,7 @@ var Pt = /** @class */ function() {
|
|
|
1678
1684
|
}, t.prototype.hasNext = function() {
|
|
1679
1685
|
return this.iter.hasNext();
|
|
1680
1686
|
}, t;
|
|
1681
|
-
}(),
|
|
1687
|
+
}(), Ft = /** @class */ function() {
|
|
1682
1688
|
function t(t) {
|
|
1683
1689
|
this.fields = t,
|
|
1684
1690
|
// TODO(dimond): validation of FieldMask
|
|
@@ -1769,7 +1775,7 @@ var Pt = /** @class */ function() {
|
|
|
1769
1775
|
|
|
1770
1776
|
Nt.EMPTY_BYTE_STRING = new Nt("");
|
|
1771
1777
|
|
|
1772
|
-
var
|
|
1778
|
+
var Ot = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
|
|
1773
1779
|
|
|
1774
1780
|
/**
|
|
1775
1781
|
* Converts the possible Proto values for a timestamp value into a "seconds and
|
|
@@ -1778,12 +1784,12 @@ var Ft = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
|
|
|
1778
1784
|
// The json interface (for the browser) will return an iso timestamp string,
|
|
1779
1785
|
// while the proto js library (for node) will return a
|
|
1780
1786
|
// google.protobuf.Timestamp instance.
|
|
1781
|
-
if (
|
|
1787
|
+
if (A(!!t), "string" == typeof t) {
|
|
1782
1788
|
// The date string can have higher precision (nanos) than the Date class
|
|
1783
1789
|
// (millis), so we do some custom parsing here.
|
|
1784
1790
|
// Parse the nanos right out of the string.
|
|
1785
|
-
var e = 0, n =
|
|
1786
|
-
if (
|
|
1791
|
+
var e = 0, n = Ot.exec(t);
|
|
1792
|
+
if (A(!!n), n[1]) {
|
|
1787
1793
|
// Pad the fraction out to 9 digits (nanos).
|
|
1788
1794
|
var r = n[1];
|
|
1789
1795
|
r = (r + "000000000").substr(0, 9), e = Number(r);
|
|
@@ -1896,7 +1902,7 @@ var Ft = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
|
|
|
1896
1902
|
/** Returns true if the Value represents the canonical {@link #MAX_VALUE} . */
|
|
1897
1903
|
function(t) {
|
|
1898
1904
|
return "__max__" === (((t.mapValue || {}).fields || {}).__type__ || {}).stringValue;
|
|
1899
|
-
}(t) ? 9007199254740991 /* MaxValue */ : 10 /* ObjectValue */ :
|
|
1905
|
+
}(t) ? 9007199254740991 /* MaxValue */ : 10 /* ObjectValue */ : S();
|
|
1900
1906
|
}
|
|
1901
1907
|
|
|
1902
1908
|
/** Tests `left` and `right` for equality based on the backend semantics. */ function Bt(t, e) {
|
|
@@ -1955,13 +1961,13 @@ var Ft = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
|
|
|
1955
1961
|
case 10 /* ObjectValue */ :
|
|
1956
1962
|
return function(t, e) {
|
|
1957
1963
|
var n = t.mapValue.fields || {}, r = e.mapValue.fields || {};
|
|
1958
|
-
if (
|
|
1964
|
+
if (kt(n) !== kt(r)) return !1;
|
|
1959
1965
|
for (var i in n) if (n.hasOwnProperty(i) && (void 0 === r[i] || !Bt(n[i], r[i]))) return !1;
|
|
1960
1966
|
return !0;
|
|
1961
1967
|
}(t, e);
|
|
1962
1968
|
|
|
1963
1969
|
default:
|
|
1964
|
-
return
|
|
1970
|
+
return S();
|
|
1965
1971
|
}
|
|
1966
1972
|
}
|
|
1967
1973
|
|
|
@@ -1971,7 +1977,7 @@ function zt(t, e) {
|
|
|
1971
1977
|
}));
|
|
1972
1978
|
}
|
|
1973
1979
|
|
|
1974
|
-
function
|
|
1980
|
+
function Kt(t, e) {
|
|
1975
1981
|
if (t === e) return 0;
|
|
1976
1982
|
var n = Ut(t), r = Ut(e);
|
|
1977
1983
|
if (n !== r) return bt(n, r);
|
|
@@ -1992,10 +1998,10 @@ function Gt(t, e) {
|
|
|
1992
1998
|
}(t, e);
|
|
1993
1999
|
|
|
1994
2000
|
case 3 /* TimestampValue */ :
|
|
1995
|
-
return
|
|
2001
|
+
return Gt(t.timestampValue, e.timestampValue);
|
|
1996
2002
|
|
|
1997
2003
|
case 4 /* ServerTimestampValue */ :
|
|
1998
|
-
return
|
|
2004
|
+
return Gt(jt(t), jt(e));
|
|
1999
2005
|
|
|
2000
2006
|
case 5 /* StringValue */ :
|
|
2001
2007
|
return bt(t.stringValue, e.stringValue);
|
|
@@ -2024,7 +2030,7 @@ function Gt(t, e) {
|
|
|
2024
2030
|
case 9 /* ArrayValue */ :
|
|
2025
2031
|
return function(t, e) {
|
|
2026
2032
|
for (var n = t.values || [], r = e.values || [], i = 0; i < n.length && i < r.length; ++i) {
|
|
2027
|
-
var o =
|
|
2033
|
+
var o = Kt(n[i], r[i]);
|
|
2028
2034
|
if (o) return o;
|
|
2029
2035
|
}
|
|
2030
2036
|
return bt(n.length, r.length);
|
|
@@ -2044,18 +2050,18 @@ function Gt(t, e) {
|
|
|
2044
2050
|
for (var a = 0; a < r.length && a < o.length; ++a) {
|
|
2045
2051
|
var u = bt(r[a], o[a]);
|
|
2046
2052
|
if (0 !== u) return u;
|
|
2047
|
-
var s =
|
|
2053
|
+
var s = Kt(n[r[a]], i[o[a]]);
|
|
2048
2054
|
if (0 !== s) return s;
|
|
2049
2055
|
}
|
|
2050
2056
|
return bt(r.length, o.length);
|
|
2051
2057
|
}(t.mapValue, e.mapValue);
|
|
2052
2058
|
|
|
2053
2059
|
default:
|
|
2054
|
-
throw
|
|
2060
|
+
throw S();
|
|
2055
2061
|
}
|
|
2056
2062
|
}
|
|
2057
2063
|
|
|
2058
|
-
function
|
|
2064
|
+
function Gt(t, e) {
|
|
2059
2065
|
if ("string" == typeof t && "string" == typeof e && t.length === e.length) return bt(t, e);
|
|
2060
2066
|
var n = Rt(t), r = Rt(e), i = bt(n.seconds, r.seconds);
|
|
2061
2067
|
return 0 !== i ? i : bt(n.nanos, r.nanos);
|
|
@@ -2096,7 +2102,7 @@ function Qt(t, e) {
|
|
|
2096
2102
|
fields: {}
|
|
2097
2103
|
}
|
|
2098
2104
|
};
|
|
2099
|
-
return
|
|
2105
|
+
return St(t.mapValue.fields, (function(t, n) {
|
|
2100
2106
|
return e.mapValue.fields[t] = Jt(n);
|
|
2101
2107
|
})), e;
|
|
2102
2108
|
}
|
|
@@ -2111,7 +2117,7 @@ function Qt(t, e) {
|
|
|
2111
2117
|
return Object.assign({}, t);
|
|
2112
2118
|
}
|
|
2113
2119
|
|
|
2114
|
-
var
|
|
2120
|
+
var $t = /** @class */ function() {
|
|
2115
2121
|
function t(t) {
|
|
2116
2122
|
this.value = t;
|
|
2117
2123
|
}
|
|
@@ -2194,7 +2200,7 @@ var Zt = /** @class */ function() {
|
|
|
2194
2200
|
* entries.
|
|
2195
2201
|
*/
|
|
2196
2202
|
t.prototype.applyChanges = function(t, e, n) {
|
|
2197
|
-
|
|
2203
|
+
St(e, (function(e, n) {
|
|
2198
2204
|
return t[e] = n;
|
|
2199
2205
|
}));
|
|
2200
2206
|
for (var r = 0, i = n; r < i.length; r++) {
|
|
@@ -2204,7 +2210,7 @@ var Zt = /** @class */ function() {
|
|
|
2204
2210
|
}, t.prototype.clone = function() {
|
|
2205
2211
|
return new t(Jt(this.value));
|
|
2206
2212
|
}, t;
|
|
2207
|
-
}(),
|
|
2213
|
+
}(), Zt = /** @class */ function() {
|
|
2208
2214
|
function t(t, e, n, r, i, o) {
|
|
2209
2215
|
this.key = t, this.documentType = e, this.version = n, this.readTime = r, this.data = i,
|
|
2210
2216
|
this.documentState = o
|
|
@@ -2214,7 +2220,7 @@ var Zt = /** @class */ function() {
|
|
|
2214
2220
|
*/;
|
|
2215
2221
|
}
|
|
2216
2222
|
return t.newInvalidDocument = function(e) {
|
|
2217
|
-
return new t(e, 0 /* INVALID */ , Et.min(), Et.min(),
|
|
2223
|
+
return new t(e, 0 /* INVALID */ , Et.min(), Et.min(), $t.empty(), 0 /* SYNCED */);
|
|
2218
2224
|
},
|
|
2219
2225
|
/**
|
|
2220
2226
|
* Creates a new document that is known to exist with the given data at the
|
|
@@ -2224,7 +2230,7 @@ var Zt = /** @class */ function() {
|
|
|
2224
2230
|
return new t(e, 1 /* FOUND_DOCUMENT */ , n, Et.min(), r, 0 /* SYNCED */);
|
|
2225
2231
|
},
|
|
2226
2232
|
/** Creates a new document that is known to not exist at the given version. */ t.newNoDocument = function(e, n) {
|
|
2227
|
-
return new t(e, 2 /* NO_DOCUMENT */ , n, Et.min(),
|
|
2233
|
+
return new t(e, 2 /* NO_DOCUMENT */ , n, Et.min(), $t.empty(), 0 /* SYNCED */);
|
|
2228
2234
|
},
|
|
2229
2235
|
/**
|
|
2230
2236
|
* Creates a new document that is known to exist at the given version but
|
|
@@ -2232,7 +2238,7 @@ var Zt = /** @class */ function() {
|
|
|
2232
2238
|
* base document).
|
|
2233
2239
|
*/
|
|
2234
2240
|
t.newUnknownDocument = function(e, n) {
|
|
2235
|
-
return new t(e, 3 /* UNKNOWN_DOCUMENT */ , n, Et.min(),
|
|
2241
|
+
return new t(e, 3 /* UNKNOWN_DOCUMENT */ , n, Et.min(), $t.empty(), 2 /* HAS_COMMITTED_MUTATIONS */);
|
|
2236
2242
|
},
|
|
2237
2243
|
/**
|
|
2238
2244
|
* Changes the document type to indicate that it exists and that its version
|
|
@@ -2247,7 +2253,7 @@ var Zt = /** @class */ function() {
|
|
|
2247
2253
|
* version.
|
|
2248
2254
|
*/
|
|
2249
2255
|
t.prototype.convertToNoDocument = function(t) {
|
|
2250
|
-
return this.version = t, this.documentType = 2 /* NO_DOCUMENT */ , this.data =
|
|
2256
|
+
return this.version = t, this.documentType = 2 /* NO_DOCUMENT */ , this.data = $t.empty(),
|
|
2251
2257
|
this.documentState = 0 /* SYNCED */ , this;
|
|
2252
2258
|
},
|
|
2253
2259
|
/**
|
|
@@ -2256,7 +2262,7 @@ var Zt = /** @class */ function() {
|
|
|
2256
2262
|
* base document).
|
|
2257
2263
|
*/
|
|
2258
2264
|
t.prototype.convertToUnknownDocument = function(t) {
|
|
2259
|
-
return this.version = t, this.documentType = 3 /* UNKNOWN_DOCUMENT */ , this.data =
|
|
2265
|
+
return this.version = t, this.documentType = 3 /* UNKNOWN_DOCUMENT */ , this.data = $t.empty(),
|
|
2260
2266
|
this.documentState = 2 /* HAS_COMMITTED_MUTATIONS */ , this;
|
|
2261
2267
|
}, t.prototype.setHasCommittedMutations = function() {
|
|
2262
2268
|
return this.documentState = 2 /* HAS_COMMITTED_MUTATIONS */ , this;
|
|
@@ -2302,7 +2308,7 @@ var Zt = /** @class */ function() {
|
|
|
2302
2308
|
void 0 === e && (e = null), void 0 === n && (n = []), void 0 === r && (r = []),
|
|
2303
2309
|
void 0 === i && (i = null), void 0 === o && (o = null), void 0 === a && (a = null),
|
|
2304
2310
|
this.path = t, this.collectionGroup = e, this.orderBy = n, this.filters = r, this.limit = i,
|
|
2305
|
-
this.startAt = o, this.endAt = a, this
|
|
2311
|
+
this.startAt = o, this.endAt = a, this.D = null;
|
|
2306
2312
|
};
|
|
2307
2313
|
|
|
2308
2314
|
/**
|
|
@@ -2359,7 +2365,7 @@ var ne = /** @class */ function(e) {
|
|
|
2359
2365
|
}, n.prototype.matches = function(t) {
|
|
2360
2366
|
var e = t.data.field(this.field);
|
|
2361
2367
|
// Types do not have to match in NOT_EQUAL filters.
|
|
2362
|
-
return "!=" /* NOT_EQUAL */ === this.op ? null !== e && this.S(
|
|
2368
|
+
return "!=" /* NOT_EQUAL */ === this.op ? null !== e && this.S(Kt(e, this.value)) : null !== e && Ut(this.value) === Ut(e) && this.S(Kt(e, this.value));
|
|
2363
2369
|
// Only compare types with matching backend order (such as double and int).
|
|
2364
2370
|
}, n.prototype.S = function(t) {
|
|
2365
2371
|
switch (this.op) {
|
|
@@ -2382,7 +2388,7 @@ var ne = /** @class */ function(e) {
|
|
|
2382
2388
|
return t >= 0;
|
|
2383
2389
|
|
|
2384
2390
|
default:
|
|
2385
|
-
return
|
|
2391
|
+
return S();
|
|
2386
2392
|
}
|
|
2387
2393
|
}, n.prototype.q = function() {
|
|
2388
2394
|
return [ "<" /* LESS_THAN */ , "<=" /* LESS_THAN_OR_EQUAL */ , ">" /* GREATER_THAN */ , ">=" /* GREATER_THAN_OR_EQUAL */ , "!=" /* NOT_EQUAL */ , "not-in" /* NOT_IN */ ].indexOf(this.op) >= 0;
|
|
@@ -2548,7 +2554,7 @@ function ve(t) {
|
|
|
2548
2554
|
* which can be different from the order by constraints the user provided (e.g.
|
|
2549
2555
|
* the SDK and backend always orders by `__name__`).
|
|
2550
2556
|
*/ function we(t) {
|
|
2551
|
-
var e =
|
|
2557
|
+
var e = I(t);
|
|
2552
2558
|
if (null === e.O) {
|
|
2553
2559
|
e.O = [];
|
|
2554
2560
|
var n = ve(e), r = me(e);
|
|
@@ -2575,7 +2581,7 @@ function ve(t) {
|
|
|
2575
2581
|
/**
|
|
2576
2582
|
* Converts this `Query` instance to it's corresponding `Target` representation.
|
|
2577
2583
|
*/ function be(t) {
|
|
2578
|
-
var e =
|
|
2584
|
+
var e = I(t);
|
|
2579
2585
|
if (!e.k) if ("F" /* First */ === e.limitType) e.k = ee(e.path, e.collectionGroup, we(e), e.filters, e.limit, e.startAt, e.endAt); else {
|
|
2580
2586
|
for (
|
|
2581
2587
|
// Flip the orderBy directions since we want the last results
|
|
@@ -2670,25 +2676,25 @@ function _e(t, e) {
|
|
|
2670
2676
|
return null !== e && e.apply(this, arguments) || this;
|
|
2671
2677
|
}
|
|
2672
2678
|
return t(n, e), n;
|
|
2673
|
-
}(Te),
|
|
2679
|
+
}(Te), ke = /** @class */ function(e) {
|
|
2674
2680
|
function n(t) {
|
|
2675
2681
|
var n = this;
|
|
2676
2682
|
return (n = e.call(this) || this).elements = t, n;
|
|
2677
2683
|
}
|
|
2678
2684
|
return t(n, e), n;
|
|
2679
|
-
}(Te),
|
|
2685
|
+
}(Te), Se = /** @class */ function(e) {
|
|
2680
2686
|
function n(t) {
|
|
2681
2687
|
var n = this;
|
|
2682
2688
|
return (n = e.call(this) || this).elements = t, n;
|
|
2683
2689
|
}
|
|
2684
2690
|
return t(n, e), n;
|
|
2685
|
-
}(Te),
|
|
2691
|
+
}(Te), Ae = /** @class */ function(e) {
|
|
2686
2692
|
function n(t, n) {
|
|
2687
2693
|
var r = this;
|
|
2688
2694
|
return (r = e.call(this) || this).L = t, r.M = n, r;
|
|
2689
2695
|
}
|
|
2690
2696
|
return t(n, e), n;
|
|
2691
|
-
}(Te),
|
|
2697
|
+
}(Te), Ie = function(t, e) {
|
|
2692
2698
|
this.field = t, this.transform = e;
|
|
2693
2699
|
}, Ve = /** @class */ function() {
|
|
2694
2700
|
function t(t, e) {
|
|
@@ -2722,7 +2728,7 @@ function _e(t, e) {
|
|
|
2722
2728
|
return t(n, e), n.prototype.getFieldMask = function() {
|
|
2723
2729
|
return null;
|
|
2724
2730
|
}, n;
|
|
2725
|
-
}(Pe),
|
|
2731
|
+
}(Pe), Fe = /** @class */ function(e) {
|
|
2726
2732
|
function n(t, n, r, i, o) {
|
|
2727
2733
|
void 0 === o && (o = []);
|
|
2728
2734
|
var a = this;
|
|
@@ -2741,7 +2747,7 @@ function _e(t, e) {
|
|
|
2741
2747
|
return t(n, e), n.prototype.getFieldMask = function() {
|
|
2742
2748
|
return null;
|
|
2743
2749
|
}, n;
|
|
2744
|
-
}(Pe),
|
|
2750
|
+
}(Pe), Oe = /** @class */ function(e) {
|
|
2745
2751
|
function n(t, n) {
|
|
2746
2752
|
var r = this;
|
|
2747
2753
|
return (r = e.call(this) || this).key = t, r.precondition = n, r.type = 3 /* Verify */ ,
|
|
@@ -2800,7 +2806,7 @@ function je(t, e) {
|
|
|
2800
2806
|
}
|
|
2801
2807
|
|
|
2802
2808
|
function Me(t) {
|
|
2803
|
-
return
|
|
2809
|
+
return A(!!t), Et.fromTimestamp(function(t) {
|
|
2804
2810
|
var e = Rt(t);
|
|
2805
2811
|
return new Tt(e.seconds, e.nanos);
|
|
2806
2812
|
}(t));
|
|
@@ -2819,18 +2825,18 @@ function Be(t, e) {
|
|
|
2819
2825
|
function ze(t, e) {
|
|
2820
2826
|
var n, r = function(t) {
|
|
2821
2827
|
var e = et.fromString(t);
|
|
2822
|
-
return
|
|
2828
|
+
return A($e(e)), e;
|
|
2823
2829
|
}(e);
|
|
2824
2830
|
if (r.get(1) !== t.databaseId.projectId) throw new B(D, "Tried to deserialize key from different project: " + r.get(1) + " vs " + t.databaseId.projectId);
|
|
2825
2831
|
if (r.get(3) !== t.databaseId.database) throw new B(D, "Tried to deserialize key from different database: " + r.get(3) + " vs " + t.databaseId.database);
|
|
2826
|
-
return new it((
|
|
2832
|
+
return new it((A((n = r).length > 4 && "documents" === n.get(4)), n.popFirst(5)));
|
|
2827
2833
|
}
|
|
2828
2834
|
|
|
2829
|
-
function
|
|
2835
|
+
function Ke(t, e) {
|
|
2830
2836
|
return Ue(t.databaseId, e);
|
|
2831
2837
|
}
|
|
2832
2838
|
|
|
2833
|
-
function
|
|
2839
|
+
function Ge(t) {
|
|
2834
2840
|
return new et([ "projects", t.databaseId.projectId, "databases", t.databaseId.database ]).canonicalString();
|
|
2835
2841
|
}
|
|
2836
2842
|
|
|
@@ -2846,10 +2852,10 @@ function We(t, e) {
|
|
|
2846
2852
|
var n = {
|
|
2847
2853
|
structuredQuery: {}
|
|
2848
2854
|
}, r = e.path;
|
|
2849
|
-
null !== e.collectionGroup ? (n.parent =
|
|
2855
|
+
null !== e.collectionGroup ? (n.parent = Ke(t, r), n.structuredQuery.from = [ {
|
|
2850
2856
|
collectionId: e.collectionGroup,
|
|
2851
2857
|
allDescendants: !0
|
|
2852
|
-
} ]) : (n.parent =
|
|
2858
|
+
} ]) : (n.parent = Ke(t, r.popLast()), n.structuredQuery.from = [ {
|
|
2853
2859
|
collectionId: r.lastSegment()
|
|
2854
2860
|
} ]);
|
|
2855
2861
|
var i = function(t) {
|
|
@@ -2954,7 +2960,7 @@ function Je(t) {
|
|
|
2954
2960
|
};
|
|
2955
2961
|
}
|
|
2956
2962
|
|
|
2957
|
-
function
|
|
2963
|
+
function $e(t) {
|
|
2958
2964
|
// Resource names have at least 4 components (project ID, database ID)
|
|
2959
2965
|
return t.length >= 4 && "projects" === t.get(0) && "databases" === t.get(2);
|
|
2960
2966
|
}
|
|
@@ -2974,7 +2980,7 @@ function Ze(t) {
|
|
|
2974
2980
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2975
2981
|
* See the License for the specific language governing permissions and
|
|
2976
2982
|
* limitations under the License.
|
|
2977
|
-
*/ function
|
|
2983
|
+
*/ function Ze(t) {
|
|
2978
2984
|
return new Le(t, /* useProto3Json= */ !0);
|
|
2979
2985
|
}
|
|
2980
2986
|
|
|
@@ -3080,16 +3086,16 @@ function Ze(t) {
|
|
|
3080
3086
|
function n(t, n, r, i) {
|
|
3081
3087
|
var o = this;
|
|
3082
3088
|
return (o = e.call(this) || this).authCredentials = t, o.appCheckCredentials = n,
|
|
3083
|
-
o.
|
|
3089
|
+
o.connection = r, o.L = i, o.tt = !1, o;
|
|
3084
3090
|
}
|
|
3085
|
-
return t(n, e), n.prototype.
|
|
3086
|
-
if (this.
|
|
3091
|
+
return t(n, e), n.prototype.et = function() {
|
|
3092
|
+
if (this.tt) throw new B(L, "The client has already been terminated.");
|
|
3087
3093
|
},
|
|
3088
3094
|
/** Invokes the provided RPC with auth and AppCheck tokens. */ n.prototype.I = function(t, e, n) {
|
|
3089
3095
|
var r = this;
|
|
3090
|
-
return this.
|
|
3096
|
+
return this.et(), Promise.all([ this.authCredentials.getToken(), this.appCheckCredentials.getToken() ]).then((function(i) {
|
|
3091
3097
|
var o = i[0], a = i[1];
|
|
3092
|
-
return r.
|
|
3098
|
+
return r.connection.I(t, e, n, o, a);
|
|
3093
3099
|
})).catch((function(t) {
|
|
3094
3100
|
throw "FirebaseError" === t.name ? (t.code === R && (r.authCredentials.invalidateToken(),
|
|
3095
3101
|
r.appCheckCredentials.invalidateToken()), t) : new B(P, t.toString());
|
|
@@ -3097,15 +3103,15 @@ function Ze(t) {
|
|
|
3097
3103
|
},
|
|
3098
3104
|
/** Invokes the provided RPC with streamed results with auth and AppCheck tokens. */ n.prototype.P = function(t, e, n, r) {
|
|
3099
3105
|
var i = this;
|
|
3100
|
-
return this.
|
|
3106
|
+
return this.et(), Promise.all([ this.authCredentials.getToken(), this.appCheckCredentials.getToken() ]).then((function(o) {
|
|
3101
3107
|
var a = o[0], u = o[1];
|
|
3102
|
-
return i.
|
|
3108
|
+
return i.connection.P(t, e, n, a, u, r);
|
|
3103
3109
|
})).catch((function(t) {
|
|
3104
3110
|
throw "FirebaseError" === t.name ? (t.code === R && (i.authCredentials.invalidateToken(),
|
|
3105
3111
|
i.appCheckCredentials.invalidateToken()), t) : new B(P, t.toString());
|
|
3106
3112
|
}));
|
|
3107
3113
|
}, n.prototype.terminate = function() {
|
|
3108
|
-
this.
|
|
3114
|
+
this.tt = !0;
|
|
3109
3115
|
}, n;
|
|
3110
3116
|
}((function() {}));
|
|
3111
3117
|
|
|
@@ -3142,7 +3148,7 @@ function nn(t, r) {
|
|
|
3142
3148
|
return n(this, (function(n) {
|
|
3143
3149
|
switch (n.label) {
|
|
3144
3150
|
case 0:
|
|
3145
|
-
return e =
|
|
3151
|
+
return e = I(t), i = Ge(e.L) + "/documents", o = {
|
|
3146
3152
|
writes: r.map((function(t) {
|
|
3147
3153
|
return function(t, e) {
|
|
3148
3154
|
var n;
|
|
@@ -3150,11 +3156,11 @@ function nn(t, r) {
|
|
|
3150
3156
|
update: Qe(t, e.key, e.value)
|
|
3151
3157
|
}; else if (e instanceof Ne) n = {
|
|
3152
3158
|
delete: Be(t, e.key)
|
|
3153
|
-
}; else if (e instanceof
|
|
3159
|
+
}; else if (e instanceof Fe) n = {
|
|
3154
3160
|
update: Qe(t, e.key, e.data),
|
|
3155
3161
|
updateMask: Je(e.fieldMask)
|
|
3156
3162
|
}; else {
|
|
3157
|
-
if (!(e instanceof
|
|
3163
|
+
if (!(e instanceof Oe)) return S();
|
|
3158
3164
|
n = {
|
|
3159
3165
|
verify: Be(t, e.key)
|
|
3160
3166
|
};
|
|
@@ -3166,30 +3172,30 @@ function nn(t, r) {
|
|
|
3166
3172
|
fieldPath: e.field.canonicalString(),
|
|
3167
3173
|
setToServerValue: "REQUEST_TIME"
|
|
3168
3174
|
};
|
|
3169
|
-
if (n instanceof
|
|
3175
|
+
if (n instanceof ke) return {
|
|
3170
3176
|
fieldPath: e.field.canonicalString(),
|
|
3171
3177
|
appendMissingElements: {
|
|
3172
3178
|
values: n.elements
|
|
3173
3179
|
}
|
|
3174
3180
|
};
|
|
3175
|
-
if (n instanceof
|
|
3181
|
+
if (n instanceof Se) return {
|
|
3176
3182
|
fieldPath: e.field.canonicalString(),
|
|
3177
3183
|
removeAllFromArray: {
|
|
3178
3184
|
values: n.elements
|
|
3179
3185
|
}
|
|
3180
3186
|
};
|
|
3181
|
-
if (n instanceof
|
|
3187
|
+
if (n instanceof Ae) return {
|
|
3182
3188
|
fieldPath: e.field.canonicalString(),
|
|
3183
3189
|
increment: n.M
|
|
3184
3190
|
};
|
|
3185
|
-
throw
|
|
3191
|
+
throw S();
|
|
3186
3192
|
}(0, t);
|
|
3187
3193
|
}))), e.precondition.isNone || (n.currentDocument = function(t, e) {
|
|
3188
3194
|
return void 0 !== e.updateTime ? {
|
|
3189
3195
|
updateTime: je(t, e.updateTime)
|
|
3190
3196
|
} : void 0 !== e.exists ? {
|
|
3191
3197
|
exists: e.exists
|
|
3192
|
-
} :
|
|
3198
|
+
} : S();
|
|
3193
3199
|
}(t, e.precondition)), n;
|
|
3194
3200
|
}(e.L, t);
|
|
3195
3201
|
}))
|
|
@@ -3208,7 +3214,7 @@ function rn(t, r) {
|
|
|
3208
3214
|
return n(this, (function(n) {
|
|
3209
3215
|
switch (n.label) {
|
|
3210
3216
|
case 0:
|
|
3211
|
-
return e =
|
|
3217
|
+
return e = I(t), i = Ge(e.L) + "/documents", o = {
|
|
3212
3218
|
documents: r.map((function(t) {
|
|
3213
3219
|
return Be(e.L, t);
|
|
3214
3220
|
}))
|
|
@@ -3218,23 +3224,23 @@ function rn(t, r) {
|
|
|
3218
3224
|
return a = n.sent(), u = new Map, a.forEach((function(t) {
|
|
3219
3225
|
var n = function(t, e) {
|
|
3220
3226
|
return "found" in e ? function(t, e) {
|
|
3221
|
-
|
|
3222
|
-
var n = ze(t, e.found.name), r = Me(e.found.updateTime), i = new
|
|
3227
|
+
A(!!e.found), e.found.name, e.found.updateTime;
|
|
3228
|
+
var n = ze(t, e.found.name), r = Me(e.found.updateTime), i = new $t({
|
|
3223
3229
|
mapValue: {
|
|
3224
3230
|
fields: e.found.fields
|
|
3225
3231
|
}
|
|
3226
3232
|
});
|
|
3227
|
-
return
|
|
3233
|
+
return Zt.newFoundDocument(n, r, i);
|
|
3228
3234
|
}(t, e) : "missing" in e ? function(t, e) {
|
|
3229
|
-
|
|
3235
|
+
A(!!e.missing), A(!!e.readTime);
|
|
3230
3236
|
var n = ze(t, e.missing), r = Me(e.readTime);
|
|
3231
|
-
return
|
|
3232
|
-
}(t, e) :
|
|
3237
|
+
return Zt.newNoDocument(n, r);
|
|
3238
|
+
}(t, e) : S();
|
|
3233
3239
|
}(e.L, t);
|
|
3234
3240
|
u.set(n.key.toString(), n);
|
|
3235
3241
|
})), s = [], [ 2 /*return*/ , (r.forEach((function(t) {
|
|
3236
3242
|
var e = u.get(t.toString());
|
|
3237
|
-
|
|
3243
|
+
A(!!e), s.push(e);
|
|
3238
3244
|
})), s) ];
|
|
3239
3245
|
}
|
|
3240
3246
|
}));
|
|
@@ -3274,7 +3280,7 @@ var on = new Map;
|
|
|
3274
3280
|
var e = function(t) {
|
|
3275
3281
|
return new vt(t, fetch.bind(null));
|
|
3276
3282
|
}((i = t._databaseId, o = t.app.options.appId || "", a = t._persistenceKey, u = t._freezeSettings(),
|
|
3277
|
-
new
|
|
3283
|
+
new $(i, o, a, u.host, u.ssl, u.experimentalForceLongPolling, u.experimentalAutoDetectLongPolling, u.useFetchStreams))), n = Ze(t._databaseId), r = function(t, e, n, r) {
|
|
3278
3284
|
return new en(t, e, n, r);
|
|
3279
3285
|
}(t._authCredentials, t._appCheckCredentials, e, n);
|
|
3280
3286
|
on.set(t, r);
|
|
@@ -3363,7 +3369,7 @@ var on = new Map;
|
|
|
3363
3369
|
}), t.prototype._setSettings = function(t) {
|
|
3364
3370
|
if (this._settingsFrozen) throw new B(L, "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.");
|
|
3365
3371
|
this._settings = new un(t), void 0 !== t.credentials && (this._authCredentials = function(t) {
|
|
3366
|
-
if (!t) return new
|
|
3372
|
+
if (!t) return new G;
|
|
3367
3373
|
switch (t.type) {
|
|
3368
3374
|
case "gapi":
|
|
3369
3375
|
var e = t.client;
|
|
@@ -3475,7 +3481,7 @@ function ln(t, e) {
|
|
|
3475
3481
|
if (!s) throw new B(D, "mockUserToken must contain 'sub' or 'user_id' field!");
|
|
3476
3482
|
u = new v(s);
|
|
3477
3483
|
}
|
|
3478
|
-
t._authCredentials = new Q(new
|
|
3484
|
+
t._authCredentials = new Q(new K(a, u));
|
|
3479
3485
|
}
|
|
3480
3486
|
}
|
|
3481
3487
|
|
|
@@ -3574,7 +3580,7 @@ var pn = function() {
|
|
|
3574
3580
|
return n(this, (function(n) {
|
|
3575
3581
|
switch (n.label) {
|
|
3576
3582
|
case 0:
|
|
3577
|
-
return e =
|
|
3583
|
+
return e = I(t), i = function(t, e) {
|
|
3578
3584
|
var n = We(t, e);
|
|
3579
3585
|
return {
|
|
3580
3586
|
structuredAggregationQuery: {
|
|
@@ -3586,7 +3592,7 @@ var pn = function() {
|
|
|
3586
3592
|
},
|
|
3587
3593
|
parent: n.parent
|
|
3588
3594
|
};
|
|
3589
|
-
}(e.L, be(r)), o = i.parent, e.
|
|
3595
|
+
}(e.L, be(r)), o = i.parent, e.connection.v || delete i.parent, [ 4 /*yield*/ , e.P("RunAggregationQuery", o, i, /*expectedResponseCount=*/ 1) ];
|
|
3590
3596
|
|
|
3591
3597
|
case 1:
|
|
3592
3598
|
return [ 2 /*return*/ , n.sent().filter((function(t) {
|
|
@@ -3598,7 +3604,7 @@ var pn = function() {
|
|
|
3598
3604
|
}));
|
|
3599
3605
|
}));
|
|
3600
3606
|
}(this.datastore, this.query._query).then((function(e) {
|
|
3601
|
-
|
|
3607
|
+
A(void 0 !== e[0]);
|
|
3602
3608
|
var n = Object.entries(e[0]).filter((function(t) {
|
|
3603
3609
|
var e = t[0];
|
|
3604
3610
|
return t[1], "count_alias" === e;
|
|
@@ -3607,7 +3613,7 @@ var pn = function() {
|
|
|
3607
3613
|
var n = e[1];
|
|
3608
3614
|
return t.userDataWriter.convertValue(n);
|
|
3609
3615
|
}))[0];
|
|
3610
|
-
return
|
|
3616
|
+
return A("number" == typeof n), Promise.resolve(new dn(t.query, {
|
|
3611
3617
|
count: n
|
|
3612
3618
|
}));
|
|
3613
3619
|
}));
|
|
@@ -3760,7 +3766,7 @@ function _n(t, e) {
|
|
|
3760
3766
|
if (t = p(t),
|
|
3761
3767
|
// We allow omission of 'pathString' but explicitly prohibit passing in both
|
|
3762
3768
|
// 'undefined' and 'null'.
|
|
3763
|
-
1 === arguments.length && (e = wt
|
|
3769
|
+
1 === arguments.length && (e = wt.$()), ot("doc", "path", e), t instanceof sn) {
|
|
3764
3770
|
var o = et.fromString.apply(et, r([ e ], n));
|
|
3765
3771
|
return at(o), new mn(t,
|
|
3766
3772
|
/* converter= */ null, new it(o));
|
|
@@ -3824,7 +3830,7 @@ function En(t, e) {
|
|
|
3824
3830
|
*/;
|
|
3825
3831
|
}
|
|
3826
3832
|
|
|
3827
|
-
var
|
|
3833
|
+
var kn = /** @class */ function() {
|
|
3828
3834
|
/** @hideconstructor */
|
|
3829
3835
|
function t(t) {
|
|
3830
3836
|
this._byteString = t;
|
|
@@ -3882,7 +3888,7 @@ var Sn = /** @class */ function() {
|
|
|
3882
3888
|
t.prototype.isEqual = function(t) {
|
|
3883
3889
|
return this._byteString.isEqual(t._byteString);
|
|
3884
3890
|
}, t;
|
|
3885
|
-
}(),
|
|
3891
|
+
}(), Sn = /** @class */ function() {
|
|
3886
3892
|
/**
|
|
3887
3893
|
* Creates a `FieldPath` from the provided field names. If more than one field
|
|
3888
3894
|
* name is provided, the path will point to a nested field in a document.
|
|
@@ -3932,8 +3938,8 @@ var Sn = /** @class */ function() {
|
|
|
3932
3938
|
* Returns a special sentinel `FieldPath` to refer to the ID of a document.
|
|
3933
3939
|
* It can be used in queries to sort or filter by the document ID.
|
|
3934
3940
|
*/
|
|
3935
|
-
function
|
|
3936
|
-
return new
|
|
3941
|
+
function An() {
|
|
3942
|
+
return new Sn("__name__");
|
|
3937
3943
|
}
|
|
3938
3944
|
|
|
3939
3945
|
/**
|
|
@@ -3955,7 +3961,7 @@ function In() {
|
|
|
3955
3961
|
/**
|
|
3956
3962
|
* Sentinel values that can be used when writing document fields with `set()`
|
|
3957
3963
|
* or `update()`.
|
|
3958
|
-
*/ var
|
|
3964
|
+
*/ var In =
|
|
3959
3965
|
/**
|
|
3960
3966
|
* @param _methodName - The public API endpoint that returns this class.
|
|
3961
3967
|
* @hideconstructor
|
|
@@ -4020,16 +4026,16 @@ function(t) {
|
|
|
4020
4026
|
this.data = t, this.fieldMask = e, this.fieldTransforms = n;
|
|
4021
4027
|
}
|
|
4022
4028
|
return t.prototype.toMutation = function(t, e) {
|
|
4023
|
-
return null !== this.fieldMask ? new
|
|
4029
|
+
return null !== this.fieldMask ? new Fe(t, this.data, this.fieldMask, e, this.fieldTransforms) : new De(t, this.data, e, this.fieldTransforms);
|
|
4024
4030
|
}, t;
|
|
4025
|
-
}(),
|
|
4031
|
+
}(), Fn = /** @class */ function() {
|
|
4026
4032
|
function t(t,
|
|
4027
4033
|
// The fieldMask does not include document transforms.
|
|
4028
4034
|
e, n) {
|
|
4029
4035
|
this.data = t, this.fieldMask = e, this.fieldTransforms = n;
|
|
4030
4036
|
}
|
|
4031
4037
|
return t.prototype.toMutation = function(t, e) {
|
|
4032
|
-
return new
|
|
4038
|
+
return new Fe(t, this.data, this.fieldMask, e, this.fieldTransforms);
|
|
4033
4039
|
}, t;
|
|
4034
4040
|
}();
|
|
4035
4041
|
|
|
@@ -4069,11 +4075,11 @@ function(t) {
|
|
|
4069
4075
|
return !1;
|
|
4070
4076
|
|
|
4071
4077
|
default:
|
|
4072
|
-
throw
|
|
4078
|
+
throw S();
|
|
4073
4079
|
}
|
|
4074
4080
|
}
|
|
4075
4081
|
|
|
4076
|
-
/** A "context" object passed around while parsing user data. */ var
|
|
4082
|
+
/** A "context" object passed around while parsing user data. */ var On = /** @class */ function() {
|
|
4077
4083
|
/**
|
|
4078
4084
|
* Initializes a ParseContext with the given source and path.
|
|
4079
4085
|
*
|
|
@@ -4096,7 +4102,7 @@ function(t) {
|
|
|
4096
4102
|
this.settings = t, this.databaseId = e, this.L = n, this.ignoreUndefinedProperties = r,
|
|
4097
4103
|
// Minor hack: If fieldTransforms is undefined, we assume this is an
|
|
4098
4104
|
// external call and we need to validate the entire path.
|
|
4099
|
-
void 0 === i && this.
|
|
4105
|
+
void 0 === i && this.nt(), this.fieldTransforms = i || [], this.fieldMask = o || [];
|
|
4100
4106
|
}
|
|
4101
4107
|
return Object.defineProperty(t.prototype, "path", {
|
|
4102
4108
|
get: function() {
|
|
@@ -4104,36 +4110,36 @@ function(t) {
|
|
|
4104
4110
|
},
|
|
4105
4111
|
enumerable: !1,
|
|
4106
4112
|
configurable: !0
|
|
4107
|
-
}), Object.defineProperty(t.prototype, "
|
|
4113
|
+
}), Object.defineProperty(t.prototype, "rt", {
|
|
4108
4114
|
get: function() {
|
|
4109
|
-
return this.settings.
|
|
4115
|
+
return this.settings.rt;
|
|
4110
4116
|
},
|
|
4111
4117
|
enumerable: !1,
|
|
4112
4118
|
configurable: !0
|
|
4113
4119
|
}),
|
|
4114
|
-
/** Returns a new context with the specified settings overwritten. */ t.prototype.
|
|
4120
|
+
/** Returns a new context with the specified settings overwritten. */ t.prototype.st = function(e) {
|
|
4115
4121
|
return new t(Object.assign(Object.assign({}, this.settings), e), this.databaseId, this.L, this.ignoreUndefinedProperties, this.fieldTransforms, this.fieldMask);
|
|
4116
|
-
}, t.prototype.
|
|
4117
|
-
var e, n = null === (e = this.path) || void 0 === e ? void 0 : e.child(t), r = this.
|
|
4122
|
+
}, t.prototype.it = function(t) {
|
|
4123
|
+
var e, n = null === (e = this.path) || void 0 === e ? void 0 : e.child(t), r = this.st({
|
|
4118
4124
|
path: n,
|
|
4119
|
-
|
|
4125
|
+
ot: !1
|
|
4120
4126
|
});
|
|
4121
|
-
return r.
|
|
4122
|
-
}, t.prototype.
|
|
4123
|
-
var e, n = null === (e = this.path) || void 0 === e ? void 0 : e.child(t), r = this.
|
|
4127
|
+
return r.ut(t), r;
|
|
4128
|
+
}, t.prototype.ct = function(t) {
|
|
4129
|
+
var e, n = null === (e = this.path) || void 0 === e ? void 0 : e.child(t), r = this.st({
|
|
4124
4130
|
path: n,
|
|
4125
|
-
|
|
4131
|
+
ot: !1
|
|
4126
4132
|
});
|
|
4127
|
-
return r.
|
|
4128
|
-
}, t.prototype.
|
|
4133
|
+
return r.nt(), r;
|
|
4134
|
+
}, t.prototype.at = function(t) {
|
|
4129
4135
|
// TODO(b/34871131): We don't support array paths right now; so make path
|
|
4130
4136
|
// undefined.
|
|
4131
|
-
return this.
|
|
4137
|
+
return this.st({
|
|
4132
4138
|
path: void 0,
|
|
4133
|
-
|
|
4139
|
+
ot: !0
|
|
4134
4140
|
});
|
|
4135
|
-
}, t.prototype.
|
|
4136
|
-
return
|
|
4141
|
+
}, t.prototype.ht = function(t) {
|
|
4142
|
+
return Zn(t, this.settings.methodName, this.settings.lt || !1, this.path, this.settings.ft);
|
|
4137
4143
|
},
|
|
4138
4144
|
/** Returns 'true' if 'fieldPath' was traversed when creating this context. */ t.prototype.contains = function(t) {
|
|
4139
4145
|
return void 0 !== this.fieldMask.find((function(e) {
|
|
@@ -4141,27 +4147,27 @@ function(t) {
|
|
|
4141
4147
|
})) || void 0 !== this.fieldTransforms.find((function(e) {
|
|
4142
4148
|
return t.isPrefixOf(e.field);
|
|
4143
4149
|
}));
|
|
4144
|
-
}, t.prototype.
|
|
4150
|
+
}, t.prototype.nt = function() {
|
|
4145
4151
|
// TODO(b/34871131): Remove null check once we have proper paths for fields
|
|
4146
4152
|
// within arrays.
|
|
4147
|
-
if (this.path) for (var t = 0; t < this.path.length; t++) this.
|
|
4148
|
-
}, t.prototype.
|
|
4149
|
-
if (0 === t.length) throw this.
|
|
4150
|
-
if (Nn(this.
|
|
4153
|
+
if (this.path) for (var t = 0; t < this.path.length; t++) this.ut(this.path.get(t));
|
|
4154
|
+
}, t.prototype.ut = function(t) {
|
|
4155
|
+
if (0 === t.length) throw this.ht("Document fields must not be empty");
|
|
4156
|
+
if (Nn(this.rt) && Pn.test(t)) throw this.ht('Document fields cannot begin and end with "__"');
|
|
4151
4157
|
}, t;
|
|
4152
4158
|
}(), Rn = /** @class */ function() {
|
|
4153
4159
|
function t(t, e, n) {
|
|
4154
|
-
this.databaseId = t, this.ignoreUndefinedProperties = e, this.L = n ||
|
|
4160
|
+
this.databaseId = t, this.ignoreUndefinedProperties = e, this.L = n || Ze(t)
|
|
4155
4161
|
/** Creates a new top-level parse context. */;
|
|
4156
4162
|
}
|
|
4157
|
-
return t.prototype.
|
|
4158
|
-
return void 0 === r && (r = !1), new
|
|
4159
|
-
|
|
4163
|
+
return t.prototype.dt = function(t, e, n, r) {
|
|
4164
|
+
return void 0 === r && (r = !1), new On({
|
|
4165
|
+
rt: t,
|
|
4160
4166
|
methodName: e,
|
|
4161
|
-
|
|
4167
|
+
ft: n,
|
|
4162
4168
|
path: rt.emptyPath(),
|
|
4163
|
-
|
|
4164
|
-
|
|
4169
|
+
ot: !1,
|
|
4170
|
+
lt: r
|
|
4165
4171
|
}, this.databaseId, this.L, this.ignoreUndefinedProperties);
|
|
4166
4172
|
}, t;
|
|
4167
4173
|
}();
|
|
@@ -4170,26 +4176,26 @@ function(t) {
|
|
|
4170
4176
|
* Helper for parsing raw user input (provided via the API) into internal model
|
|
4171
4177
|
* classes.
|
|
4172
4178
|
*/ function qn(t) {
|
|
4173
|
-
var e = t._freezeSettings(), n =
|
|
4179
|
+
var e = t._freezeSettings(), n = Ze(t._databaseId);
|
|
4174
4180
|
return new Rn(t._databaseId, !!e.ignoreUndefinedProperties, n);
|
|
4175
4181
|
}
|
|
4176
4182
|
|
|
4177
4183
|
/** Parse document data from a set() call. */ function Ln(t, e, n, r, i, o) {
|
|
4178
4184
|
void 0 === o && (o = {});
|
|
4179
|
-
var a = t.
|
|
4185
|
+
var a = t.dt(o.merge || o.mergeFields ? 2 /* MergeSet */ : 0 /* Set */ , e, n, i);
|
|
4180
4186
|
Hn("Data must be an object, but it was:", a, r);
|
|
4181
4187
|
var u, s, c = Wn(r, a);
|
|
4182
|
-
if (o.merge) u = new
|
|
4188
|
+
if (o.merge) u = new Ft(a.fieldMask), s = a.fieldTransforms; else if (o.mergeFields) {
|
|
4183
4189
|
for (var l = [], f = 0, h = o.mergeFields; f < h.length; f++) {
|
|
4184
4190
|
var p = Xn(e, h[f], n);
|
|
4185
4191
|
if (!a.contains(p)) throw new B(D, "Field '" + p + "' is specified in your field mask but missing from your input data.");
|
|
4186
4192
|
tr(l, p) || l.push(p);
|
|
4187
4193
|
}
|
|
4188
|
-
u = new
|
|
4194
|
+
u = new Ft(l), s = a.fieldTransforms.filter((function(t) {
|
|
4189
4195
|
return u.covers(t.field);
|
|
4190
4196
|
}));
|
|
4191
4197
|
} else u = null, s = a.fieldTransforms;
|
|
4192
|
-
return new Dn(new
|
|
4198
|
+
return new Dn(new $t(c), u, s);
|
|
4193
4199
|
}
|
|
4194
4200
|
|
|
4195
4201
|
var xn = /** @class */ function(e) {
|
|
@@ -4197,14 +4203,14 @@ var xn = /** @class */ function(e) {
|
|
|
4197
4203
|
return null !== e && e.apply(this, arguments) || this;
|
|
4198
4204
|
}
|
|
4199
4205
|
return t(n, e), n.prototype._toFieldTransform = function(t) {
|
|
4200
|
-
if (2 /* MergeSet */ !== t.
|
|
4206
|
+
if (2 /* MergeSet */ !== t.rt) throw 1 /* Update */ === t.rt ? t.ht(this._methodName + "() can only appear at the top level of your update data") : t.ht(this._methodName + "() cannot be used with set() unless you pass {merge:true}");
|
|
4201
4207
|
// No transform to add for a delete, but we need to add it to our
|
|
4202
4208
|
// fieldMask so it gets deleted.
|
|
4203
4209
|
return t.fieldMask.push(t.path), null;
|
|
4204
4210
|
}, n.prototype.isEqual = function(t) {
|
|
4205
4211
|
return t instanceof n;
|
|
4206
4212
|
}, n;
|
|
4207
|
-
}(
|
|
4213
|
+
}(In);
|
|
4208
4214
|
|
|
4209
4215
|
/**
|
|
4210
4216
|
* Creates a child context for parsing SerializableFieldValues.
|
|
@@ -4222,11 +4228,11 @@ var xn = /** @class */ function(e) {
|
|
|
4222
4228
|
* @param context - The parent context.
|
|
4223
4229
|
* @param arrayElement - Whether or not the FieldValue has an array.
|
|
4224
4230
|
*/ function Cn(t, e, n) {
|
|
4225
|
-
return new
|
|
4226
|
-
|
|
4227
|
-
|
|
4231
|
+
return new On({
|
|
4232
|
+
rt: 3 /* Argument */ ,
|
|
4233
|
+
ft: e.settings.ft,
|
|
4228
4234
|
methodName: t._methodName,
|
|
4229
|
-
|
|
4235
|
+
ot: n
|
|
4230
4236
|
}, e.databaseId, e.L, e.ignoreUndefinedProperties);
|
|
4231
4237
|
}
|
|
4232
4238
|
|
|
@@ -4235,64 +4241,64 @@ var jn = /** @class */ function(e) {
|
|
|
4235
4241
|
return null !== e && e.apply(this, arguments) || this;
|
|
4236
4242
|
}
|
|
4237
4243
|
return t(n, e), n.prototype._toFieldTransform = function(t) {
|
|
4238
|
-
return new
|
|
4244
|
+
return new Ie(t.path, new Ee);
|
|
4239
4245
|
}, n.prototype.isEqual = function(t) {
|
|
4240
4246
|
return t instanceof n;
|
|
4241
4247
|
}, n;
|
|
4242
|
-
}(
|
|
4248
|
+
}(In), Mn = /** @class */ function(e) {
|
|
4243
4249
|
function n(t, n) {
|
|
4244
4250
|
var r = this;
|
|
4245
|
-
return (r = e.call(this, t) || this).
|
|
4251
|
+
return (r = e.call(this, t) || this).wt = n, r;
|
|
4246
4252
|
}
|
|
4247
4253
|
return t(n, e), n.prototype._toFieldTransform = function(t) {
|
|
4248
4254
|
var e = Cn(this, t,
|
|
4249
|
-
/*array=*/ !0), n = this.
|
|
4255
|
+
/*array=*/ !0), n = this.wt.map((function(t) {
|
|
4250
4256
|
return Qn(t, e);
|
|
4251
|
-
})), r = new
|
|
4252
|
-
return new
|
|
4257
|
+
})), r = new ke(n);
|
|
4258
|
+
return new Ie(t.path, r);
|
|
4253
4259
|
}, n.prototype.isEqual = function(t) {
|
|
4254
4260
|
// TODO(mrschmidt): Implement isEquals
|
|
4255
4261
|
return this === t;
|
|
4256
4262
|
}, n;
|
|
4257
|
-
}(
|
|
4263
|
+
}(In), Un = /** @class */ function(e) {
|
|
4258
4264
|
function n(t, n) {
|
|
4259
4265
|
var r = this;
|
|
4260
|
-
return (r = e.call(this, t) || this).
|
|
4266
|
+
return (r = e.call(this, t) || this).wt = n, r;
|
|
4261
4267
|
}
|
|
4262
4268
|
return t(n, e), n.prototype._toFieldTransform = function(t) {
|
|
4263
4269
|
var e = Cn(this, t,
|
|
4264
|
-
/*array=*/ !0), n = this.
|
|
4270
|
+
/*array=*/ !0), n = this.wt.map((function(t) {
|
|
4265
4271
|
return Qn(t, e);
|
|
4266
|
-
})), r = new
|
|
4267
|
-
return new
|
|
4272
|
+
})), r = new Se(n);
|
|
4273
|
+
return new Ie(t.path, r);
|
|
4268
4274
|
}, n.prototype.isEqual = function(t) {
|
|
4269
4275
|
// TODO(mrschmidt): Implement isEquals
|
|
4270
4276
|
return this === t;
|
|
4271
4277
|
}, n;
|
|
4272
|
-
}(
|
|
4278
|
+
}(In), Bn = /** @class */ function(e) {
|
|
4273
4279
|
function n(t, n) {
|
|
4274
4280
|
var r = this;
|
|
4275
|
-
return (r = e.call(this, t) || this).
|
|
4281
|
+
return (r = e.call(this, t) || this).yt = n, r;
|
|
4276
4282
|
}
|
|
4277
4283
|
return t(n, e), n.prototype._toFieldTransform = function(t) {
|
|
4278
|
-
var e = new
|
|
4279
|
-
return new
|
|
4284
|
+
var e = new Ae(t.L, _e(t.L, this.yt));
|
|
4285
|
+
return new Ie(t.path, e);
|
|
4280
4286
|
}, n.prototype.isEqual = function(t) {
|
|
4281
4287
|
// TODO(mrschmidt): Implement isEquals
|
|
4282
4288
|
return this === t;
|
|
4283
4289
|
}, n;
|
|
4284
|
-
}(
|
|
4290
|
+
}(In);
|
|
4285
4291
|
|
|
4286
4292
|
/** Parse update data from an update() call. */ function zn(t, e, n, r) {
|
|
4287
|
-
var i = t.
|
|
4293
|
+
var i = t.dt(1 /* Update */ , e, n);
|
|
4288
4294
|
Hn("Data must be an object, but it was:", i, r);
|
|
4289
|
-
var o = [], a =
|
|
4290
|
-
|
|
4291
|
-
var u =
|
|
4295
|
+
var o = [], a = $t.empty();
|
|
4296
|
+
St(r, (function(t, r) {
|
|
4297
|
+
var u = $n(e, t, n);
|
|
4292
4298
|
// For Compat types, we have to "extract" the underlying types before
|
|
4293
4299
|
// performing validation.
|
|
4294
4300
|
r = p(r);
|
|
4295
|
-
var s = i.
|
|
4301
|
+
var s = i.ct(u);
|
|
4296
4302
|
if (r instanceof xn)
|
|
4297
4303
|
// Add it to the field mask, but don't add anything to updateData.
|
|
4298
4304
|
o.push(u); else {
|
|
@@ -4300,22 +4306,22 @@ var jn = /** @class */ function(e) {
|
|
|
4300
4306
|
null != c && (o.push(u), a.set(u, c));
|
|
4301
4307
|
}
|
|
4302
4308
|
}));
|
|
4303
|
-
var u = new
|
|
4304
|
-
return new
|
|
4309
|
+
var u = new Ft(o);
|
|
4310
|
+
return new Fn(a, u, i.fieldTransforms);
|
|
4305
4311
|
}
|
|
4306
4312
|
|
|
4307
|
-
/** Parse update data from a list of field/value arguments. */ function
|
|
4308
|
-
var a = t.
|
|
4313
|
+
/** Parse update data from a list of field/value arguments. */ function Kn(t, e, n, r, i, o) {
|
|
4314
|
+
var a = t.dt(1 /* Update */ , e, n), u = [ Xn(e, r, n) ], s = [ i ];
|
|
4309
4315
|
if (o.length % 2 != 0) throw new B(D, "Function " + e + "() needs to be called with an even number of arguments that alternate between field names and values.");
|
|
4310
4316
|
for (var c = 0; c < o.length; c += 2) u.push(Xn(e, o[c])), s.push(o[c + 1]);
|
|
4311
4317
|
// We iterate in reverse order to pick the last value for a field if the
|
|
4312
4318
|
// user specified the field multiple times.
|
|
4313
|
-
for (var l = [], f =
|
|
4319
|
+
for (var l = [], f = $t.empty(), h = u.length - 1; h >= 0; --h) if (!tr(l, u[h])) {
|
|
4314
4320
|
var d = u[h], y = s[h];
|
|
4315
4321
|
// For Compat types, we have to "extract" the underlying types before
|
|
4316
4322
|
// performing validation.
|
|
4317
4323
|
y = p(y);
|
|
4318
|
-
var m = a.
|
|
4324
|
+
var m = a.ct(d);
|
|
4319
4325
|
if (y instanceof xn)
|
|
4320
4326
|
// Add it to the field mask, but don't add anything to updateData.
|
|
4321
4327
|
l.push(d); else {
|
|
@@ -4323,8 +4329,8 @@ var jn = /** @class */ function(e) {
|
|
|
4323
4329
|
null != v && (l.push(d), f.set(d, v));
|
|
4324
4330
|
}
|
|
4325
4331
|
}
|
|
4326
|
-
var g = new
|
|
4327
|
-
return new
|
|
4332
|
+
var g = new Ft(l);
|
|
4333
|
+
return new Fn(f, g, a.fieldTransforms);
|
|
4328
4334
|
}
|
|
4329
4335
|
|
|
4330
4336
|
/**
|
|
@@ -4333,8 +4339,8 @@ var jn = /** @class */ function(e) {
|
|
|
4333
4339
|
*
|
|
4334
4340
|
* @param allowArrays - Whether the query value is an array that may directly
|
|
4335
4341
|
* contain additional arrays (e.g. the operand of an `in` query).
|
|
4336
|
-
*/ function
|
|
4337
|
-
return void 0 === r && (r = !1), Qn(n, t.
|
|
4342
|
+
*/ function Gn(t, e, n, r) {
|
|
4343
|
+
return void 0 === r && (r = !1), Qn(n, t.dt(r ? 4 /* ArrayArgument */ : 3 /* Argument */ , e));
|
|
4338
4344
|
}
|
|
4339
4345
|
|
|
4340
4346
|
/**
|
|
@@ -4350,7 +4356,7 @@ var jn = /** @class */ function(e) {
|
|
|
4350
4356
|
// Unwrap the API type from the Compat SDK. This will return the API type
|
|
4351
4357
|
// from firestore-exp.
|
|
4352
4358
|
t = p(t))) return Hn("Unsupported field value:", e, t), Wn(t, e);
|
|
4353
|
-
if (t instanceof
|
|
4359
|
+
if (t instanceof In)
|
|
4354
4360
|
// FieldValues usually parse into transforms (except deleteField())
|
|
4355
4361
|
// in which case we do not want to include this field in our parsed data
|
|
4356
4362
|
// (as doing so will overwrite the field directly prior to the transform
|
|
@@ -4362,8 +4368,8 @@ var jn = /** @class */ function(e) {
|
|
|
4362
4368
|
*/
|
|
4363
4369
|
return function(t, e) {
|
|
4364
4370
|
// Sentinels are only supported with writes, and not within arrays.
|
|
4365
|
-
if (!Nn(e.
|
|
4366
|
-
if (!e.path) throw e.
|
|
4371
|
+
if (!Nn(e.rt)) throw e.ht(t._methodName + "() can only be used with update() and set()");
|
|
4372
|
+
if (!e.path) throw e.ht(t._methodName + "() is not currently supported inside arrays");
|
|
4367
4373
|
var n = t._toFieldTransform(e);
|
|
4368
4374
|
n && e.fieldTransforms.push(n);
|
|
4369
4375
|
}(t, e), null;
|
|
@@ -4382,10 +4388,10 @@ var jn = /** @class */ function(e) {
|
|
|
4382
4388
|
// the set of values to be included for the IN query) that may directly
|
|
4383
4389
|
// contain additional arrays (each representing an individual field
|
|
4384
4390
|
// value), so we disable this validation.
|
|
4385
|
-
if (e.settings.
|
|
4391
|
+
if (e.settings.ot && 4 /* ArrayArgument */ !== e.rt) throw e.ht("Nested arrays are not supported");
|
|
4386
4392
|
return function(t, e) {
|
|
4387
4393
|
for (var n = [], r = 0, i = 0, o = t; i < o.length; i++) {
|
|
4388
|
-
var a = Qn(o[i], e.
|
|
4394
|
+
var a = Qn(o[i], e.at(r));
|
|
4389
4395
|
null == a && (
|
|
4390
4396
|
// Just include nulls in the array for fields being replaced with a
|
|
4391
4397
|
// sentinel.
|
|
@@ -4432,17 +4438,17 @@ var jn = /** @class */ function(e) {
|
|
|
4432
4438
|
longitude: t.longitude
|
|
4433
4439
|
}
|
|
4434
4440
|
};
|
|
4435
|
-
if (t instanceof
|
|
4441
|
+
if (t instanceof kn) return {
|
|
4436
4442
|
bytesValue: Ce(e.L, t._byteString)
|
|
4437
4443
|
};
|
|
4438
4444
|
if (t instanceof mn) {
|
|
4439
4445
|
var i = e.databaseId, o = t.firestore._databaseId;
|
|
4440
|
-
if (!o.isEqual(i)) throw e.
|
|
4446
|
+
if (!o.isEqual(i)) throw e.ht("Document reference is for database " + o.projectId + "/" + o.database + " but should be for database " + i.projectId + "/" + i.database);
|
|
4441
4447
|
return {
|
|
4442
4448
|
referenceValue: Ue(t.firestore._databaseId || e.databaseId, t._key.path)
|
|
4443
4449
|
};
|
|
4444
4450
|
}
|
|
4445
|
-
throw e.
|
|
4451
|
+
throw e.ht("Unsupported field value: " + st(t));
|
|
4446
4452
|
}(t, e);
|
|
4447
4453
|
}
|
|
4448
4454
|
|
|
@@ -4454,8 +4460,8 @@ function Wn(t, e) {
|
|
|
4454
4460
|
}(t) ?
|
|
4455
4461
|
// If we encounter an empty object, we explicitly add it to the update
|
|
4456
4462
|
// mask to ensure that the server creates a map entry.
|
|
4457
|
-
e.path && e.path.length > 0 && e.fieldMask.push(e.path) :
|
|
4458
|
-
var i = Qn(r, e.
|
|
4463
|
+
e.path && e.path.length > 0 && e.fieldMask.push(e.path) : St(t, (function(t, r) {
|
|
4464
|
+
var i = Qn(r, e.it(t));
|
|
4459
4465
|
null != i && (n[t] = i);
|
|
4460
4466
|
})), {
|
|
4461
4467
|
mapValue: {
|
|
@@ -4465,7 +4471,7 @@ function Wn(t, e) {
|
|
|
4465
4471
|
}
|
|
4466
4472
|
|
|
4467
4473
|
function Yn(t) {
|
|
4468
|
-
return !("object" != typeof t || null === t || t instanceof Array || t instanceof Date || t instanceof Tt || t instanceof Vn || t instanceof
|
|
4474
|
+
return !("object" != typeof t || null === t || t instanceof Array || t instanceof Date || t instanceof Tt || t instanceof Vn || t instanceof kn || t instanceof mn || t instanceof In);
|
|
4469
4475
|
}
|
|
4470
4476
|
|
|
4471
4477
|
function Hn(t, e, n) {
|
|
@@ -4473,7 +4479,7 @@ function Hn(t, e, n) {
|
|
|
4473
4479
|
return "object" == typeof t && null !== t && (Object.getPrototypeOf(t) === Object.prototype || null === Object.getPrototypeOf(t));
|
|
4474
4480
|
}(n)) {
|
|
4475
4481
|
var r = st(n);
|
|
4476
|
-
throw "an object" === r ? e.
|
|
4482
|
+
throw "an object" === r ? e.ht(t + " a custom object") : e.ht(t + " " + r);
|
|
4477
4483
|
}
|
|
4478
4484
|
}
|
|
4479
4485
|
|
|
@@ -4483,9 +4489,9 @@ function Hn(t, e, n) {
|
|
|
4483
4489
|
if (
|
|
4484
4490
|
// If required, replace the FieldPath Compat class with with the firestore-exp
|
|
4485
4491
|
// FieldPath.
|
|
4486
|
-
(e = p(e)) instanceof
|
|
4487
|
-
if ("string" == typeof e) return
|
|
4488
|
-
throw
|
|
4492
|
+
(e = p(e)) instanceof Sn) return e._internalPath;
|
|
4493
|
+
if ("string" == typeof e) return $n(t, e);
|
|
4494
|
+
throw Zn("Field path arguments must be of type string or ", t,
|
|
4489
4495
|
/* hasConverter= */ !1,
|
|
4490
4496
|
/* path= */ void 0, n);
|
|
4491
4497
|
}
|
|
@@ -4502,20 +4508,20 @@ function Hn(t, e, n) {
|
|
|
4502
4508
|
* split on dots.
|
|
4503
4509
|
* @param targetDoc - The document against which the field path will be
|
|
4504
4510
|
* evaluated.
|
|
4505
|
-
*/ function
|
|
4506
|
-
if (e.search(Jn) >= 0) throw
|
|
4511
|
+
*/ function $n(t, e, n) {
|
|
4512
|
+
if (e.search(Jn) >= 0) throw Zn("Invalid field path (" + e + "). Paths must not contain '~', '*', '/', '[', or ']'", t,
|
|
4507
4513
|
/* hasConverter= */ !1,
|
|
4508
4514
|
/* path= */ void 0, n);
|
|
4509
4515
|
try {
|
|
4510
|
-
return (new (
|
|
4516
|
+
return (new (Sn.bind.apply(Sn, r([ void 0 ], e.split(".")))))._internalPath;
|
|
4511
4517
|
} catch (r) {
|
|
4512
|
-
throw
|
|
4518
|
+
throw Zn("Invalid field path (" + e + "). Paths must not be empty, begin with '.', end with '.', or contain '..'", t,
|
|
4513
4519
|
/* hasConverter= */ !1,
|
|
4514
4520
|
/* path= */ void 0, n);
|
|
4515
4521
|
}
|
|
4516
4522
|
}
|
|
4517
4523
|
|
|
4518
|
-
function
|
|
4524
|
+
function Zn(t, e, n, r, i) {
|
|
4519
4525
|
var o = r && !r.isEmpty(), a = void 0 !== i, u = "Function " + e + "() called with invalid data";
|
|
4520
4526
|
n && (u += " (via `toFirestore()`)");
|
|
4521
4527
|
var s = "";
|
|
@@ -4698,7 +4704,7 @@ function ir(t, e) {
|
|
|
4698
4704
|
}
|
|
4699
4705
|
|
|
4700
4706
|
function or(t, e) {
|
|
4701
|
-
return "string" == typeof e ?
|
|
4707
|
+
return "string" == typeof e ? $n(t, e) : e instanceof Sn ? e._internalPath : e._delegate._internalPath;
|
|
4702
4708
|
}
|
|
4703
4709
|
|
|
4704
4710
|
/**
|
|
@@ -4746,7 +4752,7 @@ function or(t, e) {
|
|
|
4746
4752
|
var sr = /** @class */ function(e) {
|
|
4747
4753
|
function n(t, n, r) {
|
|
4748
4754
|
var i = this;
|
|
4749
|
-
return (i = e.call(this) || this).
|
|
4755
|
+
return (i = e.call(this) || this)._t = t, i.gt = n, i.vt = r, i.type = "where",
|
|
4750
4756
|
i;
|
|
4751
4757
|
}
|
|
4752
4758
|
return t(n, e), n.prototype._apply = function(t) {
|
|
@@ -4767,7 +4773,7 @@ var sr = /** @class */ function(e) {
|
|
|
4767
4773
|
};
|
|
4768
4774
|
} else u = Tr(r, t, a);
|
|
4769
4775
|
} else "in" /* IN */ !== o && "not-in" /* NOT_IN */ !== o && "array-contains-any" /* ARRAY_CONTAINS_ANY */ !== o || Er(a, o),
|
|
4770
|
-
u =
|
|
4776
|
+
u = Gn(n, "where", a,
|
|
4771
4777
|
/* allowArrays= */ "in" /* IN */ === o || "not-in" /* NOT_IN */ === o);
|
|
4772
4778
|
var h = ne.create(i, o, u);
|
|
4773
4779
|
return function(t, e) {
|
|
@@ -4775,7 +4781,7 @@ var sr = /** @class */ function(e) {
|
|
|
4775
4781
|
var n = ve(t);
|
|
4776
4782
|
if (null !== n && !n.isEqual(e.field)) throw new B(D, "Invalid query. All where filters with an inequality (<, <=, !=, not-in, >, or >=) must be on the same field. But you have inequality filters on '" + n.toString() + "' and '" + e.field.toString() + "'");
|
|
4777
4783
|
var r = me(t);
|
|
4778
|
-
null !== r &&
|
|
4784
|
+
null !== r && kr(t, e.field, r);
|
|
4779
4785
|
}
|
|
4780
4786
|
var i = function(t, e) {
|
|
4781
4787
|
for (var n = 0, r = t.filters; n < r.length; n++) {
|
|
@@ -4821,7 +4827,7 @@ var sr = /** @class */ function(e) {
|
|
|
4821
4827
|
// Special case when it's a duplicate op to give a slightly clearer error message.
|
|
4822
4828
|
throw i === e.op ? new B(D, "Invalid query. You cannot use more than one '" + e.op.toString() + "' filter.") : new B(D, "Invalid query. You cannot use '" + e.op.toString() + "' filters with '" + i.toString() + "' filters.");
|
|
4823
4829
|
}(t, h), h;
|
|
4824
|
-
}(t._query, 0, e, t.firestore._databaseId, this.
|
|
4830
|
+
}(t._query, 0, e, t.firestore._databaseId, this._t, this.gt, this.vt);
|
|
4825
4831
|
return new vn(t.firestore, t.converter, function(t, e) {
|
|
4826
4832
|
var n = t.filters.concat([ e ]);
|
|
4827
4833
|
return new ye(t.path, t.collectionGroup, t.explicitOrderBy.slice(), n, t.limit, t.limitType, t.startAt, t.endAt);
|
|
@@ -4847,7 +4853,7 @@ var sr = /** @class */ function(e) {
|
|
|
4847
4853
|
var lr = /** @class */ function(e) {
|
|
4848
4854
|
function n(t, n) {
|
|
4849
4855
|
var r = this;
|
|
4850
|
-
return (r = e.call(this) || this).
|
|
4856
|
+
return (r = e.call(this) || this)._t = t, r.bt = n, r.type = "orderBy", r;
|
|
4851
4857
|
}
|
|
4852
4858
|
return t(n, e), n.prototype._apply = function(t) {
|
|
4853
4859
|
var e = function(t, e, n) {
|
|
@@ -4858,10 +4864,10 @@ var lr = /** @class */ function(e) {
|
|
|
4858
4864
|
if (null === me(t)) {
|
|
4859
4865
|
// This is the first order by. It must match any inequality.
|
|
4860
4866
|
var n = ve(t);
|
|
4861
|
-
null !== n &&
|
|
4867
|
+
null !== n && kr(t, n, e.field);
|
|
4862
4868
|
}
|
|
4863
4869
|
}(t, r), r;
|
|
4864
|
-
}(t._query, this.
|
|
4870
|
+
}(t._query, this._t, this.bt);
|
|
4865
4871
|
return new vn(t.firestore, t.converter, function(t, e) {
|
|
4866
4872
|
// TODO(dimond): validate that orderBy does not list the same key twice.
|
|
4867
4873
|
var n = t.explicitOrderBy.concat([ e ]);
|
|
@@ -4887,12 +4893,12 @@ var lr = /** @class */ function(e) {
|
|
|
4887
4893
|
var hr = /** @class */ function(e) {
|
|
4888
4894
|
function n(t, n, r) {
|
|
4889
4895
|
var i = this;
|
|
4890
|
-
return (i = e.call(this) || this).type = t, i.
|
|
4896
|
+
return (i = e.call(this) || this).type = t, i.Et = n, i.It = r, i;
|
|
4891
4897
|
}
|
|
4892
4898
|
return t(n, e), n.prototype._apply = function(t) {
|
|
4893
4899
|
return new vn(t.firestore, t.converter, function(t, e, n) {
|
|
4894
4900
|
return new ye(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), e, n, t.startAt, t.endAt);
|
|
4895
|
-
}(t._query, this.
|
|
4901
|
+
}(t._query, this.Et, this.It));
|
|
4896
4902
|
}, n;
|
|
4897
4903
|
}(ar);
|
|
4898
4904
|
|
|
@@ -4921,10 +4927,10 @@ function dr(t) {
|
|
|
4921
4927
|
var yr = /** @class */ function(e) {
|
|
4922
4928
|
function n(t, n, r) {
|
|
4923
4929
|
var i = this;
|
|
4924
|
-
return (i = e.call(this) || this).type = t, i.
|
|
4930
|
+
return (i = e.call(this) || this).type = t, i.Tt = n, i.At = r, i;
|
|
4925
4931
|
}
|
|
4926
4932
|
return t(n, e), n.prototype._apply = function(t) {
|
|
4927
|
-
var e = _r(t, this.type, this.
|
|
4933
|
+
var e = _r(t, this.type, this.Tt, this.At);
|
|
4928
4934
|
return new vn(t.firestore, t.converter, function(t, e) {
|
|
4929
4935
|
return new ye(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), t.limit, t.limitType, e, t.endAt);
|
|
4930
4936
|
}(t._query, e));
|
|
@@ -4946,10 +4952,10 @@ function vr() {
|
|
|
4946
4952
|
var gr = /** @class */ function(e) {
|
|
4947
4953
|
function n(t, n, r) {
|
|
4948
4954
|
var i = this;
|
|
4949
|
-
return (i = e.call(this) || this).type = t, i.
|
|
4955
|
+
return (i = e.call(this) || this).type = t, i.Tt = n, i.At = r, i;
|
|
4950
4956
|
}
|
|
4951
4957
|
return t(n, e), n.prototype._apply = function(t) {
|
|
4952
|
-
var e = _r(t, this.type, this.
|
|
4958
|
+
var e = _r(t, this.type, this.Tt, this.At);
|
|
4953
4959
|
return new vn(t.firestore, t.converter, function(t, e) {
|
|
4954
4960
|
return new ye(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), t.limit, t.limitType, t.startAt, e);
|
|
4955
4961
|
}(t._query, e));
|
|
@@ -5006,7 +5012,7 @@ function br() {
|
|
|
5006
5012
|
var f = new it(l);
|
|
5007
5013
|
u.push(Qt(e, f));
|
|
5008
5014
|
} else {
|
|
5009
|
-
var h =
|
|
5015
|
+
var h = Gn(n, r, c);
|
|
5010
5016
|
u.push(h);
|
|
5011
5017
|
}
|
|
5012
5018
|
}
|
|
@@ -5034,7 +5040,7 @@ function Tr(t, e, n) {
|
|
|
5034
5040
|
if (t.length > 10) throw new B(D, "Invalid Query. '" + e.toString() + "' filters support a maximum of 10 elements in the value array.");
|
|
5035
5041
|
}
|
|
5036
5042
|
|
|
5037
|
-
function
|
|
5043
|
+
function kr(t, e, n) {
|
|
5038
5044
|
if (!n.isEqual(e)) throw new B(D, "Invalid query. You have a where filter with an inequality (<, <=, !=, not-in, >, or >=) on field '" + e.toString() + "' and so you must also use '" + e.toString() + "' as your first argument to orderBy(), but your first orderBy() is on field '" + n.toString() + "' instead.");
|
|
5039
5045
|
}
|
|
5040
5046
|
|
|
@@ -5084,20 +5090,20 @@ function Sr(t, e, n) {
|
|
|
5084
5090
|
* because we want to provide the user with a more specific error message if
|
|
5085
5091
|
* their `set()` or fails due to invalid data originating from a `toFirestore()`
|
|
5086
5092
|
* call.
|
|
5087
|
-
*/ function
|
|
5093
|
+
*/ function Sr(t, e, n) {
|
|
5088
5094
|
// Cast to `any` in order to satisfy the union type constraint on
|
|
5089
5095
|
// toFirestore().
|
|
5090
5096
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5091
5097
|
return t ? n && (n.merge || n.mergeFields) ? t.toFirestore(e, n) : t.toFirestore(e) : e;
|
|
5092
5098
|
}
|
|
5093
5099
|
|
|
5094
|
-
var
|
|
5100
|
+
var Ar = /** @class */ function(e) {
|
|
5095
5101
|
function n(t) {
|
|
5096
5102
|
var n = this;
|
|
5097
5103
|
return (n = e.call(this) || this).firestore = t, n;
|
|
5098
5104
|
}
|
|
5099
5105
|
return t(n, e), n.prototype.convertBytes = function(t) {
|
|
5100
|
-
return new
|
|
5106
|
+
return new kn(t);
|
|
5101
5107
|
}, n.prototype.convertReference = function(t) {
|
|
5102
5108
|
var e = this.convertDocumentKey(t, this.firestore._databaseId);
|
|
5103
5109
|
return new mn(this.firestore, /* converter= */ null, e);
|
|
@@ -5140,11 +5146,11 @@ var Ir = /** @class */ function(e) {
|
|
|
5140
5146
|
return this.convertObject(t.mapValue, e);
|
|
5141
5147
|
|
|
5142
5148
|
default:
|
|
5143
|
-
throw
|
|
5149
|
+
throw S();
|
|
5144
5150
|
}
|
|
5145
5151
|
}, t.prototype.convertObject = function(t, e) {
|
|
5146
5152
|
var n = this, r = {};
|
|
5147
|
-
return
|
|
5153
|
+
return St(t.fields, (function(t, i) {
|
|
5148
5154
|
r[t] = n.convertValue(i, e);
|
|
5149
5155
|
})), r;
|
|
5150
5156
|
}, t.prototype.convertGeoPoint = function(t) {
|
|
@@ -5171,8 +5177,8 @@ var Ir = /** @class */ function(e) {
|
|
|
5171
5177
|
return new Tt(e.seconds, e.nanos);
|
|
5172
5178
|
}, t.prototype.convertDocumentKey = function(t, e) {
|
|
5173
5179
|
var n = et.fromString(t);
|
|
5174
|
-
|
|
5175
|
-
var r = new
|
|
5180
|
+
A($e(n));
|
|
5181
|
+
var r = new Z(n.get(1), n.get(3)), i = new it(n.popFirst(5));
|
|
5176
5182
|
return r.isEqual(e) ||
|
|
5177
5183
|
// TODO(b/64130202): Somehow support foreign references.
|
|
5178
5184
|
T("Document " + i + " contains a document reference within a different database (" + r.projectId + "/" + r.database + ") which is not supported. It will be treated as a reference in the current database (" + e.projectId + "/" + e.database + ") instead."),
|
|
@@ -5192,10 +5198,10 @@ var Ir = /** @class */ function(e) {
|
|
|
5192
5198
|
* @param reference - The reference of the document to fetch.
|
|
5193
5199
|
* @returns A Promise resolved with a `DocumentSnapshot` containing the current
|
|
5194
5200
|
* document contents.
|
|
5195
|
-
*/ function
|
|
5196
|
-
var e = an((t = ct(t, mn)).firestore), n = new
|
|
5201
|
+
*/ function Ir(t) {
|
|
5202
|
+
var e = an((t = ct(t, mn)).firestore), n = new Ar(t.firestore);
|
|
5197
5203
|
return rn(e, [ t._key ]).then((function(e) {
|
|
5198
|
-
|
|
5204
|
+
A(1 === e.length);
|
|
5199
5205
|
var r = e[0];
|
|
5200
5206
|
return new er(t.firestore, n, t._key, r.isFoundDocument() ? r : null, t.converter);
|
|
5201
5207
|
}));
|
|
@@ -5216,14 +5222,14 @@ var Ir = /** @class */ function(e) {
|
|
|
5216
5222
|
!function(t) {
|
|
5217
5223
|
if ("L" /* Last */ === t.limitType && 0 === t.explicitOrderBy.length) throw new B(j, "limitToLast() queries require specifying at least one orderBy() clause");
|
|
5218
5224
|
}((t = ct(t, vn))._query);
|
|
5219
|
-
var r = an(t.firestore), i = new
|
|
5225
|
+
var r = an(t.firestore), i = new Ar(t.firestore);
|
|
5220
5226
|
return function(t, r) {
|
|
5221
5227
|
return e(this, void 0, void 0, (function() {
|
|
5222
5228
|
var e, i;
|
|
5223
5229
|
return n(this, (function(n) {
|
|
5224
5230
|
switch (n.label) {
|
|
5225
5231
|
case 0:
|
|
5226
|
-
return e =
|
|
5232
|
+
return e = I(t), i = We(e.L, be(r)), [ 4 /*yield*/ , e.P("RunQuery", i.parent, {
|
|
5227
5233
|
structuredQuery: i.structuredQuery
|
|
5228
5234
|
}) ];
|
|
5229
5235
|
|
|
@@ -5232,12 +5238,12 @@ var Ir = /** @class */ function(e) {
|
|
|
5232
5238
|
return !!t.document;
|
|
5233
5239
|
})).map((function(t) {
|
|
5234
5240
|
return function(t, e, n) {
|
|
5235
|
-
var r = ze(t, e.name), i = Me(e.updateTime), o = new
|
|
5241
|
+
var r = ze(t, e.name), i = Me(e.updateTime), o = new $t({
|
|
5236
5242
|
mapValue: {
|
|
5237
5243
|
fields: e.fields
|
|
5238
5244
|
}
|
|
5239
5245
|
});
|
|
5240
|
-
return
|
|
5246
|
+
return Zt.newFoundDocument(r, i, o);
|
|
5241
5247
|
}(e.L, t.document);
|
|
5242
5248
|
})) ];
|
|
5243
5249
|
}
|
|
@@ -5256,7 +5262,7 @@ var Ir = /** @class */ function(e) {
|
|
|
5256
5262
|
}
|
|
5257
5263
|
|
|
5258
5264
|
function Pr(t, e, n) {
|
|
5259
|
-
var r =
|
|
5265
|
+
var r = Sr((t = ct(t, mn)).converter, e, n), i = Ln(qn(t.firestore), "setDoc", t._key, r, null !== t.converter, n);
|
|
5260
5266
|
return nn(an(t.firestore), [ i.toMutation(t._key, Ve.none()) ]);
|
|
5261
5267
|
}
|
|
5262
5268
|
|
|
@@ -5265,7 +5271,7 @@ function Dr(t, e, n) {
|
|
|
5265
5271
|
var o, a = qn((t = ct(t, mn)).firestore);
|
|
5266
5272
|
// For Compat types, we have to "extract" the underlying types before
|
|
5267
5273
|
// performing validation.
|
|
5268
|
-
return o = "string" == typeof (e = p(e)) || e instanceof
|
|
5274
|
+
return o = "string" == typeof (e = p(e)) || e instanceof Sn ? Kn(a, "updateDoc", t._key, e, n, r) : zn(a, "updateDoc", t._key, e),
|
|
5269
5275
|
nn(an(t.firestore), [ o.toMutation(t._key, Ve.exists(!0)) ]);
|
|
5270
5276
|
}
|
|
5271
5277
|
|
|
@@ -5280,7 +5286,7 @@ function Dr(t, e, n) {
|
|
|
5280
5286
|
* @param reference - A reference to the document to delete.
|
|
5281
5287
|
* @returns A `Promise` resolved once the document has been successfully
|
|
5282
5288
|
* deleted from the backend.
|
|
5283
|
-
*/ function
|
|
5289
|
+
*/ function Fr(t) {
|
|
5284
5290
|
return nn(an((t = ct(t, mn)).firestore), [ new Ne(t._key, Ve.none()) ]);
|
|
5285
5291
|
}
|
|
5286
5292
|
|
|
@@ -5299,7 +5305,7 @@ function Dr(t, e, n) {
|
|
|
5299
5305
|
* @returns A `Promise` resolved with a `DocumentReference` pointing to the
|
|
5300
5306
|
* newly created document after it has been written to the backend.
|
|
5301
5307
|
*/ function Nr(t, e) {
|
|
5302
|
-
var n = _n(t = ct(t, gn)), r =
|
|
5308
|
+
var n = _n(t = ct(t, gn)), r = Sr(t.converter, e), i = Ln(qn(t.firestore), "addDoc", n._key, r, null !== n.converter, {});
|
|
5303
5309
|
return nn(an(t.firestore), [ i.toMutation(n._key, Ve.exists(!1)) ]).then((function() {
|
|
5304
5310
|
return n;
|
|
5305
5311
|
}));
|
|
@@ -5334,8 +5340,8 @@ function Dr(t, e, n) {
|
|
|
5334
5340
|
* @returns A Promise that will be resolved with the count; the count can be
|
|
5335
5341
|
* retrieved from `snapshot.data().count`, where `snapshot` is the
|
|
5336
5342
|
* `AggregateQuerySnapshot` to which the returned Promise resolves.
|
|
5337
|
-
*/ function
|
|
5338
|
-
var e = ct(t.firestore, sn), n = an(e), r = new
|
|
5343
|
+
*/ function Or(t) {
|
|
5344
|
+
var e = ct(t.firestore, sn), n = an(e), r = new Ar(e);
|
|
5339
5345
|
return new yn(t, n, r).run();
|
|
5340
5346
|
}
|
|
5341
5347
|
|
|
@@ -5472,7 +5478,7 @@ function Dr(t, e, n) {
|
|
|
5472
5478
|
}
|
|
5473
5479
|
return t.prototype.set = function(t, e, n) {
|
|
5474
5480
|
this._verifyNotCommitted();
|
|
5475
|
-
var r = Ur(t, this._firestore), i =
|
|
5481
|
+
var r = Ur(t, this._firestore), i = Sr(r.converter, e, n), o = Ln(this._dataReader, "WriteBatch.set", r._key, i, null !== r.converter, n);
|
|
5476
5482
|
return this._mutations.push(o.toMutation(r._key, Ve.none())), this;
|
|
5477
5483
|
}, t.prototype.update = function(t, e, n) {
|
|
5478
5484
|
for (var r = [], i = 3; i < arguments.length; i++) r[i - 3] = arguments[i];
|
|
@@ -5480,7 +5486,7 @@ function Dr(t, e, n) {
|
|
|
5480
5486
|
var o, a = Ur(t, this._firestore);
|
|
5481
5487
|
// For Compat types, we have to "extract" the underlying types before
|
|
5482
5488
|
// performing validation.
|
|
5483
|
-
return o = "string" == typeof (e = p(e)) || e instanceof
|
|
5489
|
+
return o = "string" == typeof (e = p(e)) || e instanceof Sn ? Kn(this._dataReader, "WriteBatch.update", a._key, e, n, r) : zn(this._dataReader, "WriteBatch.update", a._key, e),
|
|
5484
5490
|
this._mutations.push(o.toMutation(a._key, Ve.exists(!0))), this;
|
|
5485
5491
|
},
|
|
5486
5492
|
/**
|
|
@@ -5617,7 +5623,7 @@ function Ur(t, e) {
|
|
|
5617
5623
|
// a `verify` operation.
|
|
5618
5624
|
t.forEach((function(t, n) {
|
|
5619
5625
|
var r = it.fromPath(n);
|
|
5620
|
-
e.mutations.push(new
|
|
5626
|
+
e.mutations.push(new Oe(r, e.precondition(r)));
|
|
5621
5627
|
})), [ 4 /*yield*/ , nn(this.datastore, this.mutations) ];
|
|
5622
5628
|
|
|
5623
5629
|
case 1:
|
|
@@ -5629,7 +5635,7 @@ function Ur(t, e) {
|
|
|
5629
5635
|
}, t.prototype.recordVersion = function(t) {
|
|
5630
5636
|
var e;
|
|
5631
5637
|
if (t.isFoundDocument()) e = t.version; else {
|
|
5632
|
-
if (!t.isNoDocument()) throw
|
|
5638
|
+
if (!t.isNoDocument()) throw S();
|
|
5633
5639
|
// Represent a deleted doc using SnapshotVersion.min().
|
|
5634
5640
|
e = Et.min();
|
|
5635
5641
|
}
|
|
@@ -5676,23 +5682,23 @@ function Ur(t, e) {
|
|
|
5676
5682
|
}, t.prototype.write = function(t) {
|
|
5677
5683
|
this.ensureCommitNotCalled(), this.mutations.push(t);
|
|
5678
5684
|
}, t.prototype.ensureCommitNotCalled = function() {}, t;
|
|
5679
|
-
}(),
|
|
5685
|
+
}(), Kr = {
|
|
5680
5686
|
maxAttempts: 5
|
|
5681
|
-
},
|
|
5687
|
+
}, Gr = /** @class */ function() {
|
|
5682
5688
|
function t(t, e, n, r, i) {
|
|
5683
5689
|
this.asyncQueue = t, this.datastore = e, this.options = n, this.updateFunction = r,
|
|
5684
|
-
this.deferred = i, this.
|
|
5690
|
+
this.deferred = i, this.Rt = n.maxAttempts, this.Pt = new tn(this.asyncQueue, "transaction_retry" /* TransactionRetry */)
|
|
5685
5691
|
/** Runs the transaction and sets the result on deferred. */;
|
|
5686
5692
|
}
|
|
5687
5693
|
return t.prototype.run = function() {
|
|
5688
|
-
this.
|
|
5689
|
-
}, t.prototype.
|
|
5694
|
+
this.Rt -= 1, this.Vt();
|
|
5695
|
+
}, t.prototype.Vt = function() {
|
|
5690
5696
|
var t = this;
|
|
5691
|
-
this.
|
|
5697
|
+
this.Pt.J((function() {
|
|
5692
5698
|
return e(t, void 0, void 0, (function() {
|
|
5693
5699
|
var t, e, r = this;
|
|
5694
5700
|
return n(this, (function(n) {
|
|
5695
|
-
return t = new zr(this.datastore), (e = this.
|
|
5701
|
+
return t = new zr(this.datastore), (e = this.Nt(t)) && e.then((function(e) {
|
|
5696
5702
|
r.asyncQueue.enqueueAndForget((function() {
|
|
5697
5703
|
return t.commit().then((function() {
|
|
5698
5704
|
r.deferred.resolve(e);
|
|
@@ -5706,7 +5712,7 @@ function Ur(t, e) {
|
|
|
5706
5712
|
}));
|
|
5707
5713
|
}));
|
|
5708
5714
|
}));
|
|
5709
|
-
}, t.prototype.
|
|
5715
|
+
}, t.prototype.Nt = function(t) {
|
|
5710
5716
|
try {
|
|
5711
5717
|
var e = this.updateFunction(t);
|
|
5712
5718
|
return !ft(e) && e.catch && e.then ? e : (this.deferred.reject(Error("Transaction callback must return a Promise")),
|
|
@@ -5717,15 +5723,15 @@ function Ur(t, e) {
|
|
|
5717
5723
|
}
|
|
5718
5724
|
}, t.prototype.$t = function(t) {
|
|
5719
5725
|
var e = this;
|
|
5720
|
-
this.
|
|
5721
|
-
return e.
|
|
5726
|
+
this.Rt > 0 && this.Dt(t) ? (this.Rt -= 1, this.asyncQueue.enqueueAndForget((function() {
|
|
5727
|
+
return e.Vt(), Promise.resolve();
|
|
5722
5728
|
}))) : this.deferred.reject(t);
|
|
5723
|
-
}, t.prototype.
|
|
5729
|
+
}, t.prototype.Dt = function(t) {
|
|
5724
5730
|
if ("FirebaseError" === t.name) {
|
|
5725
5731
|
// In transactions, the backend will fail outdated reads with FAILED_PRECONDITION and
|
|
5726
5732
|
// non-matching document versions with ABORTED. These errors should be retried.
|
|
5727
5733
|
var e = t.code;
|
|
5728
|
-
return "aborted" === e || "failed-precondition" === e || !
|
|
5734
|
+
return "aborted" === e || "failed-precondition" === e || "already-exists" === e || !
|
|
5729
5735
|
/**
|
|
5730
5736
|
* Determines whether an error code represents a permanent error when received
|
|
5731
5737
|
* in response to a non-write operation.
|
|
@@ -5735,11 +5741,11 @@ function Ur(t, e) {
|
|
|
5735
5741
|
function(t) {
|
|
5736
5742
|
switch (t) {
|
|
5737
5743
|
default:
|
|
5738
|
-
return
|
|
5744
|
+
return S();
|
|
5739
5745
|
|
|
5740
5746
|
case V:
|
|
5741
5747
|
case P:
|
|
5742
|
-
case
|
|
5748
|
+
case F:
|
|
5743
5749
|
case q:
|
|
5744
5750
|
case M:
|
|
5745
5751
|
case U:
|
|
@@ -5751,7 +5757,7 @@ function Ur(t, e) {
|
|
|
5751
5757
|
case D:
|
|
5752
5758
|
case N:
|
|
5753
5759
|
case "already-exists":
|
|
5754
|
-
case
|
|
5760
|
+
case O:
|
|
5755
5761
|
case L:
|
|
5756
5762
|
// Aborted might be retried in some scenarios, but that is dependant on
|
|
5757
5763
|
// the context and should handled individually by the calling code.
|
|
@@ -5900,40 +5906,40 @@ function Ur(t, e) {
|
|
|
5900
5906
|
function t() {
|
|
5901
5907
|
var t = this;
|
|
5902
5908
|
// The last promise in the queue.
|
|
5903
|
-
this.
|
|
5909
|
+
this.xt = Promise.resolve(),
|
|
5904
5910
|
// A list of retryable operations. Retryable operations are run in order and
|
|
5905
5911
|
// retried with backoff.
|
|
5906
|
-
this.
|
|
5912
|
+
this.Ft = [],
|
|
5907
5913
|
// Is this AsyncQueue being shut down? Once it is set to true, it will not
|
|
5908
5914
|
// be changed again.
|
|
5909
|
-
this.
|
|
5915
|
+
this.St = !1,
|
|
5910
5916
|
// Operations scheduled to be queued in the future. Operations are
|
|
5911
5917
|
// automatically removed after they are run or canceled.
|
|
5912
|
-
this.
|
|
5918
|
+
this.qt = [],
|
|
5913
5919
|
// visible for testing
|
|
5914
|
-
this.
|
|
5920
|
+
this.Ot = null,
|
|
5915
5921
|
// Flag set while there's an outstanding AsyncQueue operation, used for
|
|
5916
5922
|
// assertion sanity-checks.
|
|
5917
|
-
this.
|
|
5923
|
+
this.kt = !1,
|
|
5918
5924
|
// Enabled during shutdown on Safari to prevent future access to IndexedDB.
|
|
5919
|
-
this.
|
|
5925
|
+
this.Ct = !1,
|
|
5920
5926
|
// List of TimerIds to fast-forward delays for.
|
|
5921
|
-
this.
|
|
5927
|
+
this.Lt = [],
|
|
5922
5928
|
// Backoff timer used to schedule retries for retryable operations
|
|
5923
|
-
this.
|
|
5929
|
+
this.Pt = new tn(this, "async_queue_retry" /* AsyncQueueRetry */),
|
|
5924
5930
|
// Visibility handler that triggers an immediate retry of all retryable
|
|
5925
5931
|
// operations. Meant to speed up recovery when we regain file system access
|
|
5926
5932
|
// after page comes into foreground.
|
|
5927
|
-
this.
|
|
5933
|
+
this.Mt = function() {
|
|
5928
5934
|
var e = Qr();
|
|
5929
|
-
e && _("AsyncQueue", "Visibility state changed to " + e.visibilityState), t.
|
|
5935
|
+
e && _("AsyncQueue", "Visibility state changed to " + e.visibilityState), t.Pt.Z();
|
|
5930
5936
|
};
|
|
5931
5937
|
var e = Qr();
|
|
5932
|
-
e && "function" == typeof e.addEventListener && e.addEventListener("visibilitychange", this.
|
|
5938
|
+
e && "function" == typeof e.addEventListener && e.addEventListener("visibilitychange", this.Mt);
|
|
5933
5939
|
}
|
|
5934
5940
|
return Object.defineProperty(t.prototype, "isShuttingDown", {
|
|
5935
5941
|
get: function() {
|
|
5936
|
-
return this.
|
|
5942
|
+
return this.St;
|
|
5937
5943
|
},
|
|
5938
5944
|
enumerable: !1,
|
|
5939
5945
|
configurable: !0
|
|
@@ -5946,53 +5952,53 @@ function Ur(t, e) {
|
|
|
5946
5952
|
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
5947
5953
|
this.enqueue(t);
|
|
5948
5954
|
}, t.prototype.enqueueAndForgetEvenWhileRestricted = function(t) {
|
|
5949
|
-
this.
|
|
5955
|
+
this.Ut(),
|
|
5950
5956
|
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
5951
|
-
this.
|
|
5957
|
+
this.jt(t);
|
|
5952
5958
|
}, t.prototype.enterRestrictedMode = function(t) {
|
|
5953
|
-
if (!this.
|
|
5954
|
-
this.
|
|
5959
|
+
if (!this.St) {
|
|
5960
|
+
this.St = !0, this.Ct = t || !1;
|
|
5955
5961
|
var e = Qr();
|
|
5956
|
-
e && "function" == typeof e.removeEventListener && e.removeEventListener("visibilitychange", this.
|
|
5962
|
+
e && "function" == typeof e.removeEventListener && e.removeEventListener("visibilitychange", this.Mt);
|
|
5957
5963
|
}
|
|
5958
5964
|
}, t.prototype.enqueue = function(t) {
|
|
5959
5965
|
var e = this;
|
|
5960
|
-
if (this.
|
|
5966
|
+
if (this.Ut(), this.St)
|
|
5961
5967
|
// Return a Promise which never resolves.
|
|
5962
5968
|
return new Promise((function() {}));
|
|
5963
5969
|
// Create a deferred Promise that we can return to the callee. This
|
|
5964
5970
|
// allows us to return a "hanging Promise" only to the callee and still
|
|
5965
5971
|
// advance the queue even when the operation is not run.
|
|
5966
5972
|
var n = new z;
|
|
5967
|
-
return this.
|
|
5968
|
-
return e.
|
|
5973
|
+
return this.jt((function() {
|
|
5974
|
+
return e.St && e.Ct ? Promise.resolve() : (t().then(n.resolve, n.reject), n.promise);
|
|
5969
5975
|
})).then((function() {
|
|
5970
5976
|
return n.promise;
|
|
5971
5977
|
}));
|
|
5972
5978
|
}, t.prototype.enqueueRetryable = function(t) {
|
|
5973
5979
|
var e = this;
|
|
5974
5980
|
this.enqueueAndForget((function() {
|
|
5975
|
-
return e.
|
|
5981
|
+
return e.Ft.push(t), e.Bt();
|
|
5976
5982
|
}));
|
|
5977
5983
|
},
|
|
5978
5984
|
/**
|
|
5979
5985
|
* Runs the next operation from the retryable queue. If the operation fails,
|
|
5980
5986
|
* reschedules with backoff.
|
|
5981
5987
|
*/
|
|
5982
|
-
t.prototype.
|
|
5988
|
+
t.prototype.Bt = function() {
|
|
5983
5989
|
return e(this, void 0, void 0, (function() {
|
|
5984
5990
|
var t, e = this;
|
|
5985
5991
|
return n(this, (function(n) {
|
|
5986
5992
|
switch (n.label) {
|
|
5987
5993
|
case 0:
|
|
5988
|
-
if (0 === this.
|
|
5994
|
+
if (0 === this.Ft.length) return [ 3 /*break*/ , 5 ];
|
|
5989
5995
|
n.label = 1;
|
|
5990
5996
|
|
|
5991
5997
|
case 1:
|
|
5992
|
-
return n.trys.push([ 1, 3, , 4 ]), [ 4 /*yield*/ , this.
|
|
5998
|
+
return n.trys.push([ 1, 3, , 4 ]), [ 4 /*yield*/ , this.Ft[0]() ];
|
|
5993
5999
|
|
|
5994
6000
|
case 2:
|
|
5995
|
-
return n.sent(), this.
|
|
6001
|
+
return n.sent(), this.Ft.shift(), this.Pt.reset(), [ 3 /*break*/ , 4 ];
|
|
5996
6002
|
|
|
5997
6003
|
case 3:
|
|
5998
6004
|
if (t = n.sent(), "IndexedDbTransactionError" !== t.name) throw t;
|
|
@@ -6001,7 +6007,7 @@ function Ur(t, e) {
|
|
|
6001
6007
|
[ 3 /*break*/ , 4 ];
|
|
6002
6008
|
|
|
6003
6009
|
case 4:
|
|
6004
|
-
this.
|
|
6010
|
+
this.Ft.length > 0 &&
|
|
6005
6011
|
// If there are additional operations, we re-schedule `retryNextOp()`.
|
|
6006
6012
|
// This is necessary to run retryable operations that failed during
|
|
6007
6013
|
// their initial attempt since we don't know whether they are already
|
|
@@ -6012,8 +6018,8 @@ function Ur(t, e) {
|
|
|
6012
6018
|
// Since `backoffAndRun()` cancels an existing backoff and schedules a
|
|
6013
6019
|
// new backoff on every call, there is only ever a single additional
|
|
6014
6020
|
// operation in the queue.
|
|
6015
|
-
this.
|
|
6016
|
-
return e.
|
|
6021
|
+
this.Pt.J((function() {
|
|
6022
|
+
return e.Bt();
|
|
6017
6023
|
})), n.label = 5;
|
|
6018
6024
|
|
|
6019
6025
|
case 5:
|
|
@@ -6021,10 +6027,10 @@ function Ur(t, e) {
|
|
|
6021
6027
|
}
|
|
6022
6028
|
}));
|
|
6023
6029
|
}));
|
|
6024
|
-
}, t.prototype.
|
|
6025
|
-
var e = this, n = this.
|
|
6026
|
-
return e.
|
|
6027
|
-
e.
|
|
6030
|
+
}, t.prototype.jt = function(t) {
|
|
6031
|
+
var e = this, n = this.xt.then((function() {
|
|
6032
|
+
return e.kt = !0, t().catch((function(t) {
|
|
6033
|
+
e.Ot = t, e.kt = !1;
|
|
6028
6034
|
var n =
|
|
6029
6035
|
/**
|
|
6030
6036
|
* Chrome includes Error.message in Error.stack. Other browsers do not.
|
|
@@ -6041,39 +6047,39 @@ function Ur(t, e) {
|
|
|
6041
6047
|
// and return the rejected Promise.
|
|
6042
6048
|
throw T("INTERNAL UNHANDLED ERROR: ", n), t;
|
|
6043
6049
|
})).then((function(t) {
|
|
6044
|
-
return e.
|
|
6050
|
+
return e.kt = !1, t;
|
|
6045
6051
|
}));
|
|
6046
6052
|
}));
|
|
6047
|
-
return this.
|
|
6053
|
+
return this.xt = n, n;
|
|
6048
6054
|
}, t.prototype.enqueueAfterDelay = function(t, e, n) {
|
|
6049
6055
|
var r = this;
|
|
6050
|
-
this.
|
|
6056
|
+
this.Ut(),
|
|
6051
6057
|
// Fast-forward delays for timerIds that have been overriden.
|
|
6052
|
-
this.
|
|
6058
|
+
this.Lt.indexOf(t) > -1 && (e = 0);
|
|
6053
6059
|
var i = Wr.createAndSchedule(this, t, e, n, (function(t) {
|
|
6054
|
-
return r.
|
|
6060
|
+
return r.Qt(t);
|
|
6055
6061
|
}));
|
|
6056
|
-
return this.
|
|
6057
|
-
}, t.prototype.
|
|
6058
|
-
this.
|
|
6062
|
+
return this.qt.push(i), i;
|
|
6063
|
+
}, t.prototype.Ut = function() {
|
|
6064
|
+
this.Ot && S();
|
|
6059
6065
|
}, t.prototype.verifyOperationInProgress = function() {},
|
|
6060
6066
|
/**
|
|
6061
6067
|
* Waits until all currently queued tasks are finished executing. Delayed
|
|
6062
6068
|
* operations are not run.
|
|
6063
6069
|
*/
|
|
6064
|
-
t.prototype.
|
|
6070
|
+
t.prototype.zt = function() {
|
|
6065
6071
|
return e(this, void 0, void 0, (function() {
|
|
6066
6072
|
var t;
|
|
6067
6073
|
return n(this, (function(e) {
|
|
6068
6074
|
switch (e.label) {
|
|
6069
6075
|
case 0:
|
|
6070
|
-
return [ 4 /*yield*/ , t = this.
|
|
6076
|
+
return [ 4 /*yield*/ , t = this.xt ];
|
|
6071
6077
|
|
|
6072
6078
|
case 1:
|
|
6073
6079
|
e.sent(), e.label = 2;
|
|
6074
6080
|
|
|
6075
6081
|
case 2:
|
|
6076
|
-
if (t !== this.
|
|
6082
|
+
if (t !== this.xt) return [ 3 /*break*/ , 0 ];
|
|
6077
6083
|
e.label = 3;
|
|
6078
6084
|
|
|
6079
6085
|
case 3:
|
|
@@ -6086,8 +6092,8 @@ function Ur(t, e) {
|
|
|
6086
6092
|
* For Tests: Determine if a delayed operation with a particular TimerId
|
|
6087
6093
|
* exists.
|
|
6088
6094
|
*/
|
|
6089
|
-
t.prototype.
|
|
6090
|
-
for (var e = 0, n = this.
|
|
6095
|
+
t.prototype.Gt = function(t) {
|
|
6096
|
+
for (var e = 0, n = this.qt; e < n.length; e++) {
|
|
6091
6097
|
if (n[e].timerId === t) return !0;
|
|
6092
6098
|
}
|
|
6093
6099
|
return !1;
|
|
@@ -6099,31 +6105,31 @@ function Ur(t, e) {
|
|
|
6099
6105
|
* will be drained. Pass TimerId.All to run all delayed operations.
|
|
6100
6106
|
* @returns a Promise that resolves once all operations have been run.
|
|
6101
6107
|
*/
|
|
6102
|
-
t.prototype.
|
|
6108
|
+
t.prototype.Wt = function(t) {
|
|
6103
6109
|
var e = this;
|
|
6104
6110
|
// Note that draining may generate more delayed ops, so we do that first.
|
|
6105
|
-
return this.
|
|
6111
|
+
return this.zt().then((function() {
|
|
6106
6112
|
// Run ops in the same order they'd run if they ran naturally.
|
|
6107
|
-
e.
|
|
6113
|
+
e.qt.sort((function(t, e) {
|
|
6108
6114
|
return t.targetTimeMs - e.targetTimeMs;
|
|
6109
6115
|
}));
|
|
6110
|
-
for (var n = 0, r = e.
|
|
6116
|
+
for (var n = 0, r = e.qt; n < r.length; n++) {
|
|
6111
6117
|
var i = r[n];
|
|
6112
6118
|
if (i.skipDelay(), "all" /* All */ !== t && i.timerId === t) break;
|
|
6113
6119
|
}
|
|
6114
|
-
return e.
|
|
6120
|
+
return e.zt();
|
|
6115
6121
|
}));
|
|
6116
6122
|
},
|
|
6117
6123
|
/**
|
|
6118
6124
|
* For Tests: Skip all subsequent delays for a timer id.
|
|
6119
6125
|
*/
|
|
6120
|
-
t.prototype.
|
|
6121
|
-
this.
|
|
6126
|
+
t.prototype.Kt = function(t) {
|
|
6127
|
+
this.Lt.push(t);
|
|
6122
6128
|
},
|
|
6123
|
-
/** Called once a DelayedOperation is run or canceled. */ t.prototype.
|
|
6129
|
+
/** Called once a DelayedOperation is run or canceled. */ t.prototype.Qt = function(t) {
|
|
6124
6130
|
// NOTE: indexOf / slice are O(n), but delayedOperations is expected to be small.
|
|
6125
|
-
var e = this.
|
|
6126
|
-
this.
|
|
6131
|
+
var e = this.qt.indexOf(t);
|
|
6132
|
+
this.qt.splice(e, 1);
|
|
6127
6133
|
}, t;
|
|
6128
6134
|
}(), Hr = /** @class */ function() {
|
|
6129
6135
|
/** @hideconstructor */
|
|
@@ -6137,23 +6143,23 @@ function Ur(t, e) {
|
|
|
6137
6143
|
*/;
|
|
6138
6144
|
}
|
|
6139
6145
|
return t.prototype.get = function(t) {
|
|
6140
|
-
var e = this, n = Ur(t, this._firestore), r = new
|
|
6146
|
+
var e = this, n = Ur(t, this._firestore), r = new Ar(this._firestore);
|
|
6141
6147
|
return this._transaction.lookup([ n._key ]).then((function(t) {
|
|
6142
|
-
if (!t || 1 !== t.length) return
|
|
6148
|
+
if (!t || 1 !== t.length) return S();
|
|
6143
6149
|
var i = t[0];
|
|
6144
6150
|
if (i.isFoundDocument()) return new er(e._firestore, r, i.key, i, n.converter);
|
|
6145
6151
|
if (i.isNoDocument()) return new er(e._firestore, r, n._key, null, n.converter);
|
|
6146
|
-
throw
|
|
6152
|
+
throw S();
|
|
6147
6153
|
}));
|
|
6148
6154
|
}, t.prototype.set = function(t, e, n) {
|
|
6149
|
-
var r = Ur(t, this._firestore), i =
|
|
6155
|
+
var r = Ur(t, this._firestore), i = Sr(r.converter, e, n), o = Ln(this._dataReader, "Transaction.set", r._key, i, null !== r.converter, n);
|
|
6150
6156
|
return this._transaction.set(r._key, o), this;
|
|
6151
6157
|
}, t.prototype.update = function(t, e, n) {
|
|
6152
6158
|
for (var r = [], i = 3; i < arguments.length; i++) r[i - 3] = arguments[i];
|
|
6153
6159
|
var o, a = Ur(t, this._firestore);
|
|
6154
6160
|
// For Compat types, we have to "extract" the underlying types before
|
|
6155
6161
|
// performing validation.
|
|
6156
|
-
return o = "string" == typeof (e = p(e)) || e instanceof
|
|
6162
|
+
return o = "string" == typeof (e = p(e)) || e instanceof Sn ? Kn(this._dataReader, "Transaction.update", a._key, e, n, r) : zn(this._dataReader, "Transaction.update", a._key, e),
|
|
6157
6163
|
this._transaction.update(a._key, o), this;
|
|
6158
6164
|
},
|
|
6159
6165
|
/**
|
|
@@ -6204,12 +6210,12 @@ function Ur(t, e) {
|
|
|
6204
6210
|
* rejected promise with the corresponding failure error is returned.
|
|
6205
6211
|
*/
|
|
6206
6212
|
function Xr(t, e, n) {
|
|
6207
|
-
var r = an(t = ct(t, sn)), i = Object.assign(Object.assign({},
|
|
6213
|
+
var r = an(t = ct(t, sn)), i = Object.assign(Object.assign({}, Kr), n);
|
|
6208
6214
|
!function(t) {
|
|
6209
6215
|
if (t.maxAttempts < 1) throw new B(D, "Max attempts must be at least 1");
|
|
6210
6216
|
}(i);
|
|
6211
6217
|
var o = new z;
|
|
6212
|
-
return new
|
|
6218
|
+
return new Gr(new Yr, r, i, (function(n) {
|
|
6213
6219
|
return e(new Hr(t, n));
|
|
6214
6220
|
}), o).run(), o.promise
|
|
6215
6221
|
/**
|
|
@@ -6225,12 +6231,12 @@ function Xr(t, e, n) {
|
|
|
6225
6231
|
g = i + "_lite", o(new c("firestore/lite", (function(t, e) {
|
|
6226
6232
|
var n = e.instanceIdentifier, r = e.options, i = t.getProvider("app").getImmediate(), o = new sn(new W(t.getProvider("auth-internal")), new J(t.getProvider("app-check-internal")), function(t, e) {
|
|
6227
6233
|
if (!Object.prototype.hasOwnProperty.apply(t.options, [ "projectId" ])) throw new B(D, '"projectId" not provided in firebase.initializeApp.');
|
|
6228
|
-
return new
|
|
6234
|
+
return new Z(t.options.projectId, e);
|
|
6229
6235
|
}(i, n), i);
|
|
6230
6236
|
return r && o._setSettings(r), o;
|
|
6231
6237
|
}), "PUBLIC").setMultipleInstances(!0)),
|
|
6232
6238
|
// RUNTIME_ENV and BUILD_TARGET are replaced by real values during the compilation
|
|
6233
|
-
a("firestore-lite", "3.7.
|
|
6239
|
+
a("firestore-lite", "3.7.2-canary.457fc2eeb", ""), a("firestore-lite", "3.7.2-canary.457fc2eeb", "esm5");
|
|
6234
6240
|
|
|
6235
|
-
export { pn as AggregateField, dn as AggregateQuerySnapshot,
|
|
6241
|
+
export { pn as AggregateField, dn as AggregateQuerySnapshot, kn as Bytes, gn as CollectionReference, mn as DocumentReference, er as DocumentSnapshot, Sn as FieldPath, In as FieldValue, sn as Firestore, B as FirestoreError, Vn as GeoPoint, vn as Query, ar as QueryConstraint, nr as QueryDocumentSnapshot, rr as QuerySnapshot, Tt as Timestamp, Hr as Transaction, Mr as WriteBatch, Nr as addDoc, Rr as aggregateQuerySnapshotEqual, Cr as arrayRemove, xr as arrayUnion, wn as collection, bn as collectionGroup, fn as connectFirestoreEmulator, Fr as deleteDoc, qr as deleteField, _n as doc, An as documentId, br as endAt, wr as endBefore, Or as getCount, Ir as getDoc, Vr as getDocs, ln as getFirestore, jr as increment, cn as initializeFirestore, pr as limit, dr as limitToLast, fr as orderBy, ur as query, En as queryEqual, Tn as refEqual, Xr as runTransaction, Lr as serverTimestamp, Pr as setDoc, b as setLogLevel, ir as snapshotEqual, vr as startAfter, mr as startAt, hn as terminate, Dr as updateDoc, cr as where, Br as writeBatch };
|
|
6236
6242
|
//# sourceMappingURL=index.browser.esm5.js.map
|