@firebase/firestore 4.7.8 → 4.7.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/firestore/src/global_index.d.ts +9 -2
- package/dist/firestore/src/lite-api/database.d.ts +4 -0
- package/dist/firestore/src/lite-api/settings.d.ts +4 -0
- package/dist/firestore/src/lite-api/vector_value.d.ts +2 -2
- package/dist/firestore/test/integration/util/settings.d.ts +1 -0
- package/dist/index.cjs.js +108 -98
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.esm2017.js +109 -99
- package/dist/index.esm2017.js.map +1 -1
- package/dist/index.node.cjs.js +17 -5
- package/dist/index.node.cjs.js.map +1 -1
- package/dist/index.node.mjs +18 -6
- package/dist/index.node.mjs.map +1 -1
- package/dist/index.rn.js +44 -34
- package/dist/index.rn.js.map +1 -1
- package/dist/internal.d.ts +9 -2
- package/dist/lite/firestore/src/lite-api/database.d.ts +4 -0
- package/dist/lite/firestore/src/lite-api/settings.d.ts +4 -0
- package/dist/lite/firestore/src/lite-api/vector_value.d.ts +2 -2
- package/dist/lite/firestore/test/integration/util/settings.d.ts +1 -0
- package/dist/lite/index.browser.esm2017.js +23 -13
- package/dist/lite/index.browser.esm2017.js.map +1 -1
- package/dist/lite/index.cjs.js +23 -13
- package/dist/lite/index.cjs.js.map +1 -1
- package/dist/lite/index.d.ts +2 -2
- package/dist/lite/index.node.cjs.js +17 -5
- package/dist/lite/index.node.cjs.js.map +1 -1
- package/dist/lite/index.node.mjs +18 -6
- package/dist/lite/index.node.mjs.map +1 -1
- package/dist/lite/index.rn.esm2017.js +43 -33
- package/dist/lite/index.rn.esm2017.js.map +1 -1
- package/dist/lite/internal.d.ts +9 -2
- package/dist/lite/private.d.ts +6 -2
- package/dist/private.d.ts +6 -2
- package/package.json +6 -6
package/dist/index.esm2017.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { _registerComponent, registerVersion, _isFirebaseServerApp, _getProvider, getApp, _removeServiceInstance, SDK_VERSION } from '@firebase/app';
|
|
2
2
|
import { Component } from '@firebase/component';
|
|
3
3
|
import { Logger, LogLevel } from '@firebase/logger';
|
|
4
|
-
import { FirebaseError, createMockUserToken, getModularInstance,
|
|
4
|
+
import { FirebaseError, deepEqual, createMockUserToken, getModularInstance, getDefaultEmulatorHostnameAndPort, isIndexedDBAvailable, getUA, isSafari } from '@firebase/util';
|
|
5
5
|
import { Integer, Md5 } from '@firebase/webchannel-wrapper/bloom-blob';
|
|
6
6
|
import { XhrIo, EventType, ErrorCode, createWebChannelTransport, getStatEventTarget, WebChannel, Event, Stat } from '@firebase/webchannel-wrapper/webchannel-blob';
|
|
7
7
|
|
|
8
|
-
const
|
|
8
|
+
const b = "@firebase/firestore", S = "4.7.9";
|
|
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 D = "11.
|
|
70
|
+
let D = "11.4.0";
|
|
71
71
|
|
|
72
72
|
/**
|
|
73
73
|
* @license
|
|
@@ -2355,7 +2355,7 @@ function __PRIVATE_newDbDocumentMutationPrefixForPath(e, t) {
|
|
|
2355
2355
|
* there is no useful information to store as the value. The raw (unencoded)
|
|
2356
2356
|
* path cannot be stored because IndexedDb doesn't store prototype
|
|
2357
2357
|
* information.
|
|
2358
|
-
*/ const Z = {}, X = "documentMutations", ee = "remoteDocumentsV14", te = [ "prefixPath", "collectionGroup", "readTime", "documentId" ], ne = "documentKeyIndex", re = [ "prefixPath", "collectionGroup", "documentId" ], ie = "collectionGroupIndex", se = [ "collectionGroup", "readTime", "prefixPath", "documentId" ], oe = "remoteDocumentGlobal", _e = "remoteDocumentGlobalKey", ae = "targets", ue = "queryTargetsIndex", ce = [ "canonicalId", "targetId" ], le = "targetDocuments", he = [ "targetId", "path" ], Pe = "documentTargetsIndex", Te = [ "path", "targetId" ], Ie = "targetGlobalKey", Ee = "targetGlobal", de = "collectionParents", Ae = [ "collectionId", "parent" ], Re = "clientMetadata", Ve = "clientId", me = "bundles", fe = "bundleId", ge = "namedQueries", pe = "name", ye = "indexConfiguration", we = "indexId",
|
|
2358
|
+
*/ const Z = {}, X = "documentMutations", ee = "remoteDocumentsV14", te = [ "prefixPath", "collectionGroup", "readTime", "documentId" ], ne = "documentKeyIndex", re = [ "prefixPath", "collectionGroup", "documentId" ], ie = "collectionGroupIndex", se = [ "collectionGroup", "readTime", "prefixPath", "documentId" ], oe = "remoteDocumentGlobal", _e = "remoteDocumentGlobalKey", ae = "targets", ue = "queryTargetsIndex", ce = [ "canonicalId", "targetId" ], le = "targetDocuments", he = [ "targetId", "path" ], Pe = "documentTargetsIndex", Te = [ "path", "targetId" ], Ie = "targetGlobalKey", Ee = "targetGlobal", de = "collectionParents", Ae = [ "collectionId", "parent" ], Re = "clientMetadata", Ve = "clientId", me = "bundles", fe = "bundleId", ge = "namedQueries", pe = "name", ye = "indexConfiguration", we = "indexId", be = "collectionGroupIndex", Se = "collectionGroup", De = "indexState", ve = [ "indexId", "uid" ], Ce = "sequenceNumberIndex", Fe = [ "uid", "sequenceNumber" ], Me = "indexEntries", xe = [ "indexId", "uid", "arrayValue", "directionalValue", "orderedDocumentKey", "documentKey" ], Oe = "documentKeyIndex", Ne = [ "indexId", "uid", "orderedDocumentKey" ], Be = "documentOverlays", Le = [ "userId", "collectionPath", "documentId" ], ke = "collectionPathOverlayIndex", qe = [ "userId", "collectionPath", "largestBatchId" ], Qe = "collectionGroupOverlayIndex", $e = [ "userId", "collectionGroup", "largestBatchId" ], Ke = "globals", Ue = "name", We = [ ...[ ...[ ...[ ...[ G, j, X, K, ae, U, Ee, le ], Re ], oe ], de ], me, ge ], Ge = [ ...We, Be ], ze = [ G, j, X, ee, ae, U, Ee, le, Re, oe, de, me, ge, Be ], je = ze, He = [ ...je, ye, De, Me ], Je = He, Ye = [ ...He, Ke ];
|
|
2359
2359
|
|
|
2360
2360
|
/**
|
|
2361
2361
|
* @license
|
|
@@ -6183,13 +6183,13 @@ class __PRIVATE_WatchTargetChange {
|
|
|
6183
6183
|
*/
|
|
6184
6184
|
this.ye = __PRIVATE_snapshotChangesMap(),
|
|
6185
6185
|
/** See public getters for explanations of these fields. */
|
|
6186
|
-
this.we = ByteString.EMPTY_BYTE_STRING, this.
|
|
6186
|
+
this.we = ByteString.EMPTY_BYTE_STRING, this.be = !1,
|
|
6187
6187
|
/**
|
|
6188
6188
|
* Whether this target state should be included in the next snapshot. We
|
|
6189
6189
|
* initialize to true so that newly-added targets are included in the next
|
|
6190
6190
|
* RemoteEvent.
|
|
6191
6191
|
*/
|
|
6192
|
-
this.
|
|
6192
|
+
this.Se = !0;
|
|
6193
6193
|
}
|
|
6194
6194
|
/**
|
|
6195
6195
|
* Whether this target has been marked 'current'.
|
|
@@ -6199,7 +6199,7 @@ class __PRIVATE_WatchTargetChange {
|
|
|
6199
6199
|
* was added and that the target is consistent with the rest of the watch
|
|
6200
6200
|
* stream.
|
|
6201
6201
|
*/ get current() {
|
|
6202
|
-
return this.
|
|
6202
|
+
return this.be;
|
|
6203
6203
|
}
|
|
6204
6204
|
/** The last resume token sent to us for this target. */ get resumeToken() {
|
|
6205
6205
|
return this.we;
|
|
@@ -6208,13 +6208,13 @@ class __PRIVATE_WatchTargetChange {
|
|
|
6208
6208
|
return 0 !== this.pe;
|
|
6209
6209
|
}
|
|
6210
6210
|
/** Whether we have modified any state that should trigger a snapshot. */ get ve() {
|
|
6211
|
-
return this.
|
|
6211
|
+
return this.Se;
|
|
6212
6212
|
}
|
|
6213
6213
|
/**
|
|
6214
6214
|
* Applies the resume token to the TargetChange, but only when it has a new
|
|
6215
6215
|
* value. Empty resumeTokens are discarded.
|
|
6216
6216
|
*/ Ce(e) {
|
|
6217
|
-
e.approximateByteSize() > 0 && (this.
|
|
6217
|
+
e.approximateByteSize() > 0 && (this.Se = !0, this.we = e);
|
|
6218
6218
|
}
|
|
6219
6219
|
/**
|
|
6220
6220
|
* Creates a target change from the current set of changes.
|
|
@@ -6240,18 +6240,18 @@ class __PRIVATE_WatchTargetChange {
|
|
|
6240
6240
|
default:
|
|
6241
6241
|
fail();
|
|
6242
6242
|
}
|
|
6243
|
-
})), new TargetChange(this.we, this.
|
|
6243
|
+
})), new TargetChange(this.we, this.be, e, t, n);
|
|
6244
6244
|
}
|
|
6245
6245
|
/**
|
|
6246
6246
|
* Resets the document changes and sets `hasPendingChanges` to false.
|
|
6247
6247
|
*/ Me() {
|
|
6248
|
-
this.
|
|
6248
|
+
this.Se = !1, this.ye = __PRIVATE_snapshotChangesMap();
|
|
6249
6249
|
}
|
|
6250
6250
|
xe(e, t) {
|
|
6251
|
-
this.
|
|
6251
|
+
this.Se = !0, this.ye = this.ye.insert(e, t);
|
|
6252
6252
|
}
|
|
6253
6253
|
Oe(e) {
|
|
6254
|
-
this.
|
|
6254
|
+
this.Se = !0, this.ye = this.ye.remove(e);
|
|
6255
6255
|
}
|
|
6256
6256
|
Ne() {
|
|
6257
6257
|
this.pe += 1;
|
|
@@ -6260,7 +6260,7 @@ class __PRIVATE_WatchTargetChange {
|
|
|
6260
6260
|
this.pe -= 1, __PRIVATE_hardAssert(this.pe >= 0);
|
|
6261
6261
|
}
|
|
6262
6262
|
Le() {
|
|
6263
|
-
this.
|
|
6263
|
+
this.Se = !0, this.be = !0;
|
|
6264
6264
|
}
|
|
6265
6265
|
}
|
|
6266
6266
|
|
|
@@ -7790,12 +7790,12 @@ class __PRIVATE_FirestoreIndexValueWriter {
|
|
|
7790
7790
|
let n = e.timestampValue;
|
|
7791
7791
|
this.ft(t, 20), "string" == typeof n && (n = __PRIVATE_normalizeTimestamp(n)), t.yt(`${n.seconds || ""}`),
|
|
7792
7792
|
t.gt(n.nanos || 0);
|
|
7793
|
-
} else if ("stringValue" in e) this.wt(e.stringValue, t), this.
|
|
7794
|
-
t.
|
|
7793
|
+
} else if ("stringValue" in e) this.wt(e.stringValue, t), this.bt(t); else if ("bytesValue" in e) this.ft(t, 30),
|
|
7794
|
+
t.St(__PRIVATE_normalizeByteString(e.bytesValue)), this.bt(t); else if ("referenceValue" in e) this.Dt(e.referenceValue, t); else if ("geoPointValue" in e) {
|
|
7795
7795
|
const n = e.geoPointValue;
|
|
7796
7796
|
this.ft(t, 45), t.gt(n.latitude || 0), t.gt(n.longitude || 0);
|
|
7797
7797
|
} else "mapValue" in e ? __PRIVATE_isMaxValue(e) ? this.ft(t, Number.MAX_SAFE_INTEGER) : __PRIVATE_isVectorValue(e) ? this.vt(e.mapValue, t) : (this.Ct(e.mapValue, t),
|
|
7798
|
-
this.
|
|
7798
|
+
this.bt(t)) : "arrayValue" in e ? (this.Ft(e.arrayValue, t), this.bt(t)) : fail();
|
|
7799
7799
|
}
|
|
7800
7800
|
wt(e, t) {
|
|
7801
7801
|
this.ft(t, 25), this.Mt(e, t);
|
|
@@ -7832,7 +7832,7 @@ class __PRIVATE_FirestoreIndexValueWriter {
|
|
|
7832
7832
|
ft(e, t) {
|
|
7833
7833
|
e.gt(t);
|
|
7834
7834
|
}
|
|
7835
|
-
|
|
7835
|
+
bt(e) {
|
|
7836
7836
|
// While the SDK does not implement truncation, the truncation marker is
|
|
7837
7837
|
// used to terminate all variable length values (which are strings, bytes,
|
|
7838
7838
|
// references, arrays and maps).
|
|
@@ -8039,7 +8039,7 @@ class __PRIVATE_AscendingIndexByteEncoder {
|
|
|
8039
8039
|
constructor(e) {
|
|
8040
8040
|
this.Zt = e;
|
|
8041
8041
|
}
|
|
8042
|
-
|
|
8042
|
+
St(e) {
|
|
8043
8043
|
this.Zt.Ot(e);
|
|
8044
8044
|
}
|
|
8045
8045
|
yt(e) {
|
|
@@ -8057,7 +8057,7 @@ class __PRIVATE_DescendingIndexByteEncoder {
|
|
|
8057
8057
|
constructor(e) {
|
|
8058
8058
|
this.Zt = e;
|
|
8059
8059
|
}
|
|
8060
|
-
|
|
8060
|
+
St(e) {
|
|
8061
8061
|
this.Zt.Lt(e);
|
|
8062
8062
|
}
|
|
8063
8063
|
yt(e) {
|
|
@@ -8887,7 +8887,7 @@ class __PRIVATE_IndexedDbIndexManager {
|
|
|
8887
8887
|
let i = 0;
|
|
8888
8888
|
for (const s of __PRIVATE_fieldIndexGetDirectionalSegments(e)) {
|
|
8889
8889
|
const e = n[i++];
|
|
8890
|
-
for (const n of r) if (this.
|
|
8890
|
+
for (const n of r) if (this.bn(t, s.fieldPath) && isArray(e)) r = this.Sn(r, s, e); else {
|
|
8891
8891
|
const t = n.tn(s.kind);
|
|
8892
8892
|
__PRIVATE_FirestoreIndexValueWriter.xt.At(e, t);
|
|
8893
8893
|
}
|
|
@@ -8911,7 +8911,7 @@ class __PRIVATE_IndexedDbIndexManager {
|
|
|
8911
8911
|
* The method appends each value to all existing encoders (e.g. filter("a",
|
|
8912
8912
|
* "==", "a1").filter("b", "in", ["b1", "b2"]) becomes ["a1,b1", "a1,b2"]). A
|
|
8913
8913
|
* list of new encoders is returned.
|
|
8914
|
-
*/
|
|
8914
|
+
*/ Sn(e, t, n) {
|
|
8915
8915
|
const r = [ ...e ], i = [];
|
|
8916
8916
|
for (const e of n.arrayValue.values || []) for (const n of r) {
|
|
8917
8917
|
const r = new __PRIVATE_IndexByteEncoder;
|
|
@@ -8919,12 +8919,12 @@ class __PRIVATE_IndexedDbIndexManager {
|
|
|
8919
8919
|
}
|
|
8920
8920
|
return i;
|
|
8921
8921
|
}
|
|
8922
|
-
|
|
8922
|
+
bn(e, t) {
|
|
8923
8923
|
return !!e.filters.find((e => e instanceof FieldFilter && e.field.isEqual(t) && ("in" /* Operator.IN */ === e.op || "not-in" /* Operator.NOT_IN */ === e.op)));
|
|
8924
8924
|
}
|
|
8925
8925
|
getFieldIndexes(e, t) {
|
|
8926
8926
|
const n = __PRIVATE_indexConfigurationStore(e), r = __PRIVATE_indexStateStore(e);
|
|
8927
|
-
return (t ? n.G(
|
|
8927
|
+
return (t ? n.G(be, IDBKeyRange.bound(t, t)) : n.G()).next((e => {
|
|
8928
8928
|
const t = [];
|
|
8929
8929
|
return PersistencePromise.forEach(e, (e => r.get([ e.indexId, this.uid ]).next((n => {
|
|
8930
8930
|
t.push(function __PRIVATE_fromDbIndexConfiguration(e, t) {
|
|
@@ -8942,7 +8942,7 @@ class __PRIVATE_IndexedDbIndexManager {
|
|
|
8942
8942
|
}
|
|
8943
8943
|
updateCollectionGroup(e, t, n) {
|
|
8944
8944
|
const r = __PRIVATE_indexConfigurationStore(e), i = __PRIVATE_indexStateStore(e);
|
|
8945
|
-
return this.vn(e).next((e => r.G(
|
|
8945
|
+
return this.vn(e).next((e => r.G(be, IDBKeyRange.bound(t, t)).next((t => PersistencePromise.forEach(t, (t => i.put(__PRIVATE_toDbIndexState(t.indexId, this.uid, e, n))))))));
|
|
8946
8946
|
}
|
|
8947
8947
|
updateIndexEntries(e, t) {
|
|
8948
8948
|
// Porting Note: `getFieldIndexes()` on Web does not cache index lookups as
|
|
@@ -9139,7 +9139,7 @@ function __PRIVATE_getMinOffsetFromFieldIndexes(e) {
|
|
|
9139
9139
|
sequenceNumbersCollected: 0,
|
|
9140
9140
|
targetsRemoved: 0,
|
|
9141
9141
|
documentsRemoved: 0
|
|
9142
|
-
},
|
|
9142
|
+
}, bt = 41943040;
|
|
9143
9143
|
|
|
9144
9144
|
class LruParams {
|
|
9145
9145
|
static withCacheSize(e) {
|
|
@@ -9224,7 +9224,7 @@ function removeMutationBatch(e, t, n) {
|
|
|
9224
9224
|
* limitations under the License.
|
|
9225
9225
|
*/
|
|
9226
9226
|
/** A mutation queue for a specific user, backed by IndexedDB. */ LruParams.DEFAULT_COLLECTION_PERCENTILE = 10,
|
|
9227
|
-
LruParams.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT = 1e3, LruParams.DEFAULT = new LruParams(
|
|
9227
|
+
LruParams.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT = 1e3, LruParams.DEFAULT = new LruParams(bt, LruParams.DEFAULT_COLLECTION_PERCENTILE, LruParams.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT),
|
|
9228
9228
|
LruParams.DISABLED = new LruParams(-1, 0, 0);
|
|
9229
9229
|
|
|
9230
9230
|
class __PRIVATE_IndexedDbMutationQueue {
|
|
@@ -9781,7 +9781,7 @@ class __PRIVATE_TargetIdGenerator {
|
|
|
9781
9781
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
9782
9782
|
* See the License for the specific language governing permissions and
|
|
9783
9783
|
* limitations under the License.
|
|
9784
|
-
*/ const
|
|
9784
|
+
*/ const St = "LruGarbageCollector", Dt = 1048576;
|
|
9785
9785
|
|
|
9786
9786
|
function __PRIVATE_bufferEntryComparator([e, t], [n, r]) {
|
|
9787
9787
|
const i = __PRIVATE_primitiveComparator(e, n);
|
|
@@ -9834,12 +9834,12 @@ function __PRIVATE_bufferEntryComparator([e, t], [n, r]) {
|
|
|
9834
9834
|
return null !== this.Xn;
|
|
9835
9835
|
}
|
|
9836
9836
|
er(e) {
|
|
9837
|
-
__PRIVATE_logDebug(
|
|
9837
|
+
__PRIVATE_logDebug(St, `Garbage collection scheduled in ${e}ms`), this.Xn = this.asyncQueue.enqueueAfterDelay("lru_garbage_collection" /* TimerId.LruGarbageCollection */ , e, (async () => {
|
|
9838
9838
|
this.Xn = null;
|
|
9839
9839
|
try {
|
|
9840
9840
|
await this.localStore.collectGarbage(this.garbageCollector);
|
|
9841
9841
|
} catch (e) {
|
|
9842
|
-
__PRIVATE_isIndexedDbTransactionError(e) ? __PRIVATE_logDebug(
|
|
9842
|
+
__PRIVATE_isIndexedDbTransactionError(e) ? __PRIVATE_logDebug(St, "Ignoring IndexedDB error during garbage collection: ", e) : await __PRIVATE_ignoreIfPrimaryLeaseLoss(e);
|
|
9843
9843
|
}
|
|
9844
9844
|
await this.er(3e5);
|
|
9845
9845
|
}));
|
|
@@ -10957,13 +10957,13 @@ class OverlayedDocument {
|
|
|
10957
10957
|
*/ removeReference(e, t) {
|
|
10958
10958
|
this.wr(new __PRIVATE_DocReference(e, t));
|
|
10959
10959
|
}
|
|
10960
|
-
|
|
10960
|
+
br(e, t) {
|
|
10961
10961
|
e.forEach((e => this.removeReference(e, t)));
|
|
10962
10962
|
}
|
|
10963
10963
|
/**
|
|
10964
10964
|
* Clears all references with a given ID. Calls removeRef() for each key
|
|
10965
10965
|
* removed.
|
|
10966
|
-
*/
|
|
10966
|
+
*/ Sr(e) {
|
|
10967
10967
|
const t = new DocumentKey(new ResourcePath([])), n = new __PRIVATE_DocReference(t, e), r = new __PRIVATE_DocReference(t, e + 1), i = [];
|
|
10968
10968
|
return this.gr.forEachInRange([ n, r ], (e => {
|
|
10969
10969
|
this.wr(e), i.push(e.key);
|
|
@@ -11361,7 +11361,7 @@ class __PRIVATE_MemoryRemoteDocumentChangeBuffer extends RemoteDocumentChangeBuf
|
|
|
11361
11361
|
return this.zn(t), PersistencePromise.resolve();
|
|
11362
11362
|
}
|
|
11363
11363
|
removeTargetData(e, t) {
|
|
11364
|
-
return this.Qr.delete(t.target), this.Kr.
|
|
11364
|
+
return this.Qr.delete(t.target), this.Kr.Sr(t.targetId), this.targetCount -= 1,
|
|
11365
11365
|
PersistencePromise.resolve();
|
|
11366
11366
|
}
|
|
11367
11367
|
removeTargets(e, t, n) {
|
|
@@ -11383,14 +11383,14 @@ class __PRIVATE_MemoryRemoteDocumentChangeBuffer extends RemoteDocumentChangeBuf
|
|
|
11383
11383
|
return this.Kr.yr(t, n), PersistencePromise.resolve();
|
|
11384
11384
|
}
|
|
11385
11385
|
removeMatchingKeys(e, t, n) {
|
|
11386
|
-
this.Kr.
|
|
11386
|
+
this.Kr.br(t, n);
|
|
11387
11387
|
const r = this.persistence.referenceDelegate, i = [];
|
|
11388
11388
|
return r && t.forEach((t => {
|
|
11389
11389
|
i.push(r.markPotentiallyOrphaned(e, t));
|
|
11390
11390
|
})), PersistencePromise.waitFor(i);
|
|
11391
11391
|
}
|
|
11392
11392
|
removeMatchingKeysForTargetId(e, t) {
|
|
11393
|
-
return this.Kr.
|
|
11393
|
+
return this.Kr.Sr(t), PersistencePromise.resolve();
|
|
11394
11394
|
}
|
|
11395
11395
|
getMatchingKeysForTargetId(e, t) {
|
|
11396
11396
|
const n = this.Kr.vr(t);
|
|
@@ -11525,7 +11525,7 @@ class __PRIVATE_MemoryEagerDelegate {
|
|
|
11525
11525
|
return this.ii.add(t.toString()), PersistencePromise.resolve();
|
|
11526
11526
|
}
|
|
11527
11527
|
removeTarget(e, t) {
|
|
11528
|
-
this.ti.
|
|
11528
|
+
this.ti.Sr(t.targetId).forEach((e => this.ii.add(e.toString())));
|
|
11529
11529
|
const n = this.persistence.getTargetCache();
|
|
11530
11530
|
return n.getMatchingKeysForTargetId(e, t.targetId).next((e => {
|
|
11531
11531
|
e.forEach((e => this.ii.add(e.toString())));
|
|
@@ -11769,7 +11769,7 @@ class __PRIVATE_MemoryLruDelegate {
|
|
|
11769
11769
|
keyPath: we,
|
|
11770
11770
|
autoIncrement: !0
|
|
11771
11771
|
});
|
|
11772
|
-
t.createIndex(
|
|
11772
|
+
t.createIndex(be, Se, {
|
|
11773
11773
|
unique: !1
|
|
11774
11774
|
});
|
|
11775
11775
|
const n = e.createObjectStore(De, {
|
|
@@ -12036,7 +12036,7 @@ class __PRIVATE_IndexedDbPersistence {
|
|
|
12036
12036
|
// Fail `start()` if `synchronizeTabs` is disabled and we cannot
|
|
12037
12037
|
// obtain the primary lease.
|
|
12038
12038
|
throw new FirestoreError(C.FAILED_PRECONDITION, Mt);
|
|
12039
|
-
return this.
|
|
12039
|
+
return this.bi(), this.Si(), this.Di(), this.runTransaction("getHighestListenSequenceNumber", "readonly", (e => this.Hr.getHighestSequenceNumber(e)));
|
|
12040
12040
|
})).then((e => {
|
|
12041
12041
|
this.Gr = new __PRIVATE_ListenSequence(e, this.Ii);
|
|
12042
12042
|
})).then((() => {
|
|
@@ -12297,7 +12297,7 @@ class __PRIVATE_IndexedDbPersistence {
|
|
|
12297
12297
|
return !(e < n - t) && (!(e > n) || (__PRIVATE_logError(`Detected an update time that is in the future: ${e} > ${n}`),
|
|
12298
12298
|
!1));
|
|
12299
12299
|
}
|
|
12300
|
-
|
|
12300
|
+
bi() {
|
|
12301
12301
|
null !== this.document && "function" == typeof this.document.addEventListener && (this.Ri = () => {
|
|
12302
12302
|
this.Ti.enqueueAndForget((() => (this.inForeground = "visible" === this.document.visibilityState,
|
|
12303
12303
|
this.wi())));
|
|
@@ -12315,7 +12315,7 @@ class __PRIVATE_IndexedDbPersistence {
|
|
|
12315
12315
|
* primary lease). LocalStorage is used for this rather than IndexedDb because
|
|
12316
12316
|
* it is a synchronous API and so can be used reliably from an unload
|
|
12317
12317
|
* handler.
|
|
12318
|
-
*/
|
|
12318
|
+
*/ Si() {
|
|
12319
12319
|
var e;
|
|
12320
12320
|
"function" == typeof (null === (e = this.window) || void 0 === e ? void 0 : e.addEventListener) && (this.Ai = () => {
|
|
12321
12321
|
// Note: In theory, this should be scheduled on the AsyncQueue since it
|
|
@@ -13230,14 +13230,14 @@ class __PRIVATE_MutationMetadata {
|
|
|
13230
13230
|
/**
|
|
13231
13231
|
* Parses a MutationMetadata from its JSON representation in WebStorage.
|
|
13232
13232
|
* Logs a warning and returns null if the format of the data is not valid.
|
|
13233
|
-
*/ static
|
|
13233
|
+
*/ static bs(e, t, n) {
|
|
13234
13234
|
const r = JSON.parse(n);
|
|
13235
13235
|
let i, s = "object" == typeof r && -1 !== [ "pending", "acknowledged", "rejected" ].indexOf(r.state) && (void 0 === r.error || "object" == typeof r.error);
|
|
13236
13236
|
return s && r.error && (s = "string" == typeof r.error.message && "string" == typeof r.error.code,
|
|
13237
13237
|
s && (i = new FirestoreError(r.error.code, r.error.message))), s ? new __PRIVATE_MutationMetadata(e, t, r.state, i) : (__PRIVATE_logError(qt, `Failed to parse mutation state for ID '${t}': ${n}`),
|
|
13238
13238
|
null);
|
|
13239
13239
|
}
|
|
13240
|
-
|
|
13240
|
+
Ss() {
|
|
13241
13241
|
const e = {
|
|
13242
13242
|
state: this.state,
|
|
13243
13243
|
updateTimeMs: Date.now()
|
|
@@ -13261,14 +13261,14 @@ class __PRIVATE_QueryTargetMetadata {
|
|
|
13261
13261
|
/**
|
|
13262
13262
|
* Parses a QueryTargetMetadata from its JSON representation in WebStorage.
|
|
13263
13263
|
* Logs a warning and returns null if the format of the data is not valid.
|
|
13264
|
-
*/ static
|
|
13264
|
+
*/ static bs(e, t) {
|
|
13265
13265
|
const n = JSON.parse(t);
|
|
13266
13266
|
let r, i = "object" == typeof n && -1 !== [ "not-current", "current", "rejected" ].indexOf(n.state) && (void 0 === n.error || "object" == typeof n.error);
|
|
13267
13267
|
return i && n.error && (i = "string" == typeof n.error.message && "string" == typeof n.error.code,
|
|
13268
13268
|
i && (r = new FirestoreError(n.error.code, n.error.message))), i ? new __PRIVATE_QueryTargetMetadata(e, n.state, r) : (__PRIVATE_logError(qt, `Failed to parse target state for ID '${e}': ${t}`),
|
|
13269
13269
|
null);
|
|
13270
13270
|
}
|
|
13271
|
-
|
|
13271
|
+
Ss() {
|
|
13272
13272
|
const e = {
|
|
13273
13273
|
state: this.state,
|
|
13274
13274
|
updateTimeMs: Date.now()
|
|
@@ -13290,7 +13290,7 @@ class __PRIVATE_QueryTargetMetadata {
|
|
|
13290
13290
|
/**
|
|
13291
13291
|
* Parses a RemoteClientState from the JSON representation in WebStorage.
|
|
13292
13292
|
* Logs a warning and returns null if the format of the data is not valid.
|
|
13293
|
-
*/ static
|
|
13293
|
+
*/ static bs(e, t) {
|
|
13294
13294
|
const n = JSON.parse(t);
|
|
13295
13295
|
let r = "object" == typeof n && n.activeTargetIds instanceof Array, i = __PRIVATE_targetIdSet();
|
|
13296
13296
|
for (let e = 0; r && e < n.activeTargetIds.length; ++e) r = isSafeInteger(n.activeTargetIds[e]),
|
|
@@ -13311,7 +13311,7 @@ class __PRIVATE_QueryTargetMetadata {
|
|
|
13311
13311
|
/**
|
|
13312
13312
|
* Parses a SharedOnlineState from its JSON representation in WebStorage.
|
|
13313
13313
|
* Logs a warning and returns null if the format of the data is not valid.
|
|
13314
|
-
*/ static
|
|
13314
|
+
*/ static bs(e) {
|
|
13315
13315
|
const t = JSON.parse(e);
|
|
13316
13316
|
return "object" == typeof t && -1 !== [ "Unknown", "Online", "Offline" ].indexOf(t.onlineState) && "string" == typeof t.clientId ? new __PRIVATE_SharedOnlineState(t.clientId, t.onlineState) : (__PRIVATE_logError(qt, `Failed to parse online state: ${e}`),
|
|
13317
13317
|
null);
|
|
@@ -13342,7 +13342,7 @@ class __PRIVATE_LocalClientState {
|
|
|
13342
13342
|
/**
|
|
13343
13343
|
* Converts this entry into a JSON-encoded format we can use for WebStorage.
|
|
13344
13344
|
* Does not encode `clientId` as it is part of the key in WebStorage.
|
|
13345
|
-
*/
|
|
13345
|
+
*/ Ss() {
|
|
13346
13346
|
const e = {
|
|
13347
13347
|
activeTargetIds: this.activeTargetIds.toArray(),
|
|
13348
13348
|
updateTimeMs: Date.now()
|
|
@@ -13410,7 +13410,7 @@ class __PRIVATE_LocalClientState {
|
|
|
13410
13410
|
if (t === this.Cs) continue;
|
|
13411
13411
|
const e = this.getItem(createWebStorageClientStateKey(this.persistenceKey, t));
|
|
13412
13412
|
if (e) {
|
|
13413
|
-
const n = __PRIVATE_RemoteClientState.
|
|
13413
|
+
const n = __PRIVATE_RemoteClientState.bs(t, e);
|
|
13414
13414
|
n && (this.xs = this.xs.insert(n.clientId, n));
|
|
13415
13415
|
}
|
|
13416
13416
|
}
|
|
@@ -13457,7 +13457,7 @@ class __PRIVATE_LocalClientState {
|
|
|
13457
13457
|
if (this.isActiveQueryTarget(e)) {
|
|
13458
13458
|
const t = this.storage.getItem(createWebStorageQueryTargetMetadataKey(this.persistenceKey, e));
|
|
13459
13459
|
if (t) {
|
|
13460
|
-
const r = __PRIVATE_QueryTargetMetadata.
|
|
13460
|
+
const r = __PRIVATE_QueryTargetMetadata.bs(e, t);
|
|
13461
13461
|
r && (n = r.state);
|
|
13462
13462
|
}
|
|
13463
13463
|
}
|
|
@@ -13565,11 +13565,11 @@ class __PRIVATE_LocalClientState {
|
|
|
13565
13565
|
return this.xs.get(this.Cs);
|
|
13566
13566
|
}
|
|
13567
13567
|
Ks() {
|
|
13568
|
-
this.setItem(this.Ns, this.Hs.
|
|
13568
|
+
this.setItem(this.Ns, this.Hs.Ss());
|
|
13569
13569
|
}
|
|
13570
13570
|
zs(e, t, n) {
|
|
13571
13571
|
const r = new __PRIVATE_MutationMetadata(this.currentUser, e, t, n), i = createWebStorageMutationBatchKey(this.persistenceKey, this.currentUser, e);
|
|
13572
|
-
this.setItem(i, r.
|
|
13572
|
+
this.setItem(i, r.Ss());
|
|
13573
13573
|
}
|
|
13574
13574
|
js(e) {
|
|
13575
13575
|
const t = createWebStorageMutationBatchKey(this.persistenceKey, this.currentUser, e);
|
|
@@ -13584,7 +13584,7 @@ class __PRIVATE_LocalClientState {
|
|
|
13584
13584
|
}
|
|
13585
13585
|
Js(e, t, n) {
|
|
13586
13586
|
const r = createWebStorageQueryTargetMetadataKey(this.persistenceKey, e), i = new __PRIVATE_QueryTargetMetadata(e, t, n);
|
|
13587
|
-
this.setItem(r, i.
|
|
13587
|
+
this.setItem(r, i.Ss());
|
|
13588
13588
|
}
|
|
13589
13589
|
Zs(e) {
|
|
13590
13590
|
const t = JSON.stringify(Array.from(e));
|
|
@@ -13602,27 +13602,27 @@ class __PRIVATE_LocalClientState {
|
|
|
13602
13602
|
* be parsed.
|
|
13603
13603
|
*/ no(e, t) {
|
|
13604
13604
|
const n = this.Xs(e);
|
|
13605
|
-
return __PRIVATE_RemoteClientState.
|
|
13605
|
+
return __PRIVATE_RemoteClientState.bs(n, t);
|
|
13606
13606
|
}
|
|
13607
13607
|
/**
|
|
13608
13608
|
* Parses a mutation batch state in WebStorage. Returns 'null' if the value
|
|
13609
13609
|
* could not be parsed.
|
|
13610
13610
|
*/ ro(e, t) {
|
|
13611
13611
|
const n = this.ks.exec(e), r = Number(n[1]), i = void 0 !== n[2] ? n[2] : null;
|
|
13612
|
-
return __PRIVATE_MutationMetadata.
|
|
13612
|
+
return __PRIVATE_MutationMetadata.bs(new User(i), r, t);
|
|
13613
13613
|
}
|
|
13614
13614
|
/**
|
|
13615
13615
|
* Parses a query target state from WebStorage. Returns 'null' if the value
|
|
13616
13616
|
* could not be parsed.
|
|
13617
13617
|
*/ so(e, t) {
|
|
13618
13618
|
const n = this.qs.exec(e), r = Number(n[1]);
|
|
13619
|
-
return __PRIVATE_QueryTargetMetadata.
|
|
13619
|
+
return __PRIVATE_QueryTargetMetadata.bs(r, t);
|
|
13620
13620
|
}
|
|
13621
13621
|
/**
|
|
13622
13622
|
* Parses an online state from WebStorage. Returns 'null' if the value
|
|
13623
13623
|
* could not be parsed.
|
|
13624
13624
|
*/ Us(e) {
|
|
13625
|
-
return __PRIVATE_SharedOnlineState.
|
|
13625
|
+
return __PRIVATE_SharedOnlineState.bs(e);
|
|
13626
13626
|
}
|
|
13627
13627
|
_o(e) {
|
|
13628
13628
|
return JSON.parse(e);
|
|
@@ -13873,8 +13873,8 @@ class __PRIVATE_RestConnection {
|
|
|
13873
13873
|
const t = e.ssl ? "https" : "http", n = encodeURIComponent(this.databaseId.projectId), r = encodeURIComponent(this.databaseId.database);
|
|
13874
13874
|
this.po = t + "://" + e.host, this.yo = `projects/${n}/databases/${r}`, this.wo = this.databaseId.database === rt ? `project_id=${n}` : `project_id=${n}&database_id=${r}`;
|
|
13875
13875
|
}
|
|
13876
|
-
|
|
13877
|
-
const s = __PRIVATE_generateUniqueDebugId(), o = this.
|
|
13876
|
+
bo(e, t, n, r, i) {
|
|
13877
|
+
const s = __PRIVATE_generateUniqueDebugId(), o = this.So(e, t.toUriEncodedString());
|
|
13878
13878
|
__PRIVATE_logDebug(Kt, `Sending RPC '${e}' ${s}:`, o, n);
|
|
13879
13879
|
const _ = {
|
|
13880
13880
|
"google-cloud-resource-prefix": this.yo,
|
|
@@ -13889,7 +13889,7 @@ class __PRIVATE_RestConnection {
|
|
|
13889
13889
|
Co(e, t, n, r, i, s) {
|
|
13890
13890
|
// The REST API automatically aggregates all of the streamed results, so we
|
|
13891
13891
|
// can just use the normal invoke() method.
|
|
13892
|
-
return this.
|
|
13892
|
+
return this.bo(e, t, n, r, i);
|
|
13893
13893
|
}
|
|
13894
13894
|
/**
|
|
13895
13895
|
* Modifies the headers for a request, adding any authorization token if
|
|
@@ -13908,7 +13908,7 @@ class __PRIVATE_RestConnection {
|
|
|
13908
13908
|
e["Content-Type"] = "text/plain", this.databaseInfo.appId && (e["X-Firebase-GMPID"] = this.databaseInfo.appId),
|
|
13909
13909
|
t && t.headers.forEach(((t, n) => e[n] = t)), n && n.headers.forEach(((t, n) => e[n] = t));
|
|
13910
13910
|
}
|
|
13911
|
-
|
|
13911
|
+
So(e, t) {
|
|
13912
13912
|
const n = Ut[e];
|
|
13913
13913
|
return `${this.po}/v1/${t}:${n}`;
|
|
13914
13914
|
}
|
|
@@ -14670,7 +14670,7 @@ class __PRIVATE_PersistentStream {
|
|
|
14670
14670
|
/**
|
|
14671
14671
|
* Tracks whether or not a handshake has been successfully exchanged and
|
|
14672
14672
|
* the stream is ready to accept mutations.
|
|
14673
|
-
*/ get
|
|
14673
|
+
*/ get b_() {
|
|
14674
14674
|
return this.__ > 0;
|
|
14675
14675
|
}
|
|
14676
14676
|
// Override of PersistentStream.start
|
|
@@ -14678,7 +14678,7 @@ class __PRIVATE_PersistentStream {
|
|
|
14678
14678
|
this.lastStreamToken = void 0, super.start();
|
|
14679
14679
|
}
|
|
14680
14680
|
A_() {
|
|
14681
|
-
this.
|
|
14681
|
+
this.b_ && this.S_([]);
|
|
14682
14682
|
}
|
|
14683
14683
|
f_(e, t) {
|
|
14684
14684
|
return this.connection.Wo("Write", e, t);
|
|
@@ -14709,7 +14709,7 @@ class __PRIVATE_PersistentStream {
|
|
|
14709
14709
|
const e = {};
|
|
14710
14710
|
e.database = __PRIVATE_getEncodedDatabaseId(this.serializer), this.I_(e);
|
|
14711
14711
|
}
|
|
14712
|
-
/** Sends a group of mutations to the Firestore backend to apply. */
|
|
14712
|
+
/** Sends a group of mutations to the Firestore backend to apply. */ S_(e) {
|
|
14713
14713
|
const t = {
|
|
14714
14714
|
streamToken: this.lastStreamToken,
|
|
14715
14715
|
writes: e.map((e => toMutation(this.serializer, e)))
|
|
@@ -14751,8 +14751,8 @@ class __PRIVATE_PersistentStream {
|
|
|
14751
14751
|
M_() {
|
|
14752
14752
|
if (this.F_) throw new FirestoreError(C.FAILED_PRECONDITION, "The client has already been terminated.");
|
|
14753
14753
|
}
|
|
14754
|
-
/** Invokes the provided RPC with auth and AppCheck tokens. */
|
|
14755
|
-
return this.M_(), Promise.all([ this.authCredentials.getToken(), this.appCheckCredentials.getToken() ]).then((([i, s]) => this.connection.
|
|
14754
|
+
/** Invokes the provided RPC with auth and AppCheck tokens. */ bo(e, t, n, r) {
|
|
14755
|
+
return this.M_(), Promise.all([ this.authCredentials.getToken(), this.appCheckCredentials.getToken() ]).then((([i, s]) => this.connection.bo(e, __PRIVATE_toResourcePath(t, n), r, i, s))).catch((e => {
|
|
14756
14756
|
throw "FirebaseError" === e.name ? (e.code === C.UNAUTHENTICATED && (this.authCredentials.invalidateToken(),
|
|
14757
14757
|
this.appCheckCredentials.invalidateToken()), e) : new FirestoreError(C.UNKNOWN, e.toString());
|
|
14758
14758
|
}));
|
|
@@ -15167,7 +15167,7 @@ async function __PRIVATE_fillWritePipeline(e) {
|
|
|
15167
15167
|
*/ function __PRIVATE_addToWritePipeline(e, t) {
|
|
15168
15168
|
e.K_.push(t);
|
|
15169
15169
|
const n = __PRIVATE_ensureWriteStream(e);
|
|
15170
|
-
n.c_() && n.
|
|
15170
|
+
n.c_() && n.b_ && n.S_(t.mutations);
|
|
15171
15171
|
}
|
|
15172
15172
|
|
|
15173
15173
|
function __PRIVATE_shouldStartWriteStream(e) {
|
|
@@ -15185,7 +15185,7 @@ async function __PRIVATE_onWriteStreamOpen(e) {
|
|
|
15185
15185
|
async function __PRIVATE_onWriteHandshakeComplete(e) {
|
|
15186
15186
|
const t = __PRIVATE_ensureWriteStream(e);
|
|
15187
15187
|
// Send the write pipeline now that the stream is established.
|
|
15188
|
-
for (const n of e.K_) t.
|
|
15188
|
+
for (const n of e.K_) t.S_(n.mutations);
|
|
15189
15189
|
}
|
|
15190
15190
|
|
|
15191
15191
|
async function __PRIVATE_onMutationResult(e, t, n) {
|
|
@@ -15199,7 +15199,7 @@ async function __PRIVATE_onMutationResult(e, t, n) {
|
|
|
15199
15199
|
async function __PRIVATE_onWriteStreamClose(e, t) {
|
|
15200
15200
|
// If the write stream closed after the write handshake completes, a write
|
|
15201
15201
|
// operation failed and we fail the pending operation.
|
|
15202
|
-
t && __PRIVATE_ensureWriteStream(e).
|
|
15202
|
+
t && __PRIVATE_ensureWriteStream(e).b_ &&
|
|
15203
15203
|
// This error affects the actual write.
|
|
15204
15204
|
await async function __PRIVATE_handleWriteError(e, t) {
|
|
15205
15205
|
// Only handle permanent errors here. If it's transient, just let the retry
|
|
@@ -16006,7 +16006,7 @@ class __PRIVATE_RemovedLimboDocument {
|
|
|
16006
16006
|
/**
|
|
16007
16007
|
* The set of remote documents that the server has told us belongs to the target associated with
|
|
16008
16008
|
* this view.
|
|
16009
|
-
*/ get
|
|
16009
|
+
*/ get ba() {
|
|
16010
16010
|
return this.fa;
|
|
16011
16011
|
}
|
|
16012
16012
|
/**
|
|
@@ -16018,7 +16018,7 @@ class __PRIVATE_RemovedLimboDocument {
|
|
|
16018
16018
|
* @param previousChanges - If this is being called with a refill, then start
|
|
16019
16019
|
* with this set of docs and changes instead of the current view.
|
|
16020
16020
|
* @returns a new set of docs, changes, and refill flag.
|
|
16021
|
-
*/
|
|
16021
|
+
*/ Sa(e, t) {
|
|
16022
16022
|
const n = t ? t.Da : new __PRIVATE_DocumentChangeSet, r = t ? t.wa : this.wa;
|
|
16023
16023
|
let i = t ? t.mutatedKeys : this.mutatedKeys, s = r, o = !1;
|
|
16024
16024
|
// Track the last doc in a (full) limit. This is necessary, because some
|
|
@@ -16231,7 +16231,7 @@ class __PRIVATE_RemovedLimboDocument {
|
|
|
16231
16231
|
// PORTING NOTE: Multi-tab only.
|
|
16232
16232
|
Oa(e) {
|
|
16233
16233
|
this.fa = e.gs, this.pa = __PRIVATE_documentKeySet();
|
|
16234
|
-
const t = this.
|
|
16234
|
+
const t = this.Sa(e.documents);
|
|
16235
16235
|
return this.applyChanges(t, /* limboResolutionEnabled= */ !0);
|
|
16236
16236
|
}
|
|
16237
16237
|
/**
|
|
@@ -16380,19 +16380,19 @@ async function __PRIVATE_allocateTargetAndMaybeListen(e, t, n, r) {
|
|
|
16380
16380
|
// targets based on view changes. This allows us to only depend on Limbo
|
|
16381
16381
|
// changes when user code includes queries.
|
|
16382
16382
|
e.Ha = (t, n, r) => async function __PRIVATE_applyDocChanges(e, t, n, r) {
|
|
16383
|
-
let i = t.view.
|
|
16383
|
+
let i = t.view.Sa(n);
|
|
16384
16384
|
i.ls && (
|
|
16385
16385
|
// The query has a limit and some docs were removed, so we need
|
|
16386
16386
|
// to re-run the query against the local store to make sure we
|
|
16387
16387
|
// didn't lose any good docs that had been past the limit.
|
|
16388
16388
|
i = await __PRIVATE_localStoreExecuteQuery(e.localStore, t.query,
|
|
16389
|
-
/* usePreviousResults= */ !1).then((({documents: e}) => t.view.
|
|
16389
|
+
/* usePreviousResults= */ !1).then((({documents: e}) => t.view.Sa(e, i))));
|
|
16390
16390
|
const s = r && r.targetChanges.get(t.targetId), o = r && null != r.targetMismatches.get(t.targetId), _ = t.view.applyChanges(i,
|
|
16391
16391
|
/* limboResolutionEnabled= */ e.isPrimaryClient, s, o);
|
|
16392
16392
|
return __PRIVATE_updateTrackedLimbos(e, t.targetId, _.Ma), _.snapshot;
|
|
16393
16393
|
}(e, t, n, r);
|
|
16394
16394
|
const s = await __PRIVATE_localStoreExecuteQuery(e.localStore, t,
|
|
16395
|
-
/* usePreviousResults= */ !0), o = new __PRIVATE_View(t, s.gs), _ = o.
|
|
16395
|
+
/* usePreviousResults= */ !0), o = new __PRIVATE_View(t, s.gs), _ = o.Sa(s.documents), a = TargetChange.createSynthesizedTargetChangeForCurrentChange(n, r && "Offline" /* OnlineState.Offline */ !== e.onlineState, i), u = o.applyChanges(_,
|
|
16396
16396
|
/* limboResolutionEnabled= */ e.isPrimaryClient, a);
|
|
16397
16397
|
__PRIVATE_updateTrackedLimbos(e, n, u.Ma);
|
|
16398
16398
|
const c = new __PRIVATE_QueryView(t, n, o);
|
|
@@ -16677,7 +16677,7 @@ function __PRIVATE_removeAndCleanupTarget(e, t, n = null) {
|
|
|
16677
16677
|
e.sharedClientState.removeLocalQueryTarget(t);
|
|
16678
16678
|
for (const r of e.qa.get(t)) e.ka.delete(r), n && e.La.Ja(r, n);
|
|
16679
16679
|
if (e.qa.delete(t), e.isPrimaryClient) {
|
|
16680
|
-
e.Ua.
|
|
16680
|
+
e.Ua.Sr(t).forEach((t => {
|
|
16681
16681
|
e.Ua.containsKey(t) ||
|
|
16682
16682
|
// We removed the last reference for this key
|
|
16683
16683
|
__PRIVATE_removeLimboTarget(e, t);
|
|
@@ -16798,7 +16798,7 @@ function __PRIVATE_syncEngineGetRemoteKeysForTarget(e, t) {
|
|
|
16798
16798
|
if (!r) return e;
|
|
16799
16799
|
for (const t of r) {
|
|
16800
16800
|
const r = n.ka.get(t);
|
|
16801
|
-
e = e.unionWith(r.view.
|
|
16801
|
+
e = e.unionWith(r.view.ba);
|
|
16802
16802
|
}
|
|
16803
16803
|
return e;
|
|
16804
16804
|
}
|
|
@@ -17584,7 +17584,7 @@ class Transaction$2 {
|
|
|
17584
17584
|
const n = __PRIVATE_debugCast(e), r = {
|
|
17585
17585
|
writes: t.map((e => toMutation(n.serializer, e)))
|
|
17586
17586
|
};
|
|
17587
|
-
await n.
|
|
17587
|
+
await n.bo("Commit", n.serializer.databaseId, ResourcePath.emptyPath(), r);
|
|
17588
17588
|
}(this.datastore, this.mutations), this.committed = !0;
|
|
17589
17589
|
}
|
|
17590
17590
|
recordVersion(e) {
|
|
@@ -17946,7 +17946,7 @@ function __PRIVATE_firestoreClientGetDocumentsFromLocalCache(e, t) {
|
|
|
17946
17946
|
return e.asyncQueue.enqueueAndForget((async () => async function __PRIVATE_executeQueryFromCache(e, t, n) {
|
|
17947
17947
|
try {
|
|
17948
17948
|
const r = await __PRIVATE_localStoreExecuteQuery(e, t,
|
|
17949
|
-
/* usePreviousResults= */ !0), i = new __PRIVATE_View(t, r.gs), s = i.
|
|
17949
|
+
/* usePreviousResults= */ !0), i = new __PRIVATE_View(t, r.gs), s = i.Sa(r.documents), o = i.applyChanges(s,
|
|
17950
17950
|
/* limboResolutionEnabled= */ !1);
|
|
17951
17951
|
n.resolve(o.snapshot);
|
|
17952
17952
|
} catch (e) {
|
|
@@ -18319,7 +18319,7 @@ class FirestoreSettingsImpl {
|
|
|
18319
18319
|
this.host = Xt, this.ssl = en;
|
|
18320
18320
|
} else this.host = e.host, this.ssl = null !== (t = e.ssl) && void 0 !== t ? t : en;
|
|
18321
18321
|
if (this.credentials = e.credentials, this.ignoreUndefinedProperties = !!e.ignoreUndefinedProperties,
|
|
18322
|
-
this.localCache = e.localCache, void 0 === e.cacheSizeBytes) this.cacheSizeBytes =
|
|
18322
|
+
this.localCache = e.localCache, void 0 === e.cacheSizeBytes) this.cacheSizeBytes = bt; else {
|
|
18323
18323
|
if (-1 !== e.cacheSizeBytes && e.cacheSizeBytes < Dt) throw new FirestoreError(C.INVALID_ARGUMENT, "cacheSizeBytes must be at least 1048576");
|
|
18324
18324
|
this.cacheSizeBytes = e.cacheSizeBytes;
|
|
18325
18325
|
}
|
|
@@ -18375,7 +18375,7 @@ class Firestore$1 {
|
|
|
18375
18375
|
* Whether it's a Firestore or Firestore Lite instance.
|
|
18376
18376
|
*/
|
|
18377
18377
|
this.type = "firestore-lite", this._persistenceKey = "(lite)", this._settings = new FirestoreSettingsImpl({}),
|
|
18378
|
-
this._settingsFrozen = !1,
|
|
18378
|
+
this._settingsFrozen = !1, this._emulatorOptions = {},
|
|
18379
18379
|
// A task that is assigned when the terminate() is invoked and resolved when
|
|
18380
18380
|
// all components have shut down. Otherwise, Firestore is not terminated,
|
|
18381
18381
|
// which can mean either the FirestoreClient is in the process of starting,
|
|
@@ -18397,7 +18397,8 @@ class Firestore$1 {
|
|
|
18397
18397
|
}
|
|
18398
18398
|
_setSettings(e) {
|
|
18399
18399
|
if (this._settingsFrozen) throw new FirestoreError(C.FAILED_PRECONDITION, "Firestore has already been started and its settings can no longer be changed. You can only modify settings before calling any other methods on a Firestore object.");
|
|
18400
|
-
this._settings = new FirestoreSettingsImpl(e),
|
|
18400
|
+
this._settings = new FirestoreSettingsImpl(e), this._emulatorOptions = e.emulatorOptions || {},
|
|
18401
|
+
void 0 !== e.credentials && (this._authCredentials = function __PRIVATE_makeAuthCredentialsProvider(e) {
|
|
18401
18402
|
if (!e) return new __PRIVATE_EmptyAuthCredentialsProvider;
|
|
18402
18403
|
switch (e.type) {
|
|
18403
18404
|
case "firstParty":
|
|
@@ -18414,6 +18415,9 @@ class Firestore$1 {
|
|
|
18414
18415
|
_getSettings() {
|
|
18415
18416
|
return this._settings;
|
|
18416
18417
|
}
|
|
18418
|
+
_getEmulatorOptions() {
|
|
18419
|
+
return this._emulatorOptions;
|
|
18420
|
+
}
|
|
18417
18421
|
_freezeSettings() {
|
|
18418
18422
|
return this._settingsFrozen = !0, this._settings;
|
|
18419
18423
|
}
|
|
@@ -18469,12 +18473,18 @@ class Firestore$1 {
|
|
|
18469
18473
|
* Security Rules.
|
|
18470
18474
|
*/ function connectFirestoreEmulator(e, t, n, r = {}) {
|
|
18471
18475
|
var i;
|
|
18472
|
-
const s = (e = __PRIVATE_cast(e, Firestore$1))._getSettings(), o =
|
|
18473
|
-
|
|
18474
|
-
|
|
18475
|
-
|
|
18476
|
-
|
|
18477
|
-
|
|
18476
|
+
const s = (e = __PRIVATE_cast(e, Firestore$1))._getSettings(), o = Object.assign(Object.assign({}, s), {
|
|
18477
|
+
emulatorOptions: e._getEmulatorOptions()
|
|
18478
|
+
}), _ = `${t}:${n}`;
|
|
18479
|
+
s.host !== Xt && s.host !== _ && __PRIVATE_logWarn("Host has been set in both settings() and connectFirestoreEmulator(), emulator host will be used.");
|
|
18480
|
+
const a = Object.assign(Object.assign({}, s), {
|
|
18481
|
+
host: _,
|
|
18482
|
+
ssl: !1,
|
|
18483
|
+
emulatorOptions: r
|
|
18484
|
+
});
|
|
18485
|
+
// No-op if the new configuration matches the current configuration. This supports SSR
|
|
18486
|
+
// enviornments which might call `connectFirestoreEmulator` multiple times as a standard practice.
|
|
18487
|
+
if (!deepEqual(a, o) && (e._setSettings(a), r.mockUserToken)) {
|
|
18478
18488
|
let t, n;
|
|
18479
18489
|
if ("string" == typeof r.mockUserToken) t = r.mockUserToken, n = User.MOCK_USER; else {
|
|
18480
18490
|
// Let createMockUserToken validate first (catches common mistakes like
|
|
@@ -18711,13 +18721,13 @@ class __PRIVATE_AsyncQueueImpl {
|
|
|
18711
18721
|
// Visibility handler that triggers an immediate retry of all retryable
|
|
18712
18722
|
// operations. Meant to speed up recovery when we regain file system access
|
|
18713
18723
|
// after page comes into foreground.
|
|
18714
|
-
this.
|
|
18724
|
+
this.bu = () => {
|
|
18715
18725
|
const e = getDocument();
|
|
18716
18726
|
e && __PRIVATE_logDebug(tn, "Visibility state changed to " + e.visibilityState),
|
|
18717
18727
|
this.a_.t_();
|
|
18718
|
-
}, this.
|
|
18728
|
+
}, this.Su = e;
|
|
18719
18729
|
const t = getDocument();
|
|
18720
|
-
t && "function" == typeof t.addEventListener && t.addEventListener("visibilitychange", this.
|
|
18730
|
+
t && "function" == typeof t.addEventListener && t.addEventListener("visibilitychange", this.bu);
|
|
18721
18731
|
}
|
|
18722
18732
|
get isShuttingDown() {
|
|
18723
18733
|
return this.mu;
|
|
@@ -18738,7 +18748,7 @@ class __PRIVATE_AsyncQueueImpl {
|
|
|
18738
18748
|
if (!this.mu) {
|
|
18739
18749
|
this.mu = !0, this.yu = e || !1;
|
|
18740
18750
|
const t = getDocument();
|
|
18741
|
-
t && "function" == typeof t.removeEventListener && t.removeEventListener("visibilitychange", this.
|
|
18751
|
+
t && "function" == typeof t.removeEventListener && t.removeEventListener("visibilitychange", this.bu);
|
|
18742
18752
|
}
|
|
18743
18753
|
}
|
|
18744
18754
|
enqueue(e) {
|
|
@@ -18782,7 +18792,7 @@ class __PRIVATE_AsyncQueueImpl {
|
|
|
18782
18792
|
}
|
|
18783
18793
|
}
|
|
18784
18794
|
vu(e) {
|
|
18785
|
-
const t = this.
|
|
18795
|
+
const t = this.Su.then((() => (this.pu = !0, e().catch((e => {
|
|
18786
18796
|
this.gu = e, this.pu = !1;
|
|
18787
18797
|
const t =
|
|
18788
18798
|
/**
|
|
@@ -18816,7 +18826,7 @@ class __PRIVATE_AsyncQueueImpl {
|
|
|
18816
18826
|
// and return the rejected Promise.
|
|
18817
18827
|
throw __PRIVATE_logError("INTERNAL UNHANDLED ERROR: ", t), e;
|
|
18818
18828
|
})).then((e => (this.pu = !1, e))))));
|
|
18819
|
-
return this.
|
|
18829
|
+
return this.Su = t, t;
|
|
18820
18830
|
}
|
|
18821
18831
|
enqueueAfterDelay(e, t, n) {
|
|
18822
18832
|
this.Du(),
|
|
@@ -18839,8 +18849,8 @@ class __PRIVATE_AsyncQueueImpl {
|
|
|
18839
18849
|
// operations were executed.
|
|
18840
18850
|
let e;
|
|
18841
18851
|
do {
|
|
18842
|
-
e = this.
|
|
18843
|
-
} while (e !== this.
|
|
18852
|
+
e = this.Su, await e;
|
|
18853
|
+
} while (e !== this.Su);
|
|
18844
18854
|
}
|
|
18845
18855
|
/**
|
|
18846
18856
|
* For Tests: Determine if a delayed operation with a particular TimerId
|
|
@@ -19618,7 +19628,7 @@ class AggregateField {
|
|
|
19618
19628
|
*/
|
|
19619
19629
|
/**
|
|
19620
19630
|
* Represents a vector type in Firestore documents.
|
|
19621
|
-
* Create an instance with {@link
|
|
19631
|
+
* Create an instance with <code>{@link vector}</code>.
|
|
19622
19632
|
*
|
|
19623
19633
|
* @class VectorValue
|
|
19624
19634
|
*/ class VectorValue {
|
|
@@ -19636,7 +19646,7 @@ class AggregateField {
|
|
|
19636
19646
|
return this._values.map((e => e));
|
|
19637
19647
|
}
|
|
19638
19648
|
/**
|
|
19639
|
-
* Returns `true` if the two VectorValue
|
|
19649
|
+
* Returns `true` if the two `VectorValue` values have the same raw number arrays, returns `false` otherwise.
|
|
19640
19650
|
*/ isEqual(e) {
|
|
19641
19651
|
return function __PRIVATE_isPrimitiveArrayEqual(e, t) {
|
|
19642
19652
|
if (e.length !== t.length) return !1;
|
|
@@ -22339,9 +22349,9 @@ let an = null;
|
|
|
22339
22349
|
return r = Object.assign({
|
|
22340
22350
|
useFetchStreams: t
|
|
22341
22351
|
}, r), s._setSettings(r), s;
|
|
22342
|
-
}), "PUBLIC").setMultipleInstances(!0)), registerVersion(
|
|
22352
|
+
}), "PUBLIC").setMultipleInstances(!0)), registerVersion(b, S, e),
|
|
22343
22353
|
// BUILD_TARGET will be replaced by values like esm2017, cjs2017, etc during the compilation
|
|
22344
|
-
registerVersion(
|
|
22354
|
+
registerVersion(b, S, "esm2017");
|
|
22345
22355
|
}();
|
|
22346
22356
|
|
|
22347
22357
|
export { AbstractUserDataWriter, AggregateField, AggregateQuerySnapshot, Bytes, nn as CACHE_SIZE_UNLIMITED, CollectionReference, DocumentReference, DocumentSnapshot, FieldPath, FieldValue, Firestore, FirestoreError, GeoPoint, LoadBundleTask, PersistentCacheIndexManager, Query, QueryCompositeFilterConstraint, QueryConstraint, QueryDocumentSnapshot, QueryEndAtConstraint, QueryFieldFilterConstraint, QueryLimitConstraint, QueryOrderByConstraint, QuerySnapshot, QueryStartAtConstraint, SnapshotMetadata, Timestamp, Transaction, VectorValue, WriteBatch, __PRIVATE_AutoId as _AutoId, ByteString as _ByteString, DatabaseId as _DatabaseId, DocumentKey as _DocumentKey, __PRIVATE_EmptyAppCheckTokenProvider as _EmptyAppCheckTokenProvider, __PRIVATE_EmptyAuthCredentialsProvider as _EmptyAuthCredentialsProvider, FieldPath$1 as _FieldPath, TestingHooks as _TestingHooks, __PRIVATE_cast as _cast, __PRIVATE_debugAssert as _debugAssert, _internalAggregationQueryToProtoRunAggregationQueryRequest, _internalQueryToProtoQueryTarget, __PRIVATE_isBase64Available as _isBase64Available, __PRIVATE_logWarn as _logWarn, __PRIVATE_validateIsNotUsedTogether as _validateIsNotUsedTogether, addDoc, aggregateFieldEqual, aggregateQuerySnapshotEqual, and, arrayRemove, arrayUnion, average, clearIndexedDbPersistence, collection, collectionGroup, connectFirestoreEmulator, count, deleteAllPersistentCacheIndexes, deleteDoc, deleteField, disableNetwork, disablePersistentCacheIndexAutoCreation, doc, documentId, enableIndexedDbPersistence, enableMultiTabIndexedDbPersistence, enableNetwork, enablePersistentCacheIndexAutoCreation, endAt, endBefore, ensureFirestoreConfigured, executeWrite, getAggregateFromServer, getCountFromServer, getDoc, getDocFromCache, getDocFromServer, getDocs, getDocsFromCache, getDocsFromServer, getFirestore, getPersistentCacheIndexManager, increment, initializeFirestore, limit, limitToLast, loadBundle, memoryEagerGarbageCollector, memoryLocalCache, memoryLruGarbageCollector, namedQuery, onSnapshot, onSnapshotsInSync, or, orderBy, persistentLocalCache, persistentMultipleTabManager, persistentSingleTabManager, query, queryEqual, refEqual, runTransaction, serverTimestamp, setDoc, setIndexConfiguration, setLogLevel, snapshotEqual, startAfter, startAt, sum, terminate, updateDoc, vector, waitForPendingWrites, where, writeBatch };
|