@firebase/firestore 3.4.5-canary.2b98b28f2 → 3.4.5-canary.2d672cead
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/firestore/src/local/document_overlay_cache.d.ts +4 -5
- package/dist/firestore/src/local/indexeddb_document_overlay_cache.d.ts +4 -5
- package/dist/firestore/src/local/indexeddb_index_manager.d.ts +1 -1
- package/dist/firestore/src/local/indexeddb_schema.d.ts +34 -553
- package/dist/firestore/src/local/indexeddb_sentinels.d.ts +238 -0
- package/dist/firestore/src/local/indexeddb_target_cache.d.ts +2 -1
- package/dist/firestore/src/local/local_serializer.d.ts +2 -1
- package/dist/firestore/src/local/memory_document_overlay_cache.d.ts +4 -5
- package/dist/firestore/src/model/collections.d.ts +7 -0
- package/dist/firestore/src/util/obj_map.d.ts +3 -0
- package/dist/firestore/test/unit/local/test_document_overlay_cache.d.ts +4 -4
- package/dist/index.esm2017.js +3143 -3655
- package/dist/index.esm2017.js.map +1 -1
- package/dist/index.esm5.js +3305 -3756
- package/dist/index.esm5.js.map +1 -1
- package/dist/index.node.cjs.js +483 -929
- package/dist/index.node.cjs.js.map +1 -1
- package/dist/index.node.mjs +483 -929
- package/dist/index.node.mjs.map +1 -1
- package/dist/index.rn.js +3168 -3680
- package/dist/index.rn.js.map +1 -1
- package/dist/internal.d.ts +10 -3
- package/dist/lite/firestore/src/local/document_overlay_cache.d.ts +4 -5
- package/dist/lite/firestore/src/local/indexeddb_document_overlay_cache.d.ts +4 -5
- package/dist/lite/firestore/src/local/indexeddb_index_manager.d.ts +1 -1
- package/dist/lite/firestore/src/local/indexeddb_schema.d.ts +34 -553
- package/dist/lite/firestore/src/local/indexeddb_sentinels.d.ts +238 -0
- package/dist/lite/firestore/src/local/indexeddb_target_cache.d.ts +2 -1
- package/dist/lite/firestore/src/local/local_serializer.d.ts +2 -1
- package/dist/lite/firestore/src/local/memory_document_overlay_cache.d.ts +4 -5
- package/dist/lite/firestore/src/model/collections.d.ts +7 -0
- package/dist/lite/firestore/src/util/obj_map.d.ts +3 -0
- package/dist/lite/firestore/test/unit/local/test_document_overlay_cache.d.ts +4 -4
- package/dist/lite/index.browser.esm2017.js +72 -72
- package/dist/lite/index.browser.esm2017.js.map +1 -1
- package/dist/lite/index.browser.esm5.js +8 -8
- 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 +83 -83
- package/dist/lite/packages/firestore/dist/lite/index.browser.esm2017.d.ts +18 -18
- package/dist/lite/packages/firestore/src/local/document_overlay_cache.d.ts +4 -5
- package/dist/lite/packages/firestore/src/local/indexeddb_document_overlay_cache.d.ts +4 -5
- package/dist/lite/packages/firestore/src/local/indexeddb_index_manager.d.ts +1 -1
- package/dist/lite/packages/firestore/src/local/indexeddb_schema.d.ts +34 -553
- package/dist/lite/packages/firestore/src/local/indexeddb_sentinels.d.ts +238 -0
- package/dist/lite/packages/firestore/src/local/indexeddb_target_cache.d.ts +2 -1
- package/dist/lite/packages/firestore/src/local/local_serializer.d.ts +2 -1
- package/dist/lite/packages/firestore/src/local/memory_document_overlay_cache.d.ts +4 -5
- package/dist/lite/packages/firestore/src/model/collections.d.ts +7 -0
- package/dist/lite/packages/firestore/src/util/obj_map.d.ts +3 -0
- package/dist/lite/packages/firestore/test/unit/local/test_document_overlay_cache.d.ts +4 -4
- package/dist/packages/firestore/dist/index.esm2017.d.ts +163 -163
- package/dist/packages/firestore/src/local/document_overlay_cache.d.ts +4 -5
- package/dist/packages/firestore/src/local/indexeddb_document_overlay_cache.d.ts +4 -5
- package/dist/packages/firestore/src/local/indexeddb_index_manager.d.ts +1 -1
- package/dist/packages/firestore/src/local/indexeddb_schema.d.ts +34 -553
- package/dist/packages/firestore/src/local/indexeddb_sentinels.d.ts +238 -0
- package/dist/packages/firestore/src/local/indexeddb_target_cache.d.ts +2 -1
- package/dist/packages/firestore/src/local/local_serializer.d.ts +2 -1
- package/dist/packages/firestore/src/local/memory_document_overlay_cache.d.ts +4 -5
- package/dist/packages/firestore/src/model/collections.d.ts +7 -0
- package/dist/packages/firestore/src/util/obj_map.d.ts +3 -0
- package/dist/packages/firestore/test/unit/local/test_document_overlay_cache.d.ts +4 -4
- package/dist/private.d.ts +10 -3
- 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.7-canary.
|
|
69
|
+
let d = "9.6.7-canary.2d672cead";
|
|
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() {}
|
|
@@ -482,7 +482,7 @@ class J {
|
|
|
482
482
|
*/
|
|
483
483
|
class X {
|
|
484
484
|
constructor(t, n, e) {
|
|
485
|
-
void 0 === n ? n = 0 : n > t.length &&
|
|
485
|
+
void 0 === n ? n = 0 : n > t.length && v(), void 0 === e ? e = t.length - n : e > t.length - n && v(),
|
|
486
486
|
this.segments = t, this.offset = n, this.len = e;
|
|
487
487
|
}
|
|
488
488
|
get length() {
|
|
@@ -784,7 +784,7 @@ function ot(t) {
|
|
|
784
784
|
return n ? `a custom ${n} object` : "an object";
|
|
785
785
|
}
|
|
786
786
|
}
|
|
787
|
-
return "function" == typeof t ? "a function" :
|
|
787
|
+
return "function" == typeof t ? "a function" : v();
|
|
788
788
|
}
|
|
789
789
|
|
|
790
790
|
function ut(t,
|
|
@@ -1193,7 +1193,7 @@ function _t(t, n) {
|
|
|
1193
1193
|
* For examples and further specifications, refer to the
|
|
1194
1194
|
* {@link https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto | Timestamp definition}.
|
|
1195
1195
|
*/
|
|
1196
|
-
class
|
|
1196
|
+
class vt {
|
|
1197
1197
|
/**
|
|
1198
1198
|
* Creates a new timestamp.
|
|
1199
1199
|
*
|
|
@@ -1225,7 +1225,7 @@ class bt {
|
|
|
1225
1225
|
*
|
|
1226
1226
|
* @returns a new timestamp representing the current date.
|
|
1227
1227
|
*/ static now() {
|
|
1228
|
-
return
|
|
1228
|
+
return vt.fromMillis(Date.now());
|
|
1229
1229
|
}
|
|
1230
1230
|
/**
|
|
1231
1231
|
* Creates a new timestamp from the given date.
|
|
@@ -1234,7 +1234,7 @@ class bt {
|
|
|
1234
1234
|
* @returns A new `Timestamp` representing the same point in time as the given
|
|
1235
1235
|
* date.
|
|
1236
1236
|
*/ static fromDate(t) {
|
|
1237
|
-
return
|
|
1237
|
+
return vt.fromMillis(t.getTime());
|
|
1238
1238
|
}
|
|
1239
1239
|
/**
|
|
1240
1240
|
* Creates a new timestamp from the given number of milliseconds.
|
|
@@ -1245,7 +1245,7 @@ class bt {
|
|
|
1245
1245
|
* number of milliseconds.
|
|
1246
1246
|
*/ static fromMillis(t) {
|
|
1247
1247
|
const n = Math.floor(t / 1e3), e = Math.floor(1e6 * (t - 1e3 * n));
|
|
1248
|
-
return new
|
|
1248
|
+
return new vt(n, e);
|
|
1249
1249
|
}
|
|
1250
1250
|
/**
|
|
1251
1251
|
* Converts a `Timestamp` to a JavaScript `Date` object. This conversion
|
|
@@ -1323,15 +1323,15 @@ class bt {
|
|
|
1323
1323
|
/**
|
|
1324
1324
|
* A version of a document in Firestore. This corresponds to the version
|
|
1325
1325
|
* timestamp, such as update_time or read_time.
|
|
1326
|
-
*/ class
|
|
1326
|
+
*/ class bt {
|
|
1327
1327
|
constructor(t) {
|
|
1328
1328
|
this.timestamp = t;
|
|
1329
1329
|
}
|
|
1330
1330
|
static fromTimestamp(t) {
|
|
1331
|
-
return new
|
|
1331
|
+
return new bt(t);
|
|
1332
1332
|
}
|
|
1333
1333
|
static min() {
|
|
1334
|
-
return new
|
|
1334
|
+
return new bt(new vt(0, 0));
|
|
1335
1335
|
}
|
|
1336
1336
|
compareTo(t) {
|
|
1337
1337
|
return this.timestamp._compareTo(t.timestamp);
|
|
@@ -1567,13 +1567,13 @@ const Pt = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
|
|
|
1567
1567
|
// The json interface (for the browser) will return an iso timestamp string,
|
|
1568
1568
|
// while the proto js library (for node) will return a
|
|
1569
1569
|
// google.protobuf.Timestamp instance.
|
|
1570
|
-
if (
|
|
1570
|
+
if (b(!!t), "string" == typeof t) {
|
|
1571
1571
|
// The date string can have higher precision (nanos) than the Date class
|
|
1572
1572
|
// (millis), so we do some custom parsing here.
|
|
1573
1573
|
// Parse the nanos right out of the string.
|
|
1574
1574
|
let n = 0;
|
|
1575
1575
|
const e = Pt.exec(t);
|
|
1576
|
-
if (
|
|
1576
|
+
if (b(!!e), e[1]) {
|
|
1577
1577
|
// Pad the fraction out to 9 digits (nanos).
|
|
1578
1578
|
let t = e[1];
|
|
1579
1579
|
t = (t + "000000000").substr(0, 9), n = Number(t);
|
|
@@ -1655,7 +1655,7 @@ const Pt = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
|
|
|
1655
1655
|
* Returns the local time at which this timestamp was first set.
|
|
1656
1656
|
*/ function Ft(t) {
|
|
1657
1657
|
const n = Vt(t.mapValue.fields.__local_write_time__.timestampValue);
|
|
1658
|
-
return new
|
|
1658
|
+
return new vt(n.seconds, n.nanos);
|
|
1659
1659
|
}
|
|
1660
1660
|
|
|
1661
1661
|
/**
|
|
@@ -1700,7 +1700,7 @@ function xt(t) {
|
|
|
1700
1700
|
/**
|
|
1701
1701
|
* An ObjectValue represents a MapValue in the Firestore Proto and offers the
|
|
1702
1702
|
* ability to add and remove fields (via the ObjectValueBuilder).
|
|
1703
|
-
*/ (t) ? 9 /* ArrayValue */ : 10 /* ObjectValue */ :
|
|
1703
|
+
*/ (t) ? 9 /* ArrayValue */ : 10 /* ObjectValue */ : v();
|
|
1704
1704
|
}
|
|
1705
1705
|
|
|
1706
1706
|
/** Tests `left` and `right` for equality based on the backend semantics. */ function qt(t, n) {
|
|
@@ -1766,7 +1766,7 @@ function xt(t) {
|
|
|
1766
1766
|
/** Returns true if the ArrayValue contains the specified element. */ (t, n);
|
|
1767
1767
|
|
|
1768
1768
|
default:
|
|
1769
|
-
return
|
|
1769
|
+
return v();
|
|
1770
1770
|
}
|
|
1771
1771
|
}
|
|
1772
1772
|
|
|
@@ -1855,7 +1855,7 @@ function Ct(t, n) {
|
|
|
1855
1855
|
/** Returns a reference value for the provided database and key. */ (t.mapValue, n.mapValue);
|
|
1856
1856
|
|
|
1857
1857
|
default:
|
|
1858
|
-
throw
|
|
1858
|
+
throw v();
|
|
1859
1859
|
}
|
|
1860
1860
|
}
|
|
1861
1861
|
|
|
@@ -2038,23 +2038,23 @@ class Gt {
|
|
|
2038
2038
|
* Creates a document with no known version or data, but which can serve as
|
|
2039
2039
|
* base document for mutations.
|
|
2040
2040
|
*/ static newInvalidDocument(t) {
|
|
2041
|
-
return new Qt(t, 0 /* INVALID */ ,
|
|
2041
|
+
return new Qt(t, 0 /* INVALID */ , bt.min(), bt.min(), Gt.empty(), 0 /* SYNCED */);
|
|
2042
2042
|
}
|
|
2043
2043
|
/**
|
|
2044
2044
|
* Creates a new document that is known to exist with the given data at the
|
|
2045
2045
|
* given version.
|
|
2046
2046
|
*/ static newFoundDocument(t, n, e) {
|
|
2047
|
-
return new Qt(t, 1 /* FOUND_DOCUMENT */ , n,
|
|
2047
|
+
return new Qt(t, 1 /* FOUND_DOCUMENT */ , n, bt.min(), e, 0 /* SYNCED */);
|
|
2048
2048
|
}
|
|
2049
2049
|
/** Creates a new document that is known to not exist at the given version. */ static newNoDocument(t, n) {
|
|
2050
|
-
return new Qt(t, 2 /* NO_DOCUMENT */ , n,
|
|
2050
|
+
return new Qt(t, 2 /* NO_DOCUMENT */ , n, bt.min(), Gt.empty(), 0 /* SYNCED */);
|
|
2051
2051
|
}
|
|
2052
2052
|
/**
|
|
2053
2053
|
* Creates a new document that is known to exist at the given version but
|
|
2054
2054
|
* whose data is not known (e.g. a document that was updated without a known
|
|
2055
2055
|
* base document).
|
|
2056
2056
|
*/ static newUnknownDocument(t, n) {
|
|
2057
|
-
return new Qt(t, 3 /* UNKNOWN_DOCUMENT */ , n,
|
|
2057
|
+
return new Qt(t, 3 /* UNKNOWN_DOCUMENT */ , n, bt.min(), Gt.empty(), 2 /* HAS_COMMITTED_MUTATIONS */);
|
|
2058
2058
|
}
|
|
2059
2059
|
/**
|
|
2060
2060
|
* Changes the document type to indicate that it exists and that its version
|
|
@@ -2193,7 +2193,7 @@ class Ht extends class {} {
|
|
|
2193
2193
|
return t >= 0;
|
|
2194
2194
|
|
|
2195
2195
|
default:
|
|
2196
|
-
return
|
|
2196
|
+
return v();
|
|
2197
2197
|
}
|
|
2198
2198
|
}
|
|
2199
2199
|
D() {
|
|
@@ -2518,13 +2518,13 @@ function yn(t, n) {
|
|
|
2518
2518
|
|
|
2519
2519
|
/** Transforms a value into a server-generated timestamp. */ class gn extends _n {}
|
|
2520
2520
|
|
|
2521
|
-
/** Transforms an array value via a union operation. */ class
|
|
2521
|
+
/** Transforms an array value via a union operation. */ class vn extends _n {
|
|
2522
2522
|
constructor(t) {
|
|
2523
2523
|
super(), this.elements = t;
|
|
2524
2524
|
}
|
|
2525
2525
|
}
|
|
2526
2526
|
|
|
2527
|
-
/** Transforms an array value via a remove operation. */ class
|
|
2527
|
+
/** Transforms an array value via a remove operation. */ class bn extends _n {
|
|
2528
2528
|
constructor(t) {
|
|
2529
2529
|
super(), this.elements = t;
|
|
2530
2530
|
}
|
|
@@ -2772,9 +2772,9 @@ function qn(t, n) {
|
|
|
2772
2772
|
}
|
|
2773
2773
|
|
|
2774
2774
|
function On(t) {
|
|
2775
|
-
return
|
|
2775
|
+
return b(!!t), bt.fromTimestamp(function(t) {
|
|
2776
2776
|
const n = Vt(t);
|
|
2777
|
-
return new
|
|
2777
|
+
return new vt(n.seconds, n.nanos);
|
|
2778
2778
|
}(t));
|
|
2779
2779
|
}
|
|
2780
2780
|
|
|
@@ -2791,11 +2791,11 @@ function Ln(t, n) {
|
|
|
2791
2791
|
function kn(t, n) {
|
|
2792
2792
|
const e = function(t) {
|
|
2793
2793
|
const n = Z.fromString(t);
|
|
2794
|
-
return
|
|
2794
|
+
return b(Kn(n)), n;
|
|
2795
2795
|
}(n);
|
|
2796
2796
|
if (e.get(1) !== t.databaseId.projectId) throw new U(R, "Tried to deserialize key from different project: " + e.get(1) + " vs " + t.databaseId.projectId);
|
|
2797
2797
|
if (e.get(3) !== t.databaseId.database) throw new U(R, "Tried to deserialize key from different database: " + e.get(3) + " vs " + t.databaseId.database);
|
|
2798
|
-
return new et((
|
|
2798
|
+
return new et((b((r = e).length > 4 && "documents" === r.get(4)), r.popFirst(5)));
|
|
2799
2799
|
var r;
|
|
2800
2800
|
/** Creates a Document proto from key and fields (but no create/update time) */}
|
|
2801
2801
|
|
|
@@ -2816,7 +2816,7 @@ function Mn(t, n, e) {
|
|
|
2816
2816
|
|
|
2817
2817
|
function Bn(t, n) {
|
|
2818
2818
|
return "found" in n ? function(t, n) {
|
|
2819
|
-
|
|
2819
|
+
b(!!n.found), n.found.name, n.found.updateTime;
|
|
2820
2820
|
const e = kn(t, n.found.name), r = On(n.found.updateTime), s = new Gt({
|
|
2821
2821
|
mapValue: {
|
|
2822
2822
|
fields: n.found.fields
|
|
@@ -2824,10 +2824,10 @@ function Bn(t, n) {
|
|
|
2824
2824
|
});
|
|
2825
2825
|
return Qt.newFoundDocument(e, r, s);
|
|
2826
2826
|
}(t, n) : "missing" in n ? function(t, n) {
|
|
2827
|
-
|
|
2827
|
+
b(!!n.missing), b(!!n.readTime);
|
|
2828
2828
|
const e = kn(t, n.missing), r = On(n.readTime);
|
|
2829
2829
|
return Qt.newNoDocument(e, r);
|
|
2830
|
-
}(t, n) :
|
|
2830
|
+
}(t, n) : v();
|
|
2831
2831
|
}
|
|
2832
2832
|
|
|
2833
2833
|
function zn(t, n) {
|
|
@@ -2840,7 +2840,7 @@ function zn(t, n) {
|
|
|
2840
2840
|
update: Mn(t, n.key, n.data),
|
|
2841
2841
|
updateMask: Hn(n.fieldMask)
|
|
2842
2842
|
}; else {
|
|
2843
|
-
if (!(n instanceof Nn)) return
|
|
2843
|
+
if (!(n instanceof Nn)) return v();
|
|
2844
2844
|
e = {
|
|
2845
2845
|
verify: Ln(t, n.key)
|
|
2846
2846
|
};
|
|
@@ -2851,13 +2851,13 @@ function zn(t, n) {
|
|
|
2851
2851
|
fieldPath: n.field.canonicalString(),
|
|
2852
2852
|
setToServerValue: "REQUEST_TIME"
|
|
2853
2853
|
};
|
|
2854
|
-
if (e instanceof
|
|
2854
|
+
if (e instanceof vn) return {
|
|
2855
2855
|
fieldPath: n.field.canonicalString(),
|
|
2856
2856
|
appendMissingElements: {
|
|
2857
2857
|
values: e.elements
|
|
2858
2858
|
}
|
|
2859
2859
|
};
|
|
2860
|
-
if (e instanceof
|
|
2860
|
+
if (e instanceof bn) return {
|
|
2861
2861
|
fieldPath: n.field.canonicalString(),
|
|
2862
2862
|
removeAllFromArray: {
|
|
2863
2863
|
values: e.elements
|
|
@@ -2867,13 +2867,13 @@ function zn(t, n) {
|
|
|
2867
2867
|
fieldPath: n.field.canonicalString(),
|
|
2868
2868
|
increment: e.O
|
|
2869
2869
|
};
|
|
2870
|
-
throw
|
|
2870
|
+
throw v();
|
|
2871
2871
|
}(0, t)))), n.precondition.isNone || (e.currentDocument = function(t, n) {
|
|
2872
2872
|
return void 0 !== n.updateTime ? {
|
|
2873
2873
|
updateTime: qn(t, n.updateTime)
|
|
2874
2874
|
} : void 0 !== n.exists ? {
|
|
2875
2875
|
exists: n.exists
|
|
2876
|
-
} :
|
|
2876
|
+
} : v();
|
|
2877
2877
|
}(t, n.precondition)), e;
|
|
2878
2878
|
}
|
|
2879
2879
|
|
|
@@ -3182,7 +3182,7 @@ async function ne(t, n) {
|
|
|
3182
3182
|
const u = [];
|
|
3183
3183
|
return n.forEach((t => {
|
|
3184
3184
|
const n = o.get(t.toString());
|
|
3185
|
-
|
|
3185
|
+
b(!!n), u.push(n);
|
|
3186
3186
|
})), u;
|
|
3187
3187
|
}
|
|
3188
3188
|
|
|
@@ -3354,7 +3354,7 @@ class ie {
|
|
|
3354
3354
|
case "gapi":
|
|
3355
3355
|
const n = t.client;
|
|
3356
3356
|
// Make sure this really is a Gapi client.
|
|
3357
|
-
return
|
|
3357
|
+
return b(!("object" != typeof n || null === n || !n.auth || !n.auth.getAuthHeaderValueForFirstParty)),
|
|
3358
3358
|
new W(n, t.sessionIndex || "0", t.iamToken || null);
|
|
3359
3359
|
|
|
3360
3360
|
case "provider":
|
|
@@ -3719,7 +3719,7 @@ function pe(t, n, ...e) {
|
|
|
3719
3719
|
/**
|
|
3720
3720
|
* Returns a special sentinel `FieldPath` to refer to the ID of a document.
|
|
3721
3721
|
* It can be used in queries to sort or filter by the document ID.
|
|
3722
|
-
*/ function
|
|
3722
|
+
*/ function ve() {
|
|
3723
3723
|
return new ge("__name__");
|
|
3724
3724
|
}
|
|
3725
3725
|
|
|
@@ -3741,7 +3741,7 @@ function pe(t, n, ...e) {
|
|
|
3741
3741
|
*/
|
|
3742
3742
|
/**
|
|
3743
3743
|
* An immutable object representing an array of bytes.
|
|
3744
|
-
*/ class
|
|
3744
|
+
*/ class be {
|
|
3745
3745
|
/** @hideconstructor */
|
|
3746
3746
|
constructor(t) {
|
|
3747
3747
|
this._byteString = t;
|
|
@@ -3753,7 +3753,7 @@ function pe(t, n, ...e) {
|
|
|
3753
3753
|
* @param base64 - The Base64 string used to create the `Bytes` object.
|
|
3754
3754
|
*/ static fromBase64String(t) {
|
|
3755
3755
|
try {
|
|
3756
|
-
return new
|
|
3756
|
+
return new be(Rt.fromBase64String(t));
|
|
3757
3757
|
} catch (t) {
|
|
3758
3758
|
throw new U(R, "Failed to construct data from Base64 string: " + t);
|
|
3759
3759
|
}
|
|
@@ -3763,7 +3763,7 @@ function pe(t, n, ...e) {
|
|
|
3763
3763
|
*
|
|
3764
3764
|
* @param array - The Uint8Array used to create the `Bytes` object.
|
|
3765
3765
|
*/ static fromUint8Array(t) {
|
|
3766
|
-
return new
|
|
3766
|
+
return new be(Rt.fromUint8Array(t));
|
|
3767
3767
|
}
|
|
3768
3768
|
/**
|
|
3769
3769
|
* Returns the underlying bytes as a Base64-encoded string.
|
|
@@ -3942,7 +3942,7 @@ function Pe(t) {
|
|
|
3942
3942
|
return !1;
|
|
3943
3943
|
|
|
3944
3944
|
default:
|
|
3945
|
-
throw
|
|
3945
|
+
throw v();
|
|
3946
3946
|
}
|
|
3947
3947
|
}
|
|
3948
3948
|
|
|
@@ -4113,7 +4113,7 @@ class qe extends Ee {
|
|
|
4113
4113
|
}
|
|
4114
4114
|
_toFieldTransform(t) {
|
|
4115
4115
|
const n = Fe(this, t,
|
|
4116
|
-
/*array=*/ !0), e = this.lt.map((t => je(t, n))), r = new
|
|
4116
|
+
/*array=*/ !0), e = this.lt.map((t => je(t, n))), r = new vn(e);
|
|
4117
4117
|
return new Tn(t.path, r);
|
|
4118
4118
|
}
|
|
4119
4119
|
isEqual(t) {
|
|
@@ -4128,7 +4128,7 @@ class Oe extends Ee {
|
|
|
4128
4128
|
}
|
|
4129
4129
|
_toFieldTransform(t) {
|
|
4130
4130
|
const n = Fe(this, t,
|
|
4131
|
-
/*array=*/ !0), e = this.lt.map((t => je(t, n))), r = new
|
|
4131
|
+
/*array=*/ !0), e = this.lt.map((t => je(t, n))), r = new bn(e);
|
|
4132
4132
|
return new Tn(t.path, r);
|
|
4133
4133
|
}
|
|
4134
4134
|
isEqual(t) {
|
|
@@ -4289,16 +4289,16 @@ class Ce extends Ee {
|
|
|
4289
4289
|
stringValue: t
|
|
4290
4290
|
};
|
|
4291
4291
|
if (t instanceof Date) {
|
|
4292
|
-
const e =
|
|
4292
|
+
const e = vt.fromDate(t);
|
|
4293
4293
|
return {
|
|
4294
4294
|
timestampValue: Fn(n.q, e)
|
|
4295
4295
|
};
|
|
4296
4296
|
}
|
|
4297
|
-
if (t instanceof
|
|
4297
|
+
if (t instanceof vt) {
|
|
4298
4298
|
// Firestore backend truncates precision down to microseconds. To ensure
|
|
4299
4299
|
// offline mode works the same with regards to truncation, perform the
|
|
4300
4300
|
// truncation immediately without waiting for the backend to do that.
|
|
4301
|
-
const e = new
|
|
4301
|
+
const e = new vt(t.seconds, 1e3 * Math.floor(t.nanoseconds / 1e3));
|
|
4302
4302
|
return {
|
|
4303
4303
|
timestampValue: Fn(n.q, e)
|
|
4304
4304
|
};
|
|
@@ -4309,7 +4309,7 @@ class Ce extends Ee {
|
|
|
4309
4309
|
longitude: t.longitude
|
|
4310
4310
|
}
|
|
4311
4311
|
};
|
|
4312
|
-
if (t instanceof
|
|
4312
|
+
if (t instanceof be) return {
|
|
4313
4313
|
bytesValue: xn(n.q, t._byteString)
|
|
4314
4314
|
};
|
|
4315
4315
|
if (t instanceof le) {
|
|
@@ -4349,7 +4349,7 @@ function Me(t, n) {
|
|
|
4349
4349
|
}
|
|
4350
4350
|
|
|
4351
4351
|
function Be(t) {
|
|
4352
|
-
return !("object" != typeof t || null === t || t instanceof Array || t instanceof Date || t instanceof
|
|
4352
|
+
return !("object" != typeof t || null === t || t instanceof Array || t instanceof Date || t instanceof vt || t instanceof Te || t instanceof be || t instanceof le || t instanceof Ee);
|
|
4353
4353
|
}
|
|
4354
4354
|
|
|
4355
4355
|
function ze(t, n, e) {
|
|
@@ -4751,12 +4751,12 @@ class ir extends nr {
|
|
|
4751
4751
|
|
|
4752
4752
|
class ur extends nr {
|
|
4753
4753
|
constructor(t, n, e) {
|
|
4754
|
-
super(), this.type = t, this.gt = n, this.
|
|
4754
|
+
super(), this.type = t, this.gt = n, this.vt = e;
|
|
4755
4755
|
}
|
|
4756
4756
|
_apply(t) {
|
|
4757
4757
|
return new fe(t.firestore, t.converter, function(t, n, e) {
|
|
4758
4758
|
return new an(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), n, e, t.startAt, t.endAt);
|
|
4759
|
-
}(t._query, this.gt, this.
|
|
4759
|
+
}(t._query, this.gt, this.vt));
|
|
4760
4760
|
}
|
|
4761
4761
|
}
|
|
4762
4762
|
|
|
@@ -4783,10 +4783,10 @@ class ur extends nr {
|
|
|
4783
4783
|
|
|
4784
4784
|
class hr extends nr {
|
|
4785
4785
|
constructor(t, n, e) {
|
|
4786
|
-
super(), this.type = t, this.
|
|
4786
|
+
super(), this.type = t, this.bt = n, this.Et = e;
|
|
4787
4787
|
}
|
|
4788
4788
|
_apply(t) {
|
|
4789
|
-
const n = pr(t, this.type, this.
|
|
4789
|
+
const n = pr(t, this.type, this.bt, this.Et);
|
|
4790
4790
|
return new fe(t.firestore, t.converter, function(t, n) {
|
|
4791
4791
|
return new an(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), t.limit, t.limitType, n, t.endAt);
|
|
4792
4792
|
}(t._query, n));
|
|
@@ -4805,10 +4805,10 @@ function fr(...t) {
|
|
|
4805
4805
|
|
|
4806
4806
|
class dr extends nr {
|
|
4807
4807
|
constructor(t, n, e) {
|
|
4808
|
-
super(), this.type = t, this.
|
|
4808
|
+
super(), this.type = t, this.bt = n, this.Et = e;
|
|
4809
4809
|
}
|
|
4810
4810
|
_apply(t) {
|
|
4811
|
-
const n = pr(t, this.type, this.
|
|
4811
|
+
const n = pr(t, this.type, this.bt, this.Et);
|
|
4812
4812
|
return new fe(t.firestore, t.converter, function(t, n) {
|
|
4813
4813
|
return new an(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), t.limit, t.limitType, t.startAt, n);
|
|
4814
4814
|
}(t._query, n));
|
|
@@ -4951,7 +4951,7 @@ function gr(t, n, e) {
|
|
|
4951
4951
|
* their `set()` or fails due to invalid data originating from a `toFirestore()`
|
|
4952
4952
|
* call.
|
|
4953
4953
|
*/
|
|
4954
|
-
function
|
|
4954
|
+
function vr(t, n, e) {
|
|
4955
4955
|
let r;
|
|
4956
4956
|
// Cast to `any` in order to satisfy the union type constraint on
|
|
4957
4957
|
// toFirestore().
|
|
@@ -4960,7 +4960,7 @@ function br(t, n, e) {
|
|
|
4960
4960
|
r;
|
|
4961
4961
|
}
|
|
4962
4962
|
|
|
4963
|
-
class
|
|
4963
|
+
class br extends class {
|
|
4964
4964
|
convertValue(t, n = "none") {
|
|
4965
4965
|
switch (xt(t)) {
|
|
4966
4966
|
case 0 /* NullValue */ :
|
|
@@ -4997,7 +4997,7 @@ class vr extends class {
|
|
|
4997
4997
|
return this.convertObject(t.mapValue, n);
|
|
4998
4998
|
|
|
4999
4999
|
default:
|
|
5000
|
-
throw
|
|
5000
|
+
throw v();
|
|
5001
5001
|
}
|
|
5002
5002
|
}
|
|
5003
5003
|
convertObject(t, n) {
|
|
@@ -5027,11 +5027,11 @@ class vr extends class {
|
|
|
5027
5027
|
}
|
|
5028
5028
|
convertTimestamp(t) {
|
|
5029
5029
|
const n = Vt(t);
|
|
5030
|
-
return new
|
|
5030
|
+
return new vt(n.seconds, n.nanos);
|
|
5031
5031
|
}
|
|
5032
5032
|
convertDocumentKey(t, n) {
|
|
5033
5033
|
const e = Z.fromString(t);
|
|
5034
|
-
|
|
5034
|
+
b(Kn(e));
|
|
5035
5035
|
const r = new J(e.get(1), e.get(3)), s = new et(e.popFirst(5));
|
|
5036
5036
|
return r.isEqual(n) ||
|
|
5037
5037
|
// TODO(b/64130202): Somehow support foreign references.
|
|
@@ -5043,7 +5043,7 @@ class vr extends class {
|
|
|
5043
5043
|
super(), this.firestore = t;
|
|
5044
5044
|
}
|
|
5045
5045
|
convertBytes(t) {
|
|
5046
|
-
return new
|
|
5046
|
+
return new be(t);
|
|
5047
5047
|
}
|
|
5048
5048
|
convertReference(t) {
|
|
5049
5049
|
const n = this.convertDocumentKey(t, this.firestore._databaseId);
|
|
@@ -5064,9 +5064,9 @@ class vr extends class {
|
|
|
5064
5064
|
* @returns A Promise resolved with a `DocumentSnapshot` containing the current
|
|
5065
5065
|
* document contents.
|
|
5066
5066
|
*/ function Er(t) {
|
|
5067
|
-
const n = se((t = ut(t, le)).firestore), e = new
|
|
5067
|
+
const n = se((t = ut(t, le)).firestore), e = new br(t.firestore);
|
|
5068
5068
|
return ne(n, [ t._key ]).then((n => {
|
|
5069
|
-
|
|
5069
|
+
b(1 === n.length);
|
|
5070
5070
|
const r = n[0];
|
|
5071
5071
|
return new Ke(t.firestore, e, t._key, r.isFoundDocument() ? r : null, t.converter);
|
|
5072
5072
|
}));
|
|
@@ -5087,7 +5087,7 @@ class vr extends class {
|
|
|
5087
5087
|
!function(t) {
|
|
5088
5088
|
if (hn(t) && 0 === t.explicitOrderBy.length) throw new U(O, "limitToLast() queries require specifying at least one orderBy() clause");
|
|
5089
5089
|
}((t = ut(t, fe))._query);
|
|
5090
|
-
const n = se(t.firestore), e = new
|
|
5090
|
+
const n = se(t.firestore), e = new br(t.firestore);
|
|
5091
5091
|
return ee(n, t._query).then((n => {
|
|
5092
5092
|
const r = n.map((n => new Je(t.firestore, e, n.key, n, t.converter)));
|
|
5093
5093
|
return hn(t._query) &&
|
|
@@ -5099,7 +5099,7 @@ class vr extends class {
|
|
|
5099
5099
|
}
|
|
5100
5100
|
|
|
5101
5101
|
function Ir(t, n, e) {
|
|
5102
|
-
const r =
|
|
5102
|
+
const r = vr((t = ut(t, le)).converter, n, e), s = $e(De(t.firestore), "setDoc", t._key, r, null !== t.converter, e);
|
|
5103
5103
|
return te(se(t.firestore), [ s.toMutation(t._key, In.none()) ]);
|
|
5104
5104
|
}
|
|
5105
5105
|
|
|
@@ -5142,7 +5142,7 @@ function Ar(t, n, e, ...r) {
|
|
|
5142
5142
|
* @returns A `Promise` resolved with a `DocumentReference` pointing to the
|
|
5143
5143
|
* newly created document after it has been written to the backend.
|
|
5144
5144
|
*/ function Pr(t, n) {
|
|
5145
|
-
const e = pe(t = ut(t, de)), r =
|
|
5145
|
+
const e = pe(t = ut(t, de)), r = vr(t.converter, n), s = $e(De(t.firestore), "addDoc", e._key, r, null !== e.converter, {});
|
|
5146
5146
|
return te(se(t.firestore), [ s.toMutation(e._key, In.exists(!1)) ]).then((() => e));
|
|
5147
5147
|
}
|
|
5148
5148
|
|
|
@@ -5262,7 +5262,7 @@ function Ar(t, n, e, ...r) {
|
|
|
5262
5262
|
}
|
|
5263
5263
|
set(t, n, e) {
|
|
5264
5264
|
this._verifyNotCommitted();
|
|
5265
|
-
const r = xr(t, this._firestore), s =
|
|
5265
|
+
const r = xr(t, this._firestore), s = vr(r.converter, n, e), i = $e(this._dataReader, "WriteBatch.set", r._key, s, null !== r.converter, e);
|
|
5266
5266
|
return this._mutations.push(i.toMutation(r._key, In.none())), this;
|
|
5267
5267
|
}
|
|
5268
5268
|
update(t, n, e, ...r) {
|
|
@@ -5398,9 +5398,9 @@ function xr(t, n) {
|
|
|
5398
5398
|
recordVersion(t) {
|
|
5399
5399
|
let n;
|
|
5400
5400
|
if (t.isFoundDocument()) n = t.version; else {
|
|
5401
|
-
if (!t.isNoDocument()) throw
|
|
5401
|
+
if (!t.isNoDocument()) throw v();
|
|
5402
5402
|
// For deleted docs, we must use baseVersion 0 when we overwrite them.
|
|
5403
|
-
n =
|
|
5403
|
+
n = bt.min();
|
|
5404
5404
|
}
|
|
5405
5405
|
const e = this.readVersions.get(t.key.toString());
|
|
5406
5406
|
if (e) {
|
|
@@ -5423,7 +5423,7 @@ function xr(t, n) {
|
|
|
5423
5423
|
// The first time a document is written, we want to take into account the
|
|
5424
5424
|
// read time and existence
|
|
5425
5425
|
if (!this.writtenDocs.has(t.toString()) && n) {
|
|
5426
|
-
if (n.isEqual(
|
|
5426
|
+
if (n.isEqual(bt.min()))
|
|
5427
5427
|
// The document doesn't exist, so fail the transaction.
|
|
5428
5428
|
// This has to be validated locally because you can't send a
|
|
5429
5429
|
// precondition that a document does not exist without changing the
|
|
@@ -5518,7 +5518,7 @@ class Cr {
|
|
|
5518
5518
|
function(t) {
|
|
5519
5519
|
switch (t) {
|
|
5520
5520
|
default:
|
|
5521
|
-
return
|
|
5521
|
+
return v();
|
|
5522
5522
|
|
|
5523
5523
|
case I:
|
|
5524
5524
|
case A:
|
|
@@ -5859,7 +5859,7 @@ class Cr {
|
|
|
5859
5859
|
return this.St.push(r), r;
|
|
5860
5860
|
}
|
|
5861
5861
|
Lt() {
|
|
5862
|
-
this.Ft &&
|
|
5862
|
+
this.Ft && v();
|
|
5863
5863
|
}
|
|
5864
5864
|
verifyOperationInProgress() {}
|
|
5865
5865
|
/**
|
|
@@ -5920,17 +5920,17 @@ class jr {
|
|
|
5920
5920
|
* @param documentRef - A reference to the document to be read.
|
|
5921
5921
|
* @returns A `DocumentSnapshot` with the read data.
|
|
5922
5922
|
*/ get(t) {
|
|
5923
|
-
const n = xr(t, this._firestore), e = new
|
|
5923
|
+
const n = xr(t, this._firestore), e = new br(this._firestore);
|
|
5924
5924
|
return this._transaction.lookup([ n._key ]).then((t => {
|
|
5925
|
-
if (!t || 1 !== t.length) return
|
|
5925
|
+
if (!t || 1 !== t.length) return v();
|
|
5926
5926
|
const r = t[0];
|
|
5927
5927
|
if (r.isFoundDocument()) return new Ke(this._firestore, e, r.key, r, n.converter);
|
|
5928
5928
|
if (r.isNoDocument()) return new Ke(this._firestore, e, n._key, null, n.converter);
|
|
5929
|
-
throw
|
|
5929
|
+
throw v();
|
|
5930
5930
|
}));
|
|
5931
5931
|
}
|
|
5932
5932
|
set(t, n, e) {
|
|
5933
|
-
const r = xr(t, this._firestore), s =
|
|
5933
|
+
const r = xr(t, this._firestore), s = vr(r.converter, n, e), i = $e(this._dataReader, "Transaction.set", r._key, s, null !== r.converter, e);
|
|
5934
5934
|
return this._transaction.set(r._key, i), this;
|
|
5935
5935
|
}
|
|
5936
5936
|
update(t, n, e, ...r) {
|
|
@@ -5987,7 +5987,7 @@ class jr {
|
|
|
5987
5987
|
return n && r._setSettings(n), r;
|
|
5988
5988
|
}), "PUBLIC")),
|
|
5989
5989
|
// RUNTIME_ENV and BUILD_TARGET are replaced by real values during the compilation
|
|
5990
|
-
r("firestore-lite", "3.4.5-canary.
|
|
5990
|
+
r("firestore-lite", "3.4.5-canary.2d672cead", "rn"), r("firestore-lite", "3.4.5-canary.2d672cead", "esm2017");
|
|
5991
5991
|
|
|
5992
|
-
export {
|
|
5992
|
+
export { be as Bytes, de as CollectionReference, le as DocumentReference, Ke as DocumentSnapshot, ge as FieldPath, Ee as FieldValue, oe as Firestore, U as FirestoreError, Te as GeoPoint, fe as Query, nr as QueryConstraint, Je as QueryDocumentSnapshot, Xe as QuerySnapshot, vt as Timestamp, jr as Transaction, Fr as WriteBatch, Pr as addDoc, $r as arrayRemove, Dr as arrayUnion, we as collection, me as collectionGroup, ae as connectFirestoreEmulator, Rr as deleteDoc, Vr as deleteField, pe as doc, ve as documentId, mr as endAt, wr as endBefore, Er as getDoc, Tr as getDocs, ce as getFirestore, Sr as increment, ue as initializeFirestore, cr as limit, ar as limitToLast, or as orderBy, er as query, _e as queryEqual, ye as refEqual, Mr as runTransaction, Nr as serverTimestamp, Ir as setDoc, m as setLogLevel, Ze as snapshotEqual, fr as startAfter, lr as startAt, he as terminate, Ar as updateDoc, sr as where, qr as writeBatch };
|
|
5993
5993
|
//# sourceMappingURL=index.rn.esm2017.js.map
|