@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.cjs.js
CHANGED
|
@@ -9,7 +9,7 @@ var util = require('@firebase/util');
|
|
|
9
9
|
var bloomBlob = require('@firebase/webchannel-wrapper/bloom-blob');
|
|
10
10
|
var webchannelBlob = require('@firebase/webchannel-wrapper/webchannel-blob');
|
|
11
11
|
|
|
12
|
-
const
|
|
12
|
+
const w = "@firebase/firestore";
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
* @license
|
|
@@ -71,7 +71,7 @@ User.MOCK_USER = new User("mock-user");
|
|
|
71
71
|
* See the License for the specific language governing permissions and
|
|
72
72
|
* limitations under the License.
|
|
73
73
|
*/
|
|
74
|
-
let
|
|
74
|
+
let S = "10.13.1-canary.ff0475c41";
|
|
75
75
|
|
|
76
76
|
/**
|
|
77
77
|
* @license
|
|
@@ -89,11 +89,11 @@ let b = "10.13.1-canary.ca4dbcf3f";
|
|
|
89
89
|
* See the License for the specific language governing permissions and
|
|
90
90
|
* limitations under the License.
|
|
91
91
|
*/
|
|
92
|
-
const
|
|
92
|
+
const b = new logger.Logger("@firebase/firestore");
|
|
93
93
|
|
|
94
94
|
// Helper methods are needed because variables can't be exported as read/write
|
|
95
95
|
function __PRIVATE_getLogLevel() {
|
|
96
|
-
return
|
|
96
|
+
return b.logLevel;
|
|
97
97
|
}
|
|
98
98
|
|
|
99
99
|
/**
|
|
@@ -109,29 +109,29 @@ function __PRIVATE_getLogLevel() {
|
|
|
109
109
|
* <li><code>`silent` to turn off logging.</li>
|
|
110
110
|
* </ul>
|
|
111
111
|
*/ function setLogLevel(e) {
|
|
112
|
-
|
|
112
|
+
b.setLogLevel(e);
|
|
113
113
|
}
|
|
114
114
|
|
|
115
115
|
function __PRIVATE_logDebug(e, ...t) {
|
|
116
|
-
if (
|
|
116
|
+
if (b.logLevel <= logger.LogLevel.DEBUG) {
|
|
117
117
|
const n = t.map(__PRIVATE_argToString);
|
|
118
|
-
|
|
118
|
+
b.debug(`Firestore (${S}): ${e}`, ...n);
|
|
119
119
|
}
|
|
120
120
|
}
|
|
121
121
|
|
|
122
122
|
function __PRIVATE_logError(e, ...t) {
|
|
123
|
-
if (
|
|
123
|
+
if (b.logLevel <= logger.LogLevel.ERROR) {
|
|
124
124
|
const n = t.map(__PRIVATE_argToString);
|
|
125
|
-
|
|
125
|
+
b.error(`Firestore (${S}): ${e}`, ...n);
|
|
126
126
|
}
|
|
127
127
|
}
|
|
128
128
|
|
|
129
129
|
/**
|
|
130
130
|
* @internal
|
|
131
131
|
*/ function __PRIVATE_logWarn(e, ...t) {
|
|
132
|
-
if (
|
|
132
|
+
if (b.logLevel <= logger.LogLevel.WARN) {
|
|
133
133
|
const n = t.map(__PRIVATE_argToString);
|
|
134
|
-
|
|
134
|
+
b.warn(`Firestore (${S}): ${e}`, ...n);
|
|
135
135
|
}
|
|
136
136
|
}
|
|
137
137
|
|
|
@@ -192,7 +192,7 @@ function __PRIVATE_logError(e, ...t) {
|
|
|
192
192
|
*/ function fail(e = "Unexpected state") {
|
|
193
193
|
// Log the failure in addition to throw an exception, just in case the
|
|
194
194
|
// exception is swallowed.
|
|
195
|
-
const t = `FIRESTORE (${
|
|
195
|
+
const t = `FIRESTORE (${S}) INTERNAL ASSERTION FAILED: ` + e;
|
|
196
196
|
// NOTE: We don't use FirestoreError here because these are internal failures
|
|
197
197
|
// that cannot be handled by the user. (Also it would create a circular
|
|
198
198
|
// dependency between the error and assert modules which doesn't work.)
|
|
@@ -245,7 +245,7 @@ t) {
|
|
|
245
245
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
246
246
|
* See the License for the specific language governing permissions and
|
|
247
247
|
* limitations under the License.
|
|
248
|
-
*/ const
|
|
248
|
+
*/ const D = {
|
|
249
249
|
// Causes are copied from:
|
|
250
250
|
// https://github.com/grpc/grpc/blob/bceec94ea4fc5f0085d81235d8e1c06798dc341a/include/grpc%2B%2B/impl/codegen/status_code_enum.h
|
|
251
251
|
/** Not an error; returned on success. */
|
|
@@ -790,11 +790,11 @@ class Timestamp {
|
|
|
790
790
|
* The fractions of a second at nanosecond resolution.*
|
|
791
791
|
*/
|
|
792
792
|
t) {
|
|
793
|
-
if (this.seconds = e, this.nanoseconds = t, t < 0) throw new FirestoreError(
|
|
794
|
-
if (t >= 1e9) throw new FirestoreError(
|
|
795
|
-
if (e < -62135596800) throw new FirestoreError(
|
|
793
|
+
if (this.seconds = e, this.nanoseconds = t, t < 0) throw new FirestoreError(D.INVALID_ARGUMENT, "Timestamp nanoseconds out of range: " + t);
|
|
794
|
+
if (t >= 1e9) throw new FirestoreError(D.INVALID_ARGUMENT, "Timestamp nanoseconds out of range: " + t);
|
|
795
|
+
if (e < -62135596800) throw new FirestoreError(D.INVALID_ARGUMENT, "Timestamp seconds out of range: " + e);
|
|
796
796
|
// This will break in the year 10,000.
|
|
797
|
-
if (e >= 253402300800) throw new FirestoreError(
|
|
797
|
+
if (e >= 253402300800) throw new FirestoreError(D.INVALID_ARGUMENT, "Timestamp seconds out of range: " + e);
|
|
798
798
|
}
|
|
799
799
|
/**
|
|
800
800
|
* Creates a new timestamp with the current date, with millisecond precision.
|
|
@@ -1049,7 +1049,7 @@ class BasePath {
|
|
|
1049
1049
|
// for legacy reasons and should not be used frequently).
|
|
1050
1050
|
const t = [];
|
|
1051
1051
|
for (const n of e) {
|
|
1052
|
-
if (n.indexOf("//") >= 0) throw new FirestoreError(
|
|
1052
|
+
if (n.indexOf("//") >= 0) throw new FirestoreError(D.INVALID_ARGUMENT, `Invalid segment (${n}). Paths must not contain // in them.`);
|
|
1053
1053
|
// Strip leading and trailing slashed.
|
|
1054
1054
|
t.push(...n.split("/").filter((e => e.length > 0)));
|
|
1055
1055
|
}
|
|
@@ -1060,7 +1060,7 @@ class BasePath {
|
|
|
1060
1060
|
}
|
|
1061
1061
|
}
|
|
1062
1062
|
|
|
1063
|
-
const
|
|
1063
|
+
const v = /^[_a-zA-Z][_a-zA-Z0-9]*$/;
|
|
1064
1064
|
|
|
1065
1065
|
/**
|
|
1066
1066
|
* A dot-separated path for navigating sub-objects within a document.
|
|
@@ -1073,7 +1073,7 @@ const C = /^[_a-zA-Z][_a-zA-Z0-9]*$/;
|
|
|
1073
1073
|
* Returns true if the string could be used as a segment in a field path
|
|
1074
1074
|
* without escaping.
|
|
1075
1075
|
*/ static isValidIdentifier(e) {
|
|
1076
|
-
return
|
|
1076
|
+
return v.test(e);
|
|
1077
1077
|
}
|
|
1078
1078
|
canonicalString() {
|
|
1079
1079
|
return this.toArray().map((e => (e = e.replace(/\\/g, "\\\\").replace(/`/g, "\\`"),
|
|
@@ -1105,21 +1105,21 @@ const C = /^[_a-zA-Z][_a-zA-Z0-9]*$/;
|
|
|
1105
1105
|
const t = [];
|
|
1106
1106
|
let n = "", r = 0;
|
|
1107
1107
|
const __PRIVATE_addCurrentSegment = () => {
|
|
1108
|
-
if (0 === n.length) throw new FirestoreError(
|
|
1108
|
+
if (0 === n.length) throw new FirestoreError(D.INVALID_ARGUMENT, `Invalid field path (${e}). Paths must not be empty, begin with '.', end with '.', or contain '..'`);
|
|
1109
1109
|
t.push(n), n = "";
|
|
1110
1110
|
};
|
|
1111
1111
|
let i = !1;
|
|
1112
1112
|
for (;r < e.length; ) {
|
|
1113
1113
|
const t = e[r];
|
|
1114
1114
|
if ("\\" === t) {
|
|
1115
|
-
if (r + 1 === e.length) throw new FirestoreError(
|
|
1115
|
+
if (r + 1 === e.length) throw new FirestoreError(D.INVALID_ARGUMENT, "Path has trailing escape character: " + e);
|
|
1116
1116
|
const t = e[r + 1];
|
|
1117
|
-
if ("\\" !== t && "." !== t && "`" !== t) throw new FirestoreError(
|
|
1117
|
+
if ("\\" !== t && "." !== t && "`" !== t) throw new FirestoreError(D.INVALID_ARGUMENT, "Path has invalid escape sequence: " + e);
|
|
1118
1118
|
n += t, r += 2;
|
|
1119
1119
|
} else "`" === t ? (i = !i, r++) : "." !== t || i ? (n += t, r++) : (__PRIVATE_addCurrentSegment(),
|
|
1120
1120
|
r++);
|
|
1121
1121
|
}
|
|
1122
|
-
if (__PRIVATE_addCurrentSegment(), i) throw new FirestoreError(
|
|
1122
|
+
if (__PRIVATE_addCurrentSegment(), i) throw new FirestoreError(D.INVALID_ARGUMENT, "Unterminated ` in path: " + e);
|
|
1123
1123
|
return new FieldPath$1(t);
|
|
1124
1124
|
}
|
|
1125
1125
|
static emptyPath() {
|
|
@@ -1371,7 +1371,7 @@ function __PRIVATE_indexOffsetComparator(e, t) {
|
|
|
1371
1371
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1372
1372
|
* See the License for the specific language governing permissions and
|
|
1373
1373
|
* limitations under the License.
|
|
1374
|
-
*/ const
|
|
1374
|
+
*/ const C = "The current tab is not in the required state to perform this operation. It might be necessary to refresh the browser tab.";
|
|
1375
1375
|
|
|
1376
1376
|
/**
|
|
1377
1377
|
* A base class representing a persistence transaction, encapsulating both the
|
|
@@ -1418,7 +1418,7 @@ function __PRIVATE_indexOffsetComparator(e, t) {
|
|
|
1418
1418
|
* @param err - An error returned by a LocalStore operation.
|
|
1419
1419
|
* @returns A Promise that resolves after we recovered, or the original error.
|
|
1420
1420
|
*/ async function __PRIVATE_ignoreIfPrimaryLeaseLoss(e) {
|
|
1421
|
-
if (e.code !==
|
|
1421
|
+
if (e.code !== D.FAILED_PRECONDITION || e.message !== C) throw e;
|
|
1422
1422
|
__PRIVATE_logDebug("LocalStore", "Unexpectedly lost primary lease");
|
|
1423
1423
|
}
|
|
1424
1424
|
|
|
@@ -1723,7 +1723,7 @@ class __PRIVATE_SimpleDbTransaction {
|
|
|
1723
1723
|
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."));
|
|
1724
1724
|
}, r.onerror = t => {
|
|
1725
1725
|
const r = t.target.error;
|
|
1726
|
-
"VersionError" === r.name ? n(new FirestoreError(
|
|
1726
|
+
"VersionError" === r.name ? n(new FirestoreError(D.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(D.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));
|
|
1727
1727
|
}, r.onupgradeneeded = e => {
|
|
1728
1728
|
__PRIVATE_logDebug("SimpleDb", 'Database "' + this.name + '" requires upgrade from version:', e.oldVersion);
|
|
1729
1729
|
const t = e.target.result;
|
|
@@ -1815,7 +1815,7 @@ class __PRIVATE_SimpleDbTransaction {
|
|
|
1815
1815
|
|
|
1816
1816
|
/** An error that wraps exceptions that thrown during IndexedDB execution. */ class __PRIVATE_IndexedDbTransactionError extends FirestoreError {
|
|
1817
1817
|
constructor(e, t) {
|
|
1818
|
-
super(
|
|
1818
|
+
super(D.UNAVAILABLE, `IndexedDB transaction '${e}' failed: ${t}`), this.name = "IndexedDbTransactionError";
|
|
1819
1819
|
}
|
|
1820
1820
|
}
|
|
1821
1821
|
|
|
@@ -1999,7 +1999,7 @@ class __PRIVATE_SimpleDbTransaction {
|
|
|
1999
1999
|
}
|
|
2000
2000
|
|
|
2001
2001
|
// Guard so we only report the error once.
|
|
2002
|
-
let
|
|
2002
|
+
let F = !1;
|
|
2003
2003
|
|
|
2004
2004
|
function __PRIVATE_checkForAndReportiOSError(e) {
|
|
2005
2005
|
const t = __PRIVATE_SimpleDb.S(util.getUA());
|
|
@@ -2008,7 +2008,7 @@ function __PRIVATE_checkForAndReportiOSError(e) {
|
|
|
2008
2008
|
if (e.message.indexOf(t) >= 0) {
|
|
2009
2009
|
// Wrap error in a more descriptive one.
|
|
2010
2010
|
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.`);
|
|
2011
|
-
return
|
|
2011
|
+
return F || (F = !0,
|
|
2012
2012
|
// Throw a global exception outside of this promise chain, for the user to
|
|
2013
2013
|
// potentially catch.
|
|
2014
2014
|
setTimeout((() => {
|
|
@@ -2260,7 +2260,7 @@ function __PRIVATE_encodeResourcePath(e) {
|
|
|
2260
2260
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2261
2261
|
* See the License for the specific language governing permissions and
|
|
2262
2262
|
* limitations under the License.
|
|
2263
|
-
*/ const
|
|
2263
|
+
*/ const M = [ "userId", "batchId" ];
|
|
2264
2264
|
|
|
2265
2265
|
/**
|
|
2266
2266
|
* @license
|
|
@@ -2305,7 +2305,7 @@ function __PRIVATE_newDbDocumentMutationPrefixForPath(e, t) {
|
|
|
2305
2305
|
* there is no useful information to store as the value. The raw (unencoded)
|
|
2306
2306
|
* path cannot be stored because IndexedDb doesn't store prototype
|
|
2307
2307
|
* information.
|
|
2308
|
-
*/ const
|
|
2308
|
+
*/ const x = {}, O = [ "prefixPath", "collectionGroup", "readTime", "documentId" ], N = [ "prefixPath", "collectionGroup", "documentId" ], L = [ "collectionGroup", "readTime", "prefixPath", "documentId" ], B = [ "canonicalId", "targetId" ], k = [ "targetId", "path" ], q = [ "path", "targetId" ], Q = [ "collectionId", "parent" ], K = [ "indexId", "uid" ], $ = [ "uid", "sequenceNumber" ], U = [ "indexId", "uid", "arrayValue", "directionalValue", "orderedDocumentKey", "documentKey" ], W = [ "indexId", "uid", "orderedDocumentKey" ], G = [ "userId", "collectionPath", "documentId" ], z = [ "userId", "collectionPath", "largestBatchId" ], j = [ "userId", "collectionGroup", "largestBatchId" ], H = [ ...[ ...[ ...[ ...[ "mutationQueues", "mutations", "documentMutations", "remoteDocuments", "targets", "owner", "targetGlobal", "targetDocuments" ], "clientMetadata" ], "remoteDocumentGlobal" ], "collectionParents" ], "bundles", "namedQueries" ], J = [ ...H, "documentOverlays" ], Y = [ "mutationQueues", "mutations", "documentMutations", "remoteDocumentsV14", "targets", "owner", "targetGlobal", "targetDocuments", "clientMetadata", "remoteDocumentGlobal", "collectionParents", "bundles", "namedQueries", "documentOverlays" ], Z = Y, X = [ ...Z, "indexConfiguration", "indexState", "indexEntries" ], ee = X, te = [ ...X, "globals" ];
|
|
2309
2309
|
|
|
2310
2310
|
/**
|
|
2311
2311
|
* @license
|
|
@@ -3068,7 +3068,7 @@ function __PRIVATE_isBase64Available() {
|
|
|
3068
3068
|
|
|
3069
3069
|
ByteString.EMPTY_BYTE_STRING = new ByteString("");
|
|
3070
3070
|
|
|
3071
|
-
const
|
|
3071
|
+
const ne = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
|
|
3072
3072
|
|
|
3073
3073
|
/**
|
|
3074
3074
|
* Converts the possible Proto values for a timestamp value into a "seconds and
|
|
@@ -3082,7 +3082,7 @@ const re = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
|
|
|
3082
3082
|
// (millis), so we do some custom parsing here.
|
|
3083
3083
|
// Parse the nanos right out of the string.
|
|
3084
3084
|
let t = 0;
|
|
3085
|
-
const n =
|
|
3085
|
+
const n = ne.exec(e);
|
|
3086
3086
|
if (__PRIVATE_hardAssert(!!n), n[1]) {
|
|
3087
3087
|
// Pad the fraction out to 9 digits (nanos).
|
|
3088
3088
|
let e = n[1];
|
|
@@ -3249,7 +3249,7 @@ class DatabaseId {
|
|
|
3249
3249
|
* See the License for the specific language governing permissions and
|
|
3250
3250
|
* limitations under the License.
|
|
3251
3251
|
*/
|
|
3252
|
-
const
|
|
3252
|
+
const re = {
|
|
3253
3253
|
mapValue: {
|
|
3254
3254
|
fields: {
|
|
3255
3255
|
__type__: {
|
|
@@ -3257,7 +3257,7 @@ const ie = {
|
|
|
3257
3257
|
}
|
|
3258
3258
|
}
|
|
3259
3259
|
}
|
|
3260
|
-
},
|
|
3260
|
+
}, ie = {
|
|
3261
3261
|
nullValue: "NULL_VALUE"
|
|
3262
3262
|
};
|
|
3263
3263
|
|
|
@@ -3403,9 +3403,9 @@ function __PRIVATE_valueCompare(e, t) {
|
|
|
3403
3403
|
|
|
3404
3404
|
case 11 /* TypeOrder.ObjectValue */ :
|
|
3405
3405
|
return function __PRIVATE_compareMaps(e, t) {
|
|
3406
|
-
if (e ===
|
|
3407
|
-
if (e ===
|
|
3408
|
-
if (t ===
|
|
3406
|
+
if (e === re.mapValue && t === re.mapValue) return 0;
|
|
3407
|
+
if (e === re.mapValue) return 1;
|
|
3408
|
+
if (t === re.mapValue) return -1;
|
|
3409
3409
|
const n = e.fields || {}, r = Object.keys(n), i = t.fields || {}, s = Object.keys(i);
|
|
3410
3410
|
// Even though MapValues are likely sorted correctly based on their insertion
|
|
3411
3411
|
// order (e.g. when received from the backend), local modifications can bring
|
|
@@ -3595,7 +3595,7 @@ function isArray(e) {
|
|
|
3595
3595
|
return "__max__" === (((e.mapValue || {}).fields || {}).__type__ || {}).stringValue;
|
|
3596
3596
|
}
|
|
3597
3597
|
|
|
3598
|
-
const
|
|
3598
|
+
const se = {
|
|
3599
3599
|
mapValue: {
|
|
3600
3600
|
fields: {
|
|
3601
3601
|
__type__: {
|
|
@@ -3609,7 +3609,7 @@ const oe = {
|
|
|
3609
3609
|
};
|
|
3610
3610
|
|
|
3611
3611
|
/** Returns the lowest value for the given value type (inclusive). */ function __PRIVATE_valuesGetLowerBound(e) {
|
|
3612
|
-
return "nullValue" in e ?
|
|
3612
|
+
return "nullValue" in e ? ie : "booleanValue" in e ? {
|
|
3613
3613
|
booleanValue: !1
|
|
3614
3614
|
} : "integerValue" in e || "doubleValue" in e ? {
|
|
3615
3615
|
doubleValue: NaN
|
|
@@ -3628,7 +3628,7 @@ const oe = {
|
|
|
3628
3628
|
}
|
|
3629
3629
|
} : "arrayValue" in e ? {
|
|
3630
3630
|
arrayValue: {}
|
|
3631
|
-
} : "mapValue" in e ? __PRIVATE_isVectorValue(e) ?
|
|
3631
|
+
} : "mapValue" in e ? __PRIVATE_isVectorValue(e) ? se : {
|
|
3632
3632
|
mapValue: {}
|
|
3633
3633
|
} : fail();
|
|
3634
3634
|
}
|
|
@@ -3653,9 +3653,9 @@ const oe = {
|
|
|
3653
3653
|
}
|
|
3654
3654
|
} : "geoPointValue" in e ? {
|
|
3655
3655
|
arrayValue: {}
|
|
3656
|
-
} : "arrayValue" in e ?
|
|
3656
|
+
} : "arrayValue" in e ? se : "mapValue" in e ? __PRIVATE_isVectorValue(e) ? {
|
|
3657
3657
|
mapValue: {}
|
|
3658
|
-
} :
|
|
3658
|
+
} : re : fail();
|
|
3659
3659
|
}
|
|
3660
3660
|
|
|
3661
3661
|
function __PRIVATE_lowerBoundCompare(e, t) {
|
|
@@ -4343,10 +4343,10 @@ function __PRIVATE_targetIsDocumentTarget(e) {
|
|
|
4343
4343
|
* the provided `fieldPath` (or the upper bound for an descending segment).
|
|
4344
4344
|
*/
|
|
4345
4345
|
function __PRIVATE_targetGetAscendingBound(e, t, n) {
|
|
4346
|
-
let r =
|
|
4346
|
+
let r = ie, i = !0;
|
|
4347
4347
|
// Process all filters to find a value for the current field segment
|
|
4348
4348
|
for (const n of __PRIVATE_targetGetFieldFiltersForPath(e, t)) {
|
|
4349
|
-
let e =
|
|
4349
|
+
let e = ie, t = !0;
|
|
4350
4350
|
switch (n.op) {
|
|
4351
4351
|
case "<" /* Operator.LESS_THAN */ :
|
|
4352
4352
|
case "<=" /* Operator.LESS_THAN_OR_EQUAL */ :
|
|
@@ -4365,7 +4365,7 @@ function __PRIVATE_targetGetAscendingBound(e, t, n) {
|
|
|
4365
4365
|
|
|
4366
4366
|
case "!=" /* Operator.NOT_EQUAL */ :
|
|
4367
4367
|
case "not-in" /* Operator.NOT_IN */ :
|
|
4368
|
-
e =
|
|
4368
|
+
e = ie;
|
|
4369
4369
|
// Remaining filters cannot be used as lower bounds.
|
|
4370
4370
|
}
|
|
4371
4371
|
__PRIVATE_lowerBoundCompare({
|
|
@@ -4401,10 +4401,10 @@ function __PRIVATE_targetGetAscendingBound(e, t, n) {
|
|
|
4401
4401
|
* Returns the value to use as the upper bound for ascending index segment at
|
|
4402
4402
|
* the provided `fieldPath` (or the lower bound for a descending segment).
|
|
4403
4403
|
*/ function __PRIVATE_targetGetDescendingBound(e, t, n) {
|
|
4404
|
-
let r =
|
|
4404
|
+
let r = re, i = !0;
|
|
4405
4405
|
// Process all filters to find a value for the current field segment
|
|
4406
4406
|
for (const n of __PRIVATE_targetGetFieldFiltersForPath(e, t)) {
|
|
4407
|
-
let e =
|
|
4407
|
+
let e = re, t = !0;
|
|
4408
4408
|
switch (n.op) {
|
|
4409
4409
|
case ">=" /* Operator.GREATER_THAN_OR_EQUAL */ :
|
|
4410
4410
|
case ">" /* Operator.GREATER_THAN */ :
|
|
@@ -4423,7 +4423,7 @@ function __PRIVATE_targetGetAscendingBound(e, t, n) {
|
|
|
4423
4423
|
|
|
4424
4424
|
case "!=" /* Operator.NOT_EQUAL */ :
|
|
4425
4425
|
case "not-in" /* Operator.NOT_IN */ :
|
|
4426
|
-
e =
|
|
4426
|
+
e = re;
|
|
4427
4427
|
// Remaining filters cannot be used as upper bounds.
|
|
4428
4428
|
}
|
|
4429
4429
|
__PRIVATE_upperBoundCompare({
|
|
@@ -4807,22 +4807,22 @@ function __PRIVATE_compareDocs(e, t, n) {
|
|
|
4807
4807
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
4808
4808
|
* See the License for the specific language governing permissions and
|
|
4809
4809
|
* limitations under the License.
|
|
4810
|
-
*/ const
|
|
4810
|
+
*/ const oe = new SortedMap(DocumentKey.comparator);
|
|
4811
4811
|
|
|
4812
4812
|
function __PRIVATE_mutableDocumentMap() {
|
|
4813
|
-
return
|
|
4813
|
+
return oe;
|
|
4814
4814
|
}
|
|
4815
4815
|
|
|
4816
|
-
const
|
|
4816
|
+
const _e = new SortedMap(DocumentKey.comparator);
|
|
4817
4817
|
|
|
4818
4818
|
function documentMap(...e) {
|
|
4819
|
-
let t =
|
|
4819
|
+
let t = _e;
|
|
4820
4820
|
for (const n of e) t = t.insert(n.key, n);
|
|
4821
4821
|
return t;
|
|
4822
4822
|
}
|
|
4823
4823
|
|
|
4824
4824
|
function __PRIVATE_convertOverlayedDocumentMapToDocumentMap(e) {
|
|
4825
|
-
let t =
|
|
4825
|
+
let t = _e;
|
|
4826
4826
|
return e.forEach(((e, n) => t = t.insert(e, n.overlayedDocument))), t;
|
|
4827
4827
|
}
|
|
4828
4828
|
|
|
@@ -4838,20 +4838,20 @@ function __PRIVATE_newDocumentKeyMap() {
|
|
|
4838
4838
|
return new ObjectMap((e => e.toString()), ((e, t) => e.isEqual(t)));
|
|
4839
4839
|
}
|
|
4840
4840
|
|
|
4841
|
-
const
|
|
4841
|
+
const ae = new SortedMap(DocumentKey.comparator);
|
|
4842
4842
|
|
|
4843
|
-
const
|
|
4843
|
+
const ue = new SortedSet(DocumentKey.comparator);
|
|
4844
4844
|
|
|
4845
4845
|
function __PRIVATE_documentKeySet(...e) {
|
|
4846
|
-
let t =
|
|
4846
|
+
let t = ue;
|
|
4847
4847
|
for (const n of e) t = t.add(n);
|
|
4848
4848
|
return t;
|
|
4849
4849
|
}
|
|
4850
4850
|
|
|
4851
|
-
const
|
|
4851
|
+
const ce = new SortedSet(__PRIVATE_primitiveComparator);
|
|
4852
4852
|
|
|
4853
4853
|
function __PRIVATE_targetIdSet() {
|
|
4854
|
-
return
|
|
4854
|
+
return ce;
|
|
4855
4855
|
}
|
|
4856
4856
|
|
|
4857
4857
|
/**
|
|
@@ -5542,7 +5542,7 @@ class __PRIVATE_VerifyMutation extends Mutation {
|
|
|
5542
5542
|
*/ static from(e, t, n) {
|
|
5543
5543
|
__PRIVATE_hardAssert(e.mutations.length === n.length);
|
|
5544
5544
|
let r = function __PRIVATE_documentVersionMap() {
|
|
5545
|
-
return
|
|
5545
|
+
return ae;
|
|
5546
5546
|
}();
|
|
5547
5547
|
const i = e.mutations;
|
|
5548
5548
|
for (let e = 0; e < i.length; e++) r = r.insert(i[e].key, n[e].version);
|
|
@@ -5656,7 +5656,7 @@ class __PRIVATE_VerifyMutation extends Mutation {
|
|
|
5656
5656
|
* Important! The names of these identifiers matter because the string forms
|
|
5657
5657
|
* are used for reverse lookups from the webchannel stream. Do NOT change the
|
|
5658
5658
|
* names of these identifiers or change this into a const enum.
|
|
5659
|
-
*/ var
|
|
5659
|
+
*/ var le, he;
|
|
5660
5660
|
|
|
5661
5661
|
/**
|
|
5662
5662
|
* Determines whether an error code represents a permanent error when received
|
|
@@ -5669,29 +5669,29 @@ function __PRIVATE_isPermanentError(e) {
|
|
|
5669
5669
|
default:
|
|
5670
5670
|
return fail();
|
|
5671
5671
|
|
|
5672
|
-
case
|
|
5673
|
-
case
|
|
5674
|
-
case
|
|
5675
|
-
case
|
|
5676
|
-
case
|
|
5677
|
-
case
|
|
5672
|
+
case D.CANCELLED:
|
|
5673
|
+
case D.UNKNOWN:
|
|
5674
|
+
case D.DEADLINE_EXCEEDED:
|
|
5675
|
+
case D.RESOURCE_EXHAUSTED:
|
|
5676
|
+
case D.INTERNAL:
|
|
5677
|
+
case D.UNAVAILABLE:
|
|
5678
5678
|
// Unauthenticated means something went wrong with our token and we need
|
|
5679
5679
|
// to retry with new credentials which will happen automatically.
|
|
5680
|
-
case
|
|
5680
|
+
case D.UNAUTHENTICATED:
|
|
5681
5681
|
return !1;
|
|
5682
5682
|
|
|
5683
|
-
case
|
|
5684
|
-
case
|
|
5685
|
-
case
|
|
5686
|
-
case
|
|
5687
|
-
case
|
|
5683
|
+
case D.INVALID_ARGUMENT:
|
|
5684
|
+
case D.NOT_FOUND:
|
|
5685
|
+
case D.ALREADY_EXISTS:
|
|
5686
|
+
case D.PERMISSION_DENIED:
|
|
5687
|
+
case D.FAILED_PRECONDITION:
|
|
5688
5688
|
// Aborted might be retried in some scenarios, but that is dependent on
|
|
5689
5689
|
// the context and should handled individually by the calling code.
|
|
5690
5690
|
// See https://cloud.google.com/apis/design/errors.
|
|
5691
|
-
case
|
|
5692
|
-
case
|
|
5693
|
-
case
|
|
5694
|
-
case
|
|
5691
|
+
case D.ABORTED:
|
|
5692
|
+
case D.OUT_OF_RANGE:
|
|
5693
|
+
case D.UNIMPLEMENTED:
|
|
5694
|
+
case D.DATA_LOSS:
|
|
5695
5695
|
return !0;
|
|
5696
5696
|
}
|
|
5697
5697
|
}
|
|
@@ -5719,58 +5719,58 @@ function __PRIVATE_mapCodeFromRpcCode(e) {
|
|
|
5719
5719
|
if (void 0 === e)
|
|
5720
5720
|
// This shouldn't normally happen, but in certain error cases (like trying
|
|
5721
5721
|
// to send invalid proto messages) we may get an error with no GRPC code.
|
|
5722
|
-
return __PRIVATE_logError("GRPC error has no .code"),
|
|
5722
|
+
return __PRIVATE_logError("GRPC error has no .code"), D.UNKNOWN;
|
|
5723
5723
|
switch (e) {
|
|
5724
|
-
case
|
|
5725
|
-
return
|
|
5724
|
+
case le.OK:
|
|
5725
|
+
return D.OK;
|
|
5726
5726
|
|
|
5727
|
-
case
|
|
5728
|
-
return
|
|
5727
|
+
case le.CANCELLED:
|
|
5728
|
+
return D.CANCELLED;
|
|
5729
5729
|
|
|
5730
|
-
case
|
|
5731
|
-
return
|
|
5730
|
+
case le.UNKNOWN:
|
|
5731
|
+
return D.UNKNOWN;
|
|
5732
5732
|
|
|
5733
|
-
case
|
|
5734
|
-
return
|
|
5733
|
+
case le.DEADLINE_EXCEEDED:
|
|
5734
|
+
return D.DEADLINE_EXCEEDED;
|
|
5735
5735
|
|
|
5736
|
-
case
|
|
5737
|
-
return
|
|
5736
|
+
case le.RESOURCE_EXHAUSTED:
|
|
5737
|
+
return D.RESOURCE_EXHAUSTED;
|
|
5738
5738
|
|
|
5739
|
-
case
|
|
5740
|
-
return
|
|
5739
|
+
case le.INTERNAL:
|
|
5740
|
+
return D.INTERNAL;
|
|
5741
5741
|
|
|
5742
|
-
case
|
|
5743
|
-
return
|
|
5742
|
+
case le.UNAVAILABLE:
|
|
5743
|
+
return D.UNAVAILABLE;
|
|
5744
5744
|
|
|
5745
|
-
case
|
|
5746
|
-
return
|
|
5745
|
+
case le.UNAUTHENTICATED:
|
|
5746
|
+
return D.UNAUTHENTICATED;
|
|
5747
5747
|
|
|
5748
|
-
case
|
|
5749
|
-
return
|
|
5748
|
+
case le.INVALID_ARGUMENT:
|
|
5749
|
+
return D.INVALID_ARGUMENT;
|
|
5750
5750
|
|
|
5751
|
-
case
|
|
5752
|
-
return
|
|
5751
|
+
case le.NOT_FOUND:
|
|
5752
|
+
return D.NOT_FOUND;
|
|
5753
5753
|
|
|
5754
|
-
case
|
|
5755
|
-
return
|
|
5754
|
+
case le.ALREADY_EXISTS:
|
|
5755
|
+
return D.ALREADY_EXISTS;
|
|
5756
5756
|
|
|
5757
|
-
case
|
|
5758
|
-
return
|
|
5757
|
+
case le.PERMISSION_DENIED:
|
|
5758
|
+
return D.PERMISSION_DENIED;
|
|
5759
5759
|
|
|
5760
|
-
case
|
|
5761
|
-
return
|
|
5760
|
+
case le.FAILED_PRECONDITION:
|
|
5761
|
+
return D.FAILED_PRECONDITION;
|
|
5762
5762
|
|
|
5763
|
-
case
|
|
5764
|
-
return
|
|
5763
|
+
case le.ABORTED:
|
|
5764
|
+
return D.ABORTED;
|
|
5765
5765
|
|
|
5766
|
-
case
|
|
5767
|
-
return
|
|
5766
|
+
case le.OUT_OF_RANGE:
|
|
5767
|
+
return D.OUT_OF_RANGE;
|
|
5768
5768
|
|
|
5769
|
-
case
|
|
5770
|
-
return
|
|
5769
|
+
case le.UNIMPLEMENTED:
|
|
5770
|
+
return D.UNIMPLEMENTED;
|
|
5771
5771
|
|
|
5772
|
-
case
|
|
5773
|
-
return
|
|
5772
|
+
case le.DATA_LOSS:
|
|
5773
|
+
return D.DATA_LOSS;
|
|
5774
5774
|
|
|
5775
5775
|
default:
|
|
5776
5776
|
return fail();
|
|
@@ -5784,14 +5784,14 @@ function __PRIVATE_mapCodeFromRpcCode(e) {
|
|
|
5784
5784
|
* "UNKNOWN", etc.)
|
|
5785
5785
|
* @returns The equivalent Code. Non-matching responses are mapped to
|
|
5786
5786
|
* Code.UNKNOWN.
|
|
5787
|
-
*/ (
|
|
5788
|
-
|
|
5789
|
-
|
|
5790
|
-
|
|
5791
|
-
|
|
5792
|
-
|
|
5793
|
-
|
|
5794
|
-
|
|
5787
|
+
*/ (he = le || (le = {}))[he.OK = 0] = "OK", he[he.CANCELLED = 1] = "CANCELLED",
|
|
5788
|
+
he[he.UNKNOWN = 2] = "UNKNOWN", he[he.INVALID_ARGUMENT = 3] = "INVALID_ARGUMENT",
|
|
5789
|
+
he[he.DEADLINE_EXCEEDED = 4] = "DEADLINE_EXCEEDED", he[he.NOT_FOUND = 5] = "NOT_FOUND",
|
|
5790
|
+
he[he.ALREADY_EXISTS = 6] = "ALREADY_EXISTS", he[he.PERMISSION_DENIED = 7] = "PERMISSION_DENIED",
|
|
5791
|
+
he[he.UNAUTHENTICATED = 16] = "UNAUTHENTICATED", he[he.RESOURCE_EXHAUSTED = 8] = "RESOURCE_EXHAUSTED",
|
|
5792
|
+
he[he.FAILED_PRECONDITION = 9] = "FAILED_PRECONDITION", he[he.ABORTED = 10] = "ABORTED",
|
|
5793
|
+
he[he.OUT_OF_RANGE = 11] = "OUT_OF_RANGE", he[he.UNIMPLEMENTED = 12] = "UNIMPLEMENTED",
|
|
5794
|
+
he[he.INTERNAL = 13] = "INTERNAL", he[he.UNAVAILABLE = 14] = "UNAVAILABLE", he[he.DATA_LOSS = 15] = "DATA_LOSS";
|
|
5795
5795
|
|
|
5796
5796
|
/**
|
|
5797
5797
|
* @license
|
|
@@ -5816,7 +5816,7 @@ Pe[Pe.INTERNAL = 13] = "INTERNAL", Pe[Pe.UNAVAILABLE = 14] = "UNAVAILABLE", Pe[P
|
|
|
5816
5816
|
* integration tests that have registered callbacks to be notified of events
|
|
5817
5817
|
* that happen during the test execution.
|
|
5818
5818
|
*/
|
|
5819
|
-
let
|
|
5819
|
+
let Pe = null;
|
|
5820
5820
|
|
|
5821
5821
|
/**
|
|
5822
5822
|
* Sets the value of the `testingHooksSpi` object.
|
|
@@ -5864,7 +5864,7 @@ function __PRIVATE_newTextEncoder() {
|
|
|
5864
5864
|
* See the License for the specific language governing permissions and
|
|
5865
5865
|
* limitations under the License.
|
|
5866
5866
|
*/
|
|
5867
|
-
const
|
|
5867
|
+
const Ie = new bloomBlob.Integer([ 4294967295, 4294967295 ], 0);
|
|
5868
5868
|
|
|
5869
5869
|
// Hash a string using md5 hashing algorithm.
|
|
5870
5870
|
function __PRIVATE_getMd5HashValue(e) {
|
|
@@ -5899,7 +5899,7 @@ class BloomFilter {
|
|
|
5899
5899
|
// Calculate hashed value h(i) = h1 + (i * h2).
|
|
5900
5900
|
let r = e.add(t.multiply(bloomBlob.Integer.fromNumber(n)));
|
|
5901
5901
|
// Wrap if hash value overflow 64bit.
|
|
5902
|
-
return 1 === r.compare(
|
|
5902
|
+
return 1 === r.compare(Ie) && (r = new bloomBlob.Integer([ r.getBits(0), r.getBits(1) ], 0)),
|
|
5903
5903
|
r.modulo(this.Te).toNumber();
|
|
5904
5904
|
}
|
|
5905
5905
|
// Return whether the bit on the given index in the bitmap is set to 1.
|
|
@@ -6317,7 +6317,7 @@ class __PRIVATE_WatchChangeAggregator {
|
|
|
6317
6317
|
const e = 2 /* BloomFilterApplicationStatus.FalsePositive */ === i ? "TargetPurposeExistenceFilterMismatchBloom" /* TargetPurpose.ExistenceFilterMismatchBloom */ : "TargetPurposeExistenceFilterMismatch" /* TargetPurpose.ExistenceFilterMismatch */;
|
|
6318
6318
|
this.Qe = this.Qe.insert(t, e);
|
|
6319
6319
|
}
|
|
6320
|
-
null ==
|
|
6320
|
+
null == Pe || Pe.et(function __PRIVATE_createExistenceFilterMismatchInfoForTestingHooks(e, t, n, r, i) {
|
|
6321
6321
|
var s, o, _, a, u, c;
|
|
6322
6322
|
const l = {
|
|
6323
6323
|
localCacheCount: e,
|
|
@@ -6533,13 +6533,13 @@ function __PRIVATE_snapshotChangesMap() {
|
|
|
6533
6533
|
return new SortedMap(DocumentKey.comparator);
|
|
6534
6534
|
}
|
|
6535
6535
|
|
|
6536
|
-
const
|
|
6536
|
+
const Te = (() => {
|
|
6537
6537
|
const e = {
|
|
6538
6538
|
asc: "ASCENDING",
|
|
6539
6539
|
desc: "DESCENDING"
|
|
6540
6540
|
};
|
|
6541
6541
|
return e;
|
|
6542
|
-
})(),
|
|
6542
|
+
})(), Ee = (() => {
|
|
6543
6543
|
const e = {
|
|
6544
6544
|
"<": "LESS_THAN",
|
|
6545
6545
|
"<=": "LESS_THAN_OR_EQUAL",
|
|
@@ -6553,7 +6553,7 @@ const Ee = (() => {
|
|
|
6553
6553
|
"array-contains-any": "ARRAY_CONTAINS_ANY"
|
|
6554
6554
|
};
|
|
6555
6555
|
return e;
|
|
6556
|
-
})(),
|
|
6556
|
+
})(), de = (() => {
|
|
6557
6557
|
const e = {
|
|
6558
6558
|
and: "AND",
|
|
6559
6559
|
or: "OR"
|
|
@@ -6655,8 +6655,8 @@ function __PRIVATE_toName(e, t) {
|
|
|
6655
6655
|
|
|
6656
6656
|
function fromName(e, t) {
|
|
6657
6657
|
const n = __PRIVATE_fromResourceName(t);
|
|
6658
|
-
if (n.get(1) !== e.databaseId.projectId) throw new FirestoreError(
|
|
6659
|
-
if (n.get(3) !== e.databaseId.database) throw new FirestoreError(
|
|
6658
|
+
if (n.get(1) !== e.databaseId.projectId) throw new FirestoreError(D.INVALID_ARGUMENT, "Tried to deserialize key from different project: " + n.get(1) + " vs " + e.databaseId.projectId);
|
|
6659
|
+
if (n.get(3) !== e.databaseId.database) throw new FirestoreError(D.INVALID_ARGUMENT, "Tried to deserialize key from different database: " + n.get(3) + " vs " + e.databaseId.database);
|
|
6660
6660
|
return new DocumentKey(__PRIVATE_extractLocalPathFromResourceName(n));
|
|
6661
6661
|
}
|
|
6662
6662
|
|
|
@@ -6730,7 +6730,7 @@ function __PRIVATE_fromWatchChange(e, t) {
|
|
|
6730
6730
|
// does not indicate that it extends Uint8Array.
|
|
6731
6731
|
t instanceof Buffer || t instanceof Uint8Array), ByteString.fromUint8Array(t || new Uint8Array));
|
|
6732
6732
|
}(e, t.targetChange.resumeToken), o = t.targetChange.cause, _ = o && function __PRIVATE_fromRpcStatus(e) {
|
|
6733
|
-
const t = void 0 === e.code ?
|
|
6733
|
+
const t = void 0 === e.code ? D.UNKNOWN : __PRIVATE_mapCodeFromRpcCode(e.code);
|
|
6734
6734
|
return new FirestoreError(t, e.message || "");
|
|
6735
6735
|
}(o);
|
|
6736
6736
|
n = new __PRIVATE_WatchTargetChange(r, i, s, _ || null);
|
|
@@ -7125,15 +7125,15 @@ function __PRIVATE_fromFilter(e) {
|
|
|
7125
7125
|
}
|
|
7126
7126
|
|
|
7127
7127
|
function __PRIVATE_toDirection(e) {
|
|
7128
|
-
return
|
|
7128
|
+
return Te[e];
|
|
7129
7129
|
}
|
|
7130
7130
|
|
|
7131
7131
|
function __PRIVATE_toOperatorName(e) {
|
|
7132
|
-
return
|
|
7132
|
+
return Ee[e];
|
|
7133
7133
|
}
|
|
7134
7134
|
|
|
7135
7135
|
function __PRIVATE_toCompositeOperatorName(e) {
|
|
7136
|
-
return
|
|
7136
|
+
return de[e];
|
|
7137
7137
|
}
|
|
7138
7138
|
|
|
7139
7139
|
function __PRIVATE_toFieldPathReference(e) {
|
|
@@ -8498,7 +8498,7 @@ function __PRIVATE_applyDistributionFieldAndCompositeFilters(e, t) {
|
|
|
8498
8498
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
8499
8499
|
* See the License for the specific language governing permissions and
|
|
8500
8500
|
* limitations under the License.
|
|
8501
|
-
*/ const
|
|
8501
|
+
*/ const Ae = new Uint8Array(0);
|
|
8502
8502
|
|
|
8503
8503
|
/**
|
|
8504
8504
|
* A persisted implementation of IndexManager.
|
|
@@ -8712,7 +8712,7 @@ class __PRIVATE_IndexedDbIndexManager {
|
|
|
8712
8712
|
// combined with the values from the query bounds.
|
|
8713
8713
|
const _ = (null != t ? t.length : 1) * Math.max(n.length, i.length), a = _ / (null != t ? t.length : 1), u = [];
|
|
8714
8714
|
for (let c = 0; c < _; ++c) {
|
|
8715
|
-
const _ = t ? this.dn(t[c / a]) :
|
|
8715
|
+
const _ = t ? this.dn(t[c / a]) : Ae, l = this.An(e, _, n[c % a], r), h = this.Rn(e, _, i[c % a], s), P = o.map((t => this.An(e, _, t,
|
|
8716
8716
|
/* inclusive= */ !0)));
|
|
8717
8717
|
u.push(...this.createRange(l, h, P));
|
|
8718
8718
|
}
|
|
@@ -8909,7 +8909,7 @@ class __PRIVATE_IndexedDbIndexManager {
|
|
|
8909
8909
|
if (null != i) {
|
|
8910
8910
|
const s = e.data.field(i.fieldPath);
|
|
8911
8911
|
if (isArray(s)) for (const i of s.arrayValue.values || []) n = n.add(new __PRIVATE_IndexEntry(t.indexId, e.key, this.dn(i), r));
|
|
8912
|
-
} else n = n.add(new __PRIVATE_IndexEntry(t.indexId, e.key,
|
|
8912
|
+
} else n = n.add(new __PRIVATE_IndexEntry(t.indexId, e.key, Ae, r));
|
|
8913
8913
|
return n;
|
|
8914
8914
|
}
|
|
8915
8915
|
/**
|
|
@@ -8984,7 +8984,7 @@ class __PRIVATE_IndexedDbIndexManager {
|
|
|
8984
8984
|
// If we encounter two bounds that will create an unmatchable key range,
|
|
8985
8985
|
// then we return an empty set of key ranges.
|
|
8986
8986
|
if (this.Cn(r[e], r[e + 1])) return [];
|
|
8987
|
-
const t = [ r[e].indexId, this.uid, r[e].arrayValue, r[e].directionalValue,
|
|
8987
|
+
const t = [ r[e].indexId, this.uid, r[e].arrayValue, r[e].directionalValue, Ae, [] ], n = [ r[e + 1].indexId, this.uid, r[e + 1].arrayValue, r[e + 1].directionalValue, Ae, [] ];
|
|
8988
8988
|
i.push(IDBKeyRange.bound(t, n));
|
|
8989
8989
|
}
|
|
8990
8990
|
return i;
|
|
@@ -9052,7 +9052,7 @@ function __PRIVATE_getMinOffsetFromFieldIndexes(e) {
|
|
|
9052
9052
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
9053
9053
|
* See the License for the specific language governing permissions and
|
|
9054
9054
|
* limitations under the License.
|
|
9055
|
-
*/ const
|
|
9055
|
+
*/ const Re = {
|
|
9056
9056
|
didRun: !1,
|
|
9057
9057
|
sequenceNumbersCollected: 0,
|
|
9058
9058
|
targetsRemoved: 0,
|
|
@@ -9216,7 +9216,7 @@ class __PRIVATE_IndexedDbMutationQueue {
|
|
|
9216
9216
|
let c = new SortedSet(((e, t) => __PRIVATE_primitiveComparator(e.canonicalString(), t.canonicalString())));
|
|
9217
9217
|
for (const e of r) {
|
|
9218
9218
|
const t = __PRIVATE_newDbDocumentMutationKey(this.userId, e.key.path, o);
|
|
9219
|
-
c = c.add(e.key.path.popLast()), u.push(s.put(a)), u.push(i.put(t,
|
|
9219
|
+
c = c.add(e.key.path.popLast()), u.push(s.put(a)), u.push(i.put(t, x));
|
|
9220
9220
|
}
|
|
9221
9221
|
return c.forEach((t => {
|
|
9222
9222
|
u.push(this.indexManager.addToCollectionParentIndex(e, t));
|
|
@@ -9785,8 +9785,8 @@ class __PRIVATE_TargetIdGenerator {
|
|
|
9785
9785
|
}
|
|
9786
9786
|
collect(e, t) {
|
|
9787
9787
|
return -1 === this.params.cacheSizeCollectionThreshold ? (__PRIVATE_logDebug("LruGarbageCollector", "Garbage collection skipped; disabled"),
|
|
9788
|
-
PersistencePromise.resolve(
|
|
9789
|
-
|
|
9788
|
+
PersistencePromise.resolve(Re)) : 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}`),
|
|
9789
|
+
Re) : this.Xn(e, t)));
|
|
9790
9790
|
}
|
|
9791
9791
|
getCacheSize(e) {
|
|
9792
9792
|
return this.Jn.getCacheSize(e);
|
|
@@ -11577,7 +11577,7 @@ class __PRIVATE_MemoryLruDelegate {
|
|
|
11577
11577
|
e.createObjectStore("mutations", {
|
|
11578
11578
|
keyPath: "batchId",
|
|
11579
11579
|
autoIncrement: !0
|
|
11580
|
-
}).createIndex("userMutationsIndex",
|
|
11580
|
+
}).createIndex("userMutationsIndex", M, {
|
|
11581
11581
|
unique: !0
|
|
11582
11582
|
}), e.createObjectStore("documentMutations");
|
|
11583
11583
|
}
|
|
@@ -11622,7 +11622,7 @@ class __PRIVATE_MemoryLruDelegate {
|
|
|
11622
11622
|
e.createObjectStore("mutations", {
|
|
11623
11623
|
keyPath: "batchId",
|
|
11624
11624
|
autoIncrement: !0
|
|
11625
|
-
}).createIndex("userMutationsIndex",
|
|
11625
|
+
}).createIndex("userMutationsIndex", M, {
|
|
11626
11626
|
unique: !0
|
|
11627
11627
|
});
|
|
11628
11628
|
const r = t.store("mutations"), i = n.map((e => r.put(e)));
|
|
@@ -11659,19 +11659,19 @@ class __PRIVATE_MemoryLruDelegate {
|
|
|
11659
11659
|
}))), n < 12 && r >= 12 && (s = s.next((() => {
|
|
11660
11660
|
!function __PRIVATE_createDocumentOverlayStore(e) {
|
|
11661
11661
|
const t = e.createObjectStore("documentOverlays", {
|
|
11662
|
-
keyPath:
|
|
11662
|
+
keyPath: G
|
|
11663
11663
|
});
|
|
11664
|
-
t.createIndex("collectionPathOverlayIndex",
|
|
11664
|
+
t.createIndex("collectionPathOverlayIndex", z, {
|
|
11665
11665
|
unique: !1
|
|
11666
|
-
}), t.createIndex("collectionGroupOverlayIndex",
|
|
11666
|
+
}), t.createIndex("collectionGroupOverlayIndex", j, {
|
|
11667
11667
|
unique: !1
|
|
11668
11668
|
});
|
|
11669
11669
|
}(e);
|
|
11670
11670
|
}))), n < 13 && r >= 13 && (s = s.next((() => function __PRIVATE_createRemoteDocumentCache(e) {
|
|
11671
11671
|
const t = e.createObjectStore("remoteDocumentsV14", {
|
|
11672
|
-
keyPath:
|
|
11672
|
+
keyPath: O
|
|
11673
11673
|
});
|
|
11674
|
-
t.createIndex("documentKeyIndex",
|
|
11674
|
+
t.createIndex("documentKeyIndex", N), t.createIndex("collectionGroupIndex", L);
|
|
11675
11675
|
}(e))).next((() => this._i(e, i))).next((() => e.deleteObjectStore("remoteDocuments")))),
|
|
11676
11676
|
n < 14 && r >= 14 && (s = s.next((() => this.ai(e, i)))), n < 15 && r >= 15 && (s = s.next((() => function __PRIVATE_createFieldIndex(e) {
|
|
11677
11677
|
e.createObjectStore("indexConfiguration", {
|
|
@@ -11681,13 +11681,13 @@ class __PRIVATE_MemoryLruDelegate {
|
|
|
11681
11681
|
unique: !1
|
|
11682
11682
|
});
|
|
11683
11683
|
e.createObjectStore("indexState", {
|
|
11684
|
-
keyPath:
|
|
11685
|
-
}).createIndex("sequenceNumberIndex",
|
|
11684
|
+
keyPath: K
|
|
11685
|
+
}).createIndex("sequenceNumberIndex", $, {
|
|
11686
11686
|
unique: !1
|
|
11687
11687
|
});
|
|
11688
11688
|
e.createObjectStore("indexEntries", {
|
|
11689
|
-
keyPath:
|
|
11690
|
-
}).createIndex("documentKeyIndex",
|
|
11689
|
+
keyPath: U
|
|
11690
|
+
}).createIndex("documentKeyIndex", W, {
|
|
11691
11691
|
unique: !1
|
|
11692
11692
|
});
|
|
11693
11693
|
}(e)))), n < 16 && r >= 16 && (
|
|
@@ -11748,7 +11748,7 @@ class __PRIVATE_MemoryLruDelegate {
|
|
|
11748
11748
|
si(e, t) {
|
|
11749
11749
|
// Create the index.
|
|
11750
11750
|
e.createObjectStore("collectionParents", {
|
|
11751
|
-
keyPath:
|
|
11751
|
+
keyPath: Q
|
|
11752
11752
|
});
|
|
11753
11753
|
const n = t.store("collectionParents"), r = new __PRIVATE_MemoryCollectionParentIndex, addEntry = e => {
|
|
11754
11754
|
if (r.add(e)) {
|
|
@@ -11833,19 +11833,19 @@ class __PRIVATE_MemoryLruDelegate {
|
|
|
11833
11833
|
|
|
11834
11834
|
function __PRIVATE_createQueryCache(e) {
|
|
11835
11835
|
e.createObjectStore("targetDocuments", {
|
|
11836
|
-
keyPath:
|
|
11837
|
-
}).createIndex("documentTargetsIndex",
|
|
11836
|
+
keyPath: k
|
|
11837
|
+
}).createIndex("documentTargetsIndex", q, {
|
|
11838
11838
|
unique: !0
|
|
11839
11839
|
});
|
|
11840
11840
|
// NOTE: This is unique only because the TargetId is the suffix.
|
|
11841
11841
|
e.createObjectStore("targets", {
|
|
11842
11842
|
keyPath: "targetId"
|
|
11843
|
-
}).createIndex("queryTargetsIndex",
|
|
11843
|
+
}).createIndex("queryTargetsIndex", B, {
|
|
11844
11844
|
unique: !0
|
|
11845
11845
|
}), e.createObjectStore("targetGlobal");
|
|
11846
11846
|
}
|
|
11847
11847
|
|
|
11848
|
-
const
|
|
11848
|
+
const Ve = "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.";
|
|
11849
11849
|
|
|
11850
11850
|
/**
|
|
11851
11851
|
* Oldest acceptable age in milliseconds for client metadata before the client
|
|
@@ -11921,7 +11921,7 @@ class __PRIVATE_IndexedDbPersistence {
|
|
|
11921
11921
|
/** The last time we garbage collected the client metadata object store. */
|
|
11922
11922
|
this.Ei = Number.NEGATIVE_INFINITY,
|
|
11923
11923
|
/** A listener to notify on primary state changes. */
|
|
11924
|
-
this.di = e => Promise.resolve(), !__PRIVATE_IndexedDbPersistence.D()) throw new FirestoreError(
|
|
11924
|
+
this.di = e => Promise.resolve(), !__PRIVATE_IndexedDbPersistence.D()) throw new FirestoreError(D.UNIMPLEMENTED, "This platform is either missing IndexedDB or is known to have an incomplete implementation. Offline persistence has been disabled.");
|
|
11925
11925
|
this.referenceDelegate = new __PRIVATE_IndexedDbLruDelegateImpl(this, r), this.Ai = t + "main",
|
|
11926
11926
|
this.serializer = new __PRIVATE_LocalSerializer(_), this.Ri = new __PRIVATE_SimpleDb(this.Ai, this.hi, new __PRIVATE_SchemaConverter(this.serializer)),
|
|
11927
11927
|
this.$r = new __PRIVATE_IndexedDbGlobalsCache, this.Ur = new __PRIVATE_IndexedDbTargetCache(this.referenceDelegate, this.serializer),
|
|
@@ -11941,7 +11941,7 @@ class __PRIVATE_IndexedDbPersistence {
|
|
|
11941
11941
|
if (!this.isPrimary && !this.allowTabSynchronization)
|
|
11942
11942
|
// Fail `start()` if `synchronizeTabs` is disabled and we cannot
|
|
11943
11943
|
// obtain the primary lease.
|
|
11944
|
-
throw new FirestoreError(
|
|
11944
|
+
throw new FirestoreError(D.FAILED_PRECONDITION, Ve);
|
|
11945
11945
|
return this.fi(), this.gi(), this.pi(), this.runTransaction("getHighestListenSequenceNumber", "readonly", (e => this.Ur.getHighestSequenceNumber(e)));
|
|
11946
11946
|
})).then((e => {
|
|
11947
11947
|
this.Qr = new __PRIVATE_ListenSequence(e, this.ci);
|
|
@@ -12083,7 +12083,7 @@ class __PRIVATE_IndexedDbPersistence {
|
|
|
12083
12083
|
// settings is not supported.
|
|
12084
12084
|
// TODO(b/114226234): Remove this check when `synchronizeTabs` can
|
|
12085
12085
|
// no longer be turned off.
|
|
12086
|
-
throw new FirestoreError(
|
|
12086
|
+
throw new FirestoreError(D.FAILED_PRECONDITION, Ve);
|
|
12087
12087
|
return !1;
|
|
12088
12088
|
}
|
|
12089
12089
|
}
|
|
@@ -12156,7 +12156,7 @@ class __PRIVATE_IndexedDbPersistence {
|
|
|
12156
12156
|
const r = "readonly" === t ? "readonly" : "readwrite", i =
|
|
12157
12157
|
/** Returns the object stores for the provided schema. */
|
|
12158
12158
|
function __PRIVATE_getObjectStores(e) {
|
|
12159
|
-
return 17 === e ?
|
|
12159
|
+
return 17 === e ? te : 16 === e ? ee : 15 === e ? X : 14 === e ? Z : 13 === e ? Y : 12 === e ? J : 11 === e ? H : void fail();
|
|
12160
12160
|
}(this.hi);
|
|
12161
12161
|
let s;
|
|
12162
12162
|
// Do all transactions as readwrite against all object stores, since we
|
|
@@ -12164,7 +12164,7 @@ class __PRIVATE_IndexedDbPersistence {
|
|
|
12164
12164
|
return this.Ri.runTransaction(e, r, i, (r => (s = new __PRIVATE_IndexedDbTransaction(r, this.Qr ? this.Qr.next() : __PRIVATE_ListenSequence.oe),
|
|
12165
12165
|
"readwrite-primary" === t ? this.wi(s).next((e => !!e || this.Si(s))).next((t => {
|
|
12166
12166
|
if (!t) throw __PRIVATE_logError(`Failed to obtain primary lease for action '${e}'.`),
|
|
12167
|
-
this.isPrimary = !1, this.ui.enqueueRetryable((() => this.di(!1))), new FirestoreError(
|
|
12167
|
+
this.isPrimary = !1, this.ui.enqueueRetryable((() => this.di(!1))), new FirestoreError(D.FAILED_PRECONDITION, C);
|
|
12168
12168
|
return n(s);
|
|
12169
12169
|
})).next((e => this.Di(s).next((() => e)))) : this.Ki(s).next((() => n(s)))))).then((e => (s.raiseOnCommittedEvent(),
|
|
12170
12170
|
e)));
|
|
@@ -12177,7 +12177,7 @@ class __PRIVATE_IndexedDbPersistence {
|
|
|
12177
12177
|
// be turned off.
|
|
12178
12178
|
Ki(e) {
|
|
12179
12179
|
return __PRIVATE_primaryClientStore(e).get("owner").next((e => {
|
|
12180
|
-
if (null !== e && this.Mi(e.leaseTimestampMs, 5e3) && !this.Ni(e.ownerId) && !this.vi(e) && !(this.li || this.allowTabSynchronization && e.allowTabSynchronization)) throw new FirestoreError(
|
|
12180
|
+
if (null !== e && this.Mi(e.leaseTimestampMs, 5e3) && !this.Ni(e.ownerId) && !this.vi(e) && !(this.li || this.allowTabSynchronization && e.allowTabSynchronization)) throw new FirestoreError(D.FAILED_PRECONDITION, Ve);
|
|
12181
12181
|
}));
|
|
12182
12182
|
}
|
|
12183
12183
|
/**
|
|
@@ -13325,18 +13325,20 @@ class __PRIVATE_LocalClientState {
|
|
|
13325
13325
|
// in order, it is safe to delete the entry right after updating it.
|
|
13326
13326
|
this.Qs(e);
|
|
13327
13327
|
}
|
|
13328
|
-
addLocalQueryTarget(e) {
|
|
13329
|
-
let
|
|
13328
|
+
addLocalQueryTarget(e, t = !0) {
|
|
13329
|
+
let n = "not-current";
|
|
13330
13330
|
// Lookup an existing query state if the target ID was already registered
|
|
13331
13331
|
// by another tab
|
|
13332
13332
|
if (this.isActiveQueryTarget(e)) {
|
|
13333
|
-
const
|
|
13334
|
-
if (
|
|
13335
|
-
const r = __PRIVATE_QueryTargetMetadata.Rs(e,
|
|
13336
|
-
r && (
|
|
13333
|
+
const t = this.storage.getItem(createWebStorageQueryTargetMetadataKey(this.persistenceKey, e));
|
|
13334
|
+
if (t) {
|
|
13335
|
+
const r = __PRIVATE_QueryTargetMetadata.Rs(e, t);
|
|
13336
|
+
r && (n = r.state);
|
|
13337
13337
|
}
|
|
13338
13338
|
}
|
|
13339
|
-
|
|
13339
|
+
// If the query is listening to cache only, the target ID should not be registered with the
|
|
13340
|
+
// local Firestore client as an active watch target.
|
|
13341
|
+
return t && this.Ks.fs(e), this.Ns(), n;
|
|
13340
13342
|
}
|
|
13341
13343
|
removeLocalQueryTarget(e) {
|
|
13342
13344
|
this.Ks.gs(e), this.Ns();
|
|
@@ -13544,8 +13546,8 @@ class __PRIVATE_MemorySharedClientState {
|
|
|
13544
13546
|
updateMutationState(e, t, n) {
|
|
13545
13547
|
// No op.
|
|
13546
13548
|
}
|
|
13547
|
-
addLocalQueryTarget(e) {
|
|
13548
|
-
return this.so.fs(e), this.oo[e] || "not-current";
|
|
13549
|
+
addLocalQueryTarget(e, t = !0) {
|
|
13550
|
+
return t && this.so.fs(e), this.oo[e] || "not-current";
|
|
13549
13551
|
}
|
|
13550
13552
|
updateQueryState(e, t, n) {
|
|
13551
13553
|
this.oo[e] = t;
|
|
@@ -13674,7 +13676,7 @@ class __PRIVATE_BrowserConnectivityMonitor {
|
|
|
13674
13676
|
/**
|
|
13675
13677
|
* The value returned from the most recent invocation of
|
|
13676
13678
|
* `generateUniqueDebugId()`, or null if it has never been invoked.
|
|
13677
|
-
*/ let
|
|
13679
|
+
*/ let me = null;
|
|
13678
13680
|
|
|
13679
13681
|
/**
|
|
13680
13682
|
* Generates and returns an initial value for `lastUniqueDebugId`.
|
|
@@ -13699,9 +13701,9 @@ class __PRIVATE_BrowserConnectivityMonitor {
|
|
|
13699
13701
|
* @return the 10-character generated ID (e.g. "0xa1b2c3d4").
|
|
13700
13702
|
*/
|
|
13701
13703
|
function __PRIVATE_generateUniqueDebugId() {
|
|
13702
|
-
return null ===
|
|
13704
|
+
return null === me ? me = function __PRIVATE_generateInitialUniqueDebugId() {
|
|
13703
13705
|
return 268435456 + Math.round(2147483648 * Math.random());
|
|
13704
|
-
}() :
|
|
13706
|
+
}() : me++, "0x" + me.toString(16);
|
|
13705
13707
|
}
|
|
13706
13708
|
|
|
13707
13709
|
/**
|
|
@@ -13719,7 +13721,7 @@ function __PRIVATE_generateUniqueDebugId() {
|
|
|
13719
13721
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13720
13722
|
* See the License for the specific language governing permissions and
|
|
13721
13723
|
* limitations under the License.
|
|
13722
|
-
*/ const
|
|
13724
|
+
*/ const fe = {
|
|
13723
13725
|
BatchGetDocuments: "batchGet",
|
|
13724
13726
|
Commit: "commit",
|
|
13725
13727
|
RunQuery: "runQuery",
|
|
@@ -13803,7 +13805,7 @@ class __PRIVATE_StreamBridge {
|
|
|
13803
13805
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13804
13806
|
* See the License for the specific language governing permissions and
|
|
13805
13807
|
* limitations under the License.
|
|
13806
|
-
*/ const
|
|
13808
|
+
*/ const ge = "WebChannelConnection";
|
|
13807
13809
|
|
|
13808
13810
|
class __PRIVATE_WebChannelConnection extends
|
|
13809
13811
|
/**
|
|
@@ -13847,7 +13849,7 @@ class __PRIVATE_RestConnection {
|
|
|
13847
13849
|
// SDK_VERSION is updated to different value at runtime depending on the entry point,
|
|
13848
13850
|
// so we need to get its value when we need it in a function.
|
|
13849
13851
|
function __PRIVATE_getGoogApiClientValue() {
|
|
13850
|
-
return "gl-js/ fire/" +
|
|
13852
|
+
return "gl-js/ fire/" + S;
|
|
13851
13853
|
}(),
|
|
13852
13854
|
// Content-Type: text/plain will avoid preflight requests which might
|
|
13853
13855
|
// mess with CORS and redirects by proxies. If we add custom headers
|
|
@@ -13857,7 +13859,7 @@ class __PRIVATE_RestConnection {
|
|
|
13857
13859
|
t && t.headers.forEach(((t, n) => e[n] = t)), n && n.headers.forEach(((t, n) => e[n] = t));
|
|
13858
13860
|
}
|
|
13859
13861
|
xo(e, t) {
|
|
13860
|
-
const n =
|
|
13862
|
+
const n = fe[e];
|
|
13861
13863
|
return `${this.Do}/v1/${t}:${n}`;
|
|
13862
13864
|
}
|
|
13863
13865
|
/**
|
|
@@ -13881,17 +13883,17 @@ class __PRIVATE_RestConnection {
|
|
|
13881
13883
|
switch (_.getLastErrorCode()) {
|
|
13882
13884
|
case webchannelBlob.ErrorCode.NO_ERROR:
|
|
13883
13885
|
const t = _.getResponseJson();
|
|
13884
|
-
__PRIVATE_logDebug(
|
|
13886
|
+
__PRIVATE_logDebug(ge, `XHR for RPC '${e}' ${i} received:`, JSON.stringify(t)),
|
|
13885
13887
|
s(t);
|
|
13886
13888
|
break;
|
|
13887
13889
|
|
|
13888
13890
|
case webchannelBlob.ErrorCode.TIMEOUT:
|
|
13889
|
-
__PRIVATE_logDebug(
|
|
13891
|
+
__PRIVATE_logDebug(ge, `RPC '${e}' ${i} timed out`), o(new FirestoreError(D.DEADLINE_EXCEEDED, "Request time out"));
|
|
13890
13892
|
break;
|
|
13891
13893
|
|
|
13892
13894
|
case webchannelBlob.ErrorCode.HTTP_ERROR:
|
|
13893
13895
|
const n = _.getStatus();
|
|
13894
|
-
if (__PRIVATE_logDebug(
|
|
13896
|
+
if (__PRIVATE_logDebug(ge, `RPC '${e}' ${i} failed with status:`, n, "response text:", _.getResponseText()),
|
|
13895
13897
|
n > 0) {
|
|
13896
13898
|
let e = _.getResponseJson();
|
|
13897
13899
|
Array.isArray(e) && (e = e[0]);
|
|
@@ -13899,25 +13901,25 @@ class __PRIVATE_RestConnection {
|
|
|
13899
13901
|
if (t && t.status && t.message) {
|
|
13900
13902
|
const e = function __PRIVATE_mapCodeFromHttpResponseErrorStatus(e) {
|
|
13901
13903
|
const t = e.toLowerCase().replace(/_/g, "-");
|
|
13902
|
-
return Object.values(
|
|
13904
|
+
return Object.values(D).indexOf(t) >= 0 ? t : D.UNKNOWN;
|
|
13903
13905
|
}(t.status);
|
|
13904
13906
|
o(new FirestoreError(e, t.message));
|
|
13905
|
-
} else o(new FirestoreError(
|
|
13907
|
+
} else o(new FirestoreError(D.UNKNOWN, "Server responded with status " + _.getStatus()));
|
|
13906
13908
|
} else
|
|
13907
13909
|
// If we received an HTTP_ERROR but there's no status code,
|
|
13908
13910
|
// it's most probably a connection issue
|
|
13909
|
-
o(new FirestoreError(
|
|
13911
|
+
o(new FirestoreError(D.UNAVAILABLE, "Connection failed."));
|
|
13910
13912
|
break;
|
|
13911
13913
|
|
|
13912
13914
|
default:
|
|
13913
13915
|
fail();
|
|
13914
13916
|
}
|
|
13915
13917
|
} finally {
|
|
13916
|
-
__PRIVATE_logDebug(
|
|
13918
|
+
__PRIVATE_logDebug(ge, `RPC '${e}' ${i} completed.`);
|
|
13917
13919
|
}
|
|
13918
13920
|
}));
|
|
13919
13921
|
const a = JSON.stringify(r);
|
|
13920
|
-
__PRIVATE_logDebug(
|
|
13922
|
+
__PRIVATE_logDebug(ge, `RPC '${e}' ${i} sending request:`, r), _.send(t, "POST", a, n, 15);
|
|
13921
13923
|
}));
|
|
13922
13924
|
}
|
|
13923
13925
|
Bo(e, t, n) {
|
|
@@ -13945,7 +13947,7 @@ class __PRIVATE_RestConnection {
|
|
|
13945
13947
|
forceLongPolling: this.forceLongPolling,
|
|
13946
13948
|
detectBufferingProxy: this.autoDetectLongPolling
|
|
13947
13949
|
}, a = this.longPollingOptions.timeoutSeconds;
|
|
13948
|
-
void 0 !== a && (_.longPollingTimeout = Math.round(1e3 * a)), this.useFetchStreams && (_.
|
|
13950
|
+
void 0 !== a && (_.longPollingTimeout = Math.round(1e3 * a)), this.useFetchStreams && (_.useFetchStreams = !0),
|
|
13949
13951
|
this.Oo(_.initMessageHeaders, t, n),
|
|
13950
13952
|
// Sending the custom headers we just added to request.initMessageHeaders
|
|
13951
13953
|
// (Authorization, etc.) will trigger the browser to make a CORS preflight
|
|
@@ -13958,7 +13960,7 @@ class __PRIVATE_RestConnection {
|
|
|
13958
13960
|
// which is recognized by the webchannel backend.
|
|
13959
13961
|
_.encodeInitMessageHeaders = !0;
|
|
13960
13962
|
const u = i.join("");
|
|
13961
|
-
__PRIVATE_logDebug(
|
|
13963
|
+
__PRIVATE_logDebug(ge, `Creating RPC '${e}' stream ${r}: ${u}`, _);
|
|
13962
13964
|
const c = s.createWebChannel(u, _);
|
|
13963
13965
|
// WebChannel supports sending the first message with the handshake - saving
|
|
13964
13966
|
// a network round trip. However, it will have to call send in the same
|
|
@@ -13971,8 +13973,8 @@ class __PRIVATE_RestConnection {
|
|
|
13971
13973
|
// on a closed stream
|
|
13972
13974
|
const P = new __PRIVATE_StreamBridge({
|
|
13973
13975
|
Io: t => {
|
|
13974
|
-
h ? __PRIVATE_logDebug(
|
|
13975
|
-
c.open(), l = !0), __PRIVATE_logDebug(
|
|
13976
|
+
h ? __PRIVATE_logDebug(ge, `Not sending because RPC '${e}' stream ${r} is closed:`, t) : (l || (__PRIVATE_logDebug(ge, `Opening RPC '${e}' stream ${r} transport.`),
|
|
13977
|
+
c.open(), l = !0), __PRIVATE_logDebug(ge, `RPC '${e}' stream ${r} sending:`, t),
|
|
13976
13978
|
c.send(t));
|
|
13977
13979
|
},
|
|
13978
13980
|
To: () => c.close()
|
|
@@ -13994,13 +13996,13 @@ class __PRIVATE_RestConnection {
|
|
|
13994
13996
|
// Note that eventually this function could go away if we are confident
|
|
13995
13997
|
// enough the code is exception free.
|
|
13996
13998
|
return __PRIVATE_unguardedEventListen(c, webchannelBlob.WebChannel.EventType.OPEN, (() => {
|
|
13997
|
-
h || (__PRIVATE_logDebug(
|
|
13999
|
+
h || (__PRIVATE_logDebug(ge, `RPC '${e}' stream ${r} transport opened.`), P.yo());
|
|
13998
14000
|
})), __PRIVATE_unguardedEventListen(c, webchannelBlob.WebChannel.EventType.CLOSE, (() => {
|
|
13999
|
-
h || (h = !0, __PRIVATE_logDebug(
|
|
14001
|
+
h || (h = !0, __PRIVATE_logDebug(ge, `RPC '${e}' stream ${r} transport closed`),
|
|
14000
14002
|
P.So());
|
|
14001
14003
|
})), __PRIVATE_unguardedEventListen(c, webchannelBlob.WebChannel.EventType.ERROR, (t => {
|
|
14002
|
-
h || (h = !0, __PRIVATE_logWarn(
|
|
14003
|
-
P.So(new FirestoreError(
|
|
14004
|
+
h || (h = !0, __PRIVATE_logWarn(ge, `RPC '${e}' stream ${r} transport errored:`, t),
|
|
14005
|
+
P.So(new FirestoreError(D.UNAVAILABLE, "The operation could not be completed")));
|
|
14004
14006
|
})), __PRIVATE_unguardedEventListen(c, webchannelBlob.WebChannel.EventType.MESSAGE, (t => {
|
|
14005
14007
|
var n;
|
|
14006
14008
|
if (!h) {
|
|
@@ -14013,7 +14015,7 @@ class __PRIVATE_RestConnection {
|
|
|
14013
14015
|
// Use any because msgData.error is not typed.
|
|
14014
14016
|
const s = i, o = s.error || (null === (n = s[0]) || void 0 === n ? void 0 : n.error);
|
|
14015
14017
|
if (o) {
|
|
14016
|
-
__PRIVATE_logDebug(
|
|
14018
|
+
__PRIVATE_logDebug(ge, `RPC '${e}' stream ${r} received error:`, o);
|
|
14017
14019
|
// error.status will be a string like 'OK' or 'NOT_FOUND'.
|
|
14018
14020
|
const t = o.status;
|
|
14019
14021
|
let n =
|
|
@@ -14026,16 +14028,16 @@ class __PRIVATE_RestConnection {
|
|
|
14026
14028
|
function __PRIVATE_mapCodeFromRpcStatus(e) {
|
|
14027
14029
|
// lookup by string
|
|
14028
14030
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
14029
|
-
const t =
|
|
14031
|
+
const t = le[e];
|
|
14030
14032
|
if (void 0 !== t) return __PRIVATE_mapCodeFromRpcCode(t);
|
|
14031
14033
|
}(t), i = o.message;
|
|
14032
|
-
void 0 === n && (n =
|
|
14034
|
+
void 0 === n && (n = D.INTERNAL, i = "Unknown error status: " + t + " with message " + o.message),
|
|
14033
14035
|
// Mark closed so no further events are propagated
|
|
14034
14036
|
h = !0, P.So(new FirestoreError(n, i)), c.close();
|
|
14035
|
-
} else __PRIVATE_logDebug(
|
|
14037
|
+
} else __PRIVATE_logDebug(ge, `RPC '${e}' stream ${r} received:`, i), P.bo(i);
|
|
14036
14038
|
}
|
|
14037
14039
|
})), __PRIVATE_unguardedEventListen(o, webchannelBlob.Event.STAT_EVENT, (t => {
|
|
14038
|
-
t.stat === webchannelBlob.Stat.PROXY ? __PRIVATE_logDebug(
|
|
14040
|
+
t.stat === webchannelBlob.Stat.PROXY ? __PRIVATE_logDebug(ge, `RPC '${e}' stream ${r} detected buffering proxy`) : t.stat === webchannelBlob.Stat.NOPROXY && __PRIVATE_logDebug(ge, `RPC '${e}' stream ${r} detected no buffering proxy`);
|
|
14039
14041
|
})), setTimeout((() => {
|
|
14040
14042
|
// Technically we could/should wait for the WebChannel opened event,
|
|
14041
14043
|
// but because we want to send the first message with the WebChannel
|
|
@@ -14363,10 +14365,10 @@ class __PRIVATE_PersistentStream {
|
|
|
14363
14365
|
// underlying stream), guaranteeing they won't execute.
|
|
14364
14366
|
this.Yo++, 4 /* PersistentStreamState.Error */ !== e ?
|
|
14365
14367
|
// If this is an intentional close ensure we don't delay our next connection attempt.
|
|
14366
|
-
this.t_.reset() : t && t.code ===
|
|
14368
|
+
this.t_.reset() : t && t.code === D.RESOURCE_EXHAUSTED ? (
|
|
14367
14369
|
// Log the error. (Probably either 'quota exceeded' or 'max queue length reached'.)
|
|
14368
14370
|
__PRIVATE_logError(t.toString()), __PRIVATE_logError("Using maximum backoff delay to prevent overloading the backend."),
|
|
14369
|
-
this.t_.Wo()) : t && t.code ===
|
|
14371
|
+
this.t_.Wo()) : t && t.code === D.UNAUTHENTICATED && 3 /* PersistentStreamState.Healthy */ !== this.state && (
|
|
14370
14372
|
// "unauthenticated" error means the token was rejected. This should rarely
|
|
14371
14373
|
// happen since both Auth and AppCheck ensure a sufficient TTL when we
|
|
14372
14374
|
// request a token. If a user manually resets their system clock this can
|
|
@@ -14402,7 +14404,7 @@ class __PRIVATE_PersistentStream {
|
|
|
14402
14404
|
this.P_(e, n);
|
|
14403
14405
|
}), (t => {
|
|
14404
14406
|
e((() => {
|
|
14405
|
-
const e = new FirestoreError(
|
|
14407
|
+
const e = new FirestoreError(D.UNKNOWN, "Fetching auth token failed: " + t.message);
|
|
14406
14408
|
return this.I_(e);
|
|
14407
14409
|
}));
|
|
14408
14410
|
}));
|
|
@@ -14621,18 +14623,18 @@ class __PRIVATE_DatastoreImpl extends class Datastore {} {
|
|
|
14621
14623
|
this.serializer = r, this.y_ = !1;
|
|
14622
14624
|
}
|
|
14623
14625
|
w_() {
|
|
14624
|
-
if (this.y_) throw new FirestoreError(
|
|
14626
|
+
if (this.y_) throw new FirestoreError(D.FAILED_PRECONDITION, "The client has already been terminated.");
|
|
14625
14627
|
}
|
|
14626
14628
|
/** Invokes the provided RPC with auth and AppCheck tokens. */ Mo(e, t, n, r) {
|
|
14627
14629
|
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 => {
|
|
14628
|
-
throw "FirebaseError" === e.name ? (e.code ===
|
|
14629
|
-
this.appCheckCredentials.invalidateToken()), e) : new FirestoreError(
|
|
14630
|
+
throw "FirebaseError" === e.name ? (e.code === D.UNAUTHENTICATED && (this.authCredentials.invalidateToken(),
|
|
14631
|
+
this.appCheckCredentials.invalidateToken()), e) : new FirestoreError(D.UNKNOWN, e.toString());
|
|
14630
14632
|
}));
|
|
14631
14633
|
}
|
|
14632
14634
|
/** Invokes the provided RPC with streamed results with auth and AppCheck tokens. */ Lo(e, t, n, r, i) {
|
|
14633
14635
|
return this.w_(), Promise.all([ this.authCredentials.getToken(), this.appCheckCredentials.getToken() ]).then((([s, o]) => this.connection.Lo(e, __PRIVATE_toResourcePath(t, n), r, s, o, i))).catch((e => {
|
|
14634
|
-
throw "FirebaseError" === e.name ? (e.code ===
|
|
14635
|
-
this.appCheckCredentials.invalidateToken()), e) : new FirestoreError(
|
|
14636
|
+
throw "FirebaseError" === e.name ? (e.code === D.UNAUTHENTICATED && (this.authCredentials.invalidateToken(),
|
|
14637
|
+
this.appCheckCredentials.invalidateToken()), e) : new FirestoreError(D.UNKNOWN, e.toString());
|
|
14636
14638
|
}));
|
|
14637
14639
|
}
|
|
14638
14640
|
terminate() {
|
|
@@ -15076,7 +15078,7 @@ async function __PRIVATE_onWriteStreamClose(e, t) {
|
|
|
15076
15078
|
// Only handle permanent errors here. If it's transient, just let the retry
|
|
15077
15079
|
// logic kick in.
|
|
15078
15080
|
if (function __PRIVATE_isPermanentWriteError(e) {
|
|
15079
|
-
return __PRIVATE_isPermanentError(e) && e !==
|
|
15081
|
+
return __PRIVATE_isPermanentError(e) && e !== D.ABORTED;
|
|
15080
15082
|
}(t.code)) {
|
|
15081
15083
|
// This was a permanent error, the request itself was the problem
|
|
15082
15084
|
// so it's not going to succeed if we resend it.
|
|
@@ -15259,7 +15261,7 @@ class DelayedOperation {
|
|
|
15259
15261
|
* As long as the operation has not yet been run, calling cancel() provides a
|
|
15260
15262
|
* guarantee that the operation will not be run.
|
|
15261
15263
|
*/ cancel(e) {
|
|
15262
|
-
null !== this.timerHandle && (this.clearTimeout(), this.deferred.reject(new FirestoreError(
|
|
15264
|
+
null !== this.timerHandle && (this.clearTimeout(), this.deferred.reject(new FirestoreError(D.CANCELLED, "Operation cancelled" + (e ? ": " + e : ""))));
|
|
15263
15265
|
}
|
|
15264
15266
|
handleDelayElapsed() {
|
|
15265
15267
|
this.asyncQueue.enqueueAndForget((() => null !== this.timerHandle ? (this.clearTimeout(),
|
|
@@ -15275,7 +15277,7 @@ class DelayedOperation {
|
|
|
15275
15277
|
* Returns a FirestoreError that can be surfaced to the user if the provided
|
|
15276
15278
|
* error is an IndexedDbTransactionError. Re-throws the error otherwise.
|
|
15277
15279
|
*/ function __PRIVATE_wrapInUserErrorIfRecoverable(e, t) {
|
|
15278
|
-
if (__PRIVATE_logError("AsyncQueue", `${t}: ${e}`), __PRIVATE_isIndexedDbTransactionError(e)) return new FirestoreError(
|
|
15280
|
+
if (__PRIVATE_logError("AsyncQueue", `${t}: ${e}`), __PRIVATE_isIndexedDbTransactionError(e)) return new FirestoreError(D.UNAVAILABLE, `${t}: ${e}`);
|
|
15279
15281
|
throw e;
|
|
15280
15282
|
}
|
|
15281
15283
|
|
|
@@ -15505,7 +15507,7 @@ class __PRIVATE_EventManagerImpl {
|
|
|
15505
15507
|
}));
|
|
15506
15508
|
}
|
|
15507
15509
|
// Call all global snapshot listeners that have been set.
|
|
15508
|
-
(this, new FirestoreError(
|
|
15510
|
+
(this, new FirestoreError(D.ABORTED, "Firestore shutting down"));
|
|
15509
15511
|
}
|
|
15510
15512
|
}
|
|
15511
15513
|
|
|
@@ -15602,12 +15604,12 @@ function __PRIVATE_raiseSnapshotsInSyncEvent(e) {
|
|
|
15602
15604
|
}));
|
|
15603
15605
|
}
|
|
15604
15606
|
|
|
15605
|
-
var
|
|
15607
|
+
var pe, ye;
|
|
15606
15608
|
|
|
15607
15609
|
/** Listen to both cache and server changes */
|
|
15608
|
-
(
|
|
15610
|
+
(ye = pe || (pe = {})).ea = "default",
|
|
15609
15611
|
/** Listen to changes in cache only */
|
|
15610
|
-
|
|
15612
|
+
ye.Cache = "cache";
|
|
15611
15613
|
|
|
15612
15614
|
/**
|
|
15613
15615
|
* QueryListener takes a series of internal view snapshots and determines
|
|
@@ -15682,7 +15684,7 @@ class __PRIVATE_QueryListener {
|
|
|
15682
15684
|
this.na = !0, this.ta.next(e);
|
|
15683
15685
|
}
|
|
15684
15686
|
J_() {
|
|
15685
|
-
return this.options.source !==
|
|
15687
|
+
return this.options.source !== pe.Cache;
|
|
15686
15688
|
}
|
|
15687
15689
|
}
|
|
15688
15690
|
|
|
@@ -16236,7 +16238,7 @@ async function __PRIVATE_syncEngineListen(e, t, n = !0) {
|
|
|
16236
16238
|
}
|
|
16237
16239
|
|
|
16238
16240
|
async function __PRIVATE_allocateTargetAndMaybeListen(e, t, n, r) {
|
|
16239
|
-
const i = await __PRIVATE_localStoreAllocateTarget(e.localStore, __PRIVATE_queryToTarget(t)), s = i.targetId, o =
|
|
16241
|
+
const i = await __PRIVATE_localStoreAllocateTarget(e.localStore, __PRIVATE_queryToTarget(t)), s = i.targetId, o = e.sharedClientState.addLocalQueryTarget(s, n);
|
|
16240
16242
|
let _;
|
|
16241
16243
|
return r && (_ = await __PRIVATE_initializeViewAndComputeSnapshot(e, t, s, "current" === o, i.resumeToken)),
|
|
16242
16244
|
e.isPrimaryClient && n && __PRIVATE_remoteStoreListen(e.remoteStore, i), _;
|
|
@@ -16650,7 +16652,7 @@ async function __PRIVATE_syncEngineHandleCredentialChange(e, t) {
|
|
|
16650
16652
|
function __PRIVATE_rejectOutstandingPendingWritesCallbacks(e, t) {
|
|
16651
16653
|
e.ka.forEach((e => {
|
|
16652
16654
|
e.forEach((e => {
|
|
16653
|
-
e.reject(new FirestoreError(
|
|
16655
|
+
e.reject(new FirestoreError(D.CANCELLED, t));
|
|
16654
16656
|
}));
|
|
16655
16657
|
})), e.ka.clear();
|
|
16656
16658
|
}(n, "'waitForPendingWrites' promise is rejected due to a user change."),
|
|
@@ -17079,7 +17081,7 @@ class __PRIVATE_LruGcMemoryOfflineComponentProvider extends MemoryOfflineCompone
|
|
|
17079
17081
|
}
|
|
17080
17082
|
createSharedClientState(e) {
|
|
17081
17083
|
const t = __PRIVATE_getWindow();
|
|
17082
|
-
if (!__PRIVATE_WebStorageSharedClientState.D(t)) throw new FirestoreError(
|
|
17084
|
+
if (!__PRIVATE_WebStorageSharedClientState.D(t)) throw new FirestoreError(D.UNIMPLEMENTED, "IndexedDB persistence is only available on platforms that support LocalStorage.");
|
|
17083
17085
|
const n = __PRIVATE_indexedDbStoragePrefix(e.databaseInfo.databaseId, e.databaseInfo.persistenceKey);
|
|
17084
17086
|
return new __PRIVATE_WebStorageSharedClientState(t, e.asyncQueue, n, e.clientId, e.initialUser);
|
|
17085
17087
|
}
|
|
@@ -17418,7 +17420,7 @@ class Transaction$2 {
|
|
|
17418
17420
|
this.writtenDocs = new Set;
|
|
17419
17421
|
}
|
|
17420
17422
|
async lookup(e) {
|
|
17421
|
-
if (this.ensureCommitNotCalled(), this.mutations.length > 0) throw this.lastTransactionError = new FirestoreError(
|
|
17423
|
+
if (this.ensureCommitNotCalled(), this.mutations.length > 0) throw this.lastTransactionError = new FirestoreError(D.INVALID_ARGUMENT, "Firestore transactions require all reads to be executed before all writes."),
|
|
17422
17424
|
this.lastTransactionError;
|
|
17423
17425
|
const t = await async function __PRIVATE_invokeBatchGetDocumentsRpc(e, t) {
|
|
17424
17426
|
const n = __PRIVATE_debugCast(e), r = {
|
|
@@ -17480,7 +17482,7 @@ class Transaction$2 {
|
|
|
17480
17482
|
if (n) {
|
|
17481
17483
|
if (!t.isEqual(n))
|
|
17482
17484
|
// This transaction will fail no matter what.
|
|
17483
|
-
throw new FirestoreError(
|
|
17485
|
+
throw new FirestoreError(D.ABORTED, "Document version changed between two reads.");
|
|
17484
17486
|
} else this.readVersions.set(e.key.toString(), t);
|
|
17485
17487
|
}
|
|
17486
17488
|
/**
|
|
@@ -17507,7 +17509,7 @@ class Transaction$2 {
|
|
|
17507
17509
|
// express that to the backend, we have to validate locally.
|
|
17508
17510
|
// Note: this can change once we can send separate verify writes in the
|
|
17509
17511
|
// transaction.
|
|
17510
|
-
throw new FirestoreError(
|
|
17512
|
+
throw new FirestoreError(D.INVALID_ARGUMENT, "Can't update a document that doesn't exist.");
|
|
17511
17513
|
// Document exists, base precondition on document update time.
|
|
17512
17514
|
return Precondition.updateTime(t);
|
|
17513
17515
|
}
|
|
@@ -17648,7 +17650,7 @@ class FirestoreClient {
|
|
|
17648
17650
|
* Checks that the client has not been terminated. Ensures that other methods on //
|
|
17649
17651
|
* this class cannot be called after the client is terminated. //
|
|
17650
17652
|
*/ verifyNotTerminated() {
|
|
17651
|
-
if (this.asyncQueue.isShuttingDown) throw new FirestoreError(
|
|
17653
|
+
if (this.asyncQueue.isShuttingDown) throw new FirestoreError(D.FAILED_PRECONDITION, "The client has already been terminated.");
|
|
17652
17654
|
}
|
|
17653
17655
|
terminate() {
|
|
17654
17656
|
this.asyncQueue.enterRestrictedMode();
|
|
@@ -17696,7 +17698,7 @@ async function __PRIVATE_setOnlineComponentProvider(e, t) {
|
|
|
17696
17698
|
* Decides whether the provided error allows us to gracefully disable
|
|
17697
17699
|
* persistence (as opposed to crashing the client).
|
|
17698
17700
|
*/ function __PRIVATE_canFallbackFromIndexedDbError(e) {
|
|
17699
|
-
return "FirebaseError" === e.name ? e.code ===
|
|
17701
|
+
return "FirebaseError" === e.name ? e.code === D.FAILED_PRECONDITION || e.code === D.UNIMPLEMENTED : !("undefined" != typeof DOMException && e instanceof DOMException) || (
|
|
17700
17702
|
// When the browser is out of quota we could get either quota exceeded
|
|
17701
17703
|
// or an aborted error depending on whether the error happened during
|
|
17702
17704
|
// schema migration.
|
|
@@ -17790,7 +17792,7 @@ async function __PRIVATE_getEventManager(e) {
|
|
|
17790
17792
|
const n = __PRIVATE_debugCast(e);
|
|
17791
17793
|
return n.persistence.runTransaction("read document", "readonly", (e => n.localDocuments.getDocument(e, t)));
|
|
17792
17794
|
}(e, t);
|
|
17793
|
-
r.isFoundDocument() ? n.resolve(r) : r.isNoDocument() ? n.resolve(null) : n.reject(new FirestoreError(
|
|
17795
|
+
r.isFoundDocument() ? n.resolve(r) : r.isNoDocument() ? n.resolve(null) : n.reject(new FirestoreError(D.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.)"));
|
|
17794
17796
|
} catch (e) {
|
|
17795
17797
|
const r = __PRIVATE_wrapInUserErrorIfRecoverable(e, `Failed to get document '${t} from cache`);
|
|
17796
17798
|
n.reject(r);
|
|
@@ -17819,7 +17821,7 @@ function __PRIVATE_firestoreClientGetDocumentViaSnapshotListener(e, t, n = {}) {
|
|
|
17819
17821
|
// the server so we can deliver that even when you're
|
|
17820
17822
|
// offline 2) Actually reject the Promise in the online case
|
|
17821
17823
|
// if the document doesn't exist.
|
|
17822
|
-
i.reject(new FirestoreError(
|
|
17824
|
+
i.reject(new FirestoreError(D.UNAVAILABLE, "Failed to get document because the client is offline.")) : _ && s.fromCache && r && "server" === r.source ? i.reject(new FirestoreError(D.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);
|
|
17823
17825
|
},
|
|
17824
17826
|
error: e => i.reject(e)
|
|
17825
17827
|
}), o = new __PRIVATE_QueryListener(__PRIVATE_newQueryForPath(n.path), s, {
|
|
@@ -17856,7 +17858,7 @@ function __PRIVATE_firestoreClientGetDocumentsViaSnapshotListener(e, t, n = {})
|
|
|
17856
17858
|
next: n => {
|
|
17857
17859
|
// Remove query first before passing event to user to avoid
|
|
17858
17860
|
// user actions affecting the now stale query.
|
|
17859
|
-
t.enqueueAndForget((() => __PRIVATE_eventManagerUnlisten(e, o))), n.fromCache && "server" === r.source ? i.reject(new FirestoreError(
|
|
17861
|
+
t.enqueueAndForget((() => __PRIVATE_eventManagerUnlisten(e, o))), n.fromCache && "server" === r.source ? i.reject(new FirestoreError(D.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);
|
|
17860
17862
|
},
|
|
17861
17863
|
error: e => i.reject(e)
|
|
17862
17864
|
}), o = new __PRIVATE_QueryListener(n, s, {
|
|
@@ -18094,7 +18096,7 @@ function __PRIVATE_cloneLongPollingOptions(e) {
|
|
|
18094
18096
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
18095
18097
|
* See the License for the specific language governing permissions and
|
|
18096
18098
|
* limitations under the License.
|
|
18097
|
-
*/ const
|
|
18099
|
+
*/ const we = new Map;
|
|
18098
18100
|
|
|
18099
18101
|
/**
|
|
18100
18102
|
* An instance map that ensures only one Datastore exists per Firestore
|
|
@@ -18117,28 +18119,28 @@ function __PRIVATE_cloneLongPollingOptions(e) {
|
|
|
18117
18119
|
* limitations under the License.
|
|
18118
18120
|
*/
|
|
18119
18121
|
function __PRIVATE_validateNonEmptyArgument(e, t, n) {
|
|
18120
|
-
if (!n) throw new FirestoreError(
|
|
18122
|
+
if (!n) throw new FirestoreError(D.INVALID_ARGUMENT, `Function ${e}() cannot be called with an empty ${t}.`);
|
|
18121
18123
|
}
|
|
18122
18124
|
|
|
18123
18125
|
/**
|
|
18124
18126
|
* Validates that two boolean options are not set at the same time.
|
|
18125
18127
|
* @internal
|
|
18126
18128
|
*/ function __PRIVATE_validateIsNotUsedTogether(e, t, n, r) {
|
|
18127
|
-
if (!0 === t && !0 === r) throw new FirestoreError(
|
|
18129
|
+
if (!0 === t && !0 === r) throw new FirestoreError(D.INVALID_ARGUMENT, `${e} and ${n} cannot be used together.`);
|
|
18128
18130
|
}
|
|
18129
18131
|
|
|
18130
18132
|
/**
|
|
18131
18133
|
* Validates that `path` refers to a document (indicated by the fact it contains
|
|
18132
18134
|
* an even numbers of segments).
|
|
18133
18135
|
*/ function __PRIVATE_validateDocumentPath(e) {
|
|
18134
|
-
if (!DocumentKey.isDocumentKey(e)) throw new FirestoreError(
|
|
18136
|
+
if (!DocumentKey.isDocumentKey(e)) throw new FirestoreError(D.INVALID_ARGUMENT, `Invalid document reference. Document references must have an even number of segments, but ${e} has ${e.length}.`);
|
|
18135
18137
|
}
|
|
18136
18138
|
|
|
18137
18139
|
/**
|
|
18138
18140
|
* Validates that `path` refers to a collection (indicated by the fact it
|
|
18139
18141
|
* contains an odd numbers of segments).
|
|
18140
18142
|
*/ function __PRIVATE_validateCollectionPath(e) {
|
|
18141
|
-
if (DocumentKey.isDocumentKey(e)) throw new FirestoreError(
|
|
18143
|
+
if (DocumentKey.isDocumentKey(e)) throw new FirestoreError(D.INVALID_ARGUMENT, `Invalid collection reference. Collection references must have an odd number of segments, but ${e} has ${e.length}.`);
|
|
18142
18144
|
}
|
|
18143
18145
|
|
|
18144
18146
|
/**
|
|
@@ -18182,17 +18184,17 @@ t) {
|
|
|
18182
18184
|
// Unwrap Compat types
|
|
18183
18185
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
18184
18186
|
e = e._delegate), !(e instanceof t)) {
|
|
18185
|
-
if (t.name === e.constructor.name) throw new FirestoreError(
|
|
18187
|
+
if (t.name === e.constructor.name) throw new FirestoreError(D.INVALID_ARGUMENT, "Type does not match the expected instance. Did you pass a reference from a different Firestore SDK?");
|
|
18186
18188
|
{
|
|
18187
18189
|
const n = __PRIVATE_valueDescription(e);
|
|
18188
|
-
throw new FirestoreError(
|
|
18190
|
+
throw new FirestoreError(D.INVALID_ARGUMENT, `Expected type '${t.name}', but it was: ${n}`);
|
|
18189
18191
|
}
|
|
18190
18192
|
}
|
|
18191
18193
|
return e;
|
|
18192
18194
|
}
|
|
18193
18195
|
|
|
18194
18196
|
function __PRIVATE_validatePositiveNumber(e, t) {
|
|
18195
|
-
if (t <= 0) throw new FirestoreError(
|
|
18197
|
+
if (t <= 0) throw new FirestoreError(D.INVALID_ARGUMENT, `Function ${e}() requires a positive number, but it was: ${t}.`);
|
|
18196
18198
|
}
|
|
18197
18199
|
|
|
18198
18200
|
/**
|
|
@@ -18221,12 +18223,12 @@ class FirestoreSettingsImpl {
|
|
|
18221
18223
|
constructor(e) {
|
|
18222
18224
|
var t, n;
|
|
18223
18225
|
if (void 0 === e.host) {
|
|
18224
|
-
if (void 0 !== e.ssl) throw new FirestoreError(
|
|
18226
|
+
if (void 0 !== e.ssl) throw new FirestoreError(D.INVALID_ARGUMENT, "Can't provide ssl option if host option is not set");
|
|
18225
18227
|
this.host = "firestore.googleapis.com", this.ssl = true;
|
|
18226
18228
|
} else this.host = e.host, this.ssl = null === (t = e.ssl) || void 0 === t || t;
|
|
18227
18229
|
if (this.credentials = e.credentials, this.ignoreUndefinedProperties = !!e.ignoreUndefinedProperties,
|
|
18228
18230
|
this.localCache = e.localCache, void 0 === e.cacheSizeBytes) this.cacheSizeBytes = 41943040; else {
|
|
18229
|
-
if (-1 !== e.cacheSizeBytes && e.cacheSizeBytes < 1048576) throw new FirestoreError(
|
|
18231
|
+
if (-1 !== e.cacheSizeBytes && e.cacheSizeBytes < 1048576) throw new FirestoreError(D.INVALID_ARGUMENT, "cacheSizeBytes must be at least 1048576");
|
|
18230
18232
|
this.cacheSizeBytes = e.cacheSizeBytes;
|
|
18231
18233
|
}
|
|
18232
18234
|
__PRIVATE_validateIsNotUsedTogether("experimentalForceLongPolling", e.experimentalForceLongPolling, "experimentalAutoDetectLongPolling", e.experimentalAutoDetectLongPolling),
|
|
@@ -18238,9 +18240,9 @@ class FirestoreSettingsImpl {
|
|
|
18238
18240
|
this.experimentalLongPollingOptions = __PRIVATE_cloneLongPollingOptions(null !== (n = e.experimentalLongPollingOptions) && void 0 !== n ? n : {}),
|
|
18239
18241
|
function __PRIVATE_validateLongPollingOptions(e) {
|
|
18240
18242
|
if (void 0 !== e.timeoutSeconds) {
|
|
18241
|
-
if (isNaN(e.timeoutSeconds)) throw new FirestoreError(
|
|
18242
|
-
if (e.timeoutSeconds < 5) throw new FirestoreError(
|
|
18243
|
-
if (e.timeoutSeconds > 30) throw new FirestoreError(
|
|
18243
|
+
if (isNaN(e.timeoutSeconds)) throw new FirestoreError(D.INVALID_ARGUMENT, `invalid long polling timeout: ${e.timeoutSeconds} (must not be NaN)`);
|
|
18244
|
+
if (e.timeoutSeconds < 5) throw new FirestoreError(D.INVALID_ARGUMENT, `invalid long polling timeout: ${e.timeoutSeconds} (minimum allowed value is 5)`);
|
|
18245
|
+
if (e.timeoutSeconds > 30) throw new FirestoreError(D.INVALID_ARGUMENT, `invalid long polling timeout: ${e.timeoutSeconds} (maximum allowed value is 30)`);
|
|
18244
18246
|
}
|
|
18245
18247
|
}
|
|
18246
18248
|
/**
|
|
@@ -18287,7 +18289,7 @@ class Firestore$1 {
|
|
|
18287
18289
|
* The {@link @firebase/app#FirebaseApp} associated with this `Firestore` service
|
|
18288
18290
|
* instance.
|
|
18289
18291
|
*/ get app() {
|
|
18290
|
-
if (!this._app) throw new FirestoreError(
|
|
18292
|
+
if (!this._app) throw new FirestoreError(D.FAILED_PRECONDITION, "Firestore was not initialized using the Firebase SDK. 'app' is not available");
|
|
18291
18293
|
return this._app;
|
|
18292
18294
|
}
|
|
18293
18295
|
get _initialized() {
|
|
@@ -18297,7 +18299,7 @@ class Firestore$1 {
|
|
|
18297
18299
|
return void 0 !== this._terminateTask;
|
|
18298
18300
|
}
|
|
18299
18301
|
_setSettings(e) {
|
|
18300
|
-
if (this._settingsFrozen) throw new FirestoreError(
|
|
18302
|
+
if (this._settingsFrozen) throw new FirestoreError(D.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.");
|
|
18301
18303
|
this._settings = new FirestoreSettingsImpl(e), void 0 !== e.credentials && (this._authCredentials = function __PRIVATE_makeAuthCredentialsProvider(e) {
|
|
18302
18304
|
if (!e) return new __PRIVATE_EmptyAuthCredentialsProvider;
|
|
18303
18305
|
switch (e.type) {
|
|
@@ -18308,7 +18310,7 @@ class Firestore$1 {
|
|
|
18308
18310
|
return e.client;
|
|
18309
18311
|
|
|
18310
18312
|
default:
|
|
18311
|
-
throw new FirestoreError(
|
|
18313
|
+
throw new FirestoreError(D.INVALID_ARGUMENT, "makeAuthCredentialsProvider failed due to invalid credential type");
|
|
18312
18314
|
}
|
|
18313
18315
|
}(e.credentials));
|
|
18314
18316
|
}
|
|
@@ -18340,8 +18342,8 @@ class Firestore$1 {
|
|
|
18340
18342
|
* when the `Firestore` instance is terminated.
|
|
18341
18343
|
*/
|
|
18342
18344
|
return function __PRIVATE_removeComponents(e) {
|
|
18343
|
-
const t =
|
|
18344
|
-
t && (__PRIVATE_logDebug("ComponentProvider", "Removing Datastore"),
|
|
18345
|
+
const t = we.get(e);
|
|
18346
|
+
t && (__PRIVATE_logDebug("ComponentProvider", "Removing Datastore"), we.delete(e),
|
|
18345
18347
|
t.terminate());
|
|
18346
18348
|
}(this), Promise.resolve();
|
|
18347
18349
|
}
|
|
@@ -18373,7 +18375,7 @@ class Firestore$1 {
|
|
|
18373
18375
|
// invalid field "uid" and missing field "sub" / "user_id".)
|
|
18374
18376
|
t = util.createMockUserToken(r.mockUserToken, null === (i = e._app) || void 0 === i ? void 0 : i.options.projectId);
|
|
18375
18377
|
const s = r.mockUserToken.sub || r.mockUserToken.user_id;
|
|
18376
|
-
if (!s) throw new FirestoreError(
|
|
18378
|
+
if (!s) throw new FirestoreError(D.INVALID_ARGUMENT, "mockUserToken must contain 'sub' or 'user_id' field!");
|
|
18377
18379
|
n = new User(s);
|
|
18378
18380
|
}
|
|
18379
18381
|
e._authCredentials = new __PRIVATE_EmulatorAuthCredentialsProvider(new __PRIVATE_OAuthToken(t, n));
|
|
@@ -18493,7 +18495,7 @@ function collection(e, t, ...n) {
|
|
|
18493
18495
|
return __PRIVATE_validateCollectionPath(r), new CollectionReference(e, /* converter= */ null, r);
|
|
18494
18496
|
}
|
|
18495
18497
|
{
|
|
18496
|
-
if (!(e instanceof DocumentReference || e instanceof CollectionReference)) throw new FirestoreError(
|
|
18498
|
+
if (!(e instanceof DocumentReference || e instanceof CollectionReference)) throw new FirestoreError(D.INVALID_ARGUMENT, "Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");
|
|
18497
18499
|
const r = e._path.child(ResourcePath.fromString(t, ...n));
|
|
18498
18500
|
return __PRIVATE_validateCollectionPath(r), new CollectionReference(e.firestore,
|
|
18499
18501
|
/* converter= */ null, r);
|
|
@@ -18514,7 +18516,7 @@ function collection(e, t, ...n) {
|
|
|
18514
18516
|
* @returns The created `Query`.
|
|
18515
18517
|
*/ function collectionGroup(e, t) {
|
|
18516
18518
|
if (e = __PRIVATE_cast(e, Firestore$1), __PRIVATE_validateNonEmptyArgument("collectionGroup", "collection id", t),
|
|
18517
|
-
t.indexOf("/") >= 0) throw new FirestoreError(
|
|
18519
|
+
t.indexOf("/") >= 0) throw new FirestoreError(D.INVALID_ARGUMENT, `Invalid collection ID '${t}' passed to function collectionGroup(). Collection IDs must not contain '/'.`);
|
|
18518
18520
|
return new Query(e,
|
|
18519
18521
|
/* converter= */ null, function __PRIVATE_newQueryForCollectionGroup(e) {
|
|
18520
18522
|
return new __PRIVATE_QueryImpl(ResourcePath.emptyPath(), e);
|
|
@@ -18532,7 +18534,7 @@ function doc(e, t, ...n) {
|
|
|
18532
18534
|
/* converter= */ null, new DocumentKey(r));
|
|
18533
18535
|
}
|
|
18534
18536
|
{
|
|
18535
|
-
if (!(e instanceof DocumentReference || e instanceof CollectionReference)) throw new FirestoreError(
|
|
18537
|
+
if (!(e instanceof DocumentReference || e instanceof CollectionReference)) throw new FirestoreError(D.INVALID_ARGUMENT, "Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");
|
|
18536
18538
|
const r = e._path.child(ResourcePath.fromString(t, ...n));
|
|
18537
18539
|
return __PRIVATE_validateDocumentPath(r), new DocumentReference(e.firestore, e instanceof CollectionReference ? e.converter : null, new DocumentKey(r));
|
|
18538
18540
|
}
|
|
@@ -18893,7 +18895,7 @@ class LoadBundleTask {
|
|
|
18893
18895
|
* Constant used to indicate the LRU garbage collection should be disabled.
|
|
18894
18896
|
* Set this value as the `cacheSizeBytes` on the settings passed to the
|
|
18895
18897
|
* {@link Firestore} instance.
|
|
18896
|
-
*/ const
|
|
18898
|
+
*/ const Se = -1;
|
|
18897
18899
|
|
|
18898
18900
|
/**
|
|
18899
18901
|
* The Cloud Firestore service interface.
|
|
@@ -18937,10 +18939,10 @@ class LoadBundleTask {
|
|
|
18937
18939
|
identifier: n
|
|
18938
18940
|
}), i = r.getOptions(n);
|
|
18939
18941
|
if (util.deepEqual(i, t)) return e;
|
|
18940
|
-
throw new FirestoreError(
|
|
18942
|
+
throw new FirestoreError(D.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.");
|
|
18941
18943
|
}
|
|
18942
|
-
if (void 0 !== t.cacheSizeBytes && void 0 !== t.localCache) throw new FirestoreError(
|
|
18943
|
-
if (void 0 !== t.cacheSizeBytes && -1 !== t.cacheSizeBytes && t.cacheSizeBytes < 1048576) throw new FirestoreError(
|
|
18944
|
+
if (void 0 !== t.cacheSizeBytes && void 0 !== t.localCache) throw new FirestoreError(D.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");
|
|
18945
|
+
if (void 0 !== t.cacheSizeBytes && -1 !== t.cacheSizeBytes && t.cacheSizeBytes < 1048576) throw new FirestoreError(D.INVALID_ARGUMENT, "cacheSizeBytes must be at least 1048576");
|
|
18944
18946
|
return r.initialize({
|
|
18945
18947
|
options: t,
|
|
18946
18948
|
instanceIdentifier: n
|
|
@@ -19009,7 +19011,7 @@ function __PRIVATE_configureFirestore(e) {
|
|
|
19009
19011
|
*/ function enableIndexedDbPersistence(e, t) {
|
|
19010
19012
|
__PRIVATE_verifyNotInitialized(e = __PRIVATE_cast(e, Firestore));
|
|
19011
19013
|
const n = ensureFirestoreConfigured(e);
|
|
19012
|
-
if (n._uninitializedComponentsProvider) throw new FirestoreError(
|
|
19014
|
+
if (n._uninitializedComponentsProvider) throw new FirestoreError(D.FAILED_PRECONDITION, "SDK cache is already specified.");
|
|
19013
19015
|
__PRIVATE_logWarn("enableIndexedDbPersistence() will be deprecated in the future, you can use `FirestoreSettings.cache` instead.");
|
|
19014
19016
|
const r = e._freezeSettings(), i = new OnlineComponentProvider;
|
|
19015
19017
|
return __PRIVATE_setPersistenceProviders(n, i, new __PRIVATE_IndexedDbOfflineComponentProvider(i, r.cacheSizeBytes, null == t ? void 0 : t.forceOwnership));
|
|
@@ -19043,7 +19045,7 @@ function __PRIVATE_configureFirestore(e) {
|
|
|
19043
19045
|
*/ function enableMultiTabIndexedDbPersistence(e) {
|
|
19044
19046
|
__PRIVATE_verifyNotInitialized(e = __PRIVATE_cast(e, Firestore));
|
|
19045
19047
|
const t = ensureFirestoreConfigured(e);
|
|
19046
|
-
if (t._uninitializedComponentsProvider) throw new FirestoreError(
|
|
19048
|
+
if (t._uninitializedComponentsProvider) throw new FirestoreError(D.FAILED_PRECONDITION, "SDK cache is already specified.");
|
|
19047
19049
|
__PRIVATE_logWarn("enableMultiTabIndexedDbPersistence() will be deprecated in the future, you can use `FirestoreSettings.cache` instead.");
|
|
19048
19050
|
const n = e._freezeSettings(), r = new OnlineComponentProvider;
|
|
19049
19051
|
return __PRIVATE_setPersistenceProviders(t, r, new __PRIVATE_MultiTabOfflineComponentProvider(r, n.cacheSizeBytes));
|
|
@@ -19091,7 +19093,7 @@ function __PRIVATE_configureFirestore(e) {
|
|
|
19091
19093
|
* @returns A `Promise` that is resolved when the persistent storage is
|
|
19092
19094
|
* cleared. Otherwise, the promise is rejected with an error.
|
|
19093
19095
|
*/ function clearIndexedDbPersistence(e) {
|
|
19094
|
-
if (e._initialized && !e._terminated) throw new FirestoreError(
|
|
19096
|
+
if (e._initialized && !e._terminated) throw new FirestoreError(D.FAILED_PRECONDITION, "Persistence can only be cleared before a Firestore instance is initialized or after it is terminated.");
|
|
19095
19097
|
const t = new __PRIVATE_Deferred;
|
|
19096
19098
|
return e._queue.enqueueAndForgetEvenWhileRestricted((async () => {
|
|
19097
19099
|
try {
|
|
@@ -19205,7 +19207,7 @@ function __PRIVATE_configureFirestore(e) {
|
|
|
19205
19207
|
}
|
|
19206
19208
|
|
|
19207
19209
|
function __PRIVATE_verifyNotInitialized(e) {
|
|
19208
|
-
if (e._initialized || e._terminated) throw new FirestoreError(
|
|
19210
|
+
if (e._initialized || e._terminated) throw new FirestoreError(D.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.");
|
|
19209
19211
|
}
|
|
19210
19212
|
|
|
19211
19213
|
/**
|
|
@@ -19314,7 +19316,7 @@ class AggregateField {
|
|
|
19314
19316
|
try {
|
|
19315
19317
|
return new Bytes(ByteString.fromBase64String(e));
|
|
19316
19318
|
} catch (e) {
|
|
19317
|
-
throw new FirestoreError(
|
|
19319
|
+
throw new FirestoreError(D.INVALID_ARGUMENT, "Failed to construct data from Base64 string: " + e);
|
|
19318
19320
|
}
|
|
19319
19321
|
}
|
|
19320
19322
|
/**
|
|
@@ -19386,7 +19388,7 @@ class AggregateField {
|
|
|
19386
19388
|
* @param fieldNames - A list of field names.
|
|
19387
19389
|
*/
|
|
19388
19390
|
constructor(...e) {
|
|
19389
|
-
for (let t = 0; t < e.length; ++t) if (0 === e[t].length) throw new FirestoreError(
|
|
19391
|
+
for (let t = 0; t < e.length; ++t) if (0 === e[t].length) throw new FirestoreError(D.INVALID_ARGUMENT, "Invalid field name at argument $(i + 1). Field names must not be empty.");
|
|
19390
19392
|
this._internalPath = new FieldPath$1(e);
|
|
19391
19393
|
}
|
|
19392
19394
|
/**
|
|
@@ -19465,8 +19467,8 @@ class AggregateField {
|
|
|
19465
19467
|
* @param longitude - The longitude as number between -180 and 180.
|
|
19466
19468
|
*/
|
|
19467
19469
|
constructor(e, t) {
|
|
19468
|
-
if (!isFinite(e) || e < -90 || e > 90) throw new FirestoreError(
|
|
19469
|
-
if (!isFinite(t) || t < -180 || t > 180) throw new FirestoreError(
|
|
19470
|
+
if (!isFinite(e) || e < -90 || e > 90) throw new FirestoreError(D.INVALID_ARGUMENT, "Latitude must be a number between -90 and 90, but was: " + e);
|
|
19471
|
+
if (!isFinite(t) || t < -180 || t > 180) throw new FirestoreError(D.INVALID_ARGUMENT, "Longitude must be a number between -180 and 180, but was: " + t);
|
|
19470
19472
|
this._lat = e, this._long = t;
|
|
19471
19473
|
}
|
|
19472
19474
|
/**
|
|
@@ -19562,7 +19564,7 @@ class AggregateField {
|
|
|
19562
19564
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
19563
19565
|
* See the License for the specific language governing permissions and
|
|
19564
19566
|
* limitations under the License.
|
|
19565
|
-
*/ const
|
|
19567
|
+
*/ const be = /^__.*__$/;
|
|
19566
19568
|
|
|
19567
19569
|
/** The result of parsing document data (e.g. for a setData call). */ class ParsedSetData {
|
|
19568
19570
|
constructor(e, t, n) {
|
|
@@ -19673,7 +19675,7 @@ function __PRIVATE_isWrite(e) {
|
|
|
19673
19675
|
}
|
|
19674
19676
|
vu(e) {
|
|
19675
19677
|
if (0 === e.length) throw this.Mu("Document fields must not be empty");
|
|
19676
|
-
if (__PRIVATE_isWrite(this.wu) &&
|
|
19678
|
+
if (__PRIVATE_isWrite(this.wu) && be.test(e)) throw this.Mu('Document fields cannot begin and end with "__"');
|
|
19677
19679
|
}
|
|
19678
19680
|
}
|
|
19679
19681
|
|
|
@@ -19710,7 +19712,7 @@ function __PRIVATE_newUserDataReader(e) {
|
|
|
19710
19712
|
const e = [];
|
|
19711
19713
|
for (const r of s.mergeFields) {
|
|
19712
19714
|
const i = __PRIVATE_fieldPathFromArgument$1(t, r, n);
|
|
19713
|
-
if (!o.contains(i)) throw new FirestoreError(
|
|
19715
|
+
if (!o.contains(i)) throw new FirestoreError(D.INVALID_ARGUMENT, `Field '${i}' is specified in your field mask but missing from your input data.`);
|
|
19714
19716
|
__PRIVATE_fieldMaskContains(e, i) || e.push(i);
|
|
19715
19717
|
}
|
|
19716
19718
|
a = new FieldMask(e), u = o.fieldTransforms.filter((e => a.covers(e.field)));
|
|
@@ -19827,7 +19829,7 @@ class __PRIVATE_NumericIncrementFieldValueImpl extends FieldValue {
|
|
|
19827
19829
|
|
|
19828
19830
|
/** Parse update data from a list of field/value arguments. */ function __PRIVATE_parseUpdateVarargs(e, t, n, r, i, s) {
|
|
19829
19831
|
const o = e.Nu(1 /* UserDataSource.Update */ , t, n), _ = [ __PRIVATE_fieldPathFromArgument$1(t, r, n) ], a = [ i ];
|
|
19830
|
-
if (s.length % 2 != 0) throw new FirestoreError(
|
|
19832
|
+
if (s.length % 2 != 0) throw new FirestoreError(D.INVALID_ARGUMENT, `Function ${t}() needs to be called with an even number of arguments that alternate between field names and values.`);
|
|
19831
19833
|
for (let e = 0; e < s.length; e += 2) _.push(__PRIVATE_fieldPathFromArgument$1(t, s[e])),
|
|
19832
19834
|
a.push(s[e + 1]);
|
|
19833
19835
|
const u = [], c = ObjectValue.empty();
|
|
@@ -20051,7 +20053,7 @@ function __PRIVATE_validatePlainObject(e, t, n) {
|
|
|
20051
20053
|
|
|
20052
20054
|
/**
|
|
20053
20055
|
* Matches any characters in a field path string that are reserved.
|
|
20054
|
-
*/ const
|
|
20056
|
+
*/ const De = new RegExp("[~\\*/\\[\\]]");
|
|
20055
20057
|
|
|
20056
20058
|
/**
|
|
20057
20059
|
* Wraps fromDotSeparatedString with an error message about the method that
|
|
@@ -20062,7 +20064,7 @@ function __PRIVATE_validatePlainObject(e, t, n) {
|
|
|
20062
20064
|
* @param targetDoc - The document against which the field path will be
|
|
20063
20065
|
* evaluated.
|
|
20064
20066
|
*/ function __PRIVATE_fieldPathFromDotSeparatedString(e, t, n) {
|
|
20065
|
-
if (t.search(
|
|
20067
|
+
if (t.search(De) >= 0) throw __PRIVATE_createError(`Invalid field path (${t}). Paths must not contain '~', '*', '/', '[', or ']'`, e,
|
|
20066
20068
|
/* hasConverter= */ !1,
|
|
20067
20069
|
/* path= */ void 0, n);
|
|
20068
20070
|
try {
|
|
@@ -20080,7 +20082,7 @@ function __PRIVATE_createError(e, t, n, r, i) {
|
|
|
20080
20082
|
n && (_ += " (via `toFirestore()`)"), _ += ". ";
|
|
20081
20083
|
let a = "";
|
|
20082
20084
|
return (s || o) && (a += " (found", s && (a += ` in field ${r}`), o && (a += ` in document ${i}`),
|
|
20083
|
-
a += ")"), new FirestoreError(
|
|
20085
|
+
a += ")"), new FirestoreError(D.INVALID_ARGUMENT, _ + e + a);
|
|
20084
20086
|
}
|
|
20085
20087
|
|
|
20086
20088
|
/** Checks `haystack` if FieldPath `needle` is present. Runs in O(n). */ function __PRIVATE_fieldMaskContains(e, t) {
|
|
@@ -20217,7 +20219,7 @@ function __PRIVATE_createError(e, t, n, r, i) {
|
|
|
20217
20219
|
* See the License for the specific language governing permissions and
|
|
20218
20220
|
* limitations under the License.
|
|
20219
20221
|
*/ function __PRIVATE_validateHasExplicitOrderByForLimitToLast(e) {
|
|
20220
|
-
if ("L" /* LimitType.Last */ === e.limitType && 0 === e.explicitOrderBy.length) throw new FirestoreError(
|
|
20222
|
+
if ("L" /* LimitType.Last */ === e.limitType && 0 === e.explicitOrderBy.length) throw new FirestoreError(D.UNIMPLEMENTED, "limitToLast() queries require specifying at least one orderBy() clause");
|
|
20221
20223
|
}
|
|
20222
20224
|
|
|
20223
20225
|
/**
|
|
@@ -20238,7 +20240,7 @@ function query(e, t, ...n) {
|
|
|
20238
20240
|
let r = [];
|
|
20239
20241
|
t instanceof AppliableConstraint && r.push(t), r = r.concat(n), function __PRIVATE_validateQueryConstraintArray(e) {
|
|
20240
20242
|
const t = e.filter((e => e instanceof QueryCompositeFilterConstraint)).length, n = e.filter((e => e instanceof QueryFieldFilterConstraint)).length;
|
|
20241
|
-
if (t > 1 || t > 0 && n > 0) throw new FirestoreError(
|
|
20243
|
+
if (t > 1 || t > 0 && n > 0) throw new FirestoreError(D.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(...)))`.");
|
|
20242
20244
|
}
|
|
20243
20245
|
/**
|
|
20244
20246
|
* @license
|
|
@@ -20292,7 +20294,7 @@ function query(e, t, ...n) {
|
|
|
20292
20294
|
const t = __PRIVATE_newUserDataReader(e.firestore), n = function __PRIVATE_newQueryFilter(e, t, n, r, i, s, o) {
|
|
20293
20295
|
let _;
|
|
20294
20296
|
if (i.isKeyField()) {
|
|
20295
|
-
if ("array-contains" /* Operator.ARRAY_CONTAINS */ === s || "array-contains-any" /* Operator.ARRAY_CONTAINS_ANY */ === s) throw new FirestoreError(
|
|
20297
|
+
if ("array-contains" /* Operator.ARRAY_CONTAINS */ === s || "array-contains-any" /* Operator.ARRAY_CONTAINS_ANY */ === s) throw new FirestoreError(D.INVALID_ARGUMENT, `Invalid Query. You can't perform '${s}' queries on documentId().`);
|
|
20296
20298
|
if ("in" /* Operator.IN */ === s || "not-in" /* Operator.NOT_IN */ === s) {
|
|
20297
20299
|
__PRIVATE_validateDisjunctiveFilterElements(o, s);
|
|
20298
20300
|
const t = [];
|
|
@@ -20419,8 +20421,8 @@ function query(e, t, ...n) {
|
|
|
20419
20421
|
}
|
|
20420
20422
|
_apply(e) {
|
|
20421
20423
|
const t = function __PRIVATE_newQueryOrderBy(e, t, n) {
|
|
20422
|
-
if (null !== e.startAt) throw new FirestoreError(
|
|
20423
|
-
if (null !== e.endAt) throw new FirestoreError(
|
|
20424
|
+
if (null !== e.startAt) throw new FirestoreError(D.INVALID_ARGUMENT, "Invalid query. You must not call startAt() or startAfter() before calling orderBy().");
|
|
20425
|
+
if (null !== e.endAt) throw new FirestoreError(D.INVALID_ARGUMENT, "Invalid query. You must not call endAt() or endBefore() before calling orderBy().");
|
|
20424
20426
|
return new OrderBy(t, n);
|
|
20425
20427
|
}
|
|
20426
20428
|
/**
|
|
@@ -20578,7 +20580,7 @@ function endAt(...e) {
|
|
|
20578
20580
|
|
|
20579
20581
|
/** Helper function to create a bound from a document or fields */ function __PRIVATE_newQueryBoundFromDocOrFields(e, t, n, r) {
|
|
20580
20582
|
if (n[0] = util.getModularInstance(n[0]), n[0] instanceof DocumentSnapshot$1) return function __PRIVATE_newQueryBoundFromDocument(e, t, n, r, i) {
|
|
20581
|
-
if (!r) throw new FirestoreError(
|
|
20583
|
+
if (!r) throw new FirestoreError(D.NOT_FOUND, `Can't use a DocumentSnapshot that doesn't exist for ${n}().`);
|
|
20582
20584
|
const s = [];
|
|
20583
20585
|
// Because people expect to continue/end a query at the exact document
|
|
20584
20586
|
// provided, we need to use the implicit sort order rather than the explicit
|
|
@@ -20589,10 +20591,10 @@ function endAt(...e) {
|
|
|
20589
20591
|
// results.
|
|
20590
20592
|
for (const n of __PRIVATE_queryNormalizedOrderBy(e)) if (n.field.isKeyField()) s.push(__PRIVATE_refValue(t, r.key)); else {
|
|
20591
20593
|
const e = r.data.field(n.field);
|
|
20592
|
-
if (__PRIVATE_isServerTimestamp(e)) throw new FirestoreError(
|
|
20594
|
+
if (__PRIVATE_isServerTimestamp(e)) throw new FirestoreError(D.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.)');
|
|
20593
20595
|
if (null === e) {
|
|
20594
20596
|
const e = n.field.canonicalString();
|
|
20595
|
-
throw new FirestoreError(
|
|
20597
|
+
throw new FirestoreError(D.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.`);
|
|
20596
20598
|
}
|
|
20597
20599
|
s.push(e);
|
|
20598
20600
|
}
|
|
@@ -20606,15 +20608,15 @@ function endAt(...e) {
|
|
|
20606
20608
|
return function __PRIVATE_newQueryBoundFromFields(e, t, n, r, i, s) {
|
|
20607
20609
|
// Use explicit order by's because it has to match the query the user made
|
|
20608
20610
|
const o = e.explicitOrderBy;
|
|
20609
|
-
if (i.length > o.length) throw new FirestoreError(
|
|
20611
|
+
if (i.length > o.length) throw new FirestoreError(D.INVALID_ARGUMENT, `Too many arguments provided to ${r}(). The number of arguments must be less than or equal to the number of orderBy() clauses`);
|
|
20610
20612
|
const _ = [];
|
|
20611
20613
|
for (let s = 0; s < i.length; s++) {
|
|
20612
20614
|
const a = i[s];
|
|
20613
20615
|
if (o[s].field.isKeyField()) {
|
|
20614
|
-
if ("string" != typeof a) throw new FirestoreError(
|
|
20615
|
-
if (!__PRIVATE_isCollectionGroupQuery(e) && -1 !== a.indexOf("/")) throw new FirestoreError(
|
|
20616
|
+
if ("string" != typeof a) throw new FirestoreError(D.INVALID_ARGUMENT, `Invalid query. Expected a string for document ID in ${r}(), but got a ${typeof a}`);
|
|
20617
|
+
if (!__PRIVATE_isCollectionGroupQuery(e) && -1 !== a.indexOf("/")) throw new FirestoreError(D.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.`);
|
|
20616
20618
|
const n = e.path.child(ResourcePath.fromString(a));
|
|
20617
|
-
if (!DocumentKey.isDocumentKey(n)) throw new FirestoreError(
|
|
20619
|
+
if (!DocumentKey.isDocumentKey(n)) throw new FirestoreError(D.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.`);
|
|
20618
20620
|
const i = new DocumentKey(n);
|
|
20619
20621
|
_.push(__PRIVATE_refValue(t, i));
|
|
20620
20622
|
} else {
|
|
@@ -20634,21 +20636,21 @@ function endAt(...e) {
|
|
|
20634
20636
|
|
|
20635
20637
|
function __PRIVATE_parseDocumentIdValue(e, t, n) {
|
|
20636
20638
|
if ("string" == typeof (n = util.getModularInstance(n))) {
|
|
20637
|
-
if ("" === n) throw new FirestoreError(
|
|
20638
|
-
if (!__PRIVATE_isCollectionGroupQuery(t) && -1 !== n.indexOf("/")) throw new FirestoreError(
|
|
20639
|
+
if ("" === n) throw new FirestoreError(D.INVALID_ARGUMENT, "Invalid query. When querying with documentId(), you must provide a valid document ID, but it was an empty string.");
|
|
20640
|
+
if (!__PRIVATE_isCollectionGroupQuery(t) && -1 !== n.indexOf("/")) throw new FirestoreError(D.INVALID_ARGUMENT, `Invalid query. When querying a collection by documentId(), you must provide a plain document ID, but '${n}' contains a '/' character.`);
|
|
20639
20641
|
const r = t.path.child(ResourcePath.fromString(n));
|
|
20640
|
-
if (!DocumentKey.isDocumentKey(r)) throw new FirestoreError(
|
|
20642
|
+
if (!DocumentKey.isDocumentKey(r)) throw new FirestoreError(D.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}).`);
|
|
20641
20643
|
return __PRIVATE_refValue(e, new DocumentKey(r));
|
|
20642
20644
|
}
|
|
20643
20645
|
if (n instanceof DocumentReference) return __PRIVATE_refValue(e, n._key);
|
|
20644
|
-
throw new FirestoreError(
|
|
20646
|
+
throw new FirestoreError(D.INVALID_ARGUMENT, `Invalid query. When querying with documentId(), you must provide a valid string or a DocumentReference, but it was: ${__PRIVATE_valueDescription(n)}.`);
|
|
20645
20647
|
}
|
|
20646
20648
|
|
|
20647
20649
|
/**
|
|
20648
20650
|
* Validates that the value passed into a disjunctive filter satisfies all
|
|
20649
20651
|
* array requirements.
|
|
20650
20652
|
*/ function __PRIVATE_validateDisjunctiveFilterElements(e, t) {
|
|
20651
|
-
if (!Array.isArray(e) || 0 === e.length) throw new FirestoreError(
|
|
20653
|
+
if (!Array.isArray(e) || 0 === e.length) throw new FirestoreError(D.INVALID_ARGUMENT, `Invalid Query. A non-empty array is required for '${t.toString()}' filters.`);
|
|
20652
20654
|
}
|
|
20653
20655
|
|
|
20654
20656
|
/**
|
|
@@ -20682,11 +20684,11 @@ function __PRIVATE_parseDocumentIdValue(e, t, n) {
|
|
|
20682
20684
|
}(t.op));
|
|
20683
20685
|
if (null !== n)
|
|
20684
20686
|
// Special case when it's a duplicate op to give a slightly clearer error message.
|
|
20685
|
-
throw n === t.op ? new FirestoreError(
|
|
20687
|
+
throw n === t.op ? new FirestoreError(D.INVALID_ARGUMENT, `Invalid query. You cannot use more than one '${t.op.toString()}' filter.`) : new FirestoreError(D.INVALID_ARGUMENT, `Invalid query. You cannot use '${t.op.toString()}' filters with '${n.toString()}' filters.`);
|
|
20686
20688
|
}
|
|
20687
20689
|
|
|
20688
20690
|
function __PRIVATE_validateQueryFilterConstraint(e, t) {
|
|
20689
|
-
if (!(t instanceof QueryFieldFilterConstraint || t instanceof QueryCompositeFilterConstraint)) throw new FirestoreError(
|
|
20691
|
+
if (!(t instanceof QueryFieldFilterConstraint || t instanceof QueryCompositeFilterConstraint)) throw new FirestoreError(D.INVALID_ARGUMENT, `Function ${e}() requires AppliableConstraints created with a call to 'where(...)', 'or(...)', or 'and(...)'.`);
|
|
20690
20692
|
}
|
|
20691
20693
|
|
|
20692
20694
|
class AbstractUserDataWriter {
|
|
@@ -21068,7 +21070,7 @@ class __PRIVATE_LiteUserDataWriter extends AbstractUserDataWriter {
|
|
|
21068
21070
|
* snapshot events.
|
|
21069
21071
|
*/ docChanges(e = {}) {
|
|
21070
21072
|
const t = !!e.includeMetadataChanges;
|
|
21071
|
-
if (t && this._snapshot.excludesMetadataChanges) throw new FirestoreError(
|
|
21073
|
+
if (t && this._snapshot.excludesMetadataChanges) throw new FirestoreError(D.INVALID_ARGUMENT, "To include metadata changes with your document changes, you must also pass { includeMetadataChanges:true } to onSnapshot().");
|
|
21072
21074
|
return this._cachedChanges && this._cachedChangesIncludeMetadataChanges === t || (this._cachedChanges =
|
|
21073
21075
|
/** Calculates the array of `DocumentChange`s for a given `ViewSnapshot`. */
|
|
21074
21076
|
function __PRIVATE_changesFromSnapshot(e, t) {
|
|
@@ -21608,7 +21610,7 @@ class __PRIVATE_MultiTabManagerImpl {
|
|
|
21608
21610
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
21609
21611
|
* See the License for the specific language governing permissions and
|
|
21610
21612
|
* limitations under the License.
|
|
21611
|
-
*/ const
|
|
21613
|
+
*/ const ve = {
|
|
21612
21614
|
maxAttempts: 5
|
|
21613
21615
|
};
|
|
21614
21616
|
|
|
@@ -21682,12 +21684,12 @@ class WriteBatch {
|
|
|
21682
21684
|
return this._verifyNotCommitted(), this._committed = !0, this._mutations.length > 0 ? this._commitHandler(this._mutations) : Promise.resolve();
|
|
21683
21685
|
}
|
|
21684
21686
|
_verifyNotCommitted() {
|
|
21685
|
-
if (this._committed) throw new FirestoreError(
|
|
21687
|
+
if (this._committed) throw new FirestoreError(D.FAILED_PRECONDITION, "A write batch can no longer be used after commit() has been called.");
|
|
21686
21688
|
}
|
|
21687
21689
|
}
|
|
21688
21690
|
|
|
21689
21691
|
function __PRIVATE_validateReference(e, t) {
|
|
21690
|
-
if ((e = util.getModularInstance(e)).firestore !== t) throw new FirestoreError(
|
|
21692
|
+
if ((e = util.getModularInstance(e)).firestore !== t) throw new FirestoreError(D.INVALID_ARGUMENT, "Provided document reference is from a different Firestore instance.");
|
|
21691
21693
|
return e;
|
|
21692
21694
|
}
|
|
21693
21695
|
|
|
@@ -21820,9 +21822,9 @@ class Transaction extends class Transaction$1 {
|
|
|
21820
21822
|
* rejected promise with the corresponding failure error is returned.
|
|
21821
21823
|
*/ function runTransaction(e, t, n) {
|
|
21822
21824
|
e = __PRIVATE_cast(e, Firestore);
|
|
21823
|
-
const r = Object.assign(Object.assign({},
|
|
21825
|
+
const r = Object.assign(Object.assign({}, ve), n);
|
|
21824
21826
|
!function __PRIVATE_validateTransactionOptions(e) {
|
|
21825
|
-
if (e.maxAttempts < 1) throw new FirestoreError(
|
|
21827
|
+
if (e.maxAttempts < 1) throw new FirestoreError(D.INVALID_ARGUMENT, "Max attempts must be at least 1");
|
|
21826
21828
|
}(r);
|
|
21827
21829
|
return function __PRIVATE_firestoreClientTransaction(e, t, n) {
|
|
21828
21830
|
const r = new __PRIVATE_Deferred;
|
|
@@ -21986,7 +21988,7 @@ class Transaction extends class Transaction$1 {
|
|
|
21986
21988
|
try {
|
|
21987
21989
|
return JSON.parse(e);
|
|
21988
21990
|
} catch (e) {
|
|
21989
|
-
throw new FirestoreError(
|
|
21991
|
+
throw new FirestoreError(D.INVALID_ARGUMENT, "Failed to parse JSON: " + (null == e ? void 0 : e.message));
|
|
21990
21992
|
}
|
|
21991
21993
|
}(e) : e, n = [];
|
|
21992
21994
|
if (Array.isArray(t.indexes)) for (const e of t.indexes) {
|
|
@@ -22003,7 +22005,7 @@ class Transaction extends class Transaction$1 {
|
|
|
22003
22005
|
}
|
|
22004
22006
|
|
|
22005
22007
|
function __PRIVATE_tryGetString(e, t) {
|
|
22006
|
-
if ("string" != typeof e[t]) throw new FirestoreError(
|
|
22008
|
+
if ("string" != typeof e[t]) throw new FirestoreError(D.INVALID_ARGUMENT, "Missing string value for: " + t);
|
|
22007
22009
|
return e[t];
|
|
22008
22010
|
}
|
|
22009
22011
|
|
|
@@ -22046,12 +22048,12 @@ function __PRIVATE_tryGetString(e, t) {
|
|
|
22046
22048
|
*/ function getPersistentCacheIndexManager(e) {
|
|
22047
22049
|
var t;
|
|
22048
22050
|
e = __PRIVATE_cast(e, Firestore);
|
|
22049
|
-
const n =
|
|
22051
|
+
const n = Ce.get(e);
|
|
22050
22052
|
if (n) return n;
|
|
22051
22053
|
const r = ensureFirestoreConfigured(e);
|
|
22052
22054
|
if ("persistent" !== (null === (t = r._uninitializedComponentsProvider) || void 0 === t ? void 0 : t._offlineKind)) return null;
|
|
22053
22055
|
const i = new PersistentCacheIndexManager(r);
|
|
22054
|
-
return
|
|
22056
|
+
return Ce.set(e, i), i;
|
|
22055
22057
|
}
|
|
22056
22058
|
|
|
22057
22059
|
/**
|
|
@@ -22094,7 +22096,7 @@ function __PRIVATE_setPersistentCacheIndexAutoCreationEnabled(e, t) {
|
|
|
22094
22096
|
* Use a `WeakMap` so that the mapping will be automatically dropped when the
|
|
22095
22097
|
* `Firestore` instance is garbage collected. This emulates a private member
|
|
22096
22098
|
* as described in https://goo.gle/454yvug.
|
|
22097
|
-
*/ const
|
|
22099
|
+
*/ const Ce = new WeakMap;
|
|
22098
22100
|
|
|
22099
22101
|
/**
|
|
22100
22102
|
* @license
|
|
@@ -22202,10 +22204,10 @@ function _internalQueryToProtoQueryTarget(e) {
|
|
|
22202
22204
|
this.ku = new Map;
|
|
22203
22205
|
}
|
|
22204
22206
|
static get instance() {
|
|
22205
|
-
return
|
|
22206
|
-
if (
|
|
22207
|
-
|
|
22208
|
-
}(
|
|
22207
|
+
return Fe || (Fe = new __PRIVATE_TestingHooksSpiImpl, function __PRIVATE_setTestingHooksSpi(e) {
|
|
22208
|
+
if (Pe) throw new Error("a TestingHooksSpi instance is already set");
|
|
22209
|
+
Pe = e;
|
|
22210
|
+
}(Fe)), Fe;
|
|
22209
22211
|
}
|
|
22210
22212
|
et(e) {
|
|
22211
22213
|
this.ku.forEach((t => t(e)));
|
|
@@ -22216,7 +22218,7 @@ function _internalQueryToProtoQueryTarget(e) {
|
|
|
22216
22218
|
}
|
|
22217
22219
|
}
|
|
22218
22220
|
|
|
22219
|
-
let
|
|
22221
|
+
let Fe = null;
|
|
22220
22222
|
|
|
22221
22223
|
/**
|
|
22222
22224
|
* Cloud Firestore
|
|
@@ -22224,25 +22226,25 @@ let Me = null;
|
|
|
22224
22226
|
* @packageDocumentation
|
|
22225
22227
|
*/ !function __PRIVATE_registerFirestore(e, t = !0) {
|
|
22226
22228
|
!function __PRIVATE_setSDKVersion(e) {
|
|
22227
|
-
|
|
22229
|
+
S = e;
|
|
22228
22230
|
}(app.SDK_VERSION), app._registerComponent(new component.Component("firestore", ((e, {instanceIdentifier: n, options: r}) => {
|
|
22229
22231
|
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) {
|
|
22230
|
-
if (!Object.prototype.hasOwnProperty.apply(e.options, [ "projectId" ])) throw new FirestoreError(
|
|
22232
|
+
if (!Object.prototype.hasOwnProperty.apply(e.options, [ "projectId" ])) throw new FirestoreError(D.INVALID_ARGUMENT, '"projectId" not provided in firebase.initializeApp.');
|
|
22231
22233
|
return new DatabaseId(e.options.projectId, t);
|
|
22232
22234
|
}(i, n), i);
|
|
22233
22235
|
return r = Object.assign({
|
|
22234
22236
|
useFetchStreams: t
|
|
22235
22237
|
}, r), s._setSettings(r), s;
|
|
22236
|
-
}), "PUBLIC").setMultipleInstances(!0)), app.registerVersion(
|
|
22238
|
+
}), "PUBLIC").setMultipleInstances(!0)), app.registerVersion(w, "4.7.1-canary.ff0475c41", e),
|
|
22237
22239
|
// BUILD_TARGET will be replaced by values like esm5, esm2017, cjs5, etc during the compilation
|
|
22238
|
-
app.registerVersion(
|
|
22240
|
+
app.registerVersion(w, "4.7.1-canary.ff0475c41", "cjs2017");
|
|
22239
22241
|
}();
|
|
22240
22242
|
|
|
22241
22243
|
exports.AbstractUserDataWriter = AbstractUserDataWriter;
|
|
22242
22244
|
exports.AggregateField = AggregateField;
|
|
22243
22245
|
exports.AggregateQuerySnapshot = AggregateQuerySnapshot;
|
|
22244
22246
|
exports.Bytes = Bytes;
|
|
22245
|
-
exports.CACHE_SIZE_UNLIMITED =
|
|
22247
|
+
exports.CACHE_SIZE_UNLIMITED = Se;
|
|
22246
22248
|
exports.CollectionReference = CollectionReference;
|
|
22247
22249
|
exports.DocumentReference = DocumentReference;
|
|
22248
22250
|
exports.DocumentSnapshot = DocumentSnapshot;
|