@firebase/firestore 3.4.3 → 3.4.4-canary.0482aa5b7
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 +10 -0
- package/dist/firestore/src/api/database.d.ts +14 -9
- package/dist/firestore/src/api/{query.d.ts → filter.d.ts} +0 -0
- package/dist/firestore/src/api/index_configuration.d.ts +117 -0
- package/dist/firestore/src/api/snapshot.d.ts +1 -2
- package/dist/firestore/src/api.d.ts +2 -1
- package/dist/firestore/src/core/database_info.d.ts +1 -0
- package/dist/firestore/src/core/firestore_client.d.ts +2 -0
- package/dist/firestore/src/core/target.d.ts +34 -5
- package/dist/firestore/src/lite-api/query.d.ts +2 -2
- package/dist/firestore/src/local/index_manager.d.ts +52 -0
- package/dist/firestore/src/local/indexeddb_index_manager.d.ts +11 -0
- package/dist/firestore/src/local/indexeddb_schema.d.ts +121 -7
- package/dist/firestore/src/local/local_serializer.d.ts +1 -1
- package/dist/firestore/src/local/memory_index_manager.d.ts +11 -0
- package/dist/firestore/src/local/remote_document_change_buffer.d.ts +3 -12
- package/dist/firestore/src/model/document.d.ts +7 -0
- package/dist/firestore/src/model/document_key.d.ts +1 -0
- package/dist/firestore/src/model/field_index.d.ts +156 -0
- package/dist/firestore/src/model/values.d.ts +7 -0
- package/dist/firestore/test/integration/api/index_configuration.test.d.ts +17 -0
- package/dist/firestore/test/unit/local/test_remote_document_cache.d.ts +1 -1
- package/dist/firestore/test/unit/model/field_index.test.d.ts +17 -0
- package/dist/firestore/test/unit/model/target.test.d.ts +17 -0
- package/dist/firestore/test/util/helpers.d.ts +8 -2
- package/dist/index.d.ts +16 -11
- package/dist/index.esm2017.js +2979 -2671
- package/dist/index.esm2017.js.map +1 -1
- package/dist/index.esm5.js +3036 -2815
- package/dist/index.esm5.js.map +1 -1
- package/dist/index.node.cjs.js +644 -235
- package/dist/index.node.cjs.js.map +1 -1
- package/dist/index.node.mjs +644 -236
- package/dist/index.node.mjs.map +1 -1
- package/dist/index.rn.js +2761 -2449
- package/dist/index.rn.js.map +1 -1
- package/dist/internal.d.ts +303 -25
- package/dist/lite/firestore/src/api/database.d.ts +14 -9
- package/dist/lite/firestore/src/api/{query.d.ts → filter.d.ts} +0 -0
- package/dist/lite/firestore/src/api/index_configuration.d.ts +117 -0
- package/dist/lite/firestore/src/api/snapshot.d.ts +1 -2
- package/dist/lite/firestore/src/api.d.ts +2 -1
- package/dist/lite/firestore/src/core/database_info.d.ts +1 -0
- package/dist/lite/firestore/src/core/firestore_client.d.ts +2 -0
- package/dist/lite/firestore/src/core/target.d.ts +34 -5
- package/dist/lite/firestore/src/lite-api/query.d.ts +2 -2
- package/dist/lite/firestore/src/local/index_manager.d.ts +52 -0
- package/dist/lite/firestore/src/local/indexeddb_index_manager.d.ts +11 -0
- package/dist/lite/firestore/src/local/indexeddb_schema.d.ts +121 -7
- package/dist/lite/firestore/src/local/local_serializer.d.ts +1 -1
- package/dist/lite/firestore/src/local/memory_index_manager.d.ts +11 -0
- package/dist/lite/firestore/src/local/remote_document_change_buffer.d.ts +3 -12
- package/dist/lite/firestore/src/model/document.d.ts +7 -0
- package/dist/lite/firestore/src/model/document_key.d.ts +1 -0
- package/dist/lite/firestore/src/model/field_index.d.ts +156 -0
- package/dist/lite/firestore/src/model/values.d.ts +7 -0
- package/dist/lite/firestore/test/integration/api/index_configuration.test.d.ts +17 -0
- package/dist/lite/firestore/test/unit/local/test_remote_document_cache.d.ts +1 -1
- package/dist/lite/firestore/test/unit/model/field_index.test.d.ts +17 -0
- package/dist/lite/firestore/test/unit/model/target.test.d.ts +17 -0
- package/dist/lite/firestore/test/util/helpers.d.ts +8 -2
- package/dist/lite/index.browser.esm2017.js +352 -338
- package/dist/lite/index.browser.esm2017.js.map +1 -1
- package/dist/lite/index.browser.esm5.js +334 -326
- package/dist/lite/index.browser.esm5.js.map +1 -1
- package/dist/lite/index.node.cjs.js +53 -34
- package/dist/lite/index.node.cjs.js.map +1 -1
- package/dist/lite/index.node.mjs +53 -34
- package/dist/lite/index.node.mjs.map +1 -1
- package/dist/lite/index.rn.esm2017.js +318 -304
- package/dist/lite/index.rn.esm2017.js.map +1 -1
- package/dist/lite/internal.d.ts +11 -2
- package/dist/lite/packages/firestore/dist/lite/index.browser.esm2017.d.ts +98 -97
- package/dist/lite/packages/firestore/src/api/database.d.ts +14 -9
- package/dist/lite/packages/firestore/src/api/{query.d.ts → filter.d.ts} +0 -0
- package/dist/lite/packages/firestore/src/api/index_configuration.d.ts +117 -0
- package/dist/lite/packages/firestore/src/api/snapshot.d.ts +1 -2
- package/dist/lite/packages/firestore/src/api.d.ts +2 -1
- package/dist/lite/packages/firestore/src/core/database_info.d.ts +1 -0
- package/dist/lite/packages/firestore/src/core/firestore_client.d.ts +2 -0
- package/dist/lite/packages/firestore/src/core/target.d.ts +34 -5
- package/dist/lite/packages/firestore/src/lite-api/query.d.ts +2 -2
- package/dist/lite/packages/firestore/src/local/index_manager.d.ts +52 -0
- package/dist/lite/packages/firestore/src/local/indexeddb_index_manager.d.ts +11 -0
- package/dist/lite/packages/firestore/src/local/indexeddb_schema.d.ts +121 -7
- package/dist/lite/packages/firestore/src/local/local_serializer.d.ts +1 -1
- package/dist/lite/packages/firestore/src/local/memory_index_manager.d.ts +11 -0
- package/dist/lite/packages/firestore/src/local/remote_document_change_buffer.d.ts +3 -12
- package/dist/lite/packages/firestore/src/model/document.d.ts +7 -0
- package/dist/lite/packages/firestore/src/model/document_key.d.ts +1 -0
- package/dist/lite/packages/firestore/src/model/field_index.d.ts +156 -0
- package/dist/lite/packages/firestore/src/model/values.d.ts +7 -0
- package/dist/lite/packages/firestore/test/integration/api/index_configuration.test.d.ts +17 -0
- package/dist/lite/packages/firestore/test/unit/local/test_remote_document_cache.d.ts +1 -1
- package/dist/lite/packages/firestore/test/unit/model/field_index.test.d.ts +17 -0
- package/dist/lite/packages/firestore/test/unit/model/target.test.d.ts +17 -0
- package/dist/lite/packages/firestore/test/util/helpers.d.ts +8 -2
- package/dist/lite/private.d.ts +9 -2
- package/dist/packages/firestore/dist/index.esm2017.d.ts +214 -191
- package/dist/packages/firestore/src/api/database.d.ts +14 -9
- package/dist/packages/firestore/src/api/{query.d.ts → filter.d.ts} +0 -0
- package/dist/packages/firestore/src/api/index_configuration.d.ts +117 -0
- package/dist/packages/firestore/src/api/snapshot.d.ts +1 -2
- package/dist/packages/firestore/src/api.d.ts +2 -1
- package/dist/packages/firestore/src/core/database_info.d.ts +1 -0
- package/dist/packages/firestore/src/core/firestore_client.d.ts +2 -0
- package/dist/packages/firestore/src/core/target.d.ts +34 -5
- package/dist/packages/firestore/src/lite-api/query.d.ts +2 -2
- package/dist/packages/firestore/src/local/index_manager.d.ts +52 -0
- package/dist/packages/firestore/src/local/indexeddb_index_manager.d.ts +11 -0
- package/dist/packages/firestore/src/local/indexeddb_schema.d.ts +121 -7
- package/dist/packages/firestore/src/local/local_serializer.d.ts +1 -1
- package/dist/packages/firestore/src/local/memory_index_manager.d.ts +11 -0
- package/dist/packages/firestore/src/local/remote_document_change_buffer.d.ts +3 -12
- package/dist/packages/firestore/src/model/document.d.ts +7 -0
- package/dist/packages/firestore/src/model/document_key.d.ts +1 -0
- package/dist/packages/firestore/src/model/field_index.d.ts +156 -0
- package/dist/packages/firestore/src/model/values.d.ts +7 -0
- package/dist/packages/firestore/test/integration/api/index_configuration.test.d.ts +17 -0
- package/dist/packages/firestore/test/unit/local/test_remote_document_cache.d.ts +1 -1
- package/dist/packages/firestore/test/unit/model/field_index.test.d.ts +17 -0
- package/dist/packages/firestore/test/unit/model/target.test.d.ts +17 -0
- package/dist/packages/firestore/test/util/helpers.d.ts +8 -2
- package/dist/private.d.ts +205 -25
- package/package.json +10 -10
|
@@ -67,7 +67,7 @@ m.MOCK_USER = new m("mock-user");
|
|
|
67
67
|
* See the License for the specific language governing permissions and
|
|
68
68
|
* limitations under the License.
|
|
69
69
|
*/
|
|
70
|
-
var y = "9.6.
|
|
70
|
+
var y = "9.6.5-canary.0482aa5b7", v = new l("@firebase/firestore");
|
|
71
71
|
|
|
72
72
|
/**
|
|
73
73
|
* @license
|
|
@@ -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 A = "cancelled", k = "unknown", V = "invalid-argument", D = "deadline-exceeded",
|
|
228
|
+
*/ var A = "cancelled", k = "unknown", V = "invalid-argument", D = "deadline-exceeded", P = "not-found", N = "permission-denied", q = "unauthenticated", F = "resource-exhausted", O = "failed-precondition", C = "aborted", j = "out-of-range", L = "unimplemented", R = "internal", M = "unavailable", U = /** @class */ function(e) {
|
|
229
229
|
/** @hideconstructor */
|
|
230
230
|
function n(
|
|
231
231
|
/**
|
|
@@ -356,7 +356,9 @@ function(t, e, n, r, i, o, a, s) {
|
|
|
356
356
|
function t(t, e) {
|
|
357
357
|
this.projectId = t, this.database = e || "(default)";
|
|
358
358
|
}
|
|
359
|
-
return
|
|
359
|
+
return t.empty = function() {
|
|
360
|
+
return new t("", "");
|
|
361
|
+
}, Object.defineProperty(t.prototype, "isDefaultDatabase", {
|
|
360
362
|
get: function() {
|
|
361
363
|
return "(default)" === this.database;
|
|
362
364
|
},
|
|
@@ -523,6 +525,8 @@ function(t, e, n, r, i, o, a, s) {
|
|
|
523
525
|
return new t(Z.fromString(e));
|
|
524
526
|
}, t.fromName = function(e) {
|
|
525
527
|
return new t(Z.fromString(e).popFirst(5));
|
|
528
|
+
}, t.empty = function() {
|
|
529
|
+
return new t(Z.emptyPath());
|
|
526
530
|
},
|
|
527
531
|
/** Returns true if the document is in the specified collectionId. */ t.prototype.hasCollectionId = function(t) {
|
|
528
532
|
return this.path.length >= 2 && this.path.get(this.path.length - 2) === t;
|
|
@@ -741,11 +745,11 @@ function dt(t) {
|
|
|
741
745
|
|
|
742
746
|
case 403:
|
|
743
747
|
// Forbidden
|
|
744
|
-
return
|
|
748
|
+
return N;
|
|
745
749
|
|
|
746
750
|
case 404:
|
|
747
751
|
// Not Found
|
|
748
|
-
return
|
|
752
|
+
return P;
|
|
749
753
|
|
|
750
754
|
case 409:
|
|
751
755
|
// Conflict
|
|
@@ -1418,7 +1422,7 @@ var At = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
|
|
|
1418
1422
|
* FieldValueOptions to value().
|
|
1419
1423
|
* - With respect to other ServerTimestampValues, they sort by their
|
|
1420
1424
|
* localWriteTime.
|
|
1421
|
-
*/ function
|
|
1425
|
+
*/ function Pt(t) {
|
|
1422
1426
|
var e, n;
|
|
1423
1427
|
return "server_timestamp" === (null === (n = ((null === (e = null == t ? void 0 : t.mapValue) || void 0 === e ? void 0 : e.fields) || {}).__type__) || void 0 === n ? void 0 : n.stringValue);
|
|
1424
1428
|
}
|
|
@@ -1428,9 +1432,9 @@ var At = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
|
|
|
1428
1432
|
*
|
|
1429
1433
|
* Preserving the previous values allows the user to display the last resoled
|
|
1430
1434
|
* value until the backend responds with the timestamp.
|
|
1431
|
-
*/ function
|
|
1435
|
+
*/ function Nt(t) {
|
|
1432
1436
|
var e = t.mapValue.fields.__previous_value__;
|
|
1433
|
-
return
|
|
1437
|
+
return Pt(e) ? Nt(e) : e;
|
|
1434
1438
|
}
|
|
1435
1439
|
|
|
1436
1440
|
/**
|
|
@@ -1457,7 +1461,7 @@ var At = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
|
|
|
1457
1461
|
* limitations under the License.
|
|
1458
1462
|
*/
|
|
1459
1463
|
/** Extracts the backend's type order for the provided value. */ function Ft(t) {
|
|
1460
|
-
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 ?
|
|
1464
|
+
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 ? Pt(t) ? 4 /* ServerTimestampValue */ : 10 /* ObjectValue */ : S();
|
|
1461
1465
|
}
|
|
1462
1466
|
|
|
1463
1467
|
/** Tests `left` and `right` for equality based on the backend semantics. */ function Ot(t, e) {
|
|
@@ -1780,25 +1784,26 @@ function Rt(t, e) {
|
|
|
1780
1784
|
return new t(Gt(this.value));
|
|
1781
1785
|
}, t;
|
|
1782
1786
|
}(), Qt = /** @class */ function() {
|
|
1783
|
-
function t(t, e, n, r, i) {
|
|
1784
|
-
this.key = t, this.documentType = e, this.version = n, this.
|
|
1787
|
+
function t(t, e, n, r, i, o) {
|
|
1788
|
+
this.key = t, this.documentType = e, this.version = n, this.readTime = r, this.data = i,
|
|
1789
|
+
this.documentState = o
|
|
1785
1790
|
/**
|
|
1786
1791
|
* Creates a document with no known version or data, but which can serve as
|
|
1787
1792
|
* base document for mutations.
|
|
1788
1793
|
*/;
|
|
1789
1794
|
}
|
|
1790
1795
|
return t.newInvalidDocument = function(e) {
|
|
1791
|
-
return new t(e, 0 /* INVALID */ , _t.min(), zt.empty(), 0 /* SYNCED */);
|
|
1796
|
+
return new t(e, 0 /* INVALID */ , _t.min(), _t.min(), zt.empty(), 0 /* SYNCED */);
|
|
1792
1797
|
},
|
|
1793
1798
|
/**
|
|
1794
1799
|
* Creates a new document that is known to exist with the given data at the
|
|
1795
1800
|
* given version.
|
|
1796
1801
|
*/
|
|
1797
1802
|
t.newFoundDocument = function(e, n, r) {
|
|
1798
|
-
return new t(e, 1 /* FOUND_DOCUMENT */ , n, r, 0 /* SYNCED */);
|
|
1803
|
+
return new t(e, 1 /* FOUND_DOCUMENT */ , n, _t.min(), r, 0 /* SYNCED */);
|
|
1799
1804
|
},
|
|
1800
1805
|
/** Creates a new document that is known to not exist at the given version. */ t.newNoDocument = function(e, n) {
|
|
1801
|
-
return new t(e, 2 /* NO_DOCUMENT */ , n, zt.empty(), 0 /* SYNCED */);
|
|
1806
|
+
return new t(e, 2 /* NO_DOCUMENT */ , n, _t.min(), zt.empty(), 0 /* SYNCED */);
|
|
1802
1807
|
},
|
|
1803
1808
|
/**
|
|
1804
1809
|
* Creates a new document that is known to exist at the given version but
|
|
@@ -1806,7 +1811,7 @@ function Rt(t, e) {
|
|
|
1806
1811
|
* base document).
|
|
1807
1812
|
*/
|
|
1808
1813
|
t.newUnknownDocument = function(e, n) {
|
|
1809
|
-
return new t(e, 3 /* UNKNOWN_DOCUMENT */ , n, zt.empty(), 2 /* HAS_COMMITTED_MUTATIONS */);
|
|
1814
|
+
return new t(e, 3 /* UNKNOWN_DOCUMENT */ , n, _t.min(), zt.empty(), 2 /* HAS_COMMITTED_MUTATIONS */);
|
|
1810
1815
|
},
|
|
1811
1816
|
/**
|
|
1812
1817
|
* Changes the document type to indicate that it exists and that its version
|
|
@@ -1836,6 +1841,8 @@ function Rt(t, e) {
|
|
|
1836
1841
|
return this.documentState = 2 /* HAS_COMMITTED_MUTATIONS */ , this;
|
|
1837
1842
|
}, t.prototype.setHasLocalMutations = function() {
|
|
1838
1843
|
return this.documentState = 1 /* HAS_LOCAL_MUTATIONS */ , this;
|
|
1844
|
+
}, t.prototype.setReadTime = function(t) {
|
|
1845
|
+
return this.readTime = t, this;
|
|
1839
1846
|
}, Object.defineProperty(t.prototype, "hasLocalMutations", {
|
|
1840
1847
|
get: function() {
|
|
1841
1848
|
return 1 /* HAS_LOCAL_MUTATIONS */ === this.documentState;
|
|
@@ -1865,7 +1872,7 @@ function Rt(t, e) {
|
|
|
1865
1872
|
}, t.prototype.isEqual = function(e) {
|
|
1866
1873
|
return e instanceof t && this.key.isEqual(e.key) && this.version.isEqual(e.version) && this.documentType === e.documentType && this.documentState === e.documentState && this.data.isEqual(e.data);
|
|
1867
1874
|
}, t.prototype.mutableCopy = function() {
|
|
1868
|
-
return new t(this.key, this.documentType, this.version, this.data.clone(), this.documentState);
|
|
1875
|
+
return new t(this.key, this.documentType, this.version, this.readTime, this.data.clone(), this.documentState);
|
|
1869
1876
|
}, t.prototype.toString = function() {
|
|
1870
1877
|
return "Document(" + this.key + ", " + this.version + ", " + JSON.stringify(this.data.value) + ", {documentType: " + this.documentType + "}), {documentState: " + this.documentState + "})";
|
|
1871
1878
|
}, t;
|
|
@@ -2037,7 +2044,7 @@ var Wt = /** @class */ function(e) {
|
|
|
2037
2044
|
}));
|
|
2038
2045
|
}, n;
|
|
2039
2046
|
}(Wt), re = function(t, e) {
|
|
2040
|
-
this.position = t, this.
|
|
2047
|
+
this.position = t, this.inclusive = e;
|
|
2041
2048
|
}, ie = function(t, e /* ASCENDING */) {
|
|
2042
2049
|
void 0 === e && (e = "asc"), this.field = t, this.dir = e;
|
|
2043
2050
|
};
|
|
@@ -2049,7 +2056,7 @@ var Wt = /** @class */ function(e) {
|
|
|
2049
2056
|
function ae(t, e) {
|
|
2050
2057
|
if (null === t) return null === e;
|
|
2051
2058
|
if (null === e) return !1;
|
|
2052
|
-
if (t.
|
|
2059
|
+
if (t.inclusive !== e.inclusive || t.position.length !== e.position.length) return !1;
|
|
2053
2060
|
for (var n = 0; n < t.position.length; n++) if (!Ot(t.position[n], e.position[n])) return !1;
|
|
2054
2061
|
return !0;
|
|
2055
2062
|
}
|
|
@@ -2159,7 +2166,7 @@ function le(t) {
|
|
|
2159
2166
|
n.push(new ie(o.field, a));
|
|
2160
2167
|
}
|
|
2161
2168
|
// We need to swap the cursors to match the now-flipped query ordering.
|
|
2162
|
-
var s = e.endAt ? new re(e.endAt.position, !e.endAt.
|
|
2169
|
+
var s = e.endAt ? new re(e.endAt.position, !e.endAt.inclusive) : null, u = e.startAt ? new re(e.startAt.position, !e.startAt.inclusive) : null;
|
|
2163
2170
|
// Now return as a LimitType.First query.
|
|
2164
2171
|
e.S = Ht(e.path, e.collectionGroup, n, e.filters, e.limit, s, u);
|
|
2165
2172
|
}
|
|
@@ -2347,7 +2354,7 @@ function de(t, e) {
|
|
|
2347
2354
|
/**
|
|
2348
2355
|
* Returns a value for a Date that's appropriate to put into a proto.
|
|
2349
2356
|
*/
|
|
2350
|
-
function
|
|
2357
|
+
function Pe(t, e) {
|
|
2351
2358
|
return t.F ? new Date(1e3 * e.seconds).toISOString().replace(/\.\d*/, "").replace("Z", "") + "." + ("000000000" + e.nanoseconds).slice(-9) + "Z" : {
|
|
2352
2359
|
seconds: "" + e.seconds,
|
|
2353
2360
|
nanos: e.nanoseconds
|
|
@@ -2358,12 +2365,12 @@ function Ne(t, e) {
|
|
|
2358
2365
|
* Returns a value for bytes that's appropriate to put in a proto.
|
|
2359
2366
|
*
|
|
2360
2367
|
* Visible for testing.
|
|
2361
|
-
*/ function
|
|
2368
|
+
*/ function Ne(t, e) {
|
|
2362
2369
|
return t.F ? e.toBase64() : e.toUint8Array();
|
|
2363
2370
|
}
|
|
2364
2371
|
|
|
2365
2372
|
function qe(t, e) {
|
|
2366
|
-
return
|
|
2373
|
+
return Pe(t, e.toTimestamp());
|
|
2367
2374
|
}
|
|
2368
2375
|
|
|
2369
2376
|
function Fe(t) {
|
|
@@ -2386,7 +2393,7 @@ function Ce(t, e) {
|
|
|
2386
2393
|
function je(t, e) {
|
|
2387
2394
|
var n, r = function(t) {
|
|
2388
2395
|
var e = Z.fromString(t);
|
|
2389
|
-
return E(
|
|
2396
|
+
return E(ze(e)), e;
|
|
2390
2397
|
}(e);
|
|
2391
2398
|
if (r.get(1) !== t.databaseId.projectId) throw new U(V, "Tried to deserialize key from different project: " + r.get(1) + " vs " + t.databaseId.projectId);
|
|
2392
2399
|
if (r.get(3) !== t.databaseId.database) throw new U(V, "Tried to deserialize key from different database: " + r.get(3) + " vs " + t.databaseId.database);
|
|
@@ -2409,29 +2416,21 @@ function Me(t, e, n) {
|
|
|
2409
2416
|
}
|
|
2410
2417
|
|
|
2411
2418
|
function Ue(t) {
|
|
2412
|
-
return {
|
|
2413
|
-
before: t.before,
|
|
2414
|
-
values: t.position
|
|
2415
|
-
};
|
|
2416
|
-
}
|
|
2417
|
-
|
|
2418
|
-
// visible for testing
|
|
2419
|
-
function xe(t) {
|
|
2420
2419
|
return ke[t];
|
|
2421
2420
|
}
|
|
2422
2421
|
|
|
2423
2422
|
// visible for testing
|
|
2424
|
-
function
|
|
2423
|
+
function xe(t) {
|
|
2425
2424
|
return Ve[t];
|
|
2426
2425
|
}
|
|
2427
2426
|
|
|
2428
|
-
function
|
|
2427
|
+
function Be(t) {
|
|
2429
2428
|
return {
|
|
2430
2429
|
fieldPath: t.canonicalString()
|
|
2431
2430
|
};
|
|
2432
2431
|
}
|
|
2433
2432
|
|
|
2434
|
-
function
|
|
2433
|
+
function Ge(t) {
|
|
2435
2434
|
var e = [];
|
|
2436
2435
|
return t.fields.forEach((function(t) {
|
|
2437
2436
|
return e.push(t.canonicalString());
|
|
@@ -2440,7 +2439,7 @@ function ze(t) {
|
|
|
2440
2439
|
};
|
|
2441
2440
|
}
|
|
2442
2441
|
|
|
2443
|
-
function
|
|
2442
|
+
function ze(t) {
|
|
2444
2443
|
// Resource names have at least 4 components (project ID, database ID)
|
|
2445
2444
|
return t.length >= 4 && "projects" === t.get(0) && "databases" === t.get(2);
|
|
2446
2445
|
}
|
|
@@ -2460,7 +2459,7 @@ function Qe(t) {
|
|
|
2460
2459
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2461
2460
|
* See the License for the specific language governing permissions and
|
|
2462
2461
|
* limitations under the License.
|
|
2463
|
-
*/ function
|
|
2462
|
+
*/ function Qe(t) {
|
|
2464
2463
|
return new De(t, /* useProto3Json= */ !0);
|
|
2465
2464
|
}
|
|
2466
2465
|
|
|
@@ -2488,7 +2487,7 @@ function Qe(t) {
|
|
|
2488
2487
|
* backoff curve, and a +/- 50% "jitter" that is calculated and added to the
|
|
2489
2488
|
* base delay. This prevents clients from accidentally synchronizing their
|
|
2490
2489
|
* delays causing spikes of load to the backend.
|
|
2491
|
-
*/ var
|
|
2490
|
+
*/ var Ke = /** @class */ function() {
|
|
2492
2491
|
function t(
|
|
2493
2492
|
/**
|
|
2494
2493
|
* The AsyncQueue to run backoff operations on.
|
|
@@ -2562,7 +2561,7 @@ function Qe(t) {
|
|
|
2562
2561
|
/** Returns a random value in the range [-currentBaseMs/2, currentBaseMs/2] */ t.prototype.Y = function() {
|
|
2563
2562
|
return (Math.random() - .5) * this.j;
|
|
2564
2563
|
}, t;
|
|
2565
|
-
}(),
|
|
2564
|
+
}(), He = /** @class */ function(e) {
|
|
2566
2565
|
function n(t, n, r, i) {
|
|
2567
2566
|
var o = this;
|
|
2568
2567
|
return (o = e.call(this) || this).authCredentials = t, o.appCheckCredentials = n,
|
|
@@ -2622,7 +2621,7 @@ function Qe(t) {
|
|
|
2622
2621
|
*/
|
|
2623
2622
|
// TODO(firestorexp): Make sure there is only one Datastore instance per
|
|
2624
2623
|
// firestore-exp client.
|
|
2625
|
-
function
|
|
2624
|
+
function We(t, r) {
|
|
2626
2625
|
return e(this, void 0, void 0, (function() {
|
|
2627
2626
|
var e, i, o;
|
|
2628
2627
|
return n(this, (function(n) {
|
|
@@ -2638,7 +2637,7 @@ function Ye(t, r) {
|
|
|
2638
2637
|
delete: Ce(t, e.key)
|
|
2639
2638
|
}; else if (e instanceof Ee) n = {
|
|
2640
2639
|
update: Me(t, e.key, e.data),
|
|
2641
|
-
updateMask:
|
|
2640
|
+
updateMask: Ge(e.fieldMask)
|
|
2642
2641
|
}; else {
|
|
2643
2642
|
if (!(e instanceof Ae)) return S();
|
|
2644
2643
|
n = {
|
|
@@ -2688,7 +2687,7 @@ function Ye(t, r) {
|
|
|
2688
2687
|
}));
|
|
2689
2688
|
}
|
|
2690
2689
|
|
|
2691
|
-
function
|
|
2690
|
+
function Ye(t, r) {
|
|
2692
2691
|
return e(this, void 0, void 0, (function() {
|
|
2693
2692
|
var e, i, o, a, s, u;
|
|
2694
2693
|
return n(this, (function(n) {
|
|
@@ -2727,7 +2726,7 @@ function $e(t, r) {
|
|
|
2727
2726
|
}));
|
|
2728
2727
|
}
|
|
2729
2728
|
|
|
2730
|
-
function
|
|
2729
|
+
function $e(t, r) {
|
|
2731
2730
|
return e(this, void 0, void 0, (function() {
|
|
2732
2731
|
var e, i;
|
|
2733
2732
|
return n(this, (function(n) {
|
|
@@ -2752,34 +2751,34 @@ function Xe(t, r) {
|
|
|
2752
2751
|
if ("==" /* EQUAL */ === t.op) {
|
|
2753
2752
|
if (xt(t.value)) return {
|
|
2754
2753
|
unaryFilter: {
|
|
2755
|
-
field:
|
|
2754
|
+
field: Be(t.field),
|
|
2756
2755
|
op: "IS_NAN"
|
|
2757
2756
|
}
|
|
2758
2757
|
};
|
|
2759
2758
|
if (Ut(t.value)) return {
|
|
2760
2759
|
unaryFilter: {
|
|
2761
|
-
field:
|
|
2760
|
+
field: Be(t.field),
|
|
2762
2761
|
op: "IS_NULL"
|
|
2763
2762
|
}
|
|
2764
2763
|
};
|
|
2765
2764
|
} else if ("!=" /* NOT_EQUAL */ === t.op) {
|
|
2766
2765
|
if (xt(t.value)) return {
|
|
2767
2766
|
unaryFilter: {
|
|
2768
|
-
field:
|
|
2767
|
+
field: Be(t.field),
|
|
2769
2768
|
op: "IS_NOT_NAN"
|
|
2770
2769
|
}
|
|
2771
2770
|
};
|
|
2772
2771
|
if (Ut(t.value)) return {
|
|
2773
2772
|
unaryFilter: {
|
|
2774
|
-
field:
|
|
2773
|
+
field: Be(t.field),
|
|
2775
2774
|
op: "IS_NOT_NULL"
|
|
2776
2775
|
}
|
|
2777
2776
|
};
|
|
2778
2777
|
}
|
|
2779
2778
|
return {
|
|
2780
2779
|
fieldFilter: {
|
|
2781
|
-
field:
|
|
2782
|
-
op:
|
|
2780
|
+
field: Be(t.field),
|
|
2781
|
+
op: xe(t.op),
|
|
2783
2782
|
value: t.value
|
|
2784
2783
|
}
|
|
2785
2784
|
};
|
|
@@ -2799,20 +2798,27 @@ function Xe(t, r) {
|
|
|
2799
2798
|
// visible for testing
|
|
2800
2799
|
return function(t) {
|
|
2801
2800
|
return {
|
|
2802
|
-
field:
|
|
2803
|
-
direction:
|
|
2801
|
+
field: Be(t.field),
|
|
2802
|
+
direction: Ue(t.dir)
|
|
2804
2803
|
};
|
|
2805
2804
|
}(t);
|
|
2806
2805
|
}));
|
|
2807
2806
|
}(e.orderBy);
|
|
2808
2807
|
o && (n.structuredQuery.orderBy = o);
|
|
2809
|
-
var a = function(t, e) {
|
|
2808
|
+
var a, s = function(t, e) {
|
|
2810
2809
|
return t.F || ct(e) ? e : {
|
|
2811
2810
|
value: e
|
|
2812
2811
|
};
|
|
2813
2812
|
}(t, e.limit);
|
|
2814
|
-
return null !==
|
|
2815
|
-
|
|
2813
|
+
return null !== s && (n.structuredQuery.limit = s), e.startAt && (n.structuredQuery.startAt = {
|
|
2814
|
+
before: (a = e.startAt).inclusive,
|
|
2815
|
+
values: a.position
|
|
2816
|
+
}), e.endAt && (n.structuredQuery.endAt = function(t) {
|
|
2817
|
+
return {
|
|
2818
|
+
before: !t.inclusive,
|
|
2819
|
+
values: t.position
|
|
2820
|
+
};
|
|
2821
|
+
}(e.endAt)), n;
|
|
2816
2822
|
}(e.q, pe(r)), [ 4 /*yield*/ , e.T("RunQuery", i.parent, {
|
|
2817
2823
|
structuredQuery: i.structuredQuery
|
|
2818
2824
|
}) ];
|
|
@@ -2850,7 +2856,7 @@ function Xe(t, r) {
|
|
|
2850
2856
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2851
2857
|
* See the License for the specific language governing permissions and
|
|
2852
2858
|
* limitations under the License.
|
|
2853
|
-
*/ var
|
|
2859
|
+
*/ var Xe = new Map;
|
|
2854
2860
|
|
|
2855
2861
|
/**
|
|
2856
2862
|
* An instance map that ensures only one Datastore exists per Firestore
|
|
@@ -2860,17 +2866,17 @@ function Xe(t, r) {
|
|
|
2860
2866
|
* Returns an initialized and started Datastore for the given Firestore
|
|
2861
2867
|
* instance. Callers must invoke removeComponents() when the Firestore
|
|
2862
2868
|
* instance is terminated.
|
|
2863
|
-
*/ function
|
|
2869
|
+
*/ function Je(t) {
|
|
2864
2870
|
if (t._terminated) throw new U(O, "The client has already been terminated.");
|
|
2865
|
-
if (!
|
|
2871
|
+
if (!Xe.has(t)) {
|
|
2866
2872
|
w("ComponentProvider", "Initializing Datastore");
|
|
2867
2873
|
var e = function(t) {
|
|
2868
2874
|
return new mt(t, fetch.bind(null));
|
|
2869
2875
|
}((i = t._databaseId, o = t.app.options.appId || "", a = t._persistenceKey, s = t._freezeSettings(),
|
|
2870
|
-
new $(i, o, a, s.host, s.ssl, s.experimentalForceLongPolling, s.experimentalAutoDetectLongPolling, s.useFetchStreams))), n =
|
|
2871
|
-
return new
|
|
2876
|
+
new $(i, o, a, s.host, s.ssl, s.experimentalForceLongPolling, s.experimentalAutoDetectLongPolling, s.useFetchStreams))), n = Qe(t._databaseId), r = function(t, e, n, r) {
|
|
2877
|
+
return new He(t, e, n, r);
|
|
2872
2878
|
}(t._authCredentials, t._appCheckCredentials, e, n);
|
|
2873
|
-
|
|
2879
|
+
Xe.set(t, r);
|
|
2874
2880
|
}
|
|
2875
2881
|
var i, o, a, s;
|
|
2876
2882
|
/**
|
|
@@ -2888,7 +2894,7 @@ function Xe(t, r) {
|
|
|
2888
2894
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2889
2895
|
* See the License for the specific language governing permissions and
|
|
2890
2896
|
* limitations under the License.
|
|
2891
|
-
*/ return
|
|
2897
|
+
*/ return Xe.get(t);
|
|
2892
2898
|
}
|
|
2893
2899
|
|
|
2894
2900
|
/**
|
|
@@ -2899,7 +2905,7 @@ function Xe(t, r) {
|
|
|
2899
2905
|
* A concrete type describing all the values that can be applied via a
|
|
2900
2906
|
* user-supplied `FirestoreSettings` object. This is a separate type so that
|
|
2901
2907
|
* defaults can be supplied and the value can be checked for equality.
|
|
2902
|
-
*/ var
|
|
2908
|
+
*/ var Ze = /** @class */ function() {
|
|
2903
2909
|
function t(t) {
|
|
2904
2910
|
var e;
|
|
2905
2911
|
if (void 0 === t.host) {
|
|
@@ -2919,14 +2925,14 @@ function Xe(t, r) {
|
|
|
2919
2925
|
return t.prototype.isEqual = function(t) {
|
|
2920
2926
|
return this.host === t.host && this.ssl === t.ssl && this.credentials === t.credentials && this.cacheSizeBytes === t.cacheSizeBytes && this.experimentalForceLongPolling === t.experimentalForceLongPolling && this.experimentalAutoDetectLongPolling === t.experimentalAutoDetectLongPolling && this.ignoreUndefinedProperties === t.ignoreUndefinedProperties && this.useFetchStreams === t.useFetchStreams;
|
|
2921
2927
|
}, t;
|
|
2922
|
-
}(),
|
|
2928
|
+
}(), tn = /** @class */ function() {
|
|
2923
2929
|
/** @hideconstructor */
|
|
2924
2930
|
function t(t, e, n) {
|
|
2925
2931
|
this._authCredentials = e, this._appCheckCredentials = n,
|
|
2926
2932
|
/**
|
|
2927
2933
|
* Whether it's a Firestore or Firestore Lite instance.
|
|
2928
2934
|
*/
|
|
2929
|
-
this.type = "firestore-lite", this._persistenceKey = "(lite)", this._settings = new
|
|
2935
|
+
this.type = "firestore-lite", this._persistenceKey = "(lite)", this._settings = new Ze({}),
|
|
2930
2936
|
this._settingsFrozen = !1, t instanceof X ? this._databaseId = t : (this._app = t,
|
|
2931
2937
|
this._databaseId = function(t) {
|
|
2932
2938
|
if (!Object.prototype.hasOwnProperty.apply(t.options, [ "projectId" ])) throw new U(V, '"projectId" not provided in firebase.initializeApp.');
|
|
@@ -2958,7 +2964,7 @@ function Xe(t, r) {
|
|
|
2958
2964
|
configurable: !0
|
|
2959
2965
|
}), t.prototype._setSettings = function(t) {
|
|
2960
2966
|
if (this._settingsFrozen) throw new U(O, "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.");
|
|
2961
|
-
this._settings = new
|
|
2967
|
+
this._settings = new Ze(t), void 0 !== t.credentials && (this._authCredentials = function(t) {
|
|
2962
2968
|
if (!t) return new G;
|
|
2963
2969
|
switch (t.type) {
|
|
2964
2970
|
case "gapi":
|
|
@@ -2996,8 +3002,8 @@ function Xe(t, r) {
|
|
|
2996
3002
|
* Only ever called once.
|
|
2997
3003
|
*/
|
|
2998
3004
|
t.prototype._terminate = function() {
|
|
2999
|
-
return t = this, (e =
|
|
3000
|
-
|
|
3005
|
+
return t = this, (e = Xe.get(t)) && (w("ComponentProvider", "Removing Datastore"),
|
|
3006
|
+
Xe.delete(t), e.terminate()), Promise.resolve();
|
|
3001
3007
|
var t, e;
|
|
3002
3008
|
}, t;
|
|
3003
3009
|
}();
|
|
@@ -3022,7 +3028,7 @@ function Xe(t, r) {
|
|
|
3022
3028
|
* The Cloud Firestore service interface.
|
|
3023
3029
|
*
|
|
3024
3030
|
* Do not call this constructor directly. Instead, use {@link getFirestore}.
|
|
3025
|
-
*/ function
|
|
3031
|
+
*/ function en(t, e) {
|
|
3026
3032
|
var n = _getProvider(t, "firestore/lite");
|
|
3027
3033
|
if (n.isInitialized()) throw new U(O, "Firestore can only be initialized once per app.");
|
|
3028
3034
|
return n.initialize({
|
|
@@ -3038,7 +3044,7 @@ function Xe(t, r) {
|
|
|
3038
3044
|
* @param app - The {@link @firebase/app#FirebaseApp} instance that the returned `Firestore`
|
|
3039
3045
|
* instance is associated with.
|
|
3040
3046
|
* @returns The `Firestore` instance of the provided app.
|
|
3041
|
-
*/ function
|
|
3047
|
+
*/ function nn(t) {
|
|
3042
3048
|
return void 0 === t && (t = s()), _getProvider(t, "firestore/lite").getImmediate();
|
|
3043
3049
|
}
|
|
3044
3050
|
|
|
@@ -3054,10 +3060,10 @@ function Xe(t, r) {
|
|
|
3054
3060
|
* @param port - the emulator port (ex: 9000).
|
|
3055
3061
|
* @param options.mockUserToken - the mock auth token to use for unit testing
|
|
3056
3062
|
* Security Rules.
|
|
3057
|
-
*/ function
|
|
3063
|
+
*/ function rn(t, e, n, r) {
|
|
3058
3064
|
var i;
|
|
3059
3065
|
void 0 === r && (r = {});
|
|
3060
|
-
var o = (t = st(t,
|
|
3066
|
+
var o = (t = st(t, tn))._getSettings();
|
|
3061
3067
|
if ("firestore.googleapis.com" !== o.host && o.host !== e && _("Host has been set in both settings() and useEmulator(), emulator host will be used"),
|
|
3062
3068
|
t._setSettings(Object.assign(Object.assign({}, o), {
|
|
3063
3069
|
host: e + ":" + n,
|
|
@@ -3095,8 +3101,8 @@ function Xe(t, r) {
|
|
|
3095
3101
|
* @param firestore - The `Firestore` instance to terminate.
|
|
3096
3102
|
* @returns A `Promise` that is resolved when the instance has been successfully
|
|
3097
3103
|
* terminated.
|
|
3098
|
-
*/ function
|
|
3099
|
-
return t = st(t,
|
|
3104
|
+
*/ function on(t) {
|
|
3105
|
+
return t = st(t, tn), u(t.app, "firestore/lite"), t._delete()
|
|
3100
3106
|
/**
|
|
3101
3107
|
* @license
|
|
3102
3108
|
* Copyright 2020 Google LLC
|
|
@@ -3136,7 +3142,7 @@ function Xe(t, r) {
|
|
|
3136
3142
|
*/;
|
|
3137
3143
|
}
|
|
3138
3144
|
|
|
3139
|
-
var
|
|
3145
|
+
var an = /** @class */ function() {
|
|
3140
3146
|
/** @hideconstructor */
|
|
3141
3147
|
function t(t,
|
|
3142
3148
|
/**
|
|
@@ -3177,14 +3183,14 @@ var sn = /** @class */ function() {
|
|
|
3177
3183
|
* The collection this `DocumentReference` belongs to.
|
|
3178
3184
|
*/
|
|
3179
3185
|
get: function() {
|
|
3180
|
-
return new
|
|
3186
|
+
return new un(this.firestore, this.converter, this._key.path.popLast());
|
|
3181
3187
|
},
|
|
3182
3188
|
enumerable: !1,
|
|
3183
3189
|
configurable: !0
|
|
3184
3190
|
}), t.prototype.withConverter = function(e) {
|
|
3185
3191
|
return new t(this.firestore, e, this._key);
|
|
3186
3192
|
}, t;
|
|
3187
|
-
}(),
|
|
3193
|
+
}(), sn = /** @class */ function() {
|
|
3188
3194
|
// This is the lite version of the Query class in the main SDK.
|
|
3189
3195
|
/** @hideconstructor protected */
|
|
3190
3196
|
function t(t,
|
|
@@ -3199,7 +3205,7 @@ var sn = /** @class */ function() {
|
|
|
3199
3205
|
return t.prototype.withConverter = function(e) {
|
|
3200
3206
|
return new t(this.firestore, e, this._query);
|
|
3201
3207
|
}, t;
|
|
3202
|
-
}(),
|
|
3208
|
+
}(), un = /** @class */ function(e) {
|
|
3203
3209
|
/** @hideconstructor */
|
|
3204
3210
|
function n(t, n, r) {
|
|
3205
3211
|
var i = this;
|
|
@@ -3230,7 +3236,7 @@ var sn = /** @class */ function() {
|
|
|
3230
3236
|
*/
|
|
3231
3237
|
get: function() {
|
|
3232
3238
|
var t = this._path.popLast();
|
|
3233
|
-
return t.isEmpty() ? null : new
|
|
3239
|
+
return t.isEmpty() ? null : new an(this.firestore,
|
|
3234
3240
|
/* converter= */ null, new nt(t));
|
|
3235
3241
|
},
|
|
3236
3242
|
enumerable: !1,
|
|
@@ -3238,20 +3244,20 @@ var sn = /** @class */ function() {
|
|
|
3238
3244
|
}), n.prototype.withConverter = function(t) {
|
|
3239
3245
|
return new n(this.firestore, t, this._path);
|
|
3240
3246
|
}, n;
|
|
3241
|
-
}(
|
|
3247
|
+
}(sn);
|
|
3242
3248
|
|
|
3243
3249
|
/**
|
|
3244
3250
|
* A `Query` refers to a query which you can read or listen to. You can also
|
|
3245
3251
|
* construct refined `Query` objects by adding filters and ordering.
|
|
3246
|
-
*/ function
|
|
3252
|
+
*/ function cn(t, e) {
|
|
3247
3253
|
for (var n = [], i = 2; i < arguments.length; i++) n[i - 2] = arguments[i];
|
|
3248
|
-
if (t = p(t), rt("collection", "path", e), t instanceof
|
|
3254
|
+
if (t = p(t), rt("collection", "path", e), t instanceof tn) {
|
|
3249
3255
|
var o = Z.fromString.apply(Z, r([ e ], n));
|
|
3250
|
-
return ot(o), new
|
|
3256
|
+
return ot(o), new un(t, /* converter= */ null, o);
|
|
3251
3257
|
}
|
|
3252
|
-
if (!(t instanceof
|
|
3258
|
+
if (!(t instanceof an || t instanceof un)) throw new U(V, "Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");
|
|
3253
3259
|
var a = t._path.child(Z.fromString.apply(Z, r([ e ], n)));
|
|
3254
|
-
return ot(a), new
|
|
3260
|
+
return ot(a), new un(t.firestore,
|
|
3255
3261
|
/* converter= */ null, a);
|
|
3256
3262
|
}
|
|
3257
3263
|
|
|
@@ -3267,9 +3273,9 @@ var sn = /** @class */ function() {
|
|
|
3267
3273
|
* collection or subcollection with this ID as the last segment of its path
|
|
3268
3274
|
* will be included. Cannot contain a slash.
|
|
3269
3275
|
* @returns The created `Query`.
|
|
3270
|
-
*/ function
|
|
3271
|
-
if (t = st(t,
|
|
3272
|
-
return new
|
|
3276
|
+
*/ function ln(t, e) {
|
|
3277
|
+
if (t = st(t, tn), rt("collectionGroup", "collection id", e), e.indexOf("/") >= 0) throw new U(V, "Invalid collection ID '" + e + "' passed to function collectionGroup(). Collection IDs must not contain '/'.");
|
|
3278
|
+
return new sn(t,
|
|
3273
3279
|
/* converter= */ null,
|
|
3274
3280
|
/**
|
|
3275
3281
|
* Creates a new Query for a collection group query that matches all documents
|
|
@@ -3280,19 +3286,19 @@ var sn = /** @class */ function() {
|
|
|
3280
3286
|
}(e));
|
|
3281
3287
|
}
|
|
3282
3288
|
|
|
3283
|
-
function
|
|
3289
|
+
function fn(t, e) {
|
|
3284
3290
|
for (var n = [], i = 2; i < arguments.length; i++) n[i - 2] = arguments[i];
|
|
3285
3291
|
if (t = p(t),
|
|
3286
3292
|
// We allow omission of 'pathString' but explicitly prohibit passing in both
|
|
3287
3293
|
// 'undefined' and 'null'.
|
|
3288
|
-
1 === arguments.length && (e = vt.R()), rt("doc", "path", e), t instanceof
|
|
3294
|
+
1 === arguments.length && (e = vt.R()), rt("doc", "path", e), t instanceof tn) {
|
|
3289
3295
|
var o = Z.fromString.apply(Z, r([ e ], n));
|
|
3290
|
-
return it(o), new
|
|
3296
|
+
return it(o), new an(t,
|
|
3291
3297
|
/* converter= */ null, new nt(o));
|
|
3292
3298
|
}
|
|
3293
|
-
if (!(t instanceof
|
|
3299
|
+
if (!(t instanceof an || t instanceof un)) throw new U(V, "Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");
|
|
3294
3300
|
var a = t._path.child(Z.fromString.apply(Z, r([ e ], n)));
|
|
3295
|
-
return it(a), new
|
|
3301
|
+
return it(a), new an(t.firestore, t instanceof un ? t.converter : null, new nt(a));
|
|
3296
3302
|
}
|
|
3297
3303
|
|
|
3298
3304
|
/**
|
|
@@ -3302,8 +3308,8 @@ function hn(t, e) {
|
|
|
3302
3308
|
* @param right - A reference to compare.
|
|
3303
3309
|
* @returns true if the references point to the same location in the same
|
|
3304
3310
|
* Firestore database.
|
|
3305
|
-
*/ function
|
|
3306
|
-
return t = p(t), e = p(e), (t instanceof
|
|
3311
|
+
*/ function hn(t, e) {
|
|
3312
|
+
return t = p(t), e = p(e), (t instanceof an || t instanceof un) && (e instanceof an || e instanceof un) && t.firestore === e.firestore && t.path === e.path && t.converter === e.converter
|
|
3307
3313
|
/**
|
|
3308
3314
|
* Returns true if the provided queries point to the same collection and apply
|
|
3309
3315
|
* the same constraints.
|
|
@@ -3315,8 +3321,8 @@ function hn(t, e) {
|
|
|
3315
3321
|
*/;
|
|
3316
3322
|
}
|
|
3317
3323
|
|
|
3318
|
-
function
|
|
3319
|
-
return t = p(t), e = p(e), t instanceof
|
|
3324
|
+
function pn(t, e) {
|
|
3325
|
+
return t = p(t), e = p(e), t instanceof sn && e instanceof sn && t.firestore === e.firestore && function(t, e) {
|
|
3320
3326
|
return function(t, e) {
|
|
3321
3327
|
if (t.limit !== e.limit) return !1;
|
|
3322
3328
|
if (t.orderBy.length !== e.orderBy.length) return !1;
|
|
@@ -3354,7 +3360,7 @@ function dn(t, e) {
|
|
|
3354
3360
|
*/;
|
|
3355
3361
|
}
|
|
3356
3362
|
|
|
3357
|
-
var
|
|
3363
|
+
var dn = /** @class */ function() {
|
|
3358
3364
|
/**
|
|
3359
3365
|
* Creates a `FieldPath` from the provided field names. If more than one field
|
|
3360
3366
|
* name is provided, the path will point to a nested field in a document.
|
|
@@ -3379,8 +3385,8 @@ var mn = /** @class */ function() {
|
|
|
3379
3385
|
/**
|
|
3380
3386
|
* Returns a special sentinel `FieldPath` to refer to the ID of a document.
|
|
3381
3387
|
* It can be used in queries to sort or filter by the document ID.
|
|
3382
|
-
*/ function
|
|
3383
|
-
return new
|
|
3388
|
+
*/ function mn() {
|
|
3389
|
+
return new dn("__name__");
|
|
3384
3390
|
}
|
|
3385
3391
|
|
|
3386
3392
|
/**
|
|
@@ -3401,7 +3407,7 @@ var mn = /** @class */ function() {
|
|
|
3401
3407
|
*/
|
|
3402
3408
|
/**
|
|
3403
3409
|
* An immutable object representing an array of bytes.
|
|
3404
|
-
*/ var
|
|
3410
|
+
*/ var yn = /** @class */ function() {
|
|
3405
3411
|
/** @hideconstructor */
|
|
3406
3412
|
function t(t) {
|
|
3407
3413
|
this._byteString = t;
|
|
@@ -3459,14 +3465,14 @@ var mn = /** @class */ function() {
|
|
|
3459
3465
|
t.prototype.isEqual = function(t) {
|
|
3460
3466
|
return this._byteString.isEqual(t._byteString);
|
|
3461
3467
|
}, t;
|
|
3462
|
-
}(),
|
|
3468
|
+
}(), vn =
|
|
3463
3469
|
/**
|
|
3464
3470
|
* @param _methodName - The public API endpoint that returns this class.
|
|
3465
3471
|
* @hideconstructor
|
|
3466
3472
|
*/
|
|
3467
3473
|
function(t) {
|
|
3468
3474
|
this._methodName = t;
|
|
3469
|
-
},
|
|
3475
|
+
}, gn = /** @class */ function() {
|
|
3470
3476
|
/**
|
|
3471
3477
|
* Creates a new immutable `GeoPoint` object with the provided latitude and
|
|
3472
3478
|
* longitude values.
|
|
@@ -3519,14 +3525,14 @@ function(t) {
|
|
|
3519
3525
|
t.prototype._compareTo = function(t) {
|
|
3520
3526
|
return gt(this._lat, t._lat) || gt(this._long, t._long);
|
|
3521
3527
|
}, t;
|
|
3522
|
-
}(),
|
|
3528
|
+
}(), wn = /^__.*__$/, bn = /** @class */ function() {
|
|
3523
3529
|
function t(t, e, n) {
|
|
3524
3530
|
this.data = t, this.fieldMask = e, this.fieldTransforms = n;
|
|
3525
3531
|
}
|
|
3526
3532
|
return t.prototype.toMutation = function(t, e) {
|
|
3527
3533
|
return null !== this.fieldMask ? new Ee(t, this.data, this.fieldMask, e, this.fieldTransforms) : new Se(t, this.data, e, this.fieldTransforms);
|
|
3528
3534
|
}, t;
|
|
3529
|
-
}(),
|
|
3535
|
+
}(), _n = /** @class */ function() {
|
|
3530
3536
|
function t(t,
|
|
3531
3537
|
// The fieldMask does not include document transforms.
|
|
3532
3538
|
e, n) {
|
|
@@ -3556,7 +3562,7 @@ function(t) {
|
|
|
3556
3562
|
/**
|
|
3557
3563
|
* Sentinel values that can be used when writing document fields with `set()`
|
|
3558
3564
|
* or `update()`.
|
|
3559
|
-
*/ function
|
|
3565
|
+
*/ function Tn(t) {
|
|
3560
3566
|
switch (t) {
|
|
3561
3567
|
case 0 /* Set */ :
|
|
3562
3568
|
// fall through
|
|
@@ -3574,7 +3580,7 @@ function(t) {
|
|
|
3574
3580
|
}
|
|
3575
3581
|
}
|
|
3576
3582
|
|
|
3577
|
-
/** A "context" object passed around while parsing user data. */ var
|
|
3583
|
+
/** A "context" object passed around while parsing user data. */ var Sn = /** @class */ function() {
|
|
3578
3584
|
/**
|
|
3579
3585
|
* Initializes a ParseContext with the given source and path.
|
|
3580
3586
|
*
|
|
@@ -3634,7 +3640,7 @@ function(t) {
|
|
|
3634
3640
|
rt: !0
|
|
3635
3641
|
});
|
|
3636
3642
|
}, t.prototype.ut = function(t) {
|
|
3637
|
-
return
|
|
3643
|
+
return Gn(t, this.settings.methodName, this.settings.ct || !1, this.path, this.settings.at);
|
|
3638
3644
|
},
|
|
3639
3645
|
/** Returns 'true' if 'fieldPath' was traversed when creating this context. */ t.prototype.contains = function(t) {
|
|
3640
3646
|
return void 0 !== this.fieldMask.find((function(e) {
|
|
@@ -3648,15 +3654,15 @@ function(t) {
|
|
|
3648
3654
|
if (this.path) for (var t = 0; t < this.path.length; t++) this.st(this.path.get(t));
|
|
3649
3655
|
}, t.prototype.st = function(t) {
|
|
3650
3656
|
if (0 === t.length) throw this.ut("Document fields must not be empty");
|
|
3651
|
-
if (
|
|
3657
|
+
if (Tn(this.tt) && wn.test(t)) throw this.ut('Document fields cannot begin and end with "__"');
|
|
3652
3658
|
}, t;
|
|
3653
|
-
}(),
|
|
3659
|
+
}(), En = /** @class */ function() {
|
|
3654
3660
|
function t(t, e, n) {
|
|
3655
|
-
this.databaseId = t, this.ignoreUndefinedProperties = e, this.q = n ||
|
|
3661
|
+
this.databaseId = t, this.ignoreUndefinedProperties = e, this.q = n || Qe(t)
|
|
3656
3662
|
/** Creates a new top-level parse context. */;
|
|
3657
3663
|
}
|
|
3658
3664
|
return t.prototype.ht = function(t, e, n, r) {
|
|
3659
|
-
return void 0 === r && (r = !1), new
|
|
3665
|
+
return void 0 === r && (r = !1), new Sn({
|
|
3660
3666
|
tt: t,
|
|
3661
3667
|
methodName: e,
|
|
3662
3668
|
at: n,
|
|
@@ -3670,30 +3676,30 @@ function(t) {
|
|
|
3670
3676
|
/**
|
|
3671
3677
|
* Helper for parsing raw user input (provided via the API) into internal model
|
|
3672
3678
|
* classes.
|
|
3673
|
-
*/ function
|
|
3674
|
-
var e = t._freezeSettings(), n =
|
|
3675
|
-
return new
|
|
3679
|
+
*/ function In(t) {
|
|
3680
|
+
var e = t._freezeSettings(), n = Qe(t._databaseId);
|
|
3681
|
+
return new En(t._databaseId, !!e.ignoreUndefinedProperties, n);
|
|
3676
3682
|
}
|
|
3677
3683
|
|
|
3678
|
-
/** Parse document data from a set() call. */ function
|
|
3684
|
+
/** Parse document data from a set() call. */ function An(t, e, n, r, i, o) {
|
|
3679
3685
|
void 0 === o && (o = {});
|
|
3680
3686
|
var a = t.ht(o.merge || o.mergeFields ? 2 /* MergeSet */ : 0 /* Set */ , e, n, i);
|
|
3681
|
-
|
|
3682
|
-
var s, u, c =
|
|
3687
|
+
Mn("Data must be an object, but it was:", a, r);
|
|
3688
|
+
var s, u, c = Ln(r, a);
|
|
3683
3689
|
if (o.merge) s = new Et(a.fieldMask), u = a.fieldTransforms; else if (o.mergeFields) {
|
|
3684
3690
|
for (var l = [], f = 0, h = o.mergeFields; f < h.length; f++) {
|
|
3685
|
-
var p =
|
|
3691
|
+
var p = Un(e, h[f], n);
|
|
3686
3692
|
if (!a.contains(p)) throw new U(V, "Field '" + p + "' is specified in your field mask but missing from your input data.");
|
|
3687
|
-
|
|
3693
|
+
zn(l, p) || l.push(p);
|
|
3688
3694
|
}
|
|
3689
3695
|
s = new Et(l), u = a.fieldTransforms.filter((function(t) {
|
|
3690
3696
|
return s.covers(t.field);
|
|
3691
3697
|
}));
|
|
3692
3698
|
} else s = null, u = a.fieldTransforms;
|
|
3693
|
-
return new
|
|
3699
|
+
return new bn(new zt(c), s, u);
|
|
3694
3700
|
}
|
|
3695
3701
|
|
|
3696
|
-
var
|
|
3702
|
+
var kn = /** @class */ function(e) {
|
|
3697
3703
|
function n() {
|
|
3698
3704
|
return null !== e && e.apply(this, arguments) || this;
|
|
3699
3705
|
}
|
|
@@ -3705,7 +3711,7 @@ var Vn = /** @class */ function(e) {
|
|
|
3705
3711
|
}, n.prototype.isEqual = function(t) {
|
|
3706
3712
|
return t instanceof n;
|
|
3707
3713
|
}, n;
|
|
3708
|
-
}(
|
|
3714
|
+
}(vn);
|
|
3709
3715
|
|
|
3710
3716
|
/**
|
|
3711
3717
|
* Creates a child context for parsing SerializableFieldValues.
|
|
@@ -3722,8 +3728,8 @@ var Vn = /** @class */ function(e) {
|
|
|
3722
3728
|
* context.
|
|
3723
3729
|
* @param context - The parent context.
|
|
3724
3730
|
* @param arrayElement - Whether or not the FieldValue has an array.
|
|
3725
|
-
*/ function
|
|
3726
|
-
return new
|
|
3731
|
+
*/ function Vn(t, e, n) {
|
|
3732
|
+
return new Sn({
|
|
3727
3733
|
tt: 3 /* Argument */ ,
|
|
3728
3734
|
at: e.settings.at,
|
|
3729
3735
|
methodName: t._methodName,
|
|
@@ -3731,7 +3737,7 @@ var Vn = /** @class */ function(e) {
|
|
|
3731
3737
|
}, e.databaseId, e.q, e.ignoreUndefinedProperties);
|
|
3732
3738
|
}
|
|
3733
3739
|
|
|
3734
|
-
var
|
|
3740
|
+
var Dn = /** @class */ function(e) {
|
|
3735
3741
|
function n() {
|
|
3736
3742
|
return null !== e && e.apply(this, arguments) || this;
|
|
3737
3743
|
}
|
|
@@ -3740,37 +3746,37 @@ var Nn = /** @class */ function(e) {
|
|
|
3740
3746
|
}, n.prototype.isEqual = function(t) {
|
|
3741
3747
|
return t instanceof n;
|
|
3742
3748
|
}, n;
|
|
3743
|
-
}(
|
|
3749
|
+
}(vn), Pn = /** @class */ function(e) {
|
|
3744
3750
|
function n(t, n) {
|
|
3745
3751
|
var r = this;
|
|
3746
3752
|
return (r = e.call(this, t) || this).lt = n, r;
|
|
3747
3753
|
}
|
|
3748
3754
|
return t(n, e), n.prototype._toFieldTransform = function(t) {
|
|
3749
|
-
var e =
|
|
3755
|
+
var e = Vn(this, t,
|
|
3750
3756
|
/*array=*/ !0), n = this.lt.map((function(t) {
|
|
3751
|
-
return
|
|
3757
|
+
return jn(t, e);
|
|
3752
3758
|
})), r = new ve(n);
|
|
3753
3759
|
return new be(t.path, r);
|
|
3754
3760
|
}, n.prototype.isEqual = function(t) {
|
|
3755
3761
|
// TODO(mrschmidt): Implement isEquals
|
|
3756
3762
|
return this === t;
|
|
3757
3763
|
}, n;
|
|
3758
|
-
}(
|
|
3764
|
+
}(vn), Nn = /** @class */ function(e) {
|
|
3759
3765
|
function n(t, n) {
|
|
3760
3766
|
var r = this;
|
|
3761
3767
|
return (r = e.call(this, t) || this).lt = n, r;
|
|
3762
3768
|
}
|
|
3763
3769
|
return t(n, e), n.prototype._toFieldTransform = function(t) {
|
|
3764
|
-
var e =
|
|
3770
|
+
var e = Vn(this, t,
|
|
3765
3771
|
/*array=*/ !0), n = this.lt.map((function(t) {
|
|
3766
|
-
return
|
|
3772
|
+
return jn(t, e);
|
|
3767
3773
|
})), r = new ge(n);
|
|
3768
3774
|
return new be(t.path, r);
|
|
3769
3775
|
}, n.prototype.isEqual = function(t) {
|
|
3770
3776
|
// TODO(mrschmidt): Implement isEquals
|
|
3771
3777
|
return this === t;
|
|
3772
3778
|
}, n;
|
|
3773
|
-
}(
|
|
3779
|
+
}(vn), qn = /** @class */ function(e) {
|
|
3774
3780
|
function n(t, n) {
|
|
3775
3781
|
var r = this;
|
|
3776
3782
|
return (r = e.call(this, t) || this).ft = n, r;
|
|
@@ -3782,50 +3788,50 @@ var Nn = /** @class */ function(e) {
|
|
|
3782
3788
|
// TODO(mrschmidt): Implement isEquals
|
|
3783
3789
|
return this === t;
|
|
3784
3790
|
}, n;
|
|
3785
|
-
}(
|
|
3791
|
+
}(vn);
|
|
3786
3792
|
|
|
3787
|
-
/** Parse update data from an update() call. */ function
|
|
3793
|
+
/** Parse update data from an update() call. */ function Fn(t, e, n, r) {
|
|
3788
3794
|
var i = t.ht(1 /* Update */ , e, n);
|
|
3789
|
-
|
|
3795
|
+
Mn("Data must be an object, but it was:", i, r);
|
|
3790
3796
|
var o = [], a = zt.empty();
|
|
3791
3797
|
St(r, (function(t, r) {
|
|
3792
|
-
var s =
|
|
3798
|
+
var s = Bn(e, t, n);
|
|
3793
3799
|
// For Compat types, we have to "extract" the underlying types before
|
|
3794
3800
|
// performing validation.
|
|
3795
3801
|
r = p(r);
|
|
3796
3802
|
var u = i.it(s);
|
|
3797
|
-
if (r instanceof
|
|
3803
|
+
if (r instanceof kn)
|
|
3798
3804
|
// Add it to the field mask, but don't add anything to updateData.
|
|
3799
3805
|
o.push(s); else {
|
|
3800
|
-
var c =
|
|
3806
|
+
var c = jn(r, u);
|
|
3801
3807
|
null != c && (o.push(s), a.set(s, c));
|
|
3802
3808
|
}
|
|
3803
3809
|
}));
|
|
3804
3810
|
var s = new Et(o);
|
|
3805
|
-
return new
|
|
3811
|
+
return new _n(a, s, i.fieldTransforms);
|
|
3806
3812
|
}
|
|
3807
3813
|
|
|
3808
|
-
/** Parse update data from a list of field/value arguments. */ function
|
|
3809
|
-
var a = t.ht(1 /* Update */ , e, n), s = [
|
|
3814
|
+
/** Parse update data from a list of field/value arguments. */ function On(t, e, n, r, i, o) {
|
|
3815
|
+
var a = t.ht(1 /* Update */ , e, n), s = [ Un(e, r, n) ], u = [ i ];
|
|
3810
3816
|
if (o.length % 2 != 0) throw new U(V, "Function " + e + "() needs to be called with an even number of arguments that alternate between field names and values.");
|
|
3811
|
-
for (var c = 0; c < o.length; c += 2) s.push(
|
|
3817
|
+
for (var c = 0; c < o.length; c += 2) s.push(Un(e, o[c])), u.push(o[c + 1]);
|
|
3812
3818
|
// We iterate in reverse order to pick the last value for a field if the
|
|
3813
3819
|
// user specified the field multiple times.
|
|
3814
|
-
for (var l = [], f = zt.empty(), h = s.length - 1; h >= 0; --h) if (!
|
|
3820
|
+
for (var l = [], f = zt.empty(), h = s.length - 1; h >= 0; --h) if (!zn(l, s[h])) {
|
|
3815
3821
|
var d = s[h], m = u[h];
|
|
3816
3822
|
// For Compat types, we have to "extract" the underlying types before
|
|
3817
3823
|
// performing validation.
|
|
3818
3824
|
m = p(m);
|
|
3819
3825
|
var y = a.it(d);
|
|
3820
|
-
if (m instanceof
|
|
3826
|
+
if (m instanceof kn)
|
|
3821
3827
|
// Add it to the field mask, but don't add anything to updateData.
|
|
3822
3828
|
l.push(d); else {
|
|
3823
|
-
var v =
|
|
3829
|
+
var v = jn(m, y);
|
|
3824
3830
|
null != v && (l.push(d), f.set(d, v));
|
|
3825
3831
|
}
|
|
3826
3832
|
}
|
|
3827
3833
|
var g = new Et(l);
|
|
3828
|
-
return new
|
|
3834
|
+
return new _n(f, g, a.fieldTransforms);
|
|
3829
3835
|
}
|
|
3830
3836
|
|
|
3831
3837
|
/**
|
|
@@ -3834,8 +3840,8 @@ var Nn = /** @class */ function(e) {
|
|
|
3834
3840
|
*
|
|
3835
3841
|
* @param allowArrays - Whether the query value is an array that may directly
|
|
3836
3842
|
* contain additional arrays (e.g. the operand of an `in` query).
|
|
3837
|
-
*/ function
|
|
3838
|
-
return void 0 === r && (r = !1),
|
|
3843
|
+
*/ function Cn(t, e, n, r) {
|
|
3844
|
+
return void 0 === r && (r = !1), jn(n, t.ht(r ? 4 /* ArrayArgument */ : 3 /* Argument */ , e));
|
|
3839
3845
|
}
|
|
3840
3846
|
|
|
3841
3847
|
/**
|
|
@@ -3846,12 +3852,12 @@ var Nn = /** @class */ function(e) {
|
|
|
3846
3852
|
* the source of the data being parsed, etc.
|
|
3847
3853
|
* @returns The parsed value, or null if the value was a FieldValue sentinel
|
|
3848
3854
|
* that should not be included in the resulting parsed data.
|
|
3849
|
-
*/ function
|
|
3850
|
-
if (
|
|
3855
|
+
*/ function jn(t, e) {
|
|
3856
|
+
if (Rn(
|
|
3851
3857
|
// Unwrap the API type from the Compat SDK. This will return the API type
|
|
3852
3858
|
// from firestore-exp.
|
|
3853
|
-
t = p(t))) return
|
|
3854
|
-
if (t instanceof
|
|
3859
|
+
t = p(t))) return Mn("Unsupported field value:", e, t), Ln(t, e);
|
|
3860
|
+
if (t instanceof vn)
|
|
3855
3861
|
// FieldValues usually parse into transforms (except deleteField())
|
|
3856
3862
|
// in which case we do not want to include this field in our parsed data
|
|
3857
3863
|
// (as doing so will overwrite the field directly prior to the transform
|
|
@@ -3863,7 +3869,7 @@ var Nn = /** @class */ function(e) {
|
|
|
3863
3869
|
*/
|
|
3864
3870
|
return function(t, e) {
|
|
3865
3871
|
// Sentinels are only supported with writes, and not within arrays.
|
|
3866
|
-
if (!
|
|
3872
|
+
if (!Tn(e.tt)) throw e.ut(t._methodName + "() can only be used with update() and set()");
|
|
3867
3873
|
if (!e.path) throw e.ut(t._methodName + "() is not currently supported inside arrays");
|
|
3868
3874
|
var n = t._toFieldTransform(e);
|
|
3869
3875
|
n && e.fieldTransforms.push(n);
|
|
@@ -3886,7 +3892,7 @@ var Nn = /** @class */ function(e) {
|
|
|
3886
3892
|
if (e.settings.rt && 4 /* ArrayArgument */ !== e.tt) throw e.ut("Nested arrays are not supported");
|
|
3887
3893
|
return function(t, e) {
|
|
3888
3894
|
for (var n = [], r = 0, i = 0, o = t; i < o.length; i++) {
|
|
3889
|
-
var a =
|
|
3895
|
+
var a = jn(o[i], e.ot(r));
|
|
3890
3896
|
null == a && (
|
|
3891
3897
|
// Just include nulls in the array for fields being replaced with a
|
|
3892
3898
|
// sentinel.
|
|
@@ -3915,7 +3921,7 @@ var Nn = /** @class */ function(e) {
|
|
|
3915
3921
|
if (t instanceof Date) {
|
|
3916
3922
|
var n = bt.fromDate(t);
|
|
3917
3923
|
return {
|
|
3918
|
-
timestampValue:
|
|
3924
|
+
timestampValue: Pe(e.q, n)
|
|
3919
3925
|
};
|
|
3920
3926
|
}
|
|
3921
3927
|
if (t instanceof bt) {
|
|
@@ -3924,19 +3930,19 @@ var Nn = /** @class */ function(e) {
|
|
|
3924
3930
|
// truncation immediately without waiting for the backend to do that.
|
|
3925
3931
|
var r = new bt(t.seconds, 1e3 * Math.floor(t.nanoseconds / 1e3));
|
|
3926
3932
|
return {
|
|
3927
|
-
timestampValue:
|
|
3933
|
+
timestampValue: Pe(e.q, r)
|
|
3928
3934
|
};
|
|
3929
3935
|
}
|
|
3930
|
-
if (t instanceof
|
|
3936
|
+
if (t instanceof gn) return {
|
|
3931
3937
|
geoPointValue: {
|
|
3932
3938
|
latitude: t.latitude,
|
|
3933
3939
|
longitude: t.longitude
|
|
3934
3940
|
}
|
|
3935
3941
|
};
|
|
3936
|
-
if (t instanceof
|
|
3937
|
-
bytesValue:
|
|
3942
|
+
if (t instanceof yn) return {
|
|
3943
|
+
bytesValue: Ne(e.q, t._byteString)
|
|
3938
3944
|
};
|
|
3939
|
-
if (t instanceof
|
|
3945
|
+
if (t instanceof an) {
|
|
3940
3946
|
var i = e.databaseId, o = t.firestore._databaseId;
|
|
3941
3947
|
if (!o.isEqual(i)) throw e.ut("Document reference is for database " + o.projectId + "/" + o.database + " but should be for database " + i.projectId + "/" + i.database);
|
|
3942
3948
|
return {
|
|
@@ -3947,7 +3953,7 @@ var Nn = /** @class */ function(e) {
|
|
|
3947
3953
|
}(t, e);
|
|
3948
3954
|
}
|
|
3949
3955
|
|
|
3950
|
-
function
|
|
3956
|
+
function Ln(t, e) {
|
|
3951
3957
|
var n = {};
|
|
3952
3958
|
return function(t) {
|
|
3953
3959
|
for (var e in t) if (Object.prototype.hasOwnProperty.call(t, e)) return !1;
|
|
@@ -3956,7 +3962,7 @@ function Rn(t, e) {
|
|
|
3956
3962
|
// If we encounter an empty object, we explicitly add it to the update
|
|
3957
3963
|
// mask to ensure that the server creates a map entry.
|
|
3958
3964
|
e.path && e.path.length > 0 && e.fieldMask.push(e.path) : St(t, (function(t, r) {
|
|
3959
|
-
var i =
|
|
3965
|
+
var i = jn(r, e.et(t));
|
|
3960
3966
|
null != i && (n[t] = i);
|
|
3961
3967
|
})), {
|
|
3962
3968
|
mapValue: {
|
|
@@ -3965,12 +3971,12 @@ function Rn(t, e) {
|
|
|
3965
3971
|
};
|
|
3966
3972
|
}
|
|
3967
3973
|
|
|
3968
|
-
function
|
|
3969
|
-
return !("object" != typeof t || null === t || t instanceof Array || t instanceof Date || t instanceof bt || t instanceof
|
|
3974
|
+
function Rn(t) {
|
|
3975
|
+
return !("object" != typeof t || null === t || t instanceof Array || t instanceof Date || t instanceof bt || t instanceof gn || t instanceof yn || t instanceof an || t instanceof vn);
|
|
3970
3976
|
}
|
|
3971
3977
|
|
|
3972
|
-
function
|
|
3973
|
-
if (!
|
|
3978
|
+
function Mn(t, e, n) {
|
|
3979
|
+
if (!Rn(n) || !function(t) {
|
|
3974
3980
|
return "object" == typeof t && null !== t && (Object.getPrototypeOf(t) === Object.prototype || null === Object.getPrototypeOf(t));
|
|
3975
3981
|
}(n)) {
|
|
3976
3982
|
var r = at(n);
|
|
@@ -3980,20 +3986,20 @@ function Un(t, e, n) {
|
|
|
3980
3986
|
|
|
3981
3987
|
/**
|
|
3982
3988
|
* Helper that calls fromDotSeparatedString() but wraps any error thrown.
|
|
3983
|
-
*/ function
|
|
3989
|
+
*/ function Un(t, e, n) {
|
|
3984
3990
|
if (
|
|
3985
3991
|
// If required, replace the FieldPath Compat class with with the firestore-exp
|
|
3986
3992
|
// FieldPath.
|
|
3987
|
-
(e = p(e)) instanceof
|
|
3988
|
-
if ("string" == typeof e) return
|
|
3989
|
-
throw
|
|
3993
|
+
(e = p(e)) instanceof dn) return e._internalPath;
|
|
3994
|
+
if ("string" == typeof e) return Bn(t, e);
|
|
3995
|
+
throw Gn("Field path arguments must be of type string or ", t,
|
|
3990
3996
|
/* hasConverter= */ !1,
|
|
3991
3997
|
/* path= */ void 0, n);
|
|
3992
3998
|
}
|
|
3993
3999
|
|
|
3994
4000
|
/**
|
|
3995
4001
|
* Matches any characters in a field path string that are reserved.
|
|
3996
|
-
*/ var
|
|
4002
|
+
*/ var xn = new RegExp("[~\\*/\\[\\]]");
|
|
3997
4003
|
|
|
3998
4004
|
/**
|
|
3999
4005
|
* Wraps fromDotSeparatedString with an error message about the method that
|
|
@@ -4003,20 +4009,20 @@ function Un(t, e, n) {
|
|
|
4003
4009
|
* split on dots.
|
|
4004
4010
|
* @param targetDoc - The document against which the field path will be
|
|
4005
4011
|
* evaluated.
|
|
4006
|
-
*/ function
|
|
4007
|
-
if (e.search(
|
|
4012
|
+
*/ function Bn(t, e, n) {
|
|
4013
|
+
if (e.search(xn) >= 0) throw Gn("Invalid field path (" + e + "). Paths must not contain '~', '*', '/', '[', or ']'", t,
|
|
4008
4014
|
/* hasConverter= */ !1,
|
|
4009
4015
|
/* path= */ void 0, n);
|
|
4010
4016
|
try {
|
|
4011
|
-
return (new (
|
|
4017
|
+
return (new (dn.bind.apply(dn, r([ void 0 ], e.split(".")))))._internalPath;
|
|
4012
4018
|
} catch (r) {
|
|
4013
|
-
throw
|
|
4019
|
+
throw Gn("Invalid field path (" + e + "). Paths must not be empty, begin with '.', end with '.', or contain '..'", t,
|
|
4014
4020
|
/* hasConverter= */ !1,
|
|
4015
4021
|
/* path= */ void 0, n);
|
|
4016
4022
|
}
|
|
4017
4023
|
}
|
|
4018
4024
|
|
|
4019
|
-
function
|
|
4025
|
+
function Gn(t, e, n, r, i) {
|
|
4020
4026
|
var o = r && !r.isEmpty(), a = void 0 !== i, s = "Function " + e + "() called with invalid data";
|
|
4021
4027
|
n && (s += " (via `toFirestore()`)");
|
|
4022
4028
|
var u = "";
|
|
@@ -4025,7 +4031,7 @@ function zn(t, e, n, r, i) {
|
|
|
4025
4031
|
/** Checks `haystack` if FieldPath `needle` is present. Runs in O(n). */;
|
|
4026
4032
|
}
|
|
4027
4033
|
|
|
4028
|
-
function
|
|
4034
|
+
function zn(t, e) {
|
|
4029
4035
|
return t.some((function(t) {
|
|
4030
4036
|
return t.isEqual(e);
|
|
4031
4037
|
}));
|
|
@@ -4055,7 +4061,7 @@ function Qn(t, e) {
|
|
|
4055
4061
|
* For a `DocumentSnapshot` that points to a non-existing document, any data
|
|
4056
4062
|
* access will return 'undefined'. You can use the `exists()` method to
|
|
4057
4063
|
* explicitly verify a document's existence.
|
|
4058
|
-
*/ var
|
|
4064
|
+
*/ var Qn = /** @class */ function() {
|
|
4059
4065
|
// Note: This class is stripped down version of the DocumentSnapshot in
|
|
4060
4066
|
// the legacy SDK. The changes are:
|
|
4061
4067
|
// - No support for SnapshotMetadata.
|
|
@@ -4076,7 +4082,7 @@ function Qn(t, e) {
|
|
|
4076
4082
|
* The `DocumentReference` for the document included in the `DocumentSnapshot`.
|
|
4077
4083
|
*/
|
|
4078
4084
|
get: function() {
|
|
4079
|
-
return new
|
|
4085
|
+
return new an(this._firestore, this._converter, this._key);
|
|
4080
4086
|
},
|
|
4081
4087
|
enumerable: !1,
|
|
4082
4088
|
configurable: !0
|
|
@@ -4101,7 +4107,7 @@ function Qn(t, e) {
|
|
|
4101
4107
|
if (this._converter) {
|
|
4102
4108
|
// We only want to use the converter and create a new DocumentSnapshot
|
|
4103
4109
|
// if a converter has been provided.
|
|
4104
|
-
var t = new
|
|
4110
|
+
var t = new Kn(this._firestore, this._userDataWriter, this._key, this._document,
|
|
4105
4111
|
/* converter= */ null);
|
|
4106
4112
|
return this._converter.fromFirestore(t);
|
|
4107
4113
|
}
|
|
@@ -4121,11 +4127,11 @@ function Qn(t, e) {
|
|
|
4121
4127
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4122
4128
|
t.prototype.get = function(t) {
|
|
4123
4129
|
if (this._document) {
|
|
4124
|
-
var e = this._document.data.field(
|
|
4130
|
+
var e = this._document.data.field(Yn("DocumentSnapshot.get", t));
|
|
4125
4131
|
if (null !== e) return this._userDataWriter.convertValue(e);
|
|
4126
4132
|
}
|
|
4127
4133
|
}, t;
|
|
4128
|
-
}(),
|
|
4134
|
+
}(), Kn = /** @class */ function(e) {
|
|
4129
4135
|
function n() {
|
|
4130
4136
|
return null !== e && e.apply(this, arguments) || this;
|
|
4131
4137
|
}
|
|
@@ -4137,7 +4143,7 @@ function Qn(t, e) {
|
|
|
4137
4143
|
*/ return t(n, e), n.prototype.data = function() {
|
|
4138
4144
|
return e.prototype.data.call(this);
|
|
4139
4145
|
}, n;
|
|
4140
|
-
}(
|
|
4146
|
+
}(Qn), Hn = /** @class */ function() {
|
|
4141
4147
|
/** @hideconstructor */
|
|
4142
4148
|
function t(t, e) {
|
|
4143
4149
|
this._docs = e, this.query = t;
|
|
@@ -4191,15 +4197,15 @@ function Qn(t, e) {
|
|
|
4191
4197
|
* @param right - A snapshot to compare.
|
|
4192
4198
|
* @returns true if the snapshots are equal.
|
|
4193
4199
|
*/
|
|
4194
|
-
function
|
|
4195
|
-
return t = p(t), e = p(e), t instanceof
|
|
4200
|
+
function Wn(t, e) {
|
|
4201
|
+
return t = p(t), e = p(e), t instanceof Qn && e instanceof Qn ? t._firestore === e._firestore && t._key.isEqual(e._key) && (null === t._document ? null === e._document : t._document.isEqual(e._document)) && t._converter === e._converter : t instanceof Hn && e instanceof Hn && pn(t.query, e.query) && wt(t.docs, e.docs, Wn)
|
|
4196
4202
|
/**
|
|
4197
4203
|
* Helper that calls `fromDotSeparatedString()` but wraps any error thrown.
|
|
4198
4204
|
*/;
|
|
4199
4205
|
}
|
|
4200
4206
|
|
|
4201
|
-
function
|
|
4202
|
-
return "string" == typeof e ?
|
|
4207
|
+
function Yn(t, e) {
|
|
4208
|
+
return "string" == typeof e ? Bn(t, e) : e instanceof dn ? e._internalPath : e._delegate._internalPath;
|
|
4203
4209
|
}
|
|
4204
4210
|
|
|
4205
4211
|
/**
|
|
@@ -4225,7 +4231,7 @@ function $n(t, e) {
|
|
|
4225
4231
|
* endBefore:1}, {@link (endAt:1)}, {@link limit} or {@link limitToLast} and
|
|
4226
4232
|
* can then be passed to {@link query} to create a new query instance that
|
|
4227
4233
|
* also contains this `QueryConstraint`.
|
|
4228
|
-
*/ var
|
|
4234
|
+
*/ var $n = function() {};
|
|
4229
4235
|
|
|
4230
4236
|
/**
|
|
4231
4237
|
* Creates a new immutable instance of {@link Query} that is extended to also include
|
|
@@ -4235,7 +4241,7 @@ function $n(t, e) {
|
|
|
4235
4241
|
* @param queryConstraints - The list of {@link QueryConstraint}s to apply.
|
|
4236
4242
|
* @throws if any of the provided query constraints cannot be combined with the
|
|
4237
4243
|
* existing or new constraints.
|
|
4238
|
-
*/ function
|
|
4244
|
+
*/ function Xn(t) {
|
|
4239
4245
|
for (var e = [], n = 1; n < arguments.length; n++) e[n - 1] = arguments[n];
|
|
4240
4246
|
for (var r = 0, i = e; r < i.length; r++) {
|
|
4241
4247
|
var o = i[r];
|
|
@@ -4244,31 +4250,31 @@ function $n(t, e) {
|
|
|
4244
4250
|
return t;
|
|
4245
4251
|
}
|
|
4246
4252
|
|
|
4247
|
-
var
|
|
4253
|
+
var Jn = /** @class */ function(e) {
|
|
4248
4254
|
function n(t, n, r) {
|
|
4249
4255
|
var i = this;
|
|
4250
4256
|
return (i = e.call(this) || this).dt = t, i.wt = n, i.yt = r, i.type = "where",
|
|
4251
4257
|
i;
|
|
4252
4258
|
}
|
|
4253
4259
|
return t(n, e), n.prototype._apply = function(t) {
|
|
4254
|
-
var e =
|
|
4260
|
+
var e = In(t.firestore), n = function(t, e, n, r, i, o, a) {
|
|
4255
4261
|
var s;
|
|
4256
4262
|
if (i.isKeyField()) {
|
|
4257
4263
|
if ("array-contains" /* ARRAY_CONTAINS */ === o || "array-contains-any" /* ARRAY_CONTAINS_ANY */ === o) throw new U(V, "Invalid Query. You can't perform '" + o + "' queries on documentId().");
|
|
4258
4264
|
if ("in" /* IN */ === o || "not-in" /* NOT_IN */ === o) {
|
|
4259
|
-
|
|
4265
|
+
pr(a, o);
|
|
4260
4266
|
for (var u = [], c = 0, l = a; c < l.length; c++) {
|
|
4261
4267
|
var f = l[c];
|
|
4262
|
-
u.push(
|
|
4268
|
+
u.push(hr(r, t, f));
|
|
4263
4269
|
}
|
|
4264
4270
|
s = {
|
|
4265
4271
|
arrayValue: {
|
|
4266
4272
|
values: u
|
|
4267
4273
|
}
|
|
4268
4274
|
};
|
|
4269
|
-
} else s =
|
|
4270
|
-
} else "in" /* IN */ !== o && "not-in" /* NOT_IN */ !== o && "array-contains-any" /* ARRAY_CONTAINS_ANY */ !== o ||
|
|
4271
|
-
s =
|
|
4275
|
+
} else s = hr(r, t, a);
|
|
4276
|
+
} else "in" /* IN */ !== o && "not-in" /* NOT_IN */ !== o && "array-contains-any" /* ARRAY_CONTAINS_ANY */ !== o || pr(a, o),
|
|
4277
|
+
s = Cn(n, "where", a,
|
|
4272
4278
|
/* allowArrays= */ "in" /* IN */ === o || "not-in" /* NOT_IN */ === o);
|
|
4273
4279
|
var h = Wt.create(i, o, s);
|
|
4274
4280
|
return function(t, e) {
|
|
@@ -4276,7 +4282,7 @@ var Zn = /** @class */ function(e) {
|
|
|
4276
4282
|
var n = le(t);
|
|
4277
4283
|
if (null !== n && !n.isEqual(e.field)) throw new U(V, "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() + "'");
|
|
4278
4284
|
var r = ce(t);
|
|
4279
|
-
null !== r &&
|
|
4285
|
+
null !== r && dr(t, e.field, r);
|
|
4280
4286
|
}
|
|
4281
4287
|
var i = function(t, e) {
|
|
4282
4288
|
for (var n = 0, r = t.filters; n < r.length; n++) {
|
|
@@ -4323,12 +4329,12 @@ var Zn = /** @class */ function(e) {
|
|
|
4323
4329
|
throw i === e.op ? new U(V, "Invalid query. You cannot use more than one '" + e.op.toString() + "' filter.") : new U(V, "Invalid query. You cannot use '" + e.op.toString() + "' filters with '" + i.toString() + "' filters.");
|
|
4324
4330
|
}(t, h), h;
|
|
4325
4331
|
}(t._query, 0, e, t.firestore._databaseId, this.dt, this.wt, this.yt);
|
|
4326
|
-
return new
|
|
4332
|
+
return new sn(t.firestore, t.converter, function(t, e) {
|
|
4327
4333
|
var n = t.filters.concat([ e ]);
|
|
4328
4334
|
return new se(t.path, t.collectionGroup, t.explicitOrderBy.slice(), n, t.limit, t.limitType, t.startAt, t.endAt);
|
|
4329
4335
|
}(t._query, n));
|
|
4330
4336
|
}, n;
|
|
4331
|
-
}(
|
|
4337
|
+
}($n);
|
|
4332
4338
|
|
|
4333
4339
|
/**
|
|
4334
4340
|
* Creates a {@link QueryConstraint} that enforces that documents must contain the
|
|
@@ -4340,12 +4346,12 @@ var Zn = /** @class */ function(e) {
|
|
|
4340
4346
|
* "<=", "!=").
|
|
4341
4347
|
* @param value - The value for comparison
|
|
4342
4348
|
* @returns The created {@link Query}.
|
|
4343
|
-
*/ function
|
|
4344
|
-
var r = e, i =
|
|
4345
|
-
return new
|
|
4349
|
+
*/ function Zn(t, e, n) {
|
|
4350
|
+
var r = e, i = Yn("where", t);
|
|
4351
|
+
return new Jn(i, r, n);
|
|
4346
4352
|
}
|
|
4347
4353
|
|
|
4348
|
-
var
|
|
4354
|
+
var tr = /** @class */ function(e) {
|
|
4349
4355
|
function n(t, n) {
|
|
4350
4356
|
var r = this;
|
|
4351
4357
|
return (r = e.call(this) || this).dt = t, r._t = n, r.type = "orderBy", r;
|
|
@@ -4359,17 +4365,17 @@ var er = /** @class */ function(e) {
|
|
|
4359
4365
|
if (null === ce(t)) {
|
|
4360
4366
|
// This is the first order by. It must match any inequality.
|
|
4361
4367
|
var n = le(t);
|
|
4362
|
-
null !== n &&
|
|
4368
|
+
null !== n && dr(t, n, e.field);
|
|
4363
4369
|
}
|
|
4364
4370
|
}(t, r), r;
|
|
4365
4371
|
}(t._query, this.dt, this._t);
|
|
4366
|
-
return new
|
|
4372
|
+
return new sn(t.firestore, t.converter, function(t, e) {
|
|
4367
4373
|
// TODO(dimond): validate that orderBy does not list the same key twice.
|
|
4368
4374
|
var n = t.explicitOrderBy.concat([ e ]);
|
|
4369
4375
|
return new se(t.path, t.collectionGroup, n, t.filters.slice(), t.limit, t.limitType, t.startAt, t.endAt);
|
|
4370
4376
|
}(t._query, e));
|
|
4371
4377
|
}, n;
|
|
4372
|
-
}(
|
|
4378
|
+
}($n);
|
|
4373
4379
|
|
|
4374
4380
|
/**
|
|
4375
4381
|
* Creates a {@link QueryConstraint} that sorts the query result by the
|
|
@@ -4379,31 +4385,31 @@ var er = /** @class */ function(e) {
|
|
|
4379
4385
|
* @param directionStr - Optional direction to sort by ('asc' or 'desc'). If
|
|
4380
4386
|
* not specified, order will be ascending.
|
|
4381
4387
|
* @returns The created {@link Query}.
|
|
4382
|
-
*/ function
|
|
4388
|
+
*/ function er(t, e) {
|
|
4383
4389
|
void 0 === e && (e = "asc");
|
|
4384
|
-
var n = e, r =
|
|
4385
|
-
return new
|
|
4390
|
+
var n = e, r = Yn("orderBy", t);
|
|
4391
|
+
return new tr(r, n);
|
|
4386
4392
|
}
|
|
4387
4393
|
|
|
4388
|
-
var
|
|
4394
|
+
var nr = /** @class */ function(e) {
|
|
4389
4395
|
function n(t, n, r) {
|
|
4390
4396
|
var i = this;
|
|
4391
|
-
return (i = e.call(this) || this).type = t, i.gt = n, i.
|
|
4397
|
+
return (i = e.call(this) || this).type = t, i.gt = n, i.bt = r, i;
|
|
4392
4398
|
}
|
|
4393
4399
|
return t(n, e), n.prototype._apply = function(t) {
|
|
4394
|
-
return new
|
|
4400
|
+
return new sn(t.firestore, t.converter, function(t, e, n) {
|
|
4395
4401
|
return new se(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), e, n, t.startAt, t.endAt);
|
|
4396
|
-
}(t._query, this.gt, this.
|
|
4402
|
+
}(t._query, this.gt, this.bt));
|
|
4397
4403
|
}, n;
|
|
4398
|
-
}(
|
|
4404
|
+
}($n);
|
|
4399
4405
|
|
|
4400
4406
|
/**
|
|
4401
4407
|
* Creates a {@link QueryConstraint} that only returns the first matching documents.
|
|
4402
4408
|
*
|
|
4403
4409
|
* @param limit - The maximum number of items to return.
|
|
4404
4410
|
* @returns The created {@link Query}.
|
|
4405
|
-
*/ function
|
|
4406
|
-
return ut("limit", t), new
|
|
4411
|
+
*/ function rr(t) {
|
|
4412
|
+
return ut("limit", t), new nr("limit", t, "F" /* First */)
|
|
4407
4413
|
/**
|
|
4408
4414
|
* Creates a {@link QueryConstraint} that only returns the last matching documents.
|
|
4409
4415
|
*
|
|
@@ -4415,60 +4421,62 @@ var rr = /** @class */ function(e) {
|
|
|
4415
4421
|
*/;
|
|
4416
4422
|
}
|
|
4417
4423
|
|
|
4418
|
-
function
|
|
4419
|
-
return ut("limitToLast", t), new
|
|
4424
|
+
function ir(t) {
|
|
4425
|
+
return ut("limitToLast", t), new nr("limitToLast", t, "L" /* Last */);
|
|
4420
4426
|
}
|
|
4421
4427
|
|
|
4422
|
-
var
|
|
4428
|
+
var or = /** @class */ function(e) {
|
|
4423
4429
|
function n(t, n, r) {
|
|
4424
4430
|
var i = this;
|
|
4425
|
-
return (i = e.call(this) || this).type = t, i.
|
|
4431
|
+
return (i = e.call(this) || this).type = t, i.vt = n, i.Et = r, i;
|
|
4426
4432
|
}
|
|
4427
4433
|
return t(n, e), n.prototype._apply = function(t) {
|
|
4428
|
-
var e =
|
|
4429
|
-
return new
|
|
4434
|
+
var e = fr(t, this.type, this.vt, this.Et);
|
|
4435
|
+
return new sn(t.firestore, t.converter, function(t, e) {
|
|
4430
4436
|
return new se(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), t.limit, t.limitType, e, t.endAt);
|
|
4431
4437
|
}(t._query, e));
|
|
4432
4438
|
}, n;
|
|
4433
|
-
}(
|
|
4439
|
+
}($n);
|
|
4434
4440
|
|
|
4435
|
-
function
|
|
4441
|
+
function ar() {
|
|
4436
4442
|
for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
|
|
4437
|
-
return new
|
|
4443
|
+
return new or("startAt", t,
|
|
4444
|
+
/*inclusive=*/ !0);
|
|
4438
4445
|
}
|
|
4439
4446
|
|
|
4440
|
-
function
|
|
4447
|
+
function sr() {
|
|
4441
4448
|
for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
|
|
4442
|
-
return new
|
|
4443
|
-
/*
|
|
4449
|
+
return new or("startAfter", t,
|
|
4450
|
+
/*inclusive=*/ !1);
|
|
4444
4451
|
}
|
|
4445
4452
|
|
|
4446
|
-
var
|
|
4453
|
+
var ur = /** @class */ function(e) {
|
|
4447
4454
|
function n(t, n, r) {
|
|
4448
4455
|
var i = this;
|
|
4449
|
-
return (i = e.call(this) || this).type = t, i.
|
|
4456
|
+
return (i = e.call(this) || this).type = t, i.vt = n, i.Et = r, i;
|
|
4450
4457
|
}
|
|
4451
4458
|
return t(n, e), n.prototype._apply = function(t) {
|
|
4452
|
-
var e =
|
|
4453
|
-
return new
|
|
4459
|
+
var e = fr(t, this.type, this.vt, this.Et);
|
|
4460
|
+
return new sn(t.firestore, t.converter, function(t, e) {
|
|
4454
4461
|
return new se(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), t.limit, t.limitType, t.startAt, e);
|
|
4455
4462
|
}(t._query, e));
|
|
4456
4463
|
}, n;
|
|
4457
|
-
}(
|
|
4464
|
+
}($n);
|
|
4458
4465
|
|
|
4459
|
-
function
|
|
4466
|
+
function cr() {
|
|
4460
4467
|
for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
|
|
4461
|
-
return new
|
|
4468
|
+
return new ur("endBefore", t,
|
|
4469
|
+
/*inclusive=*/ !1);
|
|
4462
4470
|
}
|
|
4463
4471
|
|
|
4464
|
-
function
|
|
4472
|
+
function lr() {
|
|
4465
4473
|
for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
|
|
4466
|
-
return new
|
|
4474
|
+
return new ur("endAt", t, /*inclusive=*/ !0);
|
|
4467
4475
|
}
|
|
4468
4476
|
|
|
4469
|
-
/** Helper function to create a bound from a document or fields */ function
|
|
4470
|
-
if (n[0] = p(n[0]), n[0] instanceof
|
|
4471
|
-
if (!r) throw new U(
|
|
4477
|
+
/** Helper function to create a bound from a document or fields */ function fr(t, e, n, r) {
|
|
4478
|
+
if (n[0] = p(n[0]), n[0] instanceof Qn) return function(t, e, n, r, i) {
|
|
4479
|
+
if (!r) throw new U(P, "Can't use a DocumentSnapshot that doesn't exist for " + n + "().");
|
|
4472
4480
|
// Because people expect to continue/end a query at the exact document
|
|
4473
4481
|
// provided, we need to use the implicit sort order rather than the explicit
|
|
4474
4482
|
// sort order, because it's guaranteed to contain the document key. That way
|
|
@@ -4480,7 +4488,7 @@ function fr() {
|
|
|
4480
4488
|
var u = s[a];
|
|
4481
4489
|
if (u.field.isKeyField()) o.push(Rt(e, r.key)); else {
|
|
4482
4490
|
var c = r.data.field(u.field);
|
|
4483
|
-
if (
|
|
4491
|
+
if (Pt(c)) throw new U(V, 'Invalid query. You are trying to start or end a query using a document for which the field "' + u.field + '" is an uncommitted server timestamp. (Since the value of this field is unknown, you cannot start/end a query with it.)');
|
|
4484
4492
|
if (null === c) {
|
|
4485
4493
|
var l = u.field.canonicalString();
|
|
4486
4494
|
throw new U(V, "Invalid query. You are trying to start or end a query using a document for which the field '" + l + "' (used as the orderBy) does not exist.");
|
|
@@ -4490,7 +4498,7 @@ function fr() {
|
|
|
4490
4498
|
}
|
|
4491
4499
|
return new re(o, i);
|
|
4492
4500
|
}(t._query, t.firestore._databaseId, e, n[0]._document, r);
|
|
4493
|
-
var i =
|
|
4501
|
+
var i = In(t.firestore);
|
|
4494
4502
|
return function(t, e, n, r, i, o) {
|
|
4495
4503
|
// Use explicit order by's because it has to match the query the user made
|
|
4496
4504
|
var a = t.explicitOrderBy;
|
|
@@ -4505,7 +4513,7 @@ function fr() {
|
|
|
4505
4513
|
var f = new nt(l);
|
|
4506
4514
|
s.push(Rt(e, f));
|
|
4507
4515
|
} else {
|
|
4508
|
-
var h =
|
|
4516
|
+
var h = Cn(n, r, c);
|
|
4509
4517
|
s.push(h);
|
|
4510
4518
|
}
|
|
4511
4519
|
}
|
|
@@ -4513,7 +4521,7 @@ function fr() {
|
|
|
4513
4521
|
}(t._query, t.firestore._databaseId, i, e, n, r);
|
|
4514
4522
|
}
|
|
4515
4523
|
|
|
4516
|
-
function
|
|
4524
|
+
function hr(t, e, n) {
|
|
4517
4525
|
if ("string" == typeof (n = p(n))) {
|
|
4518
4526
|
if ("" === n) throw new U(V, "Invalid query. When querying with documentId(), you must provide a valid document ID, but it was an empty string.");
|
|
4519
4527
|
if (!fe(e) && -1 !== n.indexOf("/")) throw new U(V, "Invalid query. When querying a collection by documentId(), you must provide a plain document ID, but '" + n + "' contains a '/' character.");
|
|
@@ -4521,19 +4529,19 @@ function pr(t, e, n) {
|
|
|
4521
4529
|
if (!nt.isDocumentKey(r)) throw new U(V, "Invalid query. When querying a collection group by documentId(), the value provided must result in a valid document path, but '" + r + "' is not because it has an odd number of segments (" + r.length + ").");
|
|
4522
4530
|
return Rt(t, new nt(r));
|
|
4523
4531
|
}
|
|
4524
|
-
if (n instanceof
|
|
4532
|
+
if (n instanceof an) return Rt(t, n._key);
|
|
4525
4533
|
throw new U(V, "Invalid query. When querying with documentId(), you must provide a valid string or a DocumentReference, but it was: " + at(n) + ".");
|
|
4526
4534
|
}
|
|
4527
4535
|
|
|
4528
4536
|
/**
|
|
4529
4537
|
* Validates that the value passed into a disjunctive filter satisfies all
|
|
4530
4538
|
* array requirements.
|
|
4531
|
-
*/ function
|
|
4539
|
+
*/ function pr(t, e) {
|
|
4532
4540
|
if (!Array.isArray(t) || 0 === t.length) throw new U(V, "Invalid Query. A non-empty array is required for '" + e.toString() + "' filters.");
|
|
4533
4541
|
if (t.length > 10) throw new U(V, "Invalid Query. '" + e.toString() + "' filters support a maximum of 10 elements in the value array.");
|
|
4534
4542
|
}
|
|
4535
4543
|
|
|
4536
|
-
function
|
|
4544
|
+
function dr(t, e, n) {
|
|
4537
4545
|
if (!n.isEqual(e)) throw new U(V, "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.");
|
|
4538
4546
|
}
|
|
4539
4547
|
|
|
@@ -4583,23 +4591,23 @@ function mr(t, e, n) {
|
|
|
4583
4591
|
* because we want to provide the user with a more specific error message if
|
|
4584
4592
|
* their `set()` or fails due to invalid data originating from a `toFirestore()`
|
|
4585
4593
|
* call.
|
|
4586
|
-
*/ function
|
|
4594
|
+
*/ function mr(t, e, n) {
|
|
4587
4595
|
// Cast to `any` in order to satisfy the union type constraint on
|
|
4588
4596
|
// toFirestore().
|
|
4589
4597
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4590
4598
|
return t ? n && (n.merge || n.mergeFields) ? t.toFirestore(e, n) : t.toFirestore(e) : e;
|
|
4591
4599
|
}
|
|
4592
4600
|
|
|
4593
|
-
var
|
|
4601
|
+
var yr = /** @class */ function(e) {
|
|
4594
4602
|
function n(t) {
|
|
4595
4603
|
var n = this;
|
|
4596
4604
|
return (n = e.call(this) || this).firestore = t, n;
|
|
4597
4605
|
}
|
|
4598
4606
|
return t(n, e), n.prototype.convertBytes = function(t) {
|
|
4599
|
-
return new
|
|
4607
|
+
return new yn(t);
|
|
4600
4608
|
}, n.prototype.convertReference = function(t) {
|
|
4601
4609
|
var e = this.convertDocumentKey(t, this.firestore._databaseId);
|
|
4602
|
-
return new
|
|
4610
|
+
return new an(this.firestore, /* converter= */ null, e);
|
|
4603
4611
|
}, n;
|
|
4604
4612
|
}(/** @class */ function() {
|
|
4605
4613
|
function t() {}
|
|
@@ -4647,7 +4655,7 @@ var vr = /** @class */ function(e) {
|
|
|
4647
4655
|
r[t] = n.convertValue(i, e);
|
|
4648
4656
|
})), r;
|
|
4649
4657
|
}, t.prototype.convertGeoPoint = function(t) {
|
|
4650
|
-
return new
|
|
4658
|
+
return new gn(Vt(t.latitude), Vt(t.longitude));
|
|
4651
4659
|
}, t.prototype.convertArray = function(t, e) {
|
|
4652
4660
|
var n = this;
|
|
4653
4661
|
return (t.values || []).map((function(t) {
|
|
@@ -4656,7 +4664,7 @@ var vr = /** @class */ function(e) {
|
|
|
4656
4664
|
}, t.prototype.convertServerTimestamp = function(t, e) {
|
|
4657
4665
|
switch (e) {
|
|
4658
4666
|
case "previous":
|
|
4659
|
-
var n =
|
|
4667
|
+
var n = Nt(t);
|
|
4660
4668
|
return null == n ? null : this.convertValue(n, e);
|
|
4661
4669
|
|
|
4662
4670
|
case "estimate":
|
|
@@ -4670,7 +4678,7 @@ var vr = /** @class */ function(e) {
|
|
|
4670
4678
|
return new bt(e.seconds, e.nanos);
|
|
4671
4679
|
}, t.prototype.convertDocumentKey = function(t, e) {
|
|
4672
4680
|
var n = Z.fromString(t);
|
|
4673
|
-
E(
|
|
4681
|
+
E(ze(n));
|
|
4674
4682
|
var r = new X(n.get(1), n.get(3)), i = new nt(n.popFirst(5));
|
|
4675
4683
|
return r.isEqual(e) ||
|
|
4676
4684
|
// TODO(b/64130202): Somehow support foreign references.
|
|
@@ -4691,12 +4699,12 @@ var vr = /** @class */ function(e) {
|
|
|
4691
4699
|
* @param reference - The reference of the document to fetch.
|
|
4692
4700
|
* @returns A Promise resolved with a `DocumentSnapshot` containing the current
|
|
4693
4701
|
* document contents.
|
|
4694
|
-
*/ function
|
|
4695
|
-
var e =
|
|
4696
|
-
return
|
|
4702
|
+
*/ function vr(t) {
|
|
4703
|
+
var e = Je((t = st(t, an)).firestore), n = new yr(t.firestore);
|
|
4704
|
+
return Ye(e, [ t._key ]).then((function(e) {
|
|
4697
4705
|
E(1 === e.length);
|
|
4698
4706
|
var r = e[0];
|
|
4699
|
-
return new
|
|
4707
|
+
return new Qn(t.firestore, n, t._key, r.isFoundDocument() ? r : null, t.converter);
|
|
4700
4708
|
}));
|
|
4701
4709
|
}
|
|
4702
4710
|
|
|
@@ -4711,35 +4719,35 @@ var vr = /** @class */ function(e) {
|
|
|
4711
4719
|
*
|
|
4712
4720
|
* @param query - The `Query` to execute.
|
|
4713
4721
|
* @returns A Promise that will be resolved with the results of the query.
|
|
4714
|
-
*/ function
|
|
4722
|
+
*/ function gr(t) {
|
|
4715
4723
|
!function(t) {
|
|
4716
4724
|
if (ue(t) && 0 === t.explicitOrderBy.length) throw new U(L, "limitToLast() queries require specifying at least one orderBy() clause");
|
|
4717
|
-
}((t = st(t,
|
|
4718
|
-
var e =
|
|
4719
|
-
return
|
|
4725
|
+
}((t = st(t, sn))._query);
|
|
4726
|
+
var e = Je(t.firestore), n = new yr(t.firestore);
|
|
4727
|
+
return $e(e, t._query).then((function(e) {
|
|
4720
4728
|
var r = e.map((function(e) {
|
|
4721
|
-
return new
|
|
4729
|
+
return new Kn(t.firestore, n, e.key, e, t.converter);
|
|
4722
4730
|
}));
|
|
4723
4731
|
return ue(t._query) &&
|
|
4724
4732
|
// Limit to last queries reverse the orderBy constraint that was
|
|
4725
4733
|
// specified by the user. As such, we need to reverse the order of the
|
|
4726
4734
|
// results to return the documents in the expected order.
|
|
4727
|
-
r.reverse(), new
|
|
4735
|
+
r.reverse(), new Hn(t, r);
|
|
4728
4736
|
}));
|
|
4729
4737
|
}
|
|
4730
4738
|
|
|
4731
|
-
function
|
|
4732
|
-
var r =
|
|
4733
|
-
return
|
|
4739
|
+
function wr(t, e, n) {
|
|
4740
|
+
var r = mr((t = st(t, an)).converter, e, n), i = An(In(t.firestore), "setDoc", t._key, r, null !== t.converter, n);
|
|
4741
|
+
return We(Je(t.firestore), [ i.toMutation(t._key, _e.none()) ]);
|
|
4734
4742
|
}
|
|
4735
4743
|
|
|
4736
|
-
function
|
|
4744
|
+
function br(t, e, n) {
|
|
4737
4745
|
for (var r = [], i = 3; i < arguments.length; i++) r[i - 3] = arguments[i];
|
|
4738
|
-
var o, a =
|
|
4746
|
+
var o, a = In((t = st(t, an)).firestore);
|
|
4739
4747
|
// For Compat types, we have to "extract" the underlying types before
|
|
4740
4748
|
// performing validation.
|
|
4741
|
-
return o = "string" == typeof (e = p(e)) || e instanceof
|
|
4742
|
-
|
|
4749
|
+
return o = "string" == typeof (e = p(e)) || e instanceof dn ? On(a, "updateDoc", t._key, e, n, r) : Fn(a, "updateDoc", t._key, e),
|
|
4750
|
+
We(Je(t.firestore), [ o.toMutation(t._key, _e.exists(!0)) ]);
|
|
4743
4751
|
}
|
|
4744
4752
|
|
|
4745
4753
|
/**
|
|
@@ -4753,8 +4761,8 @@ function _r(t, e, n) {
|
|
|
4753
4761
|
* @param reference - A reference to the document to delete.
|
|
4754
4762
|
* @returns A `Promise` resolved once the document has been successfully
|
|
4755
4763
|
* deleted from the backend.
|
|
4756
|
-
*/ function
|
|
4757
|
-
return
|
|
4764
|
+
*/ function _r(t) {
|
|
4765
|
+
return We(Je((t = st(t, an)).firestore), [ new Ie(t._key, _e.none()) ]);
|
|
4758
4766
|
}
|
|
4759
4767
|
|
|
4760
4768
|
/**
|
|
@@ -4771,9 +4779,9 @@ function _r(t, e, n) {
|
|
|
4771
4779
|
* @throws Error - If the provided input is not a valid Firestore document.
|
|
4772
4780
|
* @returns A `Promise` resolved with a `DocumentReference` pointing to the
|
|
4773
4781
|
* newly created document after it has been written to the backend.
|
|
4774
|
-
*/ function
|
|
4775
|
-
var n =
|
|
4776
|
-
return
|
|
4782
|
+
*/ function Tr(t, e) {
|
|
4783
|
+
var n = fn(t = st(t, un)), r = mr(t.converter, e), i = An(In(t.firestore), "addDoc", n._key, r, null !== n.converter, {});
|
|
4784
|
+
return We(Je(t.firestore), [ i.toMutation(n._key, _e.exists(!1)) ]).then((function() {
|
|
4777
4785
|
return n;
|
|
4778
4786
|
}));
|
|
4779
4787
|
}
|
|
@@ -4797,15 +4805,15 @@ function _r(t, e, n) {
|
|
|
4797
4805
|
/**
|
|
4798
4806
|
* Returns a sentinel for use with {@link @firebase/firestore/lite#(updateDoc:1)} or
|
|
4799
4807
|
* {@link @firebase/firestore/lite#(setDoc:1)} with `{merge: true}` to mark a field for deletion.
|
|
4800
|
-
*/ function
|
|
4801
|
-
return new
|
|
4808
|
+
*/ function Sr() {
|
|
4809
|
+
return new kn("deleteField");
|
|
4802
4810
|
}
|
|
4803
4811
|
|
|
4804
4812
|
/**
|
|
4805
4813
|
* Returns a sentinel used with {@link @firebase/firestore/lite#(setDoc:1)} or {@link @firebase/firestore/lite#(updateDoc:1)} to
|
|
4806
4814
|
* include a server-generated timestamp in the written data.
|
|
4807
|
-
*/ function
|
|
4808
|
-
return new
|
|
4815
|
+
*/ function Er() {
|
|
4816
|
+
return new Dn("serverTimestamp");
|
|
4809
4817
|
}
|
|
4810
4818
|
|
|
4811
4819
|
/**
|
|
@@ -4819,7 +4827,7 @@ function _r(t, e, n) {
|
|
|
4819
4827
|
* @param elements - The elements to union into the array.
|
|
4820
4828
|
* @returns The `FieldValue` sentinel for use in a call to `setDoc()` or
|
|
4821
4829
|
* `updateDoc()`.
|
|
4822
|
-
*/ function
|
|
4830
|
+
*/ function Ir() {
|
|
4823
4831
|
for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
|
|
4824
4832
|
// NOTE: We don't actually parse the data until it's used in set() or
|
|
4825
4833
|
// update() since we'd need the Firestore instance to do this.
|
|
@@ -4836,11 +4844,11 @@ function _r(t, e, n) {
|
|
|
4836
4844
|
* @param elements - The elements to remove from the array.
|
|
4837
4845
|
* @returns The `FieldValue` sentinel for use in a call to `setDoc()` or
|
|
4838
4846
|
* `updateDoc()`
|
|
4839
|
-
*/ function
|
|
4847
|
+
*/ function Ar() {
|
|
4840
4848
|
for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
|
|
4841
4849
|
// NOTE: We don't actually parse the data until it's used in set() or
|
|
4842
4850
|
// update() since we'd need the Firestore instance to do this.
|
|
4843
|
-
return new
|
|
4851
|
+
return new Nn("arrayRemove", t);
|
|
4844
4852
|
}
|
|
4845
4853
|
|
|
4846
4854
|
/**
|
|
@@ -4861,8 +4869,8 @@ function _r(t, e, n) {
|
|
|
4861
4869
|
* @param n - The value to increment by.
|
|
4862
4870
|
* @returns The `FieldValue` sentinel for use in a call to `setDoc()` or
|
|
4863
4871
|
* `updateDoc()`
|
|
4864
|
-
*/ function
|
|
4865
|
-
return new
|
|
4872
|
+
*/ function kr(t) {
|
|
4873
|
+
return new qn("increment", t);
|
|
4866
4874
|
}
|
|
4867
4875
|
|
|
4868
4876
|
/**
|
|
@@ -4888,23 +4896,23 @@ function _r(t, e, n) {
|
|
|
4888
4896
|
* provides methods for adding writes to the write batch. None of the writes
|
|
4889
4897
|
* will be committed (or visible locally) until {@link WriteBatch.commit} is
|
|
4890
4898
|
* called.
|
|
4891
|
-
*/ var
|
|
4899
|
+
*/ var Vr = /** @class */ function() {
|
|
4892
4900
|
/** @hideconstructor */
|
|
4893
4901
|
function t(t, e) {
|
|
4894
4902
|
this._firestore = t, this._commitHandler = e, this._mutations = [], this._committed = !1,
|
|
4895
|
-
this._dataReader =
|
|
4903
|
+
this._dataReader = In(t);
|
|
4896
4904
|
}
|
|
4897
4905
|
return t.prototype.set = function(t, e, n) {
|
|
4898
4906
|
this._verifyNotCommitted();
|
|
4899
|
-
var r =
|
|
4907
|
+
var r = Dr(t, this._firestore), i = mr(r.converter, e, n), o = An(this._dataReader, "WriteBatch.set", r._key, i, null !== r.converter, n);
|
|
4900
4908
|
return this._mutations.push(o.toMutation(r._key, _e.none())), this;
|
|
4901
4909
|
}, t.prototype.update = function(t, e, n) {
|
|
4902
4910
|
for (var r = [], i = 3; i < arguments.length; i++) r[i - 3] = arguments[i];
|
|
4903
4911
|
this._verifyNotCommitted();
|
|
4904
|
-
var o, a =
|
|
4912
|
+
var o, a = Dr(t, this._firestore);
|
|
4905
4913
|
// For Compat types, we have to "extract" the underlying types before
|
|
4906
4914
|
// performing validation.
|
|
4907
|
-
return o = "string" == typeof (e = p(e)) || e instanceof
|
|
4915
|
+
return o = "string" == typeof (e = p(e)) || e instanceof dn ? On(this._dataReader, "WriteBatch.update", a._key, e, n, r) : Fn(this._dataReader, "WriteBatch.update", a._key, e),
|
|
4908
4916
|
this._mutations.push(o.toMutation(a._key, _e.exists(!0))), this;
|
|
4909
4917
|
},
|
|
4910
4918
|
/**
|
|
@@ -4915,7 +4923,7 @@ function _r(t, e, n) {
|
|
|
4915
4923
|
*/
|
|
4916
4924
|
t.prototype.delete = function(t) {
|
|
4917
4925
|
this._verifyNotCommitted();
|
|
4918
|
-
var e =
|
|
4926
|
+
var e = Dr(t, this._firestore);
|
|
4919
4927
|
return this._mutations = this._mutations.concat(new Ie(e._key, _e.none())), this;
|
|
4920
4928
|
},
|
|
4921
4929
|
/**
|
|
@@ -4937,7 +4945,7 @@ function _r(t, e, n) {
|
|
|
4937
4945
|
}, t;
|
|
4938
4946
|
}();
|
|
4939
4947
|
|
|
4940
|
-
function
|
|
4948
|
+
function Dr(t, e) {
|
|
4941
4949
|
if ((t = p(t)).firestore !== e) throw new U(V, "Provided document reference is from a different Firestore instance.");
|
|
4942
4950
|
return t;
|
|
4943
4951
|
}
|
|
@@ -4955,9 +4963,9 @@ function Nr(t, e) {
|
|
|
4955
4963
|
* @returns A `WriteBatch` that can be used to atomically execute multiple
|
|
4956
4964
|
* writes.
|
|
4957
4965
|
*/ function Pr(t) {
|
|
4958
|
-
var e =
|
|
4959
|
-
return new
|
|
4960
|
-
return
|
|
4966
|
+
var e = Je(t = st(t, tn));
|
|
4967
|
+
return new Vr(t, (function(t) {
|
|
4968
|
+
return We(e, t);
|
|
4961
4969
|
}));
|
|
4962
4970
|
}
|
|
4963
4971
|
|
|
@@ -4980,7 +4988,7 @@ function Nr(t, e) {
|
|
|
4980
4988
|
/**
|
|
4981
4989
|
* Internal transaction object responsible for accumulating the mutations to
|
|
4982
4990
|
* perform and the base versions for any documents read.
|
|
4983
|
-
*/ var
|
|
4991
|
+
*/ var Nr = /** @class */ function() {
|
|
4984
4992
|
function t(t) {
|
|
4985
4993
|
this.datastore = t,
|
|
4986
4994
|
// The version of each document that was read during this transaction.
|
|
@@ -5005,7 +5013,7 @@ function Nr(t, e) {
|
|
|
5005
5013
|
switch (n.label) {
|
|
5006
5014
|
case 0:
|
|
5007
5015
|
if (this.ensureCommitNotCalled(), this.mutations.length > 0) throw new U(V, "Firestore transactions require all reads to be executed before all writes.");
|
|
5008
|
-
return [ 4 /*yield*/ ,
|
|
5016
|
+
return [ 4 /*yield*/ , Ye(this.datastore, t) ];
|
|
5009
5017
|
|
|
5010
5018
|
case 1:
|
|
5011
5019
|
return [ 2 /*return*/ , ((e = n.sent()).forEach((function(t) {
|
|
@@ -5042,7 +5050,7 @@ function Nr(t, e) {
|
|
|
5042
5050
|
t.forEach((function(t, n) {
|
|
5043
5051
|
var r = nt.fromPath(n);
|
|
5044
5052
|
e.mutations.push(new Ae(r, e.precondition(r)));
|
|
5045
|
-
})), [ 4 /*yield*/ ,
|
|
5053
|
+
})), [ 4 /*yield*/ , We(this.datastore, this.mutations) ];
|
|
5046
5054
|
|
|
5047
5055
|
case 1:
|
|
5048
5056
|
// For each mutation, note that the doc was written.
|
|
@@ -5100,10 +5108,10 @@ function Nr(t, e) {
|
|
|
5100
5108
|
}, t.prototype.write = function(t) {
|
|
5101
5109
|
this.ensureCommitNotCalled(), this.mutations.push(t);
|
|
5102
5110
|
}, t.prototype.ensureCommitNotCalled = function() {}, t;
|
|
5103
|
-
}(),
|
|
5111
|
+
}(), qr = /** @class */ function() {
|
|
5104
5112
|
function t(t, e, n, r) {
|
|
5105
5113
|
this.asyncQueue = t, this.datastore = e, this.updateFunction = n, this.deferred = r,
|
|
5106
|
-
this.Tt = 5, this.It = new
|
|
5114
|
+
this.Tt = 5, this.It = new Ke(this.asyncQueue, "transaction_retry" /* TransactionRetry */)
|
|
5107
5115
|
/** Runs the transaction and sets the result on deferred. */;
|
|
5108
5116
|
}
|
|
5109
5117
|
return t.prototype.run = function() {
|
|
@@ -5114,7 +5122,7 @@ function Nr(t, e) {
|
|
|
5114
5122
|
return e(t, void 0, void 0, (function() {
|
|
5115
5123
|
var t, e, r = this;
|
|
5116
5124
|
return n(this, (function(n) {
|
|
5117
|
-
return t = new
|
|
5125
|
+
return t = new Nr(this.datastore), (e = this.Rt(t)) && e.then((function(e) {
|
|
5118
5126
|
r.asyncQueue.enqueueAndForget((function() {
|
|
5119
5127
|
return t.commit().then((function() {
|
|
5120
5128
|
r.deferred.resolve(e);
|
|
@@ -5171,9 +5179,9 @@ function Nr(t, e) {
|
|
|
5171
5179
|
return !1;
|
|
5172
5180
|
|
|
5173
5181
|
case V:
|
|
5174
|
-
case N:
|
|
5175
|
-
case "already-exists":
|
|
5176
5182
|
case P:
|
|
5183
|
+
case "already-exists":
|
|
5184
|
+
case N:
|
|
5177
5185
|
case O:
|
|
5178
5186
|
// Aborted might be retried in some scenarios, but that is dependant on
|
|
5179
5187
|
// the context and should handled individually by the calling code.
|
|
@@ -5226,7 +5234,7 @@ function Nr(t, e) {
|
|
|
5226
5234
|
* See the License for the specific language governing permissions and
|
|
5227
5235
|
* limitations under the License.
|
|
5228
5236
|
*/
|
|
5229
|
-
/** The Platform's 'document' implementation or null if not available. */ function
|
|
5237
|
+
/** The Platform's 'document' implementation or null if not available. */ function Fr() {
|
|
5230
5238
|
// `document` is not always available, e.g. in ReactNative and WebWorkers.
|
|
5231
5239
|
// eslint-disable-next-line no-restricted-globals
|
|
5232
5240
|
return "undefined" != typeof document ? document : null;
|
|
@@ -5258,7 +5266,7 @@ function Nr(t, e) {
|
|
|
5258
5266
|
* Note: We implement `PromiseLike` instead of `Promise`, as the `Promise` type
|
|
5259
5267
|
* in newer versions of TypeScript defines `finally`, which is not available in
|
|
5260
5268
|
* IE.
|
|
5261
|
-
*/ var
|
|
5269
|
+
*/ var Or = /** @class */ function() {
|
|
5262
5270
|
function t(t, e, n, r, i) {
|
|
5263
5271
|
this.asyncQueue = t, this.timerId = e, this.targetTimeMs = n, this.op = r, this.removalCallback = i,
|
|
5264
5272
|
this.deferred = new x, this.then = this.deferred.promise.then.bind(this.deferred.promise),
|
|
@@ -5322,7 +5330,7 @@ function Nr(t, e) {
|
|
|
5322
5330
|
null !== this.timerHandle && (this.removalCallback(this), clearTimeout(this.timerHandle),
|
|
5323
5331
|
this.timerHandle = null);
|
|
5324
5332
|
}, t;
|
|
5325
|
-
}(),
|
|
5333
|
+
}(), Cr = /** @class */ function() {
|
|
5326
5334
|
function t() {
|
|
5327
5335
|
var t = this;
|
|
5328
5336
|
// The last promise in the queue.
|
|
@@ -5346,15 +5354,15 @@ function Nr(t, e) {
|
|
|
5346
5354
|
// List of TimerIds to fast-forward delays for.
|
|
5347
5355
|
this.Ot = [],
|
|
5348
5356
|
// Backoff timer used to schedule retries for retryable operations
|
|
5349
|
-
this.It = new
|
|
5357
|
+
this.It = new Ke(this, "async_queue_retry" /* AsyncQueueRetry */),
|
|
5350
5358
|
// Visibility handler that triggers an immediate retry of all retryable
|
|
5351
5359
|
// operations. Meant to speed up recovery when we regain file system access
|
|
5352
5360
|
// after page comes into foreground.
|
|
5353
5361
|
this.Ct = function() {
|
|
5354
|
-
var e =
|
|
5362
|
+
var e = Fr();
|
|
5355
5363
|
e && w("AsyncQueue", "Visibility state changed to " + e.visibilityState), t.It.H();
|
|
5356
5364
|
};
|
|
5357
|
-
var e =
|
|
5365
|
+
var e = Fr();
|
|
5358
5366
|
e && "function" == typeof e.addEventListener && e.addEventListener("visibilitychange", this.Ct);
|
|
5359
5367
|
}
|
|
5360
5368
|
return Object.defineProperty(t.prototype, "isShuttingDown", {
|
|
@@ -5378,7 +5386,7 @@ function Nr(t, e) {
|
|
|
5378
5386
|
}, t.prototype.enterRestrictedMode = function(t) {
|
|
5379
5387
|
if (!this.$t) {
|
|
5380
5388
|
this.$t = !0, this.qt = t || !1;
|
|
5381
|
-
var e =
|
|
5389
|
+
var e = Fr();
|
|
5382
5390
|
e && "function" == typeof e.removeEventListener && e.removeEventListener("visibilitychange", this.Ct);
|
|
5383
5391
|
}
|
|
5384
5392
|
}, t.prototype.enqueue = function(t) {
|
|
@@ -5476,7 +5484,7 @@ function Nr(t, e) {
|
|
|
5476
5484
|
this.Lt(),
|
|
5477
5485
|
// Fast-forward delays for timerIds that have been overriden.
|
|
5478
5486
|
this.Ot.indexOf(t) > -1 && (e = 0);
|
|
5479
|
-
var i =
|
|
5487
|
+
var i = Or.createAndSchedule(this, t, e, n, (function(t) {
|
|
5480
5488
|
return r.jt(t);
|
|
5481
5489
|
}));
|
|
5482
5490
|
return this.St.push(i), i;
|
|
@@ -5551,10 +5559,10 @@ function Nr(t, e) {
|
|
|
5551
5559
|
var e = this.St.indexOf(t);
|
|
5552
5560
|
this.St.splice(e, 1);
|
|
5553
5561
|
}, t;
|
|
5554
|
-
}(),
|
|
5562
|
+
}(), jr = /** @class */ function() {
|
|
5555
5563
|
/** @hideconstructor */
|
|
5556
5564
|
function t(t, e) {
|
|
5557
|
-
this._firestore = t, this._transaction = e, this._dataReader =
|
|
5565
|
+
this._firestore = t, this._transaction = e, this._dataReader = In(t)
|
|
5558
5566
|
/**
|
|
5559
5567
|
* Reads the document referenced by the provided {@link DocumentReference}.
|
|
5560
5568
|
*
|
|
@@ -5563,23 +5571,23 @@ function Nr(t, e) {
|
|
|
5563
5571
|
*/;
|
|
5564
5572
|
}
|
|
5565
5573
|
return t.prototype.get = function(t) {
|
|
5566
|
-
var e = this, n =
|
|
5574
|
+
var e = this, n = Dr(t, this._firestore), r = new yr(this._firestore);
|
|
5567
5575
|
return this._transaction.lookup([ n._key ]).then((function(t) {
|
|
5568
5576
|
if (!t || 1 !== t.length) return S();
|
|
5569
5577
|
var i = t[0];
|
|
5570
|
-
if (i.isFoundDocument()) return new
|
|
5571
|
-
if (i.isNoDocument()) return new
|
|
5578
|
+
if (i.isFoundDocument()) return new Qn(e._firestore, r, i.key, i, n.converter);
|
|
5579
|
+
if (i.isNoDocument()) return new Qn(e._firestore, r, n._key, null, n.converter);
|
|
5572
5580
|
throw S();
|
|
5573
5581
|
}));
|
|
5574
5582
|
}, t.prototype.set = function(t, e, n) {
|
|
5575
|
-
var r =
|
|
5583
|
+
var r = Dr(t, this._firestore), i = mr(r.converter, e, n), o = An(this._dataReader, "Transaction.set", r._key, i, null !== r.converter, n);
|
|
5576
5584
|
return this._transaction.set(r._key, o), this;
|
|
5577
5585
|
}, t.prototype.update = function(t, e, n) {
|
|
5578
5586
|
for (var r = [], i = 3; i < arguments.length; i++) r[i - 3] = arguments[i];
|
|
5579
|
-
var o, a =
|
|
5587
|
+
var o, a = Dr(t, this._firestore);
|
|
5580
5588
|
// For Compat types, we have to "extract" the underlying types before
|
|
5581
5589
|
// performing validation.
|
|
5582
|
-
return o = "string" == typeof (e = p(e)) || e instanceof
|
|
5590
|
+
return o = "string" == typeof (e = p(e)) || e instanceof dn ? On(this._dataReader, "Transaction.update", a._key, e, n, r) : Fn(this._dataReader, "Transaction.update", a._key, e),
|
|
5583
5591
|
this._transaction.update(a._key, o), this;
|
|
5584
5592
|
},
|
|
5585
5593
|
/**
|
|
@@ -5589,7 +5597,7 @@ function Nr(t, e) {
|
|
|
5589
5597
|
* @returns This `Transaction` instance. Used for chaining method calls.
|
|
5590
5598
|
*/
|
|
5591
5599
|
t.prototype.delete = function(t) {
|
|
5592
|
-
var e =
|
|
5600
|
+
var e = Dr(t, this._firestore);
|
|
5593
5601
|
return this._transaction.delete(e._key), this;
|
|
5594
5602
|
}, t;
|
|
5595
5603
|
}();
|
|
@@ -5627,10 +5635,10 @@ function Nr(t, e) {
|
|
|
5627
5635
|
* `updateFunction `is returned here. Otherwise, if the transaction failed, a
|
|
5628
5636
|
* rejected promise with the corresponding failure error is returned.
|
|
5629
5637
|
*/
|
|
5630
|
-
function
|
|
5631
|
-
var n =
|
|
5632
|
-
return new
|
|
5633
|
-
return e(new
|
|
5638
|
+
function Lr(t, e) {
|
|
5639
|
+
var n = Je(t = st(t, tn)), r = new x;
|
|
5640
|
+
return new qr(new Cr, n, (function(n) {
|
|
5641
|
+
return e(new jr(t, n));
|
|
5634
5642
|
}), r).run(), r.promise
|
|
5635
5643
|
/**
|
|
5636
5644
|
* Firestore Lite
|
|
@@ -5643,11 +5651,11 @@ function Rr(t, e) {
|
|
|
5643
5651
|
}
|
|
5644
5652
|
|
|
5645
5653
|
y = i + "_lite", o(new c("firestore/lite", (function(t, e) {
|
|
5646
|
-
var n = e.options, r = t.getProvider("app").getImmediate(), i = new
|
|
5654
|
+
var n = e.options, r = t.getProvider("app").getImmediate(), i = new tn(r, new Q(t.getProvider("auth-internal")), new Y(t.getProvider("app-check-internal")));
|
|
5647
5655
|
return n && i._setSettings(n), i;
|
|
5648
5656
|
}), "PUBLIC")),
|
|
5649
5657
|
// RUNTIME_ENV and BUILD_TARGET are replaced by real values during the compilation
|
|
5650
|
-
a("firestore-lite", "3.4.
|
|
5658
|
+
a("firestore-lite", "3.4.4-canary.0482aa5b7", ""), a("firestore-lite", "3.4.4-canary.0482aa5b7", "esm5");
|
|
5651
5659
|
|
|
5652
|
-
export {
|
|
5660
|
+
export { yn as Bytes, un as CollectionReference, an as DocumentReference, Qn as DocumentSnapshot, dn as FieldPath, vn as FieldValue, tn as Firestore, U as FirestoreError, gn as GeoPoint, sn as Query, $n as QueryConstraint, Kn as QueryDocumentSnapshot, Hn as QuerySnapshot, bt as Timestamp, jr as Transaction, Vr as WriteBatch, Tr as addDoc, Ar as arrayRemove, Ir as arrayUnion, cn as collection, ln as collectionGroup, rn as connectFirestoreEmulator, _r as deleteDoc, Sr as deleteField, fn as doc, mn as documentId, lr as endAt, cr as endBefore, vr as getDoc, gr as getDocs, nn as getFirestore, kr as increment, en as initializeFirestore, rr as limit, ir as limitToLast, er as orderBy, Xn as query, pn as queryEqual, hn as refEqual, Lr as runTransaction, Er as serverTimestamp, wr as setDoc, g as setLogLevel, Wn as snapshotEqual, sr as startAfter, ar as startAt, on as terminate, br as updateDoc, Zn as where, Pr as writeBatch };
|
|
5653
5661
|
//# sourceMappingURL=index.browser.esm5.js.map
|