@firebase/firestore 3.4.8-canary.477815d4e → 3.4.8-canary.69baecadd
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.esm2017.js +133 -133
- package/dist/index.esm2017.js.map +1 -1
- package/dist/index.esm5.js +56 -56
- package/dist/index.esm5.js.map +1 -1
- package/dist/index.node.cjs.js +2 -2
- package/dist/index.node.mjs +2 -2
- package/dist/index.node.mjs.map +1 -1
- package/dist/index.rn.js +3 -3
- package/dist/lite/index.browser.esm2017.js +73 -73
- package/dist/lite/index.browser.esm2017.js.map +1 -1
- package/dist/lite/index.browser.esm5.js +8 -8
- package/dist/lite/index.browser.esm5.js.map +1 -1
- package/dist/lite/index.node.cjs.js +2 -2
- package/dist/lite/index.node.mjs +2 -2
- package/dist/lite/index.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/packages/firestore/dist/index.esm2017.d.ts +11 -11
- package/package.json +9 -9
package/dist/index.rn.js
CHANGED
|
@@ -70,7 +70,7 @@ x.MOCK_USER = new x("mock-user");
|
|
|
70
70
|
* See the License for the specific language governing permissions and
|
|
71
71
|
* limitations under the License.
|
|
72
72
|
*/
|
|
73
|
-
let N = "9.
|
|
73
|
+
let N = "9.7.0-canary.69baecadd";
|
|
74
74
|
|
|
75
75
|
/**
|
|
76
76
|
* @license
|
|
@@ -19219,9 +19219,9 @@ function bl(t, e) {
|
|
|
19219
19219
|
return n = Object.assign({
|
|
19220
19220
|
useFetchStreams: e
|
|
19221
19221
|
}, n), i._setSettings(n), i;
|
|
19222
|
-
}), "PUBLIC")), s(C, "3.4.8-canary.
|
|
19222
|
+
}), "PUBLIC")), s(C, "3.4.8-canary.69baecadd", t),
|
|
19223
19223
|
// BUILD_TARGET will be replaced by values like esm5, esm2017, cjs5, etc during the compilation
|
|
19224
|
-
s(C, "3.4.8-canary.
|
|
19224
|
+
s(C, "3.4.8-canary.69baecadd", "esm2017");
|
|
19225
19225
|
}("rn", /* useFetchStreams= */ !1);
|
|
19226
19226
|
|
|
19227
19227
|
export { Yh as AbstractUserDataWriter, Wc as Bytes, vc as CACHE_SIZE_UNLIMITED, pc as CollectionReference, gc as DocumentReference, bh as DocumentSnapshot, Qc as FieldPath, zc as FieldValue, Sc as Firestore, j as FirestoreError, Hc as GeoPoint, Vc as LoadBundleTask, yc as Query, xh as QueryConstraint, Vh as QueryDocumentSnapshot, vh as QuerySnapshot, Ph as SnapshotMetadata, ct as Timestamp, gl as Transaction, tl as WriteBatch, Dt as _DatabaseId, kt as _DocumentKey, nt as _EmptyAppCheckTokenProvider, H as _EmptyAuthCredentialsProvider, gt as _FieldPath, fc as _cast, K as _debugAssert, It as _isBase64Available, B as _logWarn, Pl as _setIndexConfiguration, ac as _validateIsNotUsedTogether, fl as addDoc, El as arrayRemove, Tl as arrayUnion, Fc as clearIndexedDbPersistence, Ic as collection, Tc as collectionGroup, mc as connectFirestoreEmulator, ll as deleteDoc, pl as deleteField, Lc as disableNetwork, Ec as doc, jc as documentId, kc as enableIndexedDbPersistence, Mc as enableMultiTabIndexedDbPersistence, Bc as enableNetwork, jh as endAt, Qh as endBefore, xc as ensureFirestoreConfigured, wl as executeWrite, nl as getDoc, il as getDocFromCache, rl as getDocFromServer, ol as getDocs, ul as getDocsFromCache, al as getDocsFromServer, Cc as getFirestore, Al as increment, Dc as initializeFirestore, Bh as limit, Lh as limitToLast, qc as loadBundle, Kc as namedQuery, dl as onSnapshot, _l as onSnapshotsInSync, Fh as orderBy, Nh as query, Rc as queryEqual, Ac as refEqual, yl as runTransaction, Il as serverTimestamp, cl as setDoc, O as setLogLevel, Dh as snapshotEqual, Kh as startAfter, qh as startAt, Uc as terminate, hl as updateDoc, $c as waitForPendingWrites, Mh as where, Rl as writeBatch };
|
|
@@ -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.
|
|
66
|
+
let f = "9.7.0-canary.69baecadd";
|
|
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() {}
|
|
@@ -1320,18 +1320,18 @@ class gt {
|
|
|
1320
1320
|
/**
|
|
1321
1321
|
* A version of a document in Firestore. This corresponds to the version
|
|
1322
1322
|
* timestamp, such as update_time or read_time.
|
|
1323
|
-
*/ class
|
|
1323
|
+
*/ class bt {
|
|
1324
1324
|
constructor(t) {
|
|
1325
1325
|
this.timestamp = t;
|
|
1326
1326
|
}
|
|
1327
1327
|
static fromTimestamp(t) {
|
|
1328
|
-
return new
|
|
1328
|
+
return new bt(t);
|
|
1329
1329
|
}
|
|
1330
1330
|
static min() {
|
|
1331
|
-
return new
|
|
1331
|
+
return new bt(new gt(0, 0));
|
|
1332
1332
|
}
|
|
1333
1333
|
static max() {
|
|
1334
|
-
return new
|
|
1334
|
+
return new bt(new gt(253402300799, 999999999));
|
|
1335
1335
|
}
|
|
1336
1336
|
compareTo(t) {
|
|
1337
1337
|
return this.timestamp._compareTo(t.timestamp);
|
|
@@ -1366,7 +1366,7 @@ class gt {
|
|
|
1366
1366
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1367
1367
|
* See the License for the specific language governing permissions and
|
|
1368
1368
|
* limitations under the License.
|
|
1369
|
-
*/ function
|
|
1369
|
+
*/ function vt(t) {
|
|
1370
1370
|
let e = 0;
|
|
1371
1371
|
for (const n in t) Object.prototype.hasOwnProperty.call(t, n) && e++;
|
|
1372
1372
|
return e;
|
|
@@ -1554,13 +1554,13 @@ const At = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
|
|
|
1554
1554
|
// The json interface (for the browser) will return an iso timestamp string,
|
|
1555
1555
|
// while the proto js library (for node) will return a
|
|
1556
1556
|
// google.protobuf.Timestamp instance.
|
|
1557
|
-
if (
|
|
1557
|
+
if (b(!!t), "string" == typeof t) {
|
|
1558
1558
|
// The date string can have higher precision (nanos) than the Date class
|
|
1559
1559
|
// (millis), so we do some custom parsing here.
|
|
1560
1560
|
// Parse the nanos right out of the string.
|
|
1561
1561
|
let e = 0;
|
|
1562
1562
|
const n = At.exec(t);
|
|
1563
|
-
if (
|
|
1563
|
+
if (b(!!n), n[1]) {
|
|
1564
1564
|
// Pad the fraction out to 9 digits (nanos).
|
|
1565
1565
|
let t = n[1];
|
|
1566
1566
|
t = (t + "000000000").substr(0, 9), e = Number(t);
|
|
@@ -1753,7 +1753,7 @@ function Ft(t) {
|
|
|
1753
1753
|
case 10 /* ObjectValue */ :
|
|
1754
1754
|
return function(t, e) {
|
|
1755
1755
|
const n = t.mapValue.fields || {}, r = e.mapValue.fields || {};
|
|
1756
|
-
if (
|
|
1756
|
+
if (vt(n) !== vt(r)) return !1;
|
|
1757
1757
|
for (const t in n) if (n.hasOwnProperty(t) && (void 0 === r[t] || !xt(n[t], r[t]))) return !1;
|
|
1758
1758
|
return !0;
|
|
1759
1759
|
}
|
|
@@ -2035,23 +2035,23 @@ class zt {
|
|
|
2035
2035
|
* Creates a document with no known version or data, but which can serve as
|
|
2036
2036
|
* base document for mutations.
|
|
2037
2037
|
*/ static newInvalidDocument(t) {
|
|
2038
|
-
return new Gt(t, 0 /* INVALID */ ,
|
|
2038
|
+
return new Gt(t, 0 /* INVALID */ , bt.min(), bt.min(), zt.empty(), 0 /* SYNCED */);
|
|
2039
2039
|
}
|
|
2040
2040
|
/**
|
|
2041
2041
|
* Creates a new document that is known to exist with the given data at the
|
|
2042
2042
|
* given version.
|
|
2043
2043
|
*/ static newFoundDocument(t, e, n) {
|
|
2044
|
-
return new Gt(t, 1 /* FOUND_DOCUMENT */ , e,
|
|
2044
|
+
return new Gt(t, 1 /* FOUND_DOCUMENT */ , e, bt.min(), n, 0 /* SYNCED */);
|
|
2045
2045
|
}
|
|
2046
2046
|
/** Creates a new document that is known to not exist at the given version. */ static newNoDocument(t, e) {
|
|
2047
|
-
return new Gt(t, 2 /* NO_DOCUMENT */ , e,
|
|
2047
|
+
return new Gt(t, 2 /* NO_DOCUMENT */ , e, bt.min(), zt.empty(), 0 /* SYNCED */);
|
|
2048
2048
|
}
|
|
2049
2049
|
/**
|
|
2050
2050
|
* Creates a new document that is known to exist at the given version but
|
|
2051
2051
|
* whose data is not known (e.g. a document that was updated without a known
|
|
2052
2052
|
* base document).
|
|
2053
2053
|
*/ static newUnknownDocument(t, e) {
|
|
2054
|
-
return new Gt(t, 3 /* UNKNOWN_DOCUMENT */ , e,
|
|
2054
|
+
return new Gt(t, 3 /* UNKNOWN_DOCUMENT */ , e, bt.min(), zt.empty(), 2 /* HAS_COMMITTED_MUTATIONS */);
|
|
2055
2055
|
}
|
|
2056
2056
|
/**
|
|
2057
2057
|
* Changes the document type to indicate that it exists and that its version
|
|
@@ -2377,7 +2377,7 @@ function he(t) {
|
|
|
2377
2377
|
* which can be different from the order by constraints the user provided (e.g.
|
|
2378
2378
|
* the SDK and backend always orders by `__name__`).
|
|
2379
2379
|
*/ function le(t) {
|
|
2380
|
-
const e =
|
|
2380
|
+
const e = v(t);
|
|
2381
2381
|
if (null === e.$) {
|
|
2382
2382
|
e.$ = [];
|
|
2383
2383
|
const t = ae(e), n = ce(e);
|
|
@@ -2402,7 +2402,7 @@ function he(t) {
|
|
|
2402
2402
|
/**
|
|
2403
2403
|
* Converts this `Query` instance to it's corresponding `Target` representation.
|
|
2404
2404
|
*/ function fe(t) {
|
|
2405
|
-
const e =
|
|
2405
|
+
const e = v(t);
|
|
2406
2406
|
if (!e.S) if ("F" /* First */ === e.limitType) e.S = Wt(e.path, e.collectionGroup, le(e), e.filters, e.limit, e.startAt, e.endAt); else {
|
|
2407
2407
|
// Flip the orderBy directions since we want the last results
|
|
2408
2408
|
const t = [];
|
|
@@ -2550,7 +2550,7 @@ function we(t, e) {
|
|
|
2550
2550
|
* See the License for the specific language governing permissions and
|
|
2551
2551
|
* limitations under the License.
|
|
2552
2552
|
*/
|
|
2553
|
-
/** A field path and the TransformOperation to perform upon it. */ class
|
|
2553
|
+
/** A field path and the TransformOperation to perform upon it. */ class be {
|
|
2554
2554
|
constructor(t, e) {
|
|
2555
2555
|
this.field = t, this.transform = e;
|
|
2556
2556
|
}
|
|
@@ -2560,18 +2560,18 @@ function we(t, e) {
|
|
|
2560
2560
|
* Encodes a precondition for a mutation. This follows the model that the
|
|
2561
2561
|
* backend accepts with the special case of an explicit "empty" precondition
|
|
2562
2562
|
* (meaning no precondition).
|
|
2563
|
-
*/ class
|
|
2563
|
+
*/ class ve {
|
|
2564
2564
|
constructor(t, e) {
|
|
2565
2565
|
this.updateTime = t, this.exists = e;
|
|
2566
2566
|
}
|
|
2567
2567
|
/** Creates a new empty Precondition. */ static none() {
|
|
2568
|
-
return new
|
|
2568
|
+
return new ve;
|
|
2569
2569
|
}
|
|
2570
2570
|
/** Creates a new Precondition with an exists flag. */ static exists(t) {
|
|
2571
|
-
return new
|
|
2571
|
+
return new ve(void 0, t);
|
|
2572
2572
|
}
|
|
2573
2573
|
/** Creates a new Precondition based on a version a document exists at. */ static updateTime(t) {
|
|
2574
|
-
return new
|
|
2574
|
+
return new ve(t);
|
|
2575
2575
|
}
|
|
2576
2576
|
/** Returns whether this Precondition is empty. */ get isNone() {
|
|
2577
2577
|
return void 0 === this.updateTime && void 0 === this.exists;
|
|
@@ -2765,7 +2765,7 @@ function Se(t, e) {
|
|
|
2765
2765
|
}
|
|
2766
2766
|
|
|
2767
2767
|
function Fe(t) {
|
|
2768
|
-
return
|
|
2768
|
+
return b(!!t), bt.fromTimestamp(function(t) {
|
|
2769
2769
|
const e = Rt(t);
|
|
2770
2770
|
return new gt(e.seconds, e.nanos);
|
|
2771
2771
|
}(t));
|
|
@@ -2784,11 +2784,11 @@ function qe(t, e) {
|
|
|
2784
2784
|
function Oe(t, e) {
|
|
2785
2785
|
const n = function(t) {
|
|
2786
2786
|
const e = X.fromString(t);
|
|
2787
|
-
return
|
|
2787
|
+
return b(We(e)), e;
|
|
2788
2788
|
}(e);
|
|
2789
2789
|
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);
|
|
2790
2790
|
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);
|
|
2791
|
-
return new et((
|
|
2791
|
+
return new et((b((r = n).length > 4 && "documents" === r.get(4)), r.popFirst(5)));
|
|
2792
2792
|
var r;
|
|
2793
2793
|
/** Creates a Document proto from key and fields (but no create/update time) */}
|
|
2794
2794
|
|
|
@@ -2809,7 +2809,7 @@ function Ue(t, e, n) {
|
|
|
2809
2809
|
|
|
2810
2810
|
function ke(t, e) {
|
|
2811
2811
|
return "found" in e ? function(t, e) {
|
|
2812
|
-
|
|
2812
|
+
b(!!e.found), e.found.name, e.found.updateTime;
|
|
2813
2813
|
const n = Oe(t, e.found.name), r = Fe(e.found.updateTime), s = new zt({
|
|
2814
2814
|
mapValue: {
|
|
2815
2815
|
fields: e.found.fields
|
|
@@ -2817,7 +2817,7 @@ function ke(t, e) {
|
|
|
2817
2817
|
});
|
|
2818
2818
|
return Gt.newFoundDocument(n, r, s);
|
|
2819
2819
|
}(t, e) : "missing" in e ? function(t, e) {
|
|
2820
|
-
|
|
2820
|
+
b(!!e.missing), b(!!e.readTime);
|
|
2821
2821
|
const n = Oe(t, e.missing), r = Fe(e.readTime);
|
|
2822
2822
|
return Gt.newNoDocument(n, r);
|
|
2823
2823
|
}(t, e) : g();
|
|
@@ -3158,14 +3158,14 @@ class Ke extends class {} {
|
|
|
3158
3158
|
// TODO(firestorexp): Make sure there is only one Datastore instance per
|
|
3159
3159
|
// firestore-exp client.
|
|
3160
3160
|
async function Je(t, e) {
|
|
3161
|
-
const n =
|
|
3161
|
+
const n = v(t), r = Le(n.q) + "/documents", s = {
|
|
3162
3162
|
writes: e.map((t => je(n.q, t)))
|
|
3163
3163
|
};
|
|
3164
3164
|
await n.m("Commit", r, s);
|
|
3165
3165
|
}
|
|
3166
3166
|
|
|
3167
3167
|
async function Xe(t, e) {
|
|
3168
|
-
const n =
|
|
3168
|
+
const n = v(t), r = Le(n.q) + "/documents", s = {
|
|
3169
3169
|
documents: e.map((t => qe(n.q, t)))
|
|
3170
3170
|
}, i = await n.T("BatchGetDocuments", r, s), o = new Map;
|
|
3171
3171
|
i.forEach((t => {
|
|
@@ -3175,12 +3175,12 @@ async function Xe(t, e) {
|
|
|
3175
3175
|
const u = [];
|
|
3176
3176
|
return e.forEach((t => {
|
|
3177
3177
|
const e = o.get(t.toString());
|
|
3178
|
-
|
|
3178
|
+
b(!!e), u.push(e);
|
|
3179
3179
|
})), u;
|
|
3180
3180
|
}
|
|
3181
3181
|
|
|
3182
3182
|
async function Ze(t, e) {
|
|
3183
|
-
const n =
|
|
3183
|
+
const n = v(t), r = Me(n.q, fe(e));
|
|
3184
3184
|
return (await n.T("RunQuery", r.parent, {
|
|
3185
3185
|
structuredQuery: r.structuredQuery
|
|
3186
3186
|
})).filter((t => !!t.document)).map((t => function(t, e, n) {
|
|
@@ -3347,7 +3347,7 @@ class nn {
|
|
|
3347
3347
|
case "gapi":
|
|
3348
3348
|
const e = t.client;
|
|
3349
3349
|
// Make sure this really is a Gapi client.
|
|
3350
|
-
return
|
|
3350
|
+
return b(!("object" != typeof e || null === e || !e.auth || !e.auth.getAuthHeaderValueForFirstParty)),
|
|
3351
3351
|
new Q(e, t.sessionIndex || "0", t.iamToken || null);
|
|
3352
3352
|
|
|
3353
3353
|
case "provider":
|
|
@@ -3808,7 +3808,7 @@ function wn(t, e, ...n) {
|
|
|
3808
3808
|
/**
|
|
3809
3809
|
* Sentinel values that can be used when writing document fields with `set()`
|
|
3810
3810
|
* or `update()`.
|
|
3811
|
-
*/ class
|
|
3811
|
+
*/ class bn {
|
|
3812
3812
|
/**
|
|
3813
3813
|
* @param _methodName - The public API endpoint that returns this class.
|
|
3814
3814
|
* @hideconstructor
|
|
@@ -3840,7 +3840,7 @@ function wn(t, e, ...n) {
|
|
|
3840
3840
|
*
|
|
3841
3841
|
* Latitude values are in the range of [-90, 90].
|
|
3842
3842
|
* Longitude values are in the range of [-180, 180].
|
|
3843
|
-
*/ class
|
|
3843
|
+
*/ class vn {
|
|
3844
3844
|
/**
|
|
3845
3845
|
* Creates a new immutable `GeoPoint` object with the provided latitude and
|
|
3846
3846
|
* longitude values.
|
|
@@ -4055,7 +4055,7 @@ function Vn(t) {
|
|
|
4055
4055
|
return new Tn(new zt(u), c, a);
|
|
4056
4056
|
}
|
|
4057
4057
|
|
|
4058
|
-
class Nn extends
|
|
4058
|
+
class Nn extends bn {
|
|
4059
4059
|
_toFieldTransform(t) {
|
|
4060
4060
|
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}`);
|
|
4061
4061
|
// No transform to add for a delete, but we need to add it to our
|
|
@@ -4091,23 +4091,23 @@ class Nn extends vn {
|
|
|
4091
4091
|
}, e.databaseId, e.q, e.ignoreUndefinedProperties);
|
|
4092
4092
|
}
|
|
4093
4093
|
|
|
4094
|
-
class Sn extends
|
|
4094
|
+
class Sn extends bn {
|
|
4095
4095
|
_toFieldTransform(t) {
|
|
4096
|
-
return new
|
|
4096
|
+
return new be(t.path, new pe);
|
|
4097
4097
|
}
|
|
4098
4098
|
isEqual(t) {
|
|
4099
4099
|
return t instanceof Sn;
|
|
4100
4100
|
}
|
|
4101
4101
|
}
|
|
4102
4102
|
|
|
4103
|
-
class Fn extends
|
|
4103
|
+
class Fn extends bn {
|
|
4104
4104
|
constructor(t, e) {
|
|
4105
4105
|
super(t), this.lt = e;
|
|
4106
4106
|
}
|
|
4107
4107
|
_toFieldTransform(t) {
|
|
4108
4108
|
const e = $n(this, t,
|
|
4109
4109
|
/*array=*/ !0), n = this.lt.map((t => Un(t, e))), r = new ye(n);
|
|
4110
|
-
return new
|
|
4110
|
+
return new be(t.path, r);
|
|
4111
4111
|
}
|
|
4112
4112
|
isEqual(t) {
|
|
4113
4113
|
// TODO(mrschmidt): Implement isEquals
|
|
@@ -4115,14 +4115,14 @@ class Fn extends vn {
|
|
|
4115
4115
|
}
|
|
4116
4116
|
}
|
|
4117
4117
|
|
|
4118
|
-
class xn extends
|
|
4118
|
+
class xn extends bn {
|
|
4119
4119
|
constructor(t, e) {
|
|
4120
4120
|
super(t), this.lt = e;
|
|
4121
4121
|
}
|
|
4122
4122
|
_toFieldTransform(t) {
|
|
4123
4123
|
const e = $n(this, t,
|
|
4124
4124
|
/*array=*/ !0), n = this.lt.map((t => Un(t, e))), r = new _e(n);
|
|
4125
|
-
return new
|
|
4125
|
+
return new be(t.path, r);
|
|
4126
4126
|
}
|
|
4127
4127
|
isEqual(t) {
|
|
4128
4128
|
// TODO(mrschmidt): Implement isEquals
|
|
@@ -4130,13 +4130,13 @@ class xn extends vn {
|
|
|
4130
4130
|
}
|
|
4131
4131
|
}
|
|
4132
4132
|
|
|
4133
|
-
class qn extends
|
|
4133
|
+
class qn extends bn {
|
|
4134
4134
|
constructor(t, e) {
|
|
4135
4135
|
super(t), this.ft = e;
|
|
4136
4136
|
}
|
|
4137
4137
|
_toFieldTransform(t) {
|
|
4138
4138
|
const e = new ge(t.q, we(t.q, this.ft));
|
|
4139
|
-
return new
|
|
4139
|
+
return new be(t.path, e);
|
|
4140
4140
|
}
|
|
4141
4141
|
isEqual(t) {
|
|
4142
4142
|
// TODO(mrschmidt): Implement isEquals
|
|
@@ -4213,7 +4213,7 @@ class qn extends vn {
|
|
|
4213
4213
|
// Unwrap the API type from the Compat SDK. This will return the API type
|
|
4214
4214
|
// from firestore-exp.
|
|
4215
4215
|
t = getModularInstance(t))) return Mn("Unsupported field value:", e, t), kn(t, e);
|
|
4216
|
-
if (t instanceof
|
|
4216
|
+
if (t instanceof bn)
|
|
4217
4217
|
// FieldValues usually parse into transforms (except deleteField())
|
|
4218
4218
|
// in which case we do not want to include this field in our parsed data
|
|
4219
4219
|
// (as doing so will overwrite the field directly prior to the transform
|
|
@@ -4296,7 +4296,7 @@ class qn extends vn {
|
|
|
4296
4296
|
timestampValue: Ne(e.q, n)
|
|
4297
4297
|
};
|
|
4298
4298
|
}
|
|
4299
|
-
if (t instanceof
|
|
4299
|
+
if (t instanceof vn) return {
|
|
4300
4300
|
geoPointValue: {
|
|
4301
4301
|
latitude: t.latitude,
|
|
4302
4302
|
longitude: t.longitude
|
|
@@ -4342,7 +4342,7 @@ function kn(t, e) {
|
|
|
4342
4342
|
}
|
|
4343
4343
|
|
|
4344
4344
|
function jn(t) {
|
|
4345
|
-
return !("object" != typeof t || null === t || t instanceof Array || t instanceof Date || t instanceof gt || t instanceof
|
|
4345
|
+
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);
|
|
4346
4346
|
}
|
|
4347
4347
|
|
|
4348
4348
|
function Mn(t, e, n) {
|
|
@@ -4744,12 +4744,12 @@ class rr extends Zn {
|
|
|
4744
4744
|
|
|
4745
4745
|
class ir extends Zn {
|
|
4746
4746
|
constructor(t, e, n) {
|
|
4747
|
-
super(), this.type = t, this.gt = e, this.
|
|
4747
|
+
super(), this.type = t, this.gt = e, this.bt = n;
|
|
4748
4748
|
}
|
|
4749
4749
|
_apply(t) {
|
|
4750
4750
|
return new hn(t.firestore, t.converter, function(t, e, n) {
|
|
4751
4751
|
return new ue(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), e, n, t.startAt, t.endAt);
|
|
4752
|
-
}(t._query, this.gt, this.
|
|
4752
|
+
}(t._query, this.gt, this.bt));
|
|
4753
4753
|
}
|
|
4754
4754
|
}
|
|
4755
4755
|
|
|
@@ -4776,10 +4776,10 @@ class ir extends Zn {
|
|
|
4776
4776
|
|
|
4777
4777
|
class cr extends Zn {
|
|
4778
4778
|
constructor(t, e, n) {
|
|
4779
|
-
super(), this.type = t, this.
|
|
4779
|
+
super(), this.type = t, this.vt = e, this.Et = n;
|
|
4780
4780
|
}
|
|
4781
4781
|
_apply(t) {
|
|
4782
|
-
const e = wr(t, this.type, this.
|
|
4782
|
+
const e = wr(t, this.type, this.vt, this.Et);
|
|
4783
4783
|
return new hn(t.firestore, t.converter, function(t, e) {
|
|
4784
4784
|
return new ue(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), t.limit, t.limitType, e, t.endAt);
|
|
4785
4785
|
}(t._query, e));
|
|
@@ -4798,10 +4798,10 @@ function hr(...t) {
|
|
|
4798
4798
|
|
|
4799
4799
|
class lr extends Zn {
|
|
4800
4800
|
constructor(t, e, n) {
|
|
4801
|
-
super(), this.type = t, this.
|
|
4801
|
+
super(), this.type = t, this.vt = e, this.Et = n;
|
|
4802
4802
|
}
|
|
4803
4803
|
_apply(t) {
|
|
4804
|
-
const e = wr(t, this.type, this.
|
|
4804
|
+
const e = wr(t, this.type, this.vt, this.Et);
|
|
4805
4805
|
return new hn(t.firestore, t.converter, function(t, e) {
|
|
4806
4806
|
return new ue(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), t.limit, t.limitType, t.startAt, e);
|
|
4807
4807
|
}(t._query, e));
|
|
@@ -5000,7 +5000,7 @@ class gr extends class {
|
|
|
5000
5000
|
})), n;
|
|
5001
5001
|
}
|
|
5002
5002
|
convertGeoPoint(t) {
|
|
5003
|
-
return new
|
|
5003
|
+
return new vn(Pt(t.latitude), Pt(t.longitude));
|
|
5004
5004
|
}
|
|
5005
5005
|
convertArray(t, e) {
|
|
5006
5006
|
return (t.values || []).map((t => this.convertValue(t, e)));
|
|
@@ -5024,7 +5024,7 @@ class gr extends class {
|
|
|
5024
5024
|
}
|
|
5025
5025
|
convertDocumentKey(t, e) {
|
|
5026
5026
|
const n = X.fromString(t);
|
|
5027
|
-
|
|
5027
|
+
b(We(n));
|
|
5028
5028
|
const r = new K(n.get(1), n.get(3)), s = new et(n.popFirst(5));
|
|
5029
5029
|
return r.isEqual(e) ||
|
|
5030
5030
|
// TODO(b/64130202): Somehow support foreign references.
|
|
@@ -5056,10 +5056,10 @@ class gr extends class {
|
|
|
5056
5056
|
* @param reference - The reference of the document to fetch.
|
|
5057
5057
|
* @returns A Promise resolved with a `DocumentSnapshot` containing the current
|
|
5058
5058
|
* document contents.
|
|
5059
|
-
*/ function
|
|
5059
|
+
*/ function br(t) {
|
|
5060
5060
|
const e = en((t = ot(t, an)).firestore), n = new gr(t.firestore);
|
|
5061
5061
|
return Xe(e, [ t._key ]).then((e => {
|
|
5062
|
-
|
|
5062
|
+
b(1 === e.length);
|
|
5063
5063
|
const r = e[0];
|
|
5064
5064
|
return new Yn(t.firestore, n, t._key, r.isFoundDocument() ? r : null, t.converter);
|
|
5065
5065
|
}));
|
|
@@ -5076,7 +5076,7 @@ class gr extends class {
|
|
|
5076
5076
|
*
|
|
5077
5077
|
* @param query - The `Query` to execute.
|
|
5078
5078
|
* @returns A Promise that will be resolved with the results of the query.
|
|
5079
|
-
*/ function
|
|
5079
|
+
*/ function vr(t) {
|
|
5080
5080
|
!function(t) {
|
|
5081
5081
|
if ("L" /* Last */ === t.limitType && 0 === t.explicitOrderBy.length) throw new U(q, "limitToLast() queries require specifying at least one orderBy() clause");
|
|
5082
5082
|
}((t = ot(t, hn))._query);
|
|
@@ -5093,7 +5093,7 @@ class gr extends class {
|
|
|
5093
5093
|
|
|
5094
5094
|
function Er(t, e, n) {
|
|
5095
5095
|
const r = _r((t = ot(t, an)).converter, e, n), s = Dn(Vn(t.firestore), "setDoc", t._key, r, null !== t.converter, n);
|
|
5096
|
-
return Je(en(t.firestore), [ s.toMutation(t._key,
|
|
5096
|
+
return Je(en(t.firestore), [ s.toMutation(t._key, ve.none()) ]);
|
|
5097
5097
|
}
|
|
5098
5098
|
|
|
5099
5099
|
function Tr(t, e, n, ...r) {
|
|
@@ -5102,7 +5102,7 @@ function Tr(t, e, n, ...r) {
|
|
|
5102
5102
|
// performing validation.
|
|
5103
5103
|
let i;
|
|
5104
5104
|
i = "string" == typeof (e = getModularInstance(e)) || e instanceof yn ? Cn(s, "updateDoc", t._key, e, n, r) : On(s, "updateDoc", t._key, e);
|
|
5105
|
-
return Je(en(t.firestore), [ i.toMutation(t._key,
|
|
5105
|
+
return Je(en(t.firestore), [ i.toMutation(t._key, ve.exists(!0)) ]);
|
|
5106
5106
|
}
|
|
5107
5107
|
|
|
5108
5108
|
/**
|
|
@@ -5117,7 +5117,7 @@ function Tr(t, e, n, ...r) {
|
|
|
5117
5117
|
* @returns A `Promise` resolved once the document has been successfully
|
|
5118
5118
|
* deleted from the backend.
|
|
5119
5119
|
*/ function Ir(t) {
|
|
5120
|
-
return Je(en((t = ot(t, an)).firestore), [ new Ae(t._key,
|
|
5120
|
+
return Je(en((t = ot(t, an)).firestore), [ new Ae(t._key, ve.none()) ]);
|
|
5121
5121
|
}
|
|
5122
5122
|
|
|
5123
5123
|
/**
|
|
@@ -5136,7 +5136,7 @@ function Tr(t, e, n, ...r) {
|
|
|
5136
5136
|
* newly created document after it has been written to the backend.
|
|
5137
5137
|
*/ function Ar(t, e) {
|
|
5138
5138
|
const n = wn(t = ot(t, ln)), r = _r(t.converter, e), s = Dn(Vn(t.firestore), "addDoc", n._key, r, null !== n.converter, {});
|
|
5139
|
-
return Je(en(t.firestore), [ s.toMutation(n._key,
|
|
5139
|
+
return Je(en(t.firestore), [ s.toMutation(n._key, ve.exists(!1)) ]).then((() => n));
|
|
5140
5140
|
}
|
|
5141
5141
|
|
|
5142
5142
|
/**
|
|
@@ -5256,7 +5256,7 @@ function Tr(t, e, n, ...r) {
|
|
|
5256
5256
|
set(t, e, n) {
|
|
5257
5257
|
this._verifyNotCommitted();
|
|
5258
5258
|
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);
|
|
5259
|
-
return this._mutations.push(i.toMutation(r._key,
|
|
5259
|
+
return this._mutations.push(i.toMutation(r._key, ve.none())), this;
|
|
5260
5260
|
}
|
|
5261
5261
|
update(t, e, n, ...r) {
|
|
5262
5262
|
this._verifyNotCommitted();
|
|
@@ -5265,7 +5265,7 @@ function Tr(t, e, n, ...r) {
|
|
|
5265
5265
|
// performing validation.
|
|
5266
5266
|
let i;
|
|
5267
5267
|
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),
|
|
5268
|
-
this._mutations.push(i.toMutation(s._key,
|
|
5268
|
+
this._mutations.push(i.toMutation(s._key, ve.exists(!0))), this;
|
|
5269
5269
|
}
|
|
5270
5270
|
/**
|
|
5271
5271
|
* Deletes the document referred to by the provided {@link DocumentReference}.
|
|
@@ -5275,7 +5275,7 @@ function Tr(t, e, n, ...r) {
|
|
|
5275
5275
|
*/ delete(t) {
|
|
5276
5276
|
this._verifyNotCommitted();
|
|
5277
5277
|
const e = Sr(t, this._firestore);
|
|
5278
|
-
return this._mutations = this._mutations.concat(new Ae(e._key,
|
|
5278
|
+
return this._mutations = this._mutations.concat(new Ae(e._key, ve.none())), this;
|
|
5279
5279
|
}
|
|
5280
5280
|
/**
|
|
5281
5281
|
* Commits all of the writes in this write batch as a single atomic unit.
|
|
@@ -5393,7 +5393,7 @@ function Sr(t, e) {
|
|
|
5393
5393
|
if (t.isFoundDocument()) e = t.version; else {
|
|
5394
5394
|
if (!t.isNoDocument()) throw g();
|
|
5395
5395
|
// For deleted docs, we must use baseVersion 0 when we overwrite them.
|
|
5396
|
-
e =
|
|
5396
|
+
e = bt.min();
|
|
5397
5397
|
}
|
|
5398
5398
|
const n = this.readVersions.get(t.key.toString());
|
|
5399
5399
|
if (n) {
|
|
@@ -5407,7 +5407,7 @@ function Sr(t, e) {
|
|
|
5407
5407
|
* as a precondition, or no precondition if it was not read.
|
|
5408
5408
|
*/ precondition(t) {
|
|
5409
5409
|
const e = this.readVersions.get(t.toString());
|
|
5410
|
-
return !this.writtenDocs.has(t.toString()) && e ?
|
|
5410
|
+
return !this.writtenDocs.has(t.toString()) && e ? ve.updateTime(e) : ve.none();
|
|
5411
5411
|
}
|
|
5412
5412
|
/**
|
|
5413
5413
|
* Returns the precondition for a document if the operation is an update.
|
|
@@ -5416,7 +5416,7 @@ function Sr(t, e) {
|
|
|
5416
5416
|
// The first time a document is written, we want to take into account the
|
|
5417
5417
|
// read time and existence
|
|
5418
5418
|
if (!this.writtenDocs.has(t.toString()) && e) {
|
|
5419
|
-
if (e.isEqual(
|
|
5419
|
+
if (e.isEqual(bt.min()))
|
|
5420
5420
|
// The document doesn't exist, so fail the transaction.
|
|
5421
5421
|
// This has to be validated locally because you can't send a
|
|
5422
5422
|
// precondition that a document does not exist without changing the
|
|
@@ -5428,11 +5428,11 @@ function Sr(t, e) {
|
|
|
5428
5428
|
// transaction.
|
|
5429
5429
|
throw new U(A, "Can't update a document that doesn't exist.");
|
|
5430
5430
|
// Document exists, base precondition on document update time.
|
|
5431
|
-
return
|
|
5431
|
+
return ve.updateTime(e);
|
|
5432
5432
|
}
|
|
5433
5433
|
// Document was not read, so we just use the preconditions for a blind
|
|
5434
5434
|
// update.
|
|
5435
|
-
return
|
|
5435
|
+
return ve.exists(!0);
|
|
5436
5436
|
}
|
|
5437
5437
|
write(t) {
|
|
5438
5438
|
this.ensureCommitNotCalled(), this.mutations.push(t);
|
|
@@ -5980,7 +5980,7 @@ class Ur {
|
|
|
5980
5980
|
return e && r._setSettings(e), r;
|
|
5981
5981
|
}), "PUBLIC")),
|
|
5982
5982
|
// RUNTIME_ENV and BUILD_TARGET are replaced by real values during the compilation
|
|
5983
|
-
registerVersion("firestore-lite", "3.4.8-canary.
|
|
5983
|
+
registerVersion("firestore-lite", "3.4.8-canary.69baecadd", ""), registerVersion("firestore-lite", "3.4.8-canary.69baecadd", "esm2017");
|
|
5984
5984
|
|
|
5985
|
-
export { gn as Bytes, ln as CollectionReference, an as DocumentReference, Yn as DocumentSnapshot, yn as FieldPath,
|
|
5985
|
+
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 };
|
|
5986
5986
|
//# sourceMappingURL=index.browser.esm2017.js.map
|