@firebase/firestore 4.7.7 → 4.7.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/firestore/src/util/misc.d.ts +0 -2
- package/dist/index.cjs.js +145 -153
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm2017.js +145 -153
- package/dist/index.esm2017.js.map +1 -1
- package/dist/index.node.cjs.js +41 -52
- package/dist/index.node.cjs.js.map +1 -1
- package/dist/index.node.mjs +41 -52
- package/dist/index.node.mjs.map +1 -1
- package/dist/index.rn.js +156 -164
- package/dist/index.rn.js.map +1 -1
- package/dist/lite/firestore/src/util/misc.d.ts +0 -2
- package/dist/lite/index.browser.esm2017.js +127 -157
- package/dist/lite/index.browser.esm2017.js.map +1 -1
- package/dist/lite/index.cjs.js +127 -157
- package/dist/lite/index.cjs.js.map +1 -1
- package/dist/lite/index.node.cjs.js +97 -127
- package/dist/lite/index.node.cjs.js.map +1 -1
- package/dist/lite/index.node.mjs +97 -127
- package/dist/lite/index.node.mjs.map +1 -1
- package/dist/lite/index.rn.esm2017.js +120 -150
- package/dist/lite/index.rn.esm2017.js.map +1 -1
- package/package.json +3 -3
|
@@ -8,7 +8,7 @@ import { FirebaseError as _, base64 as c, DecodeBase64StringError as l, getDefau
|
|
|
8
8
|
|
|
9
9
|
import { Integer as m } from "@firebase/webchannel-wrapper/bloom-blob";
|
|
10
10
|
|
|
11
|
-
const
|
|
11
|
+
const A = "4.7.8";
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* @license
|
|
@@ -69,7 +69,7 @@ User.MOCK_USER = new User("mock-user");
|
|
|
69
69
|
* See the License for the specific language governing permissions and
|
|
70
70
|
* limitations under the License.
|
|
71
71
|
*/
|
|
72
|
-
let
|
|
72
|
+
let T = "11.3.1";
|
|
73
73
|
|
|
74
74
|
/**
|
|
75
75
|
* @license
|
|
@@ -108,14 +108,14 @@ const P = new a("@firebase/firestore");
|
|
|
108
108
|
function __PRIVATE_logDebug(t, ...e) {
|
|
109
109
|
if (P.logLevel <= u.DEBUG) {
|
|
110
110
|
const r = e.map(__PRIVATE_argToString);
|
|
111
|
-
P.debug(`Firestore (${
|
|
111
|
+
P.debug(`Firestore (${T}): ${t}`, ...r);
|
|
112
112
|
}
|
|
113
113
|
}
|
|
114
114
|
|
|
115
115
|
function __PRIVATE_logError(t, ...e) {
|
|
116
116
|
if (P.logLevel <= u.ERROR) {
|
|
117
117
|
const r = e.map(__PRIVATE_argToString);
|
|
118
|
-
P.error(`Firestore (${
|
|
118
|
+
P.error(`Firestore (${T}): ${t}`, ...r);
|
|
119
119
|
}
|
|
120
120
|
}
|
|
121
121
|
|
|
@@ -124,7 +124,7 @@ function __PRIVATE_logError(t, ...e) {
|
|
|
124
124
|
*/ function __PRIVATE_logWarn(t, ...e) {
|
|
125
125
|
if (P.logLevel <= u.WARN) {
|
|
126
126
|
const r = e.map(__PRIVATE_argToString);
|
|
127
|
-
P.warn(`Firestore (${
|
|
127
|
+
P.warn(`Firestore (${T}): ${t}`, ...r);
|
|
128
128
|
}
|
|
129
129
|
}
|
|
130
130
|
|
|
@@ -185,7 +185,7 @@ function __PRIVATE_logError(t, ...e) {
|
|
|
185
185
|
*/ function fail(t = "Unexpected state") {
|
|
186
186
|
// Log the failure in addition to throw an exception, just in case the
|
|
187
187
|
// exception is swallowed.
|
|
188
|
-
const e = `FIRESTORE (${
|
|
188
|
+
const e = `FIRESTORE (${T}) INTERNAL ASSERTION FAILED: ` + t;
|
|
189
189
|
// NOTE: We don't use FirestoreError here because these are internal failures
|
|
190
190
|
// that cannot be handled by the user. (Also it would create a circular
|
|
191
191
|
// dependency between the error and assert modules which doesn't work.)
|
|
@@ -480,60 +480,6 @@ class DatabaseInfo {
|
|
|
480
480
|
}
|
|
481
481
|
}
|
|
482
482
|
|
|
483
|
-
/**
|
|
484
|
-
* @license
|
|
485
|
-
* Copyright 2020 Google LLC
|
|
486
|
-
*
|
|
487
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
488
|
-
* you may not use this file except in compliance with the License.
|
|
489
|
-
* You may obtain a copy of the License at
|
|
490
|
-
*
|
|
491
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
492
|
-
*
|
|
493
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
494
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
495
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
496
|
-
* See the License for the specific language governing permissions and
|
|
497
|
-
* limitations under the License.
|
|
498
|
-
*/
|
|
499
|
-
/**
|
|
500
|
-
* Generates `nBytes` of random bytes.
|
|
501
|
-
*
|
|
502
|
-
* If `nBytes < 0` , an error will be thrown.
|
|
503
|
-
*/
|
|
504
|
-
function __PRIVATE_randomBytes(t) {
|
|
505
|
-
// Polyfills for IE and WebWorker by using `self` and `msCrypto` when `crypto` is not available.
|
|
506
|
-
const e =
|
|
507
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
508
|
-
"undefined" != typeof self && (self.crypto || self.msCrypto), r = new Uint8Array(t);
|
|
509
|
-
if (e && "function" == typeof e.getRandomValues) e.getRandomValues(r); else
|
|
510
|
-
// Falls back to Math.random
|
|
511
|
-
for (let e = 0; e < t; e++) r[e] = Math.floor(256 * Math.random());
|
|
512
|
-
return r;
|
|
513
|
-
}
|
|
514
|
-
|
|
515
|
-
/**
|
|
516
|
-
* @license
|
|
517
|
-
* Copyright 2023 Google LLC
|
|
518
|
-
*
|
|
519
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
520
|
-
* you may not use this file except in compliance with the License.
|
|
521
|
-
* You may obtain a copy of the License at
|
|
522
|
-
*
|
|
523
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
524
|
-
*
|
|
525
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
526
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
527
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
528
|
-
* See the License for the specific language governing permissions and
|
|
529
|
-
* limitations under the License.
|
|
530
|
-
*/
|
|
531
|
-
/**
|
|
532
|
-
* An instance of the Platform's 'TextEncoder' implementation.
|
|
533
|
-
*/ function __PRIVATE_newTextEncoder() {
|
|
534
|
-
return new TextEncoder;
|
|
535
|
-
}
|
|
536
|
-
|
|
537
483
|
/**
|
|
538
484
|
* @license
|
|
539
485
|
* Copyright 2017 Google LLC
|
|
@@ -550,62 +496,7 @@ function __PRIVATE_randomBytes(t) {
|
|
|
550
496
|
* See the License for the specific language governing permissions and
|
|
551
497
|
* limitations under the License.
|
|
552
498
|
*/
|
|
553
|
-
|
|
554
|
-
* A utility class for generating unique alphanumeric IDs of a specified length.
|
|
555
|
-
*
|
|
556
|
-
* @internal
|
|
557
|
-
* Exported internally for testing purposes.
|
|
558
|
-
*/ class __PRIVATE_AutoId {
|
|
559
|
-
static newId() {
|
|
560
|
-
// Alphanumeric characters
|
|
561
|
-
const t = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", e = 62 * Math.floor(256 / 62);
|
|
562
|
-
// The largest byte value that is a multiple of `char.length`.
|
|
563
|
-
let r = "";
|
|
564
|
-
for (;r.length < 20; ) {
|
|
565
|
-
const n = __PRIVATE_randomBytes(40);
|
|
566
|
-
for (let i = 0; i < n.length; ++i)
|
|
567
|
-
// Only accept values that are [0, maxMultiple), this ensures they can
|
|
568
|
-
// be evenly mapped to indices of `chars` via a modulo operation.
|
|
569
|
-
r.length < 20 && n[i] < e && (r += t.charAt(n[i] % 62));
|
|
570
|
-
}
|
|
571
|
-
return r;
|
|
572
|
-
}
|
|
573
|
-
}
|
|
574
|
-
|
|
575
|
-
function __PRIVATE_primitiveComparator(t, e) {
|
|
576
|
-
return t < e ? -1 : t > e ? 1 : 0;
|
|
577
|
-
}
|
|
578
|
-
|
|
579
|
-
/** Compare strings in UTF-8 encoded byte order */ function __PRIVATE_compareUtf8Strings(t, e) {
|
|
580
|
-
// Convert the string to UTF-8 encoded bytes
|
|
581
|
-
const r = __PRIVATE_newTextEncoder().encode(t), n = __PRIVATE_newTextEncoder().encode(e);
|
|
582
|
-
for (let t = 0; t < Math.min(r.length, n.length); t++) {
|
|
583
|
-
const e = __PRIVATE_primitiveComparator(r[t], n[t]);
|
|
584
|
-
if (0 !== e) return e;
|
|
585
|
-
}
|
|
586
|
-
return __PRIVATE_primitiveComparator(r.length, n.length);
|
|
587
|
-
}
|
|
588
|
-
|
|
589
|
-
/** Helper to compare arrays using isEqual(). */ function __PRIVATE_arrayEquals(t, e, r) {
|
|
590
|
-
return t.length === e.length && t.every(((t, n) => r(t, e[n])));
|
|
591
|
-
}
|
|
592
|
-
|
|
593
|
-
/**
|
|
594
|
-
* @license
|
|
595
|
-
* Copyright 2017 Google LLC
|
|
596
|
-
*
|
|
597
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
598
|
-
* you may not use this file except in compliance with the License.
|
|
599
|
-
* You may obtain a copy of the License at
|
|
600
|
-
*
|
|
601
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
602
|
-
*
|
|
603
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
604
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
605
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
606
|
-
* See the License for the specific language governing permissions and
|
|
607
|
-
* limitations under the License.
|
|
608
|
-
*/ const Q = "__name__";
|
|
499
|
+
const Q = "__name__";
|
|
609
500
|
|
|
610
501
|
/**
|
|
611
502
|
* Path represents an ordered sequence of string segments.
|
|
@@ -673,11 +564,13 @@ function __PRIVATE_primitiveComparator(t, e) {
|
|
|
673
564
|
const r = BasePath.compareSegments(t.get(n), e.get(n));
|
|
674
565
|
if (0 !== r) return r;
|
|
675
566
|
}
|
|
676
|
-
return
|
|
567
|
+
return Math.sign(t.length - e.length);
|
|
677
568
|
}
|
|
678
569
|
static compareSegments(t, e) {
|
|
679
570
|
const r = BasePath.isNumericId(t), n = BasePath.isNumericId(e);
|
|
680
|
-
return r && !n ? -1 : !r && n ? 1 : r && n ? BasePath.extractNumericId(t).compare(BasePath.extractNumericId(e)) :
|
|
571
|
+
return r && !n ? -1 : !r && n ? 1 : r && n ? BasePath.extractNumericId(t).compare(BasePath.extractNumericId(e)) :
|
|
572
|
+
// both non-numeric
|
|
573
|
+
t < e ? -1 : t > e ? 1 : 0;
|
|
681
574
|
}
|
|
682
575
|
// Checks if a segment is a numeric ID (starts with "__id" and ends with "__").
|
|
683
576
|
static isNumericId(t) {
|
|
@@ -1005,7 +898,7 @@ function __PRIVATE_cloneLongPollingOptions(t) {
|
|
|
1005
898
|
/**
|
|
1006
899
|
* The value returned from the most recent invocation of
|
|
1007
900
|
* `generateUniqueDebugId()`, or null if it has never been invoked.
|
|
1008
|
-
*/ let
|
|
901
|
+
*/ let M = null;
|
|
1009
902
|
|
|
1010
903
|
/**
|
|
1011
904
|
* Generates and returns an initial value for `lastUniqueDebugId`.
|
|
@@ -1030,9 +923,9 @@ function __PRIVATE_cloneLongPollingOptions(t) {
|
|
|
1030
923
|
* @return the 10-character generated ID (e.g. "0xa1b2c3d4").
|
|
1031
924
|
*/
|
|
1032
925
|
function __PRIVATE_generateUniqueDebugId() {
|
|
1033
|
-
return null ===
|
|
926
|
+
return null === M ? M = function __PRIVATE_generateInitialUniqueDebugId() {
|
|
1034
927
|
return 268435456 + Math.round(2147483648 * Math.random());
|
|
1035
|
-
}() :
|
|
928
|
+
}() : M++, "0x" + M.toString(16);
|
|
1036
929
|
}
|
|
1037
930
|
|
|
1038
931
|
/**
|
|
@@ -1083,7 +976,7 @@ function __PRIVATE_generateUniqueDebugId() {
|
|
|
1083
976
|
* See the License for the specific language governing permissions and
|
|
1084
977
|
* limitations under the License.
|
|
1085
978
|
*/
|
|
1086
|
-
const
|
|
979
|
+
const x = "RestConnection", k = {
|
|
1087
980
|
BatchGetDocuments: "batchGet",
|
|
1088
981
|
Commit: "commit",
|
|
1089
982
|
RunQuery: "runQuery",
|
|
@@ -1100,7 +993,7 @@ const M = "RestConnection", U = {
|
|
|
1100
993
|
* HTTP).
|
|
1101
994
|
*/
|
|
1102
995
|
class __PRIVATE_RestConnection {
|
|
1103
|
-
get
|
|
996
|
+
get A() {
|
|
1104
997
|
// Both `invokeRPC()` and `invokeStreamingRPC()` use their `path` arguments to determine
|
|
1105
998
|
// where to run the query, and expect the `request` to NOT specify the "path".
|
|
1106
999
|
return !1;
|
|
@@ -1108,18 +1001,18 @@ class __PRIVATE_RestConnection {
|
|
|
1108
1001
|
constructor(t) {
|
|
1109
1002
|
this.databaseInfo = t, this.databaseId = t.databaseId;
|
|
1110
1003
|
const e = t.ssl ? "https" : "http", r = encodeURIComponent(this.databaseId.projectId), n = encodeURIComponent(this.databaseId.database);
|
|
1111
|
-
this.
|
|
1004
|
+
this.T = e + "://" + t.host, this.P = `projects/${r}/databases/${n}`, this.R = this.databaseId.database === $ ? `project_id=${r}` : `project_id=${r}&database_id=${n}`;
|
|
1112
1005
|
}
|
|
1113
1006
|
V(t, e, r, n, i) {
|
|
1114
1007
|
const s = __PRIVATE_generateUniqueDebugId(), o = this.I(t, e.toUriEncodedString());
|
|
1115
|
-
__PRIVATE_logDebug(
|
|
1008
|
+
__PRIVATE_logDebug(x, `Sending RPC '${t}' ${s}:`, o, r);
|
|
1116
1009
|
const a = {
|
|
1117
1010
|
"google-cloud-resource-prefix": this.P,
|
|
1118
1011
|
"x-goog-request-params": this.R
|
|
1119
1012
|
};
|
|
1120
|
-
return this.p(a, n, i), this.F(t, o, a, r).then((e => (__PRIVATE_logDebug(
|
|
1013
|
+
return this.p(a, n, i), this.F(t, o, a, r).then((e => (__PRIVATE_logDebug(x, `Received RPC '${t}' ${s}: `, e),
|
|
1121
1014
|
e)), (e => {
|
|
1122
|
-
throw __PRIVATE_logWarn(
|
|
1015
|
+
throw __PRIVATE_logWarn(x, `RPC '${t}' ${s} failed with error: `, e, "url: ", o, "request:", r),
|
|
1123
1016
|
e;
|
|
1124
1017
|
}));
|
|
1125
1018
|
}
|
|
@@ -1136,7 +1029,7 @@ class __PRIVATE_RestConnection {
|
|
|
1136
1029
|
// SDK_VERSION is updated to different value at runtime depending on the entry point,
|
|
1137
1030
|
// so we need to get its value when we need it in a function.
|
|
1138
1031
|
function __PRIVATE_getGoogApiClientValue() {
|
|
1139
|
-
return "gl-js/ fire/" +
|
|
1032
|
+
return "gl-js/ fire/" + T;
|
|
1140
1033
|
}(),
|
|
1141
1034
|
// Content-Type: text/plain will avoid preflight requests which might
|
|
1142
1035
|
// mess with CORS and redirects by proxies. If we add custom headers
|
|
@@ -1146,8 +1039,8 @@ class __PRIVATE_RestConnection {
|
|
|
1146
1039
|
e && e.headers.forEach(((e, r) => t[r] = e)), r && r.headers.forEach(((e, r) => t[r] = e));
|
|
1147
1040
|
}
|
|
1148
1041
|
I(t, e) {
|
|
1149
|
-
const r =
|
|
1150
|
-
return `${this.
|
|
1042
|
+
const r = k[t];
|
|
1043
|
+
return `${this.T}/v1/${e}:${r}`;
|
|
1151
1044
|
}
|
|
1152
1045
|
/**
|
|
1153
1046
|
* Closes and cleans up any resources associated with the connection. This
|
|
@@ -1183,7 +1076,7 @@ class __PRIVATE_RestConnection {
|
|
|
1183
1076
|
* Important! The names of these identifiers matter because the string forms
|
|
1184
1077
|
* are used for reverse lookups from the webchannel stream. Do NOT change the
|
|
1185
1078
|
* names of these identifiers or change this into a const enum.
|
|
1186
|
-
*/ var
|
|
1079
|
+
*/ var U, j;
|
|
1187
1080
|
|
|
1188
1081
|
/**
|
|
1189
1082
|
* Converts an HTTP Status Code to the equivalent error code.
|
|
@@ -1286,7 +1179,7 @@ function __PRIVATE_mapCodeFromHttpStatus(t) {
|
|
|
1286
1179
|
/**
|
|
1287
1180
|
* A Rest-based connection that relies on the native HTTP stack
|
|
1288
1181
|
* (e.g. `fetch` or a polyfill).
|
|
1289
|
-
*/ (j =
|
|
1182
|
+
*/ (j = U || (U = {}))[j.OK = 0] = "OK", j[j.CANCELLED = 1] = "CANCELLED", j[j.UNKNOWN = 2] = "UNKNOWN",
|
|
1290
1183
|
j[j.INVALID_ARGUMENT = 3] = "INVALID_ARGUMENT", j[j.DEADLINE_EXCEEDED = 4] = "DEADLINE_EXCEEDED",
|
|
1291
1184
|
j[j.NOT_FOUND = 5] = "NOT_FOUND", j[j.ALREADY_EXISTS = 6] = "ALREADY_EXISTS", j[j.PERMISSION_DENIED = 7] = "PERMISSION_DENIED",
|
|
1292
1185
|
j[j.UNAUTHENTICATED = 16] = "UNAUTHENTICATED", j[j.RESOURCE_EXHAUSTED = 8] = "RESOURCE_EXHAUSTED",
|
|
@@ -1364,6 +1257,83 @@ class __PRIVATE_AggregateImpl {
|
|
|
1364
1257
|
}
|
|
1365
1258
|
}
|
|
1366
1259
|
|
|
1260
|
+
/**
|
|
1261
|
+
* @license
|
|
1262
|
+
* Copyright 2020 Google LLC
|
|
1263
|
+
*
|
|
1264
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1265
|
+
* you may not use this file except in compliance with the License.
|
|
1266
|
+
* You may obtain a copy of the License at
|
|
1267
|
+
*
|
|
1268
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1269
|
+
*
|
|
1270
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
1271
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1272
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1273
|
+
* See the License for the specific language governing permissions and
|
|
1274
|
+
* limitations under the License.
|
|
1275
|
+
*/
|
|
1276
|
+
/**
|
|
1277
|
+
* Generates `nBytes` of random bytes.
|
|
1278
|
+
*
|
|
1279
|
+
* If `nBytes < 0` , an error will be thrown.
|
|
1280
|
+
*/ function __PRIVATE_randomBytes(t) {
|
|
1281
|
+
// Polyfills for IE and WebWorker by using `self` and `msCrypto` when `crypto` is not available.
|
|
1282
|
+
const e =
|
|
1283
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1284
|
+
"undefined" != typeof self && (self.crypto || self.msCrypto), r = new Uint8Array(t);
|
|
1285
|
+
if (e && "function" == typeof e.getRandomValues) e.getRandomValues(r); else
|
|
1286
|
+
// Falls back to Math.random
|
|
1287
|
+
for (let e = 0; e < t; e++) r[e] = Math.floor(256 * Math.random());
|
|
1288
|
+
return r;
|
|
1289
|
+
}
|
|
1290
|
+
|
|
1291
|
+
/**
|
|
1292
|
+
* @license
|
|
1293
|
+
* Copyright 2017 Google LLC
|
|
1294
|
+
*
|
|
1295
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1296
|
+
* you may not use this file except in compliance with the License.
|
|
1297
|
+
* You may obtain a copy of the License at
|
|
1298
|
+
*
|
|
1299
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1300
|
+
*
|
|
1301
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
1302
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1303
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1304
|
+
* See the License for the specific language governing permissions and
|
|
1305
|
+
* limitations under the License.
|
|
1306
|
+
*/
|
|
1307
|
+
/**
|
|
1308
|
+
* A utility class for generating unique alphanumeric IDs of a specified length.
|
|
1309
|
+
*
|
|
1310
|
+
* @internal
|
|
1311
|
+
* Exported internally for testing purposes.
|
|
1312
|
+
*/ class __PRIVATE_AutoId {
|
|
1313
|
+
static newId() {
|
|
1314
|
+
// Alphanumeric characters
|
|
1315
|
+
const t = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", e = 62 * Math.floor(256 / 62);
|
|
1316
|
+
// The largest byte value that is a multiple of `char.length`.
|
|
1317
|
+
let r = "";
|
|
1318
|
+
for (;r.length < 20; ) {
|
|
1319
|
+
const n = __PRIVATE_randomBytes(40);
|
|
1320
|
+
for (let i = 0; i < n.length; ++i)
|
|
1321
|
+
// Only accept values that are [0, maxMultiple), this ensures they can
|
|
1322
|
+
// be evenly mapped to indices of `chars` via a modulo operation.
|
|
1323
|
+
r.length < 20 && n[i] < e && (r += t.charAt(n[i] % 62));
|
|
1324
|
+
}
|
|
1325
|
+
return r;
|
|
1326
|
+
}
|
|
1327
|
+
}
|
|
1328
|
+
|
|
1329
|
+
function __PRIVATE_primitiveComparator(t, e) {
|
|
1330
|
+
return t < e ? -1 : t > e ? 1 : 0;
|
|
1331
|
+
}
|
|
1332
|
+
|
|
1333
|
+
/** Helper to compare arrays using isEqual(). */ function __PRIVATE_arrayEquals(t, e, r) {
|
|
1334
|
+
return t.length === e.length && t.every(((t, n) => r(t, e[n])));
|
|
1335
|
+
}
|
|
1336
|
+
|
|
1367
1337
|
/**
|
|
1368
1338
|
* @license
|
|
1369
1339
|
* Copyright 2017 Google LLC
|
|
@@ -1967,7 +1937,7 @@ function __PRIVATE_valueCompare(t, e) {
|
|
|
1967
1937
|
return __PRIVATE_compareTimestamps(__PRIVATE_getLocalWriteTime(t), __PRIVATE_getLocalWriteTime(e));
|
|
1968
1938
|
|
|
1969
1939
|
case 5 /* TypeOrder.StringValue */ :
|
|
1970
|
-
return
|
|
1940
|
+
return __PRIVATE_primitiveComparator(t.stringValue, e.stringValue);
|
|
1971
1941
|
|
|
1972
1942
|
case 6 /* TypeOrder.BlobValue */ :
|
|
1973
1943
|
return function __PRIVATE_compareBlobs(t, e) {
|
|
@@ -2015,7 +1985,7 @@ function __PRIVATE_valueCompare(t, e) {
|
|
|
2015
1985
|
// canonical IDs are independent of insertion order.
|
|
2016
1986
|
n.sort(), s.sort();
|
|
2017
1987
|
for (let t = 0; t < n.length && t < s.length; ++t) {
|
|
2018
|
-
const e =
|
|
1988
|
+
const e = __PRIVATE_primitiveComparator(n[t], s[t]);
|
|
2019
1989
|
if (0 !== e) return e;
|
|
2020
1990
|
const o = __PRIVATE_valueCompare(r[n[t]], i[s[t]]);
|
|
2021
1991
|
if (0 !== o) return o;
|
|
@@ -3963,7 +3933,7 @@ class __PRIVATE_ExponentialBackoff {
|
|
|
3963
3933
|
* Note that jitter will still be applied, so the actual delay could be as
|
|
3964
3934
|
* much as 1.5*maxDelayMs.
|
|
3965
3935
|
*/ , i = 6e4) {
|
|
3966
|
-
this.L = t, this.timerId = e, this.M = r, this.
|
|
3936
|
+
this.L = t, this.timerId = e, this.M = r, this.k = n, this.U = i, this.j = 0, this.W = null,
|
|
3967
3937
|
/** The last backoff attempt, as epoch milliseconds. */
|
|
3968
3938
|
this.K = Date.now(), this.reset();
|
|
3969
3939
|
}
|
|
@@ -3980,7 +3950,7 @@ class __PRIVATE_ExponentialBackoff {
|
|
|
3980
3950
|
* Resets the backoff delay to the maximum delay (e.g. for use after a
|
|
3981
3951
|
* RESOURCE_EXHAUSTED error).
|
|
3982
3952
|
*/ G() {
|
|
3983
|
-
this.j = this.
|
|
3953
|
+
this.j = this.U;
|
|
3984
3954
|
}
|
|
3985
3955
|
/**
|
|
3986
3956
|
* Returns a promise that resolves after currentDelayMs, and increases the
|
|
@@ -3998,7 +3968,7 @@ class __PRIVATE_ExponentialBackoff {
|
|
|
3998
3968
|
t()))),
|
|
3999
3969
|
// Apply backoff factor to determine next delay and ensure it is within
|
|
4000
3970
|
// bounds.
|
|
4001
|
-
this.j *= this.
|
|
3971
|
+
this.j *= this.k, this.j < this.M && (this.j = this.M), this.j > this.U && (this.j = this.U);
|
|
4002
3972
|
}
|
|
4003
3973
|
Y() {
|
|
4004
3974
|
null !== this.W && (this.W.skipDelay(), this.W = null);
|
|
@@ -4140,7 +4110,7 @@ async function __PRIVATE_invokeRunAggregationQueryRpc(t, e, r) {
|
|
|
4140
4110
|
// Do not include implicit order-bys for aggregate queries.
|
|
4141
4111
|
e.q = __PRIVATE__queryToTarget(e, t.explicitOrderBy)), e.q;
|
|
4142
4112
|
}(e), r);
|
|
4143
|
-
i.connection.
|
|
4113
|
+
i.connection.A || delete s.parent;
|
|
4144
4114
|
const u = (await i.v("RunAggregationQuery", i.serializer.databaseId, a, s,
|
|
4145
4115
|
/*expectedResponseCount=*/ 1)).filter((t => !!t.result));
|
|
4146
4116
|
// Omit RunAggregationQueryResponse that only contain readTimes.
|
|
@@ -6922,13 +6892,13 @@ function __PRIVATE_validateReference(t, e) {
|
|
|
6922
6892
|
class __PRIVATE_TransactionRunner {
|
|
6923
6893
|
constructor(t, e, r, n, i) {
|
|
6924
6894
|
this.asyncQueue = t, this.datastore = e, this.options = r, this.updateFunction = n,
|
|
6925
|
-
this.deferred = i, this.
|
|
6895
|
+
this.deferred = i, this.At = r.maxAttempts, this.Tt = new __PRIVATE_ExponentialBackoff(this.asyncQueue, "transaction_retry" /* TimerId.TransactionRetry */);
|
|
6926
6896
|
}
|
|
6927
6897
|
/** Runs the transaction and sets the result on deferred. */ Pt() {
|
|
6928
|
-
this.
|
|
6898
|
+
this.At -= 1, this.Rt();
|
|
6929
6899
|
}
|
|
6930
6900
|
Rt() {
|
|
6931
|
-
this.
|
|
6901
|
+
this.Tt.H((async () => {
|
|
6932
6902
|
const t = new Transaction$1(this.datastore), e = this.Vt(t);
|
|
6933
6903
|
e && e.then((e => {
|
|
6934
6904
|
this.asyncQueue.enqueueAndForget((() => t.commit().then((() => {
|
|
@@ -6952,7 +6922,7 @@ class __PRIVATE_TransactionRunner {
|
|
|
6952
6922
|
}
|
|
6953
6923
|
}
|
|
6954
6924
|
It(t) {
|
|
6955
|
-
this.
|
|
6925
|
+
this.At > 0 && this.yt(t) ? (this.At -= 1, this.asyncQueue.enqueueAndForget((() => (this.Rt(),
|
|
6956
6926
|
Promise.resolve())))) : this.deferred.reject(t);
|
|
6957
6927
|
}
|
|
6958
6928
|
yt(t) {
|
|
@@ -7152,14 +7122,14 @@ class __PRIVATE_AsyncQueueImpl {
|
|
|
7152
7122
|
// List of TimerIds to fast-forward delays for.
|
|
7153
7123
|
this.Ct = [],
|
|
7154
7124
|
// Backoff timer used to schedule retries for retryable operations
|
|
7155
|
-
this.
|
|
7125
|
+
this.Tt = new __PRIVATE_ExponentialBackoff(this, "async_queue_retry" /* TimerId.AsyncQueueRetry */),
|
|
7156
7126
|
// Visibility handler that triggers an immediate retry of all retryable
|
|
7157
7127
|
// operations. Meant to speed up recovery when we regain file system access
|
|
7158
7128
|
// after page comes into foreground.
|
|
7159
7129
|
this.St = () => {
|
|
7160
7130
|
const t = getDocument();
|
|
7161
7131
|
t && __PRIVATE_logDebug(lt, "Visibility state changed to " + t.visibilityState),
|
|
7162
|
-
this.
|
|
7132
|
+
this.Tt.Y();
|
|
7163
7133
|
}, this.Nt = t;
|
|
7164
7134
|
const e = getDocument();
|
|
7165
7135
|
e && "function" == typeof e.addEventListener && e.addEventListener("visibilitychange", this.St);
|
|
@@ -7206,7 +7176,7 @@ class __PRIVATE_AsyncQueueImpl {
|
|
|
7206
7176
|
*/ async Bt() {
|
|
7207
7177
|
if (0 !== this.wt.length) {
|
|
7208
7178
|
try {
|
|
7209
|
-
await this.wt[0](), this.wt.shift(), this.
|
|
7179
|
+
await this.wt[0](), this.wt.shift(), this.Tt.reset();
|
|
7210
7180
|
} catch (t) {
|
|
7211
7181
|
if (!
|
|
7212
7182
|
/**
|
|
@@ -7245,7 +7215,7 @@ class __PRIVATE_AsyncQueueImpl {
|
|
|
7245
7215
|
// Since `backoffAndRun()` cancels an existing backoff and schedules a
|
|
7246
7216
|
// new backoff on every call, there is only ever a single additional
|
|
7247
7217
|
// operation in the queue.
|
|
7248
|
-
this.
|
|
7218
|
+
this.Tt.H((() => this.Bt()));
|
|
7249
7219
|
}
|
|
7250
7220
|
}
|
|
7251
7221
|
qt(t) {
|
|
@@ -7331,7 +7301,7 @@ class __PRIVATE_AsyncQueueImpl {
|
|
|
7331
7301
|
* @param lastTimerId - Delayed operations up to and including this TimerId
|
|
7332
7302
|
* will be drained. Pass TimerId.All to run all delayed operations.
|
|
7333
7303
|
* @returns a Promise that resolves once all operations have been run.
|
|
7334
|
-
*/
|
|
7304
|
+
*/ Mt(t) {
|
|
7335
7305
|
// Note that draining may generate more delayed ops, so we do that first.
|
|
7336
7306
|
return this.Qt().then((() => {
|
|
7337
7307
|
// Run ops in the same order they'd run if they ran naturally.
|
|
@@ -7343,7 +7313,7 @@ class __PRIVATE_AsyncQueueImpl {
|
|
|
7343
7313
|
}
|
|
7344
7314
|
/**
|
|
7345
7315
|
* For Tests: Skip all subsequent delays for a timer id.
|
|
7346
|
-
*/
|
|
7316
|
+
*/ xt(t) {
|
|
7347
7317
|
this.Ct.push(t);
|
|
7348
7318
|
}
|
|
7349
7319
|
/** Called once a DelayedOperation is run or canceled. */ $t(t) {
|
|
@@ -7434,7 +7404,7 @@ class Transaction {
|
|
|
7434
7404
|
* @packageDocumentation
|
|
7435
7405
|
*/ !function __PRIVATE_registerFirestore() {
|
|
7436
7406
|
!function __PRIVATE_setSDKVersion(t) {
|
|
7437
|
-
|
|
7407
|
+
T = t;
|
|
7438
7408
|
}(`${s}_lite`), n(new o("firestore/lite", ((t, {instanceIdentifier: e, options: r}) => {
|
|
7439
7409
|
const n = t.getProvider("app").getImmediate(), i = new Firestore(new __PRIVATE_LiteAuthCredentialsProvider(t.getProvider("auth-internal")), new __PRIVATE_LiteAppCheckTokenProvider(n, t.getProvider("app-check-internal")), function __PRIVATE_databaseIdFromApp(t, e) {
|
|
7440
7410
|
if (!Object.prototype.hasOwnProperty.apply(t.options, [ "projectId" ])) throw new FirestoreError(p, '"projectId" not provided in firebase.initializeApp.');
|
|
@@ -7443,7 +7413,7 @@ class Transaction {
|
|
|
7443
7413
|
return r && i._setSettings(r), i;
|
|
7444
7414
|
}), "PUBLIC").setMultipleInstances(!0)),
|
|
7445
7415
|
// RUNTIME_ENV and BUILD_TARGET are replaced by real values during the compilation
|
|
7446
|
-
i("firestore-lite",
|
|
7416
|
+
i("firestore-lite", A, "rn"), i("firestore-lite", A, "esm2017");
|
|
7447
7417
|
}();
|
|
7448
7418
|
|
|
7449
7419
|
export { AggregateField, AggregateQuerySnapshot, Bytes, CollectionReference, DocumentReference, DocumentSnapshot, FieldPath, FieldValue, Firestore, FirestoreError, GeoPoint, Query, QueryCompositeFilterConstraint, QueryConstraint, QueryDocumentSnapshot, QueryEndAtConstraint, QueryFieldFilterConstraint, QueryLimitConstraint, QueryOrderByConstraint, QuerySnapshot, QueryStartAtConstraint, Timestamp, Transaction, VectorValue, WriteBatch, addDoc, aggregateFieldEqual, aggregateQuerySnapshotEqual, and, arrayRemove, arrayUnion, average, collection, collectionGroup, connectFirestoreEmulator, count, deleteDoc, deleteField, doc, documentId, endAt, endBefore, getAggregate, getCount, getDoc, getDocs, getFirestore, increment, initializeFirestore, limit, limitToLast, or, orderBy, query, queryEqual, refEqual, runTransaction, serverTimestamp, setDoc, setLogLevel, snapshotEqual, startAfter, startAt, sum, terminate, updateDoc, vector, where, writeBatch };
|