@firebase/firestore 3.4.1-canary.be7ccb8ed → 3.4.2
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/firestore/test/util/helpers.d.ts +1 -0
- package/dist/index.esm2017.js +31 -34
- package/dist/index.esm2017.js.map +1 -1
- package/dist/index.esm5.js +24 -27
- package/dist/index.esm5.js.map +1 -1
- package/dist/index.node.cjs.js +16 -15
- package/dist/index.node.cjs.js.map +1 -1
- package/dist/index.node.mjs +16 -15
- package/dist/index.node.mjs.map +1 -1
- package/dist/index.rn.js +849 -852
- package/dist/index.rn.js.map +1 -1
- package/dist/lite/firestore/test/util/helpers.d.ts +1 -0
- package/dist/lite/index.browser.esm2017.js +74 -74
- package/dist/lite/index.browser.esm2017.js.map +1 -1
- package/dist/lite/index.browser.esm5.js +8 -8
- package/dist/lite/index.browser.esm5.js.map +1 -1
- package/dist/lite/index.node.cjs.js +2 -2
- package/dist/lite/index.node.mjs +2 -2
- package/dist/lite/index.node.mjs.map +1 -1
- package/dist/lite/index.rn.esm2017.js +82 -82
- package/dist/lite/index.rn.esm2017.js.map +1 -1
- package/dist/lite/packages/firestore/dist/lite/index.browser.esm2017.d.ts +19 -19
- package/dist/lite/packages/firestore/test/util/helpers.d.ts +1 -0
- package/dist/packages/firestore/test/util/helpers.d.ts +1 -0
- package/package.json +9 -9
|
@@ -66,7 +66,7 @@ f.MOCK_USER = new f("mock-user");
|
|
|
66
66
|
* See the License for the specific language governing permissions and
|
|
67
67
|
* limitations under the License.
|
|
68
68
|
*/
|
|
69
|
-
let d = "9.6.
|
|
69
|
+
let d = "9.6.2";
|
|
70
70
|
|
|
71
71
|
/**
|
|
72
72
|
* @license
|
|
@@ -178,7 +178,7 @@ function y(t, ...n) {
|
|
|
178
178
|
* Returns `never` and can be used in expressions:
|
|
179
179
|
* @example
|
|
180
180
|
* let futureVar = fail('not implemented yet');
|
|
181
|
-
*/ function
|
|
181
|
+
*/ function v(t = "Unexpected state") {
|
|
182
182
|
// Log the failure in addition to throw an exception, just in case the
|
|
183
183
|
// exception is swallowed.
|
|
184
184
|
const n = `FIRESTORE (${d}) INTERNAL ASSERTION FAILED: ` + t;
|
|
@@ -193,8 +193,8 @@ function y(t, ...n) {
|
|
|
193
193
|
* given message if it did.
|
|
194
194
|
*
|
|
195
195
|
* Messages are stripped in production builds.
|
|
196
|
-
*/ function
|
|
197
|
-
t ||
|
|
196
|
+
*/ function b(t, n) {
|
|
197
|
+
t || v();
|
|
198
198
|
}
|
|
199
199
|
|
|
200
200
|
/**
|
|
@@ -335,7 +335,7 @@ n) {
|
|
|
335
335
|
}));
|
|
336
336
|
}
|
|
337
337
|
getToken() {
|
|
338
|
-
return this.auth ? this.auth.getToken().then((t => t ? (
|
|
338
|
+
return this.auth ? this.auth.getToken().then((t => t ? (b("string" == typeof t.accessToken),
|
|
339
339
|
new M(t.accessToken, new f(this.auth.getUid()))) : null)) : Promise.resolve(null);
|
|
340
340
|
}
|
|
341
341
|
invalidateToken() {}
|
|
@@ -389,7 +389,7 @@ class Y {
|
|
|
389
389
|
}));
|
|
390
390
|
}
|
|
391
391
|
getToken() {
|
|
392
|
-
return this.appCheck ? this.appCheck.getToken().then((t => t ? (
|
|
392
|
+
return this.appCheck ? this.appCheck.getToken().then((t => t ? (b("string" == typeof t.token),
|
|
393
393
|
new Y(t.token)) : null)) : Promise.resolve(null);
|
|
394
394
|
}
|
|
395
395
|
invalidateToken() {}
|
|
@@ -479,7 +479,7 @@ class J {
|
|
|
479
479
|
*/
|
|
480
480
|
class X {
|
|
481
481
|
constructor(t, n, e) {
|
|
482
|
-
void 0 === n ? n = 0 : n > t.length &&
|
|
482
|
+
void 0 === n ? n = 0 : n > t.length && v(), void 0 === e ? e = t.length - n : e > t.length - n && v(),
|
|
483
483
|
this.segments = t, this.offset = n, this.len = e;
|
|
484
484
|
}
|
|
485
485
|
get length() {
|
|
@@ -769,7 +769,7 @@ function ot(t) {
|
|
|
769
769
|
return n ? `a custom ${n} object` : "an object";
|
|
770
770
|
}
|
|
771
771
|
}
|
|
772
|
-
return "function" == typeof t ? "a function" :
|
|
772
|
+
return "function" == typeof t ? "a function" : v();
|
|
773
773
|
}
|
|
774
774
|
|
|
775
775
|
function ut(t,
|
|
@@ -1178,7 +1178,7 @@ function _t(t, n) {
|
|
|
1178
1178
|
* For examples and further specifications, refer to the
|
|
1179
1179
|
* {@link https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto | Timestamp definition}.
|
|
1180
1180
|
*/
|
|
1181
|
-
class
|
|
1181
|
+
class vt {
|
|
1182
1182
|
/**
|
|
1183
1183
|
* Creates a new timestamp.
|
|
1184
1184
|
*
|
|
@@ -1210,7 +1210,7 @@ class bt {
|
|
|
1210
1210
|
*
|
|
1211
1211
|
* @returns a new timestamp representing the current date.
|
|
1212
1212
|
*/ static now() {
|
|
1213
|
-
return
|
|
1213
|
+
return vt.fromMillis(Date.now());
|
|
1214
1214
|
}
|
|
1215
1215
|
/**
|
|
1216
1216
|
* Creates a new timestamp from the given date.
|
|
@@ -1219,7 +1219,7 @@ class bt {
|
|
|
1219
1219
|
* @returns A new `Timestamp` representing the same point in time as the given
|
|
1220
1220
|
* date.
|
|
1221
1221
|
*/ static fromDate(t) {
|
|
1222
|
-
return
|
|
1222
|
+
return vt.fromMillis(t.getTime());
|
|
1223
1223
|
}
|
|
1224
1224
|
/**
|
|
1225
1225
|
* Creates a new timestamp from the given number of milliseconds.
|
|
@@ -1230,7 +1230,7 @@ class bt {
|
|
|
1230
1230
|
* number of milliseconds.
|
|
1231
1231
|
*/ static fromMillis(t) {
|
|
1232
1232
|
const n = Math.floor(t / 1e3), e = Math.floor(1e6 * (t - 1e3 * n));
|
|
1233
|
-
return new
|
|
1233
|
+
return new vt(n, e);
|
|
1234
1234
|
}
|
|
1235
1235
|
/**
|
|
1236
1236
|
* Converts a `Timestamp` to a JavaScript `Date` object. This conversion
|
|
@@ -1308,15 +1308,15 @@ class bt {
|
|
|
1308
1308
|
/**
|
|
1309
1309
|
* A version of a document in Firestore. This corresponds to the version
|
|
1310
1310
|
* timestamp, such as update_time or read_time.
|
|
1311
|
-
*/ class
|
|
1311
|
+
*/ class bt {
|
|
1312
1312
|
constructor(t) {
|
|
1313
1313
|
this.timestamp = t;
|
|
1314
1314
|
}
|
|
1315
1315
|
static fromTimestamp(t) {
|
|
1316
|
-
return new
|
|
1316
|
+
return new bt(t);
|
|
1317
1317
|
}
|
|
1318
1318
|
static min() {
|
|
1319
|
-
return new
|
|
1319
|
+
return new bt(new vt(0, 0));
|
|
1320
1320
|
}
|
|
1321
1321
|
compareTo(t) {
|
|
1322
1322
|
return this.timestamp._compareTo(t.timestamp);
|
|
@@ -1550,13 +1550,13 @@ const Rt = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
|
|
|
1550
1550
|
// The json interface (for the browser) will return an iso timestamp string,
|
|
1551
1551
|
// while the proto js library (for node) will return a
|
|
1552
1552
|
// google.protobuf.Timestamp instance.
|
|
1553
|
-
if (
|
|
1553
|
+
if (b(!!t), "string" == typeof t) {
|
|
1554
1554
|
// The date string can have higher precision (nanos) than the Date class
|
|
1555
1555
|
// (millis), so we do some custom parsing here.
|
|
1556
1556
|
// Parse the nanos right out of the string.
|
|
1557
1557
|
let n = 0;
|
|
1558
1558
|
const e = Rt.exec(t);
|
|
1559
|
-
if (
|
|
1559
|
+
if (b(!!e), e[1]) {
|
|
1560
1560
|
// Pad the fraction out to 9 digits (nanos).
|
|
1561
1561
|
let t = e[1];
|
|
1562
1562
|
t = (t + "000000000").substr(0, 9), n = Number(t);
|
|
@@ -1638,7 +1638,7 @@ const Rt = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
|
|
|
1638
1638
|
* Returns the local time at which this timestamp was first set.
|
|
1639
1639
|
*/ function St(t) {
|
|
1640
1640
|
const n = Vt(t.mapValue.fields.__local_write_time__.timestampValue);
|
|
1641
|
-
return new
|
|
1641
|
+
return new vt(n.seconds, n.nanos);
|
|
1642
1642
|
}
|
|
1643
1643
|
|
|
1644
1644
|
/**
|
|
@@ -1658,7 +1658,7 @@ const Rt = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
|
|
|
1658
1658
|
* limitations under the License.
|
|
1659
1659
|
*/
|
|
1660
1660
|
/** Extracts the backend's type order for the provided value. */ function xt(t) {
|
|
1661
|
-
return "nullValue" in t ? 0 /* NullValue */ : "booleanValue" in t ? 1 /* BooleanValue */ : "integerValue" in t || "doubleValue" in t ? 2 /* NumberValue */ : "timestampValue" in t ? 3 /* TimestampValue */ : "stringValue" in t ? 5 /* StringValue */ : "bytesValue" in t ? 6 /* BlobValue */ : "referenceValue" in t ? 7 /* RefValue */ : "geoPointValue" in t ? 8 /* GeoPointValue */ : "arrayValue" in t ? 9 /* ArrayValue */ : "mapValue" in t ? $t(t) ? 4 /* ServerTimestampValue */ : 10 /* ObjectValue */ :
|
|
1661
|
+
return "nullValue" in t ? 0 /* NullValue */ : "booleanValue" in t ? 1 /* BooleanValue */ : "integerValue" in t || "doubleValue" in t ? 2 /* NumberValue */ : "timestampValue" in t ? 3 /* TimestampValue */ : "stringValue" in t ? 5 /* StringValue */ : "bytesValue" in t ? 6 /* BlobValue */ : "referenceValue" in t ? 7 /* RefValue */ : "geoPointValue" in t ? 8 /* GeoPointValue */ : "arrayValue" in t ? 9 /* ArrayValue */ : "mapValue" in t ? $t(t) ? 4 /* ServerTimestampValue */ : 10 /* ObjectValue */ : v();
|
|
1662
1662
|
}
|
|
1663
1663
|
|
|
1664
1664
|
/** Tests `left` and `right` for equality based on the backend semantics. */ function qt(t, n) {
|
|
@@ -1723,7 +1723,7 @@ const Rt = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
|
|
|
1723
1723
|
/** Returns true if the ArrayValue contains the specified element. */ (t, n);
|
|
1724
1724
|
|
|
1725
1725
|
default:
|
|
1726
|
-
return
|
|
1726
|
+
return v();
|
|
1727
1727
|
}
|
|
1728
1728
|
}
|
|
1729
1729
|
|
|
@@ -1811,7 +1811,7 @@ function Ct(t, n) {
|
|
|
1811
1811
|
/** Returns a reference value for the provided database and key. */ (t.mapValue, n.mapValue);
|
|
1812
1812
|
|
|
1813
1813
|
default:
|
|
1814
|
-
throw
|
|
1814
|
+
throw v();
|
|
1815
1815
|
}
|
|
1816
1816
|
}
|
|
1817
1817
|
|
|
@@ -2012,7 +2012,7 @@ function kt(t, n) {
|
|
|
2012
2012
|
* Creates a document with no known version or data, but which can serve as
|
|
2013
2013
|
* base document for mutations.
|
|
2014
2014
|
*/ static newInvalidDocument(t) {
|
|
2015
|
-
return new Gt(t, 0 /* INVALID */ ,
|
|
2015
|
+
return new Gt(t, 0 /* INVALID */ , bt.min(), Qt.empty(), 0 /* SYNCED */);
|
|
2016
2016
|
}
|
|
2017
2017
|
/**
|
|
2018
2018
|
* Creates a new document that is known to exist with the given data at the
|
|
@@ -2164,7 +2164,7 @@ class Ht extends class {} {
|
|
|
2164
2164
|
return t >= 0;
|
|
2165
2165
|
|
|
2166
2166
|
default:
|
|
2167
|
-
return
|
|
2167
|
+
return v();
|
|
2168
2168
|
}
|
|
2169
2169
|
}
|
|
2170
2170
|
D() {
|
|
@@ -2489,13 +2489,13 @@ function yn(t, n) {
|
|
|
2489
2489
|
|
|
2490
2490
|
/** Transforms a value into a server-generated timestamp. */ class gn extends _n {}
|
|
2491
2491
|
|
|
2492
|
-
/** Transforms an array value via a union operation. */ class
|
|
2492
|
+
/** Transforms an array value via a union operation. */ class vn extends _n {
|
|
2493
2493
|
constructor(t) {
|
|
2494
2494
|
super(), this.elements = t;
|
|
2495
2495
|
}
|
|
2496
2496
|
}
|
|
2497
2497
|
|
|
2498
|
-
/** Transforms an array value via a remove operation. */ class
|
|
2498
|
+
/** Transforms an array value via a remove operation. */ class bn extends _n {
|
|
2499
2499
|
constructor(t) {
|
|
2500
2500
|
super(), this.elements = t;
|
|
2501
2501
|
}
|
|
@@ -2743,9 +2743,9 @@ function qn(t, n) {
|
|
|
2743
2743
|
}
|
|
2744
2744
|
|
|
2745
2745
|
function On(t) {
|
|
2746
|
-
return
|
|
2746
|
+
return b(!!t), bt.fromTimestamp(function(t) {
|
|
2747
2747
|
const n = Vt(t);
|
|
2748
|
-
return new
|
|
2748
|
+
return new vt(n.seconds, n.nanos);
|
|
2749
2749
|
}(t));
|
|
2750
2750
|
}
|
|
2751
2751
|
|
|
@@ -2762,11 +2762,11 @@ function Ln(t, n) {
|
|
|
2762
2762
|
function kn(t, n) {
|
|
2763
2763
|
const e = function(t) {
|
|
2764
2764
|
const n = Z.fromString(t);
|
|
2765
|
-
return
|
|
2765
|
+
return b(Jn(n)), n;
|
|
2766
2766
|
}(n);
|
|
2767
2767
|
if (e.get(1) !== t.databaseId.projectId) throw new U(P, "Tried to deserialize key from different project: " + e.get(1) + " vs " + t.databaseId.projectId);
|
|
2768
2768
|
if (e.get(3) !== t.databaseId.database) throw new U(P, "Tried to deserialize key from different database: " + e.get(3) + " vs " + t.databaseId.database);
|
|
2769
|
-
return new et((
|
|
2769
|
+
return new et((b((r = e).length > 4 && "documents" === r.get(4)), r.popFirst(5)));
|
|
2770
2770
|
var r;
|
|
2771
2771
|
/** Creates a Document proto from key and fields (but no create/update time) */}
|
|
2772
2772
|
|
|
@@ -2787,7 +2787,7 @@ function Mn(t, n, e) {
|
|
|
2787
2787
|
|
|
2788
2788
|
function Bn(t, n) {
|
|
2789
2789
|
return "found" in n ? function(t, n) {
|
|
2790
|
-
|
|
2790
|
+
b(!!n.found), n.found.name, n.found.updateTime;
|
|
2791
2791
|
const e = kn(t, n.found.name), r = On(n.found.updateTime), s = new Qt({
|
|
2792
2792
|
mapValue: {
|
|
2793
2793
|
fields: n.found.fields
|
|
@@ -2795,10 +2795,10 @@ function Bn(t, n) {
|
|
|
2795
2795
|
});
|
|
2796
2796
|
return Gt.newFoundDocument(e, r, s);
|
|
2797
2797
|
}(t, n) : "missing" in n ? function(t, n) {
|
|
2798
|
-
|
|
2798
|
+
b(!!n.missing), b(!!n.readTime);
|
|
2799
2799
|
const e = kn(t, n.missing), r = On(n.readTime);
|
|
2800
2800
|
return Gt.newNoDocument(e, r);
|
|
2801
|
-
}(t, n) :
|
|
2801
|
+
}(t, n) : v();
|
|
2802
2802
|
}
|
|
2803
2803
|
|
|
2804
2804
|
function zn(t, n) {
|
|
@@ -2811,7 +2811,7 @@ function zn(t, n) {
|
|
|
2811
2811
|
update: Mn(t, n.key, n.data),
|
|
2812
2812
|
updateMask: Kn(n.fieldMask)
|
|
2813
2813
|
}; else {
|
|
2814
|
-
if (!(n instanceof Nn)) return
|
|
2814
|
+
if (!(n instanceof Nn)) return v();
|
|
2815
2815
|
e = {
|
|
2816
2816
|
verify: Ln(t, n.key)
|
|
2817
2817
|
};
|
|
@@ -2822,13 +2822,13 @@ function zn(t, n) {
|
|
|
2822
2822
|
fieldPath: n.field.canonicalString(),
|
|
2823
2823
|
setToServerValue: "REQUEST_TIME"
|
|
2824
2824
|
};
|
|
2825
|
-
if (e instanceof
|
|
2825
|
+
if (e instanceof vn) return {
|
|
2826
2826
|
fieldPath: n.field.canonicalString(),
|
|
2827
2827
|
appendMissingElements: {
|
|
2828
2828
|
values: e.elements
|
|
2829
2829
|
}
|
|
2830
2830
|
};
|
|
2831
|
-
if (e instanceof
|
|
2831
|
+
if (e instanceof bn) return {
|
|
2832
2832
|
fieldPath: n.field.canonicalString(),
|
|
2833
2833
|
removeAllFromArray: {
|
|
2834
2834
|
values: e.elements
|
|
@@ -2838,13 +2838,13 @@ function zn(t, n) {
|
|
|
2838
2838
|
fieldPath: n.field.canonicalString(),
|
|
2839
2839
|
increment: e.O
|
|
2840
2840
|
};
|
|
2841
|
-
throw
|
|
2841
|
+
throw v();
|
|
2842
2842
|
}(0, t)))), n.precondition.isNone || (e.currentDocument = function(t, n) {
|
|
2843
2843
|
return void 0 !== n.updateTime ? {
|
|
2844
2844
|
updateTime: qn(t, n.updateTime)
|
|
2845
2845
|
} : void 0 !== n.exists ? {
|
|
2846
2846
|
exists: n.exists
|
|
2847
|
-
} :
|
|
2847
|
+
} : v();
|
|
2848
2848
|
}(t, n.precondition)), e;
|
|
2849
2849
|
}
|
|
2850
2850
|
|
|
@@ -3151,7 +3151,7 @@ async function ee(t, n) {
|
|
|
3151
3151
|
const u = [];
|
|
3152
3152
|
return n.forEach((t => {
|
|
3153
3153
|
const n = o.get(t.toString());
|
|
3154
|
-
|
|
3154
|
+
b(!!n), u.push(n);
|
|
3155
3155
|
})), u;
|
|
3156
3156
|
}
|
|
3157
3157
|
|
|
@@ -3323,7 +3323,7 @@ class oe {
|
|
|
3323
3323
|
case "gapi":
|
|
3324
3324
|
const n = t.client;
|
|
3325
3325
|
// Make sure this really is a Gapi client.
|
|
3326
|
-
return
|
|
3326
|
+
return b(!("object" != typeof n || null === n || !n.auth || !n.auth.getAuthHeaderValueForFirstParty)),
|
|
3327
3327
|
new W(n, t.sessionIndex || "0", t.iamToken || null);
|
|
3328
3328
|
|
|
3329
3329
|
case "provider":
|
|
@@ -3664,7 +3664,7 @@ function ye(t, n, ...e) {
|
|
|
3664
3664
|
*
|
|
3665
3665
|
* Create a `FieldPath` by providing field names. If more than one field
|
|
3666
3666
|
* name is provided, the path will point to a nested field in a document.
|
|
3667
|
-
*/ class
|
|
3667
|
+
*/ class ve {
|
|
3668
3668
|
/**
|
|
3669
3669
|
* Creates a `FieldPath` from the provided field names. If more than one field
|
|
3670
3670
|
* name is provided, the path will point to a nested field in a document.
|
|
@@ -3688,8 +3688,8 @@ function ye(t, n, ...e) {
|
|
|
3688
3688
|
/**
|
|
3689
3689
|
* Returns a special sentinel `FieldPath` to refer to the ID of a document.
|
|
3690
3690
|
* It can be used in queries to sort or filter by the document ID.
|
|
3691
|
-
*/ function
|
|
3692
|
-
return new
|
|
3691
|
+
*/ function be() {
|
|
3692
|
+
return new ve("__name__");
|
|
3693
3693
|
}
|
|
3694
3694
|
|
|
3695
3695
|
/**
|
|
@@ -3911,7 +3911,7 @@ function Ve(t) {
|
|
|
3911
3911
|
return !1;
|
|
3912
3912
|
|
|
3913
3913
|
default:
|
|
3914
|
-
throw
|
|
3914
|
+
throw v();
|
|
3915
3915
|
}
|
|
3916
3916
|
}
|
|
3917
3917
|
|
|
@@ -4082,7 +4082,7 @@ class Oe extends Te {
|
|
|
4082
4082
|
}
|
|
4083
4083
|
_toFieldTransform(t) {
|
|
4084
4084
|
const n = xe(this, t,
|
|
4085
|
-
/*array=*/ !0), e = this.lt.map((t => Me(t, n))), r = new
|
|
4085
|
+
/*array=*/ !0), e = this.lt.map((t => Me(t, n))), r = new vn(e);
|
|
4086
4086
|
return new Tn(t.path, r);
|
|
4087
4087
|
}
|
|
4088
4088
|
isEqual(t) {
|
|
@@ -4097,7 +4097,7 @@ class Ce extends Te {
|
|
|
4097
4097
|
}
|
|
4098
4098
|
_toFieldTransform(t) {
|
|
4099
4099
|
const n = xe(this, t,
|
|
4100
|
-
/*array=*/ !0), e = this.lt.map((t => Me(t, n))), r = new
|
|
4100
|
+
/*array=*/ !0), e = this.lt.map((t => Me(t, n))), r = new bn(e);
|
|
4101
4101
|
return new Tn(t.path, r);
|
|
4102
4102
|
}
|
|
4103
4103
|
isEqual(t) {
|
|
@@ -4258,16 +4258,16 @@ class Le extends Te {
|
|
|
4258
4258
|
stringValue: t
|
|
4259
4259
|
};
|
|
4260
4260
|
if (t instanceof Date) {
|
|
4261
|
-
const e =
|
|
4261
|
+
const e = vt.fromDate(t);
|
|
4262
4262
|
return {
|
|
4263
4263
|
timestampValue: Sn(n.q, e)
|
|
4264
4264
|
};
|
|
4265
4265
|
}
|
|
4266
|
-
if (t instanceof
|
|
4266
|
+
if (t instanceof vt) {
|
|
4267
4267
|
// Firestore backend truncates precision down to microseconds. To ensure
|
|
4268
4268
|
// offline mode works the same with regards to truncation, perform the
|
|
4269
4269
|
// truncation immediately without waiting for the backend to do that.
|
|
4270
|
-
const e = new
|
|
4270
|
+
const e = new vt(t.seconds, 1e3 * Math.floor(t.nanoseconds / 1e3));
|
|
4271
4271
|
return {
|
|
4272
4272
|
timestampValue: Sn(n.q, e)
|
|
4273
4273
|
};
|
|
@@ -4318,7 +4318,7 @@ function Be(t, n) {
|
|
|
4318
4318
|
}
|
|
4319
4319
|
|
|
4320
4320
|
function ze(t) {
|
|
4321
|
-
return !("object" != typeof t || null === t || t instanceof Array || t instanceof Date || t instanceof
|
|
4321
|
+
return !("object" != typeof t || null === t || t instanceof Array || t instanceof Date || t instanceof vt || t instanceof Ie || t instanceof Ee || t instanceof fe || t instanceof Te);
|
|
4322
4322
|
}
|
|
4323
4323
|
|
|
4324
4324
|
function Qe(t, n, e) {
|
|
@@ -4336,7 +4336,7 @@ function Qe(t, n, e) {
|
|
|
4336
4336
|
if ((
|
|
4337
4337
|
// If required, replace the FieldPath Compat class with with the firestore-exp
|
|
4338
4338
|
// FieldPath.
|
|
4339
|
-
n = l(n)) instanceof
|
|
4339
|
+
n = l(n)) instanceof ve) return n._internalPath;
|
|
4340
4340
|
if ("string" == typeof n) return Ye(t, n);
|
|
4341
4341
|
throw He("Field path arguments must be of type string or FieldPath.", t,
|
|
4342
4342
|
/* hasConverter= */ !1,
|
|
@@ -4360,7 +4360,7 @@ function Qe(t, n, e) {
|
|
|
4360
4360
|
/* hasConverter= */ !1,
|
|
4361
4361
|
/* path= */ void 0, e);
|
|
4362
4362
|
try {
|
|
4363
|
-
return new
|
|
4363
|
+
return new ve(...n.split("."))._internalPath;
|
|
4364
4364
|
} catch (r) {
|
|
4365
4365
|
throw He(`Invalid field path (${n}). Paths must not be empty, begin with '.', end with '.', or contain '..'`, t,
|
|
4366
4366
|
/* hasConverter= */ !1,
|
|
@@ -4533,7 +4533,7 @@ function He(t, n, e, r, s) {
|
|
|
4533
4533
|
/**
|
|
4534
4534
|
* Helper that calls `fromDotSeparatedString()` but wraps any error thrown.
|
|
4535
4535
|
*/ function nr(t, n) {
|
|
4536
|
-
return "string" == typeof n ? Ye(t, n) : n instanceof
|
|
4536
|
+
return "string" == typeof n ? Ye(t, n) : n instanceof ve ? n._internalPath : n._delegate._internalPath;
|
|
4537
4537
|
}
|
|
4538
4538
|
|
|
4539
4539
|
/**
|
|
@@ -4603,7 +4603,7 @@ class sr extends er {
|
|
|
4603
4603
|
const e = fn(t);
|
|
4604
4604
|
if (null !== e && !e.isEqual(n.field)) throw new U(P, `Invalid query. All where filters with an inequality (<, <=, !=, not-in, >, or >=) must be on the same field. But you have inequality filters on '${e.toString()}' and '${n.field.toString()}'`);
|
|
4605
4605
|
const r = ln(t);
|
|
4606
|
-
null !== r &&
|
|
4606
|
+
null !== r && vr(t, n.field, r);
|
|
4607
4607
|
}
|
|
4608
4608
|
const e = function(t, n) {
|
|
4609
4609
|
for (const e of t.filters) if (n.indexOf(e.op) >= 0) return e.op;
|
|
@@ -4682,7 +4682,7 @@ class or extends er {
|
|
|
4682
4682
|
if (null === ln(t)) {
|
|
4683
4683
|
// This is the first order by. It must match any inequality.
|
|
4684
4684
|
const e = fn(t);
|
|
4685
|
-
null !== e &&
|
|
4685
|
+
null !== e && vr(t, e, n.field);
|
|
4686
4686
|
}
|
|
4687
4687
|
}(t, r), r;
|
|
4688
4688
|
}
|
|
@@ -4720,12 +4720,12 @@ class or extends er {
|
|
|
4720
4720
|
|
|
4721
4721
|
class cr extends er {
|
|
4722
4722
|
constructor(t, n, e) {
|
|
4723
|
-
super(), this.type = t, this.gt = n, this.
|
|
4723
|
+
super(), this.type = t, this.gt = n, this.vt = e;
|
|
4724
4724
|
}
|
|
4725
4725
|
_apply(t) {
|
|
4726
4726
|
return new de(t.firestore, t.converter, function(t, n, e) {
|
|
4727
4727
|
return new an(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), n, e, t.startAt, t.endAt);
|
|
4728
|
-
}(t._query, this.gt, this.
|
|
4728
|
+
}(t._query, this.gt, this.vt));
|
|
4729
4729
|
}
|
|
4730
4730
|
}
|
|
4731
4731
|
|
|
@@ -4752,10 +4752,10 @@ class cr extends er {
|
|
|
4752
4752
|
|
|
4753
4753
|
class lr extends er {
|
|
4754
4754
|
constructor(t, n, e) {
|
|
4755
|
-
super(), this.type = t, this.
|
|
4755
|
+
super(), this.type = t, this.bt = n, this.Et = e;
|
|
4756
4756
|
}
|
|
4757
4757
|
_apply(t) {
|
|
4758
|
-
const n = yr(t, this.type, this.
|
|
4758
|
+
const n = yr(t, this.type, this.bt, this.Et);
|
|
4759
4759
|
return new de(t.firestore, t.converter, function(t, n) {
|
|
4760
4760
|
return new an(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), t.limit, t.limitType, n, t.endAt);
|
|
4761
4761
|
}(t._query, n));
|
|
@@ -4773,10 +4773,10 @@ function dr(...t) {
|
|
|
4773
4773
|
|
|
4774
4774
|
class wr extends er {
|
|
4775
4775
|
constructor(t, n, e) {
|
|
4776
|
-
super(), this.type = t, this.
|
|
4776
|
+
super(), this.type = t, this.bt = n, this.Et = e;
|
|
4777
4777
|
}
|
|
4778
4778
|
_apply(t) {
|
|
4779
|
-
const n = yr(t, this.type, this.
|
|
4779
|
+
const n = yr(t, this.type, this.bt, this.Et);
|
|
4780
4780
|
return new de(t.firestore, t.converter, function(t, n) {
|
|
4781
4781
|
return new an(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), t.limit, t.limitType, t.startAt, n);
|
|
4782
4782
|
}(t._query, n));
|
|
@@ -4867,7 +4867,7 @@ function _r(t, n, e) {
|
|
|
4867
4867
|
if (t.length > 10) throw new U(P, `Invalid Query. '${n.toString()}' filters support a maximum of 10 elements in the value array.`);
|
|
4868
4868
|
}
|
|
4869
4869
|
|
|
4870
|
-
function
|
|
4870
|
+
function vr(t, n, e) {
|
|
4871
4871
|
if (!e.isEqual(n)) throw new U(P, `Invalid query. You have a where filter with an inequality (<, <=, !=, not-in, >, or >=) on field '${n.toString()}' and so you must also use '${n.toString()}' as your first argument to orderBy(), but your first orderBy() is on field '${e.toString()}' instead.`);
|
|
4872
4872
|
}
|
|
4873
4873
|
|
|
@@ -4918,7 +4918,7 @@ function br(t, n, e) {
|
|
|
4918
4918
|
* their `set()` or fails due to invalid data originating from a `toFirestore()`
|
|
4919
4919
|
* call.
|
|
4920
4920
|
*/
|
|
4921
|
-
function
|
|
4921
|
+
function br(t, n, e) {
|
|
4922
4922
|
let r;
|
|
4923
4923
|
// Cast to `any` in order to satisfy the union type constraint on
|
|
4924
4924
|
// toFirestore().
|
|
@@ -4964,7 +4964,7 @@ class Er extends class {
|
|
|
4964
4964
|
return this.convertObject(t.mapValue, n);
|
|
4965
4965
|
|
|
4966
4966
|
default:
|
|
4967
|
-
throw
|
|
4967
|
+
throw v();
|
|
4968
4968
|
}
|
|
4969
4969
|
}
|
|
4970
4970
|
convertObject(t, n) {
|
|
@@ -4994,11 +4994,11 @@ class Er extends class {
|
|
|
4994
4994
|
}
|
|
4995
4995
|
convertTimestamp(t) {
|
|
4996
4996
|
const n = Vt(t);
|
|
4997
|
-
return new
|
|
4997
|
+
return new vt(n.seconds, n.nanos);
|
|
4998
4998
|
}
|
|
4999
4999
|
convertDocumentKey(t, n) {
|
|
5000
5000
|
const e = Z.fromString(t);
|
|
5001
|
-
|
|
5001
|
+
b(Jn(e));
|
|
5002
5002
|
const r = new J(e.get(1), e.get(3)), s = new et(e.popFirst(5));
|
|
5003
5003
|
return r.isEqual(n) ||
|
|
5004
5004
|
// TODO(b/64130202): Somehow support foreign references.
|
|
@@ -5033,7 +5033,7 @@ class Er extends class {
|
|
|
5033
5033
|
*/ function Tr(t) {
|
|
5034
5034
|
const n = ie((t = ut(t, fe)).firestore), e = new Er(t.firestore);
|
|
5035
5035
|
return ee(n, [ t._key ]).then((n => {
|
|
5036
|
-
|
|
5036
|
+
b(1 === n.length);
|
|
5037
5037
|
const r = n[0];
|
|
5038
5038
|
return new Je(t.firestore, e, t._key, r.isFoundDocument() ? r : null, t.converter);
|
|
5039
5039
|
}));
|
|
@@ -5066,7 +5066,7 @@ class Er extends class {
|
|
|
5066
5066
|
}
|
|
5067
5067
|
|
|
5068
5068
|
function Ar(t, n, e) {
|
|
5069
|
-
const r =
|
|
5069
|
+
const r = br((t = ut(t, fe)).converter, n, e), s = Fe($e(t.firestore), "setDoc", t._key, r, null !== t.converter, e);
|
|
5070
5070
|
return ne(ie(t.firestore), [ s.toMutation(t._key, In.none()) ]);
|
|
5071
5071
|
}
|
|
5072
5072
|
|
|
@@ -5075,7 +5075,7 @@ function Pr(t, n, e, ...r) {
|
|
|
5075
5075
|
// For Compat types, we have to "extract" the underlying types before
|
|
5076
5076
|
// performing validation.
|
|
5077
5077
|
let i;
|
|
5078
|
-
i = "string" == typeof (n = l(n)) || n instanceof
|
|
5078
|
+
i = "string" == typeof (n = l(n)) || n instanceof ve ? Ue(s, "updateDoc", t._key, n, e, r) : ke(s, "updateDoc", t._key, n);
|
|
5079
5079
|
return ne(ie(t.firestore), [ i.toMutation(t._key, In.exists(!0)) ]);
|
|
5080
5080
|
}
|
|
5081
5081
|
|
|
@@ -5109,7 +5109,7 @@ function Pr(t, n, e, ...r) {
|
|
|
5109
5109
|
* @returns A `Promise` resolved with a `DocumentReference` pointing to the
|
|
5110
5110
|
* newly created document after it has been written to the backend.
|
|
5111
5111
|
*/ function Vr(t, n) {
|
|
5112
|
-
const e = ye(t = ut(t, we)), r =
|
|
5112
|
+
const e = ye(t = ut(t, we)), r = br(t.converter, n), s = Fe($e(t.firestore), "addDoc", e._key, r, null !== e.converter, {});
|
|
5113
5113
|
return ne(ie(t.firestore), [ s.toMutation(e._key, In.exists(!1)) ]).then((() => e));
|
|
5114
5114
|
}
|
|
5115
5115
|
|
|
@@ -5229,7 +5229,7 @@ function Pr(t, n, e, ...r) {
|
|
|
5229
5229
|
}
|
|
5230
5230
|
set(t, n, e) {
|
|
5231
5231
|
this._verifyNotCommitted();
|
|
5232
|
-
const r = qr(t, this._firestore), s =
|
|
5232
|
+
const r = qr(t, this._firestore), s = br(r.converter, n, e), i = Fe(this._dataReader, "WriteBatch.set", r._key, s, null !== r.converter, e);
|
|
5233
5233
|
return this._mutations.push(i.toMutation(r._key, In.none())), this;
|
|
5234
5234
|
}
|
|
5235
5235
|
update(t, n, e, ...r) {
|
|
@@ -5238,7 +5238,7 @@ function Pr(t, n, e, ...r) {
|
|
|
5238
5238
|
// For Compat types, we have to "extract" the underlying types before
|
|
5239
5239
|
// performing validation.
|
|
5240
5240
|
let i;
|
|
5241
|
-
return i = "string" == typeof (n = l(n)) || n instanceof
|
|
5241
|
+
return i = "string" == typeof (n = l(n)) || n instanceof ve ? Ue(this._dataReader, "WriteBatch.update", s._key, n, e, r) : ke(this._dataReader, "WriteBatch.update", s._key, n),
|
|
5242
5242
|
this._mutations.push(i.toMutation(s._key, In.exists(!0))), this;
|
|
5243
5243
|
}
|
|
5244
5244
|
/**
|
|
@@ -5365,9 +5365,9 @@ function qr(t, n) {
|
|
|
5365
5365
|
recordVersion(t) {
|
|
5366
5366
|
let n;
|
|
5367
5367
|
if (t.isFoundDocument()) n = t.version; else {
|
|
5368
|
-
if (!t.isNoDocument()) throw
|
|
5368
|
+
if (!t.isNoDocument()) throw v();
|
|
5369
5369
|
// For deleted docs, we must use baseVersion 0 when we overwrite them.
|
|
5370
|
-
n =
|
|
5370
|
+
n = bt.min();
|
|
5371
5371
|
}
|
|
5372
5372
|
const e = this.readVersions.get(t.key.toString());
|
|
5373
5373
|
if (e) {
|
|
@@ -5390,7 +5390,7 @@ function qr(t, n) {
|
|
|
5390
5390
|
// The first time a document is written, we want to take into account the
|
|
5391
5391
|
// read time and existence
|
|
5392
5392
|
if (!this.writtenDocs.has(t.toString()) && n) {
|
|
5393
|
-
if (n.isEqual(
|
|
5393
|
+
if (n.isEqual(bt.min()))
|
|
5394
5394
|
// The document doesn't exist, so fail the transaction.
|
|
5395
5395
|
// This has to be validated locally because you can't send a
|
|
5396
5396
|
// precondition that a document does not exist without changing the
|
|
@@ -5485,7 +5485,7 @@ class Lr {
|
|
|
5485
5485
|
function(t) {
|
|
5486
5486
|
switch (t) {
|
|
5487
5487
|
default:
|
|
5488
|
-
return
|
|
5488
|
+
return v();
|
|
5489
5489
|
|
|
5490
5490
|
case I:
|
|
5491
5491
|
case A:
|
|
@@ -5826,7 +5826,7 @@ class Lr {
|
|
|
5826
5826
|
return this.Ft.push(r), r;
|
|
5827
5827
|
}
|
|
5828
5828
|
Lt() {
|
|
5829
|
-
this.St &&
|
|
5829
|
+
this.St && v();
|
|
5830
5830
|
}
|
|
5831
5831
|
verifyOperationInProgress() {}
|
|
5832
5832
|
/**
|
|
@@ -5889,15 +5889,15 @@ class Mr {
|
|
|
5889
5889
|
*/ get(t) {
|
|
5890
5890
|
const n = qr(t, this._firestore), e = new Er(this._firestore);
|
|
5891
5891
|
return this._transaction.lookup([ n._key ]).then((t => {
|
|
5892
|
-
if (!t || 1 !== t.length) return
|
|
5892
|
+
if (!t || 1 !== t.length) return v();
|
|
5893
5893
|
const r = t[0];
|
|
5894
5894
|
if (r.isFoundDocument()) return new Je(this._firestore, e, r.key, r, n.converter);
|
|
5895
5895
|
if (r.isNoDocument()) return new Je(this._firestore, e, n._key, null, n.converter);
|
|
5896
|
-
throw
|
|
5896
|
+
throw v();
|
|
5897
5897
|
}));
|
|
5898
5898
|
}
|
|
5899
5899
|
set(t, n, e) {
|
|
5900
|
-
const r = qr(t, this._firestore), s =
|
|
5900
|
+
const r = qr(t, this._firestore), s = br(r.converter, n, e), i = Fe(this._dataReader, "Transaction.set", r._key, s, null !== r.converter, e);
|
|
5901
5901
|
return this._transaction.set(r._key, i), this;
|
|
5902
5902
|
}
|
|
5903
5903
|
update(t, n, e, ...r) {
|
|
@@ -5905,7 +5905,7 @@ class Mr {
|
|
|
5905
5905
|
// For Compat types, we have to "extract" the underlying types before
|
|
5906
5906
|
// performing validation.
|
|
5907
5907
|
let i;
|
|
5908
|
-
return i = "string" == typeof (n = l(n)) || n instanceof
|
|
5908
|
+
return i = "string" == typeof (n = l(n)) || n instanceof ve ? Ue(this._dataReader, "Transaction.update", s._key, n, e, r) : ke(this._dataReader, "Transaction.update", s._key, n),
|
|
5909
5909
|
this._transaction.update(s._key, i), this;
|
|
5910
5910
|
}
|
|
5911
5911
|
/**
|
|
@@ -5954,7 +5954,7 @@ class Mr {
|
|
|
5954
5954
|
return n && r._setSettings(n), r;
|
|
5955
5955
|
}), "PUBLIC")),
|
|
5956
5956
|
// RUNTIME_ENV and BUILD_TARGET are replaced by real values during the compilation
|
|
5957
|
-
r("firestore-lite", "3.4.
|
|
5957
|
+
r("firestore-lite", "3.4.2", "rn"), r("firestore-lite", "3.4.2", "esm2017");
|
|
5958
5958
|
|
|
5959
|
-
export { Ee as Bytes, we as CollectionReference, fe as DocumentReference, Je as DocumentSnapshot,
|
|
5959
|
+
export { Ee as Bytes, we as CollectionReference, fe as DocumentReference, Je as DocumentSnapshot, ve as FieldPath, Te as FieldValue, ue as Firestore, U as FirestoreError, Ie as GeoPoint, de as Query, er as QueryConstraint, Xe as QueryDocumentSnapshot, Ze as QuerySnapshot, vt as Timestamp, Mr as Transaction, xr as WriteBatch, Vr as addDoc, Fr as arrayRemove, $r as arrayUnion, me as collection, pe as collectionGroup, he as connectFirestoreEmulator, Rr as deleteDoc, Nr as deleteField, ye as doc, be as documentId, pr as endAt, mr as endBefore, Tr as getDoc, Ir as getDocs, ae as getFirestore, Sr as increment, ce as initializeFirestore, ar as limit, hr as limitToLast, ur as orderBy, rr as query, ge as queryEqual, _e as refEqual, Br as runTransaction, Dr as serverTimestamp, Ar as setDoc, m as setLogLevel, tr as snapshotEqual, dr as startAfter, fr as startAt, le as terminate, Pr as updateDoc, ir as where, Or as writeBatch };
|
|
5960
5960
|
//# sourceMappingURL=index.rn.esm2017.js.map
|