@firebase/firestore 3.4.2 → 3.4.3
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 +8 -0
- package/dist/firestore/src/api/snapshot.d.ts +6 -6
- package/dist/firestore/src/lite-api/snapshot.d.ts +2 -2
- package/dist/firestore/test/integration/bootstrap.d.ts +0 -1
- package/dist/firestore/test/integration/util/events_accumulator.d.ts +2 -2
- package/dist/firestore/test/integration/util/firebase_export.d.ts +6 -14
- package/dist/firestore/test/integration/util/helpers.d.ts +18 -18
- package/dist/firestore/test/integration/util/internal_helpers.d.ts +3 -3
- package/dist/firestore/test/integration/util/settings.d.ts +2 -2
- package/dist/firestore/test/unit/api/{blob.test.d.ts → bytes.test.d.ts} +0 -0
- package/dist/firestore/test/util/api_helpers.d.ts +1 -1
- package/dist/firestore/test/util/helpers.d.ts +4 -6
- package/dist/index.d.ts +6 -6
- package/dist/index.esm2017.js +869 -869
- package/dist/index.esm2017.js.map +1 -1
- package/dist/index.esm5.js +1257 -1257
- package/dist/index.esm5.js.map +1 -1
- package/dist/index.node.cjs.js +2674 -24
- package/dist/index.node.cjs.js.map +1 -1
- package/dist/index.node.mjs +2675 -25
- package/dist/index.node.mjs.map +1 -1
- package/dist/index.rn.js +1068 -1068
- package/dist/index.rn.js.map +1 -1
- package/dist/internal.d.ts +8 -8
- package/dist/lite/firestore/src/api/snapshot.d.ts +6 -6
- package/dist/lite/firestore/src/lite-api/snapshot.d.ts +2 -2
- package/dist/lite/firestore/test/integration/bootstrap.d.ts +0 -1
- package/dist/lite/firestore/test/integration/util/events_accumulator.d.ts +2 -2
- package/dist/lite/firestore/test/integration/util/firebase_export.d.ts +6 -14
- package/dist/lite/firestore/test/integration/util/helpers.d.ts +18 -18
- package/dist/lite/firestore/test/integration/util/internal_helpers.d.ts +3 -3
- package/dist/lite/firestore/test/integration/util/settings.d.ts +2 -2
- package/dist/lite/firestore/test/unit/api/{blob.test.d.ts → bytes.test.d.ts} +0 -0
- package/dist/lite/firestore/test/util/api_helpers.d.ts +1 -1
- package/dist/lite/firestore/test/util/helpers.d.ts +4 -6
- package/dist/lite/index.browser.esm2017.js +1136 -1136
- package/dist/lite/index.browser.esm2017.js.map +1 -1
- package/dist/lite/index.browser.esm5.js +105 -105
- package/dist/lite/index.browser.esm5.js.map +1 -1
- package/dist/lite/index.d.ts +2 -2
- package/dist/lite/index.node.cjs.js +11 -12
- package/dist/lite/index.node.cjs.js.map +1 -1
- package/dist/lite/index.node.mjs +11 -12
- package/dist/lite/index.node.mjs.map +1 -1
- package/dist/lite/index.rn.esm2017.js +148 -148
- package/dist/lite/index.rn.esm2017.js.map +1 -1
- package/dist/lite/internal.d.ts +2 -2
- package/dist/lite/packages/firestore/dist/lite/index.browser.esm2017.d.ts +107 -107
- package/dist/lite/packages/firestore/src/api/snapshot.d.ts +6 -6
- package/dist/lite/packages/firestore/src/lite-api/snapshot.d.ts +2 -2
- package/dist/lite/packages/firestore/test/integration/bootstrap.d.ts +0 -1
- package/dist/lite/packages/firestore/test/integration/util/events_accumulator.d.ts +2 -2
- package/dist/lite/packages/firestore/test/integration/util/firebase_export.d.ts +6 -14
- package/dist/lite/packages/firestore/test/integration/util/helpers.d.ts +18 -18
- package/dist/lite/packages/firestore/test/integration/util/internal_helpers.d.ts +3 -3
- package/dist/lite/packages/firestore/test/integration/util/settings.d.ts +2 -2
- package/dist/lite/packages/firestore/test/unit/api/{blob.test.d.ts → bytes.test.d.ts} +0 -0
- package/dist/lite/packages/firestore/test/util/api_helpers.d.ts +1 -1
- package/dist/lite/packages/firestore/test/util/helpers.d.ts +4 -6
- package/dist/lite/private.d.ts +2 -2
- package/dist/packages/firestore/dist/index.esm2017.d.ts +105 -105
- package/dist/packages/firestore/src/api/snapshot.d.ts +6 -6
- package/dist/packages/firestore/src/lite-api/snapshot.d.ts +2 -2
- package/dist/packages/firestore/test/integration/bootstrap.d.ts +0 -1
- package/dist/packages/firestore/test/integration/util/events_accumulator.d.ts +2 -2
- package/dist/packages/firestore/test/integration/util/firebase_export.d.ts +6 -14
- package/dist/packages/firestore/test/integration/util/helpers.d.ts +18 -18
- package/dist/packages/firestore/test/integration/util/internal_helpers.d.ts +3 -3
- package/dist/packages/firestore/test/integration/util/settings.d.ts +2 -2
- package/dist/packages/firestore/test/unit/api/{blob.test.d.ts → bytes.test.d.ts} +0 -0
- package/dist/packages/firestore/test/util/api_helpers.d.ts +1 -1
- package/dist/packages/firestore/test/util/helpers.d.ts +4 -6
- package/dist/private.d.ts +8 -8
- package/package.json +4 -7
- package/dist/firestore/compat/api/blob.d.ts +0 -29
- package/dist/firestore/compat/api/database.d.ts +0 -228
- package/dist/firestore/compat/api/field_path.d.ts +0 -36
- package/dist/firestore/compat/api/field_value.d.ts +0 -29
- package/dist/firestore/compat/api/geo_point.d.ts +0 -17
- package/dist/firestore/compat/api/observer.d.ts +0 -29
- package/dist/firestore/compat/api/timestamp.d.ts +0 -17
- package/dist/firestore/compat/config.d.ts +0 -28
- package/dist/firestore/compat/index.console.d.ts +0 -42
- package/dist/firestore/compat/index.d.ts +0 -49
- package/dist/firestore/compat/index.node.d.ts +0 -22
- package/dist/firestore/compat/index.rn.d.ts +0 -22
- package/dist/firestore/compat/register-module.d.ts +0 -42
- package/dist/firestore/compat/util/input_validation.d.ts +0 -18
- package/dist/lite/firestore/compat/api/blob.d.ts +0 -29
- package/dist/lite/firestore/compat/api/database.d.ts +0 -228
- package/dist/lite/firestore/compat/api/field_path.d.ts +0 -36
- package/dist/lite/firestore/compat/api/field_value.d.ts +0 -29
- package/dist/lite/firestore/compat/api/geo_point.d.ts +0 -17
- package/dist/lite/firestore/compat/api/observer.d.ts +0 -29
- package/dist/lite/firestore/compat/api/timestamp.d.ts +0 -17
- package/dist/lite/firestore/compat/config.d.ts +0 -28
- package/dist/lite/firestore/compat/index.console.d.ts +0 -42
- package/dist/lite/firestore/compat/index.d.ts +0 -49
- package/dist/lite/firestore/compat/index.node.d.ts +0 -22
- package/dist/lite/firestore/compat/index.rn.d.ts +0 -22
- package/dist/lite/firestore/compat/register-module.d.ts +0 -42
- package/dist/lite/firestore/compat/util/input_validation.d.ts +0 -18
- package/dist/lite/packages/firestore/compat/api/blob.d.ts +0 -29
- package/dist/lite/packages/firestore/compat/api/database.d.ts +0 -228
- package/dist/lite/packages/firestore/compat/api/field_path.d.ts +0 -36
- package/dist/lite/packages/firestore/compat/api/field_value.d.ts +0 -29
- package/dist/lite/packages/firestore/compat/api/geo_point.d.ts +0 -17
- package/dist/lite/packages/firestore/compat/api/observer.d.ts +0 -29
- package/dist/lite/packages/firestore/compat/api/timestamp.d.ts +0 -17
- package/dist/lite/packages/firestore/compat/config.d.ts +0 -28
- package/dist/lite/packages/firestore/compat/index.console.d.ts +0 -42
- package/dist/lite/packages/firestore/compat/index.d.ts +0 -49
- package/dist/lite/packages/firestore/compat/index.node.d.ts +0 -22
- package/dist/lite/packages/firestore/compat/index.rn.d.ts +0 -22
- package/dist/lite/packages/firestore/compat/register-module.d.ts +0 -42
- package/dist/lite/packages/firestore/compat/util/input_validation.d.ts +0 -18
- package/dist/lite/src/protos/README.md +0 -2
- package/dist/lite/src/protos/firestore/bundle.proto +0 -121
- package/dist/lite/src/protos/firestore_bundle_proto.ts +0 -93
- package/dist/lite/src/protos/firestore_proto_api.ts +0 -1259
- package/dist/lite/src/protos/google/api/annotations.proto +0 -31
- package/dist/lite/src/protos/google/api/http.proto +0 -370
- package/dist/lite/src/protos/google/firestore/v1/common.proto +0 -84
- package/dist/lite/src/protos/google/firestore/v1/document.proto +0 -151
- package/dist/lite/src/protos/google/firestore/v1/firestore.proto +0 -761
- package/dist/lite/src/protos/google/firestore/v1/query.proto +0 -302
- package/dist/lite/src/protos/google/firestore/v1/write.proto +0 -264
- package/dist/lite/src/protos/google/protobuf/any.proto +0 -155
- package/dist/lite/src/protos/google/protobuf/descriptor.proto +0 -882
- package/dist/lite/src/protos/google/protobuf/empty.proto +0 -52
- package/dist/lite/src/protos/google/protobuf/struct.proto +0 -96
- package/dist/lite/src/protos/google/protobuf/timestamp.proto +0 -137
- package/dist/lite/src/protos/google/protobuf/wrappers.proto +0 -123
- package/dist/lite/src/protos/google/rpc/status.proto +0 -92
- package/dist/lite/src/protos/google/type/latlng.proto +0 -71
- package/dist/lite/src/protos/update.sh +0 -61
- package/dist/packages/firestore/compat/api/blob.d.ts +0 -29
- package/dist/packages/firestore/compat/api/database.d.ts +0 -228
- package/dist/packages/firestore/compat/api/field_path.d.ts +0 -36
- package/dist/packages/firestore/compat/api/field_value.d.ts +0 -29
- package/dist/packages/firestore/compat/api/geo_point.d.ts +0 -17
- package/dist/packages/firestore/compat/api/observer.d.ts +0 -29
- package/dist/packages/firestore/compat/api/timestamp.d.ts +0 -17
- package/dist/packages/firestore/compat/config.d.ts +0 -28
- package/dist/packages/firestore/compat/index.console.d.ts +0 -42
- package/dist/packages/firestore/compat/index.d.ts +0 -49
- package/dist/packages/firestore/compat/index.node.d.ts +0 -22
- package/dist/packages/firestore/compat/index.rn.d.ts +0 -22
- package/dist/packages/firestore/compat/register-module.d.ts +0 -42
- package/dist/packages/firestore/compat/util/input_validation.d.ts +0 -18
- package/dist/src/protos/README.md +0 -2
- package/dist/src/protos/firestore/bundle.proto +0 -121
- package/dist/src/protos/firestore_bundle_proto.ts +0 -93
- package/dist/src/protos/firestore_proto_api.ts +0 -1259
- package/dist/src/protos/google/api/annotations.proto +0 -31
- package/dist/src/protos/google/api/http.proto +0 -370
- package/dist/src/protos/google/firestore/v1/common.proto +0 -84
- package/dist/src/protos/google/firestore/v1/document.proto +0 -151
- package/dist/src/protos/google/firestore/v1/firestore.proto +0 -761
- package/dist/src/protos/google/firestore/v1/query.proto +0 -302
- package/dist/src/protos/google/firestore/v1/write.proto +0 -264
- package/dist/src/protos/google/protobuf/any.proto +0 -155
- package/dist/src/protos/google/protobuf/descriptor.proto +0 -882
- package/dist/src/protos/google/protobuf/empty.proto +0 -52
- package/dist/src/protos/google/protobuf/struct.proto +0 -96
- package/dist/src/protos/google/protobuf/timestamp.proto +0 -137
- package/dist/src/protos/google/protobuf/wrappers.proto +0 -123
- package/dist/src/protos/google/rpc/status.proto +0 -92
- package/dist/src/protos/google/type/latlng.proto +0 -71
- package/dist/src/protos/update.sh +0 -61
|
@@ -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.3", 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", N = "not-found", P = "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
|
/**
|
|
@@ -737,15 +737,15 @@ function dt(t) {
|
|
|
737
737
|
// return Code.OUT_OF_RANGE;
|
|
738
738
|
case 401:
|
|
739
739
|
// Unauthorized
|
|
740
|
-
return
|
|
740
|
+
return q;
|
|
741
741
|
|
|
742
742
|
case 403:
|
|
743
743
|
// Forbidden
|
|
744
|
-
return
|
|
744
|
+
return P;
|
|
745
745
|
|
|
746
746
|
case 404:
|
|
747
747
|
// Not Found
|
|
748
|
-
return
|
|
748
|
+
return N;
|
|
749
749
|
|
|
750
750
|
case 409:
|
|
751
751
|
// Conflict
|
|
@@ -759,7 +759,7 @@ function dt(t) {
|
|
|
759
759
|
|
|
760
760
|
case 429:
|
|
761
761
|
// Too Many Requests
|
|
762
|
-
return
|
|
762
|
+
return F;
|
|
763
763
|
|
|
764
764
|
case 499:
|
|
765
765
|
// Client Closed Request
|
|
@@ -968,7 +968,7 @@ var mt = /** @class */ function(r) {
|
|
|
968
968
|
* limitations under the License.
|
|
969
969
|
*/ var vt = /** @class */ function() {
|
|
970
970
|
function t() {}
|
|
971
|
-
return t.
|
|
971
|
+
return t.R = function() {
|
|
972
972
|
for (
|
|
973
973
|
// Alphanumeric characters
|
|
974
974
|
var t = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", e = Math.floor(256 / t.length) * t.length, n = ""
|
|
@@ -1418,7 +1418,7 @@ var At = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
|
|
|
1418
1418
|
* FieldValueOptions to value().
|
|
1419
1419
|
* - With respect to other ServerTimestampValues, they sort by their
|
|
1420
1420
|
* localWriteTime.
|
|
1421
|
-
*/ function
|
|
1421
|
+
*/ function Nt(t) {
|
|
1422
1422
|
var e, n;
|
|
1423
1423
|
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
1424
|
}
|
|
@@ -1428,14 +1428,14 @@ var At = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
|
|
|
1428
1428
|
*
|
|
1429
1429
|
* Preserving the previous values allows the user to display the last resoled
|
|
1430
1430
|
* value until the backend responds with the timestamp.
|
|
1431
|
-
*/ function
|
|
1431
|
+
*/ function Pt(t) {
|
|
1432
1432
|
var e = t.mapValue.fields.__previous_value__;
|
|
1433
|
-
return
|
|
1433
|
+
return Nt(e) ? Pt(e) : e;
|
|
1434
1434
|
}
|
|
1435
1435
|
|
|
1436
1436
|
/**
|
|
1437
1437
|
* Returns the local time at which this timestamp was first set.
|
|
1438
|
-
*/ function
|
|
1438
|
+
*/ function qt(t) {
|
|
1439
1439
|
var e = kt(t.mapValue.fields.__local_write_time__.timestampValue);
|
|
1440
1440
|
return new bt(e.seconds, e.nanos);
|
|
1441
1441
|
}
|
|
@@ -1456,14 +1456,14 @@ var At = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
|
|
|
1456
1456
|
* See the License for the specific language governing permissions and
|
|
1457
1457
|
* limitations under the License.
|
|
1458
1458
|
*/
|
|
1459
|
-
/** Extracts the backend's type order for the provided value. */ function
|
|
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 ?
|
|
1459
|
+
/** 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 ? Nt(t) ? 4 /* ServerTimestampValue */ : 10 /* ObjectValue */ : S();
|
|
1461
1461
|
}
|
|
1462
1462
|
|
|
1463
1463
|
/** Tests `left` and `right` for equality based on the backend semantics. */ function Ot(t, e) {
|
|
1464
1464
|
if (t === e) return !0;
|
|
1465
|
-
var n =
|
|
1466
|
-
if (n !==
|
|
1465
|
+
var n = Ft(t);
|
|
1466
|
+
if (n !== Ft(e)) return !1;
|
|
1467
1467
|
switch (n) {
|
|
1468
1468
|
case 0 /* NullValue */ :
|
|
1469
1469
|
return !0;
|
|
@@ -1472,7 +1472,7 @@ var At = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
|
|
|
1472
1472
|
return t.booleanValue === e.booleanValue;
|
|
1473
1473
|
|
|
1474
1474
|
case 4 /* ServerTimestampValue */ :
|
|
1475
|
-
return
|
|
1475
|
+
return qt(t).isEqual(qt(e));
|
|
1476
1476
|
|
|
1477
1477
|
case 3 /* TimestampValue */ :
|
|
1478
1478
|
return function(t, e) {
|
|
@@ -1533,7 +1533,7 @@ function Ct(t, e) {
|
|
|
1533
1533
|
|
|
1534
1534
|
function jt(t, e) {
|
|
1535
1535
|
if (t === e) return 0;
|
|
1536
|
-
var n =
|
|
1536
|
+
var n = Ft(t), r = Ft(e);
|
|
1537
1537
|
if (n !== r) return gt(n, r);
|
|
1538
1538
|
switch (n) {
|
|
1539
1539
|
case 0 /* NullValue */ :
|
|
@@ -1554,7 +1554,7 @@ function jt(t, e) {
|
|
|
1554
1554
|
return Lt(t.timestampValue, e.timestampValue);
|
|
1555
1555
|
|
|
1556
1556
|
case 4 /* ServerTimestampValue */ :
|
|
1557
|
-
return Lt(
|
|
1557
|
+
return Lt(qt(t), qt(e));
|
|
1558
1558
|
|
|
1559
1559
|
case 5 /* StringValue */ :
|
|
1560
1560
|
return gt(t.stringValue, e.stringValue);
|
|
@@ -1873,7 +1873,7 @@ function Rt(t, e) {
|
|
|
1873
1873
|
void 0 === e && (e = null), void 0 === n && (n = []), void 0 === r && (r = []),
|
|
1874
1874
|
void 0 === i && (i = null), void 0 === o && (o = null), void 0 === a && (a = null),
|
|
1875
1875
|
this.path = t, this.collectionGroup = e, this.orderBy = n, this.filters = r, this.limit = i,
|
|
1876
|
-
this.startAt = o, this.endAt = a, this.
|
|
1876
|
+
this.startAt = o, this.endAt = a, this.P = null;
|
|
1877
1877
|
};
|
|
1878
1878
|
|
|
1879
1879
|
/**
|
|
@@ -1930,7 +1930,7 @@ var Wt = /** @class */ function(e) {
|
|
|
1930
1930
|
}, n.prototype.matches = function(t) {
|
|
1931
1931
|
var e = t.data.field(this.field);
|
|
1932
1932
|
// Types do not have to match in NOT_EQUAL filters.
|
|
1933
|
-
return "!=" /* NOT_EQUAL */ === this.op ? null !== e && this.D(jt(e, this.value)) : null !== e &&
|
|
1933
|
+
return "!=" /* NOT_EQUAL */ === this.op ? null !== e && this.D(jt(e, this.value)) : null !== e && Ft(this.value) === Ft(e) && this.D(jt(e, this.value));
|
|
1934
1934
|
// Only compare types with matching backend order (such as double and int).
|
|
1935
1935
|
}, n.prototype.D = function(t) {
|
|
1936
1936
|
switch (this.op) {
|
|
@@ -2088,7 +2088,7 @@ function(t, e, n, r, i, o /* First */ , a, s) {
|
|
|
2088
2088
|
this.filters = r, this.limit = i, this.limitType = o, this.startAt = a, this.endAt = s,
|
|
2089
2089
|
this.$ = null,
|
|
2090
2090
|
// The corresponding `Target` of this `Query` instance.
|
|
2091
|
-
this.
|
|
2091
|
+
this.S = null, this.startAt, this.endAt;
|
|
2092
2092
|
};
|
|
2093
2093
|
|
|
2094
2094
|
/** Creates a new Query for a query that matches all documents at `path` */ function ue(t) {
|
|
@@ -2151,7 +2151,7 @@ function le(t) {
|
|
|
2151
2151
|
* Converts this `Query` instance to it's corresponding `Target` representation.
|
|
2152
2152
|
*/ function pe(t) {
|
|
2153
2153
|
var e = I(t);
|
|
2154
|
-
if (!e.
|
|
2154
|
+
if (!e.S) if ("F" /* First */ === e.limitType) e.S = Ht(e.path, e.collectionGroup, he(e), e.filters, e.limit, e.startAt, e.endAt); else {
|
|
2155
2155
|
for (
|
|
2156
2156
|
// Flip the orderBy directions since we want the last results
|
|
2157
2157
|
var n = [], r = 0, i = he(e); r < i.length; r++) {
|
|
@@ -2161,9 +2161,9 @@ function le(t) {
|
|
|
2161
2161
|
// We need to swap the cursors to match the now-flipped query ordering.
|
|
2162
2162
|
var s = e.endAt ? new re(e.endAt.position, !e.endAt.before) : null, u = e.startAt ? new re(e.startAt.position, !e.startAt.before) : null;
|
|
2163
2163
|
// Now return as a LimitType.First query.
|
|
2164
|
-
e.
|
|
2164
|
+
e.S = Ht(e.path, e.collectionGroup, n, e.filters, e.limit, s, u);
|
|
2165
2165
|
}
|
|
2166
|
-
return e.
|
|
2166
|
+
return e.S;
|
|
2167
2167
|
}
|
|
2168
2168
|
|
|
2169
2169
|
/**
|
|
@@ -2203,7 +2203,7 @@ function de(t, e) {
|
|
|
2203
2203
|
integerValue: "" + t
|
|
2204
2204
|
};
|
|
2205
2205
|
}(e) : function(t, e) {
|
|
2206
|
-
if (t.
|
|
2206
|
+
if (t.F) {
|
|
2207
2207
|
if (isNaN(e)) return {
|
|
2208
2208
|
doubleValue: "NaN"
|
|
2209
2209
|
};
|
|
@@ -2332,7 +2332,7 @@ function de(t, e) {
|
|
|
2332
2332
|
"not-in": "NOT_IN",
|
|
2333
2333
|
"array-contains-any": "ARRAY_CONTAINS_ANY"
|
|
2334
2334
|
}, De = function(t, e) {
|
|
2335
|
-
this.databaseId = t, this.
|
|
2335
|
+
this.databaseId = t, this.F = e;
|
|
2336
2336
|
};
|
|
2337
2337
|
|
|
2338
2338
|
/** Transforms a value into a server-generated timestamp. */
|
|
@@ -2347,8 +2347,8 @@ function de(t, e) {
|
|
|
2347
2347
|
/**
|
|
2348
2348
|
* Returns a value for a Date that's appropriate to put into a proto.
|
|
2349
2349
|
*/
|
|
2350
|
-
function
|
|
2351
|
-
return t.
|
|
2350
|
+
function Ne(t, e) {
|
|
2351
|
+
return t.F ? new Date(1e3 * e.seconds).toISOString().replace(/\.\d*/, "").replace("Z", "") + "." + ("000000000" + e.nanoseconds).slice(-9) + "Z" : {
|
|
2352
2352
|
seconds: "" + e.seconds,
|
|
2353
2353
|
nanos: e.nanoseconds
|
|
2354
2354
|
};
|
|
@@ -2358,15 +2358,15 @@ function Pe(t, e) {
|
|
|
2358
2358
|
* Returns a value for bytes that's appropriate to put in a proto.
|
|
2359
2359
|
*
|
|
2360
2360
|
* Visible for testing.
|
|
2361
|
-
*/ function
|
|
2362
|
-
return t.
|
|
2361
|
+
*/ function Pe(t, e) {
|
|
2362
|
+
return t.F ? e.toBase64() : e.toUint8Array();
|
|
2363
2363
|
}
|
|
2364
2364
|
|
|
2365
|
-
function
|
|
2366
|
-
return
|
|
2365
|
+
function qe(t, e) {
|
|
2366
|
+
return Ne(t, e.toTimestamp());
|
|
2367
2367
|
}
|
|
2368
2368
|
|
|
2369
|
-
function
|
|
2369
|
+
function Fe(t) {
|
|
2370
2370
|
return E(!!t), _t.fromTimestamp(function(t) {
|
|
2371
2371
|
var e = kt(t);
|
|
2372
2372
|
return new bt(e.seconds, e.nanos);
|
|
@@ -2577,7 +2577,7 @@ function Qe(t) {
|
|
|
2577
2577
|
var o = i[0], a = i[1];
|
|
2578
2578
|
return r.K.m(t, e, n, o, a);
|
|
2579
2579
|
})).catch((function(t) {
|
|
2580
|
-
throw "FirebaseError" === t.name ? (t.code ===
|
|
2580
|
+
throw "FirebaseError" === t.name ? (t.code === q && (r.authCredentials.invalidateToken(),
|
|
2581
2581
|
r.appCheckCredentials.invalidateToken()), t) : new U(k, t.toString());
|
|
2582
2582
|
}));
|
|
2583
2583
|
},
|
|
@@ -2587,7 +2587,7 @@ function Qe(t) {
|
|
|
2587
2587
|
var o = i[0], a = i[1];
|
|
2588
2588
|
return r.K.T(t, e, n, o, a);
|
|
2589
2589
|
})).catch((function(t) {
|
|
2590
|
-
throw "FirebaseError" === t.name ? (t.code ===
|
|
2590
|
+
throw "FirebaseError" === t.name ? (t.code === q && (r.authCredentials.invalidateToken(),
|
|
2591
2591
|
r.appCheckCredentials.invalidateToken()), t) : new U(k, t.toString());
|
|
2592
2592
|
}));
|
|
2593
2593
|
}, n.prototype.terminate = function() {
|
|
@@ -2672,7 +2672,7 @@ function Ye(t, r) {
|
|
|
2672
2672
|
}(0, t);
|
|
2673
2673
|
}))), e.precondition.isNone || (n.currentDocument = function(t, e) {
|
|
2674
2674
|
return void 0 !== e.updateTime ? {
|
|
2675
|
-
updateTime:
|
|
2675
|
+
updateTime: qe(t, e.updateTime)
|
|
2676
2676
|
} : void 0 !== e.exists ? {
|
|
2677
2677
|
exists: e.exists
|
|
2678
2678
|
} : S();
|
|
@@ -2705,7 +2705,7 @@ function $e(t, r) {
|
|
|
2705
2705
|
var n = function(t, e) {
|
|
2706
2706
|
return "found" in e ? function(t, e) {
|
|
2707
2707
|
E(!!e.found), e.found.name, e.found.updateTime;
|
|
2708
|
-
var n = je(t, e.found.name), r =
|
|
2708
|
+
var n = je(t, e.found.name), r = Fe(e.found.updateTime), i = new zt({
|
|
2709
2709
|
mapValue: {
|
|
2710
2710
|
fields: e.found.fields
|
|
2711
2711
|
}
|
|
@@ -2713,7 +2713,7 @@ function $e(t, r) {
|
|
|
2713
2713
|
return Qt.newFoundDocument(n, r, i);
|
|
2714
2714
|
}(t, e) : "missing" in e ? function(t, e) {
|
|
2715
2715
|
E(!!e.missing), E(!!e.readTime);
|
|
2716
|
-
var n = je(t, e.missing), r =
|
|
2716
|
+
var n = je(t, e.missing), r = Fe(e.readTime);
|
|
2717
2717
|
return Qt.newNoDocument(n, r);
|
|
2718
2718
|
}(t, e) : S();
|
|
2719
2719
|
}(e.q, t);
|
|
@@ -2807,7 +2807,7 @@ function Xe(t, r) {
|
|
|
2807
2807
|
}(e.orderBy);
|
|
2808
2808
|
o && (n.structuredQuery.orderBy = o);
|
|
2809
2809
|
var a = function(t, e) {
|
|
2810
|
-
return t.
|
|
2810
|
+
return t.F || ct(e) ? e : {
|
|
2811
2811
|
value: e
|
|
2812
2812
|
};
|
|
2813
2813
|
}(t, e.limit);
|
|
@@ -2822,7 +2822,7 @@ function Xe(t, r) {
|
|
|
2822
2822
|
return !!t.document;
|
|
2823
2823
|
})).map((function(t) {
|
|
2824
2824
|
return function(t, e, n) {
|
|
2825
|
-
var r = je(t, e.name), i =
|
|
2825
|
+
var r = je(t, e.name), i = Fe(e.updateTime), o = new zt({
|
|
2826
2826
|
mapValue: {
|
|
2827
2827
|
fields: e.fields
|
|
2828
2828
|
}
|
|
@@ -3285,7 +3285,7 @@ function hn(t, e) {
|
|
|
3285
3285
|
if (t = p(t),
|
|
3286
3286
|
// We allow omission of 'pathString' but explicitly prohibit passing in both
|
|
3287
3287
|
// 'undefined' and 'null'.
|
|
3288
|
-
1 === arguments.length && (e = vt.
|
|
3288
|
+
1 === arguments.length && (e = vt.R()), rt("doc", "path", e), t instanceof en) {
|
|
3289
3289
|
var o = Z.fromString.apply(Z, r([ e ], n));
|
|
3290
3290
|
return it(o), new sn(t,
|
|
3291
3291
|
/* converter= */ null, new nt(o));
|
|
@@ -3612,16 +3612,16 @@ function(t) {
|
|
|
3612
3612
|
enumerable: !1,
|
|
3613
3613
|
configurable: !0
|
|
3614
3614
|
}),
|
|
3615
|
-
/** Returns a new context with the specified settings overwritten. */ t.prototype.
|
|
3615
|
+
/** Returns a new context with the specified settings overwritten. */ t.prototype.nt = function(e) {
|
|
3616
3616
|
return new t(Object.assign(Object.assign({}, this.settings), e), this.databaseId, this.q, this.ignoreUndefinedProperties, this.fieldTransforms, this.fieldMask);
|
|
3617
|
-
}, t.prototype.
|
|
3618
|
-
var e, n = null === (e = this.path) || void 0 === e ? void 0 : e.child(t), r = this.
|
|
3617
|
+
}, t.prototype.et = function(t) {
|
|
3618
|
+
var e, n = null === (e = this.path) || void 0 === e ? void 0 : e.child(t), r = this.nt({
|
|
3619
3619
|
path: n,
|
|
3620
3620
|
rt: !1
|
|
3621
3621
|
});
|
|
3622
3622
|
return r.st(t), r;
|
|
3623
3623
|
}, t.prototype.it = function(t) {
|
|
3624
|
-
var e, n = null === (e = this.path) || void 0 === e ? void 0 : e.child(t), r = this.
|
|
3624
|
+
var e, n = null === (e = this.path) || void 0 === e ? void 0 : e.child(t), r = this.nt({
|
|
3625
3625
|
path: n,
|
|
3626
3626
|
rt: !1
|
|
3627
3627
|
});
|
|
@@ -3629,7 +3629,7 @@ function(t) {
|
|
|
3629
3629
|
}, t.prototype.ot = function(t) {
|
|
3630
3630
|
// TODO(b/34871131): We don't support array paths right now; so make path
|
|
3631
3631
|
// undefined.
|
|
3632
|
-
return this.
|
|
3632
|
+
return this.nt({
|
|
3633
3633
|
path: void 0,
|
|
3634
3634
|
rt: !0
|
|
3635
3635
|
});
|
|
@@ -3731,7 +3731,7 @@ var Vn = /** @class */ function(e) {
|
|
|
3731
3731
|
}, e.databaseId, e.q, e.ignoreUndefinedProperties);
|
|
3732
3732
|
}
|
|
3733
3733
|
|
|
3734
|
-
var
|
|
3734
|
+
var Nn = /** @class */ function(e) {
|
|
3735
3735
|
function n() {
|
|
3736
3736
|
return null !== e && e.apply(this, arguments) || this;
|
|
3737
3737
|
}
|
|
@@ -3740,7 +3740,7 @@ var Pn = /** @class */ function(e) {
|
|
|
3740
3740
|
}, n.prototype.isEqual = function(t) {
|
|
3741
3741
|
return t instanceof n;
|
|
3742
3742
|
}, n;
|
|
3743
|
-
}(gn),
|
|
3743
|
+
}(gn), Pn = /** @class */ function(e) {
|
|
3744
3744
|
function n(t, n) {
|
|
3745
3745
|
var r = this;
|
|
3746
3746
|
return (r = e.call(this, t) || this).lt = n, r;
|
|
@@ -3755,7 +3755,7 @@ var Pn = /** @class */ function(e) {
|
|
|
3755
3755
|
// TODO(mrschmidt): Implement isEquals
|
|
3756
3756
|
return this === t;
|
|
3757
3757
|
}, n;
|
|
3758
|
-
}(gn),
|
|
3758
|
+
}(gn), qn = /** @class */ function(e) {
|
|
3759
3759
|
function n(t, n) {
|
|
3760
3760
|
var r = this;
|
|
3761
3761
|
return (r = e.call(this, t) || this).lt = n, r;
|
|
@@ -3770,7 +3770,7 @@ var Pn = /** @class */ function(e) {
|
|
|
3770
3770
|
// TODO(mrschmidt): Implement isEquals
|
|
3771
3771
|
return this === t;
|
|
3772
3772
|
}, n;
|
|
3773
|
-
}(gn),
|
|
3773
|
+
}(gn), Fn = /** @class */ function(e) {
|
|
3774
3774
|
function n(t, n) {
|
|
3775
3775
|
var r = this;
|
|
3776
3776
|
return (r = e.call(this, t) || this).ft = n, r;
|
|
@@ -3852,7 +3852,7 @@ var Pn = /** @class */ function(e) {
|
|
|
3852
3852
|
// from firestore-exp.
|
|
3853
3853
|
t = p(t))) return Un("Unsupported field value:", e, t), Rn(t, e);
|
|
3854
3854
|
if (t instanceof gn)
|
|
3855
|
-
// FieldValues usually parse into transforms (except
|
|
3855
|
+
// FieldValues usually parse into transforms (except deleteField())
|
|
3856
3856
|
// in which case we do not want to include this field in our parsed data
|
|
3857
3857
|
// (as doing so will overwrite the field directly prior to the transform
|
|
3858
3858
|
// trying to transform it). So we don't add this location to
|
|
@@ -3915,7 +3915,7 @@ var Pn = /** @class */ function(e) {
|
|
|
3915
3915
|
if (t instanceof Date) {
|
|
3916
3916
|
var n = bt.fromDate(t);
|
|
3917
3917
|
return {
|
|
3918
|
-
timestampValue:
|
|
3918
|
+
timestampValue: Ne(e.q, n)
|
|
3919
3919
|
};
|
|
3920
3920
|
}
|
|
3921
3921
|
if (t instanceof bt) {
|
|
@@ -3924,7 +3924,7 @@ var Pn = /** @class */ function(e) {
|
|
|
3924
3924
|
// truncation immediately without waiting for the backend to do that.
|
|
3925
3925
|
var r = new bt(t.seconds, 1e3 * Math.floor(t.nanoseconds / 1e3));
|
|
3926
3926
|
return {
|
|
3927
|
-
timestampValue:
|
|
3927
|
+
timestampValue: Ne(e.q, r)
|
|
3928
3928
|
};
|
|
3929
3929
|
}
|
|
3930
3930
|
if (t instanceof wn) return {
|
|
@@ -3934,7 +3934,7 @@ var Pn = /** @class */ function(e) {
|
|
|
3934
3934
|
}
|
|
3935
3935
|
};
|
|
3936
3936
|
if (t instanceof vn) return {
|
|
3937
|
-
bytesValue:
|
|
3937
|
+
bytesValue: Pe(e.q, t._byteString)
|
|
3938
3938
|
};
|
|
3939
3939
|
if (t instanceof sn) {
|
|
3940
3940
|
var i = e.databaseId, o = t.firestore._databaseId;
|
|
@@ -3956,7 +3956,7 @@ function Rn(t, e) {
|
|
|
3956
3956
|
// If we encounter an empty object, we explicitly add it to the update
|
|
3957
3957
|
// mask to ensure that the server creates a map entry.
|
|
3958
3958
|
e.path && e.path.length > 0 && e.fieldMask.push(e.path) : St(t, (function(t, r) {
|
|
3959
|
-
var i = Ln(r, e.
|
|
3959
|
+
var i = Ln(r, e.et(t));
|
|
3960
3960
|
null != i && (n[t] = i);
|
|
3961
3961
|
})), {
|
|
3962
3962
|
mapValue: {
|
|
@@ -3986,7 +3986,7 @@ function Un(t, e, n) {
|
|
|
3986
3986
|
// FieldPath.
|
|
3987
3987
|
(e = p(e)) instanceof mn) return e._internalPath;
|
|
3988
3988
|
if ("string" == typeof e) return Gn(t, e);
|
|
3989
|
-
throw zn("Field path arguments must be of type string or
|
|
3989
|
+
throw zn("Field path arguments must be of type string or ", t,
|
|
3990
3990
|
/* hasConverter= */ !1,
|
|
3991
3991
|
/* path= */ void 0, n);
|
|
3992
3992
|
}
|
|
@@ -4254,7 +4254,7 @@ var Zn = /** @class */ function(e) {
|
|
|
4254
4254
|
var e = An(t.firestore), n = function(t, e, n, r, i, o, a) {
|
|
4255
4255
|
var s;
|
|
4256
4256
|
if (i.isKeyField()) {
|
|
4257
|
-
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
|
|
4257
|
+
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
4258
|
if ("in" /* IN */ === o || "not-in" /* NOT_IN */ === o) {
|
|
4259
4259
|
dr(a, o);
|
|
4260
4260
|
for (var u = [], c = 0, l = a; c < l.length; c++) {
|
|
@@ -4468,7 +4468,7 @@ function fr() {
|
|
|
4468
4468
|
|
|
4469
4469
|
/** Helper function to create a bound from a document or fields */ function hr(t, e, n, r) {
|
|
4470
4470
|
if (n[0] = p(n[0]), n[0] instanceof Kn) return function(t, e, n, r, i) {
|
|
4471
|
-
if (!r) throw new U(
|
|
4471
|
+
if (!r) throw new U(N, "Can't use a DocumentSnapshot that doesn't exist for " + n + "().");
|
|
4472
4472
|
// Because people expect to continue/end a query at the exact document
|
|
4473
4473
|
// provided, we need to use the implicit sort order rather than the explicit
|
|
4474
4474
|
// sort order, because it's guaranteed to contain the document key. That way
|
|
@@ -4480,7 +4480,7 @@ function fr() {
|
|
|
4480
4480
|
var u = s[a];
|
|
4481
4481
|
if (u.field.isKeyField()) o.push(Rt(e, r.key)); else {
|
|
4482
4482
|
var c = r.data.field(u.field);
|
|
4483
|
-
if (
|
|
4483
|
+
if (Nt(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
4484
|
if (null === c) {
|
|
4485
4485
|
var l = u.field.canonicalString();
|
|
4486
4486
|
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.");
|
|
@@ -4499,9 +4499,9 @@ function fr() {
|
|
|
4499
4499
|
var c = i[u];
|
|
4500
4500
|
if (a[u].field.isKeyField()) {
|
|
4501
4501
|
if ("string" != typeof c) throw new U(V, "Invalid query. Expected a string for document ID in " + r + "(), but got a " + typeof c);
|
|
4502
|
-
if (!fe(t) && -1 !== c.indexOf("/")) throw new U(V, "Invalid query. When querying a collection and ordering by
|
|
4502
|
+
if (!fe(t) && -1 !== c.indexOf("/")) throw new U(V, "Invalid query. When querying a collection and ordering by documentId(), the value passed to " + r + "() must be a plain document ID, but '" + c + "' contains a slash.");
|
|
4503
4503
|
var l = t.path.child(Z.fromString(c));
|
|
4504
|
-
if (!nt.isDocumentKey(l)) throw new U(V, "Invalid query. When querying a collection group and ordering by
|
|
4504
|
+
if (!nt.isDocumentKey(l)) throw new U(V, "Invalid query. When querying a collection group and ordering by documentId(), the value passed to " + r + "() must result in a valid document path, but '" + l + "' is not because it contains an odd number of segments.");
|
|
4505
4505
|
var f = new nt(l);
|
|
4506
4506
|
s.push(Rt(e, f));
|
|
4507
4507
|
} else {
|
|
@@ -4515,14 +4515,14 @@ function fr() {
|
|
|
4515
4515
|
|
|
4516
4516
|
function pr(t, e, n) {
|
|
4517
4517
|
if ("string" == typeof (n = p(n))) {
|
|
4518
|
-
if ("" === n) throw new U(V, "Invalid query. When querying with
|
|
4519
|
-
if (!fe(e) && -1 !== n.indexOf("/")) throw new U(V, "Invalid query. When querying a collection by
|
|
4518
|
+
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
|
+
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.");
|
|
4520
4520
|
var r = e.path.child(Z.fromString(n));
|
|
4521
|
-
if (!nt.isDocumentKey(r)) throw new U(V, "Invalid query. When querying a collection group by
|
|
4521
|
+
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
4522
|
return Rt(t, new nt(r));
|
|
4523
4523
|
}
|
|
4524
4524
|
if (n instanceof sn) return Rt(t, n._key);
|
|
4525
|
-
throw new U(V, "Invalid query. When querying with
|
|
4525
|
+
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
4526
|
}
|
|
4527
4527
|
|
|
4528
4528
|
/**
|
|
@@ -4604,7 +4604,7 @@ var vr = /** @class */ function(e) {
|
|
|
4604
4604
|
}(/** @class */ function() {
|
|
4605
4605
|
function t() {}
|
|
4606
4606
|
return t.prototype.convertValue = function(t, e) {
|
|
4607
|
-
switch (void 0 === e && (e = "none"),
|
|
4607
|
+
switch (void 0 === e && (e = "none"), Ft(t)) {
|
|
4608
4608
|
case 0 /* NullValue */ :
|
|
4609
4609
|
return null;
|
|
4610
4610
|
|
|
@@ -4656,11 +4656,11 @@ var vr = /** @class */ function(e) {
|
|
|
4656
4656
|
}, t.prototype.convertServerTimestamp = function(t, e) {
|
|
4657
4657
|
switch (e) {
|
|
4658
4658
|
case "previous":
|
|
4659
|
-
var n =
|
|
4659
|
+
var n = Pt(t);
|
|
4660
4660
|
return null == n ? null : this.convertValue(n, e);
|
|
4661
4661
|
|
|
4662
4662
|
case "estimate":
|
|
4663
|
-
return this.convertTimestamp(
|
|
4663
|
+
return this.convertTimestamp(qt(t));
|
|
4664
4664
|
|
|
4665
4665
|
default:
|
|
4666
4666
|
return null;
|
|
@@ -4805,7 +4805,7 @@ function _r(t, e, n) {
|
|
|
4805
4805
|
* Returns a sentinel used with {@link @firebase/firestore/lite#(setDoc:1)} or {@link @firebase/firestore/lite#(updateDoc:1)} to
|
|
4806
4806
|
* include a server-generated timestamp in the written data.
|
|
4807
4807
|
*/ function Ir() {
|
|
4808
|
-
return new
|
|
4808
|
+
return new Nn("serverTimestamp");
|
|
4809
4809
|
}
|
|
4810
4810
|
|
|
4811
4811
|
/**
|
|
@@ -4823,7 +4823,7 @@ function _r(t, e, n) {
|
|
|
4823
4823
|
for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
|
|
4824
4824
|
// NOTE: We don't actually parse the data until it's used in set() or
|
|
4825
4825
|
// update() since we'd need the Firestore instance to do this.
|
|
4826
|
-
return new
|
|
4826
|
+
return new Pn("arrayUnion", t);
|
|
4827
4827
|
}
|
|
4828
4828
|
|
|
4829
4829
|
/**
|
|
@@ -4840,7 +4840,7 @@ function _r(t, e, n) {
|
|
|
4840
4840
|
for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
|
|
4841
4841
|
// NOTE: We don't actually parse the data until it's used in set() or
|
|
4842
4842
|
// update() since we'd need the Firestore instance to do this.
|
|
4843
|
-
return new
|
|
4843
|
+
return new qn("arrayRemove", t);
|
|
4844
4844
|
}
|
|
4845
4845
|
|
|
4846
4846
|
/**
|
|
@@ -4862,7 +4862,7 @@ function _r(t, e, n) {
|
|
|
4862
4862
|
* @returns The `FieldValue` sentinel for use in a call to `setDoc()` or
|
|
4863
4863
|
* `updateDoc()`
|
|
4864
4864
|
*/ function Vr(t) {
|
|
4865
|
-
return new
|
|
4865
|
+
return new Fn("increment", t);
|
|
4866
4866
|
}
|
|
4867
4867
|
|
|
4868
4868
|
/**
|
|
@@ -4896,12 +4896,12 @@ function _r(t, e, n) {
|
|
|
4896
4896
|
}
|
|
4897
4897
|
return t.prototype.set = function(t, e, n) {
|
|
4898
4898
|
this._verifyNotCommitted();
|
|
4899
|
-
var r =
|
|
4899
|
+
var r = Nr(t, this._firestore), i = yr(r.converter, e, n), o = kn(this._dataReader, "WriteBatch.set", r._key, i, null !== r.converter, n);
|
|
4900
4900
|
return this._mutations.push(o.toMutation(r._key, _e.none())), this;
|
|
4901
4901
|
}, t.prototype.update = function(t, e, n) {
|
|
4902
4902
|
for (var r = [], i = 3; i < arguments.length; i++) r[i - 3] = arguments[i];
|
|
4903
4903
|
this._verifyNotCommitted();
|
|
4904
|
-
var o, a =
|
|
4904
|
+
var o, a = Nr(t, this._firestore);
|
|
4905
4905
|
// For Compat types, we have to "extract" the underlying types before
|
|
4906
4906
|
// performing validation.
|
|
4907
4907
|
return o = "string" == typeof (e = p(e)) || e instanceof mn ? Cn(this._dataReader, "WriteBatch.update", a._key, e, n, r) : On(this._dataReader, "WriteBatch.update", a._key, e),
|
|
@@ -4915,7 +4915,7 @@ function _r(t, e, n) {
|
|
|
4915
4915
|
*/
|
|
4916
4916
|
t.prototype.delete = function(t) {
|
|
4917
4917
|
this._verifyNotCommitted();
|
|
4918
|
-
var e =
|
|
4918
|
+
var e = Nr(t, this._firestore);
|
|
4919
4919
|
return this._mutations = this._mutations.concat(new Ie(e._key, _e.none())), this;
|
|
4920
4920
|
},
|
|
4921
4921
|
/**
|
|
@@ -4937,7 +4937,7 @@ function _r(t, e, n) {
|
|
|
4937
4937
|
}, t;
|
|
4938
4938
|
}();
|
|
4939
4939
|
|
|
4940
|
-
function
|
|
4940
|
+
function Nr(t, e) {
|
|
4941
4941
|
if ((t = p(t)).firestore !== e) throw new U(V, "Provided document reference is from a different Firestore instance.");
|
|
4942
4942
|
return t;
|
|
4943
4943
|
}
|
|
@@ -4954,7 +4954,7 @@ function Pr(t, e) {
|
|
|
4954
4954
|
*
|
|
4955
4955
|
* @returns A `WriteBatch` that can be used to atomically execute multiple
|
|
4956
4956
|
* writes.
|
|
4957
|
-
*/ function
|
|
4957
|
+
*/ function Pr(t) {
|
|
4958
4958
|
var e = Ze(t = st(t, en));
|
|
4959
4959
|
return new Dr(t, (function(t) {
|
|
4960
4960
|
return Ye(e, t);
|
|
@@ -4980,7 +4980,7 @@ function Pr(t, e) {
|
|
|
4980
4980
|
/**
|
|
4981
4981
|
* Internal transaction object responsible for accumulating the mutations to
|
|
4982
4982
|
* perform and the base versions for any documents read.
|
|
4983
|
-
*/ var
|
|
4983
|
+
*/ var qr = /** @class */ function() {
|
|
4984
4984
|
function t(t) {
|
|
4985
4985
|
this.datastore = t,
|
|
4986
4986
|
// The version of each document that was read during this transaction.
|
|
@@ -5100,7 +5100,7 @@ function Pr(t, e) {
|
|
|
5100
5100
|
}, t.prototype.write = function(t) {
|
|
5101
5101
|
this.ensureCommitNotCalled(), this.mutations.push(t);
|
|
5102
5102
|
}, t.prototype.ensureCommitNotCalled = function() {}, t;
|
|
5103
|
-
}(),
|
|
5103
|
+
}(), Fr = /** @class */ function() {
|
|
5104
5104
|
function t(t, e, n, r) {
|
|
5105
5105
|
this.asyncQueue = t, this.datastore = e, this.updateFunction = n, this.deferred = r,
|
|
5106
5106
|
this.Tt = 5, this.It = new He(this.asyncQueue, "transaction_retry" /* TransactionRetry */)
|
|
@@ -5114,21 +5114,21 @@ function Pr(t, e) {
|
|
|
5114
5114
|
return e(t, void 0, void 0, (function() {
|
|
5115
5115
|
var t, e, r = this;
|
|
5116
5116
|
return n(this, (function(n) {
|
|
5117
|
-
return t = new
|
|
5117
|
+
return t = new qr(this.datastore), (e = this.Rt(t)) && e.then((function(e) {
|
|
5118
5118
|
r.asyncQueue.enqueueAndForget((function() {
|
|
5119
5119
|
return t.commit().then((function() {
|
|
5120
5120
|
r.deferred.resolve(e);
|
|
5121
5121
|
})).catch((function(t) {
|
|
5122
|
-
r.
|
|
5122
|
+
r.Pt(t);
|
|
5123
5123
|
}));
|
|
5124
5124
|
}));
|
|
5125
5125
|
})).catch((function(t) {
|
|
5126
|
-
r.
|
|
5126
|
+
r.Pt(t);
|
|
5127
5127
|
})), [ 2 /*return*/ ];
|
|
5128
5128
|
}));
|
|
5129
5129
|
}));
|
|
5130
5130
|
}));
|
|
5131
|
-
}, t.prototype.
|
|
5131
|
+
}, t.prototype.Rt = function(t) {
|
|
5132
5132
|
try {
|
|
5133
5133
|
var e = this.updateFunction(t);
|
|
5134
5134
|
return !ct(e) && e.catch && e.then ? e : (this.deferred.reject(Error("Transaction callback must return a Promise")),
|
|
@@ -5137,7 +5137,7 @@ function Pr(t, e) {
|
|
|
5137
5137
|
// Do not retry errors thrown by user provided updateFunction.
|
|
5138
5138
|
return this.deferred.reject(t), null;
|
|
5139
5139
|
}
|
|
5140
|
-
}, t.prototype.
|
|
5140
|
+
}, t.prototype.Pt = function(t) {
|
|
5141
5141
|
var e = this;
|
|
5142
5142
|
this.Tt > 0 && this.Vt(t) ? (this.Tt -= 1, this.asyncQueue.enqueueAndForget((function() {
|
|
5143
5143
|
return e.At(), Promise.resolve();
|
|
@@ -5162,18 +5162,18 @@ function Pr(t, e) {
|
|
|
5162
5162
|
case A:
|
|
5163
5163
|
case k:
|
|
5164
5164
|
case D:
|
|
5165
|
-
case
|
|
5165
|
+
case F:
|
|
5166
5166
|
case R:
|
|
5167
5167
|
case M:
|
|
5168
5168
|
// Unauthenticated means something went wrong with our token and we need
|
|
5169
5169
|
// to retry with new credentials which will happen automatically.
|
|
5170
|
-
case
|
|
5170
|
+
case q:
|
|
5171
5171
|
return !1;
|
|
5172
5172
|
|
|
5173
5173
|
case V:
|
|
5174
|
-
case
|
|
5174
|
+
case N:
|
|
5175
5175
|
case "already-exists":
|
|
5176
|
-
case
|
|
5176
|
+
case P:
|
|
5177
5177
|
case O:
|
|
5178
5178
|
// Aborted might be retried in some scenarios, but that is dependant on
|
|
5179
5179
|
// the context and should handled individually by the calling code.
|
|
@@ -5335,9 +5335,9 @@ function Pr(t, e) {
|
|
|
5335
5335
|
this.$t = !1,
|
|
5336
5336
|
// Operations scheduled to be queued in the future. Operations are
|
|
5337
5337
|
// automatically removed after they are run or canceled.
|
|
5338
|
-
this.
|
|
5338
|
+
this.St = [],
|
|
5339
5339
|
// visible for testing
|
|
5340
|
-
this.
|
|
5340
|
+
this.Ft = null,
|
|
5341
5341
|
// Flag set while there's an outstanding AsyncQueue operation, used for
|
|
5342
5342
|
// assertion sanity-checks.
|
|
5343
5343
|
this.xt = !1,
|
|
@@ -5450,7 +5450,7 @@ function Pr(t, e) {
|
|
|
5450
5450
|
}, t.prototype.Ut = function(t) {
|
|
5451
5451
|
var e = this, n = this.Dt.then((function() {
|
|
5452
5452
|
return e.xt = !0, t().catch((function(t) {
|
|
5453
|
-
e.
|
|
5453
|
+
e.Ft = t, e.xt = !1;
|
|
5454
5454
|
var n =
|
|
5455
5455
|
/**
|
|
5456
5456
|
* Chrome includes Error.message in Error.stack. Other browsers do not.
|
|
@@ -5479,9 +5479,9 @@ function Pr(t, e) {
|
|
|
5479
5479
|
var i = Cr.createAndSchedule(this, t, e, n, (function(t) {
|
|
5480
5480
|
return r.jt(t);
|
|
5481
5481
|
}));
|
|
5482
|
-
return this.
|
|
5482
|
+
return this.St.push(i), i;
|
|
5483
5483
|
}, t.prototype.Lt = function() {
|
|
5484
|
-
this.
|
|
5484
|
+
this.Ft && S();
|
|
5485
5485
|
}, t.prototype.verifyOperationInProgress = function() {},
|
|
5486
5486
|
/**
|
|
5487
5487
|
* Waits until all currently queued tasks are finished executing. Delayed
|
|
@@ -5513,7 +5513,7 @@ function Pr(t, e) {
|
|
|
5513
5513
|
* exists.
|
|
5514
5514
|
*/
|
|
5515
5515
|
t.prototype.Bt = function(t) {
|
|
5516
|
-
for (var e = 0, n = this.
|
|
5516
|
+
for (var e = 0, n = this.St; e < n.length; e++) {
|
|
5517
5517
|
if (n[e].timerId === t) return !0;
|
|
5518
5518
|
}
|
|
5519
5519
|
return !1;
|
|
@@ -5530,10 +5530,10 @@ function Pr(t, e) {
|
|
|
5530
5530
|
// Note that draining may generate more delayed ops, so we do that first.
|
|
5531
5531
|
return this.Mt().then((function() {
|
|
5532
5532
|
// Run ops in the same order they'd run if they ran naturally.
|
|
5533
|
-
e.
|
|
5533
|
+
e.St.sort((function(t, e) {
|
|
5534
5534
|
return t.targetTimeMs - e.targetTimeMs;
|
|
5535
5535
|
}));
|
|
5536
|
-
for (var n = 0, r = e.
|
|
5536
|
+
for (var n = 0, r = e.St; n < r.length; n++) {
|
|
5537
5537
|
var i = r[n];
|
|
5538
5538
|
if (i.skipDelay(), "all" /* All */ !== t && i.timerId === t) break;
|
|
5539
5539
|
}
|
|
@@ -5548,8 +5548,8 @@ function Pr(t, e) {
|
|
|
5548
5548
|
},
|
|
5549
5549
|
/** Called once a DelayedOperation is run or canceled. */ t.prototype.jt = function(t) {
|
|
5550
5550
|
// NOTE: indexOf / slice are O(n), but delayedOperations is expected to be small.
|
|
5551
|
-
var e = this.
|
|
5552
|
-
this.
|
|
5551
|
+
var e = this.St.indexOf(t);
|
|
5552
|
+
this.St.splice(e, 1);
|
|
5553
5553
|
}, t;
|
|
5554
5554
|
}(), Lr = /** @class */ function() {
|
|
5555
5555
|
/** @hideconstructor */
|
|
@@ -5563,7 +5563,7 @@ function Pr(t, e) {
|
|
|
5563
5563
|
*/;
|
|
5564
5564
|
}
|
|
5565
5565
|
return t.prototype.get = function(t) {
|
|
5566
|
-
var e = this, n =
|
|
5566
|
+
var e = this, n = Nr(t, this._firestore), r = new vr(this._firestore);
|
|
5567
5567
|
return this._transaction.lookup([ n._key ]).then((function(t) {
|
|
5568
5568
|
if (!t || 1 !== t.length) return S();
|
|
5569
5569
|
var i = t[0];
|
|
@@ -5572,11 +5572,11 @@ function Pr(t, e) {
|
|
|
5572
5572
|
throw S();
|
|
5573
5573
|
}));
|
|
5574
5574
|
}, t.prototype.set = function(t, e, n) {
|
|
5575
|
-
var r =
|
|
5575
|
+
var r = Nr(t, this._firestore), i = yr(r.converter, e, n), o = kn(this._dataReader, "Transaction.set", r._key, i, null !== r.converter, n);
|
|
5576
5576
|
return this._transaction.set(r._key, o), this;
|
|
5577
5577
|
}, t.prototype.update = function(t, e, n) {
|
|
5578
5578
|
for (var r = [], i = 3; i < arguments.length; i++) r[i - 3] = arguments[i];
|
|
5579
|
-
var o, a =
|
|
5579
|
+
var o, a = Nr(t, this._firestore);
|
|
5580
5580
|
// For Compat types, we have to "extract" the underlying types before
|
|
5581
5581
|
// performing validation.
|
|
5582
5582
|
return o = "string" == typeof (e = p(e)) || e instanceof mn ? Cn(this._dataReader, "Transaction.update", a._key, e, n, r) : On(this._dataReader, "Transaction.update", a._key, e),
|
|
@@ -5589,7 +5589,7 @@ function Pr(t, e) {
|
|
|
5589
5589
|
* @returns This `Transaction` instance. Used for chaining method calls.
|
|
5590
5590
|
*/
|
|
5591
5591
|
t.prototype.delete = function(t) {
|
|
5592
|
-
var e =
|
|
5592
|
+
var e = Nr(t, this._firestore);
|
|
5593
5593
|
return this._transaction.delete(e._key), this;
|
|
5594
5594
|
}, t;
|
|
5595
5595
|
}();
|
|
@@ -5629,7 +5629,7 @@ function Pr(t, e) {
|
|
|
5629
5629
|
*/
|
|
5630
5630
|
function Rr(t, e) {
|
|
5631
5631
|
var n = Ze(t = st(t, en)), r = new x;
|
|
5632
|
-
return new
|
|
5632
|
+
return new Fr(new jr, n, (function(n) {
|
|
5633
5633
|
return e(new Lr(t, n));
|
|
5634
5634
|
}), r).run(), r.promise
|
|
5635
5635
|
/**
|
|
@@ -5647,7 +5647,7 @@ y = i + "_lite", o(new c("firestore/lite", (function(t, e) {
|
|
|
5647
5647
|
return n && i._setSettings(n), i;
|
|
5648
5648
|
}), "PUBLIC")),
|
|
5649
5649
|
// RUNTIME_ENV and BUILD_TARGET are replaced by real values during the compilation
|
|
5650
|
-
a("firestore-lite", "3.4.
|
|
5650
|
+
a("firestore-lite", "3.4.3", ""), a("firestore-lite", "3.4.3", "esm5");
|
|
5651
5651
|
|
|
5652
|
-
export { vn as Bytes, cn as CollectionReference, sn as DocumentReference, Kn as DocumentSnapshot, mn as FieldPath, gn as FieldValue, en as Firestore, U as FirestoreError, wn as GeoPoint, un as Query, Xn as QueryConstraint, Hn as QueryDocumentSnapshot, Wn as QuerySnapshot, bt as Timestamp, Lr as Transaction, Dr as WriteBatch, Sr as addDoc, kr as arrayRemove, Ar as arrayUnion, ln as collection, fn as collectionGroup, on as connectFirestoreEmulator, Tr as deleteDoc, Er as deleteField, hn as doc, yn as documentId, fr as endAt, lr as endBefore, gr as getDoc, wr as getDocs, rn as getFirestore, Vr as increment, nn as initializeFirestore, ir as limit, or as limitToLast, nr as orderBy, Jn as query, dn as queryEqual, pn as refEqual, Rr as runTransaction, Ir as serverTimestamp, br as setDoc, g as setLogLevel, Yn as snapshotEqual, ur as startAfter, sr as startAt, an as terminate, _r as updateDoc, tr as where,
|
|
5652
|
+
export { vn as Bytes, cn as CollectionReference, sn as DocumentReference, Kn as DocumentSnapshot, mn as FieldPath, gn as FieldValue, en as Firestore, U as FirestoreError, wn as GeoPoint, un as Query, Xn as QueryConstraint, Hn as QueryDocumentSnapshot, Wn as QuerySnapshot, bt as Timestamp, Lr as Transaction, Dr as WriteBatch, Sr as addDoc, kr as arrayRemove, Ar as arrayUnion, ln as collection, fn as collectionGroup, on as connectFirestoreEmulator, Tr as deleteDoc, Er as deleteField, hn as doc, yn as documentId, fr as endAt, lr as endBefore, gr as getDoc, wr as getDocs, rn as getFirestore, Vr as increment, nn as initializeFirestore, ir as limit, or as limitToLast, nr as orderBy, Jn as query, dn as queryEqual, pn as refEqual, Rr as runTransaction, Ir as serverTimestamp, br as setDoc, g as setLogLevel, Yn as snapshotEqual, ur as startAfter, sr as startAt, an as terminate, _r as updateDoc, tr as where, Pr as writeBatch };
|
|
5653
5653
|
//# sourceMappingURL=index.browser.esm5.js.map
|