@firebase/firestore 3.4.5-canary.2b98b28f2 → 3.4.5-canary.2d672cead
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/local/document_overlay_cache.d.ts +4 -5
- package/dist/firestore/src/local/indexeddb_document_overlay_cache.d.ts +4 -5
- package/dist/firestore/src/local/indexeddb_index_manager.d.ts +1 -1
- package/dist/firestore/src/local/indexeddb_schema.d.ts +34 -553
- package/dist/firestore/src/local/indexeddb_sentinels.d.ts +238 -0
- package/dist/firestore/src/local/indexeddb_target_cache.d.ts +2 -1
- package/dist/firestore/src/local/local_serializer.d.ts +2 -1
- package/dist/firestore/src/local/memory_document_overlay_cache.d.ts +4 -5
- package/dist/firestore/src/model/collections.d.ts +7 -0
- package/dist/firestore/src/util/obj_map.d.ts +3 -0
- package/dist/firestore/test/unit/local/test_document_overlay_cache.d.ts +4 -4
- package/dist/index.esm2017.js +3143 -3655
- package/dist/index.esm2017.js.map +1 -1
- package/dist/index.esm5.js +3305 -3756
- package/dist/index.esm5.js.map +1 -1
- package/dist/index.node.cjs.js +483 -929
- package/dist/index.node.cjs.js.map +1 -1
- package/dist/index.node.mjs +483 -929
- package/dist/index.node.mjs.map +1 -1
- package/dist/index.rn.js +3168 -3680
- package/dist/index.rn.js.map +1 -1
- package/dist/internal.d.ts +10 -3
- package/dist/lite/firestore/src/local/document_overlay_cache.d.ts +4 -5
- package/dist/lite/firestore/src/local/indexeddb_document_overlay_cache.d.ts +4 -5
- package/dist/lite/firestore/src/local/indexeddb_index_manager.d.ts +1 -1
- package/dist/lite/firestore/src/local/indexeddb_schema.d.ts +34 -553
- package/dist/lite/firestore/src/local/indexeddb_sentinels.d.ts +238 -0
- package/dist/lite/firestore/src/local/indexeddb_target_cache.d.ts +2 -1
- package/dist/lite/firestore/src/local/local_serializer.d.ts +2 -1
- package/dist/lite/firestore/src/local/memory_document_overlay_cache.d.ts +4 -5
- package/dist/lite/firestore/src/model/collections.d.ts +7 -0
- package/dist/lite/firestore/src/util/obj_map.d.ts +3 -0
- package/dist/lite/firestore/test/unit/local/test_document_overlay_cache.d.ts +4 -4
- 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 +83 -83
- package/dist/lite/packages/firestore/dist/lite/index.browser.esm2017.d.ts +18 -18
- package/dist/lite/packages/firestore/src/local/document_overlay_cache.d.ts +4 -5
- package/dist/lite/packages/firestore/src/local/indexeddb_document_overlay_cache.d.ts +4 -5
- package/dist/lite/packages/firestore/src/local/indexeddb_index_manager.d.ts +1 -1
- package/dist/lite/packages/firestore/src/local/indexeddb_schema.d.ts +34 -553
- package/dist/lite/packages/firestore/src/local/indexeddb_sentinels.d.ts +238 -0
- package/dist/lite/packages/firestore/src/local/indexeddb_target_cache.d.ts +2 -1
- package/dist/lite/packages/firestore/src/local/local_serializer.d.ts +2 -1
- package/dist/lite/packages/firestore/src/local/memory_document_overlay_cache.d.ts +4 -5
- package/dist/lite/packages/firestore/src/model/collections.d.ts +7 -0
- package/dist/lite/packages/firestore/src/util/obj_map.d.ts +3 -0
- package/dist/lite/packages/firestore/test/unit/local/test_document_overlay_cache.d.ts +4 -4
- package/dist/packages/firestore/dist/index.esm2017.d.ts +163 -163
- package/dist/packages/firestore/src/local/document_overlay_cache.d.ts +4 -5
- package/dist/packages/firestore/src/local/indexeddb_document_overlay_cache.d.ts +4 -5
- package/dist/packages/firestore/src/local/indexeddb_index_manager.d.ts +1 -1
- package/dist/packages/firestore/src/local/indexeddb_schema.d.ts +34 -553
- package/dist/packages/firestore/src/local/indexeddb_sentinels.d.ts +238 -0
- package/dist/packages/firestore/src/local/indexeddb_target_cache.d.ts +2 -1
- package/dist/packages/firestore/src/local/local_serializer.d.ts +2 -1
- package/dist/packages/firestore/src/local/memory_document_overlay_cache.d.ts +4 -5
- package/dist/packages/firestore/src/model/collections.d.ts +7 -0
- package/dist/packages/firestore/src/util/obj_map.d.ts +3 -0
- package/dist/packages/firestore/test/unit/local/test_document_overlay_cache.d.ts +4 -4
- package/dist/private.d.ts +10 -3
- package/package.json +9 -9
|
@@ -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.7-canary.
|
|
66
|
+
let f = "9.6.7-canary.2d672cead";
|
|
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 v(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 b(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 ? (v("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 ? (v("string" == typeof t.token),
|
|
390
390
|
new W(t.token)) : null)) : Promise.resolve(null);
|
|
391
391
|
}
|
|
392
392
|
invalidateToken() {}
|
|
@@ -1320,15 +1320,15 @@ 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 vt {
|
|
1324
1324
|
constructor(t) {
|
|
1325
1325
|
this.timestamp = t;
|
|
1326
1326
|
}
|
|
1327
1327
|
static fromTimestamp(t) {
|
|
1328
|
-
return new
|
|
1328
|
+
return new vt(t);
|
|
1329
1329
|
}
|
|
1330
1330
|
static min() {
|
|
1331
|
-
return new
|
|
1331
|
+
return new vt(new gt(0, 0));
|
|
1332
1332
|
}
|
|
1333
1333
|
compareTo(t) {
|
|
1334
1334
|
return this.timestamp._compareTo(t.timestamp);
|
|
@@ -1363,7 +1363,7 @@ class gt {
|
|
|
1363
1363
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1364
1364
|
* See the License for the specific language governing permissions and
|
|
1365
1365
|
* limitations under the License.
|
|
1366
|
-
*/ function
|
|
1366
|
+
*/ function bt(t) {
|
|
1367
1367
|
let e = 0;
|
|
1368
1368
|
for (const n in t) Object.prototype.hasOwnProperty.call(t, n) && e++;
|
|
1369
1369
|
return e;
|
|
@@ -1551,13 +1551,13 @@ const At = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
|
|
|
1551
1551
|
// The json interface (for the browser) will return an iso timestamp string,
|
|
1552
1552
|
// while the proto js library (for node) will return a
|
|
1553
1553
|
// google.protobuf.Timestamp instance.
|
|
1554
|
-
if (
|
|
1554
|
+
if (v(!!t), "string" == typeof t) {
|
|
1555
1555
|
// The date string can have higher precision (nanos) than the Date class
|
|
1556
1556
|
// (millis), so we do some custom parsing here.
|
|
1557
1557
|
// Parse the nanos right out of the string.
|
|
1558
1558
|
let e = 0;
|
|
1559
1559
|
const n = At.exec(t);
|
|
1560
|
-
if (
|
|
1560
|
+
if (v(!!n), n[1]) {
|
|
1561
1561
|
// Pad the fraction out to 9 digits (nanos).
|
|
1562
1562
|
let t = n[1];
|
|
1563
1563
|
t = (t + "000000000").substr(0, 9), e = Number(t);
|
|
@@ -1743,7 +1743,7 @@ function St(t) {
|
|
|
1743
1743
|
case 10 /* ObjectValue */ :
|
|
1744
1744
|
return function(t, e) {
|
|
1745
1745
|
const n = t.mapValue.fields || {}, r = e.mapValue.fields || {};
|
|
1746
|
-
if (
|
|
1746
|
+
if (bt(n) !== bt(r)) return !1;
|
|
1747
1747
|
for (const t in n) if (n.hasOwnProperty(t) && (void 0 === r[t] || !Ft(n[t], r[t]))) return !1;
|
|
1748
1748
|
return !0;
|
|
1749
1749
|
}
|
|
@@ -2022,23 +2022,23 @@ class Bt {
|
|
|
2022
2022
|
* Creates a document with no known version or data, but which can serve as
|
|
2023
2023
|
* base document for mutations.
|
|
2024
2024
|
*/ static newInvalidDocument(t) {
|
|
2025
|
-
return new zt(t, 0 /* INVALID */ ,
|
|
2025
|
+
return new zt(t, 0 /* INVALID */ , vt.min(), vt.min(), Bt.empty(), 0 /* SYNCED */);
|
|
2026
2026
|
}
|
|
2027
2027
|
/**
|
|
2028
2028
|
* Creates a new document that is known to exist with the given data at the
|
|
2029
2029
|
* given version.
|
|
2030
2030
|
*/ static newFoundDocument(t, e, n) {
|
|
2031
|
-
return new zt(t, 1 /* FOUND_DOCUMENT */ , e,
|
|
2031
|
+
return new zt(t, 1 /* FOUND_DOCUMENT */ , e, vt.min(), n, 0 /* SYNCED */);
|
|
2032
2032
|
}
|
|
2033
2033
|
/** Creates a new document that is known to not exist at the given version. */ static newNoDocument(t, e) {
|
|
2034
|
-
return new zt(t, 2 /* NO_DOCUMENT */ , e,
|
|
2034
|
+
return new zt(t, 2 /* NO_DOCUMENT */ , e, vt.min(), Bt.empty(), 0 /* SYNCED */);
|
|
2035
2035
|
}
|
|
2036
2036
|
/**
|
|
2037
2037
|
* Creates a new document that is known to exist at the given version but
|
|
2038
2038
|
* whose data is not known (e.g. a document that was updated without a known
|
|
2039
2039
|
* base document).
|
|
2040
2040
|
*/ static newUnknownDocument(t, e) {
|
|
2041
|
-
return new zt(t, 3 /* UNKNOWN_DOCUMENT */ , e,
|
|
2041
|
+
return new zt(t, 3 /* UNKNOWN_DOCUMENT */ , e, vt.min(), Bt.empty(), 2 /* HAS_COMMITTED_MUTATIONS */);
|
|
2042
2042
|
}
|
|
2043
2043
|
/**
|
|
2044
2044
|
* Changes the document type to indicate that it exists and that its version
|
|
@@ -2368,7 +2368,7 @@ function he(t) {
|
|
|
2368
2368
|
* which can be different from the order by constraints the user provided (e.g.
|
|
2369
2369
|
* the SDK and backend always orders by `__name__`).
|
|
2370
2370
|
*/ function le(t) {
|
|
2371
|
-
const e =
|
|
2371
|
+
const e = b(t);
|
|
2372
2372
|
if (null === e.$) {
|
|
2373
2373
|
e.$ = [];
|
|
2374
2374
|
const t = ae(e), n = ce(e);
|
|
@@ -2393,7 +2393,7 @@ function he(t) {
|
|
|
2393
2393
|
/**
|
|
2394
2394
|
* Converts this `Query` instance to it's corresponding `Target` representation.
|
|
2395
2395
|
*/ function fe(t) {
|
|
2396
|
-
const e =
|
|
2396
|
+
const e = b(t);
|
|
2397
2397
|
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 {
|
|
2398
2398
|
// Flip the orderBy directions since we want the last results
|
|
2399
2399
|
const t = [];
|
|
@@ -2541,7 +2541,7 @@ function we(t, e) {
|
|
|
2541
2541
|
* See the License for the specific language governing permissions and
|
|
2542
2542
|
* limitations under the License.
|
|
2543
2543
|
*/
|
|
2544
|
-
/** A field path and the TransformOperation to perform upon it. */ class
|
|
2544
|
+
/** A field path and the TransformOperation to perform upon it. */ class ve {
|
|
2545
2545
|
constructor(t, e) {
|
|
2546
2546
|
this.field = t, this.transform = e;
|
|
2547
2547
|
}
|
|
@@ -2551,18 +2551,18 @@ function we(t, e) {
|
|
|
2551
2551
|
* Encodes a precondition for a mutation. This follows the model that the
|
|
2552
2552
|
* backend accepts with the special case of an explicit "empty" precondition
|
|
2553
2553
|
* (meaning no precondition).
|
|
2554
|
-
*/ class
|
|
2554
|
+
*/ class be {
|
|
2555
2555
|
constructor(t, e) {
|
|
2556
2556
|
this.updateTime = t, this.exists = e;
|
|
2557
2557
|
}
|
|
2558
2558
|
/** Creates a new empty Precondition. */ static none() {
|
|
2559
|
-
return new
|
|
2559
|
+
return new be;
|
|
2560
2560
|
}
|
|
2561
2561
|
/** Creates a new Precondition with an exists flag. */ static exists(t) {
|
|
2562
|
-
return new
|
|
2562
|
+
return new be(void 0, t);
|
|
2563
2563
|
}
|
|
2564
2564
|
/** Creates a new Precondition based on a version a document exists at. */ static updateTime(t) {
|
|
2565
|
-
return new
|
|
2565
|
+
return new be(t);
|
|
2566
2566
|
}
|
|
2567
2567
|
/** Returns whether this Precondition is empty. */ get isNone() {
|
|
2568
2568
|
return void 0 === this.updateTime && void 0 === this.exists;
|
|
@@ -2756,7 +2756,7 @@ function Se(t, e) {
|
|
|
2756
2756
|
}
|
|
2757
2757
|
|
|
2758
2758
|
function Fe(t) {
|
|
2759
|
-
return
|
|
2759
|
+
return v(!!t), vt.fromTimestamp(function(t) {
|
|
2760
2760
|
const e = Rt(t);
|
|
2761
2761
|
return new gt(e.seconds, e.nanos);
|
|
2762
2762
|
}(t));
|
|
@@ -2775,11 +2775,11 @@ function qe(t, e) {
|
|
|
2775
2775
|
function Oe(t, e) {
|
|
2776
2776
|
const n = function(t) {
|
|
2777
2777
|
const e = X.fromString(t);
|
|
2778
|
-
return
|
|
2778
|
+
return v(We(e)), e;
|
|
2779
2779
|
}(e);
|
|
2780
2780
|
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);
|
|
2781
2781
|
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);
|
|
2782
|
-
return new et((
|
|
2782
|
+
return new et((v((r = n).length > 4 && "documents" === r.get(4)), r.popFirst(5)));
|
|
2783
2783
|
var r;
|
|
2784
2784
|
/** Creates a Document proto from key and fields (but no create/update time) */}
|
|
2785
2785
|
|
|
@@ -2800,7 +2800,7 @@ function Ue(t, e, n) {
|
|
|
2800
2800
|
|
|
2801
2801
|
function ke(t, e) {
|
|
2802
2802
|
return "found" in e ? function(t, e) {
|
|
2803
|
-
|
|
2803
|
+
v(!!e.found), e.found.name, e.found.updateTime;
|
|
2804
2804
|
const n = Oe(t, e.found.name), r = Fe(e.found.updateTime), s = new Bt({
|
|
2805
2805
|
mapValue: {
|
|
2806
2806
|
fields: e.found.fields
|
|
@@ -2808,7 +2808,7 @@ function ke(t, e) {
|
|
|
2808
2808
|
});
|
|
2809
2809
|
return zt.newFoundDocument(n, r, s);
|
|
2810
2810
|
}(t, e) : "missing" in e ? function(t, e) {
|
|
2811
|
-
|
|
2811
|
+
v(!!e.missing), v(!!e.readTime);
|
|
2812
2812
|
const n = Oe(t, e.missing), r = Fe(e.readTime);
|
|
2813
2813
|
return zt.newNoDocument(n, r);
|
|
2814
2814
|
}(t, e) : g();
|
|
@@ -3149,14 +3149,14 @@ class Ke extends class {} {
|
|
|
3149
3149
|
// TODO(firestorexp): Make sure there is only one Datastore instance per
|
|
3150
3150
|
// firestore-exp client.
|
|
3151
3151
|
async function Je(t, e) {
|
|
3152
|
-
const n =
|
|
3152
|
+
const n = b(t), r = Le(n.q) + "/documents", s = {
|
|
3153
3153
|
writes: e.map((t => je(n.q, t)))
|
|
3154
3154
|
};
|
|
3155
3155
|
await n.m("Commit", r, s);
|
|
3156
3156
|
}
|
|
3157
3157
|
|
|
3158
3158
|
async function Xe(t, e) {
|
|
3159
|
-
const n =
|
|
3159
|
+
const n = b(t), r = Le(n.q) + "/documents", s = {
|
|
3160
3160
|
documents: e.map((t => qe(n.q, t)))
|
|
3161
3161
|
}, i = await n.T("BatchGetDocuments", r, s), o = new Map;
|
|
3162
3162
|
i.forEach((t => {
|
|
@@ -3166,12 +3166,12 @@ async function Xe(t, e) {
|
|
|
3166
3166
|
const u = [];
|
|
3167
3167
|
return e.forEach((t => {
|
|
3168
3168
|
const e = o.get(t.toString());
|
|
3169
|
-
|
|
3169
|
+
v(!!e), u.push(e);
|
|
3170
3170
|
})), u;
|
|
3171
3171
|
}
|
|
3172
3172
|
|
|
3173
3173
|
async function Ze(t, e) {
|
|
3174
|
-
const n =
|
|
3174
|
+
const n = b(t), r = Me(n.q, fe(e));
|
|
3175
3175
|
return (await n.T("RunQuery", r.parent, {
|
|
3176
3176
|
structuredQuery: r.structuredQuery
|
|
3177
3177
|
})).filter((t => !!t.document)).map((t => function(t, e, n) {
|
|
@@ -3338,7 +3338,7 @@ class nn {
|
|
|
3338
3338
|
case "gapi":
|
|
3339
3339
|
const e = t.client;
|
|
3340
3340
|
// Make sure this really is a Gapi client.
|
|
3341
|
-
return
|
|
3341
|
+
return v(!("object" != typeof e || null === e || !e.auth || !e.auth.getAuthHeaderValueForFirstParty)),
|
|
3342
3342
|
new Q(e, t.sessionIndex || "0", t.iamToken || null);
|
|
3343
3343
|
|
|
3344
3344
|
case "provider":
|
|
@@ -3799,7 +3799,7 @@ function wn(t, e, ...n) {
|
|
|
3799
3799
|
/**
|
|
3800
3800
|
* Sentinel values that can be used when writing document fields with `set()`
|
|
3801
3801
|
* or `update()`.
|
|
3802
|
-
*/ class
|
|
3802
|
+
*/ class vn {
|
|
3803
3803
|
/**
|
|
3804
3804
|
* @param _methodName - The public API endpoint that returns this class.
|
|
3805
3805
|
* @hideconstructor
|
|
@@ -3831,7 +3831,7 @@ function wn(t, e, ...n) {
|
|
|
3831
3831
|
*
|
|
3832
3832
|
* Latitude values are in the range of [-90, 90].
|
|
3833
3833
|
* Longitude values are in the range of [-180, 180].
|
|
3834
|
-
*/ class
|
|
3834
|
+
*/ class bn {
|
|
3835
3835
|
/**
|
|
3836
3836
|
* Creates a new immutable `GeoPoint` object with the provided latitude and
|
|
3837
3837
|
* longitude values.
|
|
@@ -4046,7 +4046,7 @@ function Vn(t) {
|
|
|
4046
4046
|
return new Tn(new Bt(u), c, a);
|
|
4047
4047
|
}
|
|
4048
4048
|
|
|
4049
|
-
class Nn extends
|
|
4049
|
+
class Nn extends vn {
|
|
4050
4050
|
_toFieldTransform(t) {
|
|
4051
4051
|
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}`);
|
|
4052
4052
|
// No transform to add for a delete, but we need to add it to our
|
|
@@ -4082,23 +4082,23 @@ class Nn extends bn {
|
|
|
4082
4082
|
}, e.databaseId, e.q, e.ignoreUndefinedProperties);
|
|
4083
4083
|
}
|
|
4084
4084
|
|
|
4085
|
-
class Sn extends
|
|
4085
|
+
class Sn extends vn {
|
|
4086
4086
|
_toFieldTransform(t) {
|
|
4087
|
-
return new
|
|
4087
|
+
return new ve(t.path, new pe);
|
|
4088
4088
|
}
|
|
4089
4089
|
isEqual(t) {
|
|
4090
4090
|
return t instanceof Sn;
|
|
4091
4091
|
}
|
|
4092
4092
|
}
|
|
4093
4093
|
|
|
4094
|
-
class Fn extends
|
|
4094
|
+
class Fn extends vn {
|
|
4095
4095
|
constructor(t, e) {
|
|
4096
4096
|
super(t), this.lt = e;
|
|
4097
4097
|
}
|
|
4098
4098
|
_toFieldTransform(t) {
|
|
4099
4099
|
const e = $n(this, t,
|
|
4100
4100
|
/*array=*/ !0), n = this.lt.map((t => Un(t, e))), r = new ye(n);
|
|
4101
|
-
return new
|
|
4101
|
+
return new ve(t.path, r);
|
|
4102
4102
|
}
|
|
4103
4103
|
isEqual(t) {
|
|
4104
4104
|
// TODO(mrschmidt): Implement isEquals
|
|
@@ -4106,14 +4106,14 @@ class Fn extends bn {
|
|
|
4106
4106
|
}
|
|
4107
4107
|
}
|
|
4108
4108
|
|
|
4109
|
-
class xn extends
|
|
4109
|
+
class xn extends vn {
|
|
4110
4110
|
constructor(t, e) {
|
|
4111
4111
|
super(t), this.lt = e;
|
|
4112
4112
|
}
|
|
4113
4113
|
_toFieldTransform(t) {
|
|
4114
4114
|
const e = $n(this, t,
|
|
4115
4115
|
/*array=*/ !0), n = this.lt.map((t => Un(t, e))), r = new _e(n);
|
|
4116
|
-
return new
|
|
4116
|
+
return new ve(t.path, r);
|
|
4117
4117
|
}
|
|
4118
4118
|
isEqual(t) {
|
|
4119
4119
|
// TODO(mrschmidt): Implement isEquals
|
|
@@ -4121,13 +4121,13 @@ class xn extends bn {
|
|
|
4121
4121
|
}
|
|
4122
4122
|
}
|
|
4123
4123
|
|
|
4124
|
-
class qn extends
|
|
4124
|
+
class qn extends vn {
|
|
4125
4125
|
constructor(t, e) {
|
|
4126
4126
|
super(t), this.ft = e;
|
|
4127
4127
|
}
|
|
4128
4128
|
_toFieldTransform(t) {
|
|
4129
4129
|
const e = new ge(t.q, we(t.q, this.ft));
|
|
4130
|
-
return new
|
|
4130
|
+
return new ve(t.path, e);
|
|
4131
4131
|
}
|
|
4132
4132
|
isEqual(t) {
|
|
4133
4133
|
// TODO(mrschmidt): Implement isEquals
|
|
@@ -4204,7 +4204,7 @@ class qn extends bn {
|
|
|
4204
4204
|
// Unwrap the API type from the Compat SDK. This will return the API type
|
|
4205
4205
|
// from firestore-exp.
|
|
4206
4206
|
t = getModularInstance(t))) return Mn("Unsupported field value:", e, t), kn(t, e);
|
|
4207
|
-
if (t instanceof
|
|
4207
|
+
if (t instanceof vn)
|
|
4208
4208
|
// FieldValues usually parse into transforms (except deleteField())
|
|
4209
4209
|
// in which case we do not want to include this field in our parsed data
|
|
4210
4210
|
// (as doing so will overwrite the field directly prior to the transform
|
|
@@ -4287,7 +4287,7 @@ class qn extends bn {
|
|
|
4287
4287
|
timestampValue: Ne(e.q, n)
|
|
4288
4288
|
};
|
|
4289
4289
|
}
|
|
4290
|
-
if (t instanceof
|
|
4290
|
+
if (t instanceof bn) return {
|
|
4291
4291
|
geoPointValue: {
|
|
4292
4292
|
latitude: t.latitude,
|
|
4293
4293
|
longitude: t.longitude
|
|
@@ -4333,7 +4333,7 @@ function kn(t, e) {
|
|
|
4333
4333
|
}
|
|
4334
4334
|
|
|
4335
4335
|
function jn(t) {
|
|
4336
|
-
return !("object" != typeof t || null === t || t instanceof Array || t instanceof Date || t instanceof gt || t instanceof
|
|
4336
|
+
return !("object" != typeof t || null === t || t instanceof Array || t instanceof Date || t instanceof gt || t instanceof bn || t instanceof gn || t instanceof an || t instanceof vn);
|
|
4337
4337
|
}
|
|
4338
4338
|
|
|
4339
4339
|
function Mn(t, e, n) {
|
|
@@ -4735,12 +4735,12 @@ class rr extends Zn {
|
|
|
4735
4735
|
|
|
4736
4736
|
class ir extends Zn {
|
|
4737
4737
|
constructor(t, e, n) {
|
|
4738
|
-
super(), this.type = t, this.gt = e, this.
|
|
4738
|
+
super(), this.type = t, this.gt = e, this.vt = n;
|
|
4739
4739
|
}
|
|
4740
4740
|
_apply(t) {
|
|
4741
4741
|
return new hn(t.firestore, t.converter, function(t, e, n) {
|
|
4742
4742
|
return new oe(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), e, n, t.startAt, t.endAt);
|
|
4743
|
-
}(t._query, this.gt, this.
|
|
4743
|
+
}(t._query, this.gt, this.vt));
|
|
4744
4744
|
}
|
|
4745
4745
|
}
|
|
4746
4746
|
|
|
@@ -4767,10 +4767,10 @@ class ir extends Zn {
|
|
|
4767
4767
|
|
|
4768
4768
|
class cr extends Zn {
|
|
4769
4769
|
constructor(t, e, n) {
|
|
4770
|
-
super(), this.type = t, this.
|
|
4770
|
+
super(), this.type = t, this.bt = e, this.Et = n;
|
|
4771
4771
|
}
|
|
4772
4772
|
_apply(t) {
|
|
4773
|
-
const e = wr(t, this.type, this.
|
|
4773
|
+
const e = wr(t, this.type, this.bt, this.Et);
|
|
4774
4774
|
return new hn(t.firestore, t.converter, function(t, e) {
|
|
4775
4775
|
return new oe(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), t.limit, t.limitType, e, t.endAt);
|
|
4776
4776
|
}(t._query, e));
|
|
@@ -4789,10 +4789,10 @@ function hr(...t) {
|
|
|
4789
4789
|
|
|
4790
4790
|
class lr extends Zn {
|
|
4791
4791
|
constructor(t, e, n) {
|
|
4792
|
-
super(), this.type = t, this.
|
|
4792
|
+
super(), this.type = t, this.bt = e, this.Et = n;
|
|
4793
4793
|
}
|
|
4794
4794
|
_apply(t) {
|
|
4795
|
-
const e = wr(t, this.type, this.
|
|
4795
|
+
const e = wr(t, this.type, this.bt, this.Et);
|
|
4796
4796
|
return new hn(t.firestore, t.converter, function(t, e) {
|
|
4797
4797
|
return new oe(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), t.limit, t.limitType, t.startAt, e);
|
|
4798
4798
|
}(t._query, e));
|
|
@@ -4991,7 +4991,7 @@ class gr extends class {
|
|
|
4991
4991
|
})), n;
|
|
4992
4992
|
}
|
|
4993
4993
|
convertGeoPoint(t) {
|
|
4994
|
-
return new
|
|
4994
|
+
return new bn(Pt(t.latitude), Pt(t.longitude));
|
|
4995
4995
|
}
|
|
4996
4996
|
convertArray(t, e) {
|
|
4997
4997
|
return (t.values || []).map((t => this.convertValue(t, e)));
|
|
@@ -5015,7 +5015,7 @@ class gr extends class {
|
|
|
5015
5015
|
}
|
|
5016
5016
|
convertDocumentKey(t, e) {
|
|
5017
5017
|
const n = X.fromString(t);
|
|
5018
|
-
|
|
5018
|
+
v(We(n));
|
|
5019
5019
|
const r = new K(n.get(1), n.get(3)), s = new et(n.popFirst(5));
|
|
5020
5020
|
return r.isEqual(e) ||
|
|
5021
5021
|
// TODO(b/64130202): Somehow support foreign references.
|
|
@@ -5047,10 +5047,10 @@ class gr extends class {
|
|
|
5047
5047
|
* @param reference - The reference of the document to fetch.
|
|
5048
5048
|
* @returns A Promise resolved with a `DocumentSnapshot` containing the current
|
|
5049
5049
|
* document contents.
|
|
5050
|
-
*/ function
|
|
5050
|
+
*/ function vr(t) {
|
|
5051
5051
|
const e = en((t = ot(t, an)).firestore), n = new gr(t.firestore);
|
|
5052
5052
|
return Xe(e, [ t._key ]).then((e => {
|
|
5053
|
-
|
|
5053
|
+
v(1 === e.length);
|
|
5054
5054
|
const r = e[0];
|
|
5055
5055
|
return new Yn(t.firestore, n, t._key, r.isFoundDocument() ? r : null, t.converter);
|
|
5056
5056
|
}));
|
|
@@ -5067,7 +5067,7 @@ class gr extends class {
|
|
|
5067
5067
|
*
|
|
5068
5068
|
* @param query - The `Query` to execute.
|
|
5069
5069
|
* @returns A Promise that will be resolved with the results of the query.
|
|
5070
|
-
*/ function
|
|
5070
|
+
*/ function br(t) {
|
|
5071
5071
|
!function(t) {
|
|
5072
5072
|
if (ue(t) && 0 === t.explicitOrderBy.length) throw new U(q, "limitToLast() queries require specifying at least one orderBy() clause");
|
|
5073
5073
|
}((t = ot(t, hn))._query);
|
|
@@ -5084,7 +5084,7 @@ class gr extends class {
|
|
|
5084
5084
|
|
|
5085
5085
|
function Er(t, e, n) {
|
|
5086
5086
|
const r = _r((t = ot(t, an)).converter, e, n), s = Dn(Vn(t.firestore), "setDoc", t._key, r, null !== t.converter, n);
|
|
5087
|
-
return Je(en(t.firestore), [ s.toMutation(t._key,
|
|
5087
|
+
return Je(en(t.firestore), [ s.toMutation(t._key, be.none()) ]);
|
|
5088
5088
|
}
|
|
5089
5089
|
|
|
5090
5090
|
function Tr(t, e, n, ...r) {
|
|
@@ -5093,7 +5093,7 @@ function Tr(t, e, n, ...r) {
|
|
|
5093
5093
|
// performing validation.
|
|
5094
5094
|
let i;
|
|
5095
5095
|
i = "string" == typeof (e = getModularInstance(e)) || e instanceof yn ? Cn(s, "updateDoc", t._key, e, n, r) : On(s, "updateDoc", t._key, e);
|
|
5096
|
-
return Je(en(t.firestore), [ i.toMutation(t._key,
|
|
5096
|
+
return Je(en(t.firestore), [ i.toMutation(t._key, be.exists(!0)) ]);
|
|
5097
5097
|
}
|
|
5098
5098
|
|
|
5099
5099
|
/**
|
|
@@ -5108,7 +5108,7 @@ function Tr(t, e, n, ...r) {
|
|
|
5108
5108
|
* @returns A `Promise` resolved once the document has been successfully
|
|
5109
5109
|
* deleted from the backend.
|
|
5110
5110
|
*/ function Ir(t) {
|
|
5111
|
-
return Je(en((t = ot(t, an)).firestore), [ new Ae(t._key,
|
|
5111
|
+
return Je(en((t = ot(t, an)).firestore), [ new Ae(t._key, be.none()) ]);
|
|
5112
5112
|
}
|
|
5113
5113
|
|
|
5114
5114
|
/**
|
|
@@ -5127,7 +5127,7 @@ function Tr(t, e, n, ...r) {
|
|
|
5127
5127
|
* newly created document after it has been written to the backend.
|
|
5128
5128
|
*/ function Ar(t, e) {
|
|
5129
5129
|
const n = wn(t = ot(t, ln)), r = _r(t.converter, e), s = Dn(Vn(t.firestore), "addDoc", n._key, r, null !== n.converter, {});
|
|
5130
|
-
return Je(en(t.firestore), [ s.toMutation(n._key,
|
|
5130
|
+
return Je(en(t.firestore), [ s.toMutation(n._key, be.exists(!1)) ]).then((() => n));
|
|
5131
5131
|
}
|
|
5132
5132
|
|
|
5133
5133
|
/**
|
|
@@ -5247,7 +5247,7 @@ function Tr(t, e, n, ...r) {
|
|
|
5247
5247
|
set(t, e, n) {
|
|
5248
5248
|
this._verifyNotCommitted();
|
|
5249
5249
|
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);
|
|
5250
|
-
return this._mutations.push(i.toMutation(r._key,
|
|
5250
|
+
return this._mutations.push(i.toMutation(r._key, be.none())), this;
|
|
5251
5251
|
}
|
|
5252
5252
|
update(t, e, n, ...r) {
|
|
5253
5253
|
this._verifyNotCommitted();
|
|
@@ -5256,7 +5256,7 @@ function Tr(t, e, n, ...r) {
|
|
|
5256
5256
|
// performing validation.
|
|
5257
5257
|
let i;
|
|
5258
5258
|
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),
|
|
5259
|
-
this._mutations.push(i.toMutation(s._key,
|
|
5259
|
+
this._mutations.push(i.toMutation(s._key, be.exists(!0))), this;
|
|
5260
5260
|
}
|
|
5261
5261
|
/**
|
|
5262
5262
|
* Deletes the document referred to by the provided {@link DocumentReference}.
|
|
@@ -5266,7 +5266,7 @@ function Tr(t, e, n, ...r) {
|
|
|
5266
5266
|
*/ delete(t) {
|
|
5267
5267
|
this._verifyNotCommitted();
|
|
5268
5268
|
const e = Sr(t, this._firestore);
|
|
5269
|
-
return this._mutations = this._mutations.concat(new Ae(e._key,
|
|
5269
|
+
return this._mutations = this._mutations.concat(new Ae(e._key, be.none())), this;
|
|
5270
5270
|
}
|
|
5271
5271
|
/**
|
|
5272
5272
|
* Commits all of the writes in this write batch as a single atomic unit.
|
|
@@ -5384,7 +5384,7 @@ function Sr(t, e) {
|
|
|
5384
5384
|
if (t.isFoundDocument()) e = t.version; else {
|
|
5385
5385
|
if (!t.isNoDocument()) throw g();
|
|
5386
5386
|
// For deleted docs, we must use baseVersion 0 when we overwrite them.
|
|
5387
|
-
e =
|
|
5387
|
+
e = vt.min();
|
|
5388
5388
|
}
|
|
5389
5389
|
const n = this.readVersions.get(t.key.toString());
|
|
5390
5390
|
if (n) {
|
|
@@ -5398,7 +5398,7 @@ function Sr(t, e) {
|
|
|
5398
5398
|
* as a precondition, or no precondition if it was not read.
|
|
5399
5399
|
*/ precondition(t) {
|
|
5400
5400
|
const e = this.readVersions.get(t.toString());
|
|
5401
|
-
return !this.writtenDocs.has(t.toString()) && e ?
|
|
5401
|
+
return !this.writtenDocs.has(t.toString()) && e ? be.updateTime(e) : be.none();
|
|
5402
5402
|
}
|
|
5403
5403
|
/**
|
|
5404
5404
|
* Returns the precondition for a document if the operation is an update.
|
|
@@ -5407,7 +5407,7 @@ function Sr(t, e) {
|
|
|
5407
5407
|
// The first time a document is written, we want to take into account the
|
|
5408
5408
|
// read time and existence
|
|
5409
5409
|
if (!this.writtenDocs.has(t.toString()) && e) {
|
|
5410
|
-
if (e.isEqual(
|
|
5410
|
+
if (e.isEqual(vt.min()))
|
|
5411
5411
|
// The document doesn't exist, so fail the transaction.
|
|
5412
5412
|
// This has to be validated locally because you can't send a
|
|
5413
5413
|
// precondition that a document does not exist without changing the
|
|
@@ -5419,11 +5419,11 @@ function Sr(t, e) {
|
|
|
5419
5419
|
// transaction.
|
|
5420
5420
|
throw new U(A, "Can't update a document that doesn't exist.");
|
|
5421
5421
|
// Document exists, base precondition on document update time.
|
|
5422
|
-
return
|
|
5422
|
+
return be.updateTime(e);
|
|
5423
5423
|
}
|
|
5424
5424
|
// Document was not read, so we just use the preconditions for a blind
|
|
5425
5425
|
// update.
|
|
5426
|
-
return
|
|
5426
|
+
return be.exists(!0);
|
|
5427
5427
|
}
|
|
5428
5428
|
write(t) {
|
|
5429
5429
|
this.ensureCommitNotCalled(), this.mutations.push(t);
|
|
@@ -5971,7 +5971,7 @@ class Ur {
|
|
|
5971
5971
|
return e && r._setSettings(e), r;
|
|
5972
5972
|
}), "PUBLIC")),
|
|
5973
5973
|
// RUNTIME_ENV and BUILD_TARGET are replaced by real values during the compilation
|
|
5974
|
-
registerVersion("firestore-lite", "3.4.5-canary.
|
|
5974
|
+
registerVersion("firestore-lite", "3.4.5-canary.2d672cead", ""), registerVersion("firestore-lite", "3.4.5-canary.2d672cead", "esm2017");
|
|
5975
5975
|
|
|
5976
|
-
export { gn as Bytes, ln as CollectionReference, an as DocumentReference, Yn as DocumentSnapshot, yn as FieldPath,
|
|
5976
|
+
export { gn as Bytes, ln as CollectionReference, an as DocumentReference, Yn as DocumentSnapshot, yn as FieldPath, vn as FieldValue, rn as Firestore, U as FirestoreError, bn 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, vr as getDoc, br 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 };
|
|
5977
5977
|
//# sourceMappingURL=index.browser.esm2017.js.map
|