@firebase/firestore 4.7.1-canary.ca4dbcf3f → 4.7.1-canary.ff0475c41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/firestore/src/global_index.d.ts +1 -1
- package/dist/firestore/src/local/shared_client_state.d.ts +3 -3
- package/dist/index.cjs.js +311 -309
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm2017.js +312 -310
- package/dist/index.esm2017.js.map +1 -1
- package/dist/index.esm5.js +3128 -3125
- package/dist/index.esm5.js.map +1 -1
- package/dist/index.node.cjs.js +14 -9
- package/dist/index.node.cjs.js.map +1 -1
- package/dist/index.node.mjs +14 -9
- package/dist/index.node.mjs.map +1 -1
- package/dist/index.rn.js +317 -315
- package/dist/index.rn.js.map +1 -1
- package/dist/internal.d.ts +1 -1
- package/dist/lite/firestore/src/local/shared_client_state.d.ts +3 -3
- package/dist/lite/index.browser.esm2017.js +2 -2
- package/dist/lite/index.browser.esm5.js +2 -2
- package/dist/lite/index.cjs.js +2 -2
- package/dist/lite/index.node.cjs.js +2 -2
- package/dist/lite/index.node.mjs +2 -2
- package/dist/lite/index.rn.esm2017.js +2 -2
- package/dist/lite/internal.d.ts +1 -1
- package/dist/lite/packages/firestore/src/local/shared_client_state.d.ts +3 -3
- package/dist/lite/private.d.ts +1 -1
- package/dist/packages/firestore/dist/index.esm2017.d.ts +4 -4
- package/dist/packages/firestore/src/local/shared_client_state.d.ts +3 -3
- package/dist/private.d.ts +1 -1
- package/package.json +9 -9
package/dist/index.esm2017.js
CHANGED
|
@@ -3,9 +3,9 @@ import { Component } from '@firebase/component';
|
|
|
3
3
|
import { Logger, LogLevel } from '@firebase/logger';
|
|
4
4
|
import { FirebaseError, createMockUserToken, getModularInstance, deepEqual, getDefaultEmulatorHostnameAndPort, getUA, isIndexedDBAvailable, isSafari } from '@firebase/util';
|
|
5
5
|
import { Integer, Md5 } from '@firebase/webchannel-wrapper/bloom-blob';
|
|
6
|
-
import { XhrIo, EventType, ErrorCode, createWebChannelTransport, getStatEventTarget,
|
|
6
|
+
import { XhrIo, EventType, ErrorCode, createWebChannelTransport, getStatEventTarget, WebChannel, Event, Stat } from '@firebase/webchannel-wrapper/webchannel-blob';
|
|
7
7
|
|
|
8
|
-
const
|
|
8
|
+
const w = "@firebase/firestore";
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* @license
|
|
@@ -67,7 +67,7 @@ User.MOCK_USER = new User("mock-user");
|
|
|
67
67
|
* See the License for the specific language governing permissions and
|
|
68
68
|
* limitations under the License.
|
|
69
69
|
*/
|
|
70
|
-
let
|
|
70
|
+
let S = "10.13.1-canary.ff0475c41";
|
|
71
71
|
|
|
72
72
|
/**
|
|
73
73
|
* @license
|
|
@@ -85,11 +85,11 @@ let b = "10.13.1-canary.ca4dbcf3f";
|
|
|
85
85
|
* See the License for the specific language governing permissions and
|
|
86
86
|
* limitations under the License.
|
|
87
87
|
*/
|
|
88
|
-
const
|
|
88
|
+
const b = new Logger("@firebase/firestore");
|
|
89
89
|
|
|
90
90
|
// Helper methods are needed because variables can't be exported as read/write
|
|
91
91
|
function __PRIVATE_getLogLevel() {
|
|
92
|
-
return
|
|
92
|
+
return b.logLevel;
|
|
93
93
|
}
|
|
94
94
|
|
|
95
95
|
/**
|
|
@@ -105,29 +105,29 @@ function __PRIVATE_getLogLevel() {
|
|
|
105
105
|
* <li><code>`silent` to turn off logging.</li>
|
|
106
106
|
* </ul>
|
|
107
107
|
*/ function setLogLevel(e) {
|
|
108
|
-
|
|
108
|
+
b.setLogLevel(e);
|
|
109
109
|
}
|
|
110
110
|
|
|
111
111
|
function __PRIVATE_logDebug(e, ...t) {
|
|
112
|
-
if (
|
|
112
|
+
if (b.logLevel <= LogLevel.DEBUG) {
|
|
113
113
|
const n = t.map(__PRIVATE_argToString);
|
|
114
|
-
|
|
114
|
+
b.debug(`Firestore (${S}): ${e}`, ...n);
|
|
115
115
|
}
|
|
116
116
|
}
|
|
117
117
|
|
|
118
118
|
function __PRIVATE_logError(e, ...t) {
|
|
119
|
-
if (
|
|
119
|
+
if (b.logLevel <= LogLevel.ERROR) {
|
|
120
120
|
const n = t.map(__PRIVATE_argToString);
|
|
121
|
-
|
|
121
|
+
b.error(`Firestore (${S}): ${e}`, ...n);
|
|
122
122
|
}
|
|
123
123
|
}
|
|
124
124
|
|
|
125
125
|
/**
|
|
126
126
|
* @internal
|
|
127
127
|
*/ function __PRIVATE_logWarn(e, ...t) {
|
|
128
|
-
if (
|
|
128
|
+
if (b.logLevel <= LogLevel.WARN) {
|
|
129
129
|
const n = t.map(__PRIVATE_argToString);
|
|
130
|
-
|
|
130
|
+
b.warn(`Firestore (${S}): ${e}`, ...n);
|
|
131
131
|
}
|
|
132
132
|
}
|
|
133
133
|
|
|
@@ -188,7 +188,7 @@ function __PRIVATE_logError(e, ...t) {
|
|
|
188
188
|
*/ function fail(e = "Unexpected state") {
|
|
189
189
|
// Log the failure in addition to throw an exception, just in case the
|
|
190
190
|
// exception is swallowed.
|
|
191
|
-
const t = `FIRESTORE (${
|
|
191
|
+
const t = `FIRESTORE (${S}) INTERNAL ASSERTION FAILED: ` + e;
|
|
192
192
|
// NOTE: We don't use FirestoreError here because these are internal failures
|
|
193
193
|
// that cannot be handled by the user. (Also it would create a circular
|
|
194
194
|
// dependency between the error and assert modules which doesn't work.)
|
|
@@ -241,7 +241,7 @@ t) {
|
|
|
241
241
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
242
242
|
* See the License for the specific language governing permissions and
|
|
243
243
|
* limitations under the License.
|
|
244
|
-
*/ const
|
|
244
|
+
*/ const D = {
|
|
245
245
|
// Causes are copied from:
|
|
246
246
|
// https://github.com/grpc/grpc/blob/bceec94ea4fc5f0085d81235d8e1c06798dc341a/include/grpc%2B%2B/impl/codegen/status_code_enum.h
|
|
247
247
|
/** Not an error; returned on success. */
|
|
@@ -786,11 +786,11 @@ class Timestamp {
|
|
|
786
786
|
* The fractions of a second at nanosecond resolution.*
|
|
787
787
|
*/
|
|
788
788
|
t) {
|
|
789
|
-
if (this.seconds = e, this.nanoseconds = t, t < 0) throw new FirestoreError(
|
|
790
|
-
if (t >= 1e9) throw new FirestoreError(
|
|
791
|
-
if (e < -62135596800) throw new FirestoreError(
|
|
789
|
+
if (this.seconds = e, this.nanoseconds = t, t < 0) throw new FirestoreError(D.INVALID_ARGUMENT, "Timestamp nanoseconds out of range: " + t);
|
|
790
|
+
if (t >= 1e9) throw new FirestoreError(D.INVALID_ARGUMENT, "Timestamp nanoseconds out of range: " + t);
|
|
791
|
+
if (e < -62135596800) throw new FirestoreError(D.INVALID_ARGUMENT, "Timestamp seconds out of range: " + e);
|
|
792
792
|
// This will break in the year 10,000.
|
|
793
|
-
if (e >= 253402300800) throw new FirestoreError(
|
|
793
|
+
if (e >= 253402300800) throw new FirestoreError(D.INVALID_ARGUMENT, "Timestamp seconds out of range: " + e);
|
|
794
794
|
}
|
|
795
795
|
/**
|
|
796
796
|
* Creates a new timestamp with the current date, with millisecond precision.
|
|
@@ -1045,7 +1045,7 @@ class BasePath {
|
|
|
1045
1045
|
// for legacy reasons and should not be used frequently).
|
|
1046
1046
|
const t = [];
|
|
1047
1047
|
for (const n of e) {
|
|
1048
|
-
if (n.indexOf("//") >= 0) throw new FirestoreError(
|
|
1048
|
+
if (n.indexOf("//") >= 0) throw new FirestoreError(D.INVALID_ARGUMENT, `Invalid segment (${n}). Paths must not contain // in them.`);
|
|
1049
1049
|
// Strip leading and trailing slashed.
|
|
1050
1050
|
t.push(...n.split("/").filter((e => e.length > 0)));
|
|
1051
1051
|
}
|
|
@@ -1056,7 +1056,7 @@ class BasePath {
|
|
|
1056
1056
|
}
|
|
1057
1057
|
}
|
|
1058
1058
|
|
|
1059
|
-
const
|
|
1059
|
+
const v = /^[_a-zA-Z][_a-zA-Z0-9]*$/;
|
|
1060
1060
|
|
|
1061
1061
|
/**
|
|
1062
1062
|
* A dot-separated path for navigating sub-objects within a document.
|
|
@@ -1069,7 +1069,7 @@ const C = /^[_a-zA-Z][_a-zA-Z0-9]*$/;
|
|
|
1069
1069
|
* Returns true if the string could be used as a segment in a field path
|
|
1070
1070
|
* without escaping.
|
|
1071
1071
|
*/ static isValidIdentifier(e) {
|
|
1072
|
-
return
|
|
1072
|
+
return v.test(e);
|
|
1073
1073
|
}
|
|
1074
1074
|
canonicalString() {
|
|
1075
1075
|
return this.toArray().map((e => (e = e.replace(/\\/g, "\\\\").replace(/`/g, "\\`"),
|
|
@@ -1101,21 +1101,21 @@ const C = /^[_a-zA-Z][_a-zA-Z0-9]*$/;
|
|
|
1101
1101
|
const t = [];
|
|
1102
1102
|
let n = "", r = 0;
|
|
1103
1103
|
const __PRIVATE_addCurrentSegment = () => {
|
|
1104
|
-
if (0 === n.length) throw new FirestoreError(
|
|
1104
|
+
if (0 === n.length) throw new FirestoreError(D.INVALID_ARGUMENT, `Invalid field path (${e}). Paths must not be empty, begin with '.', end with '.', or contain '..'`);
|
|
1105
1105
|
t.push(n), n = "";
|
|
1106
1106
|
};
|
|
1107
1107
|
let i = !1;
|
|
1108
1108
|
for (;r < e.length; ) {
|
|
1109
1109
|
const t = e[r];
|
|
1110
1110
|
if ("\\" === t) {
|
|
1111
|
-
if (r + 1 === e.length) throw new FirestoreError(
|
|
1111
|
+
if (r + 1 === e.length) throw new FirestoreError(D.INVALID_ARGUMENT, "Path has trailing escape character: " + e);
|
|
1112
1112
|
const t = e[r + 1];
|
|
1113
|
-
if ("\\" !== t && "." !== t && "`" !== t) throw new FirestoreError(
|
|
1113
|
+
if ("\\" !== t && "." !== t && "`" !== t) throw new FirestoreError(D.INVALID_ARGUMENT, "Path has invalid escape sequence: " + e);
|
|
1114
1114
|
n += t, r += 2;
|
|
1115
1115
|
} else "`" === t ? (i = !i, r++) : "." !== t || i ? (n += t, r++) : (__PRIVATE_addCurrentSegment(),
|
|
1116
1116
|
r++);
|
|
1117
1117
|
}
|
|
1118
|
-
if (__PRIVATE_addCurrentSegment(), i) throw new FirestoreError(
|
|
1118
|
+
if (__PRIVATE_addCurrentSegment(), i) throw new FirestoreError(D.INVALID_ARGUMENT, "Unterminated ` in path: " + e);
|
|
1119
1119
|
return new FieldPath$1(t);
|
|
1120
1120
|
}
|
|
1121
1121
|
static emptyPath() {
|
|
@@ -1367,7 +1367,7 @@ function __PRIVATE_indexOffsetComparator(e, t) {
|
|
|
1367
1367
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1368
1368
|
* See the License for the specific language governing permissions and
|
|
1369
1369
|
* limitations under the License.
|
|
1370
|
-
*/ const
|
|
1370
|
+
*/ const C = "The current tab is not in the required state to perform this operation. It might be necessary to refresh the browser tab.";
|
|
1371
1371
|
|
|
1372
1372
|
/**
|
|
1373
1373
|
* A base class representing a persistence transaction, encapsulating both the
|
|
@@ -1414,7 +1414,7 @@ function __PRIVATE_indexOffsetComparator(e, t) {
|
|
|
1414
1414
|
* @param err - An error returned by a LocalStore operation.
|
|
1415
1415
|
* @returns A Promise that resolves after we recovered, or the original error.
|
|
1416
1416
|
*/ async function __PRIVATE_ignoreIfPrimaryLeaseLoss(e) {
|
|
1417
|
-
if (e.code !==
|
|
1417
|
+
if (e.code !== D.FAILED_PRECONDITION || e.message !== C) throw e;
|
|
1418
1418
|
__PRIVATE_logDebug("LocalStore", "Unexpectedly lost primary lease");
|
|
1419
1419
|
}
|
|
1420
1420
|
|
|
@@ -1719,7 +1719,7 @@ class __PRIVATE_SimpleDbTransaction {
|
|
|
1719
1719
|
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."));
|
|
1720
1720
|
}, r.onerror = t => {
|
|
1721
1721
|
const r = t.target.error;
|
|
1722
|
-
"VersionError" === r.name ? n(new FirestoreError(
|
|
1722
|
+
"VersionError" === r.name ? n(new FirestoreError(D.FAILED_PRECONDITION, "A newer version of the Firestore SDK was previously used and so the persisted data is not compatible with the version of the SDK you are now using. The SDK will operate with persistence disabled. If you need persistence, please re-upgrade to a newer version of the SDK or else clear the persisted IndexedDB data for your app to start fresh.")) : "InvalidStateError" === r.name ? n(new FirestoreError(D.FAILED_PRECONDITION, "Unable to open an IndexedDB connection. This could be due to running in a private browsing session on a browser whose private browsing sessions do not support IndexedDB: " + r)) : n(new __PRIVATE_IndexedDbTransactionError(e, r));
|
|
1723
1723
|
}, r.onupgradeneeded = e => {
|
|
1724
1724
|
__PRIVATE_logDebug("SimpleDb", 'Database "' + this.name + '" requires upgrade from version:', e.oldVersion);
|
|
1725
1725
|
const t = e.target.result;
|
|
@@ -1811,7 +1811,7 @@ class __PRIVATE_SimpleDbTransaction {
|
|
|
1811
1811
|
|
|
1812
1812
|
/** An error that wraps exceptions that thrown during IndexedDB execution. */ class __PRIVATE_IndexedDbTransactionError extends FirestoreError {
|
|
1813
1813
|
constructor(e, t) {
|
|
1814
|
-
super(
|
|
1814
|
+
super(D.UNAVAILABLE, `IndexedDB transaction '${e}' failed: ${t}`), this.name = "IndexedDbTransactionError";
|
|
1815
1815
|
}
|
|
1816
1816
|
}
|
|
1817
1817
|
|
|
@@ -1995,7 +1995,7 @@ class __PRIVATE_SimpleDbTransaction {
|
|
|
1995
1995
|
}
|
|
1996
1996
|
|
|
1997
1997
|
// Guard so we only report the error once.
|
|
1998
|
-
let
|
|
1998
|
+
let F = !1;
|
|
1999
1999
|
|
|
2000
2000
|
function __PRIVATE_checkForAndReportiOSError(e) {
|
|
2001
2001
|
const t = __PRIVATE_SimpleDb.S(getUA());
|
|
@@ -2004,7 +2004,7 @@ function __PRIVATE_checkForAndReportiOSError(e) {
|
|
|
2004
2004
|
if (e.message.indexOf(t) >= 0) {
|
|
2005
2005
|
// Wrap error in a more descriptive one.
|
|
2006
2006
|
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.`);
|
|
2007
|
-
return
|
|
2007
|
+
return F || (F = !0,
|
|
2008
2008
|
// Throw a global exception outside of this promise chain, for the user to
|
|
2009
2009
|
// potentially catch.
|
|
2010
2010
|
setTimeout((() => {
|
|
@@ -2256,7 +2256,7 @@ function __PRIVATE_encodeResourcePath(e) {
|
|
|
2256
2256
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2257
2257
|
* See the License for the specific language governing permissions and
|
|
2258
2258
|
* limitations under the License.
|
|
2259
|
-
*/ const
|
|
2259
|
+
*/ const M = [ "userId", "batchId" ];
|
|
2260
2260
|
|
|
2261
2261
|
/**
|
|
2262
2262
|
* @license
|
|
@@ -2301,7 +2301,7 @@ function __PRIVATE_newDbDocumentMutationPrefixForPath(e, t) {
|
|
|
2301
2301
|
* there is no useful information to store as the value. The raw (unencoded)
|
|
2302
2302
|
* path cannot be stored because IndexedDb doesn't store prototype
|
|
2303
2303
|
* information.
|
|
2304
|
-
*/ const
|
|
2304
|
+
*/ const x = {}, O = [ "prefixPath", "collectionGroup", "readTime", "documentId" ], N = [ "prefixPath", "collectionGroup", "documentId" ], L = [ "collectionGroup", "readTime", "prefixPath", "documentId" ], B = [ "canonicalId", "targetId" ], k = [ "targetId", "path" ], q = [ "path", "targetId" ], Q = [ "collectionId", "parent" ], K = [ "indexId", "uid" ], $ = [ "uid", "sequenceNumber" ], U = [ "indexId", "uid", "arrayValue", "directionalValue", "orderedDocumentKey", "documentKey" ], W = [ "indexId", "uid", "orderedDocumentKey" ], G = [ "userId", "collectionPath", "documentId" ], z = [ "userId", "collectionPath", "largestBatchId" ], j = [ "userId", "collectionGroup", "largestBatchId" ], H = [ ...[ ...[ ...[ ...[ "mutationQueues", "mutations", "documentMutations", "remoteDocuments", "targets", "owner", "targetGlobal", "targetDocuments" ], "clientMetadata" ], "remoteDocumentGlobal" ], "collectionParents" ], "bundles", "namedQueries" ], J = [ ...H, "documentOverlays" ], Y = [ "mutationQueues", "mutations", "documentMutations", "remoteDocumentsV14", "targets", "owner", "targetGlobal", "targetDocuments", "clientMetadata", "remoteDocumentGlobal", "collectionParents", "bundles", "namedQueries", "documentOverlays" ], Z = Y, X = [ ...Z, "indexConfiguration", "indexState", "indexEntries" ], ee = X, te = [ ...X, "globals" ];
|
|
2305
2305
|
|
|
2306
2306
|
/**
|
|
2307
2307
|
* @license
|
|
@@ -3064,7 +3064,7 @@ function __PRIVATE_isBase64Available() {
|
|
|
3064
3064
|
|
|
3065
3065
|
ByteString.EMPTY_BYTE_STRING = new ByteString("");
|
|
3066
3066
|
|
|
3067
|
-
const
|
|
3067
|
+
const ne = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
|
|
3068
3068
|
|
|
3069
3069
|
/**
|
|
3070
3070
|
* Converts the possible Proto values for a timestamp value into a "seconds and
|
|
@@ -3078,7 +3078,7 @@ const re = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
|
|
|
3078
3078
|
// (millis), so we do some custom parsing here.
|
|
3079
3079
|
// Parse the nanos right out of the string.
|
|
3080
3080
|
let t = 0;
|
|
3081
|
-
const n =
|
|
3081
|
+
const n = ne.exec(e);
|
|
3082
3082
|
if (__PRIVATE_hardAssert(!!n), n[1]) {
|
|
3083
3083
|
// Pad the fraction out to 9 digits (nanos).
|
|
3084
3084
|
let e = n[1];
|
|
@@ -3245,7 +3245,7 @@ class DatabaseId {
|
|
|
3245
3245
|
* See the License for the specific language governing permissions and
|
|
3246
3246
|
* limitations under the License.
|
|
3247
3247
|
*/
|
|
3248
|
-
const
|
|
3248
|
+
const re = {
|
|
3249
3249
|
mapValue: {
|
|
3250
3250
|
fields: {
|
|
3251
3251
|
__type__: {
|
|
@@ -3253,7 +3253,7 @@ const ie = {
|
|
|
3253
3253
|
}
|
|
3254
3254
|
}
|
|
3255
3255
|
}
|
|
3256
|
-
},
|
|
3256
|
+
}, ie = {
|
|
3257
3257
|
nullValue: "NULL_VALUE"
|
|
3258
3258
|
};
|
|
3259
3259
|
|
|
@@ -3399,9 +3399,9 @@ function __PRIVATE_valueCompare(e, t) {
|
|
|
3399
3399
|
|
|
3400
3400
|
case 11 /* TypeOrder.ObjectValue */ :
|
|
3401
3401
|
return function __PRIVATE_compareMaps(e, t) {
|
|
3402
|
-
if (e ===
|
|
3403
|
-
if (e ===
|
|
3404
|
-
if (t ===
|
|
3402
|
+
if (e === re.mapValue && t === re.mapValue) return 0;
|
|
3403
|
+
if (e === re.mapValue) return 1;
|
|
3404
|
+
if (t === re.mapValue) return -1;
|
|
3405
3405
|
const n = e.fields || {}, r = Object.keys(n), i = t.fields || {}, s = Object.keys(i);
|
|
3406
3406
|
// Even though MapValues are likely sorted correctly based on their insertion
|
|
3407
3407
|
// order (e.g. when received from the backend), local modifications can bring
|
|
@@ -3591,7 +3591,7 @@ function isArray(e) {
|
|
|
3591
3591
|
return "__max__" === (((e.mapValue || {}).fields || {}).__type__ || {}).stringValue;
|
|
3592
3592
|
}
|
|
3593
3593
|
|
|
3594
|
-
const
|
|
3594
|
+
const se = {
|
|
3595
3595
|
mapValue: {
|
|
3596
3596
|
fields: {
|
|
3597
3597
|
__type__: {
|
|
@@ -3605,7 +3605,7 @@ const oe = {
|
|
|
3605
3605
|
};
|
|
3606
3606
|
|
|
3607
3607
|
/** Returns the lowest value for the given value type (inclusive). */ function __PRIVATE_valuesGetLowerBound(e) {
|
|
3608
|
-
return "nullValue" in e ?
|
|
3608
|
+
return "nullValue" in e ? ie : "booleanValue" in e ? {
|
|
3609
3609
|
booleanValue: !1
|
|
3610
3610
|
} : "integerValue" in e || "doubleValue" in e ? {
|
|
3611
3611
|
doubleValue: NaN
|
|
@@ -3624,7 +3624,7 @@ const oe = {
|
|
|
3624
3624
|
}
|
|
3625
3625
|
} : "arrayValue" in e ? {
|
|
3626
3626
|
arrayValue: {}
|
|
3627
|
-
} : "mapValue" in e ? __PRIVATE_isVectorValue(e) ?
|
|
3627
|
+
} : "mapValue" in e ? __PRIVATE_isVectorValue(e) ? se : {
|
|
3628
3628
|
mapValue: {}
|
|
3629
3629
|
} : fail();
|
|
3630
3630
|
}
|
|
@@ -3649,9 +3649,9 @@ const oe = {
|
|
|
3649
3649
|
}
|
|
3650
3650
|
} : "geoPointValue" in e ? {
|
|
3651
3651
|
arrayValue: {}
|
|
3652
|
-
} : "arrayValue" in e ?
|
|
3652
|
+
} : "arrayValue" in e ? se : "mapValue" in e ? __PRIVATE_isVectorValue(e) ? {
|
|
3653
3653
|
mapValue: {}
|
|
3654
|
-
} :
|
|
3654
|
+
} : re : fail();
|
|
3655
3655
|
}
|
|
3656
3656
|
|
|
3657
3657
|
function __PRIVATE_lowerBoundCompare(e, t) {
|
|
@@ -4339,10 +4339,10 @@ function __PRIVATE_targetIsDocumentTarget(e) {
|
|
|
4339
4339
|
* the provided `fieldPath` (or the upper bound for an descending segment).
|
|
4340
4340
|
*/
|
|
4341
4341
|
function __PRIVATE_targetGetAscendingBound(e, t, n) {
|
|
4342
|
-
let r =
|
|
4342
|
+
let r = ie, i = !0;
|
|
4343
4343
|
// Process all filters to find a value for the current field segment
|
|
4344
4344
|
for (const n of __PRIVATE_targetGetFieldFiltersForPath(e, t)) {
|
|
4345
|
-
let e =
|
|
4345
|
+
let e = ie, t = !0;
|
|
4346
4346
|
switch (n.op) {
|
|
4347
4347
|
case "<" /* Operator.LESS_THAN */ :
|
|
4348
4348
|
case "<=" /* Operator.LESS_THAN_OR_EQUAL */ :
|
|
@@ -4361,7 +4361,7 @@ function __PRIVATE_targetGetAscendingBound(e, t, n) {
|
|
|
4361
4361
|
|
|
4362
4362
|
case "!=" /* Operator.NOT_EQUAL */ :
|
|
4363
4363
|
case "not-in" /* Operator.NOT_IN */ :
|
|
4364
|
-
e =
|
|
4364
|
+
e = ie;
|
|
4365
4365
|
// Remaining filters cannot be used as lower bounds.
|
|
4366
4366
|
}
|
|
4367
4367
|
__PRIVATE_lowerBoundCompare({
|
|
@@ -4397,10 +4397,10 @@ function __PRIVATE_targetGetAscendingBound(e, t, n) {
|
|
|
4397
4397
|
* Returns the value to use as the upper bound for ascending index segment at
|
|
4398
4398
|
* the provided `fieldPath` (or the lower bound for a descending segment).
|
|
4399
4399
|
*/ function __PRIVATE_targetGetDescendingBound(e, t, n) {
|
|
4400
|
-
let r =
|
|
4400
|
+
let r = re, i = !0;
|
|
4401
4401
|
// Process all filters to find a value for the current field segment
|
|
4402
4402
|
for (const n of __PRIVATE_targetGetFieldFiltersForPath(e, t)) {
|
|
4403
|
-
let e =
|
|
4403
|
+
let e = re, t = !0;
|
|
4404
4404
|
switch (n.op) {
|
|
4405
4405
|
case ">=" /* Operator.GREATER_THAN_OR_EQUAL */ :
|
|
4406
4406
|
case ">" /* Operator.GREATER_THAN */ :
|
|
@@ -4419,7 +4419,7 @@ function __PRIVATE_targetGetAscendingBound(e, t, n) {
|
|
|
4419
4419
|
|
|
4420
4420
|
case "!=" /* Operator.NOT_EQUAL */ :
|
|
4421
4421
|
case "not-in" /* Operator.NOT_IN */ :
|
|
4422
|
-
e =
|
|
4422
|
+
e = re;
|
|
4423
4423
|
// Remaining filters cannot be used as upper bounds.
|
|
4424
4424
|
}
|
|
4425
4425
|
__PRIVATE_upperBoundCompare({
|
|
@@ -4803,22 +4803,22 @@ function __PRIVATE_compareDocs(e, t, n) {
|
|
|
4803
4803
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
4804
4804
|
* See the License for the specific language governing permissions and
|
|
4805
4805
|
* limitations under the License.
|
|
4806
|
-
*/ const
|
|
4806
|
+
*/ const oe = new SortedMap(DocumentKey.comparator);
|
|
4807
4807
|
|
|
4808
4808
|
function __PRIVATE_mutableDocumentMap() {
|
|
4809
|
-
return
|
|
4809
|
+
return oe;
|
|
4810
4810
|
}
|
|
4811
4811
|
|
|
4812
|
-
const
|
|
4812
|
+
const _e = new SortedMap(DocumentKey.comparator);
|
|
4813
4813
|
|
|
4814
4814
|
function documentMap(...e) {
|
|
4815
|
-
let t =
|
|
4815
|
+
let t = _e;
|
|
4816
4816
|
for (const n of e) t = t.insert(n.key, n);
|
|
4817
4817
|
return t;
|
|
4818
4818
|
}
|
|
4819
4819
|
|
|
4820
4820
|
function __PRIVATE_convertOverlayedDocumentMapToDocumentMap(e) {
|
|
4821
|
-
let t =
|
|
4821
|
+
let t = _e;
|
|
4822
4822
|
return e.forEach(((e, n) => t = t.insert(e, n.overlayedDocument))), t;
|
|
4823
4823
|
}
|
|
4824
4824
|
|
|
@@ -4834,20 +4834,20 @@ function __PRIVATE_newDocumentKeyMap() {
|
|
|
4834
4834
|
return new ObjectMap((e => e.toString()), ((e, t) => e.isEqual(t)));
|
|
4835
4835
|
}
|
|
4836
4836
|
|
|
4837
|
-
const
|
|
4837
|
+
const ae = new SortedMap(DocumentKey.comparator);
|
|
4838
4838
|
|
|
4839
|
-
const
|
|
4839
|
+
const ue = new SortedSet(DocumentKey.comparator);
|
|
4840
4840
|
|
|
4841
4841
|
function __PRIVATE_documentKeySet(...e) {
|
|
4842
|
-
let t =
|
|
4842
|
+
let t = ue;
|
|
4843
4843
|
for (const n of e) t = t.add(n);
|
|
4844
4844
|
return t;
|
|
4845
4845
|
}
|
|
4846
4846
|
|
|
4847
|
-
const
|
|
4847
|
+
const ce = new SortedSet(__PRIVATE_primitiveComparator);
|
|
4848
4848
|
|
|
4849
4849
|
function __PRIVATE_targetIdSet() {
|
|
4850
|
-
return
|
|
4850
|
+
return ce;
|
|
4851
4851
|
}
|
|
4852
4852
|
|
|
4853
4853
|
/**
|
|
@@ -5538,7 +5538,7 @@ class __PRIVATE_VerifyMutation extends Mutation {
|
|
|
5538
5538
|
*/ static from(e, t, n) {
|
|
5539
5539
|
__PRIVATE_hardAssert(e.mutations.length === n.length);
|
|
5540
5540
|
let r = function __PRIVATE_documentVersionMap() {
|
|
5541
|
-
return
|
|
5541
|
+
return ae;
|
|
5542
5542
|
}();
|
|
5543
5543
|
const i = e.mutations;
|
|
5544
5544
|
for (let e = 0; e < i.length; e++) r = r.insert(i[e].key, n[e].version);
|
|
@@ -5652,7 +5652,7 @@ class __PRIVATE_VerifyMutation extends Mutation {
|
|
|
5652
5652
|
* Important! The names of these identifiers matter because the string forms
|
|
5653
5653
|
* are used for reverse lookups from the webchannel stream. Do NOT change the
|
|
5654
5654
|
* names of these identifiers or change this into a const enum.
|
|
5655
|
-
*/ var
|
|
5655
|
+
*/ var le, he;
|
|
5656
5656
|
|
|
5657
5657
|
/**
|
|
5658
5658
|
* Determines whether an error code represents a permanent error when received
|
|
@@ -5665,29 +5665,29 @@ function __PRIVATE_isPermanentError(e) {
|
|
|
5665
5665
|
default:
|
|
5666
5666
|
return fail();
|
|
5667
5667
|
|
|
5668
|
-
case
|
|
5669
|
-
case
|
|
5670
|
-
case
|
|
5671
|
-
case
|
|
5672
|
-
case
|
|
5673
|
-
case
|
|
5668
|
+
case D.CANCELLED:
|
|
5669
|
+
case D.UNKNOWN:
|
|
5670
|
+
case D.DEADLINE_EXCEEDED:
|
|
5671
|
+
case D.RESOURCE_EXHAUSTED:
|
|
5672
|
+
case D.INTERNAL:
|
|
5673
|
+
case D.UNAVAILABLE:
|
|
5674
5674
|
// Unauthenticated means something went wrong with our token and we need
|
|
5675
5675
|
// to retry with new credentials which will happen automatically.
|
|
5676
|
-
case
|
|
5676
|
+
case D.UNAUTHENTICATED:
|
|
5677
5677
|
return !1;
|
|
5678
5678
|
|
|
5679
|
-
case
|
|
5680
|
-
case
|
|
5681
|
-
case
|
|
5682
|
-
case
|
|
5683
|
-
case
|
|
5679
|
+
case D.INVALID_ARGUMENT:
|
|
5680
|
+
case D.NOT_FOUND:
|
|
5681
|
+
case D.ALREADY_EXISTS:
|
|
5682
|
+
case D.PERMISSION_DENIED:
|
|
5683
|
+
case D.FAILED_PRECONDITION:
|
|
5684
5684
|
// Aborted might be retried in some scenarios, but that is dependent on
|
|
5685
5685
|
// the context and should handled individually by the calling code.
|
|
5686
5686
|
// See https://cloud.google.com/apis/design/errors.
|
|
5687
|
-
case
|
|
5688
|
-
case
|
|
5689
|
-
case
|
|
5690
|
-
case
|
|
5687
|
+
case D.ABORTED:
|
|
5688
|
+
case D.OUT_OF_RANGE:
|
|
5689
|
+
case D.UNIMPLEMENTED:
|
|
5690
|
+
case D.DATA_LOSS:
|
|
5691
5691
|
return !0;
|
|
5692
5692
|
}
|
|
5693
5693
|
}
|
|
@@ -5715,58 +5715,58 @@ function __PRIVATE_mapCodeFromRpcCode(e) {
|
|
|
5715
5715
|
if (void 0 === e)
|
|
5716
5716
|
// This shouldn't normally happen, but in certain error cases (like trying
|
|
5717
5717
|
// to send invalid proto messages) we may get an error with no GRPC code.
|
|
5718
|
-
return __PRIVATE_logError("GRPC error has no .code"),
|
|
5718
|
+
return __PRIVATE_logError("GRPC error has no .code"), D.UNKNOWN;
|
|
5719
5719
|
switch (e) {
|
|
5720
|
-
case
|
|
5721
|
-
return
|
|
5720
|
+
case le.OK:
|
|
5721
|
+
return D.OK;
|
|
5722
5722
|
|
|
5723
|
-
case
|
|
5724
|
-
return
|
|
5723
|
+
case le.CANCELLED:
|
|
5724
|
+
return D.CANCELLED;
|
|
5725
5725
|
|
|
5726
|
-
case
|
|
5727
|
-
return
|
|
5726
|
+
case le.UNKNOWN:
|
|
5727
|
+
return D.UNKNOWN;
|
|
5728
5728
|
|
|
5729
|
-
case
|
|
5730
|
-
return
|
|
5729
|
+
case le.DEADLINE_EXCEEDED:
|
|
5730
|
+
return D.DEADLINE_EXCEEDED;
|
|
5731
5731
|
|
|
5732
|
-
case
|
|
5733
|
-
return
|
|
5732
|
+
case le.RESOURCE_EXHAUSTED:
|
|
5733
|
+
return D.RESOURCE_EXHAUSTED;
|
|
5734
5734
|
|
|
5735
|
-
case
|
|
5736
|
-
return
|
|
5735
|
+
case le.INTERNAL:
|
|
5736
|
+
return D.INTERNAL;
|
|
5737
5737
|
|
|
5738
|
-
case
|
|
5739
|
-
return
|
|
5738
|
+
case le.UNAVAILABLE:
|
|
5739
|
+
return D.UNAVAILABLE;
|
|
5740
5740
|
|
|
5741
|
-
case
|
|
5742
|
-
return
|
|
5741
|
+
case le.UNAUTHENTICATED:
|
|
5742
|
+
return D.UNAUTHENTICATED;
|
|
5743
5743
|
|
|
5744
|
-
case
|
|
5745
|
-
return
|
|
5744
|
+
case le.INVALID_ARGUMENT:
|
|
5745
|
+
return D.INVALID_ARGUMENT;
|
|
5746
5746
|
|
|
5747
|
-
case
|
|
5748
|
-
return
|
|
5747
|
+
case le.NOT_FOUND:
|
|
5748
|
+
return D.NOT_FOUND;
|
|
5749
5749
|
|
|
5750
|
-
case
|
|
5751
|
-
return
|
|
5750
|
+
case le.ALREADY_EXISTS:
|
|
5751
|
+
return D.ALREADY_EXISTS;
|
|
5752
5752
|
|
|
5753
|
-
case
|
|
5754
|
-
return
|
|
5753
|
+
case le.PERMISSION_DENIED:
|
|
5754
|
+
return D.PERMISSION_DENIED;
|
|
5755
5755
|
|
|
5756
|
-
case
|
|
5757
|
-
return
|
|
5756
|
+
case le.FAILED_PRECONDITION:
|
|
5757
|
+
return D.FAILED_PRECONDITION;
|
|
5758
5758
|
|
|
5759
|
-
case
|
|
5760
|
-
return
|
|
5759
|
+
case le.ABORTED:
|
|
5760
|
+
return D.ABORTED;
|
|
5761
5761
|
|
|
5762
|
-
case
|
|
5763
|
-
return
|
|
5762
|
+
case le.OUT_OF_RANGE:
|
|
5763
|
+
return D.OUT_OF_RANGE;
|
|
5764
5764
|
|
|
5765
|
-
case
|
|
5766
|
-
return
|
|
5765
|
+
case le.UNIMPLEMENTED:
|
|
5766
|
+
return D.UNIMPLEMENTED;
|
|
5767
5767
|
|
|
5768
|
-
case
|
|
5769
|
-
return
|
|
5768
|
+
case le.DATA_LOSS:
|
|
5769
|
+
return D.DATA_LOSS;
|
|
5770
5770
|
|
|
5771
5771
|
default:
|
|
5772
5772
|
return fail();
|
|
@@ -5780,14 +5780,14 @@ function __PRIVATE_mapCodeFromRpcCode(e) {
|
|
|
5780
5780
|
* "UNKNOWN", etc.)
|
|
5781
5781
|
* @returns The equivalent Code. Non-matching responses are mapped to
|
|
5782
5782
|
* Code.UNKNOWN.
|
|
5783
|
-
*/ (
|
|
5784
|
-
|
|
5785
|
-
|
|
5786
|
-
|
|
5787
|
-
|
|
5788
|
-
|
|
5789
|
-
|
|
5790
|
-
|
|
5783
|
+
*/ (he = le || (le = {}))[he.OK = 0] = "OK", he[he.CANCELLED = 1] = "CANCELLED",
|
|
5784
|
+
he[he.UNKNOWN = 2] = "UNKNOWN", he[he.INVALID_ARGUMENT = 3] = "INVALID_ARGUMENT",
|
|
5785
|
+
he[he.DEADLINE_EXCEEDED = 4] = "DEADLINE_EXCEEDED", he[he.NOT_FOUND = 5] = "NOT_FOUND",
|
|
5786
|
+
he[he.ALREADY_EXISTS = 6] = "ALREADY_EXISTS", he[he.PERMISSION_DENIED = 7] = "PERMISSION_DENIED",
|
|
5787
|
+
he[he.UNAUTHENTICATED = 16] = "UNAUTHENTICATED", he[he.RESOURCE_EXHAUSTED = 8] = "RESOURCE_EXHAUSTED",
|
|
5788
|
+
he[he.FAILED_PRECONDITION = 9] = "FAILED_PRECONDITION", he[he.ABORTED = 10] = "ABORTED",
|
|
5789
|
+
he[he.OUT_OF_RANGE = 11] = "OUT_OF_RANGE", he[he.UNIMPLEMENTED = 12] = "UNIMPLEMENTED",
|
|
5790
|
+
he[he.INTERNAL = 13] = "INTERNAL", he[he.UNAVAILABLE = 14] = "UNAVAILABLE", he[he.DATA_LOSS = 15] = "DATA_LOSS";
|
|
5791
5791
|
|
|
5792
5792
|
/**
|
|
5793
5793
|
* @license
|
|
@@ -5812,7 +5812,7 @@ Pe[Pe.INTERNAL = 13] = "INTERNAL", Pe[Pe.UNAVAILABLE = 14] = "UNAVAILABLE", Pe[P
|
|
|
5812
5812
|
* integration tests that have registered callbacks to be notified of events
|
|
5813
5813
|
* that happen during the test execution.
|
|
5814
5814
|
*/
|
|
5815
|
-
let
|
|
5815
|
+
let Pe = null;
|
|
5816
5816
|
|
|
5817
5817
|
/**
|
|
5818
5818
|
* Sets the value of the `testingHooksSpi` object.
|
|
@@ -5860,7 +5860,7 @@ function __PRIVATE_newTextEncoder() {
|
|
|
5860
5860
|
* See the License for the specific language governing permissions and
|
|
5861
5861
|
* limitations under the License.
|
|
5862
5862
|
*/
|
|
5863
|
-
const
|
|
5863
|
+
const Ie = new Integer([ 4294967295, 4294967295 ], 0);
|
|
5864
5864
|
|
|
5865
5865
|
// Hash a string using md5 hashing algorithm.
|
|
5866
5866
|
function __PRIVATE_getMd5HashValue(e) {
|
|
@@ -5895,7 +5895,7 @@ class BloomFilter {
|
|
|
5895
5895
|
// Calculate hashed value h(i) = h1 + (i * h2).
|
|
5896
5896
|
let r = e.add(t.multiply(Integer.fromNumber(n)));
|
|
5897
5897
|
// Wrap if hash value overflow 64bit.
|
|
5898
|
-
return 1 === r.compare(
|
|
5898
|
+
return 1 === r.compare(Ie) && (r = new Integer([ r.getBits(0), r.getBits(1) ], 0)),
|
|
5899
5899
|
r.modulo(this.Te).toNumber();
|
|
5900
5900
|
}
|
|
5901
5901
|
// Return whether the bit on the given index in the bitmap is set to 1.
|
|
@@ -6313,7 +6313,7 @@ class __PRIVATE_WatchChangeAggregator {
|
|
|
6313
6313
|
const e = 2 /* BloomFilterApplicationStatus.FalsePositive */ === i ? "TargetPurposeExistenceFilterMismatchBloom" /* TargetPurpose.ExistenceFilterMismatchBloom */ : "TargetPurposeExistenceFilterMismatch" /* TargetPurpose.ExistenceFilterMismatch */;
|
|
6314
6314
|
this.Qe = this.Qe.insert(t, e);
|
|
6315
6315
|
}
|
|
6316
|
-
null ==
|
|
6316
|
+
null == Pe || Pe.et(function __PRIVATE_createExistenceFilterMismatchInfoForTestingHooks(e, t, n, r, i) {
|
|
6317
6317
|
var s, o, _, a, u, c;
|
|
6318
6318
|
const l = {
|
|
6319
6319
|
localCacheCount: e,
|
|
@@ -6529,13 +6529,13 @@ function __PRIVATE_snapshotChangesMap() {
|
|
|
6529
6529
|
return new SortedMap(DocumentKey.comparator);
|
|
6530
6530
|
}
|
|
6531
6531
|
|
|
6532
|
-
const
|
|
6532
|
+
const Te = (() => {
|
|
6533
6533
|
const e = {
|
|
6534
6534
|
asc: "ASCENDING",
|
|
6535
6535
|
desc: "DESCENDING"
|
|
6536
6536
|
};
|
|
6537
6537
|
return e;
|
|
6538
|
-
})(),
|
|
6538
|
+
})(), Ee = (() => {
|
|
6539
6539
|
const e = {
|
|
6540
6540
|
"<": "LESS_THAN",
|
|
6541
6541
|
"<=": "LESS_THAN_OR_EQUAL",
|
|
@@ -6549,7 +6549,7 @@ const Ee = (() => {
|
|
|
6549
6549
|
"array-contains-any": "ARRAY_CONTAINS_ANY"
|
|
6550
6550
|
};
|
|
6551
6551
|
return e;
|
|
6552
|
-
})(),
|
|
6552
|
+
})(), de = (() => {
|
|
6553
6553
|
const e = {
|
|
6554
6554
|
and: "AND",
|
|
6555
6555
|
or: "OR"
|
|
@@ -6651,8 +6651,8 @@ function __PRIVATE_toName(e, t) {
|
|
|
6651
6651
|
|
|
6652
6652
|
function fromName(e, t) {
|
|
6653
6653
|
const n = __PRIVATE_fromResourceName(t);
|
|
6654
|
-
if (n.get(1) !== e.databaseId.projectId) throw new FirestoreError(
|
|
6655
|
-
if (n.get(3) !== e.databaseId.database) throw new FirestoreError(
|
|
6654
|
+
if (n.get(1) !== e.databaseId.projectId) throw new FirestoreError(D.INVALID_ARGUMENT, "Tried to deserialize key from different project: " + n.get(1) + " vs " + e.databaseId.projectId);
|
|
6655
|
+
if (n.get(3) !== e.databaseId.database) throw new FirestoreError(D.INVALID_ARGUMENT, "Tried to deserialize key from different database: " + n.get(3) + " vs " + e.databaseId.database);
|
|
6656
6656
|
return new DocumentKey(__PRIVATE_extractLocalPathFromResourceName(n));
|
|
6657
6657
|
}
|
|
6658
6658
|
|
|
@@ -6726,7 +6726,7 @@ function __PRIVATE_fromWatchChange(e, t) {
|
|
|
6726
6726
|
// does not indicate that it extends Uint8Array.
|
|
6727
6727
|
t instanceof Buffer || t instanceof Uint8Array), ByteString.fromUint8Array(t || new Uint8Array));
|
|
6728
6728
|
}(e, t.targetChange.resumeToken), o = t.targetChange.cause, _ = o && function __PRIVATE_fromRpcStatus(e) {
|
|
6729
|
-
const t = void 0 === e.code ?
|
|
6729
|
+
const t = void 0 === e.code ? D.UNKNOWN : __PRIVATE_mapCodeFromRpcCode(e.code);
|
|
6730
6730
|
return new FirestoreError(t, e.message || "");
|
|
6731
6731
|
}(o);
|
|
6732
6732
|
n = new __PRIVATE_WatchTargetChange(r, i, s, _ || null);
|
|
@@ -7121,15 +7121,15 @@ function __PRIVATE_fromFilter(e) {
|
|
|
7121
7121
|
}
|
|
7122
7122
|
|
|
7123
7123
|
function __PRIVATE_toDirection(e) {
|
|
7124
|
-
return
|
|
7124
|
+
return Te[e];
|
|
7125
7125
|
}
|
|
7126
7126
|
|
|
7127
7127
|
function __PRIVATE_toOperatorName(e) {
|
|
7128
|
-
return
|
|
7128
|
+
return Ee[e];
|
|
7129
7129
|
}
|
|
7130
7130
|
|
|
7131
7131
|
function __PRIVATE_toCompositeOperatorName(e) {
|
|
7132
|
-
return
|
|
7132
|
+
return de[e];
|
|
7133
7133
|
}
|
|
7134
7134
|
|
|
7135
7135
|
function __PRIVATE_toFieldPathReference(e) {
|
|
@@ -8494,7 +8494,7 @@ function __PRIVATE_applyDistributionFieldAndCompositeFilters(e, t) {
|
|
|
8494
8494
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
8495
8495
|
* See the License for the specific language governing permissions and
|
|
8496
8496
|
* limitations under the License.
|
|
8497
|
-
*/ const
|
|
8497
|
+
*/ const Ae = new Uint8Array(0);
|
|
8498
8498
|
|
|
8499
8499
|
/**
|
|
8500
8500
|
* A persisted implementation of IndexManager.
|
|
@@ -8708,7 +8708,7 @@ class __PRIVATE_IndexedDbIndexManager {
|
|
|
8708
8708
|
// combined with the values from the query bounds.
|
|
8709
8709
|
const _ = (null != t ? t.length : 1) * Math.max(n.length, i.length), a = _ / (null != t ? t.length : 1), u = [];
|
|
8710
8710
|
for (let c = 0; c < _; ++c) {
|
|
8711
|
-
const _ = t ? this.dn(t[c / a]) :
|
|
8711
|
+
const _ = t ? this.dn(t[c / a]) : Ae, l = this.An(e, _, n[c % a], r), h = this.Rn(e, _, i[c % a], s), P = o.map((t => this.An(e, _, t,
|
|
8712
8712
|
/* inclusive= */ !0)));
|
|
8713
8713
|
u.push(...this.createRange(l, h, P));
|
|
8714
8714
|
}
|
|
@@ -8905,7 +8905,7 @@ class __PRIVATE_IndexedDbIndexManager {
|
|
|
8905
8905
|
if (null != i) {
|
|
8906
8906
|
const s = e.data.field(i.fieldPath);
|
|
8907
8907
|
if (isArray(s)) for (const i of s.arrayValue.values || []) n = n.add(new __PRIVATE_IndexEntry(t.indexId, e.key, this.dn(i), r));
|
|
8908
|
-
} else n = n.add(new __PRIVATE_IndexEntry(t.indexId, e.key,
|
|
8908
|
+
} else n = n.add(new __PRIVATE_IndexEntry(t.indexId, e.key, Ae, r));
|
|
8909
8909
|
return n;
|
|
8910
8910
|
}
|
|
8911
8911
|
/**
|
|
@@ -8980,7 +8980,7 @@ class __PRIVATE_IndexedDbIndexManager {
|
|
|
8980
8980
|
// If we encounter two bounds that will create an unmatchable key range,
|
|
8981
8981
|
// then we return an empty set of key ranges.
|
|
8982
8982
|
if (this.Cn(r[e], r[e + 1])) return [];
|
|
8983
|
-
const t = [ r[e].indexId, this.uid, r[e].arrayValue, r[e].directionalValue,
|
|
8983
|
+
const t = [ r[e].indexId, this.uid, r[e].arrayValue, r[e].directionalValue, Ae, [] ], n = [ r[e + 1].indexId, this.uid, r[e + 1].arrayValue, r[e + 1].directionalValue, Ae, [] ];
|
|
8984
8984
|
i.push(IDBKeyRange.bound(t, n));
|
|
8985
8985
|
}
|
|
8986
8986
|
return i;
|
|
@@ -9048,7 +9048,7 @@ function __PRIVATE_getMinOffsetFromFieldIndexes(e) {
|
|
|
9048
9048
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
9049
9049
|
* See the License for the specific language governing permissions and
|
|
9050
9050
|
* limitations under the License.
|
|
9051
|
-
*/ const
|
|
9051
|
+
*/ const Re = {
|
|
9052
9052
|
didRun: !1,
|
|
9053
9053
|
sequenceNumbersCollected: 0,
|
|
9054
9054
|
targetsRemoved: 0,
|
|
@@ -9212,7 +9212,7 @@ class __PRIVATE_IndexedDbMutationQueue {
|
|
|
9212
9212
|
let c = new SortedSet(((e, t) => __PRIVATE_primitiveComparator(e.canonicalString(), t.canonicalString())));
|
|
9213
9213
|
for (const e of r) {
|
|
9214
9214
|
const t = __PRIVATE_newDbDocumentMutationKey(this.userId, e.key.path, o);
|
|
9215
|
-
c = c.add(e.key.path.popLast()), u.push(s.put(a)), u.push(i.put(t,
|
|
9215
|
+
c = c.add(e.key.path.popLast()), u.push(s.put(a)), u.push(i.put(t, x));
|
|
9216
9216
|
}
|
|
9217
9217
|
return c.forEach((t => {
|
|
9218
9218
|
u.push(this.indexManager.addToCollectionParentIndex(e, t));
|
|
@@ -9781,8 +9781,8 @@ class __PRIVATE_TargetIdGenerator {
|
|
|
9781
9781
|
}
|
|
9782
9782
|
collect(e, t) {
|
|
9783
9783
|
return -1 === this.params.cacheSizeCollectionThreshold ? (__PRIVATE_logDebug("LruGarbageCollector", "Garbage collection skipped; disabled"),
|
|
9784
|
-
PersistencePromise.resolve(
|
|
9785
|
-
|
|
9784
|
+
PersistencePromise.resolve(Re)) : this.getCacheSize(e).next((n => n < this.params.cacheSizeCollectionThreshold ? (__PRIVATE_logDebug("LruGarbageCollector", `Garbage collection skipped; Cache size ${n} is lower than threshold ${this.params.cacheSizeCollectionThreshold}`),
|
|
9785
|
+
Re) : this.Xn(e, t)));
|
|
9786
9786
|
}
|
|
9787
9787
|
getCacheSize(e) {
|
|
9788
9788
|
return this.Jn.getCacheSize(e);
|
|
@@ -11573,7 +11573,7 @@ class __PRIVATE_MemoryLruDelegate {
|
|
|
11573
11573
|
e.createObjectStore("mutations", {
|
|
11574
11574
|
keyPath: "batchId",
|
|
11575
11575
|
autoIncrement: !0
|
|
11576
|
-
}).createIndex("userMutationsIndex",
|
|
11576
|
+
}).createIndex("userMutationsIndex", M, {
|
|
11577
11577
|
unique: !0
|
|
11578
11578
|
}), e.createObjectStore("documentMutations");
|
|
11579
11579
|
}
|
|
@@ -11618,7 +11618,7 @@ class __PRIVATE_MemoryLruDelegate {
|
|
|
11618
11618
|
e.createObjectStore("mutations", {
|
|
11619
11619
|
keyPath: "batchId",
|
|
11620
11620
|
autoIncrement: !0
|
|
11621
|
-
}).createIndex("userMutationsIndex",
|
|
11621
|
+
}).createIndex("userMutationsIndex", M, {
|
|
11622
11622
|
unique: !0
|
|
11623
11623
|
});
|
|
11624
11624
|
const r = t.store("mutations"), i = n.map((e => r.put(e)));
|
|
@@ -11655,19 +11655,19 @@ class __PRIVATE_MemoryLruDelegate {
|
|
|
11655
11655
|
}))), n < 12 && r >= 12 && (s = s.next((() => {
|
|
11656
11656
|
!function __PRIVATE_createDocumentOverlayStore(e) {
|
|
11657
11657
|
const t = e.createObjectStore("documentOverlays", {
|
|
11658
|
-
keyPath:
|
|
11658
|
+
keyPath: G
|
|
11659
11659
|
});
|
|
11660
|
-
t.createIndex("collectionPathOverlayIndex",
|
|
11660
|
+
t.createIndex("collectionPathOverlayIndex", z, {
|
|
11661
11661
|
unique: !1
|
|
11662
|
-
}), t.createIndex("collectionGroupOverlayIndex",
|
|
11662
|
+
}), t.createIndex("collectionGroupOverlayIndex", j, {
|
|
11663
11663
|
unique: !1
|
|
11664
11664
|
});
|
|
11665
11665
|
}(e);
|
|
11666
11666
|
}))), n < 13 && r >= 13 && (s = s.next((() => function __PRIVATE_createRemoteDocumentCache(e) {
|
|
11667
11667
|
const t = e.createObjectStore("remoteDocumentsV14", {
|
|
11668
|
-
keyPath:
|
|
11668
|
+
keyPath: O
|
|
11669
11669
|
});
|
|
11670
|
-
t.createIndex("documentKeyIndex",
|
|
11670
|
+
t.createIndex("documentKeyIndex", N), t.createIndex("collectionGroupIndex", L);
|
|
11671
11671
|
}(e))).next((() => this._i(e, i))).next((() => e.deleteObjectStore("remoteDocuments")))),
|
|
11672
11672
|
n < 14 && r >= 14 && (s = s.next((() => this.ai(e, i)))), n < 15 && r >= 15 && (s = s.next((() => function __PRIVATE_createFieldIndex(e) {
|
|
11673
11673
|
e.createObjectStore("indexConfiguration", {
|
|
@@ -11677,13 +11677,13 @@ class __PRIVATE_MemoryLruDelegate {
|
|
|
11677
11677
|
unique: !1
|
|
11678
11678
|
});
|
|
11679
11679
|
e.createObjectStore("indexState", {
|
|
11680
|
-
keyPath:
|
|
11681
|
-
}).createIndex("sequenceNumberIndex",
|
|
11680
|
+
keyPath: K
|
|
11681
|
+
}).createIndex("sequenceNumberIndex", $, {
|
|
11682
11682
|
unique: !1
|
|
11683
11683
|
});
|
|
11684
11684
|
e.createObjectStore("indexEntries", {
|
|
11685
|
-
keyPath:
|
|
11686
|
-
}).createIndex("documentKeyIndex",
|
|
11685
|
+
keyPath: U
|
|
11686
|
+
}).createIndex("documentKeyIndex", W, {
|
|
11687
11687
|
unique: !1
|
|
11688
11688
|
});
|
|
11689
11689
|
}(e)))), n < 16 && r >= 16 && (
|
|
@@ -11744,7 +11744,7 @@ class __PRIVATE_MemoryLruDelegate {
|
|
|
11744
11744
|
si(e, t) {
|
|
11745
11745
|
// Create the index.
|
|
11746
11746
|
e.createObjectStore("collectionParents", {
|
|
11747
|
-
keyPath:
|
|
11747
|
+
keyPath: Q
|
|
11748
11748
|
});
|
|
11749
11749
|
const n = t.store("collectionParents"), r = new __PRIVATE_MemoryCollectionParentIndex, addEntry = e => {
|
|
11750
11750
|
if (r.add(e)) {
|
|
@@ -11829,19 +11829,19 @@ class __PRIVATE_MemoryLruDelegate {
|
|
|
11829
11829
|
|
|
11830
11830
|
function __PRIVATE_createQueryCache(e) {
|
|
11831
11831
|
e.createObjectStore("targetDocuments", {
|
|
11832
|
-
keyPath:
|
|
11833
|
-
}).createIndex("documentTargetsIndex",
|
|
11832
|
+
keyPath: k
|
|
11833
|
+
}).createIndex("documentTargetsIndex", q, {
|
|
11834
11834
|
unique: !0
|
|
11835
11835
|
});
|
|
11836
11836
|
// NOTE: This is unique only because the TargetId is the suffix.
|
|
11837
11837
|
e.createObjectStore("targets", {
|
|
11838
11838
|
keyPath: "targetId"
|
|
11839
|
-
}).createIndex("queryTargetsIndex",
|
|
11839
|
+
}).createIndex("queryTargetsIndex", B, {
|
|
11840
11840
|
unique: !0
|
|
11841
11841
|
}), e.createObjectStore("targetGlobal");
|
|
11842
11842
|
}
|
|
11843
11843
|
|
|
11844
|
-
const
|
|
11844
|
+
const Ve = "Failed to obtain exclusive access to the persistence layer. To allow shared access, multi-tab synchronization has to be enabled in all tabs. If you are using `experimentalForceOwningTab:true`, make sure that only one tab has persistence enabled at any given time.";
|
|
11845
11845
|
|
|
11846
11846
|
/**
|
|
11847
11847
|
* Oldest acceptable age in milliseconds for client metadata before the client
|
|
@@ -11917,7 +11917,7 @@ class __PRIVATE_IndexedDbPersistence {
|
|
|
11917
11917
|
/** The last time we garbage collected the client metadata object store. */
|
|
11918
11918
|
this.Ei = Number.NEGATIVE_INFINITY,
|
|
11919
11919
|
/** A listener to notify on primary state changes. */
|
|
11920
|
-
this.di = e => Promise.resolve(), !__PRIVATE_IndexedDbPersistence.D()) throw new FirestoreError(
|
|
11920
|
+
this.di = e => Promise.resolve(), !__PRIVATE_IndexedDbPersistence.D()) throw new FirestoreError(D.UNIMPLEMENTED, "This platform is either missing IndexedDB or is known to have an incomplete implementation. Offline persistence has been disabled.");
|
|
11921
11921
|
this.referenceDelegate = new __PRIVATE_IndexedDbLruDelegateImpl(this, r), this.Ai = t + "main",
|
|
11922
11922
|
this.serializer = new __PRIVATE_LocalSerializer(_), this.Ri = new __PRIVATE_SimpleDb(this.Ai, this.hi, new __PRIVATE_SchemaConverter(this.serializer)),
|
|
11923
11923
|
this.$r = new __PRIVATE_IndexedDbGlobalsCache, this.Ur = new __PRIVATE_IndexedDbTargetCache(this.referenceDelegate, this.serializer),
|
|
@@ -11937,7 +11937,7 @@ class __PRIVATE_IndexedDbPersistence {
|
|
|
11937
11937
|
if (!this.isPrimary && !this.allowTabSynchronization)
|
|
11938
11938
|
// Fail `start()` if `synchronizeTabs` is disabled and we cannot
|
|
11939
11939
|
// obtain the primary lease.
|
|
11940
|
-
throw new FirestoreError(
|
|
11940
|
+
throw new FirestoreError(D.FAILED_PRECONDITION, Ve);
|
|
11941
11941
|
return this.fi(), this.gi(), this.pi(), this.runTransaction("getHighestListenSequenceNumber", "readonly", (e => this.Ur.getHighestSequenceNumber(e)));
|
|
11942
11942
|
})).then((e => {
|
|
11943
11943
|
this.Qr = new __PRIVATE_ListenSequence(e, this.ci);
|
|
@@ -12079,7 +12079,7 @@ class __PRIVATE_IndexedDbPersistence {
|
|
|
12079
12079
|
// settings is not supported.
|
|
12080
12080
|
// TODO(b/114226234): Remove this check when `synchronizeTabs` can
|
|
12081
12081
|
// no longer be turned off.
|
|
12082
|
-
throw new FirestoreError(
|
|
12082
|
+
throw new FirestoreError(D.FAILED_PRECONDITION, Ve);
|
|
12083
12083
|
return !1;
|
|
12084
12084
|
}
|
|
12085
12085
|
}
|
|
@@ -12152,7 +12152,7 @@ class __PRIVATE_IndexedDbPersistence {
|
|
|
12152
12152
|
const r = "readonly" === t ? "readonly" : "readwrite", i =
|
|
12153
12153
|
/** Returns the object stores for the provided schema. */
|
|
12154
12154
|
function __PRIVATE_getObjectStores(e) {
|
|
12155
|
-
return 17 === e ?
|
|
12155
|
+
return 17 === e ? te : 16 === e ? ee : 15 === e ? X : 14 === e ? Z : 13 === e ? Y : 12 === e ? J : 11 === e ? H : void fail();
|
|
12156
12156
|
}(this.hi);
|
|
12157
12157
|
let s;
|
|
12158
12158
|
// Do all transactions as readwrite against all object stores, since we
|
|
@@ -12160,7 +12160,7 @@ class __PRIVATE_IndexedDbPersistence {
|
|
|
12160
12160
|
return this.Ri.runTransaction(e, r, i, (r => (s = new __PRIVATE_IndexedDbTransaction(r, this.Qr ? this.Qr.next() : __PRIVATE_ListenSequence.oe),
|
|
12161
12161
|
"readwrite-primary" === t ? this.wi(s).next((e => !!e || this.Si(s))).next((t => {
|
|
12162
12162
|
if (!t) throw __PRIVATE_logError(`Failed to obtain primary lease for action '${e}'.`),
|
|
12163
|
-
this.isPrimary = !1, this.ui.enqueueRetryable((() => this.di(!1))), new FirestoreError(
|
|
12163
|
+
this.isPrimary = !1, this.ui.enqueueRetryable((() => this.di(!1))), new FirestoreError(D.FAILED_PRECONDITION, C);
|
|
12164
12164
|
return n(s);
|
|
12165
12165
|
})).next((e => this.Di(s).next((() => e)))) : this.Ki(s).next((() => n(s)))))).then((e => (s.raiseOnCommittedEvent(),
|
|
12166
12166
|
e)));
|
|
@@ -12173,7 +12173,7 @@ class __PRIVATE_IndexedDbPersistence {
|
|
|
12173
12173
|
// be turned off.
|
|
12174
12174
|
Ki(e) {
|
|
12175
12175
|
return __PRIVATE_primaryClientStore(e).get("owner").next((e => {
|
|
12176
|
-
if (null !== e && this.Mi(e.leaseTimestampMs, 5e3) && !this.Ni(e.ownerId) && !this.vi(e) && !(this.li || this.allowTabSynchronization && e.allowTabSynchronization)) throw new FirestoreError(
|
|
12176
|
+
if (null !== e && this.Mi(e.leaseTimestampMs, 5e3) && !this.Ni(e.ownerId) && !this.vi(e) && !(this.li || this.allowTabSynchronization && e.allowTabSynchronization)) throw new FirestoreError(D.FAILED_PRECONDITION, Ve);
|
|
12177
12177
|
}));
|
|
12178
12178
|
}
|
|
12179
12179
|
/**
|
|
@@ -13321,18 +13321,20 @@ class __PRIVATE_LocalClientState {
|
|
|
13321
13321
|
// in order, it is safe to delete the entry right after updating it.
|
|
13322
13322
|
this.Qs(e);
|
|
13323
13323
|
}
|
|
13324
|
-
addLocalQueryTarget(e) {
|
|
13325
|
-
let
|
|
13324
|
+
addLocalQueryTarget(e, t = !0) {
|
|
13325
|
+
let n = "not-current";
|
|
13326
13326
|
// Lookup an existing query state if the target ID was already registered
|
|
13327
13327
|
// by another tab
|
|
13328
13328
|
if (this.isActiveQueryTarget(e)) {
|
|
13329
|
-
const
|
|
13330
|
-
if (
|
|
13331
|
-
const r = __PRIVATE_QueryTargetMetadata.Rs(e,
|
|
13332
|
-
r && (
|
|
13329
|
+
const t = this.storage.getItem(createWebStorageQueryTargetMetadataKey(this.persistenceKey, e));
|
|
13330
|
+
if (t) {
|
|
13331
|
+
const r = __PRIVATE_QueryTargetMetadata.Rs(e, t);
|
|
13332
|
+
r && (n = r.state);
|
|
13333
13333
|
}
|
|
13334
13334
|
}
|
|
13335
|
-
|
|
13335
|
+
// If the query is listening to cache only, the target ID should not be registered with the
|
|
13336
|
+
// local Firestore client as an active watch target.
|
|
13337
|
+
return t && this.Ks.fs(e), this.Ns(), n;
|
|
13336
13338
|
}
|
|
13337
13339
|
removeLocalQueryTarget(e) {
|
|
13338
13340
|
this.Ks.gs(e), this.Ns();
|
|
@@ -13540,8 +13542,8 @@ class __PRIVATE_MemorySharedClientState {
|
|
|
13540
13542
|
updateMutationState(e, t, n) {
|
|
13541
13543
|
// No op.
|
|
13542
13544
|
}
|
|
13543
|
-
addLocalQueryTarget(e) {
|
|
13544
|
-
return this.so.fs(e), this.oo[e] || "not-current";
|
|
13545
|
+
addLocalQueryTarget(e, t = !0) {
|
|
13546
|
+
return t && this.so.fs(e), this.oo[e] || "not-current";
|
|
13545
13547
|
}
|
|
13546
13548
|
updateQueryState(e, t, n) {
|
|
13547
13549
|
this.oo[e] = t;
|
|
@@ -13670,7 +13672,7 @@ class __PRIVATE_BrowserConnectivityMonitor {
|
|
|
13670
13672
|
/**
|
|
13671
13673
|
* The value returned from the most recent invocation of
|
|
13672
13674
|
* `generateUniqueDebugId()`, or null if it has never been invoked.
|
|
13673
|
-
*/ let
|
|
13675
|
+
*/ let me = null;
|
|
13674
13676
|
|
|
13675
13677
|
/**
|
|
13676
13678
|
* Generates and returns an initial value for `lastUniqueDebugId`.
|
|
@@ -13695,9 +13697,9 @@ class __PRIVATE_BrowserConnectivityMonitor {
|
|
|
13695
13697
|
* @return the 10-character generated ID (e.g. "0xa1b2c3d4").
|
|
13696
13698
|
*/
|
|
13697
13699
|
function __PRIVATE_generateUniqueDebugId() {
|
|
13698
|
-
return null ===
|
|
13700
|
+
return null === me ? me = function __PRIVATE_generateInitialUniqueDebugId() {
|
|
13699
13701
|
return 268435456 + Math.round(2147483648 * Math.random());
|
|
13700
|
-
}() :
|
|
13702
|
+
}() : me++, "0x" + me.toString(16);
|
|
13701
13703
|
}
|
|
13702
13704
|
|
|
13703
13705
|
/**
|
|
@@ -13715,7 +13717,7 @@ function __PRIVATE_generateUniqueDebugId() {
|
|
|
13715
13717
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13716
13718
|
* See the License for the specific language governing permissions and
|
|
13717
13719
|
* limitations under the License.
|
|
13718
|
-
*/ const
|
|
13720
|
+
*/ const fe = {
|
|
13719
13721
|
BatchGetDocuments: "batchGet",
|
|
13720
13722
|
Commit: "commit",
|
|
13721
13723
|
RunQuery: "runQuery",
|
|
@@ -13799,7 +13801,7 @@ class __PRIVATE_StreamBridge {
|
|
|
13799
13801
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13800
13802
|
* See the License for the specific language governing permissions and
|
|
13801
13803
|
* limitations under the License.
|
|
13802
|
-
*/ const
|
|
13804
|
+
*/ const ge = "WebChannelConnection";
|
|
13803
13805
|
|
|
13804
13806
|
class __PRIVATE_WebChannelConnection extends
|
|
13805
13807
|
/**
|
|
@@ -13843,7 +13845,7 @@ class __PRIVATE_RestConnection {
|
|
|
13843
13845
|
// SDK_VERSION is updated to different value at runtime depending on the entry point,
|
|
13844
13846
|
// so we need to get its value when we need it in a function.
|
|
13845
13847
|
function __PRIVATE_getGoogApiClientValue() {
|
|
13846
|
-
return "gl-js/ fire/" +
|
|
13848
|
+
return "gl-js/ fire/" + S;
|
|
13847
13849
|
}(),
|
|
13848
13850
|
// Content-Type: text/plain will avoid preflight requests which might
|
|
13849
13851
|
// mess with CORS and redirects by proxies. If we add custom headers
|
|
@@ -13853,7 +13855,7 @@ class __PRIVATE_RestConnection {
|
|
|
13853
13855
|
t && t.headers.forEach(((t, n) => e[n] = t)), n && n.headers.forEach(((t, n) => e[n] = t));
|
|
13854
13856
|
}
|
|
13855
13857
|
xo(e, t) {
|
|
13856
|
-
const n =
|
|
13858
|
+
const n = fe[e];
|
|
13857
13859
|
return `${this.Do}/v1/${t}:${n}`;
|
|
13858
13860
|
}
|
|
13859
13861
|
/**
|
|
@@ -13877,17 +13879,17 @@ class __PRIVATE_RestConnection {
|
|
|
13877
13879
|
switch (_.getLastErrorCode()) {
|
|
13878
13880
|
case ErrorCode.NO_ERROR:
|
|
13879
13881
|
const t = _.getResponseJson();
|
|
13880
|
-
__PRIVATE_logDebug(
|
|
13882
|
+
__PRIVATE_logDebug(ge, `XHR for RPC '${e}' ${i} received:`, JSON.stringify(t)),
|
|
13881
13883
|
s(t);
|
|
13882
13884
|
break;
|
|
13883
13885
|
|
|
13884
13886
|
case ErrorCode.TIMEOUT:
|
|
13885
|
-
__PRIVATE_logDebug(
|
|
13887
|
+
__PRIVATE_logDebug(ge, `RPC '${e}' ${i} timed out`), o(new FirestoreError(D.DEADLINE_EXCEEDED, "Request time out"));
|
|
13886
13888
|
break;
|
|
13887
13889
|
|
|
13888
13890
|
case ErrorCode.HTTP_ERROR:
|
|
13889
13891
|
const n = _.getStatus();
|
|
13890
|
-
if (__PRIVATE_logDebug(
|
|
13892
|
+
if (__PRIVATE_logDebug(ge, `RPC '${e}' ${i} failed with status:`, n, "response text:", _.getResponseText()),
|
|
13891
13893
|
n > 0) {
|
|
13892
13894
|
let e = _.getResponseJson();
|
|
13893
13895
|
Array.isArray(e) && (e = e[0]);
|
|
@@ -13895,25 +13897,25 @@ class __PRIVATE_RestConnection {
|
|
|
13895
13897
|
if (t && t.status && t.message) {
|
|
13896
13898
|
const e = function __PRIVATE_mapCodeFromHttpResponseErrorStatus(e) {
|
|
13897
13899
|
const t = e.toLowerCase().replace(/_/g, "-");
|
|
13898
|
-
return Object.values(
|
|
13900
|
+
return Object.values(D).indexOf(t) >= 0 ? t : D.UNKNOWN;
|
|
13899
13901
|
}(t.status);
|
|
13900
13902
|
o(new FirestoreError(e, t.message));
|
|
13901
|
-
} else o(new FirestoreError(
|
|
13903
|
+
} else o(new FirestoreError(D.UNKNOWN, "Server responded with status " + _.getStatus()));
|
|
13902
13904
|
} else
|
|
13903
13905
|
// If we received an HTTP_ERROR but there's no status code,
|
|
13904
13906
|
// it's most probably a connection issue
|
|
13905
|
-
o(new FirestoreError(
|
|
13907
|
+
o(new FirestoreError(D.UNAVAILABLE, "Connection failed."));
|
|
13906
13908
|
break;
|
|
13907
13909
|
|
|
13908
13910
|
default:
|
|
13909
13911
|
fail();
|
|
13910
13912
|
}
|
|
13911
13913
|
} finally {
|
|
13912
|
-
__PRIVATE_logDebug(
|
|
13914
|
+
__PRIVATE_logDebug(ge, `RPC '${e}' ${i} completed.`);
|
|
13913
13915
|
}
|
|
13914
13916
|
}));
|
|
13915
13917
|
const a = JSON.stringify(r);
|
|
13916
|
-
__PRIVATE_logDebug(
|
|
13918
|
+
__PRIVATE_logDebug(ge, `RPC '${e}' ${i} sending request:`, r), _.send(t, "POST", a, n, 15);
|
|
13917
13919
|
}));
|
|
13918
13920
|
}
|
|
13919
13921
|
Bo(e, t, n) {
|
|
@@ -13941,7 +13943,7 @@ class __PRIVATE_RestConnection {
|
|
|
13941
13943
|
forceLongPolling: this.forceLongPolling,
|
|
13942
13944
|
detectBufferingProxy: this.autoDetectLongPolling
|
|
13943
13945
|
}, a = this.longPollingOptions.timeoutSeconds;
|
|
13944
|
-
void 0 !== a && (_.longPollingTimeout = Math.round(1e3 * a)), this.useFetchStreams && (_.
|
|
13946
|
+
void 0 !== a && (_.longPollingTimeout = Math.round(1e3 * a)), this.useFetchStreams && (_.useFetchStreams = !0),
|
|
13945
13947
|
this.Oo(_.initMessageHeaders, t, n),
|
|
13946
13948
|
// Sending the custom headers we just added to request.initMessageHeaders
|
|
13947
13949
|
// (Authorization, etc.) will trigger the browser to make a CORS preflight
|
|
@@ -13954,7 +13956,7 @@ class __PRIVATE_RestConnection {
|
|
|
13954
13956
|
// which is recognized by the webchannel backend.
|
|
13955
13957
|
_.encodeInitMessageHeaders = !0;
|
|
13956
13958
|
const u = i.join("");
|
|
13957
|
-
__PRIVATE_logDebug(
|
|
13959
|
+
__PRIVATE_logDebug(ge, `Creating RPC '${e}' stream ${r}: ${u}`, _);
|
|
13958
13960
|
const c = s.createWebChannel(u, _);
|
|
13959
13961
|
// WebChannel supports sending the first message with the handshake - saving
|
|
13960
13962
|
// a network round trip. However, it will have to call send in the same
|
|
@@ -13967,8 +13969,8 @@ class __PRIVATE_RestConnection {
|
|
|
13967
13969
|
// on a closed stream
|
|
13968
13970
|
const P = new __PRIVATE_StreamBridge({
|
|
13969
13971
|
Io: t => {
|
|
13970
|
-
h ? __PRIVATE_logDebug(
|
|
13971
|
-
c.open(), l = !0), __PRIVATE_logDebug(
|
|
13972
|
+
h ? __PRIVATE_logDebug(ge, `Not sending because RPC '${e}' stream ${r} is closed:`, t) : (l || (__PRIVATE_logDebug(ge, `Opening RPC '${e}' stream ${r} transport.`),
|
|
13973
|
+
c.open(), l = !0), __PRIVATE_logDebug(ge, `RPC '${e}' stream ${r} sending:`, t),
|
|
13972
13974
|
c.send(t));
|
|
13973
13975
|
},
|
|
13974
13976
|
To: () => c.close()
|
|
@@ -13990,13 +13992,13 @@ class __PRIVATE_RestConnection {
|
|
|
13990
13992
|
// Note that eventually this function could go away if we are confident
|
|
13991
13993
|
// enough the code is exception free.
|
|
13992
13994
|
return __PRIVATE_unguardedEventListen(c, WebChannel.EventType.OPEN, (() => {
|
|
13993
|
-
h || (__PRIVATE_logDebug(
|
|
13995
|
+
h || (__PRIVATE_logDebug(ge, `RPC '${e}' stream ${r} transport opened.`), P.yo());
|
|
13994
13996
|
})), __PRIVATE_unguardedEventListen(c, WebChannel.EventType.CLOSE, (() => {
|
|
13995
|
-
h || (h = !0, __PRIVATE_logDebug(
|
|
13997
|
+
h || (h = !0, __PRIVATE_logDebug(ge, `RPC '${e}' stream ${r} transport closed`),
|
|
13996
13998
|
P.So());
|
|
13997
13999
|
})), __PRIVATE_unguardedEventListen(c, WebChannel.EventType.ERROR, (t => {
|
|
13998
|
-
h || (h = !0, __PRIVATE_logWarn(
|
|
13999
|
-
P.So(new FirestoreError(
|
|
14000
|
+
h || (h = !0, __PRIVATE_logWarn(ge, `RPC '${e}' stream ${r} transport errored:`, t),
|
|
14001
|
+
P.So(new FirestoreError(D.UNAVAILABLE, "The operation could not be completed")));
|
|
14000
14002
|
})), __PRIVATE_unguardedEventListen(c, WebChannel.EventType.MESSAGE, (t => {
|
|
14001
14003
|
var n;
|
|
14002
14004
|
if (!h) {
|
|
@@ -14009,7 +14011,7 @@ class __PRIVATE_RestConnection {
|
|
|
14009
14011
|
// Use any because msgData.error is not typed.
|
|
14010
14012
|
const s = i, o = s.error || (null === (n = s[0]) || void 0 === n ? void 0 : n.error);
|
|
14011
14013
|
if (o) {
|
|
14012
|
-
__PRIVATE_logDebug(
|
|
14014
|
+
__PRIVATE_logDebug(ge, `RPC '${e}' stream ${r} received error:`, o);
|
|
14013
14015
|
// error.status will be a string like 'OK' or 'NOT_FOUND'.
|
|
14014
14016
|
const t = o.status;
|
|
14015
14017
|
let n =
|
|
@@ -14022,16 +14024,16 @@ class __PRIVATE_RestConnection {
|
|
|
14022
14024
|
function __PRIVATE_mapCodeFromRpcStatus(e) {
|
|
14023
14025
|
// lookup by string
|
|
14024
14026
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
14025
|
-
const t =
|
|
14027
|
+
const t = le[e];
|
|
14026
14028
|
if (void 0 !== t) return __PRIVATE_mapCodeFromRpcCode(t);
|
|
14027
14029
|
}(t), i = o.message;
|
|
14028
|
-
void 0 === n && (n =
|
|
14030
|
+
void 0 === n && (n = D.INTERNAL, i = "Unknown error status: " + t + " with message " + o.message),
|
|
14029
14031
|
// Mark closed so no further events are propagated
|
|
14030
14032
|
h = !0, P.So(new FirestoreError(n, i)), c.close();
|
|
14031
|
-
} else __PRIVATE_logDebug(
|
|
14033
|
+
} else __PRIVATE_logDebug(ge, `RPC '${e}' stream ${r} received:`, i), P.bo(i);
|
|
14032
14034
|
}
|
|
14033
14035
|
})), __PRIVATE_unguardedEventListen(o, Event.STAT_EVENT, (t => {
|
|
14034
|
-
t.stat === Stat.PROXY ? __PRIVATE_logDebug(
|
|
14036
|
+
t.stat === Stat.PROXY ? __PRIVATE_logDebug(ge, `RPC '${e}' stream ${r} detected buffering proxy`) : t.stat === Stat.NOPROXY && __PRIVATE_logDebug(ge, `RPC '${e}' stream ${r} detected no buffering proxy`);
|
|
14035
14037
|
})), setTimeout((() => {
|
|
14036
14038
|
// Technically we could/should wait for the WebChannel opened event,
|
|
14037
14039
|
// but because we want to send the first message with the WebChannel
|
|
@@ -14359,10 +14361,10 @@ class __PRIVATE_PersistentStream {
|
|
|
14359
14361
|
// underlying stream), guaranteeing they won't execute.
|
|
14360
14362
|
this.Yo++, 4 /* PersistentStreamState.Error */ !== e ?
|
|
14361
14363
|
// If this is an intentional close ensure we don't delay our next connection attempt.
|
|
14362
|
-
this.t_.reset() : t && t.code ===
|
|
14364
|
+
this.t_.reset() : t && t.code === D.RESOURCE_EXHAUSTED ? (
|
|
14363
14365
|
// Log the error. (Probably either 'quota exceeded' or 'max queue length reached'.)
|
|
14364
14366
|
__PRIVATE_logError(t.toString()), __PRIVATE_logError("Using maximum backoff delay to prevent overloading the backend."),
|
|
14365
|
-
this.t_.Wo()) : t && t.code ===
|
|
14367
|
+
this.t_.Wo()) : t && t.code === D.UNAUTHENTICATED && 3 /* PersistentStreamState.Healthy */ !== this.state && (
|
|
14366
14368
|
// "unauthenticated" error means the token was rejected. This should rarely
|
|
14367
14369
|
// happen since both Auth and AppCheck ensure a sufficient TTL when we
|
|
14368
14370
|
// request a token. If a user manually resets their system clock this can
|
|
@@ -14398,7 +14400,7 @@ class __PRIVATE_PersistentStream {
|
|
|
14398
14400
|
this.P_(e, n);
|
|
14399
14401
|
}), (t => {
|
|
14400
14402
|
e((() => {
|
|
14401
|
-
const e = new FirestoreError(
|
|
14403
|
+
const e = new FirestoreError(D.UNKNOWN, "Fetching auth token failed: " + t.message);
|
|
14402
14404
|
return this.I_(e);
|
|
14403
14405
|
}));
|
|
14404
14406
|
}));
|
|
@@ -14617,18 +14619,18 @@ class __PRIVATE_DatastoreImpl extends class Datastore {} {
|
|
|
14617
14619
|
this.serializer = r, this.y_ = !1;
|
|
14618
14620
|
}
|
|
14619
14621
|
w_() {
|
|
14620
|
-
if (this.y_) throw new FirestoreError(
|
|
14622
|
+
if (this.y_) throw new FirestoreError(D.FAILED_PRECONDITION, "The client has already been terminated.");
|
|
14621
14623
|
}
|
|
14622
14624
|
/** Invokes the provided RPC with auth and AppCheck tokens. */ Mo(e, t, n, r) {
|
|
14623
14625
|
return this.w_(), Promise.all([ this.authCredentials.getToken(), this.appCheckCredentials.getToken() ]).then((([i, s]) => this.connection.Mo(e, __PRIVATE_toResourcePath(t, n), r, i, s))).catch((e => {
|
|
14624
|
-
throw "FirebaseError" === e.name ? (e.code ===
|
|
14625
|
-
this.appCheckCredentials.invalidateToken()), e) : new FirestoreError(
|
|
14626
|
+
throw "FirebaseError" === e.name ? (e.code === D.UNAUTHENTICATED && (this.authCredentials.invalidateToken(),
|
|
14627
|
+
this.appCheckCredentials.invalidateToken()), e) : new FirestoreError(D.UNKNOWN, e.toString());
|
|
14626
14628
|
}));
|
|
14627
14629
|
}
|
|
14628
14630
|
/** Invokes the provided RPC with streamed results with auth and AppCheck tokens. */ Lo(e, t, n, r, i) {
|
|
14629
14631
|
return this.w_(), Promise.all([ this.authCredentials.getToken(), this.appCheckCredentials.getToken() ]).then((([s, o]) => this.connection.Lo(e, __PRIVATE_toResourcePath(t, n), r, s, o, i))).catch((e => {
|
|
14630
|
-
throw "FirebaseError" === e.name ? (e.code ===
|
|
14631
|
-
this.appCheckCredentials.invalidateToken()), e) : new FirestoreError(
|
|
14632
|
+
throw "FirebaseError" === e.name ? (e.code === D.UNAUTHENTICATED && (this.authCredentials.invalidateToken(),
|
|
14633
|
+
this.appCheckCredentials.invalidateToken()), e) : new FirestoreError(D.UNKNOWN, e.toString());
|
|
14632
14634
|
}));
|
|
14633
14635
|
}
|
|
14634
14636
|
terminate() {
|
|
@@ -15072,7 +15074,7 @@ async function __PRIVATE_onWriteStreamClose(e, t) {
|
|
|
15072
15074
|
// Only handle permanent errors here. If it's transient, just let the retry
|
|
15073
15075
|
// logic kick in.
|
|
15074
15076
|
if (function __PRIVATE_isPermanentWriteError(e) {
|
|
15075
|
-
return __PRIVATE_isPermanentError(e) && e !==
|
|
15077
|
+
return __PRIVATE_isPermanentError(e) && e !== D.ABORTED;
|
|
15076
15078
|
}(t.code)) {
|
|
15077
15079
|
// This was a permanent error, the request itself was the problem
|
|
15078
15080
|
// so it's not going to succeed if we resend it.
|
|
@@ -15255,7 +15257,7 @@ class DelayedOperation {
|
|
|
15255
15257
|
* As long as the operation has not yet been run, calling cancel() provides a
|
|
15256
15258
|
* guarantee that the operation will not be run.
|
|
15257
15259
|
*/ cancel(e) {
|
|
15258
|
-
null !== this.timerHandle && (this.clearTimeout(), this.deferred.reject(new FirestoreError(
|
|
15260
|
+
null !== this.timerHandle && (this.clearTimeout(), this.deferred.reject(new FirestoreError(D.CANCELLED, "Operation cancelled" + (e ? ": " + e : ""))));
|
|
15259
15261
|
}
|
|
15260
15262
|
handleDelayElapsed() {
|
|
15261
15263
|
this.asyncQueue.enqueueAndForget((() => null !== this.timerHandle ? (this.clearTimeout(),
|
|
@@ -15271,7 +15273,7 @@ class DelayedOperation {
|
|
|
15271
15273
|
* Returns a FirestoreError that can be surfaced to the user if the provided
|
|
15272
15274
|
* error is an IndexedDbTransactionError. Re-throws the error otherwise.
|
|
15273
15275
|
*/ function __PRIVATE_wrapInUserErrorIfRecoverable(e, t) {
|
|
15274
|
-
if (__PRIVATE_logError("AsyncQueue", `${t}: ${e}`), __PRIVATE_isIndexedDbTransactionError(e)) return new FirestoreError(
|
|
15276
|
+
if (__PRIVATE_logError("AsyncQueue", `${t}: ${e}`), __PRIVATE_isIndexedDbTransactionError(e)) return new FirestoreError(D.UNAVAILABLE, `${t}: ${e}`);
|
|
15275
15277
|
throw e;
|
|
15276
15278
|
}
|
|
15277
15279
|
|
|
@@ -15501,7 +15503,7 @@ class __PRIVATE_EventManagerImpl {
|
|
|
15501
15503
|
}));
|
|
15502
15504
|
}
|
|
15503
15505
|
// Call all global snapshot listeners that have been set.
|
|
15504
|
-
(this, new FirestoreError(
|
|
15506
|
+
(this, new FirestoreError(D.ABORTED, "Firestore shutting down"));
|
|
15505
15507
|
}
|
|
15506
15508
|
}
|
|
15507
15509
|
|
|
@@ -15598,12 +15600,12 @@ function __PRIVATE_raiseSnapshotsInSyncEvent(e) {
|
|
|
15598
15600
|
}));
|
|
15599
15601
|
}
|
|
15600
15602
|
|
|
15601
|
-
var
|
|
15603
|
+
var pe, ye;
|
|
15602
15604
|
|
|
15603
15605
|
/** Listen to both cache and server changes */
|
|
15604
|
-
(
|
|
15606
|
+
(ye = pe || (pe = {})).ea = "default",
|
|
15605
15607
|
/** Listen to changes in cache only */
|
|
15606
|
-
|
|
15608
|
+
ye.Cache = "cache";
|
|
15607
15609
|
|
|
15608
15610
|
/**
|
|
15609
15611
|
* QueryListener takes a series of internal view snapshots and determines
|
|
@@ -15678,7 +15680,7 @@ class __PRIVATE_QueryListener {
|
|
|
15678
15680
|
this.na = !0, this.ta.next(e);
|
|
15679
15681
|
}
|
|
15680
15682
|
J_() {
|
|
15681
|
-
return this.options.source !==
|
|
15683
|
+
return this.options.source !== pe.Cache;
|
|
15682
15684
|
}
|
|
15683
15685
|
}
|
|
15684
15686
|
|
|
@@ -16232,7 +16234,7 @@ async function __PRIVATE_syncEngineListen(e, t, n = !0) {
|
|
|
16232
16234
|
}
|
|
16233
16235
|
|
|
16234
16236
|
async function __PRIVATE_allocateTargetAndMaybeListen(e, t, n, r) {
|
|
16235
|
-
const i = await __PRIVATE_localStoreAllocateTarget(e.localStore, __PRIVATE_queryToTarget(t)), s = i.targetId, o =
|
|
16237
|
+
const i = await __PRIVATE_localStoreAllocateTarget(e.localStore, __PRIVATE_queryToTarget(t)), s = i.targetId, o = e.sharedClientState.addLocalQueryTarget(s, n);
|
|
16236
16238
|
let _;
|
|
16237
16239
|
return r && (_ = await __PRIVATE_initializeViewAndComputeSnapshot(e, t, s, "current" === o, i.resumeToken)),
|
|
16238
16240
|
e.isPrimaryClient && n && __PRIVATE_remoteStoreListen(e.remoteStore, i), _;
|
|
@@ -16646,7 +16648,7 @@ async function __PRIVATE_syncEngineHandleCredentialChange(e, t) {
|
|
|
16646
16648
|
function __PRIVATE_rejectOutstandingPendingWritesCallbacks(e, t) {
|
|
16647
16649
|
e.ka.forEach((e => {
|
|
16648
16650
|
e.forEach((e => {
|
|
16649
|
-
e.reject(new FirestoreError(
|
|
16651
|
+
e.reject(new FirestoreError(D.CANCELLED, t));
|
|
16650
16652
|
}));
|
|
16651
16653
|
})), e.ka.clear();
|
|
16652
16654
|
}(n, "'waitForPendingWrites' promise is rejected due to a user change."),
|
|
@@ -17075,7 +17077,7 @@ class __PRIVATE_LruGcMemoryOfflineComponentProvider extends MemoryOfflineCompone
|
|
|
17075
17077
|
}
|
|
17076
17078
|
createSharedClientState(e) {
|
|
17077
17079
|
const t = __PRIVATE_getWindow();
|
|
17078
|
-
if (!__PRIVATE_WebStorageSharedClientState.D(t)) throw new FirestoreError(
|
|
17080
|
+
if (!__PRIVATE_WebStorageSharedClientState.D(t)) throw new FirestoreError(D.UNIMPLEMENTED, "IndexedDB persistence is only available on platforms that support LocalStorage.");
|
|
17079
17081
|
const n = __PRIVATE_indexedDbStoragePrefix(e.databaseInfo.databaseId, e.databaseInfo.persistenceKey);
|
|
17080
17082
|
return new __PRIVATE_WebStorageSharedClientState(t, e.asyncQueue, n, e.clientId, e.initialUser);
|
|
17081
17083
|
}
|
|
@@ -17414,7 +17416,7 @@ class Transaction$2 {
|
|
|
17414
17416
|
this.writtenDocs = new Set;
|
|
17415
17417
|
}
|
|
17416
17418
|
async lookup(e) {
|
|
17417
|
-
if (this.ensureCommitNotCalled(), this.mutations.length > 0) throw this.lastTransactionError = new FirestoreError(
|
|
17419
|
+
if (this.ensureCommitNotCalled(), this.mutations.length > 0) throw this.lastTransactionError = new FirestoreError(D.INVALID_ARGUMENT, "Firestore transactions require all reads to be executed before all writes."),
|
|
17418
17420
|
this.lastTransactionError;
|
|
17419
17421
|
const t = await async function __PRIVATE_invokeBatchGetDocumentsRpc(e, t) {
|
|
17420
17422
|
const n = __PRIVATE_debugCast(e), r = {
|
|
@@ -17476,7 +17478,7 @@ class Transaction$2 {
|
|
|
17476
17478
|
if (n) {
|
|
17477
17479
|
if (!t.isEqual(n))
|
|
17478
17480
|
// This transaction will fail no matter what.
|
|
17479
|
-
throw new FirestoreError(
|
|
17481
|
+
throw new FirestoreError(D.ABORTED, "Document version changed between two reads.");
|
|
17480
17482
|
} else this.readVersions.set(e.key.toString(), t);
|
|
17481
17483
|
}
|
|
17482
17484
|
/**
|
|
@@ -17503,7 +17505,7 @@ class Transaction$2 {
|
|
|
17503
17505
|
// express that to the backend, we have to validate locally.
|
|
17504
17506
|
// Note: this can change once we can send separate verify writes in the
|
|
17505
17507
|
// transaction.
|
|
17506
|
-
throw new FirestoreError(
|
|
17508
|
+
throw new FirestoreError(D.INVALID_ARGUMENT, "Can't update a document that doesn't exist.");
|
|
17507
17509
|
// Document exists, base precondition on document update time.
|
|
17508
17510
|
return Precondition.updateTime(t);
|
|
17509
17511
|
}
|
|
@@ -17644,7 +17646,7 @@ class FirestoreClient {
|
|
|
17644
17646
|
* Checks that the client has not been terminated. Ensures that other methods on //
|
|
17645
17647
|
* this class cannot be called after the client is terminated. //
|
|
17646
17648
|
*/ verifyNotTerminated() {
|
|
17647
|
-
if (this.asyncQueue.isShuttingDown) throw new FirestoreError(
|
|
17649
|
+
if (this.asyncQueue.isShuttingDown) throw new FirestoreError(D.FAILED_PRECONDITION, "The client has already been terminated.");
|
|
17648
17650
|
}
|
|
17649
17651
|
terminate() {
|
|
17650
17652
|
this.asyncQueue.enterRestrictedMode();
|
|
@@ -17692,7 +17694,7 @@ async function __PRIVATE_setOnlineComponentProvider(e, t) {
|
|
|
17692
17694
|
* Decides whether the provided error allows us to gracefully disable
|
|
17693
17695
|
* persistence (as opposed to crashing the client).
|
|
17694
17696
|
*/ function __PRIVATE_canFallbackFromIndexedDbError(e) {
|
|
17695
|
-
return "FirebaseError" === e.name ? e.code ===
|
|
17697
|
+
return "FirebaseError" === e.name ? e.code === D.FAILED_PRECONDITION || e.code === D.UNIMPLEMENTED : !("undefined" != typeof DOMException && e instanceof DOMException) || (
|
|
17696
17698
|
// When the browser is out of quota we could get either quota exceeded
|
|
17697
17699
|
// or an aborted error depending on whether the error happened during
|
|
17698
17700
|
// schema migration.
|
|
@@ -17786,7 +17788,7 @@ async function __PRIVATE_getEventManager(e) {
|
|
|
17786
17788
|
const n = __PRIVATE_debugCast(e);
|
|
17787
17789
|
return n.persistence.runTransaction("read document", "readonly", (e => n.localDocuments.getDocument(e, t)));
|
|
17788
17790
|
}(e, t);
|
|
17789
|
-
r.isFoundDocument() ? n.resolve(r) : r.isNoDocument() ? n.resolve(null) : n.reject(new FirestoreError(
|
|
17791
|
+
r.isFoundDocument() ? n.resolve(r) : r.isNoDocument() ? n.resolve(null) : n.reject(new FirestoreError(D.UNAVAILABLE, "Failed to get document from cache. (However, this document may exist on the server. Run again without setting 'source' in the GetOptions to attempt to retrieve the document from the server.)"));
|
|
17790
17792
|
} catch (e) {
|
|
17791
17793
|
const r = __PRIVATE_wrapInUserErrorIfRecoverable(e, `Failed to get document '${t} from cache`);
|
|
17792
17794
|
n.reject(r);
|
|
@@ -17815,7 +17817,7 @@ function __PRIVATE_firestoreClientGetDocumentViaSnapshotListener(e, t, n = {}) {
|
|
|
17815
17817
|
// the server so we can deliver that even when you're
|
|
17816
17818
|
// offline 2) Actually reject the Promise in the online case
|
|
17817
17819
|
// if the document doesn't exist.
|
|
17818
|
-
i.reject(new FirestoreError(
|
|
17820
|
+
i.reject(new FirestoreError(D.UNAVAILABLE, "Failed to get document because the client is offline.")) : _ && s.fromCache && r && "server" === r.source ? i.reject(new FirestoreError(D.UNAVAILABLE, 'Failed to get document from server. (However, this document does exist in the local cache. Run again without setting source to "server" to retrieve the cached document.)')) : i.resolve(s);
|
|
17819
17821
|
},
|
|
17820
17822
|
error: e => i.reject(e)
|
|
17821
17823
|
}), o = new __PRIVATE_QueryListener(__PRIVATE_newQueryForPath(n.path), s, {
|
|
@@ -17852,7 +17854,7 @@ function __PRIVATE_firestoreClientGetDocumentsViaSnapshotListener(e, t, n = {})
|
|
|
17852
17854
|
next: n => {
|
|
17853
17855
|
// Remove query first before passing event to user to avoid
|
|
17854
17856
|
// user actions affecting the now stale query.
|
|
17855
|
-
t.enqueueAndForget((() => __PRIVATE_eventManagerUnlisten(e, o))), n.fromCache && "server" === r.source ? i.reject(new FirestoreError(
|
|
17857
|
+
t.enqueueAndForget((() => __PRIVATE_eventManagerUnlisten(e, o))), n.fromCache && "server" === r.source ? i.reject(new FirestoreError(D.UNAVAILABLE, 'Failed to get documents from server. (However, these documents may exist in the local cache. Run again without setting source to "server" to retrieve the cached documents.)')) : i.resolve(n);
|
|
17856
17858
|
},
|
|
17857
17859
|
error: e => i.reject(e)
|
|
17858
17860
|
}), o = new __PRIVATE_QueryListener(n, s, {
|
|
@@ -18090,7 +18092,7 @@ function __PRIVATE_cloneLongPollingOptions(e) {
|
|
|
18090
18092
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
18091
18093
|
* See the License for the specific language governing permissions and
|
|
18092
18094
|
* limitations under the License.
|
|
18093
|
-
*/ const
|
|
18095
|
+
*/ const we = new Map;
|
|
18094
18096
|
|
|
18095
18097
|
/**
|
|
18096
18098
|
* An instance map that ensures only one Datastore exists per Firestore
|
|
@@ -18113,28 +18115,28 @@ function __PRIVATE_cloneLongPollingOptions(e) {
|
|
|
18113
18115
|
* limitations under the License.
|
|
18114
18116
|
*/
|
|
18115
18117
|
function __PRIVATE_validateNonEmptyArgument(e, t, n) {
|
|
18116
|
-
if (!n) throw new FirestoreError(
|
|
18118
|
+
if (!n) throw new FirestoreError(D.INVALID_ARGUMENT, `Function ${e}() cannot be called with an empty ${t}.`);
|
|
18117
18119
|
}
|
|
18118
18120
|
|
|
18119
18121
|
/**
|
|
18120
18122
|
* Validates that two boolean options are not set at the same time.
|
|
18121
18123
|
* @internal
|
|
18122
18124
|
*/ function __PRIVATE_validateIsNotUsedTogether(e, t, n, r) {
|
|
18123
|
-
if (!0 === t && !0 === r) throw new FirestoreError(
|
|
18125
|
+
if (!0 === t && !0 === r) throw new FirestoreError(D.INVALID_ARGUMENT, `${e} and ${n} cannot be used together.`);
|
|
18124
18126
|
}
|
|
18125
18127
|
|
|
18126
18128
|
/**
|
|
18127
18129
|
* Validates that `path` refers to a document (indicated by the fact it contains
|
|
18128
18130
|
* an even numbers of segments).
|
|
18129
18131
|
*/ function __PRIVATE_validateDocumentPath(e) {
|
|
18130
|
-
if (!DocumentKey.isDocumentKey(e)) throw new FirestoreError(
|
|
18132
|
+
if (!DocumentKey.isDocumentKey(e)) throw new FirestoreError(D.INVALID_ARGUMENT, `Invalid document reference. Document references must have an even number of segments, but ${e} has ${e.length}.`);
|
|
18131
18133
|
}
|
|
18132
18134
|
|
|
18133
18135
|
/**
|
|
18134
18136
|
* Validates that `path` refers to a collection (indicated by the fact it
|
|
18135
18137
|
* contains an odd numbers of segments).
|
|
18136
18138
|
*/ function __PRIVATE_validateCollectionPath(e) {
|
|
18137
|
-
if (DocumentKey.isDocumentKey(e)) throw new FirestoreError(
|
|
18139
|
+
if (DocumentKey.isDocumentKey(e)) throw new FirestoreError(D.INVALID_ARGUMENT, `Invalid collection reference. Collection references must have an odd number of segments, but ${e} has ${e.length}.`);
|
|
18138
18140
|
}
|
|
18139
18141
|
|
|
18140
18142
|
/**
|
|
@@ -18178,17 +18180,17 @@ t) {
|
|
|
18178
18180
|
// Unwrap Compat types
|
|
18179
18181
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
18180
18182
|
e = e._delegate), !(e instanceof t)) {
|
|
18181
|
-
if (t.name === e.constructor.name) throw new FirestoreError(
|
|
18183
|
+
if (t.name === e.constructor.name) throw new FirestoreError(D.INVALID_ARGUMENT, "Type does not match the expected instance. Did you pass a reference from a different Firestore SDK?");
|
|
18182
18184
|
{
|
|
18183
18185
|
const n = __PRIVATE_valueDescription(e);
|
|
18184
|
-
throw new FirestoreError(
|
|
18186
|
+
throw new FirestoreError(D.INVALID_ARGUMENT, `Expected type '${t.name}', but it was: ${n}`);
|
|
18185
18187
|
}
|
|
18186
18188
|
}
|
|
18187
18189
|
return e;
|
|
18188
18190
|
}
|
|
18189
18191
|
|
|
18190
18192
|
function __PRIVATE_validatePositiveNumber(e, t) {
|
|
18191
|
-
if (t <= 0) throw new FirestoreError(
|
|
18193
|
+
if (t <= 0) throw new FirestoreError(D.INVALID_ARGUMENT, `Function ${e}() requires a positive number, but it was: ${t}.`);
|
|
18192
18194
|
}
|
|
18193
18195
|
|
|
18194
18196
|
/**
|
|
@@ -18217,12 +18219,12 @@ class FirestoreSettingsImpl {
|
|
|
18217
18219
|
constructor(e) {
|
|
18218
18220
|
var t, n;
|
|
18219
18221
|
if (void 0 === e.host) {
|
|
18220
|
-
if (void 0 !== e.ssl) throw new FirestoreError(
|
|
18222
|
+
if (void 0 !== e.ssl) throw new FirestoreError(D.INVALID_ARGUMENT, "Can't provide ssl option if host option is not set");
|
|
18221
18223
|
this.host = "firestore.googleapis.com", this.ssl = true;
|
|
18222
18224
|
} else this.host = e.host, this.ssl = null === (t = e.ssl) || void 0 === t || t;
|
|
18223
18225
|
if (this.credentials = e.credentials, this.ignoreUndefinedProperties = !!e.ignoreUndefinedProperties,
|
|
18224
18226
|
this.localCache = e.localCache, void 0 === e.cacheSizeBytes) this.cacheSizeBytes = 41943040; else {
|
|
18225
|
-
if (-1 !== e.cacheSizeBytes && e.cacheSizeBytes < 1048576) throw new FirestoreError(
|
|
18227
|
+
if (-1 !== e.cacheSizeBytes && e.cacheSizeBytes < 1048576) throw new FirestoreError(D.INVALID_ARGUMENT, "cacheSizeBytes must be at least 1048576");
|
|
18226
18228
|
this.cacheSizeBytes = e.cacheSizeBytes;
|
|
18227
18229
|
}
|
|
18228
18230
|
__PRIVATE_validateIsNotUsedTogether("experimentalForceLongPolling", e.experimentalForceLongPolling, "experimentalAutoDetectLongPolling", e.experimentalAutoDetectLongPolling),
|
|
@@ -18234,9 +18236,9 @@ class FirestoreSettingsImpl {
|
|
|
18234
18236
|
this.experimentalLongPollingOptions = __PRIVATE_cloneLongPollingOptions(null !== (n = e.experimentalLongPollingOptions) && void 0 !== n ? n : {}),
|
|
18235
18237
|
function __PRIVATE_validateLongPollingOptions(e) {
|
|
18236
18238
|
if (void 0 !== e.timeoutSeconds) {
|
|
18237
|
-
if (isNaN(e.timeoutSeconds)) throw new FirestoreError(
|
|
18238
|
-
if (e.timeoutSeconds < 5) throw new FirestoreError(
|
|
18239
|
-
if (e.timeoutSeconds > 30) throw new FirestoreError(
|
|
18239
|
+
if (isNaN(e.timeoutSeconds)) throw new FirestoreError(D.INVALID_ARGUMENT, `invalid long polling timeout: ${e.timeoutSeconds} (must not be NaN)`);
|
|
18240
|
+
if (e.timeoutSeconds < 5) throw new FirestoreError(D.INVALID_ARGUMENT, `invalid long polling timeout: ${e.timeoutSeconds} (minimum allowed value is 5)`);
|
|
18241
|
+
if (e.timeoutSeconds > 30) throw new FirestoreError(D.INVALID_ARGUMENT, `invalid long polling timeout: ${e.timeoutSeconds} (maximum allowed value is 30)`);
|
|
18240
18242
|
}
|
|
18241
18243
|
}
|
|
18242
18244
|
/**
|
|
@@ -18283,7 +18285,7 @@ class Firestore$1 {
|
|
|
18283
18285
|
* The {@link @firebase/app#FirebaseApp} associated with this `Firestore` service
|
|
18284
18286
|
* instance.
|
|
18285
18287
|
*/ get app() {
|
|
18286
|
-
if (!this._app) throw new FirestoreError(
|
|
18288
|
+
if (!this._app) throw new FirestoreError(D.FAILED_PRECONDITION, "Firestore was not initialized using the Firebase SDK. 'app' is not available");
|
|
18287
18289
|
return this._app;
|
|
18288
18290
|
}
|
|
18289
18291
|
get _initialized() {
|
|
@@ -18293,7 +18295,7 @@ class Firestore$1 {
|
|
|
18293
18295
|
return void 0 !== this._terminateTask;
|
|
18294
18296
|
}
|
|
18295
18297
|
_setSettings(e) {
|
|
18296
|
-
if (this._settingsFrozen) throw new FirestoreError(
|
|
18298
|
+
if (this._settingsFrozen) throw new FirestoreError(D.FAILED_PRECONDITION, "Firestore has already been started and its settings can no longer be changed. You can only modify settings before calling any other methods on a Firestore object.");
|
|
18297
18299
|
this._settings = new FirestoreSettingsImpl(e), void 0 !== e.credentials && (this._authCredentials = function __PRIVATE_makeAuthCredentialsProvider(e) {
|
|
18298
18300
|
if (!e) return new __PRIVATE_EmptyAuthCredentialsProvider;
|
|
18299
18301
|
switch (e.type) {
|
|
@@ -18304,7 +18306,7 @@ class Firestore$1 {
|
|
|
18304
18306
|
return e.client;
|
|
18305
18307
|
|
|
18306
18308
|
default:
|
|
18307
|
-
throw new FirestoreError(
|
|
18309
|
+
throw new FirestoreError(D.INVALID_ARGUMENT, "makeAuthCredentialsProvider failed due to invalid credential type");
|
|
18308
18310
|
}
|
|
18309
18311
|
}(e.credentials));
|
|
18310
18312
|
}
|
|
@@ -18336,8 +18338,8 @@ class Firestore$1 {
|
|
|
18336
18338
|
* when the `Firestore` instance is terminated.
|
|
18337
18339
|
*/
|
|
18338
18340
|
return function __PRIVATE_removeComponents(e) {
|
|
18339
|
-
const t =
|
|
18340
|
-
t && (__PRIVATE_logDebug("ComponentProvider", "Removing Datastore"),
|
|
18341
|
+
const t = we.get(e);
|
|
18342
|
+
t && (__PRIVATE_logDebug("ComponentProvider", "Removing Datastore"), we.delete(e),
|
|
18341
18343
|
t.terminate());
|
|
18342
18344
|
}(this), Promise.resolve();
|
|
18343
18345
|
}
|
|
@@ -18369,7 +18371,7 @@ class Firestore$1 {
|
|
|
18369
18371
|
// invalid field "uid" and missing field "sub" / "user_id".)
|
|
18370
18372
|
t = createMockUserToken(r.mockUserToken, null === (i = e._app) || void 0 === i ? void 0 : i.options.projectId);
|
|
18371
18373
|
const s = r.mockUserToken.sub || r.mockUserToken.user_id;
|
|
18372
|
-
if (!s) throw new FirestoreError(
|
|
18374
|
+
if (!s) throw new FirestoreError(D.INVALID_ARGUMENT, "mockUserToken must contain 'sub' or 'user_id' field!");
|
|
18373
18375
|
n = new User(s);
|
|
18374
18376
|
}
|
|
18375
18377
|
e._authCredentials = new __PRIVATE_EmulatorAuthCredentialsProvider(new __PRIVATE_OAuthToken(t, n));
|
|
@@ -18489,7 +18491,7 @@ function collection(e, t, ...n) {
|
|
|
18489
18491
|
return __PRIVATE_validateCollectionPath(r), new CollectionReference(e, /* converter= */ null, r);
|
|
18490
18492
|
}
|
|
18491
18493
|
{
|
|
18492
|
-
if (!(e instanceof DocumentReference || e instanceof CollectionReference)) throw new FirestoreError(
|
|
18494
|
+
if (!(e instanceof DocumentReference || e instanceof CollectionReference)) throw new FirestoreError(D.INVALID_ARGUMENT, "Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");
|
|
18493
18495
|
const r = e._path.child(ResourcePath.fromString(t, ...n));
|
|
18494
18496
|
return __PRIVATE_validateCollectionPath(r), new CollectionReference(e.firestore,
|
|
18495
18497
|
/* converter= */ null, r);
|
|
@@ -18510,7 +18512,7 @@ function collection(e, t, ...n) {
|
|
|
18510
18512
|
* @returns The created `Query`.
|
|
18511
18513
|
*/ function collectionGroup(e, t) {
|
|
18512
18514
|
if (e = __PRIVATE_cast(e, Firestore$1), __PRIVATE_validateNonEmptyArgument("collectionGroup", "collection id", t),
|
|
18513
|
-
t.indexOf("/") >= 0) throw new FirestoreError(
|
|
18515
|
+
t.indexOf("/") >= 0) throw new FirestoreError(D.INVALID_ARGUMENT, `Invalid collection ID '${t}' passed to function collectionGroup(). Collection IDs must not contain '/'.`);
|
|
18514
18516
|
return new Query(e,
|
|
18515
18517
|
/* converter= */ null, function __PRIVATE_newQueryForCollectionGroup(e) {
|
|
18516
18518
|
return new __PRIVATE_QueryImpl(ResourcePath.emptyPath(), e);
|
|
@@ -18528,7 +18530,7 @@ function doc(e, t, ...n) {
|
|
|
18528
18530
|
/* converter= */ null, new DocumentKey(r));
|
|
18529
18531
|
}
|
|
18530
18532
|
{
|
|
18531
|
-
if (!(e instanceof DocumentReference || e instanceof CollectionReference)) throw new FirestoreError(
|
|
18533
|
+
if (!(e instanceof DocumentReference || e instanceof CollectionReference)) throw new FirestoreError(D.INVALID_ARGUMENT, "Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");
|
|
18532
18534
|
const r = e._path.child(ResourcePath.fromString(t, ...n));
|
|
18533
18535
|
return __PRIVATE_validateDocumentPath(r), new DocumentReference(e.firestore, e instanceof CollectionReference ? e.converter : null, new DocumentKey(r));
|
|
18534
18536
|
}
|
|
@@ -18889,7 +18891,7 @@ class LoadBundleTask {
|
|
|
18889
18891
|
* Constant used to indicate the LRU garbage collection should be disabled.
|
|
18890
18892
|
* Set this value as the `cacheSizeBytes` on the settings passed to the
|
|
18891
18893
|
* {@link Firestore} instance.
|
|
18892
|
-
*/ const
|
|
18894
|
+
*/ const Se = -1;
|
|
18893
18895
|
|
|
18894
18896
|
/**
|
|
18895
18897
|
* The Cloud Firestore service interface.
|
|
@@ -18933,10 +18935,10 @@ class LoadBundleTask {
|
|
|
18933
18935
|
identifier: n
|
|
18934
18936
|
}), i = r.getOptions(n);
|
|
18935
18937
|
if (deepEqual(i, t)) return e;
|
|
18936
|
-
throw new FirestoreError(
|
|
18938
|
+
throw new FirestoreError(D.FAILED_PRECONDITION, "initializeFirestore() has already been called with different options. To avoid this error, call initializeFirestore() with the same options as when it was originally called, or call getFirestore() to return the already initialized instance.");
|
|
18937
18939
|
}
|
|
18938
|
-
if (void 0 !== t.cacheSizeBytes && void 0 !== t.localCache) throw new FirestoreError(
|
|
18939
|
-
if (void 0 !== t.cacheSizeBytes && -1 !== t.cacheSizeBytes && t.cacheSizeBytes < 1048576) throw new FirestoreError(
|
|
18940
|
+
if (void 0 !== t.cacheSizeBytes && void 0 !== t.localCache) throw new FirestoreError(D.INVALID_ARGUMENT, "cache and cacheSizeBytes cannot be specified at the same time as cacheSizeBytes willbe deprecated. Instead, specify the cache size in the cache object");
|
|
18941
|
+
if (void 0 !== t.cacheSizeBytes && -1 !== t.cacheSizeBytes && t.cacheSizeBytes < 1048576) throw new FirestoreError(D.INVALID_ARGUMENT, "cacheSizeBytes must be at least 1048576");
|
|
18940
18942
|
return r.initialize({
|
|
18941
18943
|
options: t,
|
|
18942
18944
|
instanceIdentifier: n
|
|
@@ -19005,7 +19007,7 @@ function __PRIVATE_configureFirestore(e) {
|
|
|
19005
19007
|
*/ function enableIndexedDbPersistence(e, t) {
|
|
19006
19008
|
__PRIVATE_verifyNotInitialized(e = __PRIVATE_cast(e, Firestore));
|
|
19007
19009
|
const n = ensureFirestoreConfigured(e);
|
|
19008
|
-
if (n._uninitializedComponentsProvider) throw new FirestoreError(
|
|
19010
|
+
if (n._uninitializedComponentsProvider) throw new FirestoreError(D.FAILED_PRECONDITION, "SDK cache is already specified.");
|
|
19009
19011
|
__PRIVATE_logWarn("enableIndexedDbPersistence() will be deprecated in the future, you can use `FirestoreSettings.cache` instead.");
|
|
19010
19012
|
const r = e._freezeSettings(), i = new OnlineComponentProvider;
|
|
19011
19013
|
return __PRIVATE_setPersistenceProviders(n, i, new __PRIVATE_IndexedDbOfflineComponentProvider(i, r.cacheSizeBytes, null == t ? void 0 : t.forceOwnership));
|
|
@@ -19039,7 +19041,7 @@ function __PRIVATE_configureFirestore(e) {
|
|
|
19039
19041
|
*/ function enableMultiTabIndexedDbPersistence(e) {
|
|
19040
19042
|
__PRIVATE_verifyNotInitialized(e = __PRIVATE_cast(e, Firestore));
|
|
19041
19043
|
const t = ensureFirestoreConfigured(e);
|
|
19042
|
-
if (t._uninitializedComponentsProvider) throw new FirestoreError(
|
|
19044
|
+
if (t._uninitializedComponentsProvider) throw new FirestoreError(D.FAILED_PRECONDITION, "SDK cache is already specified.");
|
|
19043
19045
|
__PRIVATE_logWarn("enableMultiTabIndexedDbPersistence() will be deprecated in the future, you can use `FirestoreSettings.cache` instead.");
|
|
19044
19046
|
const n = e._freezeSettings(), r = new OnlineComponentProvider;
|
|
19045
19047
|
return __PRIVATE_setPersistenceProviders(t, r, new __PRIVATE_MultiTabOfflineComponentProvider(r, n.cacheSizeBytes));
|
|
@@ -19087,7 +19089,7 @@ function __PRIVATE_configureFirestore(e) {
|
|
|
19087
19089
|
* @returns A `Promise` that is resolved when the persistent storage is
|
|
19088
19090
|
* cleared. Otherwise, the promise is rejected with an error.
|
|
19089
19091
|
*/ function clearIndexedDbPersistence(e) {
|
|
19090
|
-
if (e._initialized && !e._terminated) throw new FirestoreError(
|
|
19092
|
+
if (e._initialized && !e._terminated) throw new FirestoreError(D.FAILED_PRECONDITION, "Persistence can only be cleared before a Firestore instance is initialized or after it is terminated.");
|
|
19091
19093
|
const t = new __PRIVATE_Deferred;
|
|
19092
19094
|
return e._queue.enqueueAndForgetEvenWhileRestricted((async () => {
|
|
19093
19095
|
try {
|
|
@@ -19201,7 +19203,7 @@ function __PRIVATE_configureFirestore(e) {
|
|
|
19201
19203
|
}
|
|
19202
19204
|
|
|
19203
19205
|
function __PRIVATE_verifyNotInitialized(e) {
|
|
19204
|
-
if (e._initialized || e._terminated) throw new FirestoreError(
|
|
19206
|
+
if (e._initialized || e._terminated) throw new FirestoreError(D.FAILED_PRECONDITION, "Firestore has already been started and persistence can no longer be enabled. You can only enable persistence before calling any other methods on a Firestore object.");
|
|
19205
19207
|
}
|
|
19206
19208
|
|
|
19207
19209
|
/**
|
|
@@ -19310,7 +19312,7 @@ class AggregateField {
|
|
|
19310
19312
|
try {
|
|
19311
19313
|
return new Bytes(ByteString.fromBase64String(e));
|
|
19312
19314
|
} catch (e) {
|
|
19313
|
-
throw new FirestoreError(
|
|
19315
|
+
throw new FirestoreError(D.INVALID_ARGUMENT, "Failed to construct data from Base64 string: " + e);
|
|
19314
19316
|
}
|
|
19315
19317
|
}
|
|
19316
19318
|
/**
|
|
@@ -19382,7 +19384,7 @@ class AggregateField {
|
|
|
19382
19384
|
* @param fieldNames - A list of field names.
|
|
19383
19385
|
*/
|
|
19384
19386
|
constructor(...e) {
|
|
19385
|
-
for (let t = 0; t < e.length; ++t) if (0 === e[t].length) throw new FirestoreError(
|
|
19387
|
+
for (let t = 0; t < e.length; ++t) if (0 === e[t].length) throw new FirestoreError(D.INVALID_ARGUMENT, "Invalid field name at argument $(i + 1). Field names must not be empty.");
|
|
19386
19388
|
this._internalPath = new FieldPath$1(e);
|
|
19387
19389
|
}
|
|
19388
19390
|
/**
|
|
@@ -19461,8 +19463,8 @@ class AggregateField {
|
|
|
19461
19463
|
* @param longitude - The longitude as number between -180 and 180.
|
|
19462
19464
|
*/
|
|
19463
19465
|
constructor(e, t) {
|
|
19464
|
-
if (!isFinite(e) || e < -90 || e > 90) throw new FirestoreError(
|
|
19465
|
-
if (!isFinite(t) || t < -180 || t > 180) throw new FirestoreError(
|
|
19466
|
+
if (!isFinite(e) || e < -90 || e > 90) throw new FirestoreError(D.INVALID_ARGUMENT, "Latitude must be a number between -90 and 90, but was: " + e);
|
|
19467
|
+
if (!isFinite(t) || t < -180 || t > 180) throw new FirestoreError(D.INVALID_ARGUMENT, "Longitude must be a number between -180 and 180, but was: " + t);
|
|
19466
19468
|
this._lat = e, this._long = t;
|
|
19467
19469
|
}
|
|
19468
19470
|
/**
|
|
@@ -19558,7 +19560,7 @@ class AggregateField {
|
|
|
19558
19560
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
19559
19561
|
* See the License for the specific language governing permissions and
|
|
19560
19562
|
* limitations under the License.
|
|
19561
|
-
*/ const
|
|
19563
|
+
*/ const be = /^__.*__$/;
|
|
19562
19564
|
|
|
19563
19565
|
/** The result of parsing document data (e.g. for a setData call). */ class ParsedSetData {
|
|
19564
19566
|
constructor(e, t, n) {
|
|
@@ -19669,7 +19671,7 @@ function __PRIVATE_isWrite(e) {
|
|
|
19669
19671
|
}
|
|
19670
19672
|
vu(e) {
|
|
19671
19673
|
if (0 === e.length) throw this.Mu("Document fields must not be empty");
|
|
19672
|
-
if (__PRIVATE_isWrite(this.wu) &&
|
|
19674
|
+
if (__PRIVATE_isWrite(this.wu) && be.test(e)) throw this.Mu('Document fields cannot begin and end with "__"');
|
|
19673
19675
|
}
|
|
19674
19676
|
}
|
|
19675
19677
|
|
|
@@ -19706,7 +19708,7 @@ function __PRIVATE_newUserDataReader(e) {
|
|
|
19706
19708
|
const e = [];
|
|
19707
19709
|
for (const r of s.mergeFields) {
|
|
19708
19710
|
const i = __PRIVATE_fieldPathFromArgument$1(t, r, n);
|
|
19709
|
-
if (!o.contains(i)) throw new FirestoreError(
|
|
19711
|
+
if (!o.contains(i)) throw new FirestoreError(D.INVALID_ARGUMENT, `Field '${i}' is specified in your field mask but missing from your input data.`);
|
|
19710
19712
|
__PRIVATE_fieldMaskContains(e, i) || e.push(i);
|
|
19711
19713
|
}
|
|
19712
19714
|
a = new FieldMask(e), u = o.fieldTransforms.filter((e => a.covers(e.field)));
|
|
@@ -19823,7 +19825,7 @@ class __PRIVATE_NumericIncrementFieldValueImpl extends FieldValue {
|
|
|
19823
19825
|
|
|
19824
19826
|
/** Parse update data from a list of field/value arguments. */ function __PRIVATE_parseUpdateVarargs(e, t, n, r, i, s) {
|
|
19825
19827
|
const o = e.Nu(1 /* UserDataSource.Update */ , t, n), _ = [ __PRIVATE_fieldPathFromArgument$1(t, r, n) ], a = [ i ];
|
|
19826
|
-
if (s.length % 2 != 0) throw new FirestoreError(
|
|
19828
|
+
if (s.length % 2 != 0) throw new FirestoreError(D.INVALID_ARGUMENT, `Function ${t}() needs to be called with an even number of arguments that alternate between field names and values.`);
|
|
19827
19829
|
for (let e = 0; e < s.length; e += 2) _.push(__PRIVATE_fieldPathFromArgument$1(t, s[e])),
|
|
19828
19830
|
a.push(s[e + 1]);
|
|
19829
19831
|
const u = [], c = ObjectValue.empty();
|
|
@@ -20047,7 +20049,7 @@ function __PRIVATE_validatePlainObject(e, t, n) {
|
|
|
20047
20049
|
|
|
20048
20050
|
/**
|
|
20049
20051
|
* Matches any characters in a field path string that are reserved.
|
|
20050
|
-
*/ const
|
|
20052
|
+
*/ const De = new RegExp("[~\\*/\\[\\]]");
|
|
20051
20053
|
|
|
20052
20054
|
/**
|
|
20053
20055
|
* Wraps fromDotSeparatedString with an error message about the method that
|
|
@@ -20058,7 +20060,7 @@ function __PRIVATE_validatePlainObject(e, t, n) {
|
|
|
20058
20060
|
* @param targetDoc - The document against which the field path will be
|
|
20059
20061
|
* evaluated.
|
|
20060
20062
|
*/ function __PRIVATE_fieldPathFromDotSeparatedString(e, t, n) {
|
|
20061
|
-
if (t.search(
|
|
20063
|
+
if (t.search(De) >= 0) throw __PRIVATE_createError(`Invalid field path (${t}). Paths must not contain '~', '*', '/', '[', or ']'`, e,
|
|
20062
20064
|
/* hasConverter= */ !1,
|
|
20063
20065
|
/* path= */ void 0, n);
|
|
20064
20066
|
try {
|
|
@@ -20076,7 +20078,7 @@ function __PRIVATE_createError(e, t, n, r, i) {
|
|
|
20076
20078
|
n && (_ += " (via `toFirestore()`)"), _ += ". ";
|
|
20077
20079
|
let a = "";
|
|
20078
20080
|
return (s || o) && (a += " (found", s && (a += ` in field ${r}`), o && (a += ` in document ${i}`),
|
|
20079
|
-
a += ")"), new FirestoreError(
|
|
20081
|
+
a += ")"), new FirestoreError(D.INVALID_ARGUMENT, _ + e + a);
|
|
20080
20082
|
}
|
|
20081
20083
|
|
|
20082
20084
|
/** Checks `haystack` if FieldPath `needle` is present. Runs in O(n). */ function __PRIVATE_fieldMaskContains(e, t) {
|
|
@@ -20213,7 +20215,7 @@ function __PRIVATE_createError(e, t, n, r, i) {
|
|
|
20213
20215
|
* See the License for the specific language governing permissions and
|
|
20214
20216
|
* limitations under the License.
|
|
20215
20217
|
*/ function __PRIVATE_validateHasExplicitOrderByForLimitToLast(e) {
|
|
20216
|
-
if ("L" /* LimitType.Last */ === e.limitType && 0 === e.explicitOrderBy.length) throw new FirestoreError(
|
|
20218
|
+
if ("L" /* LimitType.Last */ === e.limitType && 0 === e.explicitOrderBy.length) throw new FirestoreError(D.UNIMPLEMENTED, "limitToLast() queries require specifying at least one orderBy() clause");
|
|
20217
20219
|
}
|
|
20218
20220
|
|
|
20219
20221
|
/**
|
|
@@ -20234,7 +20236,7 @@ function query(e, t, ...n) {
|
|
|
20234
20236
|
let r = [];
|
|
20235
20237
|
t instanceof AppliableConstraint && r.push(t), r = r.concat(n), function __PRIVATE_validateQueryConstraintArray(e) {
|
|
20236
20238
|
const t = e.filter((e => e instanceof QueryCompositeFilterConstraint)).length, n = e.filter((e => e instanceof QueryFieldFilterConstraint)).length;
|
|
20237
|
-
if (t > 1 || t > 0 && n > 0) throw new FirestoreError(
|
|
20239
|
+
if (t > 1 || t > 0 && n > 0) throw new FirestoreError(D.INVALID_ARGUMENT, "InvalidQuery. When using composite filters, you cannot use more than one filter at the top level. Consider nesting the multiple filters within an `and(...)` statement. For example: change `query(query, where(...), or(...))` to `query(query, and(where(...), or(...)))`.");
|
|
20238
20240
|
}
|
|
20239
20241
|
/**
|
|
20240
20242
|
* @license
|
|
@@ -20288,7 +20290,7 @@ function query(e, t, ...n) {
|
|
|
20288
20290
|
const t = __PRIVATE_newUserDataReader(e.firestore), n = function __PRIVATE_newQueryFilter(e, t, n, r, i, s, o) {
|
|
20289
20291
|
let _;
|
|
20290
20292
|
if (i.isKeyField()) {
|
|
20291
|
-
if ("array-contains" /* Operator.ARRAY_CONTAINS */ === s || "array-contains-any" /* Operator.ARRAY_CONTAINS_ANY */ === s) throw new FirestoreError(
|
|
20293
|
+
if ("array-contains" /* Operator.ARRAY_CONTAINS */ === s || "array-contains-any" /* Operator.ARRAY_CONTAINS_ANY */ === s) throw new FirestoreError(D.INVALID_ARGUMENT, `Invalid Query. You can't perform '${s}' queries on documentId().`);
|
|
20292
20294
|
if ("in" /* Operator.IN */ === s || "not-in" /* Operator.NOT_IN */ === s) {
|
|
20293
20295
|
__PRIVATE_validateDisjunctiveFilterElements(o, s);
|
|
20294
20296
|
const t = [];
|
|
@@ -20415,8 +20417,8 @@ function query(e, t, ...n) {
|
|
|
20415
20417
|
}
|
|
20416
20418
|
_apply(e) {
|
|
20417
20419
|
const t = function __PRIVATE_newQueryOrderBy(e, t, n) {
|
|
20418
|
-
if (null !== e.startAt) throw new FirestoreError(
|
|
20419
|
-
if (null !== e.endAt) throw new FirestoreError(
|
|
20420
|
+
if (null !== e.startAt) throw new FirestoreError(D.INVALID_ARGUMENT, "Invalid query. You must not call startAt() or startAfter() before calling orderBy().");
|
|
20421
|
+
if (null !== e.endAt) throw new FirestoreError(D.INVALID_ARGUMENT, "Invalid query. You must not call endAt() or endBefore() before calling orderBy().");
|
|
20420
20422
|
return new OrderBy(t, n);
|
|
20421
20423
|
}
|
|
20422
20424
|
/**
|
|
@@ -20574,7 +20576,7 @@ function endAt(...e) {
|
|
|
20574
20576
|
|
|
20575
20577
|
/** Helper function to create a bound from a document or fields */ function __PRIVATE_newQueryBoundFromDocOrFields(e, t, n, r) {
|
|
20576
20578
|
if (n[0] = getModularInstance(n[0]), n[0] instanceof DocumentSnapshot$1) return function __PRIVATE_newQueryBoundFromDocument(e, t, n, r, i) {
|
|
20577
|
-
if (!r) throw new FirestoreError(
|
|
20579
|
+
if (!r) throw new FirestoreError(D.NOT_FOUND, `Can't use a DocumentSnapshot that doesn't exist for ${n}().`);
|
|
20578
20580
|
const s = [];
|
|
20579
20581
|
// Because people expect to continue/end a query at the exact document
|
|
20580
20582
|
// provided, we need to use the implicit sort order rather than the explicit
|
|
@@ -20585,10 +20587,10 @@ function endAt(...e) {
|
|
|
20585
20587
|
// results.
|
|
20586
20588
|
for (const n of __PRIVATE_queryNormalizedOrderBy(e)) if (n.field.isKeyField()) s.push(__PRIVATE_refValue(t, r.key)); else {
|
|
20587
20589
|
const e = r.data.field(n.field);
|
|
20588
|
-
if (__PRIVATE_isServerTimestamp(e)) throw new FirestoreError(
|
|
20590
|
+
if (__PRIVATE_isServerTimestamp(e)) throw new FirestoreError(D.INVALID_ARGUMENT, 'Invalid query. You are trying to start or end a query using a document for which the field "' + n.field + '" is an uncommitted server timestamp. (Since the value of this field is unknown, you cannot start/end a query with it.)');
|
|
20589
20591
|
if (null === e) {
|
|
20590
20592
|
const e = n.field.canonicalString();
|
|
20591
|
-
throw new FirestoreError(
|
|
20593
|
+
throw new FirestoreError(D.INVALID_ARGUMENT, `Invalid query. You are trying to start or end a query using a document for which the field '${e}' (used as the orderBy) does not exist.`);
|
|
20592
20594
|
}
|
|
20593
20595
|
s.push(e);
|
|
20594
20596
|
}
|
|
@@ -20602,15 +20604,15 @@ function endAt(...e) {
|
|
|
20602
20604
|
return function __PRIVATE_newQueryBoundFromFields(e, t, n, r, i, s) {
|
|
20603
20605
|
// Use explicit order by's because it has to match the query the user made
|
|
20604
20606
|
const o = e.explicitOrderBy;
|
|
20605
|
-
if (i.length > o.length) throw new FirestoreError(
|
|
20607
|
+
if (i.length > o.length) throw new FirestoreError(D.INVALID_ARGUMENT, `Too many arguments provided to ${r}(). The number of arguments must be less than or equal to the number of orderBy() clauses`);
|
|
20606
20608
|
const _ = [];
|
|
20607
20609
|
for (let s = 0; s < i.length; s++) {
|
|
20608
20610
|
const a = i[s];
|
|
20609
20611
|
if (o[s].field.isKeyField()) {
|
|
20610
|
-
if ("string" != typeof a) throw new FirestoreError(
|
|
20611
|
-
if (!__PRIVATE_isCollectionGroupQuery(e) && -1 !== a.indexOf("/")) throw new FirestoreError(
|
|
20612
|
+
if ("string" != typeof a) throw new FirestoreError(D.INVALID_ARGUMENT, `Invalid query. Expected a string for document ID in ${r}(), but got a ${typeof a}`);
|
|
20613
|
+
if (!__PRIVATE_isCollectionGroupQuery(e) && -1 !== a.indexOf("/")) throw new FirestoreError(D.INVALID_ARGUMENT, `Invalid query. When querying a collection and ordering by documentId(), the value passed to ${r}() must be a plain document ID, but '${a}' contains a slash.`);
|
|
20612
20614
|
const n = e.path.child(ResourcePath.fromString(a));
|
|
20613
|
-
if (!DocumentKey.isDocumentKey(n)) throw new FirestoreError(
|
|
20615
|
+
if (!DocumentKey.isDocumentKey(n)) throw new FirestoreError(D.INVALID_ARGUMENT, `Invalid query. When querying a collection group and ordering by documentId(), the value passed to ${r}() must result in a valid document path, but '${n}' is not because it contains an odd number of segments.`);
|
|
20614
20616
|
const i = new DocumentKey(n);
|
|
20615
20617
|
_.push(__PRIVATE_refValue(t, i));
|
|
20616
20618
|
} else {
|
|
@@ -20630,21 +20632,21 @@ function endAt(...e) {
|
|
|
20630
20632
|
|
|
20631
20633
|
function __PRIVATE_parseDocumentIdValue(e, t, n) {
|
|
20632
20634
|
if ("string" == typeof (n = getModularInstance(n))) {
|
|
20633
|
-
if ("" === n) throw new FirestoreError(
|
|
20634
|
-
if (!__PRIVATE_isCollectionGroupQuery(t) && -1 !== n.indexOf("/")) throw new FirestoreError(
|
|
20635
|
+
if ("" === n) throw new FirestoreError(D.INVALID_ARGUMENT, "Invalid query. When querying with documentId(), you must provide a valid document ID, but it was an empty string.");
|
|
20636
|
+
if (!__PRIVATE_isCollectionGroupQuery(t) && -1 !== n.indexOf("/")) throw new FirestoreError(D.INVALID_ARGUMENT, `Invalid query. When querying a collection by documentId(), you must provide a plain document ID, but '${n}' contains a '/' character.`);
|
|
20635
20637
|
const r = t.path.child(ResourcePath.fromString(n));
|
|
20636
|
-
if (!DocumentKey.isDocumentKey(r)) throw new FirestoreError(
|
|
20638
|
+
if (!DocumentKey.isDocumentKey(r)) throw new FirestoreError(D.INVALID_ARGUMENT, `Invalid query. When querying a collection group by documentId(), the value provided must result in a valid document path, but '${r}' is not because it has an odd number of segments (${r.length}).`);
|
|
20637
20639
|
return __PRIVATE_refValue(e, new DocumentKey(r));
|
|
20638
20640
|
}
|
|
20639
20641
|
if (n instanceof DocumentReference) return __PRIVATE_refValue(e, n._key);
|
|
20640
|
-
throw new FirestoreError(
|
|
20642
|
+
throw new FirestoreError(D.INVALID_ARGUMENT, `Invalid query. When querying with documentId(), you must provide a valid string or a DocumentReference, but it was: ${__PRIVATE_valueDescription(n)}.`);
|
|
20641
20643
|
}
|
|
20642
20644
|
|
|
20643
20645
|
/**
|
|
20644
20646
|
* Validates that the value passed into a disjunctive filter satisfies all
|
|
20645
20647
|
* array requirements.
|
|
20646
20648
|
*/ function __PRIVATE_validateDisjunctiveFilterElements(e, t) {
|
|
20647
|
-
if (!Array.isArray(e) || 0 === e.length) throw new FirestoreError(
|
|
20649
|
+
if (!Array.isArray(e) || 0 === e.length) throw new FirestoreError(D.INVALID_ARGUMENT, `Invalid Query. A non-empty array is required for '${t.toString()}' filters.`);
|
|
20648
20650
|
}
|
|
20649
20651
|
|
|
20650
20652
|
/**
|
|
@@ -20678,11 +20680,11 @@ function __PRIVATE_parseDocumentIdValue(e, t, n) {
|
|
|
20678
20680
|
}(t.op));
|
|
20679
20681
|
if (null !== n)
|
|
20680
20682
|
// Special case when it's a duplicate op to give a slightly clearer error message.
|
|
20681
|
-
throw n === t.op ? new FirestoreError(
|
|
20683
|
+
throw n === t.op ? new FirestoreError(D.INVALID_ARGUMENT, `Invalid query. You cannot use more than one '${t.op.toString()}' filter.`) : new FirestoreError(D.INVALID_ARGUMENT, `Invalid query. You cannot use '${t.op.toString()}' filters with '${n.toString()}' filters.`);
|
|
20682
20684
|
}
|
|
20683
20685
|
|
|
20684
20686
|
function __PRIVATE_validateQueryFilterConstraint(e, t) {
|
|
20685
|
-
if (!(t instanceof QueryFieldFilterConstraint || t instanceof QueryCompositeFilterConstraint)) throw new FirestoreError(
|
|
20687
|
+
if (!(t instanceof QueryFieldFilterConstraint || t instanceof QueryCompositeFilterConstraint)) throw new FirestoreError(D.INVALID_ARGUMENT, `Function ${e}() requires AppliableConstraints created with a call to 'where(...)', 'or(...)', or 'and(...)'.`);
|
|
20686
20688
|
}
|
|
20687
20689
|
|
|
20688
20690
|
class AbstractUserDataWriter {
|
|
@@ -21064,7 +21066,7 @@ class __PRIVATE_LiteUserDataWriter extends AbstractUserDataWriter {
|
|
|
21064
21066
|
* snapshot events.
|
|
21065
21067
|
*/ docChanges(e = {}) {
|
|
21066
21068
|
const t = !!e.includeMetadataChanges;
|
|
21067
|
-
if (t && this._snapshot.excludesMetadataChanges) throw new FirestoreError(
|
|
21069
|
+
if (t && this._snapshot.excludesMetadataChanges) throw new FirestoreError(D.INVALID_ARGUMENT, "To include metadata changes with your document changes, you must also pass { includeMetadataChanges:true } to onSnapshot().");
|
|
21068
21070
|
return this._cachedChanges && this._cachedChangesIncludeMetadataChanges === t || (this._cachedChanges =
|
|
21069
21071
|
/** Calculates the array of `DocumentChange`s for a given `ViewSnapshot`. */
|
|
21070
21072
|
function __PRIVATE_changesFromSnapshot(e, t) {
|
|
@@ -21604,7 +21606,7 @@ class __PRIVATE_MultiTabManagerImpl {
|
|
|
21604
21606
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
21605
21607
|
* See the License for the specific language governing permissions and
|
|
21606
21608
|
* limitations under the License.
|
|
21607
|
-
*/ const
|
|
21609
|
+
*/ const ve = {
|
|
21608
21610
|
maxAttempts: 5
|
|
21609
21611
|
};
|
|
21610
21612
|
|
|
@@ -21678,12 +21680,12 @@ class WriteBatch {
|
|
|
21678
21680
|
return this._verifyNotCommitted(), this._committed = !0, this._mutations.length > 0 ? this._commitHandler(this._mutations) : Promise.resolve();
|
|
21679
21681
|
}
|
|
21680
21682
|
_verifyNotCommitted() {
|
|
21681
|
-
if (this._committed) throw new FirestoreError(
|
|
21683
|
+
if (this._committed) throw new FirestoreError(D.FAILED_PRECONDITION, "A write batch can no longer be used after commit() has been called.");
|
|
21682
21684
|
}
|
|
21683
21685
|
}
|
|
21684
21686
|
|
|
21685
21687
|
function __PRIVATE_validateReference(e, t) {
|
|
21686
|
-
if ((e = getModularInstance(e)).firestore !== t) throw new FirestoreError(
|
|
21688
|
+
if ((e = getModularInstance(e)).firestore !== t) throw new FirestoreError(D.INVALID_ARGUMENT, "Provided document reference is from a different Firestore instance.");
|
|
21687
21689
|
return e;
|
|
21688
21690
|
}
|
|
21689
21691
|
|
|
@@ -21816,9 +21818,9 @@ class Transaction extends class Transaction$1 {
|
|
|
21816
21818
|
* rejected promise with the corresponding failure error is returned.
|
|
21817
21819
|
*/ function runTransaction(e, t, n) {
|
|
21818
21820
|
e = __PRIVATE_cast(e, Firestore);
|
|
21819
|
-
const r = Object.assign(Object.assign({},
|
|
21821
|
+
const r = Object.assign(Object.assign({}, ve), n);
|
|
21820
21822
|
!function __PRIVATE_validateTransactionOptions(e) {
|
|
21821
|
-
if (e.maxAttempts < 1) throw new FirestoreError(
|
|
21823
|
+
if (e.maxAttempts < 1) throw new FirestoreError(D.INVALID_ARGUMENT, "Max attempts must be at least 1");
|
|
21822
21824
|
}(r);
|
|
21823
21825
|
return function __PRIVATE_firestoreClientTransaction(e, t, n) {
|
|
21824
21826
|
const r = new __PRIVATE_Deferred;
|
|
@@ -21982,7 +21984,7 @@ class Transaction extends class Transaction$1 {
|
|
|
21982
21984
|
try {
|
|
21983
21985
|
return JSON.parse(e);
|
|
21984
21986
|
} catch (e) {
|
|
21985
|
-
throw new FirestoreError(
|
|
21987
|
+
throw new FirestoreError(D.INVALID_ARGUMENT, "Failed to parse JSON: " + (null == e ? void 0 : e.message));
|
|
21986
21988
|
}
|
|
21987
21989
|
}(e) : e, n = [];
|
|
21988
21990
|
if (Array.isArray(t.indexes)) for (const e of t.indexes) {
|
|
@@ -21999,7 +22001,7 @@ class Transaction extends class Transaction$1 {
|
|
|
21999
22001
|
}
|
|
22000
22002
|
|
|
22001
22003
|
function __PRIVATE_tryGetString(e, t) {
|
|
22002
|
-
if ("string" != typeof e[t]) throw new FirestoreError(
|
|
22004
|
+
if ("string" != typeof e[t]) throw new FirestoreError(D.INVALID_ARGUMENT, "Missing string value for: " + t);
|
|
22003
22005
|
return e[t];
|
|
22004
22006
|
}
|
|
22005
22007
|
|
|
@@ -22042,12 +22044,12 @@ function __PRIVATE_tryGetString(e, t) {
|
|
|
22042
22044
|
*/ function getPersistentCacheIndexManager(e) {
|
|
22043
22045
|
var t;
|
|
22044
22046
|
e = __PRIVATE_cast(e, Firestore);
|
|
22045
|
-
const n =
|
|
22047
|
+
const n = Ce.get(e);
|
|
22046
22048
|
if (n) return n;
|
|
22047
22049
|
const r = ensureFirestoreConfigured(e);
|
|
22048
22050
|
if ("persistent" !== (null === (t = r._uninitializedComponentsProvider) || void 0 === t ? void 0 : t._offlineKind)) return null;
|
|
22049
22051
|
const i = new PersistentCacheIndexManager(r);
|
|
22050
|
-
return
|
|
22052
|
+
return Ce.set(e, i), i;
|
|
22051
22053
|
}
|
|
22052
22054
|
|
|
22053
22055
|
/**
|
|
@@ -22090,7 +22092,7 @@ function __PRIVATE_setPersistentCacheIndexAutoCreationEnabled(e, t) {
|
|
|
22090
22092
|
* Use a `WeakMap` so that the mapping will be automatically dropped when the
|
|
22091
22093
|
* `Firestore` instance is garbage collected. This emulates a private member
|
|
22092
22094
|
* as described in https://goo.gle/454yvug.
|
|
22093
|
-
*/ const
|
|
22095
|
+
*/ const Ce = new WeakMap;
|
|
22094
22096
|
|
|
22095
22097
|
/**
|
|
22096
22098
|
* @license
|
|
@@ -22198,10 +22200,10 @@ function _internalQueryToProtoQueryTarget(e) {
|
|
|
22198
22200
|
this.ku = new Map;
|
|
22199
22201
|
}
|
|
22200
22202
|
static get instance() {
|
|
22201
|
-
return
|
|
22202
|
-
if (
|
|
22203
|
-
|
|
22204
|
-
}(
|
|
22203
|
+
return Fe || (Fe = new __PRIVATE_TestingHooksSpiImpl, function __PRIVATE_setTestingHooksSpi(e) {
|
|
22204
|
+
if (Pe) throw new Error("a TestingHooksSpi instance is already set");
|
|
22205
|
+
Pe = e;
|
|
22206
|
+
}(Fe)), Fe;
|
|
22205
22207
|
}
|
|
22206
22208
|
et(e) {
|
|
22207
22209
|
this.ku.forEach((t => t(e)));
|
|
@@ -22212,7 +22214,7 @@ function _internalQueryToProtoQueryTarget(e) {
|
|
|
22212
22214
|
}
|
|
22213
22215
|
}
|
|
22214
22216
|
|
|
22215
|
-
let
|
|
22217
|
+
let Fe = null;
|
|
22216
22218
|
|
|
22217
22219
|
/**
|
|
22218
22220
|
* Cloud Firestore
|
|
@@ -22220,19 +22222,19 @@ let Me = null;
|
|
|
22220
22222
|
* @packageDocumentation
|
|
22221
22223
|
*/ !function __PRIVATE_registerFirestore(e, t = !0) {
|
|
22222
22224
|
!function __PRIVATE_setSDKVersion(e) {
|
|
22223
|
-
|
|
22225
|
+
S = e;
|
|
22224
22226
|
}(SDK_VERSION), _registerComponent(new Component("firestore", ((e, {instanceIdentifier: n, options: r}) => {
|
|
22225
22227
|
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) {
|
|
22226
|
-
if (!Object.prototype.hasOwnProperty.apply(e.options, [ "projectId" ])) throw new FirestoreError(
|
|
22228
|
+
if (!Object.prototype.hasOwnProperty.apply(e.options, [ "projectId" ])) throw new FirestoreError(D.INVALID_ARGUMENT, '"projectId" not provided in firebase.initializeApp.');
|
|
22227
22229
|
return new DatabaseId(e.options.projectId, t);
|
|
22228
22230
|
}(i, n), i);
|
|
22229
22231
|
return r = Object.assign({
|
|
22230
22232
|
useFetchStreams: t
|
|
22231
22233
|
}, r), s._setSettings(r), s;
|
|
22232
|
-
}), "PUBLIC").setMultipleInstances(!0)), registerVersion(
|
|
22234
|
+
}), "PUBLIC").setMultipleInstances(!0)), registerVersion(w, "4.7.1-canary.ff0475c41", e),
|
|
22233
22235
|
// BUILD_TARGET will be replaced by values like esm5, esm2017, cjs5, etc during the compilation
|
|
22234
|
-
registerVersion(
|
|
22236
|
+
registerVersion(w, "4.7.1-canary.ff0475c41", "esm2017");
|
|
22235
22237
|
}();
|
|
22236
22238
|
|
|
22237
|
-
export { AbstractUserDataWriter, AggregateField, AggregateQuerySnapshot, Bytes,
|
|
22239
|
+
export { AbstractUserDataWriter, AggregateField, AggregateQuerySnapshot, Bytes, Se as CACHE_SIZE_UNLIMITED, CollectionReference, DocumentReference, DocumentSnapshot, FieldPath, FieldValue, Firestore, FirestoreError, GeoPoint, LoadBundleTask, PersistentCacheIndexManager, Query, QueryCompositeFilterConstraint, QueryConstraint, QueryDocumentSnapshot, QueryEndAtConstraint, QueryFieldFilterConstraint, QueryLimitConstraint, QueryOrderByConstraint, QuerySnapshot, QueryStartAtConstraint, SnapshotMetadata, Timestamp, Transaction, VectorValue, WriteBatch, __PRIVATE_AutoId as _AutoId, ByteString as _ByteString, DatabaseId as _DatabaseId, DocumentKey as _DocumentKey, __PRIVATE_EmptyAppCheckTokenProvider as _EmptyAppCheckTokenProvider, __PRIVATE_EmptyAuthCredentialsProvider as _EmptyAuthCredentialsProvider, FieldPath$1 as _FieldPath, TestingHooks as _TestingHooks, __PRIVATE_cast as _cast, __PRIVATE_debugAssert as _debugAssert, _internalAggregationQueryToProtoRunAggregationQueryRequest, _internalQueryToProtoQueryTarget, __PRIVATE_isBase64Available as _isBase64Available, __PRIVATE_logWarn as _logWarn, __PRIVATE_validateIsNotUsedTogether as _validateIsNotUsedTogether, addDoc, aggregateFieldEqual, aggregateQuerySnapshotEqual, and, arrayRemove, arrayUnion, average, clearIndexedDbPersistence, collection, collectionGroup, connectFirestoreEmulator, count, deleteAllPersistentCacheIndexes, deleteDoc, deleteField, disableNetwork, disablePersistentCacheIndexAutoCreation, doc, documentId, enableIndexedDbPersistence, enableMultiTabIndexedDbPersistence, enableNetwork, enablePersistentCacheIndexAutoCreation, endAt, endBefore, ensureFirestoreConfigured, executeWrite, getAggregateFromServer, getCountFromServer, getDoc, getDocFromCache, getDocFromServer, getDocs, getDocsFromCache, getDocsFromServer, getFirestore, getPersistentCacheIndexManager, increment, initializeFirestore, limit, limitToLast, loadBundle, memoryEagerGarbageCollector, memoryLocalCache, memoryLruGarbageCollector, namedQuery, onSnapshot, onSnapshotsInSync, or, orderBy, persistentLocalCache, persistentMultipleTabManager, persistentSingleTabManager, query, queryEqual, refEqual, runTransaction, serverTimestamp, setDoc, setIndexConfiguration, setLogLevel, snapshotEqual, startAfter, startAt, sum, terminate, updateDoc, vector, waitForPendingWrites, where, writeBatch };
|
|
22238
22240
|
//# sourceMappingURL=index.esm2017.js.map
|