@firebase/firestore 4.6.2-canary.8fb372afb → 4.6.2-dataconnect-preview.877f8b7d0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +294 -294
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm2017.js +294 -294
- package/dist/index.esm2017.js.map +1 -1
- package/dist/index.esm5.js +3082 -3082
- package/dist/index.esm5.js.map +1 -1
- package/dist/index.node.cjs.js +2 -2
- package/dist/index.node.mjs +2 -2
- package/dist/index.rn.js +294 -294
- package/dist/index.rn.js.map +1 -1
- package/dist/lite/index.browser.esm2017.js +153 -152
- package/dist/lite/index.browser.esm2017.js.map +1 -1
- package/dist/lite/index.browser.esm5.js +905 -904
- package/dist/lite/index.browser.esm5.js.map +1 -1
- package/dist/lite/index.cjs.js +153 -152
- package/dist/lite/index.cjs.js.map +1 -1
- package/dist/lite/index.node.cjs.js +2 -2
- package/dist/lite/index.node.mjs +2 -2
- package/dist/lite/index.rn.esm2017.js +153 -152
- package/dist/lite/index.rn.esm2017.js.map +1 -1
- package/dist/packages/firestore/dist/index.esm2017.d.ts +2 -2
- package/package.json +9 -9
package/dist/index.esm2017.js
CHANGED
|
@@ -5,7 +5,7 @@ import { FirebaseError, createMockUserToken, getModularInstance, deepEqual, getD
|
|
|
5
5
|
import { Integer, Md5 } from '@firebase/webchannel-wrapper/bloom-blob';
|
|
6
6
|
import { XhrIo, EventType, ErrorCode, createWebChannelTransport, getStatEventTarget, FetchXmlHttpFactory, WebChannel, Event, Stat } from '@firebase/webchannel-wrapper/webchannel-blob';
|
|
7
7
|
|
|
8
|
-
const S = "@firebase/firestore";
|
|
8
|
+
const S = "@firebase/firestore", b = "4.6.2-dataconnect-preview.877f8b7d0";
|
|
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 D = "10.12.0-dataconnect-preview.877f8b7d0";
|
|
71
71
|
|
|
72
72
|
/**
|
|
73
73
|
* @license
|
|
@@ -85,11 +85,11 @@ let b = "10.12.0-canary.8fb372afb";
|
|
|
85
85
|
* See the License for the specific language governing permissions and
|
|
86
86
|
* limitations under the License.
|
|
87
87
|
*/
|
|
88
|
-
const
|
|
88
|
+
const C = 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 C.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
|
+
C.setLogLevel(e);
|
|
109
109
|
}
|
|
110
110
|
|
|
111
111
|
function __PRIVATE_logDebug(e, ...t) {
|
|
112
|
-
if (
|
|
112
|
+
if (C.logLevel <= LogLevel.DEBUG) {
|
|
113
113
|
const n = t.map(__PRIVATE_argToString);
|
|
114
|
-
|
|
114
|
+
C.debug(`Firestore (${D}): ${e}`, ...n);
|
|
115
115
|
}
|
|
116
116
|
}
|
|
117
117
|
|
|
118
118
|
function __PRIVATE_logError(e, ...t) {
|
|
119
|
-
if (
|
|
119
|
+
if (C.logLevel <= LogLevel.ERROR) {
|
|
120
120
|
const n = t.map(__PRIVATE_argToString);
|
|
121
|
-
|
|
121
|
+
C.error(`Firestore (${D}): ${e}`, ...n);
|
|
122
122
|
}
|
|
123
123
|
}
|
|
124
124
|
|
|
125
125
|
/**
|
|
126
126
|
* @internal
|
|
127
127
|
*/ function __PRIVATE_logWarn(e, ...t) {
|
|
128
|
-
if (
|
|
128
|
+
if (C.logLevel <= LogLevel.WARN) {
|
|
129
129
|
const n = t.map(__PRIVATE_argToString);
|
|
130
|
-
|
|
130
|
+
C.warn(`Firestore (${D}): ${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 (${D}) 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 v = {
|
|
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(v.INVALID_ARGUMENT, "Timestamp nanoseconds out of range: " + t);
|
|
790
|
+
if (t >= 1e9) throw new FirestoreError(v.INVALID_ARGUMENT, "Timestamp nanoseconds out of range: " + t);
|
|
791
|
+
if (e < -62135596800) throw new FirestoreError(v.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(v.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(v.INVALID_ARGUMENT, `Invalid segment (${n}). Paths must not contain // in them.`);
|
|
1049
1049
|
// Strip leading and traling 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 F = /^[_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 v = /^[_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 F.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 v = /^[_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(v.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(v.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(v.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(v.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 M = "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 !== v.FAILED_PRECONDITION || e.message !== M) 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(v.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(v.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(v.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 x = !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 x || (x = !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 O = [ "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 N = {}, L = [ "prefixPath", "collectionGroup", "readTime", "documentId" ], B = [ "prefixPath", "collectionGroup", "documentId" ], k = [ "collectionGroup", "readTime", "prefixPath", "documentId" ], q = [ "canonicalId", "targetId" ], Q = [ "targetId", "path" ], K = [ "path", "targetId" ], $ = [ "collectionId", "parent" ], U = [ "indexId", "uid" ], W = [ "uid", "sequenceNumber" ], G = [ "indexId", "uid", "arrayValue", "directionalValue", "orderedDocumentKey", "documentKey" ], z = [ "indexId", "uid", "orderedDocumentKey" ], j = [ "userId", "collectionPath", "documentId" ], H = [ "userId", "collectionPath", "largestBatchId" ], J = [ "userId", "collectionGroup", "largestBatchId" ], Y = [ ...[ ...[ ...[ ...[ "mutationQueues", "mutations", "documentMutations", "remoteDocuments", "targets", "owner", "targetGlobal", "targetDocuments" ], "clientMetadata" ], "remoteDocumentGlobal" ], "collectionParents" ], "bundles", "namedQueries" ], Z = [ ...Y, "documentOverlays" ], X = [ "mutationQueues", "mutations", "documentMutations", "remoteDocumentsV14", "targets", "owner", "targetGlobal", "targetDocuments", "clientMetadata", "remoteDocumentGlobal", "collectionParents", "bundles", "namedQueries", "documentOverlays" ], ee = X, te = [ ...ee, "indexConfiguration", "indexState", "indexEntries" ], ne = te;
|
|
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 re = 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 ne = 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 = re.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 ie = {
|
|
3249
3249
|
mapValue: {
|
|
3250
3250
|
fields: {
|
|
3251
3251
|
__type__: {
|
|
@@ -3253,7 +3253,7 @@ const re = {
|
|
|
3253
3253
|
}
|
|
3254
3254
|
}
|
|
3255
3255
|
}
|
|
3256
|
-
},
|
|
3256
|
+
}, se = {
|
|
3257
3257
|
nullValue: "NULL_VALUE"
|
|
3258
3258
|
};
|
|
3259
3259
|
|
|
@@ -3397,9 +3397,9 @@ function __PRIVATE_valueCompare(e, t) {
|
|
|
3397
3397
|
|
|
3398
3398
|
case 10 /* TypeOrder.ObjectValue */ :
|
|
3399
3399
|
return function __PRIVATE_compareMaps(e, t) {
|
|
3400
|
-
if (e ===
|
|
3401
|
-
if (e ===
|
|
3402
|
-
if (t ===
|
|
3400
|
+
if (e === ie.mapValue && t === ie.mapValue) return 0;
|
|
3401
|
+
if (e === ie.mapValue) return 1;
|
|
3402
|
+
if (t === ie.mapValue) return -1;
|
|
3403
3403
|
const n = e.fields || {}, r = Object.keys(n), i = t.fields || {}, s = Object.keys(i);
|
|
3404
3404
|
// Even though MapValues are likely sorted correctly based on their insertion
|
|
3405
3405
|
// order (e.g. when received from the backend), local modifications can bring
|
|
@@ -3575,7 +3575,7 @@ function isArray(e) {
|
|
|
3575
3575
|
}
|
|
3576
3576
|
|
|
3577
3577
|
/** Returns the lowest value for the given value type (inclusive). */ function __PRIVATE_valuesGetLowerBound(e) {
|
|
3578
|
-
return "nullValue" in e ?
|
|
3578
|
+
return "nullValue" in e ? se : "booleanValue" in e ? {
|
|
3579
3579
|
booleanValue: !1
|
|
3580
3580
|
} : "integerValue" in e || "doubleValue" in e ? {
|
|
3581
3581
|
doubleValue: NaN
|
|
@@ -3621,7 +3621,7 @@ function isArray(e) {
|
|
|
3621
3621
|
arrayValue: {}
|
|
3622
3622
|
} : "arrayValue" in e ? {
|
|
3623
3623
|
mapValue: {}
|
|
3624
|
-
} : "mapValue" in e ?
|
|
3624
|
+
} : "mapValue" in e ? ie : fail();
|
|
3625
3625
|
}
|
|
3626
3626
|
|
|
3627
3627
|
function __PRIVATE_lowerBoundCompare(e, t) {
|
|
@@ -4309,10 +4309,10 @@ function __PRIVATE_targetIsDocumentTarget(e) {
|
|
|
4309
4309
|
* the provided `fieldPath` (or the upper bound for an descending segment).
|
|
4310
4310
|
*/
|
|
4311
4311
|
function __PRIVATE_targetGetAscendingBound(e, t, n) {
|
|
4312
|
-
let r =
|
|
4312
|
+
let r = se, i = !0;
|
|
4313
4313
|
// Process all filters to find a value for the current field segment
|
|
4314
4314
|
for (const n of __PRIVATE_targetGetFieldFiltersForPath(e, t)) {
|
|
4315
|
-
let e =
|
|
4315
|
+
let e = se, t = !0;
|
|
4316
4316
|
switch (n.op) {
|
|
4317
4317
|
case "<" /* Operator.LESS_THAN */ :
|
|
4318
4318
|
case "<=" /* Operator.LESS_THAN_OR_EQUAL */ :
|
|
@@ -4331,7 +4331,7 @@ function __PRIVATE_targetGetAscendingBound(e, t, n) {
|
|
|
4331
4331
|
|
|
4332
4332
|
case "!=" /* Operator.NOT_EQUAL */ :
|
|
4333
4333
|
case "not-in" /* Operator.NOT_IN */ :
|
|
4334
|
-
e =
|
|
4334
|
+
e = se;
|
|
4335
4335
|
// Remaining filters cannot be used as lower bounds.
|
|
4336
4336
|
}
|
|
4337
4337
|
__PRIVATE_lowerBoundCompare({
|
|
@@ -4367,10 +4367,10 @@ function __PRIVATE_targetGetAscendingBound(e, t, n) {
|
|
|
4367
4367
|
* Returns the value to use as the upper bound for ascending index segment at
|
|
4368
4368
|
* the provided `fieldPath` (or the lower bound for a descending segment).
|
|
4369
4369
|
*/ function __PRIVATE_targetGetDescendingBound(e, t, n) {
|
|
4370
|
-
let r =
|
|
4370
|
+
let r = ie, i = !0;
|
|
4371
4371
|
// Process all filters to find a value for the current field segment
|
|
4372
4372
|
for (const n of __PRIVATE_targetGetFieldFiltersForPath(e, t)) {
|
|
4373
|
-
let e =
|
|
4373
|
+
let e = ie, t = !0;
|
|
4374
4374
|
switch (n.op) {
|
|
4375
4375
|
case ">=" /* Operator.GREATER_THAN_OR_EQUAL */ :
|
|
4376
4376
|
case ">" /* Operator.GREATER_THAN */ :
|
|
@@ -4389,7 +4389,7 @@ function __PRIVATE_targetGetAscendingBound(e, t, n) {
|
|
|
4389
4389
|
|
|
4390
4390
|
case "!=" /* Operator.NOT_EQUAL */ :
|
|
4391
4391
|
case "not-in" /* Operator.NOT_IN */ :
|
|
4392
|
-
e =
|
|
4392
|
+
e = ie;
|
|
4393
4393
|
// Remaining filters cannot be used as upper bounds.
|
|
4394
4394
|
}
|
|
4395
4395
|
__PRIVATE_upperBoundCompare({
|
|
@@ -4773,22 +4773,22 @@ function __PRIVATE_compareDocs(e, t, n) {
|
|
|
4773
4773
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
4774
4774
|
* See the License for the specific language governing permissions and
|
|
4775
4775
|
* limitations under the License.
|
|
4776
|
-
*/ const
|
|
4776
|
+
*/ const oe = new SortedMap(DocumentKey.comparator);
|
|
4777
4777
|
|
|
4778
4778
|
function __PRIVATE_mutableDocumentMap() {
|
|
4779
|
-
return
|
|
4779
|
+
return oe;
|
|
4780
4780
|
}
|
|
4781
4781
|
|
|
4782
|
-
const
|
|
4782
|
+
const _e = new SortedMap(DocumentKey.comparator);
|
|
4783
4783
|
|
|
4784
4784
|
function documentMap(...e) {
|
|
4785
|
-
let t =
|
|
4785
|
+
let t = _e;
|
|
4786
4786
|
for (const n of e) t = t.insert(n.key, n);
|
|
4787
4787
|
return t;
|
|
4788
4788
|
}
|
|
4789
4789
|
|
|
4790
4790
|
function __PRIVATE_convertOverlayedDocumentMapToDocumentMap(e) {
|
|
4791
|
-
let t =
|
|
4791
|
+
let t = _e;
|
|
4792
4792
|
return e.forEach(((e, n) => t = t.insert(e, n.overlayedDocument))), t;
|
|
4793
4793
|
}
|
|
4794
4794
|
|
|
@@ -4804,20 +4804,20 @@ function __PRIVATE_newDocumentKeyMap() {
|
|
|
4804
4804
|
return new ObjectMap((e => e.toString()), ((e, t) => e.isEqual(t)));
|
|
4805
4805
|
}
|
|
4806
4806
|
|
|
4807
|
-
const
|
|
4807
|
+
const ae = new SortedMap(DocumentKey.comparator);
|
|
4808
4808
|
|
|
4809
|
-
const
|
|
4809
|
+
const ue = new SortedSet(DocumentKey.comparator);
|
|
4810
4810
|
|
|
4811
4811
|
function __PRIVATE_documentKeySet(...e) {
|
|
4812
|
-
let t =
|
|
4812
|
+
let t = ue;
|
|
4813
4813
|
for (const n of e) t = t.add(n);
|
|
4814
4814
|
return t;
|
|
4815
4815
|
}
|
|
4816
4816
|
|
|
4817
|
-
const
|
|
4817
|
+
const ce = new SortedSet(__PRIVATE_primitiveComparator);
|
|
4818
4818
|
|
|
4819
4819
|
function __PRIVATE_targetIdSet() {
|
|
4820
|
-
return
|
|
4820
|
+
return ce;
|
|
4821
4821
|
}
|
|
4822
4822
|
|
|
4823
4823
|
/**
|
|
@@ -5508,7 +5508,7 @@ class __PRIVATE_VerifyMutation extends Mutation {
|
|
|
5508
5508
|
*/ static from(e, t, n) {
|
|
5509
5509
|
__PRIVATE_hardAssert(e.mutations.length === n.length);
|
|
5510
5510
|
let r = function __PRIVATE_documentVersionMap() {
|
|
5511
|
-
return
|
|
5511
|
+
return ae;
|
|
5512
5512
|
}();
|
|
5513
5513
|
const i = e.mutations;
|
|
5514
5514
|
for (let e = 0; e < i.length; e++) r = r.insert(i[e].key, n[e].version);
|
|
@@ -5622,7 +5622,7 @@ class __PRIVATE_VerifyMutation extends Mutation {
|
|
|
5622
5622
|
* Important! The names of these identifiers matter because the string forms
|
|
5623
5623
|
* are used for reverse lookups from the webchannel stream. Do NOT change the
|
|
5624
5624
|
* names of these identifiers or change this into a const enum.
|
|
5625
|
-
*/ var
|
|
5625
|
+
*/ var le, he;
|
|
5626
5626
|
|
|
5627
5627
|
/**
|
|
5628
5628
|
* Determines whether an error code represents a permanent error when received
|
|
@@ -5635,29 +5635,29 @@ function __PRIVATE_isPermanentError(e) {
|
|
|
5635
5635
|
default:
|
|
5636
5636
|
return fail();
|
|
5637
5637
|
|
|
5638
|
-
case
|
|
5639
|
-
case
|
|
5640
|
-
case
|
|
5641
|
-
case
|
|
5642
|
-
case
|
|
5643
|
-
case
|
|
5638
|
+
case v.CANCELLED:
|
|
5639
|
+
case v.UNKNOWN:
|
|
5640
|
+
case v.DEADLINE_EXCEEDED:
|
|
5641
|
+
case v.RESOURCE_EXHAUSTED:
|
|
5642
|
+
case v.INTERNAL:
|
|
5643
|
+
case v.UNAVAILABLE:
|
|
5644
5644
|
// Unauthenticated means something went wrong with our token and we need
|
|
5645
5645
|
// to retry with new credentials which will happen automatically.
|
|
5646
|
-
case
|
|
5646
|
+
case v.UNAUTHENTICATED:
|
|
5647
5647
|
return !1;
|
|
5648
5648
|
|
|
5649
|
-
case
|
|
5650
|
-
case
|
|
5651
|
-
case
|
|
5652
|
-
case
|
|
5653
|
-
case
|
|
5649
|
+
case v.INVALID_ARGUMENT:
|
|
5650
|
+
case v.NOT_FOUND:
|
|
5651
|
+
case v.ALREADY_EXISTS:
|
|
5652
|
+
case v.PERMISSION_DENIED:
|
|
5653
|
+
case v.FAILED_PRECONDITION:
|
|
5654
5654
|
// Aborted might be retried in some scenarios, but that is dependant on
|
|
5655
5655
|
// the context and should handled individually by the calling code.
|
|
5656
5656
|
// See https://cloud.google.com/apis/design/errors.
|
|
5657
|
-
case
|
|
5658
|
-
case
|
|
5659
|
-
case
|
|
5660
|
-
case
|
|
5657
|
+
case v.ABORTED:
|
|
5658
|
+
case v.OUT_OF_RANGE:
|
|
5659
|
+
case v.UNIMPLEMENTED:
|
|
5660
|
+
case v.DATA_LOSS:
|
|
5661
5661
|
return !0;
|
|
5662
5662
|
}
|
|
5663
5663
|
}
|
|
@@ -5685,58 +5685,58 @@ function __PRIVATE_mapCodeFromRpcCode(e) {
|
|
|
5685
5685
|
if (void 0 === e)
|
|
5686
5686
|
// This shouldn't normally happen, but in certain error cases (like trying
|
|
5687
5687
|
// to send invalid proto messages) we may get an error with no GRPC code.
|
|
5688
|
-
return __PRIVATE_logError("GRPC error has no .code"),
|
|
5688
|
+
return __PRIVATE_logError("GRPC error has no .code"), v.UNKNOWN;
|
|
5689
5689
|
switch (e) {
|
|
5690
|
-
case
|
|
5691
|
-
return
|
|
5690
|
+
case le.OK:
|
|
5691
|
+
return v.OK;
|
|
5692
5692
|
|
|
5693
|
-
case
|
|
5694
|
-
return
|
|
5693
|
+
case le.CANCELLED:
|
|
5694
|
+
return v.CANCELLED;
|
|
5695
5695
|
|
|
5696
|
-
case
|
|
5697
|
-
return
|
|
5696
|
+
case le.UNKNOWN:
|
|
5697
|
+
return v.UNKNOWN;
|
|
5698
5698
|
|
|
5699
|
-
case
|
|
5700
|
-
return
|
|
5699
|
+
case le.DEADLINE_EXCEEDED:
|
|
5700
|
+
return v.DEADLINE_EXCEEDED;
|
|
5701
5701
|
|
|
5702
|
-
case
|
|
5703
|
-
return
|
|
5702
|
+
case le.RESOURCE_EXHAUSTED:
|
|
5703
|
+
return v.RESOURCE_EXHAUSTED;
|
|
5704
5704
|
|
|
5705
|
-
case
|
|
5706
|
-
return
|
|
5705
|
+
case le.INTERNAL:
|
|
5706
|
+
return v.INTERNAL;
|
|
5707
5707
|
|
|
5708
|
-
case
|
|
5709
|
-
return
|
|
5708
|
+
case le.UNAVAILABLE:
|
|
5709
|
+
return v.UNAVAILABLE;
|
|
5710
5710
|
|
|
5711
|
-
case
|
|
5712
|
-
return
|
|
5711
|
+
case le.UNAUTHENTICATED:
|
|
5712
|
+
return v.UNAUTHENTICATED;
|
|
5713
5713
|
|
|
5714
|
-
case
|
|
5715
|
-
return
|
|
5714
|
+
case le.INVALID_ARGUMENT:
|
|
5715
|
+
return v.INVALID_ARGUMENT;
|
|
5716
5716
|
|
|
5717
|
-
case
|
|
5718
|
-
return
|
|
5717
|
+
case le.NOT_FOUND:
|
|
5718
|
+
return v.NOT_FOUND;
|
|
5719
5719
|
|
|
5720
|
-
case
|
|
5721
|
-
return
|
|
5720
|
+
case le.ALREADY_EXISTS:
|
|
5721
|
+
return v.ALREADY_EXISTS;
|
|
5722
5722
|
|
|
5723
|
-
case
|
|
5724
|
-
return
|
|
5723
|
+
case le.PERMISSION_DENIED:
|
|
5724
|
+
return v.PERMISSION_DENIED;
|
|
5725
5725
|
|
|
5726
|
-
case
|
|
5727
|
-
return
|
|
5726
|
+
case le.FAILED_PRECONDITION:
|
|
5727
|
+
return v.FAILED_PRECONDITION;
|
|
5728
5728
|
|
|
5729
|
-
case
|
|
5730
|
-
return
|
|
5729
|
+
case le.ABORTED:
|
|
5730
|
+
return v.ABORTED;
|
|
5731
5731
|
|
|
5732
|
-
case
|
|
5733
|
-
return
|
|
5732
|
+
case le.OUT_OF_RANGE:
|
|
5733
|
+
return v.OUT_OF_RANGE;
|
|
5734
5734
|
|
|
5735
|
-
case
|
|
5736
|
-
return
|
|
5735
|
+
case le.UNIMPLEMENTED:
|
|
5736
|
+
return v.UNIMPLEMENTED;
|
|
5737
5737
|
|
|
5738
|
-
case
|
|
5739
|
-
return
|
|
5738
|
+
case le.DATA_LOSS:
|
|
5739
|
+
return v.DATA_LOSS;
|
|
5740
5740
|
|
|
5741
5741
|
default:
|
|
5742
5742
|
return fail();
|
|
@@ -5750,14 +5750,14 @@ function __PRIVATE_mapCodeFromRpcCode(e) {
|
|
|
5750
5750
|
* "UNKNOWN", etc.)
|
|
5751
5751
|
* @returns The equivalent Code. Non-matching responses are mapped to
|
|
5752
5752
|
* Code.UNKNOWN.
|
|
5753
|
-
*/ (
|
|
5754
|
-
|
|
5755
|
-
|
|
5756
|
-
|
|
5757
|
-
|
|
5758
|
-
|
|
5759
|
-
|
|
5760
|
-
|
|
5753
|
+
*/ (he = le || (le = {}))[he.OK = 0] = "OK", he[he.CANCELLED = 1] = "CANCELLED",
|
|
5754
|
+
he[he.UNKNOWN = 2] = "UNKNOWN", he[he.INVALID_ARGUMENT = 3] = "INVALID_ARGUMENT",
|
|
5755
|
+
he[he.DEADLINE_EXCEEDED = 4] = "DEADLINE_EXCEEDED", he[he.NOT_FOUND = 5] = "NOT_FOUND",
|
|
5756
|
+
he[he.ALREADY_EXISTS = 6] = "ALREADY_EXISTS", he[he.PERMISSION_DENIED = 7] = "PERMISSION_DENIED",
|
|
5757
|
+
he[he.UNAUTHENTICATED = 16] = "UNAUTHENTICATED", he[he.RESOURCE_EXHAUSTED = 8] = "RESOURCE_EXHAUSTED",
|
|
5758
|
+
he[he.FAILED_PRECONDITION = 9] = "FAILED_PRECONDITION", he[he.ABORTED = 10] = "ABORTED",
|
|
5759
|
+
he[he.OUT_OF_RANGE = 11] = "OUT_OF_RANGE", he[he.UNIMPLEMENTED = 12] = "UNIMPLEMENTED",
|
|
5760
|
+
he[he.INTERNAL = 13] = "INTERNAL", he[he.UNAVAILABLE = 14] = "UNAVAILABLE", he[he.DATA_LOSS = 15] = "DATA_LOSS";
|
|
5761
5761
|
|
|
5762
5762
|
/**
|
|
5763
5763
|
* @license
|
|
@@ -5782,7 +5782,7 @@ le[le.INTERNAL = 13] = "INTERNAL", le[le.UNAVAILABLE = 14] = "UNAVAILABLE", le[l
|
|
|
5782
5782
|
* integration tests that have registered callbacks to be notified of events
|
|
5783
5783
|
* that happen during the test execution.
|
|
5784
5784
|
*/
|
|
5785
|
-
let
|
|
5785
|
+
let Pe = null;
|
|
5786
5786
|
|
|
5787
5787
|
/**
|
|
5788
5788
|
* Sets the value of the `testingHooksSpi` object.
|
|
@@ -5830,7 +5830,7 @@ function __PRIVATE_newTextEncoder() {
|
|
|
5830
5830
|
* See the License for the specific language governing permissions and
|
|
5831
5831
|
* limitations under the License.
|
|
5832
5832
|
*/
|
|
5833
|
-
const
|
|
5833
|
+
const Ie = new Integer([ 4294967295, 4294967295 ], 0);
|
|
5834
5834
|
|
|
5835
5835
|
// Hash a string using md5 hashing algorithm.
|
|
5836
5836
|
function __PRIVATE_getMd5HashValue(e) {
|
|
@@ -5865,7 +5865,7 @@ class BloomFilter {
|
|
|
5865
5865
|
// Calculate hashed value h(i) = h1 + (i * h2).
|
|
5866
5866
|
let r = e.add(t.multiply(Integer.fromNumber(n)));
|
|
5867
5867
|
// Wrap if hash value overflow 64bit.
|
|
5868
|
-
return 1 === r.compare(
|
|
5868
|
+
return 1 === r.compare(Ie) && (r = new Integer([ r.getBits(0), r.getBits(1) ], 0)),
|
|
5869
5869
|
r.modulo(this.Te).toNumber();
|
|
5870
5870
|
}
|
|
5871
5871
|
// Return whether the bit on the given index in the bitmap is set to 1.
|
|
@@ -6283,7 +6283,7 @@ class __PRIVATE_WatchChangeAggregator {
|
|
|
6283
6283
|
const e = 2 /* BloomFilterApplicationStatus.FalsePositive */ === i ? "TargetPurposeExistenceFilterMismatchBloom" /* TargetPurpose.ExistenceFilterMismatchBloom */ : "TargetPurposeExistenceFilterMismatch" /* TargetPurpose.ExistenceFilterMismatch */;
|
|
6284
6284
|
this.Qe = this.Qe.insert(t, e);
|
|
6285
6285
|
}
|
|
6286
|
-
null ==
|
|
6286
|
+
null == Pe || Pe.et(function __PRIVATE_createExistenceFilterMismatchInfoForTestingHooks(e, t, n, r, i) {
|
|
6287
6287
|
var s, o, _, a, u, c;
|
|
6288
6288
|
const l = {
|
|
6289
6289
|
localCacheCount: e,
|
|
@@ -6499,13 +6499,13 @@ function __PRIVATE_snapshotChangesMap() {
|
|
|
6499
6499
|
return new SortedMap(DocumentKey.comparator);
|
|
6500
6500
|
}
|
|
6501
6501
|
|
|
6502
|
-
const
|
|
6502
|
+
const Te = (() => {
|
|
6503
6503
|
const e = {
|
|
6504
6504
|
asc: "ASCENDING",
|
|
6505
6505
|
desc: "DESCENDING"
|
|
6506
6506
|
};
|
|
6507
6507
|
return e;
|
|
6508
|
-
})(),
|
|
6508
|
+
})(), Ee = (() => {
|
|
6509
6509
|
const e = {
|
|
6510
6510
|
"<": "LESS_THAN",
|
|
6511
6511
|
"<=": "LESS_THAN_OR_EQUAL",
|
|
@@ -6519,7 +6519,7 @@ const Ie = (() => {
|
|
|
6519
6519
|
"array-contains-any": "ARRAY_CONTAINS_ANY"
|
|
6520
6520
|
};
|
|
6521
6521
|
return e;
|
|
6522
|
-
})(),
|
|
6522
|
+
})(), de = (() => {
|
|
6523
6523
|
const e = {
|
|
6524
6524
|
and: "AND",
|
|
6525
6525
|
or: "OR"
|
|
@@ -6621,8 +6621,8 @@ function __PRIVATE_toName(e, t) {
|
|
|
6621
6621
|
|
|
6622
6622
|
function fromName(e, t) {
|
|
6623
6623
|
const n = __PRIVATE_fromResourceName(t);
|
|
6624
|
-
if (n.get(1) !== e.databaseId.projectId) throw new FirestoreError(
|
|
6625
|
-
if (n.get(3) !== e.databaseId.database) throw new FirestoreError(
|
|
6624
|
+
if (n.get(1) !== e.databaseId.projectId) throw new FirestoreError(v.INVALID_ARGUMENT, "Tried to deserialize key from different project: " + n.get(1) + " vs " + e.databaseId.projectId);
|
|
6625
|
+
if (n.get(3) !== e.databaseId.database) throw new FirestoreError(v.INVALID_ARGUMENT, "Tried to deserialize key from different database: " + n.get(3) + " vs " + e.databaseId.database);
|
|
6626
6626
|
return new DocumentKey(__PRIVATE_extractLocalPathFromResourceName(n));
|
|
6627
6627
|
}
|
|
6628
6628
|
|
|
@@ -6696,7 +6696,7 @@ function __PRIVATE_fromWatchChange(e, t) {
|
|
|
6696
6696
|
// does not indicate that it extends Uint8Array.
|
|
6697
6697
|
t instanceof Buffer || t instanceof Uint8Array), ByteString.fromUint8Array(t || new Uint8Array));
|
|
6698
6698
|
}(e, t.targetChange.resumeToken), o = t.targetChange.cause, _ = o && function __PRIVATE_fromRpcStatus(e) {
|
|
6699
|
-
const t = void 0 === e.code ?
|
|
6699
|
+
const t = void 0 === e.code ? v.UNKNOWN : __PRIVATE_mapCodeFromRpcCode(e.code);
|
|
6700
6700
|
return new FirestoreError(t, e.message || "");
|
|
6701
6701
|
}(o);
|
|
6702
6702
|
n = new __PRIVATE_WatchTargetChange(r, i, s, _ || null);
|
|
@@ -7091,15 +7091,15 @@ function __PRIVATE_fromFilter(e) {
|
|
|
7091
7091
|
}
|
|
7092
7092
|
|
|
7093
7093
|
function __PRIVATE_toDirection(e) {
|
|
7094
|
-
return
|
|
7094
|
+
return Te[e];
|
|
7095
7095
|
}
|
|
7096
7096
|
|
|
7097
7097
|
function __PRIVATE_toOperatorName(e) {
|
|
7098
|
-
return
|
|
7098
|
+
return Ee[e];
|
|
7099
7099
|
}
|
|
7100
7100
|
|
|
7101
7101
|
function __PRIVATE_toCompositeOperatorName(e) {
|
|
7102
|
-
return
|
|
7102
|
+
return de[e];
|
|
7103
7103
|
}
|
|
7104
7104
|
|
|
7105
7105
|
function __PRIVATE_toFieldPathReference(e) {
|
|
@@ -8421,7 +8421,7 @@ function __PRIVATE_applyDistributionFieldAndCompositeFilters(e, t) {
|
|
|
8421
8421
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
8422
8422
|
* See the License for the specific language governing permissions and
|
|
8423
8423
|
* limitations under the License.
|
|
8424
|
-
*/ const
|
|
8424
|
+
*/ const Ae = new Uint8Array(0);
|
|
8425
8425
|
|
|
8426
8426
|
/**
|
|
8427
8427
|
* A persisted implementation of IndexManager.
|
|
@@ -8635,7 +8635,7 @@ class __PRIVATE_IndexedDbIndexManager {
|
|
|
8635
8635
|
// combined with the values from the query bounds.
|
|
8636
8636
|
const _ = (null != t ? t.length : 1) * Math.max(n.length, i.length), a = _ / (null != t ? t.length : 1), u = [];
|
|
8637
8637
|
for (let c = 0; c < _; ++c) {
|
|
8638
|
-
const _ = t ? this.Tn(t[c / a]) :
|
|
8638
|
+
const _ = t ? this.Tn(t[c / a]) : Ae, l = this.En(e, _, n[c % a], r), h = this.dn(e, _, i[c % a], s), P = o.map((t => this.En(e, _, t,
|
|
8639
8639
|
/* inclusive= */ !0)));
|
|
8640
8640
|
u.push(...this.createRange(l, h, P));
|
|
8641
8641
|
}
|
|
@@ -8832,7 +8832,7 @@ class __PRIVATE_IndexedDbIndexManager {
|
|
|
8832
8832
|
if (null != i) {
|
|
8833
8833
|
const s = e.data.field(i.fieldPath);
|
|
8834
8834
|
if (isArray(s)) for (const i of s.arrayValue.values || []) n = n.add(new __PRIVATE_IndexEntry(t.indexId, e.key, this.Tn(i), r));
|
|
8835
|
-
} else n = n.add(new __PRIVATE_IndexEntry(t.indexId, e.key,
|
|
8835
|
+
} else n = n.add(new __PRIVATE_IndexEntry(t.indexId, e.key, Ae, r));
|
|
8836
8836
|
return n;
|
|
8837
8837
|
}
|
|
8838
8838
|
/**
|
|
@@ -8907,7 +8907,7 @@ class __PRIVATE_IndexedDbIndexManager {
|
|
|
8907
8907
|
// If we encounter two bounds that will create an unmatchable key range,
|
|
8908
8908
|
// then we return an empty set of key ranges.
|
|
8909
8909
|
if (this.Dn(r[e], r[e + 1])) return [];
|
|
8910
|
-
const t = [ r[e].indexId, this.uid, r[e].arrayValue, r[e].directionalValue,
|
|
8910
|
+
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, [] ];
|
|
8911
8911
|
i.push(IDBKeyRange.bound(t, n));
|
|
8912
8912
|
}
|
|
8913
8913
|
return i;
|
|
@@ -8975,7 +8975,7 @@ function __PRIVATE_getMinOffsetFromFieldIndexes(e) {
|
|
|
8975
8975
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
8976
8976
|
* See the License for the specific language governing permissions and
|
|
8977
8977
|
* limitations under the License.
|
|
8978
|
-
*/ const
|
|
8978
|
+
*/ const Re = {
|
|
8979
8979
|
didRun: !1,
|
|
8980
8980
|
sequenceNumbersCollected: 0,
|
|
8981
8981
|
targetsRemoved: 0,
|
|
@@ -9139,7 +9139,7 @@ class __PRIVATE_IndexedDbMutationQueue {
|
|
|
9139
9139
|
let c = new SortedSet(((e, t) => __PRIVATE_primitiveComparator(e.canonicalString(), t.canonicalString())));
|
|
9140
9140
|
for (const e of r) {
|
|
9141
9141
|
const t = __PRIVATE_newDbDocumentMutationKey(this.userId, e.key.path, o);
|
|
9142
|
-
c = c.add(e.key.path.popLast()), u.push(s.put(a)), u.push(i.put(t,
|
|
9142
|
+
c = c.add(e.key.path.popLast()), u.push(s.put(a)), u.push(i.put(t, N));
|
|
9143
9143
|
}
|
|
9144
9144
|
return c.forEach((t => {
|
|
9145
9145
|
u.push(this.indexManager.addToCollectionParentIndex(e, t));
|
|
@@ -9708,8 +9708,8 @@ class __PRIVATE_TargetIdGenerator {
|
|
|
9708
9708
|
}
|
|
9709
9709
|
collect(e, t) {
|
|
9710
9710
|
return -1 === this.params.cacheSizeCollectionThreshold ? (__PRIVATE_logDebug("LruGarbageCollector", "Garbage collection skipped; disabled"),
|
|
9711
|
-
PersistencePromise.resolve(
|
|
9712
|
-
|
|
9711
|
+
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}`),
|
|
9712
|
+
Re) : this.Yn(e, t)));
|
|
9713
9713
|
}
|
|
9714
9714
|
getCacheSize(e) {
|
|
9715
9715
|
return this.jn.getCacheSize(e);
|
|
@@ -11469,7 +11469,7 @@ class __PRIVATE_MemoryLruDelegate {
|
|
|
11469
11469
|
e.createObjectStore("mutations", {
|
|
11470
11470
|
keyPath: "batchId",
|
|
11471
11471
|
autoIncrement: !0
|
|
11472
|
-
}).createIndex("userMutationsIndex",
|
|
11472
|
+
}).createIndex("userMutationsIndex", O, {
|
|
11473
11473
|
unique: !0
|
|
11474
11474
|
}), e.createObjectStore("documentMutations");
|
|
11475
11475
|
}
|
|
@@ -11514,7 +11514,7 @@ class __PRIVATE_MemoryLruDelegate {
|
|
|
11514
11514
|
e.createObjectStore("mutations", {
|
|
11515
11515
|
keyPath: "batchId",
|
|
11516
11516
|
autoIncrement: !0
|
|
11517
|
-
}).createIndex("userMutationsIndex",
|
|
11517
|
+
}).createIndex("userMutationsIndex", O, {
|
|
11518
11518
|
unique: !0
|
|
11519
11519
|
});
|
|
11520
11520
|
const r = t.store("mutations"), i = n.map((e => r.put(e)));
|
|
@@ -11551,19 +11551,19 @@ class __PRIVATE_MemoryLruDelegate {
|
|
|
11551
11551
|
}))), n < 12 && r >= 12 && (s = s.next((() => {
|
|
11552
11552
|
!function __PRIVATE_createDocumentOverlayStore(e) {
|
|
11553
11553
|
const t = e.createObjectStore("documentOverlays", {
|
|
11554
|
-
keyPath:
|
|
11554
|
+
keyPath: j
|
|
11555
11555
|
});
|
|
11556
|
-
t.createIndex("collectionPathOverlayIndex",
|
|
11556
|
+
t.createIndex("collectionPathOverlayIndex", H, {
|
|
11557
11557
|
unique: !1
|
|
11558
|
-
}), t.createIndex("collectionGroupOverlayIndex",
|
|
11558
|
+
}), t.createIndex("collectionGroupOverlayIndex", J, {
|
|
11559
11559
|
unique: !1
|
|
11560
11560
|
});
|
|
11561
11561
|
}(e);
|
|
11562
11562
|
}))), n < 13 && r >= 13 && (s = s.next((() => function __PRIVATE_createRemoteDocumentCache(e) {
|
|
11563
11563
|
const t = e.createObjectStore("remoteDocumentsV14", {
|
|
11564
|
-
keyPath:
|
|
11564
|
+
keyPath: L
|
|
11565
11565
|
});
|
|
11566
|
-
t.createIndex("documentKeyIndex",
|
|
11566
|
+
t.createIndex("documentKeyIndex", B), t.createIndex("collectionGroupIndex", k);
|
|
11567
11567
|
}(e))).next((() => this.ii(e, i))).next((() => e.deleteObjectStore("remoteDocuments")))),
|
|
11568
11568
|
n < 14 && r >= 14 && (s = s.next((() => this.si(e, i)))), n < 15 && r >= 15 && (s = s.next((() => function __PRIVATE_createFieldIndex(e) {
|
|
11569
11569
|
e.createObjectStore("indexConfiguration", {
|
|
@@ -11573,13 +11573,13 @@ class __PRIVATE_MemoryLruDelegate {
|
|
|
11573
11573
|
unique: !1
|
|
11574
11574
|
});
|
|
11575
11575
|
e.createObjectStore("indexState", {
|
|
11576
|
-
keyPath:
|
|
11577
|
-
}).createIndex("sequenceNumberIndex",
|
|
11576
|
+
keyPath: U
|
|
11577
|
+
}).createIndex("sequenceNumberIndex", W, {
|
|
11578
11578
|
unique: !1
|
|
11579
11579
|
});
|
|
11580
11580
|
e.createObjectStore("indexEntries", {
|
|
11581
|
-
keyPath:
|
|
11582
|
-
}).createIndex("documentKeyIndex",
|
|
11581
|
+
keyPath: G
|
|
11582
|
+
}).createIndex("documentKeyIndex", z, {
|
|
11583
11583
|
unique: !1
|
|
11584
11584
|
});
|
|
11585
11585
|
}(e)))), n < 16 && r >= 16 && (
|
|
@@ -11634,7 +11634,7 @@ class __PRIVATE_MemoryLruDelegate {
|
|
|
11634
11634
|
ni(e, t) {
|
|
11635
11635
|
// Create the index.
|
|
11636
11636
|
e.createObjectStore("collectionParents", {
|
|
11637
|
-
keyPath:
|
|
11637
|
+
keyPath: $
|
|
11638
11638
|
});
|
|
11639
11639
|
const n = t.store("collectionParents"), r = new __PRIVATE_MemoryCollectionParentIndex, addEntry = e => {
|
|
11640
11640
|
if (r.add(e)) {
|
|
@@ -11719,19 +11719,19 @@ class __PRIVATE_MemoryLruDelegate {
|
|
|
11719
11719
|
|
|
11720
11720
|
function __PRIVATE_createQueryCache(e) {
|
|
11721
11721
|
e.createObjectStore("targetDocuments", {
|
|
11722
|
-
keyPath:
|
|
11723
|
-
}).createIndex("documentTargetsIndex",
|
|
11722
|
+
keyPath: Q
|
|
11723
|
+
}).createIndex("documentTargetsIndex", K, {
|
|
11724
11724
|
unique: !0
|
|
11725
11725
|
});
|
|
11726
11726
|
// NOTE: This is unique only because the TargetId is the suffix.
|
|
11727
11727
|
e.createObjectStore("targets", {
|
|
11728
11728
|
keyPath: "targetId"
|
|
11729
|
-
}).createIndex("queryTargetsIndex",
|
|
11729
|
+
}).createIndex("queryTargetsIndex", q, {
|
|
11730
11730
|
unique: !0
|
|
11731
11731
|
}), e.createObjectStore("targetGlobal");
|
|
11732
11732
|
}
|
|
11733
11733
|
|
|
11734
|
-
const
|
|
11734
|
+
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.";
|
|
11735
11735
|
|
|
11736
11736
|
/**
|
|
11737
11737
|
* Oldest acceptable age in milliseconds for client metadata before the client
|
|
@@ -11807,7 +11807,7 @@ class __PRIVATE_IndexedDbPersistence {
|
|
|
11807
11807
|
/** The last time we garbage collected the client metadata object store. */
|
|
11808
11808
|
this.Pi = Number.NEGATIVE_INFINITY,
|
|
11809
11809
|
/** A listener to notify on primary state changes. */
|
|
11810
|
-
this.Ii = e => Promise.resolve(), !__PRIVATE_IndexedDbPersistence.D()) throw new FirestoreError(
|
|
11810
|
+
this.Ii = e => Promise.resolve(), !__PRIVATE_IndexedDbPersistence.D()) throw new FirestoreError(v.UNIMPLEMENTED, "This platform is either missing IndexedDB or is known to have an incomplete implementation. Offline persistence has been disabled.");
|
|
11811
11811
|
this.referenceDelegate = new __PRIVATE_IndexedDbLruDelegateImpl(this, r), this.Ti = t + "main",
|
|
11812
11812
|
this.serializer = new __PRIVATE_LocalSerializer(_), this.Ei = new __PRIVATE_SimpleDb(this.Ti, this.ui, new __PRIVATE_SchemaConverter(this.serializer)),
|
|
11813
11813
|
this.Qr = new __PRIVATE_IndexedDbTargetCache(this.referenceDelegate, this.serializer),
|
|
@@ -11827,7 +11827,7 @@ class __PRIVATE_IndexedDbPersistence {
|
|
|
11827
11827
|
if (!this.isPrimary && !this.allowTabSynchronization)
|
|
11828
11828
|
// Fail `start()` if `synchronizeTabs` is disabled and we cannot
|
|
11829
11829
|
// obtain the primary lease.
|
|
11830
|
-
throw new FirestoreError(
|
|
11830
|
+
throw new FirestoreError(v.FAILED_PRECONDITION, Ve);
|
|
11831
11831
|
return this.Ri(), this.Vi(), this.mi(), this.runTransaction("getHighestListenSequenceNumber", "readonly", (e => this.Qr.getHighestSequenceNumber(e)));
|
|
11832
11832
|
})).then((e => {
|
|
11833
11833
|
this.kr = new __PRIVATE_ListenSequence(e, this._i);
|
|
@@ -11969,7 +11969,7 @@ class __PRIVATE_IndexedDbPersistence {
|
|
|
11969
11969
|
// settings is not supported.
|
|
11970
11970
|
// TODO(b/114226234): Remove this check when `synchronizeTabs` can
|
|
11971
11971
|
// no longer be turned off.
|
|
11972
|
-
throw new FirestoreError(
|
|
11972
|
+
throw new FirestoreError(v.FAILED_PRECONDITION, Ve);
|
|
11973
11973
|
return !1;
|
|
11974
11974
|
}
|
|
11975
11975
|
}
|
|
@@ -12039,7 +12039,7 @@ class __PRIVATE_IndexedDbPersistence {
|
|
|
12039
12039
|
const r = "readonly" === t ? "readonly" : "readwrite", i =
|
|
12040
12040
|
/** Returns the object stores for the provided schema. */
|
|
12041
12041
|
function __PRIVATE_getObjectStores(e) {
|
|
12042
|
-
return 16 === e ?
|
|
12042
|
+
return 16 === e ? ne : 15 === e ? te : 14 === e ? ee : 13 === e ? X : 12 === e ? Z : 11 === e ? Y : void fail();
|
|
12043
12043
|
}(this.ui);
|
|
12044
12044
|
let s;
|
|
12045
12045
|
// Do all transactions as readwrite against all object stores, since we
|
|
@@ -12047,7 +12047,7 @@ class __PRIVATE_IndexedDbPersistence {
|
|
|
12047
12047
|
return this.Ei.runTransaction(e, r, i, (r => (s = new __PRIVATE_IndexedDbTransaction(r, this.kr ? this.kr.next() : __PRIVATE_ListenSequence.oe),
|
|
12048
12048
|
"readwrite-primary" === t ? this.gi(s).next((e => !!e || this.pi(s))).next((t => {
|
|
12049
12049
|
if (!t) throw __PRIVATE_logError(`Failed to obtain primary lease for action '${e}'.`),
|
|
12050
|
-
this.isPrimary = !1, this.oi.enqueueRetryable((() => this.Ii(!1))), new FirestoreError(
|
|
12050
|
+
this.isPrimary = !1, this.oi.enqueueRetryable((() => this.Ii(!1))), new FirestoreError(v.FAILED_PRECONDITION, M);
|
|
12051
12051
|
return n(s);
|
|
12052
12052
|
})).next((e => this.wi(s).next((() => e)))) : this.ki(s).next((() => n(s)))))).then((e => (s.raiseOnCommittedEvent(),
|
|
12053
12053
|
e)));
|
|
@@ -12060,7 +12060,7 @@ class __PRIVATE_IndexedDbPersistence {
|
|
|
12060
12060
|
// be turned off.
|
|
12061
12061
|
ki(e) {
|
|
12062
12062
|
return __PRIVATE_primaryClientStore(e).get("owner").next((e => {
|
|
12063
|
-
if (null !== e && this.Ci(e.leaseTimestampMs, 5e3) && !this.Mi(e.ownerId) && !this.Si(e) && !(this.ai || this.allowTabSynchronization && e.allowTabSynchronization)) throw new FirestoreError(
|
|
12063
|
+
if (null !== e && this.Ci(e.leaseTimestampMs, 5e3) && !this.Mi(e.ownerId) && !this.Si(e) && !(this.ai || this.allowTabSynchronization && e.allowTabSynchronization)) throw new FirestoreError(v.FAILED_PRECONDITION, Ve);
|
|
12064
12064
|
}));
|
|
12065
12065
|
}
|
|
12066
12066
|
/**
|
|
@@ -13557,7 +13557,7 @@ class __PRIVATE_BrowserConnectivityMonitor {
|
|
|
13557
13557
|
/**
|
|
13558
13558
|
* The value returned from the most recent invocation of
|
|
13559
13559
|
* `generateUniqueDebugId()`, or null if it has never been invoked.
|
|
13560
|
-
*/ let
|
|
13560
|
+
*/ let me = null;
|
|
13561
13561
|
|
|
13562
13562
|
/**
|
|
13563
13563
|
* Generates and returns an initial value for `lastUniqueDebugId`.
|
|
@@ -13582,9 +13582,9 @@ class __PRIVATE_BrowserConnectivityMonitor {
|
|
|
13582
13582
|
* @return the 10-character generated ID (e.g. "0xa1b2c3d4").
|
|
13583
13583
|
*/
|
|
13584
13584
|
function __PRIVATE_generateUniqueDebugId() {
|
|
13585
|
-
return null ===
|
|
13585
|
+
return null === me ? me = function __PRIVATE_generateInitialUniqueDebugId() {
|
|
13586
13586
|
return 268435456 + Math.round(2147483648 * Math.random());
|
|
13587
|
-
}() :
|
|
13587
|
+
}() : me++, "0x" + me.toString(16);
|
|
13588
13588
|
}
|
|
13589
13589
|
|
|
13590
13590
|
/**
|
|
@@ -13602,7 +13602,7 @@ function __PRIVATE_generateUniqueDebugId() {
|
|
|
13602
13602
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13603
13603
|
* See the License for the specific language governing permissions and
|
|
13604
13604
|
* limitations under the License.
|
|
13605
|
-
*/ const
|
|
13605
|
+
*/ const fe = {
|
|
13606
13606
|
BatchGetDocuments: "batchGet",
|
|
13607
13607
|
Commit: "commit",
|
|
13608
13608
|
RunQuery: "runQuery",
|
|
@@ -13686,7 +13686,7 @@ class __PRIVATE_StreamBridge {
|
|
|
13686
13686
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13687
13687
|
* See the License for the specific language governing permissions and
|
|
13688
13688
|
* limitations under the License.
|
|
13689
|
-
*/ const
|
|
13689
|
+
*/ const ge = "WebChannelConnection";
|
|
13690
13690
|
|
|
13691
13691
|
class __PRIVATE_WebChannelConnection extends
|
|
13692
13692
|
/**
|
|
@@ -13730,7 +13730,7 @@ class __PRIVATE_RestConnection {
|
|
|
13730
13730
|
// SDK_VERSION is updated to different value at runtime depending on the entry point,
|
|
13731
13731
|
// so we need to get its value when we need it in a function.
|
|
13732
13732
|
function __PRIVATE_getGoogApiClientValue() {
|
|
13733
|
-
return "gl-js/ fire/" +
|
|
13733
|
+
return "gl-js/ fire/" + D;
|
|
13734
13734
|
}(),
|
|
13735
13735
|
// Content-Type: text/plain will avoid preflight requests which might
|
|
13736
13736
|
// mess with CORS and redirects by proxies. If we add custom headers
|
|
@@ -13740,7 +13740,7 @@ class __PRIVATE_RestConnection {
|
|
|
13740
13740
|
t && t.headers.forEach(((t, n) => e[n] = t)), n && n.headers.forEach(((t, n) => e[n] = t));
|
|
13741
13741
|
}
|
|
13742
13742
|
vo(e, t) {
|
|
13743
|
-
const n =
|
|
13743
|
+
const n = fe[e];
|
|
13744
13744
|
return `${this.wo}/v1/${t}:${n}`;
|
|
13745
13745
|
}
|
|
13746
13746
|
/**
|
|
@@ -13764,17 +13764,17 @@ class __PRIVATE_RestConnection {
|
|
|
13764
13764
|
switch (_.getLastErrorCode()) {
|
|
13765
13765
|
case ErrorCode.NO_ERROR:
|
|
13766
13766
|
const t = _.getResponseJson();
|
|
13767
|
-
__PRIVATE_logDebug(
|
|
13767
|
+
__PRIVATE_logDebug(ge, `XHR for RPC '${e}' ${i} received:`, JSON.stringify(t)),
|
|
13768
13768
|
s(t);
|
|
13769
13769
|
break;
|
|
13770
13770
|
|
|
13771
13771
|
case ErrorCode.TIMEOUT:
|
|
13772
|
-
__PRIVATE_logDebug(
|
|
13772
|
+
__PRIVATE_logDebug(ge, `RPC '${e}' ${i} timed out`), o(new FirestoreError(v.DEADLINE_EXCEEDED, "Request time out"));
|
|
13773
13773
|
break;
|
|
13774
13774
|
|
|
13775
13775
|
case ErrorCode.HTTP_ERROR:
|
|
13776
13776
|
const n = _.getStatus();
|
|
13777
|
-
if (__PRIVATE_logDebug(
|
|
13777
|
+
if (__PRIVATE_logDebug(ge, `RPC '${e}' ${i} failed with status:`, n, "response text:", _.getResponseText()),
|
|
13778
13778
|
n > 0) {
|
|
13779
13779
|
let e = _.getResponseJson();
|
|
13780
13780
|
Array.isArray(e) && (e = e[0]);
|
|
@@ -13782,25 +13782,25 @@ class __PRIVATE_RestConnection {
|
|
|
13782
13782
|
if (t && t.status && t.message) {
|
|
13783
13783
|
const e = function __PRIVATE_mapCodeFromHttpResponseErrorStatus(e) {
|
|
13784
13784
|
const t = e.toLowerCase().replace(/_/g, "-");
|
|
13785
|
-
return Object.values(
|
|
13785
|
+
return Object.values(v).indexOf(t) >= 0 ? t : v.UNKNOWN;
|
|
13786
13786
|
}(t.status);
|
|
13787
13787
|
o(new FirestoreError(e, t.message));
|
|
13788
|
-
} else o(new FirestoreError(
|
|
13788
|
+
} else o(new FirestoreError(v.UNKNOWN, "Server responded with status " + _.getStatus()));
|
|
13789
13789
|
} else
|
|
13790
13790
|
// If we received an HTTP_ERROR but there's no status code,
|
|
13791
13791
|
// it's most probably a connection issue
|
|
13792
|
-
o(new FirestoreError(
|
|
13792
|
+
o(new FirestoreError(v.UNAVAILABLE, "Connection failed."));
|
|
13793
13793
|
break;
|
|
13794
13794
|
|
|
13795
13795
|
default:
|
|
13796
13796
|
fail();
|
|
13797
13797
|
}
|
|
13798
13798
|
} finally {
|
|
13799
|
-
__PRIVATE_logDebug(
|
|
13799
|
+
__PRIVATE_logDebug(ge, `RPC '${e}' ${i} completed.`);
|
|
13800
13800
|
}
|
|
13801
13801
|
}));
|
|
13802
13802
|
const a = JSON.stringify(r);
|
|
13803
|
-
__PRIVATE_logDebug(
|
|
13803
|
+
__PRIVATE_logDebug(ge, `RPC '${e}' ${i} sending request:`, r), _.send(t, "POST", a, n, 15);
|
|
13804
13804
|
}));
|
|
13805
13805
|
}
|
|
13806
13806
|
Oo(e, t, n) {
|
|
@@ -13841,7 +13841,7 @@ class __PRIVATE_RestConnection {
|
|
|
13841
13841
|
// which is recognized by the webchannel backend.
|
|
13842
13842
|
_.encodeInitMessageHeaders = !0;
|
|
13843
13843
|
const u = i.join("");
|
|
13844
|
-
__PRIVATE_logDebug(
|
|
13844
|
+
__PRIVATE_logDebug(ge, `Creating RPC '${e}' stream ${r}: ${u}`, _);
|
|
13845
13845
|
const c = s.createWebChannel(u, _);
|
|
13846
13846
|
// WebChannel supports sending the first message with the handshake - saving
|
|
13847
13847
|
// a network round trip. However, it will have to call send in the same
|
|
@@ -13854,8 +13854,8 @@ class __PRIVATE_RestConnection {
|
|
|
13854
13854
|
// on a closed stream
|
|
13855
13855
|
const P = new __PRIVATE_StreamBridge({
|
|
13856
13856
|
lo: t => {
|
|
13857
|
-
h ? __PRIVATE_logDebug(
|
|
13858
|
-
c.open(), l = !0), __PRIVATE_logDebug(
|
|
13857
|
+
h ? __PRIVATE_logDebug(ge, `Not sending because RPC '${e}' stream ${r} is closed:`, t) : (l || (__PRIVATE_logDebug(ge, `Opening RPC '${e}' stream ${r} transport.`),
|
|
13858
|
+
c.open(), l = !0), __PRIVATE_logDebug(ge, `RPC '${e}' stream ${r} sending:`, t),
|
|
13859
13859
|
c.send(t));
|
|
13860
13860
|
},
|
|
13861
13861
|
ho: () => c.close()
|
|
@@ -13877,13 +13877,13 @@ class __PRIVATE_RestConnection {
|
|
|
13877
13877
|
// Note that eventually this function could go away if we are confident
|
|
13878
13878
|
// enough the code is exception free.
|
|
13879
13879
|
return __PRIVATE_unguardedEventListen(c, WebChannel.EventType.OPEN, (() => {
|
|
13880
|
-
h || (__PRIVATE_logDebug(
|
|
13880
|
+
h || (__PRIVATE_logDebug(ge, `RPC '${e}' stream ${r} transport opened.`), P.mo());
|
|
13881
13881
|
})), __PRIVATE_unguardedEventListen(c, WebChannel.EventType.CLOSE, (() => {
|
|
13882
|
-
h || (h = !0, __PRIVATE_logDebug(
|
|
13882
|
+
h || (h = !0, __PRIVATE_logDebug(ge, `RPC '${e}' stream ${r} transport closed`),
|
|
13883
13883
|
P.po());
|
|
13884
13884
|
})), __PRIVATE_unguardedEventListen(c, WebChannel.EventType.ERROR, (t => {
|
|
13885
|
-
h || (h = !0, __PRIVATE_logWarn(
|
|
13886
|
-
P.po(new FirestoreError(
|
|
13885
|
+
h || (h = !0, __PRIVATE_logWarn(ge, `RPC '${e}' stream ${r} transport errored:`, t),
|
|
13886
|
+
P.po(new FirestoreError(v.UNAVAILABLE, "The operation could not be completed")));
|
|
13887
13887
|
})), __PRIVATE_unguardedEventListen(c, WebChannel.EventType.MESSAGE, (t => {
|
|
13888
13888
|
var n;
|
|
13889
13889
|
if (!h) {
|
|
@@ -13896,7 +13896,7 @@ class __PRIVATE_RestConnection {
|
|
|
13896
13896
|
// Use any because msgData.error is not typed.
|
|
13897
13897
|
const s = i, o = s.error || (null === (n = s[0]) || void 0 === n ? void 0 : n.error);
|
|
13898
13898
|
if (o) {
|
|
13899
|
-
__PRIVATE_logDebug(
|
|
13899
|
+
__PRIVATE_logDebug(ge, `RPC '${e}' stream ${r} received error:`, o);
|
|
13900
13900
|
// error.status will be a string like 'OK' or 'NOT_FOUND'.
|
|
13901
13901
|
const t = o.status;
|
|
13902
13902
|
let n =
|
|
@@ -13909,16 +13909,16 @@ class __PRIVATE_RestConnection {
|
|
|
13909
13909
|
function __PRIVATE_mapCodeFromRpcStatus(e) {
|
|
13910
13910
|
// lookup by string
|
|
13911
13911
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
13912
|
-
const t =
|
|
13912
|
+
const t = le[e];
|
|
13913
13913
|
if (void 0 !== t) return __PRIVATE_mapCodeFromRpcCode(t);
|
|
13914
13914
|
}(t), i = o.message;
|
|
13915
|
-
void 0 === n && (n =
|
|
13915
|
+
void 0 === n && (n = v.INTERNAL, i = "Unknown error status: " + t + " with message " + o.message),
|
|
13916
13916
|
// Mark closed so no further events are propagated
|
|
13917
13917
|
h = !0, P.po(new FirestoreError(n, i)), c.close();
|
|
13918
|
-
} else __PRIVATE_logDebug(
|
|
13918
|
+
} else __PRIVATE_logDebug(ge, `RPC '${e}' stream ${r} received:`, i), P.yo(i);
|
|
13919
13919
|
}
|
|
13920
13920
|
})), __PRIVATE_unguardedEventListen(o, Event.STAT_EVENT, (t => {
|
|
13921
|
-
t.stat === Stat.PROXY ? __PRIVATE_logDebug(
|
|
13921
|
+
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`);
|
|
13922
13922
|
})), setTimeout((() => {
|
|
13923
13923
|
// Technically we could/should wait for the WebChannel opened event,
|
|
13924
13924
|
// but because we want to send the first message with the WebChannel
|
|
@@ -14242,10 +14242,10 @@ class __PRIVATE_PersistentStream {
|
|
|
14242
14242
|
// underlying stream), guaranteeing they won't execute.
|
|
14243
14243
|
this.jo++, 4 /* PersistentStreamState.Error */ !== e ?
|
|
14244
14244
|
// If this is an intentional close ensure we don't delay our next connection attempt.
|
|
14245
|
-
this.Yo.reset() : t && t.code ===
|
|
14245
|
+
this.Yo.reset() : t && t.code === v.RESOURCE_EXHAUSTED ? (
|
|
14246
14246
|
// Log the error. (Probably either 'quota exceeded' or 'max queue length reached'.)
|
|
14247
14247
|
__PRIVATE_logError(t.toString()), __PRIVATE_logError("Using maximum backoff delay to prevent overloading the backend."),
|
|
14248
|
-
this.Yo.Ko()) : t && t.code ===
|
|
14248
|
+
this.Yo.Ko()) : t && t.code === v.UNAUTHENTICATED && 3 /* PersistentStreamState.Healthy */ !== this.state && (
|
|
14249
14249
|
// "unauthenticated" error means the token was rejected. This should rarely
|
|
14250
14250
|
// happen since both Auth and AppCheck ensure a sufficient TTL when we
|
|
14251
14251
|
// request a token. If a user manually resets their system clock this can
|
|
@@ -14281,7 +14281,7 @@ class __PRIVATE_PersistentStream {
|
|
|
14281
14281
|
this.u_(e, n);
|
|
14282
14282
|
}), (t => {
|
|
14283
14283
|
e((() => {
|
|
14284
|
-
const e = new FirestoreError(
|
|
14284
|
+
const e = new FirestoreError(v.UNKNOWN, "Fetching auth token failed: " + t.message);
|
|
14285
14285
|
return this.c_(e);
|
|
14286
14286
|
}));
|
|
14287
14287
|
}));
|
|
@@ -14496,18 +14496,18 @@ class __PRIVATE_DatastoreImpl extends class Datastore {} {
|
|
|
14496
14496
|
this.serializer = r, this.m_ = !1;
|
|
14497
14497
|
}
|
|
14498
14498
|
f_() {
|
|
14499
|
-
if (this.m_) throw new FirestoreError(
|
|
14499
|
+
if (this.m_) throw new FirestoreError(v.FAILED_PRECONDITION, "The client has already been terminated.");
|
|
14500
14500
|
}
|
|
14501
14501
|
/** Invokes the provided RPC with auth and AppCheck tokens. */ Co(e, t, n, r) {
|
|
14502
14502
|
return this.f_(), Promise.all([ this.authCredentials.getToken(), this.appCheckCredentials.getToken() ]).then((([i, s]) => this.connection.Co(e, __PRIVATE_toResourcePath(t, n), r, i, s))).catch((e => {
|
|
14503
|
-
throw "FirebaseError" === e.name ? (e.code ===
|
|
14504
|
-
this.appCheckCredentials.invalidateToken()), e) : new FirestoreError(
|
|
14503
|
+
throw "FirebaseError" === e.name ? (e.code === v.UNAUTHENTICATED && (this.authCredentials.invalidateToken(),
|
|
14504
|
+
this.appCheckCredentials.invalidateToken()), e) : new FirestoreError(v.UNKNOWN, e.toString());
|
|
14505
14505
|
}));
|
|
14506
14506
|
}
|
|
14507
14507
|
/** Invokes the provided RPC with streamed results with auth and AppCheck tokens. */ xo(e, t, n, r, i) {
|
|
14508
14508
|
return this.f_(), Promise.all([ this.authCredentials.getToken(), this.appCheckCredentials.getToken() ]).then((([s, o]) => this.connection.xo(e, __PRIVATE_toResourcePath(t, n), r, s, o, i))).catch((e => {
|
|
14509
|
-
throw "FirebaseError" === e.name ? (e.code ===
|
|
14510
|
-
this.appCheckCredentials.invalidateToken()), e) : new FirestoreError(
|
|
14509
|
+
throw "FirebaseError" === e.name ? (e.code === v.UNAUTHENTICATED && (this.authCredentials.invalidateToken(),
|
|
14510
|
+
this.appCheckCredentials.invalidateToken()), e) : new FirestoreError(v.UNKNOWN, e.toString());
|
|
14511
14511
|
}));
|
|
14512
14512
|
}
|
|
14513
14513
|
terminate() {
|
|
@@ -14951,7 +14951,7 @@ async function __PRIVATE_onWriteStreamClose(e, t) {
|
|
|
14951
14951
|
// Only handle permanent errors here. If it's transient, just let the retry
|
|
14952
14952
|
// logic kick in.
|
|
14953
14953
|
if (function __PRIVATE_isPermanentWriteError(e) {
|
|
14954
|
-
return __PRIVATE_isPermanentError(e) && e !==
|
|
14954
|
+
return __PRIVATE_isPermanentError(e) && e !== v.ABORTED;
|
|
14955
14955
|
}(t.code)) {
|
|
14956
14956
|
// This was a permanent error, the request itself was the problem
|
|
14957
14957
|
// so it's not going to succeed if we resend it.
|
|
@@ -15134,7 +15134,7 @@ class DelayedOperation {
|
|
|
15134
15134
|
* As long as the operation has not yet been run, calling cancel() provides a
|
|
15135
15135
|
* guarantee that the operation will not be run.
|
|
15136
15136
|
*/ cancel(e) {
|
|
15137
|
-
null !== this.timerHandle && (this.clearTimeout(), this.deferred.reject(new FirestoreError(
|
|
15137
|
+
null !== this.timerHandle && (this.clearTimeout(), this.deferred.reject(new FirestoreError(v.CANCELLED, "Operation cancelled" + (e ? ": " + e : ""))));
|
|
15138
15138
|
}
|
|
15139
15139
|
handleDelayElapsed() {
|
|
15140
15140
|
this.asyncQueue.enqueueAndForget((() => null !== this.timerHandle ? (this.clearTimeout(),
|
|
@@ -15150,7 +15150,7 @@ class DelayedOperation {
|
|
|
15150
15150
|
* Returns a FirestoreError that can be surfaced to the user if the provided
|
|
15151
15151
|
* error is an IndexedDbTransactionError. Re-throws the error otherwise.
|
|
15152
15152
|
*/ function __PRIVATE_wrapInUserErrorIfRecoverable(e, t) {
|
|
15153
|
-
if (__PRIVATE_logError("AsyncQueue", `${t}: ${e}`), __PRIVATE_isIndexedDbTransactionError(e)) return new FirestoreError(
|
|
15153
|
+
if (__PRIVATE_logError("AsyncQueue", `${t}: ${e}`), __PRIVATE_isIndexedDbTransactionError(e)) return new FirestoreError(v.UNAVAILABLE, `${t}: ${e}`);
|
|
15154
15154
|
throw e;
|
|
15155
15155
|
}
|
|
15156
15156
|
|
|
@@ -15463,12 +15463,12 @@ function __PRIVATE_raiseSnapshotsInSyncEvent(e) {
|
|
|
15463
15463
|
}));
|
|
15464
15464
|
}
|
|
15465
15465
|
|
|
15466
|
-
var
|
|
15466
|
+
var pe, ye;
|
|
15467
15467
|
|
|
15468
15468
|
/** Listen to both cache and server changes */
|
|
15469
|
-
(
|
|
15469
|
+
(ye = pe || (pe = {})).J_ = "default",
|
|
15470
15470
|
/** Listen to changes in cache only */
|
|
15471
|
-
|
|
15471
|
+
ye.Cache = "cache";
|
|
15472
15472
|
|
|
15473
15473
|
/**
|
|
15474
15474
|
* QueryListener takes a series of internal view snapshots and determines
|
|
@@ -15543,7 +15543,7 @@ class __PRIVATE_QueryListener {
|
|
|
15543
15543
|
this.Z_ = !0, this.Y_.next(e);
|
|
15544
15544
|
}
|
|
15545
15545
|
G_() {
|
|
15546
|
-
return this.options.source !==
|
|
15546
|
+
return this.options.source !== pe.Cache;
|
|
15547
15547
|
}
|
|
15548
15548
|
}
|
|
15549
15549
|
|
|
@@ -16505,7 +16505,7 @@ async function __PRIVATE_syncEngineHandleCredentialChange(e, t) {
|
|
|
16505
16505
|
function __PRIVATE_rejectOutstandingPendingWritesCallbacks(e, t) {
|
|
16506
16506
|
e.Oa.forEach((e => {
|
|
16507
16507
|
e.forEach((e => {
|
|
16508
|
-
e.reject(new FirestoreError(
|
|
16508
|
+
e.reject(new FirestoreError(v.CANCELLED, t));
|
|
16509
16509
|
}));
|
|
16510
16510
|
})), e.Oa.clear();
|
|
16511
16511
|
}(n, "'waitForPendingWrites' promise is rejected due to a user change."),
|
|
@@ -16934,7 +16934,7 @@ class __PRIVATE_LruGcMemoryOfflineComponentProvider extends MemoryOfflineCompone
|
|
|
16934
16934
|
}
|
|
16935
16935
|
createSharedClientState(e) {
|
|
16936
16936
|
const t = __PRIVATE_getWindow();
|
|
16937
|
-
if (!__PRIVATE_WebStorageSharedClientState.D(t)) throw new FirestoreError(
|
|
16937
|
+
if (!__PRIVATE_WebStorageSharedClientState.D(t)) throw new FirestoreError(v.UNIMPLEMENTED, "IndexedDB persistence is only available on platforms that support LocalStorage.");
|
|
16938
16938
|
const n = __PRIVATE_indexedDbStoragePrefix(e.databaseInfo.databaseId, e.databaseInfo.persistenceKey);
|
|
16939
16939
|
return new __PRIVATE_WebStorageSharedClientState(t, e.asyncQueue, n, e.clientId, e.initialUser);
|
|
16940
16940
|
}
|
|
@@ -17272,7 +17272,7 @@ class Transaction$2 {
|
|
|
17272
17272
|
this.writtenDocs = new Set;
|
|
17273
17273
|
}
|
|
17274
17274
|
async lookup(e) {
|
|
17275
|
-
if (this.ensureCommitNotCalled(), this.mutations.length > 0) throw this.lastTransactionError = new FirestoreError(
|
|
17275
|
+
if (this.ensureCommitNotCalled(), this.mutations.length > 0) throw this.lastTransactionError = new FirestoreError(v.INVALID_ARGUMENT, "Firestore transactions require all reads to be executed before all writes."),
|
|
17276
17276
|
this.lastTransactionError;
|
|
17277
17277
|
const t = await async function __PRIVATE_invokeBatchGetDocumentsRpc(e, t) {
|
|
17278
17278
|
const n = __PRIVATE_debugCast(e), r = {
|
|
@@ -17334,7 +17334,7 @@ class Transaction$2 {
|
|
|
17334
17334
|
if (n) {
|
|
17335
17335
|
if (!t.isEqual(n))
|
|
17336
17336
|
// This transaction will fail no matter what.
|
|
17337
|
-
throw new FirestoreError(
|
|
17337
|
+
throw new FirestoreError(v.ABORTED, "Document version changed between two reads.");
|
|
17338
17338
|
} else this.readVersions.set(e.key.toString(), t);
|
|
17339
17339
|
}
|
|
17340
17340
|
/**
|
|
@@ -17361,7 +17361,7 @@ class Transaction$2 {
|
|
|
17361
17361
|
// express that to the backend, we have to validate locally.
|
|
17362
17362
|
// Note: this can change once we can send separate verify writes in the
|
|
17363
17363
|
// transaction.
|
|
17364
|
-
throw new FirestoreError(
|
|
17364
|
+
throw new FirestoreError(v.INVALID_ARGUMENT, "Can't update a document that doesn't exist.");
|
|
17365
17365
|
// Document exists, base precondition on document update time.
|
|
17366
17366
|
return Precondition.updateTime(t);
|
|
17367
17367
|
}
|
|
@@ -17502,7 +17502,7 @@ class FirestoreClient {
|
|
|
17502
17502
|
* Checks that the client has not been terminated. Ensures that other methods on //
|
|
17503
17503
|
* this class cannot be called after the client is terminated. //
|
|
17504
17504
|
*/ verifyNotTerminated() {
|
|
17505
|
-
if (this.asyncQueue.isShuttingDown) throw new FirestoreError(
|
|
17505
|
+
if (this.asyncQueue.isShuttingDown) throw new FirestoreError(v.FAILED_PRECONDITION, "The client has already been terminated.");
|
|
17506
17506
|
}
|
|
17507
17507
|
terminate() {
|
|
17508
17508
|
this.asyncQueue.enterRestrictedMode();
|
|
@@ -17550,7 +17550,7 @@ async function __PRIVATE_setOnlineComponentProvider(e, t) {
|
|
|
17550
17550
|
* Decides whether the provided error allows us to gracefully disable
|
|
17551
17551
|
* persistence (as opposed to crashing the client).
|
|
17552
17552
|
*/ function __PRIVATE_canFallbackFromIndexedDbError(e) {
|
|
17553
|
-
return "FirebaseError" === e.name ? e.code ===
|
|
17553
|
+
return "FirebaseError" === e.name ? e.code === v.FAILED_PRECONDITION || e.code === v.UNIMPLEMENTED : !("undefined" != typeof DOMException && e instanceof DOMException) || (
|
|
17554
17554
|
// When the browser is out of quota we could get either quota exceeded
|
|
17555
17555
|
// or an aborted error depending on whether the error happened during
|
|
17556
17556
|
// schema migration.
|
|
@@ -17644,7 +17644,7 @@ async function __PRIVATE_getEventManager(e) {
|
|
|
17644
17644
|
const n = __PRIVATE_debugCast(e);
|
|
17645
17645
|
return n.persistence.runTransaction("read document", "readonly", (e => n.localDocuments.getDocument(e, t)));
|
|
17646
17646
|
}(e, t);
|
|
17647
|
-
r.isFoundDocument() ? n.resolve(r) : r.isNoDocument() ? n.resolve(null) : n.reject(new FirestoreError(
|
|
17647
|
+
r.isFoundDocument() ? n.resolve(r) : r.isNoDocument() ? n.resolve(null) : n.reject(new FirestoreError(v.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.)"));
|
|
17648
17648
|
} catch (e) {
|
|
17649
17649
|
const r = __PRIVATE_wrapInUserErrorIfRecoverable(e, `Failed to get document '${t} from cache`);
|
|
17650
17650
|
n.reject(r);
|
|
@@ -17673,7 +17673,7 @@ function __PRIVATE_firestoreClientGetDocumentViaSnapshotListener(e, t, n = {}) {
|
|
|
17673
17673
|
// the server so we can deliver that even when you're
|
|
17674
17674
|
// offline 2) Actually reject the Promise in the online case
|
|
17675
17675
|
// if the document doesn't exist.
|
|
17676
|
-
i.reject(new FirestoreError(
|
|
17676
|
+
i.reject(new FirestoreError(v.UNAVAILABLE, "Failed to get document because the client is offline.")) : _ && s.fromCache && r && "server" === r.source ? i.reject(new FirestoreError(v.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);
|
|
17677
17677
|
},
|
|
17678
17678
|
error: e => i.reject(e)
|
|
17679
17679
|
}), o = new __PRIVATE_QueryListener(__PRIVATE_newQueryForPath(n.path), s, {
|
|
@@ -17710,7 +17710,7 @@ function __PRIVATE_firestoreClientGetDocumentsViaSnapshotListener(e, t, n = {})
|
|
|
17710
17710
|
next: n => {
|
|
17711
17711
|
// Remove query first before passing event to user to avoid
|
|
17712
17712
|
// user actions affecting the now stale query.
|
|
17713
|
-
t.enqueueAndForget((() => __PRIVATE_eventManagerUnlisten(e, o))), n.fromCache && "server" === r.source ? i.reject(new FirestoreError(
|
|
17713
|
+
t.enqueueAndForget((() => __PRIVATE_eventManagerUnlisten(e, o))), n.fromCache && "server" === r.source ? i.reject(new FirestoreError(v.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);
|
|
17714
17714
|
},
|
|
17715
17715
|
error: e => i.reject(e)
|
|
17716
17716
|
}), o = new __PRIVATE_QueryListener(n, s, {
|
|
@@ -17939,7 +17939,7 @@ function __PRIVATE_cloneLongPollingOptions(e) {
|
|
|
17939
17939
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
17940
17940
|
* See the License for the specific language governing permissions and
|
|
17941
17941
|
* limitations under the License.
|
|
17942
|
-
*/ const
|
|
17942
|
+
*/ const we = new Map;
|
|
17943
17943
|
|
|
17944
17944
|
/**
|
|
17945
17945
|
* An instance map that ensures only one Datastore exists per Firestore
|
|
@@ -17962,28 +17962,28 @@ function __PRIVATE_cloneLongPollingOptions(e) {
|
|
|
17962
17962
|
* limitations under the License.
|
|
17963
17963
|
*/
|
|
17964
17964
|
function __PRIVATE_validateNonEmptyArgument(e, t, n) {
|
|
17965
|
-
if (!n) throw new FirestoreError(
|
|
17965
|
+
if (!n) throw new FirestoreError(v.INVALID_ARGUMENT, `Function ${e}() cannot be called with an empty ${t}.`);
|
|
17966
17966
|
}
|
|
17967
17967
|
|
|
17968
17968
|
/**
|
|
17969
17969
|
* Validates that two boolean options are not set at the same time.
|
|
17970
17970
|
* @internal
|
|
17971
17971
|
*/ function __PRIVATE_validateIsNotUsedTogether(e, t, n, r) {
|
|
17972
|
-
if (!0 === t && !0 === r) throw new FirestoreError(
|
|
17972
|
+
if (!0 === t && !0 === r) throw new FirestoreError(v.INVALID_ARGUMENT, `${e} and ${n} cannot be used together.`);
|
|
17973
17973
|
}
|
|
17974
17974
|
|
|
17975
17975
|
/**
|
|
17976
17976
|
* Validates that `path` refers to a document (indicated by the fact it contains
|
|
17977
17977
|
* an even numbers of segments).
|
|
17978
17978
|
*/ function __PRIVATE_validateDocumentPath(e) {
|
|
17979
|
-
if (!DocumentKey.isDocumentKey(e)) throw new FirestoreError(
|
|
17979
|
+
if (!DocumentKey.isDocumentKey(e)) throw new FirestoreError(v.INVALID_ARGUMENT, `Invalid document reference. Document references must have an even number of segments, but ${e} has ${e.length}.`);
|
|
17980
17980
|
}
|
|
17981
17981
|
|
|
17982
17982
|
/**
|
|
17983
17983
|
* Validates that `path` refers to a collection (indicated by the fact it
|
|
17984
17984
|
* contains an odd numbers of segments).
|
|
17985
17985
|
*/ function __PRIVATE_validateCollectionPath(e) {
|
|
17986
|
-
if (DocumentKey.isDocumentKey(e)) throw new FirestoreError(
|
|
17986
|
+
if (DocumentKey.isDocumentKey(e)) throw new FirestoreError(v.INVALID_ARGUMENT, `Invalid collection reference. Collection references must have an odd number of segments, but ${e} has ${e.length}.`);
|
|
17987
17987
|
}
|
|
17988
17988
|
|
|
17989
17989
|
/**
|
|
@@ -18027,17 +18027,17 @@ t) {
|
|
|
18027
18027
|
// Unwrap Compat types
|
|
18028
18028
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
18029
18029
|
e = e._delegate), !(e instanceof t)) {
|
|
18030
|
-
if (t.name === e.constructor.name) throw new FirestoreError(
|
|
18030
|
+
if (t.name === e.constructor.name) throw new FirestoreError(v.INVALID_ARGUMENT, "Type does not match the expected instance. Did you pass a reference from a different Firestore SDK?");
|
|
18031
18031
|
{
|
|
18032
18032
|
const n = __PRIVATE_valueDescription(e);
|
|
18033
|
-
throw new FirestoreError(
|
|
18033
|
+
throw new FirestoreError(v.INVALID_ARGUMENT, `Expected type '${t.name}', but it was: ${n}`);
|
|
18034
18034
|
}
|
|
18035
18035
|
}
|
|
18036
18036
|
return e;
|
|
18037
18037
|
}
|
|
18038
18038
|
|
|
18039
18039
|
function __PRIVATE_validatePositiveNumber(e, t) {
|
|
18040
|
-
if (t <= 0) throw new FirestoreError(
|
|
18040
|
+
if (t <= 0) throw new FirestoreError(v.INVALID_ARGUMENT, `Function ${e}() requires a positive number, but it was: ${t}.`);
|
|
18041
18041
|
}
|
|
18042
18042
|
|
|
18043
18043
|
/**
|
|
@@ -18066,12 +18066,12 @@ class FirestoreSettingsImpl {
|
|
|
18066
18066
|
constructor(e) {
|
|
18067
18067
|
var t, n;
|
|
18068
18068
|
if (void 0 === e.host) {
|
|
18069
|
-
if (void 0 !== e.ssl) throw new FirestoreError(
|
|
18069
|
+
if (void 0 !== e.ssl) throw new FirestoreError(v.INVALID_ARGUMENT, "Can't provide ssl option if host option is not set");
|
|
18070
18070
|
this.host = "firestore.googleapis.com", this.ssl = true;
|
|
18071
18071
|
} else this.host = e.host, this.ssl = null === (t = e.ssl) || void 0 === t || t;
|
|
18072
18072
|
if (this.credentials = e.credentials, this.ignoreUndefinedProperties = !!e.ignoreUndefinedProperties,
|
|
18073
18073
|
this.localCache = e.localCache, void 0 === e.cacheSizeBytes) this.cacheSizeBytes = 41943040; else {
|
|
18074
|
-
if (-1 !== e.cacheSizeBytes && e.cacheSizeBytes < 1048576) throw new FirestoreError(
|
|
18074
|
+
if (-1 !== e.cacheSizeBytes && e.cacheSizeBytes < 1048576) throw new FirestoreError(v.INVALID_ARGUMENT, "cacheSizeBytes must be at least 1048576");
|
|
18075
18075
|
this.cacheSizeBytes = e.cacheSizeBytes;
|
|
18076
18076
|
}
|
|
18077
18077
|
__PRIVATE_validateIsNotUsedTogether("experimentalForceLongPolling", e.experimentalForceLongPolling, "experimentalAutoDetectLongPolling", e.experimentalAutoDetectLongPolling),
|
|
@@ -18083,9 +18083,9 @@ class FirestoreSettingsImpl {
|
|
|
18083
18083
|
this.experimentalLongPollingOptions = __PRIVATE_cloneLongPollingOptions(null !== (n = e.experimentalLongPollingOptions) && void 0 !== n ? n : {}),
|
|
18084
18084
|
function __PRIVATE_validateLongPollingOptions(e) {
|
|
18085
18085
|
if (void 0 !== e.timeoutSeconds) {
|
|
18086
|
-
if (isNaN(e.timeoutSeconds)) throw new FirestoreError(
|
|
18087
|
-
if (e.timeoutSeconds < 5) throw new FirestoreError(
|
|
18088
|
-
if (e.timeoutSeconds > 30) throw new FirestoreError(
|
|
18086
|
+
if (isNaN(e.timeoutSeconds)) throw new FirestoreError(v.INVALID_ARGUMENT, `invalid long polling timeout: ${e.timeoutSeconds} (must not be NaN)`);
|
|
18087
|
+
if (e.timeoutSeconds < 5) throw new FirestoreError(v.INVALID_ARGUMENT, `invalid long polling timeout: ${e.timeoutSeconds} (minimum allowed value is 5)`);
|
|
18088
|
+
if (e.timeoutSeconds > 30) throw new FirestoreError(v.INVALID_ARGUMENT, `invalid long polling timeout: ${e.timeoutSeconds} (maximum allowed value is 30)`);
|
|
18089
18089
|
}
|
|
18090
18090
|
}
|
|
18091
18091
|
/**
|
|
@@ -18132,7 +18132,7 @@ class Firestore$1 {
|
|
|
18132
18132
|
* The {@link @firebase/app#FirebaseApp} associated with this `Firestore` service
|
|
18133
18133
|
* instance.
|
|
18134
18134
|
*/ get app() {
|
|
18135
|
-
if (!this._app) throw new FirestoreError(
|
|
18135
|
+
if (!this._app) throw new FirestoreError(v.FAILED_PRECONDITION, "Firestore was not initialized using the Firebase SDK. 'app' is not available");
|
|
18136
18136
|
return this._app;
|
|
18137
18137
|
}
|
|
18138
18138
|
get _initialized() {
|
|
@@ -18142,7 +18142,7 @@ class Firestore$1 {
|
|
|
18142
18142
|
return void 0 !== this._terminateTask;
|
|
18143
18143
|
}
|
|
18144
18144
|
_setSettings(e) {
|
|
18145
|
-
if (this._settingsFrozen) throw new FirestoreError(
|
|
18145
|
+
if (this._settingsFrozen) throw new FirestoreError(v.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.");
|
|
18146
18146
|
this._settings = new FirestoreSettingsImpl(e), void 0 !== e.credentials && (this._authCredentials = function __PRIVATE_makeAuthCredentialsProvider(e) {
|
|
18147
18147
|
if (!e) return new __PRIVATE_EmptyAuthCredentialsProvider;
|
|
18148
18148
|
switch (e.type) {
|
|
@@ -18153,7 +18153,7 @@ class Firestore$1 {
|
|
|
18153
18153
|
return e.client;
|
|
18154
18154
|
|
|
18155
18155
|
default:
|
|
18156
|
-
throw new FirestoreError(
|
|
18156
|
+
throw new FirestoreError(v.INVALID_ARGUMENT, "makeAuthCredentialsProvider failed due to invalid credential type");
|
|
18157
18157
|
}
|
|
18158
18158
|
}(e.credentials));
|
|
18159
18159
|
}
|
|
@@ -18185,8 +18185,8 @@ class Firestore$1 {
|
|
|
18185
18185
|
* when the `Firestore` instance is terminated.
|
|
18186
18186
|
*/
|
|
18187
18187
|
return function __PRIVATE_removeComponents(e) {
|
|
18188
|
-
const t =
|
|
18189
|
-
t && (__PRIVATE_logDebug("ComponentProvider", "Removing Datastore"),
|
|
18188
|
+
const t = we.get(e);
|
|
18189
|
+
t && (__PRIVATE_logDebug("ComponentProvider", "Removing Datastore"), we.delete(e),
|
|
18190
18190
|
t.terminate());
|
|
18191
18191
|
}(this), Promise.resolve();
|
|
18192
18192
|
}
|
|
@@ -18218,7 +18218,7 @@ class Firestore$1 {
|
|
|
18218
18218
|
// invalid field "uid" and missing field "sub" / "user_id".)
|
|
18219
18219
|
t = createMockUserToken(r.mockUserToken, null === (i = e._app) || void 0 === i ? void 0 : i.options.projectId);
|
|
18220
18220
|
const s = r.mockUserToken.sub || r.mockUserToken.user_id;
|
|
18221
|
-
if (!s) throw new FirestoreError(
|
|
18221
|
+
if (!s) throw new FirestoreError(v.INVALID_ARGUMENT, "mockUserToken must contain 'sub' or 'user_id' field!");
|
|
18222
18222
|
n = new User(s);
|
|
18223
18223
|
}
|
|
18224
18224
|
e._authCredentials = new __PRIVATE_EmulatorAuthCredentialsProvider(new __PRIVATE_OAuthToken(t, n));
|
|
@@ -18338,7 +18338,7 @@ function collection(e, t, ...n) {
|
|
|
18338
18338
|
return __PRIVATE_validateCollectionPath(r), new CollectionReference(e, /* converter= */ null, r);
|
|
18339
18339
|
}
|
|
18340
18340
|
{
|
|
18341
|
-
if (!(e instanceof DocumentReference || e instanceof CollectionReference)) throw new FirestoreError(
|
|
18341
|
+
if (!(e instanceof DocumentReference || e instanceof CollectionReference)) throw new FirestoreError(v.INVALID_ARGUMENT, "Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");
|
|
18342
18342
|
const r = e._path.child(ResourcePath.fromString(t, ...n));
|
|
18343
18343
|
return __PRIVATE_validateCollectionPath(r), new CollectionReference(e.firestore,
|
|
18344
18344
|
/* converter= */ null, r);
|
|
@@ -18359,7 +18359,7 @@ function collection(e, t, ...n) {
|
|
|
18359
18359
|
* @returns The created `Query`.
|
|
18360
18360
|
*/ function collectionGroup(e, t) {
|
|
18361
18361
|
if (e = __PRIVATE_cast(e, Firestore$1), __PRIVATE_validateNonEmptyArgument("collectionGroup", "collection id", t),
|
|
18362
|
-
t.indexOf("/") >= 0) throw new FirestoreError(
|
|
18362
|
+
t.indexOf("/") >= 0) throw new FirestoreError(v.INVALID_ARGUMENT, `Invalid collection ID '${t}' passed to function collectionGroup(). Collection IDs must not contain '/'.`);
|
|
18363
18363
|
return new Query(e,
|
|
18364
18364
|
/* converter= */ null, function __PRIVATE_newQueryForCollectionGroup(e) {
|
|
18365
18365
|
return new __PRIVATE_QueryImpl(ResourcePath.emptyPath(), e);
|
|
@@ -18377,7 +18377,7 @@ function doc(e, t, ...n) {
|
|
|
18377
18377
|
/* converter= */ null, new DocumentKey(r));
|
|
18378
18378
|
}
|
|
18379
18379
|
{
|
|
18380
|
-
if (!(e instanceof DocumentReference || e instanceof CollectionReference)) throw new FirestoreError(
|
|
18380
|
+
if (!(e instanceof DocumentReference || e instanceof CollectionReference)) throw new FirestoreError(v.INVALID_ARGUMENT, "Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");
|
|
18381
18381
|
const r = e._path.child(ResourcePath.fromString(t, ...n));
|
|
18382
18382
|
return __PRIVATE_validateDocumentPath(r), new DocumentReference(e.firestore, e instanceof CollectionReference ? e.converter : null, new DocumentKey(r));
|
|
18383
18383
|
}
|
|
@@ -18737,7 +18737,7 @@ class LoadBundleTask {
|
|
|
18737
18737
|
* Constant used to indicate the LRU garbage collection should be disabled.
|
|
18738
18738
|
* Set this value as the `cacheSizeBytes` on the settings passed to the
|
|
18739
18739
|
* {@link Firestore} instance.
|
|
18740
|
-
*/ const
|
|
18740
|
+
*/ const Se = -1;
|
|
18741
18741
|
|
|
18742
18742
|
/**
|
|
18743
18743
|
* The Cloud Firestore service interface.
|
|
@@ -18781,10 +18781,10 @@ class LoadBundleTask {
|
|
|
18781
18781
|
identifier: n
|
|
18782
18782
|
}), i = r.getOptions(n);
|
|
18783
18783
|
if (deepEqual(i, t)) return e;
|
|
18784
|
-
throw new FirestoreError(
|
|
18784
|
+
throw new FirestoreError(v.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.");
|
|
18785
18785
|
}
|
|
18786
|
-
if (void 0 !== t.cacheSizeBytes && void 0 !== t.localCache) throw new FirestoreError(
|
|
18787
|
-
if (void 0 !== t.cacheSizeBytes && -1 !== t.cacheSizeBytes && t.cacheSizeBytes < 1048576) throw new FirestoreError(
|
|
18786
|
+
if (void 0 !== t.cacheSizeBytes && void 0 !== t.localCache) throw new FirestoreError(v.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");
|
|
18787
|
+
if (void 0 !== t.cacheSizeBytes && -1 !== t.cacheSizeBytes && t.cacheSizeBytes < 1048576) throw new FirestoreError(v.INVALID_ARGUMENT, "cacheSizeBytes must be at least 1048576");
|
|
18788
18788
|
return r.initialize({
|
|
18789
18789
|
options: t,
|
|
18790
18790
|
instanceIdentifier: n
|
|
@@ -18853,7 +18853,7 @@ function __PRIVATE_configureFirestore(e) {
|
|
|
18853
18853
|
*/ function enableIndexedDbPersistence(e, t) {
|
|
18854
18854
|
__PRIVATE_verifyNotInitialized(e = __PRIVATE_cast(e, Firestore));
|
|
18855
18855
|
const n = ensureFirestoreConfigured(e);
|
|
18856
|
-
if (n._uninitializedComponentsProvider) throw new FirestoreError(
|
|
18856
|
+
if (n._uninitializedComponentsProvider) throw new FirestoreError(v.FAILED_PRECONDITION, "SDK cache is already specified.");
|
|
18857
18857
|
__PRIVATE_logWarn("enableIndexedDbPersistence() will be deprecated in the future, you can use `FirestoreSettings.cache` instead.");
|
|
18858
18858
|
const r = e._freezeSettings(), i = new OnlineComponentProvider;
|
|
18859
18859
|
return __PRIVATE_setPersistenceProviders(n, i, new __PRIVATE_IndexedDbOfflineComponentProvider(i, r.cacheSizeBytes, null == t ? void 0 : t.forceOwnership));
|
|
@@ -18887,7 +18887,7 @@ function __PRIVATE_configureFirestore(e) {
|
|
|
18887
18887
|
*/ function enableMultiTabIndexedDbPersistence(e) {
|
|
18888
18888
|
__PRIVATE_verifyNotInitialized(e = __PRIVATE_cast(e, Firestore));
|
|
18889
18889
|
const t = ensureFirestoreConfigured(e);
|
|
18890
|
-
if (t._uninitializedComponentsProvider) throw new FirestoreError(
|
|
18890
|
+
if (t._uninitializedComponentsProvider) throw new FirestoreError(v.FAILED_PRECONDITION, "SDK cache is already specified.");
|
|
18891
18891
|
__PRIVATE_logWarn("enableMultiTabIndexedDbPersistence() will be deprecated in the future, you can use `FirestoreSettings.cache` instead.");
|
|
18892
18892
|
const n = e._freezeSettings(), r = new OnlineComponentProvider;
|
|
18893
18893
|
return __PRIVATE_setPersistenceProviders(t, r, new __PRIVATE_MultiTabOfflineComponentProvider(r, n.cacheSizeBytes));
|
|
@@ -18935,7 +18935,7 @@ function __PRIVATE_configureFirestore(e) {
|
|
|
18935
18935
|
* @returns A `Promise` that is resolved when the persistent storage is
|
|
18936
18936
|
* cleared. Otherwise, the promise is rejected with an error.
|
|
18937
18937
|
*/ function clearIndexedDbPersistence(e) {
|
|
18938
|
-
if (e._initialized && !e._terminated) throw new FirestoreError(
|
|
18938
|
+
if (e._initialized && !e._terminated) throw new FirestoreError(v.FAILED_PRECONDITION, "Persistence can only be cleared before a Firestore instance is initialized or after it is terminated.");
|
|
18939
18939
|
const t = new __PRIVATE_Deferred;
|
|
18940
18940
|
return e._queue.enqueueAndForgetEvenWhileRestricted((async () => {
|
|
18941
18941
|
try {
|
|
@@ -19049,7 +19049,7 @@ function __PRIVATE_configureFirestore(e) {
|
|
|
19049
19049
|
}
|
|
19050
19050
|
|
|
19051
19051
|
function __PRIVATE_verifyNotInitialized(e) {
|
|
19052
|
-
if (e._initialized || e._terminated) throw new FirestoreError(
|
|
19052
|
+
if (e._initialized || e._terminated) throw new FirestoreError(v.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.");
|
|
19053
19053
|
}
|
|
19054
19054
|
|
|
19055
19055
|
/**
|
|
@@ -19158,7 +19158,7 @@ class AggregateField {
|
|
|
19158
19158
|
try {
|
|
19159
19159
|
return new Bytes(ByteString.fromBase64String(e));
|
|
19160
19160
|
} catch (e) {
|
|
19161
|
-
throw new FirestoreError(
|
|
19161
|
+
throw new FirestoreError(v.INVALID_ARGUMENT, "Failed to construct data from Base64 string: " + e);
|
|
19162
19162
|
}
|
|
19163
19163
|
}
|
|
19164
19164
|
/**
|
|
@@ -19230,7 +19230,7 @@ class AggregateField {
|
|
|
19230
19230
|
* @param fieldNames - A list of field names.
|
|
19231
19231
|
*/
|
|
19232
19232
|
constructor(...e) {
|
|
19233
|
-
for (let t = 0; t < e.length; ++t) if (0 === e[t].length) throw new FirestoreError(
|
|
19233
|
+
for (let t = 0; t < e.length; ++t) if (0 === e[t].length) throw new FirestoreError(v.INVALID_ARGUMENT, "Invalid field name at argument $(i + 1). Field names must not be empty.");
|
|
19234
19234
|
this._internalPath = new FieldPath$1(e);
|
|
19235
19235
|
}
|
|
19236
19236
|
/**
|
|
@@ -19309,8 +19309,8 @@ class AggregateField {
|
|
|
19309
19309
|
* @param longitude - The longitude as number between -180 and 180.
|
|
19310
19310
|
*/
|
|
19311
19311
|
constructor(e, t) {
|
|
19312
|
-
if (!isFinite(e) || e < -90 || e > 90) throw new FirestoreError(
|
|
19313
|
-
if (!isFinite(t) || t < -180 || t > 180) throw new FirestoreError(
|
|
19312
|
+
if (!isFinite(e) || e < -90 || e > 90) throw new FirestoreError(v.INVALID_ARGUMENT, "Latitude must be a number between -90 and 90, but was: " + e);
|
|
19313
|
+
if (!isFinite(t) || t < -180 || t > 180) throw new FirestoreError(v.INVALID_ARGUMENT, "Longitude must be a number between -180 and 180, but was: " + t);
|
|
19314
19314
|
this._lat = e, this._long = t;
|
|
19315
19315
|
}
|
|
19316
19316
|
/**
|
|
@@ -19360,7 +19360,7 @@ class AggregateField {
|
|
|
19360
19360
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
19361
19361
|
* See the License for the specific language governing permissions and
|
|
19362
19362
|
* limitations under the License.
|
|
19363
|
-
*/ const
|
|
19363
|
+
*/ const be = /^__.*__$/;
|
|
19364
19364
|
|
|
19365
19365
|
/** The result of parsing document data (e.g. for a setData call). */ class ParsedSetData {
|
|
19366
19366
|
constructor(e, t, n) {
|
|
@@ -19471,7 +19471,7 @@ function __PRIVATE_isWrite(e) {
|
|
|
19471
19471
|
}
|
|
19472
19472
|
wu(e) {
|
|
19473
19473
|
if (0 === e.length) throw this.Du("Document fields must not be empty");
|
|
19474
|
-
if (__PRIVATE_isWrite(this.fu) &&
|
|
19474
|
+
if (__PRIVATE_isWrite(this.fu) && be.test(e)) throw this.Du('Document fields cannot begin and end with "__"');
|
|
19475
19475
|
}
|
|
19476
19476
|
}
|
|
19477
19477
|
|
|
@@ -19508,7 +19508,7 @@ function __PRIVATE_newUserDataReader(e) {
|
|
|
19508
19508
|
const e = [];
|
|
19509
19509
|
for (const r of s.mergeFields) {
|
|
19510
19510
|
const i = __PRIVATE_fieldPathFromArgument$1(t, r, n);
|
|
19511
|
-
if (!o.contains(i)) throw new FirestoreError(
|
|
19511
|
+
if (!o.contains(i)) throw new FirestoreError(v.INVALID_ARGUMENT, `Field '${i}' is specified in your field mask but missing from your input data.`);
|
|
19512
19512
|
__PRIVATE_fieldMaskContains(e, i) || e.push(i);
|
|
19513
19513
|
}
|
|
19514
19514
|
a = new FieldMask(e), u = o.fieldTransforms.filter((e => a.covers(e.field)));
|
|
@@ -19625,7 +19625,7 @@ class __PRIVATE_NumericIncrementFieldValueImpl extends FieldValue {
|
|
|
19625
19625
|
|
|
19626
19626
|
/** Parse update data from a list of field/value arguments. */ function __PRIVATE_parseUpdateVarargs(e, t, n, r, i, s) {
|
|
19627
19627
|
const o = e.Fu(1 /* UserDataSource.Update */ , t, n), _ = [ __PRIVATE_fieldPathFromArgument$1(t, r, n) ], a = [ i ];
|
|
19628
|
-
if (s.length % 2 != 0) throw new FirestoreError(
|
|
19628
|
+
if (s.length % 2 != 0) throw new FirestoreError(v.INVALID_ARGUMENT, `Function ${t}() needs to be called with an even number of arguments that alternate between field names and values.`);
|
|
19629
19629
|
for (let e = 0; e < s.length; e += 2) _.push(__PRIVATE_fieldPathFromArgument$1(t, s[e])),
|
|
19630
19630
|
a.push(s[e + 1]);
|
|
19631
19631
|
const u = [], c = ObjectValue.empty();
|
|
@@ -19826,7 +19826,7 @@ function __PRIVATE_validatePlainObject(e, t, n) {
|
|
|
19826
19826
|
|
|
19827
19827
|
/**
|
|
19828
19828
|
* Matches any characters in a field path string that are reserved.
|
|
19829
|
-
*/ const
|
|
19829
|
+
*/ const De = new RegExp("[~\\*/\\[\\]]");
|
|
19830
19830
|
|
|
19831
19831
|
/**
|
|
19832
19832
|
* Wraps fromDotSeparatedString with an error message about the method that
|
|
@@ -19837,7 +19837,7 @@ function __PRIVATE_validatePlainObject(e, t, n) {
|
|
|
19837
19837
|
* @param targetDoc - The document against which the field path will be
|
|
19838
19838
|
* evaluated.
|
|
19839
19839
|
*/ function __PRIVATE_fieldPathFromDotSeparatedString(e, t, n) {
|
|
19840
|
-
if (t.search(
|
|
19840
|
+
if (t.search(De) >= 0) throw __PRIVATE_createError(`Invalid field path (${t}). Paths must not contain '~', '*', '/', '[', or ']'`, e,
|
|
19841
19841
|
/* hasConverter= */ !1,
|
|
19842
19842
|
/* path= */ void 0, n);
|
|
19843
19843
|
try {
|
|
@@ -19855,7 +19855,7 @@ function __PRIVATE_createError(e, t, n, r, i) {
|
|
|
19855
19855
|
n && (_ += " (via `toFirestore()`)"), _ += ". ";
|
|
19856
19856
|
let a = "";
|
|
19857
19857
|
return (s || o) && (a += " (found", s && (a += ` in field ${r}`), o && (a += ` in document ${i}`),
|
|
19858
|
-
a += ")"), new FirestoreError(
|
|
19858
|
+
a += ")"), new FirestoreError(v.INVALID_ARGUMENT, _ + e + a);
|
|
19859
19859
|
}
|
|
19860
19860
|
|
|
19861
19861
|
/** Checks `haystack` if FieldPath `needle` is present. Runs in O(n). */ function __PRIVATE_fieldMaskContains(e, t) {
|
|
@@ -19992,7 +19992,7 @@ function __PRIVATE_createError(e, t, n, r, i) {
|
|
|
19992
19992
|
* See the License for the specific language governing permissions and
|
|
19993
19993
|
* limitations under the License.
|
|
19994
19994
|
*/ function __PRIVATE_validateHasExplicitOrderByForLimitToLast(e) {
|
|
19995
|
-
if ("L" /* LimitType.Last */ === e.limitType && 0 === e.explicitOrderBy.length) throw new FirestoreError(
|
|
19995
|
+
if ("L" /* LimitType.Last */ === e.limitType && 0 === e.explicitOrderBy.length) throw new FirestoreError(v.UNIMPLEMENTED, "limitToLast() queries require specifying at least one orderBy() clause");
|
|
19996
19996
|
}
|
|
19997
19997
|
|
|
19998
19998
|
/**
|
|
@@ -20013,7 +20013,7 @@ function query(e, t, ...n) {
|
|
|
20013
20013
|
let r = [];
|
|
20014
20014
|
t instanceof AppliableConstraint && r.push(t), r = r.concat(n), function __PRIVATE_validateQueryConstraintArray(e) {
|
|
20015
20015
|
const t = e.filter((e => e instanceof QueryCompositeFilterConstraint)).length, n = e.filter((e => e instanceof QueryFieldFilterConstraint)).length;
|
|
20016
|
-
if (t > 1 || t > 0 && n > 0) throw new FirestoreError(
|
|
20016
|
+
if (t > 1 || t > 0 && n > 0) throw new FirestoreError(v.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(...)))`.");
|
|
20017
20017
|
}
|
|
20018
20018
|
/**
|
|
20019
20019
|
* @license
|
|
@@ -20067,7 +20067,7 @@ function query(e, t, ...n) {
|
|
|
20067
20067
|
const t = __PRIVATE_newUserDataReader(e.firestore), n = function __PRIVATE_newQueryFilter(e, t, n, r, i, s, o) {
|
|
20068
20068
|
let _;
|
|
20069
20069
|
if (i.isKeyField()) {
|
|
20070
|
-
if ("array-contains" /* Operator.ARRAY_CONTAINS */ === s || "array-contains-any" /* Operator.ARRAY_CONTAINS_ANY */ === s) throw new FirestoreError(
|
|
20070
|
+
if ("array-contains" /* Operator.ARRAY_CONTAINS */ === s || "array-contains-any" /* Operator.ARRAY_CONTAINS_ANY */ === s) throw new FirestoreError(v.INVALID_ARGUMENT, `Invalid Query. You can't perform '${s}' queries on documentId().`);
|
|
20071
20071
|
if ("in" /* Operator.IN */ === s || "not-in" /* Operator.NOT_IN */ === s) {
|
|
20072
20072
|
__PRIVATE_validateDisjunctiveFilterElements(o, s);
|
|
20073
20073
|
const t = [];
|
|
@@ -20194,8 +20194,8 @@ function query(e, t, ...n) {
|
|
|
20194
20194
|
}
|
|
20195
20195
|
_apply(e) {
|
|
20196
20196
|
const t = function __PRIVATE_newQueryOrderBy(e, t, n) {
|
|
20197
|
-
if (null !== e.startAt) throw new FirestoreError(
|
|
20198
|
-
if (null !== e.endAt) throw new FirestoreError(
|
|
20197
|
+
if (null !== e.startAt) throw new FirestoreError(v.INVALID_ARGUMENT, "Invalid query. You must not call startAt() or startAfter() before calling orderBy().");
|
|
20198
|
+
if (null !== e.endAt) throw new FirestoreError(v.INVALID_ARGUMENT, "Invalid query. You must not call endAt() or endBefore() before calling orderBy().");
|
|
20199
20199
|
return new OrderBy(t, n);
|
|
20200
20200
|
}
|
|
20201
20201
|
/**
|
|
@@ -20353,7 +20353,7 @@ function endAt(...e) {
|
|
|
20353
20353
|
|
|
20354
20354
|
/** Helper function to create a bound from a document or fields */ function __PRIVATE_newQueryBoundFromDocOrFields(e, t, n, r) {
|
|
20355
20355
|
if (n[0] = getModularInstance(n[0]), n[0] instanceof DocumentSnapshot$1) return function __PRIVATE_newQueryBoundFromDocument(e, t, n, r, i) {
|
|
20356
|
-
if (!r) throw new FirestoreError(
|
|
20356
|
+
if (!r) throw new FirestoreError(v.NOT_FOUND, `Can't use a DocumentSnapshot that doesn't exist for ${n}().`);
|
|
20357
20357
|
const s = [];
|
|
20358
20358
|
// Because people expect to continue/end a query at the exact document
|
|
20359
20359
|
// provided, we need to use the implicit sort order rather than the explicit
|
|
@@ -20364,10 +20364,10 @@ function endAt(...e) {
|
|
|
20364
20364
|
// results.
|
|
20365
20365
|
for (const n of __PRIVATE_queryNormalizedOrderBy(e)) if (n.field.isKeyField()) s.push(__PRIVATE_refValue(t, r.key)); else {
|
|
20366
20366
|
const e = r.data.field(n.field);
|
|
20367
|
-
if (__PRIVATE_isServerTimestamp(e)) throw new FirestoreError(
|
|
20367
|
+
if (__PRIVATE_isServerTimestamp(e)) throw new FirestoreError(v.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.)');
|
|
20368
20368
|
if (null === e) {
|
|
20369
20369
|
const e = n.field.canonicalString();
|
|
20370
|
-
throw new FirestoreError(
|
|
20370
|
+
throw new FirestoreError(v.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.`);
|
|
20371
20371
|
}
|
|
20372
20372
|
s.push(e);
|
|
20373
20373
|
}
|
|
@@ -20381,15 +20381,15 @@ function endAt(...e) {
|
|
|
20381
20381
|
return function __PRIVATE_newQueryBoundFromFields(e, t, n, r, i, s) {
|
|
20382
20382
|
// Use explicit order by's because it has to match the query the user made
|
|
20383
20383
|
const o = e.explicitOrderBy;
|
|
20384
|
-
if (i.length > o.length) throw new FirestoreError(
|
|
20384
|
+
if (i.length > o.length) throw new FirestoreError(v.INVALID_ARGUMENT, `Too many arguments provided to ${r}(). The number of arguments must be less than or equal to the number of orderBy() clauses`);
|
|
20385
20385
|
const _ = [];
|
|
20386
20386
|
for (let s = 0; s < i.length; s++) {
|
|
20387
20387
|
const a = i[s];
|
|
20388
20388
|
if (o[s].field.isKeyField()) {
|
|
20389
|
-
if ("string" != typeof a) throw new FirestoreError(
|
|
20390
|
-
if (!__PRIVATE_isCollectionGroupQuery(e) && -1 !== a.indexOf("/")) throw new FirestoreError(
|
|
20389
|
+
if ("string" != typeof a) throw new FirestoreError(v.INVALID_ARGUMENT, `Invalid query. Expected a string for document ID in ${r}(), but got a ${typeof a}`);
|
|
20390
|
+
if (!__PRIVATE_isCollectionGroupQuery(e) && -1 !== a.indexOf("/")) throw new FirestoreError(v.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.`);
|
|
20391
20391
|
const n = e.path.child(ResourcePath.fromString(a));
|
|
20392
|
-
if (!DocumentKey.isDocumentKey(n)) throw new FirestoreError(
|
|
20392
|
+
if (!DocumentKey.isDocumentKey(n)) throw new FirestoreError(v.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.`);
|
|
20393
20393
|
const i = new DocumentKey(n);
|
|
20394
20394
|
_.push(__PRIVATE_refValue(t, i));
|
|
20395
20395
|
} else {
|
|
@@ -20409,21 +20409,21 @@ function endAt(...e) {
|
|
|
20409
20409
|
|
|
20410
20410
|
function __PRIVATE_parseDocumentIdValue(e, t, n) {
|
|
20411
20411
|
if ("string" == typeof (n = getModularInstance(n))) {
|
|
20412
|
-
if ("" === n) throw new FirestoreError(
|
|
20413
|
-
if (!__PRIVATE_isCollectionGroupQuery(t) && -1 !== n.indexOf("/")) throw new FirestoreError(
|
|
20412
|
+
if ("" === n) throw new FirestoreError(v.INVALID_ARGUMENT, "Invalid query. When querying with documentId(), you must provide a valid document ID, but it was an empty string.");
|
|
20413
|
+
if (!__PRIVATE_isCollectionGroupQuery(t) && -1 !== n.indexOf("/")) throw new FirestoreError(v.INVALID_ARGUMENT, `Invalid query. When querying a collection by documentId(), you must provide a plain document ID, but '${n}' contains a '/' character.`);
|
|
20414
20414
|
const r = t.path.child(ResourcePath.fromString(n));
|
|
20415
|
-
if (!DocumentKey.isDocumentKey(r)) throw new FirestoreError(
|
|
20415
|
+
if (!DocumentKey.isDocumentKey(r)) throw new FirestoreError(v.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}).`);
|
|
20416
20416
|
return __PRIVATE_refValue(e, new DocumentKey(r));
|
|
20417
20417
|
}
|
|
20418
20418
|
if (n instanceof DocumentReference) return __PRIVATE_refValue(e, n._key);
|
|
20419
|
-
throw new FirestoreError(
|
|
20419
|
+
throw new FirestoreError(v.INVALID_ARGUMENT, `Invalid query. When querying with documentId(), you must provide a valid string or a DocumentReference, but it was: ${__PRIVATE_valueDescription(n)}.`);
|
|
20420
20420
|
}
|
|
20421
20421
|
|
|
20422
20422
|
/**
|
|
20423
20423
|
* Validates that the value passed into a disjunctive filter satisfies all
|
|
20424
20424
|
* array requirements.
|
|
20425
20425
|
*/ function __PRIVATE_validateDisjunctiveFilterElements(e, t) {
|
|
20426
|
-
if (!Array.isArray(e) || 0 === e.length) throw new FirestoreError(
|
|
20426
|
+
if (!Array.isArray(e) || 0 === e.length) throw new FirestoreError(v.INVALID_ARGUMENT, `Invalid Query. A non-empty array is required for '${t.toString()}' filters.`);
|
|
20427
20427
|
}
|
|
20428
20428
|
|
|
20429
20429
|
/**
|
|
@@ -20457,11 +20457,11 @@ function __PRIVATE_parseDocumentIdValue(e, t, n) {
|
|
|
20457
20457
|
}(t.op));
|
|
20458
20458
|
if (null !== n)
|
|
20459
20459
|
// Special case when it's a duplicate op to give a slightly clearer error message.
|
|
20460
|
-
throw n === t.op ? new FirestoreError(
|
|
20460
|
+
throw n === t.op ? new FirestoreError(v.INVALID_ARGUMENT, `Invalid query. You cannot use more than one '${t.op.toString()}' filter.`) : new FirestoreError(v.INVALID_ARGUMENT, `Invalid query. You cannot use '${t.op.toString()}' filters with '${n.toString()}' filters.`);
|
|
20461
20461
|
}
|
|
20462
20462
|
|
|
20463
20463
|
function __PRIVATE_validateQueryFilterConstraint(e, t) {
|
|
20464
|
-
if (!(t instanceof QueryFieldFilterConstraint || t instanceof QueryCompositeFilterConstraint)) throw new FirestoreError(
|
|
20464
|
+
if (!(t instanceof QueryFieldFilterConstraint || t instanceof QueryCompositeFilterConstraint)) throw new FirestoreError(v.INVALID_ARGUMENT, `Function ${e}() requires AppliableConstraints created with a call to 'where(...)', 'or(...)', or 'and(...)'.`);
|
|
20465
20465
|
}
|
|
20466
20466
|
|
|
20467
20467
|
class AbstractUserDataWriter {
|
|
@@ -20833,7 +20833,7 @@ class __PRIVATE_LiteUserDataWriter extends AbstractUserDataWriter {
|
|
|
20833
20833
|
* snapshot events.
|
|
20834
20834
|
*/ docChanges(e = {}) {
|
|
20835
20835
|
const t = !!e.includeMetadataChanges;
|
|
20836
|
-
if (t && this._snapshot.excludesMetadataChanges) throw new FirestoreError(
|
|
20836
|
+
if (t && this._snapshot.excludesMetadataChanges) throw new FirestoreError(v.INVALID_ARGUMENT, "To include metadata changes with your document changes, you must also pass { includeMetadataChanges:true } to onSnapshot().");
|
|
20837
20837
|
return this._cachedChanges && this._cachedChangesIncludeMetadataChanges === t || (this._cachedChanges =
|
|
20838
20838
|
/** Calculates the array of `DocumentChange`s for a given `ViewSnapshot`. */
|
|
20839
20839
|
function __PRIVATE_changesFromSnapshot(e, t) {
|
|
@@ -21373,7 +21373,7 @@ class __PRIVATE_MultiTabManagerImpl {
|
|
|
21373
21373
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
21374
21374
|
* See the License for the specific language governing permissions and
|
|
21375
21375
|
* limitations under the License.
|
|
21376
|
-
*/ const
|
|
21376
|
+
*/ const Ce = {
|
|
21377
21377
|
maxAttempts: 5
|
|
21378
21378
|
};
|
|
21379
21379
|
|
|
@@ -21447,12 +21447,12 @@ class WriteBatch {
|
|
|
21447
21447
|
return this._verifyNotCommitted(), this._committed = !0, this._mutations.length > 0 ? this._commitHandler(this._mutations) : Promise.resolve();
|
|
21448
21448
|
}
|
|
21449
21449
|
_verifyNotCommitted() {
|
|
21450
|
-
if (this._committed) throw new FirestoreError(
|
|
21450
|
+
if (this._committed) throw new FirestoreError(v.FAILED_PRECONDITION, "A write batch can no longer be used after commit() has been called.");
|
|
21451
21451
|
}
|
|
21452
21452
|
}
|
|
21453
21453
|
|
|
21454
21454
|
function __PRIVATE_validateReference(e, t) {
|
|
21455
|
-
if ((e = getModularInstance(e)).firestore !== t) throw new FirestoreError(
|
|
21455
|
+
if ((e = getModularInstance(e)).firestore !== t) throw new FirestoreError(v.INVALID_ARGUMENT, "Provided document reference is from a different Firestore instance.");
|
|
21456
21456
|
return e;
|
|
21457
21457
|
}
|
|
21458
21458
|
|
|
@@ -21585,9 +21585,9 @@ class Transaction extends class Transaction$1 {
|
|
|
21585
21585
|
* rejected promise with the corresponding failure error is returned.
|
|
21586
21586
|
*/ function runTransaction(e, t, n) {
|
|
21587
21587
|
e = __PRIVATE_cast(e, Firestore);
|
|
21588
|
-
const r = Object.assign(Object.assign({},
|
|
21588
|
+
const r = Object.assign(Object.assign({}, Ce), n);
|
|
21589
21589
|
!function __PRIVATE_validateTransactionOptions(e) {
|
|
21590
|
-
if (e.maxAttempts < 1) throw new FirestoreError(
|
|
21590
|
+
if (e.maxAttempts < 1) throw new FirestoreError(v.INVALID_ARGUMENT, "Max attempts must be at least 1");
|
|
21591
21591
|
}(r);
|
|
21592
21592
|
return function __PRIVATE_firestoreClientTransaction(e, t, n) {
|
|
21593
21593
|
const r = new __PRIVATE_Deferred;
|
|
@@ -21741,7 +21741,7 @@ class Transaction extends class Transaction$1 {
|
|
|
21741
21741
|
try {
|
|
21742
21742
|
return JSON.parse(e);
|
|
21743
21743
|
} catch (e) {
|
|
21744
|
-
throw new FirestoreError(
|
|
21744
|
+
throw new FirestoreError(v.INVALID_ARGUMENT, "Failed to parse JSON: " + (null == e ? void 0 : e.message));
|
|
21745
21745
|
}
|
|
21746
21746
|
}(e) : e, n = [];
|
|
21747
21747
|
if (Array.isArray(t.indexes)) for (const e of t.indexes) {
|
|
@@ -21758,7 +21758,7 @@ class Transaction extends class Transaction$1 {
|
|
|
21758
21758
|
}
|
|
21759
21759
|
|
|
21760
21760
|
function __PRIVATE_tryGetString(e, t) {
|
|
21761
|
-
if ("string" != typeof e[t]) throw new FirestoreError(
|
|
21761
|
+
if ("string" != typeof e[t]) throw new FirestoreError(v.INVALID_ARGUMENT, "Missing string value for: " + t);
|
|
21762
21762
|
return e[t];
|
|
21763
21763
|
}
|
|
21764
21764
|
|
|
@@ -21801,12 +21801,12 @@ function __PRIVATE_tryGetString(e, t) {
|
|
|
21801
21801
|
*/ function getPersistentCacheIndexManager(e) {
|
|
21802
21802
|
var t;
|
|
21803
21803
|
e = __PRIVATE_cast(e, Firestore);
|
|
21804
|
-
const n =
|
|
21804
|
+
const n = ve.get(e);
|
|
21805
21805
|
if (n) return n;
|
|
21806
21806
|
const r = ensureFirestoreConfigured(e);
|
|
21807
21807
|
if ("persistent" !== (null === (t = r._uninitializedComponentsProvider) || void 0 === t ? void 0 : t._offlineKind)) return null;
|
|
21808
21808
|
const i = new PersistentCacheIndexManager(r);
|
|
21809
|
-
return
|
|
21809
|
+
return ve.set(e, i), i;
|
|
21810
21810
|
}
|
|
21811
21811
|
|
|
21812
21812
|
/**
|
|
@@ -21849,7 +21849,7 @@ function __PRIVATE_setPersistentCacheIndexAutoCreationEnabled(e, t) {
|
|
|
21849
21849
|
* Use a `WeakMap` so that the mapping will be automatically dropped when the
|
|
21850
21850
|
* `Firestore` instance is garbage collected. This emulates a private member
|
|
21851
21851
|
* as described in https://goo.gle/454yvug.
|
|
21852
|
-
*/ const
|
|
21852
|
+
*/ const ve = new WeakMap;
|
|
21853
21853
|
|
|
21854
21854
|
/**
|
|
21855
21855
|
* @license
|
|
@@ -21957,10 +21957,10 @@ function _internalQueryToProtoQueryTarget(e) {
|
|
|
21957
21957
|
this.Ou = new Map;
|
|
21958
21958
|
}
|
|
21959
21959
|
static get instance() {
|
|
21960
|
-
return
|
|
21961
|
-
if (
|
|
21962
|
-
|
|
21963
|
-
}(
|
|
21960
|
+
return Fe || (Fe = new __PRIVATE_TestingHooksSpiImpl, function __PRIVATE_setTestingHooksSpi(e) {
|
|
21961
|
+
if (Pe) throw new Error("a TestingHooksSpi instance is already set");
|
|
21962
|
+
Pe = e;
|
|
21963
|
+
}(Fe)), Fe;
|
|
21964
21964
|
}
|
|
21965
21965
|
et(e) {
|
|
21966
21966
|
this.Ou.forEach((t => t(e)));
|
|
@@ -21971,7 +21971,7 @@ function _internalQueryToProtoQueryTarget(e) {
|
|
|
21971
21971
|
}
|
|
21972
21972
|
}
|
|
21973
21973
|
|
|
21974
|
-
let
|
|
21974
|
+
let Fe = null;
|
|
21975
21975
|
|
|
21976
21976
|
/**
|
|
21977
21977
|
* Cloud Firestore
|
|
@@ -21979,19 +21979,19 @@ let ve = null;
|
|
|
21979
21979
|
* @packageDocumentation
|
|
21980
21980
|
*/ !function __PRIVATE_registerFirestore(e, t = !0) {
|
|
21981
21981
|
!function __PRIVATE_setSDKVersion(e) {
|
|
21982
|
-
|
|
21982
|
+
D = e;
|
|
21983
21983
|
}(SDK_VERSION), _registerComponent(new Component("firestore", ((e, {instanceIdentifier: n, options: r}) => {
|
|
21984
21984
|
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) {
|
|
21985
|
-
if (!Object.prototype.hasOwnProperty.apply(e.options, [ "projectId" ])) throw new FirestoreError(
|
|
21985
|
+
if (!Object.prototype.hasOwnProperty.apply(e.options, [ "projectId" ])) throw new FirestoreError(v.INVALID_ARGUMENT, '"projectId" not provided in firebase.initializeApp.');
|
|
21986
21986
|
return new DatabaseId(e.options.projectId, t);
|
|
21987
21987
|
}(i, n), i);
|
|
21988
21988
|
return r = Object.assign({
|
|
21989
21989
|
useFetchStreams: t
|
|
21990
21990
|
}, r), s._setSettings(r), s;
|
|
21991
|
-
}), "PUBLIC").setMultipleInstances(!0)), registerVersion(S,
|
|
21991
|
+
}), "PUBLIC").setMultipleInstances(!0)), registerVersion(S, b, e),
|
|
21992
21992
|
// BUILD_TARGET will be replaced by values like esm5, esm2017, cjs5, etc during the compilation
|
|
21993
|
-
registerVersion(S,
|
|
21993
|
+
registerVersion(S, b, "esm2017");
|
|
21994
21994
|
}();
|
|
21995
21995
|
|
|
21996
|
-
export { AbstractUserDataWriter, AggregateField, AggregateQuerySnapshot, Bytes,
|
|
21996
|
+
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, WriteBatch, __PRIVATE_AutoId as _AutoId, ByteString as _ByteString, DatabaseId as _DatabaseId, DocumentKey as _DocumentKey, __PRIVATE_EmptyAppCheckTokenProvider as _EmptyAppCheckTokenProvider, __PRIVATE_EmptyAuthCredentialsProvider as _EmptyAuthCredentialsProvider, FieldPath$1 as _FieldPath, TestingHooks as _TestingHooks, __PRIVATE_cast as _cast, __PRIVATE_debugAssert as _debugAssert, _internalAggregationQueryToProtoRunAggregationQueryRequest, _internalQueryToProtoQueryTarget, __PRIVATE_isBase64Available as _isBase64Available, __PRIVATE_logWarn as _logWarn, __PRIVATE_validateIsNotUsedTogether as _validateIsNotUsedTogether, addDoc, aggregateFieldEqual, aggregateQuerySnapshotEqual, and, arrayRemove, arrayUnion, average, clearIndexedDbPersistence, collection, collectionGroup, connectFirestoreEmulator, count, deleteAllPersistentCacheIndexes, deleteDoc, deleteField, disableNetwork, disablePersistentCacheIndexAutoCreation, doc, documentId, enableIndexedDbPersistence, enableMultiTabIndexedDbPersistence, enableNetwork, enablePersistentCacheIndexAutoCreation, endAt, endBefore, ensureFirestoreConfigured, executeWrite, getAggregateFromServer, getCountFromServer, getDoc, getDocFromCache, getDocFromServer, getDocs, getDocsFromCache, getDocsFromServer, getFirestore, getPersistentCacheIndexManager, increment, initializeFirestore, limit, limitToLast, loadBundle, memoryEagerGarbageCollector, memoryLocalCache, memoryLruGarbageCollector, namedQuery, onSnapshot, onSnapshotsInSync, or, orderBy, persistentLocalCache, persistentMultipleTabManager, persistentSingleTabManager, query, queryEqual, refEqual, runTransaction, serverTimestamp, setDoc, setIndexConfiguration, setLogLevel, snapshotEqual, startAfter, startAt, sum, terminate, updateDoc, waitForPendingWrites, where, writeBatch };
|
|
21997
21997
|
//# sourceMappingURL=index.esm2017.js.map
|