@firebase/firestore 3.4.2 → 3.4.3-canary.1b246ae04
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/CHANGELOG.md +8 -0
- package/dist/firestore/src/api/snapshot.d.ts +6 -6
- package/dist/firestore/src/lite-api/snapshot.d.ts +2 -2
- package/dist/firestore/test/integration/bootstrap.d.ts +0 -1
- package/dist/firestore/test/integration/util/events_accumulator.d.ts +2 -2
- package/dist/firestore/test/integration/util/firebase_export.d.ts +6 -14
- package/dist/firestore/test/integration/util/helpers.d.ts +18 -18
- package/dist/firestore/test/integration/util/internal_helpers.d.ts +3 -3
- package/dist/firestore/test/integration/util/settings.d.ts +2 -2
- package/dist/firestore/test/unit/api/{blob.test.d.ts → bytes.test.d.ts} +0 -0
- package/dist/firestore/test/util/api_helpers.d.ts +1 -1
- package/dist/firestore/test/util/helpers.d.ts +4 -6
- package/dist/index.d.ts +6 -6
- package/dist/index.esm2017.js +227 -227
- package/dist/index.esm2017.js.map +1 -1
- package/dist/index.esm5.js +202 -202
- package/dist/index.esm5.js.map +1 -1
- package/dist/index.node.cjs.js +2674 -24
- package/dist/index.node.cjs.js.map +1 -1
- package/dist/index.node.mjs +2675 -25
- package/dist/index.node.mjs.map +1 -1
- package/dist/index.rn.js +1068 -1068
- package/dist/index.rn.js.map +1 -1
- package/dist/internal.d.ts +8 -8
- package/dist/lite/firestore/src/api/snapshot.d.ts +6 -6
- package/dist/lite/firestore/src/lite-api/snapshot.d.ts +2 -2
- package/dist/lite/firestore/test/integration/bootstrap.d.ts +0 -1
- package/dist/lite/firestore/test/integration/util/events_accumulator.d.ts +2 -2
- package/dist/lite/firestore/test/integration/util/firebase_export.d.ts +6 -14
- package/dist/lite/firestore/test/integration/util/helpers.d.ts +18 -18
- package/dist/lite/firestore/test/integration/util/internal_helpers.d.ts +3 -3
- package/dist/lite/firestore/test/integration/util/settings.d.ts +2 -2
- package/dist/lite/firestore/test/unit/api/{blob.test.d.ts → bytes.test.d.ts} +0 -0
- package/dist/lite/firestore/test/util/api_helpers.d.ts +1 -1
- package/dist/lite/firestore/test/util/helpers.d.ts +4 -6
- package/dist/lite/index.browser.esm2017.js +1149 -1149
- package/dist/lite/index.browser.esm2017.js.map +1 -1
- package/dist/lite/index.browser.esm5.js +111 -111
- package/dist/lite/index.browser.esm5.js.map +1 -1
- package/dist/lite/index.d.ts +2 -2
- package/dist/lite/index.node.cjs.js +11 -12
- package/dist/lite/index.node.cjs.js.map +1 -1
- package/dist/lite/index.node.mjs +11 -12
- package/dist/lite/index.node.mjs.map +1 -1
- package/dist/lite/index.rn.esm2017.js +222 -222
- package/dist/lite/index.rn.esm2017.js.map +1 -1
- package/dist/lite/internal.d.ts +2 -2
- package/dist/lite/packages/firestore/dist/lite/index.browser.esm2017.d.ts +110 -110
- package/dist/lite/packages/firestore/src/api/snapshot.d.ts +6 -6
- package/dist/lite/packages/firestore/src/lite-api/snapshot.d.ts +2 -2
- package/dist/lite/packages/firestore/test/integration/bootstrap.d.ts +0 -1
- package/dist/lite/packages/firestore/test/integration/util/events_accumulator.d.ts +2 -2
- package/dist/lite/packages/firestore/test/integration/util/firebase_export.d.ts +6 -14
- package/dist/lite/packages/firestore/test/integration/util/helpers.d.ts +18 -18
- package/dist/lite/packages/firestore/test/integration/util/internal_helpers.d.ts +3 -3
- package/dist/lite/packages/firestore/test/integration/util/settings.d.ts +2 -2
- package/dist/lite/packages/firestore/test/unit/api/{blob.test.d.ts → bytes.test.d.ts} +0 -0
- package/dist/lite/packages/firestore/test/util/api_helpers.d.ts +1 -1
- package/dist/lite/packages/firestore/test/util/helpers.d.ts +4 -6
- package/dist/lite/private.d.ts +2 -2
- package/dist/packages/firestore/dist/index.esm2017.d.ts +13 -13
- package/dist/packages/firestore/src/api/snapshot.d.ts +6 -6
- package/dist/packages/firestore/src/lite-api/snapshot.d.ts +2 -2
- package/dist/packages/firestore/test/integration/bootstrap.d.ts +0 -1
- package/dist/packages/firestore/test/integration/util/events_accumulator.d.ts +2 -2
- package/dist/packages/firestore/test/integration/util/firebase_export.d.ts +6 -14
- package/dist/packages/firestore/test/integration/util/helpers.d.ts +18 -18
- package/dist/packages/firestore/test/integration/util/internal_helpers.d.ts +3 -3
- package/dist/packages/firestore/test/integration/util/settings.d.ts +2 -2
- package/dist/packages/firestore/test/unit/api/{blob.test.d.ts → bytes.test.d.ts} +0 -0
- package/dist/packages/firestore/test/util/api_helpers.d.ts +1 -1
- package/dist/packages/firestore/test/util/helpers.d.ts +4 -6
- package/dist/private.d.ts +8 -8
- package/package.json +10 -13
- package/dist/firestore/compat/api/blob.d.ts +0 -29
- package/dist/firestore/compat/api/database.d.ts +0 -228
- package/dist/firestore/compat/api/field_path.d.ts +0 -36
- package/dist/firestore/compat/api/field_value.d.ts +0 -29
- package/dist/firestore/compat/api/geo_point.d.ts +0 -17
- package/dist/firestore/compat/api/observer.d.ts +0 -29
- package/dist/firestore/compat/api/timestamp.d.ts +0 -17
- package/dist/firestore/compat/config.d.ts +0 -28
- package/dist/firestore/compat/index.console.d.ts +0 -42
- package/dist/firestore/compat/index.d.ts +0 -49
- package/dist/firestore/compat/index.node.d.ts +0 -22
- package/dist/firestore/compat/index.rn.d.ts +0 -22
- package/dist/firestore/compat/register-module.d.ts +0 -42
- package/dist/firestore/compat/util/input_validation.d.ts +0 -18
- package/dist/lite/firestore/compat/api/blob.d.ts +0 -29
- package/dist/lite/firestore/compat/api/database.d.ts +0 -228
- package/dist/lite/firestore/compat/api/field_path.d.ts +0 -36
- package/dist/lite/firestore/compat/api/field_value.d.ts +0 -29
- package/dist/lite/firestore/compat/api/geo_point.d.ts +0 -17
- package/dist/lite/firestore/compat/api/observer.d.ts +0 -29
- package/dist/lite/firestore/compat/api/timestamp.d.ts +0 -17
- package/dist/lite/firestore/compat/config.d.ts +0 -28
- package/dist/lite/firestore/compat/index.console.d.ts +0 -42
- package/dist/lite/firestore/compat/index.d.ts +0 -49
- package/dist/lite/firestore/compat/index.node.d.ts +0 -22
- package/dist/lite/firestore/compat/index.rn.d.ts +0 -22
- package/dist/lite/firestore/compat/register-module.d.ts +0 -42
- package/dist/lite/firestore/compat/util/input_validation.d.ts +0 -18
- package/dist/lite/packages/firestore/compat/api/blob.d.ts +0 -29
- package/dist/lite/packages/firestore/compat/api/database.d.ts +0 -228
- package/dist/lite/packages/firestore/compat/api/field_path.d.ts +0 -36
- package/dist/lite/packages/firestore/compat/api/field_value.d.ts +0 -29
- package/dist/lite/packages/firestore/compat/api/geo_point.d.ts +0 -17
- package/dist/lite/packages/firestore/compat/api/observer.d.ts +0 -29
- package/dist/lite/packages/firestore/compat/api/timestamp.d.ts +0 -17
- package/dist/lite/packages/firestore/compat/config.d.ts +0 -28
- package/dist/lite/packages/firestore/compat/index.console.d.ts +0 -42
- package/dist/lite/packages/firestore/compat/index.d.ts +0 -49
- package/dist/lite/packages/firestore/compat/index.node.d.ts +0 -22
- package/dist/lite/packages/firestore/compat/index.rn.d.ts +0 -22
- package/dist/lite/packages/firestore/compat/register-module.d.ts +0 -42
- package/dist/lite/packages/firestore/compat/util/input_validation.d.ts +0 -18
- package/dist/lite/src/protos/README.md +0 -2
- package/dist/lite/src/protos/firestore/bundle.proto +0 -121
- package/dist/lite/src/protos/firestore_bundle_proto.ts +0 -93
- package/dist/lite/src/protos/firestore_proto_api.ts +0 -1259
- package/dist/lite/src/protos/google/api/annotations.proto +0 -31
- package/dist/lite/src/protos/google/api/http.proto +0 -370
- package/dist/lite/src/protos/google/firestore/v1/common.proto +0 -84
- package/dist/lite/src/protos/google/firestore/v1/document.proto +0 -151
- package/dist/lite/src/protos/google/firestore/v1/firestore.proto +0 -761
- package/dist/lite/src/protos/google/firestore/v1/query.proto +0 -302
- package/dist/lite/src/protos/google/firestore/v1/write.proto +0 -264
- package/dist/lite/src/protos/google/protobuf/any.proto +0 -155
- package/dist/lite/src/protos/google/protobuf/descriptor.proto +0 -882
- package/dist/lite/src/protos/google/protobuf/empty.proto +0 -52
- package/dist/lite/src/protos/google/protobuf/struct.proto +0 -96
- package/dist/lite/src/protos/google/protobuf/timestamp.proto +0 -137
- package/dist/lite/src/protos/google/protobuf/wrappers.proto +0 -123
- package/dist/lite/src/protos/google/rpc/status.proto +0 -92
- package/dist/lite/src/protos/google/type/latlng.proto +0 -71
- package/dist/lite/src/protos/update.sh +0 -61
- package/dist/packages/firestore/compat/api/blob.d.ts +0 -29
- package/dist/packages/firestore/compat/api/database.d.ts +0 -228
- package/dist/packages/firestore/compat/api/field_path.d.ts +0 -36
- package/dist/packages/firestore/compat/api/field_value.d.ts +0 -29
- package/dist/packages/firestore/compat/api/geo_point.d.ts +0 -17
- package/dist/packages/firestore/compat/api/observer.d.ts +0 -29
- package/dist/packages/firestore/compat/api/timestamp.d.ts +0 -17
- package/dist/packages/firestore/compat/config.d.ts +0 -28
- package/dist/packages/firestore/compat/index.console.d.ts +0 -42
- package/dist/packages/firestore/compat/index.d.ts +0 -49
- package/dist/packages/firestore/compat/index.node.d.ts +0 -22
- package/dist/packages/firestore/compat/index.rn.d.ts +0 -22
- package/dist/packages/firestore/compat/register-module.d.ts +0 -42
- package/dist/packages/firestore/compat/util/input_validation.d.ts +0 -18
- package/dist/src/protos/README.md +0 -2
- package/dist/src/protos/firestore/bundle.proto +0 -121
- package/dist/src/protos/firestore_bundle_proto.ts +0 -93
- package/dist/src/protos/firestore_proto_api.ts +0 -1259
- package/dist/src/protos/google/api/annotations.proto +0 -31
- package/dist/src/protos/google/api/http.proto +0 -370
- package/dist/src/protos/google/firestore/v1/common.proto +0 -84
- package/dist/src/protos/google/firestore/v1/document.proto +0 -151
- package/dist/src/protos/google/firestore/v1/firestore.proto +0 -761
- package/dist/src/protos/google/firestore/v1/query.proto +0 -302
- package/dist/src/protos/google/firestore/v1/write.proto +0 -264
- package/dist/src/protos/google/protobuf/any.proto +0 -155
- package/dist/src/protos/google/protobuf/descriptor.proto +0 -882
- package/dist/src/protos/google/protobuf/empty.proto +0 -52
- package/dist/src/protos/google/protobuf/struct.proto +0 -96
- package/dist/src/protos/google/protobuf/timestamp.proto +0 -137
- package/dist/src/protos/google/protobuf/wrappers.proto +0 -123
- package/dist/src/protos/google/rpc/status.proto +0 -92
- package/dist/src/protos/google/type/latlng.proto +0 -71
- package/dist/src/protos/update.sh +0 -61
package/dist/index.esm2017.js
CHANGED
|
@@ -66,7 +66,7 @@ C.MOCK_USER = new C("mock-user");
|
|
|
66
66
|
* See the License for the specific language governing permissions and
|
|
67
67
|
* limitations under the License.
|
|
68
68
|
*/
|
|
69
|
-
let N = "9.6.
|
|
69
|
+
let N = "9.6.3-canary.1b246ae04";
|
|
70
70
|
|
|
71
71
|
/**
|
|
72
72
|
* @license
|
|
@@ -114,7 +114,7 @@ function O(t, ...e) {
|
|
|
114
114
|
}
|
|
115
115
|
}
|
|
116
116
|
|
|
117
|
-
function
|
|
117
|
+
function M(t, ...e) {
|
|
118
118
|
if (k.logLevel <= LogLevel.ERROR) {
|
|
119
119
|
const n = e.map(L);
|
|
120
120
|
k.error(`Firestore (${N}): ${t}`, ...n);
|
|
@@ -123,7 +123,7 @@ function F(t, ...e) {
|
|
|
123
123
|
|
|
124
124
|
/**
|
|
125
125
|
* @internal
|
|
126
|
-
*/ function
|
|
126
|
+
*/ function F(t, ...e) {
|
|
127
127
|
if (k.logLevel <= LogLevel.WARN) {
|
|
128
128
|
const n = e.map(L);
|
|
129
129
|
k.warn(`Firestore (${N}): ${t}`, ...n);
|
|
@@ -190,7 +190,7 @@ function F(t, ...e) {
|
|
|
190
190
|
// NOTE: We don't use FirestoreError here because these are internal failures
|
|
191
191
|
// that cannot be handled by the user. (Also it would create a circular
|
|
192
192
|
// dependency between the error and assert modules which doesn't work.)
|
|
193
|
-
throw
|
|
193
|
+
throw M(e), new Error(e);
|
|
194
194
|
}
|
|
195
195
|
|
|
196
196
|
/**
|
|
@@ -1697,17 +1697,17 @@ function $t(t, e) {
|
|
|
1697
1697
|
}
|
|
1698
1698
|
|
|
1699
1699
|
function Ot(t) {
|
|
1700
|
-
return
|
|
1700
|
+
return Mt(t);
|
|
1701
1701
|
}
|
|
1702
1702
|
|
|
1703
|
-
function
|
|
1703
|
+
function Mt(t) {
|
|
1704
1704
|
return "nullValue" in t ? "null" : "booleanValue" in t ? "" + t.booleanValue : "integerValue" in t ? "" + t.integerValue : "doubleValue" in t ? "" + t.doubleValue : "timestampValue" in t ? function(t) {
|
|
1705
1705
|
const e = Et(t);
|
|
1706
1706
|
return `time(${e.seconds},${e.nanos})`;
|
|
1707
1707
|
}(t.timestampValue) : "stringValue" in t ? t.stringValue : "bytesValue" in t ? At(t.bytesValue).toBase64() : "referenceValue" in t ? (n = t.referenceValue,
|
|
1708
1708
|
Dt.fromName(n).toString()) : "geoPointValue" in t ? `geo(${(e = t.geoPointValue).latitude},${e.longitude})` : "arrayValue" in t ? function(t) {
|
|
1709
1709
|
let e = "[", n = !0;
|
|
1710
|
-
for (const s of t.values || []) n ? n = !1 : e += ",", e +=
|
|
1710
|
+
for (const s of t.values || []) n ? n = !1 : e += ",", e += Mt(s);
|
|
1711
1711
|
return e + "]";
|
|
1712
1712
|
}
|
|
1713
1713
|
/** Returns a reference value for the provided database and key. */ (t.arrayValue) : "mapValue" in t ? function(t) {
|
|
@@ -1715,13 +1715,13 @@ function Ft(t) {
|
|
|
1715
1715
|
// matching canonical IDs for identical maps, we need to sort the keys.
|
|
1716
1716
|
const e = Object.keys(t.fields || {}).sort();
|
|
1717
1717
|
let n = "{", s = !0;
|
|
1718
|
-
for (const i of e) s ? s = !1 : n += ",", n += `${i}:${
|
|
1718
|
+
for (const i of e) s ? s = !1 : n += ",", n += `${i}:${Mt(t.fields[i])}`;
|
|
1719
1719
|
return n + "}";
|
|
1720
1720
|
}(t.mapValue) : B();
|
|
1721
1721
|
var e, n;
|
|
1722
1722
|
}
|
|
1723
1723
|
|
|
1724
|
-
function
|
|
1724
|
+
function Ft(t, e) {
|
|
1725
1725
|
return {
|
|
1726
1726
|
referenceValue: `projects/${t.projectId}/databases/${t.database}/documents/${e.path.canonicalString()}`
|
|
1727
1727
|
};
|
|
@@ -2568,7 +2568,7 @@ function Ne(t, e, n) {
|
|
|
2568
2568
|
/**
|
|
2569
2569
|
* Computes the local transform result against the provided `previousValue`,
|
|
2570
2570
|
* optionally using the provided localWriteTime.
|
|
2571
|
-
*/ function
|
|
2571
|
+
*/ function Me(t, e, n) {
|
|
2572
2572
|
return t instanceof Be ? function(t, e) {
|
|
2573
2573
|
const n = {
|
|
2574
2574
|
fields: {
|
|
@@ -2598,7 +2598,7 @@ function Ne(t, e, n) {
|
|
|
2598
2598
|
/**
|
|
2599
2599
|
* Computes a final transform result after the transform has been acknowledged
|
|
2600
2600
|
* by the server, potentially using the server-provided transformResult.
|
|
2601
|
-
*/ function
|
|
2601
|
+
*/ function Fe(t, e, n) {
|
|
2602
2602
|
// The server just sends null as the transform result for array operations,
|
|
2603
2603
|
// so we have to calculate a result the same as we do for local
|
|
2604
2604
|
// applications.
|
|
@@ -2981,7 +2981,7 @@ function cn(t) {
|
|
|
2981
2981
|
U(t.length === n.length);
|
|
2982
2982
|
for (let i = 0; i < n.length; i++) {
|
|
2983
2983
|
const r = t[i], o = r.transform, a = e.data.field(r.field);
|
|
2984
|
-
s.set(r.field,
|
|
2984
|
+
s.set(r.field, Fe(o, a, n[i]));
|
|
2985
2985
|
}
|
|
2986
2986
|
return s;
|
|
2987
2987
|
}
|
|
@@ -3001,7 +3001,7 @@ function cn(t) {
|
|
|
3001
3001
|
const s = new Map;
|
|
3002
3002
|
for (const i of t) {
|
|
3003
3003
|
const t = i.transform, r = n.data.field(i.field);
|
|
3004
|
-
s.set(i.field,
|
|
3004
|
+
s.set(i.field, Me(t, r, e));
|
|
3005
3005
|
}
|
|
3006
3006
|
return s;
|
|
3007
3007
|
}
|
|
@@ -3128,7 +3128,7 @@ function gn(t) {
|
|
|
3128
3128
|
if (void 0 === t)
|
|
3129
3129
|
// This shouldn't normally happen, but in certain error cases (like trying
|
|
3130
3130
|
// to send invalid proto messages) we may get an error with no GRPC code.
|
|
3131
|
-
return
|
|
3131
|
+
return M("GRPC error has no .code"), j.UNKNOWN;
|
|
3132
3132
|
switch (t) {
|
|
3133
3133
|
case wn.OK:
|
|
3134
3134
|
return j.OK;
|
|
@@ -3854,11 +3854,11 @@ function Nn() {
|
|
|
3854
3854
|
|
|
3855
3855
|
class On {
|
|
3856
3856
|
constructor(t, e) {
|
|
3857
|
-
this.targetId = t, this.
|
|
3857
|
+
this.targetId = t, this.M = e;
|
|
3858
3858
|
}
|
|
3859
3859
|
}
|
|
3860
3860
|
|
|
3861
|
-
class
|
|
3861
|
+
class Mn {
|
|
3862
3862
|
constructor(
|
|
3863
3863
|
/** What kind of change occurred to the watch target. */
|
|
3864
3864
|
t,
|
|
@@ -3876,13 +3876,13 @@ class Fn {
|
|
|
3876
3876
|
}
|
|
3877
3877
|
}
|
|
3878
3878
|
|
|
3879
|
-
/** Tracks the internal state of a Watch target. */ class
|
|
3879
|
+
/** Tracks the internal state of a Watch target. */ class Fn {
|
|
3880
3880
|
constructor() {
|
|
3881
3881
|
/**
|
|
3882
3882
|
* The number of pending responses (adds or removes) that we are waiting on.
|
|
3883
3883
|
* We only consider targets active that have no pending responses.
|
|
3884
3884
|
*/
|
|
3885
|
-
this.
|
|
3885
|
+
this.F = 0,
|
|
3886
3886
|
/**
|
|
3887
3887
|
* Keeps track of the document changes since the last raised snapshot.
|
|
3888
3888
|
*
|
|
@@ -3913,7 +3913,7 @@ class Fn {
|
|
|
3913
3913
|
return this.B;
|
|
3914
3914
|
}
|
|
3915
3915
|
/** Whether this target has pending target adds or target removes. */ get K() {
|
|
3916
|
-
return 0 !== this.
|
|
3916
|
+
return 0 !== this.F;
|
|
3917
3917
|
}
|
|
3918
3918
|
/** Whether we have modified any state that should trigger a snapshot. */ get j() {
|
|
3919
3919
|
return this.q;
|
|
@@ -3962,10 +3962,10 @@ class Fn {
|
|
|
3962
3962
|
this.q = !0, this.L = this.L.remove(t);
|
|
3963
3963
|
}
|
|
3964
3964
|
X() {
|
|
3965
|
-
this.
|
|
3965
|
+
this.F += 1;
|
|
3966
3966
|
}
|
|
3967
3967
|
Z() {
|
|
3968
|
-
this.
|
|
3968
|
+
this.F -= 1;
|
|
3969
3969
|
}
|
|
3970
3970
|
tt() {
|
|
3971
3971
|
this.q = !0, this.U = !0;
|
|
@@ -4054,7 +4054,7 @@ class Ln {
|
|
|
4054
4054
|
* Targets that are invalidated by filter mismatches are added to
|
|
4055
4055
|
* `pendingTargetResets`.
|
|
4056
4056
|
*/ dt(t) {
|
|
4057
|
-
const e = t.targetId, n = t.
|
|
4057
|
+
const e = t.targetId, n = t.M.count, s = this.wt(e);
|
|
4058
4058
|
if (s) {
|
|
4059
4059
|
const t = s.target;
|
|
4060
4060
|
if (Zt(t)) if (0 === n) {
|
|
@@ -4158,7 +4158,7 @@ class Ln {
|
|
|
4158
4158
|
}
|
|
4159
4159
|
ht(t) {
|
|
4160
4160
|
let e = this.nt.get(t);
|
|
4161
|
-
return e || (e = new
|
|
4161
|
+
return e || (e = new Fn, this.nt.set(t, e)), e;
|
|
4162
4162
|
}
|
|
4163
4163
|
Tt(t) {
|
|
4164
4164
|
let e = this.it.get(t);
|
|
@@ -4184,7 +4184,7 @@ class Ln {
|
|
|
4184
4184
|
* 'current' to false, clears the resume token and removes its target mapping
|
|
4185
4185
|
* from all documents).
|
|
4186
4186
|
*/ ft(t) {
|
|
4187
|
-
this.nt.set(t, new
|
|
4187
|
+
this.nt.set(t, new Fn);
|
|
4188
4188
|
this.et.getRemoteKeysForTarget(t).forEach((e => {
|
|
4189
4189
|
this.ct(t, e, /*updatedDocument=*/ null);
|
|
4190
4190
|
}));
|
|
@@ -4395,7 +4395,7 @@ function os(t, e) {
|
|
|
4395
4395
|
* our generated proto interfaces say Int32Value must be. But GRPC actually
|
|
4396
4396
|
* expects a { value: <number> } struct.
|
|
4397
4397
|
*/ (o);
|
|
4398
|
-
n = new
|
|
4398
|
+
n = new Mn(s, i, r, a || null);
|
|
4399
4399
|
} else if ("documentChange" in e) {
|
|
4400
4400
|
e.documentChange;
|
|
4401
4401
|
const s = e.documentChange;
|
|
@@ -5201,7 +5201,7 @@ Os.collectionReadTimeIndex = "collectionReadTimeIndex", Os.collectionReadTimeInd
|
|
|
5201
5201
|
/**
|
|
5202
5202
|
* Contains a single entry that has metadata about the remote document cache.
|
|
5203
5203
|
*/
|
|
5204
|
-
class
|
|
5204
|
+
class Ms {
|
|
5205
5205
|
/**
|
|
5206
5206
|
* @param byteSize - Approximately the total size in bytes of all the
|
|
5207
5207
|
* documents in the document cache.
|
|
@@ -5211,7 +5211,7 @@ class Fs {
|
|
|
5211
5211
|
}
|
|
5212
5212
|
}
|
|
5213
5213
|
|
|
5214
|
-
|
|
5214
|
+
Ms.store = "remoteDocumentGlobal", Ms.key = "remoteDocumentGlobalKey";
|
|
5215
5215
|
|
|
5216
5216
|
/**
|
|
5217
5217
|
* An object to be stored in the 'targets' store in IndexedDb.
|
|
@@ -5222,7 +5222,7 @@ Fs.store = "remoteDocumentGlobal", Fs.key = "remoteDocumentGlobalKey";
|
|
|
5222
5222
|
* Each query the client listens to against the server is tracked on disk so
|
|
5223
5223
|
* that the query can be efficiently resumed on restart.
|
|
5224
5224
|
*/
|
|
5225
|
-
class
|
|
5225
|
+
class Fs {
|
|
5226
5226
|
constructor(
|
|
5227
5227
|
/**
|
|
5228
5228
|
* An auto-generated sequential numeric identifier for the query.
|
|
@@ -5295,17 +5295,17 @@ class Ms {
|
|
|
5295
5295
|
}
|
|
5296
5296
|
}
|
|
5297
5297
|
|
|
5298
|
-
|
|
5298
|
+
Fs.store = "targets",
|
|
5299
5299
|
/** Keys are automatically assigned via the targetId property. */
|
|
5300
|
-
|
|
5300
|
+
Fs.keyPath = "targetId",
|
|
5301
5301
|
/** The name of the queryTargets index. */
|
|
5302
|
-
|
|
5302
|
+
Fs.queryTargetsIndexName = "queryTargetsIndex",
|
|
5303
5303
|
/**
|
|
5304
5304
|
* The index of all canonicalIds to the targets that they match. This is not
|
|
5305
5305
|
* a unique mapping because canonicalId does not promise a unique name for all
|
|
5306
5306
|
* possible queries, so we append the targetId to make the mapping unique.
|
|
5307
5307
|
*/
|
|
5308
|
-
|
|
5308
|
+
Fs.queryTargetsKeyPath = [ "canonicalId", "targetId" ];
|
|
5309
5309
|
|
|
5310
5310
|
/**
|
|
5311
5311
|
* An object representing an association between a target and a document, or a
|
|
@@ -5474,7 +5474,7 @@ class js {
|
|
|
5474
5474
|
/** Name of the IndexedDb object store. */ js.store = "namedQueries", js.keyPath = "name";
|
|
5475
5475
|
|
|
5476
5476
|
// Visible for testing
|
|
5477
|
-
const Qs = [ ...[ ...[ ...[ ...[ Cs.store, Ns.store, ks.store, Os.store,
|
|
5477
|
+
const Qs = [ ...[ ...[ ...[ ...[ Cs.store, Ns.store, ks.store, Os.store, Fs.store, Ds.store, Bs.store, Ls.store ], qs.store ], Ms.store ], Us.store ], Ks.store, js.store ], Ws = "The current tab is not in the required state to perform this operation. It might be necessary to refresh the browser tab.";
|
|
5478
5478
|
|
|
5479
5479
|
// V2 is no longer usable (see comment at top of file)
|
|
5480
5480
|
// Visible for testing
|
|
@@ -5703,7 +5703,7 @@ class Hs {
|
|
|
5703
5703
|
// bug we're checking for should exist in iOS >= 12.2 and < 13, but for
|
|
5704
5704
|
// whatever reason it's much harder to hit after 12.2 so we only proactively
|
|
5705
5705
|
// log on 12.2.
|
|
5706
|
-
12.2 === Js.bt(getUA()) &&
|
|
5706
|
+
12.2 === Js.bt(getUA()) && M("Firestore persistence suffers from a bug in iOS 12.2 Safari that may cause your app to stop working. See https://stackoverflow.com/q/56496296/110915 for details and a potential workaround.");
|
|
5707
5707
|
}
|
|
5708
5708
|
/** Deletes the specified database. */ static delete(t) {
|
|
5709
5709
|
return O("SimpleDb", "Removing database:", t), ei(window.indexedDB.deleteDatabase(t)).toPromise();
|
|
@@ -5821,13 +5821,13 @@ class Hs {
|
|
|
5821
5821
|
* within the key range or index.
|
|
5822
5822
|
*/ class Ys {
|
|
5823
5823
|
constructor(t) {
|
|
5824
|
-
this.$t = t, this.Ot = !1, this.
|
|
5824
|
+
this.$t = t, this.Ot = !1, this.Mt = null;
|
|
5825
5825
|
}
|
|
5826
5826
|
get isDone() {
|
|
5827
5827
|
return this.Ot;
|
|
5828
5828
|
}
|
|
5829
|
-
get
|
|
5830
|
-
return this.
|
|
5829
|
+
get Ft() {
|
|
5830
|
+
return this.Mt;
|
|
5831
5831
|
}
|
|
5832
5832
|
set cursor(t) {
|
|
5833
5833
|
this.$t = t;
|
|
@@ -5841,7 +5841,7 @@ class Hs {
|
|
|
5841
5841
|
* This function can be called to skip to that next key, which could be
|
|
5842
5842
|
* an index or a primary key.
|
|
5843
5843
|
*/ Lt(t) {
|
|
5844
|
-
this.
|
|
5844
|
+
this.Mt = t;
|
|
5845
5845
|
}
|
|
5846
5846
|
/**
|
|
5847
5847
|
* Delete the current cursor value from the object store.
|
|
@@ -5971,7 +5971,7 @@ class Hs {
|
|
|
5971
5971
|
const t = o.catch((t => (r.done(), zs.reject(t))));
|
|
5972
5972
|
n.push(t);
|
|
5973
5973
|
}
|
|
5974
|
-
r.isDone ? s() : null === r.
|
|
5974
|
+
r.isDone ? s() : null === r.Ft ? i.continue() : i.continue(r.Ft);
|
|
5975
5975
|
};
|
|
5976
5976
|
})).next((() => zs.waitFor(n)));
|
|
5977
5977
|
}
|
|
@@ -6349,7 +6349,7 @@ function mi(t, e) {
|
|
|
6349
6349
|
// convert it to a base64 string for storage.
|
|
6350
6350
|
const r = e.resumeToken.toBase64();
|
|
6351
6351
|
// lastListenSequenceNumber is always 0 until we do real GC.
|
|
6352
|
-
return new
|
|
6352
|
+
return new Fs(e.targetId, Jt(e.target), n, r, e.sequenceNumber, s, i);
|
|
6353
6353
|
}
|
|
6354
6354
|
|
|
6355
6355
|
/**
|
|
@@ -7013,7 +7013,7 @@ class Oi {
|
|
|
7013
7013
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
7014
7014
|
* See the License for the specific language governing permissions and
|
|
7015
7015
|
* limitations under the License.
|
|
7016
|
-
*/ class
|
|
7016
|
+
*/ class Mi {
|
|
7017
7017
|
constructor(t, e) {
|
|
7018
7018
|
this.referenceDelegate = t, this.k = e;
|
|
7019
7019
|
}
|
|
@@ -7047,7 +7047,7 @@ class Oi {
|
|
|
7047
7047
|
return this.ce(t, e);
|
|
7048
7048
|
}
|
|
7049
7049
|
removeTargetData(t, e) {
|
|
7050
|
-
return this.removeMatchingKeysForTargetId(t, e.targetId).next((() =>
|
|
7050
|
+
return this.removeMatchingKeysForTargetId(t, e.targetId).next((() => Fi(t).delete(e.targetId))).next((() => this.oe(t))).next((e => (U(e.targetCount > 0),
|
|
7051
7051
|
e.targetCount -= 1, this.ae(t, e))));
|
|
7052
7052
|
}
|
|
7053
7053
|
/**
|
|
@@ -7057,7 +7057,7 @@ class Oi {
|
|
|
7057
7057
|
*/ removeTargets(t, e, n) {
|
|
7058
7058
|
let s = 0;
|
|
7059
7059
|
const i = [];
|
|
7060
|
-
return
|
|
7060
|
+
return Fi(t).jt(((r, o) => {
|
|
7061
7061
|
const a = gi(o);
|
|
7062
7062
|
a.sequenceNumber <= e && null === n.get(a.targetId) && (s++, i.push(this.removeTargetData(t, a)));
|
|
7063
7063
|
})).next((() => zs.waitFor(i))).next((() => s));
|
|
@@ -7065,7 +7065,7 @@ class Oi {
|
|
|
7065
7065
|
/**
|
|
7066
7066
|
* Call provided function with each `TargetData` that we have cached.
|
|
7067
7067
|
*/ forEachTarget(t, e) {
|
|
7068
|
-
return
|
|
7068
|
+
return Fi(t).jt(((t, n) => {
|
|
7069
7069
|
const s = gi(n);
|
|
7070
7070
|
e(s);
|
|
7071
7071
|
}));
|
|
@@ -7077,7 +7077,7 @@ class Oi {
|
|
|
7077
7077
|
return Li(t).put(Bs.key, e);
|
|
7078
7078
|
}
|
|
7079
7079
|
ce(t, e) {
|
|
7080
|
-
return
|
|
7080
|
+
return Fi(t).put(yi(this.k, e));
|
|
7081
7081
|
}
|
|
7082
7082
|
/**
|
|
7083
7083
|
* In-place updates the provided metadata to account for values in the given
|
|
@@ -7098,9 +7098,9 @@ class Oi {
|
|
|
7098
7098
|
// depends on the queryTargets index to be efficient.
|
|
7099
7099
|
const n = Jt(e), s = IDBKeyRange.bound([ n, Number.NEGATIVE_INFINITY ], [ n, Number.POSITIVE_INFINITY ]);
|
|
7100
7100
|
let i = null;
|
|
7101
|
-
return
|
|
7101
|
+
return Fi(t).jt({
|
|
7102
7102
|
range: s,
|
|
7103
|
-
index:
|
|
7103
|
+
index: Fs.queryTargetsIndexName
|
|
7104
7104
|
}, ((t, n, s) => {
|
|
7105
7105
|
const r = gi(n);
|
|
7106
7106
|
// After finding a potential match, check that the target is
|
|
@@ -7170,14 +7170,14 @@ class Oi {
|
|
|
7170
7170
|
*/
|
|
7171
7171
|
// PORTING NOTE: Multi-tab only.
|
|
7172
7172
|
Et(t, e) {
|
|
7173
|
-
return
|
|
7173
|
+
return Fi(t).get(e).next((t => t ? gi(t) : null));
|
|
7174
7174
|
}
|
|
7175
7175
|
}
|
|
7176
7176
|
|
|
7177
7177
|
/**
|
|
7178
7178
|
* Helper to get a typed SimpleDbStore for the queries object store.
|
|
7179
|
-
*/ function
|
|
7180
|
-
return ri(t,
|
|
7179
|
+
*/ function Fi(t) {
|
|
7180
|
+
return ri(t, Fs.store);
|
|
7181
7181
|
}
|
|
7182
7182
|
|
|
7183
7183
|
/**
|
|
@@ -7785,10 +7785,10 @@ function Gi(t, e) {
|
|
|
7785
7785
|
return this.getMetadata(t).next((t => t.byteSize));
|
|
7786
7786
|
}
|
|
7787
7787
|
getMetadata(t) {
|
|
7788
|
-
return Xi(t).get(
|
|
7788
|
+
return Xi(t).get(Ms.key).next((t => (U(!!t), t)));
|
|
7789
7789
|
}
|
|
7790
7790
|
Re(t, e) {
|
|
7791
|
-
return Xi(t).put(
|
|
7791
|
+
return Xi(t).put(Ms.key, e);
|
|
7792
7792
|
}
|
|
7793
7793
|
/**
|
|
7794
7794
|
* Decodes `remoteDoc` and returns the document (or null, if the document
|
|
@@ -7868,7 +7868,7 @@ class Yi extends Hi {
|
|
|
7868
7868
|
}
|
|
7869
7869
|
|
|
7870
7870
|
function Xi(t) {
|
|
7871
|
-
return ri(t,
|
|
7871
|
+
return ri(t, Ms.store);
|
|
7872
7872
|
}
|
|
7873
7873
|
|
|
7874
7874
|
/**
|
|
@@ -7936,7 +7936,7 @@ function tr(t) {
|
|
|
7936
7936
|
// Brand new clients don't need to drop and recreate--only clients that
|
|
7937
7937
|
// potentially have corrupt data.
|
|
7938
7938
|
0 !== n && (!function(t) {
|
|
7939
|
-
t.deleteObjectStore(Ls.store), t.deleteObjectStore(
|
|
7939
|
+
t.deleteObjectStore(Ls.store), t.deleteObjectStore(Fs.store), t.deleteObjectStore(Bs.store);
|
|
7940
7940
|
}(t), nr(t)), r = r.next((() =>
|
|
7941
7941
|
/**
|
|
7942
7942
|
* Creates the target global singleton row.
|
|
@@ -7979,7 +7979,7 @@ function tr(t) {
|
|
|
7979
7979
|
});
|
|
7980
7980
|
}(t);
|
|
7981
7981
|
}))), n < 5 && s >= 5 && (r = r.next((() => this.Ne(i)))), n < 6 && s >= 6 && (r = r.next((() => (function(t) {
|
|
7982
|
-
t.createObjectStore(
|
|
7982
|
+
t.createObjectStore(Ms.store);
|
|
7983
7983
|
}(t), this.ke(i))))), n < 7 && s >= 7 && (r = r.next((() => this.xe(i)))), n < 8 && s >= 8 && (r = r.next((() => this.$e(t, i)))),
|
|
7984
7984
|
n < 9 && s >= 9 && (r = r.next((() => {
|
|
7985
7985
|
// Multi-Tab used to manage its own changelog, but this has been moved
|
|
@@ -8028,8 +8028,8 @@ function tr(t) {
|
|
|
8028
8028
|
return t.store(Os.store).jt(((t, n) => {
|
|
8029
8029
|
e += Di(n);
|
|
8030
8030
|
})).next((() => {
|
|
8031
|
-
const n = new
|
|
8032
|
-
return t.store(
|
|
8031
|
+
const n = new Ms(e);
|
|
8032
|
+
return t.store(Ms.store).put(Ms.key, n);
|
|
8033
8033
|
}));
|
|
8034
8034
|
}
|
|
8035
8035
|
Ne(t) {
|
|
@@ -8087,7 +8087,7 @@ function tr(t) {
|
|
|
8087
8087
|
}))));
|
|
8088
8088
|
}
|
|
8089
8089
|
Oe(t) {
|
|
8090
|
-
const e = t.store(
|
|
8090
|
+
const e = t.store(Fs.store);
|
|
8091
8091
|
return e.jt(((t, n) => {
|
|
8092
8092
|
const s = gi(n), i = yi(this.k, s);
|
|
8093
8093
|
return e.put(i);
|
|
@@ -8102,9 +8102,9 @@ function nr(t) {
|
|
|
8102
8102
|
unique: !0
|
|
8103
8103
|
});
|
|
8104
8104
|
// NOTE: This is unique only because the TargetId is the suffix.
|
|
8105
|
-
t.createObjectStore(
|
|
8106
|
-
keyPath:
|
|
8107
|
-
}).createIndex(
|
|
8105
|
+
t.createObjectStore(Fs.store, {
|
|
8106
|
+
keyPath: Fs.keyPath
|
|
8107
|
+
}).createIndex(Fs.queryTargetsIndexName, Fs.queryTargetsKeyPath, {
|
|
8108
8108
|
unique: !0
|
|
8109
8109
|
}), t.createObjectStore(Bs.store);
|
|
8110
8110
|
}
|
|
@@ -8174,7 +8174,7 @@ class ir {
|
|
|
8174
8174
|
*/
|
|
8175
8175
|
u) {
|
|
8176
8176
|
if (this.allowTabSynchronization = t, this.persistenceKey = e, this.clientId = n,
|
|
8177
|
-
this.
|
|
8177
|
+
this.Me = i, this.window = r, this.document = o, this.Fe = c, this.Le = u, this.Be = null,
|
|
8178
8178
|
this.Ue = !1, this.isPrimary = !1, this.networkEnabled = !0,
|
|
8179
8179
|
/** Our window.unload handler, if registered. */
|
|
8180
8180
|
this.qe = null, this.inForeground = !1,
|
|
@@ -8187,7 +8187,7 @@ class ir {
|
|
|
8187
8187
|
/** A listener to notify on primary state changes. */
|
|
8188
8188
|
this.We = t => Promise.resolve(), !ir.Pt()) throw new Q(j.UNIMPLEMENTED, "This platform is either missing IndexedDB or is known to have an incomplete implementation. Offline persistence has been disabled.");
|
|
8189
8189
|
this.referenceDelegate = new Wi(this, s), this.Ge = e + "main", this.k = new ui(a),
|
|
8190
|
-
this.ze = new Js(this.Ge, 11, new er(this.k)), this.He = new
|
|
8190
|
+
this.ze = new Js(this.Ge, 11, new er(this.k)), this.He = new Mi(this.referenceDelegate, this.k),
|
|
8191
8191
|
this.Jt = new bi, this.Je = function(t, e) {
|
|
8192
8192
|
return new Ji(t, e);
|
|
8193
8193
|
}
|
|
@@ -8197,7 +8197,7 @@ class ir {
|
|
|
8197
8197
|
*/
|
|
8198
8198
|
// PORTING NOTE: This is only used for multi-tab synchronization.
|
|
8199
8199
|
(this.k, this.Jt), this.Ye = new Ti, this.window && this.window.localStorage ? this.Xe = this.window.localStorage : (this.Xe = null,
|
|
8200
|
-
!1 === u &&
|
|
8200
|
+
!1 === u && M("IndexedDbPersistence", "LocalStorage is unavailable. As a result, persistence may not work reliably. In particular enablePersistence() could fail immediately after refreshing the page."));
|
|
8201
8201
|
}
|
|
8202
8202
|
/**
|
|
8203
8203
|
* Attempt to start IndexedDb persistence.
|
|
@@ -8214,7 +8214,7 @@ class ir {
|
|
|
8214
8214
|
throw new Q(j.FAILED_PRECONDITION, sr);
|
|
8215
8215
|
return this.tn(), this.en(), this.nn(), this.runTransaction("getHighestListenSequenceNumber", "readonly", (t => this.He.getHighestSequenceNumber(t)));
|
|
8216
8216
|
})).then((t => {
|
|
8217
|
-
this.Be = new nt(t, this.
|
|
8217
|
+
this.Be = new nt(t, this.Fe);
|
|
8218
8218
|
})).then((() => {
|
|
8219
8219
|
this.Ue = !0;
|
|
8220
8220
|
})).catch((t => (this.ze && this.ze.close(), Promise.reject(t))));
|
|
@@ -8250,7 +8250,7 @@ class ir {
|
|
|
8250
8250
|
this.networkEnabled !== t && (this.networkEnabled = t,
|
|
8251
8251
|
// Schedule a primary lease refresh for immediate execution. The eventual
|
|
8252
8252
|
// lease update will be propagated via `primaryStateListener`.
|
|
8253
|
-
this.
|
|
8253
|
+
this.Me.enqueueAndForget((async () => {
|
|
8254
8254
|
this.started && await this.Ze();
|
|
8255
8255
|
})));
|
|
8256
8256
|
}
|
|
@@ -8262,7 +8262,7 @@ class ir {
|
|
|
8262
8262
|
*/ Ze() {
|
|
8263
8263
|
return this.runTransaction("updateClientMetadataAndTryBecomePrimary", "readwrite", (t => or(t).put(new qs(this.clientId, Date.now(), this.networkEnabled, this.inForeground)).next((() => {
|
|
8264
8264
|
if (this.isPrimary) return this.rn(t).next((t => {
|
|
8265
|
-
t || (this.isPrimary = !1, this.
|
|
8265
|
+
t || (this.isPrimary = !1, this.Me.enqueueRetryable((() => this.We(!1))));
|
|
8266
8266
|
}));
|
|
8267
8267
|
})).next((() => this.on(t))).next((e => this.isPrimary && !e ? this.an(t).next((() => !1)) : !!e && this.cn(t).next((() => !0)))))).catch((t => {
|
|
8268
8268
|
if (Zs(t))
|
|
@@ -8273,7 +8273,7 @@ class ir {
|
|
|
8273
8273
|
return O("IndexedDbPersistence", "Releasing owner lease after error during lease refresh", t),
|
|
8274
8274
|
/* isPrimary= */ !1;
|
|
8275
8275
|
})).then((t => {
|
|
8276
|
-
this.isPrimary !== t && this.
|
|
8276
|
+
this.isPrimary !== t && this.Me.enqueueRetryable((() => this.We(t))), this.isPrimary = t;
|
|
8277
8277
|
}));
|
|
8278
8278
|
}
|
|
8279
8279
|
rn(t) {
|
|
@@ -8309,7 +8309,7 @@ class ir {
|
|
|
8309
8309
|
* Schedules a recurring timer to update the client metadata and to either
|
|
8310
8310
|
* extend or acquire the primary lease if the client is eligible.
|
|
8311
8311
|
*/ nn() {
|
|
8312
|
-
this.je = this.
|
|
8312
|
+
this.je = this.Me.enqueueAfterDelay("client_metadata_refresh" /* ClientMetadataRefresh */ , 4e3, (() => this.Ze().then((() => this.ln())).then((() => this.nn()))));
|
|
8313
8313
|
}
|
|
8314
8314
|
/** Checks whether `client` is the local client. */ un(t) {
|
|
8315
8315
|
return !!t && t.ownerId === this.clientId;
|
|
@@ -8417,8 +8417,8 @@ class ir {
|
|
|
8417
8417
|
// are the only reader/writer.
|
|
8418
8418
|
return this.ze.runTransaction(t, s, Qs, (s => (i = new ii(s, this.Be ? this.Be.next() : nt.I),
|
|
8419
8419
|
"readwrite-primary" === e ? this.rn(i).next((t => !!t || this.on(i))).next((e => {
|
|
8420
|
-
if (!e) throw
|
|
8421
|
-
this.
|
|
8420
|
+
if (!e) throw M(`Failed to obtain primary lease for action '${t}'.`), this.isPrimary = !1,
|
|
8421
|
+
this.Me.enqueueRetryable((() => this.We(!1))), new Q(j.FAILED_PRECONDITION, Ws);
|
|
8422
8422
|
return n(i);
|
|
8423
8423
|
})).next((t => this.cn(i).next((() => t)))) : this.En(i).next((() => n(i)))))).then((t => (i.raiseOnCommittedEvent(),
|
|
8424
8424
|
t)));
|
|
@@ -8451,12 +8451,12 @@ class ir {
|
|
|
8451
8451
|
}
|
|
8452
8452
|
/** Verifies that `updateTimeMs` is within `maxAgeMs`. */ fn(t, e) {
|
|
8453
8453
|
const n = Date.now();
|
|
8454
|
-
return !(t < n - e) && (!(t > n) || (
|
|
8454
|
+
return !(t < n - e) && (!(t > n) || (M(`Detected an update time that is in the future: ${t} > ${n}`),
|
|
8455
8455
|
!1));
|
|
8456
8456
|
}
|
|
8457
8457
|
tn() {
|
|
8458
8458
|
null !== this.document && "function" == typeof this.document.addEventListener && (this.Ke = () => {
|
|
8459
|
-
this.
|
|
8459
|
+
this.Me.enqueueAndForget((() => (this.inForeground = "visible" === this.document.visibilityState,
|
|
8460
8460
|
this.Ze())));
|
|
8461
8461
|
}, this.document.addEventListener("visibilitychange", this.Ke), this.inForeground = "visible" === this.document.visibilityState);
|
|
8462
8462
|
}
|
|
@@ -8483,7 +8483,7 @@ class ir {
|
|
|
8483
8483
|
// trigger a bug that prevents Safari from re-opening IndexedDB during
|
|
8484
8484
|
// the next page load.
|
|
8485
8485
|
// See https://bugs.webkit.org/show_bug.cgi?id=226547
|
|
8486
|
-
this.
|
|
8486
|
+
this.Me.enterRestrictedMode(/* purgeExistingTasks= */ !0), this.Me.enqueueAndForget((() => this.shutdown()));
|
|
8487
8487
|
}, this.window.addEventListener("pagehide", this.qe));
|
|
8488
8488
|
}
|
|
8489
8489
|
yn() {
|
|
@@ -8501,7 +8501,7 @@ class ir {
|
|
|
8501
8501
|
n;
|
|
8502
8502
|
} catch (t) {
|
|
8503
8503
|
// Gracefully handle if LocalStorage isn't working.
|
|
8504
|
-
return
|
|
8504
|
+
return M("IndexedDbPersistence", "Failed to get zombied client id.", t), !1;
|
|
8505
8505
|
}
|
|
8506
8506
|
}
|
|
8507
8507
|
/**
|
|
@@ -8512,7 +8512,7 @@ class ir {
|
|
|
8512
8512
|
this.Xe.setItem(this.wn(this.clientId), String(Date.now()));
|
|
8513
8513
|
} catch (t) {
|
|
8514
8514
|
// Gracefully handle if LocalStorage isn't available / working.
|
|
8515
|
-
|
|
8515
|
+
M("Failed to set zombie client id.", t);
|
|
8516
8516
|
}
|
|
8517
8517
|
}
|
|
8518
8518
|
/** Removes the zombied client entry if it exists. */ pn() {
|
|
@@ -8781,7 +8781,7 @@ class cr {
|
|
|
8781
8781
|
*/ class lr {
|
|
8782
8782
|
/** Sets the document view to query against. */
|
|
8783
8783
|
On(t) {
|
|
8784
|
-
this.
|
|
8784
|
+
this.Mn = t;
|
|
8785
8785
|
}
|
|
8786
8786
|
/** Returns all local documents matching the specified query. */ getDocumentsMatchingQuery(t, e, n, s) {
|
|
8787
8787
|
// Queries that match all documents don't benefit from using
|
|
@@ -8789,10 +8789,10 @@ class cr {
|
|
|
8789
8789
|
// collection, rather than to perform individual lookups.
|
|
8790
8790
|
return function(t) {
|
|
8791
8791
|
return 0 === t.filters.length && null === t.limit && null == t.startAt && null == t.endAt && (0 === t.explicitOrderBy.length || 1 === t.explicitOrderBy.length && t.explicitOrderBy[0].field.isKeyField());
|
|
8792
|
-
}(e) || n.isEqual(ut.min()) ? this.
|
|
8792
|
+
}(e) || n.isEqual(ut.min()) ? this.Fn(t, e) : this.Mn.vn(t, s).next((i => {
|
|
8793
8793
|
const r = this.Ln(e, i);
|
|
8794
|
-
return (pe(e) || Te(e)) && this.Bn(e.limitType, r, s, n) ? this.
|
|
8795
|
-
this.
|
|
8794
|
+
return (pe(e) || Te(e)) && this.Bn(e.limitType, r, s, n) ? this.Fn(t, e) : (x() <= LogLevel.DEBUG && O("QueryEngine", "Re-using previous result from %s to execute query: %s", n.toString(), Se(e)),
|
|
8795
|
+
this.Mn.getDocumentsMatchingQuery(t, e, n).next((t => (
|
|
8796
8796
|
// We merge `previousResults` into `updateResults`, since
|
|
8797
8797
|
// `updateResults` is already a DocumentMap. If a document is
|
|
8798
8798
|
// contained in both lists, then its contents are the same.
|
|
@@ -8836,9 +8836,9 @@ class cr {
|
|
|
8836
8836
|
const i = "F" /* First */ === t ? e.last() : e.first();
|
|
8837
8837
|
return !!i && (i.hasPendingWrites || i.version.compareTo(s) > 0);
|
|
8838
8838
|
}
|
|
8839
|
-
|
|
8839
|
+
Fn(t, e) {
|
|
8840
8840
|
return x() <= LogLevel.DEBUG && O("QueryEngine", "Using full collection scan to execute query:", Se(e)),
|
|
8841
|
-
this.
|
|
8841
|
+
this.Mn.getDocumentsMatchingQuery(t, e, ut.min());
|
|
8842
8842
|
}
|
|
8843
8843
|
}
|
|
8844
8844
|
|
|
@@ -9946,7 +9946,7 @@ class $r {
|
|
|
9946
9946
|
}
|
|
9947
9947
|
}
|
|
9948
9948
|
|
|
9949
|
-
class
|
|
9949
|
+
class Mr {
|
|
9950
9950
|
constructor(t) {
|
|
9951
9951
|
this.persistence = t,
|
|
9952
9952
|
/** Tracks all documents that are active in Query views. */
|
|
@@ -9955,7 +9955,7 @@ class Fr {
|
|
|
9955
9955
|
this.Ns = null;
|
|
9956
9956
|
}
|
|
9957
9957
|
static ks(t) {
|
|
9958
|
-
return new
|
|
9958
|
+
return new Mr(t);
|
|
9959
9959
|
}
|
|
9960
9960
|
get xs() {
|
|
9961
9961
|
if (this.Ns) return this.Ns;
|
|
@@ -10023,7 +10023,7 @@ class Fr {
|
|
|
10023
10023
|
// The format of the LocalStorage key that stores the client state is:
|
|
10024
10024
|
// firestore_clients_<persistence_prefix>_<instance_key>
|
|
10025
10025
|
/** Assembles the key for a client state in WebStorage */
|
|
10026
|
-
function
|
|
10026
|
+
function Fr(t, e) {
|
|
10027
10027
|
return `firestore_clients_${t}_${e}`;
|
|
10028
10028
|
}
|
|
10029
10029
|
|
|
@@ -10066,10 +10066,10 @@ class Ur {
|
|
|
10066
10066
|
const s = JSON.parse(n);
|
|
10067
10067
|
let i, r = "object" == typeof s && -1 !== [ "pending", "acknowledged", "rejected" ].indexOf(s.state) && (void 0 === s.error || "object" == typeof s.error);
|
|
10068
10068
|
return r && s.error && (r = "string" == typeof s.error.message && "string" == typeof s.error.code,
|
|
10069
|
-
r && (i = new Q(s.error.code, s.error.message))), r ? new Ur(t, e, s.state, i) : (
|
|
10069
|
+
r && (i = new Q(s.error.code, s.error.message))), r ? new Ur(t, e, s.state, i) : (M("SharedClientState", `Failed to parse mutation state for ID '${e}': ${n}`),
|
|
10070
10070
|
null);
|
|
10071
10071
|
}
|
|
10072
|
-
|
|
10072
|
+
Ms() {
|
|
10073
10073
|
const t = {
|
|
10074
10074
|
state: this.state,
|
|
10075
10075
|
updateTimeMs: Date.now()
|
|
@@ -10097,10 +10097,10 @@ class qr {
|
|
|
10097
10097
|
const n = JSON.parse(e);
|
|
10098
10098
|
let s, i = "object" == typeof n && -1 !== [ "not-current", "current", "rejected" ].indexOf(n.state) && (void 0 === n.error || "object" == typeof n.error);
|
|
10099
10099
|
return i && n.error && (i = "string" == typeof n.error.message && "string" == typeof n.error.code,
|
|
10100
|
-
i && (s = new Q(n.error.code, n.error.message))), i ? new qr(t, n.state, s) : (
|
|
10100
|
+
i && (s = new Q(n.error.code, n.error.message))), i ? new qr(t, n.state, s) : (M("SharedClientState", `Failed to parse target state for ID '${t}': ${e}`),
|
|
10101
10101
|
null);
|
|
10102
10102
|
}
|
|
10103
|
-
|
|
10103
|
+
Ms() {
|
|
10104
10104
|
const t = {
|
|
10105
10105
|
state: this.state,
|
|
10106
10106
|
updateTimeMs: Date.now()
|
|
@@ -10127,7 +10127,7 @@ class qr {
|
|
|
10127
10127
|
let s = "object" == typeof n && n.activeTargetIds instanceof Array, i = Nn();
|
|
10128
10128
|
for (let t = 0; s && t < n.activeTargetIds.length; ++t) s = St(n.activeTargetIds[t]),
|
|
10129
10129
|
i = i.add(n.activeTargetIds[t]);
|
|
10130
|
-
return s ? new Kr(t, i) : (
|
|
10130
|
+
return s ? new Kr(t, i) : (M("SharedClientState", `Failed to parse client data for instance '${t}': ${e}`),
|
|
10131
10131
|
null);
|
|
10132
10132
|
}
|
|
10133
10133
|
}
|
|
@@ -10145,7 +10145,7 @@ class qr {
|
|
|
10145
10145
|
* Logs a warning and returns null if the format of the data is not valid.
|
|
10146
10146
|
*/ static Os(t) {
|
|
10147
10147
|
const e = JSON.parse(t);
|
|
10148
|
-
return "object" == typeof e && -1 !== [ "Unknown", "Online", "Offline" ].indexOf(e.onlineState) && "string" == typeof e.clientId ? new jr(e.clientId, e.onlineState) : (
|
|
10148
|
+
return "object" == typeof e && -1 !== [ "Unknown", "Online", "Offline" ].indexOf(e.onlineState) && "string" == typeof e.clientId ? new jr(e.clientId, e.onlineState) : (M("SharedClientState", `Failed to parse online state: ${t}`),
|
|
10149
10149
|
null);
|
|
10150
10150
|
}
|
|
10151
10151
|
}
|
|
@@ -10165,7 +10165,7 @@ class Qr {
|
|
|
10165
10165
|
constructor() {
|
|
10166
10166
|
this.activeTargetIds = Nn();
|
|
10167
10167
|
}
|
|
10168
|
-
|
|
10168
|
+
Fs(t) {
|
|
10169
10169
|
this.activeTargetIds = this.activeTargetIds.add(t);
|
|
10170
10170
|
}
|
|
10171
10171
|
Ls(t) {
|
|
@@ -10174,7 +10174,7 @@ class Qr {
|
|
|
10174
10174
|
/**
|
|
10175
10175
|
* Converts this entry into a JSON-encoded format we can use for WebStorage.
|
|
10176
10176
|
* Does not encode `clientId` as it is part of the key in WebStorage.
|
|
10177
|
-
*/
|
|
10177
|
+
*/ Ms() {
|
|
10178
10178
|
const t = {
|
|
10179
10179
|
activeTargetIds: this.activeTargetIds.toArray(),
|
|
10180
10180
|
updateTimeMs: Date.now()
|
|
@@ -10189,7 +10189,7 @@ class Qr {
|
|
|
10189
10189
|
* clients and supports modifications of the local client's data.
|
|
10190
10190
|
*/ class Wr {
|
|
10191
10191
|
constructor(t, e, n, s, i) {
|
|
10192
|
-
this.window = t, this.
|
|
10192
|
+
this.window = t, this.Me = e, this.persistenceKey = n, this.Bs = s, this.syncEngine = null,
|
|
10193
10193
|
this.onlineStateHandler = null, this.sequenceNumberHandler = null, this.Us = this.qs.bind(this),
|
|
10194
10194
|
this.Ks = new yn(rt), this.started = !1,
|
|
10195
10195
|
/**
|
|
@@ -10200,7 +10200,7 @@ class Qr {
|
|
|
10200
10200
|
// Escape the special characters mentioned here:
|
|
10201
10201
|
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions
|
|
10202
10202
|
const r = n.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
10203
|
-
this.storage = this.window.localStorage, this.currentUser = i, this.Qs =
|
|
10203
|
+
this.storage = this.window.localStorage, this.currentUser = i, this.Qs = Fr(this.persistenceKey, this.Bs),
|
|
10204
10204
|
this.Ws =
|
|
10205
10205
|
/** Assembles the key for the current sequence number. */
|
|
10206
10206
|
function(t) {
|
|
@@ -10255,7 +10255,7 @@ class Qr {
|
|
|
10255
10255
|
const t = await this.syncEngine.Tn();
|
|
10256
10256
|
for (const e of t) {
|
|
10257
10257
|
if (e === this.Bs) continue;
|
|
10258
|
-
const t = this.getItem(
|
|
10258
|
+
const t = this.getItem(Fr(this.persistenceKey, e));
|
|
10259
10259
|
if (t) {
|
|
10260
10260
|
const n = Kr.Os(e, t);
|
|
10261
10261
|
n && (this.Ks = this.Ks.insert(n.clientId, n));
|
|
@@ -10308,7 +10308,7 @@ class Qr {
|
|
|
10308
10308
|
s && (e = s.state);
|
|
10309
10309
|
}
|
|
10310
10310
|
}
|
|
10311
|
-
return this.ii.
|
|
10311
|
+
return this.ii.Fs(t), this.Xs(), e;
|
|
10312
10312
|
}
|
|
10313
10313
|
removeLocalQueryTarget(t) {
|
|
10314
10314
|
this.ii.Ls(t), this.Xs();
|
|
@@ -10354,8 +10354,8 @@ class Qr {
|
|
|
10354
10354
|
// `Window.addEventListener`.
|
|
10355
10355
|
const e = t;
|
|
10356
10356
|
if (e.storageArea === this.storage) {
|
|
10357
|
-
if (O("SharedClientState", "EVENT", e.key, e.newValue), e.key === this.Qs) return void
|
|
10358
|
-
this.
|
|
10357
|
+
if (O("SharedClientState", "EVENT", e.key, e.newValue), e.key === this.Qs) return void M("Received WebStorage notification for local change. Another client might have garbage-collected our state");
|
|
10358
|
+
this.Me.enqueueRetryable((async () => {
|
|
10359
10359
|
if (this.started) {
|
|
10360
10360
|
if (null !== e.key) if (this.Gs.test(e.key)) {
|
|
10361
10361
|
if (null == e.newValue) {
|
|
@@ -10388,7 +10388,7 @@ class Qr {
|
|
|
10388
10388
|
const n = JSON.parse(t);
|
|
10389
10389
|
U("number" == typeof n), e = n;
|
|
10390
10390
|
} catch (t) {
|
|
10391
|
-
|
|
10391
|
+
M("SharedClientState", "Failed to read sequence number from WebStorage", t);
|
|
10392
10392
|
}
|
|
10393
10393
|
return e;
|
|
10394
10394
|
}
|
|
@@ -10407,11 +10407,11 @@ class Qr {
|
|
|
10407
10407
|
return this.Ks.get(this.Bs);
|
|
10408
10408
|
}
|
|
10409
10409
|
Xs() {
|
|
10410
|
-
this.setItem(this.Qs, this.ii.
|
|
10410
|
+
this.setItem(this.Qs, this.ii.Ms());
|
|
10411
10411
|
}
|
|
10412
10412
|
ni(t, e, n) {
|
|
10413
10413
|
const s = new Ur(this.currentUser, t, e, n), i = Lr(this.persistenceKey, this.currentUser, t);
|
|
10414
|
-
this.setItem(i, s.
|
|
10414
|
+
this.setItem(i, s.Ms());
|
|
10415
10415
|
}
|
|
10416
10416
|
si(t) {
|
|
10417
10417
|
const e = Lr(this.persistenceKey, this.currentUser, t);
|
|
@@ -10426,7 +10426,7 @@ class Qr {
|
|
|
10426
10426
|
}
|
|
10427
10427
|
ri(t, e, n) {
|
|
10428
10428
|
const s = Br(this.persistenceKey, t), i = new qr(t, e, n);
|
|
10429
|
-
this.setItem(s, i.
|
|
10429
|
+
this.setItem(s, i.Ms());
|
|
10430
10430
|
}
|
|
10431
10431
|
ai() {
|
|
10432
10432
|
this.setItem(this.Ys, "value-not-used");
|
|
@@ -10509,7 +10509,7 @@ class Gr {
|
|
|
10509
10509
|
// No op.
|
|
10510
10510
|
}
|
|
10511
10511
|
addLocalQueryTarget(t) {
|
|
10512
|
-
return this.pi.
|
|
10512
|
+
return this.pi.Fs(t), this.Ti[t] || "not-current";
|
|
10513
10513
|
}
|
|
10514
10514
|
updateQueryState(t, e, n) {
|
|
10515
10515
|
this.Ti[t] = e;
|
|
@@ -10691,7 +10691,7 @@ class Yr {
|
|
|
10691
10691
|
Oi(t) {
|
|
10692
10692
|
this.ki(t);
|
|
10693
10693
|
}
|
|
10694
|
-
|
|
10694
|
+
Mi(t) {
|
|
10695
10695
|
this.xi(t);
|
|
10696
10696
|
}
|
|
10697
10697
|
}
|
|
@@ -10720,7 +10720,7 @@ class {
|
|
|
10720
10720
|
constructor(t) {
|
|
10721
10721
|
this.databaseInfo = t, this.databaseId = t.databaseId;
|
|
10722
10722
|
const e = t.ssl ? "https" : "http";
|
|
10723
|
-
this.
|
|
10723
|
+
this.Fi = e + "://" + t.host, this.Li = "projects/" + this.databaseId.projectId + "/databases/" + this.databaseId.database + "/documents";
|
|
10724
10724
|
}
|
|
10725
10725
|
Bi(t, e, n, s, i) {
|
|
10726
10726
|
const r = this.Ui(t, e);
|
|
@@ -10728,7 +10728,7 @@ class {
|
|
|
10728
10728
|
const o = {};
|
|
10729
10729
|
return this.qi(o, s, i), this.Ki(t, r, o, n).then((t => (O("RestConnection", "Received: ", t),
|
|
10730
10730
|
t)), (e => {
|
|
10731
|
-
throw
|
|
10731
|
+
throw F("RestConnection", `${t} failed with error: `, e, "url: ", r, "request:", n),
|
|
10732
10732
|
e;
|
|
10733
10733
|
}));
|
|
10734
10734
|
}
|
|
@@ -10751,7 +10751,7 @@ class {
|
|
|
10751
10751
|
}
|
|
10752
10752
|
Ui(t, e) {
|
|
10753
10753
|
const n = Jr[t];
|
|
10754
|
-
return `${this.
|
|
10754
|
+
return `${this.Fi}/v1/${e}:${n}`;
|
|
10755
10755
|
}
|
|
10756
10756
|
} {
|
|
10757
10757
|
constructor(t) {
|
|
@@ -10803,7 +10803,7 @@ class {
|
|
|
10803
10803
|
}));
|
|
10804
10804
|
}
|
|
10805
10805
|
Qi(t, e, n) {
|
|
10806
|
-
const s = [ this.
|
|
10806
|
+
const s = [ this.Fi, "/", "google.firestore.v1.Firestore", "/", t, "/channel" ], i = createWebChannelTransport(), r = getStatEventTarget(), o = {
|
|
10807
10807
|
// Required for backend stickiness, routing behavior is based on this
|
|
10808
10808
|
// parameter.
|
|
10809
10809
|
httpSessionIdParam: "gsessionid",
|
|
@@ -10884,7 +10884,7 @@ class {
|
|
|
10884
10884
|
})), y(c, WebChannel.EventType.CLOSE, (() => {
|
|
10885
10885
|
h || (h = !0, O("Connection", "WebChannel transport closed"), l.Oi());
|
|
10886
10886
|
})), y(c, WebChannel.EventType.ERROR, (t => {
|
|
10887
|
-
h || (h = !0,
|
|
10887
|
+
h || (h = !0, F("Connection", "WebChannel transport errored:", t), l.Oi(new Q(j.UNAVAILABLE, "The operation could not be completed")));
|
|
10888
10888
|
})), y(c, WebChannel.EventType.MESSAGE, (t => {
|
|
10889
10889
|
var e;
|
|
10890
10890
|
if (!h) {
|
|
@@ -10916,7 +10916,7 @@ class {
|
|
|
10916
10916
|
void 0 === e && (e = j.INTERNAL, n = "Unknown error status: " + t + " with message " + i.message),
|
|
10917
10917
|
// Mark closed so no further events are propagated
|
|
10918
10918
|
h = !0, l.Oi(new Q(e, n)), c.close();
|
|
10919
|
-
} else O("Connection", "WebChannel received:", n), l.
|
|
10919
|
+
} else O("Connection", "WebChannel received:", n), l.Mi(n);
|
|
10920
10920
|
}
|
|
10921
10921
|
})), y(r, Event.STAT_EVENT, (t => {
|
|
10922
10922
|
t.stat === Stat.PROXY ? O("Connection", "Detected buffering proxy") : t.stat === Stat.NOPROXY && O("Connection", "Detected no buffering proxy");
|
|
@@ -11032,7 +11032,7 @@ class no {
|
|
|
11032
11032
|
* Note that jitter will still be applied, so the actual delay could be as
|
|
11033
11033
|
* much as 1.5*maxDelayMs.
|
|
11034
11034
|
*/ , i = 6e4) {
|
|
11035
|
-
this.
|
|
11035
|
+
this.Me = t, this.timerId = e, this.Wi = n, this.Gi = s, this.zi = i, this.Hi = 0,
|
|
11036
11036
|
this.Ji = null,
|
|
11037
11037
|
/** The last backoff attempt, as epoch milliseconds. */
|
|
11038
11038
|
this.Yi = Date.now(), this.reset();
|
|
@@ -11064,7 +11064,7 @@ class no {
|
|
|
11064
11064
|
const e = Math.floor(this.Hi + this.tr()), n = Math.max(0, Date.now() - this.Yi), s = Math.max(0, e - n);
|
|
11065
11065
|
// Guard against lastAttemptTime being in the future due to a clock change.
|
|
11066
11066
|
s > 0 && O("ExponentialBackoff", `Backing off for ${s} ms (base delay: ${this.Hi} ms, delay with jitter: ${e} ms, last attempt: ${n} ms ago)`),
|
|
11067
|
-
this.Ji = this.
|
|
11067
|
+
this.Ji = this.Me.enqueueAfterDelay(this.timerId, s, (() => (this.Yi = Date.now(),
|
|
11068
11068
|
t()))),
|
|
11069
11069
|
// Apply backoff factor to determine next delay and ensure it is within
|
|
11070
11070
|
// bounds.
|
|
@@ -11131,7 +11131,7 @@ class no {
|
|
|
11131
11131
|
*/
|
|
11132
11132
|
class so {
|
|
11133
11133
|
constructor(t, e, n, s, i, r, o, a) {
|
|
11134
|
-
this.
|
|
11134
|
+
this.Me = t, this.nr = n, this.sr = s, this.ir = i, this.authCredentialsProvider = r,
|
|
11135
11135
|
this.appCheckCredentialsProvider = o, this.listener = a, this.state = 0 /* Initial */ ,
|
|
11136
11136
|
/**
|
|
11137
11137
|
* A close count that's incremented every time the stream is closed; used by
|
|
@@ -11194,7 +11194,7 @@ class so {
|
|
|
11194
11194
|
*/ _r() {
|
|
11195
11195
|
// Starts the idle time if we are in state 'Open' and are not yet already
|
|
11196
11196
|
// running a timer (in which case the previous idle timeout still applies).
|
|
11197
|
-
this.lr() && null === this.ar && (this.ar = this.
|
|
11197
|
+
this.lr() && null === this.ar && (this.ar = this.Me.enqueueAfterDelay(this.nr, 6e4, (() => this.mr())));
|
|
11198
11198
|
}
|
|
11199
11199
|
/** Sends a message to the underlying stream. */ gr(t) {
|
|
11200
11200
|
this.yr(), this.stream.send(t);
|
|
@@ -11232,7 +11232,7 @@ class so {
|
|
|
11232
11232
|
// If this is an intentional close ensure we don't delay our next connection attempt.
|
|
11233
11233
|
this.ur.reset() : e && e.code === j.RESOURCE_EXHAUSTED ? (
|
|
11234
11234
|
// Log the error. (Probably either 'quota exceeded' or 'max queue length reached'.)
|
|
11235
|
-
|
|
11235
|
+
M(e.toString()), M("Using maximum backoff delay to prevent overloading the backend."),
|
|
11236
11236
|
this.ur.Xi()) : e && e.code === j.UNAUTHENTICATED && 3 /* Healthy */ !== this.state && (
|
|
11237
11237
|
// "unauthenticated" error means the token was rejected. This should rarely
|
|
11238
11238
|
// happen since both Auth and AppCheck ensure a sufficient TTL when we
|
|
@@ -11277,7 +11277,7 @@ class so {
|
|
|
11277
11277
|
Ir(t, e) {
|
|
11278
11278
|
const n = this.Er(this.rr);
|
|
11279
11279
|
this.stream = this.Rr(t, e), this.stream.Di((() => {
|
|
11280
|
-
n((() => (this.state = 2 /* Open */ , this.cr = this.
|
|
11280
|
+
n((() => (this.state = 2 /* Open */ , this.cr = this.Me.enqueueAfterDelay(this.sr, 1e4, (() => (this.lr() && (this.state = 3 /* Healthy */),
|
|
11281
11281
|
Promise.resolve()))), this.listener.Di())));
|
|
11282
11282
|
})), this.stream.Ni((t => {
|
|
11283
11283
|
n((() => this.Ar(t)));
|
|
@@ -11305,7 +11305,7 @@ class so {
|
|
|
11305
11305
|
* re-opened, etc.
|
|
11306
11306
|
*/ Er(t) {
|
|
11307
11307
|
return e => {
|
|
11308
|
-
this.
|
|
11308
|
+
this.Me.enqueueAndForget((() => this.rr === t ? e() : (O("PersistentStream", "stream callback skipped by getCloseGuardedDispatcher."),
|
|
11309
11309
|
Promise.resolve())));
|
|
11310
11310
|
};
|
|
11311
11311
|
}
|
|
@@ -11513,13 +11513,13 @@ class ao {
|
|
|
11513
11513
|
* maximum defined by MAX_WATCH_STREAM_FAILURES, we'll set the OnlineState to
|
|
11514
11514
|
* Offline.
|
|
11515
11515
|
*/
|
|
11516
|
-
this.
|
|
11516
|
+
this.Mr = 0,
|
|
11517
11517
|
/**
|
|
11518
11518
|
* A timer that elapses after ONLINE_STATE_TIMEOUT_MS, at which point we
|
|
11519
11519
|
* transition from OnlineState.Unknown to OnlineState.Offline without waiting
|
|
11520
11520
|
* for the stream to actually fail (MAX_WATCH_STREAM_FAILURES times).
|
|
11521
11521
|
*/
|
|
11522
|
-
this.
|
|
11522
|
+
this.Fr = null,
|
|
11523
11523
|
/**
|
|
11524
11524
|
* Whether the client should log a warning message if it fails to connect to
|
|
11525
11525
|
* the backend (initially true, cleared after a successful stream, or if we've
|
|
@@ -11534,7 +11534,7 @@ class ao {
|
|
|
11534
11534
|
* If this is the first attempt, it sets the OnlineState to Unknown and starts
|
|
11535
11535
|
* the onlineStateTimer.
|
|
11536
11536
|
*/ Br() {
|
|
11537
|
-
0 === this.
|
|
11537
|
+
0 === this.Mr && (this.Ur("Unknown" /* Unknown */), this.Fr = this.asyncQueue.enqueueAfterDelay("online_state_timeout" /* OnlineStateTimeout */ , 1e4, (() => (this.Fr = null,
|
|
11538
11538
|
this.qr("Backend didn't respond within 10 seconds."), this.Ur("Offline" /* Offline */),
|
|
11539
11539
|
Promise.resolve()))));
|
|
11540
11540
|
}
|
|
@@ -11544,8 +11544,8 @@ class ao {
|
|
|
11544
11544
|
* allow multiple failures (based on MAX_WATCH_STREAM_FAILURES) before we
|
|
11545
11545
|
* actually transition to the 'Offline' state.
|
|
11546
11546
|
*/ Kr(t) {
|
|
11547
|
-
"Online" /* Online */ === this.state ? this.Ur("Unknown" /* Unknown */) : (this.
|
|
11548
|
-
this.
|
|
11547
|
+
"Online" /* Online */ === this.state ? this.Ur("Unknown" /* Unknown */) : (this.Mr++,
|
|
11548
|
+
this.Mr >= 1 && (this.jr(), this.qr(`Connection failed 1 times. Most recent error: ${t.toString()}`),
|
|
11549
11549
|
this.Ur("Offline" /* Offline */)));
|
|
11550
11550
|
}
|
|
11551
11551
|
/**
|
|
@@ -11555,7 +11555,7 @@ class ao {
|
|
|
11555
11555
|
* Offline heuristics, so must not be used in place of
|
|
11556
11556
|
* handleWatchStreamStart() and handleWatchStreamFailure().
|
|
11557
11557
|
*/ set(t) {
|
|
11558
|
-
this.jr(), this.
|
|
11558
|
+
this.jr(), this.Mr = 0, "Online" /* Online */ === t && (
|
|
11559
11559
|
// We've connected to watch at least once. Don't warn the developer
|
|
11560
11560
|
// about being offline going forward.
|
|
11561
11561
|
this.Lr = !1), this.Ur(t);
|
|
@@ -11565,10 +11565,10 @@ class ao {
|
|
|
11565
11565
|
}
|
|
11566
11566
|
qr(t) {
|
|
11567
11567
|
const e = `Could not reach Cloud Firestore backend. ${t}\nThis typically indicates that your device does not have a healthy Internet connection at the moment. The client will operate in offline mode until it is able to successfully connect to the backend.`;
|
|
11568
|
-
this.Lr ? (
|
|
11568
|
+
this.Lr ? (M(e), this.Lr = !1) : O("OnlineStateTracker", e);
|
|
11569
11569
|
}
|
|
11570
11570
|
jr() {
|
|
11571
|
-
null !== this.
|
|
11571
|
+
null !== this.Fr && (this.Fr.cancel(), this.Fr = null);
|
|
11572
11572
|
}
|
|
11573
11573
|
}
|
|
11574
11574
|
|
|
@@ -11744,7 +11744,7 @@ async function Eo(t, e) {
|
|
|
11744
11744
|
async function Io(t, e, n) {
|
|
11745
11745
|
if (
|
|
11746
11746
|
// Mark the client as online since we got a message from the server
|
|
11747
|
-
t.Jr.set("Online" /* Online */), e instanceof
|
|
11747
|
+
t.Jr.set("Online" /* Online */), e instanceof Mn && 2 /* Removed */ === e.state && e.cause)
|
|
11748
11748
|
// There was an error on a target, don't wait for a consistent snapshot
|
|
11749
11749
|
// to raise events
|
|
11750
11750
|
try {
|
|
@@ -12033,7 +12033,7 @@ async function xo(t, e) {
|
|
|
12033
12033
|
* in newer versions of TypeScript defines `finally`, which is not available in
|
|
12034
12034
|
* IE.
|
|
12035
12035
|
*/
|
|
12036
|
-
class
|
|
12036
|
+
class Mo {
|
|
12037
12037
|
constructor(t, e, n, s, i) {
|
|
12038
12038
|
this.asyncQueue = t, this.timerId = e, this.targetTimeMs = n, this.op = s, this.removalCallback = i,
|
|
12039
12039
|
this.deferred = new W, this.then = this.deferred.promise.then.bind(this.deferred.promise),
|
|
@@ -12056,7 +12056,7 @@ class Fo {
|
|
|
12056
12056
|
* PORTING NOTE: This exists to prevent making removeDelayedOperation() and
|
|
12057
12057
|
* the DelayedOperation class public.
|
|
12058
12058
|
*/ static createAndSchedule(t, e, n, s, i) {
|
|
12059
|
-
const r = Date.now() + n, o = new
|
|
12059
|
+
const r = Date.now() + n, o = new Mo(t, e, r, s, i);
|
|
12060
12060
|
return o.start(n), o;
|
|
12061
12061
|
}
|
|
12062
12062
|
/**
|
|
@@ -12093,8 +12093,8 @@ class Fo {
|
|
|
12093
12093
|
/**
|
|
12094
12094
|
* Returns a FirestoreError that can be surfaced to the user if the provided
|
|
12095
12095
|
* error is an IndexedDbTransactionError. Re-throws the error otherwise.
|
|
12096
|
-
*/ function
|
|
12097
|
-
if (
|
|
12096
|
+
*/ function Fo(t, e) {
|
|
12097
|
+
if (M("AsyncQueue", `${e}: ${t}`), Zs(t)) return new Q(j.UNAVAILABLE, `${e}: ${t}`);
|
|
12098
12098
|
throw t;
|
|
12099
12099
|
}
|
|
12100
12100
|
|
|
@@ -12318,7 +12318,7 @@ async function jo(t, e) {
|
|
|
12318
12318
|
if (r || (i = !0, r = new qo), i) try {
|
|
12319
12319
|
r.so = await n.onListen(s);
|
|
12320
12320
|
} catch (t) {
|
|
12321
|
-
const n =
|
|
12321
|
+
const n = Fo(t, `Initialization of query '${Se(e.query)}' failed`);
|
|
12322
12322
|
return void e.onError(n);
|
|
12323
12323
|
}
|
|
12324
12324
|
if (n.queries.set(s, r), r.listeners.push(e),
|
|
@@ -12905,8 +12905,8 @@ class sa {
|
|
|
12905
12905
|
// PORTING NOTE: Manages state synchronization in multi-tab environments.
|
|
12906
12906
|
s, i, r) {
|
|
12907
12907
|
this.localStore = t, this.remoteStore = e, this.eventManager = n, this.sharedClientState = s,
|
|
12908
|
-
this.currentUser = i, this.maxConcurrentLimboResolutions = r, this.Oo = {}, this.
|
|
12909
|
-
this.
|
|
12908
|
+
this.currentUser = i, this.maxConcurrentLimboResolutions = r, this.Oo = {}, this.Mo = new zi((t => Ve(t)), ve),
|
|
12909
|
+
this.Fo = new Map,
|
|
12910
12910
|
/**
|
|
12911
12911
|
* The keys of documents that are in limbo for which we haven't yet started a
|
|
12912
12912
|
* limbo resolution query. The strings in this set are the result of calling
|
|
@@ -12949,7 +12949,7 @@ class sa {
|
|
|
12949
12949
|
async function oa(t, e) {
|
|
12950
12950
|
const n = $a(t);
|
|
12951
12951
|
let s, i;
|
|
12952
|
-
const r = n.
|
|
12952
|
+
const r = n.Mo.get(e);
|
|
12953
12953
|
if (r)
|
|
12954
12954
|
// PORTING NOTE: With Multi-Tab Web, it is possible that a query view
|
|
12955
12955
|
// already exists when EventManager calls us for the first time. This
|
|
@@ -12988,12 +12988,12 @@ async function oa(t, e) {
|
|
|
12988
12988
|
/* updateLimboDocuments= */ t.isPrimaryClient, a);
|
|
12989
12989
|
Ta(t, n, c.Co);
|
|
12990
12990
|
const u = new sa(e, n, r);
|
|
12991
|
-
return t.
|
|
12991
|
+
return t.Mo.set(e, u), t.Fo.has(n) ? t.Fo.get(n).push(e) : t.Fo.set(n, [ e ]), c.snapshot;
|
|
12992
12992
|
}
|
|
12993
12993
|
|
|
12994
12994
|
/** Stops listening to the query. */ async function ca(t, e) {
|
|
12995
|
-
const n = K(t), s = n.
|
|
12996
|
-
if (i.length > 1) return n.
|
|
12995
|
+
const n = K(t), s = n.Mo.get(e), i = n.Fo.get(s.targetId);
|
|
12996
|
+
if (i.length > 1) return n.Fo.set(s.targetId, i.filter((t => !ve(t, e)))), void n.Mo.delete(e);
|
|
12997
12997
|
// No other queries are mapped to the target, clean up the query and the target.
|
|
12998
12998
|
if (n.isPrimaryClient) {
|
|
12999
12999
|
// We need to remove the local query target first to allow us to verify
|
|
@@ -13057,7 +13057,7 @@ async function oa(t, e) {
|
|
|
13057
13057
|
} catch (t) {
|
|
13058
13058
|
// If we can't persist the mutation, we reject the user callback and
|
|
13059
13059
|
// don't send the mutation. The user can then retry the write.
|
|
13060
|
-
const e =
|
|
13060
|
+
const e = Fo(t, "Failed to persist write");
|
|
13061
13061
|
n.reject(e);
|
|
13062
13062
|
}
|
|
13063
13063
|
}
|
|
@@ -13096,7 +13096,7 @@ async function oa(t, e) {
|
|
|
13096
13096
|
// SharedClientState.
|
|
13097
13097
|
if (s.isPrimaryClient && 0 /* RemoteStore */ === n || !s.isPrimaryClient && 1 /* SharedClientState */ === n) {
|
|
13098
13098
|
const t = [];
|
|
13099
|
-
s.
|
|
13099
|
+
s.Mo.forEach(((n, s) => {
|
|
13100
13100
|
const i = s.view.ro(e);
|
|
13101
13101
|
i.snapshot && t.push(i.snapshot);
|
|
13102
13102
|
})), function(t, e) {
|
|
@@ -13209,7 +13209,7 @@ async function wa(t, e, n) {
|
|
|
13209
13209
|
const s = n.jo.get(t) || [];
|
|
13210
13210
|
s.push(e), n.jo.set(t, s);
|
|
13211
13211
|
} catch (t) {
|
|
13212
|
-
const n =
|
|
13212
|
+
const n = Fo(t, "Initialization of waitForPendingWrites() operation failed");
|
|
13213
13213
|
e.reject(n);
|
|
13214
13214
|
}
|
|
13215
13215
|
}
|
|
@@ -13236,8 +13236,8 @@ async function wa(t, e, n) {
|
|
|
13236
13236
|
|
|
13237
13237
|
function ya(t, e, n = null) {
|
|
13238
13238
|
t.sharedClientState.removeLocalQueryTarget(e);
|
|
13239
|
-
for (const s of t.
|
|
13240
|
-
if (t.
|
|
13239
|
+
for (const s of t.Fo.get(e)) t.Mo.delete(s), n && t.Oo.zo(s, n);
|
|
13240
|
+
if (t.Fo.delete(e), t.isPrimaryClient) {
|
|
13241
13241
|
t.qo.us(e).forEach((e => {
|
|
13242
13242
|
t.qo.containsKey(e) ||
|
|
13243
13243
|
// We removed the last reference for this key
|
|
@@ -13287,7 +13287,7 @@ function Ea(t, e) {
|
|
|
13287
13287
|
|
|
13288
13288
|
async function Aa(t, e, n) {
|
|
13289
13289
|
const s = K(t), i = [], r = [], o = [];
|
|
13290
|
-
s.
|
|
13290
|
+
s.Mo.isEmpty() || (s.Mo.forEach(((t, a) => {
|
|
13291
13291
|
o.push(s.Go(a, e, n).then((t => {
|
|
13292
13292
|
if (t) {
|
|
13293
13293
|
s.isPrimaryClient && s.sharedClientState.updateQueryState(a.targetId, t.fromCache ? "not-current" : "current"),
|
|
@@ -13343,10 +13343,10 @@ function ba(t, e) {
|
|
|
13343
13343
|
if (s && s.$o) return Dn().add(s.key);
|
|
13344
13344
|
{
|
|
13345
13345
|
let t = Dn();
|
|
13346
|
-
const s = n.
|
|
13346
|
+
const s = n.Fo.get(e);
|
|
13347
13347
|
if (!s) return t;
|
|
13348
13348
|
for (const e of s) {
|
|
13349
|
-
const s = n.
|
|
13349
|
+
const s = n.Mo.get(e);
|
|
13350
13350
|
t = t.unionWith(s.view.bo);
|
|
13351
13351
|
}
|
|
13352
13352
|
return t;
|
|
@@ -13420,7 +13420,7 @@ async function Sa(t, e) {
|
|
|
13420
13420
|
} else if (!1 === e && !1 !== n.Wo) {
|
|
13421
13421
|
const t = [];
|
|
13422
13422
|
let e = Promise.resolve();
|
|
13423
|
-
n.
|
|
13423
|
+
n.Fo.forEach(((s, i) => {
|
|
13424
13424
|
n.sharedClientState.isLocalQueryTarget(i) ? t.push(i) : e = e.then((() => (ya(n, i),
|
|
13425
13425
|
Er(n.localStore, i,
|
|
13426
13426
|
/*keepPersistedTargetData=*/ !0)))), fo(n.remoteStore, i);
|
|
@@ -13451,7 +13451,7 @@ async function Da(t, e, n) {
|
|
|
13451
13451
|
const s = K(t), i = [], r = [];
|
|
13452
13452
|
for (const t of e) {
|
|
13453
13453
|
let e;
|
|
13454
|
-
const n = s.
|
|
13454
|
+
const n = s.Fo.get(t);
|
|
13455
13455
|
if (n && 0 !== n.length) {
|
|
13456
13456
|
// For queries that have a local View, we fetch their current state
|
|
13457
13457
|
// from LocalStore (as the resume token and the snapshot version
|
|
@@ -13459,7 +13459,7 @@ async function Da(t, e, n) {
|
|
|
13459
13459
|
// state (the list of syncedDocuments may have gotten out of sync).
|
|
13460
13460
|
e = await Tr(s.localStore, be(n[0]));
|
|
13461
13461
|
for (const t of n) {
|
|
13462
|
-
const e = s.
|
|
13462
|
+
const e = s.Mo.get(t), n = await Pa(s, e);
|
|
13463
13463
|
n.snapshot && r.push(n.snapshot);
|
|
13464
13464
|
}
|
|
13465
13465
|
} else {
|
|
@@ -13503,7 +13503,7 @@ async function ka(t, e, n, s) {
|
|
|
13503
13503
|
if (i.Wo)
|
|
13504
13504
|
// If we receive a target state notification via WebStorage, we are
|
|
13505
13505
|
// either already secondary or another tab has taken the primary lease.
|
|
13506
|
-
O("SyncEngine", "Ignoring unexpected query state notification."); else if (i.
|
|
13506
|
+
O("SyncEngine", "Ignoring unexpected query state notification."); else if (i.Fo.has(e)) switch (n) {
|
|
13507
13507
|
case "current":
|
|
13508
13508
|
case "not-current":
|
|
13509
13509
|
{
|
|
@@ -13526,7 +13526,7 @@ async function ka(t, e, n, s) {
|
|
|
13526
13526
|
const s = $a(t);
|
|
13527
13527
|
if (s.Wo) {
|
|
13528
13528
|
for (const t of e) {
|
|
13529
|
-
if (s.
|
|
13529
|
+
if (s.Fo.has(t)) {
|
|
13530
13530
|
// A target might have been added in a previous attempt
|
|
13531
13531
|
O("SyncEngine", "Adding an already active target " + t);
|
|
13532
13532
|
continue;
|
|
@@ -13538,7 +13538,7 @@ async function ka(t, e, n, s) {
|
|
|
13538
13538
|
for (const t of n)
|
|
13539
13539
|
// Check that the target is still active since the target might have been
|
|
13540
13540
|
// removed if it has been rejected by the backend.
|
|
13541
|
-
s.
|
|
13541
|
+
s.Fo.has(t) &&
|
|
13542
13542
|
// Release queries that are still active.
|
|
13543
13543
|
await Er(s.localStore, t,
|
|
13544
13544
|
/* keepPersistedTargetData */ !1).then((() => {
|
|
@@ -13567,7 +13567,7 @@ function Oa(t) {
|
|
|
13567
13567
|
* @param syncEngine - SyncEngine to use.
|
|
13568
13568
|
* @param bundleReader - Bundle to load into the SDK.
|
|
13569
13569
|
* @param task - LoadBundleTask used to update the loading progress to public API.
|
|
13570
|
-
*/ function
|
|
13570
|
+
*/ function Ma(t, e, n) {
|
|
13571
13571
|
const s = K(t);
|
|
13572
13572
|
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
13573
13573
|
(async function(t, e, n) {
|
|
@@ -13611,7 +13611,7 @@ function Oa(t) {
|
|
|
13611
13611
|
* resolves to undefined if no persisted data can be found.
|
|
13612
13612
|
*/ (t.localStore, s), n._completeWith(o.progress);
|
|
13613
13613
|
} catch (t) {
|
|
13614
|
-
|
|
13614
|
+
F("SyncEngine", `Loading bundle failed with ${t}`), n._failWith(t);
|
|
13615
13615
|
}
|
|
13616
13616
|
}
|
|
13617
13617
|
/**
|
|
@@ -13638,7 +13638,7 @@ function Oa(t) {
|
|
|
13638
13638
|
}));
|
|
13639
13639
|
}
|
|
13640
13640
|
|
|
13641
|
-
class
|
|
13641
|
+
class Fa {
|
|
13642
13642
|
constructor() {
|
|
13643
13643
|
this.synchronizeTabs = !1;
|
|
13644
13644
|
}
|
|
@@ -13653,7 +13653,7 @@ class Ma {
|
|
|
13653
13653
|
return dr(this.persistence, new lr, t.initialUser, this.k);
|
|
13654
13654
|
}
|
|
13655
13655
|
Yo(t) {
|
|
13656
|
-
return new $r(
|
|
13656
|
+
return new $r(Mr.ks, this.k);
|
|
13657
13657
|
}
|
|
13658
13658
|
Jo(t) {
|
|
13659
13659
|
return new Gr;
|
|
@@ -13666,7 +13666,7 @@ class Ma {
|
|
|
13666
13666
|
|
|
13667
13667
|
/**
|
|
13668
13668
|
* Provides all components needed for Firestore with IndexedDB persistence.
|
|
13669
|
-
*/ class La extends
|
|
13669
|
+
*/ class La extends Fa {
|
|
13670
13670
|
constructor(t, e, n) {
|
|
13671
13671
|
super(), this.ta = t, this.cacheSizeBytes = e, this.forceOwnership = n, this.synchronizeTabs = !1;
|
|
13672
13672
|
}
|
|
@@ -14293,7 +14293,7 @@ class Ga {
|
|
|
14293
14293
|
// tokens.
|
|
14294
14294
|
this.authCredentials.shutdown(), this.appCheckCredentials.shutdown(), t.resolve();
|
|
14295
14295
|
} catch (e) {
|
|
14296
|
-
const n =
|
|
14296
|
+
const n = Fo(e, "Failed to shutdown persistence");
|
|
14297
14297
|
t.reject(n);
|
|
14298
14298
|
}
|
|
14299
14299
|
})), t.promise;
|
|
@@ -14337,7 +14337,7 @@ async function Ha(t, e) {
|
|
|
14337
14337
|
|
|
14338
14338
|
async function Ja(t) {
|
|
14339
14339
|
return t.offlineComponents || (O("FirestoreClient", "Using default OfflineComponentProvider"),
|
|
14340
|
-
await za(t, new
|
|
14340
|
+
await za(t, new Fa)), t.offlineComponents;
|
|
14341
14341
|
}
|
|
14342
14342
|
|
|
14343
14343
|
async function Ya(t) {
|
|
@@ -14403,7 +14403,7 @@ async function nc(t) {
|
|
|
14403
14403
|
}(t, e);
|
|
14404
14404
|
s.isFoundDocument() ? n.resolve(s) : s.isNoDocument() ? n.resolve(null) : n.reject(new Q(j.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.)"));
|
|
14405
14405
|
} catch (t) {
|
|
14406
|
-
const s =
|
|
14406
|
+
const s = Fo(t, `Failed to get document '${e} from cache`);
|
|
14407
14407
|
n.reject(s);
|
|
14408
14408
|
}
|
|
14409
14409
|
}
|
|
@@ -14450,7 +14450,7 @@ function ac(t, e) {
|
|
|
14450
14450
|
/* updateLimboDocuments= */ !1);
|
|
14451
14451
|
n.resolve(o.snapshot);
|
|
14452
14452
|
} catch (t) {
|
|
14453
|
-
const s =
|
|
14453
|
+
const s = Fo(t, `Failed to execute query '${e} against cache`);
|
|
14454
14454
|
n.reject(s);
|
|
14455
14455
|
}
|
|
14456
14456
|
}
|
|
@@ -14546,7 +14546,7 @@ function lc(t, e, n, s) {
|
|
|
14546
14546
|
* limitations under the License.
|
|
14547
14547
|
*/ (n, eo(e));
|
|
14548
14548
|
t.asyncQueue.enqueueAndForget((async () => {
|
|
14549
|
-
|
|
14549
|
+
Ma(await ec(t), i, s);
|
|
14550
14550
|
}));
|
|
14551
14551
|
}
|
|
14552
14552
|
|
|
@@ -14872,7 +14872,7 @@ class Ac {
|
|
|
14872
14872
|
function bc(t, e, n, s = {}) {
|
|
14873
14873
|
var i;
|
|
14874
14874
|
const r = (t = Ec(t, Rc))._getSettings();
|
|
14875
|
-
if ("firestore.googleapis.com" !== r.host && r.host !== e &&
|
|
14875
|
+
if ("firestore.googleapis.com" !== r.host && r.host !== e && F("Host has been set in both settings() and useEmulator(), emulator host will be used"),
|
|
14876
14876
|
t._setSettings(Object.assign(Object.assign({}, r), {
|
|
14877
14877
|
host: `${e}:${n}`,
|
|
14878
14878
|
ssl: !1
|
|
@@ -15218,7 +15218,7 @@ function Cc(t, e, ...n) {
|
|
|
15218
15218
|
// Re-throw the error so that this.tail becomes a rejected Promise and
|
|
15219
15219
|
// all further attempts to chain (via .then) will just short-circuit
|
|
15220
15220
|
// and return the rejected Promise.
|
|
15221
|
-
throw
|
|
15221
|
+
throw M("INTERNAL UNHANDLED ERROR: ", e), t;
|
|
15222
15222
|
})).then((t => (this.Ea = !1, t))))));
|
|
15223
15223
|
return this.ma = e, e;
|
|
15224
15224
|
}
|
|
@@ -15226,7 +15226,7 @@ function Cc(t, e, ...n) {
|
|
|
15226
15226
|
this.ba(),
|
|
15227
15227
|
// Fast-forward delays for timerIds that have been overriden.
|
|
15228
15228
|
this.Aa.indexOf(t) > -1 && (e = 0);
|
|
15229
|
-
const s =
|
|
15229
|
+
const s = Mo.createAndSchedule(this, t, e, n, (t => this.Va(t)));
|
|
15230
15230
|
return this.pa.push(s), s;
|
|
15231
15231
|
}
|
|
15232
15232
|
ba() {
|
|
@@ -15399,14 +15399,14 @@ class Oc {
|
|
|
15399
15399
|
* See the License for the specific language governing permissions and
|
|
15400
15400
|
* limitations under the License.
|
|
15401
15401
|
*/
|
|
15402
|
-
/** DOMException error code constants. */ const
|
|
15402
|
+
/** DOMException error code constants. */ const Mc = -1;
|
|
15403
15403
|
|
|
15404
15404
|
/**
|
|
15405
15405
|
* The Cloud Firestore service interface.
|
|
15406
15406
|
*
|
|
15407
15407
|
* Do not call this constructor directly. Instead, use {@link getFirestore}.
|
|
15408
15408
|
*/
|
|
15409
|
-
class
|
|
15409
|
+
class Fc extends Rc {
|
|
15410
15410
|
/** @hideconstructor */
|
|
15411
15411
|
constructor(t, e, n) {
|
|
15412
15412
|
super(t, e, n),
|
|
@@ -15495,7 +15495,7 @@ function qc(t) {
|
|
|
15495
15495
|
* persistence.
|
|
15496
15496
|
* @returns A `Promise` that represents successfully enabling persistent storage.
|
|
15497
15497
|
*/ function Kc(t, e) {
|
|
15498
|
-
Zc(t = Ec(t,
|
|
15498
|
+
Zc(t = Ec(t, Fc));
|
|
15499
15499
|
const n = Uc(t), s = t._freezeSettings(), i = new Ua;
|
|
15500
15500
|
return Qc(n, i, new La(i, s.cacheSizeBytes, null == e ? void 0 : e.forceOwnership));
|
|
15501
15501
|
}
|
|
@@ -15522,7 +15522,7 @@ function qc(t) {
|
|
|
15522
15522
|
* @returns A `Promise` that represents successfully enabling persistent
|
|
15523
15523
|
* storage.
|
|
15524
15524
|
*/ function jc(t) {
|
|
15525
|
-
Zc(t = Ec(t,
|
|
15525
|
+
Zc(t = Ec(t, Fc));
|
|
15526
15526
|
const e = Uc(t), n = t._freezeSettings(), s = new Ua;
|
|
15527
15527
|
return Qc(e, s, new Ba(s, n.cacheSizeBytes));
|
|
15528
15528
|
}
|
|
@@ -15625,7 +15625,7 @@ function Wc(t) {
|
|
|
15625
15625
|
return function(t) {
|
|
15626
15626
|
const e = new W;
|
|
15627
15627
|
return t.asyncQueue.enqueueAndForget((async () => _a(await ec(t), e))), e.promise;
|
|
15628
|
-
}(Uc(t = Ec(t,
|
|
15628
|
+
}(Uc(t = Ec(t, Fc)));
|
|
15629
15629
|
}
|
|
15630
15630
|
|
|
15631
15631
|
/**
|
|
@@ -15634,7 +15634,7 @@ function Wc(t) {
|
|
|
15634
15634
|
*
|
|
15635
15635
|
* @returns A `Promise` that is resolved once the network has been enabled.
|
|
15636
15636
|
*/ function zc(t) {
|
|
15637
|
-
return sc(Uc(t = Ec(t,
|
|
15637
|
+
return sc(Uc(t = Ec(t, Fc)));
|
|
15638
15638
|
}
|
|
15639
15639
|
|
|
15640
15640
|
/**
|
|
@@ -15645,7 +15645,7 @@ function Wc(t) {
|
|
|
15645
15645
|
*
|
|
15646
15646
|
* @returns A `Promise` that is resolved once the network has been disabled.
|
|
15647
15647
|
*/ function Hc(t) {
|
|
15648
|
-
return ic(Uc(t = Ec(t,
|
|
15648
|
+
return ic(Uc(t = Ec(t, Fc)));
|
|
15649
15649
|
}
|
|
15650
15650
|
|
|
15651
15651
|
/**
|
|
@@ -15684,7 +15684,7 @@ function Wc(t) {
|
|
|
15684
15684
|
* A `LoadBundleTask` object, which notifies callers with progress updates, and completion
|
|
15685
15685
|
* or error events. It can be used as a `Promise<LoadBundleTaskProgress>`.
|
|
15686
15686
|
*/ function Yc(t, e) {
|
|
15687
|
-
const n = Uc(t = Ec(t,
|
|
15687
|
+
const n = Uc(t = Ec(t, Fc)), s = new Oc;
|
|
15688
15688
|
return lc(n, t._databaseId, e, s), s;
|
|
15689
15689
|
}
|
|
15690
15690
|
|
|
@@ -15695,7 +15695,7 @@ function Wc(t) {
|
|
|
15695
15695
|
* with resulting documents), and loaded to local cache using `loadBundle`. Once in local
|
|
15696
15696
|
* cache, use this method to extract a {@link Query} by name.
|
|
15697
15697
|
*/ function Xc(t, e) {
|
|
15698
|
-
return fc(Uc(t = Ec(t,
|
|
15698
|
+
return fc(Uc(t = Ec(t, Fc)), e).then((e => e ? new vc(t, null, e.query) : null));
|
|
15699
15699
|
}
|
|
15700
15700
|
|
|
15701
15701
|
function Zc(t) {
|
|
@@ -16031,15 +16031,15 @@ function cu(t) {
|
|
|
16031
16031
|
var e;
|
|
16032
16032
|
const n = null === (e = this.path) || void 0 === e ? void 0 : e.child(t), s = this.$a({
|
|
16033
16033
|
path: n,
|
|
16034
|
-
|
|
16034
|
+
Ma: !1
|
|
16035
16035
|
});
|
|
16036
|
-
return s.
|
|
16036
|
+
return s.Fa(t), s;
|
|
16037
16037
|
}
|
|
16038
16038
|
La(t) {
|
|
16039
16039
|
var e;
|
|
16040
16040
|
const n = null === (e = this.path) || void 0 === e ? void 0 : e.child(t), s = this.$a({
|
|
16041
16041
|
path: n,
|
|
16042
|
-
|
|
16042
|
+
Ma: !1
|
|
16043
16043
|
});
|
|
16044
16044
|
return s.ka(), s;
|
|
16045
16045
|
}
|
|
@@ -16048,7 +16048,7 @@ function cu(t) {
|
|
|
16048
16048
|
// undefined.
|
|
16049
16049
|
return this.$a({
|
|
16050
16050
|
path: void 0,
|
|
16051
|
-
|
|
16051
|
+
Ma: !0
|
|
16052
16052
|
});
|
|
16053
16053
|
}
|
|
16054
16054
|
Ua(t) {
|
|
@@ -16060,9 +16060,9 @@ function cu(t) {
|
|
|
16060
16060
|
ka() {
|
|
16061
16061
|
// TODO(b/34871131): Remove null check once we have proper paths for fields
|
|
16062
16062
|
// within arrays.
|
|
16063
|
-
if (this.path) for (let t = 0; t < this.path.length; t++) this.
|
|
16063
|
+
if (this.path) for (let t = 0; t < this.path.length; t++) this.Fa(this.path.get(t));
|
|
16064
16064
|
}
|
|
16065
|
-
|
|
16065
|
+
Fa(t) {
|
|
16066
16066
|
if (0 === t.length) throw this.Ua("Document fields must not be empty");
|
|
16067
16067
|
if (cu(this.xa) && ru.test(t)) throw this.Ua('Document fields cannot begin and end with "__"');
|
|
16068
16068
|
}
|
|
@@ -16081,7 +16081,7 @@ function cu(t) {
|
|
|
16081
16081
|
methodName: e,
|
|
16082
16082
|
Ka: n,
|
|
16083
16083
|
path: mt.emptyPath(),
|
|
16084
|
-
|
|
16084
|
+
Ma: !1,
|
|
16085
16085
|
qa: s
|
|
16086
16086
|
}, this.databaseId, this.k, this.ignoreUndefinedProperties);
|
|
16087
16087
|
}
|
|
@@ -16141,7 +16141,7 @@ class du extends su {
|
|
|
16141
16141
|
xa: 3 /* Argument */ ,
|
|
16142
16142
|
Ka: e.settings.Ka,
|
|
16143
16143
|
methodName: t._methodName,
|
|
16144
|
-
|
|
16144
|
+
Ma: n
|
|
16145
16145
|
}, e.databaseId, e.k, e.ignoreUndefinedProperties);
|
|
16146
16146
|
}
|
|
16147
16147
|
|
|
@@ -16268,7 +16268,7 @@ class yu extends su {
|
|
|
16268
16268
|
// from firestore-exp.
|
|
16269
16269
|
t = getModularInstance(t))) return bu("Unsupported field value:", e, t), Au(t, e);
|
|
16270
16270
|
if (t instanceof su)
|
|
16271
|
-
// FieldValues usually parse into transforms (except
|
|
16271
|
+
// FieldValues usually parse into transforms (except deleteField())
|
|
16272
16272
|
// in which case we do not want to include this field in our parsed data
|
|
16273
16273
|
// (as doing so will overwrite the field directly prior to the transform
|
|
16274
16274
|
// trying to transform it). So we don't add this location to
|
|
@@ -16304,7 +16304,7 @@ class yu extends su {
|
|
|
16304
16304
|
// the set of values to be included for the IN query) that may directly
|
|
16305
16305
|
// contain additional arrays (each representing an individual field
|
|
16306
16306
|
// value), so we disable this validation.
|
|
16307
|
-
if (e.settings.
|
|
16307
|
+
if (e.settings.Ma && 4 /* ArrayArgument */ !== e.xa) throw e.Ua("Nested arrays are not supported");
|
|
16308
16308
|
return function(t, e) {
|
|
16309
16309
|
const n = [];
|
|
16310
16310
|
let s = 0;
|
|
@@ -16413,7 +16413,7 @@ function bu(t, e, n) {
|
|
|
16413
16413
|
// FieldPath.
|
|
16414
16414
|
e = getModularInstance(e)) instanceof tu) return e._internalPath;
|
|
16415
16415
|
if ("string" == typeof e) return Vu(t, e);
|
|
16416
|
-
throw Su("Field path arguments must be of type string or
|
|
16416
|
+
throw Su("Field path arguments must be of type string or ", t,
|
|
16417
16417
|
/* hasConverter= */ !1,
|
|
16418
16418
|
/* path= */ void 0, n);
|
|
16419
16419
|
}
|
|
@@ -16626,7 +16626,7 @@ function Su(t, e, n, s, i) {
|
|
|
16626
16626
|
* Retrieves all fields in the document as an `Object`. Returns `undefined` if
|
|
16627
16627
|
* the document doesn't exist.
|
|
16628
16628
|
*
|
|
16629
|
-
* By default, `
|
|
16629
|
+
* By default, `serverTimestamp()` values that have not yet been
|
|
16630
16630
|
* set to their final value will be returned as `null`. You can override
|
|
16631
16631
|
* this by passing an options object.
|
|
16632
16632
|
*
|
|
@@ -16651,7 +16651,7 @@ function Su(t, e, n, s, i) {
|
|
|
16651
16651
|
* Retrieves the field specified by `fieldPath`. Returns `undefined` if the
|
|
16652
16652
|
* document or field doesn't exist.
|
|
16653
16653
|
*
|
|
16654
|
-
* By default, a `
|
|
16654
|
+
* By default, a `serverTimestamp()` that has not yet been set to
|
|
16655
16655
|
* its final value will be returned as `null`. You can override this by
|
|
16656
16656
|
* passing an options object.
|
|
16657
16657
|
*
|
|
@@ -16687,7 +16687,7 @@ function Su(t, e, n, s, i) {
|
|
|
16687
16687
|
/**
|
|
16688
16688
|
* Retrieves all fields in the document as an `Object`.
|
|
16689
16689
|
*
|
|
16690
|
-
* By default, `
|
|
16690
|
+
* By default, `serverTimestamp()` values that have not yet been
|
|
16691
16691
|
* set to their final value will be returned as `null`. You can override
|
|
16692
16692
|
* this by passing an options object.
|
|
16693
16693
|
*
|
|
@@ -16708,7 +16708,7 @@ function Su(t, e, n, s, i) {
|
|
|
16708
16708
|
* array via the `docs` property or enumerated using the `forEach` method. The
|
|
16709
16709
|
* number of documents can be determined via the `empty` and `size`
|
|
16710
16710
|
* properties.
|
|
16711
|
-
*/ class
|
|
16711
|
+
*/ class Mu {
|
|
16712
16712
|
/** @hideconstructor */
|
|
16713
16713
|
constructor(t, e, n, s) {
|
|
16714
16714
|
this._firestore = t, this._userDataWriter = e, this._snapshot = s, this.metadata = new xu(s.hasPendingWrites, s.fromCache),
|
|
@@ -16767,7 +16767,7 @@ function Su(t, e, n, s, i) {
|
|
|
16767
16767
|
let i = -1, r = -1;
|
|
16768
16768
|
return 0 /* Added */ !== e.type && (i = n.indexOf(e.doc.key), n = n.delete(e.doc.key)),
|
|
16769
16769
|
1 /* Removed */ !== e.type && (n = n.add(e.doc), r = n.indexOf(e.doc.key)), {
|
|
16770
|
-
type:
|
|
16770
|
+
type: Fu(e.type),
|
|
16771
16771
|
doc: s,
|
|
16772
16772
|
oldIndex: i,
|
|
16773
16773
|
newIndex: r
|
|
@@ -16778,7 +16778,7 @@ function Su(t, e, n, s, i) {
|
|
|
16778
16778
|
}
|
|
16779
16779
|
}
|
|
16780
16780
|
|
|
16781
|
-
function
|
|
16781
|
+
function Fu(t) {
|
|
16782
16782
|
switch (t) {
|
|
16783
16783
|
case 0 /* Added */ :
|
|
16784
16784
|
return "added";
|
|
@@ -16804,7 +16804,7 @@ function Mu(t) {
|
|
|
16804
16804
|
* @param right - A snapshot to compare.
|
|
16805
16805
|
* @returns true if the snapshots are equal.
|
|
16806
16806
|
*/ function Lu(t, e) {
|
|
16807
|
-
return t instanceof $u && e instanceof $u ? t._firestore === e._firestore && t._key.isEqual(e._key) && (null === t._document ? null === e._document : t._document.isEqual(e._document)) && t._converter === e._converter : t instanceof
|
|
16807
|
+
return t instanceof $u && e instanceof $u ? t._firestore === e._firestore && t._key.isEqual(e._key) && (null === t._document ? null === e._document : t._document.isEqual(e._document)) && t._converter === e._converter : t instanceof Mu && e instanceof Mu && (t._firestore === e._firestore && kc(t.query, e.query) && t.metadata.isEqual(e.metadata) && t._snapshot.isEqual(e._snapshot));
|
|
16808
16808
|
}
|
|
16809
16809
|
|
|
16810
16810
|
/**
|
|
@@ -16856,7 +16856,7 @@ class Ku extends Uu {
|
|
|
16856
16856
|
const e = lu(t.firestore), n = function(t, e, n, s, i, r, o) {
|
|
16857
16857
|
let a;
|
|
16858
16858
|
if (i.isKeyField()) {
|
|
16859
|
-
if ("array-contains" /* ARRAY_CONTAINS */ === r || "array-contains-any" /* ARRAY_CONTAINS_ANY */ === r) throw new Q(j.INVALID_ARGUMENT, `Invalid Query. You can't perform '${r}' queries on
|
|
16859
|
+
if ("array-contains" /* ARRAY_CONTAINS */ === r || "array-contains-any" /* ARRAY_CONTAINS_ANY */ === r) throw new Q(j.INVALID_ARGUMENT, `Invalid Query. You can't perform '${r}' queries on documentId().`);
|
|
16860
16860
|
if ("in" /* IN */ === r || "not-in" /* NOT_IN */ === r) {
|
|
16861
16861
|
ih(o, r);
|
|
16862
16862
|
const e = [];
|
|
@@ -17073,7 +17073,7 @@ function eh(...t) {
|
|
|
17073
17073
|
// the provided document. Without the key (by using the explicit sort
|
|
17074
17074
|
// orders), multiple documents could match the position, yielding duplicate
|
|
17075
17075
|
// results.
|
|
17076
|
-
for (const n of Re(t)) if (n.field.isKeyField()) r.push(
|
|
17076
|
+
for (const n of Re(t)) if (n.field.isKeyField()) r.push(Ft(e, s.key)); else {
|
|
17077
17077
|
const t = s.data.field(n.field);
|
|
17078
17078
|
if (Rt(t)) throw new Q(j.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.)');
|
|
17079
17079
|
if (null === t) {
|
|
@@ -17098,11 +17098,11 @@ function eh(...t) {
|
|
|
17098
17098
|
const c = i[r];
|
|
17099
17099
|
if (o[r].field.isKeyField()) {
|
|
17100
17100
|
if ("string" != typeof c) throw new Q(j.INVALID_ARGUMENT, `Invalid query. Expected a string for document ID in ${s}(), but got a ${typeof c}`);
|
|
17101
|
-
if (!Ae(t) && -1 !== c.indexOf("/")) throw new Q(j.INVALID_ARGUMENT, `Invalid query. When querying a collection and ordering by
|
|
17101
|
+
if (!Ae(t) && -1 !== c.indexOf("/")) throw new Q(j.INVALID_ARGUMENT, `Invalid query. When querying a collection and ordering by documentId(), the value passed to ${s}() must be a plain document ID, but '${c}' contains a slash.`);
|
|
17102
17102
|
const n = t.path.child(wt.fromString(c));
|
|
17103
|
-
if (!Dt.isDocumentKey(n)) throw new Q(j.INVALID_ARGUMENT, `Invalid query. When querying a collection group and ordering by
|
|
17103
|
+
if (!Dt.isDocumentKey(n)) throw new Q(j.INVALID_ARGUMENT, `Invalid query. When querying a collection group and ordering by documentId(), the value passed to ${s}() must result in a valid document path, but '${n}' is not because it contains an odd number of segments.`);
|
|
17104
17104
|
const i = new Dt(n);
|
|
17105
|
-
a.push(
|
|
17105
|
+
a.push(Ft(e, i));
|
|
17106
17106
|
} else {
|
|
17107
17107
|
const t = Eu(n, s, c);
|
|
17108
17108
|
a.push(t);
|
|
@@ -17120,14 +17120,14 @@ function eh(...t) {
|
|
|
17120
17120
|
|
|
17121
17121
|
function sh(t, e, n) {
|
|
17122
17122
|
if ("string" == typeof (n = getModularInstance(n))) {
|
|
17123
|
-
if ("" === n) throw new Q(j.INVALID_ARGUMENT, "Invalid query. When querying with
|
|
17124
|
-
if (!Ae(e) && -1 !== n.indexOf("/")) throw new Q(j.INVALID_ARGUMENT, `Invalid query. When querying a collection by
|
|
17123
|
+
if ("" === n) throw new Q(j.INVALID_ARGUMENT, "Invalid query. When querying with documentId(), you must provide a valid document ID, but it was an empty string.");
|
|
17124
|
+
if (!Ae(e) && -1 !== n.indexOf("/")) throw new Q(j.INVALID_ARGUMENT, `Invalid query. When querying a collection by documentId(), you must provide a plain document ID, but '${n}' contains a '/' character.`);
|
|
17125
17125
|
const s = e.path.child(wt.fromString(n));
|
|
17126
|
-
if (!Dt.isDocumentKey(s)) throw new Q(j.INVALID_ARGUMENT, `Invalid query. When querying a collection group by
|
|
17127
|
-
return
|
|
17126
|
+
if (!Dt.isDocumentKey(s)) throw new Q(j.INVALID_ARGUMENT, `Invalid query. When querying a collection group by documentId(), the value provided must result in a valid document path, but '${s}' is not because it has an odd number of segments (${s.length}).`);
|
|
17127
|
+
return Ft(t, new Dt(s));
|
|
17128
17128
|
}
|
|
17129
|
-
if (n instanceof Pc) return
|
|
17130
|
-
throw new Q(j.INVALID_ARGUMENT, `Invalid query. When querying with
|
|
17129
|
+
if (n instanceof Pc) return Ft(t, n._key);
|
|
17130
|
+
throw new Q(j.INVALID_ARGUMENT, `Invalid query. When querying with documentId(), you must provide a valid string or a DocumentReference, but it was: ${Tc(n)}.`);
|
|
17131
17131
|
}
|
|
17132
17132
|
|
|
17133
17133
|
/**
|
|
@@ -17238,7 +17238,7 @@ function rh(t, e, n) {
|
|
|
17238
17238
|
const s = new wc(n.get(1), n.get(3)), i = new Dt(n.popFirst(5));
|
|
17239
17239
|
return s.isEqual(e) ||
|
|
17240
17240
|
// TODO(b/64130202): Somehow support foreign references.
|
|
17241
|
-
|
|
17241
|
+
M(`Document ${i} contains a document reference within a different database (${s.projectId}/${s.database}) which is not supported. It will be treated as a reference in the current database (${e.projectId}/${e.database}) instead.`),
|
|
17242
17242
|
i;
|
|
17243
17243
|
}
|
|
17244
17244
|
}
|
|
@@ -17421,7 +17421,7 @@ function hh(t, e) {
|
|
|
17421
17421
|
*/
|
|
17422
17422
|
function lh(t) {
|
|
17423
17423
|
t = Ec(t, Pc);
|
|
17424
|
-
const e = Ec(t.firestore,
|
|
17424
|
+
const e = Ec(t.firestore, Fc);
|
|
17425
17425
|
return oc(Uc(e), t._key).then((n => bh(e, t, n)));
|
|
17426
17426
|
}
|
|
17427
17427
|
|
|
@@ -17446,7 +17446,7 @@ class fh extends oh {
|
|
|
17446
17446
|
* current document contents.
|
|
17447
17447
|
*/ function dh(t) {
|
|
17448
17448
|
t = Ec(t, Pc);
|
|
17449
|
-
const e = Ec(t.firestore,
|
|
17449
|
+
const e = Ec(t.firestore, Fc), n = Uc(e), s = new fh(e);
|
|
17450
17450
|
return rc(n, t._key).then((n => new $u(e, s, t._key, n, new xu(null !== n && n.hasLocalMutations,
|
|
17451
17451
|
/* fromCache= */ !0), t.converter)));
|
|
17452
17452
|
}
|
|
@@ -17459,7 +17459,7 @@ class fh extends oh {
|
|
|
17459
17459
|
* current document contents.
|
|
17460
17460
|
*/ function wh(t) {
|
|
17461
17461
|
t = Ec(t, Pc);
|
|
17462
|
-
const e = Ec(t.firestore,
|
|
17462
|
+
const e = Ec(t.firestore, Fc);
|
|
17463
17463
|
return oc(Uc(e), t._key, {
|
|
17464
17464
|
source: "server"
|
|
17465
17465
|
}).then((n => bh(e, t, n)));
|
|
@@ -17476,8 +17476,8 @@ class fh extends oh {
|
|
|
17476
17476
|
* @returns A `Promise` that will be resolved with the results of the query.
|
|
17477
17477
|
*/ function _h(t) {
|
|
17478
17478
|
t = Ec(t, vc);
|
|
17479
|
-
const e = Ec(t.firestore,
|
|
17480
|
-
return Bu(t._query), cc(n, t._query).then((n => new
|
|
17479
|
+
const e = Ec(t.firestore, Fc), n = Uc(e), s = new fh(e);
|
|
17480
|
+
return Bu(t._query), cc(n, t._query).then((n => new Mu(e, s, t, n)));
|
|
17481
17481
|
}
|
|
17482
17482
|
|
|
17483
17483
|
/**
|
|
@@ -17487,8 +17487,8 @@ class fh extends oh {
|
|
|
17487
17487
|
* @returns A `Promise` that will be resolved with the results of the query.
|
|
17488
17488
|
*/ function mh(t) {
|
|
17489
17489
|
t = Ec(t, vc);
|
|
17490
|
-
const e = Ec(t.firestore,
|
|
17491
|
-
return ac(n, t._query).then((n => new
|
|
17490
|
+
const e = Ec(t.firestore, Fc), n = Uc(e), s = new fh(e);
|
|
17491
|
+
return ac(n, t._query).then((n => new Mu(e, s, t, n)));
|
|
17492
17492
|
}
|
|
17493
17493
|
|
|
17494
17494
|
/**
|
|
@@ -17498,21 +17498,21 @@ class fh extends oh {
|
|
|
17498
17498
|
* @returns A `Promise` that will be resolved with the results of the query.
|
|
17499
17499
|
*/ function gh(t) {
|
|
17500
17500
|
t = Ec(t, vc);
|
|
17501
|
-
const e = Ec(t.firestore,
|
|
17501
|
+
const e = Ec(t.firestore, Fc), n = Uc(e), s = new fh(e);
|
|
17502
17502
|
return cc(n, t._query, {
|
|
17503
17503
|
source: "server"
|
|
17504
|
-
}).then((n => new
|
|
17504
|
+
}).then((n => new Mu(e, s, t, n)));
|
|
17505
17505
|
}
|
|
17506
17506
|
|
|
17507
17507
|
function yh(t, e, n) {
|
|
17508
17508
|
t = Ec(t, Pc);
|
|
17509
|
-
const s = Ec(t.firestore,
|
|
17509
|
+
const s = Ec(t.firestore, Fc), i = ah(t.converter, e, n);
|
|
17510
17510
|
return Rh(s, [ fu(lu(s), "setDoc", t._key, i, null !== t.converter, n).toMutation(t._key, Ye.none()) ]);
|
|
17511
17511
|
}
|
|
17512
17512
|
|
|
17513
17513
|
function ph(t, e, n, ...s) {
|
|
17514
17514
|
t = Ec(t, Pc);
|
|
17515
|
-
const i = Ec(t.firestore,
|
|
17515
|
+
const i = Ec(t.firestore, Fc), r = lu(i);
|
|
17516
17516
|
let o;
|
|
17517
17517
|
o = "string" == typeof (
|
|
17518
17518
|
// For Compat types, we have to "extract" the underlying types before
|
|
@@ -17528,7 +17528,7 @@ function ph(t, e, n, ...s) {
|
|
|
17528
17528
|
* @returns A Promise resolved once the document has been successfully
|
|
17529
17529
|
* deleted from the backend (note that it won't resolve while you're offline).
|
|
17530
17530
|
*/ function Th(t) {
|
|
17531
|
-
return Rh(Ec(t.firestore,
|
|
17531
|
+
return Rh(Ec(t.firestore, Fc), [ new ln(t._key, Ye.none()) ]);
|
|
17532
17532
|
}
|
|
17533
17533
|
|
|
17534
17534
|
/**
|
|
@@ -17541,7 +17541,7 @@ function ph(t, e, n, ...s) {
|
|
|
17541
17541
|
* newly created document after it has been written to the backend (Note that it
|
|
17542
17542
|
* won't resolve while you're offline).
|
|
17543
17543
|
*/ function Eh(t, e) {
|
|
17544
|
-
const n = Ec(t.firestore,
|
|
17544
|
+
const n = Ec(t.firestore, Fc), s = Cc(t), i = ah(t.converter, e);
|
|
17545
17545
|
return Rh(n, [ fu(lu(t.firestore), "addDoc", s._key, i, null !== t.converter, {}).toMutation(s._key, Ye.exists(!1)) ]).then((() => s));
|
|
17546
17546
|
}
|
|
17547
17547
|
|
|
@@ -17561,7 +17561,7 @@ function Ih(t, ...e) {
|
|
|
17561
17561
|
e[o + 2] = null === (i = t.complete) || void 0 === i ? void 0 : i.bind(t);
|
|
17562
17562
|
}
|
|
17563
17563
|
let c, u, h;
|
|
17564
|
-
if (t instanceof Pc) u = Ec(t.firestore,
|
|
17564
|
+
if (t instanceof Pc) u = Ec(t.firestore, Fc), h = ye(t._key.path), c = {
|
|
17565
17565
|
next: n => {
|
|
17566
17566
|
e[o] && e[o](bh(u, t, n));
|
|
17567
17567
|
},
|
|
@@ -17569,11 +17569,11 @@ function Ih(t, ...e) {
|
|
|
17569
17569
|
complete: e[o + 2]
|
|
17570
17570
|
}; else {
|
|
17571
17571
|
const n = Ec(t, vc);
|
|
17572
|
-
u = Ec(n.firestore,
|
|
17572
|
+
u = Ec(n.firestore, Fc), h = n._query;
|
|
17573
17573
|
const s = new fh(u);
|
|
17574
17574
|
c = {
|
|
17575
17575
|
next: t => {
|
|
17576
|
-
e[o] && e[o](new
|
|
17576
|
+
e[o] && e[o](new Mu(u, s, n, t));
|
|
17577
17577
|
},
|
|
17578
17578
|
error: e[o + 1],
|
|
17579
17579
|
complete: e[o + 2]
|
|
@@ -17588,7 +17588,7 @@ function Ih(t, ...e) {
|
|
|
17588
17588
|
}
|
|
17589
17589
|
|
|
17590
17590
|
function Ah(t, e) {
|
|
17591
|
-
return uc(Uc(t = Ec(t,
|
|
17591
|
+
return uc(Uc(t = Ec(t, Fc)), $c(e) ? e : {
|
|
17592
17592
|
next: e
|
|
17593
17593
|
});
|
|
17594
17594
|
}
|
|
@@ -17711,7 +17711,7 @@ function Ah(t, e) {
|
|
|
17711
17711
|
* `updateFunction `is returned here. Otherwise, if the transaction failed, a
|
|
17712
17712
|
* rejected promise with the corresponding failure error is returned.
|
|
17713
17713
|
*/ function vh(t, e) {
|
|
17714
|
-
return hc(Uc(t = Ec(t,
|
|
17714
|
+
return hc(Uc(t = Ec(t, Fc)), (n => e(new Ph(t, n))));
|
|
17715
17715
|
}
|
|
17716
17716
|
|
|
17717
17717
|
/**
|
|
@@ -17826,7 +17826,7 @@ function Ah(t, e) {
|
|
|
17826
17826
|
* @returns A {@link WriteBatch} that can be used to atomically execute multiple
|
|
17827
17827
|
* writes.
|
|
17828
17828
|
*/ function kh(t) {
|
|
17829
|
-
return Uc(t = Ec(t,
|
|
17829
|
+
return Uc(t = Ec(t, Fc)), new uh(t, (e => Rh(t, e)));
|
|
17830
17830
|
}
|
|
17831
17831
|
|
|
17832
17832
|
/**
|
|
@@ -17837,14 +17837,14 @@ function Ah(t, e) {
|
|
|
17837
17837
|
!function(t) {
|
|
17838
17838
|
N = t;
|
|
17839
17839
|
}(SDK_VERSION), _registerComponent(new Component("firestore", ((t, {options: n}) => {
|
|
17840
|
-
const s = t.getProvider("app").getImmediate(), i = new
|
|
17840
|
+
const s = t.getProvider("app").getImmediate(), i = new Fc(s, new J(t.getProvider("auth-internal")), new tt(t.getProvider("app-check-internal")));
|
|
17841
17841
|
return n = Object.assign({
|
|
17842
17842
|
useFetchStreams: e
|
|
17843
17843
|
}, n), i._setSettings(n), i;
|
|
17844
|
-
}), "PUBLIC")), registerVersion(D, "3.4.
|
|
17844
|
+
}), "PUBLIC")), registerVersion(D, "3.4.3-canary.1b246ae04", t),
|
|
17845
17845
|
// BUILD_TARGET will be replaced by values like esm5, esm2017, cjs5, etc during the compilation
|
|
17846
|
-
registerVersion(D, "3.4.
|
|
17846
|
+
registerVersion(D, "3.4.3-canary.1b246ae04", "esm2017");
|
|
17847
17847
|
}();
|
|
17848
17848
|
|
|
17849
|
-
export { oh as AbstractUserDataWriter, nu as Bytes,
|
|
17849
|
+
export { oh as AbstractUserDataWriter, nu as Bytes, Mc as CACHE_SIZE_UNLIMITED, Vc as CollectionReference, Pc as DocumentReference, $u as DocumentSnapshot, tu as FieldPath, su as FieldValue, Fc as Firestore, Q as FirestoreError, iu as GeoPoint, Oc as LoadBundleTask, vc as Query, Uu as QueryConstraint, Ou as QueryDocumentSnapshot, Mu as QuerySnapshot, xu as SnapshotMetadata, ct as Timestamp, Ph as Transaction, uh as WriteBatch, wc as _DatabaseId, Dt as _DocumentKey, et as _EmptyAppCheckTokenProvider, z as _EmptyAuthCredentialsProvider, mt as _FieldPath, Ec as _cast, q as _debugAssert, yt as _isBase64Available, F as _logWarn, gc as _validateIsNotUsedTogether, Eh as addDoc, Ch as arrayRemove, Dh as arrayUnion, Wc as clearIndexedDbPersistence, Sc as collection, Dc as collectionGroup, bc as connectFirestoreEmulator, Th as deleteDoc, Vh as deleteField, Hc as disableNetwork, Cc as doc, eu as documentId, Kc as enableIndexedDbPersistence, jc as enableMultiTabIndexedDbPersistence, zc as enableNetwork, eh as endAt, th as endBefore, Uc as ensureFirestoreConfigured, Rh as executeWrite, lh as getDoc, dh as getDocFromCache, wh as getDocFromServer, _h as getDocs, mh as getDocsFromCache, gh as getDocsFromServer, Bc as getFirestore, Nh as increment, Lc as initializeFirestore, zu as limit, Hu as limitToLast, Yc as loadBundle, Xc as namedQuery, Ih as onSnapshot, Ah as onSnapshotsInSync, Wu as orderBy, qu as query, kc as queryEqual, Nc as refEqual, vh as runTransaction, Sh as serverTimestamp, yh as setDoc, $ as setLogLevel, Lu as snapshotEqual, Xu as startAfter, Yu as startAt, Jc as terminate, ph as updateDoc, Gc as waitForPendingWrites, ju as where, kh as writeBatch };
|
|
17850
17850
|
//# sourceMappingURL=index.esm2017.js.map
|