@firebase/firestore 3.8.4 → 3.9.0-20230314181055
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/dist/firestore/src/lite-api/query.d.ts +11 -19
- package/dist/firestore/src/lite-api/reference.d.ts +1 -1
- package/dist/firestore/src/util/debug_uid.d.ts +28 -0
- package/dist/firestore/test/unit/specs/spec_builder.d.ts +3 -0
- package/dist/firestore/test/unit/specs/spec_test_components.d.ts +5 -1
- package/dist/index.cjs.js +1359 -1309
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +66 -14
- package/dist/index.esm2017.js +1272 -1222
- package/dist/index.esm2017.js.map +1 -1
- package/dist/index.esm5.js +1335 -1259
- package/dist/index.esm5.js.map +1 -1
- package/dist/index.node.cjs.js +97 -32
- package/dist/index.node.cjs.js.map +1 -1
- package/dist/index.node.mjs +97 -32
- package/dist/index.node.mjs.map +1 -1
- package/dist/index.rn.js +1380 -1330
- package/dist/index.rn.js.map +1 -1
- package/dist/internal.d.ts +12 -20
- package/dist/lite/firestore/src/lite-api/query.d.ts +11 -19
- package/dist/lite/firestore/src/lite-api/reference.d.ts +1 -1
- package/dist/lite/firestore/src/util/debug_uid.d.ts +28 -0
- package/dist/lite/firestore/test/unit/specs/spec_builder.d.ts +3 -0
- package/dist/lite/firestore/test/unit/specs/spec_test_components.d.ts +5 -1
- package/dist/lite/index.browser.esm2017.js +775 -730
- package/dist/lite/index.browser.esm2017.js.map +1 -1
- package/dist/lite/index.browser.esm5.js +736 -693
- package/dist/lite/index.browser.esm5.js.map +1 -1
- package/dist/lite/index.cjs.js +775 -730
- package/dist/lite/index.cjs.js.map +1 -1
- package/dist/lite/index.d.ts +66 -14
- package/dist/lite/index.node.cjs.js +76 -18
- package/dist/lite/index.node.cjs.js.map +1 -1
- package/dist/lite/index.node.mjs +76 -18
- package/dist/lite/index.node.mjs.map +1 -1
- package/dist/lite/index.rn.esm2017.js +777 -732
- package/dist/lite/index.rn.esm2017.js.map +1 -1
- package/dist/lite/internal.d.ts +12 -20
- package/dist/lite/packages/firestore/dist/lite/index.browser.esm2017.d.ts +139 -142
- package/dist/lite/packages/firestore/src/lite-api/query.d.ts +11 -19
- package/dist/lite/packages/firestore/src/lite-api/reference.d.ts +1 -1
- package/dist/lite/packages/firestore/src/util/debug_uid.d.ts +28 -0
- package/dist/lite/packages/firestore/test/unit/specs/spec_builder.d.ts +3 -0
- package/dist/lite/packages/firestore/test/unit/specs/spec_test_components.d.ts +5 -1
- package/dist/lite/private.d.ts +72 -16
- package/dist/packages/firestore/dist/index.esm2017.d.ts +157 -160
- package/dist/packages/firestore/src/lite-api/query.d.ts +11 -19
- package/dist/packages/firestore/src/lite-api/reference.d.ts +1 -1
- package/dist/packages/firestore/src/util/debug_uid.d.ts +28 -0
- package/dist/packages/firestore/test/unit/specs/spec_builder.d.ts +3 -0
- package/dist/packages/firestore/test/unit/specs/spec_test_components.d.ts +5 -1
- package/dist/private.d.ts +72 -16
- package/package.json +2 -2
|
@@ -67,7 +67,7 @@ v.MOCK_USER = new v("mock-user");
|
|
|
67
67
|
* See the License for the specific language governing permissions and
|
|
68
68
|
* limitations under the License.
|
|
69
69
|
*/
|
|
70
|
-
var g = "9.
|
|
70
|
+
var g = "9.18.0-20230314181055", w = new l("@firebase/firestore");
|
|
71
71
|
|
|
72
72
|
/**
|
|
73
73
|
* @license
|
|
@@ -659,6 +659,49 @@ function lt(t, e) {
|
|
|
659
659
|
if (e <= 0) throw new B(V, "Function ".concat(t, "() requires a positive number, but it was: ").concat(e, "."));
|
|
660
660
|
}
|
|
661
661
|
|
|
662
|
+
/**
|
|
663
|
+
* @license
|
|
664
|
+
* Copyright 2023 Google LLC
|
|
665
|
+
*
|
|
666
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
667
|
+
* you may not use this file except in compliance with the License.
|
|
668
|
+
* You may obtain a copy of the License at
|
|
669
|
+
*
|
|
670
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
671
|
+
*
|
|
672
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
673
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
674
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
675
|
+
* See the License for the specific language governing permissions and
|
|
676
|
+
* limitations under the License.
|
|
677
|
+
*/
|
|
678
|
+
/**
|
|
679
|
+
* The value returned from the most recent invocation of
|
|
680
|
+
* `generateUniqueDebugId()`, or null if it has never been invoked.
|
|
681
|
+
*/ var ft = null;
|
|
682
|
+
|
|
683
|
+
/**
|
|
684
|
+
* Generates and returns an initial value for `lastUniqueDebugId`.
|
|
685
|
+
*
|
|
686
|
+
* The returned value is randomly selected from a range of integers that are
|
|
687
|
+
* represented as 8 hexadecimal digits. This means that (within reason) any
|
|
688
|
+
* numbers generated by incrementing the returned number by 1 will also be
|
|
689
|
+
* represented by 8 hexadecimal digits. This leads to all "IDs" having the same
|
|
690
|
+
* length when converted to a hexadecimal string, making reading logs containing
|
|
691
|
+
* these IDs easier to follow. And since the return value is randomly selected
|
|
692
|
+
* it will help to differentiate between logs from different executions.
|
|
693
|
+
*/
|
|
694
|
+
/**
|
|
695
|
+
* Generates and returns a unique ID as a hexadecimal string.
|
|
696
|
+
*
|
|
697
|
+
* The returned ID is intended to be used in debug logging messages to help
|
|
698
|
+
* correlate log messages that may be spatially separated in the logs, but
|
|
699
|
+
* logically related. For example, a network connection could include the same
|
|
700
|
+
* "debug ID" string in all of its log messages to help trace a specific
|
|
701
|
+
* connection over time.
|
|
702
|
+
*
|
|
703
|
+
* @return the 10-character generated ID (e.g. "0xa1b2c3d4").
|
|
704
|
+
*/
|
|
662
705
|
/**
|
|
663
706
|
* @license
|
|
664
707
|
* Copyright 2017 Google LLC
|
|
@@ -677,11 +720,12 @@ function lt(t, e) {
|
|
|
677
720
|
*/
|
|
678
721
|
/**
|
|
679
722
|
* Returns whether a variable is either undefined or null.
|
|
680
|
-
*/
|
|
723
|
+
*/
|
|
724
|
+
function ht(t) {
|
|
681
725
|
return null == t;
|
|
682
726
|
}
|
|
683
727
|
|
|
684
|
-
/** Returns whether the value represents -0. */ function
|
|
728
|
+
/** Returns whether the value represents -0. */ function pt(t) {
|
|
685
729
|
// Detect if the value is -0.0. Based on polyfill from
|
|
686
730
|
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
|
|
687
731
|
return 0 === t && 1 / t == -1 / 0;
|
|
@@ -706,7 +750,7 @@ function lt(t, e) {
|
|
|
706
750
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
707
751
|
* See the License for the specific language governing permissions and
|
|
708
752
|
* limitations under the License.
|
|
709
|
-
*/ var
|
|
753
|
+
*/ var dt, yt, mt = {
|
|
710
754
|
BatchGetDocuments: "batchGet",
|
|
711
755
|
Commit: "commit",
|
|
712
756
|
RunQuery: "runQuery",
|
|
@@ -751,7 +795,7 @@ function lt(t, e) {
|
|
|
751
795
|
* @returns The equivalent Code. Unknown status codes are mapped to
|
|
752
796
|
* Code.UNKNOWN.
|
|
753
797
|
*/
|
|
754
|
-
function
|
|
798
|
+
function vt(t) {
|
|
755
799
|
if (void 0 === t) return T("RPC_ERROR", "HTTP error has no status"), P;
|
|
756
800
|
// The canonical error codes for Google APIs [1] specify mapping onto HTTP
|
|
757
801
|
// status codes but the mapping is not bijective. In each case of ambiguity
|
|
@@ -843,16 +887,16 @@ function mt(t) {
|
|
|
843
887
|
/**
|
|
844
888
|
* A Rest-based connection that relies on the native HTTP stack
|
|
845
889
|
* (e.g. `fetch` or a polyfill).
|
|
846
|
-
*/ (
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
var
|
|
890
|
+
*/ (yt = dt || (dt = {}))[yt.OK = 0] = "OK", yt[yt.CANCELLED = 1] = "CANCELLED",
|
|
891
|
+
yt[yt.UNKNOWN = 2] = "UNKNOWN", yt[yt.INVALID_ARGUMENT = 3] = "INVALID_ARGUMENT",
|
|
892
|
+
yt[yt.DEADLINE_EXCEEDED = 4] = "DEADLINE_EXCEEDED", yt[yt.NOT_FOUND = 5] = "NOT_FOUND",
|
|
893
|
+
yt[yt.ALREADY_EXISTS = 6] = "ALREADY_EXISTS", yt[yt.PERMISSION_DENIED = 7] = "PERMISSION_DENIED",
|
|
894
|
+
yt[yt.UNAUTHENTICATED = 16] = "UNAUTHENTICATED", yt[yt.RESOURCE_EXHAUSTED = 8] = "RESOURCE_EXHAUSTED",
|
|
895
|
+
yt[yt.FAILED_PRECONDITION = 9] = "FAILED_PRECONDITION", yt[yt.ABORTED = 10] = "ABORTED",
|
|
896
|
+
yt[yt.OUT_OF_RANGE = 11] = "OUT_OF_RANGE", yt[yt.UNIMPLEMENTED = 12] = "UNIMPLEMENTED",
|
|
897
|
+
yt[yt.INTERNAL = 13] = "INTERNAL", yt[yt.UNAVAILABLE = 14] = "UNAVAILABLE", yt[yt.DATA_LOSS = 15] = "DATA_LOSS";
|
|
898
|
+
|
|
899
|
+
var gt = /** @class */ function(r) {
|
|
856
900
|
/**
|
|
857
901
|
* @param databaseInfo - The connection info.
|
|
858
902
|
* @param fetchImpl - `fetch` or a Polyfill that implements the fetch API.
|
|
@@ -886,14 +930,14 @@ var vt = /** @class */ function(r) {
|
|
|
886
930
|
return a = n.sent(), [ 3 /*break*/ , 4 ];
|
|
887
931
|
|
|
888
932
|
case 3:
|
|
889
|
-
throw u = n.sent(), new B(
|
|
933
|
+
throw u = n.sent(), new B(vt((s = u).status), "Request failed with error: " + s.statusText);
|
|
890
934
|
|
|
891
935
|
case 4:
|
|
892
936
|
return a.ok ? [ 3 /*break*/ , 6 ] : [ 4 /*yield*/ , a.json() ];
|
|
893
937
|
|
|
894
938
|
case 5:
|
|
895
939
|
throw c = n.sent(), Array.isArray(c) && (c = c[0]), l = null === (t = null == c ? void 0 : c.error) || void 0 === t ? void 0 : t.message,
|
|
896
|
-
new B(
|
|
940
|
+
new B(vt(a.status), "Request failed with error: ".concat(null != l ? l : a.statusText));
|
|
897
941
|
|
|
898
942
|
case 6:
|
|
899
943
|
return [ 2 /*return*/ , a.json() ];
|
|
@@ -916,13 +960,15 @@ var vt = /** @class */ function(r) {
|
|
|
916
960
|
enumerable: !1,
|
|
917
961
|
configurable: !0
|
|
918
962
|
}), t.prototype.A = function(t, e, n, r, i) {
|
|
919
|
-
var o =
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
963
|
+
var o = (null === ft ? ft = 268435456 + Math.round(2147483648 * Math.random()) : ft++,
|
|
964
|
+
"0x" + ft.toString(16)), a = this.I(t, e);
|
|
965
|
+
b("RestConnection", "Sending RPC '".concat(t, "' ").concat(o, ":"), a, n);
|
|
966
|
+
var u = {};
|
|
967
|
+
return this.T(u, r, i), this.R(t, a, u, n).then((function(e) {
|
|
968
|
+
return b("RestConnection", "Received RPC '".concat(t, "' ").concat(o, ": "), e),
|
|
969
|
+
e;
|
|
924
970
|
}), (function(e) {
|
|
925
|
-
throw E("RestConnection", "".concat(t, " failed with error: "), e, "url: ",
|
|
971
|
+
throw E("RestConnection", "RPC '".concat(t, "' ").concat(o, " failed with error: "), e, "url: ", a, "request:", n),
|
|
926
972
|
e;
|
|
927
973
|
}));
|
|
928
974
|
}, t.prototype.P = function(t, e, n, r, i, o) {
|
|
@@ -947,10 +993,10 @@ var vt = /** @class */ function(r) {
|
|
|
947
993
|
return t[n] = e;
|
|
948
994
|
}));
|
|
949
995
|
}, t.prototype.I = function(t, e) {
|
|
950
|
-
var n =
|
|
996
|
+
var n = mt[t];
|
|
951
997
|
return "".concat(this.p, "/v1/").concat(e, ":").concat(n);
|
|
952
998
|
}, t;
|
|
953
|
-
}()),
|
|
999
|
+
}()), wt = /^[_a-zA-Z][_a-zA-Z0-9]*(?:\.[_a-zA-Z][_a-zA-Z0-9]*)*$/, _t = /** @class */ function() {
|
|
954
1000
|
/**
|
|
955
1001
|
* @internal
|
|
956
1002
|
* @param alias Un-escaped alias representation
|
|
@@ -961,7 +1007,7 @@ var vt = /** @class */ function(r) {
|
|
|
961
1007
|
/**
|
|
962
1008
|
* Returns true if the string could be used as an alias.
|
|
963
1009
|
*/ return t.D = function(t) {
|
|
964
|
-
return
|
|
1010
|
+
return wt.test(t);
|
|
965
1011
|
},
|
|
966
1012
|
/**
|
|
967
1013
|
* Return an escaped and quoted string representation of the alias.
|
|
@@ -970,7 +1016,7 @@ var vt = /** @class */ function(r) {
|
|
|
970
1016
|
var e = this.alias.replace(/\\/g, "\\\\").replace(/`/g, "\\`");
|
|
971
1017
|
return t.D(e) || (e = "`" + e + "`"), e;
|
|
972
1018
|
}, t;
|
|
973
|
-
}(),
|
|
1019
|
+
}(), bt = function(t, e, n) {
|
|
974
1020
|
this.alias = t, this.N = e, this.fieldPath = n;
|
|
975
1021
|
};
|
|
976
1022
|
|
|
@@ -1028,7 +1074,7 @@ var vt = /** @class */ function(r) {
|
|
|
1028
1074
|
*
|
|
1029
1075
|
* If `nBytes < 0` , an error will be thrown.
|
|
1030
1076
|
*/
|
|
1031
|
-
function
|
|
1077
|
+
function Tt(t) {
|
|
1032
1078
|
// Polyfills for IE and WebWorker by using `self` and `msCrypto` when `crypto` is not available.
|
|
1033
1079
|
var e =
|
|
1034
1080
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -1054,14 +1100,14 @@ function bt(t) {
|
|
|
1054
1100
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1055
1101
|
* See the License for the specific language governing permissions and
|
|
1056
1102
|
* limitations under the License.
|
|
1057
|
-
*/ var
|
|
1103
|
+
*/ var Et = /** @class */ function() {
|
|
1058
1104
|
function t() {}
|
|
1059
1105
|
return t.F = function() {
|
|
1060
1106
|
for (
|
|
1061
1107
|
// Alphanumeric characters
|
|
1062
1108
|
var t = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", e = Math.floor(256 / t.length) * t.length, n = ""
|
|
1063
1109
|
// The largest byte value that is a multiple of `char.length`.
|
|
1064
|
-
; n.length < 20; ) for (var r =
|
|
1110
|
+
; n.length < 20; ) for (var r = Tt(40), i = 0; i < r.length; ++i)
|
|
1065
1111
|
// Only accept values that are [0, maxMultiple), this ensures they can
|
|
1066
1112
|
// be evenly mapped to indices of `chars` via a modulo operation.
|
|
1067
1113
|
n.length < 20 && r[i] < e && (n += t.charAt(r[i] % t.length));
|
|
@@ -1069,11 +1115,11 @@ function bt(t) {
|
|
|
1069
1115
|
}, t;
|
|
1070
1116
|
}();
|
|
1071
1117
|
|
|
1072
|
-
function
|
|
1118
|
+
function St(t, e) {
|
|
1073
1119
|
return t < e ? -1 : t > e ? 1 : 0;
|
|
1074
1120
|
}
|
|
1075
1121
|
|
|
1076
|
-
/** Helper to compare arrays using isEqual(). */ function
|
|
1122
|
+
/** Helper to compare arrays using isEqual(). */ function kt(t, e, n) {
|
|
1077
1123
|
return t.length === e.length && t.every((function(t, r) {
|
|
1078
1124
|
return n(t, e[r]);
|
|
1079
1125
|
}));
|
|
@@ -1094,13 +1140,13 @@ function Et(t, e) {
|
|
|
1094
1140
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1095
1141
|
* See the License for the specific language governing permissions and
|
|
1096
1142
|
* limitations under the License.
|
|
1097
|
-
*/ function
|
|
1143
|
+
*/ function At(t) {
|
|
1098
1144
|
var e = 0;
|
|
1099
1145
|
for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && e++;
|
|
1100
1146
|
return e;
|
|
1101
1147
|
}
|
|
1102
1148
|
|
|
1103
|
-
function
|
|
1149
|
+
function It(t, e) {
|
|
1104
1150
|
for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && e(n, t[n]);
|
|
1105
1151
|
}
|
|
1106
1152
|
|
|
@@ -1122,13 +1168,13 @@ function At(t, e) {
|
|
|
1122
1168
|
*/
|
|
1123
1169
|
/**
|
|
1124
1170
|
* An error encountered while decoding base64 string.
|
|
1125
|
-
*/ var
|
|
1171
|
+
*/ var Ft = /** @class */ function(e) {
|
|
1126
1172
|
function n() {
|
|
1127
1173
|
var t = this;
|
|
1128
1174
|
return (t = e.apply(this, arguments) || this).name = "Base64DecodeError", t;
|
|
1129
1175
|
}
|
|
1130
1176
|
return t(n, e), n;
|
|
1131
|
-
}(Error),
|
|
1177
|
+
}(Error), Pt = /** @class */ function() {
|
|
1132
1178
|
function t(t) {
|
|
1133
1179
|
this.binaryString = t;
|
|
1134
1180
|
}
|
|
@@ -1137,7 +1183,7 @@ function At(t, e) {
|
|
|
1137
1183
|
try {
|
|
1138
1184
|
return atob(t);
|
|
1139
1185
|
} catch (t) {
|
|
1140
|
-
throw t instanceof DOMException ? new
|
|
1186
|
+
throw t instanceof DOMException ? new Ft("Invalid base64 string: " + t) : t;
|
|
1141
1187
|
}
|
|
1142
1188
|
}(e);
|
|
1143
1189
|
return new t(n);
|
|
@@ -1177,7 +1223,7 @@ function At(t, e) {
|
|
|
1177
1223
|
}, t.prototype.approximateByteSize = function() {
|
|
1178
1224
|
return 2 * this.binaryString.length;
|
|
1179
1225
|
}, t.prototype.compareTo = function(t) {
|
|
1180
|
-
return
|
|
1226
|
+
return St(this.binaryString, t.binaryString);
|
|
1181
1227
|
}, t.prototype.isEqual = function(t) {
|
|
1182
1228
|
return this.binaryString === t.binaryString;
|
|
1183
1229
|
}, t;
|
|
@@ -1224,14 +1270,14 @@ function At(t, e) {
|
|
|
1224
1270
|
* the proto byte string in a common class that must be converted into a string
|
|
1225
1271
|
* before being sent as a proto.
|
|
1226
1272
|
* @internal
|
|
1227
|
-
*/
|
|
1273
|
+
*/ Pt.EMPTY_BYTE_STRING = new Pt("");
|
|
1228
1274
|
|
|
1229
|
-
var
|
|
1275
|
+
var Vt = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
|
|
1230
1276
|
|
|
1231
1277
|
/**
|
|
1232
1278
|
* Converts the possible Proto values for a timestamp value into a "seconds and
|
|
1233
1279
|
* nanos" representation.
|
|
1234
|
-
*/ function
|
|
1280
|
+
*/ function Dt(t) {
|
|
1235
1281
|
// The json interface (for the browser) will return an iso timestamp string,
|
|
1236
1282
|
// while the proto js library (for node) will return a
|
|
1237
1283
|
// google.protobuf.Timestamp instance.
|
|
@@ -1239,7 +1285,7 @@ var Pt = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
|
|
|
1239
1285
|
// The date string can have higher precision (nanos) than the Date class
|
|
1240
1286
|
// (millis), so we do some custom parsing here.
|
|
1241
1287
|
// Parse the nanos right out of the string.
|
|
1242
|
-
var e = 0, n =
|
|
1288
|
+
var e = 0, n = Vt.exec(t);
|
|
1243
1289
|
if (A(!!n), n[1]) {
|
|
1244
1290
|
// Pad the fraction out to 9 digits (nanos).
|
|
1245
1291
|
var r = n[1];
|
|
@@ -1253,21 +1299,21 @@ var Pt = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
|
|
|
1253
1299
|
};
|
|
1254
1300
|
}
|
|
1255
1301
|
return {
|
|
1256
|
-
seconds:
|
|
1257
|
-
nanos:
|
|
1302
|
+
seconds: Nt(t.seconds),
|
|
1303
|
+
nanos: Nt(t.nanos)
|
|
1258
1304
|
};
|
|
1259
1305
|
}
|
|
1260
1306
|
|
|
1261
1307
|
/**
|
|
1262
1308
|
* Converts the possible Proto types for numbers into a JavaScript number.
|
|
1263
1309
|
* Returns 0 if the value is not numeric.
|
|
1264
|
-
*/ function
|
|
1310
|
+
*/ function Nt(t) {
|
|
1265
1311
|
// TODO(bjornick): Handle int64 greater than 53 bits.
|
|
1266
1312
|
return "number" == typeof t ? t : "string" == typeof t ? Number(t) : 0;
|
|
1267
1313
|
}
|
|
1268
1314
|
|
|
1269
|
-
/** Converts the possible Proto types for Blobs into a ByteString. */ function
|
|
1270
|
-
return "string" == typeof t ?
|
|
1315
|
+
/** Converts the possible Proto types for Blobs into a ByteString. */ function Ot(t) {
|
|
1316
|
+
return "string" == typeof t ? Pt.fromBase64String(t) : Pt.fromUint8Array(t);
|
|
1271
1317
|
}
|
|
1272
1318
|
|
|
1273
1319
|
/**
|
|
@@ -1300,7 +1346,7 @@ var Pt = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
|
|
|
1300
1346
|
*
|
|
1301
1347
|
* For examples and further specifications, refer to the
|
|
1302
1348
|
* {@link https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto | Timestamp definition}.
|
|
1303
|
-
*/ var
|
|
1349
|
+
*/ var qt = /** @class */ function() {
|
|
1304
1350
|
/**
|
|
1305
1351
|
* Creates a new timestamp.
|
|
1306
1352
|
*
|
|
@@ -1377,7 +1423,7 @@ var Pt = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
|
|
|
1377
1423
|
t.prototype.toMillis = function() {
|
|
1378
1424
|
return 1e3 * this.seconds + this.nanoseconds / 1e6;
|
|
1379
1425
|
}, t.prototype._compareTo = function(t) {
|
|
1380
|
-
return this.seconds === t.seconds ?
|
|
1426
|
+
return this.seconds === t.seconds ? St(this.nanoseconds, t.nanoseconds) : St(this.seconds, t.seconds);
|
|
1381
1427
|
},
|
|
1382
1428
|
/**
|
|
1383
1429
|
* Returns true if this `Timestamp` is equal to the provided one.
|
|
@@ -1449,7 +1495,7 @@ var Pt = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
|
|
|
1449
1495
|
* FieldValueOptions to value().
|
|
1450
1496
|
* - With respect to other ServerTimestampValues, they sort by their
|
|
1451
1497
|
* localWriteTime.
|
|
1452
|
-
*/ function
|
|
1498
|
+
*/ function Rt(t) {
|
|
1453
1499
|
var e, n;
|
|
1454
1500
|
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);
|
|
1455
1501
|
}
|
|
@@ -1459,16 +1505,16 @@ var Pt = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
|
|
|
1459
1505
|
*
|
|
1460
1506
|
* Preserving the previous values allows the user to display the last resoled
|
|
1461
1507
|
* value until the backend responds with the timestamp.
|
|
1462
|
-
*/ function
|
|
1508
|
+
*/ function Ct(t) {
|
|
1463
1509
|
var e = t.mapValue.fields.__previous_value__;
|
|
1464
|
-
return
|
|
1510
|
+
return Rt(e) ? Ct(e) : e;
|
|
1465
1511
|
}
|
|
1466
1512
|
|
|
1467
1513
|
/**
|
|
1468
1514
|
* Returns the local time at which this timestamp was first set.
|
|
1469
|
-
*/ function
|
|
1470
|
-
var e =
|
|
1471
|
-
return new
|
|
1515
|
+
*/ function xt(t) {
|
|
1516
|
+
var e = Dt(t.mapValue.fields.__local_write_time__.timestampValue);
|
|
1517
|
+
return new qt(e.seconds, e.nanos);
|
|
1472
1518
|
}
|
|
1473
1519
|
|
|
1474
1520
|
/**
|
|
@@ -1486,7 +1532,7 @@ var Pt = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
|
|
|
1486
1532
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1487
1533
|
* See the License for the specific language governing permissions and
|
|
1488
1534
|
* limitations under the License.
|
|
1489
|
-
*/ var
|
|
1535
|
+
*/ var Mt = {
|
|
1490
1536
|
fields: {
|
|
1491
1537
|
__type__: {
|
|
1492
1538
|
stringValue: "__max__"
|
|
@@ -1494,18 +1540,18 @@ var Pt = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
|
|
|
1494
1540
|
}
|
|
1495
1541
|
};
|
|
1496
1542
|
|
|
1497
|
-
/** Extracts the backend's type order for the provided value. */ function
|
|
1498
|
-
return "nullValue" in t ? 0 /* TypeOrder.NullValue */ : "booleanValue" in t ? 1 /* TypeOrder.BooleanValue */ : "integerValue" in t || "doubleValue" in t ? 2 /* TypeOrder.NumberValue */ : "timestampValue" in t ? 3 /* TypeOrder.TimestampValue */ : "stringValue" in t ? 5 /* TypeOrder.StringValue */ : "bytesValue" in t ? 6 /* TypeOrder.BlobValue */ : "referenceValue" in t ? 7 /* TypeOrder.RefValue */ : "geoPointValue" in t ? 8 /* TypeOrder.GeoPointValue */ : "arrayValue" in t ? 9 /* TypeOrder.ArrayValue */ : "mapValue" in t ?
|
|
1543
|
+
/** Extracts the backend's type order for the provided value. */ function Lt(t) {
|
|
1544
|
+
return "nullValue" in t ? 0 /* TypeOrder.NullValue */ : "booleanValue" in t ? 1 /* TypeOrder.BooleanValue */ : "integerValue" in t || "doubleValue" in t ? 2 /* TypeOrder.NumberValue */ : "timestampValue" in t ? 3 /* TypeOrder.TimestampValue */ : "stringValue" in t ? 5 /* TypeOrder.StringValue */ : "bytesValue" in t ? 6 /* TypeOrder.BlobValue */ : "referenceValue" in t ? 7 /* TypeOrder.RefValue */ : "geoPointValue" in t ? 8 /* TypeOrder.GeoPointValue */ : "arrayValue" in t ? 9 /* TypeOrder.ArrayValue */ : "mapValue" in t ? Rt(t) ? 4 /* TypeOrder.ServerTimestampValue */ :
|
|
1499
1545
|
/** Returns true if the Value represents the canonical {@link #MAX_VALUE} . */
|
|
1500
1546
|
function(t) {
|
|
1501
1547
|
return "__max__" === (((t.mapValue || {}).fields || {}).__type__ || {}).stringValue;
|
|
1502
1548
|
}(t) ? 9007199254740991 /* TypeOrder.MaxValue */ : 10 /* TypeOrder.ObjectValue */ : k();
|
|
1503
1549
|
}
|
|
1504
1550
|
|
|
1505
|
-
/** Tests `left` and `right` for equality based on the backend semantics. */ function
|
|
1551
|
+
/** Tests `left` and `right` for equality based on the backend semantics. */ function jt(t, e) {
|
|
1506
1552
|
if (t === e) return !0;
|
|
1507
|
-
var n =
|
|
1508
|
-
if (n !==
|
|
1553
|
+
var n = Lt(t);
|
|
1554
|
+
if (n !== Lt(e)) return !1;
|
|
1509
1555
|
switch (n) {
|
|
1510
1556
|
case 0 /* TypeOrder.NullValue */ :
|
|
1511
1557
|
case 9007199254740991 /* TypeOrder.MaxValue */ :
|
|
@@ -1515,14 +1561,14 @@ var Pt = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
|
|
|
1515
1561
|
return t.booleanValue === e.booleanValue;
|
|
1516
1562
|
|
|
1517
1563
|
case 4 /* TypeOrder.ServerTimestampValue */ :
|
|
1518
|
-
return
|
|
1564
|
+
return xt(t).isEqual(xt(e));
|
|
1519
1565
|
|
|
1520
1566
|
case 3 /* TypeOrder.TimestampValue */ :
|
|
1521
1567
|
return function(t, e) {
|
|
1522
1568
|
if ("string" == typeof t.timestampValue && "string" == typeof e.timestampValue && t.timestampValue.length === e.timestampValue.length)
|
|
1523
1569
|
// Use string equality for ISO 8601 timestamps
|
|
1524
1570
|
return t.timestampValue === e.timestampValue;
|
|
1525
|
-
var n =
|
|
1571
|
+
var n = Dt(t.timestampValue), r = Dt(e.timestampValue);
|
|
1526
1572
|
return n.seconds === r.seconds && n.nanos === r.nanos;
|
|
1527
1573
|
}(t, e);
|
|
1528
1574
|
|
|
@@ -1531,7 +1577,7 @@ var Pt = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
|
|
|
1531
1577
|
|
|
1532
1578
|
case 6 /* TypeOrder.BlobValue */ :
|
|
1533
1579
|
return function(t, e) {
|
|
1534
|
-
return
|
|
1580
|
+
return Ot(t.bytesValue).isEqual(Ot(e.bytesValue));
|
|
1535
1581
|
}(t, e);
|
|
1536
1582
|
|
|
1537
1583
|
case 7 /* TypeOrder.RefValue */ :
|
|
@@ -1539,27 +1585,27 @@ var Pt = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
|
|
|
1539
1585
|
|
|
1540
1586
|
case 8 /* TypeOrder.GeoPointValue */ :
|
|
1541
1587
|
return function(t, e) {
|
|
1542
|
-
return
|
|
1588
|
+
return Nt(t.geoPointValue.latitude) === Nt(e.geoPointValue.latitude) && Nt(t.geoPointValue.longitude) === Nt(e.geoPointValue.longitude);
|
|
1543
1589
|
}(t, e);
|
|
1544
1590
|
|
|
1545
1591
|
case 2 /* TypeOrder.NumberValue */ :
|
|
1546
1592
|
return function(t, e) {
|
|
1547
|
-
if ("integerValue" in t && "integerValue" in e) return
|
|
1593
|
+
if ("integerValue" in t && "integerValue" in e) return Nt(t.integerValue) === Nt(e.integerValue);
|
|
1548
1594
|
if ("doubleValue" in t && "doubleValue" in e) {
|
|
1549
|
-
var n =
|
|
1550
|
-
return n === r ?
|
|
1595
|
+
var n = Nt(t.doubleValue), r = Nt(e.doubleValue);
|
|
1596
|
+
return n === r ? pt(n) === pt(r) : isNaN(n) && isNaN(r);
|
|
1551
1597
|
}
|
|
1552
1598
|
return !1;
|
|
1553
1599
|
}(t, e);
|
|
1554
1600
|
|
|
1555
1601
|
case 9 /* TypeOrder.ArrayValue */ :
|
|
1556
|
-
return
|
|
1602
|
+
return kt(t.arrayValue.values || [], e.arrayValue.values || [], jt);
|
|
1557
1603
|
|
|
1558
1604
|
case 10 /* TypeOrder.ObjectValue */ :
|
|
1559
1605
|
return function(t, e) {
|
|
1560
1606
|
var n = t.mapValue.fields || {}, r = e.mapValue.fields || {};
|
|
1561
|
-
if (
|
|
1562
|
-
for (var i in n) if (n.hasOwnProperty(i) && (void 0 === r[i] || !
|
|
1607
|
+
if (At(n) !== At(r)) return !1;
|
|
1608
|
+
for (var i in n) if (n.hasOwnProperty(i) && (void 0 === r[i] || !jt(n[i], r[i]))) return !1;
|
|
1563
1609
|
return !0;
|
|
1564
1610
|
}(t, e);
|
|
1565
1611
|
|
|
@@ -1568,76 +1614,76 @@ var Pt = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
|
|
|
1568
1614
|
}
|
|
1569
1615
|
}
|
|
1570
1616
|
|
|
1571
|
-
function
|
|
1617
|
+
function Ut(t, e) {
|
|
1572
1618
|
return void 0 !== (t.values || []).find((function(t) {
|
|
1573
|
-
return
|
|
1619
|
+
return jt(t, e);
|
|
1574
1620
|
}));
|
|
1575
1621
|
}
|
|
1576
1622
|
|
|
1577
|
-
function
|
|
1623
|
+
function Bt(t, e) {
|
|
1578
1624
|
if (t === e) return 0;
|
|
1579
|
-
var n =
|
|
1580
|
-
if (n !== r) return
|
|
1625
|
+
var n = Lt(t), r = Lt(e);
|
|
1626
|
+
if (n !== r) return St(n, r);
|
|
1581
1627
|
switch (n) {
|
|
1582
1628
|
case 0 /* TypeOrder.NullValue */ :
|
|
1583
1629
|
case 9007199254740991 /* TypeOrder.MaxValue */ :
|
|
1584
1630
|
return 0;
|
|
1585
1631
|
|
|
1586
1632
|
case 1 /* TypeOrder.BooleanValue */ :
|
|
1587
|
-
return
|
|
1633
|
+
return St(t.booleanValue, e.booleanValue);
|
|
1588
1634
|
|
|
1589
1635
|
case 2 /* TypeOrder.NumberValue */ :
|
|
1590
1636
|
return function(t, e) {
|
|
1591
|
-
var n =
|
|
1637
|
+
var n = Nt(t.integerValue || t.doubleValue), r = Nt(e.integerValue || e.doubleValue);
|
|
1592
1638
|
return n < r ? -1 : n > r ? 1 : n === r ? 0 :
|
|
1593
1639
|
// one or both are NaN.
|
|
1594
1640
|
isNaN(n) ? isNaN(r) ? 0 : -1 : 1;
|
|
1595
1641
|
}(t, e);
|
|
1596
1642
|
|
|
1597
1643
|
case 3 /* TypeOrder.TimestampValue */ :
|
|
1598
|
-
return
|
|
1644
|
+
return zt(t.timestampValue, e.timestampValue);
|
|
1599
1645
|
|
|
1600
1646
|
case 4 /* TypeOrder.ServerTimestampValue */ :
|
|
1601
|
-
return
|
|
1647
|
+
return zt(xt(t), xt(e));
|
|
1602
1648
|
|
|
1603
1649
|
case 5 /* TypeOrder.StringValue */ :
|
|
1604
|
-
return
|
|
1650
|
+
return St(t.stringValue, e.stringValue);
|
|
1605
1651
|
|
|
1606
1652
|
case 6 /* TypeOrder.BlobValue */ :
|
|
1607
1653
|
return function(t, e) {
|
|
1608
|
-
var n =
|
|
1654
|
+
var n = Ot(t), r = Ot(e);
|
|
1609
1655
|
return n.compareTo(r);
|
|
1610
1656
|
}(t.bytesValue, e.bytesValue);
|
|
1611
1657
|
|
|
1612
1658
|
case 7 /* TypeOrder.RefValue */ :
|
|
1613
1659
|
return function(t, e) {
|
|
1614
1660
|
for (var n = t.split("/"), r = e.split("/"), i = 0; i < n.length && i < r.length; i++) {
|
|
1615
|
-
var o =
|
|
1661
|
+
var o = St(n[i], r[i]);
|
|
1616
1662
|
if (0 !== o) return o;
|
|
1617
1663
|
}
|
|
1618
|
-
return
|
|
1664
|
+
return St(n.length, r.length);
|
|
1619
1665
|
}(t.referenceValue, e.referenceValue);
|
|
1620
1666
|
|
|
1621
1667
|
case 8 /* TypeOrder.GeoPointValue */ :
|
|
1622
1668
|
return function(t, e) {
|
|
1623
|
-
var n =
|
|
1624
|
-
return 0 !== n ? n :
|
|
1669
|
+
var n = St(Nt(t.latitude), Nt(e.latitude));
|
|
1670
|
+
return 0 !== n ? n : St(Nt(t.longitude), Nt(e.longitude));
|
|
1625
1671
|
}(t.geoPointValue, e.geoPointValue);
|
|
1626
1672
|
|
|
1627
1673
|
case 9 /* TypeOrder.ArrayValue */ :
|
|
1628
1674
|
return function(t, e) {
|
|
1629
1675
|
for (var n = t.values || [], r = e.values || [], i = 0; i < n.length && i < r.length; ++i) {
|
|
1630
|
-
var o =
|
|
1676
|
+
var o = Bt(n[i], r[i]);
|
|
1631
1677
|
if (o) return o;
|
|
1632
1678
|
}
|
|
1633
|
-
return
|
|
1679
|
+
return St(n.length, r.length);
|
|
1634
1680
|
}(t.arrayValue, e.arrayValue);
|
|
1635
1681
|
|
|
1636
1682
|
case 10 /* TypeOrder.ObjectValue */ :
|
|
1637
1683
|
return function(t, e) {
|
|
1638
|
-
if (t ===
|
|
1639
|
-
if (t ===
|
|
1640
|
-
if (e ===
|
|
1684
|
+
if (t === Mt && e === Mt) return 0;
|
|
1685
|
+
if (t === Mt) return 1;
|
|
1686
|
+
if (e === Mt) return -1;
|
|
1641
1687
|
var n = t.fields || {}, r = Object.keys(n), i = e.fields || {}, o = Object.keys(i);
|
|
1642
1688
|
// Even though MapValues are likely sorted correctly based on their insertion
|
|
1643
1689
|
// order (e.g. when received from the backend), local modifications can bring
|
|
@@ -1645,12 +1691,12 @@ function Ut(t, e) {
|
|
|
1645
1691
|
// canonical IDs are independent of insertion order.
|
|
1646
1692
|
r.sort(), o.sort();
|
|
1647
1693
|
for (var a = 0; a < r.length && a < o.length; ++a) {
|
|
1648
|
-
var u =
|
|
1694
|
+
var u = St(r[a], o[a]);
|
|
1649
1695
|
if (0 !== u) return u;
|
|
1650
|
-
var s =
|
|
1696
|
+
var s = Bt(n[r[a]], i[o[a]]);
|
|
1651
1697
|
if (0 !== s) return s;
|
|
1652
1698
|
}
|
|
1653
|
-
return
|
|
1699
|
+
return St(r.length, o.length);
|
|
1654
1700
|
}(t.mapValue, e.mapValue);
|
|
1655
1701
|
|
|
1656
1702
|
default:
|
|
@@ -1658,35 +1704,35 @@ function Ut(t, e) {
|
|
|
1658
1704
|
}
|
|
1659
1705
|
}
|
|
1660
1706
|
|
|
1661
|
-
function
|
|
1662
|
-
if ("string" == typeof t && "string" == typeof e && t.length === e.length) return
|
|
1663
|
-
var n =
|
|
1664
|
-
return 0 !== i ? i :
|
|
1707
|
+
function zt(t, e) {
|
|
1708
|
+
if ("string" == typeof t && "string" == typeof e && t.length === e.length) return St(t, e);
|
|
1709
|
+
var n = Dt(t), r = Dt(e), i = St(n.seconds, r.seconds);
|
|
1710
|
+
return 0 !== i ? i : St(n.nanos, r.nanos);
|
|
1665
1711
|
}
|
|
1666
1712
|
|
|
1667
|
-
function
|
|
1713
|
+
function Kt(t, e) {
|
|
1668
1714
|
return {
|
|
1669
1715
|
referenceValue: "projects/".concat(t.projectId, "/databases/").concat(t.database, "/documents/").concat(e.path.canonicalString())
|
|
1670
1716
|
};
|
|
1671
1717
|
}
|
|
1672
1718
|
|
|
1673
|
-
/** Returns true if `value` is an ArrayValue. */ function
|
|
1719
|
+
/** Returns true if `value` is an ArrayValue. */ function Qt(t) {
|
|
1674
1720
|
return !!t && "arrayValue" in t;
|
|
1675
1721
|
}
|
|
1676
1722
|
|
|
1677
|
-
/** Returns true if `value` is a NullValue. */ function
|
|
1723
|
+
/** Returns true if `value` is a NullValue. */ function Gt(t) {
|
|
1678
1724
|
return !!t && "nullValue" in t;
|
|
1679
1725
|
}
|
|
1680
1726
|
|
|
1681
|
-
/** Returns true if `value` is NaN. */ function
|
|
1727
|
+
/** Returns true if `value` is NaN. */ function Yt(t) {
|
|
1682
1728
|
return !!t && "doubleValue" in t && isNaN(Number(t.doubleValue));
|
|
1683
1729
|
}
|
|
1684
1730
|
|
|
1685
|
-
/** Returns true if `value` is a MapValue. */ function
|
|
1731
|
+
/** Returns true if `value` is a MapValue. */ function Wt(t) {
|
|
1686
1732
|
return !!t && "mapValue" in t;
|
|
1687
1733
|
}
|
|
1688
1734
|
|
|
1689
|
-
/** Creates a deep copy of `source`. */ function
|
|
1735
|
+
/** Creates a deep copy of `source`. */ function Ht(t) {
|
|
1690
1736
|
if (t.geoPointValue) return {
|
|
1691
1737
|
geoPointValue: Object.assign({}, t.geoPointValue)
|
|
1692
1738
|
};
|
|
@@ -1699,8 +1745,8 @@ function zt(t, e) {
|
|
|
1699
1745
|
fields: {}
|
|
1700
1746
|
}
|
|
1701
1747
|
};
|
|
1702
|
-
return
|
|
1703
|
-
return e.mapValue.fields[t] =
|
|
1748
|
+
return It(t.mapValue.fields, (function(t, n) {
|
|
1749
|
+
return e.mapValue.fields[t] = Ht(n);
|
|
1704
1750
|
})), e;
|
|
1705
1751
|
}
|
|
1706
1752
|
if (t.arrayValue) {
|
|
@@ -1708,21 +1754,21 @@ function zt(t, e) {
|
|
|
1708
1754
|
arrayValue: {
|
|
1709
1755
|
values: []
|
|
1710
1756
|
}
|
|
1711
|
-
}, r = 0; r < (t.arrayValue.values || []).length; ++r) n.arrayValue.values[r] =
|
|
1757
|
+
}, r = 0; r < (t.arrayValue.values || []).length; ++r) n.arrayValue.values[r] = Ht(t.arrayValue.values[r]);
|
|
1712
1758
|
return n;
|
|
1713
1759
|
}
|
|
1714
1760
|
return Object.assign({}, t);
|
|
1715
1761
|
}
|
|
1716
1762
|
|
|
1717
|
-
var
|
|
1763
|
+
var Xt = function(t, e) {
|
|
1718
1764
|
this.position = t, this.inclusive = e;
|
|
1719
1765
|
};
|
|
1720
1766
|
|
|
1721
|
-
function
|
|
1767
|
+
function Jt(t, e) {
|
|
1722
1768
|
if (null === t) return null === e;
|
|
1723
1769
|
if (null === e) return !1;
|
|
1724
1770
|
if (t.inclusive !== e.inclusive || t.position.length !== e.position.length) return !1;
|
|
1725
|
-
for (var n = 0; n < t.position.length; n++) if (!
|
|
1771
|
+
for (var n = 0; n < t.position.length; n++) if (!jt(t.position[n], e.position[n])) return !1;
|
|
1726
1772
|
return !0;
|
|
1727
1773
|
}
|
|
1728
1774
|
|
|
@@ -1741,7 +1787,7 @@ function Xt(t, e) {
|
|
|
1741
1787
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1742
1788
|
* See the License for the specific language governing permissions and
|
|
1743
1789
|
* limitations under the License.
|
|
1744
|
-
*/ var
|
|
1790
|
+
*/ var Zt = function() {}, $t = /** @class */ function(e) {
|
|
1745
1791
|
function n(t, n, r) {
|
|
1746
1792
|
var i = this;
|
|
1747
1793
|
return (i = e.call(this) || this).field = t, i.op = n, i.value = r, i;
|
|
@@ -1749,13 +1795,13 @@ function Xt(t, e) {
|
|
|
1749
1795
|
/**
|
|
1750
1796
|
* Creates a filter based on the provided arguments.
|
|
1751
1797
|
*/ return t(n, e), n.create = function(t, e, r) {
|
|
1752
|
-
return t.isKeyField() ? "in" /* Operator.IN */ === e || "not-in" /* Operator.NOT_IN */ === e ? this.createKeyFieldInFilter(t, e, r) : new
|
|
1798
|
+
return t.isKeyField() ? "in" /* Operator.IN */ === e || "not-in" /* Operator.NOT_IN */ === e ? this.createKeyFieldInFilter(t, e, r) : new ne(t, e, r) : "array-contains" /* Operator.ARRAY_CONTAINS */ === e ? new ae(t, r) : "in" /* Operator.IN */ === e ? new ue(t, r) : "not-in" /* Operator.NOT_IN */ === e ? new se(t, r) : "array-contains-any" /* Operator.ARRAY_CONTAINS_ANY */ === e ? new ce(t, r) : new n(t, e, r);
|
|
1753
1799
|
}, n.createKeyFieldInFilter = function(t, e, n) {
|
|
1754
|
-
return "in" /* Operator.IN */ === e ? new
|
|
1800
|
+
return "in" /* Operator.IN */ === e ? new re(t, n) : new ie(t, n);
|
|
1755
1801
|
}, n.prototype.matches = function(t) {
|
|
1756
1802
|
var e = t.data.field(this.field);
|
|
1757
1803
|
// Types do not have to match in NOT_EQUAL filters.
|
|
1758
|
-
return "!=" /* Operator.NOT_EQUAL */ === this.op ? null !== e && this.matchesComparison(
|
|
1804
|
+
return "!=" /* Operator.NOT_EQUAL */ === this.op ? null !== e && this.matchesComparison(Bt(e, this.value)) : null !== e && Lt(this.value) === Lt(e) && this.matchesComparison(Bt(e, this.value));
|
|
1759
1805
|
// Only compare types with matching backend order (such as double and int).
|
|
1760
1806
|
}, n.prototype.matchesComparison = function(t) {
|
|
1761
1807
|
switch (this.op) {
|
|
@@ -1789,7 +1835,7 @@ function Xt(t, e) {
|
|
|
1789
1835
|
}, n.prototype.getFirstInequalityField = function() {
|
|
1790
1836
|
return this.isInequality() ? this.field : null;
|
|
1791
1837
|
}, n;
|
|
1792
|
-
}(
|
|
1838
|
+
}(Zt), te = /** @class */ function(e) {
|
|
1793
1839
|
function n(t, n) {
|
|
1794
1840
|
var r = this;
|
|
1795
1841
|
return (r = e.call(this) || this).filters = t, r.op = n, r.S = null, r;
|
|
@@ -1828,19 +1874,19 @@ function Xt(t, e) {
|
|
|
1828
1874
|
}
|
|
1829
1875
|
return null;
|
|
1830
1876
|
}, n;
|
|
1831
|
-
}(
|
|
1832
|
-
|
|
1833
|
-
function
|
|
1834
|
-
return t instanceof
|
|
1835
|
-
return e instanceof
|
|
1836
|
-
}(t, e) : t instanceof
|
|
1837
|
-
return e instanceof
|
|
1838
|
-
return t &&
|
|
1877
|
+
}(Zt);
|
|
1878
|
+
|
|
1879
|
+
function ee(t, e) {
|
|
1880
|
+
return t instanceof $t ? function(t, e) {
|
|
1881
|
+
return e instanceof $t && t.op === e.op && t.field.isEqual(e.field) && jt(t.value, e.value);
|
|
1882
|
+
}(t, e) : t instanceof te ? function(t, e) {
|
|
1883
|
+
return e instanceof te && t.op === e.op && t.filters.length === e.filters.length && t.filters.reduce((function(t, n, r) {
|
|
1884
|
+
return t && ee(n, e.filters[r]);
|
|
1839
1885
|
}), !0);
|
|
1840
1886
|
}(t, e) : void k();
|
|
1841
1887
|
}
|
|
1842
1888
|
|
|
1843
|
-
var
|
|
1889
|
+
var ne = /** @class */ function(e) {
|
|
1844
1890
|
function n(t, n, r) {
|
|
1845
1891
|
var i = this;
|
|
1846
1892
|
return (i = e.call(this, t, n, r) || this).key = it.fromName(r.referenceValue),
|
|
@@ -1850,10 +1896,10 @@ var ee = /** @class */ function(e) {
|
|
|
1850
1896
|
var e = it.comparator(t.key, this.key);
|
|
1851
1897
|
return this.matchesComparison(e);
|
|
1852
1898
|
}, n;
|
|
1853
|
-
}(
|
|
1899
|
+
}($t), re = /** @class */ function(e) {
|
|
1854
1900
|
function n(t, n) {
|
|
1855
1901
|
var r = this;
|
|
1856
|
-
return (r = e.call(this, t, "in" /* Operator.IN */ , n) || this).keys =
|
|
1902
|
+
return (r = e.call(this, t, "in" /* Operator.IN */ , n) || this).keys = oe("in" /* Operator.IN */ , n),
|
|
1857
1903
|
r;
|
|
1858
1904
|
}
|
|
1859
1905
|
return t(n, e), n.prototype.matches = function(t) {
|
|
@@ -1861,10 +1907,10 @@ var ee = /** @class */ function(e) {
|
|
|
1861
1907
|
return e.isEqual(t.key);
|
|
1862
1908
|
}));
|
|
1863
1909
|
}, n;
|
|
1864
|
-
}(
|
|
1910
|
+
}($t), ie = /** @class */ function(e) {
|
|
1865
1911
|
function n(t, n) {
|
|
1866
1912
|
var r = this;
|
|
1867
|
-
return (r = e.call(this, t, "not-in" /* Operator.NOT_IN */ , n) || this).keys =
|
|
1913
|
+
return (r = e.call(this, t, "not-in" /* Operator.NOT_IN */ , n) || this).keys = oe("not-in" /* Operator.NOT_IN */ , n),
|
|
1868
1914
|
r;
|
|
1869
1915
|
}
|
|
1870
1916
|
return t(n, e), n.prototype.matches = function(t) {
|
|
@@ -1872,57 +1918,57 @@ var ee = /** @class */ function(e) {
|
|
|
1872
1918
|
return e.isEqual(t.key);
|
|
1873
1919
|
}));
|
|
1874
1920
|
}, n;
|
|
1875
|
-
}(
|
|
1921
|
+
}($t);
|
|
1876
1922
|
|
|
1877
|
-
/** Filter that matches on key fields within an array. */ function
|
|
1923
|
+
/** Filter that matches on key fields within an array. */ function oe(t, e) {
|
|
1878
1924
|
var n;
|
|
1879
1925
|
return ((null === (n = e.arrayValue) || void 0 === n ? void 0 : n.values) || []).map((function(t) {
|
|
1880
1926
|
return it.fromName(t.referenceValue);
|
|
1881
1927
|
}));
|
|
1882
1928
|
}
|
|
1883
1929
|
|
|
1884
|
-
/** A Filter that implements the array-contains operator. */ var
|
|
1930
|
+
/** A Filter that implements the array-contains operator. */ var ae = /** @class */ function(e) {
|
|
1885
1931
|
function n(t, n) {
|
|
1886
1932
|
return e.call(this, t, "array-contains" /* Operator.ARRAY_CONTAINS */ , n) || this;
|
|
1887
1933
|
}
|
|
1888
1934
|
return t(n, e), n.prototype.matches = function(t) {
|
|
1889
1935
|
var e = t.data.field(this.field);
|
|
1890
|
-
return
|
|
1936
|
+
return Qt(e) && Ut(e.arrayValue, this.value);
|
|
1891
1937
|
}, n;
|
|
1892
|
-
}(
|
|
1938
|
+
}($t), ue = /** @class */ function(e) {
|
|
1893
1939
|
function n(t, n) {
|
|
1894
1940
|
return e.call(this, t, "in" /* Operator.IN */ , n) || this;
|
|
1895
1941
|
}
|
|
1896
1942
|
return t(n, e), n.prototype.matches = function(t) {
|
|
1897
1943
|
var e = t.data.field(this.field);
|
|
1898
|
-
return null !== e &&
|
|
1944
|
+
return null !== e && Ut(this.value.arrayValue, e);
|
|
1899
1945
|
}, n;
|
|
1900
|
-
}(
|
|
1946
|
+
}($t), se = /** @class */ function(e) {
|
|
1901
1947
|
function n(t, n) {
|
|
1902
1948
|
return e.call(this, t, "not-in" /* Operator.NOT_IN */ , n) || this;
|
|
1903
1949
|
}
|
|
1904
1950
|
return t(n, e), n.prototype.matches = function(t) {
|
|
1905
|
-
if (
|
|
1951
|
+
if (Ut(this.value.arrayValue, {
|
|
1906
1952
|
nullValue: "NULL_VALUE"
|
|
1907
1953
|
})) return !1;
|
|
1908
1954
|
var e = t.data.field(this.field);
|
|
1909
|
-
return null !== e && !
|
|
1955
|
+
return null !== e && !Ut(this.value.arrayValue, e);
|
|
1910
1956
|
}, n;
|
|
1911
|
-
}(
|
|
1957
|
+
}($t), ce = /** @class */ function(e) {
|
|
1912
1958
|
function n(t, n) {
|
|
1913
1959
|
return e.call(this, t, "array-contains-any" /* Operator.ARRAY_CONTAINS_ANY */ , n) || this;
|
|
1914
1960
|
}
|
|
1915
1961
|
return t(n, e), n.prototype.matches = function(t) {
|
|
1916
1962
|
var e = this, n = t.data.field(this.field);
|
|
1917
|
-
return !(!
|
|
1918
|
-
return
|
|
1963
|
+
return !(!Qt(n) || !n.arrayValue.values) && n.arrayValue.values.some((function(t) {
|
|
1964
|
+
return Ut(e.value.arrayValue, t);
|
|
1919
1965
|
}));
|
|
1920
1966
|
}, n;
|
|
1921
|
-
}(
|
|
1967
|
+
}($t), le = function(t, e /* Direction.ASCENDING */) {
|
|
1922
1968
|
void 0 === e && (e = "asc"), this.field = t, this.dir = e;
|
|
1923
1969
|
};
|
|
1924
1970
|
|
|
1925
|
-
/** A Filter that implements the IN operator. */ function
|
|
1971
|
+
/** A Filter that implements the IN operator. */ function fe(t, e) {
|
|
1926
1972
|
return t.dir === e.dir && t.field.isEqual(e.field);
|
|
1927
1973
|
}
|
|
1928
1974
|
|
|
@@ -1945,16 +1991,16 @@ var ee = /** @class */ function(e) {
|
|
|
1945
1991
|
/**
|
|
1946
1992
|
* A version of a document in Firestore. This corresponds to the version
|
|
1947
1993
|
* timestamp, such as update_time or read_time.
|
|
1948
|
-
*/ var
|
|
1994
|
+
*/ var he = /** @class */ function() {
|
|
1949
1995
|
function t(t) {
|
|
1950
1996
|
this.timestamp = t;
|
|
1951
1997
|
}
|
|
1952
1998
|
return t.fromTimestamp = function(e) {
|
|
1953
1999
|
return new t(e);
|
|
1954
2000
|
}, t.min = function() {
|
|
1955
|
-
return new t(new
|
|
2001
|
+
return new t(new qt(0, 0));
|
|
1956
2002
|
}, t.max = function() {
|
|
1957
|
-
return new t(new
|
|
2003
|
+
return new t(new qt(253402300799, 999999999));
|
|
1958
2004
|
}, t.prototype.compareTo = function(t) {
|
|
1959
2005
|
return this.timestamp._compareTo(t.timestamp);
|
|
1960
2006
|
}, t.prototype.isEqual = function(t) {
|
|
@@ -1968,17 +2014,17 @@ var ee = /** @class */ function(e) {
|
|
|
1968
2014
|
}, t.prototype.toTimestamp = function() {
|
|
1969
2015
|
return this.timestamp;
|
|
1970
2016
|
}, t;
|
|
1971
|
-
}(),
|
|
2017
|
+
}(), pe = /** @class */ function() {
|
|
1972
2018
|
function t(t, e) {
|
|
1973
|
-
this.comparator = t, this.root = e ||
|
|
2019
|
+
this.comparator = t, this.root = e || ye.EMPTY;
|
|
1974
2020
|
}
|
|
1975
2021
|
// Returns a copy of the map, with the specified key/value added or replaced.
|
|
1976
2022
|
return t.prototype.insert = function(e, n) {
|
|
1977
|
-
return new t(this.comparator, this.root.insert(e, n, this.comparator).copy(null, null,
|
|
2023
|
+
return new t(this.comparator, this.root.insert(e, n, this.comparator).copy(null, null, ye.BLACK, null, null));
|
|
1978
2024
|
},
|
|
1979
2025
|
// Returns a copy of the map, with the specified key removed.
|
|
1980
2026
|
t.prototype.remove = function(e) {
|
|
1981
|
-
return new t(this.comparator, this.root.remove(e, this.comparator).copy(null, null,
|
|
2027
|
+
return new t(this.comparator, this.root.remove(e, this.comparator).copy(null, null, ye.BLACK, null, null));
|
|
1982
2028
|
},
|
|
1983
2029
|
// Returns the value of the node with the given key, or null.
|
|
1984
2030
|
t.prototype.get = function(t) {
|
|
@@ -2047,15 +2093,15 @@ var ee = /** @class */ function(e) {
|
|
|
2047
2093
|
},
|
|
2048
2094
|
// Returns an iterator over the SortedMap.
|
|
2049
2095
|
t.prototype.getIterator = function() {
|
|
2050
|
-
return new
|
|
2096
|
+
return new de(this.root, null, this.comparator, !1);
|
|
2051
2097
|
}, t.prototype.getIteratorFrom = function(t) {
|
|
2052
|
-
return new
|
|
2098
|
+
return new de(this.root, t, this.comparator, !1);
|
|
2053
2099
|
}, t.prototype.getReverseIterator = function() {
|
|
2054
|
-
return new
|
|
2100
|
+
return new de(this.root, null, this.comparator, !0);
|
|
2055
2101
|
}, t.prototype.getReverseIteratorFrom = function(t) {
|
|
2056
|
-
return new
|
|
2102
|
+
return new de(this.root, t, this.comparator, !0);
|
|
2057
2103
|
}, t;
|
|
2058
|
-
}(),
|
|
2104
|
+
}(), de = /** @class */ function() {
|
|
2059
2105
|
function t(t, e, n, r) {
|
|
2060
2106
|
this.isReverse = r, this.nodeStack = [];
|
|
2061
2107
|
for (var i = 1; !t.isEmpty(); ) if (i = e ? n(t.key, e) : 1,
|
|
@@ -2092,7 +2138,7 @@ var ee = /** @class */ function(e) {
|
|
|
2092
2138
|
value: t.value
|
|
2093
2139
|
};
|
|
2094
2140
|
}, t;
|
|
2095
|
-
}(),
|
|
2141
|
+
}(), ye = /** @class */ function() {
|
|
2096
2142
|
function t(e, n, r, i, o) {
|
|
2097
2143
|
this.key = e, this.value = n, this.color = null != r ? r : t.RED, this.left = null != i ? i : t.EMPTY,
|
|
2098
2144
|
this.right = null != o ? o : t.EMPTY, this.size = this.left.size + 1 + this.right.size;
|
|
@@ -2213,9 +2259,9 @@ var ee = /** @class */ function(e) {
|
|
|
2213
2259
|
// end LLRBNode
|
|
2214
2260
|
// Empty node is shared between all LLRB trees.
|
|
2215
2261
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2216
|
-
|
|
2262
|
+
ye.EMPTY = null, ye.RED = !0, ye.BLACK = !1,
|
|
2217
2263
|
// end LLRBEmptyNode
|
|
2218
|
-
|
|
2264
|
+
ye.EMPTY = new (/** @class */ function() {
|
|
2219
2265
|
function t() {
|
|
2220
2266
|
this.size = 0;
|
|
2221
2267
|
}
|
|
@@ -2256,7 +2302,7 @@ de.EMPTY = new (/** @class */ function() {
|
|
|
2256
2302
|
},
|
|
2257
2303
|
// Returns a copy of the tree, with the specified key/value added.
|
|
2258
2304
|
t.prototype.insert = function(t, e, n) {
|
|
2259
|
-
return new
|
|
2305
|
+
return new ye(t, e);
|
|
2260
2306
|
},
|
|
2261
2307
|
// Returns a copy of the tree, with the specified key removed.
|
|
2262
2308
|
t.prototype.remove = function(t, e) {
|
|
@@ -2305,9 +2351,9 @@ de.EMPTY = new (/** @class */ function() {
|
|
|
2305
2351
|
* NOTE: if provided comparator returns 0 for two elements, we consider them to
|
|
2306
2352
|
* be equal!
|
|
2307
2353
|
*/
|
|
2308
|
-
var
|
|
2354
|
+
var me = /** @class */ function() {
|
|
2309
2355
|
function t(t) {
|
|
2310
|
-
this.comparator = t, this.data = new
|
|
2356
|
+
this.comparator = t, this.data = new pe(this.comparator);
|
|
2311
2357
|
}
|
|
2312
2358
|
return t.prototype.has = function(t) {
|
|
2313
2359
|
return null !== this.data.get(t);
|
|
@@ -2347,9 +2393,9 @@ var ye = /** @class */ function() {
|
|
|
2347
2393
|
var e = this.data.getIteratorFrom(t);
|
|
2348
2394
|
return e.hasNext() ? e.getNext().key : null;
|
|
2349
2395
|
}, t.prototype.getIterator = function() {
|
|
2350
|
-
return new
|
|
2396
|
+
return new ve(this.data.getIterator());
|
|
2351
2397
|
}, t.prototype.getIteratorFrom = function(t) {
|
|
2352
|
-
return new
|
|
2398
|
+
return new ve(this.data.getIteratorFrom(t));
|
|
2353
2399
|
},
|
|
2354
2400
|
/** Inserts or updates an element */ t.prototype.add = function(t) {
|
|
2355
2401
|
return this.copy(this.data.remove(t).insert(t, !0));
|
|
@@ -2386,7 +2432,7 @@ var ye = /** @class */ function() {
|
|
|
2386
2432
|
var n = new t(this.comparator);
|
|
2387
2433
|
return n.data = e, n;
|
|
2388
2434
|
}, t;
|
|
2389
|
-
}(),
|
|
2435
|
+
}(), ve = /** @class */ function() {
|
|
2390
2436
|
function t(t) {
|
|
2391
2437
|
this.iter = t;
|
|
2392
2438
|
}
|
|
@@ -2395,7 +2441,7 @@ var ye = /** @class */ function() {
|
|
|
2395
2441
|
}, t.prototype.hasNext = function() {
|
|
2396
2442
|
return this.iter.hasNext();
|
|
2397
2443
|
}, t;
|
|
2398
|
-
}(),
|
|
2444
|
+
}(), ge = /** @class */ function() {
|
|
2399
2445
|
function t(t) {
|
|
2400
2446
|
this.fields = t,
|
|
2401
2447
|
// TODO(dimond): validation of FieldMask
|
|
@@ -2410,7 +2456,7 @@ var ye = /** @class */ function() {
|
|
|
2410
2456
|
* fields paths to this field mask.
|
|
2411
2457
|
*/
|
|
2412
2458
|
t.prototype.unionWith = function(e) {
|
|
2413
|
-
for (var n = new
|
|
2459
|
+
for (var n = new me(rt.comparator), r = 0, i = this.fields; r < i.length; r++) {
|
|
2414
2460
|
var o = i[r];
|
|
2415
2461
|
n = n.add(o);
|
|
2416
2462
|
}
|
|
@@ -2432,11 +2478,11 @@ var ye = /** @class */ function() {
|
|
|
2432
2478
|
}
|
|
2433
2479
|
return !1;
|
|
2434
2480
|
}, t.prototype.isEqual = function(t) {
|
|
2435
|
-
return
|
|
2481
|
+
return kt(this.fields, t.fields, (function(t, e) {
|
|
2436
2482
|
return t.isEqual(e);
|
|
2437
2483
|
}));
|
|
2438
2484
|
}, t;
|
|
2439
|
-
}(),
|
|
2485
|
+
}(), we = /** @class */ function() {
|
|
2440
2486
|
function t(t) {
|
|
2441
2487
|
this.value = t;
|
|
2442
2488
|
}
|
|
@@ -2453,7 +2499,7 @@ var ye = /** @class */ function() {
|
|
|
2453
2499
|
*/
|
|
2454
2500
|
t.prototype.field = function(t) {
|
|
2455
2501
|
if (t.isEmpty()) return this.value;
|
|
2456
|
-
for (var e = this.value, n = 0; n < t.length - 1; ++n) if (!
|
|
2502
|
+
for (var e = this.value, n = 0; n < t.length - 1; ++n) if (!Wt(e = (e.mapValue.fields || {})[t.get(n)])) return null;
|
|
2457
2503
|
return (e = (e.mapValue.fields || {})[t.lastSegment()]) || null;
|
|
2458
2504
|
},
|
|
2459
2505
|
/**
|
|
@@ -2463,7 +2509,7 @@ var ye = /** @class */ function() {
|
|
|
2463
2509
|
* @param value - The value to set.
|
|
2464
2510
|
*/
|
|
2465
2511
|
t.prototype.set = function(t, e) {
|
|
2466
|
-
this.getFieldsMap(t.popLast())[t.lastSegment()] =
|
|
2512
|
+
this.getFieldsMap(t.popLast())[t.lastSegment()] = Ht(e);
|
|
2467
2513
|
},
|
|
2468
2514
|
/**
|
|
2469
2515
|
* Sets the provided fields to the provided values.
|
|
@@ -2478,7 +2524,7 @@ var ye = /** @class */ function() {
|
|
|
2478
2524
|
var a = e.getFieldsMap(n);
|
|
2479
2525
|
e.applyChanges(a, r, i), r = {}, i = [], n = o.popLast();
|
|
2480
2526
|
}
|
|
2481
|
-
t ? r[o.lastSegment()] =
|
|
2527
|
+
t ? r[o.lastSegment()] = Ht(t) : i.push(o.lastSegment());
|
|
2482
2528
|
}));
|
|
2483
2529
|
var o = this.getFieldsMap(n);
|
|
2484
2530
|
this.applyChanges(o, r, i);
|
|
@@ -2491,9 +2537,9 @@ var ye = /** @class */ function() {
|
|
|
2491
2537
|
*/
|
|
2492
2538
|
t.prototype.delete = function(t) {
|
|
2493
2539
|
var e = this.field(t.popLast());
|
|
2494
|
-
|
|
2540
|
+
Wt(e) && e.mapValue.fields && delete e.mapValue.fields[t.lastSegment()];
|
|
2495
2541
|
}, t.prototype.isEqual = function(t) {
|
|
2496
|
-
return
|
|
2542
|
+
return jt(this.value, t.value);
|
|
2497
2543
|
},
|
|
2498
2544
|
/**
|
|
2499
2545
|
* Returns the map that contains the leaf element of `path`. If the parent
|
|
@@ -2506,7 +2552,7 @@ var ye = /** @class */ function() {
|
|
|
2506
2552
|
});
|
|
2507
2553
|
for (var n = 0; n < t.length; ++n) {
|
|
2508
2554
|
var r = e.mapValue.fields[t.get(n)];
|
|
2509
|
-
|
|
2555
|
+
Wt(r) && r.mapValue.fields || (r = {
|
|
2510
2556
|
mapValue: {
|
|
2511
2557
|
fields: {}
|
|
2512
2558
|
}
|
|
@@ -2519,7 +2565,7 @@ var ye = /** @class */ function() {
|
|
|
2519
2565
|
* entries.
|
|
2520
2566
|
*/
|
|
2521
2567
|
t.prototype.applyChanges = function(t, e, n) {
|
|
2522
|
-
|
|
2568
|
+
It(e, (function(e, n) {
|
|
2523
2569
|
return t[e] = n;
|
|
2524
2570
|
}));
|
|
2525
2571
|
for (var r = 0, i = n; r < i.length; r++) {
|
|
@@ -2527,9 +2573,9 @@ var ye = /** @class */ function() {
|
|
|
2527
2573
|
delete t[o];
|
|
2528
2574
|
}
|
|
2529
2575
|
}, t.prototype.clone = function() {
|
|
2530
|
-
return new t(
|
|
2576
|
+
return new t(Ht(this.value));
|
|
2531
2577
|
}, t;
|
|
2532
|
-
}(),
|
|
2578
|
+
}(), _e = /** @class */ function() {
|
|
2533
2579
|
function t(t, e, n, r, i, o, a) {
|
|
2534
2580
|
this.key = t, this.documentType = e, this.version = n, this.readTime = r, this.createTime = i,
|
|
2535
2581
|
this.data = o, this.documentState = a
|
|
@@ -2540,9 +2586,9 @@ var ye = /** @class */ function() {
|
|
|
2540
2586
|
}
|
|
2541
2587
|
return t.newInvalidDocument = function(e) {
|
|
2542
2588
|
return new t(e, 0 /* DocumentType.INVALID */ ,
|
|
2543
|
-
/* version */
|
|
2544
|
-
/* readTime */
|
|
2545
|
-
/* createTime */
|
|
2589
|
+
/* version */ he.min(),
|
|
2590
|
+
/* readTime */ he.min(),
|
|
2591
|
+
/* createTime */ he.min(), we.empty(), 0 /* DocumentState.SYNCED */);
|
|
2546
2592
|
},
|
|
2547
2593
|
/**
|
|
2548
2594
|
* Creates a new document that is known to exist with the given data at the
|
|
@@ -2551,14 +2597,14 @@ var ye = /** @class */ function() {
|
|
|
2551
2597
|
t.newFoundDocument = function(e, n, r, i) {
|
|
2552
2598
|
return new t(e, 1 /* DocumentType.FOUND_DOCUMENT */ ,
|
|
2553
2599
|
/* version */ n,
|
|
2554
|
-
/* readTime */
|
|
2600
|
+
/* readTime */ he.min(),
|
|
2555
2601
|
/* createTime */ r, i, 0 /* DocumentState.SYNCED */);
|
|
2556
2602
|
},
|
|
2557
2603
|
/** Creates a new document that is known to not exist at the given version. */ t.newNoDocument = function(e, n) {
|
|
2558
2604
|
return new t(e, 2 /* DocumentType.NO_DOCUMENT */ ,
|
|
2559
2605
|
/* version */ n,
|
|
2560
|
-
/* readTime */
|
|
2561
|
-
/* createTime */
|
|
2606
|
+
/* readTime */ he.min(),
|
|
2607
|
+
/* createTime */ he.min(), we.empty(), 0 /* DocumentState.SYNCED */);
|
|
2562
2608
|
},
|
|
2563
2609
|
/**
|
|
2564
2610
|
* Creates a new document that is known to exist at the given version but
|
|
@@ -2568,8 +2614,8 @@ var ye = /** @class */ function() {
|
|
|
2568
2614
|
t.newUnknownDocument = function(e, n) {
|
|
2569
2615
|
return new t(e, 3 /* DocumentType.UNKNOWN_DOCUMENT */ ,
|
|
2570
2616
|
/* version */ n,
|
|
2571
|
-
/* readTime */
|
|
2572
|
-
/* createTime */
|
|
2617
|
+
/* readTime */ he.min(),
|
|
2618
|
+
/* createTime */ he.min(), we.empty(), 2 /* DocumentState.HAS_COMMITTED_MUTATIONS */);
|
|
2573
2619
|
},
|
|
2574
2620
|
/**
|
|
2575
2621
|
* Changes the document type to indicate that it exists and that its version
|
|
@@ -2581,7 +2627,7 @@ var ye = /** @class */ function() {
|
|
|
2581
2627
|
// update from Watch or due to applying a local set mutation on top
|
|
2582
2628
|
// of a deleted document, our best guess about its createTime would be the
|
|
2583
2629
|
// version at which the document transitioned to a FOUND_DOCUMENT.
|
|
2584
|
-
return !this.createTime.isEqual(
|
|
2630
|
+
return !this.createTime.isEqual(he.min()) || 2 /* DocumentType.NO_DOCUMENT */ !== this.documentType && 0 /* DocumentType.INVALID */ !== this.documentType || (this.createTime = t),
|
|
2585
2631
|
this.version = t, this.documentType = 1 /* DocumentType.FOUND_DOCUMENT */ , this.data = e,
|
|
2586
2632
|
this.documentState = 0 /* DocumentState.SYNCED */ , this;
|
|
2587
2633
|
},
|
|
@@ -2591,7 +2637,7 @@ var ye = /** @class */ function() {
|
|
|
2591
2637
|
*/
|
|
2592
2638
|
t.prototype.convertToNoDocument = function(t) {
|
|
2593
2639
|
return this.version = t, this.documentType = 2 /* DocumentType.NO_DOCUMENT */ ,
|
|
2594
|
-
this.data =
|
|
2640
|
+
this.data = we.empty(), this.documentState = 0 /* DocumentState.SYNCED */ , this;
|
|
2595
2641
|
},
|
|
2596
2642
|
/**
|
|
2597
2643
|
* Changes the document type to indicate that it exists at a given version but
|
|
@@ -2600,12 +2646,12 @@ var ye = /** @class */ function() {
|
|
|
2600
2646
|
*/
|
|
2601
2647
|
t.prototype.convertToUnknownDocument = function(t) {
|
|
2602
2648
|
return this.version = t, this.documentType = 3 /* DocumentType.UNKNOWN_DOCUMENT */ ,
|
|
2603
|
-
this.data =
|
|
2649
|
+
this.data = we.empty(), this.documentState = 2 /* DocumentState.HAS_COMMITTED_MUTATIONS */ ,
|
|
2604
2650
|
this;
|
|
2605
2651
|
}, t.prototype.setHasCommittedMutations = function() {
|
|
2606
2652
|
return this.documentState = 2 /* DocumentState.HAS_COMMITTED_MUTATIONS */ , this;
|
|
2607
2653
|
}, t.prototype.setHasLocalMutations = function() {
|
|
2608
|
-
return this.documentState = 1 /* DocumentState.HAS_LOCAL_MUTATIONS */ , this.version =
|
|
2654
|
+
return this.documentState = 1 /* DocumentState.HAS_LOCAL_MUTATIONS */ , this.version = he.min(),
|
|
2609
2655
|
this;
|
|
2610
2656
|
}, t.prototype.setReadTime = function(t) {
|
|
2611
2657
|
return this.readTime = t, this;
|
|
@@ -2642,7 +2688,7 @@ var ye = /** @class */ function() {
|
|
|
2642
2688
|
}, t.prototype.toString = function() {
|
|
2643
2689
|
return "Document(".concat(this.key, ", ").concat(this.version, ", ").concat(JSON.stringify(this.data.value), ", {createTime: ").concat(this.createTime, "}), {documentType: ").concat(this.documentType, "}), {documentState: ").concat(this.documentState, "})");
|
|
2644
2690
|
}, t;
|
|
2645
|
-
}(),
|
|
2691
|
+
}(), be = function(t, e, n, r, i, o, a) {
|
|
2646
2692
|
void 0 === e && (e = null), void 0 === n && (n = []), void 0 === r && (r = []),
|
|
2647
2693
|
void 0 === i && (i = null), void 0 === o && (o = null), void 0 === a && (a = null),
|
|
2648
2694
|
this.path = t, this.collectionGroup = e, this.orderBy = n, this.filters = r, this.limit = i,
|
|
@@ -2657,10 +2703,10 @@ var ye = /** @class */ function() {
|
|
|
2657
2703
|
* using this factory method, because `Query` provides an implicit `orderBy`
|
|
2658
2704
|
* property.
|
|
2659
2705
|
*/
|
|
2660
|
-
function
|
|
2706
|
+
function Te(t, e, n, r, i, o, a) {
|
|
2661
2707
|
return void 0 === e && (e = null), void 0 === n && (n = []), void 0 === r && (r = []),
|
|
2662
2708
|
void 0 === i && (i = null), void 0 === o && (o = null), void 0 === a && (a = null),
|
|
2663
|
-
new
|
|
2709
|
+
new be(t, e, n, r, i, o, a);
|
|
2664
2710
|
}
|
|
2665
2711
|
|
|
2666
2712
|
/**
|
|
@@ -2685,7 +2731,7 @@ function be(t, e, n, r, i, o, a) {
|
|
|
2685
2731
|
* query the RemoteStore results.
|
|
2686
2732
|
*
|
|
2687
2733
|
* Visible for testing.
|
|
2688
|
-
*/ var
|
|
2734
|
+
*/ var Ee =
|
|
2689
2735
|
/**
|
|
2690
2736
|
* Initializes a Query with a path and optional additional query constraints.
|
|
2691
2737
|
* Path must currently be empty if this is a collection group query.
|
|
@@ -2700,11 +2746,11 @@ function(t, e, n, r, i, o /* LimitType.First */ , a, u) {
|
|
|
2700
2746
|
this.C = null, this.startAt, this.endAt;
|
|
2701
2747
|
};
|
|
2702
2748
|
|
|
2703
|
-
/** Creates a new Query for a query that matches all documents at `path` */ function
|
|
2749
|
+
/** Creates a new Query for a query that matches all documents at `path` */ function Se(t) {
|
|
2704
2750
|
return t.explicitOrderBy.length > 0 ? t.explicitOrderBy[0].field : null;
|
|
2705
2751
|
}
|
|
2706
2752
|
|
|
2707
|
-
function
|
|
2753
|
+
function ke(t) {
|
|
2708
2754
|
for (var e = 0, n = t.filters; e < n.length; e++) {
|
|
2709
2755
|
var r = n[e].getFirstInequalityField();
|
|
2710
2756
|
if (null !== r) return r;
|
|
@@ -2719,7 +2765,7 @@ function Se(t) {
|
|
|
2719
2765
|
/**
|
|
2720
2766
|
* Returns whether the query matches a collection group rather than a specific
|
|
2721
2767
|
* collection.
|
|
2722
|
-
*/ function
|
|
2768
|
+
*/ function Ae(t) {
|
|
2723
2769
|
return null !== t.collectionGroup;
|
|
2724
2770
|
}
|
|
2725
2771
|
|
|
@@ -2727,16 +2773,16 @@ function Se(t) {
|
|
|
2727
2773
|
* Returns the implicit order by constraint that is used to execute the Query,
|
|
2728
2774
|
* which can be different from the order by constraints the user provided (e.g.
|
|
2729
2775
|
* the SDK and backend always orders by `__name__`).
|
|
2730
|
-
*/ function
|
|
2776
|
+
*/ function Ie(t) {
|
|
2731
2777
|
var e = I(t);
|
|
2732
2778
|
if (null === e.k) {
|
|
2733
2779
|
e.k = [];
|
|
2734
|
-
var n =
|
|
2780
|
+
var n = ke(e), r = Se(e);
|
|
2735
2781
|
if (null !== n && null === r)
|
|
2736
2782
|
// In order to implicitly add key ordering, we must also add the
|
|
2737
2783
|
// inequality filter field for it to be a valid query.
|
|
2738
2784
|
// Note that the default inequality field and key ordering is ascending.
|
|
2739
|
-
n.isKeyField() || e.k.push(new
|
|
2785
|
+
n.isKeyField() || e.k.push(new le(n)), e.k.push(new le(rt.keyField(), "asc" /* Direction.ASCENDING */)); else {
|
|
2740
2786
|
for (var i = !1, o = 0, a = e.explicitOrderBy; o < a.length; o++) {
|
|
2741
2787
|
var u = a[o];
|
|
2742
2788
|
e.k.push(u), u.field.isKeyField() && (i = !0);
|
|
@@ -2745,7 +2791,7 @@ function Se(t) {
|
|
|
2745
2791
|
// The order of the implicit key ordering always matches the last
|
|
2746
2792
|
// explicit order by
|
|
2747
2793
|
var s = e.explicitOrderBy.length > 0 ? e.explicitOrderBy[e.explicitOrderBy.length - 1].dir : "asc" /* Direction.ASCENDING */;
|
|
2748
|
-
e.k.push(new
|
|
2794
|
+
e.k.push(new le(rt.keyField(), s));
|
|
2749
2795
|
}
|
|
2750
2796
|
}
|
|
2751
2797
|
}
|
|
@@ -2754,27 +2800,27 @@ function Se(t) {
|
|
|
2754
2800
|
|
|
2755
2801
|
/**
|
|
2756
2802
|
* Converts this `Query` instance to it's corresponding `Target` representation.
|
|
2757
|
-
*/ function
|
|
2803
|
+
*/ function Fe(t) {
|
|
2758
2804
|
var e = I(t);
|
|
2759
|
-
if (!e.C) if ("F" /* LimitType.First */ === e.limitType) e.C =
|
|
2805
|
+
if (!e.C) if ("F" /* LimitType.First */ === e.limitType) e.C = Te(e.path, e.collectionGroup, Ie(e), e.filters, e.limit, e.startAt, e.endAt); else {
|
|
2760
2806
|
for (
|
|
2761
2807
|
// Flip the orderBy directions since we want the last results
|
|
2762
|
-
var n = [], r = 0, i =
|
|
2808
|
+
var n = [], r = 0, i = Ie(e); r < i.length; r++) {
|
|
2763
2809
|
var o = i[r], a = "desc" /* Direction.DESCENDING */ === o.dir ? "asc" /* Direction.ASCENDING */ : "desc" /* Direction.DESCENDING */;
|
|
2764
|
-
n.push(new
|
|
2810
|
+
n.push(new le(o.field, a));
|
|
2765
2811
|
}
|
|
2766
2812
|
// We need to swap the cursors to match the now-flipped query ordering.
|
|
2767
|
-
var u = e.endAt ? new
|
|
2813
|
+
var u = e.endAt ? new Xt(e.endAt.position, e.endAt.inclusive) : null, s = e.startAt ? new Xt(e.startAt.position, e.startAt.inclusive) : null;
|
|
2768
2814
|
// Now return as a LimitType.First query.
|
|
2769
|
-
e.C =
|
|
2815
|
+
e.C = Te(e.path, e.collectionGroup, n, e.filters, e.limit, u, s);
|
|
2770
2816
|
}
|
|
2771
2817
|
return e.C;
|
|
2772
2818
|
}
|
|
2773
2819
|
|
|
2774
|
-
function
|
|
2775
|
-
e.getFirstInequalityField(),
|
|
2820
|
+
function Pe(t, e) {
|
|
2821
|
+
e.getFirstInequalityField(), ke(t);
|
|
2776
2822
|
var n = t.filters.concat([ e ]);
|
|
2777
|
-
return new
|
|
2823
|
+
return new Ee(t.path, t.collectionGroup, t.explicitOrderBy.slice(), n, t.limit, t.limitType, t.startAt, t.endAt);
|
|
2778
2824
|
}
|
|
2779
2825
|
|
|
2780
2826
|
/**
|
|
@@ -2802,9 +2848,9 @@ function Fe(t, e) {
|
|
|
2802
2848
|
* The return value is an IntegerValue if it can safely represent the value,
|
|
2803
2849
|
* otherwise a DoubleValue is returned.
|
|
2804
2850
|
*/
|
|
2805
|
-
function
|
|
2851
|
+
function Ve(t, e) {
|
|
2806
2852
|
return function(t) {
|
|
2807
|
-
return "number" == typeof t && Number.isInteger(t) && !
|
|
2853
|
+
return "number" == typeof t && Number.isInteger(t) && !pt(t) && t <= Number.MAX_SAFE_INTEGER && t >= Number.MIN_SAFE_INTEGER;
|
|
2808
2854
|
}(e) ?
|
|
2809
2855
|
/**
|
|
2810
2856
|
* Returns an IntegerValue for `value`.
|
|
@@ -2826,7 +2872,7 @@ function Pe(t, e) {
|
|
|
2826
2872
|
};
|
|
2827
2873
|
}
|
|
2828
2874
|
return {
|
|
2829
|
-
doubleValue:
|
|
2875
|
+
doubleValue: pt(e) ? "-0" : e
|
|
2830
2876
|
};
|
|
2831
2877
|
}(t, e);
|
|
2832
2878
|
}
|
|
@@ -2847,36 +2893,36 @@ function Pe(t, e) {
|
|
|
2847
2893
|
* See the License for the specific language governing permissions and
|
|
2848
2894
|
* limitations under the License.
|
|
2849
2895
|
*/
|
|
2850
|
-
/** Used to represent a field transform on a mutation. */ var
|
|
2896
|
+
/** Used to represent a field transform on a mutation. */ var De = function() {
|
|
2851
2897
|
// Make sure that the structural type of `TransformOperation` is unique.
|
|
2852
2898
|
// See https://github.com/microsoft/TypeScript/issues/5451
|
|
2853
2899
|
this._ = void 0;
|
|
2854
|
-
},
|
|
2900
|
+
}, Ne = /** @class */ function(e) {
|
|
2855
2901
|
function n() {
|
|
2856
2902
|
return null !== e && e.apply(this, arguments) || this;
|
|
2857
2903
|
}
|
|
2858
2904
|
return t(n, e), n;
|
|
2859
|
-
}(
|
|
2905
|
+
}(De), Oe = /** @class */ function(e) {
|
|
2860
2906
|
function n(t) {
|
|
2861
2907
|
var n = this;
|
|
2862
2908
|
return (n = e.call(this) || this).elements = t, n;
|
|
2863
2909
|
}
|
|
2864
2910
|
return t(n, e), n;
|
|
2865
|
-
}(
|
|
2911
|
+
}(De), qe = /** @class */ function(e) {
|
|
2866
2912
|
function n(t) {
|
|
2867
2913
|
var n = this;
|
|
2868
2914
|
return (n = e.call(this) || this).elements = t, n;
|
|
2869
2915
|
}
|
|
2870
2916
|
return t(n, e), n;
|
|
2871
|
-
}(
|
|
2917
|
+
}(De), Re = /** @class */ function(e) {
|
|
2872
2918
|
function n(t, n) {
|
|
2873
2919
|
var r = this;
|
|
2874
2920
|
return (r = e.call(this) || this).M = t, r.U = n, r;
|
|
2875
2921
|
}
|
|
2876
2922
|
return t(n, e), n;
|
|
2877
|
-
}(
|
|
2923
|
+
}(De), Ce = function(t, e) {
|
|
2878
2924
|
this.field = t, this.transform = e;
|
|
2879
|
-
},
|
|
2925
|
+
}, xe = /** @class */ function() {
|
|
2880
2926
|
function t(t, e) {
|
|
2881
2927
|
this.updateTime = t, this.exists = e
|
|
2882
2928
|
/** Creates a new empty Precondition. */;
|
|
@@ -2898,7 +2944,7 @@ function Pe(t, e) {
|
|
|
2898
2944
|
}), t.prototype.isEqual = function(t) {
|
|
2899
2945
|
return this.exists === t.exists && (this.updateTime ? !!t.updateTime && this.updateTime.isEqual(t.updateTime) : !t.updateTime);
|
|
2900
2946
|
}, t;
|
|
2901
|
-
}(),
|
|
2947
|
+
}(), Me = function() {}, Le = /** @class */ function(e) {
|
|
2902
2948
|
function n(t, n, r, i) {
|
|
2903
2949
|
void 0 === i && (i = []);
|
|
2904
2950
|
var o = this;
|
|
@@ -2908,7 +2954,7 @@ function Pe(t, e) {
|
|
|
2908
2954
|
return t(n, e), n.prototype.getFieldMask = function() {
|
|
2909
2955
|
return null;
|
|
2910
2956
|
}, n;
|
|
2911
|
-
}(
|
|
2957
|
+
}(Me), je = /** @class */ function(e) {
|
|
2912
2958
|
function n(t, n, r, i, o) {
|
|
2913
2959
|
void 0 === o && (o = []);
|
|
2914
2960
|
var a = this;
|
|
@@ -2918,7 +2964,7 @@ function Pe(t, e) {
|
|
|
2918
2964
|
return t(n, e), n.prototype.getFieldMask = function() {
|
|
2919
2965
|
return this.fieldMask;
|
|
2920
2966
|
}, n;
|
|
2921
|
-
}(
|
|
2967
|
+
}(Me), Ue = /** @class */ function(e) {
|
|
2922
2968
|
function n(t, n) {
|
|
2923
2969
|
var r = this;
|
|
2924
2970
|
return (r = e.call(this) || this).key = t, r.precondition = n, r.type = 2 /* MutationType.Delete */ ,
|
|
@@ -2927,7 +2973,7 @@ function Pe(t, e) {
|
|
|
2927
2973
|
return t(n, e), n.prototype.getFieldMask = function() {
|
|
2928
2974
|
return null;
|
|
2929
2975
|
}, n;
|
|
2930
|
-
}(
|
|
2976
|
+
}(Me), Be = /** @class */ function(e) {
|
|
2931
2977
|
function n(t, n) {
|
|
2932
2978
|
var r = this;
|
|
2933
2979
|
return (r = e.call(this) || this).key = t, r.precondition = n, r.type = 3 /* MutationType.Verify */ ,
|
|
@@ -2936,10 +2982,10 @@ function Pe(t, e) {
|
|
|
2936
2982
|
return t(n, e), n.prototype.getFieldMask = function() {
|
|
2937
2983
|
return null;
|
|
2938
2984
|
}, n;
|
|
2939
|
-
}(
|
|
2985
|
+
}(Me), ze = {
|
|
2940
2986
|
asc: "ASCENDING",
|
|
2941
2987
|
desc: "DESCENDING"
|
|
2942
|
-
},
|
|
2988
|
+
}, Ke = {
|
|
2943
2989
|
"<": "LESS_THAN",
|
|
2944
2990
|
"<=": "LESS_THAN_OR_EQUAL",
|
|
2945
2991
|
">": "GREATER_THAN",
|
|
@@ -2950,10 +2996,10 @@ function Pe(t, e) {
|
|
|
2950
2996
|
in: "IN",
|
|
2951
2997
|
"not-in": "NOT_IN",
|
|
2952
2998
|
"array-contains-any": "ARRAY_CONTAINS_ANY"
|
|
2953
|
-
},
|
|
2999
|
+
}, Qe = {
|
|
2954
3000
|
and: "AND",
|
|
2955
3001
|
or: "OR"
|
|
2956
|
-
},
|
|
3002
|
+
}, Ge = function(t, e) {
|
|
2957
3003
|
this.databaseId = t, this.L = e;
|
|
2958
3004
|
};
|
|
2959
3005
|
|
|
@@ -2969,7 +3015,7 @@ function Pe(t, e) {
|
|
|
2969
3015
|
/**
|
|
2970
3016
|
* Returns a value for a Date that's appropriate to put into a proto.
|
|
2971
3017
|
*/
|
|
2972
|
-
function
|
|
3018
|
+
function Ye(t, e) {
|
|
2973
3019
|
return t.L ? "".concat(new Date(1e3 * e.seconds).toISOString().replace(/\.\d*/, "").replace("Z", ""), ".").concat(("000000000" + e.nanoseconds).slice(-9), "Z") : {
|
|
2974
3020
|
seconds: "" + e.seconds,
|
|
2975
3021
|
nanos: e.nanoseconds
|
|
@@ -2980,69 +3026,69 @@ function Ge(t, e) {
|
|
|
2980
3026
|
* Returns a value for bytes that's appropriate to put in a proto.
|
|
2981
3027
|
*
|
|
2982
3028
|
* Visible for testing.
|
|
2983
|
-
*/ function
|
|
3029
|
+
*/ function We(t, e) {
|
|
2984
3030
|
return t.L ? e.toBase64() : e.toUint8Array();
|
|
2985
3031
|
}
|
|
2986
3032
|
|
|
2987
|
-
function
|
|
2988
|
-
return
|
|
3033
|
+
function He(t, e) {
|
|
3034
|
+
return Ye(t, e.toTimestamp());
|
|
2989
3035
|
}
|
|
2990
3036
|
|
|
2991
|
-
function
|
|
2992
|
-
return A(!!t),
|
|
2993
|
-
var e =
|
|
2994
|
-
return new
|
|
3037
|
+
function Xe(t) {
|
|
3038
|
+
return A(!!t), he.fromTimestamp(function(t) {
|
|
3039
|
+
var e = Dt(t);
|
|
3040
|
+
return new qt(e.seconds, e.nanos);
|
|
2995
3041
|
}(t));
|
|
2996
3042
|
}
|
|
2997
3043
|
|
|
2998
|
-
function
|
|
3044
|
+
function Je(t, e) {
|
|
2999
3045
|
return function(t) {
|
|
3000
3046
|
return new et([ "projects", t.projectId, "databases", t.database ]);
|
|
3001
3047
|
}(t).child("documents").child(e).canonicalString();
|
|
3002
3048
|
}
|
|
3003
3049
|
|
|
3004
|
-
function
|
|
3005
|
-
return
|
|
3050
|
+
function Ze(t, e) {
|
|
3051
|
+
return Je(t.databaseId, e.path);
|
|
3006
3052
|
}
|
|
3007
3053
|
|
|
3008
|
-
function
|
|
3054
|
+
function $e(t, e) {
|
|
3009
3055
|
var n, r = function(t) {
|
|
3010
3056
|
var e = et.fromString(t);
|
|
3011
|
-
return A(
|
|
3057
|
+
return A(fn(e)), e;
|
|
3012
3058
|
}(e);
|
|
3013
3059
|
if (r.get(1) !== t.databaseId.projectId) throw new B(V, "Tried to deserialize key from different project: " + r.get(1) + " vs " + t.databaseId.projectId);
|
|
3014
3060
|
if (r.get(3) !== t.databaseId.database) throw new B(V, "Tried to deserialize key from different database: " + r.get(3) + " vs " + t.databaseId.database);
|
|
3015
3061
|
return new it((A((n = r).length > 4 && "documents" === n.get(4)), n.popFirst(5)));
|
|
3016
3062
|
}
|
|
3017
3063
|
|
|
3018
|
-
function
|
|
3019
|
-
return
|
|
3064
|
+
function tn(t, e) {
|
|
3065
|
+
return Je(t.databaseId, e);
|
|
3020
3066
|
}
|
|
3021
3067
|
|
|
3022
|
-
function
|
|
3068
|
+
function en(t) {
|
|
3023
3069
|
return new et([ "projects", t.databaseId.projectId, "databases", t.databaseId.database ]).canonicalString();
|
|
3024
3070
|
}
|
|
3025
3071
|
|
|
3026
|
-
function
|
|
3072
|
+
function nn(t, e, n) {
|
|
3027
3073
|
return {
|
|
3028
|
-
name:
|
|
3074
|
+
name: Ze(t, e),
|
|
3029
3075
|
fields: n.value.mapValue.fields
|
|
3030
3076
|
};
|
|
3031
3077
|
}
|
|
3032
3078
|
|
|
3033
|
-
function
|
|
3079
|
+
function rn(t, e) {
|
|
3034
3080
|
// Dissect the path into parent, collectionId, and optional key filter.
|
|
3035
3081
|
var n = {
|
|
3036
3082
|
structuredQuery: {}
|
|
3037
3083
|
}, r = e.path;
|
|
3038
|
-
null !== e.collectionGroup ? (n.parent =
|
|
3084
|
+
null !== e.collectionGroup ? (n.parent = tn(t, r), n.structuredQuery.from = [ {
|
|
3039
3085
|
collectionId: e.collectionGroup,
|
|
3040
3086
|
allDescendants: !0
|
|
3041
|
-
} ]) : (n.parent =
|
|
3087
|
+
} ]) : (n.parent = tn(t, r.popLast()), n.structuredQuery.from = [ {
|
|
3042
3088
|
collectionId: r.lastSegment()
|
|
3043
3089
|
} ]);
|
|
3044
3090
|
var i = function(t) {
|
|
3045
|
-
if (0 !== t.length) return
|
|
3091
|
+
if (0 !== t.length) return cn(te.create(t, "and" /* CompositeOperator.AND */));
|
|
3046
3092
|
}(e.filters);
|
|
3047
3093
|
i && (n.structuredQuery.where = i);
|
|
3048
3094
|
var o = function(t) {
|
|
@@ -3050,15 +3096,15 @@ function nn(t, e) {
|
|
|
3050
3096
|
// visible for testing
|
|
3051
3097
|
return function(t) {
|
|
3052
3098
|
return {
|
|
3053
|
-
field:
|
|
3054
|
-
direction:
|
|
3099
|
+
field: sn(t.field),
|
|
3100
|
+
direction: on(t.dir)
|
|
3055
3101
|
};
|
|
3056
3102
|
}(t);
|
|
3057
3103
|
}));
|
|
3058
3104
|
}(e.orderBy);
|
|
3059
3105
|
o && (n.structuredQuery.orderBy = o);
|
|
3060
3106
|
var a, u = function(t, e) {
|
|
3061
|
-
return t.L ||
|
|
3107
|
+
return t.L || ht(e) ? e : {
|
|
3062
3108
|
value: e
|
|
3063
3109
|
};
|
|
3064
3110
|
}(t, e.limit);
|
|
@@ -3073,75 +3119,75 @@ function nn(t, e) {
|
|
|
3073
3119
|
}(e.endAt)), n;
|
|
3074
3120
|
}
|
|
3075
3121
|
|
|
3076
|
-
function rn(t) {
|
|
3077
|
-
return Be[t];
|
|
3078
|
-
}
|
|
3079
|
-
|
|
3080
|
-
// visible for testing
|
|
3081
3122
|
function on(t) {
|
|
3082
3123
|
return ze[t];
|
|
3083
3124
|
}
|
|
3084
3125
|
|
|
3126
|
+
// visible for testing
|
|
3085
3127
|
function an(t) {
|
|
3086
3128
|
return Ke[t];
|
|
3087
3129
|
}
|
|
3088
3130
|
|
|
3089
3131
|
function un(t) {
|
|
3132
|
+
return Qe[t];
|
|
3133
|
+
}
|
|
3134
|
+
|
|
3135
|
+
function sn(t) {
|
|
3090
3136
|
return {
|
|
3091
3137
|
fieldPath: t.canonicalString()
|
|
3092
3138
|
};
|
|
3093
3139
|
}
|
|
3094
3140
|
|
|
3095
|
-
function
|
|
3096
|
-
return t instanceof
|
|
3141
|
+
function cn(t) {
|
|
3142
|
+
return t instanceof $t ? function(t) {
|
|
3097
3143
|
if ("==" /* Operator.EQUAL */ === t.op) {
|
|
3098
|
-
if (
|
|
3144
|
+
if (Yt(t.value)) return {
|
|
3099
3145
|
unaryFilter: {
|
|
3100
|
-
field:
|
|
3146
|
+
field: sn(t.field),
|
|
3101
3147
|
op: "IS_NAN"
|
|
3102
3148
|
}
|
|
3103
3149
|
};
|
|
3104
|
-
if (
|
|
3150
|
+
if (Gt(t.value)) return {
|
|
3105
3151
|
unaryFilter: {
|
|
3106
|
-
field:
|
|
3152
|
+
field: sn(t.field),
|
|
3107
3153
|
op: "IS_NULL"
|
|
3108
3154
|
}
|
|
3109
3155
|
};
|
|
3110
3156
|
} else if ("!=" /* Operator.NOT_EQUAL */ === t.op) {
|
|
3111
|
-
if (
|
|
3157
|
+
if (Yt(t.value)) return {
|
|
3112
3158
|
unaryFilter: {
|
|
3113
|
-
field:
|
|
3159
|
+
field: sn(t.field),
|
|
3114
3160
|
op: "IS_NOT_NAN"
|
|
3115
3161
|
}
|
|
3116
3162
|
};
|
|
3117
|
-
if (
|
|
3163
|
+
if (Gt(t.value)) return {
|
|
3118
3164
|
unaryFilter: {
|
|
3119
|
-
field:
|
|
3165
|
+
field: sn(t.field),
|
|
3120
3166
|
op: "IS_NOT_NULL"
|
|
3121
3167
|
}
|
|
3122
3168
|
};
|
|
3123
3169
|
}
|
|
3124
3170
|
return {
|
|
3125
3171
|
fieldFilter: {
|
|
3126
|
-
field:
|
|
3127
|
-
op:
|
|
3172
|
+
field: sn(t.field),
|
|
3173
|
+
op: an(t.op),
|
|
3128
3174
|
value: t.value
|
|
3129
3175
|
}
|
|
3130
3176
|
};
|
|
3131
|
-
}(t) : t instanceof
|
|
3177
|
+
}(t) : t instanceof te ? function(t) {
|
|
3132
3178
|
var e = t.getFilters().map((function(t) {
|
|
3133
|
-
return
|
|
3179
|
+
return cn(t);
|
|
3134
3180
|
}));
|
|
3135
3181
|
return 1 === e.length ? e[0] : {
|
|
3136
3182
|
compositeFilter: {
|
|
3137
|
-
op:
|
|
3183
|
+
op: un(t.op),
|
|
3138
3184
|
filters: e
|
|
3139
3185
|
}
|
|
3140
3186
|
};
|
|
3141
3187
|
}(t) : k();
|
|
3142
3188
|
}
|
|
3143
3189
|
|
|
3144
|
-
function
|
|
3190
|
+
function ln(t) {
|
|
3145
3191
|
var e = [];
|
|
3146
3192
|
return t.fields.forEach((function(t) {
|
|
3147
3193
|
return e.push(t.canonicalString());
|
|
@@ -3150,7 +3196,7 @@ function cn(t) {
|
|
|
3150
3196
|
};
|
|
3151
3197
|
}
|
|
3152
3198
|
|
|
3153
|
-
function
|
|
3199
|
+
function fn(t) {
|
|
3154
3200
|
// Resource names have at least 4 components (project ID, database ID)
|
|
3155
3201
|
return t.length >= 4 && "projects" === t.get(0) && "databases" === t.get(2);
|
|
3156
3202
|
}
|
|
@@ -3170,8 +3216,8 @@ function ln(t) {
|
|
|
3170
3216
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
3171
3217
|
* See the License for the specific language governing permissions and
|
|
3172
3218
|
* limitations under the License.
|
|
3173
|
-
*/ function
|
|
3174
|
-
return new
|
|
3219
|
+
*/ function hn(t) {
|
|
3220
|
+
return new Ge(t, /* useProto3Json= */ !0);
|
|
3175
3221
|
}
|
|
3176
3222
|
|
|
3177
3223
|
/**
|
|
@@ -3198,7 +3244,7 @@ function ln(t) {
|
|
|
3198
3244
|
* backoff curve, and a +/- 50% "jitter" that is calculated and added to the
|
|
3199
3245
|
* base delay. This prevents clients from accidentally synchronizing their
|
|
3200
3246
|
* delays causing spikes of load to the backend.
|
|
3201
|
-
*/ var
|
|
3247
|
+
*/ var pn = /** @class */ function() {
|
|
3202
3248
|
function t(
|
|
3203
3249
|
/**
|
|
3204
3250
|
* The AsyncQueue to run backoff operations on.
|
|
@@ -3272,7 +3318,7 @@ function ln(t) {
|
|
|
3272
3318
|
/** Returns a random value in the range [-currentBaseMs/2, currentBaseMs/2] */ t.prototype.X = function() {
|
|
3273
3319
|
return (Math.random() - .5) * this.K;
|
|
3274
3320
|
}, t;
|
|
3275
|
-
}(),
|
|
3321
|
+
}(), dn = /** @class */ function(e) {
|
|
3276
3322
|
function n(t, n, r, i) {
|
|
3277
3323
|
var o = this;
|
|
3278
3324
|
return (o = e.call(this) || this).authCredentials = t, o.appCheckCredentials = n,
|
|
@@ -3332,49 +3378,49 @@ function ln(t) {
|
|
|
3332
3378
|
*/
|
|
3333
3379
|
// TODO(firestorexp): Make sure there is only one Datastore instance per
|
|
3334
3380
|
// firestore-exp client.
|
|
3335
|
-
function
|
|
3381
|
+
function yn(t, r) {
|
|
3336
3382
|
return e(this, void 0, void 0, (function() {
|
|
3337
3383
|
var e, i, o;
|
|
3338
3384
|
return n(this, (function(n) {
|
|
3339
3385
|
switch (n.label) {
|
|
3340
3386
|
case 0:
|
|
3341
|
-
return e = I(t), i =
|
|
3387
|
+
return e = I(t), i = en(e.M) + "/documents", o = {
|
|
3342
3388
|
writes: r.map((function(t) {
|
|
3343
3389
|
return function(t, e) {
|
|
3344
3390
|
var n;
|
|
3345
|
-
if (e instanceof
|
|
3346
|
-
update:
|
|
3391
|
+
if (e instanceof Le) n = {
|
|
3392
|
+
update: nn(t, e.key, e.value)
|
|
3393
|
+
}; else if (e instanceof Ue) n = {
|
|
3394
|
+
delete: Ze(t, e.key)
|
|
3347
3395
|
}; else if (e instanceof je) n = {
|
|
3348
|
-
|
|
3349
|
-
|
|
3350
|
-
update: en(t, e.key, e.data),
|
|
3351
|
-
updateMask: cn(e.fieldMask)
|
|
3396
|
+
update: nn(t, e.key, e.data),
|
|
3397
|
+
updateMask: ln(e.fieldMask)
|
|
3352
3398
|
}; else {
|
|
3353
|
-
if (!(e instanceof
|
|
3399
|
+
if (!(e instanceof Be)) return k();
|
|
3354
3400
|
n = {
|
|
3355
|
-
verify:
|
|
3401
|
+
verify: Ze(t, e.key)
|
|
3356
3402
|
};
|
|
3357
3403
|
}
|
|
3358
3404
|
return e.fieldTransforms.length > 0 && (n.updateTransforms = e.fieldTransforms.map((function(t) {
|
|
3359
3405
|
return function(t, e) {
|
|
3360
3406
|
var n = e.transform;
|
|
3361
|
-
if (n instanceof
|
|
3407
|
+
if (n instanceof Ne) return {
|
|
3362
3408
|
fieldPath: e.field.canonicalString(),
|
|
3363
3409
|
setToServerValue: "REQUEST_TIME"
|
|
3364
3410
|
};
|
|
3365
|
-
if (n instanceof
|
|
3411
|
+
if (n instanceof Oe) return {
|
|
3366
3412
|
fieldPath: e.field.canonicalString(),
|
|
3367
3413
|
appendMissingElements: {
|
|
3368
3414
|
values: n.elements
|
|
3369
3415
|
}
|
|
3370
3416
|
};
|
|
3371
|
-
if (n instanceof
|
|
3417
|
+
if (n instanceof qe) return {
|
|
3372
3418
|
fieldPath: e.field.canonicalString(),
|
|
3373
3419
|
removeAllFromArray: {
|
|
3374
3420
|
values: n.elements
|
|
3375
3421
|
}
|
|
3376
3422
|
};
|
|
3377
|
-
if (n instanceof
|
|
3423
|
+
if (n instanceof Re) return {
|
|
3378
3424
|
fieldPath: e.field.canonicalString(),
|
|
3379
3425
|
increment: n.U
|
|
3380
3426
|
};
|
|
@@ -3382,7 +3428,7 @@ function dn(t, r) {
|
|
|
3382
3428
|
}(0, t);
|
|
3383
3429
|
}))), e.precondition.isNone || (n.currentDocument = function(t, e) {
|
|
3384
3430
|
return void 0 !== e.updateTime ? {
|
|
3385
|
-
updateTime:
|
|
3431
|
+
updateTime: He(t, e.updateTime)
|
|
3386
3432
|
} : void 0 !== e.exists ? {
|
|
3387
3433
|
exists: e.exists
|
|
3388
3434
|
} : k();
|
|
@@ -3398,15 +3444,15 @@ function dn(t, r) {
|
|
|
3398
3444
|
}));
|
|
3399
3445
|
}
|
|
3400
3446
|
|
|
3401
|
-
function
|
|
3447
|
+
function mn(t, r) {
|
|
3402
3448
|
return e(this, void 0, void 0, (function() {
|
|
3403
3449
|
var e, i, o, a, u, s;
|
|
3404
3450
|
return n(this, (function(n) {
|
|
3405
3451
|
switch (n.label) {
|
|
3406
3452
|
case 0:
|
|
3407
|
-
return e = I(t), i =
|
|
3453
|
+
return e = I(t), i = en(e.M) + "/documents", o = {
|
|
3408
3454
|
documents: r.map((function(t) {
|
|
3409
|
-
return
|
|
3455
|
+
return Ze(e.M, t);
|
|
3410
3456
|
}))
|
|
3411
3457
|
}, [ 4 /*yield*/ , e.P("BatchGetDocuments", i, o, r.length) ];
|
|
3412
3458
|
|
|
@@ -3415,16 +3461,16 @@ function yn(t, r) {
|
|
|
3415
3461
|
var n = function(t, e) {
|
|
3416
3462
|
return "found" in e ? function(t, e) {
|
|
3417
3463
|
A(!!e.found), e.found.name, e.found.updateTime;
|
|
3418
|
-
var n =
|
|
3464
|
+
var n = $e(t, e.found.name), r = Xe(e.found.updateTime), i = e.found.createTime ? Xe(e.found.createTime) : he.min(), o = new we({
|
|
3419
3465
|
mapValue: {
|
|
3420
3466
|
fields: e.found.fields
|
|
3421
3467
|
}
|
|
3422
3468
|
});
|
|
3423
|
-
return
|
|
3469
|
+
return _e.newFoundDocument(n, r, i, o);
|
|
3424
3470
|
}(t, e) : "missing" in e ? function(t, e) {
|
|
3425
3471
|
A(!!e.missing), A(!!e.readTime);
|
|
3426
|
-
var n =
|
|
3427
|
-
return
|
|
3472
|
+
var n = $e(t, e.missing), r = Xe(e.readTime);
|
|
3473
|
+
return _e.newNoDocument(n, r);
|
|
3428
3474
|
}(t, e) : k();
|
|
3429
3475
|
}(e.M, t);
|
|
3430
3476
|
u.set(n.key.toString(), n);
|
|
@@ -3453,7 +3499,7 @@ function yn(t, r) {
|
|
|
3453
3499
|
* See the License for the specific language governing permissions and
|
|
3454
3500
|
* limitations under the License.
|
|
3455
3501
|
*/
|
|
3456
|
-
var
|
|
3502
|
+
var vn = new Map;
|
|
3457
3503
|
|
|
3458
3504
|
/**
|
|
3459
3505
|
* An instance map that ensures only one Datastore exists per Firestore
|
|
@@ -3463,17 +3509,17 @@ var mn = new Map;
|
|
|
3463
3509
|
* Returns an initialized and started Datastore for the given Firestore
|
|
3464
3510
|
* instance. Callers must invoke removeComponents() when the Firestore
|
|
3465
3511
|
* instance is terminated.
|
|
3466
|
-
*/ function
|
|
3512
|
+
*/ function gn(t) {
|
|
3467
3513
|
if (t._terminated) throw new B(C, "The client has already been terminated.");
|
|
3468
|
-
if (!
|
|
3514
|
+
if (!vn.has(t)) {
|
|
3469
3515
|
b("ComponentProvider", "Initializing Datastore");
|
|
3470
3516
|
var e = function(t) {
|
|
3471
|
-
return new
|
|
3517
|
+
return new gt(t, fetch.bind(null));
|
|
3472
3518
|
}((i = t._databaseId, o = t.app.options.appId || "", a = t._persistenceKey, u = t._freezeSettings(),
|
|
3473
|
-
new Z(i, o, a, u.host, u.ssl, u.experimentalForceLongPolling, u.experimentalAutoDetectLongPolling, u.useFetchStreams))), n =
|
|
3474
|
-
return new
|
|
3519
|
+
new Z(i, o, a, u.host, u.ssl, u.experimentalForceLongPolling, u.experimentalAutoDetectLongPolling, u.useFetchStreams))), n = hn(t._databaseId), r = function(t, e, n, r) {
|
|
3520
|
+
return new dn(t, e, n, r);
|
|
3475
3521
|
}(t._authCredentials, t._appCheckCredentials, e, n);
|
|
3476
|
-
|
|
3522
|
+
vn.set(t, r);
|
|
3477
3523
|
}
|
|
3478
3524
|
var i, o, a, u;
|
|
3479
3525
|
/**
|
|
@@ -3491,7 +3537,7 @@ var mn = new Map;
|
|
|
3491
3537
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
3492
3538
|
* See the License for the specific language governing permissions and
|
|
3493
3539
|
* limitations under the License.
|
|
3494
|
-
*/ return
|
|
3540
|
+
*/ return vn.get(t);
|
|
3495
3541
|
}
|
|
3496
3542
|
|
|
3497
3543
|
/**
|
|
@@ -3502,7 +3548,7 @@ var mn = new Map;
|
|
|
3502
3548
|
* A concrete type describing all the values that can be applied via a
|
|
3503
3549
|
* user-supplied `FirestoreSettings` object. This is a separate type so that
|
|
3504
3550
|
* defaults can be supplied and the value can be checked for equality.
|
|
3505
|
-
*/ var
|
|
3551
|
+
*/ var wn = /** @class */ function() {
|
|
3506
3552
|
function t(t) {
|
|
3507
3553
|
var e;
|
|
3508
3554
|
if (void 0 === t.host) {
|
|
@@ -3522,7 +3568,7 @@ var mn = new Map;
|
|
|
3522
3568
|
return t.prototype.isEqual = function(t) {
|
|
3523
3569
|
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;
|
|
3524
3570
|
}, t;
|
|
3525
|
-
}(),
|
|
3571
|
+
}(), _n = /** @class */ function() {
|
|
3526
3572
|
/** @hideconstructor */
|
|
3527
3573
|
function t(t, e, n, r) {
|
|
3528
3574
|
this._authCredentials = t, this._appCheckCredentials = e, this._databaseId = n,
|
|
@@ -3530,7 +3576,7 @@ var mn = new Map;
|
|
|
3530
3576
|
/**
|
|
3531
3577
|
* Whether it's a Firestore or Firestore Lite instance.
|
|
3532
3578
|
*/
|
|
3533
|
-
this.type = "firestore-lite", this._persistenceKey = "(lite)", this._settings = new
|
|
3579
|
+
this.type = "firestore-lite", this._persistenceKey = "(lite)", this._settings = new wn({}),
|
|
3534
3580
|
this._settingsFrozen = !1;
|
|
3535
3581
|
}
|
|
3536
3582
|
return Object.defineProperty(t.prototype, "app", {
|
|
@@ -3558,7 +3604,7 @@ var mn = new Map;
|
|
|
3558
3604
|
configurable: !0
|
|
3559
3605
|
}), t.prototype._setSettings = function(t) {
|
|
3560
3606
|
if (this._settingsFrozen) throw new B(C, "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.");
|
|
3561
|
-
this._settings = new
|
|
3607
|
+
this._settings = new wn(t), void 0 !== t.credentials && (this._authCredentials = function(t) {
|
|
3562
3608
|
if (!t) return new Q;
|
|
3563
3609
|
switch (t.type) {
|
|
3564
3610
|
case "gapi":
|
|
@@ -3594,8 +3640,8 @@ var mn = new Map;
|
|
|
3594
3640
|
* Only ever called once.
|
|
3595
3641
|
*/
|
|
3596
3642
|
t.prototype._terminate = function() {
|
|
3597
|
-
return t = this, (e =
|
|
3598
|
-
|
|
3643
|
+
return t = this, (e = vn.get(t)) && (b("ComponentProvider", "Removing Datastore"),
|
|
3644
|
+
vn.delete(t), e.terminate()), Promise.resolve();
|
|
3599
3645
|
var t, e;
|
|
3600
3646
|
}, t;
|
|
3601
3647
|
}();
|
|
@@ -3620,7 +3666,7 @@ var mn = new Map;
|
|
|
3620
3666
|
* The Cloud Firestore service interface.
|
|
3621
3667
|
*
|
|
3622
3668
|
* Do not call this constructor directly. Instead, use {@link (getFirestore:1)}.
|
|
3623
|
-
*/ function
|
|
3669
|
+
*/ function bn(t, e, n) {
|
|
3624
3670
|
n || (n = "(default)");
|
|
3625
3671
|
var r = _getProvider(t, "firestore/lite");
|
|
3626
3672
|
if (r.isInitialized(n)) throw new B(C, "Firestore can only be initialized once per app.");
|
|
@@ -3630,13 +3676,13 @@ var mn = new Map;
|
|
|
3630
3676
|
});
|
|
3631
3677
|
}
|
|
3632
3678
|
|
|
3633
|
-
function
|
|
3679
|
+
function Tn(t, e) {
|
|
3634
3680
|
var n = "object" == typeof t ? t : u(), i = "string" == typeof t ? t : e || "(default)", o = _getProvider(n, "firestore/lite").getImmediate({
|
|
3635
3681
|
identifier: i
|
|
3636
3682
|
});
|
|
3637
3683
|
if (!o._initialized) {
|
|
3638
3684
|
var a = d("firestore");
|
|
3639
|
-
a &&
|
|
3685
|
+
a && En.apply(void 0, r([ o ], a, !1));
|
|
3640
3686
|
}
|
|
3641
3687
|
return o;
|
|
3642
3688
|
}
|
|
@@ -3653,10 +3699,10 @@ function bn(t, e) {
|
|
|
3653
3699
|
* @param port - the emulator port (ex: 9000).
|
|
3654
3700
|
* @param options.mockUserToken - the mock auth token to use for unit testing
|
|
3655
3701
|
* Security Rules.
|
|
3656
|
-
*/ function
|
|
3702
|
+
*/ function En(t, e, n, r) {
|
|
3657
3703
|
var i;
|
|
3658
3704
|
void 0 === r && (r = {});
|
|
3659
|
-
var o = (t = ct(t,
|
|
3705
|
+
var o = (t = ct(t, _n))._getSettings();
|
|
3660
3706
|
if ("firestore.googleapis.com" !== o.host && o.host !== e && E("Host has been set in both settings() and useEmulator(), emulator host will be used"),
|
|
3661
3707
|
t._setSettings(Object.assign(Object.assign({}, o), {
|
|
3662
3708
|
host: "".concat(e, ":").concat(n),
|
|
@@ -3694,8 +3740,8 @@ function bn(t, e) {
|
|
|
3694
3740
|
* @param firestore - The `Firestore` instance to terminate.
|
|
3695
3741
|
* @returns A `Promise` that is resolved when the instance has been successfully
|
|
3696
3742
|
* terminated.
|
|
3697
|
-
*/ function
|
|
3698
|
-
return t = ct(t,
|
|
3743
|
+
*/ function Sn(t) {
|
|
3744
|
+
return t = ct(t, _n), s(t.app, "firestore/lite"), t._delete();
|
|
3699
3745
|
}
|
|
3700
3746
|
|
|
3701
3747
|
/**
|
|
@@ -3734,7 +3780,7 @@ function bn(t, e) {
|
|
|
3734
3780
|
* Represents an aggregation that can be performed by Firestore.
|
|
3735
3781
|
*/
|
|
3736
3782
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
3737
|
-
var
|
|
3783
|
+
var kn =
|
|
3738
3784
|
/**
|
|
3739
3785
|
* Create a new AggregateField<T>
|
|
3740
3786
|
* @param _aggregateType Specifies the type of aggregation operation to perform.
|
|
@@ -3747,7 +3793,7 @@ t, e) {
|
|
|
3747
3793
|
void 0 === t && (t = "count"), this._aggregateType = t, this._internalFieldPath = e,
|
|
3748
3794
|
/** A type string to uniquely identify instances of this class. */
|
|
3749
3795
|
this.type = "AggregateField";
|
|
3750
|
-
},
|
|
3796
|
+
}, An = /** @class */ function() {
|
|
3751
3797
|
/** @hideconstructor */
|
|
3752
3798
|
function t(t, e, n) {
|
|
3753
3799
|
this._userDataWriter = e, this._data = n,
|
|
@@ -3768,7 +3814,7 @@ t, e) {
|
|
|
3768
3814
|
return t.prototype.data = function() {
|
|
3769
3815
|
return this._userDataWriter.convertValue(this._data.value);
|
|
3770
3816
|
}, t;
|
|
3771
|
-
}(),
|
|
3817
|
+
}(), In = /** @class */ function() {
|
|
3772
3818
|
/** @hideconstructor */
|
|
3773
3819
|
function t(t,
|
|
3774
3820
|
/**
|
|
@@ -3809,14 +3855,14 @@ t, e) {
|
|
|
3809
3855
|
* The collection this `DocumentReference` belongs to.
|
|
3810
3856
|
*/
|
|
3811
3857
|
get: function() {
|
|
3812
|
-
return new
|
|
3858
|
+
return new Pn(this.firestore, this.converter, this._key.path.popLast());
|
|
3813
3859
|
},
|
|
3814
3860
|
enumerable: !1,
|
|
3815
3861
|
configurable: !0
|
|
3816
3862
|
}), t.prototype.withConverter = function(e) {
|
|
3817
3863
|
return new t(this.firestore, e, this._key);
|
|
3818
3864
|
}, t;
|
|
3819
|
-
}(),
|
|
3865
|
+
}(), Fn = /** @class */ function() {
|
|
3820
3866
|
// This is the lite version of the Query class in the main SDK.
|
|
3821
3867
|
/** @hideconstructor protected */
|
|
3822
3868
|
function t(t,
|
|
@@ -3831,11 +3877,11 @@ t, e) {
|
|
|
3831
3877
|
return t.prototype.withConverter = function(e) {
|
|
3832
3878
|
return new t(this.firestore, e, this._query);
|
|
3833
3879
|
}, t;
|
|
3834
|
-
}(),
|
|
3880
|
+
}(), Pn = /** @class */ function(e) {
|
|
3835
3881
|
/** @hideconstructor */
|
|
3836
3882
|
function n(t, n, r) {
|
|
3837
3883
|
var i = this;
|
|
3838
|
-
return (i = e.call(this, t, n, new
|
|
3884
|
+
return (i = e.call(this, t, n, new Ee(r)) || this)._path = r,
|
|
3839
3885
|
/** The type of this Firestore reference. */
|
|
3840
3886
|
i.type = "collection", i;
|
|
3841
3887
|
}
|
|
@@ -3862,7 +3908,7 @@ t, e) {
|
|
|
3862
3908
|
*/
|
|
3863
3909
|
get: function() {
|
|
3864
3910
|
var t = this._path.popLast();
|
|
3865
|
-
return t.isEmpty() ? null : new
|
|
3911
|
+
return t.isEmpty() ? null : new In(this.firestore,
|
|
3866
3912
|
/* converter= */ null, new it(t));
|
|
3867
3913
|
},
|
|
3868
3914
|
enumerable: !1,
|
|
@@ -3870,19 +3916,19 @@ t, e) {
|
|
|
3870
3916
|
}), n.prototype.withConverter = function(t) {
|
|
3871
3917
|
return new n(this.firestore, t, this._path);
|
|
3872
3918
|
}, n;
|
|
3873
|
-
}(
|
|
3919
|
+
}(Fn);
|
|
3874
3920
|
|
|
3875
3921
|
/**
|
|
3876
3922
|
* The results of executing an aggregation query.
|
|
3877
|
-
*/ function
|
|
3923
|
+
*/ function Vn(t, e) {
|
|
3878
3924
|
for (var n = [], i = 2; i < arguments.length; i++) n[i - 2] = arguments[i];
|
|
3879
|
-
if (t = p(t), ot("collection", "path", e), t instanceof
|
|
3925
|
+
if (t = p(t), ot("collection", "path", e), t instanceof _n) {
|
|
3880
3926
|
var o = et.fromString.apply(et, r([ e ], n, !1));
|
|
3881
|
-
return ut(o), new
|
|
3927
|
+
return ut(o), new Pn(t, /* converter= */ null, o);
|
|
3882
3928
|
}
|
|
3883
|
-
if (!(t instanceof
|
|
3929
|
+
if (!(t instanceof In || t instanceof Pn)) throw new B(V, "Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");
|
|
3884
3930
|
var a = t._path.child(et.fromString.apply(et, r([ e ], n, !1)));
|
|
3885
|
-
return ut(a), new
|
|
3931
|
+
return ut(a), new Pn(t.firestore,
|
|
3886
3932
|
/* converter= */ null, a);
|
|
3887
3933
|
}
|
|
3888
3934
|
|
|
@@ -3898,27 +3944,27 @@ t, e) {
|
|
|
3898
3944
|
* collection or subcollection with this ID as the last segment of its path
|
|
3899
3945
|
* will be included. Cannot contain a slash.
|
|
3900
3946
|
* @returns The created `Query`.
|
|
3901
|
-
*/ function
|
|
3902
|
-
if (t = ct(t,
|
|
3903
|
-
return new
|
|
3947
|
+
*/ function Dn(t, e) {
|
|
3948
|
+
if (t = ct(t, _n), ot("collectionGroup", "collection id", e), e.indexOf("/") >= 0) throw new B(V, "Invalid collection ID '".concat(e, "' passed to function collectionGroup(). Collection IDs must not contain '/'."));
|
|
3949
|
+
return new Fn(t,
|
|
3904
3950
|
/* converter= */ null, function(t) {
|
|
3905
|
-
return new
|
|
3951
|
+
return new Ee(et.emptyPath(), t);
|
|
3906
3952
|
}(e));
|
|
3907
3953
|
}
|
|
3908
3954
|
|
|
3909
|
-
function
|
|
3955
|
+
function Nn(t, e) {
|
|
3910
3956
|
for (var n = [], i = 2; i < arguments.length; i++) n[i - 2] = arguments[i];
|
|
3911
3957
|
if (t = p(t),
|
|
3912
3958
|
// We allow omission of 'pathString' but explicitly prohibit passing in both
|
|
3913
3959
|
// 'undefined' and 'null'.
|
|
3914
|
-
1 === arguments.length && (e =
|
|
3960
|
+
1 === arguments.length && (e = Et.F()), ot("doc", "path", e), t instanceof _n) {
|
|
3915
3961
|
var o = et.fromString.apply(et, r([ e ], n, !1));
|
|
3916
|
-
return at(o), new
|
|
3962
|
+
return at(o), new In(t,
|
|
3917
3963
|
/* converter= */ null, new it(o));
|
|
3918
3964
|
}
|
|
3919
|
-
if (!(t instanceof
|
|
3965
|
+
if (!(t instanceof In || t instanceof Pn)) throw new B(V, "Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");
|
|
3920
3966
|
var a = t._path.child(et.fromString.apply(et, r([ e ], n, !1)));
|
|
3921
|
-
return at(a), new
|
|
3967
|
+
return at(a), new In(t.firestore, t instanceof Pn ? t.converter : null, new it(a));
|
|
3922
3968
|
}
|
|
3923
3969
|
|
|
3924
3970
|
/**
|
|
@@ -3928,8 +3974,8 @@ function Dn(t, e) {
|
|
|
3928
3974
|
* @param right - A reference to compare.
|
|
3929
3975
|
* @returns true if the references point to the same location in the same
|
|
3930
3976
|
* Firestore database.
|
|
3931
|
-
*/ function
|
|
3932
|
-
return t = p(t), e = p(e), (t instanceof
|
|
3977
|
+
*/ function On(t, e) {
|
|
3978
|
+
return t = p(t), e = p(e), (t instanceof In || t instanceof Pn) && (e instanceof In || e instanceof Pn) && t.firestore === e.firestore && t.path === e.path && t.converter === e.converter
|
|
3933
3979
|
/**
|
|
3934
3980
|
* Returns true if the provided queries point to the same collection and apply
|
|
3935
3981
|
* the same constraints.
|
|
@@ -3941,16 +3987,16 @@ function Dn(t, e) {
|
|
|
3941
3987
|
*/;
|
|
3942
3988
|
}
|
|
3943
3989
|
|
|
3944
|
-
function
|
|
3945
|
-
return t = p(t), e = p(e), t instanceof
|
|
3990
|
+
function qn(t, e) {
|
|
3991
|
+
return t = p(t), e = p(e), t instanceof Fn && e instanceof Fn && t.firestore === e.firestore && function(t, e) {
|
|
3946
3992
|
return function(t, e) {
|
|
3947
3993
|
if (t.limit !== e.limit) return !1;
|
|
3948
3994
|
if (t.orderBy.length !== e.orderBy.length) return !1;
|
|
3949
|
-
for (var n = 0; n < t.orderBy.length; n++) if (!
|
|
3995
|
+
for (var n = 0; n < t.orderBy.length; n++) if (!fe(t.orderBy[n], e.orderBy[n])) return !1;
|
|
3950
3996
|
if (t.filters.length !== e.filters.length) return !1;
|
|
3951
|
-
for (var r = 0; r < t.filters.length; r++) if (!
|
|
3952
|
-
return t.collectionGroup === e.collectionGroup && !!t.path.isEqual(e.path) && !!
|
|
3953
|
-
}(
|
|
3997
|
+
for (var r = 0; r < t.filters.length; r++) if (!ee(t.filters[r], e.filters[r])) return !1;
|
|
3998
|
+
return t.collectionGroup === e.collectionGroup && !!t.path.isEqual(e.path) && !!Jt(t.startAt, e.startAt) && Jt(t.endAt, e.endAt);
|
|
3999
|
+
}(Fe(t), Fe(e)) && t.limitType === e.limitType;
|
|
3954
4000
|
}(t._query, e._query) && t.converter === e.converter
|
|
3955
4001
|
/**
|
|
3956
4002
|
* @license
|
|
@@ -3973,7 +4019,7 @@ function On(t, e) {
|
|
|
3973
4019
|
*/;
|
|
3974
4020
|
}
|
|
3975
4021
|
|
|
3976
|
-
var
|
|
4022
|
+
var Rn = /** @class */ function() {
|
|
3977
4023
|
/** @hideconstructor */
|
|
3978
4024
|
function t(t) {
|
|
3979
4025
|
this._byteString = t;
|
|
@@ -3985,7 +4031,7 @@ var qn = /** @class */ function() {
|
|
|
3985
4031
|
* @param base64 - The Base64 string used to create the `Bytes` object.
|
|
3986
4032
|
*/ return t.fromBase64String = function(e) {
|
|
3987
4033
|
try {
|
|
3988
|
-
return new t(
|
|
4034
|
+
return new t(Pt.fromBase64String(e));
|
|
3989
4035
|
} catch (e) {
|
|
3990
4036
|
throw new B(V, "Failed to construct data from Base64 string: " + e);
|
|
3991
4037
|
}
|
|
@@ -3996,7 +4042,7 @@ var qn = /** @class */ function() {
|
|
|
3996
4042
|
* @param array - The Uint8Array used to create the `Bytes` object.
|
|
3997
4043
|
*/
|
|
3998
4044
|
t.fromUint8Array = function(e) {
|
|
3999
|
-
return new t(
|
|
4045
|
+
return new t(Pt.fromUint8Array(e));
|
|
4000
4046
|
},
|
|
4001
4047
|
/**
|
|
4002
4048
|
* Returns the underlying bytes as a Base64-encoded string.
|
|
@@ -4031,7 +4077,7 @@ var qn = /** @class */ function() {
|
|
|
4031
4077
|
t.prototype.isEqual = function(t) {
|
|
4032
4078
|
return this._byteString.isEqual(t._byteString);
|
|
4033
4079
|
}, t;
|
|
4034
|
-
}(),
|
|
4080
|
+
}(), Cn = /** @class */ function() {
|
|
4035
4081
|
/**
|
|
4036
4082
|
* Creates a `FieldPath` from the provided field names. If more than one field
|
|
4037
4083
|
* name is provided, the path will point to a nested field in a document.
|
|
@@ -4081,8 +4127,8 @@ var qn = /** @class */ function() {
|
|
|
4081
4127
|
* Returns a special sentinel `FieldPath` to refer to the ID of a document.
|
|
4082
4128
|
* It can be used in queries to sort or filter by the document ID.
|
|
4083
4129
|
*/
|
|
4084
|
-
function
|
|
4085
|
-
return new
|
|
4130
|
+
function xn() {
|
|
4131
|
+
return new Cn("__name__");
|
|
4086
4132
|
}
|
|
4087
4133
|
|
|
4088
4134
|
/**
|
|
@@ -4104,14 +4150,14 @@ function Cn() {
|
|
|
4104
4150
|
/**
|
|
4105
4151
|
* Sentinel values that can be used when writing document fields with `set()`
|
|
4106
4152
|
* or `update()`.
|
|
4107
|
-
*/ var
|
|
4153
|
+
*/ var Mn =
|
|
4108
4154
|
/**
|
|
4109
4155
|
* @param _methodName - The public API endpoint that returns this class.
|
|
4110
4156
|
* @hideconstructor
|
|
4111
4157
|
*/
|
|
4112
4158
|
function(t) {
|
|
4113
4159
|
this._methodName = t;
|
|
4114
|
-
},
|
|
4160
|
+
}, Ln = /** @class */ function() {
|
|
4115
4161
|
/**
|
|
4116
4162
|
* Creates a new immutable `GeoPoint` object with the provided latitude and
|
|
4117
4163
|
* longitude values.
|
|
@@ -4162,23 +4208,23 @@ function(t) {
|
|
|
4162
4208
|
* with an underscore.
|
|
4163
4209
|
*/
|
|
4164
4210
|
t.prototype._compareTo = function(t) {
|
|
4165
|
-
return
|
|
4211
|
+
return St(this._lat, t._lat) || St(this._long, t._long);
|
|
4166
4212
|
}, t;
|
|
4167
|
-
}(),
|
|
4213
|
+
}(), jn = /^__.*__$/, Un = /** @class */ function() {
|
|
4168
4214
|
function t(t, e, n) {
|
|
4169
4215
|
this.data = t, this.fieldMask = e, this.fieldTransforms = n;
|
|
4170
4216
|
}
|
|
4171
4217
|
return t.prototype.toMutation = function(t, e) {
|
|
4172
|
-
return null !== this.fieldMask ? new
|
|
4218
|
+
return null !== this.fieldMask ? new je(t, this.data, this.fieldMask, e, this.fieldTransforms) : new Le(t, this.data, e, this.fieldTransforms);
|
|
4173
4219
|
}, t;
|
|
4174
|
-
}(),
|
|
4220
|
+
}(), Bn = /** @class */ function() {
|
|
4175
4221
|
function t(t,
|
|
4176
4222
|
// The fieldMask does not include document transforms.
|
|
4177
4223
|
e, n) {
|
|
4178
4224
|
this.data = t, this.fieldMask = e, this.fieldTransforms = n;
|
|
4179
4225
|
}
|
|
4180
4226
|
return t.prototype.toMutation = function(t, e) {
|
|
4181
|
-
return new
|
|
4227
|
+
return new je(t, this.data, this.fieldMask, e, this.fieldTransforms);
|
|
4182
4228
|
}, t;
|
|
4183
4229
|
}();
|
|
4184
4230
|
|
|
@@ -4204,7 +4250,7 @@ function(t) {
|
|
|
4204
4250
|
*
|
|
4205
4251
|
* Latitude values are in the range of [-90, 90].
|
|
4206
4252
|
* Longitude values are in the range of [-180, 180].
|
|
4207
|
-
*/ function
|
|
4253
|
+
*/ function zn(t) {
|
|
4208
4254
|
switch (t) {
|
|
4209
4255
|
case 0 /* UserDataSource.Set */ :
|
|
4210
4256
|
// fall through
|
|
@@ -4222,7 +4268,7 @@ function(t) {
|
|
|
4222
4268
|
}
|
|
4223
4269
|
}
|
|
4224
4270
|
|
|
4225
|
-
/** A "context" object passed around while parsing user data. */ var
|
|
4271
|
+
/** A "context" object passed around while parsing user data. */ var Kn = /** @class */ function() {
|
|
4226
4272
|
/**
|
|
4227
4273
|
* Initializes a ParseContext with the given source and path.
|
|
4228
4274
|
*
|
|
@@ -4282,7 +4328,7 @@ function(t) {
|
|
|
4282
4328
|
ut: !0
|
|
4283
4329
|
});
|
|
4284
4330
|
}, t.prototype.lt = function(t) {
|
|
4285
|
-
return
|
|
4331
|
+
return lr(t, this.settings.methodName, this.settings.ft || !1, this.path, this.settings.dt);
|
|
4286
4332
|
},
|
|
4287
4333
|
/** Returns 'true' if 'fieldPath' was traversed when creating this context. */ t.prototype.contains = function(t) {
|
|
4288
4334
|
return void 0 !== this.fieldMask.find((function(e) {
|
|
@@ -4296,15 +4342,15 @@ function(t) {
|
|
|
4296
4342
|
if (this.path) for (var t = 0; t < this.path.length; t++) this.ct(this.path.get(t));
|
|
4297
4343
|
}, t.prototype.ct = function(t) {
|
|
4298
4344
|
if (0 === t.length) throw this.lt("Document fields must not be empty");
|
|
4299
|
-
if (
|
|
4345
|
+
if (zn(this.st) && jn.test(t)) throw this.lt('Document fields cannot begin and end with "__"');
|
|
4300
4346
|
}, t;
|
|
4301
|
-
}(),
|
|
4347
|
+
}(), Qn = /** @class */ function() {
|
|
4302
4348
|
function t(t, e, n) {
|
|
4303
|
-
this.databaseId = t, this.ignoreUndefinedProperties = e, this.M = n ||
|
|
4349
|
+
this.databaseId = t, this.ignoreUndefinedProperties = e, this.M = n || hn(t)
|
|
4304
4350
|
/** Creates a new top-level parse context. */;
|
|
4305
4351
|
}
|
|
4306
4352
|
return t.prototype.wt = function(t, e, n, r) {
|
|
4307
|
-
return void 0 === r && (r = !1), new
|
|
4353
|
+
return void 0 === r && (r = !1), new Kn({
|
|
4308
4354
|
st: t,
|
|
4309
4355
|
methodName: e,
|
|
4310
4356
|
dt: n,
|
|
@@ -4318,30 +4364,30 @@ function(t) {
|
|
|
4318
4364
|
/**
|
|
4319
4365
|
* Helper for parsing raw user input (provided via the API) into internal model
|
|
4320
4366
|
* classes.
|
|
4321
|
-
*/ function
|
|
4322
|
-
var e = t._freezeSettings(), n =
|
|
4323
|
-
return new
|
|
4367
|
+
*/ function Gn(t) {
|
|
4368
|
+
var e = t._freezeSettings(), n = hn(t._databaseId);
|
|
4369
|
+
return new Qn(t._databaseId, !!e.ignoreUndefinedProperties, n);
|
|
4324
4370
|
}
|
|
4325
4371
|
|
|
4326
|
-
/** Parse document data from a set() call. */ function
|
|
4372
|
+
/** Parse document data from a set() call. */ function Yn(t, e, n, r, i, o) {
|
|
4327
4373
|
void 0 === o && (o = {});
|
|
4328
4374
|
var a = t.wt(o.merge || o.mergeFields ? 2 /* UserDataSource.MergeSet */ : 0 /* UserDataSource.Set */ , e, n, i);
|
|
4329
|
-
|
|
4330
|
-
var u, s, c =
|
|
4331
|
-
if (o.merge) u = new
|
|
4375
|
+
ar("Data must be an object, but it was:", a, r);
|
|
4376
|
+
var u, s, c = ir(r, a);
|
|
4377
|
+
if (o.merge) u = new ge(a.fieldMask), s = a.fieldTransforms; else if (o.mergeFields) {
|
|
4332
4378
|
for (var l = [], f = 0, h = o.mergeFields; f < h.length; f++) {
|
|
4333
|
-
var p =
|
|
4379
|
+
var p = ur(e, h[f], n);
|
|
4334
4380
|
if (!a.contains(p)) throw new B(V, "Field '".concat(p, "' is specified in your field mask but missing from your input data."));
|
|
4335
|
-
|
|
4381
|
+
fr(l, p) || l.push(p);
|
|
4336
4382
|
}
|
|
4337
|
-
u = new
|
|
4383
|
+
u = new ge(l), s = a.fieldTransforms.filter((function(t) {
|
|
4338
4384
|
return u.covers(t.field);
|
|
4339
4385
|
}));
|
|
4340
4386
|
} else u = null, s = a.fieldTransforms;
|
|
4341
|
-
return new
|
|
4387
|
+
return new Un(new we(c), u, s);
|
|
4342
4388
|
}
|
|
4343
4389
|
|
|
4344
|
-
var
|
|
4390
|
+
var Wn = /** @class */ function(e) {
|
|
4345
4391
|
function n() {
|
|
4346
4392
|
return null !== e && e.apply(this, arguments) || this;
|
|
4347
4393
|
}
|
|
@@ -4353,7 +4399,7 @@ var Yn = /** @class */ function(e) {
|
|
|
4353
4399
|
}, n.prototype.isEqual = function(t) {
|
|
4354
4400
|
return t instanceof n;
|
|
4355
4401
|
}, n;
|
|
4356
|
-
}(
|
|
4402
|
+
}(Mn);
|
|
4357
4403
|
|
|
4358
4404
|
/**
|
|
4359
4405
|
* Creates a child context for parsing SerializableFieldValues.
|
|
@@ -4370,8 +4416,8 @@ var Yn = /** @class */ function(e) {
|
|
|
4370
4416
|
* context.
|
|
4371
4417
|
* @param context - The parent context.
|
|
4372
4418
|
* @param arrayElement - Whether or not the FieldValue has an array.
|
|
4373
|
-
*/ function
|
|
4374
|
-
return new
|
|
4419
|
+
*/ function Hn(t, e, n) {
|
|
4420
|
+
return new Kn({
|
|
4375
4421
|
st: 3 /* UserDataSource.Argument */ ,
|
|
4376
4422
|
dt: e.settings.dt,
|
|
4377
4423
|
methodName: t._methodName,
|
|
@@ -4379,101 +4425,101 @@ var Yn = /** @class */ function(e) {
|
|
|
4379
4425
|
}, e.databaseId, e.M, e.ignoreUndefinedProperties);
|
|
4380
4426
|
}
|
|
4381
4427
|
|
|
4382
|
-
var
|
|
4428
|
+
var Xn = /** @class */ function(e) {
|
|
4383
4429
|
function n() {
|
|
4384
4430
|
return null !== e && e.apply(this, arguments) || this;
|
|
4385
4431
|
}
|
|
4386
4432
|
return t(n, e), n.prototype._toFieldTransform = function(t) {
|
|
4387
|
-
return new
|
|
4433
|
+
return new Ce(t.path, new Ne);
|
|
4388
4434
|
}, n.prototype.isEqual = function(t) {
|
|
4389
4435
|
return t instanceof n;
|
|
4390
4436
|
}, n;
|
|
4391
|
-
}(
|
|
4437
|
+
}(Mn), Jn = /** @class */ function(e) {
|
|
4392
4438
|
function n(t, n) {
|
|
4393
4439
|
var r = this;
|
|
4394
4440
|
return (r = e.call(this, t) || this).yt = n, r;
|
|
4395
4441
|
}
|
|
4396
4442
|
return t(n, e), n.prototype._toFieldTransform = function(t) {
|
|
4397
|
-
var e =
|
|
4443
|
+
var e = Hn(this, t,
|
|
4398
4444
|
/*array=*/ !0), n = this.yt.map((function(t) {
|
|
4399
|
-
return
|
|
4400
|
-
})), r = new
|
|
4401
|
-
return new
|
|
4445
|
+
return rr(t, e);
|
|
4446
|
+
})), r = new Oe(n);
|
|
4447
|
+
return new Ce(t.path, r);
|
|
4402
4448
|
}, n.prototype.isEqual = function(t) {
|
|
4403
4449
|
// TODO(mrschmidt): Implement isEquals
|
|
4404
4450
|
return this === t;
|
|
4405
4451
|
}, n;
|
|
4406
|
-
}(
|
|
4452
|
+
}(Mn), Zn = /** @class */ function(e) {
|
|
4407
4453
|
function n(t, n) {
|
|
4408
4454
|
var r = this;
|
|
4409
4455
|
return (r = e.call(this, t) || this).yt = n, r;
|
|
4410
4456
|
}
|
|
4411
4457
|
return t(n, e), n.prototype._toFieldTransform = function(t) {
|
|
4412
|
-
var e =
|
|
4458
|
+
var e = Hn(this, t,
|
|
4413
4459
|
/*array=*/ !0), n = this.yt.map((function(t) {
|
|
4414
|
-
return
|
|
4415
|
-
})), r = new
|
|
4416
|
-
return new
|
|
4460
|
+
return rr(t, e);
|
|
4461
|
+
})), r = new qe(n);
|
|
4462
|
+
return new Ce(t.path, r);
|
|
4417
4463
|
}, n.prototype.isEqual = function(t) {
|
|
4418
4464
|
// TODO(mrschmidt): Implement isEquals
|
|
4419
4465
|
return this === t;
|
|
4420
4466
|
}, n;
|
|
4421
|
-
}(
|
|
4467
|
+
}(Mn), $n = /** @class */ function(e) {
|
|
4422
4468
|
function n(t, n) {
|
|
4423
4469
|
var r = this;
|
|
4424
4470
|
return (r = e.call(this, t) || this).gt = n, r;
|
|
4425
4471
|
}
|
|
4426
4472
|
return t(n, e), n.prototype._toFieldTransform = function(t) {
|
|
4427
|
-
var e = new
|
|
4428
|
-
return new
|
|
4473
|
+
var e = new Re(t.M, Ve(t.M, this.gt));
|
|
4474
|
+
return new Ce(t.path, e);
|
|
4429
4475
|
}, n.prototype.isEqual = function(t) {
|
|
4430
4476
|
// TODO(mrschmidt): Implement isEquals
|
|
4431
4477
|
return this === t;
|
|
4432
4478
|
}, n;
|
|
4433
|
-
}(
|
|
4479
|
+
}(Mn);
|
|
4434
4480
|
|
|
4435
|
-
/** Parse update data from an update() call. */ function
|
|
4481
|
+
/** Parse update data from an update() call. */ function tr(t, e, n, r) {
|
|
4436
4482
|
var i = t.wt(1 /* UserDataSource.Update */ , e, n);
|
|
4437
|
-
|
|
4438
|
-
var o = [], a =
|
|
4439
|
-
|
|
4440
|
-
var u =
|
|
4483
|
+
ar("Data must be an object, but it was:", i, r);
|
|
4484
|
+
var o = [], a = we.empty();
|
|
4485
|
+
It(r, (function(t, r) {
|
|
4486
|
+
var u = cr(e, t, n);
|
|
4441
4487
|
// For Compat types, we have to "extract" the underlying types before
|
|
4442
4488
|
// performing validation.
|
|
4443
4489
|
r = p(r);
|
|
4444
4490
|
var s = i.at(u);
|
|
4445
|
-
if (r instanceof
|
|
4491
|
+
if (r instanceof Wn)
|
|
4446
4492
|
// Add it to the field mask, but don't add anything to updateData.
|
|
4447
4493
|
o.push(u); else {
|
|
4448
|
-
var c =
|
|
4494
|
+
var c = rr(r, s);
|
|
4449
4495
|
null != c && (o.push(u), a.set(u, c));
|
|
4450
4496
|
}
|
|
4451
4497
|
}));
|
|
4452
|
-
var u = new
|
|
4453
|
-
return new
|
|
4498
|
+
var u = new ge(o);
|
|
4499
|
+
return new Bn(a, u, i.fieldTransforms);
|
|
4454
4500
|
}
|
|
4455
4501
|
|
|
4456
|
-
/** Parse update data from a list of field/value arguments. */ function
|
|
4457
|
-
var a = t.wt(1 /* UserDataSource.Update */ , e, n), u = [
|
|
4502
|
+
/** Parse update data from a list of field/value arguments. */ function er(t, e, n, r, i, o) {
|
|
4503
|
+
var a = t.wt(1 /* UserDataSource.Update */ , e, n), u = [ ur(e, r, n) ], s = [ i ];
|
|
4458
4504
|
if (o.length % 2 != 0) throw new B(V, "Function ".concat(e, "() needs to be called with an even number of arguments that alternate between field names and values."));
|
|
4459
|
-
for (var c = 0; c < o.length; c += 2) u.push(
|
|
4505
|
+
for (var c = 0; c < o.length; c += 2) u.push(ur(e, o[c])), s.push(o[c + 1]);
|
|
4460
4506
|
// We iterate in reverse order to pick the last value for a field if the
|
|
4461
4507
|
// user specified the field multiple times.
|
|
4462
|
-
for (var l = [], f =
|
|
4508
|
+
for (var l = [], f = we.empty(), h = u.length - 1; h >= 0; --h) if (!fr(l, u[h])) {
|
|
4463
4509
|
var d = u[h], y = s[h];
|
|
4464
4510
|
// For Compat types, we have to "extract" the underlying types before
|
|
4465
4511
|
// performing validation.
|
|
4466
4512
|
y = p(y);
|
|
4467
4513
|
var m = a.at(d);
|
|
4468
|
-
if (y instanceof
|
|
4514
|
+
if (y instanceof Wn)
|
|
4469
4515
|
// Add it to the field mask, but don't add anything to updateData.
|
|
4470
4516
|
l.push(d); else {
|
|
4471
|
-
var v =
|
|
4517
|
+
var v = rr(y, m);
|
|
4472
4518
|
null != v && (l.push(d), f.set(d, v));
|
|
4473
4519
|
}
|
|
4474
4520
|
}
|
|
4475
|
-
var g = new
|
|
4476
|
-
return new
|
|
4521
|
+
var g = new ge(l);
|
|
4522
|
+
return new Bn(f, g, a.fieldTransforms);
|
|
4477
4523
|
}
|
|
4478
4524
|
|
|
4479
4525
|
/**
|
|
@@ -4482,8 +4528,8 @@ var Hn = /** @class */ function(e) {
|
|
|
4482
4528
|
*
|
|
4483
4529
|
* @param allowArrays - Whether the query value is an array that may directly
|
|
4484
4530
|
* contain additional arrays (e.g. the operand of an `in` query).
|
|
4485
|
-
*/ function
|
|
4486
|
-
return void 0 === r && (r = !1),
|
|
4531
|
+
*/ function nr(t, e, n, r) {
|
|
4532
|
+
return void 0 === r && (r = !1), rr(n, t.wt(r ? 4 /* UserDataSource.ArrayArgument */ : 3 /* UserDataSource.Argument */ , e));
|
|
4487
4533
|
}
|
|
4488
4534
|
|
|
4489
4535
|
/**
|
|
@@ -4494,12 +4540,12 @@ var Hn = /** @class */ function(e) {
|
|
|
4494
4540
|
* the source of the data being parsed, etc.
|
|
4495
4541
|
* @returns The parsed value, or null if the value was a FieldValue sentinel
|
|
4496
4542
|
* that should not be included in the resulting parsed data.
|
|
4497
|
-
*/ function
|
|
4498
|
-
if (
|
|
4543
|
+
*/ function rr(t, e) {
|
|
4544
|
+
if (or(
|
|
4499
4545
|
// Unwrap the API type from the Compat SDK. This will return the API type
|
|
4500
4546
|
// from firestore-exp.
|
|
4501
|
-
t = p(t))) return
|
|
4502
|
-
if (t instanceof
|
|
4547
|
+
t = p(t))) return ar("Unsupported field value:", e, t), ir(t, e);
|
|
4548
|
+
if (t instanceof Mn)
|
|
4503
4549
|
// FieldValues usually parse into transforms (except deleteField())
|
|
4504
4550
|
// in which case we do not want to include this field in our parsed data
|
|
4505
4551
|
// (as doing so will overwrite the field directly prior to the transform
|
|
@@ -4511,7 +4557,7 @@ var Hn = /** @class */ function(e) {
|
|
|
4511
4557
|
*/
|
|
4512
4558
|
return function(t, e) {
|
|
4513
4559
|
// Sentinels are only supported with writes, and not within arrays.
|
|
4514
|
-
if (!
|
|
4560
|
+
if (!zn(e.st)) throw e.lt("".concat(t._methodName, "() can only be used with update() and set()"));
|
|
4515
4561
|
if (!e.path) throw e.lt("".concat(t._methodName, "() is not currently supported inside arrays"));
|
|
4516
4562
|
var n = t._toFieldTransform(e);
|
|
4517
4563
|
n && e.fieldTransforms.push(n);
|
|
@@ -4534,7 +4580,7 @@ var Hn = /** @class */ function(e) {
|
|
|
4534
4580
|
if (e.settings.ut && 4 /* UserDataSource.ArrayArgument */ !== e.st) throw e.lt("Nested arrays are not supported");
|
|
4535
4581
|
return function(t, e) {
|
|
4536
4582
|
for (var n = [], r = 0, i = 0, o = t; i < o.length; i++) {
|
|
4537
|
-
var a =
|
|
4583
|
+
var a = rr(o[i], e.ht(r));
|
|
4538
4584
|
null == a && (
|
|
4539
4585
|
// Just include nulls in the array for fields being replaced with a
|
|
4540
4586
|
// sentinel.
|
|
@@ -4553,7 +4599,7 @@ var Hn = /** @class */ function(e) {
|
|
|
4553
4599
|
if (null === (t = p(t))) return {
|
|
4554
4600
|
nullValue: "NULL_VALUE"
|
|
4555
4601
|
};
|
|
4556
|
-
if ("number" == typeof t) return
|
|
4602
|
+
if ("number" == typeof t) return Ve(e.M, t);
|
|
4557
4603
|
if ("boolean" == typeof t) return {
|
|
4558
4604
|
booleanValue: t
|
|
4559
4605
|
};
|
|
@@ -4561,41 +4607,41 @@ var Hn = /** @class */ function(e) {
|
|
|
4561
4607
|
stringValue: t
|
|
4562
4608
|
};
|
|
4563
4609
|
if (t instanceof Date) {
|
|
4564
|
-
var n =
|
|
4610
|
+
var n = qt.fromDate(t);
|
|
4565
4611
|
return {
|
|
4566
|
-
timestampValue:
|
|
4612
|
+
timestampValue: Ye(e.M, n)
|
|
4567
4613
|
};
|
|
4568
4614
|
}
|
|
4569
|
-
if (t instanceof
|
|
4615
|
+
if (t instanceof qt) {
|
|
4570
4616
|
// Firestore backend truncates precision down to microseconds. To ensure
|
|
4571
4617
|
// offline mode works the same with regards to truncation, perform the
|
|
4572
4618
|
// truncation immediately without waiting for the backend to do that.
|
|
4573
|
-
var r = new
|
|
4619
|
+
var r = new qt(t.seconds, 1e3 * Math.floor(t.nanoseconds / 1e3));
|
|
4574
4620
|
return {
|
|
4575
|
-
timestampValue:
|
|
4621
|
+
timestampValue: Ye(e.M, r)
|
|
4576
4622
|
};
|
|
4577
4623
|
}
|
|
4578
|
-
if (t instanceof
|
|
4624
|
+
if (t instanceof Ln) return {
|
|
4579
4625
|
geoPointValue: {
|
|
4580
4626
|
latitude: t.latitude,
|
|
4581
4627
|
longitude: t.longitude
|
|
4582
4628
|
}
|
|
4583
4629
|
};
|
|
4584
|
-
if (t instanceof
|
|
4585
|
-
bytesValue:
|
|
4630
|
+
if (t instanceof Rn) return {
|
|
4631
|
+
bytesValue: We(e.M, t._byteString)
|
|
4586
4632
|
};
|
|
4587
|
-
if (t instanceof
|
|
4633
|
+
if (t instanceof In) {
|
|
4588
4634
|
var i = e.databaseId, o = t.firestore._databaseId;
|
|
4589
4635
|
if (!o.isEqual(i)) throw e.lt("Document reference is for database ".concat(o.projectId, "/").concat(o.database, " but should be for database ").concat(i.projectId, "/").concat(i.database));
|
|
4590
4636
|
return {
|
|
4591
|
-
referenceValue:
|
|
4637
|
+
referenceValue: Je(t.firestore._databaseId || e.databaseId, t._key.path)
|
|
4592
4638
|
};
|
|
4593
4639
|
}
|
|
4594
4640
|
throw e.lt("Unsupported field value: ".concat(st(t)));
|
|
4595
4641
|
}(t, e);
|
|
4596
4642
|
}
|
|
4597
4643
|
|
|
4598
|
-
function
|
|
4644
|
+
function ir(t, e) {
|
|
4599
4645
|
var n = {};
|
|
4600
4646
|
return function(t) {
|
|
4601
4647
|
for (var e in t) if (Object.prototype.hasOwnProperty.call(t, e)) return !1;
|
|
@@ -4603,8 +4649,8 @@ function rr(t, e) {
|
|
|
4603
4649
|
}(t) ?
|
|
4604
4650
|
// If we encounter an empty object, we explicitly add it to the update
|
|
4605
4651
|
// mask to ensure that the server creates a map entry.
|
|
4606
|
-
e.path && e.path.length > 0 && e.fieldMask.push(e.path) :
|
|
4607
|
-
var i =
|
|
4652
|
+
e.path && e.path.length > 0 && e.fieldMask.push(e.path) : It(t, (function(t, r) {
|
|
4653
|
+
var i = rr(r, e.ot(t));
|
|
4608
4654
|
null != i && (n[t] = i);
|
|
4609
4655
|
})), {
|
|
4610
4656
|
mapValue: {
|
|
@@ -4613,12 +4659,12 @@ function rr(t, e) {
|
|
|
4613
4659
|
};
|
|
4614
4660
|
}
|
|
4615
4661
|
|
|
4616
|
-
function
|
|
4617
|
-
return !("object" != typeof t || null === t || t instanceof Array || t instanceof Date || t instanceof
|
|
4662
|
+
function or(t) {
|
|
4663
|
+
return !("object" != typeof t || null === t || t instanceof Array || t instanceof Date || t instanceof qt || t instanceof Ln || t instanceof Rn || t instanceof In || t instanceof Mn);
|
|
4618
4664
|
}
|
|
4619
4665
|
|
|
4620
|
-
function
|
|
4621
|
-
if (!
|
|
4666
|
+
function ar(t, e, n) {
|
|
4667
|
+
if (!or(n) || !function(t) {
|
|
4622
4668
|
return "object" == typeof t && null !== t && (Object.getPrototypeOf(t) === Object.prototype || null === Object.getPrototypeOf(t));
|
|
4623
4669
|
}(n)) {
|
|
4624
4670
|
var r = st(n);
|
|
@@ -4628,20 +4674,20 @@ function or(t, e, n) {
|
|
|
4628
4674
|
|
|
4629
4675
|
/**
|
|
4630
4676
|
* Helper that calls fromDotSeparatedString() but wraps any error thrown.
|
|
4631
|
-
*/ function
|
|
4677
|
+
*/ function ur(t, e, n) {
|
|
4632
4678
|
if (
|
|
4633
4679
|
// If required, replace the FieldPath Compat class with with the firestore-exp
|
|
4634
4680
|
// FieldPath.
|
|
4635
|
-
(e = p(e)) instanceof
|
|
4636
|
-
if ("string" == typeof e) return
|
|
4637
|
-
throw
|
|
4681
|
+
(e = p(e)) instanceof Cn) return e._internalPath;
|
|
4682
|
+
if ("string" == typeof e) return cr(t, e);
|
|
4683
|
+
throw lr("Field path arguments must be of type string or ", t,
|
|
4638
4684
|
/* hasConverter= */ !1,
|
|
4639
4685
|
/* path= */ void 0, n);
|
|
4640
4686
|
}
|
|
4641
4687
|
|
|
4642
4688
|
/**
|
|
4643
4689
|
* Matches any characters in a field path string that are reserved.
|
|
4644
|
-
*/ var
|
|
4690
|
+
*/ var sr = new RegExp("[~\\*/\\[\\]]");
|
|
4645
4691
|
|
|
4646
4692
|
/**
|
|
4647
4693
|
* Wraps fromDotSeparatedString with an error message about the method that
|
|
@@ -4651,20 +4697,20 @@ function or(t, e, n) {
|
|
|
4651
4697
|
* split on dots.
|
|
4652
4698
|
* @param targetDoc - The document against which the field path will be
|
|
4653
4699
|
* evaluated.
|
|
4654
|
-
*/ function
|
|
4655
|
-
if (e.search(
|
|
4700
|
+
*/ function cr(t, e, n) {
|
|
4701
|
+
if (e.search(sr) >= 0) throw lr("Invalid field path (".concat(e, "). Paths must not contain '~', '*', '/', '[', or ']'"), t,
|
|
4656
4702
|
/* hasConverter= */ !1,
|
|
4657
4703
|
/* path= */ void 0, n);
|
|
4658
4704
|
try {
|
|
4659
|
-
return (new (
|
|
4705
|
+
return (new (Cn.bind.apply(Cn, r([ void 0 ], e.split("."), !1))))._internalPath;
|
|
4660
4706
|
} catch (r) {
|
|
4661
|
-
throw
|
|
4707
|
+
throw lr("Invalid field path (".concat(e, "). Paths must not be empty, begin with '.', end with '.', or contain '..'"), t,
|
|
4662
4708
|
/* hasConverter= */ !1,
|
|
4663
4709
|
/* path= */ void 0, n);
|
|
4664
4710
|
}
|
|
4665
4711
|
}
|
|
4666
4712
|
|
|
4667
|
-
function
|
|
4713
|
+
function lr(t, e, n, r, i) {
|
|
4668
4714
|
var o = r && !r.isEmpty(), a = void 0 !== i, u = "Function ".concat(e, "() called with invalid data");
|
|
4669
4715
|
n && (u += " (via `toFirestore()`)"), u += ". ";
|
|
4670
4716
|
var s = "";
|
|
@@ -4673,7 +4719,7 @@ function cr(t, e, n, r, i) {
|
|
|
4673
4719
|
/** Checks `haystack` if FieldPath `needle` is present. Runs in O(n). */;
|
|
4674
4720
|
}
|
|
4675
4721
|
|
|
4676
|
-
function
|
|
4722
|
+
function fr(t, e) {
|
|
4677
4723
|
return t.some((function(t) {
|
|
4678
4724
|
return t.isEqual(e);
|
|
4679
4725
|
}));
|
|
@@ -4703,7 +4749,7 @@ function lr(t, e) {
|
|
|
4703
4749
|
* For a `DocumentSnapshot` that points to a non-existing document, any data
|
|
4704
4750
|
* access will return 'undefined'. You can use the `exists()` method to
|
|
4705
4751
|
* explicitly verify a document's existence.
|
|
4706
|
-
*/ var
|
|
4752
|
+
*/ var hr = /** @class */ function() {
|
|
4707
4753
|
// Note: This class is stripped down version of the DocumentSnapshot in
|
|
4708
4754
|
// the legacy SDK. The changes are:
|
|
4709
4755
|
// - No support for SnapshotMetadata.
|
|
@@ -4724,7 +4770,7 @@ function lr(t, e) {
|
|
|
4724
4770
|
* The `DocumentReference` for the document included in the `DocumentSnapshot`.
|
|
4725
4771
|
*/
|
|
4726
4772
|
get: function() {
|
|
4727
|
-
return new
|
|
4773
|
+
return new In(this._firestore, this._converter, this._key);
|
|
4728
4774
|
},
|
|
4729
4775
|
enumerable: !1,
|
|
4730
4776
|
configurable: !0
|
|
@@ -4749,7 +4795,7 @@ function lr(t, e) {
|
|
|
4749
4795
|
if (this._converter) {
|
|
4750
4796
|
// We only want to use the converter and create a new DocumentSnapshot
|
|
4751
4797
|
// if a converter has been provided.
|
|
4752
|
-
var t = new
|
|
4798
|
+
var t = new pr(this._firestore, this._userDataWriter, this._key, this._document,
|
|
4753
4799
|
/* converter= */ null);
|
|
4754
4800
|
return this._converter.fromFirestore(t);
|
|
4755
4801
|
}
|
|
@@ -4769,11 +4815,11 @@ function lr(t, e) {
|
|
|
4769
4815
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4770
4816
|
t.prototype.get = function(t) {
|
|
4771
4817
|
if (this._document) {
|
|
4772
|
-
var e = this._document.data.field(
|
|
4818
|
+
var e = this._document.data.field(mr("DocumentSnapshot.get", t));
|
|
4773
4819
|
if (null !== e) return this._userDataWriter.convertValue(e);
|
|
4774
4820
|
}
|
|
4775
4821
|
}, t;
|
|
4776
|
-
}(),
|
|
4822
|
+
}(), pr = /** @class */ function(e) {
|
|
4777
4823
|
function n() {
|
|
4778
4824
|
return null !== e && e.apply(this, arguments) || this;
|
|
4779
4825
|
}
|
|
@@ -4785,7 +4831,7 @@ function lr(t, e) {
|
|
|
4785
4831
|
*/ return t(n, e), n.prototype.data = function() {
|
|
4786
4832
|
return e.prototype.data.call(this);
|
|
4787
4833
|
}, n;
|
|
4788
|
-
}(
|
|
4834
|
+
}(hr), dr = /** @class */ function() {
|
|
4789
4835
|
/** @hideconstructor */
|
|
4790
4836
|
function t(t, e) {
|
|
4791
4837
|
this._docs = e, this.query = t;
|
|
@@ -4839,15 +4885,15 @@ function lr(t, e) {
|
|
|
4839
4885
|
* @param right - A snapshot to compare.
|
|
4840
4886
|
* @returns true if the snapshots are equal.
|
|
4841
4887
|
*/
|
|
4842
|
-
function
|
|
4843
|
-
return t = p(t), e = p(e), t instanceof
|
|
4888
|
+
function yr(t, e) {
|
|
4889
|
+
return t = p(t), e = p(e), t instanceof hr && e instanceof hr ? 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 dr && e instanceof dr && qn(t.query, e.query) && kt(t.docs, e.docs, yr)
|
|
4844
4890
|
/**
|
|
4845
4891
|
* Helper that calls `fromDotSeparatedString()` but wraps any error thrown.
|
|
4846
4892
|
*/;
|
|
4847
4893
|
}
|
|
4848
4894
|
|
|
4849
|
-
function
|
|
4850
|
-
return "string" == typeof e ?
|
|
4895
|
+
function mr(t, e) {
|
|
4896
|
+
return "string" == typeof e ? cr(t, e) : e instanceof Cn ? e._internalPath : e._delegate._internalPath;
|
|
4851
4897
|
}
|
|
4852
4898
|
|
|
4853
4899
|
/**
|
|
@@ -4869,28 +4915,28 @@ function yr(t, e) {
|
|
|
4869
4915
|
/**
|
|
4870
4916
|
* An `AppliableConstraint` is an abstraction of a constraint that can be applied
|
|
4871
4917
|
* to a Firestore query.
|
|
4872
|
-
*/ var
|
|
4918
|
+
*/ var vr = function() {}, gr = /** @class */ function(e) {
|
|
4873
4919
|
function n() {
|
|
4874
4920
|
return null !== e && e.apply(this, arguments) || this;
|
|
4875
4921
|
}
|
|
4876
4922
|
return t(n, e), n;
|
|
4877
|
-
}(
|
|
4923
|
+
}(vr);
|
|
4878
4924
|
|
|
4879
4925
|
/**
|
|
4880
4926
|
* A `QueryConstraint` is used to narrow the set of documents returned by a
|
|
4881
4927
|
* Firestore query. `QueryConstraint`s are created by invoking {@link where},
|
|
4882
|
-
* {@link orderBy}, {@link startAt}, {@link startAfter}, {@link
|
|
4883
|
-
* endBefore}, {@link endAt}, {@link limit}, {@link limitToLast} and
|
|
4884
|
-
* can then be passed to {@link query} to create a new query instance that
|
|
4928
|
+
* {@link orderBy}, {@link (startAt:1)}, {@link (startAfter:1)}, {@link
|
|
4929
|
+
* (endBefore:1)}, {@link (endAt:1)}, {@link limit}, {@link limitToLast} and
|
|
4930
|
+
* can then be passed to {@link (query:1)} to create a new query instance that
|
|
4885
4931
|
* also contains this `QueryConstraint`.
|
|
4886
|
-
*/ function
|
|
4932
|
+
*/ function wr(t, e) {
|
|
4887
4933
|
for (var n = [], r = 2; r < arguments.length; r++) n[r - 2] = arguments[r];
|
|
4888
4934
|
var i = [];
|
|
4889
|
-
e instanceof
|
|
4935
|
+
e instanceof vr && i.push(e), function(t) {
|
|
4890
4936
|
var e = t.filter((function(t) {
|
|
4891
|
-
return t instanceof
|
|
4937
|
+
return t instanceof Tr;
|
|
4892
4938
|
})).length, n = t.filter((function(t) {
|
|
4893
|
-
return t instanceof
|
|
4939
|
+
return t instanceof _r;
|
|
4894
4940
|
})).length;
|
|
4895
4941
|
if (e > 1 || e > 0 && n > 0) throw new B(V, "InvalidQuery. When using composite filters, you cannot use more than one filter at the top level. Consider nesting the multiple filters within an `and(...)` statement. For example: change `query(query, where(...), or(...))` to `query(query, and(where(...), or(...)))`.");
|
|
4896
4942
|
}(i = i.concat(n));
|
|
@@ -4905,9 +4951,9 @@ function yr(t, e) {
|
|
|
4905
4951
|
* A `QueryFieldFilterConstraint` is used to narrow the set of documents returned by
|
|
4906
4952
|
* a Firestore query by filtering on one or more document fields.
|
|
4907
4953
|
* `QueryFieldFilterConstraint`s are created by invoking {@link where} and can then
|
|
4908
|
-
* be passed to {@link query} to create a new query instance that also contains
|
|
4954
|
+
* be passed to {@link (query:1)} to create a new query instance that also contains
|
|
4909
4955
|
* this `QueryFieldFilterConstraint`.
|
|
4910
|
-
*/ var
|
|
4956
|
+
*/ var _r = /** @class */ function(e) {
|
|
4911
4957
|
/**
|
|
4912
4958
|
* @internal
|
|
4913
4959
|
*/
|
|
@@ -4921,32 +4967,32 @@ function yr(t, e) {
|
|
|
4921
4967
|
return new n(t, e, r);
|
|
4922
4968
|
}, n.prototype._apply = function(t) {
|
|
4923
4969
|
var e = this._parse(t);
|
|
4924
|
-
return
|
|
4970
|
+
return Lr(t._query, e), new Fn(t.firestore, t.converter, Pe(t._query, e));
|
|
4925
4971
|
}, n.prototype._parse = function(t) {
|
|
4926
|
-
var e =
|
|
4972
|
+
var e = Gn(t.firestore), n = function(t, e, n, r, i, o, a) {
|
|
4927
4973
|
var u;
|
|
4928
4974
|
if (i.isKeyField()) {
|
|
4929
4975
|
if ("array-contains" /* Operator.ARRAY_CONTAINS */ === o || "array-contains-any" /* Operator.ARRAY_CONTAINS_ANY */ === o) throw new B(V, "Invalid Query. You can't perform '".concat(o, "' queries on documentId()."));
|
|
4930
4976
|
if ("in" /* Operator.IN */ === o || "not-in" /* Operator.NOT_IN */ === o) {
|
|
4931
|
-
|
|
4977
|
+
Mr(a, o);
|
|
4932
4978
|
for (var s = [], c = 0, l = a; c < l.length; c++) {
|
|
4933
4979
|
var f = l[c];
|
|
4934
|
-
s.push(
|
|
4980
|
+
s.push(xr(r, t, f));
|
|
4935
4981
|
}
|
|
4936
4982
|
u = {
|
|
4937
4983
|
arrayValue: {
|
|
4938
4984
|
values: s
|
|
4939
4985
|
}
|
|
4940
4986
|
};
|
|
4941
|
-
} else u =
|
|
4942
|
-
} else "in" /* Operator.IN */ !== o && "not-in" /* Operator.NOT_IN */ !== o && "array-contains-any" /* Operator.ARRAY_CONTAINS_ANY */ !== o ||
|
|
4943
|
-
u =
|
|
4987
|
+
} else u = xr(r, t, a);
|
|
4988
|
+
} else "in" /* Operator.IN */ !== o && "not-in" /* Operator.NOT_IN */ !== o && "array-contains-any" /* Operator.ARRAY_CONTAINS_ANY */ !== o || Mr(a, o),
|
|
4989
|
+
u = nr(n, "where", a,
|
|
4944
4990
|
/* allowArrays= */ "in" /* Operator.IN */ === o || "not-in" /* Operator.NOT_IN */ === o);
|
|
4945
|
-
return
|
|
4991
|
+
return $t.create(i, o, u);
|
|
4946
4992
|
}(t._query, 0, e, t.firestore._databaseId, this._field, this._op, this._value);
|
|
4947
4993
|
return n;
|
|
4948
4994
|
}, n;
|
|
4949
|
-
}(
|
|
4995
|
+
}(gr);
|
|
4950
4996
|
|
|
4951
4997
|
/**
|
|
4952
4998
|
* Creates a {@link QueryFieldFilterConstraint} that enforces that documents
|
|
@@ -4958,9 +5004,9 @@ function yr(t, e) {
|
|
|
4958
5004
|
* "<=", "!=").
|
|
4959
5005
|
* @param value - The value for comparison
|
|
4960
5006
|
* @returns The created {@link QueryFieldFilterConstraint}.
|
|
4961
|
-
*/ function
|
|
4962
|
-
var r = e, i =
|
|
4963
|
-
return
|
|
5007
|
+
*/ function br(t, e, n) {
|
|
5008
|
+
var r = e, i = mr("where", t);
|
|
5009
|
+
return _r._create(i, r, n);
|
|
4964
5010
|
}
|
|
4965
5011
|
|
|
4966
5012
|
/**
|
|
@@ -4968,10 +5014,9 @@ function yr(t, e) {
|
|
|
4968
5014
|
* returned by a Firestore query by performing the logical OR or AND of multiple
|
|
4969
5015
|
* {@link QueryFieldFilterConstraint}s or {@link QueryCompositeFilterConstraint}s.
|
|
4970
5016
|
* `QueryCompositeFilterConstraint`s are created by invoking {@link or} or
|
|
4971
|
-
* {@link and} and can then be passed to {@link query} to create a new query
|
|
5017
|
+
* {@link and} and can then be passed to {@link (query:1)} to create a new query
|
|
4972
5018
|
* instance that also contains the `QueryCompositeFilterConstraint`.
|
|
4973
|
-
|
|
4974
|
-
*/ var br = /** @class */ function(e) {
|
|
5019
|
+
*/ var Tr = /** @class */ function(e) {
|
|
4975
5020
|
/**
|
|
4976
5021
|
* @internal
|
|
4977
5022
|
*/
|
|
@@ -4989,21 +5034,21 @@ function yr(t, e) {
|
|
|
4989
5034
|
})).filter((function(t) {
|
|
4990
5035
|
return t.getFilters().length > 0;
|
|
4991
5036
|
}));
|
|
4992
|
-
return 1 === e.length ? e[0] :
|
|
5037
|
+
return 1 === e.length ? e[0] : te.create(e, this._getOperator());
|
|
4993
5038
|
}, n.prototype._apply = function(t) {
|
|
4994
5039
|
var e = this._parse(t);
|
|
4995
5040
|
return 0 === e.getFilters().length ? t : (function(t, e) {
|
|
4996
5041
|
for (var n = t, r = 0, i = e.getFlattenedFilters(); r < i.length; r++) {
|
|
4997
5042
|
var o = i[r];
|
|
4998
|
-
|
|
5043
|
+
Lr(n, o), n = Pe(n, o);
|
|
4999
5044
|
}
|
|
5000
|
-
}(t._query, e), new
|
|
5045
|
+
}(t._query, e), new Fn(t.firestore, t.converter, Pe(t._query, e)));
|
|
5001
5046
|
}, n.prototype._getQueryConstraints = function() {
|
|
5002
5047
|
return this._queryConstraints;
|
|
5003
5048
|
}, n.prototype._getOperator = function() {
|
|
5004
5049
|
return "and" === this.type ? "and" /* CompositeOperator.AND */ : "or" /* CompositeOperator.OR */;
|
|
5005
5050
|
}, n;
|
|
5006
|
-
}(
|
|
5051
|
+
}(vr);
|
|
5007
5052
|
|
|
5008
5053
|
/**
|
|
5009
5054
|
* Creates a new {@link QueryCompositeFilterConstraint} that is a disjunction of
|
|
@@ -5014,13 +5059,12 @@ function yr(t, e) {
|
|
|
5014
5059
|
* {@link QueryFilterConstraint}s to perform a disjunction for. These must be
|
|
5015
5060
|
* created with calls to {@link where}, {@link or}, or {@link and}.
|
|
5016
5061
|
* @returns The newly created {@link QueryCompositeFilterConstraint}.
|
|
5017
|
-
|
|
5018
|
-
*/ function Tr() {
|
|
5062
|
+
*/ function Er() {
|
|
5019
5063
|
for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
|
|
5020
5064
|
// Only support QueryFilterConstraints
|
|
5021
5065
|
return t.forEach((function(t) {
|
|
5022
|
-
return
|
|
5023
|
-
})),
|
|
5066
|
+
return Ur("or", t);
|
|
5067
|
+
})), Tr._create("or" /* CompositeOperator.OR */ , t)
|
|
5024
5068
|
/**
|
|
5025
5069
|
* Creates a new {@link QueryCompositeFilterConstraint} that is a conjunction of
|
|
5026
5070
|
* the given filter constraints. A conjunction filter includes a document if it
|
|
@@ -5030,20 +5074,19 @@ function yr(t, e) {
|
|
|
5030
5074
|
* {@link QueryFilterConstraint}s to perform a conjunction for. These must be
|
|
5031
5075
|
* created with calls to {@link where}, {@link or}, or {@link and}.
|
|
5032
5076
|
* @returns The newly created {@link QueryCompositeFilterConstraint}.
|
|
5033
|
-
* @internal TODO remove this internal tag with OR Query support in the server
|
|
5034
5077
|
*/;
|
|
5035
5078
|
}
|
|
5036
5079
|
|
|
5037
|
-
function
|
|
5080
|
+
function Sr() {
|
|
5038
5081
|
for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
|
|
5039
5082
|
// Only support QueryFilterConstraints
|
|
5040
5083
|
return t.forEach((function(t) {
|
|
5041
|
-
return
|
|
5042
|
-
})),
|
|
5084
|
+
return Ur("and", t);
|
|
5085
|
+
})), Tr._create("and" /* CompositeOperator.AND */ , t)
|
|
5043
5086
|
/**
|
|
5044
5087
|
* A `QueryOrderByConstraint` is used to sort the set of documents returned by a
|
|
5045
5088
|
* Firestore query. `QueryOrderByConstraint`s are created by invoking
|
|
5046
|
-
* {@link orderBy} and can then be passed to {@link query} to create a new query
|
|
5089
|
+
* {@link orderBy} and can then be passed to {@link (query:1)} to create a new query
|
|
5047
5090
|
* instance that also contains this `QueryOrderByConstraint`.
|
|
5048
5091
|
*
|
|
5049
5092
|
* Note: Documents that do not contain the orderBy field will not be present in
|
|
@@ -5051,7 +5094,7 @@ function Er() {
|
|
|
5051
5094
|
*/;
|
|
5052
5095
|
}
|
|
5053
5096
|
|
|
5054
|
-
var
|
|
5097
|
+
var kr = /** @class */ function(e) {
|
|
5055
5098
|
/**
|
|
5056
5099
|
* @internal
|
|
5057
5100
|
*/
|
|
@@ -5067,22 +5110,22 @@ var Sr = /** @class */ function(e) {
|
|
|
5067
5110
|
var e = function(t, e, n) {
|
|
5068
5111
|
if (null !== t.startAt) throw new B(V, "Invalid query. You must not call startAt() or startAfter() before calling orderBy().");
|
|
5069
5112
|
if (null !== t.endAt) throw new B(V, "Invalid query. You must not call endAt() or endBefore() before calling orderBy().");
|
|
5070
|
-
var r = new
|
|
5113
|
+
var r = new le(e, n);
|
|
5071
5114
|
return function(t, e) {
|
|
5072
|
-
if (null ===
|
|
5115
|
+
if (null === Se(t)) {
|
|
5073
5116
|
// This is the first order by. It must match any inequality.
|
|
5074
|
-
var n =
|
|
5075
|
-
null !== n &&
|
|
5117
|
+
var n = ke(t);
|
|
5118
|
+
null !== n && jr(t, n, e.field);
|
|
5076
5119
|
}
|
|
5077
5120
|
}(t, r), r;
|
|
5078
5121
|
}(t._query, this._field, this._direction);
|
|
5079
|
-
return new
|
|
5122
|
+
return new Fn(t.firestore, t.converter, function(t, e) {
|
|
5080
5123
|
// TODO(dimond): validate that orderBy does not list the same key twice.
|
|
5081
5124
|
var n = t.explicitOrderBy.concat([ e ]);
|
|
5082
|
-
return new
|
|
5125
|
+
return new Ee(t.path, t.collectionGroup, n, t.filters.slice(), t.limit, t.limitType, t.startAt, t.endAt);
|
|
5083
5126
|
}(t._query, e));
|
|
5084
5127
|
}, n;
|
|
5085
|
-
}(
|
|
5128
|
+
}(gr);
|
|
5086
5129
|
|
|
5087
5130
|
/**
|
|
5088
5131
|
* Creates a {@link QueryOrderByConstraint} that sorts the query result by the
|
|
@@ -5095,19 +5138,19 @@ var Sr = /** @class */ function(e) {
|
|
|
5095
5138
|
* @param directionStr - Optional direction to sort by ('asc' or 'desc'). If
|
|
5096
5139
|
* not specified, order will be ascending.
|
|
5097
5140
|
* @returns The created {@link QueryOrderByConstraint}.
|
|
5098
|
-
*/ function
|
|
5141
|
+
*/ function Ar(t, e) {
|
|
5099
5142
|
void 0 === e && (e = "asc");
|
|
5100
|
-
var n = e, r =
|
|
5101
|
-
return
|
|
5143
|
+
var n = e, r = mr("orderBy", t);
|
|
5144
|
+
return kr._create(r, n);
|
|
5102
5145
|
}
|
|
5103
5146
|
|
|
5104
5147
|
/**
|
|
5105
5148
|
* A `QueryLimitConstraint` is used to limit the number of documents returned by
|
|
5106
5149
|
* a Firestore query.
|
|
5107
5150
|
* `QueryLimitConstraint`s are created by invoking {@link limit} or
|
|
5108
|
-
* {@link limitToLast} and can then be passed to {@link query} to create a new
|
|
5151
|
+
* {@link limitToLast} and can then be passed to {@link (query:1)} to create a new
|
|
5109
5152
|
* query instance that also contains this `QueryLimitConstraint`.
|
|
5110
|
-
*/ var
|
|
5153
|
+
*/ var Ir = /** @class */ function(e) {
|
|
5111
5154
|
/**
|
|
5112
5155
|
* @internal
|
|
5113
5156
|
*/
|
|
@@ -5120,11 +5163,11 @@ var Sr = /** @class */ function(e) {
|
|
|
5120
5163
|
return t(n, e), n._create = function(t, e, r) {
|
|
5121
5164
|
return new n(t, e, r);
|
|
5122
5165
|
}, n.prototype._apply = function(t) {
|
|
5123
|
-
return new
|
|
5124
|
-
return new
|
|
5166
|
+
return new Fn(t.firestore, t.converter, function(t, e, n) {
|
|
5167
|
+
return new Ee(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), e, n, t.startAt, t.endAt);
|
|
5125
5168
|
}(t._query, this._limit, this._limitType));
|
|
5126
5169
|
}, n;
|
|
5127
|
-
}(
|
|
5170
|
+
}(gr);
|
|
5128
5171
|
|
|
5129
5172
|
/**
|
|
5130
5173
|
* Creates a {@link QueryLimitConstraint} that only returns the first matching
|
|
@@ -5132,8 +5175,8 @@ var Sr = /** @class */ function(e) {
|
|
|
5132
5175
|
*
|
|
5133
5176
|
* @param limit - The maximum number of items to return.
|
|
5134
5177
|
* @returns The created {@link QueryLimitConstraint}.
|
|
5135
|
-
*/ function
|
|
5136
|
-
return lt("limit", t),
|
|
5178
|
+
*/ function Fr(t) {
|
|
5179
|
+
return lt("limit", t), Ir._create("limit", t, "F" /* LimitType.First */)
|
|
5137
5180
|
/**
|
|
5138
5181
|
* Creates a {@link QueryLimitConstraint} that only returns the last matching
|
|
5139
5182
|
* documents.
|
|
@@ -5146,18 +5189,18 @@ var Sr = /** @class */ function(e) {
|
|
|
5146
5189
|
*/;
|
|
5147
5190
|
}
|
|
5148
5191
|
|
|
5149
|
-
function
|
|
5150
|
-
return lt("limitToLast", t),
|
|
5192
|
+
function Pr(t) {
|
|
5193
|
+
return lt("limitToLast", t), Ir._create("limitToLast", t, "L" /* LimitType.Last */)
|
|
5151
5194
|
/**
|
|
5152
5195
|
* A `QueryStartAtConstraint` is used to exclude documents from the start of a
|
|
5153
5196
|
* result set returned by a Firestore query.
|
|
5154
5197
|
* `QueryStartAtConstraint`s are created by invoking {@link (startAt:1)} or
|
|
5155
|
-
* {@link (startAfter:1)} and can then be passed to {@link query} to create a
|
|
5198
|
+
* {@link (startAfter:1)} and can then be passed to {@link (query:1)} to create a
|
|
5156
5199
|
* new query instance that also contains this `QueryStartAtConstraint`.
|
|
5157
5200
|
*/;
|
|
5158
5201
|
}
|
|
5159
5202
|
|
|
5160
|
-
var
|
|
5203
|
+
var Vr = /** @class */ function(e) {
|
|
5161
5204
|
/**
|
|
5162
5205
|
* @internal
|
|
5163
5206
|
*/
|
|
@@ -5171,22 +5214,22 @@ var Pr = /** @class */ function(e) {
|
|
|
5171
5214
|
return t(n, e), n._create = function(t, e, r) {
|
|
5172
5215
|
return new n(t, e, r);
|
|
5173
5216
|
}, n.prototype._apply = function(t) {
|
|
5174
|
-
var e =
|
|
5175
|
-
return new
|
|
5176
|
-
return new
|
|
5217
|
+
var e = Cr(t, this.type, this._docOrFields, this._inclusive);
|
|
5218
|
+
return new Fn(t.firestore, t.converter, function(t, e) {
|
|
5219
|
+
return new Ee(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), t.limit, t.limitType, e, t.endAt);
|
|
5177
5220
|
}(t._query, e));
|
|
5178
5221
|
}, n;
|
|
5179
|
-
}(
|
|
5222
|
+
}(gr);
|
|
5180
5223
|
|
|
5181
|
-
function
|
|
5224
|
+
function Dr() {
|
|
5182
5225
|
for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
|
|
5183
|
-
return
|
|
5226
|
+
return Vr._create("startAt", t,
|
|
5184
5227
|
/*inclusive=*/ !0);
|
|
5185
5228
|
}
|
|
5186
5229
|
|
|
5187
|
-
function
|
|
5230
|
+
function Nr() {
|
|
5188
5231
|
for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
|
|
5189
|
-
return
|
|
5232
|
+
return Vr._create("startAfter", t,
|
|
5190
5233
|
/*inclusive=*/ !1);
|
|
5191
5234
|
}
|
|
5192
5235
|
|
|
@@ -5194,9 +5237,9 @@ function Dr() {
|
|
|
5194
5237
|
* A `QueryEndAtConstraint` is used to exclude documents from the end of a
|
|
5195
5238
|
* result set returned by a Firestore query.
|
|
5196
5239
|
* `QueryEndAtConstraint`s are created by invoking {@link (endAt:1)} or
|
|
5197
|
-
* {@link (endBefore:1)} and can then be passed to {@link query} to create a new
|
|
5240
|
+
* {@link (endBefore:1)} and can then be passed to {@link (query:1)} to create a new
|
|
5198
5241
|
* query instance that also contains this `QueryEndAtConstraint`.
|
|
5199
|
-
*/ var
|
|
5242
|
+
*/ var Or = /** @class */ function(e) {
|
|
5200
5243
|
/**
|
|
5201
5244
|
* @internal
|
|
5202
5245
|
*/
|
|
@@ -5210,27 +5253,27 @@ function Dr() {
|
|
|
5210
5253
|
return t(n, e), n._create = function(t, e, r) {
|
|
5211
5254
|
return new n(t, e, r);
|
|
5212
5255
|
}, n.prototype._apply = function(t) {
|
|
5213
|
-
var e =
|
|
5214
|
-
return new
|
|
5215
|
-
return new
|
|
5256
|
+
var e = Cr(t, this.type, this._docOrFields, this._inclusive);
|
|
5257
|
+
return new Fn(t.firestore, t.converter, function(t, e) {
|
|
5258
|
+
return new Ee(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), t.limit, t.limitType, t.startAt, e);
|
|
5216
5259
|
}(t._query, e));
|
|
5217
5260
|
}, n;
|
|
5218
|
-
}(
|
|
5261
|
+
}(gr);
|
|
5219
5262
|
|
|
5220
|
-
function
|
|
5263
|
+
function qr() {
|
|
5221
5264
|
for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
|
|
5222
|
-
return
|
|
5265
|
+
return Or._create("endBefore", t,
|
|
5223
5266
|
/*inclusive=*/ !1);
|
|
5224
5267
|
}
|
|
5225
5268
|
|
|
5226
|
-
function
|
|
5269
|
+
function Rr() {
|
|
5227
5270
|
for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
|
|
5228
|
-
return
|
|
5271
|
+
return Or._create("endAt", t,
|
|
5229
5272
|
/*inclusive=*/ !0);
|
|
5230
5273
|
}
|
|
5231
5274
|
|
|
5232
|
-
/** Helper function to create a bound from a document or fields */ function
|
|
5233
|
-
if (n[0] = p(n[0]), n[0] instanceof
|
|
5275
|
+
/** Helper function to create a bound from a document or fields */ function Cr(t, e, n, r) {
|
|
5276
|
+
if (n[0] = p(n[0]), n[0] instanceof hr) return function(t, e, n, r, i) {
|
|
5234
5277
|
if (!r) throw new B(N, "Can't use a DocumentSnapshot that doesn't exist for ".concat(n, "()."));
|
|
5235
5278
|
// Because people expect to continue/end a query at the exact document
|
|
5236
5279
|
// provided, we need to use the implicit sort order rather than the explicit
|
|
@@ -5239,11 +5282,11 @@ function qr() {
|
|
|
5239
5282
|
// the provided document. Without the key (by using the explicit sort
|
|
5240
5283
|
// orders), multiple documents could match the position, yielding duplicate
|
|
5241
5284
|
// results.
|
|
5242
|
-
for (var o = [], a = 0, u =
|
|
5285
|
+
for (var o = [], a = 0, u = Ie(t); a < u.length; a++) {
|
|
5243
5286
|
var s = u[a];
|
|
5244
|
-
if (s.field.isKeyField()) o.push(
|
|
5287
|
+
if (s.field.isKeyField()) o.push(Kt(e, r.key)); else {
|
|
5245
5288
|
var c = r.data.field(s.field);
|
|
5246
|
-
if (
|
|
5289
|
+
if (Rt(c)) throw new B(V, 'Invalid query. You are trying to start or end a query using a document for which the field "' + s.field + '" is an uncommitted server timestamp. (Since the value of this field is unknown, you cannot start/end a query with it.)');
|
|
5247
5290
|
if (null === c) {
|
|
5248
5291
|
var l = s.field.canonicalString();
|
|
5249
5292
|
throw new B(V, "Invalid query. You are trying to start or end a query using a document for which the field '".concat(l, "' (used as the orderBy) does not exist."));
|
|
@@ -5251,9 +5294,9 @@ function qr() {
|
|
|
5251
5294
|
o.push(c);
|
|
5252
5295
|
}
|
|
5253
5296
|
}
|
|
5254
|
-
return new
|
|
5297
|
+
return new Xt(o, i);
|
|
5255
5298
|
}(t._query, t.firestore._databaseId, e, n[0]._document, r);
|
|
5256
|
-
var i =
|
|
5299
|
+
var i = Gn(t.firestore);
|
|
5257
5300
|
return function(t, e, n, r, i, o) {
|
|
5258
5301
|
// Use explicit order by's because it has to match the query the user made
|
|
5259
5302
|
var a = t.explicitOrderBy;
|
|
@@ -5262,36 +5305,36 @@ function qr() {
|
|
|
5262
5305
|
var c = i[s];
|
|
5263
5306
|
if (a[s].field.isKeyField()) {
|
|
5264
5307
|
if ("string" != typeof c) throw new B(V, "Invalid query. Expected a string for document ID in ".concat(r, "(), but got a ").concat(typeof c));
|
|
5265
|
-
if (!
|
|
5308
|
+
if (!Ae(t) && -1 !== c.indexOf("/")) throw new B(V, "Invalid query. When querying a collection and ordering by documentId(), the value passed to ".concat(r, "() must be a plain document ID, but '").concat(c, "' contains a slash."));
|
|
5266
5309
|
var l = t.path.child(et.fromString(c));
|
|
5267
5310
|
if (!it.isDocumentKey(l)) throw new B(V, "Invalid query. When querying a collection group and ordering by documentId(), the value passed to ".concat(r, "() must result in a valid document path, but '").concat(l, "' is not because it contains an odd number of segments."));
|
|
5268
5311
|
var f = new it(l);
|
|
5269
|
-
u.push(
|
|
5312
|
+
u.push(Kt(e, f));
|
|
5270
5313
|
} else {
|
|
5271
|
-
var h =
|
|
5314
|
+
var h = nr(n, r, c);
|
|
5272
5315
|
u.push(h);
|
|
5273
5316
|
}
|
|
5274
5317
|
}
|
|
5275
|
-
return new
|
|
5318
|
+
return new Xt(u, o);
|
|
5276
5319
|
}(t._query, t.firestore._databaseId, i, e, n, r);
|
|
5277
5320
|
}
|
|
5278
5321
|
|
|
5279
|
-
function
|
|
5322
|
+
function xr(t, e, n) {
|
|
5280
5323
|
if ("string" == typeof (n = p(n))) {
|
|
5281
5324
|
if ("" === n) throw new B(V, "Invalid query. When querying with documentId(), you must provide a valid document ID, but it was an empty string.");
|
|
5282
|
-
if (!
|
|
5325
|
+
if (!Ae(e) && -1 !== n.indexOf("/")) throw new B(V, "Invalid query. When querying a collection by documentId(), you must provide a plain document ID, but '".concat(n, "' contains a '/' character."));
|
|
5283
5326
|
var r = e.path.child(et.fromString(n));
|
|
5284
5327
|
if (!it.isDocumentKey(r)) throw new B(V, "Invalid query. When querying a collection group by documentId(), the value provided must result in a valid document path, but '".concat(r, "' is not because it has an odd number of segments (").concat(r.length, ")."));
|
|
5285
|
-
return
|
|
5328
|
+
return Kt(t, new it(r));
|
|
5286
5329
|
}
|
|
5287
|
-
if (n instanceof
|
|
5330
|
+
if (n instanceof In) return Kt(t, n._key);
|
|
5288
5331
|
throw new B(V, "Invalid query. When querying with documentId(), you must provide a valid string or a DocumentReference, but it was: ".concat(st(n), "."));
|
|
5289
5332
|
}
|
|
5290
5333
|
|
|
5291
5334
|
/**
|
|
5292
5335
|
* Validates that the value passed into a disjunctive filter satisfies all
|
|
5293
5336
|
* array requirements.
|
|
5294
|
-
*/ function
|
|
5337
|
+
*/ function Mr(t, e) {
|
|
5295
5338
|
if (!Array.isArray(t) || 0 === t.length) throw new B(V, "Invalid Query. A non-empty array is required for '".concat(e.toString(), "' filters."));
|
|
5296
5339
|
}
|
|
5297
5340
|
|
|
@@ -5304,12 +5347,12 @@ function Cr(t, e, n) {
|
|
|
5304
5347
|
* Operators in a query must adhere to the following set of rules:
|
|
5305
5348
|
* 1. Only one inequality per query.
|
|
5306
5349
|
* 2. `NOT_IN` cannot be used with array, disjunctive, or `NOT_EQUAL` operators.
|
|
5307
|
-
*/ function
|
|
5350
|
+
*/ function Lr(t, e) {
|
|
5308
5351
|
if (e.isInequality()) {
|
|
5309
|
-
var n =
|
|
5352
|
+
var n = ke(t), r = e.field;
|
|
5310
5353
|
if (null !== n && !n.isEqual(r)) throw new B(V, "Invalid query. All where filters with an inequality (<, <=, !=, not-in, >, or >=) must be on the same field. But you have inequality filters on '".concat(n.toString(), "' and '").concat(r.toString(), "'"));
|
|
5311
|
-
var i =
|
|
5312
|
-
null !== i &&
|
|
5354
|
+
var i = Se(t);
|
|
5355
|
+
null !== i && jr(t, r, i);
|
|
5313
5356
|
}
|
|
5314
5357
|
var o = function(t, e) {
|
|
5315
5358
|
for (var n = 0, r = t; n < r.length; n++) for (var i = 0, o = r[n].getFlattenedFilters(); i < o.length; i++) {
|
|
@@ -5338,12 +5381,12 @@ function Cr(t, e, n) {
|
|
|
5338
5381
|
throw o === e.op ? new B(V, "Invalid query. You cannot use more than one '".concat(e.op.toString(), "' filter.")) : new B(V, "Invalid query. You cannot use '".concat(e.op.toString(), "' filters with '").concat(o.toString(), "' filters."));
|
|
5339
5382
|
}
|
|
5340
5383
|
|
|
5341
|
-
function
|
|
5384
|
+
function jr(t, e, n) {
|
|
5342
5385
|
if (!n.isEqual(e)) throw new B(V, "Invalid query. You have a where filter with an inequality (<, <=, !=, not-in, >, or >=) on field '".concat(e.toString(), "' and so you must also use '").concat(e.toString(), "' as your first argument to orderBy(), but your first orderBy() is on field '").concat(n.toString(), "' instead."));
|
|
5343
5386
|
}
|
|
5344
5387
|
|
|
5345
|
-
function
|
|
5346
|
-
if (!(e instanceof
|
|
5388
|
+
function Ur(t, e) {
|
|
5389
|
+
if (!(e instanceof _r || e instanceof Tr)) throw new B(V, "Function ".concat(t, "() requires AppliableConstraints created with a call to 'where(...)', 'or(...)', or 'and(...)'."));
|
|
5347
5390
|
}
|
|
5348
5391
|
|
|
5349
5392
|
/**
|
|
@@ -5370,28 +5413,28 @@ function jr(t, e) {
|
|
|
5370
5413
|
* because we want to provide the user with a more specific error message if
|
|
5371
5414
|
* their `set()` or fails due to invalid data originating from a `toFirestore()`
|
|
5372
5415
|
* call.
|
|
5373
|
-
*/ function
|
|
5416
|
+
*/ function Br(t, e, n) {
|
|
5374
5417
|
// Cast to `any` in order to satisfy the union type constraint on
|
|
5375
5418
|
// toFirestore().
|
|
5376
5419
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5377
5420
|
return t ? n && (n.merge || n.mergeFields) ? t.toFirestore(e, n) : t.toFirestore(e) : e;
|
|
5378
5421
|
}
|
|
5379
5422
|
|
|
5380
|
-
var
|
|
5423
|
+
var zr = /** @class */ function(e) {
|
|
5381
5424
|
function n(t) {
|
|
5382
5425
|
var n = this;
|
|
5383
5426
|
return (n = e.call(this) || this).firestore = t, n;
|
|
5384
5427
|
}
|
|
5385
5428
|
return t(n, e), n.prototype.convertBytes = function(t) {
|
|
5386
|
-
return new
|
|
5429
|
+
return new Rn(t);
|
|
5387
5430
|
}, n.prototype.convertReference = function(t) {
|
|
5388
5431
|
var e = this.convertDocumentKey(t, this.firestore._databaseId);
|
|
5389
|
-
return new
|
|
5432
|
+
return new In(this.firestore, /* converter= */ null, e);
|
|
5390
5433
|
}, n;
|
|
5391
5434
|
}(/** @class */ function() {
|
|
5392
5435
|
function t() {}
|
|
5393
5436
|
return t.prototype.convertValue = function(t, e) {
|
|
5394
|
-
switch (void 0 === e && (e = "none"),
|
|
5437
|
+
switch (void 0 === e && (e = "none"), Lt(t)) {
|
|
5395
5438
|
case 0 /* TypeOrder.NullValue */ :
|
|
5396
5439
|
return null;
|
|
5397
5440
|
|
|
@@ -5399,7 +5442,7 @@ var Br = /** @class */ function(e) {
|
|
|
5399
5442
|
return t.booleanValue;
|
|
5400
5443
|
|
|
5401
5444
|
case 2 /* TypeOrder.NumberValue */ :
|
|
5402
|
-
return
|
|
5445
|
+
return Nt(t.integerValue || t.doubleValue);
|
|
5403
5446
|
|
|
5404
5447
|
case 3 /* TypeOrder.TimestampValue */ :
|
|
5405
5448
|
return this.convertTimestamp(t.timestampValue);
|
|
@@ -5411,7 +5454,7 @@ var Br = /** @class */ function(e) {
|
|
|
5411
5454
|
return t.stringValue;
|
|
5412
5455
|
|
|
5413
5456
|
case 6 /* TypeOrder.BlobValue */ :
|
|
5414
|
-
return this.convertBytes(
|
|
5457
|
+
return this.convertBytes(Ot(t.bytesValue));
|
|
5415
5458
|
|
|
5416
5459
|
case 7 /* TypeOrder.RefValue */ :
|
|
5417
5460
|
return this.convertReference(t.referenceValue);
|
|
@@ -5430,11 +5473,11 @@ var Br = /** @class */ function(e) {
|
|
|
5430
5473
|
}
|
|
5431
5474
|
}, t.prototype.convertObject = function(t, e) {
|
|
5432
5475
|
var n = this, r = {};
|
|
5433
|
-
return
|
|
5476
|
+
return It(t.fields, (function(t, i) {
|
|
5434
5477
|
r[t] = n.convertValue(i, e);
|
|
5435
5478
|
})), r;
|
|
5436
5479
|
}, t.prototype.convertGeoPoint = function(t) {
|
|
5437
|
-
return new
|
|
5480
|
+
return new Ln(Nt(t.latitude), Nt(t.longitude));
|
|
5438
5481
|
}, t.prototype.convertArray = function(t, e) {
|
|
5439
5482
|
var n = this;
|
|
5440
5483
|
return (t.values || []).map((function(t) {
|
|
@@ -5443,21 +5486,21 @@ var Br = /** @class */ function(e) {
|
|
|
5443
5486
|
}, t.prototype.convertServerTimestamp = function(t, e) {
|
|
5444
5487
|
switch (e) {
|
|
5445
5488
|
case "previous":
|
|
5446
|
-
var n =
|
|
5489
|
+
var n = Ct(t);
|
|
5447
5490
|
return null == n ? null : this.convertValue(n, e);
|
|
5448
5491
|
|
|
5449
5492
|
case "estimate":
|
|
5450
|
-
return this.convertTimestamp(
|
|
5493
|
+
return this.convertTimestamp(xt(t));
|
|
5451
5494
|
|
|
5452
5495
|
default:
|
|
5453
5496
|
return null;
|
|
5454
5497
|
}
|
|
5455
5498
|
}, t.prototype.convertTimestamp = function(t) {
|
|
5456
|
-
var e =
|
|
5457
|
-
return new
|
|
5499
|
+
var e = Dt(t);
|
|
5500
|
+
return new qt(e.seconds, e.nanos);
|
|
5458
5501
|
}, t.prototype.convertDocumentKey = function(t, e) {
|
|
5459
5502
|
var n = et.fromString(t);
|
|
5460
|
-
A(
|
|
5503
|
+
A(fn(n));
|
|
5461
5504
|
var r = new $(n.get(1), n.get(3)), i = new it(n.popFirst(5));
|
|
5462
5505
|
return r.isEqual(e) ||
|
|
5463
5506
|
// TODO(b/64130202): Somehow support foreign references.
|
|
@@ -5478,12 +5521,12 @@ var Br = /** @class */ function(e) {
|
|
|
5478
5521
|
* @param reference - The reference of the document to fetch.
|
|
5479
5522
|
* @returns A Promise resolved with a `DocumentSnapshot` containing the current
|
|
5480
5523
|
* document contents.
|
|
5481
|
-
*/ function
|
|
5482
|
-
var e =
|
|
5483
|
-
return
|
|
5524
|
+
*/ function Kr(t) {
|
|
5525
|
+
var e = gn((t = ct(t, In)).firestore), n = new zr(t.firestore);
|
|
5526
|
+
return mn(e, [ t._key ]).then((function(e) {
|
|
5484
5527
|
A(1 === e.length);
|
|
5485
5528
|
var r = e[0];
|
|
5486
|
-
return new
|
|
5529
|
+
return new hr(t.firestore, n, t._key, r.isFoundDocument() ? r : null, t.converter);
|
|
5487
5530
|
}));
|
|
5488
5531
|
}
|
|
5489
5532
|
|
|
@@ -5498,18 +5541,18 @@ var Br = /** @class */ function(e) {
|
|
|
5498
5541
|
*
|
|
5499
5542
|
* @param query - The `Query` to execute.
|
|
5500
5543
|
* @returns A Promise that will be resolved with the results of the query.
|
|
5501
|
-
*/ function
|
|
5544
|
+
*/ function Qr(t) {
|
|
5502
5545
|
!function(t) {
|
|
5503
5546
|
if ("L" /* LimitType.Last */ === t.limitType && 0 === t.explicitOrderBy.length) throw new B(L, "limitToLast() queries require specifying at least one orderBy() clause");
|
|
5504
|
-
}((t = ct(t,
|
|
5505
|
-
var r =
|
|
5547
|
+
}((t = ct(t, Fn))._query);
|
|
5548
|
+
var r = gn(t.firestore), i = new zr(t.firestore);
|
|
5506
5549
|
return function(t, r) {
|
|
5507
5550
|
return e(this, void 0, void 0, (function() {
|
|
5508
5551
|
var e, i;
|
|
5509
5552
|
return n(this, (function(n) {
|
|
5510
5553
|
switch (n.label) {
|
|
5511
5554
|
case 0:
|
|
5512
|
-
return e = I(t), i =
|
|
5555
|
+
return e = I(t), i = rn(e.M, Fe(r)), [ 4 /*yield*/ , e.P("RunQuery", i.parent, {
|
|
5513
5556
|
structuredQuery: i.structuredQuery
|
|
5514
5557
|
}) ];
|
|
5515
5558
|
|
|
@@ -5518,12 +5561,12 @@ var Br = /** @class */ function(e) {
|
|
|
5518
5561
|
return !!t.document;
|
|
5519
5562
|
})).map((function(t) {
|
|
5520
5563
|
return function(t, e, n) {
|
|
5521
|
-
var r =
|
|
5564
|
+
var r = $e(t, e.name), i = Xe(e.updateTime), o = e.createTime ? Xe(e.createTime) : he.min(), a = new we({
|
|
5522
5565
|
mapValue: {
|
|
5523
5566
|
fields: e.fields
|
|
5524
5567
|
}
|
|
5525
5568
|
});
|
|
5526
|
-
return
|
|
5569
|
+
return _e.newFoundDocument(r, i, o, a);
|
|
5527
5570
|
}(e.M, t.document);
|
|
5528
5571
|
})) ];
|
|
5529
5572
|
}
|
|
@@ -5531,28 +5574,28 @@ var Br = /** @class */ function(e) {
|
|
|
5531
5574
|
}));
|
|
5532
5575
|
}(r, t._query).then((function(e) {
|
|
5533
5576
|
var n = e.map((function(e) {
|
|
5534
|
-
return new
|
|
5577
|
+
return new pr(t.firestore, i, e.key, e, t.converter);
|
|
5535
5578
|
}));
|
|
5536
5579
|
return "L" /* LimitType.Last */ === t._query.limitType &&
|
|
5537
5580
|
// Limit to last queries reverse the orderBy constraint that was
|
|
5538
5581
|
// specified by the user. As such, we need to reverse the order of the
|
|
5539
5582
|
// results to return the documents in the expected order.
|
|
5540
|
-
n.reverse(), new
|
|
5583
|
+
n.reverse(), new dr(t, n);
|
|
5541
5584
|
}));
|
|
5542
5585
|
}
|
|
5543
5586
|
|
|
5544
|
-
function
|
|
5545
|
-
var r =
|
|
5546
|
-
return
|
|
5587
|
+
function Gr(t, e, n) {
|
|
5588
|
+
var r = Br((t = ct(t, In)).converter, e, n), i = Yn(Gn(t.firestore), "setDoc", t._key, r, null !== t.converter, n);
|
|
5589
|
+
return yn(gn(t.firestore), [ i.toMutation(t._key, xe.none()) ]);
|
|
5547
5590
|
}
|
|
5548
5591
|
|
|
5549
|
-
function
|
|
5592
|
+
function Yr(t, e, n) {
|
|
5550
5593
|
for (var r = [], i = 3; i < arguments.length; i++) r[i - 3] = arguments[i];
|
|
5551
|
-
var o, a =
|
|
5594
|
+
var o, a = Gn((t = ct(t, In)).firestore);
|
|
5552
5595
|
// For Compat types, we have to "extract" the underlying types before
|
|
5553
5596
|
// performing validation.
|
|
5554
|
-
return o = "string" == typeof (e = p(e)) || e instanceof
|
|
5555
|
-
|
|
5597
|
+
return o = "string" == typeof (e = p(e)) || e instanceof Cn ? er(a, "updateDoc", t._key, e, n, r) : tr(a, "updateDoc", t._key, e),
|
|
5598
|
+
yn(gn(t.firestore), [ o.toMutation(t._key, xe.exists(!0)) ]);
|
|
5556
5599
|
}
|
|
5557
5600
|
|
|
5558
5601
|
/**
|
|
@@ -5566,8 +5609,8 @@ function Gr(t, e, n) {
|
|
|
5566
5609
|
* @param reference - A reference to the document to delete.
|
|
5567
5610
|
* @returns A `Promise` resolved once the document has been successfully
|
|
5568
5611
|
* deleted from the backend.
|
|
5569
|
-
*/ function
|
|
5570
|
-
return
|
|
5612
|
+
*/ function Wr(t) {
|
|
5613
|
+
return yn(gn((t = ct(t, In)).firestore), [ new Ue(t._key, xe.none()) ]);
|
|
5571
5614
|
}
|
|
5572
5615
|
|
|
5573
5616
|
/**
|
|
@@ -5584,9 +5627,9 @@ function Gr(t, e, n) {
|
|
|
5584
5627
|
* @throws Error - If the provided input is not a valid Firestore document.
|
|
5585
5628
|
* @returns A `Promise` resolved with a `DocumentReference` pointing to the
|
|
5586
5629
|
* newly created document after it has been written to the backend.
|
|
5587
|
-
*/ function
|
|
5588
|
-
var n =
|
|
5589
|
-
return
|
|
5630
|
+
*/ function Hr(t, e) {
|
|
5631
|
+
var n = Nn(t = ct(t, Pn)), r = Br(t.converter, e), i = Yn(Gn(t.firestore), "addDoc", n._key, r, null !== n.converter, {});
|
|
5632
|
+
return yn(gn(t.firestore), [ i.toMutation(n._key, xe.exists(!1)) ]).then((function() {
|
|
5590
5633
|
return n;
|
|
5591
5634
|
}));
|
|
5592
5635
|
}
|
|
@@ -5620,9 +5663,9 @@ function Gr(t, e, n) {
|
|
|
5620
5663
|
* @returns A Promise that will be resolved with the count; the count can be
|
|
5621
5664
|
* retrieved from `snapshot.data().count`, where `snapshot` is the
|
|
5622
5665
|
* `AggregateQuerySnapshot` to which the returned Promise resolves.
|
|
5623
|
-
*/ function
|
|
5624
|
-
return
|
|
5625
|
-
count:
|
|
5666
|
+
*/ function Xr(t) {
|
|
5667
|
+
return Jr(t, {
|
|
5668
|
+
count: ti()
|
|
5626
5669
|
});
|
|
5627
5670
|
}
|
|
5628
5671
|
|
|
@@ -5652,13 +5695,13 @@ function Gr(t, e, n) {
|
|
|
5652
5695
|
* const averageScore: number | null = aggregateSnapshot.data().averageScore;
|
|
5653
5696
|
* ```
|
|
5654
5697
|
* @internal TODO (sum/avg) remove when public
|
|
5655
|
-
*/ function
|
|
5656
|
-
var i = ct(t.firestore,
|
|
5698
|
+
*/ function Jr(t, r) {
|
|
5699
|
+
var i = ct(t.firestore, _n), o = gn(i), a = function(t, e) {
|
|
5657
5700
|
var n = [];
|
|
5658
5701
|
for (var r in t) Object.prototype.hasOwnProperty.call(t, r) && n.push(e(t[r], r));
|
|
5659
5702
|
return n;
|
|
5660
5703
|
}(r, (function(t, e) {
|
|
5661
|
-
return new
|
|
5704
|
+
return new bt(new _t(e), t._aggregateType, t._internalFieldPath);
|
|
5662
5705
|
}));
|
|
5663
5706
|
// Run the aggregation and convert the results
|
|
5664
5707
|
return function(t, r, i) {
|
|
@@ -5668,7 +5711,7 @@ function Gr(t, e, n) {
|
|
|
5668
5711
|
switch (n.label) {
|
|
5669
5712
|
case 0:
|
|
5670
5713
|
return e = I(t), o = function(t, e, n) {
|
|
5671
|
-
var r =
|
|
5714
|
+
var r = rn(t, e), i = [];
|
|
5672
5715
|
return n.forEach((function(t) {
|
|
5673
5716
|
"count" === t.N ? i.push({
|
|
5674
5717
|
alias: t.alias.canonicalString(),
|
|
@@ -5676,12 +5719,12 @@ function Gr(t, e, n) {
|
|
|
5676
5719
|
}) : "avg" === t.N ? i.push({
|
|
5677
5720
|
alias: t.alias.canonicalString(),
|
|
5678
5721
|
avg: {
|
|
5679
|
-
field:
|
|
5722
|
+
field: sn(t.fieldPath)
|
|
5680
5723
|
}
|
|
5681
5724
|
}) : "sum" === t.N && i.push({
|
|
5682
5725
|
alias: t.alias.canonicalString(),
|
|
5683
5726
|
sum: {
|
|
5684
|
-
field:
|
|
5727
|
+
field: sn(t.fieldPath)
|
|
5685
5728
|
}
|
|
5686
5729
|
});
|
|
5687
5730
|
})), {
|
|
@@ -5691,14 +5734,14 @@ function Gr(t, e, n) {
|
|
|
5691
5734
|
},
|
|
5692
5735
|
parent: r.parent
|
|
5693
5736
|
};
|
|
5694
|
-
}(e.M,
|
|
5737
|
+
}(e.M, Fe(r), i), a = o.parent, e.connection.v || delete o.parent, [ 4 /*yield*/ , e.P("RunAggregationQuery", a, o, /*expectedResponseCount=*/ 1) ];
|
|
5695
5738
|
|
|
5696
5739
|
case 1:
|
|
5697
5740
|
// Omit RunAggregationQueryResponse that only contain readTimes.
|
|
5698
5741
|
return u = n.sent().filter((function(t) {
|
|
5699
5742
|
return !!t.result;
|
|
5700
5743
|
})), [ 2 /*return*/ , (A(1 === u.length), (s = u[0]).result, s.result.aggregateFields,
|
|
5701
|
-
new
|
|
5744
|
+
new we({
|
|
5702
5745
|
mapValue: {
|
|
5703
5746
|
fields: null === (c = s.result) || void 0 === c ? void 0 : c.aggregateFields
|
|
5704
5747
|
}
|
|
@@ -5708,14 +5751,14 @@ function Gr(t, e, n) {
|
|
|
5708
5751
|
}));
|
|
5709
5752
|
}(o, t._query, a).then((function(e) {
|
|
5710
5753
|
return function(t, e, n) {
|
|
5711
|
-
var r = new
|
|
5712
|
-
return new
|
|
5754
|
+
var r = new zr(t);
|
|
5755
|
+
return new An(e, r, n);
|
|
5713
5756
|
}(i, t, e);
|
|
5714
5757
|
}));
|
|
5715
5758
|
}
|
|
5716
5759
|
|
|
5717
|
-
function
|
|
5718
|
-
return new
|
|
5760
|
+
function Zr(t) {
|
|
5761
|
+
return new kn("sum", ur("sum", t));
|
|
5719
5762
|
}
|
|
5720
5763
|
|
|
5721
5764
|
/**
|
|
@@ -5723,16 +5766,16 @@ function Jr(t) {
|
|
|
5723
5766
|
* a specified field over a range of documents in the result set of a query.
|
|
5724
5767
|
* @param field Specifies the field to average across the result set.
|
|
5725
5768
|
* @internal TODO (sum/avg) remove when public
|
|
5726
|
-
*/ function
|
|
5727
|
-
return new
|
|
5769
|
+
*/ function $r(t) {
|
|
5770
|
+
return new kn("avg", ur("average", t));
|
|
5728
5771
|
}
|
|
5729
5772
|
|
|
5730
5773
|
/**
|
|
5731
5774
|
* Create an AggregateField object that can be used to compute the count of
|
|
5732
5775
|
* documents in the result set of a query.
|
|
5733
5776
|
* @internal TODO (sum/avg) remove when public
|
|
5734
|
-
*/ function
|
|
5735
|
-
return new
|
|
5777
|
+
*/ function ti() {
|
|
5778
|
+
return new kn("count");
|
|
5736
5779
|
}
|
|
5737
5780
|
|
|
5738
5781
|
/**
|
|
@@ -5741,9 +5784,9 @@ function Jr(t) {
|
|
|
5741
5784
|
* @param left Compare this AggregateField to the `right`.
|
|
5742
5785
|
* @param right Compare this AggregateField to the `left`.
|
|
5743
5786
|
* @internal TODO (sum/avg) remove when public
|
|
5744
|
-
*/ function
|
|
5787
|
+
*/ function ei(t, e) {
|
|
5745
5788
|
var n, r;
|
|
5746
|
-
return t instanceof
|
|
5789
|
+
return t instanceof kn && e instanceof kn && t._aggregateType === e._aggregateType && (null === (n = t._internalFieldPath) || void 0 === n ? void 0 : n.canonicalString()) === (null === (r = e._internalFieldPath) || void 0 === r ? void 0 : r.canonicalString());
|
|
5747
5790
|
}
|
|
5748
5791
|
|
|
5749
5792
|
/**
|
|
@@ -5757,8 +5800,8 @@ function Jr(t) {
|
|
|
5757
5800
|
*
|
|
5758
5801
|
* @returns `true` if the objects are "equal", as defined above, or `false`
|
|
5759
5802
|
* otherwise.
|
|
5760
|
-
*/ function
|
|
5761
|
-
return
|
|
5803
|
+
*/ function ni(t, e) {
|
|
5804
|
+
return qn(t.query, e.query) && m(t.data(), e.data());
|
|
5762
5805
|
}
|
|
5763
5806
|
|
|
5764
5807
|
/**
|
|
@@ -5780,15 +5823,15 @@ function Jr(t) {
|
|
|
5780
5823
|
/**
|
|
5781
5824
|
* Returns a sentinel for use with {@link @firebase/firestore/lite#(updateDoc:1)} or
|
|
5782
5825
|
* {@link @firebase/firestore/lite#(setDoc:1)} with `{merge: true}` to mark a field for deletion.
|
|
5783
|
-
*/ function
|
|
5784
|
-
return new
|
|
5826
|
+
*/ function ri() {
|
|
5827
|
+
return new Wn("deleteField");
|
|
5785
5828
|
}
|
|
5786
5829
|
|
|
5787
5830
|
/**
|
|
5788
5831
|
* Returns a sentinel used with {@link @firebase/firestore/lite#(setDoc:1)} or {@link @firebase/firestore/lite#(updateDoc:1)} to
|
|
5789
5832
|
* include a server-generated timestamp in the written data.
|
|
5790
|
-
*/ function
|
|
5791
|
-
return new
|
|
5833
|
+
*/ function ii() {
|
|
5834
|
+
return new Xn("serverTimestamp");
|
|
5792
5835
|
}
|
|
5793
5836
|
|
|
5794
5837
|
/**
|
|
@@ -5802,11 +5845,11 @@ function Jr(t) {
|
|
|
5802
5845
|
* @param elements - The elements to union into the array.
|
|
5803
5846
|
* @returns The `FieldValue` sentinel for use in a call to `setDoc()` or
|
|
5804
5847
|
* `updateDoc()`.
|
|
5805
|
-
*/ function
|
|
5848
|
+
*/ function oi() {
|
|
5806
5849
|
for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
|
|
5807
5850
|
// NOTE: We don't actually parse the data until it's used in set() or
|
|
5808
5851
|
// update() since we'd need the Firestore instance to do this.
|
|
5809
|
-
return new
|
|
5852
|
+
return new Jn("arrayUnion", t);
|
|
5810
5853
|
}
|
|
5811
5854
|
|
|
5812
5855
|
/**
|
|
@@ -5819,11 +5862,11 @@ function Jr(t) {
|
|
|
5819
5862
|
* @param elements - The elements to remove from the array.
|
|
5820
5863
|
* @returns The `FieldValue` sentinel for use in a call to `setDoc()` or
|
|
5821
5864
|
* `updateDoc()`
|
|
5822
|
-
*/ function
|
|
5865
|
+
*/ function ai() {
|
|
5823
5866
|
for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
|
|
5824
5867
|
// NOTE: We don't actually parse the data until it's used in set() or
|
|
5825
5868
|
// update() since we'd need the Firestore instance to do this.
|
|
5826
|
-
return new
|
|
5869
|
+
return new Zn("arrayRemove", t);
|
|
5827
5870
|
}
|
|
5828
5871
|
|
|
5829
5872
|
/**
|
|
@@ -5844,8 +5887,8 @@ function Jr(t) {
|
|
|
5844
5887
|
* @param n - The value to increment by.
|
|
5845
5888
|
* @returns The `FieldValue` sentinel for use in a call to `setDoc()` or
|
|
5846
5889
|
* `updateDoc()`
|
|
5847
|
-
*/ function
|
|
5848
|
-
return new
|
|
5890
|
+
*/ function ui(t) {
|
|
5891
|
+
return new $n("increment", t);
|
|
5849
5892
|
}
|
|
5850
5893
|
|
|
5851
5894
|
/**
|
|
@@ -5871,24 +5914,24 @@ function Jr(t) {
|
|
|
5871
5914
|
* provides methods for adding writes to the write batch. None of the writes
|
|
5872
5915
|
* will be committed (or visible locally) until {@link WriteBatch.commit} is
|
|
5873
5916
|
* called.
|
|
5874
|
-
*/ var
|
|
5917
|
+
*/ var si = /** @class */ function() {
|
|
5875
5918
|
/** @hideconstructor */
|
|
5876
5919
|
function t(t, e) {
|
|
5877
5920
|
this._firestore = t, this._commitHandler = e, this._mutations = [], this._committed = !1,
|
|
5878
|
-
this._dataReader =
|
|
5921
|
+
this._dataReader = Gn(t);
|
|
5879
5922
|
}
|
|
5880
5923
|
return t.prototype.set = function(t, e, n) {
|
|
5881
5924
|
this._verifyNotCommitted();
|
|
5882
|
-
var r =
|
|
5883
|
-
return this._mutations.push(o.toMutation(r._key,
|
|
5925
|
+
var r = ci(t, this._firestore), i = Br(r.converter, e, n), o = Yn(this._dataReader, "WriteBatch.set", r._key, i, null !== r.converter, n);
|
|
5926
|
+
return this._mutations.push(o.toMutation(r._key, xe.none())), this;
|
|
5884
5927
|
}, t.prototype.update = function(t, e, n) {
|
|
5885
5928
|
for (var r = [], i = 3; i < arguments.length; i++) r[i - 3] = arguments[i];
|
|
5886
5929
|
this._verifyNotCommitted();
|
|
5887
|
-
var o, a =
|
|
5930
|
+
var o, a = ci(t, this._firestore);
|
|
5888
5931
|
// For Compat types, we have to "extract" the underlying types before
|
|
5889
5932
|
// performing validation.
|
|
5890
|
-
return o = "string" == typeof (e = p(e)) || e instanceof
|
|
5891
|
-
this._mutations.push(o.toMutation(a._key,
|
|
5933
|
+
return o = "string" == typeof (e = p(e)) || e instanceof Cn ? er(this._dataReader, "WriteBatch.update", a._key, e, n, r) : tr(this._dataReader, "WriteBatch.update", a._key, e),
|
|
5934
|
+
this._mutations.push(o.toMutation(a._key, xe.exists(!0))), this;
|
|
5892
5935
|
},
|
|
5893
5936
|
/**
|
|
5894
5937
|
* Deletes the document referred to by the provided {@link DocumentReference}.
|
|
@@ -5898,8 +5941,8 @@ function Jr(t) {
|
|
|
5898
5941
|
*/
|
|
5899
5942
|
t.prototype.delete = function(t) {
|
|
5900
5943
|
this._verifyNotCommitted();
|
|
5901
|
-
var e =
|
|
5902
|
-
return this._mutations = this._mutations.concat(new
|
|
5944
|
+
var e = ci(t, this._firestore);
|
|
5945
|
+
return this._mutations = this._mutations.concat(new Ue(e._key, xe.none())), this;
|
|
5903
5946
|
},
|
|
5904
5947
|
/**
|
|
5905
5948
|
* Commits all of the writes in this write batch as a single atomic unit.
|
|
@@ -5920,7 +5963,7 @@ function Jr(t) {
|
|
|
5920
5963
|
}, t;
|
|
5921
5964
|
}();
|
|
5922
5965
|
|
|
5923
|
-
function
|
|
5966
|
+
function ci(t, e) {
|
|
5924
5967
|
if ((t = p(t)).firestore !== e) throw new B(V, "Provided document reference is from a different Firestore instance.");
|
|
5925
5968
|
return t;
|
|
5926
5969
|
}
|
|
@@ -5937,10 +5980,10 @@ function si(t, e) {
|
|
|
5937
5980
|
*
|
|
5938
5981
|
* @returns A `WriteBatch` that can be used to atomically execute multiple
|
|
5939
5982
|
* writes.
|
|
5940
|
-
*/ function
|
|
5941
|
-
var e =
|
|
5942
|
-
return new
|
|
5943
|
-
return
|
|
5983
|
+
*/ function li(t) {
|
|
5984
|
+
var e = gn(t = ct(t, _n));
|
|
5985
|
+
return new si(t, (function(t) {
|
|
5986
|
+
return yn(e, t);
|
|
5944
5987
|
}));
|
|
5945
5988
|
}
|
|
5946
5989
|
|
|
@@ -5963,7 +6006,7 @@ function si(t, e) {
|
|
|
5963
6006
|
/**
|
|
5964
6007
|
* Internal transaction object responsible for accumulating the mutations to
|
|
5965
6008
|
* perform and the base versions for any documents read.
|
|
5966
|
-
*/ var
|
|
6009
|
+
*/ var fi = /** @class */ function() {
|
|
5967
6010
|
function t(t) {
|
|
5968
6011
|
this.datastore = t,
|
|
5969
6012
|
// The version of each document that was read during this transaction.
|
|
@@ -5988,7 +6031,7 @@ function si(t, e) {
|
|
|
5988
6031
|
switch (n.label) {
|
|
5989
6032
|
case 0:
|
|
5990
6033
|
if (this.ensureCommitNotCalled(), this.mutations.length > 0) throw new B(V, "Firestore transactions require all reads to be executed before all writes.");
|
|
5991
|
-
return [ 4 /*yield*/ ,
|
|
6034
|
+
return [ 4 /*yield*/ , mn(this.datastore, t) ];
|
|
5992
6035
|
|
|
5993
6036
|
case 1:
|
|
5994
6037
|
return [ 2 /*return*/ , ((e = n.sent()).forEach((function(t) {
|
|
@@ -6007,7 +6050,7 @@ function si(t, e) {
|
|
|
6007
6050
|
}
|
|
6008
6051
|
this.writtenDocs.add(t.toString());
|
|
6009
6052
|
}, t.prototype.delete = function(t) {
|
|
6010
|
-
this.write(new
|
|
6053
|
+
this.write(new Ue(t, this.precondition(t))), this.writtenDocs.add(t.toString());
|
|
6011
6054
|
}, t.prototype.commit = function() {
|
|
6012
6055
|
return e(this, void 0, void 0, (function() {
|
|
6013
6056
|
var t, e = this;
|
|
@@ -6024,8 +6067,8 @@ function si(t, e) {
|
|
|
6024
6067
|
// a `verify` operation.
|
|
6025
6068
|
t.forEach((function(t, n) {
|
|
6026
6069
|
var r = it.fromPath(n);
|
|
6027
|
-
e.mutations.push(new
|
|
6028
|
-
})), [ 4 /*yield*/ ,
|
|
6070
|
+
e.mutations.push(new Be(r, e.precondition(r)));
|
|
6071
|
+
})), [ 4 /*yield*/ , yn(this.datastore, this.mutations) ];
|
|
6029
6072
|
|
|
6030
6073
|
case 1:
|
|
6031
6074
|
// For each mutation, note that the doc was written.
|
|
@@ -6038,7 +6081,7 @@ function si(t, e) {
|
|
|
6038
6081
|
if (t.isFoundDocument()) e = t.version; else {
|
|
6039
6082
|
if (!t.isNoDocument()) throw k();
|
|
6040
6083
|
// Represent a deleted doc using SnapshotVersion.min().
|
|
6041
|
-
e =
|
|
6084
|
+
e = he.min();
|
|
6042
6085
|
}
|
|
6043
6086
|
var n = this.readVersions.get(t.key.toString());
|
|
6044
6087
|
if (n) {
|
|
@@ -6053,7 +6096,7 @@ function si(t, e) {
|
|
|
6053
6096
|
*/
|
|
6054
6097
|
t.prototype.precondition = function(t) {
|
|
6055
6098
|
var e = this.readVersions.get(t.toString());
|
|
6056
|
-
return !this.writtenDocs.has(t.toString()) && e ? e.isEqual(
|
|
6099
|
+
return !this.writtenDocs.has(t.toString()) && e ? e.isEqual(he.min()) ? xe.exists(!1) : xe.updateTime(e) : xe.none();
|
|
6057
6100
|
},
|
|
6058
6101
|
/**
|
|
6059
6102
|
* Returns the precondition for a document if the operation is an update.
|
|
@@ -6063,7 +6106,7 @@ function si(t, e) {
|
|
|
6063
6106
|
// The first time a document is written, we want to take into account the
|
|
6064
6107
|
// read time and existence
|
|
6065
6108
|
if (!this.writtenDocs.has(t.toString()) && e) {
|
|
6066
|
-
if (e.isEqual(
|
|
6109
|
+
if (e.isEqual(he.min()))
|
|
6067
6110
|
// The document doesn't exist, so fail the transaction.
|
|
6068
6111
|
// This has to be validated locally because you can't send a
|
|
6069
6112
|
// precondition that a document does not exist without changing the
|
|
@@ -6075,20 +6118,20 @@ function si(t, e) {
|
|
|
6075
6118
|
// transaction.
|
|
6076
6119
|
throw new B(V, "Can't update a document that doesn't exist.");
|
|
6077
6120
|
// Document exists, base precondition on document update time.
|
|
6078
|
-
return
|
|
6121
|
+
return xe.updateTime(e);
|
|
6079
6122
|
}
|
|
6080
6123
|
// Document was not read, so we just use the preconditions for a blind
|
|
6081
6124
|
// update.
|
|
6082
|
-
return
|
|
6125
|
+
return xe.exists(!0);
|
|
6083
6126
|
}, t.prototype.write = function(t) {
|
|
6084
6127
|
this.ensureCommitNotCalled(), this.mutations.push(t);
|
|
6085
6128
|
}, t.prototype.ensureCommitNotCalled = function() {}, t;
|
|
6086
|
-
}(),
|
|
6129
|
+
}(), hi = {
|
|
6087
6130
|
maxAttempts: 5
|
|
6088
|
-
},
|
|
6131
|
+
}, pi = /** @class */ function() {
|
|
6089
6132
|
function t(t, e, n, r, i) {
|
|
6090
6133
|
this.asyncQueue = t, this.datastore = e, this.options = n, this.updateFunction = r,
|
|
6091
|
-
this.deferred = i, this._t = n.maxAttempts, this.vt = new
|
|
6134
|
+
this.deferred = i, this._t = n.maxAttempts, this.vt = new pn(this.asyncQueue, "transaction_retry" /* TimerId.TransactionRetry */)
|
|
6092
6135
|
/** Runs the transaction and sets the result on deferred. */;
|
|
6093
6136
|
}
|
|
6094
6137
|
return t.prototype.run = function() {
|
|
@@ -6099,7 +6142,7 @@ function si(t, e) {
|
|
|
6099
6142
|
return e(t, void 0, void 0, (function() {
|
|
6100
6143
|
var t, e, r = this;
|
|
6101
6144
|
return n(this, (function(n) {
|
|
6102
|
-
return t = new
|
|
6145
|
+
return t = new fi(this.datastore), (e = this.Et(t)) && e.then((function(e) {
|
|
6103
6146
|
r.asyncQueue.enqueueAndForget((function() {
|
|
6104
6147
|
return t.commit().then((function() {
|
|
6105
6148
|
r.deferred.resolve(e);
|
|
@@ -6116,7 +6159,7 @@ function si(t, e) {
|
|
|
6116
6159
|
}, t.prototype.Et = function(t) {
|
|
6117
6160
|
try {
|
|
6118
6161
|
var e = this.updateFunction(t);
|
|
6119
|
-
return !
|
|
6162
|
+
return !ht(e) && e.catch && e.then ? e : (this.deferred.reject(Error("Transaction callback must return a Promise")),
|
|
6120
6163
|
null);
|
|
6121
6164
|
} catch (t) {
|
|
6122
6165
|
// Do not retry errors thrown by user provided updateFunction.
|
|
@@ -6207,7 +6250,7 @@ function si(t, e) {
|
|
|
6207
6250
|
* See the License for the specific language governing permissions and
|
|
6208
6251
|
* limitations under the License.
|
|
6209
6252
|
*/
|
|
6210
|
-
/** The Platform's 'document' implementation or null if not available. */ function
|
|
6253
|
+
/** The Platform's 'document' implementation or null if not available. */ function di() {
|
|
6211
6254
|
// `document` is not always available, e.g. in ReactNative and WebWorkers.
|
|
6212
6255
|
// eslint-disable-next-line no-restricted-globals
|
|
6213
6256
|
return "undefined" != typeof document ? document : null;
|
|
@@ -6239,7 +6282,7 @@ function si(t, e) {
|
|
|
6239
6282
|
* Note: We implement `PromiseLike` instead of `Promise`, as the `Promise` type
|
|
6240
6283
|
* in newer versions of TypeScript defines `finally`, which is not available in
|
|
6241
6284
|
* IE.
|
|
6242
|
-
*/ var
|
|
6285
|
+
*/ var yi, mi = /** @class */ function() {
|
|
6243
6286
|
function t(t, e, n, r, i) {
|
|
6244
6287
|
this.asyncQueue = t, this.timerId = e, this.targetTimeMs = n, this.op = r, this.removalCallback = i,
|
|
6245
6288
|
this.deferred = new z, this.then = this.deferred.promise.then.bind(this.deferred.promise),
|
|
@@ -6303,7 +6346,7 @@ function si(t, e) {
|
|
|
6303
6346
|
null !== this.timerHandle && (this.removalCallback(this), clearTimeout(this.timerHandle),
|
|
6304
6347
|
this.timerHandle = null);
|
|
6305
6348
|
}, t;
|
|
6306
|
-
}(),
|
|
6349
|
+
}(), vi = /** @class */ function() {
|
|
6307
6350
|
function t() {
|
|
6308
6351
|
var t = this;
|
|
6309
6352
|
// The last promise in the queue.
|
|
@@ -6327,15 +6370,15 @@ function si(t, e) {
|
|
|
6327
6370
|
// List of TimerIds to fast-forward delays for.
|
|
6328
6371
|
this.Ft = [],
|
|
6329
6372
|
// Backoff timer used to schedule retries for retryable operations
|
|
6330
|
-
this.vt = new
|
|
6373
|
+
this.vt = new pn(this, "async_queue_retry" /* TimerId.AsyncQueueRetry */),
|
|
6331
6374
|
// Visibility handler that triggers an immediate retry of all retryable
|
|
6332
6375
|
// operations. Meant to speed up recovery when we regain file system access
|
|
6333
6376
|
// after page comes into foreground.
|
|
6334
6377
|
this.xt = function() {
|
|
6335
|
-
var e =
|
|
6378
|
+
var e = di();
|
|
6336
6379
|
e && b("AsyncQueue", "Visibility state changed to " + e.visibilityState), t.vt.tt();
|
|
6337
6380
|
};
|
|
6338
|
-
var e =
|
|
6381
|
+
var e = di();
|
|
6339
6382
|
e && "function" == typeof e.addEventListener && e.addEventListener("visibilitychange", this.xt);
|
|
6340
6383
|
}
|
|
6341
6384
|
return Object.defineProperty(t.prototype, "isShuttingDown", {
|
|
@@ -6359,7 +6402,7 @@ function si(t, e) {
|
|
|
6359
6402
|
}, t.prototype.enterRestrictedMode = function(t) {
|
|
6360
6403
|
if (!this.Pt) {
|
|
6361
6404
|
this.Pt = !0, this.Nt = t || !1;
|
|
6362
|
-
var e =
|
|
6405
|
+
var e = di();
|
|
6363
6406
|
e && "function" == typeof e.removeEventListener && e.removeEventListener("visibilitychange", this.xt);
|
|
6364
6407
|
}
|
|
6365
6408
|
}, t.prototype.enqueue = function(t) {
|
|
@@ -6457,7 +6500,7 @@ function si(t, e) {
|
|
|
6457
6500
|
this.St(),
|
|
6458
6501
|
// Fast-forward delays for timerIds that have been overriden.
|
|
6459
6502
|
this.Ft.indexOf(t) > -1 && (e = 0);
|
|
6460
|
-
var i =
|
|
6503
|
+
var i = mi.createAndSchedule(this, t, e, n, (function(t) {
|
|
6461
6504
|
return r.kt(t);
|
|
6462
6505
|
}));
|
|
6463
6506
|
return this.Vt.push(i), i;
|
|
@@ -6532,10 +6575,10 @@ function si(t, e) {
|
|
|
6532
6575
|
var e = this.Vt.indexOf(t);
|
|
6533
6576
|
this.Vt.splice(e, 1);
|
|
6534
6577
|
}, t;
|
|
6535
|
-
}(),
|
|
6578
|
+
}(), gi = /** @class */ function() {
|
|
6536
6579
|
/** @hideconstructor */
|
|
6537
6580
|
function t(t, e) {
|
|
6538
|
-
this._firestore = t, this._transaction = e, this._dataReader =
|
|
6581
|
+
this._firestore = t, this._transaction = e, this._dataReader = Gn(t)
|
|
6539
6582
|
/**
|
|
6540
6583
|
* Reads the document referenced by the provided {@link DocumentReference}.
|
|
6541
6584
|
*
|
|
@@ -6544,23 +6587,23 @@ function si(t, e) {
|
|
|
6544
6587
|
*/;
|
|
6545
6588
|
}
|
|
6546
6589
|
return t.prototype.get = function(t) {
|
|
6547
|
-
var e = this, n =
|
|
6590
|
+
var e = this, n = ci(t, this._firestore), r = new zr(this._firestore);
|
|
6548
6591
|
return this._transaction.lookup([ n._key ]).then((function(t) {
|
|
6549
6592
|
if (!t || 1 !== t.length) return k();
|
|
6550
6593
|
var i = t[0];
|
|
6551
|
-
if (i.isFoundDocument()) return new
|
|
6552
|
-
if (i.isNoDocument()) return new
|
|
6594
|
+
if (i.isFoundDocument()) return new hr(e._firestore, r, i.key, i, n.converter);
|
|
6595
|
+
if (i.isNoDocument()) return new hr(e._firestore, r, n._key, null, n.converter);
|
|
6553
6596
|
throw k();
|
|
6554
6597
|
}));
|
|
6555
6598
|
}, t.prototype.set = function(t, e, n) {
|
|
6556
|
-
var r =
|
|
6599
|
+
var r = ci(t, this._firestore), i = Br(r.converter, e, n), o = Yn(this._dataReader, "Transaction.set", r._key, i, null !== r.converter, n);
|
|
6557
6600
|
return this._transaction.set(r._key, o), this;
|
|
6558
6601
|
}, t.prototype.update = function(t, e, n) {
|
|
6559
6602
|
for (var r = [], i = 3; i < arguments.length; i++) r[i - 3] = arguments[i];
|
|
6560
|
-
var o, a =
|
|
6603
|
+
var o, a = ci(t, this._firestore);
|
|
6561
6604
|
// For Compat types, we have to "extract" the underlying types before
|
|
6562
6605
|
// performing validation.
|
|
6563
|
-
return o = "string" == typeof (e = p(e)) || e instanceof
|
|
6606
|
+
return o = "string" == typeof (e = p(e)) || e instanceof Cn ? er(this._dataReader, "Transaction.update", a._key, e, n, r) : tr(this._dataReader, "Transaction.update", a._key, e),
|
|
6564
6607
|
this._transaction.update(a._key, o), this;
|
|
6565
6608
|
},
|
|
6566
6609
|
/**
|
|
@@ -6570,7 +6613,7 @@ function si(t, e) {
|
|
|
6570
6613
|
* @returns This `Transaction` instance. Used for chaining method calls.
|
|
6571
6614
|
*/
|
|
6572
6615
|
t.prototype.delete = function(t) {
|
|
6573
|
-
var e =
|
|
6616
|
+
var e = ci(t, this._firestore);
|
|
6574
6617
|
return this._transaction.delete(e._key), this;
|
|
6575
6618
|
}, t;
|
|
6576
6619
|
}();
|
|
@@ -6610,14 +6653,14 @@ function si(t, e) {
|
|
|
6610
6653
|
* `updateFunction `is returned here. Otherwise, if the transaction failed, a
|
|
6611
6654
|
* rejected promise with the corresponding failure error is returned.
|
|
6612
6655
|
*/
|
|
6613
|
-
function
|
|
6614
|
-
var r =
|
|
6656
|
+
function wi(t, e, n) {
|
|
6657
|
+
var r = gn(t = ct(t, _n)), i = Object.assign(Object.assign({}, hi), n);
|
|
6615
6658
|
!function(t) {
|
|
6616
6659
|
if (t.maxAttempts < 1) throw new B(V, "Max attempts must be at least 1");
|
|
6617
6660
|
}(i);
|
|
6618
6661
|
var o = new z;
|
|
6619
|
-
return new
|
|
6620
|
-
return e(new
|
|
6662
|
+
return new pi(new vi, r, i, (function(n) {
|
|
6663
|
+
return e(new gi(t, n));
|
|
6621
6664
|
}), o).run(), o.promise
|
|
6622
6665
|
/**
|
|
6623
6666
|
* Firestore Lite
|
|
@@ -6629,15 +6672,15 @@ function gi(t, e, n) {
|
|
|
6629
6672
|
*/;
|
|
6630
6673
|
}
|
|
6631
6674
|
|
|
6632
|
-
|
|
6633
|
-
var n = e.instanceIdentifier, r = e.options, i = t.getProvider("app").getImmediate(), o = new
|
|
6675
|
+
yi = "".concat(i, "_lite"), g = yi, o(new c("firestore/lite", (function(t, e) {
|
|
6676
|
+
var n = e.instanceIdentifier, r = e.options, i = t.getProvider("app").getImmediate(), o = new _n(new Y(t.getProvider("auth-internal")), new J(t.getProvider("app-check-internal")), function(t, e) {
|
|
6634
6677
|
if (!Object.prototype.hasOwnProperty.apply(t.options, [ "projectId" ])) throw new B(V, '"projectId" not provided in firebase.initializeApp.');
|
|
6635
6678
|
return new $(t.options.projectId, e);
|
|
6636
6679
|
}(i, n), i);
|
|
6637
6680
|
return r && o._setSettings(r), o;
|
|
6638
6681
|
}), "PUBLIC").setMultipleInstances(!0)),
|
|
6639
6682
|
// RUNTIME_ENV and BUILD_TARGET are replaced by real values during the compilation
|
|
6640
|
-
a("firestore-lite", "3.
|
|
6683
|
+
a("firestore-lite", "3.9.0-20230314181055", ""), a("firestore-lite", "3.9.0-20230314181055", "esm5");
|
|
6641
6684
|
|
|
6642
|
-
export {
|
|
6685
|
+
export { kn as AggregateField, An as AggregateQuerySnapshot, Rn as Bytes, Pn as CollectionReference, In as DocumentReference, hr as DocumentSnapshot, Cn as FieldPath, Mn as FieldValue, _n as Firestore, B as FirestoreError, Ln as GeoPoint, Fn as Query, Tr as QueryCompositeFilterConstraint, gr as QueryConstraint, pr as QueryDocumentSnapshot, Or as QueryEndAtConstraint, _r as QueryFieldFilterConstraint, Ir as QueryLimitConstraint, kr as QueryOrderByConstraint, dr as QuerySnapshot, Vr as QueryStartAtConstraint, qt as Timestamp, gi as Transaction, si as WriteBatch, Hr as addDoc, ei as aggregateFieldEqual, ni as aggregateQuerySnapshotEqual, Sr as and, ai as arrayRemove, oi as arrayUnion, $r as average, Vn as collection, Dn as collectionGroup, En as connectFirestoreEmulator, ti as count, Wr as deleteDoc, ri as deleteField, Nn as doc, xn as documentId, Rr as endAt, qr as endBefore, Jr as getAggregate, Xr as getCount, Kr as getDoc, Qr as getDocs, Tn as getFirestore, ui as increment, bn as initializeFirestore, Fr as limit, Pr as limitToLast, Er as or, Ar as orderBy, wr as query, qn as queryEqual, On as refEqual, wi as runTransaction, ii as serverTimestamp, Gr as setDoc, _ as setLogLevel, yr as snapshotEqual, Nr as startAfter, Dr as startAt, Zr as sum, Sn as terminate, Yr as updateDoc, br as where, li as writeBatch };
|
|
6643
6686
|
//# sourceMappingURL=index.browser.esm5.js.map
|