@firebase/firestore 4.7.1-canary.ca4dbcf3f → 4.7.1-canary.ff0475c41
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/firestore/src/global_index.d.ts +1 -1
- package/dist/firestore/src/local/shared_client_state.d.ts +3 -3
- package/dist/index.cjs.js +311 -309
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm2017.js +312 -310
- package/dist/index.esm2017.js.map +1 -1
- package/dist/index.esm5.js +3128 -3125
- package/dist/index.esm5.js.map +1 -1
- package/dist/index.node.cjs.js +14 -9
- package/dist/index.node.cjs.js.map +1 -1
- package/dist/index.node.mjs +14 -9
- package/dist/index.node.mjs.map +1 -1
- package/dist/index.rn.js +317 -315
- package/dist/index.rn.js.map +1 -1
- package/dist/internal.d.ts +1 -1
- package/dist/lite/firestore/src/local/shared_client_state.d.ts +3 -3
- package/dist/lite/index.browser.esm2017.js +2 -2
- package/dist/lite/index.browser.esm5.js +2 -2
- package/dist/lite/index.cjs.js +2 -2
- package/dist/lite/index.node.cjs.js +2 -2
- package/dist/lite/index.node.mjs +2 -2
- package/dist/lite/index.rn.esm2017.js +2 -2
- package/dist/lite/internal.d.ts +1 -1
- package/dist/lite/packages/firestore/src/local/shared_client_state.d.ts +3 -3
- package/dist/lite/private.d.ts +1 -1
- package/dist/packages/firestore/dist/index.esm2017.d.ts +4 -4
- package/dist/packages/firestore/src/local/shared_client_state.d.ts +3 -3
- package/dist/private.d.ts +1 -1
- package/package.json +9 -9
package/dist/index.rn.js
CHANGED
|
@@ -8,9 +8,9 @@ import { FirebaseError as a, getUA as u, isIndexedDBAvailable as c, base64 as l,
|
|
|
8
8
|
|
|
9
9
|
import { Integer as A, Md5 as R } from "@firebase/webchannel-wrapper/bloom-blob";
|
|
10
10
|
|
|
11
|
-
import { XhrIo as V, EventType as m, ErrorCode as f, createWebChannelTransport as g, getStatEventTarget as p,
|
|
11
|
+
import { XhrIo as V, EventType as m, ErrorCode as f, createWebChannelTransport as g, getStatEventTarget as p, WebChannel as y, Event as w, Stat as S } from "@firebase/webchannel-wrapper/webchannel-blob";
|
|
12
12
|
|
|
13
|
-
const
|
|
13
|
+
const b = "@firebase/firestore";
|
|
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 D = "10.13.1-canary.ff0475c41";
|
|
76
76
|
|
|
77
77
|
/**
|
|
78
78
|
* @license
|
|
@@ -90,11 +90,11 @@ let v = "10.13.1-canary.ca4dbcf3f";
|
|
|
90
90
|
* See the License for the specific language governing permissions and
|
|
91
91
|
* limitations under the License.
|
|
92
92
|
*/
|
|
93
|
-
const
|
|
93
|
+
const v = 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 v.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
|
+
v.setLogLevel(e);
|
|
114
114
|
}
|
|
115
115
|
|
|
116
116
|
function __PRIVATE_logDebug(e, ...t) {
|
|
117
|
-
if (
|
|
117
|
+
if (v.logLevel <= _.DEBUG) {
|
|
118
118
|
const n = t.map(__PRIVATE_argToString);
|
|
119
|
-
|
|
119
|
+
v.debug(`Firestore (${D}): ${e}`, ...n);
|
|
120
120
|
}
|
|
121
121
|
}
|
|
122
122
|
|
|
123
123
|
function __PRIVATE_logError(e, ...t) {
|
|
124
|
-
if (
|
|
124
|
+
if (v.logLevel <= _.ERROR) {
|
|
125
125
|
const n = t.map(__PRIVATE_argToString);
|
|
126
|
-
|
|
126
|
+
v.error(`Firestore (${D}): ${e}`, ...n);
|
|
127
127
|
}
|
|
128
128
|
}
|
|
129
129
|
|
|
130
130
|
/**
|
|
131
131
|
* @internal
|
|
132
132
|
*/ function __PRIVATE_logWarn(e, ...t) {
|
|
133
|
-
if (
|
|
133
|
+
if (v.logLevel <= _.WARN) {
|
|
134
134
|
const n = t.map(__PRIVATE_argToString);
|
|
135
|
-
|
|
135
|
+
v.warn(`Firestore (${D}): ${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 (${D}) 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 C = {
|
|
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(C.INVALID_ARGUMENT, "Timestamp nanoseconds out of range: " + t);
|
|
795
|
+
if (t >= 1e9) throw new FirestoreError(C.INVALID_ARGUMENT, "Timestamp nanoseconds out of range: " + t);
|
|
796
|
+
if (e < -62135596800) throw new FirestoreError(C.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(C.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(C.INVALID_ARGUMENT, `Invalid segment (${n}). Paths must not contain // in them.`);
|
|
1054
1054
|
// Strip leading and trailing 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 F = /^[_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 F.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(C.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(C.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(C.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(C.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 M = "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 !== C.FAILED_PRECONDITION || e.message !== M) 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(C.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(C.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(C.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 x = !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 x || (x = !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 O = [ "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 N = {}, B = [ "prefixPath", "collectionGroup", "readTime", "documentId" ], L = [ "prefixPath", "collectionGroup", "documentId" ], k = [ "collectionGroup", "readTime", "prefixPath", "documentId" ], q = [ "canonicalId", "targetId" ], Q = [ "targetId", "path" ], K = [ "path", "targetId" ], $ = [ "collectionId", "parent" ], U = [ "indexId", "uid" ], W = [ "uid", "sequenceNumber" ], G = [ "indexId", "uid", "arrayValue", "directionalValue", "orderedDocumentKey", "documentKey" ], z = [ "indexId", "uid", "orderedDocumentKey" ], j = [ "userId", "collectionPath", "documentId" ], H = [ "userId", "collectionPath", "largestBatchId" ], J = [ "userId", "collectionGroup", "largestBatchId" ], Y = [ ...[ ...[ ...[ ...[ "mutationQueues", "mutations", "documentMutations", "remoteDocuments", "targets", "owner", "targetGlobal", "targetDocuments" ], "clientMetadata" ], "remoteDocumentGlobal" ], "collectionParents" ], "bundles", "namedQueries" ], Z = [ ...Y, "documentOverlays" ], X = [ "mutationQueues", "mutations", "documentMutations", "remoteDocumentsV14", "targets", "owner", "targetGlobal", "targetDocuments", "clientMetadata", "remoteDocumentGlobal", "collectionParents", "bundles", "namedQueries", "documentOverlays" ], ee = X, te = [ ...ee, "indexConfiguration", "indexState", "indexEntries" ], ne = te, re = [ ...te, "globals" ];
|
|
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 ie = 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 se = 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 = ie.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 se = {
|
|
3261
3261
|
mapValue: {
|
|
3262
3262
|
fields: {
|
|
3263
3263
|
__type__: {
|
|
@@ -3265,7 +3265,7 @@ const oe = {
|
|
|
3265
3265
|
}
|
|
3266
3266
|
}
|
|
3267
3267
|
}
|
|
3268
|
-
},
|
|
3268
|
+
}, oe = {
|
|
3269
3269
|
nullValue: "NULL_VALUE"
|
|
3270
3270
|
};
|
|
3271
3271
|
|
|
@@ -3411,9 +3411,9 @@ function __PRIVATE_valueCompare(e, t) {
|
|
|
3411
3411
|
|
|
3412
3412
|
case 11 /* TypeOrder.ObjectValue */ :
|
|
3413
3413
|
return function __PRIVATE_compareMaps(e, t) {
|
|
3414
|
-
if (e ===
|
|
3415
|
-
if (e ===
|
|
3416
|
-
if (t ===
|
|
3414
|
+
if (e === se.mapValue && t === se.mapValue) return 0;
|
|
3415
|
+
if (e === se.mapValue) return 1;
|
|
3416
|
+
if (t === se.mapValue) return -1;
|
|
3417
3417
|
const n = e.fields || {}, r = Object.keys(n), i = t.fields || {}, s = Object.keys(i);
|
|
3418
3418
|
// Even though MapValues are likely sorted correctly based on their insertion
|
|
3419
3419
|
// order (e.g. when received from the backend), local modifications can bring
|
|
@@ -3603,7 +3603,7 @@ function isArray(e) {
|
|
|
3603
3603
|
return "__max__" === (((e.mapValue || {}).fields || {}).__type__ || {}).stringValue;
|
|
3604
3604
|
}
|
|
3605
3605
|
|
|
3606
|
-
const
|
|
3606
|
+
const _e = {
|
|
3607
3607
|
mapValue: {
|
|
3608
3608
|
fields: {
|
|
3609
3609
|
__type__: {
|
|
@@ -3617,7 +3617,7 @@ const ae = {
|
|
|
3617
3617
|
};
|
|
3618
3618
|
|
|
3619
3619
|
/** Returns the lowest value for the given value type (inclusive). */ function __PRIVATE_valuesGetLowerBound(e) {
|
|
3620
|
-
return "nullValue" in e ?
|
|
3620
|
+
return "nullValue" in e ? oe : "booleanValue" in e ? {
|
|
3621
3621
|
booleanValue: !1
|
|
3622
3622
|
} : "integerValue" in e || "doubleValue" in e ? {
|
|
3623
3623
|
doubleValue: NaN
|
|
@@ -3636,7 +3636,7 @@ const ae = {
|
|
|
3636
3636
|
}
|
|
3637
3637
|
} : "arrayValue" in e ? {
|
|
3638
3638
|
arrayValue: {}
|
|
3639
|
-
} : "mapValue" in e ? __PRIVATE_isVectorValue(e) ?
|
|
3639
|
+
} : "mapValue" in e ? __PRIVATE_isVectorValue(e) ? _e : {
|
|
3640
3640
|
mapValue: {}
|
|
3641
3641
|
} : fail();
|
|
3642
3642
|
}
|
|
@@ -3661,9 +3661,9 @@ const ae = {
|
|
|
3661
3661
|
}
|
|
3662
3662
|
} : "geoPointValue" in e ? {
|
|
3663
3663
|
arrayValue: {}
|
|
3664
|
-
} : "arrayValue" in e ?
|
|
3664
|
+
} : "arrayValue" in e ? _e : "mapValue" in e ? __PRIVATE_isVectorValue(e) ? {
|
|
3665
3665
|
mapValue: {}
|
|
3666
|
-
} :
|
|
3666
|
+
} : se : fail();
|
|
3667
3667
|
}
|
|
3668
3668
|
|
|
3669
3669
|
function __PRIVATE_lowerBoundCompare(e, t) {
|
|
@@ -4351,10 +4351,10 @@ function __PRIVATE_targetIsDocumentTarget(e) {
|
|
|
4351
4351
|
* the provided `fieldPath` (or the upper bound for an descending segment).
|
|
4352
4352
|
*/
|
|
4353
4353
|
function __PRIVATE_targetGetAscendingBound(e, t, n) {
|
|
4354
|
-
let r =
|
|
4354
|
+
let r = oe, i = !0;
|
|
4355
4355
|
// Process all filters to find a value for the current field segment
|
|
4356
4356
|
for (const n of __PRIVATE_targetGetFieldFiltersForPath(e, t)) {
|
|
4357
|
-
let e =
|
|
4357
|
+
let e = oe, t = !0;
|
|
4358
4358
|
switch (n.op) {
|
|
4359
4359
|
case "<" /* Operator.LESS_THAN */ :
|
|
4360
4360
|
case "<=" /* Operator.LESS_THAN_OR_EQUAL */ :
|
|
@@ -4373,7 +4373,7 @@ function __PRIVATE_targetGetAscendingBound(e, t, n) {
|
|
|
4373
4373
|
|
|
4374
4374
|
case "!=" /* Operator.NOT_EQUAL */ :
|
|
4375
4375
|
case "not-in" /* Operator.NOT_IN */ :
|
|
4376
|
-
e =
|
|
4376
|
+
e = oe;
|
|
4377
4377
|
// Remaining filters cannot be used as lower bounds.
|
|
4378
4378
|
}
|
|
4379
4379
|
__PRIVATE_lowerBoundCompare({
|
|
@@ -4409,10 +4409,10 @@ function __PRIVATE_targetGetAscendingBound(e, t, n) {
|
|
|
4409
4409
|
* Returns the value to use as the upper bound for ascending index segment at
|
|
4410
4410
|
* the provided `fieldPath` (or the lower bound for a descending segment).
|
|
4411
4411
|
*/ function __PRIVATE_targetGetDescendingBound(e, t, n) {
|
|
4412
|
-
let r =
|
|
4412
|
+
let r = se, i = !0;
|
|
4413
4413
|
// Process all filters to find a value for the current field segment
|
|
4414
4414
|
for (const n of __PRIVATE_targetGetFieldFiltersForPath(e, t)) {
|
|
4415
|
-
let e =
|
|
4415
|
+
let e = se, t = !0;
|
|
4416
4416
|
switch (n.op) {
|
|
4417
4417
|
case ">=" /* Operator.GREATER_THAN_OR_EQUAL */ :
|
|
4418
4418
|
case ">" /* Operator.GREATER_THAN */ :
|
|
@@ -4431,7 +4431,7 @@ function __PRIVATE_targetGetAscendingBound(e, t, n) {
|
|
|
4431
4431
|
|
|
4432
4432
|
case "!=" /* Operator.NOT_EQUAL */ :
|
|
4433
4433
|
case "not-in" /* Operator.NOT_IN */ :
|
|
4434
|
-
e =
|
|
4434
|
+
e = se;
|
|
4435
4435
|
// Remaining filters cannot be used as upper bounds.
|
|
4436
4436
|
}
|
|
4437
4437
|
__PRIVATE_upperBoundCompare({
|
|
@@ -4815,22 +4815,22 @@ function __PRIVATE_compareDocs(e, t, n) {
|
|
|
4815
4815
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
4816
4816
|
* See the License for the specific language governing permissions and
|
|
4817
4817
|
* limitations under the License.
|
|
4818
|
-
*/ const
|
|
4818
|
+
*/ const ae = new SortedMap(DocumentKey.comparator);
|
|
4819
4819
|
|
|
4820
4820
|
function __PRIVATE_mutableDocumentMap() {
|
|
4821
|
-
return
|
|
4821
|
+
return ae;
|
|
4822
4822
|
}
|
|
4823
4823
|
|
|
4824
|
-
const
|
|
4824
|
+
const ue = new SortedMap(DocumentKey.comparator);
|
|
4825
4825
|
|
|
4826
4826
|
function documentMap(...e) {
|
|
4827
|
-
let t =
|
|
4827
|
+
let t = ue;
|
|
4828
4828
|
for (const n of e) t = t.insert(n.key, n);
|
|
4829
4829
|
return t;
|
|
4830
4830
|
}
|
|
4831
4831
|
|
|
4832
4832
|
function __PRIVATE_convertOverlayedDocumentMapToDocumentMap(e) {
|
|
4833
|
-
let t =
|
|
4833
|
+
let t = ue;
|
|
4834
4834
|
return e.forEach(((e, n) => t = t.insert(e, n.overlayedDocument))), t;
|
|
4835
4835
|
}
|
|
4836
4836
|
|
|
@@ -4846,20 +4846,20 @@ function __PRIVATE_newDocumentKeyMap() {
|
|
|
4846
4846
|
return new ObjectMap((e => e.toString()), ((e, t) => e.isEqual(t)));
|
|
4847
4847
|
}
|
|
4848
4848
|
|
|
4849
|
-
const
|
|
4849
|
+
const ce = new SortedMap(DocumentKey.comparator);
|
|
4850
4850
|
|
|
4851
|
-
const
|
|
4851
|
+
const le = new SortedSet(DocumentKey.comparator);
|
|
4852
4852
|
|
|
4853
4853
|
function __PRIVATE_documentKeySet(...e) {
|
|
4854
|
-
let t =
|
|
4854
|
+
let t = le;
|
|
4855
4855
|
for (const n of e) t = t.add(n);
|
|
4856
4856
|
return t;
|
|
4857
4857
|
}
|
|
4858
4858
|
|
|
4859
|
-
const
|
|
4859
|
+
const he = new SortedSet(__PRIVATE_primitiveComparator);
|
|
4860
4860
|
|
|
4861
4861
|
function __PRIVATE_targetIdSet() {
|
|
4862
|
-
return
|
|
4862
|
+
return he;
|
|
4863
4863
|
}
|
|
4864
4864
|
|
|
4865
4865
|
/**
|
|
@@ -5550,7 +5550,7 @@ class __PRIVATE_VerifyMutation extends Mutation {
|
|
|
5550
5550
|
*/ static from(e, t, n) {
|
|
5551
5551
|
__PRIVATE_hardAssert(e.mutations.length === n.length);
|
|
5552
5552
|
let r = function __PRIVATE_documentVersionMap() {
|
|
5553
|
-
return
|
|
5553
|
+
return ce;
|
|
5554
5554
|
}();
|
|
5555
5555
|
const i = e.mutations;
|
|
5556
5556
|
for (let e = 0; e < i.length; e++) r = r.insert(i[e].key, n[e].version);
|
|
@@ -5664,7 +5664,7 @@ class __PRIVATE_VerifyMutation extends Mutation {
|
|
|
5664
5664
|
* Important! The names of these identifiers matter because the string forms
|
|
5665
5665
|
* are used for reverse lookups from the webchannel stream. Do NOT change the
|
|
5666
5666
|
* names of these identifiers or change this into a const enum.
|
|
5667
|
-
*/ var
|
|
5667
|
+
*/ var Pe, Ie;
|
|
5668
5668
|
|
|
5669
5669
|
/**
|
|
5670
5670
|
* Determines whether an error code represents a permanent error when received
|
|
@@ -5677,29 +5677,29 @@ function __PRIVATE_isPermanentError(e) {
|
|
|
5677
5677
|
default:
|
|
5678
5678
|
return fail();
|
|
5679
5679
|
|
|
5680
|
-
case
|
|
5681
|
-
case
|
|
5682
|
-
case
|
|
5683
|
-
case
|
|
5684
|
-
case
|
|
5685
|
-
case
|
|
5680
|
+
case C.CANCELLED:
|
|
5681
|
+
case C.UNKNOWN:
|
|
5682
|
+
case C.DEADLINE_EXCEEDED:
|
|
5683
|
+
case C.RESOURCE_EXHAUSTED:
|
|
5684
|
+
case C.INTERNAL:
|
|
5685
|
+
case C.UNAVAILABLE:
|
|
5686
5686
|
// Unauthenticated means something went wrong with our token and we need
|
|
5687
5687
|
// to retry with new credentials which will happen automatically.
|
|
5688
|
-
case
|
|
5688
|
+
case C.UNAUTHENTICATED:
|
|
5689
5689
|
return !1;
|
|
5690
5690
|
|
|
5691
|
-
case
|
|
5692
|
-
case
|
|
5693
|
-
case
|
|
5694
|
-
case
|
|
5695
|
-
case
|
|
5691
|
+
case C.INVALID_ARGUMENT:
|
|
5692
|
+
case C.NOT_FOUND:
|
|
5693
|
+
case C.ALREADY_EXISTS:
|
|
5694
|
+
case C.PERMISSION_DENIED:
|
|
5695
|
+
case C.FAILED_PRECONDITION:
|
|
5696
5696
|
// Aborted might be retried in some scenarios, but that is dependent on
|
|
5697
5697
|
// the context and should handled individually by the calling code.
|
|
5698
5698
|
// See https://cloud.google.com/apis/design/errors.
|
|
5699
|
-
case
|
|
5700
|
-
case
|
|
5701
|
-
case
|
|
5702
|
-
case
|
|
5699
|
+
case C.ABORTED:
|
|
5700
|
+
case C.OUT_OF_RANGE:
|
|
5701
|
+
case C.UNIMPLEMENTED:
|
|
5702
|
+
case C.DATA_LOSS:
|
|
5703
5703
|
return !0;
|
|
5704
5704
|
}
|
|
5705
5705
|
}
|
|
@@ -5727,58 +5727,58 @@ function __PRIVATE_mapCodeFromRpcCode(e) {
|
|
|
5727
5727
|
if (void 0 === e)
|
|
5728
5728
|
// This shouldn't normally happen, but in certain error cases (like trying
|
|
5729
5729
|
// to send invalid proto messages) we may get an error with no GRPC code.
|
|
5730
|
-
return __PRIVATE_logError("GRPC error has no .code"),
|
|
5730
|
+
return __PRIVATE_logError("GRPC error has no .code"), C.UNKNOWN;
|
|
5731
5731
|
switch (e) {
|
|
5732
|
-
case
|
|
5733
|
-
return
|
|
5732
|
+
case Pe.OK:
|
|
5733
|
+
return C.OK;
|
|
5734
5734
|
|
|
5735
|
-
case
|
|
5736
|
-
return
|
|
5735
|
+
case Pe.CANCELLED:
|
|
5736
|
+
return C.CANCELLED;
|
|
5737
5737
|
|
|
5738
|
-
case
|
|
5739
|
-
return
|
|
5738
|
+
case Pe.UNKNOWN:
|
|
5739
|
+
return C.UNKNOWN;
|
|
5740
5740
|
|
|
5741
|
-
case
|
|
5742
|
-
return
|
|
5741
|
+
case Pe.DEADLINE_EXCEEDED:
|
|
5742
|
+
return C.DEADLINE_EXCEEDED;
|
|
5743
5743
|
|
|
5744
|
-
case
|
|
5745
|
-
return
|
|
5744
|
+
case Pe.RESOURCE_EXHAUSTED:
|
|
5745
|
+
return C.RESOURCE_EXHAUSTED;
|
|
5746
5746
|
|
|
5747
|
-
case
|
|
5748
|
-
return
|
|
5747
|
+
case Pe.INTERNAL:
|
|
5748
|
+
return C.INTERNAL;
|
|
5749
5749
|
|
|
5750
|
-
case
|
|
5751
|
-
return
|
|
5750
|
+
case Pe.UNAVAILABLE:
|
|
5751
|
+
return C.UNAVAILABLE;
|
|
5752
5752
|
|
|
5753
|
-
case
|
|
5754
|
-
return
|
|
5753
|
+
case Pe.UNAUTHENTICATED:
|
|
5754
|
+
return C.UNAUTHENTICATED;
|
|
5755
5755
|
|
|
5756
|
-
case
|
|
5757
|
-
return
|
|
5756
|
+
case Pe.INVALID_ARGUMENT:
|
|
5757
|
+
return C.INVALID_ARGUMENT;
|
|
5758
5758
|
|
|
5759
|
-
case
|
|
5760
|
-
return
|
|
5759
|
+
case Pe.NOT_FOUND:
|
|
5760
|
+
return C.NOT_FOUND;
|
|
5761
5761
|
|
|
5762
|
-
case
|
|
5763
|
-
return
|
|
5762
|
+
case Pe.ALREADY_EXISTS:
|
|
5763
|
+
return C.ALREADY_EXISTS;
|
|
5764
5764
|
|
|
5765
|
-
case
|
|
5766
|
-
return
|
|
5765
|
+
case Pe.PERMISSION_DENIED:
|
|
5766
|
+
return C.PERMISSION_DENIED;
|
|
5767
5767
|
|
|
5768
|
-
case
|
|
5769
|
-
return
|
|
5768
|
+
case Pe.FAILED_PRECONDITION:
|
|
5769
|
+
return C.FAILED_PRECONDITION;
|
|
5770
5770
|
|
|
5771
|
-
case
|
|
5772
|
-
return
|
|
5771
|
+
case Pe.ABORTED:
|
|
5772
|
+
return C.ABORTED;
|
|
5773
5773
|
|
|
5774
|
-
case
|
|
5775
|
-
return
|
|
5774
|
+
case Pe.OUT_OF_RANGE:
|
|
5775
|
+
return C.OUT_OF_RANGE;
|
|
5776
5776
|
|
|
5777
|
-
case
|
|
5778
|
-
return
|
|
5777
|
+
case Pe.UNIMPLEMENTED:
|
|
5778
|
+
return C.UNIMPLEMENTED;
|
|
5779
5779
|
|
|
5780
|
-
case
|
|
5781
|
-
return
|
|
5780
|
+
case Pe.DATA_LOSS:
|
|
5781
|
+
return C.DATA_LOSS;
|
|
5782
5782
|
|
|
5783
5783
|
default:
|
|
5784
5784
|
return fail();
|
|
@@ -5792,14 +5792,14 @@ function __PRIVATE_mapCodeFromRpcCode(e) {
|
|
|
5792
5792
|
* "UNKNOWN", etc.)
|
|
5793
5793
|
* @returns The equivalent Code. Non-matching responses are mapped to
|
|
5794
5794
|
* Code.UNKNOWN.
|
|
5795
|
-
*/ (
|
|
5796
|
-
|
|
5797
|
-
|
|
5798
|
-
|
|
5799
|
-
|
|
5800
|
-
|
|
5801
|
-
|
|
5802
|
-
|
|
5795
|
+
*/ (Ie = Pe || (Pe = {}))[Ie.OK = 0] = "OK", Ie[Ie.CANCELLED = 1] = "CANCELLED",
|
|
5796
|
+
Ie[Ie.UNKNOWN = 2] = "UNKNOWN", Ie[Ie.INVALID_ARGUMENT = 3] = "INVALID_ARGUMENT",
|
|
5797
|
+
Ie[Ie.DEADLINE_EXCEEDED = 4] = "DEADLINE_EXCEEDED", Ie[Ie.NOT_FOUND = 5] = "NOT_FOUND",
|
|
5798
|
+
Ie[Ie.ALREADY_EXISTS = 6] = "ALREADY_EXISTS", Ie[Ie.PERMISSION_DENIED = 7] = "PERMISSION_DENIED",
|
|
5799
|
+
Ie[Ie.UNAUTHENTICATED = 16] = "UNAUTHENTICATED", Ie[Ie.RESOURCE_EXHAUSTED = 8] = "RESOURCE_EXHAUSTED",
|
|
5800
|
+
Ie[Ie.FAILED_PRECONDITION = 9] = "FAILED_PRECONDITION", Ie[Ie.ABORTED = 10] = "ABORTED",
|
|
5801
|
+
Ie[Ie.OUT_OF_RANGE = 11] = "OUT_OF_RANGE", Ie[Ie.UNIMPLEMENTED = 12] = "UNIMPLEMENTED",
|
|
5802
|
+
Ie[Ie.INTERNAL = 13] = "INTERNAL", Ie[Ie.UNAVAILABLE = 14] = "UNAVAILABLE", Ie[Ie.DATA_LOSS = 15] = "DATA_LOSS";
|
|
5803
5803
|
|
|
5804
5804
|
/**
|
|
5805
5805
|
* @license
|
|
@@ -5824,7 +5824,7 @@ Te[Te.INTERNAL = 13] = "INTERNAL", Te[Te.UNAVAILABLE = 14] = "UNAVAILABLE", Te[T
|
|
|
5824
5824
|
* integration tests that have registered callbacks to be notified of events
|
|
5825
5825
|
* that happen during the test execution.
|
|
5826
5826
|
*/
|
|
5827
|
-
let
|
|
5827
|
+
let Te = null;
|
|
5828
5828
|
|
|
5829
5829
|
/**
|
|
5830
5830
|
* Sets the value of the `testingHooksSpi` object.
|
|
@@ -5872,7 +5872,7 @@ function __PRIVATE_newTextEncoder() {
|
|
|
5872
5872
|
* See the License for the specific language governing permissions and
|
|
5873
5873
|
* limitations under the License.
|
|
5874
5874
|
*/
|
|
5875
|
-
const
|
|
5875
|
+
const Ee = new A([ 4294967295, 4294967295 ], 0);
|
|
5876
5876
|
|
|
5877
5877
|
// Hash a string using md5 hashing algorithm.
|
|
5878
5878
|
function __PRIVATE_getMd5HashValue(e) {
|
|
@@ -5907,7 +5907,7 @@ class BloomFilter {
|
|
|
5907
5907
|
// Calculate hashed value h(i) = h1 + (i * h2).
|
|
5908
5908
|
let r = e.add(t.multiply(A.fromNumber(n)));
|
|
5909
5909
|
// Wrap if hash value overflow 64bit.
|
|
5910
|
-
return 1 === r.compare(
|
|
5910
|
+
return 1 === r.compare(Ee) && (r = new A([ r.getBits(0), r.getBits(1) ], 0)),
|
|
5911
5911
|
r.modulo(this.Te).toNumber();
|
|
5912
5912
|
}
|
|
5913
5913
|
// Return whether the bit on the given index in the bitmap is set to 1.
|
|
@@ -6325,7 +6325,7 @@ class __PRIVATE_WatchChangeAggregator {
|
|
|
6325
6325
|
const e = 2 /* BloomFilterApplicationStatus.FalsePositive */ === i ? "TargetPurposeExistenceFilterMismatchBloom" /* TargetPurpose.ExistenceFilterMismatchBloom */ : "TargetPurposeExistenceFilterMismatch" /* TargetPurpose.ExistenceFilterMismatch */;
|
|
6326
6326
|
this.Qe = this.Qe.insert(t, e);
|
|
6327
6327
|
}
|
|
6328
|
-
null ==
|
|
6328
|
+
null == Te || Te.et(function __PRIVATE_createExistenceFilterMismatchInfoForTestingHooks(e, t, n, r, i) {
|
|
6329
6329
|
var s, o, _, a, u, c;
|
|
6330
6330
|
const l = {
|
|
6331
6331
|
localCacheCount: e,
|
|
@@ -6541,13 +6541,13 @@ function __PRIVATE_snapshotChangesMap() {
|
|
|
6541
6541
|
return new SortedMap(DocumentKey.comparator);
|
|
6542
6542
|
}
|
|
6543
6543
|
|
|
6544
|
-
const
|
|
6544
|
+
const de = (() => {
|
|
6545
6545
|
const e = {
|
|
6546
6546
|
asc: "ASCENDING",
|
|
6547
6547
|
desc: "DESCENDING"
|
|
6548
6548
|
};
|
|
6549
6549
|
return e;
|
|
6550
|
-
})(),
|
|
6550
|
+
})(), Ae = (() => {
|
|
6551
6551
|
const e = {
|
|
6552
6552
|
"<": "LESS_THAN",
|
|
6553
6553
|
"<=": "LESS_THAN_OR_EQUAL",
|
|
@@ -6561,7 +6561,7 @@ const Ae = (() => {
|
|
|
6561
6561
|
"array-contains-any": "ARRAY_CONTAINS_ANY"
|
|
6562
6562
|
};
|
|
6563
6563
|
return e;
|
|
6564
|
-
})(),
|
|
6564
|
+
})(), Re = (() => {
|
|
6565
6565
|
const e = {
|
|
6566
6566
|
and: "AND",
|
|
6567
6567
|
or: "OR"
|
|
@@ -6663,8 +6663,8 @@ function __PRIVATE_toName(e, t) {
|
|
|
6663
6663
|
|
|
6664
6664
|
function fromName(e, t) {
|
|
6665
6665
|
const n = __PRIVATE_fromResourceName(t);
|
|
6666
|
-
if (n.get(1) !== e.databaseId.projectId) throw new FirestoreError(
|
|
6667
|
-
if (n.get(3) !== e.databaseId.database) throw new FirestoreError(
|
|
6666
|
+
if (n.get(1) !== e.databaseId.projectId) throw new FirestoreError(C.INVALID_ARGUMENT, "Tried to deserialize key from different project: " + n.get(1) + " vs " + e.databaseId.projectId);
|
|
6667
|
+
if (n.get(3) !== e.databaseId.database) throw new FirestoreError(C.INVALID_ARGUMENT, "Tried to deserialize key from different database: " + n.get(3) + " vs " + e.databaseId.database);
|
|
6668
6668
|
return new DocumentKey(__PRIVATE_extractLocalPathFromResourceName(n));
|
|
6669
6669
|
}
|
|
6670
6670
|
|
|
@@ -6738,7 +6738,7 @@ function __PRIVATE_fromWatchChange(e, t) {
|
|
|
6738
6738
|
// does not indicate that it extends Uint8Array.
|
|
6739
6739
|
t instanceof Buffer || t instanceof Uint8Array), ByteString.fromUint8Array(t || new Uint8Array));
|
|
6740
6740
|
}(e, t.targetChange.resumeToken), o = t.targetChange.cause, _ = o && function __PRIVATE_fromRpcStatus(e) {
|
|
6741
|
-
const t = void 0 === e.code ?
|
|
6741
|
+
const t = void 0 === e.code ? C.UNKNOWN : __PRIVATE_mapCodeFromRpcCode(e.code);
|
|
6742
6742
|
return new FirestoreError(t, e.message || "");
|
|
6743
6743
|
}(o);
|
|
6744
6744
|
n = new __PRIVATE_WatchTargetChange(r, i, s, _ || null);
|
|
@@ -7133,15 +7133,15 @@ function __PRIVATE_fromFilter(e) {
|
|
|
7133
7133
|
}
|
|
7134
7134
|
|
|
7135
7135
|
function __PRIVATE_toDirection(e) {
|
|
7136
|
-
return
|
|
7136
|
+
return de[e];
|
|
7137
7137
|
}
|
|
7138
7138
|
|
|
7139
7139
|
function __PRIVATE_toOperatorName(e) {
|
|
7140
|
-
return
|
|
7140
|
+
return Ae[e];
|
|
7141
7141
|
}
|
|
7142
7142
|
|
|
7143
7143
|
function __PRIVATE_toCompositeOperatorName(e) {
|
|
7144
|
-
return
|
|
7144
|
+
return Re[e];
|
|
7145
7145
|
}
|
|
7146
7146
|
|
|
7147
7147
|
function __PRIVATE_toFieldPathReference(e) {
|
|
@@ -8506,7 +8506,7 @@ function __PRIVATE_applyDistributionFieldAndCompositeFilters(e, t) {
|
|
|
8506
8506
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
8507
8507
|
* See the License for the specific language governing permissions and
|
|
8508
8508
|
* limitations under the License.
|
|
8509
|
-
*/ const
|
|
8509
|
+
*/ const Ve = new Uint8Array(0);
|
|
8510
8510
|
|
|
8511
8511
|
/**
|
|
8512
8512
|
* A persisted implementation of IndexManager.
|
|
@@ -8720,7 +8720,7 @@ class __PRIVATE_IndexedDbIndexManager {
|
|
|
8720
8720
|
// combined with the values from the query bounds.
|
|
8721
8721
|
const _ = (null != t ? t.length : 1) * Math.max(n.length, i.length), a = _ / (null != t ? t.length : 1), u = [];
|
|
8722
8722
|
for (let c = 0; c < _; ++c) {
|
|
8723
|
-
const _ = t ? this.dn(t[c / a]) :
|
|
8723
|
+
const _ = t ? this.dn(t[c / a]) : Ve, l = this.An(e, _, n[c % a], r), h = this.Rn(e, _, i[c % a], s), P = o.map((t => this.An(e, _, t,
|
|
8724
8724
|
/* inclusive= */ !0)));
|
|
8725
8725
|
u.push(...this.createRange(l, h, P));
|
|
8726
8726
|
}
|
|
@@ -8917,7 +8917,7 @@ class __PRIVATE_IndexedDbIndexManager {
|
|
|
8917
8917
|
if (null != i) {
|
|
8918
8918
|
const s = e.data.field(i.fieldPath);
|
|
8919
8919
|
if (isArray(s)) for (const i of s.arrayValue.values || []) n = n.add(new __PRIVATE_IndexEntry(t.indexId, e.key, this.dn(i), r));
|
|
8920
|
-
} else n = n.add(new __PRIVATE_IndexEntry(t.indexId, e.key,
|
|
8920
|
+
} else n = n.add(new __PRIVATE_IndexEntry(t.indexId, e.key, Ve, r));
|
|
8921
8921
|
return n;
|
|
8922
8922
|
}
|
|
8923
8923
|
/**
|
|
@@ -8992,7 +8992,7 @@ class __PRIVATE_IndexedDbIndexManager {
|
|
|
8992
8992
|
// If we encounter two bounds that will create an unmatchable key range,
|
|
8993
8993
|
// then we return an empty set of key ranges.
|
|
8994
8994
|
if (this.Cn(r[e], r[e + 1])) return [];
|
|
8995
|
-
const t = [ r[e].indexId, this.uid, r[e].arrayValue, r[e].directionalValue,
|
|
8995
|
+
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, [] ];
|
|
8996
8996
|
i.push(IDBKeyRange.bound(t, n));
|
|
8997
8997
|
}
|
|
8998
8998
|
return i;
|
|
@@ -9060,7 +9060,7 @@ function __PRIVATE_getMinOffsetFromFieldIndexes(e) {
|
|
|
9060
9060
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
9061
9061
|
* See the License for the specific language governing permissions and
|
|
9062
9062
|
* limitations under the License.
|
|
9063
|
-
*/ const
|
|
9063
|
+
*/ const me = {
|
|
9064
9064
|
didRun: !1,
|
|
9065
9065
|
sequenceNumbersCollected: 0,
|
|
9066
9066
|
targetsRemoved: 0,
|
|
@@ -9224,7 +9224,7 @@ class __PRIVATE_IndexedDbMutationQueue {
|
|
|
9224
9224
|
let c = new SortedSet(((e, t) => __PRIVATE_primitiveComparator(e.canonicalString(), t.canonicalString())));
|
|
9225
9225
|
for (const e of r) {
|
|
9226
9226
|
const t = __PRIVATE_newDbDocumentMutationKey(this.userId, e.key.path, o);
|
|
9227
|
-
c = c.add(e.key.path.popLast()), u.push(s.put(a)), u.push(i.put(t,
|
|
9227
|
+
c = c.add(e.key.path.popLast()), u.push(s.put(a)), u.push(i.put(t, N));
|
|
9228
9228
|
}
|
|
9229
9229
|
return c.forEach((t => {
|
|
9230
9230
|
u.push(this.indexManager.addToCollectionParentIndex(e, t));
|
|
@@ -9793,8 +9793,8 @@ class __PRIVATE_TargetIdGenerator {
|
|
|
9793
9793
|
}
|
|
9794
9794
|
collect(e, t) {
|
|
9795
9795
|
return -1 === this.params.cacheSizeCollectionThreshold ? (__PRIVATE_logDebug("LruGarbageCollector", "Garbage collection skipped; disabled"),
|
|
9796
|
-
PersistencePromise.resolve(
|
|
9797
|
-
|
|
9796
|
+
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}`),
|
|
9797
|
+
me) : this.Xn(e, t)));
|
|
9798
9798
|
}
|
|
9799
9799
|
getCacheSize(e) {
|
|
9800
9800
|
return this.Jn.getCacheSize(e);
|
|
@@ -11585,7 +11585,7 @@ class __PRIVATE_MemoryLruDelegate {
|
|
|
11585
11585
|
e.createObjectStore("mutations", {
|
|
11586
11586
|
keyPath: "batchId",
|
|
11587
11587
|
autoIncrement: !0
|
|
11588
|
-
}).createIndex("userMutationsIndex",
|
|
11588
|
+
}).createIndex("userMutationsIndex", O, {
|
|
11589
11589
|
unique: !0
|
|
11590
11590
|
}), e.createObjectStore("documentMutations");
|
|
11591
11591
|
}
|
|
@@ -11630,7 +11630,7 @@ class __PRIVATE_MemoryLruDelegate {
|
|
|
11630
11630
|
e.createObjectStore("mutations", {
|
|
11631
11631
|
keyPath: "batchId",
|
|
11632
11632
|
autoIncrement: !0
|
|
11633
|
-
}).createIndex("userMutationsIndex",
|
|
11633
|
+
}).createIndex("userMutationsIndex", O, {
|
|
11634
11634
|
unique: !0
|
|
11635
11635
|
});
|
|
11636
11636
|
const r = t.store("mutations"), i = n.map((e => r.put(e)));
|
|
@@ -11667,19 +11667,19 @@ class __PRIVATE_MemoryLruDelegate {
|
|
|
11667
11667
|
}))), n < 12 && r >= 12 && (s = s.next((() => {
|
|
11668
11668
|
!function __PRIVATE_createDocumentOverlayStore(e) {
|
|
11669
11669
|
const t = e.createObjectStore("documentOverlays", {
|
|
11670
|
-
keyPath:
|
|
11670
|
+
keyPath: j
|
|
11671
11671
|
});
|
|
11672
|
-
t.createIndex("collectionPathOverlayIndex",
|
|
11672
|
+
t.createIndex("collectionPathOverlayIndex", H, {
|
|
11673
11673
|
unique: !1
|
|
11674
|
-
}), t.createIndex("collectionGroupOverlayIndex",
|
|
11674
|
+
}), t.createIndex("collectionGroupOverlayIndex", J, {
|
|
11675
11675
|
unique: !1
|
|
11676
11676
|
});
|
|
11677
11677
|
}(e);
|
|
11678
11678
|
}))), n < 13 && r >= 13 && (s = s.next((() => function __PRIVATE_createRemoteDocumentCache(e) {
|
|
11679
11679
|
const t = e.createObjectStore("remoteDocumentsV14", {
|
|
11680
|
-
keyPath:
|
|
11680
|
+
keyPath: B
|
|
11681
11681
|
});
|
|
11682
|
-
t.createIndex("documentKeyIndex",
|
|
11682
|
+
t.createIndex("documentKeyIndex", L), t.createIndex("collectionGroupIndex", k);
|
|
11683
11683
|
}(e))).next((() => this._i(e, i))).next((() => e.deleteObjectStore("remoteDocuments")))),
|
|
11684
11684
|
n < 14 && r >= 14 && (s = s.next((() => this.ai(e, i)))), n < 15 && r >= 15 && (s = s.next((() => function __PRIVATE_createFieldIndex(e) {
|
|
11685
11685
|
e.createObjectStore("indexConfiguration", {
|
|
@@ -11689,13 +11689,13 @@ class __PRIVATE_MemoryLruDelegate {
|
|
|
11689
11689
|
unique: !1
|
|
11690
11690
|
});
|
|
11691
11691
|
e.createObjectStore("indexState", {
|
|
11692
|
-
keyPath:
|
|
11693
|
-
}).createIndex("sequenceNumberIndex",
|
|
11692
|
+
keyPath: U
|
|
11693
|
+
}).createIndex("sequenceNumberIndex", W, {
|
|
11694
11694
|
unique: !1
|
|
11695
11695
|
});
|
|
11696
11696
|
e.createObjectStore("indexEntries", {
|
|
11697
|
-
keyPath:
|
|
11698
|
-
}).createIndex("documentKeyIndex",
|
|
11697
|
+
keyPath: G
|
|
11698
|
+
}).createIndex("documentKeyIndex", z, {
|
|
11699
11699
|
unique: !1
|
|
11700
11700
|
});
|
|
11701
11701
|
}(e)))), n < 16 && r >= 16 && (
|
|
@@ -11756,7 +11756,7 @@ class __PRIVATE_MemoryLruDelegate {
|
|
|
11756
11756
|
si(e, t) {
|
|
11757
11757
|
// Create the index.
|
|
11758
11758
|
e.createObjectStore("collectionParents", {
|
|
11759
|
-
keyPath:
|
|
11759
|
+
keyPath: $
|
|
11760
11760
|
});
|
|
11761
11761
|
const n = t.store("collectionParents"), r = new __PRIVATE_MemoryCollectionParentIndex, addEntry = e => {
|
|
11762
11762
|
if (r.add(e)) {
|
|
@@ -11841,19 +11841,19 @@ class __PRIVATE_MemoryLruDelegate {
|
|
|
11841
11841
|
|
|
11842
11842
|
function __PRIVATE_createQueryCache(e) {
|
|
11843
11843
|
e.createObjectStore("targetDocuments", {
|
|
11844
|
-
keyPath:
|
|
11845
|
-
}).createIndex("documentTargetsIndex",
|
|
11844
|
+
keyPath: Q
|
|
11845
|
+
}).createIndex("documentTargetsIndex", K, {
|
|
11846
11846
|
unique: !0
|
|
11847
11847
|
});
|
|
11848
11848
|
// NOTE: This is unique only because the TargetId is the suffix.
|
|
11849
11849
|
e.createObjectStore("targets", {
|
|
11850
11850
|
keyPath: "targetId"
|
|
11851
|
-
}).createIndex("queryTargetsIndex",
|
|
11851
|
+
}).createIndex("queryTargetsIndex", q, {
|
|
11852
11852
|
unique: !0
|
|
11853
11853
|
}), e.createObjectStore("targetGlobal");
|
|
11854
11854
|
}
|
|
11855
11855
|
|
|
11856
|
-
const
|
|
11856
|
+
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.";
|
|
11857
11857
|
|
|
11858
11858
|
/**
|
|
11859
11859
|
* Oldest acceptable age in milliseconds for client metadata before the client
|
|
@@ -11929,7 +11929,7 @@ class __PRIVATE_IndexedDbPersistence {
|
|
|
11929
11929
|
/** The last time we garbage collected the client metadata object store. */
|
|
11930
11930
|
this.Ei = Number.NEGATIVE_INFINITY,
|
|
11931
11931
|
/** A listener to notify on primary state changes. */
|
|
11932
|
-
this.di = e => Promise.resolve(), !__PRIVATE_IndexedDbPersistence.D()) throw new FirestoreError(
|
|
11932
|
+
this.di = e => Promise.resolve(), !__PRIVATE_IndexedDbPersistence.D()) throw new FirestoreError(C.UNIMPLEMENTED, "This platform is either missing IndexedDB or is known to have an incomplete implementation. Offline persistence has been disabled.");
|
|
11933
11933
|
this.referenceDelegate = new __PRIVATE_IndexedDbLruDelegateImpl(this, r), this.Ai = t + "main",
|
|
11934
11934
|
this.serializer = new __PRIVATE_LocalSerializer(_), this.Ri = new __PRIVATE_SimpleDb(this.Ai, this.hi, new __PRIVATE_SchemaConverter(this.serializer)),
|
|
11935
11935
|
this.$r = new __PRIVATE_IndexedDbGlobalsCache, this.Ur = new __PRIVATE_IndexedDbTargetCache(this.referenceDelegate, this.serializer),
|
|
@@ -11949,7 +11949,7 @@ class __PRIVATE_IndexedDbPersistence {
|
|
|
11949
11949
|
if (!this.isPrimary && !this.allowTabSynchronization)
|
|
11950
11950
|
// Fail `start()` if `synchronizeTabs` is disabled and we cannot
|
|
11951
11951
|
// obtain the primary lease.
|
|
11952
|
-
throw new FirestoreError(
|
|
11952
|
+
throw new FirestoreError(C.FAILED_PRECONDITION, fe);
|
|
11953
11953
|
return this.fi(), this.gi(), this.pi(), this.runTransaction("getHighestListenSequenceNumber", "readonly", (e => this.Ur.getHighestSequenceNumber(e)));
|
|
11954
11954
|
})).then((e => {
|
|
11955
11955
|
this.Qr = new __PRIVATE_ListenSequence(e, this.ci);
|
|
@@ -12091,7 +12091,7 @@ class __PRIVATE_IndexedDbPersistence {
|
|
|
12091
12091
|
// settings is not supported.
|
|
12092
12092
|
// TODO(b/114226234): Remove this check when `synchronizeTabs` can
|
|
12093
12093
|
// no longer be turned off.
|
|
12094
|
-
throw new FirestoreError(
|
|
12094
|
+
throw new FirestoreError(C.FAILED_PRECONDITION, fe);
|
|
12095
12095
|
return !1;
|
|
12096
12096
|
}
|
|
12097
12097
|
}
|
|
@@ -12164,7 +12164,7 @@ class __PRIVATE_IndexedDbPersistence {
|
|
|
12164
12164
|
const r = "readonly" === t ? "readonly" : "readwrite", i =
|
|
12165
12165
|
/** Returns the object stores for the provided schema. */
|
|
12166
12166
|
function __PRIVATE_getObjectStores(e) {
|
|
12167
|
-
return 17 === e ?
|
|
12167
|
+
return 17 === e ? re : 16 === e ? ne : 15 === e ? te : 14 === e ? ee : 13 === e ? X : 12 === e ? Z : 11 === e ? Y : void fail();
|
|
12168
12168
|
}(this.hi);
|
|
12169
12169
|
let s;
|
|
12170
12170
|
// Do all transactions as readwrite against all object stores, since we
|
|
@@ -12172,7 +12172,7 @@ class __PRIVATE_IndexedDbPersistence {
|
|
|
12172
12172
|
return this.Ri.runTransaction(e, r, i, (r => (s = new __PRIVATE_IndexedDbTransaction(r, this.Qr ? this.Qr.next() : __PRIVATE_ListenSequence.oe),
|
|
12173
12173
|
"readwrite-primary" === t ? this.wi(s).next((e => !!e || this.Si(s))).next((t => {
|
|
12174
12174
|
if (!t) throw __PRIVATE_logError(`Failed to obtain primary lease for action '${e}'.`),
|
|
12175
|
-
this.isPrimary = !1, this.ui.enqueueRetryable((() => this.di(!1))), new FirestoreError(
|
|
12175
|
+
this.isPrimary = !1, this.ui.enqueueRetryable((() => this.di(!1))), new FirestoreError(C.FAILED_PRECONDITION, M);
|
|
12176
12176
|
return n(s);
|
|
12177
12177
|
})).next((e => this.Di(s).next((() => e)))) : this.Ki(s).next((() => n(s)))))).then((e => (s.raiseOnCommittedEvent(),
|
|
12178
12178
|
e)));
|
|
@@ -12185,7 +12185,7 @@ class __PRIVATE_IndexedDbPersistence {
|
|
|
12185
12185
|
// be turned off.
|
|
12186
12186
|
Ki(e) {
|
|
12187
12187
|
return __PRIVATE_primaryClientStore(e).get("owner").next((e => {
|
|
12188
|
-
if (null !== e && this.Mi(e.leaseTimestampMs, 5e3) && !this.Ni(e.ownerId) && !this.vi(e) && !(this.li || this.allowTabSynchronization && e.allowTabSynchronization)) throw new FirestoreError(
|
|
12188
|
+
if (null !== e && this.Mi(e.leaseTimestampMs, 5e3) && !this.Ni(e.ownerId) && !this.vi(e) && !(this.li || this.allowTabSynchronization && e.allowTabSynchronization)) throw new FirestoreError(C.FAILED_PRECONDITION, fe);
|
|
12189
12189
|
}));
|
|
12190
12190
|
}
|
|
12191
12191
|
/**
|
|
@@ -13333,18 +13333,20 @@ class __PRIVATE_LocalClientState {
|
|
|
13333
13333
|
// in order, it is safe to delete the entry right after updating it.
|
|
13334
13334
|
this.Qs(e);
|
|
13335
13335
|
}
|
|
13336
|
-
addLocalQueryTarget(e) {
|
|
13337
|
-
let
|
|
13336
|
+
addLocalQueryTarget(e, t = !0) {
|
|
13337
|
+
let n = "not-current";
|
|
13338
13338
|
// Lookup an existing query state if the target ID was already registered
|
|
13339
13339
|
// by another tab
|
|
13340
13340
|
if (this.isActiveQueryTarget(e)) {
|
|
13341
|
-
const
|
|
13342
|
-
if (
|
|
13343
|
-
const r = __PRIVATE_QueryTargetMetadata.Rs(e,
|
|
13344
|
-
r && (
|
|
13341
|
+
const t = this.storage.getItem(createWebStorageQueryTargetMetadataKey(this.persistenceKey, e));
|
|
13342
|
+
if (t) {
|
|
13343
|
+
const r = __PRIVATE_QueryTargetMetadata.Rs(e, t);
|
|
13344
|
+
r && (n = r.state);
|
|
13345
13345
|
}
|
|
13346
13346
|
}
|
|
13347
|
-
|
|
13347
|
+
// If the query is listening to cache only, the target ID should not be registered with the
|
|
13348
|
+
// local Firestore client as an active watch target.
|
|
13349
|
+
return t && this.Ks.fs(e), this.Ns(), n;
|
|
13348
13350
|
}
|
|
13349
13351
|
removeLocalQueryTarget(e) {
|
|
13350
13352
|
this.Ks.gs(e), this.Ns();
|
|
@@ -13552,8 +13554,8 @@ class __PRIVATE_MemorySharedClientState {
|
|
|
13552
13554
|
updateMutationState(e, t, n) {
|
|
13553
13555
|
// No op.
|
|
13554
13556
|
}
|
|
13555
|
-
addLocalQueryTarget(e) {
|
|
13556
|
-
return this.so.fs(e), this.oo[e] || "not-current";
|
|
13557
|
+
addLocalQueryTarget(e, t = !0) {
|
|
13558
|
+
return t && this.so.fs(e), this.oo[e] || "not-current";
|
|
13557
13559
|
}
|
|
13558
13560
|
updateQueryState(e, t, n) {
|
|
13559
13561
|
this.oo[e] = t;
|
|
@@ -13682,7 +13684,7 @@ class __PRIVATE_BrowserConnectivityMonitor {
|
|
|
13682
13684
|
/**
|
|
13683
13685
|
* The value returned from the most recent invocation of
|
|
13684
13686
|
* `generateUniqueDebugId()`, or null if it has never been invoked.
|
|
13685
|
-
*/ let
|
|
13687
|
+
*/ let ge = null;
|
|
13686
13688
|
|
|
13687
13689
|
/**
|
|
13688
13690
|
* Generates and returns an initial value for `lastUniqueDebugId`.
|
|
@@ -13707,9 +13709,9 @@ class __PRIVATE_BrowserConnectivityMonitor {
|
|
|
13707
13709
|
* @return the 10-character generated ID (e.g. "0xa1b2c3d4").
|
|
13708
13710
|
*/
|
|
13709
13711
|
function __PRIVATE_generateUniqueDebugId() {
|
|
13710
|
-
return null ===
|
|
13712
|
+
return null === ge ? ge = function __PRIVATE_generateInitialUniqueDebugId() {
|
|
13711
13713
|
return 268435456 + Math.round(2147483648 * Math.random());
|
|
13712
|
-
}() :
|
|
13714
|
+
}() : ge++, "0x" + ge.toString(16);
|
|
13713
13715
|
}
|
|
13714
13716
|
|
|
13715
13717
|
/**
|
|
@@ -13727,7 +13729,7 @@ function __PRIVATE_generateUniqueDebugId() {
|
|
|
13727
13729
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13728
13730
|
* See the License for the specific language governing permissions and
|
|
13729
13731
|
* limitations under the License.
|
|
13730
|
-
*/ const
|
|
13732
|
+
*/ const pe = {
|
|
13731
13733
|
BatchGetDocuments: "batchGet",
|
|
13732
13734
|
Commit: "commit",
|
|
13733
13735
|
RunQuery: "runQuery",
|
|
@@ -13811,7 +13813,7 @@ class __PRIVATE_StreamBridge {
|
|
|
13811
13813
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13812
13814
|
* See the License for the specific language governing permissions and
|
|
13813
13815
|
* limitations under the License.
|
|
13814
|
-
*/ const
|
|
13816
|
+
*/ const ye = "WebChannelConnection";
|
|
13815
13817
|
|
|
13816
13818
|
class __PRIVATE_WebChannelConnection extends
|
|
13817
13819
|
/**
|
|
@@ -13855,7 +13857,7 @@ class __PRIVATE_RestConnection {
|
|
|
13855
13857
|
// SDK_VERSION is updated to different value at runtime depending on the entry point,
|
|
13856
13858
|
// so we need to get its value when we need it in a function.
|
|
13857
13859
|
function __PRIVATE_getGoogApiClientValue() {
|
|
13858
|
-
return "gl-js/ fire/" +
|
|
13860
|
+
return "gl-js/ fire/" + D;
|
|
13859
13861
|
}(),
|
|
13860
13862
|
// Content-Type: text/plain will avoid preflight requests which might
|
|
13861
13863
|
// mess with CORS and redirects by proxies. If we add custom headers
|
|
@@ -13865,7 +13867,7 @@ class __PRIVATE_RestConnection {
|
|
|
13865
13867
|
t && t.headers.forEach(((t, n) => e[n] = t)), n && n.headers.forEach(((t, n) => e[n] = t));
|
|
13866
13868
|
}
|
|
13867
13869
|
xo(e, t) {
|
|
13868
|
-
const n =
|
|
13870
|
+
const n = pe[e];
|
|
13869
13871
|
return `${this.Do}/v1/${t}:${n}`;
|
|
13870
13872
|
}
|
|
13871
13873
|
/**
|
|
@@ -13889,17 +13891,17 @@ class __PRIVATE_RestConnection {
|
|
|
13889
13891
|
switch (_.getLastErrorCode()) {
|
|
13890
13892
|
case f.NO_ERROR:
|
|
13891
13893
|
const t = _.getResponseJson();
|
|
13892
|
-
__PRIVATE_logDebug(
|
|
13894
|
+
__PRIVATE_logDebug(ye, `XHR for RPC '${e}' ${i} received:`, JSON.stringify(t)),
|
|
13893
13895
|
s(t);
|
|
13894
13896
|
break;
|
|
13895
13897
|
|
|
13896
13898
|
case f.TIMEOUT:
|
|
13897
|
-
__PRIVATE_logDebug(
|
|
13899
|
+
__PRIVATE_logDebug(ye, `RPC '${e}' ${i} timed out`), o(new FirestoreError(C.DEADLINE_EXCEEDED, "Request time out"));
|
|
13898
13900
|
break;
|
|
13899
13901
|
|
|
13900
13902
|
case f.HTTP_ERROR:
|
|
13901
13903
|
const n = _.getStatus();
|
|
13902
|
-
if (__PRIVATE_logDebug(
|
|
13904
|
+
if (__PRIVATE_logDebug(ye, `RPC '${e}' ${i} failed with status:`, n, "response text:", _.getResponseText()),
|
|
13903
13905
|
n > 0) {
|
|
13904
13906
|
let e = _.getResponseJson();
|
|
13905
13907
|
Array.isArray(e) && (e = e[0]);
|
|
@@ -13907,25 +13909,25 @@ class __PRIVATE_RestConnection {
|
|
|
13907
13909
|
if (t && t.status && t.message) {
|
|
13908
13910
|
const e = function __PRIVATE_mapCodeFromHttpResponseErrorStatus(e) {
|
|
13909
13911
|
const t = e.toLowerCase().replace(/_/g, "-");
|
|
13910
|
-
return Object.values(
|
|
13912
|
+
return Object.values(C).indexOf(t) >= 0 ? t : C.UNKNOWN;
|
|
13911
13913
|
}(t.status);
|
|
13912
13914
|
o(new FirestoreError(e, t.message));
|
|
13913
|
-
} else o(new FirestoreError(
|
|
13915
|
+
} else o(new FirestoreError(C.UNKNOWN, "Server responded with status " + _.getStatus()));
|
|
13914
13916
|
} else
|
|
13915
13917
|
// If we received an HTTP_ERROR but there's no status code,
|
|
13916
13918
|
// it's most probably a connection issue
|
|
13917
|
-
o(new FirestoreError(
|
|
13919
|
+
o(new FirestoreError(C.UNAVAILABLE, "Connection failed."));
|
|
13918
13920
|
break;
|
|
13919
13921
|
|
|
13920
13922
|
default:
|
|
13921
13923
|
fail();
|
|
13922
13924
|
}
|
|
13923
13925
|
} finally {
|
|
13924
|
-
__PRIVATE_logDebug(
|
|
13926
|
+
__PRIVATE_logDebug(ye, `RPC '${e}' ${i} completed.`);
|
|
13925
13927
|
}
|
|
13926
13928
|
}));
|
|
13927
13929
|
const a = JSON.stringify(r);
|
|
13928
|
-
__PRIVATE_logDebug(
|
|
13930
|
+
__PRIVATE_logDebug(ye, `RPC '${e}' ${i} sending request:`, r), _.send(t, "POST", a, n, 15);
|
|
13929
13931
|
}));
|
|
13930
13932
|
}
|
|
13931
13933
|
Lo(e, t, n) {
|
|
@@ -13953,7 +13955,7 @@ class __PRIVATE_RestConnection {
|
|
|
13953
13955
|
forceLongPolling: this.forceLongPolling,
|
|
13954
13956
|
detectBufferingProxy: this.autoDetectLongPolling
|
|
13955
13957
|
}, a = this.longPollingOptions.timeoutSeconds;
|
|
13956
|
-
void 0 !== a && (_.longPollingTimeout = Math.round(1e3 * a)), this.useFetchStreams && (_.
|
|
13958
|
+
void 0 !== a && (_.longPollingTimeout = Math.round(1e3 * a)), this.useFetchStreams && (_.useFetchStreams = !0),
|
|
13957
13959
|
this.Oo(_.initMessageHeaders, t, n),
|
|
13958
13960
|
// Sending the custom headers we just added to request.initMessageHeaders
|
|
13959
13961
|
// (Authorization, etc.) will trigger the browser to make a CORS preflight
|
|
@@ -13966,7 +13968,7 @@ class __PRIVATE_RestConnection {
|
|
|
13966
13968
|
// which is recognized by the webchannel backend.
|
|
13967
13969
|
_.encodeInitMessageHeaders = !0;
|
|
13968
13970
|
const u = i.join("");
|
|
13969
|
-
__PRIVATE_logDebug(
|
|
13971
|
+
__PRIVATE_logDebug(ye, `Creating RPC '${e}' stream ${r}: ${u}`, _);
|
|
13970
13972
|
const c = s.createWebChannel(u, _);
|
|
13971
13973
|
// WebChannel supports sending the first message with the handshake - saving
|
|
13972
13974
|
// a network round trip. However, it will have to call send in the same
|
|
@@ -13979,8 +13981,8 @@ class __PRIVATE_RestConnection {
|
|
|
13979
13981
|
// on a closed stream
|
|
13980
13982
|
const P = new __PRIVATE_StreamBridge({
|
|
13981
13983
|
Io: t => {
|
|
13982
|
-
h ? __PRIVATE_logDebug(
|
|
13983
|
-
c.open(), l = !0), __PRIVATE_logDebug(
|
|
13984
|
+
h ? __PRIVATE_logDebug(ye, `Not sending because RPC '${e}' stream ${r} is closed:`, t) : (l || (__PRIVATE_logDebug(ye, `Opening RPC '${e}' stream ${r} transport.`),
|
|
13985
|
+
c.open(), l = !0), __PRIVATE_logDebug(ye, `RPC '${e}' stream ${r} sending:`, t),
|
|
13984
13986
|
c.send(t));
|
|
13985
13987
|
},
|
|
13986
13988
|
To: () => c.close()
|
|
@@ -14001,15 +14003,15 @@ class __PRIVATE_RestConnection {
|
|
|
14001
14003
|
// exception and rethrow using a setTimeout so they become visible again.
|
|
14002
14004
|
// Note that eventually this function could go away if we are confident
|
|
14003
14005
|
// enough the code is exception free.
|
|
14004
|
-
return __PRIVATE_unguardedEventListen(c,
|
|
14005
|
-
h || (__PRIVATE_logDebug(
|
|
14006
|
-
})), __PRIVATE_unguardedEventListen(c,
|
|
14007
|
-
h || (h = !0, __PRIVATE_logDebug(
|
|
14006
|
+
return __PRIVATE_unguardedEventListen(c, y.EventType.OPEN, (() => {
|
|
14007
|
+
h || (__PRIVATE_logDebug(ye, `RPC '${e}' stream ${r} transport opened.`), P.yo());
|
|
14008
|
+
})), __PRIVATE_unguardedEventListen(c, y.EventType.CLOSE, (() => {
|
|
14009
|
+
h || (h = !0, __PRIVATE_logDebug(ye, `RPC '${e}' stream ${r} transport closed`),
|
|
14008
14010
|
P.So());
|
|
14009
|
-
})), __PRIVATE_unguardedEventListen(c,
|
|
14010
|
-
h || (h = !0, __PRIVATE_logWarn(
|
|
14011
|
-
P.So(new FirestoreError(
|
|
14012
|
-
})), __PRIVATE_unguardedEventListen(c,
|
|
14011
|
+
})), __PRIVATE_unguardedEventListen(c, y.EventType.ERROR, (t => {
|
|
14012
|
+
h || (h = !0, __PRIVATE_logWarn(ye, `RPC '${e}' stream ${r} transport errored:`, t),
|
|
14013
|
+
P.So(new FirestoreError(C.UNAVAILABLE, "The operation could not be completed")));
|
|
14014
|
+
})), __PRIVATE_unguardedEventListen(c, y.EventType.MESSAGE, (t => {
|
|
14013
14015
|
var n;
|
|
14014
14016
|
if (!h) {
|
|
14015
14017
|
const i = t.data[0];
|
|
@@ -14021,7 +14023,7 @@ class __PRIVATE_RestConnection {
|
|
|
14021
14023
|
// Use any because msgData.error is not typed.
|
|
14022
14024
|
const s = i, o = s.error || (null === (n = s[0]) || void 0 === n ? void 0 : n.error);
|
|
14023
14025
|
if (o) {
|
|
14024
|
-
__PRIVATE_logDebug(
|
|
14026
|
+
__PRIVATE_logDebug(ye, `RPC '${e}' stream ${r} received error:`, o);
|
|
14025
14027
|
// error.status will be a string like 'OK' or 'NOT_FOUND'.
|
|
14026
14028
|
const t = o.status;
|
|
14027
14029
|
let n =
|
|
@@ -14034,16 +14036,16 @@ class __PRIVATE_RestConnection {
|
|
|
14034
14036
|
function __PRIVATE_mapCodeFromRpcStatus(e) {
|
|
14035
14037
|
// lookup by string
|
|
14036
14038
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
14037
|
-
const t =
|
|
14039
|
+
const t = Pe[e];
|
|
14038
14040
|
if (void 0 !== t) return __PRIVATE_mapCodeFromRpcCode(t);
|
|
14039
14041
|
}(t), i = o.message;
|
|
14040
|
-
void 0 === n && (n =
|
|
14042
|
+
void 0 === n && (n = C.INTERNAL, i = "Unknown error status: " + t + " with message " + o.message),
|
|
14041
14043
|
// Mark closed so no further events are propagated
|
|
14042
14044
|
h = !0, P.So(new FirestoreError(n, i)), c.close();
|
|
14043
|
-
} else __PRIVATE_logDebug(
|
|
14045
|
+
} else __PRIVATE_logDebug(ye, `RPC '${e}' stream ${r} received:`, i), P.bo(i);
|
|
14044
14046
|
}
|
|
14045
|
-
})), __PRIVATE_unguardedEventListen(o,
|
|
14046
|
-
t.stat ===
|
|
14047
|
+
})), __PRIVATE_unguardedEventListen(o, w.STAT_EVENT, (t => {
|
|
14048
|
+
t.stat === S.PROXY ? __PRIVATE_logDebug(ye, `RPC '${e}' stream ${r} detected buffering proxy`) : t.stat === S.NOPROXY && __PRIVATE_logDebug(ye, `RPC '${e}' stream ${r} detected no buffering proxy`);
|
|
14047
14049
|
})), setTimeout((() => {
|
|
14048
14050
|
// Technically we could/should wait for the WebChannel opened event,
|
|
14049
14051
|
// but because we want to send the first message with the WebChannel
|
|
@@ -14371,10 +14373,10 @@ class __PRIVATE_PersistentStream {
|
|
|
14371
14373
|
// underlying stream), guaranteeing they won't execute.
|
|
14372
14374
|
this.Yo++, 4 /* PersistentStreamState.Error */ !== e ?
|
|
14373
14375
|
// If this is an intentional close ensure we don't delay our next connection attempt.
|
|
14374
|
-
this.t_.reset() : t && t.code ===
|
|
14376
|
+
this.t_.reset() : t && t.code === C.RESOURCE_EXHAUSTED ? (
|
|
14375
14377
|
// Log the error. (Probably either 'quota exceeded' or 'max queue length reached'.)
|
|
14376
14378
|
__PRIVATE_logError(t.toString()), __PRIVATE_logError("Using maximum backoff delay to prevent overloading the backend."),
|
|
14377
|
-
this.t_.Wo()) : t && t.code ===
|
|
14379
|
+
this.t_.Wo()) : t && t.code === C.UNAUTHENTICATED && 3 /* PersistentStreamState.Healthy */ !== this.state && (
|
|
14378
14380
|
// "unauthenticated" error means the token was rejected. This should rarely
|
|
14379
14381
|
// happen since both Auth and AppCheck ensure a sufficient TTL when we
|
|
14380
14382
|
// request a token. If a user manually resets their system clock this can
|
|
@@ -14410,7 +14412,7 @@ class __PRIVATE_PersistentStream {
|
|
|
14410
14412
|
this.P_(e, n);
|
|
14411
14413
|
}), (t => {
|
|
14412
14414
|
e((() => {
|
|
14413
|
-
const e = new FirestoreError(
|
|
14415
|
+
const e = new FirestoreError(C.UNKNOWN, "Fetching auth token failed: " + t.message);
|
|
14414
14416
|
return this.I_(e);
|
|
14415
14417
|
}));
|
|
14416
14418
|
}));
|
|
@@ -14629,18 +14631,18 @@ class __PRIVATE_DatastoreImpl extends class Datastore {} {
|
|
|
14629
14631
|
this.serializer = r, this.y_ = !1;
|
|
14630
14632
|
}
|
|
14631
14633
|
w_() {
|
|
14632
|
-
if (this.y_) throw new FirestoreError(
|
|
14634
|
+
if (this.y_) throw new FirestoreError(C.FAILED_PRECONDITION, "The client has already been terminated.");
|
|
14633
14635
|
}
|
|
14634
14636
|
/** Invokes the provided RPC with auth and AppCheck tokens. */ Mo(e, t, n, r) {
|
|
14635
14637
|
return this.w_(), Promise.all([ this.authCredentials.getToken(), this.appCheckCredentials.getToken() ]).then((([i, s]) => this.connection.Mo(e, __PRIVATE_toResourcePath(t, n), r, i, s))).catch((e => {
|
|
14636
|
-
throw "FirebaseError" === e.name ? (e.code ===
|
|
14637
|
-
this.appCheckCredentials.invalidateToken()), e) : new FirestoreError(
|
|
14638
|
+
throw "FirebaseError" === e.name ? (e.code === C.UNAUTHENTICATED && (this.authCredentials.invalidateToken(),
|
|
14639
|
+
this.appCheckCredentials.invalidateToken()), e) : new FirestoreError(C.UNKNOWN, e.toString());
|
|
14638
14640
|
}));
|
|
14639
14641
|
}
|
|
14640
14642
|
/** Invokes the provided RPC with streamed results with auth and AppCheck tokens. */ Bo(e, t, n, r, i) {
|
|
14641
14643
|
return this.w_(), Promise.all([ this.authCredentials.getToken(), this.appCheckCredentials.getToken() ]).then((([s, o]) => this.connection.Bo(e, __PRIVATE_toResourcePath(t, n), r, s, o, i))).catch((e => {
|
|
14642
|
-
throw "FirebaseError" === e.name ? (e.code ===
|
|
14643
|
-
this.appCheckCredentials.invalidateToken()), e) : new FirestoreError(
|
|
14644
|
+
throw "FirebaseError" === e.name ? (e.code === C.UNAUTHENTICATED && (this.authCredentials.invalidateToken(),
|
|
14645
|
+
this.appCheckCredentials.invalidateToken()), e) : new FirestoreError(C.UNKNOWN, e.toString());
|
|
14644
14646
|
}));
|
|
14645
14647
|
}
|
|
14646
14648
|
terminate() {
|
|
@@ -15084,7 +15086,7 @@ async function __PRIVATE_onWriteStreamClose(e, t) {
|
|
|
15084
15086
|
// Only handle permanent errors here. If it's transient, just let the retry
|
|
15085
15087
|
// logic kick in.
|
|
15086
15088
|
if (function __PRIVATE_isPermanentWriteError(e) {
|
|
15087
|
-
return __PRIVATE_isPermanentError(e) && e !==
|
|
15089
|
+
return __PRIVATE_isPermanentError(e) && e !== C.ABORTED;
|
|
15088
15090
|
}(t.code)) {
|
|
15089
15091
|
// This was a permanent error, the request itself was the problem
|
|
15090
15092
|
// so it's not going to succeed if we resend it.
|
|
@@ -15267,7 +15269,7 @@ class DelayedOperation {
|
|
|
15267
15269
|
* As long as the operation has not yet been run, calling cancel() provides a
|
|
15268
15270
|
* guarantee that the operation will not be run.
|
|
15269
15271
|
*/ cancel(e) {
|
|
15270
|
-
null !== this.timerHandle && (this.clearTimeout(), this.deferred.reject(new FirestoreError(
|
|
15272
|
+
null !== this.timerHandle && (this.clearTimeout(), this.deferred.reject(new FirestoreError(C.CANCELLED, "Operation cancelled" + (e ? ": " + e : ""))));
|
|
15271
15273
|
}
|
|
15272
15274
|
handleDelayElapsed() {
|
|
15273
15275
|
this.asyncQueue.enqueueAndForget((() => null !== this.timerHandle ? (this.clearTimeout(),
|
|
@@ -15283,7 +15285,7 @@ class DelayedOperation {
|
|
|
15283
15285
|
* Returns a FirestoreError that can be surfaced to the user if the provided
|
|
15284
15286
|
* error is an IndexedDbTransactionError. Re-throws the error otherwise.
|
|
15285
15287
|
*/ function __PRIVATE_wrapInUserErrorIfRecoverable(e, t) {
|
|
15286
|
-
if (__PRIVATE_logError("AsyncQueue", `${t}: ${e}`), __PRIVATE_isIndexedDbTransactionError(e)) return new FirestoreError(
|
|
15288
|
+
if (__PRIVATE_logError("AsyncQueue", `${t}: ${e}`), __PRIVATE_isIndexedDbTransactionError(e)) return new FirestoreError(C.UNAVAILABLE, `${t}: ${e}`);
|
|
15287
15289
|
throw e;
|
|
15288
15290
|
}
|
|
15289
15291
|
|
|
@@ -15513,7 +15515,7 @@ class __PRIVATE_EventManagerImpl {
|
|
|
15513
15515
|
}));
|
|
15514
15516
|
}
|
|
15515
15517
|
// Call all global snapshot listeners that have been set.
|
|
15516
|
-
(this, new FirestoreError(
|
|
15518
|
+
(this, new FirestoreError(C.ABORTED, "Firestore shutting down"));
|
|
15517
15519
|
}
|
|
15518
15520
|
}
|
|
15519
15521
|
|
|
@@ -15610,12 +15612,12 @@ function __PRIVATE_raiseSnapshotsInSyncEvent(e) {
|
|
|
15610
15612
|
}));
|
|
15611
15613
|
}
|
|
15612
15614
|
|
|
15613
|
-
var
|
|
15615
|
+
var we, Se;
|
|
15614
15616
|
|
|
15615
15617
|
/** Listen to both cache and server changes */
|
|
15616
|
-
(
|
|
15618
|
+
(Se = we || (we = {})).ea = "default",
|
|
15617
15619
|
/** Listen to changes in cache only */
|
|
15618
|
-
|
|
15620
|
+
Se.Cache = "cache";
|
|
15619
15621
|
|
|
15620
15622
|
/**
|
|
15621
15623
|
* QueryListener takes a series of internal view snapshots and determines
|
|
@@ -15690,7 +15692,7 @@ class __PRIVATE_QueryListener {
|
|
|
15690
15692
|
this.na = !0, this.ta.next(e);
|
|
15691
15693
|
}
|
|
15692
15694
|
J_() {
|
|
15693
|
-
return this.options.source !==
|
|
15695
|
+
return this.options.source !== we.Cache;
|
|
15694
15696
|
}
|
|
15695
15697
|
}
|
|
15696
15698
|
|
|
@@ -16244,7 +16246,7 @@ async function __PRIVATE_syncEngineListen(e, t, n = !0) {
|
|
|
16244
16246
|
}
|
|
16245
16247
|
|
|
16246
16248
|
async function __PRIVATE_allocateTargetAndMaybeListen(e, t, n, r) {
|
|
16247
|
-
const i = await __PRIVATE_localStoreAllocateTarget(e.localStore, __PRIVATE_queryToTarget(t)), s = i.targetId, o =
|
|
16249
|
+
const i = await __PRIVATE_localStoreAllocateTarget(e.localStore, __PRIVATE_queryToTarget(t)), s = i.targetId, o = e.sharedClientState.addLocalQueryTarget(s, n);
|
|
16248
16250
|
let _;
|
|
16249
16251
|
return r && (_ = await __PRIVATE_initializeViewAndComputeSnapshot(e, t, s, "current" === o, i.resumeToken)),
|
|
16250
16252
|
e.isPrimaryClient && n && __PRIVATE_remoteStoreListen(e.remoteStore, i), _;
|
|
@@ -16658,7 +16660,7 @@ async function __PRIVATE_syncEngineHandleCredentialChange(e, t) {
|
|
|
16658
16660
|
function __PRIVATE_rejectOutstandingPendingWritesCallbacks(e, t) {
|
|
16659
16661
|
e.ka.forEach((e => {
|
|
16660
16662
|
e.forEach((e => {
|
|
16661
|
-
e.reject(new FirestoreError(
|
|
16663
|
+
e.reject(new FirestoreError(C.CANCELLED, t));
|
|
16662
16664
|
}));
|
|
16663
16665
|
})), e.ka.clear();
|
|
16664
16666
|
}(n, "'waitForPendingWrites' promise is rejected due to a user change."),
|
|
@@ -17087,7 +17089,7 @@ class __PRIVATE_LruGcMemoryOfflineComponentProvider extends MemoryOfflineCompone
|
|
|
17087
17089
|
}
|
|
17088
17090
|
createSharedClientState(e) {
|
|
17089
17091
|
const t = __PRIVATE_getWindow();
|
|
17090
|
-
if (!__PRIVATE_WebStorageSharedClientState.D(t)) throw new FirestoreError(
|
|
17092
|
+
if (!__PRIVATE_WebStorageSharedClientState.D(t)) throw new FirestoreError(C.UNIMPLEMENTED, "IndexedDB persistence is only available on platforms that support LocalStorage.");
|
|
17091
17093
|
const n = __PRIVATE_indexedDbStoragePrefix(e.databaseInfo.databaseId, e.databaseInfo.persistenceKey);
|
|
17092
17094
|
return new __PRIVATE_WebStorageSharedClientState(t, e.asyncQueue, n, e.clientId, e.initialUser);
|
|
17093
17095
|
}
|
|
@@ -17426,7 +17428,7 @@ class Transaction$2 {
|
|
|
17426
17428
|
this.writtenDocs = new Set;
|
|
17427
17429
|
}
|
|
17428
17430
|
async lookup(e) {
|
|
17429
|
-
if (this.ensureCommitNotCalled(), this.mutations.length > 0) throw this.lastTransactionError = new FirestoreError(
|
|
17431
|
+
if (this.ensureCommitNotCalled(), this.mutations.length > 0) throw this.lastTransactionError = new FirestoreError(C.INVALID_ARGUMENT, "Firestore transactions require all reads to be executed before all writes."),
|
|
17430
17432
|
this.lastTransactionError;
|
|
17431
17433
|
const t = await async function __PRIVATE_invokeBatchGetDocumentsRpc(e, t) {
|
|
17432
17434
|
const n = __PRIVATE_debugCast(e), r = {
|
|
@@ -17488,7 +17490,7 @@ class Transaction$2 {
|
|
|
17488
17490
|
if (n) {
|
|
17489
17491
|
if (!t.isEqual(n))
|
|
17490
17492
|
// This transaction will fail no matter what.
|
|
17491
|
-
throw new FirestoreError(
|
|
17493
|
+
throw new FirestoreError(C.ABORTED, "Document version changed between two reads.");
|
|
17492
17494
|
} else this.readVersions.set(e.key.toString(), t);
|
|
17493
17495
|
}
|
|
17494
17496
|
/**
|
|
@@ -17515,7 +17517,7 @@ class Transaction$2 {
|
|
|
17515
17517
|
// express that to the backend, we have to validate locally.
|
|
17516
17518
|
// Note: this can change once we can send separate verify writes in the
|
|
17517
17519
|
// transaction.
|
|
17518
|
-
throw new FirestoreError(
|
|
17520
|
+
throw new FirestoreError(C.INVALID_ARGUMENT, "Can't update a document that doesn't exist.");
|
|
17519
17521
|
// Document exists, base precondition on document update time.
|
|
17520
17522
|
return Precondition.updateTime(t);
|
|
17521
17523
|
}
|
|
@@ -17656,7 +17658,7 @@ class FirestoreClient {
|
|
|
17656
17658
|
* Checks that the client has not been terminated. Ensures that other methods on //
|
|
17657
17659
|
* this class cannot be called after the client is terminated. //
|
|
17658
17660
|
*/ verifyNotTerminated() {
|
|
17659
|
-
if (this.asyncQueue.isShuttingDown) throw new FirestoreError(
|
|
17661
|
+
if (this.asyncQueue.isShuttingDown) throw new FirestoreError(C.FAILED_PRECONDITION, "The client has already been terminated.");
|
|
17660
17662
|
}
|
|
17661
17663
|
terminate() {
|
|
17662
17664
|
this.asyncQueue.enterRestrictedMode();
|
|
@@ -17704,7 +17706,7 @@ async function __PRIVATE_setOnlineComponentProvider(e, t) {
|
|
|
17704
17706
|
* Decides whether the provided error allows us to gracefully disable
|
|
17705
17707
|
* persistence (as opposed to crashing the client).
|
|
17706
17708
|
*/ function __PRIVATE_canFallbackFromIndexedDbError(e) {
|
|
17707
|
-
return "FirebaseError" === e.name ? e.code ===
|
|
17709
|
+
return "FirebaseError" === e.name ? e.code === C.FAILED_PRECONDITION || e.code === C.UNIMPLEMENTED : !("undefined" != typeof DOMException && e instanceof DOMException) || (
|
|
17708
17710
|
// When the browser is out of quota we could get either quota exceeded
|
|
17709
17711
|
// or an aborted error depending on whether the error happened during
|
|
17710
17712
|
// schema migration.
|
|
@@ -17798,7 +17800,7 @@ async function __PRIVATE_getEventManager(e) {
|
|
|
17798
17800
|
const n = __PRIVATE_debugCast(e);
|
|
17799
17801
|
return n.persistence.runTransaction("read document", "readonly", (e => n.localDocuments.getDocument(e, t)));
|
|
17800
17802
|
}(e, t);
|
|
17801
|
-
r.isFoundDocument() ? n.resolve(r) : r.isNoDocument() ? n.resolve(null) : n.reject(new FirestoreError(
|
|
17803
|
+
r.isFoundDocument() ? n.resolve(r) : r.isNoDocument() ? n.resolve(null) : n.reject(new FirestoreError(C.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.)"));
|
|
17802
17804
|
} catch (e) {
|
|
17803
17805
|
const r = __PRIVATE_wrapInUserErrorIfRecoverable(e, `Failed to get document '${t} from cache`);
|
|
17804
17806
|
n.reject(r);
|
|
@@ -17827,7 +17829,7 @@ function __PRIVATE_firestoreClientGetDocumentViaSnapshotListener(e, t, n = {}) {
|
|
|
17827
17829
|
// the server so we can deliver that even when you're
|
|
17828
17830
|
// offline 2) Actually reject the Promise in the online case
|
|
17829
17831
|
// if the document doesn't exist.
|
|
17830
|
-
i.reject(new FirestoreError(
|
|
17832
|
+
i.reject(new FirestoreError(C.UNAVAILABLE, "Failed to get document because the client is offline.")) : _ && s.fromCache && r && "server" === r.source ? i.reject(new FirestoreError(C.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);
|
|
17831
17833
|
},
|
|
17832
17834
|
error: e => i.reject(e)
|
|
17833
17835
|
}), o = new __PRIVATE_QueryListener(__PRIVATE_newQueryForPath(n.path), s, {
|
|
@@ -17864,7 +17866,7 @@ function __PRIVATE_firestoreClientGetDocumentsViaSnapshotListener(e, t, n = {})
|
|
|
17864
17866
|
next: n => {
|
|
17865
17867
|
// Remove query first before passing event to user to avoid
|
|
17866
17868
|
// user actions affecting the now stale query.
|
|
17867
|
-
t.enqueueAndForget((() => __PRIVATE_eventManagerUnlisten(e, o))), n.fromCache && "server" === r.source ? i.reject(new FirestoreError(
|
|
17869
|
+
t.enqueueAndForget((() => __PRIVATE_eventManagerUnlisten(e, o))), n.fromCache && "server" === r.source ? i.reject(new FirestoreError(C.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);
|
|
17868
17870
|
},
|
|
17869
17871
|
error: e => i.reject(e)
|
|
17870
17872
|
}), o = new __PRIVATE_QueryListener(n, s, {
|
|
@@ -18102,7 +18104,7 @@ function __PRIVATE_cloneLongPollingOptions(e) {
|
|
|
18102
18104
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
18103
18105
|
* See the License for the specific language governing permissions and
|
|
18104
18106
|
* limitations under the License.
|
|
18105
|
-
*/ const
|
|
18107
|
+
*/ const be = new Map;
|
|
18106
18108
|
|
|
18107
18109
|
/**
|
|
18108
18110
|
* An instance map that ensures only one Datastore exists per Firestore
|
|
@@ -18125,28 +18127,28 @@ function __PRIVATE_cloneLongPollingOptions(e) {
|
|
|
18125
18127
|
* limitations under the License.
|
|
18126
18128
|
*/
|
|
18127
18129
|
function __PRIVATE_validateNonEmptyArgument(e, t, n) {
|
|
18128
|
-
if (!n) throw new FirestoreError(
|
|
18130
|
+
if (!n) throw new FirestoreError(C.INVALID_ARGUMENT, `Function ${e}() cannot be called with an empty ${t}.`);
|
|
18129
18131
|
}
|
|
18130
18132
|
|
|
18131
18133
|
/**
|
|
18132
18134
|
* Validates that two boolean options are not set at the same time.
|
|
18133
18135
|
* @internal
|
|
18134
18136
|
*/ function __PRIVATE_validateIsNotUsedTogether(e, t, n, r) {
|
|
18135
|
-
if (!0 === t && !0 === r) throw new FirestoreError(
|
|
18137
|
+
if (!0 === t && !0 === r) throw new FirestoreError(C.INVALID_ARGUMENT, `${e} and ${n} cannot be used together.`);
|
|
18136
18138
|
}
|
|
18137
18139
|
|
|
18138
18140
|
/**
|
|
18139
18141
|
* Validates that `path` refers to a document (indicated by the fact it contains
|
|
18140
18142
|
* an even numbers of segments).
|
|
18141
18143
|
*/ function __PRIVATE_validateDocumentPath(e) {
|
|
18142
|
-
if (!DocumentKey.isDocumentKey(e)) throw new FirestoreError(
|
|
18144
|
+
if (!DocumentKey.isDocumentKey(e)) throw new FirestoreError(C.INVALID_ARGUMENT, `Invalid document reference. Document references must have an even number of segments, but ${e} has ${e.length}.`);
|
|
18143
18145
|
}
|
|
18144
18146
|
|
|
18145
18147
|
/**
|
|
18146
18148
|
* Validates that `path` refers to a collection (indicated by the fact it
|
|
18147
18149
|
* contains an odd numbers of segments).
|
|
18148
18150
|
*/ function __PRIVATE_validateCollectionPath(e) {
|
|
18149
|
-
if (DocumentKey.isDocumentKey(e)) throw new FirestoreError(
|
|
18151
|
+
if (DocumentKey.isDocumentKey(e)) throw new FirestoreError(C.INVALID_ARGUMENT, `Invalid collection reference. Collection references must have an odd number of segments, but ${e} has ${e.length}.`);
|
|
18150
18152
|
}
|
|
18151
18153
|
|
|
18152
18154
|
/**
|
|
@@ -18190,17 +18192,17 @@ t) {
|
|
|
18190
18192
|
// Unwrap Compat types
|
|
18191
18193
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
18192
18194
|
e = e._delegate), !(e instanceof t)) {
|
|
18193
|
-
if (t.name === e.constructor.name) throw new FirestoreError(
|
|
18195
|
+
if (t.name === e.constructor.name) throw new FirestoreError(C.INVALID_ARGUMENT, "Type does not match the expected instance. Did you pass a reference from a different Firestore SDK?");
|
|
18194
18196
|
{
|
|
18195
18197
|
const n = __PRIVATE_valueDescription(e);
|
|
18196
|
-
throw new FirestoreError(
|
|
18198
|
+
throw new FirestoreError(C.INVALID_ARGUMENT, `Expected type '${t.name}', but it was: ${n}`);
|
|
18197
18199
|
}
|
|
18198
18200
|
}
|
|
18199
18201
|
return e;
|
|
18200
18202
|
}
|
|
18201
18203
|
|
|
18202
18204
|
function __PRIVATE_validatePositiveNumber(e, t) {
|
|
18203
|
-
if (t <= 0) throw new FirestoreError(
|
|
18205
|
+
if (t <= 0) throw new FirestoreError(C.INVALID_ARGUMENT, `Function ${e}() requires a positive number, but it was: ${t}.`);
|
|
18204
18206
|
}
|
|
18205
18207
|
|
|
18206
18208
|
/**
|
|
@@ -18229,12 +18231,12 @@ class FirestoreSettingsImpl {
|
|
|
18229
18231
|
constructor(e) {
|
|
18230
18232
|
var t, n;
|
|
18231
18233
|
if (void 0 === e.host) {
|
|
18232
|
-
if (void 0 !== e.ssl) throw new FirestoreError(
|
|
18234
|
+
if (void 0 !== e.ssl) throw new FirestoreError(C.INVALID_ARGUMENT, "Can't provide ssl option if host option is not set");
|
|
18233
18235
|
this.host = "firestore.googleapis.com", this.ssl = true;
|
|
18234
18236
|
} else this.host = e.host, this.ssl = null === (t = e.ssl) || void 0 === t || t;
|
|
18235
18237
|
if (this.credentials = e.credentials, this.ignoreUndefinedProperties = !!e.ignoreUndefinedProperties,
|
|
18236
18238
|
this.localCache = e.localCache, void 0 === e.cacheSizeBytes) this.cacheSizeBytes = 41943040; else {
|
|
18237
|
-
if (-1 !== e.cacheSizeBytes && e.cacheSizeBytes < 1048576) throw new FirestoreError(
|
|
18239
|
+
if (-1 !== e.cacheSizeBytes && e.cacheSizeBytes < 1048576) throw new FirestoreError(C.INVALID_ARGUMENT, "cacheSizeBytes must be at least 1048576");
|
|
18238
18240
|
this.cacheSizeBytes = e.cacheSizeBytes;
|
|
18239
18241
|
}
|
|
18240
18242
|
__PRIVATE_validateIsNotUsedTogether("experimentalForceLongPolling", e.experimentalForceLongPolling, "experimentalAutoDetectLongPolling", e.experimentalAutoDetectLongPolling),
|
|
@@ -18246,9 +18248,9 @@ class FirestoreSettingsImpl {
|
|
|
18246
18248
|
this.experimentalLongPollingOptions = __PRIVATE_cloneLongPollingOptions(null !== (n = e.experimentalLongPollingOptions) && void 0 !== n ? n : {}),
|
|
18247
18249
|
function __PRIVATE_validateLongPollingOptions(e) {
|
|
18248
18250
|
if (void 0 !== e.timeoutSeconds) {
|
|
18249
|
-
if (isNaN(e.timeoutSeconds)) throw new FirestoreError(
|
|
18250
|
-
if (e.timeoutSeconds < 5) throw new FirestoreError(
|
|
18251
|
-
if (e.timeoutSeconds > 30) throw new FirestoreError(
|
|
18251
|
+
if (isNaN(e.timeoutSeconds)) throw new FirestoreError(C.INVALID_ARGUMENT, `invalid long polling timeout: ${e.timeoutSeconds} (must not be NaN)`);
|
|
18252
|
+
if (e.timeoutSeconds < 5) throw new FirestoreError(C.INVALID_ARGUMENT, `invalid long polling timeout: ${e.timeoutSeconds} (minimum allowed value is 5)`);
|
|
18253
|
+
if (e.timeoutSeconds > 30) throw new FirestoreError(C.INVALID_ARGUMENT, `invalid long polling timeout: ${e.timeoutSeconds} (maximum allowed value is 30)`);
|
|
18252
18254
|
}
|
|
18253
18255
|
}
|
|
18254
18256
|
/**
|
|
@@ -18295,7 +18297,7 @@ class Firestore$1 {
|
|
|
18295
18297
|
* The {@link @firebase/app#FirebaseApp} associated with this `Firestore` service
|
|
18296
18298
|
* instance.
|
|
18297
18299
|
*/ get app() {
|
|
18298
|
-
if (!this._app) throw new FirestoreError(
|
|
18300
|
+
if (!this._app) throw new FirestoreError(C.FAILED_PRECONDITION, "Firestore was not initialized using the Firebase SDK. 'app' is not available");
|
|
18299
18301
|
return this._app;
|
|
18300
18302
|
}
|
|
18301
18303
|
get _initialized() {
|
|
@@ -18305,7 +18307,7 @@ class Firestore$1 {
|
|
|
18305
18307
|
return void 0 !== this._terminateTask;
|
|
18306
18308
|
}
|
|
18307
18309
|
_setSettings(e) {
|
|
18308
|
-
if (this._settingsFrozen) throw new FirestoreError(
|
|
18310
|
+
if (this._settingsFrozen) throw new FirestoreError(C.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.");
|
|
18309
18311
|
this._settings = new FirestoreSettingsImpl(e), void 0 !== e.credentials && (this._authCredentials = function __PRIVATE_makeAuthCredentialsProvider(e) {
|
|
18310
18312
|
if (!e) return new __PRIVATE_EmptyAuthCredentialsProvider;
|
|
18311
18313
|
switch (e.type) {
|
|
@@ -18316,7 +18318,7 @@ class Firestore$1 {
|
|
|
18316
18318
|
return e.client;
|
|
18317
18319
|
|
|
18318
18320
|
default:
|
|
18319
|
-
throw new FirestoreError(
|
|
18321
|
+
throw new FirestoreError(C.INVALID_ARGUMENT, "makeAuthCredentialsProvider failed due to invalid credential type");
|
|
18320
18322
|
}
|
|
18321
18323
|
}(e.credentials));
|
|
18322
18324
|
}
|
|
@@ -18348,8 +18350,8 @@ class Firestore$1 {
|
|
|
18348
18350
|
* when the `Firestore` instance is terminated.
|
|
18349
18351
|
*/
|
|
18350
18352
|
return function __PRIVATE_removeComponents(e) {
|
|
18351
|
-
const t =
|
|
18352
|
-
t && (__PRIVATE_logDebug("ComponentProvider", "Removing Datastore"),
|
|
18353
|
+
const t = be.get(e);
|
|
18354
|
+
t && (__PRIVATE_logDebug("ComponentProvider", "Removing Datastore"), be.delete(e),
|
|
18353
18355
|
t.terminate());
|
|
18354
18356
|
}(this), Promise.resolve();
|
|
18355
18357
|
}
|
|
@@ -18381,7 +18383,7 @@ class Firestore$1 {
|
|
|
18381
18383
|
// invalid field "uid" and missing field "sub" / "user_id".)
|
|
18382
18384
|
t = I(r.mockUserToken, null === (i = e._app) || void 0 === i ? void 0 : i.options.projectId);
|
|
18383
18385
|
const s = r.mockUserToken.sub || r.mockUserToken.user_id;
|
|
18384
|
-
if (!s) throw new FirestoreError(
|
|
18386
|
+
if (!s) throw new FirestoreError(C.INVALID_ARGUMENT, "mockUserToken must contain 'sub' or 'user_id' field!");
|
|
18385
18387
|
n = new User(s);
|
|
18386
18388
|
}
|
|
18387
18389
|
e._authCredentials = new __PRIVATE_EmulatorAuthCredentialsProvider(new __PRIVATE_OAuthToken(t, n));
|
|
@@ -18501,7 +18503,7 @@ function collection(e, t, ...n) {
|
|
|
18501
18503
|
return __PRIVATE_validateCollectionPath(r), new CollectionReference(e, /* converter= */ null, r);
|
|
18502
18504
|
}
|
|
18503
18505
|
{
|
|
18504
|
-
if (!(e instanceof DocumentReference || e instanceof CollectionReference)) throw new FirestoreError(
|
|
18506
|
+
if (!(e instanceof DocumentReference || e instanceof CollectionReference)) throw new FirestoreError(C.INVALID_ARGUMENT, "Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");
|
|
18505
18507
|
const r = e._path.child(ResourcePath.fromString(t, ...n));
|
|
18506
18508
|
return __PRIVATE_validateCollectionPath(r), new CollectionReference(e.firestore,
|
|
18507
18509
|
/* converter= */ null, r);
|
|
@@ -18522,7 +18524,7 @@ function collection(e, t, ...n) {
|
|
|
18522
18524
|
* @returns The created `Query`.
|
|
18523
18525
|
*/ function collectionGroup(e, t) {
|
|
18524
18526
|
if (e = __PRIVATE_cast(e, Firestore$1), __PRIVATE_validateNonEmptyArgument("collectionGroup", "collection id", t),
|
|
18525
|
-
t.indexOf("/") >= 0) throw new FirestoreError(
|
|
18527
|
+
t.indexOf("/") >= 0) throw new FirestoreError(C.INVALID_ARGUMENT, `Invalid collection ID '${t}' passed to function collectionGroup(). Collection IDs must not contain '/'.`);
|
|
18526
18528
|
return new Query(e,
|
|
18527
18529
|
/* converter= */ null, function __PRIVATE_newQueryForCollectionGroup(e) {
|
|
18528
18530
|
return new __PRIVATE_QueryImpl(ResourcePath.emptyPath(), e);
|
|
@@ -18540,7 +18542,7 @@ function doc(e, t, ...n) {
|
|
|
18540
18542
|
/* converter= */ null, new DocumentKey(r));
|
|
18541
18543
|
}
|
|
18542
18544
|
{
|
|
18543
|
-
if (!(e instanceof DocumentReference || e instanceof CollectionReference)) throw new FirestoreError(
|
|
18545
|
+
if (!(e instanceof DocumentReference || e instanceof CollectionReference)) throw new FirestoreError(C.INVALID_ARGUMENT, "Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");
|
|
18544
18546
|
const r = e._path.child(ResourcePath.fromString(t, ...n));
|
|
18545
18547
|
return __PRIVATE_validateDocumentPath(r), new DocumentReference(e.firestore, e instanceof CollectionReference ? e.converter : null, new DocumentKey(r));
|
|
18546
18548
|
}
|
|
@@ -18901,7 +18903,7 @@ class LoadBundleTask {
|
|
|
18901
18903
|
* Constant used to indicate the LRU garbage collection should be disabled.
|
|
18902
18904
|
* Set this value as the `cacheSizeBytes` on the settings passed to the
|
|
18903
18905
|
* {@link Firestore} instance.
|
|
18904
|
-
*/ const
|
|
18906
|
+
*/ const De = -1;
|
|
18905
18907
|
|
|
18906
18908
|
/**
|
|
18907
18909
|
* The Cloud Firestore service interface.
|
|
@@ -18945,10 +18947,10 @@ class LoadBundleTask {
|
|
|
18945
18947
|
identifier: n
|
|
18946
18948
|
}), i = r.getOptions(n);
|
|
18947
18949
|
if (E(i, t)) return e;
|
|
18948
|
-
throw new FirestoreError(
|
|
18950
|
+
throw new FirestoreError(C.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.");
|
|
18949
18951
|
}
|
|
18950
|
-
if (void 0 !== t.cacheSizeBytes && void 0 !== t.localCache) throw new FirestoreError(
|
|
18951
|
-
if (void 0 !== t.cacheSizeBytes && -1 !== t.cacheSizeBytes && t.cacheSizeBytes < 1048576) throw new FirestoreError(
|
|
18952
|
+
if (void 0 !== t.cacheSizeBytes && void 0 !== t.localCache) throw new FirestoreError(C.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");
|
|
18953
|
+
if (void 0 !== t.cacheSizeBytes && -1 !== t.cacheSizeBytes && t.cacheSizeBytes < 1048576) throw new FirestoreError(C.INVALID_ARGUMENT, "cacheSizeBytes must be at least 1048576");
|
|
18952
18954
|
return r.initialize({
|
|
18953
18955
|
options: t,
|
|
18954
18956
|
instanceIdentifier: n
|
|
@@ -19017,7 +19019,7 @@ function __PRIVATE_configureFirestore(e) {
|
|
|
19017
19019
|
*/ function enableIndexedDbPersistence(e, t) {
|
|
19018
19020
|
__PRIVATE_verifyNotInitialized(e = __PRIVATE_cast(e, Firestore));
|
|
19019
19021
|
const n = ensureFirestoreConfigured(e);
|
|
19020
|
-
if (n._uninitializedComponentsProvider) throw new FirestoreError(
|
|
19022
|
+
if (n._uninitializedComponentsProvider) throw new FirestoreError(C.FAILED_PRECONDITION, "SDK cache is already specified.");
|
|
19021
19023
|
__PRIVATE_logWarn("enableIndexedDbPersistence() will be deprecated in the future, you can use `FirestoreSettings.cache` instead.");
|
|
19022
19024
|
const r = e._freezeSettings(), i = new OnlineComponentProvider;
|
|
19023
19025
|
return __PRIVATE_setPersistenceProviders(n, i, new __PRIVATE_IndexedDbOfflineComponentProvider(i, r.cacheSizeBytes, null == t ? void 0 : t.forceOwnership));
|
|
@@ -19051,7 +19053,7 @@ function __PRIVATE_configureFirestore(e) {
|
|
|
19051
19053
|
*/ function enableMultiTabIndexedDbPersistence(e) {
|
|
19052
19054
|
__PRIVATE_verifyNotInitialized(e = __PRIVATE_cast(e, Firestore));
|
|
19053
19055
|
const t = ensureFirestoreConfigured(e);
|
|
19054
|
-
if (t._uninitializedComponentsProvider) throw new FirestoreError(
|
|
19056
|
+
if (t._uninitializedComponentsProvider) throw new FirestoreError(C.FAILED_PRECONDITION, "SDK cache is already specified.");
|
|
19055
19057
|
__PRIVATE_logWarn("enableMultiTabIndexedDbPersistence() will be deprecated in the future, you can use `FirestoreSettings.cache` instead.");
|
|
19056
19058
|
const n = e._freezeSettings(), r = new OnlineComponentProvider;
|
|
19057
19059
|
return __PRIVATE_setPersistenceProviders(t, r, new __PRIVATE_MultiTabOfflineComponentProvider(r, n.cacheSizeBytes));
|
|
@@ -19099,7 +19101,7 @@ function __PRIVATE_configureFirestore(e) {
|
|
|
19099
19101
|
* @returns A `Promise` that is resolved when the persistent storage is
|
|
19100
19102
|
* cleared. Otherwise, the promise is rejected with an error.
|
|
19101
19103
|
*/ function clearIndexedDbPersistence(e) {
|
|
19102
|
-
if (e._initialized && !e._terminated) throw new FirestoreError(
|
|
19104
|
+
if (e._initialized && !e._terminated) throw new FirestoreError(C.FAILED_PRECONDITION, "Persistence can only be cleared before a Firestore instance is initialized or after it is terminated.");
|
|
19103
19105
|
const t = new __PRIVATE_Deferred;
|
|
19104
19106
|
return e._queue.enqueueAndForgetEvenWhileRestricted((async () => {
|
|
19105
19107
|
try {
|
|
@@ -19213,7 +19215,7 @@ function __PRIVATE_configureFirestore(e) {
|
|
|
19213
19215
|
}
|
|
19214
19216
|
|
|
19215
19217
|
function __PRIVATE_verifyNotInitialized(e) {
|
|
19216
|
-
if (e._initialized || e._terminated) throw new FirestoreError(
|
|
19218
|
+
if (e._initialized || e._terminated) throw new FirestoreError(C.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.");
|
|
19217
19219
|
}
|
|
19218
19220
|
|
|
19219
19221
|
/**
|
|
@@ -19322,7 +19324,7 @@ class AggregateField {
|
|
|
19322
19324
|
try {
|
|
19323
19325
|
return new Bytes(ByteString.fromBase64String(e));
|
|
19324
19326
|
} catch (e) {
|
|
19325
|
-
throw new FirestoreError(
|
|
19327
|
+
throw new FirestoreError(C.INVALID_ARGUMENT, "Failed to construct data from Base64 string: " + e);
|
|
19326
19328
|
}
|
|
19327
19329
|
}
|
|
19328
19330
|
/**
|
|
@@ -19394,7 +19396,7 @@ class AggregateField {
|
|
|
19394
19396
|
* @param fieldNames - A list of field names.
|
|
19395
19397
|
*/
|
|
19396
19398
|
constructor(...e) {
|
|
19397
|
-
for (let t = 0; t < e.length; ++t) if (0 === e[t].length) throw new FirestoreError(
|
|
19399
|
+
for (let t = 0; t < e.length; ++t) if (0 === e[t].length) throw new FirestoreError(C.INVALID_ARGUMENT, "Invalid field name at argument $(i + 1). Field names must not be empty.");
|
|
19398
19400
|
this._internalPath = new FieldPath$1(e);
|
|
19399
19401
|
}
|
|
19400
19402
|
/**
|
|
@@ -19473,8 +19475,8 @@ class AggregateField {
|
|
|
19473
19475
|
* @param longitude - The longitude as number between -180 and 180.
|
|
19474
19476
|
*/
|
|
19475
19477
|
constructor(e, t) {
|
|
19476
|
-
if (!isFinite(e) || e < -90 || e > 90) throw new FirestoreError(
|
|
19477
|
-
if (!isFinite(t) || t < -180 || t > 180) throw new FirestoreError(
|
|
19478
|
+
if (!isFinite(e) || e < -90 || e > 90) throw new FirestoreError(C.INVALID_ARGUMENT, "Latitude must be a number between -90 and 90, but was: " + e);
|
|
19479
|
+
if (!isFinite(t) || t < -180 || t > 180) throw new FirestoreError(C.INVALID_ARGUMENT, "Longitude must be a number between -180 and 180, but was: " + t);
|
|
19478
19480
|
this._lat = e, this._long = t;
|
|
19479
19481
|
}
|
|
19480
19482
|
/**
|
|
@@ -19570,7 +19572,7 @@ class AggregateField {
|
|
|
19570
19572
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
19571
19573
|
* See the License for the specific language governing permissions and
|
|
19572
19574
|
* limitations under the License.
|
|
19573
|
-
*/ const
|
|
19575
|
+
*/ const ve = /^__.*__$/;
|
|
19574
19576
|
|
|
19575
19577
|
/** The result of parsing document data (e.g. for a setData call). */ class ParsedSetData {
|
|
19576
19578
|
constructor(e, t, n) {
|
|
@@ -19681,7 +19683,7 @@ function __PRIVATE_isWrite(e) {
|
|
|
19681
19683
|
}
|
|
19682
19684
|
vu(e) {
|
|
19683
19685
|
if (0 === e.length) throw this.Mu("Document fields must not be empty");
|
|
19684
|
-
if (__PRIVATE_isWrite(this.wu) &&
|
|
19686
|
+
if (__PRIVATE_isWrite(this.wu) && ve.test(e)) throw this.Mu('Document fields cannot begin and end with "__"');
|
|
19685
19687
|
}
|
|
19686
19688
|
}
|
|
19687
19689
|
|
|
@@ -19718,7 +19720,7 @@ function __PRIVATE_newUserDataReader(e) {
|
|
|
19718
19720
|
const e = [];
|
|
19719
19721
|
for (const r of s.mergeFields) {
|
|
19720
19722
|
const i = __PRIVATE_fieldPathFromArgument$1(t, r, n);
|
|
19721
|
-
if (!o.contains(i)) throw new FirestoreError(
|
|
19723
|
+
if (!o.contains(i)) throw new FirestoreError(C.INVALID_ARGUMENT, `Field '${i}' is specified in your field mask but missing from your input data.`);
|
|
19722
19724
|
__PRIVATE_fieldMaskContains(e, i) || e.push(i);
|
|
19723
19725
|
}
|
|
19724
19726
|
a = new FieldMask(e), u = o.fieldTransforms.filter((e => a.covers(e.field)));
|
|
@@ -19835,7 +19837,7 @@ class __PRIVATE_NumericIncrementFieldValueImpl extends FieldValue {
|
|
|
19835
19837
|
|
|
19836
19838
|
/** Parse update data from a list of field/value arguments. */ function __PRIVATE_parseUpdateVarargs(e, t, n, r, i, s) {
|
|
19837
19839
|
const o = e.Nu(1 /* UserDataSource.Update */ , t, n), _ = [ __PRIVATE_fieldPathFromArgument$1(t, r, n) ], a = [ i ];
|
|
19838
|
-
if (s.length % 2 != 0) throw new FirestoreError(
|
|
19840
|
+
if (s.length % 2 != 0) throw new FirestoreError(C.INVALID_ARGUMENT, `Function ${t}() needs to be called with an even number of arguments that alternate between field names and values.`);
|
|
19839
19841
|
for (let e = 0; e < s.length; e += 2) _.push(__PRIVATE_fieldPathFromArgument$1(t, s[e])),
|
|
19840
19842
|
a.push(s[e + 1]);
|
|
19841
19843
|
const u = [], c = ObjectValue.empty();
|
|
@@ -20059,7 +20061,7 @@ function __PRIVATE_validatePlainObject(e, t, n) {
|
|
|
20059
20061
|
|
|
20060
20062
|
/**
|
|
20061
20063
|
* Matches any characters in a field path string that are reserved.
|
|
20062
|
-
*/ const
|
|
20064
|
+
*/ const Ce = new RegExp("[~\\*/\\[\\]]");
|
|
20063
20065
|
|
|
20064
20066
|
/**
|
|
20065
20067
|
* Wraps fromDotSeparatedString with an error message about the method that
|
|
@@ -20070,7 +20072,7 @@ function __PRIVATE_validatePlainObject(e, t, n) {
|
|
|
20070
20072
|
* @param targetDoc - The document against which the field path will be
|
|
20071
20073
|
* evaluated.
|
|
20072
20074
|
*/ function __PRIVATE_fieldPathFromDotSeparatedString(e, t, n) {
|
|
20073
|
-
if (t.search(
|
|
20075
|
+
if (t.search(Ce) >= 0) throw __PRIVATE_createError(`Invalid field path (${t}). Paths must not contain '~', '*', '/', '[', or ']'`, e,
|
|
20074
20076
|
/* hasConverter= */ !1,
|
|
20075
20077
|
/* path= */ void 0, n);
|
|
20076
20078
|
try {
|
|
@@ -20088,7 +20090,7 @@ function __PRIVATE_createError(e, t, n, r, i) {
|
|
|
20088
20090
|
n && (_ += " (via `toFirestore()`)"), _ += ". ";
|
|
20089
20091
|
let a = "";
|
|
20090
20092
|
return (s || o) && (a += " (found", s && (a += ` in field ${r}`), o && (a += ` in document ${i}`),
|
|
20091
|
-
a += ")"), new FirestoreError(
|
|
20093
|
+
a += ")"), new FirestoreError(C.INVALID_ARGUMENT, _ + e + a);
|
|
20092
20094
|
}
|
|
20093
20095
|
|
|
20094
20096
|
/** Checks `haystack` if FieldPath `needle` is present. Runs in O(n). */ function __PRIVATE_fieldMaskContains(e, t) {
|
|
@@ -20225,7 +20227,7 @@ function __PRIVATE_createError(e, t, n, r, i) {
|
|
|
20225
20227
|
* See the License for the specific language governing permissions and
|
|
20226
20228
|
* limitations under the License.
|
|
20227
20229
|
*/ function __PRIVATE_validateHasExplicitOrderByForLimitToLast(e) {
|
|
20228
|
-
if ("L" /* LimitType.Last */ === e.limitType && 0 === e.explicitOrderBy.length) throw new FirestoreError(
|
|
20230
|
+
if ("L" /* LimitType.Last */ === e.limitType && 0 === e.explicitOrderBy.length) throw new FirestoreError(C.UNIMPLEMENTED, "limitToLast() queries require specifying at least one orderBy() clause");
|
|
20229
20231
|
}
|
|
20230
20232
|
|
|
20231
20233
|
/**
|
|
@@ -20246,7 +20248,7 @@ function query(e, t, ...n) {
|
|
|
20246
20248
|
let r = [];
|
|
20247
20249
|
t instanceof AppliableConstraint && r.push(t), r = r.concat(n), function __PRIVATE_validateQueryConstraintArray(e) {
|
|
20248
20250
|
const t = e.filter((e => e instanceof QueryCompositeFilterConstraint)).length, n = e.filter((e => e instanceof QueryFieldFilterConstraint)).length;
|
|
20249
|
-
if (t > 1 || t > 0 && n > 0) throw new FirestoreError(
|
|
20251
|
+
if (t > 1 || t > 0 && n > 0) throw new FirestoreError(C.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(...)))`.");
|
|
20250
20252
|
}
|
|
20251
20253
|
/**
|
|
20252
20254
|
* @license
|
|
@@ -20300,7 +20302,7 @@ function query(e, t, ...n) {
|
|
|
20300
20302
|
const t = __PRIVATE_newUserDataReader(e.firestore), n = function __PRIVATE_newQueryFilter(e, t, n, r, i, s, o) {
|
|
20301
20303
|
let _;
|
|
20302
20304
|
if (i.isKeyField()) {
|
|
20303
|
-
if ("array-contains" /* Operator.ARRAY_CONTAINS */ === s || "array-contains-any" /* Operator.ARRAY_CONTAINS_ANY */ === s) throw new FirestoreError(
|
|
20305
|
+
if ("array-contains" /* Operator.ARRAY_CONTAINS */ === s || "array-contains-any" /* Operator.ARRAY_CONTAINS_ANY */ === s) throw new FirestoreError(C.INVALID_ARGUMENT, `Invalid Query. You can't perform '${s}' queries on documentId().`);
|
|
20304
20306
|
if ("in" /* Operator.IN */ === s || "not-in" /* Operator.NOT_IN */ === s) {
|
|
20305
20307
|
__PRIVATE_validateDisjunctiveFilterElements(o, s);
|
|
20306
20308
|
const t = [];
|
|
@@ -20427,8 +20429,8 @@ function query(e, t, ...n) {
|
|
|
20427
20429
|
}
|
|
20428
20430
|
_apply(e) {
|
|
20429
20431
|
const t = function __PRIVATE_newQueryOrderBy(e, t, n) {
|
|
20430
|
-
if (null !== e.startAt) throw new FirestoreError(
|
|
20431
|
-
if (null !== e.endAt) throw new FirestoreError(
|
|
20432
|
+
if (null !== e.startAt) throw new FirestoreError(C.INVALID_ARGUMENT, "Invalid query. You must not call startAt() or startAfter() before calling orderBy().");
|
|
20433
|
+
if (null !== e.endAt) throw new FirestoreError(C.INVALID_ARGUMENT, "Invalid query. You must not call endAt() or endBefore() before calling orderBy().");
|
|
20432
20434
|
return new OrderBy(t, n);
|
|
20433
20435
|
}
|
|
20434
20436
|
/**
|
|
@@ -20586,7 +20588,7 @@ function endAt(...e) {
|
|
|
20586
20588
|
|
|
20587
20589
|
/** Helper function to create a bound from a document or fields */ function __PRIVATE_newQueryBoundFromDocOrFields(e, t, n, r) {
|
|
20588
20590
|
if (n[0] = T(n[0]), n[0] instanceof DocumentSnapshot$1) return function __PRIVATE_newQueryBoundFromDocument(e, t, n, r, i) {
|
|
20589
|
-
if (!r) throw new FirestoreError(
|
|
20591
|
+
if (!r) throw new FirestoreError(C.NOT_FOUND, `Can't use a DocumentSnapshot that doesn't exist for ${n}().`);
|
|
20590
20592
|
const s = [];
|
|
20591
20593
|
// Because people expect to continue/end a query at the exact document
|
|
20592
20594
|
// provided, we need to use the implicit sort order rather than the explicit
|
|
@@ -20597,10 +20599,10 @@ function endAt(...e) {
|
|
|
20597
20599
|
// results.
|
|
20598
20600
|
for (const n of __PRIVATE_queryNormalizedOrderBy(e)) if (n.field.isKeyField()) s.push(__PRIVATE_refValue(t, r.key)); else {
|
|
20599
20601
|
const e = r.data.field(n.field);
|
|
20600
|
-
if (__PRIVATE_isServerTimestamp(e)) throw new FirestoreError(
|
|
20602
|
+
if (__PRIVATE_isServerTimestamp(e)) throw new FirestoreError(C.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.)');
|
|
20601
20603
|
if (null === e) {
|
|
20602
20604
|
const e = n.field.canonicalString();
|
|
20603
|
-
throw new FirestoreError(
|
|
20605
|
+
throw new FirestoreError(C.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.`);
|
|
20604
20606
|
}
|
|
20605
20607
|
s.push(e);
|
|
20606
20608
|
}
|
|
@@ -20614,15 +20616,15 @@ function endAt(...e) {
|
|
|
20614
20616
|
return function __PRIVATE_newQueryBoundFromFields(e, t, n, r, i, s) {
|
|
20615
20617
|
// Use explicit order by's because it has to match the query the user made
|
|
20616
20618
|
const o = e.explicitOrderBy;
|
|
20617
|
-
if (i.length > o.length) throw new FirestoreError(
|
|
20619
|
+
if (i.length > o.length) throw new FirestoreError(C.INVALID_ARGUMENT, `Too many arguments provided to ${r}(). The number of arguments must be less than or equal to the number of orderBy() clauses`);
|
|
20618
20620
|
const _ = [];
|
|
20619
20621
|
for (let s = 0; s < i.length; s++) {
|
|
20620
20622
|
const a = i[s];
|
|
20621
20623
|
if (o[s].field.isKeyField()) {
|
|
20622
|
-
if ("string" != typeof a) throw new FirestoreError(
|
|
20623
|
-
if (!__PRIVATE_isCollectionGroupQuery(e) && -1 !== a.indexOf("/")) throw new FirestoreError(
|
|
20624
|
+
if ("string" != typeof a) throw new FirestoreError(C.INVALID_ARGUMENT, `Invalid query. Expected a string for document ID in ${r}(), but got a ${typeof a}`);
|
|
20625
|
+
if (!__PRIVATE_isCollectionGroupQuery(e) && -1 !== a.indexOf("/")) throw new FirestoreError(C.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.`);
|
|
20624
20626
|
const n = e.path.child(ResourcePath.fromString(a));
|
|
20625
|
-
if (!DocumentKey.isDocumentKey(n)) throw new FirestoreError(
|
|
20627
|
+
if (!DocumentKey.isDocumentKey(n)) throw new FirestoreError(C.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.`);
|
|
20626
20628
|
const i = new DocumentKey(n);
|
|
20627
20629
|
_.push(__PRIVATE_refValue(t, i));
|
|
20628
20630
|
} else {
|
|
@@ -20642,21 +20644,21 @@ function endAt(...e) {
|
|
|
20642
20644
|
|
|
20643
20645
|
function __PRIVATE_parseDocumentIdValue(e, t, n) {
|
|
20644
20646
|
if ("string" == typeof (n = T(n))) {
|
|
20645
|
-
if ("" === n) throw new FirestoreError(
|
|
20646
|
-
if (!__PRIVATE_isCollectionGroupQuery(t) && -1 !== n.indexOf("/")) throw new FirestoreError(
|
|
20647
|
+
if ("" === n) throw new FirestoreError(C.INVALID_ARGUMENT, "Invalid query. When querying with documentId(), you must provide a valid document ID, but it was an empty string.");
|
|
20648
|
+
if (!__PRIVATE_isCollectionGroupQuery(t) && -1 !== n.indexOf("/")) throw new FirestoreError(C.INVALID_ARGUMENT, `Invalid query. When querying a collection by documentId(), you must provide a plain document ID, but '${n}' contains a '/' character.`);
|
|
20647
20649
|
const r = t.path.child(ResourcePath.fromString(n));
|
|
20648
|
-
if (!DocumentKey.isDocumentKey(r)) throw new FirestoreError(
|
|
20650
|
+
if (!DocumentKey.isDocumentKey(r)) throw new FirestoreError(C.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}).`);
|
|
20649
20651
|
return __PRIVATE_refValue(e, new DocumentKey(r));
|
|
20650
20652
|
}
|
|
20651
20653
|
if (n instanceof DocumentReference) return __PRIVATE_refValue(e, n._key);
|
|
20652
|
-
throw new FirestoreError(
|
|
20654
|
+
throw new FirestoreError(C.INVALID_ARGUMENT, `Invalid query. When querying with documentId(), you must provide a valid string or a DocumentReference, but it was: ${__PRIVATE_valueDescription(n)}.`);
|
|
20653
20655
|
}
|
|
20654
20656
|
|
|
20655
20657
|
/**
|
|
20656
20658
|
* Validates that the value passed into a disjunctive filter satisfies all
|
|
20657
20659
|
* array requirements.
|
|
20658
20660
|
*/ function __PRIVATE_validateDisjunctiveFilterElements(e, t) {
|
|
20659
|
-
if (!Array.isArray(e) || 0 === e.length) throw new FirestoreError(
|
|
20661
|
+
if (!Array.isArray(e) || 0 === e.length) throw new FirestoreError(C.INVALID_ARGUMENT, `Invalid Query. A non-empty array is required for '${t.toString()}' filters.`);
|
|
20660
20662
|
}
|
|
20661
20663
|
|
|
20662
20664
|
/**
|
|
@@ -20690,11 +20692,11 @@ function __PRIVATE_parseDocumentIdValue(e, t, n) {
|
|
|
20690
20692
|
}(t.op));
|
|
20691
20693
|
if (null !== n)
|
|
20692
20694
|
// Special case when it's a duplicate op to give a slightly clearer error message.
|
|
20693
|
-
throw n === t.op ? new FirestoreError(
|
|
20695
|
+
throw n === t.op ? new FirestoreError(C.INVALID_ARGUMENT, `Invalid query. You cannot use more than one '${t.op.toString()}' filter.`) : new FirestoreError(C.INVALID_ARGUMENT, `Invalid query. You cannot use '${t.op.toString()}' filters with '${n.toString()}' filters.`);
|
|
20694
20696
|
}
|
|
20695
20697
|
|
|
20696
20698
|
function __PRIVATE_validateQueryFilterConstraint(e, t) {
|
|
20697
|
-
if (!(t instanceof QueryFieldFilterConstraint || t instanceof QueryCompositeFilterConstraint)) throw new FirestoreError(
|
|
20699
|
+
if (!(t instanceof QueryFieldFilterConstraint || t instanceof QueryCompositeFilterConstraint)) throw new FirestoreError(C.INVALID_ARGUMENT, `Function ${e}() requires AppliableConstraints created with a call to 'where(...)', 'or(...)', or 'and(...)'.`);
|
|
20698
20700
|
}
|
|
20699
20701
|
|
|
20700
20702
|
class AbstractUserDataWriter {
|
|
@@ -21076,7 +21078,7 @@ class __PRIVATE_LiteUserDataWriter extends AbstractUserDataWriter {
|
|
|
21076
21078
|
* snapshot events.
|
|
21077
21079
|
*/ docChanges(e = {}) {
|
|
21078
21080
|
const t = !!e.includeMetadataChanges;
|
|
21079
|
-
if (t && this._snapshot.excludesMetadataChanges) throw new FirestoreError(
|
|
21081
|
+
if (t && this._snapshot.excludesMetadataChanges) throw new FirestoreError(C.INVALID_ARGUMENT, "To include metadata changes with your document changes, you must also pass { includeMetadataChanges:true } to onSnapshot().");
|
|
21080
21082
|
return this._cachedChanges && this._cachedChangesIncludeMetadataChanges === t || (this._cachedChanges =
|
|
21081
21083
|
/** Calculates the array of `DocumentChange`s for a given `ViewSnapshot`. */
|
|
21082
21084
|
function __PRIVATE_changesFromSnapshot(e, t) {
|
|
@@ -21616,7 +21618,7 @@ class __PRIVATE_MultiTabManagerImpl {
|
|
|
21616
21618
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
21617
21619
|
* See the License for the specific language governing permissions and
|
|
21618
21620
|
* limitations under the License.
|
|
21619
|
-
*/ const
|
|
21621
|
+
*/ const Fe = {
|
|
21620
21622
|
maxAttempts: 5
|
|
21621
21623
|
};
|
|
21622
21624
|
|
|
@@ -21690,12 +21692,12 @@ class WriteBatch {
|
|
|
21690
21692
|
return this._verifyNotCommitted(), this._committed = !0, this._mutations.length > 0 ? this._commitHandler(this._mutations) : Promise.resolve();
|
|
21691
21693
|
}
|
|
21692
21694
|
_verifyNotCommitted() {
|
|
21693
|
-
if (this._committed) throw new FirestoreError(
|
|
21695
|
+
if (this._committed) throw new FirestoreError(C.FAILED_PRECONDITION, "A write batch can no longer be used after commit() has been called.");
|
|
21694
21696
|
}
|
|
21695
21697
|
}
|
|
21696
21698
|
|
|
21697
21699
|
function __PRIVATE_validateReference(e, t) {
|
|
21698
|
-
if ((e = T(e)).firestore !== t) throw new FirestoreError(
|
|
21700
|
+
if ((e = T(e)).firestore !== t) throw new FirestoreError(C.INVALID_ARGUMENT, "Provided document reference is from a different Firestore instance.");
|
|
21699
21701
|
return e;
|
|
21700
21702
|
}
|
|
21701
21703
|
|
|
@@ -21828,9 +21830,9 @@ class Transaction extends class Transaction$1 {
|
|
|
21828
21830
|
* rejected promise with the corresponding failure error is returned.
|
|
21829
21831
|
*/ function runTransaction(e, t, n) {
|
|
21830
21832
|
e = __PRIVATE_cast(e, Firestore);
|
|
21831
|
-
const r = Object.assign(Object.assign({},
|
|
21833
|
+
const r = Object.assign(Object.assign({}, Fe), n);
|
|
21832
21834
|
!function __PRIVATE_validateTransactionOptions(e) {
|
|
21833
|
-
if (e.maxAttempts < 1) throw new FirestoreError(
|
|
21835
|
+
if (e.maxAttempts < 1) throw new FirestoreError(C.INVALID_ARGUMENT, "Max attempts must be at least 1");
|
|
21834
21836
|
}(r);
|
|
21835
21837
|
return function __PRIVATE_firestoreClientTransaction(e, t, n) {
|
|
21836
21838
|
const r = new __PRIVATE_Deferred;
|
|
@@ -21994,7 +21996,7 @@ class Transaction extends class Transaction$1 {
|
|
|
21994
21996
|
try {
|
|
21995
21997
|
return JSON.parse(e);
|
|
21996
21998
|
} catch (e) {
|
|
21997
|
-
throw new FirestoreError(
|
|
21999
|
+
throw new FirestoreError(C.INVALID_ARGUMENT, "Failed to parse JSON: " + (null == e ? void 0 : e.message));
|
|
21998
22000
|
}
|
|
21999
22001
|
}(e) : e, n = [];
|
|
22000
22002
|
if (Array.isArray(t.indexes)) for (const e of t.indexes) {
|
|
@@ -22011,7 +22013,7 @@ class Transaction extends class Transaction$1 {
|
|
|
22011
22013
|
}
|
|
22012
22014
|
|
|
22013
22015
|
function __PRIVATE_tryGetString(e, t) {
|
|
22014
|
-
if ("string" != typeof e[t]) throw new FirestoreError(
|
|
22016
|
+
if ("string" != typeof e[t]) throw new FirestoreError(C.INVALID_ARGUMENT, "Missing string value for: " + t);
|
|
22015
22017
|
return e[t];
|
|
22016
22018
|
}
|
|
22017
22019
|
|
|
@@ -22054,12 +22056,12 @@ function __PRIVATE_tryGetString(e, t) {
|
|
|
22054
22056
|
*/ function getPersistentCacheIndexManager(e) {
|
|
22055
22057
|
var t;
|
|
22056
22058
|
e = __PRIVATE_cast(e, Firestore);
|
|
22057
|
-
const n =
|
|
22059
|
+
const n = Me.get(e);
|
|
22058
22060
|
if (n) return n;
|
|
22059
22061
|
const r = ensureFirestoreConfigured(e);
|
|
22060
22062
|
if ("persistent" !== (null === (t = r._uninitializedComponentsProvider) || void 0 === t ? void 0 : t._offlineKind)) return null;
|
|
22061
22063
|
const i = new PersistentCacheIndexManager(r);
|
|
22062
|
-
return
|
|
22064
|
+
return Me.set(e, i), i;
|
|
22063
22065
|
}
|
|
22064
22066
|
|
|
22065
22067
|
/**
|
|
@@ -22102,7 +22104,7 @@ function __PRIVATE_setPersistentCacheIndexAutoCreationEnabled(e, t) {
|
|
|
22102
22104
|
* Use a `WeakMap` so that the mapping will be automatically dropped when the
|
|
22103
22105
|
* `Firestore` instance is garbage collected. This emulates a private member
|
|
22104
22106
|
* as described in https://goo.gle/454yvug.
|
|
22105
|
-
*/ const
|
|
22107
|
+
*/ const Me = new WeakMap;
|
|
22106
22108
|
|
|
22107
22109
|
/**
|
|
22108
22110
|
* @license
|
|
@@ -22210,10 +22212,10 @@ function _internalQueryToProtoQueryTarget(e) {
|
|
|
22210
22212
|
this.ku = new Map;
|
|
22211
22213
|
}
|
|
22212
22214
|
static get instance() {
|
|
22213
|
-
return
|
|
22214
|
-
if (
|
|
22215
|
-
|
|
22216
|
-
}(
|
|
22215
|
+
return xe || (xe = new __PRIVATE_TestingHooksSpiImpl, function __PRIVATE_setTestingHooksSpi(e) {
|
|
22216
|
+
if (Te) throw new Error("a TestingHooksSpi instance is already set");
|
|
22217
|
+
Te = e;
|
|
22218
|
+
}(xe)), xe;
|
|
22217
22219
|
}
|
|
22218
22220
|
et(e) {
|
|
22219
22221
|
this.ku.forEach((t => t(e)));
|
|
@@ -22224,7 +22226,7 @@ function _internalQueryToProtoQueryTarget(e) {
|
|
|
22224
22226
|
}
|
|
22225
22227
|
}
|
|
22226
22228
|
|
|
22227
|
-
let
|
|
22229
|
+
let xe = null;
|
|
22228
22230
|
|
|
22229
22231
|
/**
|
|
22230
22232
|
* @license
|
|
@@ -22243,19 +22245,19 @@ let Oe = null;
|
|
|
22243
22245
|
* limitations under the License.
|
|
22244
22246
|
*/ !function __PRIVATE_registerFirestore(e, t = !0) {
|
|
22245
22247
|
!function __PRIVATE_setSDKVersion(e) {
|
|
22246
|
-
|
|
22248
|
+
D = e;
|
|
22247
22249
|
}(i), n(new s("firestore", ((e, {instanceIdentifier: n, options: r}) => {
|
|
22248
22250
|
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) {
|
|
22249
|
-
if (!Object.prototype.hasOwnProperty.apply(e.options, [ "projectId" ])) throw new FirestoreError(
|
|
22251
|
+
if (!Object.prototype.hasOwnProperty.apply(e.options, [ "projectId" ])) throw new FirestoreError(C.INVALID_ARGUMENT, '"projectId" not provided in firebase.initializeApp.');
|
|
22250
22252
|
return new DatabaseId(e.options.projectId, t);
|
|
22251
22253
|
}(i, n), i);
|
|
22252
22254
|
return r = Object.assign({
|
|
22253
22255
|
useFetchStreams: t
|
|
22254
22256
|
}, r), s._setSettings(r), s;
|
|
22255
|
-
}), "PUBLIC").setMultipleInstances(!0)), r(
|
|
22257
|
+
}), "PUBLIC").setMultipleInstances(!0)), r(b, "4.7.1-canary.ff0475c41", e),
|
|
22256
22258
|
// BUILD_TARGET will be replaced by values like esm5, esm2017, cjs5, etc during the compilation
|
|
22257
|
-
r(
|
|
22259
|
+
r(b, "4.7.1-canary.ff0475c41", "esm2017");
|
|
22258
22260
|
}("rn", /* useFetchStreams= */ !1);
|
|
22259
22261
|
|
|
22260
|
-
export { AbstractUserDataWriter, AggregateField, AggregateQuerySnapshot, Bytes,
|
|
22262
|
+
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, VectorValue, 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, vector, waitForPendingWrites, where, writeBatch };
|
|
22261
22263
|
//# sourceMappingURL=index.rn.js.map
|