@firebase/firestore 4.6.2-canary.8fb372afb → 4.6.2-dataconnect-preview.877f8b7d0
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 +153 -152
- package/dist/lite/index.browser.esm2017.js.map +1 -1
- package/dist/lite/index.browser.esm5.js +905 -904
- package/dist/lite/index.browser.esm5.js.map +1 -1
- package/dist/lite/index.cjs.js +153 -152
- 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 +153 -152
- 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
package/dist/index.rn.js
CHANGED
|
@@ -10,7 +10,7 @@ import { Integer as A, Md5 as R } from "@firebase/webchannel-wrapper/bloom-blob"
|
|
|
10
10
|
|
|
11
11
|
import { XhrIo as V, EventType as m, ErrorCode as f, createWebChannelTransport as g, getStatEventTarget as p, FetchXmlHttpFactory as y, WebChannel as w, Event as S, Stat as b } from "@firebase/webchannel-wrapper/webchannel-blob";
|
|
12
12
|
|
|
13
|
-
const D = "@firebase/firestore";
|
|
13
|
+
const D = "@firebase/firestore", C = "4.6.2-dataconnect-preview.877f8b7d0";
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
16
|
* @license
|
|
@@ -72,7 +72,7 @@ User.MOCK_USER = new User("mock-user");
|
|
|
72
72
|
* See the License for the specific language governing permissions and
|
|
73
73
|
* limitations under the License.
|
|
74
74
|
*/
|
|
75
|
-
let
|
|
75
|
+
let v = "10.12.0-dataconnect-preview.877f8b7d0";
|
|
76
76
|
|
|
77
77
|
/**
|
|
78
78
|
* @license
|
|
@@ -90,11 +90,11 @@ let C = "10.12.0-canary.8fb372afb";
|
|
|
90
90
|
* See the License for the specific language governing permissions and
|
|
91
91
|
* limitations under the License.
|
|
92
92
|
*/
|
|
93
|
-
const
|
|
93
|
+
const F = new o("@firebase/firestore");
|
|
94
94
|
|
|
95
95
|
// Helper methods are needed because variables can't be exported as read/write
|
|
96
96
|
function __PRIVATE_getLogLevel() {
|
|
97
|
-
return
|
|
97
|
+
return F.logLevel;
|
|
98
98
|
}
|
|
99
99
|
|
|
100
100
|
/**
|
|
@@ -110,29 +110,29 @@ function __PRIVATE_getLogLevel() {
|
|
|
110
110
|
* <li><code>`silent` to turn off logging.</li>
|
|
111
111
|
* </ul>
|
|
112
112
|
*/ function setLogLevel(e) {
|
|
113
|
-
|
|
113
|
+
F.setLogLevel(e);
|
|
114
114
|
}
|
|
115
115
|
|
|
116
116
|
function __PRIVATE_logDebug(e, ...t) {
|
|
117
|
-
if (
|
|
117
|
+
if (F.logLevel <= _.DEBUG) {
|
|
118
118
|
const n = t.map(__PRIVATE_argToString);
|
|
119
|
-
|
|
119
|
+
F.debug(`Firestore (${v}): ${e}`, ...n);
|
|
120
120
|
}
|
|
121
121
|
}
|
|
122
122
|
|
|
123
123
|
function __PRIVATE_logError(e, ...t) {
|
|
124
|
-
if (
|
|
124
|
+
if (F.logLevel <= _.ERROR) {
|
|
125
125
|
const n = t.map(__PRIVATE_argToString);
|
|
126
|
-
|
|
126
|
+
F.error(`Firestore (${v}): ${e}`, ...n);
|
|
127
127
|
}
|
|
128
128
|
}
|
|
129
129
|
|
|
130
130
|
/**
|
|
131
131
|
* @internal
|
|
132
132
|
*/ function __PRIVATE_logWarn(e, ...t) {
|
|
133
|
-
if (
|
|
133
|
+
if (F.logLevel <= _.WARN) {
|
|
134
134
|
const n = t.map(__PRIVATE_argToString);
|
|
135
|
-
|
|
135
|
+
F.warn(`Firestore (${v}): ${e}`, ...n);
|
|
136
136
|
}
|
|
137
137
|
}
|
|
138
138
|
|
|
@@ -193,7 +193,7 @@ function __PRIVATE_logError(e, ...t) {
|
|
|
193
193
|
*/ function fail(e = "Unexpected state") {
|
|
194
194
|
// Log the failure in addition to throw an exception, just in case the
|
|
195
195
|
// exception is swallowed.
|
|
196
|
-
const t = `FIRESTORE (${
|
|
196
|
+
const t = `FIRESTORE (${v}) INTERNAL ASSERTION FAILED: ` + e;
|
|
197
197
|
// NOTE: We don't use FirestoreError here because these are internal failures
|
|
198
198
|
// that cannot be handled by the user. (Also it would create a circular
|
|
199
199
|
// dependency between the error and assert modules which doesn't work.)
|
|
@@ -246,7 +246,7 @@ t) {
|
|
|
246
246
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
247
247
|
* See the License for the specific language governing permissions and
|
|
248
248
|
* limitations under the License.
|
|
249
|
-
*/ const
|
|
249
|
+
*/ const M = {
|
|
250
250
|
// Causes are copied from:
|
|
251
251
|
// https://github.com/grpc/grpc/blob/bceec94ea4fc5f0085d81235d8e1c06798dc341a/include/grpc%2B%2B/impl/codegen/status_code_enum.h
|
|
252
252
|
/** Not an error; returned on success. */
|
|
@@ -791,11 +791,11 @@ class Timestamp {
|
|
|
791
791
|
* The fractions of a second at nanosecond resolution.*
|
|
792
792
|
*/
|
|
793
793
|
t) {
|
|
794
|
-
if (this.seconds = e, this.nanoseconds = t, t < 0) throw new FirestoreError(
|
|
795
|
-
if (t >= 1e9) throw new FirestoreError(
|
|
796
|
-
if (e < -62135596800) throw new FirestoreError(
|
|
794
|
+
if (this.seconds = e, this.nanoseconds = t, t < 0) throw new FirestoreError(M.INVALID_ARGUMENT, "Timestamp nanoseconds out of range: " + t);
|
|
795
|
+
if (t >= 1e9) throw new FirestoreError(M.INVALID_ARGUMENT, "Timestamp nanoseconds out of range: " + t);
|
|
796
|
+
if (e < -62135596800) throw new FirestoreError(M.INVALID_ARGUMENT, "Timestamp seconds out of range: " + e);
|
|
797
797
|
// This will break in the year 10,000.
|
|
798
|
-
if (e >= 253402300800) throw new FirestoreError(
|
|
798
|
+
if (e >= 253402300800) throw new FirestoreError(M.INVALID_ARGUMENT, "Timestamp seconds out of range: " + e);
|
|
799
799
|
}
|
|
800
800
|
/**
|
|
801
801
|
* Creates a new timestamp with the current date, with millisecond precision.
|
|
@@ -1050,7 +1050,7 @@ class BasePath {
|
|
|
1050
1050
|
// for legacy reasons and should not be used frequently).
|
|
1051
1051
|
const t = [];
|
|
1052
1052
|
for (const n of e) {
|
|
1053
|
-
if (n.indexOf("//") >= 0) throw new FirestoreError(
|
|
1053
|
+
if (n.indexOf("//") >= 0) throw new FirestoreError(M.INVALID_ARGUMENT, `Invalid segment (${n}). Paths must not contain // in them.`);
|
|
1054
1054
|
// Strip leading and traling slashed.
|
|
1055
1055
|
t.push(...n.split("/").filter((e => e.length > 0)));
|
|
1056
1056
|
}
|
|
@@ -1061,7 +1061,7 @@ class BasePath {
|
|
|
1061
1061
|
}
|
|
1062
1062
|
}
|
|
1063
1063
|
|
|
1064
|
-
const
|
|
1064
|
+
const x = /^[_a-zA-Z][_a-zA-Z0-9]*$/;
|
|
1065
1065
|
|
|
1066
1066
|
/**
|
|
1067
1067
|
* A dot-separated path for navigating sub-objects within a document.
|
|
@@ -1074,7 +1074,7 @@ const M = /^[_a-zA-Z][_a-zA-Z0-9]*$/;
|
|
|
1074
1074
|
* Returns true if the string could be used as a segment in a field path
|
|
1075
1075
|
* without escaping.
|
|
1076
1076
|
*/ static isValidIdentifier(e) {
|
|
1077
|
-
return
|
|
1077
|
+
return x.test(e);
|
|
1078
1078
|
}
|
|
1079
1079
|
canonicalString() {
|
|
1080
1080
|
return this.toArray().map((e => (e = e.replace(/\\/g, "\\\\").replace(/`/g, "\\`"),
|
|
@@ -1106,21 +1106,21 @@ const M = /^[_a-zA-Z][_a-zA-Z0-9]*$/;
|
|
|
1106
1106
|
const t = [];
|
|
1107
1107
|
let n = "", r = 0;
|
|
1108
1108
|
const __PRIVATE_addCurrentSegment = () => {
|
|
1109
|
-
if (0 === n.length) throw new FirestoreError(
|
|
1109
|
+
if (0 === n.length) throw new FirestoreError(M.INVALID_ARGUMENT, `Invalid field path (${e}). Paths must not be empty, begin with '.', end with '.', or contain '..'`);
|
|
1110
1110
|
t.push(n), n = "";
|
|
1111
1111
|
};
|
|
1112
1112
|
let i = !1;
|
|
1113
1113
|
for (;r < e.length; ) {
|
|
1114
1114
|
const t = e[r];
|
|
1115
1115
|
if ("\\" === t) {
|
|
1116
|
-
if (r + 1 === e.length) throw new FirestoreError(
|
|
1116
|
+
if (r + 1 === e.length) throw new FirestoreError(M.INVALID_ARGUMENT, "Path has trailing escape character: " + e);
|
|
1117
1117
|
const t = e[r + 1];
|
|
1118
|
-
if ("\\" !== t && "." !== t && "`" !== t) throw new FirestoreError(
|
|
1118
|
+
if ("\\" !== t && "." !== t && "`" !== t) throw new FirestoreError(M.INVALID_ARGUMENT, "Path has invalid escape sequence: " + e);
|
|
1119
1119
|
n += t, r += 2;
|
|
1120
1120
|
} else "`" === t ? (i = !i, r++) : "." !== t || i ? (n += t, r++) : (__PRIVATE_addCurrentSegment(),
|
|
1121
1121
|
r++);
|
|
1122
1122
|
}
|
|
1123
|
-
if (__PRIVATE_addCurrentSegment(), i) throw new FirestoreError(
|
|
1123
|
+
if (__PRIVATE_addCurrentSegment(), i) throw new FirestoreError(M.INVALID_ARGUMENT, "Unterminated ` in path: " + e);
|
|
1124
1124
|
return new FieldPath$1(t);
|
|
1125
1125
|
}
|
|
1126
1126
|
static emptyPath() {
|
|
@@ -1372,7 +1372,7 @@ function __PRIVATE_indexOffsetComparator(e, t) {
|
|
|
1372
1372
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1373
1373
|
* See the License for the specific language governing permissions and
|
|
1374
1374
|
* limitations under the License.
|
|
1375
|
-
*/ const
|
|
1375
|
+
*/ const O = "The current tab is not in the required state to perform this operation. It might be necessary to refresh the browser tab.";
|
|
1376
1376
|
|
|
1377
1377
|
/**
|
|
1378
1378
|
* A base class representing a persistence transaction, encapsulating both the
|
|
@@ -1419,7 +1419,7 @@ function __PRIVATE_indexOffsetComparator(e, t) {
|
|
|
1419
1419
|
* @param err - An error returned by a LocalStore operation.
|
|
1420
1420
|
* @returns A Promise that resolves after we recovered, or the original error.
|
|
1421
1421
|
*/ async function __PRIVATE_ignoreIfPrimaryLeaseLoss(e) {
|
|
1422
|
-
if (e.code !==
|
|
1422
|
+
if (e.code !== M.FAILED_PRECONDITION || e.message !== O) throw e;
|
|
1423
1423
|
__PRIVATE_logDebug("LocalStore", "Unexpectedly lost primary lease");
|
|
1424
1424
|
}
|
|
1425
1425
|
|
|
@@ -1724,7 +1724,7 @@ class __PRIVATE_SimpleDbTransaction {
|
|
|
1724
1724
|
n(new __PRIVATE_IndexedDbTransactionError(e, "Cannot upgrade IndexedDB schema while another tab is open. Close all tabs that access Firestore and reload this page to proceed."));
|
|
1725
1725
|
}, r.onerror = t => {
|
|
1726
1726
|
const r = t.target.error;
|
|
1727
|
-
"VersionError" === r.name ? n(new FirestoreError(
|
|
1727
|
+
"VersionError" === r.name ? n(new FirestoreError(M.FAILED_PRECONDITION, "A newer version of the Firestore SDK was previously used and so the persisted data is not compatible with the version of the SDK you are now using. The SDK will operate with persistence disabled. If you need persistence, please re-upgrade to a newer version of the SDK or else clear the persisted IndexedDB data for your app to start fresh.")) : "InvalidStateError" === r.name ? n(new FirestoreError(M.FAILED_PRECONDITION, "Unable to open an IndexedDB connection. This could be due to running in a private browsing session on a browser whose private browsing sessions do not support IndexedDB: " + r)) : n(new __PRIVATE_IndexedDbTransactionError(e, r));
|
|
1728
1728
|
}, r.onupgradeneeded = e => {
|
|
1729
1729
|
__PRIVATE_logDebug("SimpleDb", 'Database "' + this.name + '" requires upgrade from version:', e.oldVersion);
|
|
1730
1730
|
const t = e.target.result;
|
|
@@ -1816,7 +1816,7 @@ class __PRIVATE_SimpleDbTransaction {
|
|
|
1816
1816
|
|
|
1817
1817
|
/** An error that wraps exceptions that thrown during IndexedDB execution. */ class __PRIVATE_IndexedDbTransactionError extends FirestoreError {
|
|
1818
1818
|
constructor(e, t) {
|
|
1819
|
-
super(
|
|
1819
|
+
super(M.UNAVAILABLE, `IndexedDB transaction '${e}' failed: ${t}`), this.name = "IndexedDbTransactionError";
|
|
1820
1820
|
}
|
|
1821
1821
|
}
|
|
1822
1822
|
|
|
@@ -2000,7 +2000,7 @@ class __PRIVATE_SimpleDbTransaction {
|
|
|
2000
2000
|
}
|
|
2001
2001
|
|
|
2002
2002
|
// Guard so we only report the error once.
|
|
2003
|
-
let
|
|
2003
|
+
let N = !1;
|
|
2004
2004
|
|
|
2005
2005
|
function __PRIVATE_checkForAndReportiOSError(e) {
|
|
2006
2006
|
const t = __PRIVATE_SimpleDb.S(u());
|
|
@@ -2009,7 +2009,7 @@ function __PRIVATE_checkForAndReportiOSError(e) {
|
|
|
2009
2009
|
if (e.message.indexOf(t) >= 0) {
|
|
2010
2010
|
// Wrap error in a more descriptive one.
|
|
2011
2011
|
const e = new FirestoreError("internal", `IOS_INDEXEDDB_BUG1: IndexedDb has thrown '${t}'. This is likely due to an unavoidable bug in iOS. See https://stackoverflow.com/q/56496296/110915 for details and a potential workaround.`);
|
|
2012
|
-
return
|
|
2012
|
+
return N || (N = !0,
|
|
2013
2013
|
// Throw a global exception outside of this promise chain, for the user to
|
|
2014
2014
|
// potentially catch.
|
|
2015
2015
|
setTimeout((() => {
|
|
@@ -2261,7 +2261,7 @@ function __PRIVATE_encodeResourcePath(e) {
|
|
|
2261
2261
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2262
2262
|
* See the License for the specific language governing permissions and
|
|
2263
2263
|
* limitations under the License.
|
|
2264
|
-
*/ const
|
|
2264
|
+
*/ const L = [ "userId", "batchId" ];
|
|
2265
2265
|
|
|
2266
2266
|
/**
|
|
2267
2267
|
* @license
|
|
@@ -2306,7 +2306,7 @@ function __PRIVATE_newDbDocumentMutationPrefixForPath(e, t) {
|
|
|
2306
2306
|
* there is no useful information to store as the value. The raw (unencoded)
|
|
2307
2307
|
* path cannot be stored because IndexedDb doesn't store prototype
|
|
2308
2308
|
* information.
|
|
2309
|
-
*/ const
|
|
2309
|
+
*/ const B = {}, k = [ "prefixPath", "collectionGroup", "readTime", "documentId" ], q = [ "prefixPath", "collectionGroup", "documentId" ], Q = [ "collectionGroup", "readTime", "prefixPath", "documentId" ], K = [ "canonicalId", "targetId" ], $ = [ "targetId", "path" ], U = [ "path", "targetId" ], W = [ "collectionId", "parent" ], G = [ "indexId", "uid" ], z = [ "uid", "sequenceNumber" ], j = [ "indexId", "uid", "arrayValue", "directionalValue", "orderedDocumentKey", "documentKey" ], H = [ "indexId", "uid", "orderedDocumentKey" ], J = [ "userId", "collectionPath", "documentId" ], Y = [ "userId", "collectionPath", "largestBatchId" ], Z = [ "userId", "collectionGroup", "largestBatchId" ], X = [ ...[ ...[ ...[ ...[ "mutationQueues", "mutations", "documentMutations", "remoteDocuments", "targets", "owner", "targetGlobal", "targetDocuments" ], "clientMetadata" ], "remoteDocumentGlobal" ], "collectionParents" ], "bundles", "namedQueries" ], ee = [ ...X, "documentOverlays" ], te = [ "mutationQueues", "mutations", "documentMutations", "remoteDocumentsV14", "targets", "owner", "targetGlobal", "targetDocuments", "clientMetadata", "remoteDocumentGlobal", "collectionParents", "bundles", "namedQueries", "documentOverlays" ], ne = te, re = [ ...ne, "indexConfiguration", "indexState", "indexEntries" ], ie = re;
|
|
2310
2310
|
|
|
2311
2311
|
/**
|
|
2312
2312
|
* @license
|
|
@@ -3076,7 +3076,7 @@ function __PRIVATE_isBase64Available() {
|
|
|
3076
3076
|
|
|
3077
3077
|
ByteString.EMPTY_BYTE_STRING = new ByteString("");
|
|
3078
3078
|
|
|
3079
|
-
const
|
|
3079
|
+
const se = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
|
|
3080
3080
|
|
|
3081
3081
|
/**
|
|
3082
3082
|
* Converts the possible Proto values for a timestamp value into a "seconds and
|
|
@@ -3090,7 +3090,7 @@ const ie = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
|
|
|
3090
3090
|
// (millis), so we do some custom parsing here.
|
|
3091
3091
|
// Parse the nanos right out of the string.
|
|
3092
3092
|
let t = 0;
|
|
3093
|
-
const n =
|
|
3093
|
+
const n = se.exec(e);
|
|
3094
3094
|
if (__PRIVATE_hardAssert(!!n), n[1]) {
|
|
3095
3095
|
// Pad the fraction out to 9 digits (nanos).
|
|
3096
3096
|
let e = n[1];
|
|
@@ -3257,7 +3257,7 @@ class DatabaseId {
|
|
|
3257
3257
|
* See the License for the specific language governing permissions and
|
|
3258
3258
|
* limitations under the License.
|
|
3259
3259
|
*/
|
|
3260
|
-
const
|
|
3260
|
+
const oe = {
|
|
3261
3261
|
mapValue: {
|
|
3262
3262
|
fields: {
|
|
3263
3263
|
__type__: {
|
|
@@ -3265,7 +3265,7 @@ const se = {
|
|
|
3265
3265
|
}
|
|
3266
3266
|
}
|
|
3267
3267
|
}
|
|
3268
|
-
},
|
|
3268
|
+
}, _e = {
|
|
3269
3269
|
nullValue: "NULL_VALUE"
|
|
3270
3270
|
};
|
|
3271
3271
|
|
|
@@ -3409,9 +3409,9 @@ function __PRIVATE_valueCompare(e, t) {
|
|
|
3409
3409
|
|
|
3410
3410
|
case 10 /* TypeOrder.ObjectValue */ :
|
|
3411
3411
|
return function __PRIVATE_compareMaps(e, t) {
|
|
3412
|
-
if (e ===
|
|
3413
|
-
if (e ===
|
|
3414
|
-
if (t ===
|
|
3412
|
+
if (e === oe.mapValue && t === oe.mapValue) return 0;
|
|
3413
|
+
if (e === oe.mapValue) return 1;
|
|
3414
|
+
if (t === oe.mapValue) return -1;
|
|
3415
3415
|
const n = e.fields || {}, r = Object.keys(n), i = t.fields || {}, s = Object.keys(i);
|
|
3416
3416
|
// Even though MapValues are likely sorted correctly based on their insertion
|
|
3417
3417
|
// order (e.g. when received from the backend), local modifications can bring
|
|
@@ -3587,7 +3587,7 @@ function isArray(e) {
|
|
|
3587
3587
|
}
|
|
3588
3588
|
|
|
3589
3589
|
/** Returns the lowest value for the given value type (inclusive). */ function __PRIVATE_valuesGetLowerBound(e) {
|
|
3590
|
-
return "nullValue" in e ?
|
|
3590
|
+
return "nullValue" in e ? _e : "booleanValue" in e ? {
|
|
3591
3591
|
booleanValue: !1
|
|
3592
3592
|
} : "integerValue" in e || "doubleValue" in e ? {
|
|
3593
3593
|
doubleValue: NaN
|
|
@@ -3633,7 +3633,7 @@ function isArray(e) {
|
|
|
3633
3633
|
arrayValue: {}
|
|
3634
3634
|
} : "arrayValue" in e ? {
|
|
3635
3635
|
mapValue: {}
|
|
3636
|
-
} : "mapValue" in e ?
|
|
3636
|
+
} : "mapValue" in e ? oe : fail();
|
|
3637
3637
|
}
|
|
3638
3638
|
|
|
3639
3639
|
function __PRIVATE_lowerBoundCompare(e, t) {
|
|
@@ -4321,10 +4321,10 @@ function __PRIVATE_targetIsDocumentTarget(e) {
|
|
|
4321
4321
|
* the provided `fieldPath` (or the upper bound for an descending segment).
|
|
4322
4322
|
*/
|
|
4323
4323
|
function __PRIVATE_targetGetAscendingBound(e, t, n) {
|
|
4324
|
-
let r =
|
|
4324
|
+
let r = _e, i = !0;
|
|
4325
4325
|
// Process all filters to find a value for the current field segment
|
|
4326
4326
|
for (const n of __PRIVATE_targetGetFieldFiltersForPath(e, t)) {
|
|
4327
|
-
let e =
|
|
4327
|
+
let e = _e, t = !0;
|
|
4328
4328
|
switch (n.op) {
|
|
4329
4329
|
case "<" /* Operator.LESS_THAN */ :
|
|
4330
4330
|
case "<=" /* Operator.LESS_THAN_OR_EQUAL */ :
|
|
@@ -4343,7 +4343,7 @@ function __PRIVATE_targetGetAscendingBound(e, t, n) {
|
|
|
4343
4343
|
|
|
4344
4344
|
case "!=" /* Operator.NOT_EQUAL */ :
|
|
4345
4345
|
case "not-in" /* Operator.NOT_IN */ :
|
|
4346
|
-
e =
|
|
4346
|
+
e = _e;
|
|
4347
4347
|
// Remaining filters cannot be used as lower bounds.
|
|
4348
4348
|
}
|
|
4349
4349
|
__PRIVATE_lowerBoundCompare({
|
|
@@ -4379,10 +4379,10 @@ function __PRIVATE_targetGetAscendingBound(e, t, n) {
|
|
|
4379
4379
|
* Returns the value to use as the upper bound for ascending index segment at
|
|
4380
4380
|
* the provided `fieldPath` (or the lower bound for a descending segment).
|
|
4381
4381
|
*/ function __PRIVATE_targetGetDescendingBound(e, t, n) {
|
|
4382
|
-
let r =
|
|
4382
|
+
let r = oe, i = !0;
|
|
4383
4383
|
// Process all filters to find a value for the current field segment
|
|
4384
4384
|
for (const n of __PRIVATE_targetGetFieldFiltersForPath(e, t)) {
|
|
4385
|
-
let e =
|
|
4385
|
+
let e = oe, t = !0;
|
|
4386
4386
|
switch (n.op) {
|
|
4387
4387
|
case ">=" /* Operator.GREATER_THAN_OR_EQUAL */ :
|
|
4388
4388
|
case ">" /* Operator.GREATER_THAN */ :
|
|
@@ -4401,7 +4401,7 @@ function __PRIVATE_targetGetAscendingBound(e, t, n) {
|
|
|
4401
4401
|
|
|
4402
4402
|
case "!=" /* Operator.NOT_EQUAL */ :
|
|
4403
4403
|
case "not-in" /* Operator.NOT_IN */ :
|
|
4404
|
-
e =
|
|
4404
|
+
e = oe;
|
|
4405
4405
|
// Remaining filters cannot be used as upper bounds.
|
|
4406
4406
|
}
|
|
4407
4407
|
__PRIVATE_upperBoundCompare({
|
|
@@ -4785,22 +4785,22 @@ function __PRIVATE_compareDocs(e, t, n) {
|
|
|
4785
4785
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
4786
4786
|
* See the License for the specific language governing permissions and
|
|
4787
4787
|
* limitations under the License.
|
|
4788
|
-
*/ const
|
|
4788
|
+
*/ const ae = new SortedMap(DocumentKey.comparator);
|
|
4789
4789
|
|
|
4790
4790
|
function __PRIVATE_mutableDocumentMap() {
|
|
4791
|
-
return
|
|
4791
|
+
return ae;
|
|
4792
4792
|
}
|
|
4793
4793
|
|
|
4794
|
-
const
|
|
4794
|
+
const ue = new SortedMap(DocumentKey.comparator);
|
|
4795
4795
|
|
|
4796
4796
|
function documentMap(...e) {
|
|
4797
|
-
let t =
|
|
4797
|
+
let t = ue;
|
|
4798
4798
|
for (const n of e) t = t.insert(n.key, n);
|
|
4799
4799
|
return t;
|
|
4800
4800
|
}
|
|
4801
4801
|
|
|
4802
4802
|
function __PRIVATE_convertOverlayedDocumentMapToDocumentMap(e) {
|
|
4803
|
-
let t =
|
|
4803
|
+
let t = ue;
|
|
4804
4804
|
return e.forEach(((e, n) => t = t.insert(e, n.overlayedDocument))), t;
|
|
4805
4805
|
}
|
|
4806
4806
|
|
|
@@ -4816,20 +4816,20 @@ function __PRIVATE_newDocumentKeyMap() {
|
|
|
4816
4816
|
return new ObjectMap((e => e.toString()), ((e, t) => e.isEqual(t)));
|
|
4817
4817
|
}
|
|
4818
4818
|
|
|
4819
|
-
const
|
|
4819
|
+
const ce = new SortedMap(DocumentKey.comparator);
|
|
4820
4820
|
|
|
4821
|
-
const
|
|
4821
|
+
const le = new SortedSet(DocumentKey.comparator);
|
|
4822
4822
|
|
|
4823
4823
|
function __PRIVATE_documentKeySet(...e) {
|
|
4824
|
-
let t =
|
|
4824
|
+
let t = le;
|
|
4825
4825
|
for (const n of e) t = t.add(n);
|
|
4826
4826
|
return t;
|
|
4827
4827
|
}
|
|
4828
4828
|
|
|
4829
|
-
const
|
|
4829
|
+
const he = new SortedSet(__PRIVATE_primitiveComparator);
|
|
4830
4830
|
|
|
4831
4831
|
function __PRIVATE_targetIdSet() {
|
|
4832
|
-
return
|
|
4832
|
+
return he;
|
|
4833
4833
|
}
|
|
4834
4834
|
|
|
4835
4835
|
/**
|
|
@@ -5520,7 +5520,7 @@ class __PRIVATE_VerifyMutation extends Mutation {
|
|
|
5520
5520
|
*/ static from(e, t, n) {
|
|
5521
5521
|
__PRIVATE_hardAssert(e.mutations.length === n.length);
|
|
5522
5522
|
let r = function __PRIVATE_documentVersionMap() {
|
|
5523
|
-
return
|
|
5523
|
+
return ce;
|
|
5524
5524
|
}();
|
|
5525
5525
|
const i = e.mutations;
|
|
5526
5526
|
for (let e = 0; e < i.length; e++) r = r.insert(i[e].key, n[e].version);
|
|
@@ -5634,7 +5634,7 @@ class __PRIVATE_VerifyMutation extends Mutation {
|
|
|
5634
5634
|
* Important! The names of these identifiers matter because the string forms
|
|
5635
5635
|
* are used for reverse lookups from the webchannel stream. Do NOT change the
|
|
5636
5636
|
* names of these identifiers or change this into a const enum.
|
|
5637
|
-
*/ var
|
|
5637
|
+
*/ var Pe, Ie;
|
|
5638
5638
|
|
|
5639
5639
|
/**
|
|
5640
5640
|
* Determines whether an error code represents a permanent error when received
|
|
@@ -5647,29 +5647,29 @@ function __PRIVATE_isPermanentError(e) {
|
|
|
5647
5647
|
default:
|
|
5648
5648
|
return fail();
|
|
5649
5649
|
|
|
5650
|
-
case
|
|
5651
|
-
case
|
|
5652
|
-
case
|
|
5653
|
-
case
|
|
5654
|
-
case
|
|
5655
|
-
case
|
|
5650
|
+
case M.CANCELLED:
|
|
5651
|
+
case M.UNKNOWN:
|
|
5652
|
+
case M.DEADLINE_EXCEEDED:
|
|
5653
|
+
case M.RESOURCE_EXHAUSTED:
|
|
5654
|
+
case M.INTERNAL:
|
|
5655
|
+
case M.UNAVAILABLE:
|
|
5656
5656
|
// Unauthenticated means something went wrong with our token and we need
|
|
5657
5657
|
// to retry with new credentials which will happen automatically.
|
|
5658
|
-
case
|
|
5658
|
+
case M.UNAUTHENTICATED:
|
|
5659
5659
|
return !1;
|
|
5660
5660
|
|
|
5661
|
-
case
|
|
5662
|
-
case
|
|
5663
|
-
case
|
|
5664
|
-
case
|
|
5665
|
-
case
|
|
5661
|
+
case M.INVALID_ARGUMENT:
|
|
5662
|
+
case M.NOT_FOUND:
|
|
5663
|
+
case M.ALREADY_EXISTS:
|
|
5664
|
+
case M.PERMISSION_DENIED:
|
|
5665
|
+
case M.FAILED_PRECONDITION:
|
|
5666
5666
|
// Aborted might be retried in some scenarios, but that is dependant on
|
|
5667
5667
|
// the context and should handled individually by the calling code.
|
|
5668
5668
|
// See https://cloud.google.com/apis/design/errors.
|
|
5669
|
-
case
|
|
5670
|
-
case
|
|
5671
|
-
case
|
|
5672
|
-
case
|
|
5669
|
+
case M.ABORTED:
|
|
5670
|
+
case M.OUT_OF_RANGE:
|
|
5671
|
+
case M.UNIMPLEMENTED:
|
|
5672
|
+
case M.DATA_LOSS:
|
|
5673
5673
|
return !0;
|
|
5674
5674
|
}
|
|
5675
5675
|
}
|
|
@@ -5697,58 +5697,58 @@ function __PRIVATE_mapCodeFromRpcCode(e) {
|
|
|
5697
5697
|
if (void 0 === e)
|
|
5698
5698
|
// This shouldn't normally happen, but in certain error cases (like trying
|
|
5699
5699
|
// to send invalid proto messages) we may get an error with no GRPC code.
|
|
5700
|
-
return __PRIVATE_logError("GRPC error has no .code"),
|
|
5700
|
+
return __PRIVATE_logError("GRPC error has no .code"), M.UNKNOWN;
|
|
5701
5701
|
switch (e) {
|
|
5702
|
-
case
|
|
5703
|
-
return
|
|
5702
|
+
case Pe.OK:
|
|
5703
|
+
return M.OK;
|
|
5704
5704
|
|
|
5705
|
-
case
|
|
5706
|
-
return
|
|
5705
|
+
case Pe.CANCELLED:
|
|
5706
|
+
return M.CANCELLED;
|
|
5707
5707
|
|
|
5708
|
-
case
|
|
5709
|
-
return
|
|
5708
|
+
case Pe.UNKNOWN:
|
|
5709
|
+
return M.UNKNOWN;
|
|
5710
5710
|
|
|
5711
|
-
case
|
|
5712
|
-
return
|
|
5711
|
+
case Pe.DEADLINE_EXCEEDED:
|
|
5712
|
+
return M.DEADLINE_EXCEEDED;
|
|
5713
5713
|
|
|
5714
|
-
case
|
|
5715
|
-
return
|
|
5714
|
+
case Pe.RESOURCE_EXHAUSTED:
|
|
5715
|
+
return M.RESOURCE_EXHAUSTED;
|
|
5716
5716
|
|
|
5717
|
-
case
|
|
5718
|
-
return
|
|
5717
|
+
case Pe.INTERNAL:
|
|
5718
|
+
return M.INTERNAL;
|
|
5719
5719
|
|
|
5720
|
-
case
|
|
5721
|
-
return
|
|
5720
|
+
case Pe.UNAVAILABLE:
|
|
5721
|
+
return M.UNAVAILABLE;
|
|
5722
5722
|
|
|
5723
|
-
case
|
|
5724
|
-
return
|
|
5723
|
+
case Pe.UNAUTHENTICATED:
|
|
5724
|
+
return M.UNAUTHENTICATED;
|
|
5725
5725
|
|
|
5726
|
-
case
|
|
5727
|
-
return
|
|
5726
|
+
case Pe.INVALID_ARGUMENT:
|
|
5727
|
+
return M.INVALID_ARGUMENT;
|
|
5728
5728
|
|
|
5729
|
-
case
|
|
5730
|
-
return
|
|
5729
|
+
case Pe.NOT_FOUND:
|
|
5730
|
+
return M.NOT_FOUND;
|
|
5731
5731
|
|
|
5732
|
-
case
|
|
5733
|
-
return
|
|
5732
|
+
case Pe.ALREADY_EXISTS:
|
|
5733
|
+
return M.ALREADY_EXISTS;
|
|
5734
5734
|
|
|
5735
|
-
case
|
|
5736
|
-
return
|
|
5735
|
+
case Pe.PERMISSION_DENIED:
|
|
5736
|
+
return M.PERMISSION_DENIED;
|
|
5737
5737
|
|
|
5738
|
-
case
|
|
5739
|
-
return
|
|
5738
|
+
case Pe.FAILED_PRECONDITION:
|
|
5739
|
+
return M.FAILED_PRECONDITION;
|
|
5740
5740
|
|
|
5741
|
-
case
|
|
5742
|
-
return
|
|
5741
|
+
case Pe.ABORTED:
|
|
5742
|
+
return M.ABORTED;
|
|
5743
5743
|
|
|
5744
|
-
case
|
|
5745
|
-
return
|
|
5744
|
+
case Pe.OUT_OF_RANGE:
|
|
5745
|
+
return M.OUT_OF_RANGE;
|
|
5746
5746
|
|
|
5747
|
-
case
|
|
5748
|
-
return
|
|
5747
|
+
case Pe.UNIMPLEMENTED:
|
|
5748
|
+
return M.UNIMPLEMENTED;
|
|
5749
5749
|
|
|
5750
|
-
case
|
|
5751
|
-
return
|
|
5750
|
+
case Pe.DATA_LOSS:
|
|
5751
|
+
return M.DATA_LOSS;
|
|
5752
5752
|
|
|
5753
5753
|
default:
|
|
5754
5754
|
return fail();
|
|
@@ -5762,14 +5762,14 @@ function __PRIVATE_mapCodeFromRpcCode(e) {
|
|
|
5762
5762
|
* "UNKNOWN", etc.)
|
|
5763
5763
|
* @returns The equivalent Code. Non-matching responses are mapped to
|
|
5764
5764
|
* Code.UNKNOWN.
|
|
5765
|
-
*/ (
|
|
5766
|
-
|
|
5767
|
-
|
|
5768
|
-
|
|
5769
|
-
|
|
5770
|
-
|
|
5771
|
-
|
|
5772
|
-
|
|
5765
|
+
*/ (Ie = Pe || (Pe = {}))[Ie.OK = 0] = "OK", Ie[Ie.CANCELLED = 1] = "CANCELLED",
|
|
5766
|
+
Ie[Ie.UNKNOWN = 2] = "UNKNOWN", Ie[Ie.INVALID_ARGUMENT = 3] = "INVALID_ARGUMENT",
|
|
5767
|
+
Ie[Ie.DEADLINE_EXCEEDED = 4] = "DEADLINE_EXCEEDED", Ie[Ie.NOT_FOUND = 5] = "NOT_FOUND",
|
|
5768
|
+
Ie[Ie.ALREADY_EXISTS = 6] = "ALREADY_EXISTS", Ie[Ie.PERMISSION_DENIED = 7] = "PERMISSION_DENIED",
|
|
5769
|
+
Ie[Ie.UNAUTHENTICATED = 16] = "UNAUTHENTICATED", Ie[Ie.RESOURCE_EXHAUSTED = 8] = "RESOURCE_EXHAUSTED",
|
|
5770
|
+
Ie[Ie.FAILED_PRECONDITION = 9] = "FAILED_PRECONDITION", Ie[Ie.ABORTED = 10] = "ABORTED",
|
|
5771
|
+
Ie[Ie.OUT_OF_RANGE = 11] = "OUT_OF_RANGE", Ie[Ie.UNIMPLEMENTED = 12] = "UNIMPLEMENTED",
|
|
5772
|
+
Ie[Ie.INTERNAL = 13] = "INTERNAL", Ie[Ie.UNAVAILABLE = 14] = "UNAVAILABLE", Ie[Ie.DATA_LOSS = 15] = "DATA_LOSS";
|
|
5773
5773
|
|
|
5774
5774
|
/**
|
|
5775
5775
|
* @license
|
|
@@ -5794,7 +5794,7 @@ Pe[Pe.INTERNAL = 13] = "INTERNAL", Pe[Pe.UNAVAILABLE = 14] = "UNAVAILABLE", Pe[P
|
|
|
5794
5794
|
* integration tests that have registered callbacks to be notified of events
|
|
5795
5795
|
* that happen during the test execution.
|
|
5796
5796
|
*/
|
|
5797
|
-
let
|
|
5797
|
+
let Te = null;
|
|
5798
5798
|
|
|
5799
5799
|
/**
|
|
5800
5800
|
* Sets the value of the `testingHooksSpi` object.
|
|
@@ -5842,7 +5842,7 @@ function __PRIVATE_newTextEncoder() {
|
|
|
5842
5842
|
* See the License for the specific language governing permissions and
|
|
5843
5843
|
* limitations under the License.
|
|
5844
5844
|
*/
|
|
5845
|
-
const
|
|
5845
|
+
const Ee = new A([ 4294967295, 4294967295 ], 0);
|
|
5846
5846
|
|
|
5847
5847
|
// Hash a string using md5 hashing algorithm.
|
|
5848
5848
|
function __PRIVATE_getMd5HashValue(e) {
|
|
@@ -5877,7 +5877,7 @@ class BloomFilter {
|
|
|
5877
5877
|
// Calculate hashed value h(i) = h1 + (i * h2).
|
|
5878
5878
|
let r = e.add(t.multiply(A.fromNumber(n)));
|
|
5879
5879
|
// Wrap if hash value overflow 64bit.
|
|
5880
|
-
return 1 === r.compare(
|
|
5880
|
+
return 1 === r.compare(Ee) && (r = new A([ r.getBits(0), r.getBits(1) ], 0)),
|
|
5881
5881
|
r.modulo(this.Te).toNumber();
|
|
5882
5882
|
}
|
|
5883
5883
|
// Return whether the bit on the given index in the bitmap is set to 1.
|
|
@@ -6295,7 +6295,7 @@ class __PRIVATE_WatchChangeAggregator {
|
|
|
6295
6295
|
const e = 2 /* BloomFilterApplicationStatus.FalsePositive */ === i ? "TargetPurposeExistenceFilterMismatchBloom" /* TargetPurpose.ExistenceFilterMismatchBloom */ : "TargetPurposeExistenceFilterMismatch" /* TargetPurpose.ExistenceFilterMismatch */;
|
|
6296
6296
|
this.Qe = this.Qe.insert(t, e);
|
|
6297
6297
|
}
|
|
6298
|
-
null ==
|
|
6298
|
+
null == Te || Te.et(function __PRIVATE_createExistenceFilterMismatchInfoForTestingHooks(e, t, n, r, i) {
|
|
6299
6299
|
var s, o, _, a, u, c;
|
|
6300
6300
|
const l = {
|
|
6301
6301
|
localCacheCount: e,
|
|
@@ -6511,13 +6511,13 @@ function __PRIVATE_snapshotChangesMap() {
|
|
|
6511
6511
|
return new SortedMap(DocumentKey.comparator);
|
|
6512
6512
|
}
|
|
6513
6513
|
|
|
6514
|
-
const
|
|
6514
|
+
const de = (() => {
|
|
6515
6515
|
const e = {
|
|
6516
6516
|
asc: "ASCENDING",
|
|
6517
6517
|
desc: "DESCENDING"
|
|
6518
6518
|
};
|
|
6519
6519
|
return e;
|
|
6520
|
-
})(),
|
|
6520
|
+
})(), Ae = (() => {
|
|
6521
6521
|
const e = {
|
|
6522
6522
|
"<": "LESS_THAN",
|
|
6523
6523
|
"<=": "LESS_THAN_OR_EQUAL",
|
|
@@ -6531,7 +6531,7 @@ const Ee = (() => {
|
|
|
6531
6531
|
"array-contains-any": "ARRAY_CONTAINS_ANY"
|
|
6532
6532
|
};
|
|
6533
6533
|
return e;
|
|
6534
|
-
})(),
|
|
6534
|
+
})(), Re = (() => {
|
|
6535
6535
|
const e = {
|
|
6536
6536
|
and: "AND",
|
|
6537
6537
|
or: "OR"
|
|
@@ -6633,8 +6633,8 @@ function __PRIVATE_toName(e, t) {
|
|
|
6633
6633
|
|
|
6634
6634
|
function fromName(e, t) {
|
|
6635
6635
|
const n = __PRIVATE_fromResourceName(t);
|
|
6636
|
-
if (n.get(1) !== e.databaseId.projectId) throw new FirestoreError(
|
|
6637
|
-
if (n.get(3) !== e.databaseId.database) throw new FirestoreError(
|
|
6636
|
+
if (n.get(1) !== e.databaseId.projectId) throw new FirestoreError(M.INVALID_ARGUMENT, "Tried to deserialize key from different project: " + n.get(1) + " vs " + e.databaseId.projectId);
|
|
6637
|
+
if (n.get(3) !== e.databaseId.database) throw new FirestoreError(M.INVALID_ARGUMENT, "Tried to deserialize key from different database: " + n.get(3) + " vs " + e.databaseId.database);
|
|
6638
6638
|
return new DocumentKey(__PRIVATE_extractLocalPathFromResourceName(n));
|
|
6639
6639
|
}
|
|
6640
6640
|
|
|
@@ -6708,7 +6708,7 @@ function __PRIVATE_fromWatchChange(e, t) {
|
|
|
6708
6708
|
// does not indicate that it extends Uint8Array.
|
|
6709
6709
|
t instanceof Buffer || t instanceof Uint8Array), ByteString.fromUint8Array(t || new Uint8Array));
|
|
6710
6710
|
}(e, t.targetChange.resumeToken), o = t.targetChange.cause, _ = o && function __PRIVATE_fromRpcStatus(e) {
|
|
6711
|
-
const t = void 0 === e.code ?
|
|
6711
|
+
const t = void 0 === e.code ? M.UNKNOWN : __PRIVATE_mapCodeFromRpcCode(e.code);
|
|
6712
6712
|
return new FirestoreError(t, e.message || "");
|
|
6713
6713
|
}(o);
|
|
6714
6714
|
n = new __PRIVATE_WatchTargetChange(r, i, s, _ || null);
|
|
@@ -7103,15 +7103,15 @@ function __PRIVATE_fromFilter(e) {
|
|
|
7103
7103
|
}
|
|
7104
7104
|
|
|
7105
7105
|
function __PRIVATE_toDirection(e) {
|
|
7106
|
-
return
|
|
7106
|
+
return de[e];
|
|
7107
7107
|
}
|
|
7108
7108
|
|
|
7109
7109
|
function __PRIVATE_toOperatorName(e) {
|
|
7110
|
-
return
|
|
7110
|
+
return Ae[e];
|
|
7111
7111
|
}
|
|
7112
7112
|
|
|
7113
7113
|
function __PRIVATE_toCompositeOperatorName(e) {
|
|
7114
|
-
return
|
|
7114
|
+
return Re[e];
|
|
7115
7115
|
}
|
|
7116
7116
|
|
|
7117
7117
|
function __PRIVATE_toFieldPathReference(e) {
|
|
@@ -8433,7 +8433,7 @@ function __PRIVATE_applyDistributionFieldAndCompositeFilters(e, t) {
|
|
|
8433
8433
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
8434
8434
|
* See the License for the specific language governing permissions and
|
|
8435
8435
|
* limitations under the License.
|
|
8436
|
-
*/ const
|
|
8436
|
+
*/ const Ve = new Uint8Array(0);
|
|
8437
8437
|
|
|
8438
8438
|
/**
|
|
8439
8439
|
* A persisted implementation of IndexManager.
|
|
@@ -8647,7 +8647,7 @@ class __PRIVATE_IndexedDbIndexManager {
|
|
|
8647
8647
|
// combined with the values from the query bounds.
|
|
8648
8648
|
const _ = (null != t ? t.length : 1) * Math.max(n.length, i.length), a = _ / (null != t ? t.length : 1), u = [];
|
|
8649
8649
|
for (let c = 0; c < _; ++c) {
|
|
8650
|
-
const _ = t ? this.Tn(t[c / a]) :
|
|
8650
|
+
const _ = t ? this.Tn(t[c / a]) : Ve, l = this.En(e, _, n[c % a], r), h = this.dn(e, _, i[c % a], s), P = o.map((t => this.En(e, _, t,
|
|
8651
8651
|
/* inclusive= */ !0)));
|
|
8652
8652
|
u.push(...this.createRange(l, h, P));
|
|
8653
8653
|
}
|
|
@@ -8844,7 +8844,7 @@ class __PRIVATE_IndexedDbIndexManager {
|
|
|
8844
8844
|
if (null != i) {
|
|
8845
8845
|
const s = e.data.field(i.fieldPath);
|
|
8846
8846
|
if (isArray(s)) for (const i of s.arrayValue.values || []) n = n.add(new __PRIVATE_IndexEntry(t.indexId, e.key, this.Tn(i), r));
|
|
8847
|
-
} else n = n.add(new __PRIVATE_IndexEntry(t.indexId, e.key,
|
|
8847
|
+
} else n = n.add(new __PRIVATE_IndexEntry(t.indexId, e.key, Ve, r));
|
|
8848
8848
|
return n;
|
|
8849
8849
|
}
|
|
8850
8850
|
/**
|
|
@@ -8919,7 +8919,7 @@ class __PRIVATE_IndexedDbIndexManager {
|
|
|
8919
8919
|
// If we encounter two bounds that will create an unmatchable key range,
|
|
8920
8920
|
// then we return an empty set of key ranges.
|
|
8921
8921
|
if (this.Dn(r[e], r[e + 1])) return [];
|
|
8922
|
-
const t = [ r[e].indexId, this.uid, r[e].arrayValue, r[e].directionalValue,
|
|
8922
|
+
const t = [ r[e].indexId, this.uid, r[e].arrayValue, r[e].directionalValue, Ve, [] ], n = [ r[e + 1].indexId, this.uid, r[e + 1].arrayValue, r[e + 1].directionalValue, Ve, [] ];
|
|
8923
8923
|
i.push(IDBKeyRange.bound(t, n));
|
|
8924
8924
|
}
|
|
8925
8925
|
return i;
|
|
@@ -8987,7 +8987,7 @@ function __PRIVATE_getMinOffsetFromFieldIndexes(e) {
|
|
|
8987
8987
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
8988
8988
|
* See the License for the specific language governing permissions and
|
|
8989
8989
|
* limitations under the License.
|
|
8990
|
-
*/ const
|
|
8990
|
+
*/ const me = {
|
|
8991
8991
|
didRun: !1,
|
|
8992
8992
|
sequenceNumbersCollected: 0,
|
|
8993
8993
|
targetsRemoved: 0,
|
|
@@ -9151,7 +9151,7 @@ class __PRIVATE_IndexedDbMutationQueue {
|
|
|
9151
9151
|
let c = new SortedSet(((e, t) => __PRIVATE_primitiveComparator(e.canonicalString(), t.canonicalString())));
|
|
9152
9152
|
for (const e of r) {
|
|
9153
9153
|
const t = __PRIVATE_newDbDocumentMutationKey(this.userId, e.key.path, o);
|
|
9154
|
-
c = c.add(e.key.path.popLast()), u.push(s.put(a)), u.push(i.put(t,
|
|
9154
|
+
c = c.add(e.key.path.popLast()), u.push(s.put(a)), u.push(i.put(t, B));
|
|
9155
9155
|
}
|
|
9156
9156
|
return c.forEach((t => {
|
|
9157
9157
|
u.push(this.indexManager.addToCollectionParentIndex(e, t));
|
|
@@ -9720,8 +9720,8 @@ class __PRIVATE_TargetIdGenerator {
|
|
|
9720
9720
|
}
|
|
9721
9721
|
collect(e, t) {
|
|
9722
9722
|
return -1 === this.params.cacheSizeCollectionThreshold ? (__PRIVATE_logDebug("LruGarbageCollector", "Garbage collection skipped; disabled"),
|
|
9723
|
-
PersistencePromise.resolve(
|
|
9724
|
-
|
|
9723
|
+
PersistencePromise.resolve(me)) : this.getCacheSize(e).next((n => n < this.params.cacheSizeCollectionThreshold ? (__PRIVATE_logDebug("LruGarbageCollector", `Garbage collection skipped; Cache size ${n} is lower than threshold ${this.params.cacheSizeCollectionThreshold}`),
|
|
9724
|
+
me) : this.Yn(e, t)));
|
|
9725
9725
|
}
|
|
9726
9726
|
getCacheSize(e) {
|
|
9727
9727
|
return this.jn.getCacheSize(e);
|
|
@@ -11481,7 +11481,7 @@ class __PRIVATE_MemoryLruDelegate {
|
|
|
11481
11481
|
e.createObjectStore("mutations", {
|
|
11482
11482
|
keyPath: "batchId",
|
|
11483
11483
|
autoIncrement: !0
|
|
11484
|
-
}).createIndex("userMutationsIndex",
|
|
11484
|
+
}).createIndex("userMutationsIndex", L, {
|
|
11485
11485
|
unique: !0
|
|
11486
11486
|
}), e.createObjectStore("documentMutations");
|
|
11487
11487
|
}
|
|
@@ -11526,7 +11526,7 @@ class __PRIVATE_MemoryLruDelegate {
|
|
|
11526
11526
|
e.createObjectStore("mutations", {
|
|
11527
11527
|
keyPath: "batchId",
|
|
11528
11528
|
autoIncrement: !0
|
|
11529
|
-
}).createIndex("userMutationsIndex",
|
|
11529
|
+
}).createIndex("userMutationsIndex", L, {
|
|
11530
11530
|
unique: !0
|
|
11531
11531
|
});
|
|
11532
11532
|
const r = t.store("mutations"), i = n.map((e => r.put(e)));
|
|
@@ -11563,19 +11563,19 @@ class __PRIVATE_MemoryLruDelegate {
|
|
|
11563
11563
|
}))), n < 12 && r >= 12 && (s = s.next((() => {
|
|
11564
11564
|
!function __PRIVATE_createDocumentOverlayStore(e) {
|
|
11565
11565
|
const t = e.createObjectStore("documentOverlays", {
|
|
11566
|
-
keyPath:
|
|
11566
|
+
keyPath: J
|
|
11567
11567
|
});
|
|
11568
|
-
t.createIndex("collectionPathOverlayIndex",
|
|
11568
|
+
t.createIndex("collectionPathOverlayIndex", Y, {
|
|
11569
11569
|
unique: !1
|
|
11570
|
-
}), t.createIndex("collectionGroupOverlayIndex",
|
|
11570
|
+
}), t.createIndex("collectionGroupOverlayIndex", Z, {
|
|
11571
11571
|
unique: !1
|
|
11572
11572
|
});
|
|
11573
11573
|
}(e);
|
|
11574
11574
|
}))), n < 13 && r >= 13 && (s = s.next((() => function __PRIVATE_createRemoteDocumentCache(e) {
|
|
11575
11575
|
const t = e.createObjectStore("remoteDocumentsV14", {
|
|
11576
|
-
keyPath:
|
|
11576
|
+
keyPath: k
|
|
11577
11577
|
});
|
|
11578
|
-
t.createIndex("documentKeyIndex",
|
|
11578
|
+
t.createIndex("documentKeyIndex", q), t.createIndex("collectionGroupIndex", Q);
|
|
11579
11579
|
}(e))).next((() => this.ii(e, i))).next((() => e.deleteObjectStore("remoteDocuments")))),
|
|
11580
11580
|
n < 14 && r >= 14 && (s = s.next((() => this.si(e, i)))), n < 15 && r >= 15 && (s = s.next((() => function __PRIVATE_createFieldIndex(e) {
|
|
11581
11581
|
e.createObjectStore("indexConfiguration", {
|
|
@@ -11585,13 +11585,13 @@ class __PRIVATE_MemoryLruDelegate {
|
|
|
11585
11585
|
unique: !1
|
|
11586
11586
|
});
|
|
11587
11587
|
e.createObjectStore("indexState", {
|
|
11588
|
-
keyPath:
|
|
11589
|
-
}).createIndex("sequenceNumberIndex",
|
|
11588
|
+
keyPath: G
|
|
11589
|
+
}).createIndex("sequenceNumberIndex", z, {
|
|
11590
11590
|
unique: !1
|
|
11591
11591
|
});
|
|
11592
11592
|
e.createObjectStore("indexEntries", {
|
|
11593
|
-
keyPath:
|
|
11594
|
-
}).createIndex("documentKeyIndex",
|
|
11593
|
+
keyPath: j
|
|
11594
|
+
}).createIndex("documentKeyIndex", H, {
|
|
11595
11595
|
unique: !1
|
|
11596
11596
|
});
|
|
11597
11597
|
}(e)))), n < 16 && r >= 16 && (
|
|
@@ -11646,7 +11646,7 @@ class __PRIVATE_MemoryLruDelegate {
|
|
|
11646
11646
|
ni(e, t) {
|
|
11647
11647
|
// Create the index.
|
|
11648
11648
|
e.createObjectStore("collectionParents", {
|
|
11649
|
-
keyPath:
|
|
11649
|
+
keyPath: W
|
|
11650
11650
|
});
|
|
11651
11651
|
const n = t.store("collectionParents"), r = new __PRIVATE_MemoryCollectionParentIndex, addEntry = e => {
|
|
11652
11652
|
if (r.add(e)) {
|
|
@@ -11731,19 +11731,19 @@ class __PRIVATE_MemoryLruDelegate {
|
|
|
11731
11731
|
|
|
11732
11732
|
function __PRIVATE_createQueryCache(e) {
|
|
11733
11733
|
e.createObjectStore("targetDocuments", {
|
|
11734
|
-
keyPath:
|
|
11735
|
-
}).createIndex("documentTargetsIndex",
|
|
11734
|
+
keyPath: $
|
|
11735
|
+
}).createIndex("documentTargetsIndex", U, {
|
|
11736
11736
|
unique: !0
|
|
11737
11737
|
});
|
|
11738
11738
|
// NOTE: This is unique only because the TargetId is the suffix.
|
|
11739
11739
|
e.createObjectStore("targets", {
|
|
11740
11740
|
keyPath: "targetId"
|
|
11741
|
-
}).createIndex("queryTargetsIndex",
|
|
11741
|
+
}).createIndex("queryTargetsIndex", K, {
|
|
11742
11742
|
unique: !0
|
|
11743
11743
|
}), e.createObjectStore("targetGlobal");
|
|
11744
11744
|
}
|
|
11745
11745
|
|
|
11746
|
-
const
|
|
11746
|
+
const fe = "Failed to obtain exclusive access to the persistence layer. To allow shared access, multi-tab synchronization has to be enabled in all tabs. If you are using `experimentalForceOwningTab:true`, make sure that only one tab has persistence enabled at any given time.";
|
|
11747
11747
|
|
|
11748
11748
|
/**
|
|
11749
11749
|
* Oldest acceptable age in milliseconds for client metadata before the client
|
|
@@ -11819,7 +11819,7 @@ class __PRIVATE_IndexedDbPersistence {
|
|
|
11819
11819
|
/** The last time we garbage collected the client metadata object store. */
|
|
11820
11820
|
this.Pi = Number.NEGATIVE_INFINITY,
|
|
11821
11821
|
/** A listener to notify on primary state changes. */
|
|
11822
|
-
this.Ii = e => Promise.resolve(), !__PRIVATE_IndexedDbPersistence.D()) throw new FirestoreError(
|
|
11822
|
+
this.Ii = e => Promise.resolve(), !__PRIVATE_IndexedDbPersistence.D()) throw new FirestoreError(M.UNIMPLEMENTED, "This platform is either missing IndexedDB or is known to have an incomplete implementation. Offline persistence has been disabled.");
|
|
11823
11823
|
this.referenceDelegate = new __PRIVATE_IndexedDbLruDelegateImpl(this, r), this.Ti = t + "main",
|
|
11824
11824
|
this.serializer = new __PRIVATE_LocalSerializer(_), this.Ei = new __PRIVATE_SimpleDb(this.Ti, this.ui, new __PRIVATE_SchemaConverter(this.serializer)),
|
|
11825
11825
|
this.Qr = new __PRIVATE_IndexedDbTargetCache(this.referenceDelegate, this.serializer),
|
|
@@ -11839,7 +11839,7 @@ class __PRIVATE_IndexedDbPersistence {
|
|
|
11839
11839
|
if (!this.isPrimary && !this.allowTabSynchronization)
|
|
11840
11840
|
// Fail `start()` if `synchronizeTabs` is disabled and we cannot
|
|
11841
11841
|
// obtain the primary lease.
|
|
11842
|
-
throw new FirestoreError(
|
|
11842
|
+
throw new FirestoreError(M.FAILED_PRECONDITION, fe);
|
|
11843
11843
|
return this.Ri(), this.Vi(), this.mi(), this.runTransaction("getHighestListenSequenceNumber", "readonly", (e => this.Qr.getHighestSequenceNumber(e)));
|
|
11844
11844
|
})).then((e => {
|
|
11845
11845
|
this.kr = new __PRIVATE_ListenSequence(e, this._i);
|
|
@@ -11981,7 +11981,7 @@ class __PRIVATE_IndexedDbPersistence {
|
|
|
11981
11981
|
// settings is not supported.
|
|
11982
11982
|
// TODO(b/114226234): Remove this check when `synchronizeTabs` can
|
|
11983
11983
|
// no longer be turned off.
|
|
11984
|
-
throw new FirestoreError(
|
|
11984
|
+
throw new FirestoreError(M.FAILED_PRECONDITION, fe);
|
|
11985
11985
|
return !1;
|
|
11986
11986
|
}
|
|
11987
11987
|
}
|
|
@@ -12051,7 +12051,7 @@ class __PRIVATE_IndexedDbPersistence {
|
|
|
12051
12051
|
const r = "readonly" === t ? "readonly" : "readwrite", i =
|
|
12052
12052
|
/** Returns the object stores for the provided schema. */
|
|
12053
12053
|
function __PRIVATE_getObjectStores(e) {
|
|
12054
|
-
return 16 === e ?
|
|
12054
|
+
return 16 === e ? ie : 15 === e ? re : 14 === e ? ne : 13 === e ? te : 12 === e ? ee : 11 === e ? X : void fail();
|
|
12055
12055
|
}(this.ui);
|
|
12056
12056
|
let s;
|
|
12057
12057
|
// Do all transactions as readwrite against all object stores, since we
|
|
@@ -12059,7 +12059,7 @@ class __PRIVATE_IndexedDbPersistence {
|
|
|
12059
12059
|
return this.Ei.runTransaction(e, r, i, (r => (s = new __PRIVATE_IndexedDbTransaction(r, this.kr ? this.kr.next() : __PRIVATE_ListenSequence.oe),
|
|
12060
12060
|
"readwrite-primary" === t ? this.gi(s).next((e => !!e || this.pi(s))).next((t => {
|
|
12061
12061
|
if (!t) throw __PRIVATE_logError(`Failed to obtain primary lease for action '${e}'.`),
|
|
12062
|
-
this.isPrimary = !1, this.oi.enqueueRetryable((() => this.Ii(!1))), new FirestoreError(
|
|
12062
|
+
this.isPrimary = !1, this.oi.enqueueRetryable((() => this.Ii(!1))), new FirestoreError(M.FAILED_PRECONDITION, O);
|
|
12063
12063
|
return n(s);
|
|
12064
12064
|
})).next((e => this.wi(s).next((() => e)))) : this.ki(s).next((() => n(s)))))).then((e => (s.raiseOnCommittedEvent(),
|
|
12065
12065
|
e)));
|
|
@@ -12072,7 +12072,7 @@ class __PRIVATE_IndexedDbPersistence {
|
|
|
12072
12072
|
// be turned off.
|
|
12073
12073
|
ki(e) {
|
|
12074
12074
|
return __PRIVATE_primaryClientStore(e).get("owner").next((e => {
|
|
12075
|
-
if (null !== e && this.Ci(e.leaseTimestampMs, 5e3) && !this.Mi(e.ownerId) && !this.Si(e) && !(this.ai || this.allowTabSynchronization && e.allowTabSynchronization)) throw new FirestoreError(
|
|
12075
|
+
if (null !== e && this.Ci(e.leaseTimestampMs, 5e3) && !this.Mi(e.ownerId) && !this.Si(e) && !(this.ai || this.allowTabSynchronization && e.allowTabSynchronization)) throw new FirestoreError(M.FAILED_PRECONDITION, fe);
|
|
12076
12076
|
}));
|
|
12077
12077
|
}
|
|
12078
12078
|
/**
|
|
@@ -13569,7 +13569,7 @@ class __PRIVATE_BrowserConnectivityMonitor {
|
|
|
13569
13569
|
/**
|
|
13570
13570
|
* The value returned from the most recent invocation of
|
|
13571
13571
|
* `generateUniqueDebugId()`, or null if it has never been invoked.
|
|
13572
|
-
*/ let
|
|
13572
|
+
*/ let ge = null;
|
|
13573
13573
|
|
|
13574
13574
|
/**
|
|
13575
13575
|
* Generates and returns an initial value for `lastUniqueDebugId`.
|
|
@@ -13594,9 +13594,9 @@ class __PRIVATE_BrowserConnectivityMonitor {
|
|
|
13594
13594
|
* @return the 10-character generated ID (e.g. "0xa1b2c3d4").
|
|
13595
13595
|
*/
|
|
13596
13596
|
function __PRIVATE_generateUniqueDebugId() {
|
|
13597
|
-
return null ===
|
|
13597
|
+
return null === ge ? ge = function __PRIVATE_generateInitialUniqueDebugId() {
|
|
13598
13598
|
return 268435456 + Math.round(2147483648 * Math.random());
|
|
13599
|
-
}() :
|
|
13599
|
+
}() : ge++, "0x" + ge.toString(16);
|
|
13600
13600
|
}
|
|
13601
13601
|
|
|
13602
13602
|
/**
|
|
@@ -13614,7 +13614,7 @@ function __PRIVATE_generateUniqueDebugId() {
|
|
|
13614
13614
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13615
13615
|
* See the License for the specific language governing permissions and
|
|
13616
13616
|
* limitations under the License.
|
|
13617
|
-
*/ const
|
|
13617
|
+
*/ const pe = {
|
|
13618
13618
|
BatchGetDocuments: "batchGet",
|
|
13619
13619
|
Commit: "commit",
|
|
13620
13620
|
RunQuery: "runQuery",
|
|
@@ -13698,7 +13698,7 @@ class __PRIVATE_StreamBridge {
|
|
|
13698
13698
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13699
13699
|
* See the License for the specific language governing permissions and
|
|
13700
13700
|
* limitations under the License.
|
|
13701
|
-
*/ const
|
|
13701
|
+
*/ const ye = "WebChannelConnection";
|
|
13702
13702
|
|
|
13703
13703
|
class __PRIVATE_WebChannelConnection extends
|
|
13704
13704
|
/**
|
|
@@ -13742,7 +13742,7 @@ class __PRIVATE_RestConnection {
|
|
|
13742
13742
|
// SDK_VERSION is updated to different value at runtime depending on the entry point,
|
|
13743
13743
|
// so we need to get its value when we need it in a function.
|
|
13744
13744
|
function __PRIVATE_getGoogApiClientValue() {
|
|
13745
|
-
return "gl-js/ fire/" +
|
|
13745
|
+
return "gl-js/ fire/" + v;
|
|
13746
13746
|
}(),
|
|
13747
13747
|
// Content-Type: text/plain will avoid preflight requests which might
|
|
13748
13748
|
// mess with CORS and redirects by proxies. If we add custom headers
|
|
@@ -13752,7 +13752,7 @@ class __PRIVATE_RestConnection {
|
|
|
13752
13752
|
t && t.headers.forEach(((t, n) => e[n] = t)), n && n.headers.forEach(((t, n) => e[n] = t));
|
|
13753
13753
|
}
|
|
13754
13754
|
vo(e, t) {
|
|
13755
|
-
const n =
|
|
13755
|
+
const n = pe[e];
|
|
13756
13756
|
return `${this.wo}/v1/${t}:${n}`;
|
|
13757
13757
|
}
|
|
13758
13758
|
/**
|
|
@@ -13776,17 +13776,17 @@ class __PRIVATE_RestConnection {
|
|
|
13776
13776
|
switch (_.getLastErrorCode()) {
|
|
13777
13777
|
case f.NO_ERROR:
|
|
13778
13778
|
const t = _.getResponseJson();
|
|
13779
|
-
__PRIVATE_logDebug(
|
|
13779
|
+
__PRIVATE_logDebug(ye, `XHR for RPC '${e}' ${i} received:`, JSON.stringify(t)),
|
|
13780
13780
|
s(t);
|
|
13781
13781
|
break;
|
|
13782
13782
|
|
|
13783
13783
|
case f.TIMEOUT:
|
|
13784
|
-
__PRIVATE_logDebug(
|
|
13784
|
+
__PRIVATE_logDebug(ye, `RPC '${e}' ${i} timed out`), o(new FirestoreError(M.DEADLINE_EXCEEDED, "Request time out"));
|
|
13785
13785
|
break;
|
|
13786
13786
|
|
|
13787
13787
|
case f.HTTP_ERROR:
|
|
13788
13788
|
const n = _.getStatus();
|
|
13789
|
-
if (__PRIVATE_logDebug(
|
|
13789
|
+
if (__PRIVATE_logDebug(ye, `RPC '${e}' ${i} failed with status:`, n, "response text:", _.getResponseText()),
|
|
13790
13790
|
n > 0) {
|
|
13791
13791
|
let e = _.getResponseJson();
|
|
13792
13792
|
Array.isArray(e) && (e = e[0]);
|
|
@@ -13794,25 +13794,25 @@ class __PRIVATE_RestConnection {
|
|
|
13794
13794
|
if (t && t.status && t.message) {
|
|
13795
13795
|
const e = function __PRIVATE_mapCodeFromHttpResponseErrorStatus(e) {
|
|
13796
13796
|
const t = e.toLowerCase().replace(/_/g, "-");
|
|
13797
|
-
return Object.values(
|
|
13797
|
+
return Object.values(M).indexOf(t) >= 0 ? t : M.UNKNOWN;
|
|
13798
13798
|
}(t.status);
|
|
13799
13799
|
o(new FirestoreError(e, t.message));
|
|
13800
|
-
} else o(new FirestoreError(
|
|
13800
|
+
} else o(new FirestoreError(M.UNKNOWN, "Server responded with status " + _.getStatus()));
|
|
13801
13801
|
} else
|
|
13802
13802
|
// If we received an HTTP_ERROR but there's no status code,
|
|
13803
13803
|
// it's most probably a connection issue
|
|
13804
|
-
o(new FirestoreError(
|
|
13804
|
+
o(new FirestoreError(M.UNAVAILABLE, "Connection failed."));
|
|
13805
13805
|
break;
|
|
13806
13806
|
|
|
13807
13807
|
default:
|
|
13808
13808
|
fail();
|
|
13809
13809
|
}
|
|
13810
13810
|
} finally {
|
|
13811
|
-
__PRIVATE_logDebug(
|
|
13811
|
+
__PRIVATE_logDebug(ye, `RPC '${e}' ${i} completed.`);
|
|
13812
13812
|
}
|
|
13813
13813
|
}));
|
|
13814
13814
|
const a = JSON.stringify(r);
|
|
13815
|
-
__PRIVATE_logDebug(
|
|
13815
|
+
__PRIVATE_logDebug(ye, `RPC '${e}' ${i} sending request:`, r), _.send(t, "POST", a, n, 15);
|
|
13816
13816
|
}));
|
|
13817
13817
|
}
|
|
13818
13818
|
Oo(e, t, n) {
|
|
@@ -13853,7 +13853,7 @@ class __PRIVATE_RestConnection {
|
|
|
13853
13853
|
// which is recognized by the webchannel backend.
|
|
13854
13854
|
_.encodeInitMessageHeaders = !0;
|
|
13855
13855
|
const u = i.join("");
|
|
13856
|
-
__PRIVATE_logDebug(
|
|
13856
|
+
__PRIVATE_logDebug(ye, `Creating RPC '${e}' stream ${r}: ${u}`, _);
|
|
13857
13857
|
const c = s.createWebChannel(u, _);
|
|
13858
13858
|
// WebChannel supports sending the first message with the handshake - saving
|
|
13859
13859
|
// a network round trip. However, it will have to call send in the same
|
|
@@ -13866,8 +13866,8 @@ class __PRIVATE_RestConnection {
|
|
|
13866
13866
|
// on a closed stream
|
|
13867
13867
|
const P = new __PRIVATE_StreamBridge({
|
|
13868
13868
|
lo: t => {
|
|
13869
|
-
h ? __PRIVATE_logDebug(
|
|
13870
|
-
c.open(), l = !0), __PRIVATE_logDebug(
|
|
13869
|
+
h ? __PRIVATE_logDebug(ye, `Not sending because RPC '${e}' stream ${r} is closed:`, t) : (l || (__PRIVATE_logDebug(ye, `Opening RPC '${e}' stream ${r} transport.`),
|
|
13870
|
+
c.open(), l = !0), __PRIVATE_logDebug(ye, `RPC '${e}' stream ${r} sending:`, t),
|
|
13871
13871
|
c.send(t));
|
|
13872
13872
|
},
|
|
13873
13873
|
ho: () => c.close()
|
|
@@ -13889,13 +13889,13 @@ class __PRIVATE_RestConnection {
|
|
|
13889
13889
|
// Note that eventually this function could go away if we are confident
|
|
13890
13890
|
// enough the code is exception free.
|
|
13891
13891
|
return __PRIVATE_unguardedEventListen(c, w.EventType.OPEN, (() => {
|
|
13892
|
-
h || (__PRIVATE_logDebug(
|
|
13892
|
+
h || (__PRIVATE_logDebug(ye, `RPC '${e}' stream ${r} transport opened.`), P.mo());
|
|
13893
13893
|
})), __PRIVATE_unguardedEventListen(c, w.EventType.CLOSE, (() => {
|
|
13894
|
-
h || (h = !0, __PRIVATE_logDebug(
|
|
13894
|
+
h || (h = !0, __PRIVATE_logDebug(ye, `RPC '${e}' stream ${r} transport closed`),
|
|
13895
13895
|
P.po());
|
|
13896
13896
|
})), __PRIVATE_unguardedEventListen(c, w.EventType.ERROR, (t => {
|
|
13897
|
-
h || (h = !0, __PRIVATE_logWarn(
|
|
13898
|
-
P.po(new FirestoreError(
|
|
13897
|
+
h || (h = !0, __PRIVATE_logWarn(ye, `RPC '${e}' stream ${r} transport errored:`, t),
|
|
13898
|
+
P.po(new FirestoreError(M.UNAVAILABLE, "The operation could not be completed")));
|
|
13899
13899
|
})), __PRIVATE_unguardedEventListen(c, w.EventType.MESSAGE, (t => {
|
|
13900
13900
|
var n;
|
|
13901
13901
|
if (!h) {
|
|
@@ -13908,7 +13908,7 @@ class __PRIVATE_RestConnection {
|
|
|
13908
13908
|
// Use any because msgData.error is not typed.
|
|
13909
13909
|
const s = i, o = s.error || (null === (n = s[0]) || void 0 === n ? void 0 : n.error);
|
|
13910
13910
|
if (o) {
|
|
13911
|
-
__PRIVATE_logDebug(
|
|
13911
|
+
__PRIVATE_logDebug(ye, `RPC '${e}' stream ${r} received error:`, o);
|
|
13912
13912
|
// error.status will be a string like 'OK' or 'NOT_FOUND'.
|
|
13913
13913
|
const t = o.status;
|
|
13914
13914
|
let n =
|
|
@@ -13921,16 +13921,16 @@ class __PRIVATE_RestConnection {
|
|
|
13921
13921
|
function __PRIVATE_mapCodeFromRpcStatus(e) {
|
|
13922
13922
|
// lookup by string
|
|
13923
13923
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
13924
|
-
const t =
|
|
13924
|
+
const t = Pe[e];
|
|
13925
13925
|
if (void 0 !== t) return __PRIVATE_mapCodeFromRpcCode(t);
|
|
13926
13926
|
}(t), i = o.message;
|
|
13927
|
-
void 0 === n && (n =
|
|
13927
|
+
void 0 === n && (n = M.INTERNAL, i = "Unknown error status: " + t + " with message " + o.message),
|
|
13928
13928
|
// Mark closed so no further events are propagated
|
|
13929
13929
|
h = !0, P.po(new FirestoreError(n, i)), c.close();
|
|
13930
|
-
} else __PRIVATE_logDebug(
|
|
13930
|
+
} else __PRIVATE_logDebug(ye, `RPC '${e}' stream ${r} received:`, i), P.yo(i);
|
|
13931
13931
|
}
|
|
13932
13932
|
})), __PRIVATE_unguardedEventListen(o, S.STAT_EVENT, (t => {
|
|
13933
|
-
t.stat === b.PROXY ? __PRIVATE_logDebug(
|
|
13933
|
+
t.stat === b.PROXY ? __PRIVATE_logDebug(ye, `RPC '${e}' stream ${r} detected buffering proxy`) : t.stat === b.NOPROXY && __PRIVATE_logDebug(ye, `RPC '${e}' stream ${r} detected no buffering proxy`);
|
|
13934
13934
|
})), setTimeout((() => {
|
|
13935
13935
|
// Technically we could/should wait for the WebChannel opened event,
|
|
13936
13936
|
// but because we want to send the first message with the WebChannel
|
|
@@ -14254,10 +14254,10 @@ class __PRIVATE_PersistentStream {
|
|
|
14254
14254
|
// underlying stream), guaranteeing they won't execute.
|
|
14255
14255
|
this.jo++, 4 /* PersistentStreamState.Error */ !== e ?
|
|
14256
14256
|
// If this is an intentional close ensure we don't delay our next connection attempt.
|
|
14257
|
-
this.Yo.reset() : t && t.code ===
|
|
14257
|
+
this.Yo.reset() : t && t.code === M.RESOURCE_EXHAUSTED ? (
|
|
14258
14258
|
// Log the error. (Probably either 'quota exceeded' or 'max queue length reached'.)
|
|
14259
14259
|
__PRIVATE_logError(t.toString()), __PRIVATE_logError("Using maximum backoff delay to prevent overloading the backend."),
|
|
14260
|
-
this.Yo.Ko()) : t && t.code ===
|
|
14260
|
+
this.Yo.Ko()) : t && t.code === M.UNAUTHENTICATED && 3 /* PersistentStreamState.Healthy */ !== this.state && (
|
|
14261
14261
|
// "unauthenticated" error means the token was rejected. This should rarely
|
|
14262
14262
|
// happen since both Auth and AppCheck ensure a sufficient TTL when we
|
|
14263
14263
|
// request a token. If a user manually resets their system clock this can
|
|
@@ -14293,7 +14293,7 @@ class __PRIVATE_PersistentStream {
|
|
|
14293
14293
|
this.u_(e, n);
|
|
14294
14294
|
}), (t => {
|
|
14295
14295
|
e((() => {
|
|
14296
|
-
const e = new FirestoreError(
|
|
14296
|
+
const e = new FirestoreError(M.UNKNOWN, "Fetching auth token failed: " + t.message);
|
|
14297
14297
|
return this.c_(e);
|
|
14298
14298
|
}));
|
|
14299
14299
|
}));
|
|
@@ -14508,18 +14508,18 @@ class __PRIVATE_DatastoreImpl extends class Datastore {} {
|
|
|
14508
14508
|
this.serializer = r, this.m_ = !1;
|
|
14509
14509
|
}
|
|
14510
14510
|
f_() {
|
|
14511
|
-
if (this.m_) throw new FirestoreError(
|
|
14511
|
+
if (this.m_) throw new FirestoreError(M.FAILED_PRECONDITION, "The client has already been terminated.");
|
|
14512
14512
|
}
|
|
14513
14513
|
/** Invokes the provided RPC with auth and AppCheck tokens. */ Co(e, t, n, r) {
|
|
14514
14514
|
return this.f_(), Promise.all([ this.authCredentials.getToken(), this.appCheckCredentials.getToken() ]).then((([i, s]) => this.connection.Co(e, __PRIVATE_toResourcePath(t, n), r, i, s))).catch((e => {
|
|
14515
|
-
throw "FirebaseError" === e.name ? (e.code ===
|
|
14516
|
-
this.appCheckCredentials.invalidateToken()), e) : new FirestoreError(
|
|
14515
|
+
throw "FirebaseError" === e.name ? (e.code === M.UNAUTHENTICATED && (this.authCredentials.invalidateToken(),
|
|
14516
|
+
this.appCheckCredentials.invalidateToken()), e) : new FirestoreError(M.UNKNOWN, e.toString());
|
|
14517
14517
|
}));
|
|
14518
14518
|
}
|
|
14519
14519
|
/** Invokes the provided RPC with streamed results with auth and AppCheck tokens. */ xo(e, t, n, r, i) {
|
|
14520
14520
|
return this.f_(), Promise.all([ this.authCredentials.getToken(), this.appCheckCredentials.getToken() ]).then((([s, o]) => this.connection.xo(e, __PRIVATE_toResourcePath(t, n), r, s, o, i))).catch((e => {
|
|
14521
|
-
throw "FirebaseError" === e.name ? (e.code ===
|
|
14522
|
-
this.appCheckCredentials.invalidateToken()), e) : new FirestoreError(
|
|
14521
|
+
throw "FirebaseError" === e.name ? (e.code === M.UNAUTHENTICATED && (this.authCredentials.invalidateToken(),
|
|
14522
|
+
this.appCheckCredentials.invalidateToken()), e) : new FirestoreError(M.UNKNOWN, e.toString());
|
|
14523
14523
|
}));
|
|
14524
14524
|
}
|
|
14525
14525
|
terminate() {
|
|
@@ -14963,7 +14963,7 @@ async function __PRIVATE_onWriteStreamClose(e, t) {
|
|
|
14963
14963
|
// Only handle permanent errors here. If it's transient, just let the retry
|
|
14964
14964
|
// logic kick in.
|
|
14965
14965
|
if (function __PRIVATE_isPermanentWriteError(e) {
|
|
14966
|
-
return __PRIVATE_isPermanentError(e) && e !==
|
|
14966
|
+
return __PRIVATE_isPermanentError(e) && e !== M.ABORTED;
|
|
14967
14967
|
}(t.code)) {
|
|
14968
14968
|
// This was a permanent error, the request itself was the problem
|
|
14969
14969
|
// so it's not going to succeed if we resend it.
|
|
@@ -15146,7 +15146,7 @@ class DelayedOperation {
|
|
|
15146
15146
|
* As long as the operation has not yet been run, calling cancel() provides a
|
|
15147
15147
|
* guarantee that the operation will not be run.
|
|
15148
15148
|
*/ cancel(e) {
|
|
15149
|
-
null !== this.timerHandle && (this.clearTimeout(), this.deferred.reject(new FirestoreError(
|
|
15149
|
+
null !== this.timerHandle && (this.clearTimeout(), this.deferred.reject(new FirestoreError(M.CANCELLED, "Operation cancelled" + (e ? ": " + e : ""))));
|
|
15150
15150
|
}
|
|
15151
15151
|
handleDelayElapsed() {
|
|
15152
15152
|
this.asyncQueue.enqueueAndForget((() => null !== this.timerHandle ? (this.clearTimeout(),
|
|
@@ -15162,7 +15162,7 @@ class DelayedOperation {
|
|
|
15162
15162
|
* Returns a FirestoreError that can be surfaced to the user if the provided
|
|
15163
15163
|
* error is an IndexedDbTransactionError. Re-throws the error otherwise.
|
|
15164
15164
|
*/ function __PRIVATE_wrapInUserErrorIfRecoverable(e, t) {
|
|
15165
|
-
if (__PRIVATE_logError("AsyncQueue", `${t}: ${e}`), __PRIVATE_isIndexedDbTransactionError(e)) return new FirestoreError(
|
|
15165
|
+
if (__PRIVATE_logError("AsyncQueue", `${t}: ${e}`), __PRIVATE_isIndexedDbTransactionError(e)) return new FirestoreError(M.UNAVAILABLE, `${t}: ${e}`);
|
|
15166
15166
|
throw e;
|
|
15167
15167
|
}
|
|
15168
15168
|
|
|
@@ -15475,12 +15475,12 @@ function __PRIVATE_raiseSnapshotsInSyncEvent(e) {
|
|
|
15475
15475
|
}));
|
|
15476
15476
|
}
|
|
15477
15477
|
|
|
15478
|
-
var
|
|
15478
|
+
var we, Se;
|
|
15479
15479
|
|
|
15480
15480
|
/** Listen to both cache and server changes */
|
|
15481
|
-
(
|
|
15481
|
+
(Se = we || (we = {})).J_ = "default",
|
|
15482
15482
|
/** Listen to changes in cache only */
|
|
15483
|
-
|
|
15483
|
+
Se.Cache = "cache";
|
|
15484
15484
|
|
|
15485
15485
|
/**
|
|
15486
15486
|
* QueryListener takes a series of internal view snapshots and determines
|
|
@@ -15555,7 +15555,7 @@ class __PRIVATE_QueryListener {
|
|
|
15555
15555
|
this.Z_ = !0, this.Y_.next(e);
|
|
15556
15556
|
}
|
|
15557
15557
|
G_() {
|
|
15558
|
-
return this.options.source !==
|
|
15558
|
+
return this.options.source !== we.Cache;
|
|
15559
15559
|
}
|
|
15560
15560
|
}
|
|
15561
15561
|
|
|
@@ -16517,7 +16517,7 @@ async function __PRIVATE_syncEngineHandleCredentialChange(e, t) {
|
|
|
16517
16517
|
function __PRIVATE_rejectOutstandingPendingWritesCallbacks(e, t) {
|
|
16518
16518
|
e.Oa.forEach((e => {
|
|
16519
16519
|
e.forEach((e => {
|
|
16520
|
-
e.reject(new FirestoreError(
|
|
16520
|
+
e.reject(new FirestoreError(M.CANCELLED, t));
|
|
16521
16521
|
}));
|
|
16522
16522
|
})), e.Oa.clear();
|
|
16523
16523
|
}(n, "'waitForPendingWrites' promise is rejected due to a user change."),
|
|
@@ -16946,7 +16946,7 @@ class __PRIVATE_LruGcMemoryOfflineComponentProvider extends MemoryOfflineCompone
|
|
|
16946
16946
|
}
|
|
16947
16947
|
createSharedClientState(e) {
|
|
16948
16948
|
const t = __PRIVATE_getWindow();
|
|
16949
|
-
if (!__PRIVATE_WebStorageSharedClientState.D(t)) throw new FirestoreError(
|
|
16949
|
+
if (!__PRIVATE_WebStorageSharedClientState.D(t)) throw new FirestoreError(M.UNIMPLEMENTED, "IndexedDB persistence is only available on platforms that support LocalStorage.");
|
|
16950
16950
|
const n = __PRIVATE_indexedDbStoragePrefix(e.databaseInfo.databaseId, e.databaseInfo.persistenceKey);
|
|
16951
16951
|
return new __PRIVATE_WebStorageSharedClientState(t, e.asyncQueue, n, e.clientId, e.initialUser);
|
|
16952
16952
|
}
|
|
@@ -17284,7 +17284,7 @@ class Transaction$2 {
|
|
|
17284
17284
|
this.writtenDocs = new Set;
|
|
17285
17285
|
}
|
|
17286
17286
|
async lookup(e) {
|
|
17287
|
-
if (this.ensureCommitNotCalled(), this.mutations.length > 0) throw this.lastTransactionError = new FirestoreError(
|
|
17287
|
+
if (this.ensureCommitNotCalled(), this.mutations.length > 0) throw this.lastTransactionError = new FirestoreError(M.INVALID_ARGUMENT, "Firestore transactions require all reads to be executed before all writes."),
|
|
17288
17288
|
this.lastTransactionError;
|
|
17289
17289
|
const t = await async function __PRIVATE_invokeBatchGetDocumentsRpc(e, t) {
|
|
17290
17290
|
const n = __PRIVATE_debugCast(e), r = {
|
|
@@ -17346,7 +17346,7 @@ class Transaction$2 {
|
|
|
17346
17346
|
if (n) {
|
|
17347
17347
|
if (!t.isEqual(n))
|
|
17348
17348
|
// This transaction will fail no matter what.
|
|
17349
|
-
throw new FirestoreError(
|
|
17349
|
+
throw new FirestoreError(M.ABORTED, "Document version changed between two reads.");
|
|
17350
17350
|
} else this.readVersions.set(e.key.toString(), t);
|
|
17351
17351
|
}
|
|
17352
17352
|
/**
|
|
@@ -17373,7 +17373,7 @@ class Transaction$2 {
|
|
|
17373
17373
|
// express that to the backend, we have to validate locally.
|
|
17374
17374
|
// Note: this can change once we can send separate verify writes in the
|
|
17375
17375
|
// transaction.
|
|
17376
|
-
throw new FirestoreError(
|
|
17376
|
+
throw new FirestoreError(M.INVALID_ARGUMENT, "Can't update a document that doesn't exist.");
|
|
17377
17377
|
// Document exists, base precondition on document update time.
|
|
17378
17378
|
return Precondition.updateTime(t);
|
|
17379
17379
|
}
|
|
@@ -17514,7 +17514,7 @@ class FirestoreClient {
|
|
|
17514
17514
|
* Checks that the client has not been terminated. Ensures that other methods on //
|
|
17515
17515
|
* this class cannot be called after the client is terminated. //
|
|
17516
17516
|
*/ verifyNotTerminated() {
|
|
17517
|
-
if (this.asyncQueue.isShuttingDown) throw new FirestoreError(
|
|
17517
|
+
if (this.asyncQueue.isShuttingDown) throw new FirestoreError(M.FAILED_PRECONDITION, "The client has already been terminated.");
|
|
17518
17518
|
}
|
|
17519
17519
|
terminate() {
|
|
17520
17520
|
this.asyncQueue.enterRestrictedMode();
|
|
@@ -17562,7 +17562,7 @@ async function __PRIVATE_setOnlineComponentProvider(e, t) {
|
|
|
17562
17562
|
* Decides whether the provided error allows us to gracefully disable
|
|
17563
17563
|
* persistence (as opposed to crashing the client).
|
|
17564
17564
|
*/ function __PRIVATE_canFallbackFromIndexedDbError(e) {
|
|
17565
|
-
return "FirebaseError" === e.name ? e.code ===
|
|
17565
|
+
return "FirebaseError" === e.name ? e.code === M.FAILED_PRECONDITION || e.code === M.UNIMPLEMENTED : !("undefined" != typeof DOMException && e instanceof DOMException) || (
|
|
17566
17566
|
// When the browser is out of quota we could get either quota exceeded
|
|
17567
17567
|
// or an aborted error depending on whether the error happened during
|
|
17568
17568
|
// schema migration.
|
|
@@ -17656,7 +17656,7 @@ async function __PRIVATE_getEventManager(e) {
|
|
|
17656
17656
|
const n = __PRIVATE_debugCast(e);
|
|
17657
17657
|
return n.persistence.runTransaction("read document", "readonly", (e => n.localDocuments.getDocument(e, t)));
|
|
17658
17658
|
}(e, t);
|
|
17659
|
-
r.isFoundDocument() ? n.resolve(r) : r.isNoDocument() ? n.resolve(null) : n.reject(new FirestoreError(
|
|
17659
|
+
r.isFoundDocument() ? n.resolve(r) : r.isNoDocument() ? n.resolve(null) : n.reject(new FirestoreError(M.UNAVAILABLE, "Failed to get document from cache. (However, this document may exist on the server. Run again without setting 'source' in the GetOptions to attempt to retrieve the document from the server.)"));
|
|
17660
17660
|
} catch (e) {
|
|
17661
17661
|
const r = __PRIVATE_wrapInUserErrorIfRecoverable(e, `Failed to get document '${t} from cache`);
|
|
17662
17662
|
n.reject(r);
|
|
@@ -17685,7 +17685,7 @@ function __PRIVATE_firestoreClientGetDocumentViaSnapshotListener(e, t, n = {}) {
|
|
|
17685
17685
|
// the server so we can deliver that even when you're
|
|
17686
17686
|
// offline 2) Actually reject the Promise in the online case
|
|
17687
17687
|
// if the document doesn't exist.
|
|
17688
|
-
i.reject(new FirestoreError(
|
|
17688
|
+
i.reject(new FirestoreError(M.UNAVAILABLE, "Failed to get document because the client is offline.")) : _ && s.fromCache && r && "server" === r.source ? i.reject(new FirestoreError(M.UNAVAILABLE, 'Failed to get document from server. (However, this document does exist in the local cache. Run again without setting source to "server" to retrieve the cached document.)')) : i.resolve(s);
|
|
17689
17689
|
},
|
|
17690
17690
|
error: e => i.reject(e)
|
|
17691
17691
|
}), o = new __PRIVATE_QueryListener(__PRIVATE_newQueryForPath(n.path), s, {
|
|
@@ -17722,7 +17722,7 @@ function __PRIVATE_firestoreClientGetDocumentsViaSnapshotListener(e, t, n = {})
|
|
|
17722
17722
|
next: n => {
|
|
17723
17723
|
// Remove query first before passing event to user to avoid
|
|
17724
17724
|
// user actions affecting the now stale query.
|
|
17725
|
-
t.enqueueAndForget((() => __PRIVATE_eventManagerUnlisten(e, o))), n.fromCache && "server" === r.source ? i.reject(new FirestoreError(
|
|
17725
|
+
t.enqueueAndForget((() => __PRIVATE_eventManagerUnlisten(e, o))), n.fromCache && "server" === r.source ? i.reject(new FirestoreError(M.UNAVAILABLE, 'Failed to get documents from server. (However, these documents may exist in the local cache. Run again without setting source to "server" to retrieve the cached documents.)')) : i.resolve(n);
|
|
17726
17726
|
},
|
|
17727
17727
|
error: e => i.reject(e)
|
|
17728
17728
|
}), o = new __PRIVATE_QueryListener(n, s, {
|
|
@@ -17951,7 +17951,7 @@ function __PRIVATE_cloneLongPollingOptions(e) {
|
|
|
17951
17951
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
17952
17952
|
* See the License for the specific language governing permissions and
|
|
17953
17953
|
* limitations under the License.
|
|
17954
|
-
*/ const
|
|
17954
|
+
*/ const be = new Map;
|
|
17955
17955
|
|
|
17956
17956
|
/**
|
|
17957
17957
|
* An instance map that ensures only one Datastore exists per Firestore
|
|
@@ -17974,28 +17974,28 @@ function __PRIVATE_cloneLongPollingOptions(e) {
|
|
|
17974
17974
|
* limitations under the License.
|
|
17975
17975
|
*/
|
|
17976
17976
|
function __PRIVATE_validateNonEmptyArgument(e, t, n) {
|
|
17977
|
-
if (!n) throw new FirestoreError(
|
|
17977
|
+
if (!n) throw new FirestoreError(M.INVALID_ARGUMENT, `Function ${e}() cannot be called with an empty ${t}.`);
|
|
17978
17978
|
}
|
|
17979
17979
|
|
|
17980
17980
|
/**
|
|
17981
17981
|
* Validates that two boolean options are not set at the same time.
|
|
17982
17982
|
* @internal
|
|
17983
17983
|
*/ function __PRIVATE_validateIsNotUsedTogether(e, t, n, r) {
|
|
17984
|
-
if (!0 === t && !0 === r) throw new FirestoreError(
|
|
17984
|
+
if (!0 === t && !0 === r) throw new FirestoreError(M.INVALID_ARGUMENT, `${e} and ${n} cannot be used together.`);
|
|
17985
17985
|
}
|
|
17986
17986
|
|
|
17987
17987
|
/**
|
|
17988
17988
|
* Validates that `path` refers to a document (indicated by the fact it contains
|
|
17989
17989
|
* an even numbers of segments).
|
|
17990
17990
|
*/ function __PRIVATE_validateDocumentPath(e) {
|
|
17991
|
-
if (!DocumentKey.isDocumentKey(e)) throw new FirestoreError(
|
|
17991
|
+
if (!DocumentKey.isDocumentKey(e)) throw new FirestoreError(M.INVALID_ARGUMENT, `Invalid document reference. Document references must have an even number of segments, but ${e} has ${e.length}.`);
|
|
17992
17992
|
}
|
|
17993
17993
|
|
|
17994
17994
|
/**
|
|
17995
17995
|
* Validates that `path` refers to a collection (indicated by the fact it
|
|
17996
17996
|
* contains an odd numbers of segments).
|
|
17997
17997
|
*/ function __PRIVATE_validateCollectionPath(e) {
|
|
17998
|
-
if (DocumentKey.isDocumentKey(e)) throw new FirestoreError(
|
|
17998
|
+
if (DocumentKey.isDocumentKey(e)) throw new FirestoreError(M.INVALID_ARGUMENT, `Invalid collection reference. Collection references must have an odd number of segments, but ${e} has ${e.length}.`);
|
|
17999
17999
|
}
|
|
18000
18000
|
|
|
18001
18001
|
/**
|
|
@@ -18039,17 +18039,17 @@ t) {
|
|
|
18039
18039
|
// Unwrap Compat types
|
|
18040
18040
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
18041
18041
|
e = e._delegate), !(e instanceof t)) {
|
|
18042
|
-
if (t.name === e.constructor.name) throw new FirestoreError(
|
|
18042
|
+
if (t.name === e.constructor.name) throw new FirestoreError(M.INVALID_ARGUMENT, "Type does not match the expected instance. Did you pass a reference from a different Firestore SDK?");
|
|
18043
18043
|
{
|
|
18044
18044
|
const n = __PRIVATE_valueDescription(e);
|
|
18045
|
-
throw new FirestoreError(
|
|
18045
|
+
throw new FirestoreError(M.INVALID_ARGUMENT, `Expected type '${t.name}', but it was: ${n}`);
|
|
18046
18046
|
}
|
|
18047
18047
|
}
|
|
18048
18048
|
return e;
|
|
18049
18049
|
}
|
|
18050
18050
|
|
|
18051
18051
|
function __PRIVATE_validatePositiveNumber(e, t) {
|
|
18052
|
-
if (t <= 0) throw new FirestoreError(
|
|
18052
|
+
if (t <= 0) throw new FirestoreError(M.INVALID_ARGUMENT, `Function ${e}() requires a positive number, but it was: ${t}.`);
|
|
18053
18053
|
}
|
|
18054
18054
|
|
|
18055
18055
|
/**
|
|
@@ -18078,12 +18078,12 @@ class FirestoreSettingsImpl {
|
|
|
18078
18078
|
constructor(e) {
|
|
18079
18079
|
var t, n;
|
|
18080
18080
|
if (void 0 === e.host) {
|
|
18081
|
-
if (void 0 !== e.ssl) throw new FirestoreError(
|
|
18081
|
+
if (void 0 !== e.ssl) throw new FirestoreError(M.INVALID_ARGUMENT, "Can't provide ssl option if host option is not set");
|
|
18082
18082
|
this.host = "firestore.googleapis.com", this.ssl = true;
|
|
18083
18083
|
} else this.host = e.host, this.ssl = null === (t = e.ssl) || void 0 === t || t;
|
|
18084
18084
|
if (this.credentials = e.credentials, this.ignoreUndefinedProperties = !!e.ignoreUndefinedProperties,
|
|
18085
18085
|
this.localCache = e.localCache, void 0 === e.cacheSizeBytes) this.cacheSizeBytes = 41943040; else {
|
|
18086
|
-
if (-1 !== e.cacheSizeBytes && e.cacheSizeBytes < 1048576) throw new FirestoreError(
|
|
18086
|
+
if (-1 !== e.cacheSizeBytes && e.cacheSizeBytes < 1048576) throw new FirestoreError(M.INVALID_ARGUMENT, "cacheSizeBytes must be at least 1048576");
|
|
18087
18087
|
this.cacheSizeBytes = e.cacheSizeBytes;
|
|
18088
18088
|
}
|
|
18089
18089
|
__PRIVATE_validateIsNotUsedTogether("experimentalForceLongPolling", e.experimentalForceLongPolling, "experimentalAutoDetectLongPolling", e.experimentalAutoDetectLongPolling),
|
|
@@ -18095,9 +18095,9 @@ class FirestoreSettingsImpl {
|
|
|
18095
18095
|
this.experimentalLongPollingOptions = __PRIVATE_cloneLongPollingOptions(null !== (n = e.experimentalLongPollingOptions) && void 0 !== n ? n : {}),
|
|
18096
18096
|
function __PRIVATE_validateLongPollingOptions(e) {
|
|
18097
18097
|
if (void 0 !== e.timeoutSeconds) {
|
|
18098
|
-
if (isNaN(e.timeoutSeconds)) throw new FirestoreError(
|
|
18099
|
-
if (e.timeoutSeconds < 5) throw new FirestoreError(
|
|
18100
|
-
if (e.timeoutSeconds > 30) throw new FirestoreError(
|
|
18098
|
+
if (isNaN(e.timeoutSeconds)) throw new FirestoreError(M.INVALID_ARGUMENT, `invalid long polling timeout: ${e.timeoutSeconds} (must not be NaN)`);
|
|
18099
|
+
if (e.timeoutSeconds < 5) throw new FirestoreError(M.INVALID_ARGUMENT, `invalid long polling timeout: ${e.timeoutSeconds} (minimum allowed value is 5)`);
|
|
18100
|
+
if (e.timeoutSeconds > 30) throw new FirestoreError(M.INVALID_ARGUMENT, `invalid long polling timeout: ${e.timeoutSeconds} (maximum allowed value is 30)`);
|
|
18101
18101
|
}
|
|
18102
18102
|
}
|
|
18103
18103
|
/**
|
|
@@ -18144,7 +18144,7 @@ class Firestore$1 {
|
|
|
18144
18144
|
* The {@link @firebase/app#FirebaseApp} associated with this `Firestore` service
|
|
18145
18145
|
* instance.
|
|
18146
18146
|
*/ get app() {
|
|
18147
|
-
if (!this._app) throw new FirestoreError(
|
|
18147
|
+
if (!this._app) throw new FirestoreError(M.FAILED_PRECONDITION, "Firestore was not initialized using the Firebase SDK. 'app' is not available");
|
|
18148
18148
|
return this._app;
|
|
18149
18149
|
}
|
|
18150
18150
|
get _initialized() {
|
|
@@ -18154,7 +18154,7 @@ class Firestore$1 {
|
|
|
18154
18154
|
return void 0 !== this._terminateTask;
|
|
18155
18155
|
}
|
|
18156
18156
|
_setSettings(e) {
|
|
18157
|
-
if (this._settingsFrozen) throw new FirestoreError(
|
|
18157
|
+
if (this._settingsFrozen) throw new FirestoreError(M.FAILED_PRECONDITION, "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.");
|
|
18158
18158
|
this._settings = new FirestoreSettingsImpl(e), void 0 !== e.credentials && (this._authCredentials = function __PRIVATE_makeAuthCredentialsProvider(e) {
|
|
18159
18159
|
if (!e) return new __PRIVATE_EmptyAuthCredentialsProvider;
|
|
18160
18160
|
switch (e.type) {
|
|
@@ -18165,7 +18165,7 @@ class Firestore$1 {
|
|
|
18165
18165
|
return e.client;
|
|
18166
18166
|
|
|
18167
18167
|
default:
|
|
18168
|
-
throw new FirestoreError(
|
|
18168
|
+
throw new FirestoreError(M.INVALID_ARGUMENT, "makeAuthCredentialsProvider failed due to invalid credential type");
|
|
18169
18169
|
}
|
|
18170
18170
|
}(e.credentials));
|
|
18171
18171
|
}
|
|
@@ -18197,8 +18197,8 @@ class Firestore$1 {
|
|
|
18197
18197
|
* when the `Firestore` instance is terminated.
|
|
18198
18198
|
*/
|
|
18199
18199
|
return function __PRIVATE_removeComponents(e) {
|
|
18200
|
-
const t =
|
|
18201
|
-
t && (__PRIVATE_logDebug("ComponentProvider", "Removing Datastore"),
|
|
18200
|
+
const t = be.get(e);
|
|
18201
|
+
t && (__PRIVATE_logDebug("ComponentProvider", "Removing Datastore"), be.delete(e),
|
|
18202
18202
|
t.terminate());
|
|
18203
18203
|
}(this), Promise.resolve();
|
|
18204
18204
|
}
|
|
@@ -18230,7 +18230,7 @@ class Firestore$1 {
|
|
|
18230
18230
|
// invalid field "uid" and missing field "sub" / "user_id".)
|
|
18231
18231
|
t = I(r.mockUserToken, null === (i = e._app) || void 0 === i ? void 0 : i.options.projectId);
|
|
18232
18232
|
const s = r.mockUserToken.sub || r.mockUserToken.user_id;
|
|
18233
|
-
if (!s) throw new FirestoreError(
|
|
18233
|
+
if (!s) throw new FirestoreError(M.INVALID_ARGUMENT, "mockUserToken must contain 'sub' or 'user_id' field!");
|
|
18234
18234
|
n = new User(s);
|
|
18235
18235
|
}
|
|
18236
18236
|
e._authCredentials = new __PRIVATE_EmulatorAuthCredentialsProvider(new __PRIVATE_OAuthToken(t, n));
|
|
@@ -18350,7 +18350,7 @@ function collection(e, t, ...n) {
|
|
|
18350
18350
|
return __PRIVATE_validateCollectionPath(r), new CollectionReference(e, /* converter= */ null, r);
|
|
18351
18351
|
}
|
|
18352
18352
|
{
|
|
18353
|
-
if (!(e instanceof DocumentReference || e instanceof CollectionReference)) throw new FirestoreError(
|
|
18353
|
+
if (!(e instanceof DocumentReference || e instanceof CollectionReference)) throw new FirestoreError(M.INVALID_ARGUMENT, "Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");
|
|
18354
18354
|
const r = e._path.child(ResourcePath.fromString(t, ...n));
|
|
18355
18355
|
return __PRIVATE_validateCollectionPath(r), new CollectionReference(e.firestore,
|
|
18356
18356
|
/* converter= */ null, r);
|
|
@@ -18371,7 +18371,7 @@ function collection(e, t, ...n) {
|
|
|
18371
18371
|
* @returns The created `Query`.
|
|
18372
18372
|
*/ function collectionGroup(e, t) {
|
|
18373
18373
|
if (e = __PRIVATE_cast(e, Firestore$1), __PRIVATE_validateNonEmptyArgument("collectionGroup", "collection id", t),
|
|
18374
|
-
t.indexOf("/") >= 0) throw new FirestoreError(
|
|
18374
|
+
t.indexOf("/") >= 0) throw new FirestoreError(M.INVALID_ARGUMENT, `Invalid collection ID '${t}' passed to function collectionGroup(). Collection IDs must not contain '/'.`);
|
|
18375
18375
|
return new Query(e,
|
|
18376
18376
|
/* converter= */ null, function __PRIVATE_newQueryForCollectionGroup(e) {
|
|
18377
18377
|
return new __PRIVATE_QueryImpl(ResourcePath.emptyPath(), e);
|
|
@@ -18389,7 +18389,7 @@ function doc(e, t, ...n) {
|
|
|
18389
18389
|
/* converter= */ null, new DocumentKey(r));
|
|
18390
18390
|
}
|
|
18391
18391
|
{
|
|
18392
|
-
if (!(e instanceof DocumentReference || e instanceof CollectionReference)) throw new FirestoreError(
|
|
18392
|
+
if (!(e instanceof DocumentReference || e instanceof CollectionReference)) throw new FirestoreError(M.INVALID_ARGUMENT, "Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");
|
|
18393
18393
|
const r = e._path.child(ResourcePath.fromString(t, ...n));
|
|
18394
18394
|
return __PRIVATE_validateDocumentPath(r), new DocumentReference(e.firestore, e instanceof CollectionReference ? e.converter : null, new DocumentKey(r));
|
|
18395
18395
|
}
|
|
@@ -18749,7 +18749,7 @@ class LoadBundleTask {
|
|
|
18749
18749
|
* Constant used to indicate the LRU garbage collection should be disabled.
|
|
18750
18750
|
* Set this value as the `cacheSizeBytes` on the settings passed to the
|
|
18751
18751
|
* {@link Firestore} instance.
|
|
18752
|
-
*/ const
|
|
18752
|
+
*/ const De = -1;
|
|
18753
18753
|
|
|
18754
18754
|
/**
|
|
18755
18755
|
* The Cloud Firestore service interface.
|
|
@@ -18793,10 +18793,10 @@ class LoadBundleTask {
|
|
|
18793
18793
|
identifier: n
|
|
18794
18794
|
}), i = r.getOptions(n);
|
|
18795
18795
|
if (E(i, t)) return e;
|
|
18796
|
-
throw new FirestoreError(
|
|
18796
|
+
throw new FirestoreError(M.FAILED_PRECONDITION, "initializeFirestore() has already been called with different options. To avoid this error, call initializeFirestore() with the same options as when it was originally called, or call getFirestore() to return the already initialized instance.");
|
|
18797
18797
|
}
|
|
18798
|
-
if (void 0 !== t.cacheSizeBytes && void 0 !== t.localCache) throw new FirestoreError(
|
|
18799
|
-
if (void 0 !== t.cacheSizeBytes && -1 !== t.cacheSizeBytes && t.cacheSizeBytes < 1048576) throw new FirestoreError(
|
|
18798
|
+
if (void 0 !== t.cacheSizeBytes && void 0 !== t.localCache) throw new FirestoreError(M.INVALID_ARGUMENT, "cache and cacheSizeBytes cannot be specified at the same time as cacheSizeBytes willbe deprecated. Instead, specify the cache size in the cache object");
|
|
18799
|
+
if (void 0 !== t.cacheSizeBytes && -1 !== t.cacheSizeBytes && t.cacheSizeBytes < 1048576) throw new FirestoreError(M.INVALID_ARGUMENT, "cacheSizeBytes must be at least 1048576");
|
|
18800
18800
|
return r.initialize({
|
|
18801
18801
|
options: t,
|
|
18802
18802
|
instanceIdentifier: n
|
|
@@ -18865,7 +18865,7 @@ function __PRIVATE_configureFirestore(e) {
|
|
|
18865
18865
|
*/ function enableIndexedDbPersistence(e, t) {
|
|
18866
18866
|
__PRIVATE_verifyNotInitialized(e = __PRIVATE_cast(e, Firestore));
|
|
18867
18867
|
const n = ensureFirestoreConfigured(e);
|
|
18868
|
-
if (n._uninitializedComponentsProvider) throw new FirestoreError(
|
|
18868
|
+
if (n._uninitializedComponentsProvider) throw new FirestoreError(M.FAILED_PRECONDITION, "SDK cache is already specified.");
|
|
18869
18869
|
__PRIVATE_logWarn("enableIndexedDbPersistence() will be deprecated in the future, you can use `FirestoreSettings.cache` instead.");
|
|
18870
18870
|
const r = e._freezeSettings(), i = new OnlineComponentProvider;
|
|
18871
18871
|
return __PRIVATE_setPersistenceProviders(n, i, new __PRIVATE_IndexedDbOfflineComponentProvider(i, r.cacheSizeBytes, null == t ? void 0 : t.forceOwnership));
|
|
@@ -18899,7 +18899,7 @@ function __PRIVATE_configureFirestore(e) {
|
|
|
18899
18899
|
*/ function enableMultiTabIndexedDbPersistence(e) {
|
|
18900
18900
|
__PRIVATE_verifyNotInitialized(e = __PRIVATE_cast(e, Firestore));
|
|
18901
18901
|
const t = ensureFirestoreConfigured(e);
|
|
18902
|
-
if (t._uninitializedComponentsProvider) throw new FirestoreError(
|
|
18902
|
+
if (t._uninitializedComponentsProvider) throw new FirestoreError(M.FAILED_PRECONDITION, "SDK cache is already specified.");
|
|
18903
18903
|
__PRIVATE_logWarn("enableMultiTabIndexedDbPersistence() will be deprecated in the future, you can use `FirestoreSettings.cache` instead.");
|
|
18904
18904
|
const n = e._freezeSettings(), r = new OnlineComponentProvider;
|
|
18905
18905
|
return __PRIVATE_setPersistenceProviders(t, r, new __PRIVATE_MultiTabOfflineComponentProvider(r, n.cacheSizeBytes));
|
|
@@ -18947,7 +18947,7 @@ function __PRIVATE_configureFirestore(e) {
|
|
|
18947
18947
|
* @returns A `Promise` that is resolved when the persistent storage is
|
|
18948
18948
|
* cleared. Otherwise, the promise is rejected with an error.
|
|
18949
18949
|
*/ function clearIndexedDbPersistence(e) {
|
|
18950
|
-
if (e._initialized && !e._terminated) throw new FirestoreError(
|
|
18950
|
+
if (e._initialized && !e._terminated) throw new FirestoreError(M.FAILED_PRECONDITION, "Persistence can only be cleared before a Firestore instance is initialized or after it is terminated.");
|
|
18951
18951
|
const t = new __PRIVATE_Deferred;
|
|
18952
18952
|
return e._queue.enqueueAndForgetEvenWhileRestricted((async () => {
|
|
18953
18953
|
try {
|
|
@@ -19061,7 +19061,7 @@ function __PRIVATE_configureFirestore(e) {
|
|
|
19061
19061
|
}
|
|
19062
19062
|
|
|
19063
19063
|
function __PRIVATE_verifyNotInitialized(e) {
|
|
19064
|
-
if (e._initialized || e._terminated) throw new FirestoreError(
|
|
19064
|
+
if (e._initialized || e._terminated) throw new FirestoreError(M.FAILED_PRECONDITION, "Firestore has already been started and persistence can no longer be enabled. You can only enable persistence before calling any other methods on a Firestore object.");
|
|
19065
19065
|
}
|
|
19066
19066
|
|
|
19067
19067
|
/**
|
|
@@ -19170,7 +19170,7 @@ class AggregateField {
|
|
|
19170
19170
|
try {
|
|
19171
19171
|
return new Bytes(ByteString.fromBase64String(e));
|
|
19172
19172
|
} catch (e) {
|
|
19173
|
-
throw new FirestoreError(
|
|
19173
|
+
throw new FirestoreError(M.INVALID_ARGUMENT, "Failed to construct data from Base64 string: " + e);
|
|
19174
19174
|
}
|
|
19175
19175
|
}
|
|
19176
19176
|
/**
|
|
@@ -19242,7 +19242,7 @@ class AggregateField {
|
|
|
19242
19242
|
* @param fieldNames - A list of field names.
|
|
19243
19243
|
*/
|
|
19244
19244
|
constructor(...e) {
|
|
19245
|
-
for (let t = 0; t < e.length; ++t) if (0 === e[t].length) throw new FirestoreError(
|
|
19245
|
+
for (let t = 0; t < e.length; ++t) if (0 === e[t].length) throw new FirestoreError(M.INVALID_ARGUMENT, "Invalid field name at argument $(i + 1). Field names must not be empty.");
|
|
19246
19246
|
this._internalPath = new FieldPath$1(e);
|
|
19247
19247
|
}
|
|
19248
19248
|
/**
|
|
@@ -19321,8 +19321,8 @@ class AggregateField {
|
|
|
19321
19321
|
* @param longitude - The longitude as number between -180 and 180.
|
|
19322
19322
|
*/
|
|
19323
19323
|
constructor(e, t) {
|
|
19324
|
-
if (!isFinite(e) || e < -90 || e > 90) throw new FirestoreError(
|
|
19325
|
-
if (!isFinite(t) || t < -180 || t > 180) throw new FirestoreError(
|
|
19324
|
+
if (!isFinite(e) || e < -90 || e > 90) throw new FirestoreError(M.INVALID_ARGUMENT, "Latitude must be a number between -90 and 90, but was: " + e);
|
|
19325
|
+
if (!isFinite(t) || t < -180 || t > 180) throw new FirestoreError(M.INVALID_ARGUMENT, "Longitude must be a number between -180 and 180, but was: " + t);
|
|
19326
19326
|
this._lat = e, this._long = t;
|
|
19327
19327
|
}
|
|
19328
19328
|
/**
|
|
@@ -19372,7 +19372,7 @@ class AggregateField {
|
|
|
19372
19372
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
19373
19373
|
* See the License for the specific language governing permissions and
|
|
19374
19374
|
* limitations under the License.
|
|
19375
|
-
*/ const
|
|
19375
|
+
*/ const Ce = /^__.*__$/;
|
|
19376
19376
|
|
|
19377
19377
|
/** The result of parsing document data (e.g. for a setData call). */ class ParsedSetData {
|
|
19378
19378
|
constructor(e, t, n) {
|
|
@@ -19483,7 +19483,7 @@ function __PRIVATE_isWrite(e) {
|
|
|
19483
19483
|
}
|
|
19484
19484
|
wu(e) {
|
|
19485
19485
|
if (0 === e.length) throw this.Du("Document fields must not be empty");
|
|
19486
|
-
if (__PRIVATE_isWrite(this.fu) &&
|
|
19486
|
+
if (__PRIVATE_isWrite(this.fu) && Ce.test(e)) throw this.Du('Document fields cannot begin and end with "__"');
|
|
19487
19487
|
}
|
|
19488
19488
|
}
|
|
19489
19489
|
|
|
@@ -19520,7 +19520,7 @@ function __PRIVATE_newUserDataReader(e) {
|
|
|
19520
19520
|
const e = [];
|
|
19521
19521
|
for (const r of s.mergeFields) {
|
|
19522
19522
|
const i = __PRIVATE_fieldPathFromArgument$1(t, r, n);
|
|
19523
|
-
if (!o.contains(i)) throw new FirestoreError(
|
|
19523
|
+
if (!o.contains(i)) throw new FirestoreError(M.INVALID_ARGUMENT, `Field '${i}' is specified in your field mask but missing from your input data.`);
|
|
19524
19524
|
__PRIVATE_fieldMaskContains(e, i) || e.push(i);
|
|
19525
19525
|
}
|
|
19526
19526
|
a = new FieldMask(e), u = o.fieldTransforms.filter((e => a.covers(e.field)));
|
|
@@ -19637,7 +19637,7 @@ class __PRIVATE_NumericIncrementFieldValueImpl extends FieldValue {
|
|
|
19637
19637
|
|
|
19638
19638
|
/** Parse update data from a list of field/value arguments. */ function __PRIVATE_parseUpdateVarargs(e, t, n, r, i, s) {
|
|
19639
19639
|
const o = e.Fu(1 /* UserDataSource.Update */ , t, n), _ = [ __PRIVATE_fieldPathFromArgument$1(t, r, n) ], a = [ i ];
|
|
19640
|
-
if (s.length % 2 != 0) throw new FirestoreError(
|
|
19640
|
+
if (s.length % 2 != 0) throw new FirestoreError(M.INVALID_ARGUMENT, `Function ${t}() needs to be called with an even number of arguments that alternate between field names and values.`);
|
|
19641
19641
|
for (let e = 0; e < s.length; e += 2) _.push(__PRIVATE_fieldPathFromArgument$1(t, s[e])),
|
|
19642
19642
|
a.push(s[e + 1]);
|
|
19643
19643
|
const u = [], c = ObjectValue.empty();
|
|
@@ -19838,7 +19838,7 @@ function __PRIVATE_validatePlainObject(e, t, n) {
|
|
|
19838
19838
|
|
|
19839
19839
|
/**
|
|
19840
19840
|
* Matches any characters in a field path string that are reserved.
|
|
19841
|
-
*/ const
|
|
19841
|
+
*/ const ve = new RegExp("[~\\*/\\[\\]]");
|
|
19842
19842
|
|
|
19843
19843
|
/**
|
|
19844
19844
|
* Wraps fromDotSeparatedString with an error message about the method that
|
|
@@ -19849,7 +19849,7 @@ function __PRIVATE_validatePlainObject(e, t, n) {
|
|
|
19849
19849
|
* @param targetDoc - The document against which the field path will be
|
|
19850
19850
|
* evaluated.
|
|
19851
19851
|
*/ function __PRIVATE_fieldPathFromDotSeparatedString(e, t, n) {
|
|
19852
|
-
if (t.search(
|
|
19852
|
+
if (t.search(ve) >= 0) throw __PRIVATE_createError(`Invalid field path (${t}). Paths must not contain '~', '*', '/', '[', or ']'`, e,
|
|
19853
19853
|
/* hasConverter= */ !1,
|
|
19854
19854
|
/* path= */ void 0, n);
|
|
19855
19855
|
try {
|
|
@@ -19867,7 +19867,7 @@ function __PRIVATE_createError(e, t, n, r, i) {
|
|
|
19867
19867
|
n && (_ += " (via `toFirestore()`)"), _ += ". ";
|
|
19868
19868
|
let a = "";
|
|
19869
19869
|
return (s || o) && (a += " (found", s && (a += ` in field ${r}`), o && (a += ` in document ${i}`),
|
|
19870
|
-
a += ")"), new FirestoreError(
|
|
19870
|
+
a += ")"), new FirestoreError(M.INVALID_ARGUMENT, _ + e + a);
|
|
19871
19871
|
}
|
|
19872
19872
|
|
|
19873
19873
|
/** Checks `haystack` if FieldPath `needle` is present. Runs in O(n). */ function __PRIVATE_fieldMaskContains(e, t) {
|
|
@@ -20004,7 +20004,7 @@ function __PRIVATE_createError(e, t, n, r, i) {
|
|
|
20004
20004
|
* See the License for the specific language governing permissions and
|
|
20005
20005
|
* limitations under the License.
|
|
20006
20006
|
*/ function __PRIVATE_validateHasExplicitOrderByForLimitToLast(e) {
|
|
20007
|
-
if ("L" /* LimitType.Last */ === e.limitType && 0 === e.explicitOrderBy.length) throw new FirestoreError(
|
|
20007
|
+
if ("L" /* LimitType.Last */ === e.limitType && 0 === e.explicitOrderBy.length) throw new FirestoreError(M.UNIMPLEMENTED, "limitToLast() queries require specifying at least one orderBy() clause");
|
|
20008
20008
|
}
|
|
20009
20009
|
|
|
20010
20010
|
/**
|
|
@@ -20025,7 +20025,7 @@ function query(e, t, ...n) {
|
|
|
20025
20025
|
let r = [];
|
|
20026
20026
|
t instanceof AppliableConstraint && r.push(t), r = r.concat(n), function __PRIVATE_validateQueryConstraintArray(e) {
|
|
20027
20027
|
const t = e.filter((e => e instanceof QueryCompositeFilterConstraint)).length, n = e.filter((e => e instanceof QueryFieldFilterConstraint)).length;
|
|
20028
|
-
if (t > 1 || t > 0 && n > 0) throw new FirestoreError(
|
|
20028
|
+
if (t > 1 || t > 0 && n > 0) throw new FirestoreError(M.INVALID_ARGUMENT, "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(...)))`.");
|
|
20029
20029
|
}
|
|
20030
20030
|
/**
|
|
20031
20031
|
* @license
|
|
@@ -20079,7 +20079,7 @@ function query(e, t, ...n) {
|
|
|
20079
20079
|
const t = __PRIVATE_newUserDataReader(e.firestore), n = function __PRIVATE_newQueryFilter(e, t, n, r, i, s, o) {
|
|
20080
20080
|
let _;
|
|
20081
20081
|
if (i.isKeyField()) {
|
|
20082
|
-
if ("array-contains" /* Operator.ARRAY_CONTAINS */ === s || "array-contains-any" /* Operator.ARRAY_CONTAINS_ANY */ === s) throw new FirestoreError(
|
|
20082
|
+
if ("array-contains" /* Operator.ARRAY_CONTAINS */ === s || "array-contains-any" /* Operator.ARRAY_CONTAINS_ANY */ === s) throw new FirestoreError(M.INVALID_ARGUMENT, `Invalid Query. You can't perform '${s}' queries on documentId().`);
|
|
20083
20083
|
if ("in" /* Operator.IN */ === s || "not-in" /* Operator.NOT_IN */ === s) {
|
|
20084
20084
|
__PRIVATE_validateDisjunctiveFilterElements(o, s);
|
|
20085
20085
|
const t = [];
|
|
@@ -20206,8 +20206,8 @@ function query(e, t, ...n) {
|
|
|
20206
20206
|
}
|
|
20207
20207
|
_apply(e) {
|
|
20208
20208
|
const t = function __PRIVATE_newQueryOrderBy(e, t, n) {
|
|
20209
|
-
if (null !== e.startAt) throw new FirestoreError(
|
|
20210
|
-
if (null !== e.endAt) throw new FirestoreError(
|
|
20209
|
+
if (null !== e.startAt) throw new FirestoreError(M.INVALID_ARGUMENT, "Invalid query. You must not call startAt() or startAfter() before calling orderBy().");
|
|
20210
|
+
if (null !== e.endAt) throw new FirestoreError(M.INVALID_ARGUMENT, "Invalid query. You must not call endAt() or endBefore() before calling orderBy().");
|
|
20211
20211
|
return new OrderBy(t, n);
|
|
20212
20212
|
}
|
|
20213
20213
|
/**
|
|
@@ -20365,7 +20365,7 @@ function endAt(...e) {
|
|
|
20365
20365
|
|
|
20366
20366
|
/** Helper function to create a bound from a document or fields */ function __PRIVATE_newQueryBoundFromDocOrFields(e, t, n, r) {
|
|
20367
20367
|
if (n[0] = T(n[0]), n[0] instanceof DocumentSnapshot$1) return function __PRIVATE_newQueryBoundFromDocument(e, t, n, r, i) {
|
|
20368
|
-
if (!r) throw new FirestoreError(
|
|
20368
|
+
if (!r) throw new FirestoreError(M.NOT_FOUND, `Can't use a DocumentSnapshot that doesn't exist for ${n}().`);
|
|
20369
20369
|
const s = [];
|
|
20370
20370
|
// Because people expect to continue/end a query at the exact document
|
|
20371
20371
|
// provided, we need to use the implicit sort order rather than the explicit
|
|
@@ -20376,10 +20376,10 @@ function endAt(...e) {
|
|
|
20376
20376
|
// results.
|
|
20377
20377
|
for (const n of __PRIVATE_queryNormalizedOrderBy(e)) if (n.field.isKeyField()) s.push(__PRIVATE_refValue(t, r.key)); else {
|
|
20378
20378
|
const e = r.data.field(n.field);
|
|
20379
|
-
if (__PRIVATE_isServerTimestamp(e)) throw new FirestoreError(
|
|
20379
|
+
if (__PRIVATE_isServerTimestamp(e)) throw new FirestoreError(M.INVALID_ARGUMENT, 'Invalid query. You are trying to start or end a query using a document for which the field "' + n.field + '" is an uncommitted server timestamp. (Since the value of this field is unknown, you cannot start/end a query with it.)');
|
|
20380
20380
|
if (null === e) {
|
|
20381
20381
|
const e = n.field.canonicalString();
|
|
20382
|
-
throw new FirestoreError(
|
|
20382
|
+
throw new FirestoreError(M.INVALID_ARGUMENT, `Invalid query. You are trying to start or end a query using a document for which the field '${e}' (used as the orderBy) does not exist.`);
|
|
20383
20383
|
}
|
|
20384
20384
|
s.push(e);
|
|
20385
20385
|
}
|
|
@@ -20393,15 +20393,15 @@ function endAt(...e) {
|
|
|
20393
20393
|
return function __PRIVATE_newQueryBoundFromFields(e, t, n, r, i, s) {
|
|
20394
20394
|
// Use explicit order by's because it has to match the query the user made
|
|
20395
20395
|
const o = e.explicitOrderBy;
|
|
20396
|
-
if (i.length > o.length) throw new FirestoreError(
|
|
20396
|
+
if (i.length > o.length) throw new FirestoreError(M.INVALID_ARGUMENT, `Too many arguments provided to ${r}(). The number of arguments must be less than or equal to the number of orderBy() clauses`);
|
|
20397
20397
|
const _ = [];
|
|
20398
20398
|
for (let s = 0; s < i.length; s++) {
|
|
20399
20399
|
const a = i[s];
|
|
20400
20400
|
if (o[s].field.isKeyField()) {
|
|
20401
|
-
if ("string" != typeof a) throw new FirestoreError(
|
|
20402
|
-
if (!__PRIVATE_isCollectionGroupQuery(e) && -1 !== a.indexOf("/")) throw new FirestoreError(
|
|
20401
|
+
if ("string" != typeof a) throw new FirestoreError(M.INVALID_ARGUMENT, `Invalid query. Expected a string for document ID in ${r}(), but got a ${typeof a}`);
|
|
20402
|
+
if (!__PRIVATE_isCollectionGroupQuery(e) && -1 !== a.indexOf("/")) throw new FirestoreError(M.INVALID_ARGUMENT, `Invalid query. When querying a collection and ordering by documentId(), the value passed to ${r}() must be a plain document ID, but '${a}' contains a slash.`);
|
|
20403
20403
|
const n = e.path.child(ResourcePath.fromString(a));
|
|
20404
|
-
if (!DocumentKey.isDocumentKey(n)) throw new FirestoreError(
|
|
20404
|
+
if (!DocumentKey.isDocumentKey(n)) throw new FirestoreError(M.INVALID_ARGUMENT, `Invalid query. When querying a collection group and ordering by documentId(), the value passed to ${r}() must result in a valid document path, but '${n}' is not because it contains an odd number of segments.`);
|
|
20405
20405
|
const i = new DocumentKey(n);
|
|
20406
20406
|
_.push(__PRIVATE_refValue(t, i));
|
|
20407
20407
|
} else {
|
|
@@ -20421,21 +20421,21 @@ function endAt(...e) {
|
|
|
20421
20421
|
|
|
20422
20422
|
function __PRIVATE_parseDocumentIdValue(e, t, n) {
|
|
20423
20423
|
if ("string" == typeof (n = T(n))) {
|
|
20424
|
-
if ("" === n) throw new FirestoreError(
|
|
20425
|
-
if (!__PRIVATE_isCollectionGroupQuery(t) && -1 !== n.indexOf("/")) throw new FirestoreError(
|
|
20424
|
+
if ("" === n) throw new FirestoreError(M.INVALID_ARGUMENT, "Invalid query. When querying with documentId(), you must provide a valid document ID, but it was an empty string.");
|
|
20425
|
+
if (!__PRIVATE_isCollectionGroupQuery(t) && -1 !== n.indexOf("/")) throw new FirestoreError(M.INVALID_ARGUMENT, `Invalid query. When querying a collection by documentId(), you must provide a plain document ID, but '${n}' contains a '/' character.`);
|
|
20426
20426
|
const r = t.path.child(ResourcePath.fromString(n));
|
|
20427
|
-
if (!DocumentKey.isDocumentKey(r)) throw new FirestoreError(
|
|
20427
|
+
if (!DocumentKey.isDocumentKey(r)) throw new FirestoreError(M.INVALID_ARGUMENT, `Invalid query. When querying a collection group by documentId(), the value provided must result in a valid document path, but '${r}' is not because it has an odd number of segments (${r.length}).`);
|
|
20428
20428
|
return __PRIVATE_refValue(e, new DocumentKey(r));
|
|
20429
20429
|
}
|
|
20430
20430
|
if (n instanceof DocumentReference) return __PRIVATE_refValue(e, n._key);
|
|
20431
|
-
throw new FirestoreError(
|
|
20431
|
+
throw new FirestoreError(M.INVALID_ARGUMENT, `Invalid query. When querying with documentId(), you must provide a valid string or a DocumentReference, but it was: ${__PRIVATE_valueDescription(n)}.`);
|
|
20432
20432
|
}
|
|
20433
20433
|
|
|
20434
20434
|
/**
|
|
20435
20435
|
* Validates that the value passed into a disjunctive filter satisfies all
|
|
20436
20436
|
* array requirements.
|
|
20437
20437
|
*/ function __PRIVATE_validateDisjunctiveFilterElements(e, t) {
|
|
20438
|
-
if (!Array.isArray(e) || 0 === e.length) throw new FirestoreError(
|
|
20438
|
+
if (!Array.isArray(e) || 0 === e.length) throw new FirestoreError(M.INVALID_ARGUMENT, `Invalid Query. A non-empty array is required for '${t.toString()}' filters.`);
|
|
20439
20439
|
}
|
|
20440
20440
|
|
|
20441
20441
|
/**
|
|
@@ -20469,11 +20469,11 @@ function __PRIVATE_parseDocumentIdValue(e, t, n) {
|
|
|
20469
20469
|
}(t.op));
|
|
20470
20470
|
if (null !== n)
|
|
20471
20471
|
// Special case when it's a duplicate op to give a slightly clearer error message.
|
|
20472
|
-
throw n === t.op ? new FirestoreError(
|
|
20472
|
+
throw n === t.op ? new FirestoreError(M.INVALID_ARGUMENT, `Invalid query. You cannot use more than one '${t.op.toString()}' filter.`) : new FirestoreError(M.INVALID_ARGUMENT, `Invalid query. You cannot use '${t.op.toString()}' filters with '${n.toString()}' filters.`);
|
|
20473
20473
|
}
|
|
20474
20474
|
|
|
20475
20475
|
function __PRIVATE_validateQueryFilterConstraint(e, t) {
|
|
20476
|
-
if (!(t instanceof QueryFieldFilterConstraint || t instanceof QueryCompositeFilterConstraint)) throw new FirestoreError(
|
|
20476
|
+
if (!(t instanceof QueryFieldFilterConstraint || t instanceof QueryCompositeFilterConstraint)) throw new FirestoreError(M.INVALID_ARGUMENT, `Function ${e}() requires AppliableConstraints created with a call to 'where(...)', 'or(...)', or 'and(...)'.`);
|
|
20477
20477
|
}
|
|
20478
20478
|
|
|
20479
20479
|
class AbstractUserDataWriter {
|
|
@@ -20845,7 +20845,7 @@ class __PRIVATE_LiteUserDataWriter extends AbstractUserDataWriter {
|
|
|
20845
20845
|
* snapshot events.
|
|
20846
20846
|
*/ docChanges(e = {}) {
|
|
20847
20847
|
const t = !!e.includeMetadataChanges;
|
|
20848
|
-
if (t && this._snapshot.excludesMetadataChanges) throw new FirestoreError(
|
|
20848
|
+
if (t && this._snapshot.excludesMetadataChanges) throw new FirestoreError(M.INVALID_ARGUMENT, "To include metadata changes with your document changes, you must also pass { includeMetadataChanges:true } to onSnapshot().");
|
|
20849
20849
|
return this._cachedChanges && this._cachedChangesIncludeMetadataChanges === t || (this._cachedChanges =
|
|
20850
20850
|
/** Calculates the array of `DocumentChange`s for a given `ViewSnapshot`. */
|
|
20851
20851
|
function __PRIVATE_changesFromSnapshot(e, t) {
|
|
@@ -21385,7 +21385,7 @@ class __PRIVATE_MultiTabManagerImpl {
|
|
|
21385
21385
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
21386
21386
|
* See the License for the specific language governing permissions and
|
|
21387
21387
|
* limitations under the License.
|
|
21388
|
-
*/ const
|
|
21388
|
+
*/ const Fe = {
|
|
21389
21389
|
maxAttempts: 5
|
|
21390
21390
|
};
|
|
21391
21391
|
|
|
@@ -21459,12 +21459,12 @@ class WriteBatch {
|
|
|
21459
21459
|
return this._verifyNotCommitted(), this._committed = !0, this._mutations.length > 0 ? this._commitHandler(this._mutations) : Promise.resolve();
|
|
21460
21460
|
}
|
|
21461
21461
|
_verifyNotCommitted() {
|
|
21462
|
-
if (this._committed) throw new FirestoreError(
|
|
21462
|
+
if (this._committed) throw new FirestoreError(M.FAILED_PRECONDITION, "A write batch can no longer be used after commit() has been called.");
|
|
21463
21463
|
}
|
|
21464
21464
|
}
|
|
21465
21465
|
|
|
21466
21466
|
function __PRIVATE_validateReference(e, t) {
|
|
21467
|
-
if ((e = T(e)).firestore !== t) throw new FirestoreError(
|
|
21467
|
+
if ((e = T(e)).firestore !== t) throw new FirestoreError(M.INVALID_ARGUMENT, "Provided document reference is from a different Firestore instance.");
|
|
21468
21468
|
return e;
|
|
21469
21469
|
}
|
|
21470
21470
|
|
|
@@ -21597,9 +21597,9 @@ class Transaction extends class Transaction$1 {
|
|
|
21597
21597
|
* rejected promise with the corresponding failure error is returned.
|
|
21598
21598
|
*/ function runTransaction(e, t, n) {
|
|
21599
21599
|
e = __PRIVATE_cast(e, Firestore);
|
|
21600
|
-
const r = Object.assign(Object.assign({},
|
|
21600
|
+
const r = Object.assign(Object.assign({}, Fe), n);
|
|
21601
21601
|
!function __PRIVATE_validateTransactionOptions(e) {
|
|
21602
|
-
if (e.maxAttempts < 1) throw new FirestoreError(
|
|
21602
|
+
if (e.maxAttempts < 1) throw new FirestoreError(M.INVALID_ARGUMENT, "Max attempts must be at least 1");
|
|
21603
21603
|
}(r);
|
|
21604
21604
|
return function __PRIVATE_firestoreClientTransaction(e, t, n) {
|
|
21605
21605
|
const r = new __PRIVATE_Deferred;
|
|
@@ -21753,7 +21753,7 @@ class Transaction extends class Transaction$1 {
|
|
|
21753
21753
|
try {
|
|
21754
21754
|
return JSON.parse(e);
|
|
21755
21755
|
} catch (e) {
|
|
21756
|
-
throw new FirestoreError(
|
|
21756
|
+
throw new FirestoreError(M.INVALID_ARGUMENT, "Failed to parse JSON: " + (null == e ? void 0 : e.message));
|
|
21757
21757
|
}
|
|
21758
21758
|
}(e) : e, n = [];
|
|
21759
21759
|
if (Array.isArray(t.indexes)) for (const e of t.indexes) {
|
|
@@ -21770,7 +21770,7 @@ class Transaction extends class Transaction$1 {
|
|
|
21770
21770
|
}
|
|
21771
21771
|
|
|
21772
21772
|
function __PRIVATE_tryGetString(e, t) {
|
|
21773
|
-
if ("string" != typeof e[t]) throw new FirestoreError(
|
|
21773
|
+
if ("string" != typeof e[t]) throw new FirestoreError(M.INVALID_ARGUMENT, "Missing string value for: " + t);
|
|
21774
21774
|
return e[t];
|
|
21775
21775
|
}
|
|
21776
21776
|
|
|
@@ -21813,12 +21813,12 @@ function __PRIVATE_tryGetString(e, t) {
|
|
|
21813
21813
|
*/ function getPersistentCacheIndexManager(e) {
|
|
21814
21814
|
var t;
|
|
21815
21815
|
e = __PRIVATE_cast(e, Firestore);
|
|
21816
|
-
const n =
|
|
21816
|
+
const n = Me.get(e);
|
|
21817
21817
|
if (n) return n;
|
|
21818
21818
|
const r = ensureFirestoreConfigured(e);
|
|
21819
21819
|
if ("persistent" !== (null === (t = r._uninitializedComponentsProvider) || void 0 === t ? void 0 : t._offlineKind)) return null;
|
|
21820
21820
|
const i = new PersistentCacheIndexManager(r);
|
|
21821
|
-
return
|
|
21821
|
+
return Me.set(e, i), i;
|
|
21822
21822
|
}
|
|
21823
21823
|
|
|
21824
21824
|
/**
|
|
@@ -21861,7 +21861,7 @@ function __PRIVATE_setPersistentCacheIndexAutoCreationEnabled(e, t) {
|
|
|
21861
21861
|
* Use a `WeakMap` so that the mapping will be automatically dropped when the
|
|
21862
21862
|
* `Firestore` instance is garbage collected. This emulates a private member
|
|
21863
21863
|
* as described in https://goo.gle/454yvug.
|
|
21864
|
-
*/ const
|
|
21864
|
+
*/ const Me = new WeakMap;
|
|
21865
21865
|
|
|
21866
21866
|
/**
|
|
21867
21867
|
* @license
|
|
@@ -21969,10 +21969,10 @@ function _internalQueryToProtoQueryTarget(e) {
|
|
|
21969
21969
|
this.Ou = new Map;
|
|
21970
21970
|
}
|
|
21971
21971
|
static get instance() {
|
|
21972
|
-
return
|
|
21973
|
-
if (
|
|
21974
|
-
|
|
21975
|
-
}(
|
|
21972
|
+
return xe || (xe = new __PRIVATE_TestingHooksSpiImpl, function __PRIVATE_setTestingHooksSpi(e) {
|
|
21973
|
+
if (Te) throw new Error("a TestingHooksSpi instance is already set");
|
|
21974
|
+
Te = e;
|
|
21975
|
+
}(xe)), xe;
|
|
21976
21976
|
}
|
|
21977
21977
|
et(e) {
|
|
21978
21978
|
this.Ou.forEach((t => t(e)));
|
|
@@ -21983,7 +21983,7 @@ function _internalQueryToProtoQueryTarget(e) {
|
|
|
21983
21983
|
}
|
|
21984
21984
|
}
|
|
21985
21985
|
|
|
21986
|
-
let
|
|
21986
|
+
let xe = null;
|
|
21987
21987
|
|
|
21988
21988
|
/**
|
|
21989
21989
|
* @license
|
|
@@ -22002,19 +22002,19 @@ let Me = null;
|
|
|
22002
22002
|
* limitations under the License.
|
|
22003
22003
|
*/ !function __PRIVATE_registerFirestore(e, t = !0) {
|
|
22004
22004
|
!function __PRIVATE_setSDKVersion(e) {
|
|
22005
|
-
|
|
22005
|
+
v = e;
|
|
22006
22006
|
}(i), n(new s("firestore", ((e, {instanceIdentifier: n, options: r}) => {
|
|
22007
22007
|
const i = e.getProvider("app").getImmediate(), s = new Firestore(new __PRIVATE_FirebaseAuthCredentialsProvider(e.getProvider("auth-internal")), new __PRIVATE_FirebaseAppCheckTokenProvider(e.getProvider("app-check-internal")), function __PRIVATE_databaseIdFromApp(e, t) {
|
|
22008
|
-
if (!Object.prototype.hasOwnProperty.apply(e.options, [ "projectId" ])) throw new FirestoreError(
|
|
22008
|
+
if (!Object.prototype.hasOwnProperty.apply(e.options, [ "projectId" ])) throw new FirestoreError(M.INVALID_ARGUMENT, '"projectId" not provided in firebase.initializeApp.');
|
|
22009
22009
|
return new DatabaseId(e.options.projectId, t);
|
|
22010
22010
|
}(i, n), i);
|
|
22011
22011
|
return r = Object.assign({
|
|
22012
22012
|
useFetchStreams: t
|
|
22013
22013
|
}, r), s._setSettings(r), s;
|
|
22014
|
-
}), "PUBLIC").setMultipleInstances(!0)), r(D,
|
|
22014
|
+
}), "PUBLIC").setMultipleInstances(!0)), r(D, C, e),
|
|
22015
22015
|
// BUILD_TARGET will be replaced by values like esm5, esm2017, cjs5, etc during the compilation
|
|
22016
|
-
r(D,
|
|
22016
|
+
r(D, C, "esm2017");
|
|
22017
22017
|
}("rn", /* useFetchStreams= */ !1);
|
|
22018
22018
|
|
|
22019
|
-
export { AbstractUserDataWriter, AggregateField, AggregateQuerySnapshot, Bytes,
|
|
22019
|
+
export { AbstractUserDataWriter, AggregateField, AggregateQuerySnapshot, Bytes, De as CACHE_SIZE_UNLIMITED, CollectionReference, DocumentReference, DocumentSnapshot, FieldPath, FieldValue, Firestore, FirestoreError, GeoPoint, LoadBundleTask, PersistentCacheIndexManager, Query, QueryCompositeFilterConstraint, QueryConstraint, QueryDocumentSnapshot, QueryEndAtConstraint, QueryFieldFilterConstraint, QueryLimitConstraint, QueryOrderByConstraint, QuerySnapshot, QueryStartAtConstraint, SnapshotMetadata, Timestamp, Transaction, WriteBatch, __PRIVATE_AutoId as _AutoId, ByteString as _ByteString, DatabaseId as _DatabaseId, DocumentKey as _DocumentKey, __PRIVATE_EmptyAppCheckTokenProvider as _EmptyAppCheckTokenProvider, __PRIVATE_EmptyAuthCredentialsProvider as _EmptyAuthCredentialsProvider, FieldPath$1 as _FieldPath, TestingHooks as _TestingHooks, __PRIVATE_cast as _cast, __PRIVATE_debugAssert as _debugAssert, _internalAggregationQueryToProtoRunAggregationQueryRequest, _internalQueryToProtoQueryTarget, __PRIVATE_isBase64Available as _isBase64Available, __PRIVATE_logWarn as _logWarn, __PRIVATE_validateIsNotUsedTogether as _validateIsNotUsedTogether, addDoc, aggregateFieldEqual, aggregateQuerySnapshotEqual, and, arrayRemove, arrayUnion, average, clearIndexedDbPersistence, collection, collectionGroup, connectFirestoreEmulator, count, deleteAllPersistentCacheIndexes, deleteDoc, deleteField, disableNetwork, disablePersistentCacheIndexAutoCreation, doc, documentId, enableIndexedDbPersistence, enableMultiTabIndexedDbPersistence, enableNetwork, enablePersistentCacheIndexAutoCreation, endAt, endBefore, ensureFirestoreConfigured, executeWrite, getAggregateFromServer, getCountFromServer, getDoc, getDocFromCache, getDocFromServer, getDocs, getDocsFromCache, getDocsFromServer, getFirestore, getPersistentCacheIndexManager, increment, initializeFirestore, limit, limitToLast, loadBundle, memoryEagerGarbageCollector, memoryLocalCache, memoryLruGarbageCollector, namedQuery, onSnapshot, onSnapshotsInSync, or, orderBy, persistentLocalCache, persistentMultipleTabManager, persistentSingleTabManager, query, queryEqual, refEqual, runTransaction, serverTimestamp, setDoc, setIndexConfiguration, setLogLevel, snapshotEqual, startAfter, startAt, sum, terminate, updateDoc, waitForPendingWrites, where, writeBatch };
|
|
22020
22020
|
//# sourceMappingURL=index.rn.js.map
|