@firebase/firestore 4.5.1-canary.6d31930b3 → 4.5.1-vertex-preview.8b70fc586
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +294 -294
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm2017.js +294 -294
- package/dist/index.esm2017.js.map +1 -1
- package/dist/index.esm5.js +3066 -3066
- package/dist/index.esm5.js.map +1 -1
- package/dist/index.node.cjs.js +2 -2
- package/dist/index.node.mjs +2 -2
- package/dist/index.rn.js +294 -294
- package/dist/index.rn.js.map +1 -1
- package/dist/lite/index.browser.esm2017.js +152 -151
- package/dist/lite/index.browser.esm2017.js.map +1 -1
- package/dist/lite/index.browser.esm5.js +906 -905
- package/dist/lite/index.browser.esm5.js.map +1 -1
- package/dist/lite/index.cjs.js +152 -151
- package/dist/lite/index.cjs.js.map +1 -1
- package/dist/lite/index.node.cjs.js +2 -2
- package/dist/lite/index.node.mjs +2 -2
- package/dist/lite/index.rn.esm2017.js +150 -149
- package/dist/lite/index.rn.esm2017.js.map +1 -1
- package/dist/packages/firestore/dist/index.esm2017.d.ts +2 -2
- package/package.json +9 -9
package/dist/index.cjs.js
CHANGED
|
@@ -8,7 +8,7 @@ var logger = require('@firebase/logger');
|
|
|
8
8
|
var util = require('@firebase/util');
|
|
9
9
|
var webchannelWrapper = require('@firebase/webchannel-wrapper');
|
|
10
10
|
|
|
11
|
-
const w = "@firebase/firestore";
|
|
11
|
+
const w = "@firebase/firestore", S = "4.5.1-vertex-preview.8b70fc586";
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* @license
|
|
@@ -70,7 +70,7 @@ User.MOCK_USER = new User("mock-user");
|
|
|
70
70
|
* See the License for the specific language governing permissions and
|
|
71
71
|
* limitations under the License.
|
|
72
72
|
*/
|
|
73
|
-
let
|
|
73
|
+
let b = "10.10.0-vertex-preview.8b70fc586";
|
|
74
74
|
|
|
75
75
|
/**
|
|
76
76
|
* @license
|
|
@@ -88,11 +88,11 @@ let S = "10.10.0-canary.6d31930b3";
|
|
|
88
88
|
* See the License for the specific language governing permissions and
|
|
89
89
|
* limitations under the License.
|
|
90
90
|
*/
|
|
91
|
-
const
|
|
91
|
+
const D = new logger.Logger("@firebase/firestore");
|
|
92
92
|
|
|
93
93
|
// Helper methods are needed because variables can't be exported as read/write
|
|
94
94
|
function __PRIVATE_getLogLevel() {
|
|
95
|
-
return
|
|
95
|
+
return D.logLevel;
|
|
96
96
|
}
|
|
97
97
|
|
|
98
98
|
/**
|
|
@@ -108,29 +108,29 @@ function __PRIVATE_getLogLevel() {
|
|
|
108
108
|
* <li><code>`silent` to turn off logging.</li>
|
|
109
109
|
* </ul>
|
|
110
110
|
*/ function setLogLevel(e) {
|
|
111
|
-
|
|
111
|
+
D.setLogLevel(e);
|
|
112
112
|
}
|
|
113
113
|
|
|
114
114
|
function __PRIVATE_logDebug(e, ...t) {
|
|
115
|
-
if (
|
|
115
|
+
if (D.logLevel <= logger.LogLevel.DEBUG) {
|
|
116
116
|
const n = t.map(__PRIVATE_argToString);
|
|
117
|
-
|
|
117
|
+
D.debug(`Firestore (${b}): ${e}`, ...n);
|
|
118
118
|
}
|
|
119
119
|
}
|
|
120
120
|
|
|
121
121
|
function __PRIVATE_logError(e, ...t) {
|
|
122
|
-
if (
|
|
122
|
+
if (D.logLevel <= logger.LogLevel.ERROR) {
|
|
123
123
|
const n = t.map(__PRIVATE_argToString);
|
|
124
|
-
|
|
124
|
+
D.error(`Firestore (${b}): ${e}`, ...n);
|
|
125
125
|
}
|
|
126
126
|
}
|
|
127
127
|
|
|
128
128
|
/**
|
|
129
129
|
* @internal
|
|
130
130
|
*/ function __PRIVATE_logWarn(e, ...t) {
|
|
131
|
-
if (
|
|
131
|
+
if (D.logLevel <= logger.LogLevel.WARN) {
|
|
132
132
|
const n = t.map(__PRIVATE_argToString);
|
|
133
|
-
|
|
133
|
+
D.warn(`Firestore (${b}): ${e}`, ...n);
|
|
134
134
|
}
|
|
135
135
|
}
|
|
136
136
|
|
|
@@ -191,7 +191,7 @@ function __PRIVATE_logError(e, ...t) {
|
|
|
191
191
|
*/ function fail(e = "Unexpected state") {
|
|
192
192
|
// Log the failure in addition to throw an exception, just in case the
|
|
193
193
|
// exception is swallowed.
|
|
194
|
-
const t = `FIRESTORE (${
|
|
194
|
+
const t = `FIRESTORE (${b}) INTERNAL ASSERTION FAILED: ` + e;
|
|
195
195
|
// NOTE: We don't use FirestoreError here because these are internal failures
|
|
196
196
|
// that cannot be handled by the user. (Also it would create a circular
|
|
197
197
|
// dependency between the error and assert modules which doesn't work.)
|
|
@@ -244,7 +244,7 @@ t) {
|
|
|
244
244
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
245
245
|
* See the License for the specific language governing permissions and
|
|
246
246
|
* limitations under the License.
|
|
247
|
-
*/ const
|
|
247
|
+
*/ const C = {
|
|
248
248
|
// Causes are copied from:
|
|
249
249
|
// https://github.com/grpc/grpc/blob/bceec94ea4fc5f0085d81235d8e1c06798dc341a/include/grpc%2B%2B/impl/codegen/status_code_enum.h
|
|
250
250
|
/** Not an error; returned on success. */
|
|
@@ -789,11 +789,11 @@ class Timestamp {
|
|
|
789
789
|
* The fractions of a second at nanosecond resolution.*
|
|
790
790
|
*/
|
|
791
791
|
t) {
|
|
792
|
-
if (this.seconds = e, this.nanoseconds = t, t < 0) throw new FirestoreError(
|
|
793
|
-
if (t >= 1e9) throw new FirestoreError(
|
|
794
|
-
if (e < -62135596800) throw new FirestoreError(
|
|
792
|
+
if (this.seconds = e, this.nanoseconds = t, t < 0) throw new FirestoreError(C.INVALID_ARGUMENT, "Timestamp nanoseconds out of range: " + t);
|
|
793
|
+
if (t >= 1e9) throw new FirestoreError(C.INVALID_ARGUMENT, "Timestamp nanoseconds out of range: " + t);
|
|
794
|
+
if (e < -62135596800) throw new FirestoreError(C.INVALID_ARGUMENT, "Timestamp seconds out of range: " + e);
|
|
795
795
|
// This will break in the year 10,000.
|
|
796
|
-
if (e >= 253402300800) throw new FirestoreError(
|
|
796
|
+
if (e >= 253402300800) throw new FirestoreError(C.INVALID_ARGUMENT, "Timestamp seconds out of range: " + e);
|
|
797
797
|
}
|
|
798
798
|
/**
|
|
799
799
|
* Creates a new timestamp with the current date, with millisecond precision.
|
|
@@ -1048,7 +1048,7 @@ class BasePath {
|
|
|
1048
1048
|
// for legacy reasons and should not be used frequently).
|
|
1049
1049
|
const t = [];
|
|
1050
1050
|
for (const n of e) {
|
|
1051
|
-
if (n.indexOf("//") >= 0) throw new FirestoreError(
|
|
1051
|
+
if (n.indexOf("//") >= 0) throw new FirestoreError(C.INVALID_ARGUMENT, `Invalid segment (${n}). Paths must not contain // in them.`);
|
|
1052
1052
|
// Strip leading and traling slashed.
|
|
1053
1053
|
t.push(...n.split("/").filter((e => e.length > 0)));
|
|
1054
1054
|
}
|
|
@@ -1059,7 +1059,7 @@ class BasePath {
|
|
|
1059
1059
|
}
|
|
1060
1060
|
}
|
|
1061
1061
|
|
|
1062
|
-
const
|
|
1062
|
+
const v = /^[_a-zA-Z][_a-zA-Z0-9]*$/;
|
|
1063
1063
|
|
|
1064
1064
|
/**
|
|
1065
1065
|
* A dot-separated path for navigating sub-objects within a document.
|
|
@@ -1072,7 +1072,7 @@ const C = /^[_a-zA-Z][_a-zA-Z0-9]*$/;
|
|
|
1072
1072
|
* Returns true if the string could be used as a segment in a field path
|
|
1073
1073
|
* without escaping.
|
|
1074
1074
|
*/ static isValidIdentifier(e) {
|
|
1075
|
-
return
|
|
1075
|
+
return v.test(e);
|
|
1076
1076
|
}
|
|
1077
1077
|
canonicalString() {
|
|
1078
1078
|
return this.toArray().map((e => (e = e.replace(/\\/g, "\\\\").replace(/`/g, "\\`"),
|
|
@@ -1104,21 +1104,21 @@ const C = /^[_a-zA-Z][_a-zA-Z0-9]*$/;
|
|
|
1104
1104
|
const t = [];
|
|
1105
1105
|
let n = "", r = 0;
|
|
1106
1106
|
const __PRIVATE_addCurrentSegment = () => {
|
|
1107
|
-
if (0 === n.length) throw new FirestoreError(
|
|
1107
|
+
if (0 === n.length) throw new FirestoreError(C.INVALID_ARGUMENT, `Invalid field path (${e}). Paths must not be empty, begin with '.', end with '.', or contain '..'`);
|
|
1108
1108
|
t.push(n), n = "";
|
|
1109
1109
|
};
|
|
1110
1110
|
let i = !1;
|
|
1111
1111
|
for (;r < e.length; ) {
|
|
1112
1112
|
const t = e[r];
|
|
1113
1113
|
if ("\\" === t) {
|
|
1114
|
-
if (r + 1 === e.length) throw new FirestoreError(
|
|
1114
|
+
if (r + 1 === e.length) throw new FirestoreError(C.INVALID_ARGUMENT, "Path has trailing escape character: " + e);
|
|
1115
1115
|
const t = e[r + 1];
|
|
1116
|
-
if ("\\" !== t && "." !== t && "`" !== t) throw new FirestoreError(
|
|
1116
|
+
if ("\\" !== t && "." !== t && "`" !== t) throw new FirestoreError(C.INVALID_ARGUMENT, "Path has invalid escape sequence: " + e);
|
|
1117
1117
|
n += t, r += 2;
|
|
1118
1118
|
} else "`" === t ? (i = !i, r++) : "." !== t || i ? (n += t, r++) : (__PRIVATE_addCurrentSegment(),
|
|
1119
1119
|
r++);
|
|
1120
1120
|
}
|
|
1121
|
-
if (__PRIVATE_addCurrentSegment(), i) throw new FirestoreError(
|
|
1121
|
+
if (__PRIVATE_addCurrentSegment(), i) throw new FirestoreError(C.INVALID_ARGUMENT, "Unterminated ` in path: " + e);
|
|
1122
1122
|
return new FieldPath$1(t);
|
|
1123
1123
|
}
|
|
1124
1124
|
static emptyPath() {
|
|
@@ -1370,7 +1370,7 @@ function __PRIVATE_indexOffsetComparator(e, t) {
|
|
|
1370
1370
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1371
1371
|
* See the License for the specific language governing permissions and
|
|
1372
1372
|
* limitations under the License.
|
|
1373
|
-
*/ const
|
|
1373
|
+
*/ const F = "The current tab is not in the required state to perform this operation. It might be necessary to refresh the browser tab.";
|
|
1374
1374
|
|
|
1375
1375
|
/**
|
|
1376
1376
|
* A base class representing a persistence transaction, encapsulating both the
|
|
@@ -1417,7 +1417,7 @@ function __PRIVATE_indexOffsetComparator(e, t) {
|
|
|
1417
1417
|
* @param err - An error returned by a LocalStore operation.
|
|
1418
1418
|
* @returns A Promise that resolves after we recovered, or the original error.
|
|
1419
1419
|
*/ async function __PRIVATE_ignoreIfPrimaryLeaseLoss(e) {
|
|
1420
|
-
if (e.code !==
|
|
1420
|
+
if (e.code !== C.FAILED_PRECONDITION || e.message !== F) throw e;
|
|
1421
1421
|
__PRIVATE_logDebug("LocalStore", "Unexpectedly lost primary lease");
|
|
1422
1422
|
}
|
|
1423
1423
|
|
|
@@ -1728,7 +1728,7 @@ class __PRIVATE_SimpleDbTransaction {
|
|
|
1728
1728
|
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."));
|
|
1729
1729
|
}, r.onerror = t => {
|
|
1730
1730
|
const r = t.target.error;
|
|
1731
|
-
"VersionError" === r.name ? n(new FirestoreError(
|
|
1731
|
+
"VersionError" === r.name ? n(new FirestoreError(C.FAILED_PRECONDITION, "A newer version of the Firestore SDK was previously used and so the persisted data is not compatible with the version of the SDK you are now using. The SDK will operate with persistence disabled. If you need persistence, please re-upgrade to a newer version of the SDK or else clear the persisted IndexedDB data for your app to start fresh.")) : "InvalidStateError" === r.name ? n(new FirestoreError(C.FAILED_PRECONDITION, "Unable to open an IndexedDB connection. This could be due to running in a private browsing session on a browser whose private browsing sessions do not support IndexedDB: " + r)) : n(new __PRIVATE_IndexedDbTransactionError(e, r));
|
|
1732
1732
|
}, r.onupgradeneeded = e => {
|
|
1733
1733
|
__PRIVATE_logDebug("SimpleDb", 'Database "' + this.name + '" requires upgrade from version:', e.oldVersion);
|
|
1734
1734
|
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(C.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 M = !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 M || (M = !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 x = [ "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 O = {}, N = [ "prefixPath", "collectionGroup", "readTime", "documentId" ], L = [ "prefixPath", "collectionGroup", "documentId" ], B = [ "collectionGroup", "readTime", "prefixPath", "documentId" ], k = [ "canonicalId", "targetId" ], q = [ "targetId", "path" ], Q = [ "path", "targetId" ], K = [ "collectionId", "parent" ], $ = [ "indexId", "uid" ], U = [ "uid", "sequenceNumber" ], W = [ "indexId", "uid", "arrayValue", "directionalValue", "orderedDocumentKey", "documentKey" ], G = [ "indexId", "uid", "orderedDocumentKey" ], z = [ "userId", "collectionPath", "documentId" ], j = [ "userId", "collectionPath", "largestBatchId" ], H = [ "userId", "collectionGroup", "largestBatchId" ], J = [ ...[ ...[ ...[ ...[ "mutationQueues", "mutations", "documentMutations", "remoteDocuments", "targets", "owner", "targetGlobal", "targetDocuments" ], "clientMetadata" ], "remoteDocumentGlobal" ], "collectionParents" ], "bundles", "namedQueries" ], Y = [ ...J, "documentOverlays" ], Z = [ "mutationQueues", "mutations", "documentMutations", "remoteDocumentsV14", "targets", "owner", "targetGlobal", "targetDocuments", "clientMetadata", "remoteDocumentGlobal", "collectionParents", "bundles", "namedQueries", "documentOverlays" ], X = Z, ee = [ ...X, "indexConfiguration", "indexState", "indexEntries" ], te = ee;
|
|
2309
2309
|
|
|
2310
2310
|
/**
|
|
2311
2311
|
* @license
|
|
@@ -3062,7 +3062,7 @@ function __PRIVATE_isBase64Available() {
|
|
|
3062
3062
|
|
|
3063
3063
|
ByteString.EMPTY_BYTE_STRING = new ByteString("");
|
|
3064
3064
|
|
|
3065
|
-
const
|
|
3065
|
+
const ne = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
|
|
3066
3066
|
|
|
3067
3067
|
/**
|
|
3068
3068
|
* Converts the possible Proto values for a timestamp value into a "seconds and
|
|
@@ -3076,7 +3076,7 @@ const te = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
|
|
|
3076
3076
|
// (millis), so we do some custom parsing here.
|
|
3077
3077
|
// Parse the nanos right out of the string.
|
|
3078
3078
|
let t = 0;
|
|
3079
|
-
const n =
|
|
3079
|
+
const n = ne.exec(e);
|
|
3080
3080
|
if (__PRIVATE_hardAssert(!!n), n[1]) {
|
|
3081
3081
|
// Pad the fraction out to 9 digits (nanos).
|
|
3082
3082
|
let e = n[1];
|
|
@@ -3243,7 +3243,7 @@ class DatabaseId {
|
|
|
3243
3243
|
* See the License for the specific language governing permissions and
|
|
3244
3244
|
* limitations under the License.
|
|
3245
3245
|
*/
|
|
3246
|
-
const
|
|
3246
|
+
const re = {
|
|
3247
3247
|
mapValue: {
|
|
3248
3248
|
fields: {
|
|
3249
3249
|
__type__: {
|
|
@@ -3251,7 +3251,7 @@ const ne = {
|
|
|
3251
3251
|
}
|
|
3252
3252
|
}
|
|
3253
3253
|
}
|
|
3254
|
-
},
|
|
3254
|
+
}, ie = {
|
|
3255
3255
|
nullValue: "NULL_VALUE"
|
|
3256
3256
|
};
|
|
3257
3257
|
|
|
@@ -3395,9 +3395,9 @@ function __PRIVATE_valueCompare(e, t) {
|
|
|
3395
3395
|
|
|
3396
3396
|
case 10 /* TypeOrder.ObjectValue */ :
|
|
3397
3397
|
return function __PRIVATE_compareMaps(e, t) {
|
|
3398
|
-
if (e ===
|
|
3399
|
-
if (e ===
|
|
3400
|
-
if (t ===
|
|
3398
|
+
if (e === re.mapValue && t === re.mapValue) return 0;
|
|
3399
|
+
if (e === re.mapValue) return 1;
|
|
3400
|
+
if (t === re.mapValue) return -1;
|
|
3401
3401
|
const n = e.fields || {}, r = Object.keys(n), i = t.fields || {}, s = Object.keys(i);
|
|
3402
3402
|
// Even though MapValues are likely sorted correctly based on their insertion
|
|
3403
3403
|
// order (e.g. when received from the backend), local modifications can bring
|
|
@@ -3573,7 +3573,7 @@ function isArray(e) {
|
|
|
3573
3573
|
}
|
|
3574
3574
|
|
|
3575
3575
|
/** Returns the lowest value for the given value type (inclusive). */ function __PRIVATE_valuesGetLowerBound(e) {
|
|
3576
|
-
return "nullValue" in e ?
|
|
3576
|
+
return "nullValue" in e ? ie : "booleanValue" in e ? {
|
|
3577
3577
|
booleanValue: !1
|
|
3578
3578
|
} : "integerValue" in e || "doubleValue" in e ? {
|
|
3579
3579
|
doubleValue: NaN
|
|
@@ -3619,7 +3619,7 @@ function isArray(e) {
|
|
|
3619
3619
|
arrayValue: {}
|
|
3620
3620
|
} : "arrayValue" in e ? {
|
|
3621
3621
|
mapValue: {}
|
|
3622
|
-
} : "mapValue" in e ?
|
|
3622
|
+
} : "mapValue" in e ? re : fail();
|
|
3623
3623
|
}
|
|
3624
3624
|
|
|
3625
3625
|
function __PRIVATE_lowerBoundCompare(e, t) {
|
|
@@ -4307,10 +4307,10 @@ function __PRIVATE_targetIsDocumentTarget(e) {
|
|
|
4307
4307
|
* the provided `fieldPath` (or the upper bound for an descending segment).
|
|
4308
4308
|
*/
|
|
4309
4309
|
function __PRIVATE_targetGetAscendingBound(e, t, n) {
|
|
4310
|
-
let r =
|
|
4310
|
+
let r = ie, i = !0;
|
|
4311
4311
|
// Process all filters to find a value for the current field segment
|
|
4312
4312
|
for (const n of __PRIVATE_targetGetFieldFiltersForPath(e, t)) {
|
|
4313
|
-
let e =
|
|
4313
|
+
let e = ie, t = !0;
|
|
4314
4314
|
switch (n.op) {
|
|
4315
4315
|
case "<" /* Operator.LESS_THAN */ :
|
|
4316
4316
|
case "<=" /* Operator.LESS_THAN_OR_EQUAL */ :
|
|
@@ -4329,7 +4329,7 @@ function __PRIVATE_targetGetAscendingBound(e, t, n) {
|
|
|
4329
4329
|
|
|
4330
4330
|
case "!=" /* Operator.NOT_EQUAL */ :
|
|
4331
4331
|
case "not-in" /* Operator.NOT_IN */ :
|
|
4332
|
-
e =
|
|
4332
|
+
e = ie;
|
|
4333
4333
|
// Remaining filters cannot be used as lower bounds.
|
|
4334
4334
|
}
|
|
4335
4335
|
__PRIVATE_lowerBoundCompare({
|
|
@@ -4365,10 +4365,10 @@ function __PRIVATE_targetGetAscendingBound(e, t, n) {
|
|
|
4365
4365
|
* Returns the value to use as the upper bound for ascending index segment at
|
|
4366
4366
|
* the provided `fieldPath` (or the lower bound for a descending segment).
|
|
4367
4367
|
*/ function __PRIVATE_targetGetDescendingBound(e, t, n) {
|
|
4368
|
-
let r =
|
|
4368
|
+
let r = re, i = !0;
|
|
4369
4369
|
// Process all filters to find a value for the current field segment
|
|
4370
4370
|
for (const n of __PRIVATE_targetGetFieldFiltersForPath(e, t)) {
|
|
4371
|
-
let e =
|
|
4371
|
+
let e = re, t = !0;
|
|
4372
4372
|
switch (n.op) {
|
|
4373
4373
|
case ">=" /* Operator.GREATER_THAN_OR_EQUAL */ :
|
|
4374
4374
|
case ">" /* Operator.GREATER_THAN */ :
|
|
@@ -4387,7 +4387,7 @@ function __PRIVATE_targetGetAscendingBound(e, t, n) {
|
|
|
4387
4387
|
|
|
4388
4388
|
case "!=" /* Operator.NOT_EQUAL */ :
|
|
4389
4389
|
case "not-in" /* Operator.NOT_IN */ :
|
|
4390
|
-
e =
|
|
4390
|
+
e = re;
|
|
4391
4391
|
// Remaining filters cannot be used as upper bounds.
|
|
4392
4392
|
}
|
|
4393
4393
|
__PRIVATE_upperBoundCompare({
|
|
@@ -4764,22 +4764,22 @@ function __PRIVATE_compareDocs(e, t, n) {
|
|
|
4764
4764
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
4765
4765
|
* See the License for the specific language governing permissions and
|
|
4766
4766
|
* limitations under the License.
|
|
4767
|
-
*/ const
|
|
4767
|
+
*/ const se = new SortedMap(DocumentKey.comparator);
|
|
4768
4768
|
|
|
4769
4769
|
function __PRIVATE_mutableDocumentMap() {
|
|
4770
|
-
return
|
|
4770
|
+
return se;
|
|
4771
4771
|
}
|
|
4772
4772
|
|
|
4773
|
-
const
|
|
4773
|
+
const oe = new SortedMap(DocumentKey.comparator);
|
|
4774
4774
|
|
|
4775
4775
|
function documentMap(...e) {
|
|
4776
|
-
let t =
|
|
4776
|
+
let t = oe;
|
|
4777
4777
|
for (const n of e) t = t.insert(n.key, n);
|
|
4778
4778
|
return t;
|
|
4779
4779
|
}
|
|
4780
4780
|
|
|
4781
4781
|
function __PRIVATE_convertOverlayedDocumentMapToDocumentMap(e) {
|
|
4782
|
-
let t =
|
|
4782
|
+
let t = oe;
|
|
4783
4783
|
return e.forEach(((e, n) => t = t.insert(e, n.overlayedDocument))), t;
|
|
4784
4784
|
}
|
|
4785
4785
|
|
|
@@ -4795,20 +4795,20 @@ function __PRIVATE_newDocumentKeyMap() {
|
|
|
4795
4795
|
return new ObjectMap((e => e.toString()), ((e, t) => e.isEqual(t)));
|
|
4796
4796
|
}
|
|
4797
4797
|
|
|
4798
|
-
const
|
|
4798
|
+
const _e = new SortedMap(DocumentKey.comparator);
|
|
4799
4799
|
|
|
4800
|
-
const
|
|
4800
|
+
const ae = new SortedSet(DocumentKey.comparator);
|
|
4801
4801
|
|
|
4802
4802
|
function __PRIVATE_documentKeySet(...e) {
|
|
4803
|
-
let t =
|
|
4803
|
+
let t = ae;
|
|
4804
4804
|
for (const n of e) t = t.add(n);
|
|
4805
4805
|
return t;
|
|
4806
4806
|
}
|
|
4807
4807
|
|
|
4808
|
-
const
|
|
4808
|
+
const ue = new SortedSet(__PRIVATE_primitiveComparator);
|
|
4809
4809
|
|
|
4810
4810
|
function __PRIVATE_targetIdSet() {
|
|
4811
|
-
return
|
|
4811
|
+
return ue;
|
|
4812
4812
|
}
|
|
4813
4813
|
|
|
4814
4814
|
/**
|
|
@@ -5499,7 +5499,7 @@ class __PRIVATE_VerifyMutation extends Mutation {
|
|
|
5499
5499
|
*/ static from(e, t, n) {
|
|
5500
5500
|
__PRIVATE_hardAssert(e.mutations.length === n.length);
|
|
5501
5501
|
let r = function __PRIVATE_documentVersionMap() {
|
|
5502
|
-
return
|
|
5502
|
+
return _e;
|
|
5503
5503
|
}();
|
|
5504
5504
|
const i = e.mutations;
|
|
5505
5505
|
for (let e = 0; e < i.length; e++) r = r.insert(i[e].key, n[e].version);
|
|
@@ -5613,7 +5613,7 @@ class __PRIVATE_VerifyMutation extends Mutation {
|
|
|
5613
5613
|
* Important! The names of these identifiers matter because the string forms
|
|
5614
5614
|
* are used for reverse lookups from the webchannel stream. Do NOT change the
|
|
5615
5615
|
* names of these identifiers or change this into a const enum.
|
|
5616
|
-
*/ var
|
|
5616
|
+
*/ var ce, le;
|
|
5617
5617
|
|
|
5618
5618
|
/**
|
|
5619
5619
|
* Determines whether an error code represents a permanent error when received
|
|
@@ -5626,29 +5626,29 @@ function __PRIVATE_isPermanentError(e) {
|
|
|
5626
5626
|
default:
|
|
5627
5627
|
return fail();
|
|
5628
5628
|
|
|
5629
|
-
case
|
|
5630
|
-
case
|
|
5631
|
-
case
|
|
5632
|
-
case
|
|
5633
|
-
case
|
|
5634
|
-
case
|
|
5629
|
+
case C.CANCELLED:
|
|
5630
|
+
case C.UNKNOWN:
|
|
5631
|
+
case C.DEADLINE_EXCEEDED:
|
|
5632
|
+
case C.RESOURCE_EXHAUSTED:
|
|
5633
|
+
case C.INTERNAL:
|
|
5634
|
+
case C.UNAVAILABLE:
|
|
5635
5635
|
// Unauthenticated means something went wrong with our token and we need
|
|
5636
5636
|
// to retry with new credentials which will happen automatically.
|
|
5637
|
-
case
|
|
5637
|
+
case C.UNAUTHENTICATED:
|
|
5638
5638
|
return !1;
|
|
5639
5639
|
|
|
5640
|
-
case
|
|
5641
|
-
case
|
|
5642
|
-
case
|
|
5643
|
-
case
|
|
5644
|
-
case
|
|
5640
|
+
case C.INVALID_ARGUMENT:
|
|
5641
|
+
case C.NOT_FOUND:
|
|
5642
|
+
case C.ALREADY_EXISTS:
|
|
5643
|
+
case C.PERMISSION_DENIED:
|
|
5644
|
+
case C.FAILED_PRECONDITION:
|
|
5645
5645
|
// Aborted might be retried in some scenarios, but that is dependant on
|
|
5646
5646
|
// the context and should handled individually by the calling code.
|
|
5647
5647
|
// See https://cloud.google.com/apis/design/errors.
|
|
5648
|
-
case
|
|
5649
|
-
case
|
|
5650
|
-
case
|
|
5651
|
-
case
|
|
5648
|
+
case C.ABORTED:
|
|
5649
|
+
case C.OUT_OF_RANGE:
|
|
5650
|
+
case C.UNIMPLEMENTED:
|
|
5651
|
+
case C.DATA_LOSS:
|
|
5652
5652
|
return !0;
|
|
5653
5653
|
}
|
|
5654
5654
|
}
|
|
@@ -5676,58 +5676,58 @@ function __PRIVATE_mapCodeFromRpcCode(e) {
|
|
|
5676
5676
|
if (void 0 === e)
|
|
5677
5677
|
// This shouldn't normally happen, but in certain error cases (like trying
|
|
5678
5678
|
// to send invalid proto messages) we may get an error with no GRPC code.
|
|
5679
|
-
return __PRIVATE_logError("GRPC error has no .code"),
|
|
5679
|
+
return __PRIVATE_logError("GRPC error has no .code"), C.UNKNOWN;
|
|
5680
5680
|
switch (e) {
|
|
5681
|
-
case
|
|
5682
|
-
return
|
|
5681
|
+
case ce.OK:
|
|
5682
|
+
return C.OK;
|
|
5683
5683
|
|
|
5684
|
-
case
|
|
5685
|
-
return
|
|
5684
|
+
case ce.CANCELLED:
|
|
5685
|
+
return C.CANCELLED;
|
|
5686
5686
|
|
|
5687
|
-
case
|
|
5688
|
-
return
|
|
5687
|
+
case ce.UNKNOWN:
|
|
5688
|
+
return C.UNKNOWN;
|
|
5689
5689
|
|
|
5690
|
-
case
|
|
5691
|
-
return
|
|
5690
|
+
case ce.DEADLINE_EXCEEDED:
|
|
5691
|
+
return C.DEADLINE_EXCEEDED;
|
|
5692
5692
|
|
|
5693
|
-
case
|
|
5694
|
-
return
|
|
5693
|
+
case ce.RESOURCE_EXHAUSTED:
|
|
5694
|
+
return C.RESOURCE_EXHAUSTED;
|
|
5695
5695
|
|
|
5696
|
-
case
|
|
5697
|
-
return
|
|
5696
|
+
case ce.INTERNAL:
|
|
5697
|
+
return C.INTERNAL;
|
|
5698
5698
|
|
|
5699
|
-
case
|
|
5700
|
-
return
|
|
5699
|
+
case ce.UNAVAILABLE:
|
|
5700
|
+
return C.UNAVAILABLE;
|
|
5701
5701
|
|
|
5702
|
-
case
|
|
5703
|
-
return
|
|
5702
|
+
case ce.UNAUTHENTICATED:
|
|
5703
|
+
return C.UNAUTHENTICATED;
|
|
5704
5704
|
|
|
5705
|
-
case
|
|
5706
|
-
return
|
|
5705
|
+
case ce.INVALID_ARGUMENT:
|
|
5706
|
+
return C.INVALID_ARGUMENT;
|
|
5707
5707
|
|
|
5708
|
-
case
|
|
5709
|
-
return
|
|
5708
|
+
case ce.NOT_FOUND:
|
|
5709
|
+
return C.NOT_FOUND;
|
|
5710
5710
|
|
|
5711
|
-
case
|
|
5712
|
-
return
|
|
5711
|
+
case ce.ALREADY_EXISTS:
|
|
5712
|
+
return C.ALREADY_EXISTS;
|
|
5713
5713
|
|
|
5714
|
-
case
|
|
5715
|
-
return
|
|
5714
|
+
case ce.PERMISSION_DENIED:
|
|
5715
|
+
return C.PERMISSION_DENIED;
|
|
5716
5716
|
|
|
5717
|
-
case
|
|
5718
|
-
return
|
|
5717
|
+
case ce.FAILED_PRECONDITION:
|
|
5718
|
+
return C.FAILED_PRECONDITION;
|
|
5719
5719
|
|
|
5720
|
-
case
|
|
5721
|
-
return
|
|
5720
|
+
case ce.ABORTED:
|
|
5721
|
+
return C.ABORTED;
|
|
5722
5722
|
|
|
5723
|
-
case
|
|
5724
|
-
return
|
|
5723
|
+
case ce.OUT_OF_RANGE:
|
|
5724
|
+
return C.OUT_OF_RANGE;
|
|
5725
5725
|
|
|
5726
|
-
case
|
|
5727
|
-
return
|
|
5726
|
+
case ce.UNIMPLEMENTED:
|
|
5727
|
+
return C.UNIMPLEMENTED;
|
|
5728
5728
|
|
|
5729
|
-
case
|
|
5730
|
-
return
|
|
5729
|
+
case ce.DATA_LOSS:
|
|
5730
|
+
return C.DATA_LOSS;
|
|
5731
5731
|
|
|
5732
5732
|
default:
|
|
5733
5733
|
return fail();
|
|
@@ -5741,14 +5741,14 @@ function __PRIVATE_mapCodeFromRpcCode(e) {
|
|
|
5741
5741
|
* "UNKNOWN", etc.)
|
|
5742
5742
|
* @returns The equivalent Code. Non-matching responses are mapped to
|
|
5743
5743
|
* Code.UNKNOWN.
|
|
5744
|
-
*/ (
|
|
5745
|
-
|
|
5746
|
-
|
|
5747
|
-
|
|
5748
|
-
|
|
5749
|
-
|
|
5750
|
-
|
|
5751
|
-
|
|
5744
|
+
*/ (le = ce || (ce = {}))[le.OK = 0] = "OK", le[le.CANCELLED = 1] = "CANCELLED",
|
|
5745
|
+
le[le.UNKNOWN = 2] = "UNKNOWN", le[le.INVALID_ARGUMENT = 3] = "INVALID_ARGUMENT",
|
|
5746
|
+
le[le.DEADLINE_EXCEEDED = 4] = "DEADLINE_EXCEEDED", le[le.NOT_FOUND = 5] = "NOT_FOUND",
|
|
5747
|
+
le[le.ALREADY_EXISTS = 6] = "ALREADY_EXISTS", le[le.PERMISSION_DENIED = 7] = "PERMISSION_DENIED",
|
|
5748
|
+
le[le.UNAUTHENTICATED = 16] = "UNAUTHENTICATED", le[le.RESOURCE_EXHAUSTED = 8] = "RESOURCE_EXHAUSTED",
|
|
5749
|
+
le[le.FAILED_PRECONDITION = 9] = "FAILED_PRECONDITION", le[le.ABORTED = 10] = "ABORTED",
|
|
5750
|
+
le[le.OUT_OF_RANGE = 11] = "OUT_OF_RANGE", le[le.UNIMPLEMENTED = 12] = "UNIMPLEMENTED",
|
|
5751
|
+
le[le.INTERNAL = 13] = "INTERNAL", le[le.UNAVAILABLE = 14] = "UNAVAILABLE", le[le.DATA_LOSS = 15] = "DATA_LOSS";
|
|
5752
5752
|
|
|
5753
5753
|
/**
|
|
5754
5754
|
* @license
|
|
@@ -5773,7 +5773,7 @@ ce[ce.INTERNAL = 13] = "INTERNAL", ce[ce.UNAVAILABLE = 14] = "UNAVAILABLE", ce[c
|
|
|
5773
5773
|
* integration tests that have registered callbacks to be notified of events
|
|
5774
5774
|
* that happen during the test execution.
|
|
5775
5775
|
*/
|
|
5776
|
-
let
|
|
5776
|
+
let he = null;
|
|
5777
5777
|
|
|
5778
5778
|
/**
|
|
5779
5779
|
* Sets the value of the `testingHooksSpi` object.
|
|
@@ -5821,7 +5821,7 @@ function __PRIVATE_newTextEncoder() {
|
|
|
5821
5821
|
* See the License for the specific language governing permissions and
|
|
5822
5822
|
* limitations under the License.
|
|
5823
5823
|
*/
|
|
5824
|
-
const
|
|
5824
|
+
const Pe = new webchannelWrapper.Integer([ 4294967295, 4294967295 ], 0);
|
|
5825
5825
|
|
|
5826
5826
|
// Hash a string using md5 hashing algorithm.
|
|
5827
5827
|
function __PRIVATE_getMd5HashValue(e) {
|
|
@@ -5856,7 +5856,7 @@ class BloomFilter {
|
|
|
5856
5856
|
// Calculate hashed value h(i) = h1 + (i * h2).
|
|
5857
5857
|
let r = e.add(t.multiply(webchannelWrapper.Integer.fromNumber(n)));
|
|
5858
5858
|
// Wrap if hash value overflow 64bit.
|
|
5859
|
-
return 1 === r.compare(
|
|
5859
|
+
return 1 === r.compare(Pe) && (r = new webchannelWrapper.Integer([ r.getBits(0), r.getBits(1) ], 0)),
|
|
5860
5860
|
r.modulo(this.Ee).toNumber();
|
|
5861
5861
|
}
|
|
5862
5862
|
// Return whether the bit on the given index in the bitmap is set to 1.
|
|
@@ -6274,7 +6274,7 @@ class __PRIVATE_WatchChangeAggregator {
|
|
|
6274
6274
|
const e = 2 /* BloomFilterApplicationStatus.FalsePositive */ === i ? "TargetPurposeExistenceFilterMismatchBloom" /* TargetPurpose.ExistenceFilterMismatchBloom */ : "TargetPurposeExistenceFilterMismatch" /* TargetPurpose.ExistenceFilterMismatch */;
|
|
6275
6275
|
this.Ke = this.Ke.insert(t, e);
|
|
6276
6276
|
}
|
|
6277
|
-
null ==
|
|
6277
|
+
null == he || he.tt(function __PRIVATE_createExistenceFilterMismatchInfoForTestingHooks(e, t, n, r, i) {
|
|
6278
6278
|
var s, o, _, a, u, c;
|
|
6279
6279
|
const l = {
|
|
6280
6280
|
localCacheCount: e,
|
|
@@ -6490,13 +6490,13 @@ function __PRIVATE_snapshotChangesMap() {
|
|
|
6490
6490
|
return new SortedMap(DocumentKey.comparator);
|
|
6491
6491
|
}
|
|
6492
6492
|
|
|
6493
|
-
const
|
|
6493
|
+
const Ie = (() => {
|
|
6494
6494
|
const e = {
|
|
6495
6495
|
asc: "ASCENDING",
|
|
6496
6496
|
desc: "DESCENDING"
|
|
6497
6497
|
};
|
|
6498
6498
|
return e;
|
|
6499
|
-
})(),
|
|
6499
|
+
})(), Te = (() => {
|
|
6500
6500
|
const e = {
|
|
6501
6501
|
"<": "LESS_THAN",
|
|
6502
6502
|
"<=": "LESS_THAN_OR_EQUAL",
|
|
@@ -6510,7 +6510,7 @@ const Pe = (() => {
|
|
|
6510
6510
|
"array-contains-any": "ARRAY_CONTAINS_ANY"
|
|
6511
6511
|
};
|
|
6512
6512
|
return e;
|
|
6513
|
-
})(),
|
|
6513
|
+
})(), Ee = (() => {
|
|
6514
6514
|
const e = {
|
|
6515
6515
|
and: "AND",
|
|
6516
6516
|
or: "OR"
|
|
@@ -6612,8 +6612,8 @@ function __PRIVATE_toName(e, t) {
|
|
|
6612
6612
|
|
|
6613
6613
|
function fromName(e, t) {
|
|
6614
6614
|
const n = __PRIVATE_fromResourceName(t);
|
|
6615
|
-
if (n.get(1) !== e.databaseId.projectId) throw new FirestoreError(
|
|
6616
|
-
if (n.get(3) !== e.databaseId.database) throw new FirestoreError(
|
|
6615
|
+
if (n.get(1) !== e.databaseId.projectId) throw new FirestoreError(C.INVALID_ARGUMENT, "Tried to deserialize key from different project: " + n.get(1) + " vs " + e.databaseId.projectId);
|
|
6616
|
+
if (n.get(3) !== e.databaseId.database) throw new FirestoreError(C.INVALID_ARGUMENT, "Tried to deserialize key from different database: " + n.get(3) + " vs " + e.databaseId.database);
|
|
6617
6617
|
return new DocumentKey(__PRIVATE_extractLocalPathFromResourceName(n));
|
|
6618
6618
|
}
|
|
6619
6619
|
|
|
@@ -6683,7 +6683,7 @@ function __PRIVATE_fromWatchChange(e, t) {
|
|
|
6683
6683
|
ByteString.fromBase64String(t || "")) : (__PRIVATE_hardAssert(void 0 === t || t instanceof Uint8Array),
|
|
6684
6684
|
ByteString.fromUint8Array(t || new Uint8Array));
|
|
6685
6685
|
}(e, t.targetChange.resumeToken), o = t.targetChange.cause, _ = o && function __PRIVATE_fromRpcStatus(e) {
|
|
6686
|
-
const t = void 0 === e.code ?
|
|
6686
|
+
const t = void 0 === e.code ? C.UNKNOWN : __PRIVATE_mapCodeFromRpcCode(e.code);
|
|
6687
6687
|
return new FirestoreError(t, e.message || "");
|
|
6688
6688
|
}(o);
|
|
6689
6689
|
n = new __PRIVATE_WatchTargetChange(r, i, s, _ || null);
|
|
@@ -7043,15 +7043,15 @@ function __PRIVATE_fromFilter(e) {
|
|
|
7043
7043
|
}
|
|
7044
7044
|
|
|
7045
7045
|
function __PRIVATE_toDirection(e) {
|
|
7046
|
-
return
|
|
7046
|
+
return Ie[e];
|
|
7047
7047
|
}
|
|
7048
7048
|
|
|
7049
7049
|
function __PRIVATE_toOperatorName(e) {
|
|
7050
|
-
return
|
|
7050
|
+
return Te[e];
|
|
7051
7051
|
}
|
|
7052
7052
|
|
|
7053
7053
|
function __PRIVATE_toCompositeOperatorName(e) {
|
|
7054
|
-
return
|
|
7054
|
+
return Ee[e];
|
|
7055
7055
|
}
|
|
7056
7056
|
|
|
7057
7057
|
function __PRIVATE_toFieldPathReference(e) {
|
|
@@ -8373,7 +8373,7 @@ function __PRIVATE_applyDistributionFieldAndCompositeFilters(e, t) {
|
|
|
8373
8373
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
8374
8374
|
* See the License for the specific language governing permissions and
|
|
8375
8375
|
* limitations under the License.
|
|
8376
|
-
*/ const
|
|
8376
|
+
*/ const de = new Uint8Array(0);
|
|
8377
8377
|
|
|
8378
8378
|
/**
|
|
8379
8379
|
* A persisted implementation of IndexManager.
|
|
@@ -8587,7 +8587,7 @@ class __PRIVATE_IndexedDbIndexManager {
|
|
|
8587
8587
|
// combined with the values from the query bounds.
|
|
8588
8588
|
const _ = (null != t ? t.length : 1) * Math.max(n.length, i.length), a = _ / (null != t ? t.length : 1), u = [];
|
|
8589
8589
|
for (let c = 0; c < _; ++c) {
|
|
8590
|
-
const _ = t ? this.Tn(t[c / a]) :
|
|
8590
|
+
const _ = t ? this.Tn(t[c / a]) : de, l = this.En(e, _, n[c % a], r), h = this.dn(e, _, i[c % a], s), P = o.map((t => this.En(e, _, t,
|
|
8591
8591
|
/* inclusive= */ !0)));
|
|
8592
8592
|
u.push(...this.createRange(l, h, P));
|
|
8593
8593
|
}
|
|
@@ -8784,7 +8784,7 @@ class __PRIVATE_IndexedDbIndexManager {
|
|
|
8784
8784
|
if (null != i) {
|
|
8785
8785
|
const s = e.data.field(i.fieldPath);
|
|
8786
8786
|
if (isArray(s)) for (const i of s.arrayValue.values || []) n = n.add(new __PRIVATE_IndexEntry(t.indexId, e.key, this.Tn(i), r));
|
|
8787
|
-
} else n = n.add(new __PRIVATE_IndexEntry(t.indexId, e.key,
|
|
8787
|
+
} else n = n.add(new __PRIVATE_IndexEntry(t.indexId, e.key, de, r));
|
|
8788
8788
|
return n;
|
|
8789
8789
|
}
|
|
8790
8790
|
/**
|
|
@@ -8859,7 +8859,7 @@ class __PRIVATE_IndexedDbIndexManager {
|
|
|
8859
8859
|
// If we encounter two bounds that will create an unmatchable key range,
|
|
8860
8860
|
// then we return an empty set of key ranges.
|
|
8861
8861
|
if (this.Dn(r[e], r[e + 1])) return [];
|
|
8862
|
-
const t = [ r[e].indexId, this.uid, r[e].arrayValue, r[e].directionalValue,
|
|
8862
|
+
const t = [ r[e].indexId, this.uid, r[e].arrayValue, r[e].directionalValue, de, [] ], n = [ r[e + 1].indexId, this.uid, r[e + 1].arrayValue, r[e + 1].directionalValue, de, [] ];
|
|
8863
8863
|
i.push(IDBKeyRange.bound(t, n));
|
|
8864
8864
|
}
|
|
8865
8865
|
return i;
|
|
@@ -8927,7 +8927,7 @@ function __PRIVATE_getMinOffsetFromFieldIndexes(e) {
|
|
|
8927
8927
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
8928
8928
|
* See the License for the specific language governing permissions and
|
|
8929
8929
|
* limitations under the License.
|
|
8930
|
-
*/ const
|
|
8930
|
+
*/ const Ae = {
|
|
8931
8931
|
didRun: !1,
|
|
8932
8932
|
sequenceNumbersCollected: 0,
|
|
8933
8933
|
targetsRemoved: 0,
|
|
@@ -9091,7 +9091,7 @@ class __PRIVATE_IndexedDbMutationQueue {
|
|
|
9091
9091
|
let c = new SortedSet(((e, t) => __PRIVATE_primitiveComparator(e.canonicalString(), t.canonicalString())));
|
|
9092
9092
|
for (const e of r) {
|
|
9093
9093
|
const t = __PRIVATE_newDbDocumentMutationKey(this.userId, e.key.path, o);
|
|
9094
|
-
c = c.add(e.key.path.popLast()), u.push(s.put(a)), u.push(i.put(t,
|
|
9094
|
+
c = c.add(e.key.path.popLast()), u.push(s.put(a)), u.push(i.put(t, O));
|
|
9095
9095
|
}
|
|
9096
9096
|
return c.forEach((t => {
|
|
9097
9097
|
u.push(this.indexManager.addToCollectionParentIndex(e, t));
|
|
@@ -9660,8 +9660,8 @@ class __PRIVATE_TargetIdGenerator {
|
|
|
9660
9660
|
}
|
|
9661
9661
|
collect(e, t) {
|
|
9662
9662
|
return -1 === this.params.cacheSizeCollectionThreshold ? (__PRIVATE_logDebug("LruGarbageCollector", "Garbage collection skipped; disabled"),
|
|
9663
|
-
PersistencePromise.resolve(
|
|
9664
|
-
|
|
9663
|
+
PersistencePromise.resolve(Ae)) : 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}`),
|
|
9664
|
+
Ae) : this.Yn(e, t)));
|
|
9665
9665
|
}
|
|
9666
9666
|
getCacheSize(e) {
|
|
9667
9667
|
return this.jn.getCacheSize(e);
|
|
@@ -11421,7 +11421,7 @@ class __PRIVATE_MemoryLruDelegate {
|
|
|
11421
11421
|
e.createObjectStore("mutations", {
|
|
11422
11422
|
keyPath: "batchId",
|
|
11423
11423
|
autoIncrement: !0
|
|
11424
|
-
}).createIndex("userMutationsIndex",
|
|
11424
|
+
}).createIndex("userMutationsIndex", x, {
|
|
11425
11425
|
unique: !0
|
|
11426
11426
|
}), e.createObjectStore("documentMutations");
|
|
11427
11427
|
}
|
|
@@ -11466,7 +11466,7 @@ class __PRIVATE_MemoryLruDelegate {
|
|
|
11466
11466
|
e.createObjectStore("mutations", {
|
|
11467
11467
|
keyPath: "batchId",
|
|
11468
11468
|
autoIncrement: !0
|
|
11469
|
-
}).createIndex("userMutationsIndex",
|
|
11469
|
+
}).createIndex("userMutationsIndex", x, {
|
|
11470
11470
|
unique: !0
|
|
11471
11471
|
});
|
|
11472
11472
|
const r = t.store("mutations"), i = n.map((e => r.put(e)));
|
|
@@ -11503,19 +11503,19 @@ class __PRIVATE_MemoryLruDelegate {
|
|
|
11503
11503
|
}))), n < 12 && r >= 12 && (s = s.next((() => {
|
|
11504
11504
|
!function __PRIVATE_createDocumentOverlayStore(e) {
|
|
11505
11505
|
const t = e.createObjectStore("documentOverlays", {
|
|
11506
|
-
keyPath:
|
|
11506
|
+
keyPath: z
|
|
11507
11507
|
});
|
|
11508
|
-
t.createIndex("collectionPathOverlayIndex",
|
|
11508
|
+
t.createIndex("collectionPathOverlayIndex", j, {
|
|
11509
11509
|
unique: !1
|
|
11510
|
-
}), t.createIndex("collectionGroupOverlayIndex",
|
|
11510
|
+
}), t.createIndex("collectionGroupOverlayIndex", H, {
|
|
11511
11511
|
unique: !1
|
|
11512
11512
|
});
|
|
11513
11513
|
}(e);
|
|
11514
11514
|
}))), n < 13 && r >= 13 && (s = s.next((() => function __PRIVATE_createRemoteDocumentCache(e) {
|
|
11515
11515
|
const t = e.createObjectStore("remoteDocumentsV14", {
|
|
11516
|
-
keyPath:
|
|
11516
|
+
keyPath: N
|
|
11517
11517
|
});
|
|
11518
|
-
t.createIndex("documentKeyIndex",
|
|
11518
|
+
t.createIndex("documentKeyIndex", L), t.createIndex("collectionGroupIndex", B);
|
|
11519
11519
|
}(e))).next((() => this.ii(e, i))).next((() => e.deleteObjectStore("remoteDocuments")))),
|
|
11520
11520
|
n < 14 && r >= 14 && (s = s.next((() => this.si(e, i)))), n < 15 && r >= 15 && (s = s.next((() => function __PRIVATE_createFieldIndex(e) {
|
|
11521
11521
|
e.createObjectStore("indexConfiguration", {
|
|
@@ -11525,13 +11525,13 @@ class __PRIVATE_MemoryLruDelegate {
|
|
|
11525
11525
|
unique: !1
|
|
11526
11526
|
});
|
|
11527
11527
|
e.createObjectStore("indexState", {
|
|
11528
|
-
keyPath:
|
|
11529
|
-
}).createIndex("sequenceNumberIndex",
|
|
11528
|
+
keyPath: $
|
|
11529
|
+
}).createIndex("sequenceNumberIndex", U, {
|
|
11530
11530
|
unique: !1
|
|
11531
11531
|
});
|
|
11532
11532
|
e.createObjectStore("indexEntries", {
|
|
11533
|
-
keyPath:
|
|
11534
|
-
}).createIndex("documentKeyIndex",
|
|
11533
|
+
keyPath: W
|
|
11534
|
+
}).createIndex("documentKeyIndex", G, {
|
|
11535
11535
|
unique: !1
|
|
11536
11536
|
});
|
|
11537
11537
|
}(e)))), n < 16 && r >= 16 && (
|
|
@@ -11586,7 +11586,7 @@ class __PRIVATE_MemoryLruDelegate {
|
|
|
11586
11586
|
ni(e, t) {
|
|
11587
11587
|
// Create the index.
|
|
11588
11588
|
e.createObjectStore("collectionParents", {
|
|
11589
|
-
keyPath:
|
|
11589
|
+
keyPath: K
|
|
11590
11590
|
});
|
|
11591
11591
|
const n = t.store("collectionParents"), r = new __PRIVATE_MemoryCollectionParentIndex, addEntry = e => {
|
|
11592
11592
|
if (r.add(e)) {
|
|
@@ -11671,19 +11671,19 @@ class __PRIVATE_MemoryLruDelegate {
|
|
|
11671
11671
|
|
|
11672
11672
|
function __PRIVATE_createQueryCache(e) {
|
|
11673
11673
|
e.createObjectStore("targetDocuments", {
|
|
11674
|
-
keyPath:
|
|
11675
|
-
}).createIndex("documentTargetsIndex",
|
|
11674
|
+
keyPath: q
|
|
11675
|
+
}).createIndex("documentTargetsIndex", Q, {
|
|
11676
11676
|
unique: !0
|
|
11677
11677
|
});
|
|
11678
11678
|
// NOTE: This is unique only because the TargetId is the suffix.
|
|
11679
11679
|
e.createObjectStore("targets", {
|
|
11680
11680
|
keyPath: "targetId"
|
|
11681
|
-
}).createIndex("queryTargetsIndex",
|
|
11681
|
+
}).createIndex("queryTargetsIndex", k, {
|
|
11682
11682
|
unique: !0
|
|
11683
11683
|
}), e.createObjectStore("targetGlobal");
|
|
11684
11684
|
}
|
|
11685
11685
|
|
|
11686
|
-
const
|
|
11686
|
+
const Re = "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.";
|
|
11687
11687
|
|
|
11688
11688
|
/**
|
|
11689
11689
|
* Oldest acceptable age in milliseconds for client metadata before the client
|
|
@@ -11759,7 +11759,7 @@ class __PRIVATE_IndexedDbPersistence {
|
|
|
11759
11759
|
/** The last time we garbage collected the client metadata object store. */
|
|
11760
11760
|
this.Pi = Number.NEGATIVE_INFINITY,
|
|
11761
11761
|
/** A listener to notify on primary state changes. */
|
|
11762
|
-
this.Ii = e => Promise.resolve(), !__PRIVATE_IndexedDbPersistence.D()) throw new FirestoreError(
|
|
11762
|
+
this.Ii = e => Promise.resolve(), !__PRIVATE_IndexedDbPersistence.D()) throw new FirestoreError(C.UNIMPLEMENTED, "This platform is either missing IndexedDB or is known to have an incomplete implementation. Offline persistence has been disabled.");
|
|
11763
11763
|
this.referenceDelegate = new __PRIVATE_IndexedDbLruDelegateImpl(this, r), this.Ti = t + "main",
|
|
11764
11764
|
this.serializer = new __PRIVATE_LocalSerializer(_), this.Ei = new __PRIVATE_SimpleDb(this.Ti, this.ui, new __PRIVATE_SchemaConverter(this.serializer)),
|
|
11765
11765
|
this.Qr = new __PRIVATE_IndexedDbTargetCache(this.referenceDelegate, this.serializer),
|
|
@@ -11779,7 +11779,7 @@ class __PRIVATE_IndexedDbPersistence {
|
|
|
11779
11779
|
if (!this.isPrimary && !this.allowTabSynchronization)
|
|
11780
11780
|
// Fail `start()` if `synchronizeTabs` is disabled and we cannot
|
|
11781
11781
|
// obtain the primary lease.
|
|
11782
|
-
throw new FirestoreError(
|
|
11782
|
+
throw new FirestoreError(C.FAILED_PRECONDITION, Re);
|
|
11783
11783
|
return this.Ri(), this.Vi(), this.mi(), this.runTransaction("getHighestListenSequenceNumber", "readonly", (e => this.Qr.getHighestSequenceNumber(e)));
|
|
11784
11784
|
})).then((e => {
|
|
11785
11785
|
this.kr = new __PRIVATE_ListenSequence(e, this._i);
|
|
@@ -11921,7 +11921,7 @@ class __PRIVATE_IndexedDbPersistence {
|
|
|
11921
11921
|
// settings is not supported.
|
|
11922
11922
|
// TODO(b/114226234): Remove this check when `synchronizeTabs` can
|
|
11923
11923
|
// no longer be turned off.
|
|
11924
|
-
throw new FirestoreError(
|
|
11924
|
+
throw new FirestoreError(C.FAILED_PRECONDITION, Re);
|
|
11925
11925
|
return !1;
|
|
11926
11926
|
}
|
|
11927
11927
|
}
|
|
@@ -11991,7 +11991,7 @@ class __PRIVATE_IndexedDbPersistence {
|
|
|
11991
11991
|
const r = "readonly" === t ? "readonly" : "readwrite", i =
|
|
11992
11992
|
/** Returns the object stores for the provided schema. */
|
|
11993
11993
|
function __PRIVATE_getObjectStores(e) {
|
|
11994
|
-
return 16 === e ?
|
|
11994
|
+
return 16 === e ? te : 15 === e ? ee : 14 === e ? X : 13 === e ? Z : 12 === e ? Y : 11 === e ? J : void fail();
|
|
11995
11995
|
}(this.ui);
|
|
11996
11996
|
let s;
|
|
11997
11997
|
// Do all transactions as readwrite against all object stores, since we
|
|
@@ -11999,7 +11999,7 @@ class __PRIVATE_IndexedDbPersistence {
|
|
|
11999
11999
|
return this.Ei.runTransaction(e, r, i, (r => (s = new __PRIVATE_IndexedDbTransaction(r, this.kr ? this.kr.next() : __PRIVATE_ListenSequence._e),
|
|
12000
12000
|
"readwrite-primary" === t ? this.gi(s).next((e => !!e || this.pi(s))).next((t => {
|
|
12001
12001
|
if (!t) throw __PRIVATE_logError(`Failed to obtain primary lease for action '${e}'.`),
|
|
12002
|
-
this.isPrimary = !1, this.oi.enqueueRetryable((() => this.Ii(!1))), new FirestoreError(
|
|
12002
|
+
this.isPrimary = !1, this.oi.enqueueRetryable((() => this.Ii(!1))), new FirestoreError(C.FAILED_PRECONDITION, F);
|
|
12003
12003
|
return n(s);
|
|
12004
12004
|
})).next((e => this.wi(s).next((() => e)))) : this.ki(s).next((() => n(s)))))).then((e => (s.raiseOnCommittedEvent(),
|
|
12005
12005
|
e)));
|
|
@@ -12012,7 +12012,7 @@ class __PRIVATE_IndexedDbPersistence {
|
|
|
12012
12012
|
// be turned off.
|
|
12013
12013
|
ki(e) {
|
|
12014
12014
|
return __PRIVATE_primaryClientStore(e).get("owner").next((e => {
|
|
12015
|
-
if (null !== e && this.Ci(e.leaseTimestampMs, 5e3) && !this.Mi(e.ownerId) && !this.Si(e) && !(this.ai || this.allowTabSynchronization && e.allowTabSynchronization)) throw new FirestoreError(
|
|
12015
|
+
if (null !== e && this.Ci(e.leaseTimestampMs, 5e3) && !this.Mi(e.ownerId) && !this.Si(e) && !(this.ai || this.allowTabSynchronization && e.allowTabSynchronization)) throw new FirestoreError(C.FAILED_PRECONDITION, Re);
|
|
12016
12016
|
}));
|
|
12017
12017
|
}
|
|
12018
12018
|
/**
|
|
@@ -13509,7 +13509,7 @@ class __PRIVATE_BrowserConnectivityMonitor {
|
|
|
13509
13509
|
/**
|
|
13510
13510
|
* The value returned from the most recent invocation of
|
|
13511
13511
|
* `generateUniqueDebugId()`, or null if it has never been invoked.
|
|
13512
|
-
*/ let
|
|
13512
|
+
*/ let Ve = null;
|
|
13513
13513
|
|
|
13514
13514
|
/**
|
|
13515
13515
|
* Generates and returns an initial value for `lastUniqueDebugId`.
|
|
@@ -13534,9 +13534,9 @@ class __PRIVATE_BrowserConnectivityMonitor {
|
|
|
13534
13534
|
* @return the 10-character generated ID (e.g. "0xa1b2c3d4").
|
|
13535
13535
|
*/
|
|
13536
13536
|
function __PRIVATE_generateUniqueDebugId() {
|
|
13537
|
-
return null ===
|
|
13537
|
+
return null === Ve ? Ve = function __PRIVATE_generateInitialUniqueDebugId() {
|
|
13538
13538
|
return 268435456 + Math.round(2147483648 * Math.random());
|
|
13539
|
-
}() :
|
|
13539
|
+
}() : Ve++, "0x" + Ve.toString(16);
|
|
13540
13540
|
}
|
|
13541
13541
|
|
|
13542
13542
|
/**
|
|
@@ -13554,7 +13554,7 @@ function __PRIVATE_generateUniqueDebugId() {
|
|
|
13554
13554
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13555
13555
|
* See the License for the specific language governing permissions and
|
|
13556
13556
|
* limitations under the License.
|
|
13557
|
-
*/ const
|
|
13557
|
+
*/ const me = {
|
|
13558
13558
|
BatchGetDocuments: "batchGet",
|
|
13559
13559
|
Commit: "commit",
|
|
13560
13560
|
RunQuery: "runQuery",
|
|
@@ -13632,7 +13632,7 @@ class __PRIVATE_StreamBridge {
|
|
|
13632
13632
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13633
13633
|
* See the License for the specific language governing permissions and
|
|
13634
13634
|
* limitations under the License.
|
|
13635
|
-
*/ const
|
|
13635
|
+
*/ const fe = "WebChannelConnection";
|
|
13636
13636
|
|
|
13637
13637
|
class __PRIVATE_WebChannelConnection extends
|
|
13638
13638
|
/**
|
|
@@ -13676,7 +13676,7 @@ class __PRIVATE_RestConnection {
|
|
|
13676
13676
|
// SDK_VERSION is updated to different value at runtime depending on the entry point,
|
|
13677
13677
|
// so we need to get its value when we need it in a function.
|
|
13678
13678
|
function __PRIVATE_getGoogApiClientValue() {
|
|
13679
|
-
return "gl-js/ fire/" +
|
|
13679
|
+
return "gl-js/ fire/" + b;
|
|
13680
13680
|
}(),
|
|
13681
13681
|
// Content-Type: text/plain will avoid preflight requests which might
|
|
13682
13682
|
// mess with CORS and redirects by proxies. If we add custom headers
|
|
@@ -13686,7 +13686,7 @@ class __PRIVATE_RestConnection {
|
|
|
13686
13686
|
t && t.headers.forEach(((t, n) => e[n] = t)), n && n.headers.forEach(((t, n) => e[n] = t));
|
|
13687
13687
|
}
|
|
13688
13688
|
bo(e, t) {
|
|
13689
|
-
const n =
|
|
13689
|
+
const n = me[e];
|
|
13690
13690
|
return `${this.fo}/v1/${t}:${n}`;
|
|
13691
13691
|
}
|
|
13692
13692
|
/**
|
|
@@ -13710,17 +13710,17 @@ class __PRIVATE_RestConnection {
|
|
|
13710
13710
|
switch (_.getLastErrorCode()) {
|
|
13711
13711
|
case webchannelWrapper.ErrorCode.NO_ERROR:
|
|
13712
13712
|
const t = _.getResponseJson();
|
|
13713
|
-
__PRIVATE_logDebug(
|
|
13713
|
+
__PRIVATE_logDebug(fe, `XHR for RPC '${e}' ${i} received:`, JSON.stringify(t)),
|
|
13714
13714
|
s(t);
|
|
13715
13715
|
break;
|
|
13716
13716
|
|
|
13717
13717
|
case webchannelWrapper.ErrorCode.TIMEOUT:
|
|
13718
|
-
__PRIVATE_logDebug(
|
|
13718
|
+
__PRIVATE_logDebug(fe, `RPC '${e}' ${i} timed out`), o(new FirestoreError(C.DEADLINE_EXCEEDED, "Request time out"));
|
|
13719
13719
|
break;
|
|
13720
13720
|
|
|
13721
13721
|
case webchannelWrapper.ErrorCode.HTTP_ERROR:
|
|
13722
13722
|
const n = _.getStatus();
|
|
13723
|
-
if (__PRIVATE_logDebug(
|
|
13723
|
+
if (__PRIVATE_logDebug(fe, `RPC '${e}' ${i} failed with status:`, n, "response text:", _.getResponseText()),
|
|
13724
13724
|
n > 0) {
|
|
13725
13725
|
let e = _.getResponseJson();
|
|
13726
13726
|
Array.isArray(e) && (e = e[0]);
|
|
@@ -13728,25 +13728,25 @@ class __PRIVATE_RestConnection {
|
|
|
13728
13728
|
if (t && t.status && t.message) {
|
|
13729
13729
|
const e = function __PRIVATE_mapCodeFromHttpResponseErrorStatus(e) {
|
|
13730
13730
|
const t = e.toLowerCase().replace(/_/g, "-");
|
|
13731
|
-
return Object.values(
|
|
13731
|
+
return Object.values(C).indexOf(t) >= 0 ? t : C.UNKNOWN;
|
|
13732
13732
|
}(t.status);
|
|
13733
13733
|
o(new FirestoreError(e, t.message));
|
|
13734
|
-
} else o(new FirestoreError(
|
|
13734
|
+
} else o(new FirestoreError(C.UNKNOWN, "Server responded with status " + _.getStatus()));
|
|
13735
13735
|
} else
|
|
13736
13736
|
// If we received an HTTP_ERROR but there's no status code,
|
|
13737
13737
|
// it's most probably a connection issue
|
|
13738
|
-
o(new FirestoreError(
|
|
13738
|
+
o(new FirestoreError(C.UNAVAILABLE, "Connection failed."));
|
|
13739
13739
|
break;
|
|
13740
13740
|
|
|
13741
13741
|
default:
|
|
13742
13742
|
fail();
|
|
13743
13743
|
}
|
|
13744
13744
|
} finally {
|
|
13745
|
-
__PRIVATE_logDebug(
|
|
13745
|
+
__PRIVATE_logDebug(fe, `RPC '${e}' ${i} completed.`);
|
|
13746
13746
|
}
|
|
13747
13747
|
}));
|
|
13748
13748
|
const a = JSON.stringify(r);
|
|
13749
|
-
__PRIVATE_logDebug(
|
|
13749
|
+
__PRIVATE_logDebug(fe, `RPC '${e}' ${i} sending request:`, r), _.send(t, "POST", a, n, 15);
|
|
13750
13750
|
}));
|
|
13751
13751
|
}
|
|
13752
13752
|
Fo(e, t, n) {
|
|
@@ -13787,7 +13787,7 @@ class __PRIVATE_RestConnection {
|
|
|
13787
13787
|
// which is recognized by the webchannel backend.
|
|
13788
13788
|
_.encodeInitMessageHeaders = !0;
|
|
13789
13789
|
const u = i.join("");
|
|
13790
|
-
__PRIVATE_logDebug(
|
|
13790
|
+
__PRIVATE_logDebug(fe, `Creating RPC '${e}' stream ${r}: ${u}`, _);
|
|
13791
13791
|
const c = s.createWebChannel(u, _);
|
|
13792
13792
|
// WebChannel supports sending the first message with the handshake - saving
|
|
13793
13793
|
// a network round trip. However, it will have to call send in the same
|
|
@@ -13800,8 +13800,8 @@ class __PRIVATE_RestConnection {
|
|
|
13800
13800
|
// on a closed stream
|
|
13801
13801
|
const P = new __PRIVATE_StreamBridge({
|
|
13802
13802
|
lo: t => {
|
|
13803
|
-
h ? __PRIVATE_logDebug(
|
|
13804
|
-
c.open(), l = !0), __PRIVATE_logDebug(
|
|
13803
|
+
h ? __PRIVATE_logDebug(fe, `Not sending because RPC '${e}' stream ${r} is closed:`, t) : (l || (__PRIVATE_logDebug(fe, `Opening RPC '${e}' stream ${r} transport.`),
|
|
13804
|
+
c.open(), l = !0), __PRIVATE_logDebug(fe, `RPC '${e}' stream ${r} sending:`, t),
|
|
13805
13805
|
c.send(t));
|
|
13806
13806
|
},
|
|
13807
13807
|
ho: () => c.close()
|
|
@@ -13823,13 +13823,13 @@ class __PRIVATE_RestConnection {
|
|
|
13823
13823
|
// Note that eventually this function could go away if we are confident
|
|
13824
13824
|
// enough the code is exception free.
|
|
13825
13825
|
return __PRIVATE_unguardedEventListen(c, webchannelWrapper.WebChannel.EventType.OPEN, (() => {
|
|
13826
|
-
h || __PRIVATE_logDebug(
|
|
13826
|
+
h || __PRIVATE_logDebug(fe, `RPC '${e}' stream ${r} transport opened.`);
|
|
13827
13827
|
})), __PRIVATE_unguardedEventListen(c, webchannelWrapper.WebChannel.EventType.CLOSE, (() => {
|
|
13828
|
-
h || (h = !0, __PRIVATE_logDebug(
|
|
13828
|
+
h || (h = !0, __PRIVATE_logDebug(fe, `RPC '${e}' stream ${r} transport closed`),
|
|
13829
13829
|
P.Vo());
|
|
13830
13830
|
})), __PRIVATE_unguardedEventListen(c, webchannelWrapper.WebChannel.EventType.ERROR, (t => {
|
|
13831
|
-
h || (h = !0, __PRIVATE_logWarn(
|
|
13832
|
-
P.Vo(new FirestoreError(
|
|
13831
|
+
h || (h = !0, __PRIVATE_logWarn(fe, `RPC '${e}' stream ${r} transport errored:`, t),
|
|
13832
|
+
P.Vo(new FirestoreError(C.UNAVAILABLE, "The operation could not be completed")));
|
|
13833
13833
|
})), __PRIVATE_unguardedEventListen(c, webchannelWrapper.WebChannel.EventType.MESSAGE, (t => {
|
|
13834
13834
|
var n;
|
|
13835
13835
|
if (!h) {
|
|
@@ -13842,7 +13842,7 @@ class __PRIVATE_RestConnection {
|
|
|
13842
13842
|
// Use any because msgData.error is not typed.
|
|
13843
13843
|
const s = i, o = s.error || (null === (n = s[0]) || void 0 === n ? void 0 : n.error);
|
|
13844
13844
|
if (o) {
|
|
13845
|
-
__PRIVATE_logDebug(
|
|
13845
|
+
__PRIVATE_logDebug(fe, `RPC '${e}' stream ${r} received error:`, o);
|
|
13846
13846
|
// error.status will be a string like 'OK' or 'NOT_FOUND'.
|
|
13847
13847
|
const t = o.status;
|
|
13848
13848
|
let n =
|
|
@@ -13855,16 +13855,16 @@ class __PRIVATE_RestConnection {
|
|
|
13855
13855
|
function __PRIVATE_mapCodeFromRpcStatus(e) {
|
|
13856
13856
|
// lookup by string
|
|
13857
13857
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
13858
|
-
const t =
|
|
13858
|
+
const t = ce[e];
|
|
13859
13859
|
if (void 0 !== t) return __PRIVATE_mapCodeFromRpcCode(t);
|
|
13860
13860
|
}(t), i = o.message;
|
|
13861
|
-
void 0 === n && (n =
|
|
13861
|
+
void 0 === n && (n = C.INTERNAL, i = "Unknown error status: " + t + " with message " + o.message),
|
|
13862
13862
|
// Mark closed so no further events are propagated
|
|
13863
13863
|
h = !0, P.Vo(new FirestoreError(n, i)), c.close();
|
|
13864
|
-
} else __PRIVATE_logDebug(
|
|
13864
|
+
} else __PRIVATE_logDebug(fe, `RPC '${e}' stream ${r} received:`, i), P.mo(i);
|
|
13865
13865
|
}
|
|
13866
13866
|
})), __PRIVATE_unguardedEventListen(o, webchannelWrapper.Event.STAT_EVENT, (t => {
|
|
13867
|
-
t.stat === webchannelWrapper.Stat.PROXY ? __PRIVATE_logDebug(
|
|
13867
|
+
t.stat === webchannelWrapper.Stat.PROXY ? __PRIVATE_logDebug(fe, `RPC '${e}' stream ${r} detected buffering proxy`) : t.stat === webchannelWrapper.Stat.NOPROXY && __PRIVATE_logDebug(fe, `RPC '${e}' stream ${r} detected no buffering proxy`);
|
|
13868
13868
|
})), setTimeout((() => {
|
|
13869
13869
|
// Technically we could/should wait for the WebChannel opened event,
|
|
13870
13870
|
// but because we want to send the first message with the WebChannel
|
|
@@ -14188,10 +14188,10 @@ class __PRIVATE_PersistentStream {
|
|
|
14188
14188
|
// underlying stream), guaranteeing they won't execute.
|
|
14189
14189
|
this.Wo++, 4 /* PersistentStreamState.Error */ !== e ?
|
|
14190
14190
|
// If this is an intentional close ensure we don't delay our next connection attempt.
|
|
14191
|
-
this.jo.reset() : t && t.code ===
|
|
14191
|
+
this.jo.reset() : t && t.code === C.RESOURCE_EXHAUSTED ? (
|
|
14192
14192
|
// Log the error. (Probably either 'quota exceeded' or 'max queue length reached'.)
|
|
14193
14193
|
__PRIVATE_logError(t.toString()), __PRIVATE_logError("Using maximum backoff delay to prevent overloading the backend."),
|
|
14194
|
-
this.jo.ko()) : t && t.code ===
|
|
14194
|
+
this.jo.ko()) : t && t.code === C.UNAUTHENTICATED && 3 /* PersistentStreamState.Healthy */ !== this.state && (
|
|
14195
14195
|
// "unauthenticated" error means the token was rejected. This should rarely
|
|
14196
14196
|
// happen since both Auth and AppCheck ensure a sufficient TTL when we
|
|
14197
14197
|
// request a token. If a user manually resets their system clock this can
|
|
@@ -14227,7 +14227,7 @@ class __PRIVATE_PersistentStream {
|
|
|
14227
14227
|
this.o_(e, n);
|
|
14228
14228
|
}), (t => {
|
|
14229
14229
|
e((() => {
|
|
14230
|
-
const e = new FirestoreError(
|
|
14230
|
+
const e = new FirestoreError(C.UNKNOWN, "Fetching auth token failed: " + t.message);
|
|
14231
14231
|
return this.__(e);
|
|
14232
14232
|
}));
|
|
14233
14233
|
}));
|
|
@@ -14440,18 +14440,18 @@ class __PRIVATE_DatastoreImpl extends class Datastore {} {
|
|
|
14440
14440
|
this.serializer = r, this.A_ = !1;
|
|
14441
14441
|
}
|
|
14442
14442
|
R_() {
|
|
14443
|
-
if (this.A_) throw new FirestoreError(
|
|
14443
|
+
if (this.A_) throw new FirestoreError(C.FAILED_PRECONDITION, "The client has already been terminated.");
|
|
14444
14444
|
}
|
|
14445
14445
|
/** Invokes the provided RPC with auth and AppCheck tokens. */ So(e, t, n, r) {
|
|
14446
14446
|
return this.R_(), Promise.all([ this.authCredentials.getToken(), this.appCheckCredentials.getToken() ]).then((([i, s]) => this.connection.So(e, __PRIVATE_toResourcePath(t, n), r, i, s))).catch((e => {
|
|
14447
|
-
throw "FirebaseError" === e.name ? (e.code ===
|
|
14448
|
-
this.appCheckCredentials.invalidateToken()), e) : new FirestoreError(
|
|
14447
|
+
throw "FirebaseError" === e.name ? (e.code === C.UNAUTHENTICATED && (this.authCredentials.invalidateToken(),
|
|
14448
|
+
this.appCheckCredentials.invalidateToken()), e) : new FirestoreError(C.UNKNOWN, e.toString());
|
|
14449
14449
|
}));
|
|
14450
14450
|
}
|
|
14451
14451
|
/** Invokes the provided RPC with streamed results with auth and AppCheck tokens. */ vo(e, t, n, r, i) {
|
|
14452
14452
|
return this.R_(), Promise.all([ this.authCredentials.getToken(), this.appCheckCredentials.getToken() ]).then((([s, o]) => this.connection.vo(e, __PRIVATE_toResourcePath(t, n), r, s, o, i))).catch((e => {
|
|
14453
|
-
throw "FirebaseError" === e.name ? (e.code ===
|
|
14454
|
-
this.appCheckCredentials.invalidateToken()), e) : new FirestoreError(
|
|
14453
|
+
throw "FirebaseError" === e.name ? (e.code === C.UNAUTHENTICATED && (this.authCredentials.invalidateToken(),
|
|
14454
|
+
this.appCheckCredentials.invalidateToken()), e) : new FirestoreError(C.UNKNOWN, e.toString());
|
|
14455
14455
|
}));
|
|
14456
14456
|
}
|
|
14457
14457
|
terminate() {
|
|
@@ -14943,7 +14943,7 @@ async function __PRIVATE_onWriteStreamClose(e, t) {
|
|
|
14943
14943
|
// Only handle permanent errors here. If it's transient, just let the retry
|
|
14944
14944
|
// logic kick in.
|
|
14945
14945
|
if (function __PRIVATE_isPermanentWriteError(e) {
|
|
14946
|
-
return __PRIVATE_isPermanentError(e) && e !==
|
|
14946
|
+
return __PRIVATE_isPermanentError(e) && e !== C.ABORTED;
|
|
14947
14947
|
}(t.code)) {
|
|
14948
14948
|
// This was a permanent error, the request itself was the problem
|
|
14949
14949
|
// so it's not going to succeed if we resend it.
|
|
@@ -15124,7 +15124,7 @@ class DelayedOperation {
|
|
|
15124
15124
|
* As long as the operation has not yet been run, calling cancel() provides a
|
|
15125
15125
|
* guarantee that the operation will not be run.
|
|
15126
15126
|
*/ cancel(e) {
|
|
15127
|
-
null !== this.timerHandle && (this.clearTimeout(), this.deferred.reject(new FirestoreError(
|
|
15127
|
+
null !== this.timerHandle && (this.clearTimeout(), this.deferred.reject(new FirestoreError(C.CANCELLED, "Operation cancelled" + (e ? ": " + e : ""))));
|
|
15128
15128
|
}
|
|
15129
15129
|
handleDelayElapsed() {
|
|
15130
15130
|
this.asyncQueue.enqueueAndForget((() => null !== this.timerHandle ? (this.clearTimeout(),
|
|
@@ -15140,7 +15140,7 @@ class DelayedOperation {
|
|
|
15140
15140
|
* Returns a FirestoreError that can be surfaced to the user if the provided
|
|
15141
15141
|
* error is an IndexedDbTransactionError. Re-throws the error otherwise.
|
|
15142
15142
|
*/ function __PRIVATE_wrapInUserErrorIfRecoverable(e, t) {
|
|
15143
|
-
if (__PRIVATE_logError("AsyncQueue", `${t}: ${e}`), __PRIVATE_isIndexedDbTransactionError(e)) return new FirestoreError(
|
|
15143
|
+
if (__PRIVATE_logError("AsyncQueue", `${t}: ${e}`), __PRIVATE_isIndexedDbTransactionError(e)) return new FirestoreError(C.UNAVAILABLE, `${t}: ${e}`);
|
|
15144
15144
|
throw e;
|
|
15145
15145
|
}
|
|
15146
15146
|
|
|
@@ -15453,12 +15453,12 @@ function __PRIVATE_raiseSnapshotsInSyncEvent(e) {
|
|
|
15453
15453
|
}));
|
|
15454
15454
|
}
|
|
15455
15455
|
|
|
15456
|
-
var
|
|
15456
|
+
var ge, pe;
|
|
15457
15457
|
|
|
15458
15458
|
/** Listen to both cache and server changes */
|
|
15459
|
-
(
|
|
15459
|
+
(pe = ge || (ge = {})).j_ = "default",
|
|
15460
15460
|
/** Listen to changes in cache only */
|
|
15461
|
-
|
|
15461
|
+
pe.Cache = "cache";
|
|
15462
15462
|
|
|
15463
15463
|
/**
|
|
15464
15464
|
* QueryListener takes a series of internal view snapshots and determines
|
|
@@ -15533,7 +15533,7 @@ class __PRIVATE_QueryListener {
|
|
|
15533
15533
|
this.J_ = !0, this.H_.next(e);
|
|
15534
15534
|
}
|
|
15535
15535
|
U_() {
|
|
15536
|
-
return this.options.source !==
|
|
15536
|
+
return this.options.source !== ge.Cache;
|
|
15537
15537
|
}
|
|
15538
15538
|
}
|
|
15539
15539
|
|
|
@@ -16495,7 +16495,7 @@ async function __PRIVATE_syncEngineHandleCredentialChange(e, t) {
|
|
|
16495
16495
|
function __PRIVATE_rejectOutstandingPendingWritesCallbacks(e, t) {
|
|
16496
16496
|
e.Ma.forEach((e => {
|
|
16497
16497
|
e.forEach((e => {
|
|
16498
|
-
e.reject(new FirestoreError(
|
|
16498
|
+
e.reject(new FirestoreError(C.CANCELLED, t));
|
|
16499
16499
|
}));
|
|
16500
16500
|
})), e.Ma.clear();
|
|
16501
16501
|
}(n, "'waitForPendingWrites' promise is rejected due to a user change."),
|
|
@@ -16924,7 +16924,7 @@ class __PRIVATE_LruGcMemoryOfflineComponentProvider extends MemoryOfflineCompone
|
|
|
16924
16924
|
}
|
|
16925
16925
|
createSharedClientState(e) {
|
|
16926
16926
|
const t = __PRIVATE_getWindow();
|
|
16927
|
-
if (!__PRIVATE_WebStorageSharedClientState.D(t)) throw new FirestoreError(
|
|
16927
|
+
if (!__PRIVATE_WebStorageSharedClientState.D(t)) throw new FirestoreError(C.UNIMPLEMENTED, "IndexedDB persistence is only available on platforms that support LocalStorage.");
|
|
16928
16928
|
const n = __PRIVATE_indexedDbStoragePrefix(e.databaseInfo.databaseId, e.databaseInfo.persistenceKey);
|
|
16929
16929
|
return new __PRIVATE_WebStorageSharedClientState(t, e.asyncQueue, n, e.clientId, e.initialUser);
|
|
16930
16930
|
}
|
|
@@ -17262,7 +17262,7 @@ class Transaction$2 {
|
|
|
17262
17262
|
this.writtenDocs = new Set;
|
|
17263
17263
|
}
|
|
17264
17264
|
async lookup(e) {
|
|
17265
|
-
if (this.ensureCommitNotCalled(), this.mutations.length > 0) throw this.lastTransactionError = new FirestoreError(
|
|
17265
|
+
if (this.ensureCommitNotCalled(), this.mutations.length > 0) throw this.lastTransactionError = new FirestoreError(C.INVALID_ARGUMENT, "Firestore transactions require all reads to be executed before all writes."),
|
|
17266
17266
|
this.lastTransactionError;
|
|
17267
17267
|
const t = await async function __PRIVATE_invokeBatchGetDocumentsRpc(e, t) {
|
|
17268
17268
|
const n = __PRIVATE_debugCast(e), r = {
|
|
@@ -17324,7 +17324,7 @@ class Transaction$2 {
|
|
|
17324
17324
|
if (n) {
|
|
17325
17325
|
if (!t.isEqual(n))
|
|
17326
17326
|
// This transaction will fail no matter what.
|
|
17327
|
-
throw new FirestoreError(
|
|
17327
|
+
throw new FirestoreError(C.ABORTED, "Document version changed between two reads.");
|
|
17328
17328
|
} else this.readVersions.set(e.key.toString(), t);
|
|
17329
17329
|
}
|
|
17330
17330
|
/**
|
|
@@ -17351,7 +17351,7 @@ class Transaction$2 {
|
|
|
17351
17351
|
// express that to the backend, we have to validate locally.
|
|
17352
17352
|
// Note: this can change once we can send separate verify writes in the
|
|
17353
17353
|
// transaction.
|
|
17354
|
-
throw new FirestoreError(
|
|
17354
|
+
throw new FirestoreError(C.INVALID_ARGUMENT, "Can't update a document that doesn't exist.");
|
|
17355
17355
|
// Document exists, base precondition on document update time.
|
|
17356
17356
|
return Precondition.updateTime(t);
|
|
17357
17357
|
}
|
|
@@ -17492,7 +17492,7 @@ class FirestoreClient {
|
|
|
17492
17492
|
* Checks that the client has not been terminated. Ensures that other methods on //
|
|
17493
17493
|
* this class cannot be called after the client is terminated. //
|
|
17494
17494
|
*/ verifyNotTerminated() {
|
|
17495
|
-
if (this.asyncQueue.isShuttingDown) throw new FirestoreError(
|
|
17495
|
+
if (this.asyncQueue.isShuttingDown) throw new FirestoreError(C.FAILED_PRECONDITION, "The client has already been terminated.");
|
|
17496
17496
|
}
|
|
17497
17497
|
terminate() {
|
|
17498
17498
|
this.asyncQueue.enterRestrictedMode();
|
|
@@ -17540,7 +17540,7 @@ async function __PRIVATE_setOnlineComponentProvider(e, t) {
|
|
|
17540
17540
|
* Decides whether the provided error allows us to gracefully disable
|
|
17541
17541
|
* persistence (as opposed to crashing the client).
|
|
17542
17542
|
*/ function __PRIVATE_canFallbackFromIndexedDbError(e) {
|
|
17543
|
-
return "FirebaseError" === e.name ? e.code ===
|
|
17543
|
+
return "FirebaseError" === e.name ? e.code === C.FAILED_PRECONDITION || e.code === C.UNIMPLEMENTED : !("undefined" != typeof DOMException && e instanceof DOMException) || (
|
|
17544
17544
|
// When the browser is out of quota we could get either quota exceeded
|
|
17545
17545
|
// or an aborted error depending on whether the error happened during
|
|
17546
17546
|
// schema migration.
|
|
@@ -17634,7 +17634,7 @@ async function __PRIVATE_getEventManager(e) {
|
|
|
17634
17634
|
const n = __PRIVATE_debugCast(e);
|
|
17635
17635
|
return n.persistence.runTransaction("read document", "readonly", (e => n.localDocuments.getDocument(e, t)));
|
|
17636
17636
|
}(e, t);
|
|
17637
|
-
r.isFoundDocument() ? n.resolve(r) : r.isNoDocument() ? n.resolve(null) : n.reject(new FirestoreError(
|
|
17637
|
+
r.isFoundDocument() ? n.resolve(r) : r.isNoDocument() ? n.resolve(null) : n.reject(new FirestoreError(C.UNAVAILABLE, "Failed to get document from cache. (However, this document may exist on the server. Run again without setting 'source' in the GetOptions to attempt to retrieve the document from the server.)"));
|
|
17638
17638
|
} catch (e) {
|
|
17639
17639
|
const r = __PRIVATE_wrapInUserErrorIfRecoverable(e, `Failed to get document '${t} from cache`);
|
|
17640
17640
|
n.reject(r);
|
|
@@ -17663,7 +17663,7 @@ function __PRIVATE_firestoreClientGetDocumentViaSnapshotListener(e, t, n = {}) {
|
|
|
17663
17663
|
// the server so we can deliver that even when you're
|
|
17664
17664
|
// offline 2) Actually reject the Promise in the online case
|
|
17665
17665
|
// if the document doesn't exist.
|
|
17666
|
-
i.reject(new FirestoreError(
|
|
17666
|
+
i.reject(new FirestoreError(C.UNAVAILABLE, "Failed to get document because the client is offline.")) : _ && s.fromCache && r && "server" === r.source ? i.reject(new FirestoreError(C.UNAVAILABLE, 'Failed to get document from server. (However, this document does exist in the local cache. Run again without setting source to "server" to retrieve the cached document.)')) : i.resolve(s);
|
|
17667
17667
|
},
|
|
17668
17668
|
error: e => i.reject(e)
|
|
17669
17669
|
}), o = new __PRIVATE_QueryListener(__PRIVATE_newQueryForPath(n.path), s, {
|
|
@@ -17700,7 +17700,7 @@ function __PRIVATE_firestoreClientGetDocumentsViaSnapshotListener(e, t, n = {})
|
|
|
17700
17700
|
next: n => {
|
|
17701
17701
|
// Remove query first before passing event to user to avoid
|
|
17702
17702
|
// user actions affecting the now stale query.
|
|
17703
|
-
t.enqueueAndForget((() => __PRIVATE_eventManagerUnlisten(e, o))), n.fromCache && "server" === r.source ? i.reject(new FirestoreError(
|
|
17703
|
+
t.enqueueAndForget((() => __PRIVATE_eventManagerUnlisten(e, o))), n.fromCache && "server" === r.source ? i.reject(new FirestoreError(C.UNAVAILABLE, 'Failed to get documents from server. (However, these documents may exist in the local cache. Run again without setting source to "server" to retrieve the cached documents.)')) : i.resolve(n);
|
|
17704
17704
|
},
|
|
17705
17705
|
error: e => i.reject(e)
|
|
17706
17706
|
}), o = new __PRIVATE_QueryListener(n, s, {
|
|
@@ -17900,7 +17900,7 @@ function __PRIVATE_cloneLongPollingOptions(e) {
|
|
|
17900
17900
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
17901
17901
|
* See the License for the specific language governing permissions and
|
|
17902
17902
|
* limitations under the License.
|
|
17903
|
-
*/ const
|
|
17903
|
+
*/ const ye = new Map;
|
|
17904
17904
|
|
|
17905
17905
|
/**
|
|
17906
17906
|
* An instance map that ensures only one Datastore exists per Firestore
|
|
@@ -17923,28 +17923,28 @@ function __PRIVATE_cloneLongPollingOptions(e) {
|
|
|
17923
17923
|
* limitations under the License.
|
|
17924
17924
|
*/
|
|
17925
17925
|
function __PRIVATE_validateNonEmptyArgument(e, t, n) {
|
|
17926
|
-
if (!n) throw new FirestoreError(
|
|
17926
|
+
if (!n) throw new FirestoreError(C.INVALID_ARGUMENT, `Function ${e}() cannot be called with an empty ${t}.`);
|
|
17927
17927
|
}
|
|
17928
17928
|
|
|
17929
17929
|
/**
|
|
17930
17930
|
* Validates that two boolean options are not set at the same time.
|
|
17931
17931
|
* @internal
|
|
17932
17932
|
*/ function __PRIVATE_validateIsNotUsedTogether(e, t, n, r) {
|
|
17933
|
-
if (!0 === t && !0 === r) throw new FirestoreError(
|
|
17933
|
+
if (!0 === t && !0 === r) throw new FirestoreError(C.INVALID_ARGUMENT, `${e} and ${n} cannot be used together.`);
|
|
17934
17934
|
}
|
|
17935
17935
|
|
|
17936
17936
|
/**
|
|
17937
17937
|
* Validates that `path` refers to a document (indicated by the fact it contains
|
|
17938
17938
|
* an even numbers of segments).
|
|
17939
17939
|
*/ function __PRIVATE_validateDocumentPath(e) {
|
|
17940
|
-
if (!DocumentKey.isDocumentKey(e)) throw new FirestoreError(
|
|
17940
|
+
if (!DocumentKey.isDocumentKey(e)) throw new FirestoreError(C.INVALID_ARGUMENT, `Invalid document reference. Document references must have an even number of segments, but ${e} has ${e.length}.`);
|
|
17941
17941
|
}
|
|
17942
17942
|
|
|
17943
17943
|
/**
|
|
17944
17944
|
* Validates that `path` refers to a collection (indicated by the fact it
|
|
17945
17945
|
* contains an odd numbers of segments).
|
|
17946
17946
|
*/ function __PRIVATE_validateCollectionPath(e) {
|
|
17947
|
-
if (DocumentKey.isDocumentKey(e)) throw new FirestoreError(
|
|
17947
|
+
if (DocumentKey.isDocumentKey(e)) throw new FirestoreError(C.INVALID_ARGUMENT, `Invalid collection reference. Collection references must have an odd number of segments, but ${e} has ${e.length}.`);
|
|
17948
17948
|
}
|
|
17949
17949
|
|
|
17950
17950
|
/**
|
|
@@ -17988,17 +17988,17 @@ t) {
|
|
|
17988
17988
|
// Unwrap Compat types
|
|
17989
17989
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
17990
17990
|
e = e._delegate), !(e instanceof t)) {
|
|
17991
|
-
if (t.name === e.constructor.name) throw new FirestoreError(
|
|
17991
|
+
if (t.name === e.constructor.name) throw new FirestoreError(C.INVALID_ARGUMENT, "Type does not match the expected instance. Did you pass a reference from a different Firestore SDK?");
|
|
17992
17992
|
{
|
|
17993
17993
|
const n = __PRIVATE_valueDescription(e);
|
|
17994
|
-
throw new FirestoreError(
|
|
17994
|
+
throw new FirestoreError(C.INVALID_ARGUMENT, `Expected type '${t.name}', but it was: ${n}`);
|
|
17995
17995
|
}
|
|
17996
17996
|
}
|
|
17997
17997
|
return e;
|
|
17998
17998
|
}
|
|
17999
17999
|
|
|
18000
18000
|
function __PRIVATE_validatePositiveNumber(e, t) {
|
|
18001
|
-
if (t <= 0) throw new FirestoreError(
|
|
18001
|
+
if (t <= 0) throw new FirestoreError(C.INVALID_ARGUMENT, `Function ${e}() requires a positive number, but it was: ${t}.`);
|
|
18002
18002
|
}
|
|
18003
18003
|
|
|
18004
18004
|
/**
|
|
@@ -18027,12 +18027,12 @@ class FirestoreSettingsImpl {
|
|
|
18027
18027
|
constructor(e) {
|
|
18028
18028
|
var t, n;
|
|
18029
18029
|
if (void 0 === e.host) {
|
|
18030
|
-
if (void 0 !== e.ssl) throw new FirestoreError(
|
|
18030
|
+
if (void 0 !== e.ssl) throw new FirestoreError(C.INVALID_ARGUMENT, "Can't provide ssl option if host option is not set");
|
|
18031
18031
|
this.host = "firestore.googleapis.com", this.ssl = true;
|
|
18032
18032
|
} else this.host = e.host, this.ssl = null === (t = e.ssl) || void 0 === t || t;
|
|
18033
18033
|
if (this.credentials = e.credentials, this.ignoreUndefinedProperties = !!e.ignoreUndefinedProperties,
|
|
18034
18034
|
this.localCache = e.localCache, void 0 === e.cacheSizeBytes) this.cacheSizeBytes = 41943040; else {
|
|
18035
|
-
if (-1 !== e.cacheSizeBytes && e.cacheSizeBytes < 1048576) throw new FirestoreError(
|
|
18035
|
+
if (-1 !== e.cacheSizeBytes && e.cacheSizeBytes < 1048576) throw new FirestoreError(C.INVALID_ARGUMENT, "cacheSizeBytes must be at least 1048576");
|
|
18036
18036
|
this.cacheSizeBytes = e.cacheSizeBytes;
|
|
18037
18037
|
}
|
|
18038
18038
|
__PRIVATE_validateIsNotUsedTogether("experimentalForceLongPolling", e.experimentalForceLongPolling, "experimentalAutoDetectLongPolling", e.experimentalAutoDetectLongPolling),
|
|
@@ -18044,9 +18044,9 @@ class FirestoreSettingsImpl {
|
|
|
18044
18044
|
this.experimentalLongPollingOptions = __PRIVATE_cloneLongPollingOptions(null !== (n = e.experimentalLongPollingOptions) && void 0 !== n ? n : {}),
|
|
18045
18045
|
function __PRIVATE_validateLongPollingOptions(e) {
|
|
18046
18046
|
if (void 0 !== e.timeoutSeconds) {
|
|
18047
|
-
if (isNaN(e.timeoutSeconds)) throw new FirestoreError(
|
|
18048
|
-
if (e.timeoutSeconds < 5) throw new FirestoreError(
|
|
18049
|
-
if (e.timeoutSeconds > 30) throw new FirestoreError(
|
|
18047
|
+
if (isNaN(e.timeoutSeconds)) throw new FirestoreError(C.INVALID_ARGUMENT, `invalid long polling timeout: ${e.timeoutSeconds} (must not be NaN)`);
|
|
18048
|
+
if (e.timeoutSeconds < 5) throw new FirestoreError(C.INVALID_ARGUMENT, `invalid long polling timeout: ${e.timeoutSeconds} (minimum allowed value is 5)`);
|
|
18049
|
+
if (e.timeoutSeconds > 30) throw new FirestoreError(C.INVALID_ARGUMENT, `invalid long polling timeout: ${e.timeoutSeconds} (maximum allowed value is 30)`);
|
|
18050
18050
|
}
|
|
18051
18051
|
}
|
|
18052
18052
|
/**
|
|
@@ -18093,7 +18093,7 @@ class Firestore$1 {
|
|
|
18093
18093
|
* The {@link @firebase/app#FirebaseApp} associated with this `Firestore` service
|
|
18094
18094
|
* instance.
|
|
18095
18095
|
*/ get app() {
|
|
18096
|
-
if (!this._app) throw new FirestoreError(
|
|
18096
|
+
if (!this._app) throw new FirestoreError(C.FAILED_PRECONDITION, "Firestore was not initialized using the Firebase SDK. 'app' is not available");
|
|
18097
18097
|
return this._app;
|
|
18098
18098
|
}
|
|
18099
18099
|
get _initialized() {
|
|
@@ -18103,7 +18103,7 @@ class Firestore$1 {
|
|
|
18103
18103
|
return void 0 !== this._terminateTask;
|
|
18104
18104
|
}
|
|
18105
18105
|
_setSettings(e) {
|
|
18106
|
-
if (this._settingsFrozen) throw new FirestoreError(
|
|
18106
|
+
if (this._settingsFrozen) throw new FirestoreError(C.FAILED_PRECONDITION, "Firestore has already been started and its settings can no longer be changed. You can only modify settings before calling any other methods on a Firestore object.");
|
|
18107
18107
|
this._settings = new FirestoreSettingsImpl(e), void 0 !== e.credentials && (this._authCredentials = function __PRIVATE_makeAuthCredentialsProvider(e) {
|
|
18108
18108
|
if (!e) return new __PRIVATE_EmptyAuthCredentialsProvider;
|
|
18109
18109
|
switch (e.type) {
|
|
@@ -18114,7 +18114,7 @@ class Firestore$1 {
|
|
|
18114
18114
|
return e.client;
|
|
18115
18115
|
|
|
18116
18116
|
default:
|
|
18117
|
-
throw new FirestoreError(
|
|
18117
|
+
throw new FirestoreError(C.INVALID_ARGUMENT, "makeAuthCredentialsProvider failed due to invalid credential type");
|
|
18118
18118
|
}
|
|
18119
18119
|
}(e.credentials));
|
|
18120
18120
|
}
|
|
@@ -18146,8 +18146,8 @@ class Firestore$1 {
|
|
|
18146
18146
|
* when the `Firestore` instance is terminated.
|
|
18147
18147
|
*/
|
|
18148
18148
|
return function __PRIVATE_removeComponents(e) {
|
|
18149
|
-
const t =
|
|
18150
|
-
t && (__PRIVATE_logDebug("ComponentProvider", "Removing Datastore"),
|
|
18149
|
+
const t = ye.get(e);
|
|
18150
|
+
t && (__PRIVATE_logDebug("ComponentProvider", "Removing Datastore"), ye.delete(e),
|
|
18151
18151
|
t.terminate());
|
|
18152
18152
|
}(this), Promise.resolve();
|
|
18153
18153
|
}
|
|
@@ -18179,7 +18179,7 @@ class Firestore$1 {
|
|
|
18179
18179
|
// invalid field "uid" and missing field "sub" / "user_id".)
|
|
18180
18180
|
t = util.createMockUserToken(r.mockUserToken, null === (i = e._app) || void 0 === i ? void 0 : i.options.projectId);
|
|
18181
18181
|
const s = r.mockUserToken.sub || r.mockUserToken.user_id;
|
|
18182
|
-
if (!s) throw new FirestoreError(
|
|
18182
|
+
if (!s) throw new FirestoreError(C.INVALID_ARGUMENT, "mockUserToken must contain 'sub' or 'user_id' field!");
|
|
18183
18183
|
n = new User(s);
|
|
18184
18184
|
}
|
|
18185
18185
|
e._authCredentials = new __PRIVATE_EmulatorAuthCredentialsProvider(new __PRIVATE_OAuthToken(t, n));
|
|
@@ -18299,7 +18299,7 @@ function collection(e, t, ...n) {
|
|
|
18299
18299
|
return __PRIVATE_validateCollectionPath(r), new CollectionReference(e, /* converter= */ null, r);
|
|
18300
18300
|
}
|
|
18301
18301
|
{
|
|
18302
|
-
if (!(e instanceof DocumentReference || e instanceof CollectionReference)) throw new FirestoreError(
|
|
18302
|
+
if (!(e instanceof DocumentReference || e instanceof CollectionReference)) throw new FirestoreError(C.INVALID_ARGUMENT, "Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");
|
|
18303
18303
|
const r = e._path.child(ResourcePath.fromString(t, ...n));
|
|
18304
18304
|
return __PRIVATE_validateCollectionPath(r), new CollectionReference(e.firestore,
|
|
18305
18305
|
/* converter= */ null, r);
|
|
@@ -18320,7 +18320,7 @@ function collection(e, t, ...n) {
|
|
|
18320
18320
|
* @returns The created `Query`.
|
|
18321
18321
|
*/ function collectionGroup(e, t) {
|
|
18322
18322
|
if (e = __PRIVATE_cast(e, Firestore$1), __PRIVATE_validateNonEmptyArgument("collectionGroup", "collection id", t),
|
|
18323
|
-
t.indexOf("/") >= 0) throw new FirestoreError(
|
|
18323
|
+
t.indexOf("/") >= 0) throw new FirestoreError(C.INVALID_ARGUMENT, `Invalid collection ID '${t}' passed to function collectionGroup(). Collection IDs must not contain '/'.`);
|
|
18324
18324
|
return new Query(e,
|
|
18325
18325
|
/* converter= */ null, function __PRIVATE_newQueryForCollectionGroup(e) {
|
|
18326
18326
|
return new __PRIVATE_QueryImpl(ResourcePath.emptyPath(), e);
|
|
@@ -18338,7 +18338,7 @@ function doc(e, t, ...n) {
|
|
|
18338
18338
|
/* converter= */ null, new DocumentKey(r));
|
|
18339
18339
|
}
|
|
18340
18340
|
{
|
|
18341
|
-
if (!(e instanceof DocumentReference || e instanceof CollectionReference)) throw new FirestoreError(
|
|
18341
|
+
if (!(e instanceof DocumentReference || e instanceof CollectionReference)) throw new FirestoreError(C.INVALID_ARGUMENT, "Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");
|
|
18342
18342
|
const r = e._path.child(ResourcePath.fromString(t, ...n));
|
|
18343
18343
|
return __PRIVATE_validateDocumentPath(r), new DocumentReference(e.firestore, e instanceof CollectionReference ? e.converter : null, new DocumentKey(r));
|
|
18344
18344
|
}
|
|
@@ -18698,7 +18698,7 @@ class LoadBundleTask {
|
|
|
18698
18698
|
* Constant used to indicate the LRU garbage collection should be disabled.
|
|
18699
18699
|
* Set this value as the `cacheSizeBytes` on the settings passed to the
|
|
18700
18700
|
* {@link Firestore} instance.
|
|
18701
|
-
*/ const
|
|
18701
|
+
*/ const we = -1;
|
|
18702
18702
|
|
|
18703
18703
|
/**
|
|
18704
18704
|
* The Cloud Firestore service interface.
|
|
@@ -18742,10 +18742,10 @@ class LoadBundleTask {
|
|
|
18742
18742
|
identifier: n
|
|
18743
18743
|
}), i = r.getOptions(n);
|
|
18744
18744
|
if (util.deepEqual(i, t)) return e;
|
|
18745
|
-
throw new FirestoreError(
|
|
18745
|
+
throw new FirestoreError(C.FAILED_PRECONDITION, "initializeFirestore() has already been called with different options. To avoid this error, call initializeFirestore() with the same options as when it was originally called, or call getFirestore() to return the already initialized instance.");
|
|
18746
18746
|
}
|
|
18747
|
-
if (void 0 !== t.cacheSizeBytes && void 0 !== t.localCache) throw new FirestoreError(
|
|
18748
|
-
if (void 0 !== t.cacheSizeBytes && -1 !== t.cacheSizeBytes && t.cacheSizeBytes < 1048576) throw new FirestoreError(
|
|
18747
|
+
if (void 0 !== t.cacheSizeBytes && void 0 !== t.localCache) throw new FirestoreError(C.INVALID_ARGUMENT, "cache and cacheSizeBytes cannot be specified at the same time as cacheSizeBytes willbe deprecated. Instead, specify the cache size in the cache object");
|
|
18748
|
+
if (void 0 !== t.cacheSizeBytes && -1 !== t.cacheSizeBytes && t.cacheSizeBytes < 1048576) throw new FirestoreError(C.INVALID_ARGUMENT, "cacheSizeBytes must be at least 1048576");
|
|
18749
18749
|
return r.initialize({
|
|
18750
18750
|
options: t,
|
|
18751
18751
|
instanceIdentifier: n
|
|
@@ -18814,7 +18814,7 @@ function __PRIVATE_configureFirestore(e) {
|
|
|
18814
18814
|
*/ function enableIndexedDbPersistence(e, t) {
|
|
18815
18815
|
__PRIVATE_verifyNotInitialized(e = __PRIVATE_cast(e, Firestore));
|
|
18816
18816
|
const n = ensureFirestoreConfigured(e);
|
|
18817
|
-
if (n._uninitializedComponentsProvider) throw new FirestoreError(
|
|
18817
|
+
if (n._uninitializedComponentsProvider) throw new FirestoreError(C.FAILED_PRECONDITION, "SDK cache is already specified.");
|
|
18818
18818
|
__PRIVATE_logWarn("enableIndexedDbPersistence() will be deprecated in the future, you can use `FirestoreSettings.cache` instead.");
|
|
18819
18819
|
const r = e._freezeSettings(), i = new OnlineComponentProvider;
|
|
18820
18820
|
return __PRIVATE_setPersistenceProviders(n, i, new __PRIVATE_IndexedDbOfflineComponentProvider(i, r.cacheSizeBytes, null == t ? void 0 : t.forceOwnership));
|
|
@@ -18848,7 +18848,7 @@ function __PRIVATE_configureFirestore(e) {
|
|
|
18848
18848
|
*/ function enableMultiTabIndexedDbPersistence(e) {
|
|
18849
18849
|
__PRIVATE_verifyNotInitialized(e = __PRIVATE_cast(e, Firestore));
|
|
18850
18850
|
const t = ensureFirestoreConfigured(e);
|
|
18851
|
-
if (t._uninitializedComponentsProvider) throw new FirestoreError(
|
|
18851
|
+
if (t._uninitializedComponentsProvider) throw new FirestoreError(C.FAILED_PRECONDITION, "SDK cache is already specified.");
|
|
18852
18852
|
__PRIVATE_logWarn("enableMultiTabIndexedDbPersistence() will be deprecated in the future, you can use `FirestoreSettings.cache` instead.");
|
|
18853
18853
|
const n = e._freezeSettings(), r = new OnlineComponentProvider;
|
|
18854
18854
|
return __PRIVATE_setPersistenceProviders(t, r, new __PRIVATE_MultiTabOfflineComponentProvider(r, n.cacheSizeBytes));
|
|
@@ -18896,7 +18896,7 @@ function __PRIVATE_configureFirestore(e) {
|
|
|
18896
18896
|
* @returns A `Promise` that is resolved when the persistent storage is
|
|
18897
18897
|
* cleared. Otherwise, the promise is rejected with an error.
|
|
18898
18898
|
*/ function clearIndexedDbPersistence(e) {
|
|
18899
|
-
if (e._initialized && !e._terminated) throw new FirestoreError(
|
|
18899
|
+
if (e._initialized && !e._terminated) throw new FirestoreError(C.FAILED_PRECONDITION, "Persistence can only be cleared before a Firestore instance is initialized or after it is terminated.");
|
|
18900
18900
|
const t = new __PRIVATE_Deferred;
|
|
18901
18901
|
return e._queue.enqueueAndForgetEvenWhileRestricted((async () => {
|
|
18902
18902
|
try {
|
|
@@ -19010,7 +19010,7 @@ function __PRIVATE_configureFirestore(e) {
|
|
|
19010
19010
|
}
|
|
19011
19011
|
|
|
19012
19012
|
function __PRIVATE_verifyNotInitialized(e) {
|
|
19013
|
-
if (e._initialized || e._terminated) throw new FirestoreError(
|
|
19013
|
+
if (e._initialized || e._terminated) throw new FirestoreError(C.FAILED_PRECONDITION, "Firestore has already been started and persistence can no longer be enabled. You can only enable persistence before calling any other methods on a Firestore object.");
|
|
19014
19014
|
}
|
|
19015
19015
|
|
|
19016
19016
|
/**
|
|
@@ -19119,7 +19119,7 @@ class AggregateField {
|
|
|
19119
19119
|
try {
|
|
19120
19120
|
return new Bytes(ByteString.fromBase64String(e));
|
|
19121
19121
|
} catch (e) {
|
|
19122
|
-
throw new FirestoreError(
|
|
19122
|
+
throw new FirestoreError(C.INVALID_ARGUMENT, "Failed to construct data from Base64 string: " + e);
|
|
19123
19123
|
}
|
|
19124
19124
|
}
|
|
19125
19125
|
/**
|
|
@@ -19191,7 +19191,7 @@ class AggregateField {
|
|
|
19191
19191
|
* @param fieldNames - A list of field names.
|
|
19192
19192
|
*/
|
|
19193
19193
|
constructor(...e) {
|
|
19194
|
-
for (let t = 0; t < e.length; ++t) if (0 === e[t].length) throw new FirestoreError(
|
|
19194
|
+
for (let t = 0; t < e.length; ++t) if (0 === e[t].length) throw new FirestoreError(C.INVALID_ARGUMENT, "Invalid field name at argument $(i + 1). Field names must not be empty.");
|
|
19195
19195
|
this._internalPath = new FieldPath$1(e);
|
|
19196
19196
|
}
|
|
19197
19197
|
/**
|
|
@@ -19270,8 +19270,8 @@ class AggregateField {
|
|
|
19270
19270
|
* @param longitude - The longitude as number between -180 and 180.
|
|
19271
19271
|
*/
|
|
19272
19272
|
constructor(e, t) {
|
|
19273
|
-
if (!isFinite(e) || e < -90 || e > 90) throw new FirestoreError(
|
|
19274
|
-
if (!isFinite(t) || t < -180 || t > 180) throw new FirestoreError(
|
|
19273
|
+
if (!isFinite(e) || e < -90 || e > 90) throw new FirestoreError(C.INVALID_ARGUMENT, "Latitude must be a number between -90 and 90, but was: " + e);
|
|
19274
|
+
if (!isFinite(t) || t < -180 || t > 180) throw new FirestoreError(C.INVALID_ARGUMENT, "Longitude must be a number between -180 and 180, but was: " + t);
|
|
19275
19275
|
this._lat = e, this._long = t;
|
|
19276
19276
|
}
|
|
19277
19277
|
/**
|
|
@@ -19321,7 +19321,7 @@ class AggregateField {
|
|
|
19321
19321
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
19322
19322
|
* See the License for the specific language governing permissions and
|
|
19323
19323
|
* limitations under the License.
|
|
19324
|
-
*/ const
|
|
19324
|
+
*/ const Se = /^__.*__$/;
|
|
19325
19325
|
|
|
19326
19326
|
/** The result of parsing document data (e.g. for a setData call). */ class ParsedSetData {
|
|
19327
19327
|
constructor(e, t, n) {
|
|
@@ -19432,7 +19432,7 @@ function __PRIVATE_isWrite(e) {
|
|
|
19432
19432
|
}
|
|
19433
19433
|
pu(e) {
|
|
19434
19434
|
if (0 === e.length) throw this.Su("Document fields must not be empty");
|
|
19435
|
-
if (__PRIVATE_isWrite(this.Vu) &&
|
|
19435
|
+
if (__PRIVATE_isWrite(this.Vu) && Se.test(e)) throw this.Su('Document fields cannot begin and end with "__"');
|
|
19436
19436
|
}
|
|
19437
19437
|
}
|
|
19438
19438
|
|
|
@@ -19469,7 +19469,7 @@ function __PRIVATE_newUserDataReader(e) {
|
|
|
19469
19469
|
const e = [];
|
|
19470
19470
|
for (const r of s.mergeFields) {
|
|
19471
19471
|
const i = __PRIVATE_fieldPathFromArgument$1(t, r, n);
|
|
19472
|
-
if (!o.contains(i)) throw new FirestoreError(
|
|
19472
|
+
if (!o.contains(i)) throw new FirestoreError(C.INVALID_ARGUMENT, `Field '${i}' is specified in your field mask but missing from your input data.`);
|
|
19473
19473
|
__PRIVATE_fieldMaskContains(e, i) || e.push(i);
|
|
19474
19474
|
}
|
|
19475
19475
|
a = new FieldMask(e), u = o.fieldTransforms.filter((e => a.covers(e.field)));
|
|
@@ -19586,7 +19586,7 @@ class __PRIVATE_NumericIncrementFieldValueImpl extends FieldValue {
|
|
|
19586
19586
|
|
|
19587
19587
|
/** Parse update data from a list of field/value arguments. */ function __PRIVATE_parseUpdateVarargs(e, t, n, r, i, s) {
|
|
19588
19588
|
const o = e.Cu(1 /* UserDataSource.Update */ , t, n), _ = [ __PRIVATE_fieldPathFromArgument$1(t, r, n) ], a = [ i ];
|
|
19589
|
-
if (s.length % 2 != 0) throw new FirestoreError(
|
|
19589
|
+
if (s.length % 2 != 0) throw new FirestoreError(C.INVALID_ARGUMENT, `Function ${t}() needs to be called with an even number of arguments that alternate between field names and values.`);
|
|
19590
19590
|
for (let e = 0; e < s.length; e += 2) _.push(__PRIVATE_fieldPathFromArgument$1(t, s[e])),
|
|
19591
19591
|
a.push(s[e + 1]);
|
|
19592
19592
|
const u = [], c = ObjectValue.empty();
|
|
@@ -19787,7 +19787,7 @@ function __PRIVATE_validatePlainObject(e, t, n) {
|
|
|
19787
19787
|
|
|
19788
19788
|
/**
|
|
19789
19789
|
* Matches any characters in a field path string that are reserved.
|
|
19790
|
-
*/ const
|
|
19790
|
+
*/ const be = new RegExp("[~\\*/\\[\\]]");
|
|
19791
19791
|
|
|
19792
19792
|
/**
|
|
19793
19793
|
* Wraps fromDotSeparatedString with an error message about the method that
|
|
@@ -19798,7 +19798,7 @@ function __PRIVATE_validatePlainObject(e, t, n) {
|
|
|
19798
19798
|
* @param targetDoc - The document against which the field path will be
|
|
19799
19799
|
* evaluated.
|
|
19800
19800
|
*/ function __PRIVATE_fieldPathFromDotSeparatedString(e, t, n) {
|
|
19801
|
-
if (t.search(
|
|
19801
|
+
if (t.search(be) >= 0) throw __PRIVATE_createError(`Invalid field path (${t}). Paths must not contain '~', '*', '/', '[', or ']'`, e,
|
|
19802
19802
|
/* hasConverter= */ !1,
|
|
19803
19803
|
/* path= */ void 0, n);
|
|
19804
19804
|
try {
|
|
@@ -19816,7 +19816,7 @@ function __PRIVATE_createError(e, t, n, r, i) {
|
|
|
19816
19816
|
n && (_ += " (via `toFirestore()`)"), _ += ". ";
|
|
19817
19817
|
let a = "";
|
|
19818
19818
|
return (s || o) && (a += " (found", s && (a += ` in field ${r}`), o && (a += ` in document ${i}`),
|
|
19819
|
-
a += ")"), new FirestoreError(
|
|
19819
|
+
a += ")"), new FirestoreError(C.INVALID_ARGUMENT, _ + e + a);
|
|
19820
19820
|
}
|
|
19821
19821
|
|
|
19822
19822
|
/** Checks `haystack` if FieldPath `needle` is present. Runs in O(n). */ function __PRIVATE_fieldMaskContains(e, t) {
|
|
@@ -19953,7 +19953,7 @@ function __PRIVATE_createError(e, t, n, r, i) {
|
|
|
19953
19953
|
* See the License for the specific language governing permissions and
|
|
19954
19954
|
* limitations under the License.
|
|
19955
19955
|
*/ function __PRIVATE_validateHasExplicitOrderByForLimitToLast(e) {
|
|
19956
|
-
if ("L" /* LimitType.Last */ === e.limitType && 0 === e.explicitOrderBy.length) throw new FirestoreError(
|
|
19956
|
+
if ("L" /* LimitType.Last */ === e.limitType && 0 === e.explicitOrderBy.length) throw new FirestoreError(C.UNIMPLEMENTED, "limitToLast() queries require specifying at least one orderBy() clause");
|
|
19957
19957
|
}
|
|
19958
19958
|
|
|
19959
19959
|
/**
|
|
@@ -19974,7 +19974,7 @@ function query(e, t, ...n) {
|
|
|
19974
19974
|
let r = [];
|
|
19975
19975
|
t instanceof AppliableConstraint && r.push(t), r = r.concat(n), function __PRIVATE_validateQueryConstraintArray(e) {
|
|
19976
19976
|
const t = e.filter((e => e instanceof QueryCompositeFilterConstraint)).length, n = e.filter((e => e instanceof QueryFieldFilterConstraint)).length;
|
|
19977
|
-
if (t > 1 || t > 0 && n > 0) throw new FirestoreError(
|
|
19977
|
+
if (t > 1 || t > 0 && n > 0) throw new FirestoreError(C.INVALID_ARGUMENT, "InvalidQuery. When using composite filters, you cannot use more than one filter at the top level. Consider nesting the multiple filters within an `and(...)` statement. For example: change `query(query, where(...), or(...))` to `query(query, and(where(...), or(...)))`.");
|
|
19978
19978
|
}
|
|
19979
19979
|
/**
|
|
19980
19980
|
* @license
|
|
@@ -20028,7 +20028,7 @@ function query(e, t, ...n) {
|
|
|
20028
20028
|
const t = __PRIVATE_newUserDataReader(e.firestore), n = function __PRIVATE_newQueryFilter(e, t, n, r, i, s, o) {
|
|
20029
20029
|
let _;
|
|
20030
20030
|
if (i.isKeyField()) {
|
|
20031
|
-
if ("array-contains" /* Operator.ARRAY_CONTAINS */ === s || "array-contains-any" /* Operator.ARRAY_CONTAINS_ANY */ === s) throw new FirestoreError(
|
|
20031
|
+
if ("array-contains" /* Operator.ARRAY_CONTAINS */ === s || "array-contains-any" /* Operator.ARRAY_CONTAINS_ANY */ === s) throw new FirestoreError(C.INVALID_ARGUMENT, `Invalid Query. You can't perform '${s}' queries on documentId().`);
|
|
20032
20032
|
if ("in" /* Operator.IN */ === s || "not-in" /* Operator.NOT_IN */ === s) {
|
|
20033
20033
|
__PRIVATE_validateDisjunctiveFilterElements(o, s);
|
|
20034
20034
|
const t = [];
|
|
@@ -20155,8 +20155,8 @@ function query(e, t, ...n) {
|
|
|
20155
20155
|
}
|
|
20156
20156
|
_apply(e) {
|
|
20157
20157
|
const t = function __PRIVATE_newQueryOrderBy(e, t, n) {
|
|
20158
|
-
if (null !== e.startAt) throw new FirestoreError(
|
|
20159
|
-
if (null !== e.endAt) throw new FirestoreError(
|
|
20158
|
+
if (null !== e.startAt) throw new FirestoreError(C.INVALID_ARGUMENT, "Invalid query. You must not call startAt() or startAfter() before calling orderBy().");
|
|
20159
|
+
if (null !== e.endAt) throw new FirestoreError(C.INVALID_ARGUMENT, "Invalid query. You must not call endAt() or endBefore() before calling orderBy().");
|
|
20160
20160
|
return new OrderBy(t, n);
|
|
20161
20161
|
}
|
|
20162
20162
|
/**
|
|
@@ -20314,7 +20314,7 @@ function endAt(...e) {
|
|
|
20314
20314
|
|
|
20315
20315
|
/** Helper function to create a bound from a document or fields */ function __PRIVATE_newQueryBoundFromDocOrFields(e, t, n, r) {
|
|
20316
20316
|
if (n[0] = util.getModularInstance(n[0]), n[0] instanceof DocumentSnapshot$1) return function __PRIVATE_newQueryBoundFromDocument(e, t, n, r, i) {
|
|
20317
|
-
if (!r) throw new FirestoreError(
|
|
20317
|
+
if (!r) throw new FirestoreError(C.NOT_FOUND, `Can't use a DocumentSnapshot that doesn't exist for ${n}().`);
|
|
20318
20318
|
const s = [];
|
|
20319
20319
|
// Because people expect to continue/end a query at the exact document
|
|
20320
20320
|
// provided, we need to use the implicit sort order rather than the explicit
|
|
@@ -20325,10 +20325,10 @@ function endAt(...e) {
|
|
|
20325
20325
|
// results.
|
|
20326
20326
|
for (const n of __PRIVATE_queryNormalizedOrderBy(e)) if (n.field.isKeyField()) s.push(__PRIVATE_refValue(t, r.key)); else {
|
|
20327
20327
|
const e = r.data.field(n.field);
|
|
20328
|
-
if (__PRIVATE_isServerTimestamp(e)) throw new FirestoreError(
|
|
20328
|
+
if (__PRIVATE_isServerTimestamp(e)) throw new FirestoreError(C.INVALID_ARGUMENT, 'Invalid query. You are trying to start or end a query using a document for which the field "' + n.field + '" is an uncommitted server timestamp. (Since the value of this field is unknown, you cannot start/end a query with it.)');
|
|
20329
20329
|
if (null === e) {
|
|
20330
20330
|
const e = n.field.canonicalString();
|
|
20331
|
-
throw new FirestoreError(
|
|
20331
|
+
throw new FirestoreError(C.INVALID_ARGUMENT, `Invalid query. You are trying to start or end a query using a document for which the field '${e}' (used as the orderBy) does not exist.`);
|
|
20332
20332
|
}
|
|
20333
20333
|
s.push(e);
|
|
20334
20334
|
}
|
|
@@ -20342,15 +20342,15 @@ function endAt(...e) {
|
|
|
20342
20342
|
return function __PRIVATE_newQueryBoundFromFields(e, t, n, r, i, s) {
|
|
20343
20343
|
// Use explicit order by's because it has to match the query the user made
|
|
20344
20344
|
const o = e.explicitOrderBy;
|
|
20345
|
-
if (i.length > o.length) throw new FirestoreError(
|
|
20345
|
+
if (i.length > o.length) throw new FirestoreError(C.INVALID_ARGUMENT, `Too many arguments provided to ${r}(). The number of arguments must be less than or equal to the number of orderBy() clauses`);
|
|
20346
20346
|
const _ = [];
|
|
20347
20347
|
for (let s = 0; s < i.length; s++) {
|
|
20348
20348
|
const a = i[s];
|
|
20349
20349
|
if (o[s].field.isKeyField()) {
|
|
20350
|
-
if ("string" != typeof a) throw new FirestoreError(
|
|
20351
|
-
if (!__PRIVATE_isCollectionGroupQuery(e) && -1 !== a.indexOf("/")) throw new FirestoreError(
|
|
20350
|
+
if ("string" != typeof a) throw new FirestoreError(C.INVALID_ARGUMENT, `Invalid query. Expected a string for document ID in ${r}(), but got a ${typeof a}`);
|
|
20351
|
+
if (!__PRIVATE_isCollectionGroupQuery(e) && -1 !== a.indexOf("/")) throw new FirestoreError(C.INVALID_ARGUMENT, `Invalid query. When querying a collection and ordering by documentId(), the value passed to ${r}() must be a plain document ID, but '${a}' contains a slash.`);
|
|
20352
20352
|
const n = e.path.child(ResourcePath.fromString(a));
|
|
20353
|
-
if (!DocumentKey.isDocumentKey(n)) throw new FirestoreError(
|
|
20353
|
+
if (!DocumentKey.isDocumentKey(n)) throw new FirestoreError(C.INVALID_ARGUMENT, `Invalid query. When querying a collection group and ordering by documentId(), the value passed to ${r}() must result in a valid document path, but '${n}' is not because it contains an odd number of segments.`);
|
|
20354
20354
|
const i = new DocumentKey(n);
|
|
20355
20355
|
_.push(__PRIVATE_refValue(t, i));
|
|
20356
20356
|
} else {
|
|
@@ -20370,21 +20370,21 @@ function endAt(...e) {
|
|
|
20370
20370
|
|
|
20371
20371
|
function __PRIVATE_parseDocumentIdValue(e, t, n) {
|
|
20372
20372
|
if ("string" == typeof (n = util.getModularInstance(n))) {
|
|
20373
|
-
if ("" === n) throw new FirestoreError(
|
|
20374
|
-
if (!__PRIVATE_isCollectionGroupQuery(t) && -1 !== n.indexOf("/")) throw new FirestoreError(
|
|
20373
|
+
if ("" === n) throw new FirestoreError(C.INVALID_ARGUMENT, "Invalid query. When querying with documentId(), you must provide a valid document ID, but it was an empty string.");
|
|
20374
|
+
if (!__PRIVATE_isCollectionGroupQuery(t) && -1 !== n.indexOf("/")) throw new FirestoreError(C.INVALID_ARGUMENT, `Invalid query. When querying a collection by documentId(), you must provide a plain document ID, but '${n}' contains a '/' character.`);
|
|
20375
20375
|
const r = t.path.child(ResourcePath.fromString(n));
|
|
20376
|
-
if (!DocumentKey.isDocumentKey(r)) throw new FirestoreError(
|
|
20376
|
+
if (!DocumentKey.isDocumentKey(r)) throw new FirestoreError(C.INVALID_ARGUMENT, `Invalid query. When querying a collection group by documentId(), the value provided must result in a valid document path, but '${r}' is not because it has an odd number of segments (${r.length}).`);
|
|
20377
20377
|
return __PRIVATE_refValue(e, new DocumentKey(r));
|
|
20378
20378
|
}
|
|
20379
20379
|
if (n instanceof DocumentReference) return __PRIVATE_refValue(e, n._key);
|
|
20380
|
-
throw new FirestoreError(
|
|
20380
|
+
throw new FirestoreError(C.INVALID_ARGUMENT, `Invalid query. When querying with documentId(), you must provide a valid string or a DocumentReference, but it was: ${__PRIVATE_valueDescription(n)}.`);
|
|
20381
20381
|
}
|
|
20382
20382
|
|
|
20383
20383
|
/**
|
|
20384
20384
|
* Validates that the value passed into a disjunctive filter satisfies all
|
|
20385
20385
|
* array requirements.
|
|
20386
20386
|
*/ function __PRIVATE_validateDisjunctiveFilterElements(e, t) {
|
|
20387
|
-
if (!Array.isArray(e) || 0 === e.length) throw new FirestoreError(
|
|
20387
|
+
if (!Array.isArray(e) || 0 === e.length) throw new FirestoreError(C.INVALID_ARGUMENT, `Invalid Query. A non-empty array is required for '${t.toString()}' filters.`);
|
|
20388
20388
|
}
|
|
20389
20389
|
|
|
20390
20390
|
/**
|
|
@@ -20418,11 +20418,11 @@ function __PRIVATE_parseDocumentIdValue(e, t, n) {
|
|
|
20418
20418
|
}(t.op));
|
|
20419
20419
|
if (null !== n)
|
|
20420
20420
|
// Special case when it's a duplicate op to give a slightly clearer error message.
|
|
20421
|
-
throw n === t.op ? new FirestoreError(
|
|
20421
|
+
throw n === t.op ? new FirestoreError(C.INVALID_ARGUMENT, `Invalid query. You cannot use more than one '${t.op.toString()}' filter.`) : new FirestoreError(C.INVALID_ARGUMENT, `Invalid query. You cannot use '${t.op.toString()}' filters with '${n.toString()}' filters.`);
|
|
20422
20422
|
}
|
|
20423
20423
|
|
|
20424
20424
|
function __PRIVATE_validateQueryFilterConstraint(e, t) {
|
|
20425
|
-
if (!(t instanceof QueryFieldFilterConstraint || t instanceof QueryCompositeFilterConstraint)) throw new FirestoreError(
|
|
20425
|
+
if (!(t instanceof QueryFieldFilterConstraint || t instanceof QueryCompositeFilterConstraint)) throw new FirestoreError(C.INVALID_ARGUMENT, `Function ${e}() requires AppliableConstraints created with a call to 'where(...)', 'or(...)', or 'and(...)'.`);
|
|
20426
20426
|
}
|
|
20427
20427
|
|
|
20428
20428
|
class AbstractUserDataWriter {
|
|
@@ -20794,7 +20794,7 @@ class __PRIVATE_LiteUserDataWriter extends AbstractUserDataWriter {
|
|
|
20794
20794
|
* snapshot events.
|
|
20795
20795
|
*/ docChanges(e = {}) {
|
|
20796
20796
|
const t = !!e.includeMetadataChanges;
|
|
20797
|
-
if (t && this._snapshot.excludesMetadataChanges) throw new FirestoreError(
|
|
20797
|
+
if (t && this._snapshot.excludesMetadataChanges) throw new FirestoreError(C.INVALID_ARGUMENT, "To include metadata changes with your document changes, you must also pass { includeMetadataChanges:true } to onSnapshot().");
|
|
20798
20798
|
return this._cachedChanges && this._cachedChangesIncludeMetadataChanges === t || (this._cachedChanges =
|
|
20799
20799
|
/** Calculates the array of `DocumentChange`s for a given `ViewSnapshot`. */
|
|
20800
20800
|
function __PRIVATE_changesFromSnapshot(e, t) {
|
|
@@ -21352,7 +21352,7 @@ class __PRIVATE_MultiTabManagerImpl {
|
|
|
21352
21352
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
21353
21353
|
* See the License for the specific language governing permissions and
|
|
21354
21354
|
* limitations under the License.
|
|
21355
|
-
*/ const
|
|
21355
|
+
*/ const De = {
|
|
21356
21356
|
maxAttempts: 5
|
|
21357
21357
|
};
|
|
21358
21358
|
|
|
@@ -21426,12 +21426,12 @@ class WriteBatch {
|
|
|
21426
21426
|
return this._verifyNotCommitted(), this._committed = !0, this._mutations.length > 0 ? this._commitHandler(this._mutations) : Promise.resolve();
|
|
21427
21427
|
}
|
|
21428
21428
|
_verifyNotCommitted() {
|
|
21429
|
-
if (this._committed) throw new FirestoreError(
|
|
21429
|
+
if (this._committed) throw new FirestoreError(C.FAILED_PRECONDITION, "A write batch can no longer be used after commit() has been called.");
|
|
21430
21430
|
}
|
|
21431
21431
|
}
|
|
21432
21432
|
|
|
21433
21433
|
function __PRIVATE_validateReference(e, t) {
|
|
21434
|
-
if ((e = util.getModularInstance(e)).firestore !== t) throw new FirestoreError(
|
|
21434
|
+
if ((e = util.getModularInstance(e)).firestore !== t) throw new FirestoreError(C.INVALID_ARGUMENT, "Provided document reference is from a different Firestore instance.");
|
|
21435
21435
|
return e;
|
|
21436
21436
|
}
|
|
21437
21437
|
|
|
@@ -21564,9 +21564,9 @@ class Transaction extends class Transaction$1 {
|
|
|
21564
21564
|
* rejected promise with the corresponding failure error is returned.
|
|
21565
21565
|
*/ function runTransaction(e, t, n) {
|
|
21566
21566
|
e = __PRIVATE_cast(e, Firestore);
|
|
21567
|
-
const r = Object.assign(Object.assign({},
|
|
21567
|
+
const r = Object.assign(Object.assign({}, De), n);
|
|
21568
21568
|
!function __PRIVATE_validateTransactionOptions(e) {
|
|
21569
|
-
if (e.maxAttempts < 1) throw new FirestoreError(
|
|
21569
|
+
if (e.maxAttempts < 1) throw new FirestoreError(C.INVALID_ARGUMENT, "Max attempts must be at least 1");
|
|
21570
21570
|
}(r);
|
|
21571
21571
|
return function __PRIVATE_firestoreClientTransaction(e, t, n) {
|
|
21572
21572
|
const r = new __PRIVATE_Deferred;
|
|
@@ -21720,7 +21720,7 @@ class Transaction extends class Transaction$1 {
|
|
|
21720
21720
|
try {
|
|
21721
21721
|
return JSON.parse(e);
|
|
21722
21722
|
} catch (e) {
|
|
21723
|
-
throw new FirestoreError(
|
|
21723
|
+
throw new FirestoreError(C.INVALID_ARGUMENT, "Failed to parse JSON: " + (null == e ? void 0 : e.message));
|
|
21724
21724
|
}
|
|
21725
21725
|
}(e) : e, n = [];
|
|
21726
21726
|
if (Array.isArray(t.indexes)) for (const e of t.indexes) {
|
|
@@ -21737,7 +21737,7 @@ class Transaction extends class Transaction$1 {
|
|
|
21737
21737
|
}
|
|
21738
21738
|
|
|
21739
21739
|
function __PRIVATE_tryGetString(e, t) {
|
|
21740
|
-
if ("string" != typeof e[t]) throw new FirestoreError(
|
|
21740
|
+
if ("string" != typeof e[t]) throw new FirestoreError(C.INVALID_ARGUMENT, "Missing string value for: " + t);
|
|
21741
21741
|
return e[t];
|
|
21742
21742
|
}
|
|
21743
21743
|
|
|
@@ -21780,12 +21780,12 @@ function __PRIVATE_tryGetString(e, t) {
|
|
|
21780
21780
|
*/ function getPersistentCacheIndexManager(e) {
|
|
21781
21781
|
var t;
|
|
21782
21782
|
e = __PRIVATE_cast(e, Firestore);
|
|
21783
|
-
const n =
|
|
21783
|
+
const n = Ce.get(e);
|
|
21784
21784
|
if (n) return n;
|
|
21785
21785
|
const r = ensureFirestoreConfigured(e);
|
|
21786
21786
|
if ("persistent" !== (null === (t = r._uninitializedComponentsProvider) || void 0 === t ? void 0 : t._offlineKind)) return null;
|
|
21787
21787
|
const i = new PersistentCacheIndexManager(r);
|
|
21788
|
-
return
|
|
21788
|
+
return Ce.set(e, i), i;
|
|
21789
21789
|
}
|
|
21790
21790
|
|
|
21791
21791
|
/**
|
|
@@ -21828,7 +21828,7 @@ function __PRIVATE_setPersistentCacheIndexAutoCreationEnabled(e, t) {
|
|
|
21828
21828
|
* Use a `WeakMap` so that the mapping will be automatically dropped when the
|
|
21829
21829
|
* `Firestore` instance is garbage collected. This emulates a private member
|
|
21830
21830
|
* as described in https://goo.gle/454yvug.
|
|
21831
|
-
*/ const
|
|
21831
|
+
*/ const Ce = new WeakMap;
|
|
21832
21832
|
|
|
21833
21833
|
/**
|
|
21834
21834
|
* @license
|
|
@@ -21881,10 +21881,10 @@ function __PRIVATE_setPersistentCacheIndexAutoCreationEnabled(e, t) {
|
|
|
21881
21881
|
this.Mu = new Map;
|
|
21882
21882
|
}
|
|
21883
21883
|
static get instance() {
|
|
21884
|
-
return
|
|
21885
|
-
if (
|
|
21886
|
-
|
|
21887
|
-
}(
|
|
21884
|
+
return ve || (ve = new __PRIVATE_TestingHooksSpiImpl, function __PRIVATE_setTestingHooksSpi(e) {
|
|
21885
|
+
if (he) throw new Error("a TestingHooksSpi instance is already set");
|
|
21886
|
+
he = e;
|
|
21887
|
+
}(ve)), ve;
|
|
21888
21888
|
}
|
|
21889
21889
|
tt(e) {
|
|
21890
21890
|
this.Mu.forEach((t => t(e)));
|
|
@@ -21895,7 +21895,7 @@ function __PRIVATE_setPersistentCacheIndexAutoCreationEnabled(e, t) {
|
|
|
21895
21895
|
}
|
|
21896
21896
|
}
|
|
21897
21897
|
|
|
21898
|
-
let
|
|
21898
|
+
let ve = null;
|
|
21899
21899
|
|
|
21900
21900
|
/**
|
|
21901
21901
|
* Cloud Firestore
|
|
@@ -21903,25 +21903,25 @@ let Ce = null;
|
|
|
21903
21903
|
* @packageDocumentation
|
|
21904
21904
|
*/ !function __PRIVATE_registerFirestore(e, t = !0) {
|
|
21905
21905
|
!function __PRIVATE_setSDKVersion(e) {
|
|
21906
|
-
|
|
21906
|
+
b = e;
|
|
21907
21907
|
}(app.SDK_VERSION), app._registerComponent(new component.Component("firestore", ((e, {instanceIdentifier: n, options: r}) => {
|
|
21908
21908
|
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) {
|
|
21909
|
-
if (!Object.prototype.hasOwnProperty.apply(e.options, [ "projectId" ])) throw new FirestoreError(
|
|
21909
|
+
if (!Object.prototype.hasOwnProperty.apply(e.options, [ "projectId" ])) throw new FirestoreError(C.INVALID_ARGUMENT, '"projectId" not provided in firebase.initializeApp.');
|
|
21910
21910
|
return new DatabaseId(e.options.projectId, t);
|
|
21911
21911
|
}(i, n), i);
|
|
21912
21912
|
return r = Object.assign({
|
|
21913
21913
|
useFetchStreams: t
|
|
21914
21914
|
}, r), s._setSettings(r), s;
|
|
21915
|
-
}), "PUBLIC").setMultipleInstances(!0)), app.registerVersion(w,
|
|
21915
|
+
}), "PUBLIC").setMultipleInstances(!0)), app.registerVersion(w, S, e),
|
|
21916
21916
|
// BUILD_TARGET will be replaced by values like esm5, esm2017, cjs5, etc during the compilation
|
|
21917
|
-
app.registerVersion(w,
|
|
21917
|
+
app.registerVersion(w, S, "cjs2017");
|
|
21918
21918
|
}();
|
|
21919
21919
|
|
|
21920
21920
|
exports.AbstractUserDataWriter = AbstractUserDataWriter;
|
|
21921
21921
|
exports.AggregateField = AggregateField;
|
|
21922
21922
|
exports.AggregateQuerySnapshot = AggregateQuerySnapshot;
|
|
21923
21923
|
exports.Bytes = Bytes;
|
|
21924
|
-
exports.CACHE_SIZE_UNLIMITED =
|
|
21924
|
+
exports.CACHE_SIZE_UNLIMITED = we;
|
|
21925
21925
|
exports.CollectionReference = CollectionReference;
|
|
21926
21926
|
exports.DocumentReference = DocumentReference;
|
|
21927
21927
|
exports.DocumentSnapshot = DocumentSnapshot;
|