@firebase/firestore 3.4.4-canary.e8972ef49 → 3.4.4-canary.e9619685b
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/firestore/src/api/snapshot.d.ts +1 -2
- package/dist/index.d.ts +1 -2
- package/dist/index.esm2017.js +8 -7
- package/dist/index.esm2017.js.map +1 -1
- package/dist/index.esm5.js +7 -8
- package/dist/index.esm5.js.map +1 -1
- package/dist/index.node.cjs.js +6 -7
- package/dist/index.node.cjs.js.map +1 -1
- package/dist/index.node.mjs +6 -7
- package/dist/index.node.mjs.map +1 -1
- package/dist/index.rn.js +8 -7
- package/dist/index.rn.js.map +1 -1
- package/dist/internal.d.ts +1 -2
- package/dist/lite/firestore/src/api/snapshot.d.ts +1 -2
- package/dist/lite/index.browser.esm2017.js +72 -72
- package/dist/lite/index.browser.esm2017.js.map +1 -1
- package/dist/lite/index.browser.esm5.js +8 -8
- package/dist/lite/index.node.cjs.js +2 -2
- package/dist/lite/index.node.mjs +2 -2
- package/dist/lite/index.node.mjs.map +1 -1
- package/dist/lite/index.rn.esm2017.js +2 -2
- package/dist/lite/packages/firestore/dist/lite/index.browser.esm2017.d.ts +18 -18
- package/dist/lite/packages/firestore/src/api/snapshot.d.ts +1 -2
- package/dist/packages/firestore/src/api/snapshot.d.ts +1 -2
- package/dist/private.d.ts +1 -2
- package/package.json +9 -9
package/dist/internal.d.ts
CHANGED
|
@@ -1074,8 +1074,7 @@ export declare class DocumentSnapshot<T = DocumentData> extends DocumentSnapshot
|
|
|
1074
1074
|
/** @hideconstructor protected */
|
|
1075
1075
|
constructor(_firestore: Firestore, userDataWriter: AbstractUserDataWriter, key: _DocumentKey, document: Document_2 | null, metadata: SnapshotMetadata, converter: UntypedFirestoreDataConverter<T> | null);
|
|
1076
1076
|
/**
|
|
1077
|
-
*
|
|
1078
|
-
* exists. True if the document exists.
|
|
1077
|
+
* Returns whether or not the data exists. True if the document exists.
|
|
1079
1078
|
*/
|
|
1080
1079
|
exists(): this is QueryDocumentSnapshot<T>;
|
|
1081
1080
|
/**
|
|
@@ -198,8 +198,7 @@ export declare class DocumentSnapshot<T = DocumentData> extends LiteDocumentSnap
|
|
|
198
198
|
/** @hideconstructor protected */
|
|
199
199
|
constructor(_firestore: Firestore, userDataWriter: AbstractUserDataWriter, key: DocumentKey, document: Document | null, metadata: SnapshotMetadata, converter: UntypedFirestoreDataConverter<T> | null);
|
|
200
200
|
/**
|
|
201
|
-
*
|
|
202
|
-
* exists. True if the document exists.
|
|
201
|
+
* Returns whether or not the data exists. True if the document exists.
|
|
203
202
|
*/
|
|
204
203
|
exists(): this is QueryDocumentSnapshot<T>;
|
|
205
204
|
/**
|
|
@@ -63,7 +63,7 @@ l.MOCK_USER = new l("mock-user");
|
|
|
63
63
|
* See the License for the specific language governing permissions and
|
|
64
64
|
* limitations under the License.
|
|
65
65
|
*/
|
|
66
|
-
let f = "9.6.
|
|
66
|
+
let f = "9.6.6-canary.e9619685b";
|
|
67
67
|
|
|
68
68
|
/**
|
|
69
69
|
* @license
|
|
@@ -190,14 +190,14 @@ function p(t, ...e) {
|
|
|
190
190
|
* given message if it did.
|
|
191
191
|
*
|
|
192
192
|
* Messages are stripped in production builds.
|
|
193
|
-
*/ function
|
|
193
|
+
*/ function b(t, e) {
|
|
194
194
|
t || g();
|
|
195
195
|
}
|
|
196
196
|
|
|
197
197
|
/**
|
|
198
198
|
* Casts `obj` to `T`. In non-production builds, verifies that `obj` is an
|
|
199
199
|
* instance of `T` before casting.
|
|
200
|
-
*/ function
|
|
200
|
+
*/ function v(t,
|
|
201
201
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
202
202
|
e) {
|
|
203
203
|
return t;
|
|
@@ -332,7 +332,7 @@ e) {
|
|
|
332
332
|
}));
|
|
333
333
|
}
|
|
334
334
|
getToken() {
|
|
335
|
-
return this.auth ? this.auth.getToken().then((t => t ? (
|
|
335
|
+
return this.auth ? this.auth.getToken().then((t => t ? (b("string" == typeof t.accessToken),
|
|
336
336
|
new j(t.accessToken, new l(this.auth.getUid()))) : null)) : Promise.resolve(null);
|
|
337
337
|
}
|
|
338
338
|
invalidateToken() {}
|
|
@@ -386,7 +386,7 @@ class W {
|
|
|
386
386
|
}));
|
|
387
387
|
}
|
|
388
388
|
getToken() {
|
|
389
|
-
return this.appCheck ? this.appCheck.getToken().then((t => t ? (
|
|
389
|
+
return this.appCheck ? this.appCheck.getToken().then((t => t ? (b("string" == typeof t.token),
|
|
390
390
|
new W(t.token)) : null)) : Promise.resolve(null);
|
|
391
391
|
}
|
|
392
392
|
invalidateToken() {}
|
|
@@ -1311,15 +1311,15 @@ class gt {
|
|
|
1311
1311
|
/**
|
|
1312
1312
|
* A version of a document in Firestore. This corresponds to the version
|
|
1313
1313
|
* timestamp, such as update_time or read_time.
|
|
1314
|
-
*/ class
|
|
1314
|
+
*/ class bt {
|
|
1315
1315
|
constructor(t) {
|
|
1316
1316
|
this.timestamp = t;
|
|
1317
1317
|
}
|
|
1318
1318
|
static fromTimestamp(t) {
|
|
1319
|
-
return new
|
|
1319
|
+
return new bt(t);
|
|
1320
1320
|
}
|
|
1321
1321
|
static min() {
|
|
1322
|
-
return new
|
|
1322
|
+
return new bt(new gt(0, 0));
|
|
1323
1323
|
}
|
|
1324
1324
|
compareTo(t) {
|
|
1325
1325
|
return this.timestamp._compareTo(t.timestamp);
|
|
@@ -1354,7 +1354,7 @@ class gt {
|
|
|
1354
1354
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1355
1355
|
* See the License for the specific language governing permissions and
|
|
1356
1356
|
* limitations under the License.
|
|
1357
|
-
*/ function
|
|
1357
|
+
*/ function vt(t) {
|
|
1358
1358
|
let e = 0;
|
|
1359
1359
|
for (const n in t) Object.prototype.hasOwnProperty.call(t, n) && e++;
|
|
1360
1360
|
return e;
|
|
@@ -1540,13 +1540,13 @@ const At = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
|
|
|
1540
1540
|
// The json interface (for the browser) will return an iso timestamp string,
|
|
1541
1541
|
// while the proto js library (for node) will return a
|
|
1542
1542
|
// google.protobuf.Timestamp instance.
|
|
1543
|
-
if (
|
|
1543
|
+
if (b(!!t), "string" == typeof t) {
|
|
1544
1544
|
// The date string can have higher precision (nanos) than the Date class
|
|
1545
1545
|
// (millis), so we do some custom parsing here.
|
|
1546
1546
|
// Parse the nanos right out of the string.
|
|
1547
1547
|
let e = 0;
|
|
1548
1548
|
const n = At.exec(t);
|
|
1549
|
-
if (
|
|
1549
|
+
if (b(!!n), n[1]) {
|
|
1550
1550
|
// Pad the fraction out to 9 digits (nanos).
|
|
1551
1551
|
let t = n[1];
|
|
1552
1552
|
t = (t + "000000000").substr(0, 9), e = Number(t);
|
|
@@ -1706,7 +1706,7 @@ const At = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
|
|
|
1706
1706
|
case 10 /* ObjectValue */ :
|
|
1707
1707
|
return function(t, e) {
|
|
1708
1708
|
const n = t.mapValue.fields || {}, r = e.mapValue.fields || {};
|
|
1709
|
-
if (
|
|
1709
|
+
if (vt(n) !== vt(r)) return !1;
|
|
1710
1710
|
for (const t in n) if (n.hasOwnProperty(t) && (void 0 === r[t] || !Ft(n[t], r[t]))) return !1;
|
|
1711
1711
|
return !0;
|
|
1712
1712
|
}
|
|
@@ -2003,23 +2003,23 @@ function Ct(t, e) {
|
|
|
2003
2003
|
* Creates a document with no known version or data, but which can serve as
|
|
2004
2004
|
* base document for mutations.
|
|
2005
2005
|
*/ static newInvalidDocument(t) {
|
|
2006
|
-
return new zt(t, 0 /* INVALID */ ,
|
|
2006
|
+
return new zt(t, 0 /* INVALID */ , bt.min(), bt.min(), Bt.empty(), 0 /* SYNCED */);
|
|
2007
2007
|
}
|
|
2008
2008
|
/**
|
|
2009
2009
|
* Creates a new document that is known to exist with the given data at the
|
|
2010
2010
|
* given version.
|
|
2011
2011
|
*/ static newFoundDocument(t, e, n) {
|
|
2012
|
-
return new zt(t, 1 /* FOUND_DOCUMENT */ , e,
|
|
2012
|
+
return new zt(t, 1 /* FOUND_DOCUMENT */ , e, bt.min(), n, 0 /* SYNCED */);
|
|
2013
2013
|
}
|
|
2014
2014
|
/** Creates a new document that is known to not exist at the given version. */ static newNoDocument(t, e) {
|
|
2015
|
-
return new zt(t, 2 /* NO_DOCUMENT */ , e,
|
|
2015
|
+
return new zt(t, 2 /* NO_DOCUMENT */ , e, bt.min(), Bt.empty(), 0 /* SYNCED */);
|
|
2016
2016
|
}
|
|
2017
2017
|
/**
|
|
2018
2018
|
* Creates a new document that is known to exist at the given version but
|
|
2019
2019
|
* whose data is not known (e.g. a document that was updated without a known
|
|
2020
2020
|
* base document).
|
|
2021
2021
|
*/ static newUnknownDocument(t, e) {
|
|
2022
|
-
return new zt(t, 3 /* UNKNOWN_DOCUMENT */ , e,
|
|
2022
|
+
return new zt(t, 3 /* UNKNOWN_DOCUMENT */ , e, bt.min(), Bt.empty(), 2 /* HAS_COMMITTED_MUTATIONS */);
|
|
2023
2023
|
}
|
|
2024
2024
|
/**
|
|
2025
2025
|
* Changes the document type to indicate that it exists and that its version
|
|
@@ -2349,7 +2349,7 @@ function he(t) {
|
|
|
2349
2349
|
* which can be different from the order by constraints the user provided (e.g.
|
|
2350
2350
|
* the SDK and backend always orders by `__name__`).
|
|
2351
2351
|
*/ function le(t) {
|
|
2352
|
-
const e =
|
|
2352
|
+
const e = v(t);
|
|
2353
2353
|
if (null === e.$) {
|
|
2354
2354
|
e.$ = [];
|
|
2355
2355
|
const t = ae(e), n = ce(e);
|
|
@@ -2374,7 +2374,7 @@ function he(t) {
|
|
|
2374
2374
|
/**
|
|
2375
2375
|
* Converts this `Query` instance to it's corresponding `Target` representation.
|
|
2376
2376
|
*/ function fe(t) {
|
|
2377
|
-
const e =
|
|
2377
|
+
const e = v(t);
|
|
2378
2378
|
if (!e.S) if ("F" /* First */ === e.limitType) e.S = Qt(e.path, e.collectionGroup, le(e), e.filters, e.limit, e.startAt, e.endAt); else {
|
|
2379
2379
|
// Flip the orderBy directions since we want the last results
|
|
2380
2380
|
const t = [];
|
|
@@ -2522,7 +2522,7 @@ function we(t, e) {
|
|
|
2522
2522
|
* See the License for the specific language governing permissions and
|
|
2523
2523
|
* limitations under the License.
|
|
2524
2524
|
*/
|
|
2525
|
-
/** A field path and the TransformOperation to perform upon it. */ class
|
|
2525
|
+
/** A field path and the TransformOperation to perform upon it. */ class be {
|
|
2526
2526
|
constructor(t, e) {
|
|
2527
2527
|
this.field = t, this.transform = e;
|
|
2528
2528
|
}
|
|
@@ -2532,18 +2532,18 @@ function we(t, e) {
|
|
|
2532
2532
|
* Encodes a precondition for a mutation. This follows the model that the
|
|
2533
2533
|
* backend accepts with the special case of an explicit "empty" precondition
|
|
2534
2534
|
* (meaning no precondition).
|
|
2535
|
-
*/ class
|
|
2535
|
+
*/ class ve {
|
|
2536
2536
|
constructor(t, e) {
|
|
2537
2537
|
this.updateTime = t, this.exists = e;
|
|
2538
2538
|
}
|
|
2539
2539
|
/** Creates a new empty Precondition. */ static none() {
|
|
2540
|
-
return new
|
|
2540
|
+
return new ve;
|
|
2541
2541
|
}
|
|
2542
2542
|
/** Creates a new Precondition with an exists flag. */ static exists(t) {
|
|
2543
|
-
return new
|
|
2543
|
+
return new ve(void 0, t);
|
|
2544
2544
|
}
|
|
2545
2545
|
/** Creates a new Precondition based on a version a document exists at. */ static updateTime(t) {
|
|
2546
|
-
return new
|
|
2546
|
+
return new ve(t);
|
|
2547
2547
|
}
|
|
2548
2548
|
/** Returns whether this Precondition is empty. */ get isNone() {
|
|
2549
2549
|
return void 0 === this.updateTime && void 0 === this.exists;
|
|
@@ -2737,7 +2737,7 @@ function Se(t, e) {
|
|
|
2737
2737
|
}
|
|
2738
2738
|
|
|
2739
2739
|
function Fe(t) {
|
|
2740
|
-
return
|
|
2740
|
+
return b(!!t), bt.fromTimestamp(function(t) {
|
|
2741
2741
|
const e = Rt(t);
|
|
2742
2742
|
return new gt(e.seconds, e.nanos);
|
|
2743
2743
|
}(t));
|
|
@@ -2756,11 +2756,11 @@ function qe(t, e) {
|
|
|
2756
2756
|
function Oe(t, e) {
|
|
2757
2757
|
const n = function(t) {
|
|
2758
2758
|
const e = X.fromString(t);
|
|
2759
|
-
return
|
|
2759
|
+
return b(We(e)), e;
|
|
2760
2760
|
}(e);
|
|
2761
2761
|
if (n.get(1) !== t.databaseId.projectId) throw new U(A, "Tried to deserialize key from different project: " + n.get(1) + " vs " + t.databaseId.projectId);
|
|
2762
2762
|
if (n.get(3) !== t.databaseId.database) throw new U(A, "Tried to deserialize key from different database: " + n.get(3) + " vs " + t.databaseId.database);
|
|
2763
|
-
return new et((
|
|
2763
|
+
return new et((b((r = n).length > 4 && "documents" === r.get(4)), r.popFirst(5)));
|
|
2764
2764
|
var r;
|
|
2765
2765
|
/** Creates a Document proto from key and fields (but no create/update time) */}
|
|
2766
2766
|
|
|
@@ -2781,7 +2781,7 @@ function Ue(t, e, n) {
|
|
|
2781
2781
|
|
|
2782
2782
|
function ke(t, e) {
|
|
2783
2783
|
return "found" in e ? function(t, e) {
|
|
2784
|
-
|
|
2784
|
+
b(!!e.found), e.found.name, e.found.updateTime;
|
|
2785
2785
|
const n = Oe(t, e.found.name), r = Fe(e.found.updateTime), s = new Bt({
|
|
2786
2786
|
mapValue: {
|
|
2787
2787
|
fields: e.found.fields
|
|
@@ -2789,7 +2789,7 @@ function ke(t, e) {
|
|
|
2789
2789
|
});
|
|
2790
2790
|
return zt.newFoundDocument(n, r, s);
|
|
2791
2791
|
}(t, e) : "missing" in e ? function(t, e) {
|
|
2792
|
-
|
|
2792
|
+
b(!!e.missing), b(!!e.readTime);
|
|
2793
2793
|
const n = Oe(t, e.missing), r = Fe(e.readTime);
|
|
2794
2794
|
return zt.newNoDocument(n, r);
|
|
2795
2795
|
}(t, e) : g();
|
|
@@ -3130,14 +3130,14 @@ class Ke extends class {} {
|
|
|
3130
3130
|
// TODO(firestorexp): Make sure there is only one Datastore instance per
|
|
3131
3131
|
// firestore-exp client.
|
|
3132
3132
|
async function Je(t, e) {
|
|
3133
|
-
const n =
|
|
3133
|
+
const n = v(t), r = Le(n.q) + "/documents", s = {
|
|
3134
3134
|
writes: e.map((t => je(n.q, t)))
|
|
3135
3135
|
};
|
|
3136
3136
|
await n.m("Commit", r, s);
|
|
3137
3137
|
}
|
|
3138
3138
|
|
|
3139
3139
|
async function Xe(t, e) {
|
|
3140
|
-
const n =
|
|
3140
|
+
const n = v(t), r = Le(n.q) + "/documents", s = {
|
|
3141
3141
|
documents: e.map((t => qe(n.q, t)))
|
|
3142
3142
|
}, i = await n.T("BatchGetDocuments", r, s), o = new Map;
|
|
3143
3143
|
i.forEach((t => {
|
|
@@ -3147,12 +3147,12 @@ async function Xe(t, e) {
|
|
|
3147
3147
|
const u = [];
|
|
3148
3148
|
return e.forEach((t => {
|
|
3149
3149
|
const e = o.get(t.toString());
|
|
3150
|
-
|
|
3150
|
+
b(!!e), u.push(e);
|
|
3151
3151
|
})), u;
|
|
3152
3152
|
}
|
|
3153
3153
|
|
|
3154
3154
|
async function Ze(t, e) {
|
|
3155
|
-
const n =
|
|
3155
|
+
const n = v(t), r = Me(n.q, fe(e));
|
|
3156
3156
|
return (await n.T("RunQuery", r.parent, {
|
|
3157
3157
|
structuredQuery: r.structuredQuery
|
|
3158
3158
|
})).filter((t => !!t.document)).map((t => function(t, e, n) {
|
|
@@ -3319,7 +3319,7 @@ class nn {
|
|
|
3319
3319
|
case "gapi":
|
|
3320
3320
|
const e = t.client;
|
|
3321
3321
|
// Make sure this really is a Gapi client.
|
|
3322
|
-
return
|
|
3322
|
+
return b(!("object" != typeof e || null === e || !e.auth || !e.auth.getAuthHeaderValueForFirstParty)),
|
|
3323
3323
|
new Q(e, t.sessionIndex || "0", t.iamToken || null);
|
|
3324
3324
|
|
|
3325
3325
|
case "provider":
|
|
@@ -3780,7 +3780,7 @@ function wn(t, e, ...n) {
|
|
|
3780
3780
|
/**
|
|
3781
3781
|
* Sentinel values that can be used when writing document fields with `set()`
|
|
3782
3782
|
* or `update()`.
|
|
3783
|
-
*/ class
|
|
3783
|
+
*/ class bn {
|
|
3784
3784
|
/**
|
|
3785
3785
|
* @param _methodName - The public API endpoint that returns this class.
|
|
3786
3786
|
* @hideconstructor
|
|
@@ -3812,7 +3812,7 @@ function wn(t, e, ...n) {
|
|
|
3812
3812
|
*
|
|
3813
3813
|
* Latitude values are in the range of [-90, 90].
|
|
3814
3814
|
* Longitude values are in the range of [-180, 180].
|
|
3815
|
-
*/ class
|
|
3815
|
+
*/ class vn {
|
|
3816
3816
|
/**
|
|
3817
3817
|
* Creates a new immutable `GeoPoint` object with the provided latitude and
|
|
3818
3818
|
* longitude values.
|
|
@@ -4027,7 +4027,7 @@ function Vn(t) {
|
|
|
4027
4027
|
return new Tn(new Bt(u), c, a);
|
|
4028
4028
|
}
|
|
4029
4029
|
|
|
4030
|
-
class Nn extends
|
|
4030
|
+
class Nn extends bn {
|
|
4031
4031
|
_toFieldTransform(t) {
|
|
4032
4032
|
if (2 /* MergeSet */ !== t.tt) throw 1 /* Update */ === t.tt ? t.ut(`${this._methodName}() can only appear at the top level of your update data`) : t.ut(`${this._methodName}() cannot be used with set() unless you pass {merge:true}`);
|
|
4033
4033
|
// No transform to add for a delete, but we need to add it to our
|
|
@@ -4063,23 +4063,23 @@ class Nn extends vn {
|
|
|
4063
4063
|
}, e.databaseId, e.q, e.ignoreUndefinedProperties);
|
|
4064
4064
|
}
|
|
4065
4065
|
|
|
4066
|
-
class Sn extends
|
|
4066
|
+
class Sn extends bn {
|
|
4067
4067
|
_toFieldTransform(t) {
|
|
4068
|
-
return new
|
|
4068
|
+
return new be(t.path, new pe);
|
|
4069
4069
|
}
|
|
4070
4070
|
isEqual(t) {
|
|
4071
4071
|
return t instanceof Sn;
|
|
4072
4072
|
}
|
|
4073
4073
|
}
|
|
4074
4074
|
|
|
4075
|
-
class Fn extends
|
|
4075
|
+
class Fn extends bn {
|
|
4076
4076
|
constructor(t, e) {
|
|
4077
4077
|
super(t), this.lt = e;
|
|
4078
4078
|
}
|
|
4079
4079
|
_toFieldTransform(t) {
|
|
4080
4080
|
const e = $n(this, t,
|
|
4081
4081
|
/*array=*/ !0), n = this.lt.map((t => Un(t, e))), r = new ye(n);
|
|
4082
|
-
return new
|
|
4082
|
+
return new be(t.path, r);
|
|
4083
4083
|
}
|
|
4084
4084
|
isEqual(t) {
|
|
4085
4085
|
// TODO(mrschmidt): Implement isEquals
|
|
@@ -4087,14 +4087,14 @@ class Fn extends vn {
|
|
|
4087
4087
|
}
|
|
4088
4088
|
}
|
|
4089
4089
|
|
|
4090
|
-
class xn extends
|
|
4090
|
+
class xn extends bn {
|
|
4091
4091
|
constructor(t, e) {
|
|
4092
4092
|
super(t), this.lt = e;
|
|
4093
4093
|
}
|
|
4094
4094
|
_toFieldTransform(t) {
|
|
4095
4095
|
const e = $n(this, t,
|
|
4096
4096
|
/*array=*/ !0), n = this.lt.map((t => Un(t, e))), r = new _e(n);
|
|
4097
|
-
return new
|
|
4097
|
+
return new be(t.path, r);
|
|
4098
4098
|
}
|
|
4099
4099
|
isEqual(t) {
|
|
4100
4100
|
// TODO(mrschmidt): Implement isEquals
|
|
@@ -4102,13 +4102,13 @@ class xn extends vn {
|
|
|
4102
4102
|
}
|
|
4103
4103
|
}
|
|
4104
4104
|
|
|
4105
|
-
class qn extends
|
|
4105
|
+
class qn extends bn {
|
|
4106
4106
|
constructor(t, e) {
|
|
4107
4107
|
super(t), this.ft = e;
|
|
4108
4108
|
}
|
|
4109
4109
|
_toFieldTransform(t) {
|
|
4110
4110
|
const e = new ge(t.q, we(t.q, this.ft));
|
|
4111
|
-
return new
|
|
4111
|
+
return new be(t.path, e);
|
|
4112
4112
|
}
|
|
4113
4113
|
isEqual(t) {
|
|
4114
4114
|
// TODO(mrschmidt): Implement isEquals
|
|
@@ -4185,7 +4185,7 @@ class qn extends vn {
|
|
|
4185
4185
|
// Unwrap the API type from the Compat SDK. This will return the API type
|
|
4186
4186
|
// from firestore-exp.
|
|
4187
4187
|
t = getModularInstance(t))) return Mn("Unsupported field value:", e, t), kn(t, e);
|
|
4188
|
-
if (t instanceof
|
|
4188
|
+
if (t instanceof bn)
|
|
4189
4189
|
// FieldValues usually parse into transforms (except deleteField())
|
|
4190
4190
|
// in which case we do not want to include this field in our parsed data
|
|
4191
4191
|
// (as doing so will overwrite the field directly prior to the transform
|
|
@@ -4268,7 +4268,7 @@ class qn extends vn {
|
|
|
4268
4268
|
timestampValue: Ne(e.q, n)
|
|
4269
4269
|
};
|
|
4270
4270
|
}
|
|
4271
|
-
if (t instanceof
|
|
4271
|
+
if (t instanceof vn) return {
|
|
4272
4272
|
geoPointValue: {
|
|
4273
4273
|
latitude: t.latitude,
|
|
4274
4274
|
longitude: t.longitude
|
|
@@ -4314,7 +4314,7 @@ function kn(t, e) {
|
|
|
4314
4314
|
}
|
|
4315
4315
|
|
|
4316
4316
|
function jn(t) {
|
|
4317
|
-
return !("object" != typeof t || null === t || t instanceof Array || t instanceof Date || t instanceof gt || t instanceof
|
|
4317
|
+
return !("object" != typeof t || null === t || t instanceof Array || t instanceof Date || t instanceof gt || t instanceof vn || t instanceof gn || t instanceof an || t instanceof bn);
|
|
4318
4318
|
}
|
|
4319
4319
|
|
|
4320
4320
|
function Mn(t, e, n) {
|
|
@@ -4716,12 +4716,12 @@ class rr extends Zn {
|
|
|
4716
4716
|
|
|
4717
4717
|
class ir extends Zn {
|
|
4718
4718
|
constructor(t, e, n) {
|
|
4719
|
-
super(), this.type = t, this.gt = e, this.
|
|
4719
|
+
super(), this.type = t, this.gt = e, this.bt = n;
|
|
4720
4720
|
}
|
|
4721
4721
|
_apply(t) {
|
|
4722
4722
|
return new hn(t.firestore, t.converter, function(t, e, n) {
|
|
4723
4723
|
return new oe(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), e, n, t.startAt, t.endAt);
|
|
4724
|
-
}(t._query, this.gt, this.
|
|
4724
|
+
}(t._query, this.gt, this.bt));
|
|
4725
4725
|
}
|
|
4726
4726
|
}
|
|
4727
4727
|
|
|
@@ -4748,10 +4748,10 @@ class ir extends Zn {
|
|
|
4748
4748
|
|
|
4749
4749
|
class cr extends Zn {
|
|
4750
4750
|
constructor(t, e, n) {
|
|
4751
|
-
super(), this.type = t, this.
|
|
4751
|
+
super(), this.type = t, this.vt = e, this.Et = n;
|
|
4752
4752
|
}
|
|
4753
4753
|
_apply(t) {
|
|
4754
|
-
const e = wr(t, this.type, this.
|
|
4754
|
+
const e = wr(t, this.type, this.vt, this.Et);
|
|
4755
4755
|
return new hn(t.firestore, t.converter, function(t, e) {
|
|
4756
4756
|
return new oe(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), t.limit, t.limitType, e, t.endAt);
|
|
4757
4757
|
}(t._query, e));
|
|
@@ -4770,10 +4770,10 @@ function hr(...t) {
|
|
|
4770
4770
|
|
|
4771
4771
|
class lr extends Zn {
|
|
4772
4772
|
constructor(t, e, n) {
|
|
4773
|
-
super(), this.type = t, this.
|
|
4773
|
+
super(), this.type = t, this.vt = e, this.Et = n;
|
|
4774
4774
|
}
|
|
4775
4775
|
_apply(t) {
|
|
4776
|
-
const e = wr(t, this.type, this.
|
|
4776
|
+
const e = wr(t, this.type, this.vt, this.Et);
|
|
4777
4777
|
return new hn(t.firestore, t.converter, function(t, e) {
|
|
4778
4778
|
return new oe(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), t.limit, t.limitType, t.startAt, e);
|
|
4779
4779
|
}(t._query, e));
|
|
@@ -4972,7 +4972,7 @@ class gr extends class {
|
|
|
4972
4972
|
})), n;
|
|
4973
4973
|
}
|
|
4974
4974
|
convertGeoPoint(t) {
|
|
4975
|
-
return new
|
|
4975
|
+
return new vn(Pt(t.latitude), Pt(t.longitude));
|
|
4976
4976
|
}
|
|
4977
4977
|
convertArray(t, e) {
|
|
4978
4978
|
return (t.values || []).map((t => this.convertValue(t, e)));
|
|
@@ -4996,7 +4996,7 @@ class gr extends class {
|
|
|
4996
4996
|
}
|
|
4997
4997
|
convertDocumentKey(t, e) {
|
|
4998
4998
|
const n = X.fromString(t);
|
|
4999
|
-
|
|
4999
|
+
b(We(n));
|
|
5000
5000
|
const r = new K(n.get(1), n.get(3)), s = new et(n.popFirst(5));
|
|
5001
5001
|
return r.isEqual(e) ||
|
|
5002
5002
|
// TODO(b/64130202): Somehow support foreign references.
|
|
@@ -5028,10 +5028,10 @@ class gr extends class {
|
|
|
5028
5028
|
* @param reference - The reference of the document to fetch.
|
|
5029
5029
|
* @returns A Promise resolved with a `DocumentSnapshot` containing the current
|
|
5030
5030
|
* document contents.
|
|
5031
|
-
*/ function
|
|
5031
|
+
*/ function br(t) {
|
|
5032
5032
|
const e = en((t = ot(t, an)).firestore), n = new gr(t.firestore);
|
|
5033
5033
|
return Xe(e, [ t._key ]).then((e => {
|
|
5034
|
-
|
|
5034
|
+
b(1 === e.length);
|
|
5035
5035
|
const r = e[0];
|
|
5036
5036
|
return new Yn(t.firestore, n, t._key, r.isFoundDocument() ? r : null, t.converter);
|
|
5037
5037
|
}));
|
|
@@ -5048,7 +5048,7 @@ class gr extends class {
|
|
|
5048
5048
|
*
|
|
5049
5049
|
* @param query - The `Query` to execute.
|
|
5050
5050
|
* @returns A Promise that will be resolved with the results of the query.
|
|
5051
|
-
*/ function
|
|
5051
|
+
*/ function vr(t) {
|
|
5052
5052
|
!function(t) {
|
|
5053
5053
|
if (ue(t) && 0 === t.explicitOrderBy.length) throw new U(q, "limitToLast() queries require specifying at least one orderBy() clause");
|
|
5054
5054
|
}((t = ot(t, hn))._query);
|
|
@@ -5065,7 +5065,7 @@ class gr extends class {
|
|
|
5065
5065
|
|
|
5066
5066
|
function Er(t, e, n) {
|
|
5067
5067
|
const r = _r((t = ot(t, an)).converter, e, n), s = Dn(Vn(t.firestore), "setDoc", t._key, r, null !== t.converter, n);
|
|
5068
|
-
return Je(en(t.firestore), [ s.toMutation(t._key,
|
|
5068
|
+
return Je(en(t.firestore), [ s.toMutation(t._key, ve.none()) ]);
|
|
5069
5069
|
}
|
|
5070
5070
|
|
|
5071
5071
|
function Tr(t, e, n, ...r) {
|
|
@@ -5074,7 +5074,7 @@ function Tr(t, e, n, ...r) {
|
|
|
5074
5074
|
// performing validation.
|
|
5075
5075
|
let i;
|
|
5076
5076
|
i = "string" == typeof (e = getModularInstance(e)) || e instanceof yn ? Cn(s, "updateDoc", t._key, e, n, r) : On(s, "updateDoc", t._key, e);
|
|
5077
|
-
return Je(en(t.firestore), [ i.toMutation(t._key,
|
|
5077
|
+
return Je(en(t.firestore), [ i.toMutation(t._key, ve.exists(!0)) ]);
|
|
5078
5078
|
}
|
|
5079
5079
|
|
|
5080
5080
|
/**
|
|
@@ -5089,7 +5089,7 @@ function Tr(t, e, n, ...r) {
|
|
|
5089
5089
|
* @returns A `Promise` resolved once the document has been successfully
|
|
5090
5090
|
* deleted from the backend.
|
|
5091
5091
|
*/ function Ir(t) {
|
|
5092
|
-
return Je(en((t = ot(t, an)).firestore), [ new Ae(t._key,
|
|
5092
|
+
return Je(en((t = ot(t, an)).firestore), [ new Ae(t._key, ve.none()) ]);
|
|
5093
5093
|
}
|
|
5094
5094
|
|
|
5095
5095
|
/**
|
|
@@ -5108,7 +5108,7 @@ function Tr(t, e, n, ...r) {
|
|
|
5108
5108
|
* newly created document after it has been written to the backend.
|
|
5109
5109
|
*/ function Ar(t, e) {
|
|
5110
5110
|
const n = wn(t = ot(t, ln)), r = _r(t.converter, e), s = Dn(Vn(t.firestore), "addDoc", n._key, r, null !== n.converter, {});
|
|
5111
|
-
return Je(en(t.firestore), [ s.toMutation(n._key,
|
|
5111
|
+
return Je(en(t.firestore), [ s.toMutation(n._key, ve.exists(!1)) ]).then((() => n));
|
|
5112
5112
|
}
|
|
5113
5113
|
|
|
5114
5114
|
/**
|
|
@@ -5228,7 +5228,7 @@ function Tr(t, e, n, ...r) {
|
|
|
5228
5228
|
set(t, e, n) {
|
|
5229
5229
|
this._verifyNotCommitted();
|
|
5230
5230
|
const r = Sr(t, this._firestore), s = _r(r.converter, e, n), i = Dn(this._dataReader, "WriteBatch.set", r._key, s, null !== r.converter, n);
|
|
5231
|
-
return this._mutations.push(i.toMutation(r._key,
|
|
5231
|
+
return this._mutations.push(i.toMutation(r._key, ve.none())), this;
|
|
5232
5232
|
}
|
|
5233
5233
|
update(t, e, n, ...r) {
|
|
5234
5234
|
this._verifyNotCommitted();
|
|
@@ -5237,7 +5237,7 @@ function Tr(t, e, n, ...r) {
|
|
|
5237
5237
|
// performing validation.
|
|
5238
5238
|
let i;
|
|
5239
5239
|
return i = "string" == typeof (e = getModularInstance(e)) || e instanceof yn ? Cn(this._dataReader, "WriteBatch.update", s._key, e, n, r) : On(this._dataReader, "WriteBatch.update", s._key, e),
|
|
5240
|
-
this._mutations.push(i.toMutation(s._key,
|
|
5240
|
+
this._mutations.push(i.toMutation(s._key, ve.exists(!0))), this;
|
|
5241
5241
|
}
|
|
5242
5242
|
/**
|
|
5243
5243
|
* Deletes the document referred to by the provided {@link DocumentReference}.
|
|
@@ -5247,7 +5247,7 @@ function Tr(t, e, n, ...r) {
|
|
|
5247
5247
|
*/ delete(t) {
|
|
5248
5248
|
this._verifyNotCommitted();
|
|
5249
5249
|
const e = Sr(t, this._firestore);
|
|
5250
|
-
return this._mutations = this._mutations.concat(new Ae(e._key,
|
|
5250
|
+
return this._mutations = this._mutations.concat(new Ae(e._key, ve.none())), this;
|
|
5251
5251
|
}
|
|
5252
5252
|
/**
|
|
5253
5253
|
* Commits all of the writes in this write batch as a single atomic unit.
|
|
@@ -5365,7 +5365,7 @@ function Sr(t, e) {
|
|
|
5365
5365
|
if (t.isFoundDocument()) e = t.version; else {
|
|
5366
5366
|
if (!t.isNoDocument()) throw g();
|
|
5367
5367
|
// For deleted docs, we must use baseVersion 0 when we overwrite them.
|
|
5368
|
-
e =
|
|
5368
|
+
e = bt.min();
|
|
5369
5369
|
}
|
|
5370
5370
|
const n = this.readVersions.get(t.key.toString());
|
|
5371
5371
|
if (n) {
|
|
@@ -5379,7 +5379,7 @@ function Sr(t, e) {
|
|
|
5379
5379
|
* as a precondition, or no precondition if it was not read.
|
|
5380
5380
|
*/ precondition(t) {
|
|
5381
5381
|
const e = this.readVersions.get(t.toString());
|
|
5382
|
-
return !this.writtenDocs.has(t.toString()) && e ?
|
|
5382
|
+
return !this.writtenDocs.has(t.toString()) && e ? ve.updateTime(e) : ve.none();
|
|
5383
5383
|
}
|
|
5384
5384
|
/**
|
|
5385
5385
|
* Returns the precondition for a document if the operation is an update.
|
|
@@ -5388,7 +5388,7 @@ function Sr(t, e) {
|
|
|
5388
5388
|
// The first time a document is written, we want to take into account the
|
|
5389
5389
|
// read time and existence
|
|
5390
5390
|
if (!this.writtenDocs.has(t.toString()) && e) {
|
|
5391
|
-
if (e.isEqual(
|
|
5391
|
+
if (e.isEqual(bt.min()))
|
|
5392
5392
|
// The document doesn't exist, so fail the transaction.
|
|
5393
5393
|
// This has to be validated locally because you can't send a
|
|
5394
5394
|
// precondition that a document does not exist without changing the
|
|
@@ -5400,11 +5400,11 @@ function Sr(t, e) {
|
|
|
5400
5400
|
// transaction.
|
|
5401
5401
|
throw new U(A, "Can't update a document that doesn't exist.");
|
|
5402
5402
|
// Document exists, base precondition on document update time.
|
|
5403
|
-
return
|
|
5403
|
+
return ve.updateTime(e);
|
|
5404
5404
|
}
|
|
5405
5405
|
// Document was not read, so we just use the preconditions for a blind
|
|
5406
5406
|
// update.
|
|
5407
|
-
return
|
|
5407
|
+
return ve.exists(!0);
|
|
5408
5408
|
}
|
|
5409
5409
|
write(t) {
|
|
5410
5410
|
this.ensureCommitNotCalled(), this.mutations.push(t);
|
|
@@ -5952,7 +5952,7 @@ class Ur {
|
|
|
5952
5952
|
return e && r._setSettings(e), r;
|
|
5953
5953
|
}), "PUBLIC")),
|
|
5954
5954
|
// RUNTIME_ENV and BUILD_TARGET are replaced by real values during the compilation
|
|
5955
|
-
registerVersion("firestore-lite", "3.4.4-canary.
|
|
5955
|
+
registerVersion("firestore-lite", "3.4.4-canary.e9619685b", ""), registerVersion("firestore-lite", "3.4.4-canary.e9619685b", "esm2017");
|
|
5956
5956
|
|
|
5957
|
-
export { gn as Bytes, ln as CollectionReference, an as DocumentReference, Yn as DocumentSnapshot, yn as FieldPath,
|
|
5957
|
+
export { gn as Bytes, ln as CollectionReference, an as DocumentReference, Yn as DocumentSnapshot, yn as FieldPath, bn as FieldValue, rn as Firestore, U as FirestoreError, vn as GeoPoint, hn as Query, Zn as QueryConstraint, Hn as QueryDocumentSnapshot, Kn as QuerySnapshot, gt as Timestamp, Ur as Transaction, $r as WriteBatch, Ar as addDoc, Dr as arrayRemove, Vr as arrayUnion, fn as collection, dn as collectionGroup, un as connectFirestoreEmulator, Ir as deleteDoc, Rr as deleteField, wn as doc, _n as documentId, dr as endAt, fr as endBefore, br as getDoc, vr as getDocs, on as getFirestore, Nr as increment, sn as initializeFirestore, or as limit, ur as limitToLast, sr as orderBy, tr as query, pn as queryEqual, mn as refEqual, kr as runTransaction, Pr as serverTimestamp, Er as setDoc, w as setLogLevel, Jn as snapshotEqual, hr as startAfter, ar as startAt, cn as terminate, Tr as updateDoc, nr as where, Fr as writeBatch };
|
|
5958
5958
|
//# sourceMappingURL=index.browser.esm2017.js.map
|