@firebase/firestore 4.6.1-dataconnect-preview.42eb5e521 → 4.6.2-20240508213348
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +294 -294
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm2017.js +294 -294
- package/dist/index.esm2017.js.map +1 -1
- package/dist/index.esm5.js +3082 -3082
- package/dist/index.esm5.js.map +1 -1
- package/dist/index.node.cjs.js +2 -2
- package/dist/index.node.mjs +2 -2
- package/dist/index.rn.js +294 -294
- package/dist/index.rn.js.map +1 -1
- package/dist/lite/index.browser.esm2017.js +152 -153
- package/dist/lite/index.browser.esm2017.js.map +1 -1
- package/dist/lite/index.browser.esm5.js +904 -905
- package/dist/lite/index.browser.esm5.js.map +1 -1
- package/dist/lite/index.cjs.js +152 -153
- package/dist/lite/index.cjs.js.map +1 -1
- package/dist/lite/index.node.cjs.js +2 -2
- package/dist/lite/index.node.mjs +2 -2
- package/dist/lite/index.rn.esm2017.js +152 -153
- package/dist/lite/index.rn.esm2017.js.map +1 -1
- package/dist/packages/firestore/dist/index.esm2017.d.ts +2 -2
- package/package.json +9 -9
|
@@ -6,8 +6,6 @@ import { Logger as o, LogLevel as a } from "@firebase/logger";
|
|
|
6
6
|
|
|
7
7
|
import { FirebaseError as u, base64 as _, DecodeBase64StringError as c, getDefaultEmulatorHostnameAndPort as l, createMockUserToken as h, getModularInstance as d, deepEqual as f } from "@firebase/util";
|
|
8
8
|
|
|
9
|
-
const E = "4.6.1-dataconnect-preview.42eb5e521";
|
|
10
|
-
|
|
11
9
|
/**
|
|
12
10
|
* @license
|
|
13
11
|
* Copyright 2017 Google LLC
|
|
@@ -27,7 +25,8 @@ const E = "4.6.1-dataconnect-preview.42eb5e521";
|
|
|
27
25
|
/**
|
|
28
26
|
* Simple wrapper around a nullable UID. Mostly exists to make code more
|
|
29
27
|
* readable.
|
|
30
|
-
*/
|
|
28
|
+
*/
|
|
29
|
+
class User {
|
|
31
30
|
constructor(t) {
|
|
32
31
|
this.uid = t;
|
|
33
32
|
}
|
|
@@ -67,7 +66,7 @@ User.MOCK_USER = new User("mock-user");
|
|
|
67
66
|
* See the License for the specific language governing permissions and
|
|
68
67
|
* limitations under the License.
|
|
69
68
|
*/
|
|
70
|
-
let
|
|
69
|
+
let E = "10.12.0-20240508213348";
|
|
71
70
|
|
|
72
71
|
/**
|
|
73
72
|
* @license
|
|
@@ -85,7 +84,7 @@ let m = "10.11.1-dataconnect-preview.42eb5e521";
|
|
|
85
84
|
* See the License for the specific language governing permissions and
|
|
86
85
|
* limitations under the License.
|
|
87
86
|
*/
|
|
88
|
-
const
|
|
87
|
+
const m = new o("@firebase/firestore");
|
|
89
88
|
|
|
90
89
|
/**
|
|
91
90
|
* Sets the verbosity of Cloud Firestore logs (debug, error, or silent).
|
|
@@ -100,29 +99,29 @@ const A = new o("@firebase/firestore");
|
|
|
100
99
|
* <li><code>`silent` to turn off logging.</li>
|
|
101
100
|
* </ul>
|
|
102
101
|
*/ function setLogLevel(t) {
|
|
103
|
-
|
|
102
|
+
m.setLogLevel(t);
|
|
104
103
|
}
|
|
105
104
|
|
|
106
105
|
function __PRIVATE_logDebug(t, ...e) {
|
|
107
|
-
if (
|
|
106
|
+
if (m.logLevel <= a.DEBUG) {
|
|
108
107
|
const r = e.map(__PRIVATE_argToString);
|
|
109
|
-
|
|
108
|
+
m.debug(`Firestore (${E}): ${t}`, ...r);
|
|
110
109
|
}
|
|
111
110
|
}
|
|
112
111
|
|
|
113
112
|
function __PRIVATE_logError(t, ...e) {
|
|
114
|
-
if (
|
|
113
|
+
if (m.logLevel <= a.ERROR) {
|
|
115
114
|
const r = e.map(__PRIVATE_argToString);
|
|
116
|
-
|
|
115
|
+
m.error(`Firestore (${E}): ${t}`, ...r);
|
|
117
116
|
}
|
|
118
117
|
}
|
|
119
118
|
|
|
120
119
|
/**
|
|
121
120
|
* @internal
|
|
122
121
|
*/ function __PRIVATE_logWarn(t, ...e) {
|
|
123
|
-
if (
|
|
122
|
+
if (m.logLevel <= a.WARN) {
|
|
124
123
|
const r = e.map(__PRIVATE_argToString);
|
|
125
|
-
|
|
124
|
+
m.warn(`Firestore (${E}): ${t}`, ...r);
|
|
126
125
|
}
|
|
127
126
|
}
|
|
128
127
|
|
|
@@ -183,7 +182,7 @@ function __PRIVATE_logError(t, ...e) {
|
|
|
183
182
|
*/ function fail(t = "Unexpected state") {
|
|
184
183
|
// Log the failure in addition to throw an exception, just in case the
|
|
185
184
|
// exception is swallowed.
|
|
186
|
-
const e = `FIRESTORE (${
|
|
185
|
+
const e = `FIRESTORE (${E}) INTERNAL ASSERTION FAILED: ` + t;
|
|
187
186
|
// NOTE: We don't use FirestoreError here because these are internal failures
|
|
188
187
|
// that cannot be handled by the user. (Also it would create a circular
|
|
189
188
|
// dependency between the error and assert modules which doesn't work.)
|
|
@@ -223,7 +222,7 @@ e) {
|
|
|
223
222
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
224
223
|
* See the License for the specific language governing permissions and
|
|
225
224
|
* limitations under the License.
|
|
226
|
-
*/ const
|
|
225
|
+
*/ const A = "ok", T = "cancelled", R = "unknown", P = "invalid-argument", I = "deadline-exceeded", V = "not-found", p = "already-exists", y = "permission-denied", w = "unauthenticated", g = "resource-exhausted", F = "failed-precondition", v = "aborted", D = "out-of-range", b = "unimplemented", C = "internal", S = "unavailable", N = "data-loss";
|
|
227
226
|
|
|
228
227
|
/** An error returned by a Firestore operation. */ class FirestoreError extends u {
|
|
229
228
|
/** @hideconstructor */
|
|
@@ -580,7 +579,7 @@ class BasePath {
|
|
|
580
579
|
// for legacy reasons and should not be used frequently).
|
|
581
580
|
const e = [];
|
|
582
581
|
for (const r of t) {
|
|
583
|
-
if (r.indexOf("//") >= 0) throw new FirestoreError(
|
|
582
|
+
if (r.indexOf("//") >= 0) throw new FirestoreError(P, `Invalid segment (${r}). Paths must not contain // in them.`);
|
|
584
583
|
// Strip leading and traling slashed.
|
|
585
584
|
e.push(...r.split("/").filter((t => t.length > 0)));
|
|
586
585
|
}
|
|
@@ -591,7 +590,7 @@ class BasePath {
|
|
|
591
590
|
}
|
|
592
591
|
}
|
|
593
592
|
|
|
594
|
-
const
|
|
593
|
+
const O = /^[_a-zA-Z][_a-zA-Z0-9]*$/;
|
|
595
594
|
|
|
596
595
|
/**
|
|
597
596
|
* A dot-separated path for navigating sub-objects within a document.
|
|
@@ -604,7 +603,7 @@ const q = /^[_a-zA-Z][_a-zA-Z0-9]*$/;
|
|
|
604
603
|
* Returns true if the string could be used as a segment in a field path
|
|
605
604
|
* without escaping.
|
|
606
605
|
*/ static isValidIdentifier(t) {
|
|
607
|
-
return
|
|
606
|
+
return O.test(t);
|
|
608
607
|
}
|
|
609
608
|
canonicalString() {
|
|
610
609
|
return this.toArray().map((t => (t = t.replace(/\\/g, "\\\\").replace(/`/g, "\\`"),
|
|
@@ -636,21 +635,21 @@ const q = /^[_a-zA-Z][_a-zA-Z0-9]*$/;
|
|
|
636
635
|
const e = [];
|
|
637
636
|
let r = "", n = 0;
|
|
638
637
|
const __PRIVATE_addCurrentSegment = () => {
|
|
639
|
-
if (0 === r.length) throw new FirestoreError(
|
|
638
|
+
if (0 === r.length) throw new FirestoreError(P, `Invalid field path (${t}). Paths must not be empty, begin with '.', end with '.', or contain '..'`);
|
|
640
639
|
e.push(r), r = "";
|
|
641
640
|
};
|
|
642
641
|
let i = !1;
|
|
643
642
|
for (;n < t.length; ) {
|
|
644
643
|
const e = t[n];
|
|
645
644
|
if ("\\" === e) {
|
|
646
|
-
if (n + 1 === t.length) throw new FirestoreError(
|
|
645
|
+
if (n + 1 === t.length) throw new FirestoreError(P, "Path has trailing escape character: " + t);
|
|
647
646
|
const e = t[n + 1];
|
|
648
|
-
if ("\\" !== e && "." !== e && "`" !== e) throw new FirestoreError(
|
|
647
|
+
if ("\\" !== e && "." !== e && "`" !== e) throw new FirestoreError(P, "Path has invalid escape sequence: " + t);
|
|
649
648
|
r += e, n += 2;
|
|
650
649
|
} else "`" === e ? (i = !i, n++) : "." !== e || i ? (r += e, n++) : (__PRIVATE_addCurrentSegment(),
|
|
651
650
|
n++);
|
|
652
651
|
}
|
|
653
|
-
if (__PRIVATE_addCurrentSegment(), i) throw new FirestoreError(
|
|
652
|
+
if (__PRIVATE_addCurrentSegment(), i) throw new FirestoreError(P, "Unterminated ` in path: " + t);
|
|
654
653
|
return new FieldPath$1(e);
|
|
655
654
|
}
|
|
656
655
|
static emptyPath() {
|
|
@@ -739,7 +738,7 @@ const q = /^[_a-zA-Z][_a-zA-Z0-9]*$/;
|
|
|
739
738
|
* See the License for the specific language governing permissions and
|
|
740
739
|
* limitations under the License.
|
|
741
740
|
*/ function __PRIVATE_validateNonEmptyArgument(t, e, r) {
|
|
742
|
-
if (!r) throw new FirestoreError(
|
|
741
|
+
if (!r) throw new FirestoreError(P, `Function ${t}() cannot be called with an empty ${e}.`);
|
|
743
742
|
}
|
|
744
743
|
|
|
745
744
|
/**
|
|
@@ -751,14 +750,14 @@ const q = /^[_a-zA-Z][_a-zA-Z0-9]*$/;
|
|
|
751
750
|
* an even numbers of segments).
|
|
752
751
|
*/
|
|
753
752
|
function __PRIVATE_validateDocumentPath(t) {
|
|
754
|
-
if (!DocumentKey.isDocumentKey(t)) throw new FirestoreError(
|
|
753
|
+
if (!DocumentKey.isDocumentKey(t)) throw new FirestoreError(P, `Invalid document reference. Document references must have an even number of segments, but ${t} has ${t.length}.`);
|
|
755
754
|
}
|
|
756
755
|
|
|
757
756
|
/**
|
|
758
757
|
* Validates that `path` refers to a collection (indicated by the fact it
|
|
759
758
|
* contains an odd numbers of segments).
|
|
760
759
|
*/ function __PRIVATE_validateCollectionPath(t) {
|
|
761
|
-
if (DocumentKey.isDocumentKey(t)) throw new FirestoreError(
|
|
760
|
+
if (DocumentKey.isDocumentKey(t)) throw new FirestoreError(P, `Invalid collection reference. Collection references must have an odd number of segments, but ${t} has ${t.length}.`);
|
|
762
761
|
}
|
|
763
762
|
|
|
764
763
|
/**
|
|
@@ -802,17 +801,17 @@ e) {
|
|
|
802
801
|
// Unwrap Compat types
|
|
803
802
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
804
803
|
t = t._delegate), !(t instanceof e)) {
|
|
805
|
-
if (e.name === t.constructor.name) throw new FirestoreError(
|
|
804
|
+
if (e.name === t.constructor.name) throw new FirestoreError(P, "Type does not match the expected instance. Did you pass a reference from a different Firestore SDK?");
|
|
806
805
|
{
|
|
807
806
|
const r = __PRIVATE_valueDescription(t);
|
|
808
|
-
throw new FirestoreError(
|
|
807
|
+
throw new FirestoreError(P, `Expected type '${e.name}', but it was: ${r}`);
|
|
809
808
|
}
|
|
810
809
|
}
|
|
811
810
|
return t;
|
|
812
811
|
}
|
|
813
812
|
|
|
814
813
|
function __PRIVATE_validatePositiveNumber(t, e) {
|
|
815
|
-
if (e <= 0) throw new FirestoreError(
|
|
814
|
+
if (e <= 0) throw new FirestoreError(P, `Function ${t}() requires a positive number, but it was: ${e}.`);
|
|
816
815
|
}
|
|
817
816
|
|
|
818
817
|
/**
|
|
@@ -862,7 +861,7 @@ function __PRIVATE_cloneLongPollingOptions(t) {
|
|
|
862
861
|
/**
|
|
863
862
|
* The value returned from the most recent invocation of
|
|
864
863
|
* `generateUniqueDebugId()`, or null if it has never been invoked.
|
|
865
|
-
*/ let
|
|
864
|
+
*/ let q = null;
|
|
866
865
|
|
|
867
866
|
/**
|
|
868
867
|
* Generates and returns an initial value for `lastUniqueDebugId`.
|
|
@@ -887,9 +886,9 @@ function __PRIVATE_cloneLongPollingOptions(t) {
|
|
|
887
886
|
* @return the 10-character generated ID (e.g. "0xa1b2c3d4").
|
|
888
887
|
*/
|
|
889
888
|
function __PRIVATE_generateUniqueDebugId() {
|
|
890
|
-
return null ===
|
|
889
|
+
return null === q ? q = function __PRIVATE_generateInitialUniqueDebugId() {
|
|
891
890
|
return 268435456 + Math.round(2147483648 * Math.random());
|
|
892
|
-
}() :
|
|
891
|
+
}() : q++, "0x" + q.toString(16);
|
|
893
892
|
}
|
|
894
893
|
|
|
895
894
|
/**
|
|
@@ -940,7 +939,7 @@ function __PRIVATE_generateUniqueDebugId() {
|
|
|
940
939
|
* See the License for the specific language governing permissions and
|
|
941
940
|
* limitations under the License.
|
|
942
941
|
*/
|
|
943
|
-
const
|
|
942
|
+
const B = {
|
|
944
943
|
BatchGetDocuments: "batchGet",
|
|
945
944
|
Commit: "commit",
|
|
946
945
|
RunQuery: "runQuery",
|
|
@@ -978,7 +977,7 @@ const $ = {
|
|
|
978
977
|
* are used for reverse lookups from the webchannel stream. Do NOT change the
|
|
979
978
|
* names of these identifiers or change this into a const enum.
|
|
980
979
|
*/
|
|
981
|
-
var Q
|
|
980
|
+
var $, Q;
|
|
982
981
|
|
|
983
982
|
/**
|
|
984
983
|
* Converts an HTTP Status Code to the equivalent error code.
|
|
@@ -989,7 +988,7 @@ var Q, L;
|
|
|
989
988
|
*/
|
|
990
989
|
function __PRIVATE_mapCodeFromHttpStatus(t) {
|
|
991
990
|
if (void 0 === t) return __PRIVATE_logError("RPC_ERROR", "HTTP error has no status"),
|
|
992
|
-
|
|
991
|
+
R;
|
|
993
992
|
// The canonical error codes for Google APIs [1] specify mapping onto HTTP
|
|
994
993
|
// status codes but the mapping is not bijective. In each case of ambiguity
|
|
995
994
|
// this function chooses a primary error.
|
|
@@ -999,66 +998,66 @@ function __PRIVATE_mapCodeFromHttpStatus(t) {
|
|
|
999
998
|
switch (t) {
|
|
1000
999
|
case 200:
|
|
1001
1000
|
// OK
|
|
1002
|
-
return
|
|
1001
|
+
return A;
|
|
1003
1002
|
|
|
1004
1003
|
case 400:
|
|
1005
1004
|
// Bad Request
|
|
1006
|
-
return
|
|
1005
|
+
return F;
|
|
1007
1006
|
|
|
1008
1007
|
// Other possibilities based on the forward mapping
|
|
1009
1008
|
// return Code.INVALID_ARGUMENT;
|
|
1010
1009
|
// return Code.OUT_OF_RANGE;
|
|
1011
1010
|
case 401:
|
|
1012
1011
|
// Unauthorized
|
|
1013
|
-
return
|
|
1012
|
+
return w;
|
|
1014
1013
|
|
|
1015
1014
|
case 403:
|
|
1016
1015
|
// Forbidden
|
|
1017
|
-
return
|
|
1016
|
+
return y;
|
|
1018
1017
|
|
|
1019
1018
|
case 404:
|
|
1020
1019
|
// Not Found
|
|
1021
|
-
return
|
|
1020
|
+
return V;
|
|
1022
1021
|
|
|
1023
1022
|
case 409:
|
|
1024
1023
|
// Conflict
|
|
1025
|
-
return
|
|
1024
|
+
return v;
|
|
1026
1025
|
|
|
1027
1026
|
// Other possibilities:
|
|
1028
1027
|
// return Code.ALREADY_EXISTS;
|
|
1029
1028
|
case 416:
|
|
1030
1029
|
// Range Not Satisfiable
|
|
1031
|
-
return
|
|
1030
|
+
return D;
|
|
1032
1031
|
|
|
1033
1032
|
case 429:
|
|
1034
1033
|
// Too Many Requests
|
|
1035
|
-
return
|
|
1034
|
+
return g;
|
|
1036
1035
|
|
|
1037
1036
|
case 499:
|
|
1038
1037
|
// Client Closed Request
|
|
1039
|
-
return
|
|
1038
|
+
return T;
|
|
1040
1039
|
|
|
1041
1040
|
case 500:
|
|
1042
1041
|
// Internal Server Error
|
|
1043
|
-
return
|
|
1042
|
+
return R;
|
|
1044
1043
|
|
|
1045
1044
|
// Other possibilities:
|
|
1046
1045
|
// return Code.INTERNAL;
|
|
1047
1046
|
// return Code.DATA_LOSS;
|
|
1048
1047
|
case 501:
|
|
1049
1048
|
// Unimplemented
|
|
1050
|
-
return
|
|
1049
|
+
return b;
|
|
1051
1050
|
|
|
1052
1051
|
case 503:
|
|
1053
1052
|
// Service Unavailable
|
|
1054
|
-
return
|
|
1053
|
+
return S;
|
|
1055
1054
|
|
|
1056
1055
|
case 504:
|
|
1057
1056
|
// Gateway Timeout
|
|
1058
|
-
return
|
|
1057
|
+
return I;
|
|
1059
1058
|
|
|
1060
1059
|
default:
|
|
1061
|
-
return t >= 200 && t < 300 ?
|
|
1060
|
+
return t >= 200 && t < 300 ? A : t >= 400 && t < 500 ? F : t >= 500 && t < 600 ? C : R;
|
|
1062
1061
|
}
|
|
1063
1062
|
}
|
|
1064
1063
|
|
|
@@ -1081,13 +1080,13 @@ function __PRIVATE_mapCodeFromHttpStatus(t) {
|
|
|
1081
1080
|
/**
|
|
1082
1081
|
* A Rest-based connection that relies on the native HTTP stack
|
|
1083
1082
|
* (e.g. `fetch` or a polyfill).
|
|
1084
|
-
*/ (
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1083
|
+
*/ (Q = $ || ($ = {}))[Q.OK = 0] = "OK", Q[Q.CANCELLED = 1] = "CANCELLED", Q[Q.UNKNOWN = 2] = "UNKNOWN",
|
|
1084
|
+
Q[Q.INVALID_ARGUMENT = 3] = "INVALID_ARGUMENT", Q[Q.DEADLINE_EXCEEDED = 4] = "DEADLINE_EXCEEDED",
|
|
1085
|
+
Q[Q.NOT_FOUND = 5] = "NOT_FOUND", Q[Q.ALREADY_EXISTS = 6] = "ALREADY_EXISTS", Q[Q.PERMISSION_DENIED = 7] = "PERMISSION_DENIED",
|
|
1086
|
+
Q[Q.UNAUTHENTICATED = 16] = "UNAUTHENTICATED", Q[Q.RESOURCE_EXHAUSTED = 8] = "RESOURCE_EXHAUSTED",
|
|
1087
|
+
Q[Q.FAILED_PRECONDITION = 9] = "FAILED_PRECONDITION", Q[Q.ABORTED = 10] = "ABORTED",
|
|
1088
|
+
Q[Q.OUT_OF_RANGE = 11] = "OUT_OF_RANGE", Q[Q.UNIMPLEMENTED = 12] = "UNIMPLEMENTED",
|
|
1089
|
+
Q[Q.INTERNAL = 13] = "INTERNAL", Q[Q.UNAVAILABLE = 14] = "UNAVAILABLE", Q[Q.DATA_LOSS = 15] = "DATA_LOSS";
|
|
1091
1090
|
|
|
1092
1091
|
class __PRIVATE_FetchConnection extends
|
|
1093
1092
|
/**
|
|
@@ -1131,7 +1130,7 @@ class __PRIVATE_RestConnection {
|
|
|
1131
1130
|
// SDK_VERSION is updated to different value at runtime depending on the entry point,
|
|
1132
1131
|
// so we need to get its value when we need it in a function.
|
|
1133
1132
|
function __PRIVATE_getGoogApiClientValue() {
|
|
1134
|
-
return "gl-js/ fire/" +
|
|
1133
|
+
return "gl-js/ fire/" + E;
|
|
1135
1134
|
}(),
|
|
1136
1135
|
// Content-Type: text/plain will avoid preflight requests which might
|
|
1137
1136
|
// mess with CORS and redirects by proxies. If we add custom headers
|
|
@@ -1141,7 +1140,7 @@ class __PRIVATE_RestConnection {
|
|
|
1141
1140
|
e && e.headers.forEach(((e, r) => t[r] = e)), r && r.headers.forEach(((e, r) => t[r] = e));
|
|
1142
1141
|
}
|
|
1143
1142
|
I(t, e) {
|
|
1144
|
-
const r =
|
|
1143
|
+
const r = B[t];
|
|
1145
1144
|
return `${this.m}/v1/${e}:${r}`;
|
|
1146
1145
|
}
|
|
1147
1146
|
/**
|
|
@@ -1494,7 +1493,7 @@ class ByteString {
|
|
|
1494
1493
|
|
|
1495
1494
|
ByteString.EMPTY_BYTE_STRING = new ByteString("");
|
|
1496
1495
|
|
|
1497
|
-
const
|
|
1496
|
+
const L = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
|
|
1498
1497
|
|
|
1499
1498
|
/**
|
|
1500
1499
|
* Converts the possible Proto values for a timestamp value into a "seconds and
|
|
@@ -1508,7 +1507,7 @@ const M = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
|
|
|
1508
1507
|
// (millis), so we do some custom parsing here.
|
|
1509
1508
|
// Parse the nanos right out of the string.
|
|
1510
1509
|
let e = 0;
|
|
1511
|
-
const r =
|
|
1510
|
+
const r = L.exec(t);
|
|
1512
1511
|
if (__PRIVATE_hardAssert(!!r), r[1]) {
|
|
1513
1512
|
// Pad the fraction out to 9 digits (nanos).
|
|
1514
1513
|
let t = r[1];
|
|
@@ -1591,11 +1590,11 @@ class Timestamp {
|
|
|
1591
1590
|
* The fractions of a second at nanosecond resolution.*
|
|
1592
1591
|
*/
|
|
1593
1592
|
e) {
|
|
1594
|
-
if (this.seconds = t, this.nanoseconds = e, e < 0) throw new FirestoreError(
|
|
1595
|
-
if (e >= 1e9) throw new FirestoreError(
|
|
1596
|
-
if (t < -62135596800) throw new FirestoreError(
|
|
1593
|
+
if (this.seconds = t, this.nanoseconds = e, e < 0) throw new FirestoreError(P, "Timestamp nanoseconds out of range: " + e);
|
|
1594
|
+
if (e >= 1e9) throw new FirestoreError(P, "Timestamp nanoseconds out of range: " + e);
|
|
1595
|
+
if (t < -62135596800) throw new FirestoreError(P, "Timestamp seconds out of range: " + t);
|
|
1597
1596
|
// This will break in the year 10,000.
|
|
1598
|
-
if (t >= 253402300800) throw new FirestoreError(
|
|
1597
|
+
if (t >= 253402300800) throw new FirestoreError(P, "Timestamp seconds out of range: " + t);
|
|
1599
1598
|
}
|
|
1600
1599
|
/**
|
|
1601
1600
|
* Creates a new timestamp with the current date, with millisecond precision.
|
|
@@ -1751,7 +1750,7 @@ class Timestamp {
|
|
|
1751
1750
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1752
1751
|
* See the License for the specific language governing permissions and
|
|
1753
1752
|
* limitations under the License.
|
|
1754
|
-
*/ const
|
|
1753
|
+
*/ const M = {
|
|
1755
1754
|
fields: {
|
|
1756
1755
|
__type__: {
|
|
1757
1756
|
stringValue: "__max__"
|
|
@@ -1933,9 +1932,9 @@ function __PRIVATE_valueCompare(t, e) {
|
|
|
1933
1932
|
|
|
1934
1933
|
case 10 /* TypeOrder.ObjectValue */ :
|
|
1935
1934
|
return function __PRIVATE_compareMaps(t, e) {
|
|
1936
|
-
if (t ===
|
|
1937
|
-
if (t ===
|
|
1938
|
-
if (e ===
|
|
1935
|
+
if (t === M && e === M) return 0;
|
|
1936
|
+
if (t === M) return 1;
|
|
1937
|
+
if (e === M) return -1;
|
|
1939
1938
|
const r = t.fields || {}, n = Object.keys(r), i = e.fields || {}, s = Object.keys(i);
|
|
1940
1939
|
// Even though MapValues are likely sorted correctly based on their insertion
|
|
1941
1940
|
// order (e.g. when received from the backend), local modifications can bring
|
|
@@ -3491,13 +3490,13 @@ function toNumber(t, e) {
|
|
|
3491
3490
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
3492
3491
|
* See the License for the specific language governing permissions and
|
|
3493
3492
|
* limitations under the License.
|
|
3494
|
-
*/ const
|
|
3493
|
+
*/ const x = (() => {
|
|
3495
3494
|
const t = {
|
|
3496
3495
|
asc: "ASCENDING",
|
|
3497
3496
|
desc: "DESCENDING"
|
|
3498
3497
|
};
|
|
3499
3498
|
return t;
|
|
3500
|
-
})(),
|
|
3499
|
+
})(), k = (() => {
|
|
3501
3500
|
const t = {
|
|
3502
3501
|
"<": "LESS_THAN",
|
|
3503
3502
|
"<=": "LESS_THAN_OR_EQUAL",
|
|
@@ -3511,7 +3510,7 @@ function toNumber(t, e) {
|
|
|
3511
3510
|
"array-contains-any": "ARRAY_CONTAINS_ANY"
|
|
3512
3511
|
};
|
|
3513
3512
|
return t;
|
|
3514
|
-
})(),
|
|
3513
|
+
})(), U = (() => {
|
|
3515
3514
|
const t = {
|
|
3516
3515
|
and: "AND",
|
|
3517
3516
|
or: "OR"
|
|
@@ -3600,8 +3599,8 @@ function fromName(t, e) {
|
|
|
3600
3599
|
const e = ResourcePath.fromString(t);
|
|
3601
3600
|
return __PRIVATE_hardAssert(__PRIVATE_isValidResourceName(e)), e;
|
|
3602
3601
|
}(e);
|
|
3603
|
-
if (r.get(1) !== t.databaseId.projectId) throw new FirestoreError(
|
|
3604
|
-
if (r.get(3) !== t.databaseId.database) throw new FirestoreError(
|
|
3602
|
+
if (r.get(1) !== t.databaseId.projectId) throw new FirestoreError(P, "Tried to deserialize key from different project: " + r.get(1) + " vs " + t.databaseId.projectId);
|
|
3603
|
+
if (r.get(3) !== t.databaseId.database) throw new FirestoreError(P, "Tried to deserialize key from different database: " + r.get(3) + " vs " + t.databaseId.database);
|
|
3605
3604
|
return new DocumentKey(function __PRIVATE_extractLocalPathFromResourceName(t) {
|
|
3606
3605
|
return __PRIVATE_hardAssert(t.length > 4 && "documents" === t.get(4)), t.popFirst(5);
|
|
3607
3606
|
}
|
|
@@ -3735,16 +3734,16 @@ function __PRIVATE_toQueryTarget(t, e) {
|
|
|
3735
3734
|
}
|
|
3736
3735
|
|
|
3737
3736
|
function __PRIVATE_toDirection(t) {
|
|
3738
|
-
return
|
|
3737
|
+
return x[t];
|
|
3739
3738
|
}
|
|
3740
3739
|
|
|
3741
3740
|
// visible for testing
|
|
3742
3741
|
function __PRIVATE_toOperatorName(t) {
|
|
3743
|
-
return
|
|
3742
|
+
return k[t];
|
|
3744
3743
|
}
|
|
3745
3744
|
|
|
3746
3745
|
function __PRIVATE_toCompositeOperatorName(t) {
|
|
3747
|
-
return
|
|
3746
|
+
return U[t];
|
|
3748
3747
|
}
|
|
3749
3748
|
|
|
3750
3749
|
function __PRIVATE_toFieldPathReference(t) {
|
|
@@ -3961,18 +3960,18 @@ class __PRIVATE_DatastoreImpl extends class Datastore {} {
|
|
|
3961
3960
|
this.serializer = n, this.Y = !1;
|
|
3962
3961
|
}
|
|
3963
3962
|
Z() {
|
|
3964
|
-
if (this.Y) throw new FirestoreError(
|
|
3963
|
+
if (this.Y) throw new FirestoreError(F, "The client has already been terminated.");
|
|
3965
3964
|
}
|
|
3966
3965
|
/** Invokes the provided RPC with auth and AppCheck tokens. */ P(t, e, r, n) {
|
|
3967
3966
|
return this.Z(), Promise.all([ this.authCredentials.getToken(), this.appCheckCredentials.getToken() ]).then((([i, s]) => this.connection.P(t, __PRIVATE_toResourcePath(e, r), n, i, s))).catch((t => {
|
|
3968
|
-
throw "FirebaseError" === t.name ? (t.code ===
|
|
3969
|
-
this.appCheckCredentials.invalidateToken()), t) : new FirestoreError(
|
|
3967
|
+
throw "FirebaseError" === t.name ? (t.code === w && (this.authCredentials.invalidateToken(),
|
|
3968
|
+
this.appCheckCredentials.invalidateToken()), t) : new FirestoreError(R, t.toString());
|
|
3970
3969
|
}));
|
|
3971
3970
|
}
|
|
3972
3971
|
/** Invokes the provided RPC with streamed results with auth and AppCheck tokens. */ g(t, e, r, n, i) {
|
|
3973
3972
|
return this.Z(), Promise.all([ this.authCredentials.getToken(), this.appCheckCredentials.getToken() ]).then((([s, o]) => this.connection.g(t, __PRIVATE_toResourcePath(e, r), n, s, o, i))).catch((t => {
|
|
3974
|
-
throw "FirebaseError" === t.name ? (t.code ===
|
|
3975
|
-
this.appCheckCredentials.invalidateToken()), t) : new FirestoreError(
|
|
3973
|
+
throw "FirebaseError" === t.name ? (t.code === w && (this.authCredentials.invalidateToken(),
|
|
3974
|
+
this.appCheckCredentials.invalidateToken()), t) : new FirestoreError(R, t.toString());
|
|
3976
3975
|
}));
|
|
3977
3976
|
}
|
|
3978
3977
|
terminate() {
|
|
@@ -4086,7 +4085,7 @@ async function __PRIVATE_invokeRunAggregationQueryRpc(t, e, r) {
|
|
|
4086
4085
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
4087
4086
|
* See the License for the specific language governing permissions and
|
|
4088
4087
|
* limitations under the License.
|
|
4089
|
-
*/ const
|
|
4088
|
+
*/ const j = new Map;
|
|
4090
4089
|
|
|
4091
4090
|
/**
|
|
4092
4091
|
* An instance map that ensures only one Datastore exists per Firestore
|
|
@@ -4098,8 +4097,8 @@ async function __PRIVATE_invokeRunAggregationQueryRpc(t, e, r) {
|
|
|
4098
4097
|
* instance is terminated.
|
|
4099
4098
|
*/
|
|
4100
4099
|
function __PRIVATE_getDatastore(t) {
|
|
4101
|
-
if (t._terminated) throw new FirestoreError(
|
|
4102
|
-
if (!
|
|
4100
|
+
if (t._terminated) throw new FirestoreError(F, "The client has already been terminated.");
|
|
4101
|
+
if (!j.has(t)) {
|
|
4103
4102
|
__PRIVATE_logDebug("ComponentProvider", "Initializing Datastore");
|
|
4104
4103
|
const e = function __PRIVATE_newConnection(t) {
|
|
4105
4104
|
return new __PRIVATE_FetchConnection(t, fetch.bind(null));
|
|
@@ -4124,9 +4123,9 @@ function __PRIVATE_getDatastore(t) {
|
|
|
4124
4123
|
*/ (t._databaseId, t.app.options.appId || "", t._persistenceKey, t._freezeSettings())), r = __PRIVATE_newSerializer(t._databaseId), n = function __PRIVATE_newDatastore(t, e, r, n) {
|
|
4125
4124
|
return new __PRIVATE_DatastoreImpl(t, e, r, n);
|
|
4126
4125
|
}(t._authCredentials, t._appCheckCredentials, e, r);
|
|
4127
|
-
|
|
4126
|
+
j.set(t, n);
|
|
4128
4127
|
}
|
|
4129
|
-
return
|
|
4128
|
+
return j.get(t);
|
|
4130
4129
|
}
|
|
4131
4130
|
|
|
4132
4131
|
/**
|
|
@@ -4142,16 +4141,16 @@ class FirestoreSettingsImpl {
|
|
|
4142
4141
|
constructor(t) {
|
|
4143
4142
|
var e, r;
|
|
4144
4143
|
if (void 0 === t.host) {
|
|
4145
|
-
if (void 0 !== t.ssl) throw new FirestoreError(
|
|
4144
|
+
if (void 0 !== t.ssl) throw new FirestoreError(P, "Can't provide ssl option if host option is not set");
|
|
4146
4145
|
this.host = "firestore.googleapis.com", this.ssl = true;
|
|
4147
4146
|
} else this.host = t.host, this.ssl = null === (e = t.ssl) || void 0 === e || e;
|
|
4148
4147
|
if (this.credentials = t.credentials, this.ignoreUndefinedProperties = !!t.ignoreUndefinedProperties,
|
|
4149
4148
|
this.localCache = t.localCache, void 0 === t.cacheSizeBytes) this.cacheSizeBytes = 41943040; else {
|
|
4150
|
-
if (-1 !== t.cacheSizeBytes && t.cacheSizeBytes < 1048576) throw new FirestoreError(
|
|
4149
|
+
if (-1 !== t.cacheSizeBytes && t.cacheSizeBytes < 1048576) throw new FirestoreError(P, "cacheSizeBytes must be at least 1048576");
|
|
4151
4150
|
this.cacheSizeBytes = t.cacheSizeBytes;
|
|
4152
4151
|
}
|
|
4153
4152
|
!function __PRIVATE_validateIsNotUsedTogether(t, e, r, n) {
|
|
4154
|
-
if (!0 === e && !0 === n) throw new FirestoreError(
|
|
4153
|
+
if (!0 === e && !0 === n) throw new FirestoreError(P, `${t} and ${r} cannot be used together.`);
|
|
4155
4154
|
}("experimentalForceLongPolling", t.experimentalForceLongPolling, "experimentalAutoDetectLongPolling", t.experimentalAutoDetectLongPolling),
|
|
4156
4155
|
this.experimentalForceLongPolling = !!t.experimentalForceLongPolling, this.experimentalForceLongPolling ? this.experimentalAutoDetectLongPolling = !1 : void 0 === t.experimentalAutoDetectLongPolling ? this.experimentalAutoDetectLongPolling = true :
|
|
4157
4156
|
// For backwards compatibility, coerce the value to boolean even though
|
|
@@ -4161,9 +4160,9 @@ class FirestoreSettingsImpl {
|
|
|
4161
4160
|
this.experimentalLongPollingOptions = __PRIVATE_cloneLongPollingOptions(null !== (r = t.experimentalLongPollingOptions) && void 0 !== r ? r : {}),
|
|
4162
4161
|
function __PRIVATE_validateLongPollingOptions(t) {
|
|
4163
4162
|
if (void 0 !== t.timeoutSeconds) {
|
|
4164
|
-
if (isNaN(t.timeoutSeconds)) throw new FirestoreError(
|
|
4165
|
-
if (t.timeoutSeconds < 5) throw new FirestoreError(
|
|
4166
|
-
if (t.timeoutSeconds > 30) throw new FirestoreError(
|
|
4163
|
+
if (isNaN(t.timeoutSeconds)) throw new FirestoreError(P, `invalid long polling timeout: ${t.timeoutSeconds} (must not be NaN)`);
|
|
4164
|
+
if (t.timeoutSeconds < 5) throw new FirestoreError(P, `invalid long polling timeout: ${t.timeoutSeconds} (minimum allowed value is 5)`);
|
|
4165
|
+
if (t.timeoutSeconds > 30) throw new FirestoreError(P, `invalid long polling timeout: ${t.timeoutSeconds} (maximum allowed value is 30)`);
|
|
4167
4166
|
}
|
|
4168
4167
|
}
|
|
4169
4168
|
/**
|
|
@@ -4210,7 +4209,7 @@ class Firestore {
|
|
|
4210
4209
|
* The {@link @firebase/app#FirebaseApp} associated with this `Firestore` service
|
|
4211
4210
|
* instance.
|
|
4212
4211
|
*/ get app() {
|
|
4213
|
-
if (!this._app) throw new FirestoreError(
|
|
4212
|
+
if (!this._app) throw new FirestoreError(F, "Firestore was not initialized using the Firebase SDK. 'app' is not available");
|
|
4214
4213
|
return this._app;
|
|
4215
4214
|
}
|
|
4216
4215
|
get _initialized() {
|
|
@@ -4220,7 +4219,7 @@ class Firestore {
|
|
|
4220
4219
|
return void 0 !== this._terminateTask;
|
|
4221
4220
|
}
|
|
4222
4221
|
_setSettings(t) {
|
|
4223
|
-
if (this._settingsFrozen) throw new FirestoreError(
|
|
4222
|
+
if (this._settingsFrozen) throw new FirestoreError(F, "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.");
|
|
4224
4223
|
this._settings = new FirestoreSettingsImpl(t), void 0 !== t.credentials && (this._authCredentials = function __PRIVATE_makeAuthCredentialsProvider(t) {
|
|
4225
4224
|
if (!t) return new __PRIVATE_EmptyAuthCredentialsProvider;
|
|
4226
4225
|
switch (t.type) {
|
|
@@ -4231,7 +4230,7 @@ class Firestore {
|
|
|
4231
4230
|
return t.client;
|
|
4232
4231
|
|
|
4233
4232
|
default:
|
|
4234
|
-
throw new FirestoreError(
|
|
4233
|
+
throw new FirestoreError(P, "makeAuthCredentialsProvider failed due to invalid credential type");
|
|
4235
4234
|
}
|
|
4236
4235
|
}(t.credentials));
|
|
4237
4236
|
}
|
|
@@ -4259,8 +4258,8 @@ class Firestore {
|
|
|
4259
4258
|
* Only ever called once.
|
|
4260
4259
|
*/ _terminate() {
|
|
4261
4260
|
return function __PRIVATE_removeComponents(t) {
|
|
4262
|
-
const e =
|
|
4263
|
-
e && (__PRIVATE_logDebug("ComponentProvider", "Removing Datastore"),
|
|
4261
|
+
const e = j.get(t);
|
|
4262
|
+
e && (__PRIVATE_logDebug("ComponentProvider", "Removing Datastore"), j.delete(t),
|
|
4264
4263
|
e.terminate());
|
|
4265
4264
|
}(this), Promise.resolve();
|
|
4266
4265
|
}
|
|
@@ -4269,7 +4268,7 @@ class Firestore {
|
|
|
4269
4268
|
function initializeFirestore(t, e, r) {
|
|
4270
4269
|
r || (r = "(default)");
|
|
4271
4270
|
const n = _getProvider(t, "firestore/lite");
|
|
4272
|
-
if (n.isInitialized(r)) throw new FirestoreError(
|
|
4271
|
+
if (n.isInitialized(r)) throw new FirestoreError(F, "Firestore can only be initialized once per app.");
|
|
4273
4272
|
return n.initialize({
|
|
4274
4273
|
options: e,
|
|
4275
4274
|
instanceIdentifier: r
|
|
@@ -4313,7 +4312,7 @@ function getFirestore(e, r) {
|
|
|
4313
4312
|
// invalid field "uid" and missing field "sub" / "user_id".)
|
|
4314
4313
|
e = h(n.mockUserToken, null === (i = t._app) || void 0 === i ? void 0 : i.options.projectId);
|
|
4315
4314
|
const s = n.mockUserToken.sub || n.mockUserToken.user_id;
|
|
4316
|
-
if (!s) throw new FirestoreError(
|
|
4315
|
+
if (!s) throw new FirestoreError(P, "mockUserToken must contain 'sub' or 'user_id' field!");
|
|
4317
4316
|
r = new User(s);
|
|
4318
4317
|
}
|
|
4319
4318
|
t._authCredentials = new __PRIVATE_EmulatorAuthCredentialsProvider(new __PRIVATE_OAuthToken(e, r));
|
|
@@ -4532,7 +4531,7 @@ function collection(t, e, ...r) {
|
|
|
4532
4531
|
return __PRIVATE_validateCollectionPath(n), new CollectionReference(t, /* converter= */ null, n);
|
|
4533
4532
|
}
|
|
4534
4533
|
{
|
|
4535
|
-
if (!(t instanceof DocumentReference || t instanceof CollectionReference)) throw new FirestoreError(
|
|
4534
|
+
if (!(t instanceof DocumentReference || t instanceof CollectionReference)) throw new FirestoreError(P, "Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");
|
|
4536
4535
|
const n = t._path.child(ResourcePath.fromString(e, ...r));
|
|
4537
4536
|
return __PRIVATE_validateCollectionPath(n), new CollectionReference(t.firestore,
|
|
4538
4537
|
/* converter= */ null, n);
|
|
@@ -4553,7 +4552,7 @@ function collection(t, e, ...r) {
|
|
|
4553
4552
|
* @returns The created `Query`.
|
|
4554
4553
|
*/ function collectionGroup(t, e) {
|
|
4555
4554
|
if (t = __PRIVATE_cast(t, Firestore), __PRIVATE_validateNonEmptyArgument("collectionGroup", "collection id", e),
|
|
4556
|
-
e.indexOf("/") >= 0) throw new FirestoreError(
|
|
4555
|
+
e.indexOf("/") >= 0) throw new FirestoreError(P, `Invalid collection ID '${e}' passed to function collectionGroup(). Collection IDs must not contain '/'.`);
|
|
4557
4556
|
return new Query(t,
|
|
4558
4557
|
/* converter= */ null, function __PRIVATE_newQueryForCollectionGroup(t) {
|
|
4559
4558
|
return new __PRIVATE_QueryImpl(ResourcePath.emptyPath(), t);
|
|
@@ -4571,7 +4570,7 @@ function doc(t, e, ...r) {
|
|
|
4571
4570
|
/* converter= */ null, new DocumentKey(n));
|
|
4572
4571
|
}
|
|
4573
4572
|
{
|
|
4574
|
-
if (!(t instanceof DocumentReference || t instanceof CollectionReference)) throw new FirestoreError(
|
|
4573
|
+
if (!(t instanceof DocumentReference || t instanceof CollectionReference)) throw new FirestoreError(P, "Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");
|
|
4575
4574
|
const n = t._path.child(ResourcePath.fromString(e, ...r));
|
|
4576
4575
|
return __PRIVATE_validateDocumentPath(n), new DocumentReference(t.firestore, t instanceof CollectionReference ? t.converter : null, new DocumentKey(n));
|
|
4577
4576
|
}
|
|
@@ -4632,7 +4631,7 @@ function doc(t, e, ...r) {
|
|
|
4632
4631
|
try {
|
|
4633
4632
|
return new Bytes(ByteString.fromBase64String(t));
|
|
4634
4633
|
} catch (t) {
|
|
4635
|
-
throw new FirestoreError(
|
|
4634
|
+
throw new FirestoreError(P, "Failed to construct data from Base64 string: " + t);
|
|
4636
4635
|
}
|
|
4637
4636
|
}
|
|
4638
4637
|
/**
|
|
@@ -4704,7 +4703,7 @@ function doc(t, e, ...r) {
|
|
|
4704
4703
|
* @param fieldNames - A list of field names.
|
|
4705
4704
|
*/
|
|
4706
4705
|
constructor(...t) {
|
|
4707
|
-
for (let e = 0; e < t.length; ++e) if (0 === t[e].length) throw new FirestoreError(
|
|
4706
|
+
for (let e = 0; e < t.length; ++e) if (0 === t[e].length) throw new FirestoreError(P, "Invalid field name at argument $(i + 1). Field names must not be empty.");
|
|
4708
4707
|
this._internalPath = new FieldPath$1(t);
|
|
4709
4708
|
}
|
|
4710
4709
|
/**
|
|
@@ -4783,8 +4782,8 @@ function doc(t, e, ...r) {
|
|
|
4783
4782
|
* @param longitude - The longitude as number between -180 and 180.
|
|
4784
4783
|
*/
|
|
4785
4784
|
constructor(t, e) {
|
|
4786
|
-
if (!isFinite(t) || t < -90 || t > 90) throw new FirestoreError(
|
|
4787
|
-
if (!isFinite(e) || e < -180 || e > 180) throw new FirestoreError(
|
|
4785
|
+
if (!isFinite(t) || t < -90 || t > 90) throw new FirestoreError(P, "Latitude must be a number between -90 and 90, but was: " + t);
|
|
4786
|
+
if (!isFinite(e) || e < -180 || e > 180) throw new FirestoreError(P, "Longitude must be a number between -180 and 180, but was: " + e);
|
|
4788
4787
|
this._lat = t, this._long = e;
|
|
4789
4788
|
}
|
|
4790
4789
|
/**
|
|
@@ -4834,7 +4833,7 @@ function doc(t, e, ...r) {
|
|
|
4834
4833
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
4835
4834
|
* See the License for the specific language governing permissions and
|
|
4836
4835
|
* limitations under the License.
|
|
4837
|
-
*/ const
|
|
4836
|
+
*/ const z = /^__.*__$/;
|
|
4838
4837
|
|
|
4839
4838
|
/** The result of parsing document data (e.g. for a setData call). */ class ParsedSetData {
|
|
4840
4839
|
constructor(t, e, r) {
|
|
@@ -4945,7 +4944,7 @@ function __PRIVATE_isWrite(t) {
|
|
|
4945
4944
|
}
|
|
4946
4945
|
st(t) {
|
|
4947
4946
|
if (0 === t.length) throw this._t("Document fields must not be empty");
|
|
4948
|
-
if (__PRIVATE_isWrite(this.et) &&
|
|
4947
|
+
if (__PRIVATE_isWrite(this.et) && z.test(t)) throw this._t('Document fields cannot begin and end with "__"');
|
|
4949
4948
|
}
|
|
4950
4949
|
}
|
|
4951
4950
|
|
|
@@ -4982,7 +4981,7 @@ function __PRIVATE_newUserDataReader(t) {
|
|
|
4982
4981
|
const t = [];
|
|
4983
4982
|
for (const n of s.mergeFields) {
|
|
4984
4983
|
const i = __PRIVATE_fieldPathFromArgument$1(e, n, r);
|
|
4985
|
-
if (!o.contains(i)) throw new FirestoreError(
|
|
4984
|
+
if (!o.contains(i)) throw new FirestoreError(P, `Field '${i}' is specified in your field mask but missing from your input data.`);
|
|
4986
4985
|
__PRIVATE_fieldMaskContains(t, i) || t.push(i);
|
|
4987
4986
|
}
|
|
4988
4987
|
u = new FieldMask(t), _ = o.fieldTransforms.filter((t => u.covers(t.field)));
|
|
@@ -5099,7 +5098,7 @@ class __PRIVATE_NumericIncrementFieldValueImpl extends FieldValue {
|
|
|
5099
5098
|
|
|
5100
5099
|
/** Parse update data from a list of field/value arguments. */ function __PRIVATE_parseUpdateVarargs(t, e, r, n, i, s) {
|
|
5101
5100
|
const o = t.ht(1 /* UserDataSource.Update */ , e, r), a = [ __PRIVATE_fieldPathFromArgument$1(e, n, r) ], u = [ i ];
|
|
5102
|
-
if (s.length % 2 != 0) throw new FirestoreError(
|
|
5101
|
+
if (s.length % 2 != 0) throw new FirestoreError(P, `Function ${e}() needs to be called with an even number of arguments that alternate between field names and values.`);
|
|
5103
5102
|
for (let t = 0; t < s.length; t += 2) a.push(__PRIVATE_fieldPathFromArgument$1(e, s[t])),
|
|
5104
5103
|
u.push(s[t + 1]);
|
|
5105
5104
|
const _ = [], c = ObjectValue.empty();
|
|
@@ -5303,7 +5302,7 @@ function __PRIVATE_validatePlainObject(t, e, r) {
|
|
|
5303
5302
|
|
|
5304
5303
|
/**
|
|
5305
5304
|
* Matches any characters in a field path string that are reserved.
|
|
5306
|
-
*/ const
|
|
5305
|
+
*/ const W = new RegExp("[~\\*/\\[\\]]");
|
|
5307
5306
|
|
|
5308
5307
|
/**
|
|
5309
5308
|
* Wraps fromDotSeparatedString with an error message about the method that
|
|
@@ -5314,7 +5313,7 @@ function __PRIVATE_validatePlainObject(t, e, r) {
|
|
|
5314
5313
|
* @param targetDoc - The document against which the field path will be
|
|
5315
5314
|
* evaluated.
|
|
5316
5315
|
*/ function __PRIVATE_fieldPathFromDotSeparatedString(t, e, r) {
|
|
5317
|
-
if (e.search(
|
|
5316
|
+
if (e.search(W) >= 0) throw __PRIVATE_createError(`Invalid field path (${e}). Paths must not contain '~', '*', '/', '[', or ']'`, t,
|
|
5318
5317
|
/* hasConverter= */ !1,
|
|
5319
5318
|
/* path= */ void 0, r);
|
|
5320
5319
|
try {
|
|
@@ -5332,7 +5331,7 @@ function __PRIVATE_createError(t, e, r, n, i) {
|
|
|
5332
5331
|
r && (a += " (via `toFirestore()`)"), a += ". ";
|
|
5333
5332
|
let u = "";
|
|
5334
5333
|
return (s || o) && (u += " (found", s && (u += ` in field ${n}`), o && (u += ` in document ${i}`),
|
|
5335
|
-
u += ")"), new FirestoreError(
|
|
5334
|
+
u += ")"), new FirestoreError(P, a + t + u);
|
|
5336
5335
|
}
|
|
5337
5336
|
|
|
5338
5337
|
/** Checks `haystack` if FieldPath `needle` is present. Runs in O(n). */ function __PRIVATE_fieldMaskContains(t, e) {
|
|
@@ -5529,7 +5528,7 @@ function query(t, e, ...r) {
|
|
|
5529
5528
|
let n = [];
|
|
5530
5529
|
e instanceof AppliableConstraint && n.push(e), n = n.concat(r), function __PRIVATE_validateQueryConstraintArray(t) {
|
|
5531
5530
|
const e = t.filter((t => t instanceof QueryCompositeFilterConstraint)).length, r = t.filter((t => t instanceof QueryFieldFilterConstraint)).length;
|
|
5532
|
-
if (e > 1 || e > 0 && r > 0) throw new FirestoreError(
|
|
5531
|
+
if (e > 1 || e > 0 && r > 0) throw new FirestoreError(P, "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(...)))`.");
|
|
5533
5532
|
}
|
|
5534
5533
|
/**
|
|
5535
5534
|
* @license
|
|
@@ -5583,7 +5582,7 @@ function query(t, e, ...r) {
|
|
|
5583
5582
|
const e = __PRIVATE_newUserDataReader(t.firestore), r = function __PRIVATE_newQueryFilter(t, e, r, n, i, s, o) {
|
|
5584
5583
|
let a;
|
|
5585
5584
|
if (i.isKeyField()) {
|
|
5586
|
-
if ("array-contains" /* Operator.ARRAY_CONTAINS */ === s || "array-contains-any" /* Operator.ARRAY_CONTAINS_ANY */ === s) throw new FirestoreError(
|
|
5585
|
+
if ("array-contains" /* Operator.ARRAY_CONTAINS */ === s || "array-contains-any" /* Operator.ARRAY_CONTAINS_ANY */ === s) throw new FirestoreError(P, `Invalid Query. You can't perform '${s}' queries on documentId().`);
|
|
5587
5586
|
if ("in" /* Operator.IN */ === s || "not-in" /* Operator.NOT_IN */ === s) {
|
|
5588
5587
|
__PRIVATE_validateDisjunctiveFilterElements(o, s);
|
|
5589
5588
|
const e = [];
|
|
@@ -5710,8 +5709,8 @@ function query(t, e, ...r) {
|
|
|
5710
5709
|
}
|
|
5711
5710
|
_apply(t) {
|
|
5712
5711
|
const e = function __PRIVATE_newQueryOrderBy(t, e, r) {
|
|
5713
|
-
if (null !== t.startAt) throw new FirestoreError(
|
|
5714
|
-
if (null !== t.endAt) throw new FirestoreError(
|
|
5712
|
+
if (null !== t.startAt) throw new FirestoreError(P, "Invalid query. You must not call startAt() or startAfter() before calling orderBy().");
|
|
5713
|
+
if (null !== t.endAt) throw new FirestoreError(P, "Invalid query. You must not call endAt() or endBefore() before calling orderBy().");
|
|
5715
5714
|
return new OrderBy(e, r);
|
|
5716
5715
|
}
|
|
5717
5716
|
/**
|
|
@@ -5871,7 +5870,7 @@ function endAt(...t) {
|
|
|
5871
5870
|
|
|
5872
5871
|
/** Helper function to create a bound from a document or fields */ function __PRIVATE_newQueryBoundFromDocOrFields(t, e, r, n) {
|
|
5873
5872
|
if (r[0] = d(r[0]), r[0] instanceof DocumentSnapshot) return function __PRIVATE_newQueryBoundFromDocument(t, e, r, n, i) {
|
|
5874
|
-
if (!n) throw new FirestoreError(
|
|
5873
|
+
if (!n) throw new FirestoreError(V, `Can't use a DocumentSnapshot that doesn't exist for ${r}().`);
|
|
5875
5874
|
const s = [];
|
|
5876
5875
|
// Because people expect to continue/end a query at the exact document
|
|
5877
5876
|
// provided, we need to use the implicit sort order rather than the explicit
|
|
@@ -5882,10 +5881,10 @@ function endAt(...t) {
|
|
|
5882
5881
|
// results.
|
|
5883
5882
|
for (const r of __PRIVATE_queryNormalizedOrderBy(t)) if (r.field.isKeyField()) s.push(__PRIVATE_refValue(e, n.key)); else {
|
|
5884
5883
|
const t = n.data.field(r.field);
|
|
5885
|
-
if (__PRIVATE_isServerTimestamp(t)) throw new FirestoreError(
|
|
5884
|
+
if (__PRIVATE_isServerTimestamp(t)) throw new FirestoreError(P, 'Invalid query. You are trying to start or end a query using a document for which the field "' + r.field + '" is an uncommitted server timestamp. (Since the value of this field is unknown, you cannot start/end a query with it.)');
|
|
5886
5885
|
if (null === t) {
|
|
5887
5886
|
const t = r.field.canonicalString();
|
|
5888
|
-
throw new FirestoreError(
|
|
5887
|
+
throw new FirestoreError(P, `Invalid query. You are trying to start or end a query using a document for which the field '${t}' (used as the orderBy) does not exist.`);
|
|
5889
5888
|
}
|
|
5890
5889
|
s.push(t);
|
|
5891
5890
|
}
|
|
@@ -5899,15 +5898,15 @@ function endAt(...t) {
|
|
|
5899
5898
|
return function __PRIVATE_newQueryBoundFromFields(t, e, r, n, i, s) {
|
|
5900
5899
|
// Use explicit order by's because it has to match the query the user made
|
|
5901
5900
|
const o = t.explicitOrderBy;
|
|
5902
|
-
if (i.length > o.length) throw new FirestoreError(
|
|
5901
|
+
if (i.length > o.length) throw new FirestoreError(P, `Too many arguments provided to ${n}(). The number of arguments must be less than or equal to the number of orderBy() clauses`);
|
|
5903
5902
|
const a = [];
|
|
5904
5903
|
for (let s = 0; s < i.length; s++) {
|
|
5905
5904
|
const u = i[s];
|
|
5906
5905
|
if (o[s].field.isKeyField()) {
|
|
5907
|
-
if ("string" != typeof u) throw new FirestoreError(
|
|
5908
|
-
if (!__PRIVATE_isCollectionGroupQuery(t) && -1 !== u.indexOf("/")) throw new FirestoreError(
|
|
5906
|
+
if ("string" != typeof u) throw new FirestoreError(P, `Invalid query. Expected a string for document ID in ${n}(), but got a ${typeof u}`);
|
|
5907
|
+
if (!__PRIVATE_isCollectionGroupQuery(t) && -1 !== u.indexOf("/")) throw new FirestoreError(P, `Invalid query. When querying a collection and ordering by documentId(), the value passed to ${n}() must be a plain document ID, but '${u}' contains a slash.`);
|
|
5909
5908
|
const r = t.path.child(ResourcePath.fromString(u));
|
|
5910
|
-
if (!DocumentKey.isDocumentKey(r)) throw new FirestoreError(
|
|
5909
|
+
if (!DocumentKey.isDocumentKey(r)) throw new FirestoreError(P, `Invalid query. When querying a collection group and ordering by documentId(), the value passed to ${n}() must result in a valid document path, but '${r}' is not because it contains an odd number of segments.`);
|
|
5911
5910
|
const i = new DocumentKey(r);
|
|
5912
5911
|
a.push(__PRIVATE_refValue(e, i));
|
|
5913
5912
|
} else {
|
|
@@ -5927,21 +5926,21 @@ function endAt(...t) {
|
|
|
5927
5926
|
|
|
5928
5927
|
function __PRIVATE_parseDocumentIdValue(t, e, r) {
|
|
5929
5928
|
if ("string" == typeof (r = d(r))) {
|
|
5930
|
-
if ("" === r) throw new FirestoreError(
|
|
5931
|
-
if (!__PRIVATE_isCollectionGroupQuery(e) && -1 !== r.indexOf("/")) throw new FirestoreError(
|
|
5929
|
+
if ("" === r) throw new FirestoreError(P, "Invalid query. When querying with documentId(), you must provide a valid document ID, but it was an empty string.");
|
|
5930
|
+
if (!__PRIVATE_isCollectionGroupQuery(e) && -1 !== r.indexOf("/")) throw new FirestoreError(P, `Invalid query. When querying a collection by documentId(), you must provide a plain document ID, but '${r}' contains a '/' character.`);
|
|
5932
5931
|
const n = e.path.child(ResourcePath.fromString(r));
|
|
5933
|
-
if (!DocumentKey.isDocumentKey(n)) throw new FirestoreError(
|
|
5932
|
+
if (!DocumentKey.isDocumentKey(n)) throw new FirestoreError(P, `Invalid query. When querying a collection group by documentId(), the value provided must result in a valid document path, but '${n}' is not because it has an odd number of segments (${n.length}).`);
|
|
5934
5933
|
return __PRIVATE_refValue(t, new DocumentKey(n));
|
|
5935
5934
|
}
|
|
5936
5935
|
if (r instanceof DocumentReference) return __PRIVATE_refValue(t, r._key);
|
|
5937
|
-
throw new FirestoreError(
|
|
5936
|
+
throw new FirestoreError(P, `Invalid query. When querying with documentId(), you must provide a valid string or a DocumentReference, but it was: ${__PRIVATE_valueDescription(r)}.`);
|
|
5938
5937
|
}
|
|
5939
5938
|
|
|
5940
5939
|
/**
|
|
5941
5940
|
* Validates that the value passed into a disjunctive filter satisfies all
|
|
5942
5941
|
* array requirements.
|
|
5943
5942
|
*/ function __PRIVATE_validateDisjunctiveFilterElements(t, e) {
|
|
5944
|
-
if (!Array.isArray(t) || 0 === t.length) throw new FirestoreError(
|
|
5943
|
+
if (!Array.isArray(t) || 0 === t.length) throw new FirestoreError(P, `Invalid Query. A non-empty array is required for '${e.toString()}' filters.`);
|
|
5945
5944
|
}
|
|
5946
5945
|
|
|
5947
5946
|
/**
|
|
@@ -5975,11 +5974,11 @@ function __PRIVATE_parseDocumentIdValue(t, e, r) {
|
|
|
5975
5974
|
}(e.op));
|
|
5976
5975
|
if (null !== r)
|
|
5977
5976
|
// Special case when it's a duplicate op to give a slightly clearer error message.
|
|
5978
|
-
throw r === e.op ? new FirestoreError(
|
|
5977
|
+
throw r === e.op ? new FirestoreError(P, `Invalid query. You cannot use more than one '${e.op.toString()}' filter.`) : new FirestoreError(P, `Invalid query. You cannot use '${e.op.toString()}' filters with '${r.toString()}' filters.`);
|
|
5979
5978
|
}
|
|
5980
5979
|
|
|
5981
5980
|
function __PRIVATE_validateQueryFilterConstraint(t, e) {
|
|
5982
|
-
if (!(e instanceof QueryFieldFilterConstraint || e instanceof QueryCompositeFilterConstraint)) throw new FirestoreError(
|
|
5981
|
+
if (!(e instanceof QueryFieldFilterConstraint || e instanceof QueryCompositeFilterConstraint)) throw new FirestoreError(P, `Function ${t}() requires AppliableConstraints created with a call to 'where(...)', 'or(...)', or 'and(...)'.`);
|
|
5983
5982
|
}
|
|
5984
5983
|
|
|
5985
5984
|
/**
|
|
@@ -6146,7 +6145,7 @@ class __PRIVATE_LiteUserDataWriter extends class AbstractUserDataWriter {
|
|
|
6146
6145
|
* @returns A Promise that will be resolved with the results of the query.
|
|
6147
6146
|
*/ function getDocs(t) {
|
|
6148
6147
|
(function __PRIVATE_validateHasExplicitOrderByForLimitToLast(t) {
|
|
6149
|
-
if ("L" /* LimitType.Last */ === t.limitType && 0 === t.explicitOrderBy.length) throw new FirestoreError(
|
|
6148
|
+
if ("L" /* LimitType.Last */ === t.limitType && 0 === t.explicitOrderBy.length) throw new FirestoreError(b, "limitToLast() queries require specifying at least one orderBy() clause");
|
|
6150
6149
|
})((t = __PRIVATE_cast(t, Query))._query);
|
|
6151
6150
|
const e = __PRIVATE_getDatastore(t.firestore), r = new __PRIVATE_LiteUserDataWriter(t.firestore);
|
|
6152
6151
|
return __PRIVATE_invokeRunQueryRpc(e, t._query).then((e => {
|
|
@@ -6483,12 +6482,12 @@ function sum(t) {
|
|
|
6483
6482
|
return this._verifyNotCommitted(), this._committed = !0, this._mutations.length > 0 ? this._commitHandler(this._mutations) : Promise.resolve();
|
|
6484
6483
|
}
|
|
6485
6484
|
_verifyNotCommitted() {
|
|
6486
|
-
if (this._committed) throw new FirestoreError(
|
|
6485
|
+
if (this._committed) throw new FirestoreError(F, "A write batch can no longer be used after commit() has been called.");
|
|
6487
6486
|
}
|
|
6488
6487
|
}
|
|
6489
6488
|
|
|
6490
6489
|
function __PRIVATE_validateReference(t, e) {
|
|
6491
|
-
if ((t = d(t)).firestore !== e) throw new FirestoreError(
|
|
6490
|
+
if ((t = d(t)).firestore !== e) throw new FirestoreError(P, "Provided document reference is from a different Firestore instance.");
|
|
6492
6491
|
return t;
|
|
6493
6492
|
}
|
|
6494
6493
|
|
|
@@ -6547,7 +6546,7 @@ function __PRIVATE_validateReference(t, e) {
|
|
|
6547
6546
|
this.writtenDocs = new Set;
|
|
6548
6547
|
}
|
|
6549
6548
|
async lookup(t) {
|
|
6550
|
-
if (this.ensureCommitNotCalled(), this.mutations.length > 0) throw this.lastTransactionError = new FirestoreError(
|
|
6549
|
+
if (this.ensureCommitNotCalled(), this.mutations.length > 0) throw this.lastTransactionError = new FirestoreError(P, "Firestore transactions require all reads to be executed before all writes."),
|
|
6551
6550
|
this.lastTransactionError;
|
|
6552
6551
|
const e = await __PRIVATE_invokeBatchGetDocumentsRpc(this.datastore, t);
|
|
6553
6552
|
return e.forEach((t => this.recordVersion(t))), e;
|
|
@@ -6591,7 +6590,7 @@ function __PRIVATE_validateReference(t, e) {
|
|
|
6591
6590
|
if (r) {
|
|
6592
6591
|
if (!e.isEqual(r))
|
|
6593
6592
|
// This transaction will fail no matter what.
|
|
6594
|
-
throw new FirestoreError(
|
|
6593
|
+
throw new FirestoreError(v, "Document version changed between two reads.");
|
|
6595
6594
|
} else this.readVersions.set(t.key.toString(), e);
|
|
6596
6595
|
}
|
|
6597
6596
|
/**
|
|
@@ -6618,7 +6617,7 @@ function __PRIVATE_validateReference(t, e) {
|
|
|
6618
6617
|
// express that to the backend, we have to validate locally.
|
|
6619
6618
|
// Note: this can change once we can send separate verify writes in the
|
|
6620
6619
|
// transaction.
|
|
6621
|
-
throw new FirestoreError(
|
|
6620
|
+
throw new FirestoreError(P, "Can't update a document that doesn't exist.");
|
|
6622
6621
|
// Document exists, base precondition on document update time.
|
|
6623
6622
|
return Precondition.updateTime(e);
|
|
6624
6623
|
}
|
|
@@ -6647,7 +6646,7 @@ function __PRIVATE_validateReference(t, e) {
|
|
|
6647
6646
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
6648
6647
|
* See the License for the specific language governing permissions and
|
|
6649
6648
|
* limitations under the License.
|
|
6650
|
-
*/ const
|
|
6649
|
+
*/ const K = {
|
|
6651
6650
|
maxAttempts: 5
|
|
6652
6651
|
};
|
|
6653
6652
|
|
|
@@ -6724,29 +6723,29 @@ class __PRIVATE_TransactionRunner {
|
|
|
6724
6723
|
default:
|
|
6725
6724
|
return fail();
|
|
6726
6725
|
|
|
6726
|
+
case T:
|
|
6727
6727
|
case R:
|
|
6728
|
-
case
|
|
6729
|
-
case
|
|
6730
|
-
case
|
|
6728
|
+
case I:
|
|
6729
|
+
case g:
|
|
6730
|
+
case C:
|
|
6731
6731
|
case S:
|
|
6732
|
-
case N:
|
|
6733
6732
|
// Unauthenticated means something went wrong with our token and we need
|
|
6734
6733
|
// to retry with new credentials which will happen automatically.
|
|
6735
|
-
case
|
|
6734
|
+
case w:
|
|
6736
6735
|
return !1;
|
|
6737
6736
|
|
|
6738
|
-
case
|
|
6737
|
+
case P:
|
|
6738
|
+
case V:
|
|
6739
6739
|
case p:
|
|
6740
6740
|
case y:
|
|
6741
|
-
case
|
|
6742
|
-
case v:
|
|
6741
|
+
case F:
|
|
6743
6742
|
// Aborted might be retried in some scenarios, but that is dependant on
|
|
6744
6743
|
// the context and should handled individually by the calling code.
|
|
6745
6744
|
// See https://cloud.google.com/apis/design/errors.
|
|
6746
|
-
case
|
|
6745
|
+
case v:
|
|
6746
|
+
case D:
|
|
6747
6747
|
case b:
|
|
6748
|
-
case
|
|
6749
|
-
case O:
|
|
6748
|
+
case N:
|
|
6750
6749
|
return !0;
|
|
6751
6750
|
}
|
|
6752
6751
|
}(e);
|
|
@@ -6851,7 +6850,7 @@ class __PRIVATE_TransactionRunner {
|
|
|
6851
6850
|
* As long as the operation has not yet been run, calling cancel() provides a
|
|
6852
6851
|
* guarantee that the operation will not be run.
|
|
6853
6852
|
*/ cancel(t) {
|
|
6854
|
-
null !== this.timerHandle && (this.clearTimeout(), this.deferred.reject(new FirestoreError(
|
|
6853
|
+
null !== this.timerHandle && (this.clearTimeout(), this.deferred.reject(new FirestoreError(T, "Operation cancelled" + (t ? ": " + t : ""))));
|
|
6855
6854
|
}
|
|
6856
6855
|
handleDelayElapsed() {
|
|
6857
6856
|
this.asyncQueue.enqueueAndForget((() => null !== this.timerHandle ? (this.clearTimeout(),
|
|
@@ -7179,9 +7178,9 @@ class Transaction {
|
|
|
7179
7178
|
* `updateFunction `is returned here. Otherwise, if the transaction failed, a
|
|
7180
7179
|
* rejected promise with the corresponding failure error is returned.
|
|
7181
7180
|
*/ function runTransaction(t, e, r) {
|
|
7182
|
-
const n = __PRIVATE_getDatastore(t = __PRIVATE_cast(t, Firestore)), i = Object.assign(Object.assign({},
|
|
7181
|
+
const n = __PRIVATE_getDatastore(t = __PRIVATE_cast(t, Firestore)), i = Object.assign(Object.assign({}, K), r);
|
|
7183
7182
|
!function __PRIVATE_validateTransactionOptions(t) {
|
|
7184
|
-
if (t.maxAttempts < 1) throw new FirestoreError(
|
|
7183
|
+
if (t.maxAttempts < 1) throw new FirestoreError(P, "Max attempts must be at least 1");
|
|
7185
7184
|
}(i);
|
|
7186
7185
|
const s = new __PRIVATE_Deferred;
|
|
7187
7186
|
return new __PRIVATE_TransactionRunner(function __PRIVATE_newAsyncQueue() {
|
|
@@ -7198,10 +7197,10 @@ class Transaction {
|
|
|
7198
7197
|
* @packageDocumentation
|
|
7199
7198
|
*/ !function __PRIVATE_registerFirestore() {
|
|
7200
7199
|
!function __PRIVATE_setSDKVersion(t) {
|
|
7201
|
-
|
|
7200
|
+
E = t;
|
|
7202
7201
|
}(`${i}_lite`), r(new s("firestore/lite", ((t, {instanceIdentifier: e, options: r}) => {
|
|
7203
7202
|
const n = t.getProvider("app").getImmediate(), i = new Firestore(new __PRIVATE_LiteAuthCredentialsProvider(t.getProvider("auth-internal")), new __PRIVATE_LiteAppCheckTokenProvider(t.getProvider("app-check-internal")), function __PRIVATE_databaseIdFromApp(t, e) {
|
|
7204
|
-
if (!Object.prototype.hasOwnProperty.apply(t.options, [ "projectId" ])) throw new FirestoreError(
|
|
7203
|
+
if (!Object.prototype.hasOwnProperty.apply(t.options, [ "projectId" ])) throw new FirestoreError(P, '"projectId" not provided in firebase.initializeApp.');
|
|
7205
7204
|
return new DatabaseId(t.options.projectId, e);
|
|
7206
7205
|
}
|
|
7207
7206
|
/**
|
|
@@ -7223,7 +7222,7 @@ class Transaction {
|
|
|
7223
7222
|
return r && i._setSettings(r), i;
|
|
7224
7223
|
}), "PUBLIC").setMultipleInstances(!0)),
|
|
7225
7224
|
// RUNTIME_ENV and BUILD_TARGET are replaced by real values during the compilation
|
|
7226
|
-
n("firestore-lite",
|
|
7225
|
+
n("firestore-lite", "4.6.2-20240508213348", "rn"), n("firestore-lite", "4.6.2-20240508213348", "esm2017");
|
|
7227
7226
|
}();
|
|
7228
7227
|
|
|
7229
7228
|
export { AggregateField, AggregateQuerySnapshot, Bytes, CollectionReference, DocumentReference, DocumentSnapshot, FieldPath, FieldValue, Firestore, FirestoreError, GeoPoint, Query, QueryCompositeFilterConstraint, QueryConstraint, QueryDocumentSnapshot, QueryEndAtConstraint, QueryFieldFilterConstraint, QueryLimitConstraint, QueryOrderByConstraint, QuerySnapshot, QueryStartAtConstraint, Timestamp, Transaction, WriteBatch, addDoc, aggregateFieldEqual, aggregateQuerySnapshotEqual, and, arrayRemove, arrayUnion, average, collection, collectionGroup, connectFirestoreEmulator, count, deleteDoc, deleteField, doc, documentId, endAt, endBefore, getAggregate, getCount, getDoc, getDocs, getFirestore, increment, initializeFirestore, limit, limitToLast, or, orderBy, query, queryEqual, refEqual, runTransaction, serverTimestamp, setDoc, setLogLevel, snapshotEqual, startAfter, startAt, sum, terminate, updateDoc, where, writeBatch };
|