@firebase/firestore 3.4.4-canary.2dd99ae2d → 3.4.4-canary.3e9f3e253
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/credentials.d.ts +1 -0
- package/dist/firestore/src/api/snapshot.d.ts +1 -2
- package/dist/firestore/src/core/target.d.ts +8 -4
- package/dist/firestore/src/lite-api/query.d.ts +2 -2
- package/dist/firestore/src/local/document_overlay_cache.d.ts +72 -0
- package/dist/firestore/src/local/index_manager.d.ts +52 -0
- package/dist/firestore/src/local/indexeddb_document_overlay_cache.d.ts +45 -0
- package/dist/firestore/src/local/indexeddb_index_manager.d.ts +21 -2
- package/dist/firestore/src/local/indexeddb_persistence.d.ts +6 -4
- package/dist/firestore/src/local/indexeddb_remote_document_cache.d.ts +2 -8
- package/dist/firestore/src/local/indexeddb_schema.d.ts +193 -7
- package/dist/firestore/src/local/local_documents_view.d.ts +0 -1
- package/dist/firestore/src/local/local_serializer.d.ts +18 -2
- package/dist/firestore/src/local/memory_document_overlay_cache.d.ts +37 -0
- package/dist/firestore/src/local/memory_index_manager.d.ts +11 -0
- package/dist/firestore/src/local/memory_persistence.d.ts +6 -2
- package/dist/firestore/src/local/memory_remote_document_cache.d.ts +1 -3
- package/dist/firestore/src/local/persistence.d.ts +8 -2
- package/dist/firestore/src/local/remote_document_cache.d.ts +7 -9
- package/dist/firestore/src/local/simple_db.d.ts +1 -0
- package/dist/firestore/src/model/document_key.d.ts +4 -0
- package/dist/firestore/src/model/field_index.d.ts +2 -2
- package/dist/firestore/src/model/overlay.d.ts +32 -0
- package/dist/firestore/src/model/target_index_matcher.d.ts +70 -0
- package/dist/firestore/test/unit/local/counting_query_engine.d.ts +3 -3
- package/dist/firestore/test/unit/local/document_overlay_cache.test.d.ts +1 -0
- package/dist/firestore/test/unit/local/persistence_test_helpers.d.ts +1 -0
- package/dist/firestore/test/unit/local/test_document_overlay_cache.d.ts +38 -0
- package/dist/firestore/test/unit/local/test_index_manager.d.ts +11 -0
- package/dist/firestore/test/unit/local/test_remote_document_cache.d.ts +4 -2
- package/dist/firestore/test/unit/local/test_remote_document_change_buffer.d.ts +1 -1
- package/dist/firestore/test/unit/model/target_index_matcher.test.d.ts +17 -0
- package/dist/firestore/test/util/helpers.d.ts +1 -1
- package/dist/index.d.ts +1 -2
- package/dist/index.esm2017.js +3864 -3349
- package/dist/index.esm2017.js.map +1 -1
- package/dist/index.esm5.js +3879 -3455
- package/dist/index.esm5.js.map +1 -1
- package/dist/index.node.cjs.js +878 -221
- package/dist/index.node.cjs.js.map +1 -1
- package/dist/index.node.mjs +878 -221
- package/dist/index.node.mjs.map +1 -1
- package/dist/index.rn.js +3973 -3458
- package/dist/index.rn.js.map +1 -1
- package/dist/internal.d.ts +252 -14
- package/dist/lite/firestore/src/api/credentials.d.ts +1 -0
- package/dist/lite/firestore/src/api/snapshot.d.ts +1 -2
- package/dist/lite/firestore/src/core/target.d.ts +8 -4
- package/dist/lite/firestore/src/lite-api/query.d.ts +2 -2
- package/dist/lite/firestore/src/local/document_overlay_cache.d.ts +72 -0
- package/dist/lite/firestore/src/local/index_manager.d.ts +52 -0
- package/dist/lite/firestore/src/local/indexeddb_document_overlay_cache.d.ts +45 -0
- package/dist/lite/firestore/src/local/indexeddb_index_manager.d.ts +21 -2
- package/dist/lite/firestore/src/local/indexeddb_persistence.d.ts +6 -4
- package/dist/lite/firestore/src/local/indexeddb_remote_document_cache.d.ts +2 -8
- package/dist/lite/firestore/src/local/indexeddb_schema.d.ts +193 -7
- package/dist/lite/firestore/src/local/local_documents_view.d.ts +0 -1
- package/dist/lite/firestore/src/local/local_serializer.d.ts +18 -2
- package/dist/lite/firestore/src/local/memory_document_overlay_cache.d.ts +37 -0
- package/dist/lite/firestore/src/local/memory_index_manager.d.ts +11 -0
- package/dist/lite/firestore/src/local/memory_persistence.d.ts +6 -2
- package/dist/lite/firestore/src/local/memory_remote_document_cache.d.ts +1 -3
- package/dist/lite/firestore/src/local/persistence.d.ts +8 -2
- package/dist/lite/firestore/src/local/remote_document_cache.d.ts +7 -9
- package/dist/lite/firestore/src/local/simple_db.d.ts +1 -0
- package/dist/lite/firestore/src/model/document_key.d.ts +4 -0
- package/dist/lite/firestore/src/model/field_index.d.ts +2 -2
- package/dist/lite/firestore/src/model/overlay.d.ts +32 -0
- package/dist/lite/firestore/src/model/target_index_matcher.d.ts +70 -0
- package/dist/lite/firestore/test/unit/local/counting_query_engine.d.ts +3 -3
- package/dist/lite/firestore/test/unit/local/document_overlay_cache.test.d.ts +1 -0
- package/dist/lite/firestore/test/unit/local/persistence_test_helpers.d.ts +1 -0
- package/dist/lite/firestore/test/unit/local/test_document_overlay_cache.d.ts +38 -0
- package/dist/lite/firestore/test/unit/local/test_index_manager.d.ts +11 -0
- package/dist/lite/firestore/test/unit/local/test_remote_document_cache.d.ts +4 -2
- package/dist/lite/firestore/test/unit/local/test_remote_document_change_buffer.d.ts +1 -1
- package/dist/lite/firestore/test/unit/model/target_index_matcher.test.d.ts +17 -0
- package/dist/lite/firestore/test/util/helpers.d.ts +1 -1
- package/dist/lite/index.browser.esm2017.js +1152 -1143
- package/dist/lite/index.browser.esm2017.js.map +1 -1
- package/dist/lite/index.browser.esm5.js +348 -341
- package/dist/lite/index.browser.esm5.js.map +1 -1
- package/dist/lite/index.node.cjs.js +44 -29
- package/dist/lite/index.node.cjs.js.map +1 -1
- package/dist/lite/index.node.mjs +44 -29
- package/dist/lite/index.node.mjs.map +1 -1
- package/dist/lite/index.rn.esm2017.js +1180 -1171
- package/dist/lite/index.rn.esm2017.js.map +1 -1
- package/dist/lite/internal.d.ts +6 -2
- package/dist/lite/packages/firestore/dist/lite/index.browser.esm2017.d.ts +121 -121
- package/dist/lite/packages/firestore/src/api/credentials.d.ts +1 -0
- package/dist/lite/packages/firestore/src/api/snapshot.d.ts +1 -2
- package/dist/lite/packages/firestore/src/core/target.d.ts +8 -4
- package/dist/lite/packages/firestore/src/lite-api/query.d.ts +2 -2
- package/dist/lite/packages/firestore/src/local/document_overlay_cache.d.ts +72 -0
- package/dist/lite/packages/firestore/src/local/index_manager.d.ts +52 -0
- package/dist/lite/packages/firestore/src/local/indexeddb_document_overlay_cache.d.ts +45 -0
- package/dist/lite/packages/firestore/src/local/indexeddb_index_manager.d.ts +21 -2
- package/dist/lite/packages/firestore/src/local/indexeddb_persistence.d.ts +6 -4
- package/dist/lite/packages/firestore/src/local/indexeddb_remote_document_cache.d.ts +2 -8
- package/dist/lite/packages/firestore/src/local/indexeddb_schema.d.ts +193 -7
- package/dist/lite/packages/firestore/src/local/local_documents_view.d.ts +0 -1
- package/dist/lite/packages/firestore/src/local/local_serializer.d.ts +18 -2
- package/dist/lite/packages/firestore/src/local/memory_document_overlay_cache.d.ts +37 -0
- package/dist/lite/packages/firestore/src/local/memory_index_manager.d.ts +11 -0
- package/dist/lite/packages/firestore/src/local/memory_persistence.d.ts +6 -2
- package/dist/lite/packages/firestore/src/local/memory_remote_document_cache.d.ts +1 -3
- package/dist/lite/packages/firestore/src/local/persistence.d.ts +8 -2
- package/dist/lite/packages/firestore/src/local/remote_document_cache.d.ts +7 -9
- package/dist/lite/packages/firestore/src/local/simple_db.d.ts +1 -0
- package/dist/lite/packages/firestore/src/model/document_key.d.ts +4 -0
- package/dist/lite/packages/firestore/src/model/field_index.d.ts +2 -2
- package/dist/lite/packages/firestore/src/model/overlay.d.ts +32 -0
- package/dist/lite/packages/firestore/src/model/target_index_matcher.d.ts +70 -0
- package/dist/lite/packages/firestore/test/unit/local/counting_query_engine.d.ts +3 -3
- package/dist/lite/packages/firestore/test/unit/local/document_overlay_cache.test.d.ts +1 -0
- package/dist/lite/packages/firestore/test/unit/local/persistence_test_helpers.d.ts +1 -0
- package/dist/lite/packages/firestore/test/unit/local/test_document_overlay_cache.d.ts +38 -0
- package/dist/lite/packages/firestore/test/unit/local/test_index_manager.d.ts +11 -0
- package/dist/lite/packages/firestore/test/unit/local/test_remote_document_cache.d.ts +4 -2
- package/dist/lite/packages/firestore/test/unit/local/test_remote_document_change_buffer.d.ts +1 -1
- package/dist/lite/packages/firestore/test/unit/model/target_index_matcher.test.d.ts +17 -0
- package/dist/lite/packages/firestore/test/util/helpers.d.ts +1 -1
- package/dist/lite/private.d.ts +2 -2
- package/dist/packages/firestore/dist/index.esm2017.d.ts +181 -179
- package/dist/packages/firestore/src/api/credentials.d.ts +1 -0
- package/dist/packages/firestore/src/api/snapshot.d.ts +1 -2
- package/dist/packages/firestore/src/core/target.d.ts +8 -4
- package/dist/packages/firestore/src/lite-api/query.d.ts +2 -2
- package/dist/packages/firestore/src/local/document_overlay_cache.d.ts +72 -0
- package/dist/packages/firestore/src/local/index_manager.d.ts +52 -0
- package/dist/packages/firestore/src/local/indexeddb_document_overlay_cache.d.ts +45 -0
- package/dist/packages/firestore/src/local/indexeddb_index_manager.d.ts +21 -2
- package/dist/packages/firestore/src/local/indexeddb_persistence.d.ts +6 -4
- package/dist/packages/firestore/src/local/indexeddb_remote_document_cache.d.ts +2 -8
- package/dist/packages/firestore/src/local/indexeddb_schema.d.ts +193 -7
- package/dist/packages/firestore/src/local/local_documents_view.d.ts +0 -1
- package/dist/packages/firestore/src/local/local_serializer.d.ts +18 -2
- package/dist/packages/firestore/src/local/memory_document_overlay_cache.d.ts +37 -0
- package/dist/packages/firestore/src/local/memory_index_manager.d.ts +11 -0
- package/dist/packages/firestore/src/local/memory_persistence.d.ts +6 -2
- package/dist/packages/firestore/src/local/memory_remote_document_cache.d.ts +1 -3
- package/dist/packages/firestore/src/local/persistence.d.ts +8 -2
- package/dist/packages/firestore/src/local/remote_document_cache.d.ts +7 -9
- package/dist/packages/firestore/src/local/simple_db.d.ts +1 -0
- package/dist/packages/firestore/src/model/document_key.d.ts +4 -0
- package/dist/packages/firestore/src/model/field_index.d.ts +2 -2
- package/dist/packages/firestore/src/model/overlay.d.ts +32 -0
- package/dist/packages/firestore/src/model/target_index_matcher.d.ts +70 -0
- package/dist/packages/firestore/test/unit/local/counting_query_engine.d.ts +3 -3
- package/dist/packages/firestore/test/unit/local/document_overlay_cache.test.d.ts +1 -0
- package/dist/packages/firestore/test/unit/local/persistence_test_helpers.d.ts +1 -0
- package/dist/packages/firestore/test/unit/local/test_document_overlay_cache.d.ts +38 -0
- package/dist/packages/firestore/test/unit/local/test_index_manager.d.ts +11 -0
- package/dist/packages/firestore/test/unit/local/test_remote_document_cache.d.ts +4 -2
- package/dist/packages/firestore/test/unit/local/test_remote_document_change_buffer.d.ts +1 -1
- package/dist/packages/firestore/test/unit/model/target_index_matcher.test.d.ts +17 -0
- package/dist/packages/firestore/test/util/helpers.d.ts +1 -1
- package/dist/private.d.ts +248 -14
- package/package.json +9 -9
|
@@ -4,7 +4,7 @@ import { SDK_VERSION as i, _registerComponent as o, registerVersion as a, _getPr
|
|
|
4
4
|
|
|
5
5
|
import { Component as c } from "@firebase/component";
|
|
6
6
|
|
|
7
|
-
import { Logger as
|
|
7
|
+
import { Logger as l, LogLevel as f } from "@firebase/logger";
|
|
8
8
|
|
|
9
9
|
import { FirebaseError as h, getModularInstance as p, createMockUserToken as d } from "@firebase/util";
|
|
10
10
|
|
|
@@ -67,7 +67,7 @@ m.MOCK_USER = new m("mock-user");
|
|
|
67
67
|
* See the License for the specific language governing permissions and
|
|
68
68
|
* limitations under the License.
|
|
69
69
|
*/
|
|
70
|
-
var y = "9.6.
|
|
70
|
+
var y = "9.6.6-canary.3e9f3e253", v = new l("@firebase/firestore");
|
|
71
71
|
|
|
72
72
|
/**
|
|
73
73
|
* @license
|
|
@@ -104,7 +104,7 @@ function g(t) {
|
|
|
104
104
|
|
|
105
105
|
function w(t) {
|
|
106
106
|
for (var e = [], n = 1; n < arguments.length; n++) e[n - 1] = arguments[n];
|
|
107
|
-
if (v.logLevel <=
|
|
107
|
+
if (v.logLevel <= f.DEBUG) {
|
|
108
108
|
var i = e.map(T);
|
|
109
109
|
v.debug.apply(v, r([ "Firestore (" + y + "): " + t ], i));
|
|
110
110
|
}
|
|
@@ -112,7 +112,7 @@ function w(t) {
|
|
|
112
112
|
|
|
113
113
|
function b(t) {
|
|
114
114
|
for (var e = [], n = 1; n < arguments.length; n++) e[n - 1] = arguments[n];
|
|
115
|
-
if (v.logLevel <=
|
|
115
|
+
if (v.logLevel <= f.ERROR) {
|
|
116
116
|
var i = e.map(T);
|
|
117
117
|
v.error.apply(v, r([ "Firestore (" + y + "): " + t ], i));
|
|
118
118
|
}
|
|
@@ -122,7 +122,7 @@ function b(t) {
|
|
|
122
122
|
* @internal
|
|
123
123
|
*/ function _(t) {
|
|
124
124
|
for (var e = [], n = 1; n < arguments.length; n++) e[n - 1] = arguments[n];
|
|
125
|
-
if (v.logLevel <=
|
|
125
|
+
if (v.logLevel <= f.WARN) {
|
|
126
126
|
var i = e.map(T);
|
|
127
127
|
v.warn.apply(v, r([ "Firestore (" + y + "): " + t ], i));
|
|
128
128
|
}
|
|
@@ -225,7 +225,7 @@ e) {
|
|
|
225
225
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
226
226
|
* See the License for the specific language governing permissions and
|
|
227
227
|
* limitations under the License.
|
|
228
|
-
*/ var A = "cancelled", k = "unknown", V = "invalid-argument", D = "deadline-exceeded", P = "not-found", N = "permission-denied", q = "unauthenticated", F = "resource-exhausted", O = "failed-precondition", C = "aborted",
|
|
228
|
+
*/ var A = "cancelled", k = "unknown", V = "invalid-argument", D = "deadline-exceeded", P = "not-found", N = "permission-denied", q = "unauthenticated", F = "resource-exhausted", O = "failed-precondition", C = "aborted", L = "out-of-range", j = "unimplemented", R = "internal", M = "unavailable", U = /** @class */ function(e) {
|
|
229
229
|
/** @hideconstructor */
|
|
230
230
|
function n(
|
|
231
231
|
/**
|
|
@@ -530,6 +530,12 @@ function(t, e, n, r, i, o, a, s) {
|
|
|
530
530
|
},
|
|
531
531
|
/** Returns true if the document is in the specified collectionId. */ t.prototype.hasCollectionId = function(t) {
|
|
532
532
|
return this.path.length >= 2 && this.path.get(this.path.length - 2) === t;
|
|
533
|
+
},
|
|
534
|
+
/** Returns the collection group (i.e. the name of the parent collection) for this key. */ t.prototype.getCollectionGroup = function() {
|
|
535
|
+
return this.path.get(this.path.length - 2);
|
|
536
|
+
},
|
|
537
|
+
/** Returns the fully qualified path to the parent collection. */ t.prototype.getCollectionPath = function() {
|
|
538
|
+
return this.path.popLast();
|
|
533
539
|
}, t.prototype.isEqual = function(t) {
|
|
534
540
|
return null !== t && 0 === Z.comparator(this.path, t.path);
|
|
535
541
|
}, t.prototype.toString = function() {
|
|
@@ -651,7 +657,7 @@ function ut(t, e) {
|
|
|
651
657
|
return null == t;
|
|
652
658
|
}
|
|
653
659
|
|
|
654
|
-
/** Returns whether the value represents -0. */ function
|
|
660
|
+
/** Returns whether the value represents -0. */ function lt(t) {
|
|
655
661
|
// Detect if the value is -0.0. Based on polyfill from
|
|
656
662
|
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
|
|
657
663
|
return 0 === t && 1 / t == -1 / 0;
|
|
@@ -676,7 +682,7 @@ function ut(t, e) {
|
|
|
676
682
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
677
683
|
* See the License for the specific language governing permissions and
|
|
678
684
|
* limitations under the License.
|
|
679
|
-
*/ var
|
|
685
|
+
*/ var ft, ht, pt = {
|
|
680
686
|
BatchGetDocuments: "batchGet",
|
|
681
687
|
Commit: "commit",
|
|
682
688
|
RunQuery: "runQuery"
|
|
@@ -759,7 +765,7 @@ function dt(t) {
|
|
|
759
765
|
// return Code.ALREADY_EXISTS;
|
|
760
766
|
case 416:
|
|
761
767
|
// Range Not Satisfiable
|
|
762
|
-
return
|
|
768
|
+
return L;
|
|
763
769
|
|
|
764
770
|
case 429:
|
|
765
771
|
// Too Many Requests
|
|
@@ -778,7 +784,7 @@ function dt(t) {
|
|
|
778
784
|
// return Code.DATA_LOSS;
|
|
779
785
|
case 501:
|
|
780
786
|
// Unimplemented
|
|
781
|
-
return
|
|
787
|
+
return j;
|
|
782
788
|
|
|
783
789
|
case 503:
|
|
784
790
|
// Service Unavailable
|
|
@@ -812,7 +818,7 @@ function dt(t) {
|
|
|
812
818
|
/**
|
|
813
819
|
* A Rest-based connection that relies on the native HTTP stack
|
|
814
820
|
* (e.g. `fetch` or a polyfill).
|
|
815
|
-
*/ (ht =
|
|
821
|
+
*/ (ht = ft || (ft = {}))[ht.OK = 0] = "OK", ht[ht.CANCELLED = 1] = "CANCELLED",
|
|
816
822
|
ht[ht.UNKNOWN = 2] = "UNKNOWN", ht[ht.INVALID_ARGUMENT = 3] = "INVALID_ARGUMENT",
|
|
817
823
|
ht[ht.DEADLINE_EXCEEDED = 4] = "DEADLINE_EXCEEDED", ht[ht.NOT_FOUND = 5] = "NOT_FOUND",
|
|
818
824
|
ht[ht.ALREADY_EXISTS = 6] = "ALREADY_EXISTS", ht[ht.PERMISSION_DENIED = 7] = "PERMISSION_DENIED",
|
|
@@ -1508,7 +1514,7 @@ var At = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
|
|
|
1508
1514
|
if ("integerValue" in t && "integerValue" in e) return Vt(t.integerValue) === Vt(e.integerValue);
|
|
1509
1515
|
if ("doubleValue" in t && "doubleValue" in e) {
|
|
1510
1516
|
var n = Vt(t.doubleValue), r = Vt(e.doubleValue);
|
|
1511
|
-
return n === r ?
|
|
1517
|
+
return n === r ? lt(n) === lt(r) : isNaN(n) && isNaN(r);
|
|
1512
1518
|
}
|
|
1513
1519
|
return !1;
|
|
1514
1520
|
}(t, e);
|
|
@@ -1535,7 +1541,7 @@ function Ct(t, e) {
|
|
|
1535
1541
|
}));
|
|
1536
1542
|
}
|
|
1537
1543
|
|
|
1538
|
-
function
|
|
1544
|
+
function Lt(t, e) {
|
|
1539
1545
|
if (t === e) return 0;
|
|
1540
1546
|
var n = Ft(t), r = Ft(e);
|
|
1541
1547
|
if (n !== r) return gt(n, r);
|
|
@@ -1555,10 +1561,10 @@ function jt(t, e) {
|
|
|
1555
1561
|
}(t, e);
|
|
1556
1562
|
|
|
1557
1563
|
case 3 /* TimestampValue */ :
|
|
1558
|
-
return
|
|
1564
|
+
return jt(t.timestampValue, e.timestampValue);
|
|
1559
1565
|
|
|
1560
1566
|
case 4 /* ServerTimestampValue */ :
|
|
1561
|
-
return
|
|
1567
|
+
return jt(qt(t), qt(e));
|
|
1562
1568
|
|
|
1563
1569
|
case 5 /* StringValue */ :
|
|
1564
1570
|
return gt(t.stringValue, e.stringValue);
|
|
@@ -1587,7 +1593,7 @@ function jt(t, e) {
|
|
|
1587
1593
|
case 9 /* ArrayValue */ :
|
|
1588
1594
|
return function(t, e) {
|
|
1589
1595
|
for (var n = t.values || [], r = e.values || [], i = 0; i < n.length && i < r.length; ++i) {
|
|
1590
|
-
var o =
|
|
1596
|
+
var o = Lt(n[i], r[i]);
|
|
1591
1597
|
if (o) return o;
|
|
1592
1598
|
}
|
|
1593
1599
|
return gt(n.length, r.length);
|
|
@@ -1604,7 +1610,7 @@ function jt(t, e) {
|
|
|
1604
1610
|
for (var a = 0; a < r.length && a < o.length; ++a) {
|
|
1605
1611
|
var s = gt(r[a], o[a]);
|
|
1606
1612
|
if (0 !== s) return s;
|
|
1607
|
-
var u =
|
|
1613
|
+
var u = Lt(n[r[a]], i[o[a]]);
|
|
1608
1614
|
if (0 !== u) return u;
|
|
1609
1615
|
}
|
|
1610
1616
|
return gt(r.length, o.length);
|
|
@@ -1615,7 +1621,7 @@ function jt(t, e) {
|
|
|
1615
1621
|
}
|
|
1616
1622
|
}
|
|
1617
1623
|
|
|
1618
|
-
function
|
|
1624
|
+
function jt(t, e) {
|
|
1619
1625
|
if ("string" == typeof t && "string" == typeof e && t.length === e.length) return gt(t, e);
|
|
1620
1626
|
var n = kt(t), r = kt(e), i = gt(n.seconds, r.seconds);
|
|
1621
1627
|
return 0 !== i ? i : gt(n.nanos, r.nanos);
|
|
@@ -1937,7 +1943,7 @@ var Wt = /** @class */ function(e) {
|
|
|
1937
1943
|
}, n.prototype.matches = function(t) {
|
|
1938
1944
|
var e = t.data.field(this.field);
|
|
1939
1945
|
// Types do not have to match in NOT_EQUAL filters.
|
|
1940
|
-
return "!=" /* NOT_EQUAL */ === this.op ? null !== e && this.D(
|
|
1946
|
+
return "!=" /* NOT_EQUAL */ === this.op ? null !== e && this.D(Lt(e, this.value)) : null !== e && Ft(this.value) === Ft(e) && this.D(Lt(e, this.value));
|
|
1941
1947
|
// Only compare types with matching backend order (such as double and int).
|
|
1942
1948
|
}, n.prototype.D = function(t) {
|
|
1943
1949
|
switch (this.op) {
|
|
@@ -2044,7 +2050,7 @@ var Wt = /** @class */ function(e) {
|
|
|
2044
2050
|
}));
|
|
2045
2051
|
}, n;
|
|
2046
2052
|
}(Wt), re = function(t, e) {
|
|
2047
|
-
this.position = t, this.
|
|
2053
|
+
this.position = t, this.inclusive = e;
|
|
2048
2054
|
}, ie = function(t, e /* ASCENDING */) {
|
|
2049
2055
|
void 0 === e && (e = "asc"), this.field = t, this.dir = e;
|
|
2050
2056
|
};
|
|
@@ -2056,7 +2062,7 @@ var Wt = /** @class */ function(e) {
|
|
|
2056
2062
|
function ae(t, e) {
|
|
2057
2063
|
if (null === t) return null === e;
|
|
2058
2064
|
if (null === e) return !1;
|
|
2059
|
-
if (t.
|
|
2065
|
+
if (t.inclusive !== e.inclusive || t.position.length !== e.position.length) return !1;
|
|
2060
2066
|
for (var n = 0; n < t.position.length; n++) if (!Ot(t.position[n], e.position[n])) return !1;
|
|
2061
2067
|
return !0;
|
|
2062
2068
|
}
|
|
@@ -2106,7 +2112,7 @@ function ce(t) {
|
|
|
2106
2112
|
return t.explicitOrderBy.length > 0 ? t.explicitOrderBy[0].field : null;
|
|
2107
2113
|
}
|
|
2108
2114
|
|
|
2109
|
-
function
|
|
2115
|
+
function le(t) {
|
|
2110
2116
|
for (var e = 0, n = t.filters; e < n.length; e++) {
|
|
2111
2117
|
var r = n[e];
|
|
2112
2118
|
if (r.N()) return r.field;
|
|
@@ -2121,7 +2127,7 @@ function fe(t) {
|
|
|
2121
2127
|
/**
|
|
2122
2128
|
* Returns whether the query matches a collection group rather than a specific
|
|
2123
2129
|
* collection.
|
|
2124
|
-
*/ function
|
|
2130
|
+
*/ function fe(t) {
|
|
2125
2131
|
return null !== t.collectionGroup;
|
|
2126
2132
|
}
|
|
2127
2133
|
|
|
@@ -2133,7 +2139,7 @@ function fe(t) {
|
|
|
2133
2139
|
var e = I(t);
|
|
2134
2140
|
if (null === e.$) {
|
|
2135
2141
|
e.$ = [];
|
|
2136
|
-
var n =
|
|
2142
|
+
var n = le(e), r = ce(e);
|
|
2137
2143
|
if (null !== n && null === r)
|
|
2138
2144
|
// In order to implicitly add key ordering, we must also add the
|
|
2139
2145
|
// inequality filter field for it to be a valid query.
|
|
@@ -2166,7 +2172,7 @@ function fe(t) {
|
|
|
2166
2172
|
n.push(new ie(o.field, a));
|
|
2167
2173
|
}
|
|
2168
2174
|
// We need to swap the cursors to match the now-flipped query ordering.
|
|
2169
|
-
var s = e.endAt ? new re(e.endAt.position, !e.endAt.
|
|
2175
|
+
var s = e.endAt ? new re(e.endAt.position, !e.endAt.inclusive) : null, u = e.startAt ? new re(e.startAt.position, !e.startAt.inclusive) : null;
|
|
2170
2176
|
// Now return as a LimitType.First query.
|
|
2171
2177
|
e.S = Ht(e.path, e.collectionGroup, n, e.filters, e.limit, s, u);
|
|
2172
2178
|
}
|
|
@@ -2200,7 +2206,7 @@ function fe(t) {
|
|
|
2200
2206
|
*/
|
|
2201
2207
|
function de(t, e) {
|
|
2202
2208
|
return function(t) {
|
|
2203
|
-
return "number" == typeof t && Number.isInteger(t) && !
|
|
2209
|
+
return "number" == typeof t && Number.isInteger(t) && !lt(t) && t <= Number.MAX_SAFE_INTEGER && t >= Number.MIN_SAFE_INTEGER;
|
|
2204
2210
|
}(e) ?
|
|
2205
2211
|
/**
|
|
2206
2212
|
* Returns an IntegerValue for `value`.
|
|
@@ -2222,7 +2228,7 @@ function de(t, e) {
|
|
|
2222
2228
|
};
|
|
2223
2229
|
}
|
|
2224
2230
|
return {
|
|
2225
|
-
doubleValue:
|
|
2231
|
+
doubleValue: lt(e) ? "-0" : e
|
|
2226
2232
|
};
|
|
2227
2233
|
}(t, e);
|
|
2228
2234
|
}
|
|
@@ -2390,17 +2396,17 @@ function Ce(t, e) {
|
|
|
2390
2396
|
return Oe(t.databaseId, e.path);
|
|
2391
2397
|
}
|
|
2392
2398
|
|
|
2393
|
-
function
|
|
2399
|
+
function Le(t, e) {
|
|
2394
2400
|
var n, r = function(t) {
|
|
2395
2401
|
var e = Z.fromString(t);
|
|
2396
|
-
return E(
|
|
2402
|
+
return E(ze(e)), e;
|
|
2397
2403
|
}(e);
|
|
2398
2404
|
if (r.get(1) !== t.databaseId.projectId) throw new U(V, "Tried to deserialize key from different project: " + r.get(1) + " vs " + t.databaseId.projectId);
|
|
2399
2405
|
if (r.get(3) !== t.databaseId.database) throw new U(V, "Tried to deserialize key from different database: " + r.get(3) + " vs " + t.databaseId.database);
|
|
2400
2406
|
return new nt((E((n = r).length > 4 && "documents" === n.get(4)), n.popFirst(5)));
|
|
2401
2407
|
}
|
|
2402
2408
|
|
|
2403
|
-
function
|
|
2409
|
+
function je(t, e) {
|
|
2404
2410
|
return Oe(t.databaseId, e);
|
|
2405
2411
|
}
|
|
2406
2412
|
|
|
@@ -2416,29 +2422,21 @@ function Me(t, e, n) {
|
|
|
2416
2422
|
}
|
|
2417
2423
|
|
|
2418
2424
|
function Ue(t) {
|
|
2419
|
-
return {
|
|
2420
|
-
before: t.before,
|
|
2421
|
-
values: t.position
|
|
2422
|
-
};
|
|
2423
|
-
}
|
|
2424
|
-
|
|
2425
|
-
// visible for testing
|
|
2426
|
-
function xe(t) {
|
|
2427
2425
|
return ke[t];
|
|
2428
2426
|
}
|
|
2429
2427
|
|
|
2430
2428
|
// visible for testing
|
|
2431
|
-
function
|
|
2429
|
+
function xe(t) {
|
|
2432
2430
|
return Ve[t];
|
|
2433
2431
|
}
|
|
2434
2432
|
|
|
2435
|
-
function
|
|
2433
|
+
function Be(t) {
|
|
2436
2434
|
return {
|
|
2437
2435
|
fieldPath: t.canonicalString()
|
|
2438
2436
|
};
|
|
2439
2437
|
}
|
|
2440
2438
|
|
|
2441
|
-
function
|
|
2439
|
+
function Ge(t) {
|
|
2442
2440
|
var e = [];
|
|
2443
2441
|
return t.fields.forEach((function(t) {
|
|
2444
2442
|
return e.push(t.canonicalString());
|
|
@@ -2447,7 +2445,7 @@ function ze(t) {
|
|
|
2447
2445
|
};
|
|
2448
2446
|
}
|
|
2449
2447
|
|
|
2450
|
-
function
|
|
2448
|
+
function ze(t) {
|
|
2451
2449
|
// Resource names have at least 4 components (project ID, database ID)
|
|
2452
2450
|
return t.length >= 4 && "projects" === t.get(0) && "databases" === t.get(2);
|
|
2453
2451
|
}
|
|
@@ -2467,7 +2465,7 @@ function Qe(t) {
|
|
|
2467
2465
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2468
2466
|
* See the License for the specific language governing permissions and
|
|
2469
2467
|
* limitations under the License.
|
|
2470
|
-
*/ function
|
|
2468
|
+
*/ function Qe(t) {
|
|
2471
2469
|
return new De(t, /* useProto3Json= */ !0);
|
|
2472
2470
|
}
|
|
2473
2471
|
|
|
@@ -2495,7 +2493,7 @@ function Qe(t) {
|
|
|
2495
2493
|
* backoff curve, and a +/- 50% "jitter" that is calculated and added to the
|
|
2496
2494
|
* base delay. This prevents clients from accidentally synchronizing their
|
|
2497
2495
|
* delays causing spikes of load to the backend.
|
|
2498
|
-
*/ var
|
|
2496
|
+
*/ var Ke = /** @class */ function() {
|
|
2499
2497
|
function t(
|
|
2500
2498
|
/**
|
|
2501
2499
|
* The AsyncQueue to run backoff operations on.
|
|
@@ -2569,7 +2567,7 @@ function Qe(t) {
|
|
|
2569
2567
|
/** Returns a random value in the range [-currentBaseMs/2, currentBaseMs/2] */ t.prototype.Y = function() {
|
|
2570
2568
|
return (Math.random() - .5) * this.j;
|
|
2571
2569
|
}, t;
|
|
2572
|
-
}(),
|
|
2570
|
+
}(), He = /** @class */ function(e) {
|
|
2573
2571
|
function n(t, n, r, i) {
|
|
2574
2572
|
var o = this;
|
|
2575
2573
|
return (o = e.call(this) || this).authCredentials = t, o.appCheckCredentials = n,
|
|
@@ -2629,7 +2627,7 @@ function Qe(t) {
|
|
|
2629
2627
|
*/
|
|
2630
2628
|
// TODO(firestorexp): Make sure there is only one Datastore instance per
|
|
2631
2629
|
// firestore-exp client.
|
|
2632
|
-
function
|
|
2630
|
+
function We(t, r) {
|
|
2633
2631
|
return e(this, void 0, void 0, (function() {
|
|
2634
2632
|
var e, i, o;
|
|
2635
2633
|
return n(this, (function(n) {
|
|
@@ -2645,7 +2643,7 @@ function Ye(t, r) {
|
|
|
2645
2643
|
delete: Ce(t, e.key)
|
|
2646
2644
|
}; else if (e instanceof Ee) n = {
|
|
2647
2645
|
update: Me(t, e.key, e.data),
|
|
2648
|
-
updateMask:
|
|
2646
|
+
updateMask: Ge(e.fieldMask)
|
|
2649
2647
|
}; else {
|
|
2650
2648
|
if (!(e instanceof Ae)) return S();
|
|
2651
2649
|
n = {
|
|
@@ -2695,7 +2693,7 @@ function Ye(t, r) {
|
|
|
2695
2693
|
}));
|
|
2696
2694
|
}
|
|
2697
2695
|
|
|
2698
|
-
function
|
|
2696
|
+
function Ye(t, r) {
|
|
2699
2697
|
return e(this, void 0, void 0, (function() {
|
|
2700
2698
|
var e, i, o, a, s, u;
|
|
2701
2699
|
return n(this, (function(n) {
|
|
@@ -2712,7 +2710,7 @@ function $e(t, r) {
|
|
|
2712
2710
|
var n = function(t, e) {
|
|
2713
2711
|
return "found" in e ? function(t, e) {
|
|
2714
2712
|
E(!!e.found), e.found.name, e.found.updateTime;
|
|
2715
|
-
var n =
|
|
2713
|
+
var n = Le(t, e.found.name), r = Fe(e.found.updateTime), i = new zt({
|
|
2716
2714
|
mapValue: {
|
|
2717
2715
|
fields: e.found.fields
|
|
2718
2716
|
}
|
|
@@ -2720,7 +2718,7 @@ function $e(t, r) {
|
|
|
2720
2718
|
return Qt.newFoundDocument(n, r, i);
|
|
2721
2719
|
}(t, e) : "missing" in e ? function(t, e) {
|
|
2722
2720
|
E(!!e.missing), E(!!e.readTime);
|
|
2723
|
-
var n =
|
|
2721
|
+
var n = Le(t, e.missing), r = Fe(e.readTime);
|
|
2724
2722
|
return Qt.newNoDocument(n, r);
|
|
2725
2723
|
}(t, e) : S();
|
|
2726
2724
|
}(e.q, t);
|
|
@@ -2734,7 +2732,7 @@ function $e(t, r) {
|
|
|
2734
2732
|
}));
|
|
2735
2733
|
}
|
|
2736
2734
|
|
|
2737
|
-
function
|
|
2735
|
+
function $e(t, r) {
|
|
2738
2736
|
return e(this, void 0, void 0, (function() {
|
|
2739
2737
|
var e, i;
|
|
2740
2738
|
return n(this, (function(n) {
|
|
@@ -2745,10 +2743,10 @@ function Xe(t, r) {
|
|
|
2745
2743
|
var n = {
|
|
2746
2744
|
structuredQuery: {}
|
|
2747
2745
|
}, r = e.path;
|
|
2748
|
-
null !== e.collectionGroup ? (n.parent =
|
|
2746
|
+
null !== e.collectionGroup ? (n.parent = je(t, r), n.structuredQuery.from = [ {
|
|
2749
2747
|
collectionId: e.collectionGroup,
|
|
2750
2748
|
allDescendants: !0
|
|
2751
|
-
} ]) : (n.parent =
|
|
2749
|
+
} ]) : (n.parent = je(t, r.popLast()), n.structuredQuery.from = [ {
|
|
2752
2750
|
collectionId: r.lastSegment()
|
|
2753
2751
|
} ]);
|
|
2754
2752
|
var i = function(t) {
|
|
@@ -2759,34 +2757,34 @@ function Xe(t, r) {
|
|
|
2759
2757
|
if ("==" /* EQUAL */ === t.op) {
|
|
2760
2758
|
if (xt(t.value)) return {
|
|
2761
2759
|
unaryFilter: {
|
|
2762
|
-
field:
|
|
2760
|
+
field: Be(t.field),
|
|
2763
2761
|
op: "IS_NAN"
|
|
2764
2762
|
}
|
|
2765
2763
|
};
|
|
2766
2764
|
if (Ut(t.value)) return {
|
|
2767
2765
|
unaryFilter: {
|
|
2768
|
-
field:
|
|
2766
|
+
field: Be(t.field),
|
|
2769
2767
|
op: "IS_NULL"
|
|
2770
2768
|
}
|
|
2771
2769
|
};
|
|
2772
2770
|
} else if ("!=" /* NOT_EQUAL */ === t.op) {
|
|
2773
2771
|
if (xt(t.value)) return {
|
|
2774
2772
|
unaryFilter: {
|
|
2775
|
-
field:
|
|
2773
|
+
field: Be(t.field),
|
|
2776
2774
|
op: "IS_NOT_NAN"
|
|
2777
2775
|
}
|
|
2778
2776
|
};
|
|
2779
2777
|
if (Ut(t.value)) return {
|
|
2780
2778
|
unaryFilter: {
|
|
2781
|
-
field:
|
|
2779
|
+
field: Be(t.field),
|
|
2782
2780
|
op: "IS_NOT_NULL"
|
|
2783
2781
|
}
|
|
2784
2782
|
};
|
|
2785
2783
|
}
|
|
2786
2784
|
return {
|
|
2787
2785
|
fieldFilter: {
|
|
2788
|
-
field:
|
|
2789
|
-
op:
|
|
2786
|
+
field: Be(t.field),
|
|
2787
|
+
op: xe(t.op),
|
|
2790
2788
|
value: t.value
|
|
2791
2789
|
}
|
|
2792
2790
|
};
|
|
@@ -2806,20 +2804,27 @@ function Xe(t, r) {
|
|
|
2806
2804
|
// visible for testing
|
|
2807
2805
|
return function(t) {
|
|
2808
2806
|
return {
|
|
2809
|
-
field:
|
|
2810
|
-
direction:
|
|
2807
|
+
field: Be(t.field),
|
|
2808
|
+
direction: Ue(t.dir)
|
|
2811
2809
|
};
|
|
2812
2810
|
}(t);
|
|
2813
2811
|
}));
|
|
2814
2812
|
}(e.orderBy);
|
|
2815
2813
|
o && (n.structuredQuery.orderBy = o);
|
|
2816
|
-
var a = function(t, e) {
|
|
2814
|
+
var a, s = function(t, e) {
|
|
2817
2815
|
return t.F || ct(e) ? e : {
|
|
2818
2816
|
value: e
|
|
2819
2817
|
};
|
|
2820
2818
|
}(t, e.limit);
|
|
2821
|
-
return null !==
|
|
2822
|
-
|
|
2819
|
+
return null !== s && (n.structuredQuery.limit = s), e.startAt && (n.structuredQuery.startAt = {
|
|
2820
|
+
before: (a = e.startAt).inclusive,
|
|
2821
|
+
values: a.position
|
|
2822
|
+
}), e.endAt && (n.structuredQuery.endAt = function(t) {
|
|
2823
|
+
return {
|
|
2824
|
+
before: !t.inclusive,
|
|
2825
|
+
values: t.position
|
|
2826
|
+
};
|
|
2827
|
+
}(e.endAt)), n;
|
|
2823
2828
|
}(e.q, pe(r)), [ 4 /*yield*/ , e.T("RunQuery", i.parent, {
|
|
2824
2829
|
structuredQuery: i.structuredQuery
|
|
2825
2830
|
}) ];
|
|
@@ -2829,7 +2834,7 @@ function Xe(t, r) {
|
|
|
2829
2834
|
return !!t.document;
|
|
2830
2835
|
})).map((function(t) {
|
|
2831
2836
|
return function(t, e, n) {
|
|
2832
|
-
var r =
|
|
2837
|
+
var r = Le(t, e.name), i = Fe(e.updateTime), o = new zt({
|
|
2833
2838
|
mapValue: {
|
|
2834
2839
|
fields: e.fields
|
|
2835
2840
|
}
|
|
@@ -2857,7 +2862,7 @@ function Xe(t, r) {
|
|
|
2857
2862
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2858
2863
|
* See the License for the specific language governing permissions and
|
|
2859
2864
|
* limitations under the License.
|
|
2860
|
-
*/ var
|
|
2865
|
+
*/ var Xe = new Map;
|
|
2861
2866
|
|
|
2862
2867
|
/**
|
|
2863
2868
|
* An instance map that ensures only one Datastore exists per Firestore
|
|
@@ -2867,17 +2872,17 @@ function Xe(t, r) {
|
|
|
2867
2872
|
* Returns an initialized and started Datastore for the given Firestore
|
|
2868
2873
|
* instance. Callers must invoke removeComponents() when the Firestore
|
|
2869
2874
|
* instance is terminated.
|
|
2870
|
-
*/ function
|
|
2875
|
+
*/ function Je(t) {
|
|
2871
2876
|
if (t._terminated) throw new U(O, "The client has already been terminated.");
|
|
2872
|
-
if (!
|
|
2877
|
+
if (!Xe.has(t)) {
|
|
2873
2878
|
w("ComponentProvider", "Initializing Datastore");
|
|
2874
2879
|
var e = function(t) {
|
|
2875
2880
|
return new mt(t, fetch.bind(null));
|
|
2876
2881
|
}((i = t._databaseId, o = t.app.options.appId || "", a = t._persistenceKey, s = t._freezeSettings(),
|
|
2877
|
-
new $(i, o, a, s.host, s.ssl, s.experimentalForceLongPolling, s.experimentalAutoDetectLongPolling, s.useFetchStreams))), n =
|
|
2878
|
-
return new
|
|
2882
|
+
new $(i, o, a, s.host, s.ssl, s.experimentalForceLongPolling, s.experimentalAutoDetectLongPolling, s.useFetchStreams))), n = Qe(t._databaseId), r = function(t, e, n, r) {
|
|
2883
|
+
return new He(t, e, n, r);
|
|
2879
2884
|
}(t._authCredentials, t._appCheckCredentials, e, n);
|
|
2880
|
-
|
|
2885
|
+
Xe.set(t, r);
|
|
2881
2886
|
}
|
|
2882
2887
|
var i, o, a, s;
|
|
2883
2888
|
/**
|
|
@@ -2895,7 +2900,7 @@ function Xe(t, r) {
|
|
|
2895
2900
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2896
2901
|
* See the License for the specific language governing permissions and
|
|
2897
2902
|
* limitations under the License.
|
|
2898
|
-
*/ return
|
|
2903
|
+
*/ return Xe.get(t);
|
|
2899
2904
|
}
|
|
2900
2905
|
|
|
2901
2906
|
/**
|
|
@@ -2906,7 +2911,7 @@ function Xe(t, r) {
|
|
|
2906
2911
|
* A concrete type describing all the values that can be applied via a
|
|
2907
2912
|
* user-supplied `FirestoreSettings` object. This is a separate type so that
|
|
2908
2913
|
* defaults can be supplied and the value can be checked for equality.
|
|
2909
|
-
*/ var
|
|
2914
|
+
*/ var Ze = /** @class */ function() {
|
|
2910
2915
|
function t(t) {
|
|
2911
2916
|
var e;
|
|
2912
2917
|
if (void 0 === t.host) {
|
|
@@ -2926,14 +2931,14 @@ function Xe(t, r) {
|
|
|
2926
2931
|
return t.prototype.isEqual = function(t) {
|
|
2927
2932
|
return this.host === t.host && this.ssl === t.ssl && this.credentials === t.credentials && this.cacheSizeBytes === t.cacheSizeBytes && this.experimentalForceLongPolling === t.experimentalForceLongPolling && this.experimentalAutoDetectLongPolling === t.experimentalAutoDetectLongPolling && this.ignoreUndefinedProperties === t.ignoreUndefinedProperties && this.useFetchStreams === t.useFetchStreams;
|
|
2928
2933
|
}, t;
|
|
2929
|
-
}(),
|
|
2934
|
+
}(), tn = /** @class */ function() {
|
|
2930
2935
|
/** @hideconstructor */
|
|
2931
2936
|
function t(t, e, n) {
|
|
2932
2937
|
this._authCredentials = e, this._appCheckCredentials = n,
|
|
2933
2938
|
/**
|
|
2934
2939
|
* Whether it's a Firestore or Firestore Lite instance.
|
|
2935
2940
|
*/
|
|
2936
|
-
this.type = "firestore-lite", this._persistenceKey = "(lite)", this._settings = new
|
|
2941
|
+
this.type = "firestore-lite", this._persistenceKey = "(lite)", this._settings = new Ze({}),
|
|
2937
2942
|
this._settingsFrozen = !1, t instanceof X ? this._databaseId = t : (this._app = t,
|
|
2938
2943
|
this._databaseId = function(t) {
|
|
2939
2944
|
if (!Object.prototype.hasOwnProperty.apply(t.options, [ "projectId" ])) throw new U(V, '"projectId" not provided in firebase.initializeApp.');
|
|
@@ -2965,7 +2970,7 @@ function Xe(t, r) {
|
|
|
2965
2970
|
configurable: !0
|
|
2966
2971
|
}), t.prototype._setSettings = function(t) {
|
|
2967
2972
|
if (this._settingsFrozen) throw new U(O, "Firestore has already been started and its settings can no longer be changed. You can only modify settings before calling any other methods on a Firestore object.");
|
|
2968
|
-
this._settings = new
|
|
2973
|
+
this._settings = new Ze(t), void 0 !== t.credentials && (this._authCredentials = function(t) {
|
|
2969
2974
|
if (!t) return new G;
|
|
2970
2975
|
switch (t.type) {
|
|
2971
2976
|
case "gapi":
|
|
@@ -3003,8 +3008,8 @@ function Xe(t, r) {
|
|
|
3003
3008
|
* Only ever called once.
|
|
3004
3009
|
*/
|
|
3005
3010
|
t.prototype._terminate = function() {
|
|
3006
|
-
return t = this, (e =
|
|
3007
|
-
|
|
3011
|
+
return t = this, (e = Xe.get(t)) && (w("ComponentProvider", "Removing Datastore"),
|
|
3012
|
+
Xe.delete(t), e.terminate()), Promise.resolve();
|
|
3008
3013
|
var t, e;
|
|
3009
3014
|
}, t;
|
|
3010
3015
|
}();
|
|
@@ -3029,7 +3034,7 @@ function Xe(t, r) {
|
|
|
3029
3034
|
* The Cloud Firestore service interface.
|
|
3030
3035
|
*
|
|
3031
3036
|
* Do not call this constructor directly. Instead, use {@link getFirestore}.
|
|
3032
|
-
*/ function
|
|
3037
|
+
*/ function en(t, e) {
|
|
3033
3038
|
var n = _getProvider(t, "firestore/lite");
|
|
3034
3039
|
if (n.isInitialized()) throw new U(O, "Firestore can only be initialized once per app.");
|
|
3035
3040
|
return n.initialize({
|
|
@@ -3045,7 +3050,7 @@ function Xe(t, r) {
|
|
|
3045
3050
|
* @param app - The {@link @firebase/app#FirebaseApp} instance that the returned `Firestore`
|
|
3046
3051
|
* instance is associated with.
|
|
3047
3052
|
* @returns The `Firestore` instance of the provided app.
|
|
3048
|
-
*/ function
|
|
3053
|
+
*/ function nn(t) {
|
|
3049
3054
|
return void 0 === t && (t = s()), _getProvider(t, "firestore/lite").getImmediate();
|
|
3050
3055
|
}
|
|
3051
3056
|
|
|
@@ -3061,10 +3066,10 @@ function Xe(t, r) {
|
|
|
3061
3066
|
* @param port - the emulator port (ex: 9000).
|
|
3062
3067
|
* @param options.mockUserToken - the mock auth token to use for unit testing
|
|
3063
3068
|
* Security Rules.
|
|
3064
|
-
*/ function
|
|
3069
|
+
*/ function rn(t, e, n, r) {
|
|
3065
3070
|
var i;
|
|
3066
3071
|
void 0 === r && (r = {});
|
|
3067
|
-
var o = (t = st(t,
|
|
3072
|
+
var o = (t = st(t, tn))._getSettings();
|
|
3068
3073
|
if ("firestore.googleapis.com" !== o.host && o.host !== e && _("Host has been set in both settings() and useEmulator(), emulator host will be used"),
|
|
3069
3074
|
t._setSettings(Object.assign(Object.assign({}, o), {
|
|
3070
3075
|
host: e + ":" + n,
|
|
@@ -3102,8 +3107,8 @@ function Xe(t, r) {
|
|
|
3102
3107
|
* @param firestore - The `Firestore` instance to terminate.
|
|
3103
3108
|
* @returns A `Promise` that is resolved when the instance has been successfully
|
|
3104
3109
|
* terminated.
|
|
3105
|
-
*/ function
|
|
3106
|
-
return t = st(t,
|
|
3110
|
+
*/ function on(t) {
|
|
3111
|
+
return t = st(t, tn), u(t.app, "firestore/lite"), t._delete()
|
|
3107
3112
|
/**
|
|
3108
3113
|
* @license
|
|
3109
3114
|
* Copyright 2020 Google LLC
|
|
@@ -3143,7 +3148,7 @@ function Xe(t, r) {
|
|
|
3143
3148
|
*/;
|
|
3144
3149
|
}
|
|
3145
3150
|
|
|
3146
|
-
var
|
|
3151
|
+
var an = /** @class */ function() {
|
|
3147
3152
|
/** @hideconstructor */
|
|
3148
3153
|
function t(t,
|
|
3149
3154
|
/**
|
|
@@ -3184,14 +3189,14 @@ var sn = /** @class */ function() {
|
|
|
3184
3189
|
* The collection this `DocumentReference` belongs to.
|
|
3185
3190
|
*/
|
|
3186
3191
|
get: function() {
|
|
3187
|
-
return new
|
|
3192
|
+
return new un(this.firestore, this.converter, this._key.path.popLast());
|
|
3188
3193
|
},
|
|
3189
3194
|
enumerable: !1,
|
|
3190
3195
|
configurable: !0
|
|
3191
3196
|
}), t.prototype.withConverter = function(e) {
|
|
3192
3197
|
return new t(this.firestore, e, this._key);
|
|
3193
3198
|
}, t;
|
|
3194
|
-
}(),
|
|
3199
|
+
}(), sn = /** @class */ function() {
|
|
3195
3200
|
// This is the lite version of the Query class in the main SDK.
|
|
3196
3201
|
/** @hideconstructor protected */
|
|
3197
3202
|
function t(t,
|
|
@@ -3206,7 +3211,7 @@ var sn = /** @class */ function() {
|
|
|
3206
3211
|
return t.prototype.withConverter = function(e) {
|
|
3207
3212
|
return new t(this.firestore, e, this._query);
|
|
3208
3213
|
}, t;
|
|
3209
|
-
}(),
|
|
3214
|
+
}(), un = /** @class */ function(e) {
|
|
3210
3215
|
/** @hideconstructor */
|
|
3211
3216
|
function n(t, n, r) {
|
|
3212
3217
|
var i = this;
|
|
@@ -3237,7 +3242,7 @@ var sn = /** @class */ function() {
|
|
|
3237
3242
|
*/
|
|
3238
3243
|
get: function() {
|
|
3239
3244
|
var t = this._path.popLast();
|
|
3240
|
-
return t.isEmpty() ? null : new
|
|
3245
|
+
return t.isEmpty() ? null : new an(this.firestore,
|
|
3241
3246
|
/* converter= */ null, new nt(t));
|
|
3242
3247
|
},
|
|
3243
3248
|
enumerable: !1,
|
|
@@ -3245,20 +3250,20 @@ var sn = /** @class */ function() {
|
|
|
3245
3250
|
}), n.prototype.withConverter = function(t) {
|
|
3246
3251
|
return new n(this.firestore, t, this._path);
|
|
3247
3252
|
}, n;
|
|
3248
|
-
}(
|
|
3253
|
+
}(sn);
|
|
3249
3254
|
|
|
3250
3255
|
/**
|
|
3251
3256
|
* A `Query` refers to a query which you can read or listen to. You can also
|
|
3252
3257
|
* construct refined `Query` objects by adding filters and ordering.
|
|
3253
|
-
*/ function
|
|
3258
|
+
*/ function cn(t, e) {
|
|
3254
3259
|
for (var n = [], i = 2; i < arguments.length; i++) n[i - 2] = arguments[i];
|
|
3255
|
-
if (t = p(t), rt("collection", "path", e), t instanceof
|
|
3260
|
+
if (t = p(t), rt("collection", "path", e), t instanceof tn) {
|
|
3256
3261
|
var o = Z.fromString.apply(Z, r([ e ], n));
|
|
3257
|
-
return ot(o), new
|
|
3262
|
+
return ot(o), new un(t, /* converter= */ null, o);
|
|
3258
3263
|
}
|
|
3259
|
-
if (!(t instanceof
|
|
3264
|
+
if (!(t instanceof an || t instanceof un)) throw new U(V, "Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");
|
|
3260
3265
|
var a = t._path.child(Z.fromString.apply(Z, r([ e ], n)));
|
|
3261
|
-
return ot(a), new
|
|
3266
|
+
return ot(a), new un(t.firestore,
|
|
3262
3267
|
/* converter= */ null, a);
|
|
3263
3268
|
}
|
|
3264
3269
|
|
|
@@ -3275,8 +3280,8 @@ var sn = /** @class */ function() {
|
|
|
3275
3280
|
* will be included. Cannot contain a slash.
|
|
3276
3281
|
* @returns The created `Query`.
|
|
3277
3282
|
*/ function ln(t, e) {
|
|
3278
|
-
if (t = st(t,
|
|
3279
|
-
return new
|
|
3283
|
+
if (t = st(t, tn), rt("collectionGroup", "collection id", e), e.indexOf("/") >= 0) throw new U(V, "Invalid collection ID '" + e + "' passed to function collectionGroup(). Collection IDs must not contain '/'.");
|
|
3284
|
+
return new sn(t,
|
|
3280
3285
|
/* converter= */ null,
|
|
3281
3286
|
/**
|
|
3282
3287
|
* Creates a new Query for a collection group query that matches all documents
|
|
@@ -3287,19 +3292,19 @@ var sn = /** @class */ function() {
|
|
|
3287
3292
|
}(e));
|
|
3288
3293
|
}
|
|
3289
3294
|
|
|
3290
|
-
function
|
|
3295
|
+
function fn(t, e) {
|
|
3291
3296
|
for (var n = [], i = 2; i < arguments.length; i++) n[i - 2] = arguments[i];
|
|
3292
3297
|
if (t = p(t),
|
|
3293
3298
|
// We allow omission of 'pathString' but explicitly prohibit passing in both
|
|
3294
3299
|
// 'undefined' and 'null'.
|
|
3295
|
-
1 === arguments.length && (e = vt.R()), rt("doc", "path", e), t instanceof
|
|
3300
|
+
1 === arguments.length && (e = vt.R()), rt("doc", "path", e), t instanceof tn) {
|
|
3296
3301
|
var o = Z.fromString.apply(Z, r([ e ], n));
|
|
3297
|
-
return it(o), new
|
|
3302
|
+
return it(o), new an(t,
|
|
3298
3303
|
/* converter= */ null, new nt(o));
|
|
3299
3304
|
}
|
|
3300
|
-
if (!(t instanceof
|
|
3305
|
+
if (!(t instanceof an || t instanceof un)) throw new U(V, "Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");
|
|
3301
3306
|
var a = t._path.child(Z.fromString.apply(Z, r([ e ], n)));
|
|
3302
|
-
return it(a), new
|
|
3307
|
+
return it(a), new an(t.firestore, t instanceof un ? t.converter : null, new nt(a));
|
|
3303
3308
|
}
|
|
3304
3309
|
|
|
3305
3310
|
/**
|
|
@@ -3309,8 +3314,8 @@ function hn(t, e) {
|
|
|
3309
3314
|
* @param right - A reference to compare.
|
|
3310
3315
|
* @returns true if the references point to the same location in the same
|
|
3311
3316
|
* Firestore database.
|
|
3312
|
-
*/ function
|
|
3313
|
-
return t = p(t), e = p(e), (t instanceof
|
|
3317
|
+
*/ function hn(t, e) {
|
|
3318
|
+
return t = p(t), e = p(e), (t instanceof an || t instanceof un) && (e instanceof an || e instanceof un) && t.firestore === e.firestore && t.path === e.path && t.converter === e.converter
|
|
3314
3319
|
/**
|
|
3315
3320
|
* Returns true if the provided queries point to the same collection and apply
|
|
3316
3321
|
* the same constraints.
|
|
@@ -3322,8 +3327,8 @@ function hn(t, e) {
|
|
|
3322
3327
|
*/;
|
|
3323
3328
|
}
|
|
3324
3329
|
|
|
3325
|
-
function
|
|
3326
|
-
return t = p(t), e = p(e), t instanceof
|
|
3330
|
+
function pn(t, e) {
|
|
3331
|
+
return t = p(t), e = p(e), t instanceof sn && e instanceof sn && t.firestore === e.firestore && function(t, e) {
|
|
3327
3332
|
return function(t, e) {
|
|
3328
3333
|
if (t.limit !== e.limit) return !1;
|
|
3329
3334
|
if (t.orderBy.length !== e.orderBy.length) return !1;
|
|
@@ -3361,7 +3366,7 @@ function dn(t, e) {
|
|
|
3361
3366
|
*/;
|
|
3362
3367
|
}
|
|
3363
3368
|
|
|
3364
|
-
var
|
|
3369
|
+
var dn = /** @class */ function() {
|
|
3365
3370
|
/**
|
|
3366
3371
|
* Creates a `FieldPath` from the provided field names. If more than one field
|
|
3367
3372
|
* name is provided, the path will point to a nested field in a document.
|
|
@@ -3386,8 +3391,8 @@ var mn = /** @class */ function() {
|
|
|
3386
3391
|
/**
|
|
3387
3392
|
* Returns a special sentinel `FieldPath` to refer to the ID of a document.
|
|
3388
3393
|
* It can be used in queries to sort or filter by the document ID.
|
|
3389
|
-
*/ function
|
|
3390
|
-
return new
|
|
3394
|
+
*/ function mn() {
|
|
3395
|
+
return new dn("__name__");
|
|
3391
3396
|
}
|
|
3392
3397
|
|
|
3393
3398
|
/**
|
|
@@ -3408,7 +3413,7 @@ var mn = /** @class */ function() {
|
|
|
3408
3413
|
*/
|
|
3409
3414
|
/**
|
|
3410
3415
|
* An immutable object representing an array of bytes.
|
|
3411
|
-
*/ var
|
|
3416
|
+
*/ var yn = /** @class */ function() {
|
|
3412
3417
|
/** @hideconstructor */
|
|
3413
3418
|
function t(t) {
|
|
3414
3419
|
this._byteString = t;
|
|
@@ -3466,14 +3471,14 @@ var mn = /** @class */ function() {
|
|
|
3466
3471
|
t.prototype.isEqual = function(t) {
|
|
3467
3472
|
return this._byteString.isEqual(t._byteString);
|
|
3468
3473
|
}, t;
|
|
3469
|
-
}(),
|
|
3474
|
+
}(), vn =
|
|
3470
3475
|
/**
|
|
3471
3476
|
* @param _methodName - The public API endpoint that returns this class.
|
|
3472
3477
|
* @hideconstructor
|
|
3473
3478
|
*/
|
|
3474
3479
|
function(t) {
|
|
3475
3480
|
this._methodName = t;
|
|
3476
|
-
},
|
|
3481
|
+
}, gn = /** @class */ function() {
|
|
3477
3482
|
/**
|
|
3478
3483
|
* Creates a new immutable `GeoPoint` object with the provided latitude and
|
|
3479
3484
|
* longitude values.
|
|
@@ -3526,14 +3531,14 @@ function(t) {
|
|
|
3526
3531
|
t.prototype._compareTo = function(t) {
|
|
3527
3532
|
return gt(this._lat, t._lat) || gt(this._long, t._long);
|
|
3528
3533
|
}, t;
|
|
3529
|
-
}(),
|
|
3534
|
+
}(), wn = /^__.*__$/, bn = /** @class */ function() {
|
|
3530
3535
|
function t(t, e, n) {
|
|
3531
3536
|
this.data = t, this.fieldMask = e, this.fieldTransforms = n;
|
|
3532
3537
|
}
|
|
3533
3538
|
return t.prototype.toMutation = function(t, e) {
|
|
3534
3539
|
return null !== this.fieldMask ? new Ee(t, this.data, this.fieldMask, e, this.fieldTransforms) : new Se(t, this.data, e, this.fieldTransforms);
|
|
3535
3540
|
}, t;
|
|
3536
|
-
}(),
|
|
3541
|
+
}(), _n = /** @class */ function() {
|
|
3537
3542
|
function t(t,
|
|
3538
3543
|
// The fieldMask does not include document transforms.
|
|
3539
3544
|
e, n) {
|
|
@@ -3563,7 +3568,7 @@ function(t) {
|
|
|
3563
3568
|
/**
|
|
3564
3569
|
* Sentinel values that can be used when writing document fields with `set()`
|
|
3565
3570
|
* or `update()`.
|
|
3566
|
-
*/ function
|
|
3571
|
+
*/ function Tn(t) {
|
|
3567
3572
|
switch (t) {
|
|
3568
3573
|
case 0 /* Set */ :
|
|
3569
3574
|
// fall through
|
|
@@ -3581,7 +3586,7 @@ function(t) {
|
|
|
3581
3586
|
}
|
|
3582
3587
|
}
|
|
3583
3588
|
|
|
3584
|
-
/** A "context" object passed around while parsing user data. */ var
|
|
3589
|
+
/** A "context" object passed around while parsing user data. */ var Sn = /** @class */ function() {
|
|
3585
3590
|
/**
|
|
3586
3591
|
* Initializes a ParseContext with the given source and path.
|
|
3587
3592
|
*
|
|
@@ -3619,16 +3624,16 @@ function(t) {
|
|
|
3619
3624
|
enumerable: !1,
|
|
3620
3625
|
configurable: !0
|
|
3621
3626
|
}),
|
|
3622
|
-
/** Returns a new context with the specified settings overwritten. */ t.prototype.
|
|
3627
|
+
/** Returns a new context with the specified settings overwritten. */ t.prototype.et = function(e) {
|
|
3623
3628
|
return new t(Object.assign(Object.assign({}, this.settings), e), this.databaseId, this.q, this.ignoreUndefinedProperties, this.fieldTransforms, this.fieldMask);
|
|
3624
|
-
}, t.prototype.
|
|
3625
|
-
var e, n = null === (e = this.path) || void 0 === e ? void 0 : e.child(t), r = this.
|
|
3629
|
+
}, t.prototype.nt = function(t) {
|
|
3630
|
+
var e, n = null === (e = this.path) || void 0 === e ? void 0 : e.child(t), r = this.et({
|
|
3626
3631
|
path: n,
|
|
3627
3632
|
rt: !1
|
|
3628
3633
|
});
|
|
3629
3634
|
return r.st(t), r;
|
|
3630
3635
|
}, t.prototype.it = function(t) {
|
|
3631
|
-
var e, n = null === (e = this.path) || void 0 === e ? void 0 : e.child(t), r = this.
|
|
3636
|
+
var e, n = null === (e = this.path) || void 0 === e ? void 0 : e.child(t), r = this.et({
|
|
3632
3637
|
path: n,
|
|
3633
3638
|
rt: !1
|
|
3634
3639
|
});
|
|
@@ -3636,12 +3641,12 @@ function(t) {
|
|
|
3636
3641
|
}, t.prototype.ot = function(t) {
|
|
3637
3642
|
// TODO(b/34871131): We don't support array paths right now; so make path
|
|
3638
3643
|
// undefined.
|
|
3639
|
-
return this.
|
|
3644
|
+
return this.et({
|
|
3640
3645
|
path: void 0,
|
|
3641
3646
|
rt: !0
|
|
3642
3647
|
});
|
|
3643
3648
|
}, t.prototype.ut = function(t) {
|
|
3644
|
-
return
|
|
3649
|
+
return Gn(t, this.settings.methodName, this.settings.ct || !1, this.path, this.settings.at);
|
|
3645
3650
|
},
|
|
3646
3651
|
/** Returns 'true' if 'fieldPath' was traversed when creating this context. */ t.prototype.contains = function(t) {
|
|
3647
3652
|
return void 0 !== this.fieldMask.find((function(e) {
|
|
@@ -3655,15 +3660,15 @@ function(t) {
|
|
|
3655
3660
|
if (this.path) for (var t = 0; t < this.path.length; t++) this.st(this.path.get(t));
|
|
3656
3661
|
}, t.prototype.st = function(t) {
|
|
3657
3662
|
if (0 === t.length) throw this.ut("Document fields must not be empty");
|
|
3658
|
-
if (
|
|
3663
|
+
if (Tn(this.tt) && wn.test(t)) throw this.ut('Document fields cannot begin and end with "__"');
|
|
3659
3664
|
}, t;
|
|
3660
|
-
}(),
|
|
3665
|
+
}(), En = /** @class */ function() {
|
|
3661
3666
|
function t(t, e, n) {
|
|
3662
|
-
this.databaseId = t, this.ignoreUndefinedProperties = e, this.q = n ||
|
|
3667
|
+
this.databaseId = t, this.ignoreUndefinedProperties = e, this.q = n || Qe(t)
|
|
3663
3668
|
/** Creates a new top-level parse context. */;
|
|
3664
3669
|
}
|
|
3665
3670
|
return t.prototype.ht = function(t, e, n, r) {
|
|
3666
|
-
return void 0 === r && (r = !1), new
|
|
3671
|
+
return void 0 === r && (r = !1), new Sn({
|
|
3667
3672
|
tt: t,
|
|
3668
3673
|
methodName: e,
|
|
3669
3674
|
at: n,
|
|
@@ -3677,30 +3682,30 @@ function(t) {
|
|
|
3677
3682
|
/**
|
|
3678
3683
|
* Helper for parsing raw user input (provided via the API) into internal model
|
|
3679
3684
|
* classes.
|
|
3680
|
-
*/ function
|
|
3681
|
-
var e = t._freezeSettings(), n =
|
|
3682
|
-
return new
|
|
3685
|
+
*/ function In(t) {
|
|
3686
|
+
var e = t._freezeSettings(), n = Qe(t._databaseId);
|
|
3687
|
+
return new En(t._databaseId, !!e.ignoreUndefinedProperties, n);
|
|
3683
3688
|
}
|
|
3684
3689
|
|
|
3685
|
-
/** Parse document data from a set() call. */ function
|
|
3690
|
+
/** Parse document data from a set() call. */ function An(t, e, n, r, i, o) {
|
|
3686
3691
|
void 0 === o && (o = {});
|
|
3687
3692
|
var a = t.ht(o.merge || o.mergeFields ? 2 /* MergeSet */ : 0 /* Set */ , e, n, i);
|
|
3688
|
-
|
|
3689
|
-
var s, u, c =
|
|
3693
|
+
Mn("Data must be an object, but it was:", a, r);
|
|
3694
|
+
var s, u, c = jn(r, a);
|
|
3690
3695
|
if (o.merge) s = new Et(a.fieldMask), u = a.fieldTransforms; else if (o.mergeFields) {
|
|
3691
|
-
for (var
|
|
3692
|
-
var p =
|
|
3696
|
+
for (var l = [], f = 0, h = o.mergeFields; f < h.length; f++) {
|
|
3697
|
+
var p = Un(e, h[f], n);
|
|
3693
3698
|
if (!a.contains(p)) throw new U(V, "Field '" + p + "' is specified in your field mask but missing from your input data.");
|
|
3694
|
-
|
|
3699
|
+
zn(l, p) || l.push(p);
|
|
3695
3700
|
}
|
|
3696
|
-
s = new Et(
|
|
3701
|
+
s = new Et(l), u = a.fieldTransforms.filter((function(t) {
|
|
3697
3702
|
return s.covers(t.field);
|
|
3698
3703
|
}));
|
|
3699
3704
|
} else s = null, u = a.fieldTransforms;
|
|
3700
|
-
return new
|
|
3705
|
+
return new bn(new zt(c), s, u);
|
|
3701
3706
|
}
|
|
3702
3707
|
|
|
3703
|
-
var
|
|
3708
|
+
var kn = /** @class */ function(e) {
|
|
3704
3709
|
function n() {
|
|
3705
3710
|
return null !== e && e.apply(this, arguments) || this;
|
|
3706
3711
|
}
|
|
@@ -3712,7 +3717,7 @@ var Vn = /** @class */ function(e) {
|
|
|
3712
3717
|
}, n.prototype.isEqual = function(t) {
|
|
3713
3718
|
return t instanceof n;
|
|
3714
3719
|
}, n;
|
|
3715
|
-
}(
|
|
3720
|
+
}(vn);
|
|
3716
3721
|
|
|
3717
3722
|
/**
|
|
3718
3723
|
* Creates a child context for parsing SerializableFieldValues.
|
|
@@ -3729,8 +3734,8 @@ var Vn = /** @class */ function(e) {
|
|
|
3729
3734
|
* context.
|
|
3730
3735
|
* @param context - The parent context.
|
|
3731
3736
|
* @param arrayElement - Whether or not the FieldValue has an array.
|
|
3732
|
-
*/ function
|
|
3733
|
-
return new
|
|
3737
|
+
*/ function Vn(t, e, n) {
|
|
3738
|
+
return new Sn({
|
|
3734
3739
|
tt: 3 /* Argument */ ,
|
|
3735
3740
|
at: e.settings.at,
|
|
3736
3741
|
methodName: t._methodName,
|
|
@@ -3738,7 +3743,7 @@ var Vn = /** @class */ function(e) {
|
|
|
3738
3743
|
}, e.databaseId, e.q, e.ignoreUndefinedProperties);
|
|
3739
3744
|
}
|
|
3740
3745
|
|
|
3741
|
-
var
|
|
3746
|
+
var Dn = /** @class */ function(e) {
|
|
3742
3747
|
function n() {
|
|
3743
3748
|
return null !== e && e.apply(this, arguments) || this;
|
|
3744
3749
|
}
|
|
@@ -3747,13 +3752,13 @@ var Pn = /** @class */ function(e) {
|
|
|
3747
3752
|
}, n.prototype.isEqual = function(t) {
|
|
3748
3753
|
return t instanceof n;
|
|
3749
3754
|
}, n;
|
|
3750
|
-
}(
|
|
3755
|
+
}(vn), Pn = /** @class */ function(e) {
|
|
3751
3756
|
function n(t, n) {
|
|
3752
3757
|
var r = this;
|
|
3753
3758
|
return (r = e.call(this, t) || this).lt = n, r;
|
|
3754
3759
|
}
|
|
3755
3760
|
return t(n, e), n.prototype._toFieldTransform = function(t) {
|
|
3756
|
-
var e =
|
|
3761
|
+
var e = Vn(this, t,
|
|
3757
3762
|
/*array=*/ !0), n = this.lt.map((function(t) {
|
|
3758
3763
|
return Ln(t, e);
|
|
3759
3764
|
})), r = new ve(n);
|
|
@@ -3762,13 +3767,13 @@ var Pn = /** @class */ function(e) {
|
|
|
3762
3767
|
// TODO(mrschmidt): Implement isEquals
|
|
3763
3768
|
return this === t;
|
|
3764
3769
|
}, n;
|
|
3765
|
-
}(
|
|
3770
|
+
}(vn), Nn = /** @class */ function(e) {
|
|
3766
3771
|
function n(t, n) {
|
|
3767
3772
|
var r = this;
|
|
3768
3773
|
return (r = e.call(this, t) || this).lt = n, r;
|
|
3769
3774
|
}
|
|
3770
3775
|
return t(n, e), n.prototype._toFieldTransform = function(t) {
|
|
3771
|
-
var e =
|
|
3776
|
+
var e = Vn(this, t,
|
|
3772
3777
|
/*array=*/ !0), n = this.lt.map((function(t) {
|
|
3773
3778
|
return Ln(t, e);
|
|
3774
3779
|
})), r = new ge(n);
|
|
@@ -3777,7 +3782,7 @@ var Pn = /** @class */ function(e) {
|
|
|
3777
3782
|
// TODO(mrschmidt): Implement isEquals
|
|
3778
3783
|
return this === t;
|
|
3779
3784
|
}, n;
|
|
3780
|
-
}(
|
|
3785
|
+
}(vn), qn = /** @class */ function(e) {
|
|
3781
3786
|
function n(t, n) {
|
|
3782
3787
|
var r = this;
|
|
3783
3788
|
return (r = e.call(this, t) || this).ft = n, r;
|
|
@@ -3789,19 +3794,19 @@ var Pn = /** @class */ function(e) {
|
|
|
3789
3794
|
// TODO(mrschmidt): Implement isEquals
|
|
3790
3795
|
return this === t;
|
|
3791
3796
|
}, n;
|
|
3792
|
-
}(
|
|
3797
|
+
}(vn);
|
|
3793
3798
|
|
|
3794
|
-
/** Parse update data from an update() call. */ function
|
|
3799
|
+
/** Parse update data from an update() call. */ function Fn(t, e, n, r) {
|
|
3795
3800
|
var i = t.ht(1 /* Update */ , e, n);
|
|
3796
|
-
|
|
3801
|
+
Mn("Data must be an object, but it was:", i, r);
|
|
3797
3802
|
var o = [], a = zt.empty();
|
|
3798
3803
|
St(r, (function(t, r) {
|
|
3799
|
-
var s =
|
|
3804
|
+
var s = Bn(e, t, n);
|
|
3800
3805
|
// For Compat types, we have to "extract" the underlying types before
|
|
3801
3806
|
// performing validation.
|
|
3802
3807
|
r = p(r);
|
|
3803
3808
|
var u = i.it(s);
|
|
3804
|
-
if (r instanceof
|
|
3809
|
+
if (r instanceof kn)
|
|
3805
3810
|
// Add it to the field mask, but don't add anything to updateData.
|
|
3806
3811
|
o.push(s); else {
|
|
3807
3812
|
var c = Ln(r, u);
|
|
@@ -3809,30 +3814,30 @@ var Pn = /** @class */ function(e) {
|
|
|
3809
3814
|
}
|
|
3810
3815
|
}));
|
|
3811
3816
|
var s = new Et(o);
|
|
3812
|
-
return new
|
|
3817
|
+
return new _n(a, s, i.fieldTransforms);
|
|
3813
3818
|
}
|
|
3814
3819
|
|
|
3815
|
-
/** Parse update data from a list of field/value arguments. */ function
|
|
3816
|
-
var a = t.ht(1 /* Update */ , e, n), s = [
|
|
3820
|
+
/** Parse update data from a list of field/value arguments. */ function On(t, e, n, r, i, o) {
|
|
3821
|
+
var a = t.ht(1 /* Update */ , e, n), s = [ Un(e, r, n) ], u = [ i ];
|
|
3817
3822
|
if (o.length % 2 != 0) throw new U(V, "Function " + e + "() needs to be called with an even number of arguments that alternate between field names and values.");
|
|
3818
|
-
for (var c = 0; c < o.length; c += 2) s.push(
|
|
3823
|
+
for (var c = 0; c < o.length; c += 2) s.push(Un(e, o[c])), u.push(o[c + 1]);
|
|
3819
3824
|
// We iterate in reverse order to pick the last value for a field if the
|
|
3820
3825
|
// user specified the field multiple times.
|
|
3821
|
-
for (var
|
|
3826
|
+
for (var l = [], f = zt.empty(), h = s.length - 1; h >= 0; --h) if (!zn(l, s[h])) {
|
|
3822
3827
|
var d = s[h], m = u[h];
|
|
3823
3828
|
// For Compat types, we have to "extract" the underlying types before
|
|
3824
3829
|
// performing validation.
|
|
3825
3830
|
m = p(m);
|
|
3826
3831
|
var y = a.it(d);
|
|
3827
|
-
if (m instanceof
|
|
3832
|
+
if (m instanceof kn)
|
|
3828
3833
|
// Add it to the field mask, but don't add anything to updateData.
|
|
3829
|
-
|
|
3834
|
+
l.push(d); else {
|
|
3830
3835
|
var v = Ln(m, y);
|
|
3831
|
-
null != v && (
|
|
3836
|
+
null != v && (l.push(d), f.set(d, v));
|
|
3832
3837
|
}
|
|
3833
3838
|
}
|
|
3834
|
-
var g = new Et(
|
|
3835
|
-
return new
|
|
3839
|
+
var g = new Et(l);
|
|
3840
|
+
return new _n(f, g, a.fieldTransforms);
|
|
3836
3841
|
}
|
|
3837
3842
|
|
|
3838
3843
|
/**
|
|
@@ -3841,7 +3846,7 @@ var Pn = /** @class */ function(e) {
|
|
|
3841
3846
|
*
|
|
3842
3847
|
* @param allowArrays - Whether the query value is an array that may directly
|
|
3843
3848
|
* contain additional arrays (e.g. the operand of an `in` query).
|
|
3844
|
-
*/ function
|
|
3849
|
+
*/ function Cn(t, e, n, r) {
|
|
3845
3850
|
return void 0 === r && (r = !1), Ln(n, t.ht(r ? 4 /* ArrayArgument */ : 3 /* Argument */ , e));
|
|
3846
3851
|
}
|
|
3847
3852
|
|
|
@@ -3854,11 +3859,11 @@ var Pn = /** @class */ function(e) {
|
|
|
3854
3859
|
* @returns The parsed value, or null if the value was a FieldValue sentinel
|
|
3855
3860
|
* that should not be included in the resulting parsed data.
|
|
3856
3861
|
*/ function Ln(t, e) {
|
|
3857
|
-
if (
|
|
3862
|
+
if (Rn(
|
|
3858
3863
|
// Unwrap the API type from the Compat SDK. This will return the API type
|
|
3859
3864
|
// from firestore-exp.
|
|
3860
|
-
t = p(t))) return
|
|
3861
|
-
if (t instanceof
|
|
3865
|
+
t = p(t))) return Mn("Unsupported field value:", e, t), jn(t, e);
|
|
3866
|
+
if (t instanceof vn)
|
|
3862
3867
|
// FieldValues usually parse into transforms (except deleteField())
|
|
3863
3868
|
// in which case we do not want to include this field in our parsed data
|
|
3864
3869
|
// (as doing so will overwrite the field directly prior to the transform
|
|
@@ -3870,7 +3875,7 @@ var Pn = /** @class */ function(e) {
|
|
|
3870
3875
|
*/
|
|
3871
3876
|
return function(t, e) {
|
|
3872
3877
|
// Sentinels are only supported with writes, and not within arrays.
|
|
3873
|
-
if (!
|
|
3878
|
+
if (!Tn(e.tt)) throw e.ut(t._methodName + "() can only be used with update() and set()");
|
|
3874
3879
|
if (!e.path) throw e.ut(t._methodName + "() is not currently supported inside arrays");
|
|
3875
3880
|
var n = t._toFieldTransform(e);
|
|
3876
3881
|
n && e.fieldTransforms.push(n);
|
|
@@ -3934,16 +3939,16 @@ var Pn = /** @class */ function(e) {
|
|
|
3934
3939
|
timestampValue: Pe(e.q, r)
|
|
3935
3940
|
};
|
|
3936
3941
|
}
|
|
3937
|
-
if (t instanceof
|
|
3942
|
+
if (t instanceof gn) return {
|
|
3938
3943
|
geoPointValue: {
|
|
3939
3944
|
latitude: t.latitude,
|
|
3940
3945
|
longitude: t.longitude
|
|
3941
3946
|
}
|
|
3942
3947
|
};
|
|
3943
|
-
if (t instanceof
|
|
3948
|
+
if (t instanceof yn) return {
|
|
3944
3949
|
bytesValue: Ne(e.q, t._byteString)
|
|
3945
3950
|
};
|
|
3946
|
-
if (t instanceof
|
|
3951
|
+
if (t instanceof an) {
|
|
3947
3952
|
var i = e.databaseId, o = t.firestore._databaseId;
|
|
3948
3953
|
if (!o.isEqual(i)) throw e.ut("Document reference is for database " + o.projectId + "/" + o.database + " but should be for database " + i.projectId + "/" + i.database);
|
|
3949
3954
|
return {
|
|
@@ -3954,7 +3959,7 @@ var Pn = /** @class */ function(e) {
|
|
|
3954
3959
|
}(t, e);
|
|
3955
3960
|
}
|
|
3956
3961
|
|
|
3957
|
-
function
|
|
3962
|
+
function jn(t, e) {
|
|
3958
3963
|
var n = {};
|
|
3959
3964
|
return function(t) {
|
|
3960
3965
|
for (var e in t) if (Object.prototype.hasOwnProperty.call(t, e)) return !1;
|
|
@@ -3963,7 +3968,7 @@ function Rn(t, e) {
|
|
|
3963
3968
|
// If we encounter an empty object, we explicitly add it to the update
|
|
3964
3969
|
// mask to ensure that the server creates a map entry.
|
|
3965
3970
|
e.path && e.path.length > 0 && e.fieldMask.push(e.path) : St(t, (function(t, r) {
|
|
3966
|
-
var i = Ln(r, e.
|
|
3971
|
+
var i = Ln(r, e.nt(t));
|
|
3967
3972
|
null != i && (n[t] = i);
|
|
3968
3973
|
})), {
|
|
3969
3974
|
mapValue: {
|
|
@@ -3972,12 +3977,12 @@ function Rn(t, e) {
|
|
|
3972
3977
|
};
|
|
3973
3978
|
}
|
|
3974
3979
|
|
|
3975
|
-
function
|
|
3976
|
-
return !("object" != typeof t || null === t || t instanceof Array || t instanceof Date || t instanceof bt || t instanceof
|
|
3980
|
+
function Rn(t) {
|
|
3981
|
+
return !("object" != typeof t || null === t || t instanceof Array || t instanceof Date || t instanceof bt || t instanceof gn || t instanceof yn || t instanceof an || t instanceof vn);
|
|
3977
3982
|
}
|
|
3978
3983
|
|
|
3979
|
-
function
|
|
3980
|
-
if (!
|
|
3984
|
+
function Mn(t, e, n) {
|
|
3985
|
+
if (!Rn(n) || !function(t) {
|
|
3981
3986
|
return "object" == typeof t && null !== t && (Object.getPrototypeOf(t) === Object.prototype || null === Object.getPrototypeOf(t));
|
|
3982
3987
|
}(n)) {
|
|
3983
3988
|
var r = at(n);
|
|
@@ -3987,20 +3992,20 @@ function Un(t, e, n) {
|
|
|
3987
3992
|
|
|
3988
3993
|
/**
|
|
3989
3994
|
* Helper that calls fromDotSeparatedString() but wraps any error thrown.
|
|
3990
|
-
*/ function
|
|
3995
|
+
*/ function Un(t, e, n) {
|
|
3991
3996
|
if (
|
|
3992
3997
|
// If required, replace the FieldPath Compat class with with the firestore-exp
|
|
3993
3998
|
// FieldPath.
|
|
3994
|
-
(e = p(e)) instanceof
|
|
3995
|
-
if ("string" == typeof e) return
|
|
3996
|
-
throw
|
|
3999
|
+
(e = p(e)) instanceof dn) return e._internalPath;
|
|
4000
|
+
if ("string" == typeof e) return Bn(t, e);
|
|
4001
|
+
throw Gn("Field path arguments must be of type string or ", t,
|
|
3997
4002
|
/* hasConverter= */ !1,
|
|
3998
4003
|
/* path= */ void 0, n);
|
|
3999
4004
|
}
|
|
4000
4005
|
|
|
4001
4006
|
/**
|
|
4002
4007
|
* Matches any characters in a field path string that are reserved.
|
|
4003
|
-
*/ var
|
|
4008
|
+
*/ var xn = new RegExp("[~\\*/\\[\\]]");
|
|
4004
4009
|
|
|
4005
4010
|
/**
|
|
4006
4011
|
* Wraps fromDotSeparatedString with an error message about the method that
|
|
@@ -4010,20 +4015,20 @@ function Un(t, e, n) {
|
|
|
4010
4015
|
* split on dots.
|
|
4011
4016
|
* @param targetDoc - The document against which the field path will be
|
|
4012
4017
|
* evaluated.
|
|
4013
|
-
*/ function
|
|
4014
|
-
if (e.search(
|
|
4018
|
+
*/ function Bn(t, e, n) {
|
|
4019
|
+
if (e.search(xn) >= 0) throw Gn("Invalid field path (" + e + "). Paths must not contain '~', '*', '/', '[', or ']'", t,
|
|
4015
4020
|
/* hasConverter= */ !1,
|
|
4016
4021
|
/* path= */ void 0, n);
|
|
4017
4022
|
try {
|
|
4018
|
-
return (new (
|
|
4023
|
+
return (new (dn.bind.apply(dn, r([ void 0 ], e.split(".")))))._internalPath;
|
|
4019
4024
|
} catch (r) {
|
|
4020
|
-
throw
|
|
4025
|
+
throw Gn("Invalid field path (" + e + "). Paths must not be empty, begin with '.', end with '.', or contain '..'", t,
|
|
4021
4026
|
/* hasConverter= */ !1,
|
|
4022
4027
|
/* path= */ void 0, n);
|
|
4023
4028
|
}
|
|
4024
4029
|
}
|
|
4025
4030
|
|
|
4026
|
-
function
|
|
4031
|
+
function Gn(t, e, n, r, i) {
|
|
4027
4032
|
var o = r && !r.isEmpty(), a = void 0 !== i, s = "Function " + e + "() called with invalid data";
|
|
4028
4033
|
n && (s += " (via `toFirestore()`)");
|
|
4029
4034
|
var u = "";
|
|
@@ -4032,7 +4037,7 @@ function zn(t, e, n, r, i) {
|
|
|
4032
4037
|
/** Checks `haystack` if FieldPath `needle` is present. Runs in O(n). */;
|
|
4033
4038
|
}
|
|
4034
4039
|
|
|
4035
|
-
function
|
|
4040
|
+
function zn(t, e) {
|
|
4036
4041
|
return t.some((function(t) {
|
|
4037
4042
|
return t.isEqual(e);
|
|
4038
4043
|
}));
|
|
@@ -4062,7 +4067,7 @@ function Qn(t, e) {
|
|
|
4062
4067
|
* For a `DocumentSnapshot` that points to a non-existing document, any data
|
|
4063
4068
|
* access will return 'undefined'. You can use the `exists()` method to
|
|
4064
4069
|
* explicitly verify a document's existence.
|
|
4065
|
-
*/ var
|
|
4070
|
+
*/ var Qn = /** @class */ function() {
|
|
4066
4071
|
// Note: This class is stripped down version of the DocumentSnapshot in
|
|
4067
4072
|
// the legacy SDK. The changes are:
|
|
4068
4073
|
// - No support for SnapshotMetadata.
|
|
@@ -4083,7 +4088,7 @@ function Qn(t, e) {
|
|
|
4083
4088
|
* The `DocumentReference` for the document included in the `DocumentSnapshot`.
|
|
4084
4089
|
*/
|
|
4085
4090
|
get: function() {
|
|
4086
|
-
return new
|
|
4091
|
+
return new an(this._firestore, this._converter, this._key);
|
|
4087
4092
|
},
|
|
4088
4093
|
enumerable: !1,
|
|
4089
4094
|
configurable: !0
|
|
@@ -4108,7 +4113,7 @@ function Qn(t, e) {
|
|
|
4108
4113
|
if (this._converter) {
|
|
4109
4114
|
// We only want to use the converter and create a new DocumentSnapshot
|
|
4110
4115
|
// if a converter has been provided.
|
|
4111
|
-
var t = new
|
|
4116
|
+
var t = new Kn(this._firestore, this._userDataWriter, this._key, this._document,
|
|
4112
4117
|
/* converter= */ null);
|
|
4113
4118
|
return this._converter.fromFirestore(t);
|
|
4114
4119
|
}
|
|
@@ -4128,11 +4133,11 @@ function Qn(t, e) {
|
|
|
4128
4133
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4129
4134
|
t.prototype.get = function(t) {
|
|
4130
4135
|
if (this._document) {
|
|
4131
|
-
var e = this._document.data.field(
|
|
4136
|
+
var e = this._document.data.field(Yn("DocumentSnapshot.get", t));
|
|
4132
4137
|
if (null !== e) return this._userDataWriter.convertValue(e);
|
|
4133
4138
|
}
|
|
4134
4139
|
}, t;
|
|
4135
|
-
}(),
|
|
4140
|
+
}(), Kn = /** @class */ function(e) {
|
|
4136
4141
|
function n() {
|
|
4137
4142
|
return null !== e && e.apply(this, arguments) || this;
|
|
4138
4143
|
}
|
|
@@ -4144,7 +4149,7 @@ function Qn(t, e) {
|
|
|
4144
4149
|
*/ return t(n, e), n.prototype.data = function() {
|
|
4145
4150
|
return e.prototype.data.call(this);
|
|
4146
4151
|
}, n;
|
|
4147
|
-
}(
|
|
4152
|
+
}(Qn), Hn = /** @class */ function() {
|
|
4148
4153
|
/** @hideconstructor */
|
|
4149
4154
|
function t(t, e) {
|
|
4150
4155
|
this._docs = e, this.query = t;
|
|
@@ -4198,15 +4203,15 @@ function Qn(t, e) {
|
|
|
4198
4203
|
* @param right - A snapshot to compare.
|
|
4199
4204
|
* @returns true if the snapshots are equal.
|
|
4200
4205
|
*/
|
|
4201
|
-
function
|
|
4202
|
-
return t = p(t), e = p(e), t instanceof
|
|
4206
|
+
function Wn(t, e) {
|
|
4207
|
+
return t = p(t), e = p(e), t instanceof Qn && e instanceof Qn ? t._firestore === e._firestore && t._key.isEqual(e._key) && (null === t._document ? null === e._document : t._document.isEqual(e._document)) && t._converter === e._converter : t instanceof Hn && e instanceof Hn && pn(t.query, e.query) && wt(t.docs, e.docs, Wn)
|
|
4203
4208
|
/**
|
|
4204
4209
|
* Helper that calls `fromDotSeparatedString()` but wraps any error thrown.
|
|
4205
4210
|
*/;
|
|
4206
4211
|
}
|
|
4207
4212
|
|
|
4208
|
-
function
|
|
4209
|
-
return "string" == typeof e ?
|
|
4213
|
+
function Yn(t, e) {
|
|
4214
|
+
return "string" == typeof e ? Bn(t, e) : e instanceof dn ? e._internalPath : e._delegate._internalPath;
|
|
4210
4215
|
}
|
|
4211
4216
|
|
|
4212
4217
|
/**
|
|
@@ -4232,7 +4237,7 @@ function $n(t, e) {
|
|
|
4232
4237
|
* endBefore:1}, {@link (endAt:1)}, {@link limit} or {@link limitToLast} and
|
|
4233
4238
|
* can then be passed to {@link query} to create a new query instance that
|
|
4234
4239
|
* also contains this `QueryConstraint`.
|
|
4235
|
-
*/ var
|
|
4240
|
+
*/ var $n = function() {};
|
|
4236
4241
|
|
|
4237
4242
|
/**
|
|
4238
4243
|
* Creates a new immutable instance of {@link Query} that is extended to also include
|
|
@@ -4242,7 +4247,7 @@ function $n(t, e) {
|
|
|
4242
4247
|
* @param queryConstraints - The list of {@link QueryConstraint}s to apply.
|
|
4243
4248
|
* @throws if any of the provided query constraints cannot be combined with the
|
|
4244
4249
|
* existing or new constraints.
|
|
4245
|
-
*/ function
|
|
4250
|
+
*/ function Xn(t) {
|
|
4246
4251
|
for (var e = [], n = 1; n < arguments.length; n++) e[n - 1] = arguments[n];
|
|
4247
4252
|
for (var r = 0, i = e; r < i.length; r++) {
|
|
4248
4253
|
var o = i[r];
|
|
@@ -4251,39 +4256,39 @@ function $n(t, e) {
|
|
|
4251
4256
|
return t;
|
|
4252
4257
|
}
|
|
4253
4258
|
|
|
4254
|
-
var
|
|
4259
|
+
var Jn = /** @class */ function(e) {
|
|
4255
4260
|
function n(t, n, r) {
|
|
4256
4261
|
var i = this;
|
|
4257
4262
|
return (i = e.call(this) || this).dt = t, i.wt = n, i.yt = r, i.type = "where",
|
|
4258
4263
|
i;
|
|
4259
4264
|
}
|
|
4260
4265
|
return t(n, e), n.prototype._apply = function(t) {
|
|
4261
|
-
var e =
|
|
4266
|
+
var e = In(t.firestore), n = function(t, e, n, r, i, o, a) {
|
|
4262
4267
|
var s;
|
|
4263
4268
|
if (i.isKeyField()) {
|
|
4264
4269
|
if ("array-contains" /* ARRAY_CONTAINS */ === o || "array-contains-any" /* ARRAY_CONTAINS_ANY */ === o) throw new U(V, "Invalid Query. You can't perform '" + o + "' queries on documentId().");
|
|
4265
4270
|
if ("in" /* IN */ === o || "not-in" /* NOT_IN */ === o) {
|
|
4266
|
-
|
|
4267
|
-
for (var u = [], c = 0,
|
|
4268
|
-
var
|
|
4269
|
-
u.push(
|
|
4271
|
+
pr(a, o);
|
|
4272
|
+
for (var u = [], c = 0, l = a; c < l.length; c++) {
|
|
4273
|
+
var f = l[c];
|
|
4274
|
+
u.push(hr(r, t, f));
|
|
4270
4275
|
}
|
|
4271
4276
|
s = {
|
|
4272
4277
|
arrayValue: {
|
|
4273
4278
|
values: u
|
|
4274
4279
|
}
|
|
4275
4280
|
};
|
|
4276
|
-
} else s =
|
|
4277
|
-
} else "in" /* IN */ !== o && "not-in" /* NOT_IN */ !== o && "array-contains-any" /* ARRAY_CONTAINS_ANY */ !== o ||
|
|
4278
|
-
s =
|
|
4281
|
+
} else s = hr(r, t, a);
|
|
4282
|
+
} else "in" /* IN */ !== o && "not-in" /* NOT_IN */ !== o && "array-contains-any" /* ARRAY_CONTAINS_ANY */ !== o || pr(a, o),
|
|
4283
|
+
s = Cn(n, "where", a,
|
|
4279
4284
|
/* allowArrays= */ "in" /* IN */ === o || "not-in" /* NOT_IN */ === o);
|
|
4280
4285
|
var h = Wt.create(i, o, s);
|
|
4281
4286
|
return function(t, e) {
|
|
4282
4287
|
if (e.N()) {
|
|
4283
|
-
var n =
|
|
4288
|
+
var n = le(t);
|
|
4284
4289
|
if (null !== n && !n.isEqual(e.field)) throw new U(V, "Invalid query. All where filters with an inequality (<, <=, !=, not-in, >, or >=) must be on the same field. But you have inequality filters on '" + n.toString() + "' and '" + e.field.toString() + "'");
|
|
4285
4290
|
var r = ce(t);
|
|
4286
|
-
null !== r &&
|
|
4291
|
+
null !== r && dr(t, e.field, r);
|
|
4287
4292
|
}
|
|
4288
4293
|
var i = function(t, e) {
|
|
4289
4294
|
for (var n = 0, r = t.filters; n < r.length; n++) {
|
|
@@ -4330,12 +4335,12 @@ var Zn = /** @class */ function(e) {
|
|
|
4330
4335
|
throw i === e.op ? new U(V, "Invalid query. You cannot use more than one '" + e.op.toString() + "' filter.") : new U(V, "Invalid query. You cannot use '" + e.op.toString() + "' filters with '" + i.toString() + "' filters.");
|
|
4331
4336
|
}(t, h), h;
|
|
4332
4337
|
}(t._query, 0, e, t.firestore._databaseId, this.dt, this.wt, this.yt);
|
|
4333
|
-
return new
|
|
4338
|
+
return new sn(t.firestore, t.converter, function(t, e) {
|
|
4334
4339
|
var n = t.filters.concat([ e ]);
|
|
4335
4340
|
return new se(t.path, t.collectionGroup, t.explicitOrderBy.slice(), n, t.limit, t.limitType, t.startAt, t.endAt);
|
|
4336
4341
|
}(t._query, n));
|
|
4337
4342
|
}, n;
|
|
4338
|
-
}(
|
|
4343
|
+
}($n);
|
|
4339
4344
|
|
|
4340
4345
|
/**
|
|
4341
4346
|
* Creates a {@link QueryConstraint} that enforces that documents must contain the
|
|
@@ -4347,12 +4352,12 @@ var Zn = /** @class */ function(e) {
|
|
|
4347
4352
|
* "<=", "!=").
|
|
4348
4353
|
* @param value - The value for comparison
|
|
4349
4354
|
* @returns The created {@link Query}.
|
|
4350
|
-
*/ function
|
|
4351
|
-
var r = e, i =
|
|
4352
|
-
return new
|
|
4355
|
+
*/ function Zn(t, e, n) {
|
|
4356
|
+
var r = e, i = Yn("where", t);
|
|
4357
|
+
return new Jn(i, r, n);
|
|
4353
4358
|
}
|
|
4354
4359
|
|
|
4355
|
-
var
|
|
4360
|
+
var tr = /** @class */ function(e) {
|
|
4356
4361
|
function n(t, n) {
|
|
4357
4362
|
var r = this;
|
|
4358
4363
|
return (r = e.call(this) || this).dt = t, r._t = n, r.type = "orderBy", r;
|
|
@@ -4365,18 +4370,18 @@ var er = /** @class */ function(e) {
|
|
|
4365
4370
|
return function(t, e) {
|
|
4366
4371
|
if (null === ce(t)) {
|
|
4367
4372
|
// This is the first order by. It must match any inequality.
|
|
4368
|
-
var n =
|
|
4369
|
-
null !== n &&
|
|
4373
|
+
var n = le(t);
|
|
4374
|
+
null !== n && dr(t, n, e.field);
|
|
4370
4375
|
}
|
|
4371
4376
|
}(t, r), r;
|
|
4372
4377
|
}(t._query, this.dt, this._t);
|
|
4373
|
-
return new
|
|
4378
|
+
return new sn(t.firestore, t.converter, function(t, e) {
|
|
4374
4379
|
// TODO(dimond): validate that orderBy does not list the same key twice.
|
|
4375
4380
|
var n = t.explicitOrderBy.concat([ e ]);
|
|
4376
4381
|
return new se(t.path, t.collectionGroup, n, t.filters.slice(), t.limit, t.limitType, t.startAt, t.endAt);
|
|
4377
4382
|
}(t._query, e));
|
|
4378
4383
|
}, n;
|
|
4379
|
-
}(
|
|
4384
|
+
}($n);
|
|
4380
4385
|
|
|
4381
4386
|
/**
|
|
4382
4387
|
* Creates a {@link QueryConstraint} that sorts the query result by the
|
|
@@ -4386,31 +4391,31 @@ var er = /** @class */ function(e) {
|
|
|
4386
4391
|
* @param directionStr - Optional direction to sort by ('asc' or 'desc'). If
|
|
4387
4392
|
* not specified, order will be ascending.
|
|
4388
4393
|
* @returns The created {@link Query}.
|
|
4389
|
-
*/ function
|
|
4394
|
+
*/ function er(t, e) {
|
|
4390
4395
|
void 0 === e && (e = "asc");
|
|
4391
|
-
var n = e, r =
|
|
4392
|
-
return new
|
|
4396
|
+
var n = e, r = Yn("orderBy", t);
|
|
4397
|
+
return new tr(r, n);
|
|
4393
4398
|
}
|
|
4394
4399
|
|
|
4395
|
-
var
|
|
4400
|
+
var nr = /** @class */ function(e) {
|
|
4396
4401
|
function n(t, n, r) {
|
|
4397
4402
|
var i = this;
|
|
4398
4403
|
return (i = e.call(this) || this).type = t, i.gt = n, i.vt = r, i;
|
|
4399
4404
|
}
|
|
4400
4405
|
return t(n, e), n.prototype._apply = function(t) {
|
|
4401
|
-
return new
|
|
4406
|
+
return new sn(t.firestore, t.converter, function(t, e, n) {
|
|
4402
4407
|
return new se(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), e, n, t.startAt, t.endAt);
|
|
4403
4408
|
}(t._query, this.gt, this.vt));
|
|
4404
4409
|
}, n;
|
|
4405
|
-
}(
|
|
4410
|
+
}($n);
|
|
4406
4411
|
|
|
4407
4412
|
/**
|
|
4408
4413
|
* Creates a {@link QueryConstraint} that only returns the first matching documents.
|
|
4409
4414
|
*
|
|
4410
4415
|
* @param limit - The maximum number of items to return.
|
|
4411
4416
|
* @returns The created {@link Query}.
|
|
4412
|
-
*/ function
|
|
4413
|
-
return ut("limit", t), new
|
|
4417
|
+
*/ function rr(t) {
|
|
4418
|
+
return ut("limit", t), new nr("limit", t, "F" /* First */)
|
|
4414
4419
|
/**
|
|
4415
4420
|
* Creates a {@link QueryConstraint} that only returns the last matching documents.
|
|
4416
4421
|
*
|
|
@@ -4422,59 +4427,61 @@ var rr = /** @class */ function(e) {
|
|
|
4422
4427
|
*/;
|
|
4423
4428
|
}
|
|
4424
4429
|
|
|
4425
|
-
function
|
|
4426
|
-
return ut("limitToLast", t), new
|
|
4430
|
+
function ir(t) {
|
|
4431
|
+
return ut("limitToLast", t), new nr("limitToLast", t, "L" /* Last */);
|
|
4427
4432
|
}
|
|
4428
4433
|
|
|
4429
|
-
var
|
|
4434
|
+
var or = /** @class */ function(e) {
|
|
4430
4435
|
function n(t, n, r) {
|
|
4431
4436
|
var i = this;
|
|
4432
4437
|
return (i = e.call(this) || this).type = t, i.bt = n, i.Et = r, i;
|
|
4433
4438
|
}
|
|
4434
4439
|
return t(n, e), n.prototype._apply = function(t) {
|
|
4435
|
-
var e =
|
|
4436
|
-
return new
|
|
4440
|
+
var e = fr(t, this.type, this.bt, this.Et);
|
|
4441
|
+
return new sn(t.firestore, t.converter, function(t, e) {
|
|
4437
4442
|
return new se(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), t.limit, t.limitType, e, t.endAt);
|
|
4438
4443
|
}(t._query, e));
|
|
4439
4444
|
}, n;
|
|
4440
|
-
}(
|
|
4445
|
+
}($n);
|
|
4441
4446
|
|
|
4442
|
-
function
|
|
4447
|
+
function ar() {
|
|
4443
4448
|
for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
|
|
4444
|
-
return new
|
|
4449
|
+
return new or("startAt", t,
|
|
4450
|
+
/*inclusive=*/ !0);
|
|
4445
4451
|
}
|
|
4446
4452
|
|
|
4447
|
-
function
|
|
4453
|
+
function sr() {
|
|
4448
4454
|
for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
|
|
4449
|
-
return new
|
|
4450
|
-
/*
|
|
4455
|
+
return new or("startAfter", t,
|
|
4456
|
+
/*inclusive=*/ !1);
|
|
4451
4457
|
}
|
|
4452
4458
|
|
|
4453
|
-
var
|
|
4459
|
+
var ur = /** @class */ function(e) {
|
|
4454
4460
|
function n(t, n, r) {
|
|
4455
4461
|
var i = this;
|
|
4456
4462
|
return (i = e.call(this) || this).type = t, i.bt = n, i.Et = r, i;
|
|
4457
4463
|
}
|
|
4458
4464
|
return t(n, e), n.prototype._apply = function(t) {
|
|
4459
|
-
var e =
|
|
4460
|
-
return new
|
|
4465
|
+
var e = fr(t, this.type, this.bt, this.Et);
|
|
4466
|
+
return new sn(t.firestore, t.converter, function(t, e) {
|
|
4461
4467
|
return new se(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), t.limit, t.limitType, t.startAt, e);
|
|
4462
4468
|
}(t._query, e));
|
|
4463
4469
|
}, n;
|
|
4464
|
-
}(
|
|
4470
|
+
}($n);
|
|
4465
4471
|
|
|
4466
|
-
function
|
|
4472
|
+
function cr() {
|
|
4467
4473
|
for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
|
|
4468
|
-
return new
|
|
4474
|
+
return new ur("endBefore", t,
|
|
4475
|
+
/*inclusive=*/ !1);
|
|
4469
4476
|
}
|
|
4470
4477
|
|
|
4471
4478
|
function lr() {
|
|
4472
4479
|
for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
|
|
4473
|
-
return new
|
|
4480
|
+
return new ur("endAt", t, /*inclusive=*/ !0);
|
|
4474
4481
|
}
|
|
4475
4482
|
|
|
4476
|
-
/** Helper function to create a bound from a document or fields */ function
|
|
4477
|
-
if (n[0] = p(n[0]), n[0] instanceof
|
|
4483
|
+
/** Helper function to create a bound from a document or fields */ function fr(t, e, n, r) {
|
|
4484
|
+
if (n[0] = p(n[0]), n[0] instanceof Qn) return function(t, e, n, r, i) {
|
|
4478
4485
|
if (!r) throw new U(P, "Can't use a DocumentSnapshot that doesn't exist for " + n + "().");
|
|
4479
4486
|
// Because people expect to continue/end a query at the exact document
|
|
4480
4487
|
// provided, we need to use the implicit sort order rather than the explicit
|
|
@@ -4489,15 +4496,15 @@ function lr() {
|
|
|
4489
4496
|
var c = r.data.field(u.field);
|
|
4490
4497
|
if (Pt(c)) throw new U(V, 'Invalid query. You are trying to start or end a query using a document for which the field "' + u.field + '" is an uncommitted server timestamp. (Since the value of this field is unknown, you cannot start/end a query with it.)');
|
|
4491
4498
|
if (null === c) {
|
|
4492
|
-
var
|
|
4493
|
-
throw new U(V, "Invalid query. You are trying to start or end a query using a document for which the field '" +
|
|
4499
|
+
var l = u.field.canonicalString();
|
|
4500
|
+
throw new U(V, "Invalid query. You are trying to start or end a query using a document for which the field '" + l + "' (used as the orderBy) does not exist.");
|
|
4494
4501
|
}
|
|
4495
4502
|
o.push(c);
|
|
4496
4503
|
}
|
|
4497
4504
|
}
|
|
4498
4505
|
return new re(o, i);
|
|
4499
4506
|
}(t._query, t.firestore._databaseId, e, n[0]._document, r);
|
|
4500
|
-
var i =
|
|
4507
|
+
var i = In(t.firestore);
|
|
4501
4508
|
return function(t, e, n, r, i, o) {
|
|
4502
4509
|
// Use explicit order by's because it has to match the query the user made
|
|
4503
4510
|
var a = t.explicitOrderBy;
|
|
@@ -4506,13 +4513,13 @@ function lr() {
|
|
|
4506
4513
|
var c = i[u];
|
|
4507
4514
|
if (a[u].field.isKeyField()) {
|
|
4508
4515
|
if ("string" != typeof c) throw new U(V, "Invalid query. Expected a string for document ID in " + r + "(), but got a " + typeof c);
|
|
4509
|
-
if (!
|
|
4510
|
-
var
|
|
4511
|
-
if (!nt.isDocumentKey(
|
|
4512
|
-
var
|
|
4513
|
-
s.push(Rt(e,
|
|
4516
|
+
if (!fe(t) && -1 !== c.indexOf("/")) throw new U(V, "Invalid query. When querying a collection and ordering by documentId(), the value passed to " + r + "() must be a plain document ID, but '" + c + "' contains a slash.");
|
|
4517
|
+
var l = t.path.child(Z.fromString(c));
|
|
4518
|
+
if (!nt.isDocumentKey(l)) throw new U(V, "Invalid query. When querying a collection group and ordering by documentId(), the value passed to " + r + "() must result in a valid document path, but '" + l + "' is not because it contains an odd number of segments.");
|
|
4519
|
+
var f = new nt(l);
|
|
4520
|
+
s.push(Rt(e, f));
|
|
4514
4521
|
} else {
|
|
4515
|
-
var h =
|
|
4522
|
+
var h = Cn(n, r, c);
|
|
4516
4523
|
s.push(h);
|
|
4517
4524
|
}
|
|
4518
4525
|
}
|
|
@@ -4520,27 +4527,27 @@ function lr() {
|
|
|
4520
4527
|
}(t._query, t.firestore._databaseId, i, e, n, r);
|
|
4521
4528
|
}
|
|
4522
4529
|
|
|
4523
|
-
function
|
|
4530
|
+
function hr(t, e, n) {
|
|
4524
4531
|
if ("string" == typeof (n = p(n))) {
|
|
4525
4532
|
if ("" === n) throw new U(V, "Invalid query. When querying with documentId(), you must provide a valid document ID, but it was an empty string.");
|
|
4526
|
-
if (!
|
|
4533
|
+
if (!fe(e) && -1 !== n.indexOf("/")) throw new U(V, "Invalid query. When querying a collection by documentId(), you must provide a plain document ID, but '" + n + "' contains a '/' character.");
|
|
4527
4534
|
var r = e.path.child(Z.fromString(n));
|
|
4528
4535
|
if (!nt.isDocumentKey(r)) throw new U(V, "Invalid query. When querying a collection group by documentId(), the value provided must result in a valid document path, but '" + r + "' is not because it has an odd number of segments (" + r.length + ").");
|
|
4529
4536
|
return Rt(t, new nt(r));
|
|
4530
4537
|
}
|
|
4531
|
-
if (n instanceof
|
|
4538
|
+
if (n instanceof an) return Rt(t, n._key);
|
|
4532
4539
|
throw new U(V, "Invalid query. When querying with documentId(), you must provide a valid string or a DocumentReference, but it was: " + at(n) + ".");
|
|
4533
4540
|
}
|
|
4534
4541
|
|
|
4535
4542
|
/**
|
|
4536
4543
|
* Validates that the value passed into a disjunctive filter satisfies all
|
|
4537
4544
|
* array requirements.
|
|
4538
|
-
*/ function
|
|
4545
|
+
*/ function pr(t, e) {
|
|
4539
4546
|
if (!Array.isArray(t) || 0 === t.length) throw new U(V, "Invalid Query. A non-empty array is required for '" + e.toString() + "' filters.");
|
|
4540
4547
|
if (t.length > 10) throw new U(V, "Invalid Query. '" + e.toString() + "' filters support a maximum of 10 elements in the value array.");
|
|
4541
4548
|
}
|
|
4542
4549
|
|
|
4543
|
-
function
|
|
4550
|
+
function dr(t, e, n) {
|
|
4544
4551
|
if (!n.isEqual(e)) throw new U(V, "Invalid query. You have a where filter with an inequality (<, <=, !=, not-in, >, or >=) on field '" + e.toString() + "' and so you must also use '" + e.toString() + "' as your first argument to orderBy(), but your first orderBy() is on field '" + n.toString() + "' instead.");
|
|
4545
4552
|
}
|
|
4546
4553
|
|
|
@@ -4590,23 +4597,23 @@ function mr(t, e, n) {
|
|
|
4590
4597
|
* because we want to provide the user with a more specific error message if
|
|
4591
4598
|
* their `set()` or fails due to invalid data originating from a `toFirestore()`
|
|
4592
4599
|
* call.
|
|
4593
|
-
*/ function
|
|
4600
|
+
*/ function mr(t, e, n) {
|
|
4594
4601
|
// Cast to `any` in order to satisfy the union type constraint on
|
|
4595
4602
|
// toFirestore().
|
|
4596
4603
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4597
4604
|
return t ? n && (n.merge || n.mergeFields) ? t.toFirestore(e, n) : t.toFirestore(e) : e;
|
|
4598
4605
|
}
|
|
4599
4606
|
|
|
4600
|
-
var
|
|
4607
|
+
var yr = /** @class */ function(e) {
|
|
4601
4608
|
function n(t) {
|
|
4602
4609
|
var n = this;
|
|
4603
4610
|
return (n = e.call(this) || this).firestore = t, n;
|
|
4604
4611
|
}
|
|
4605
4612
|
return t(n, e), n.prototype.convertBytes = function(t) {
|
|
4606
|
-
return new
|
|
4613
|
+
return new yn(t);
|
|
4607
4614
|
}, n.prototype.convertReference = function(t) {
|
|
4608
4615
|
var e = this.convertDocumentKey(t, this.firestore._databaseId);
|
|
4609
|
-
return new
|
|
4616
|
+
return new an(this.firestore, /* converter= */ null, e);
|
|
4610
4617
|
}, n;
|
|
4611
4618
|
}(/** @class */ function() {
|
|
4612
4619
|
function t() {}
|
|
@@ -4654,7 +4661,7 @@ var vr = /** @class */ function(e) {
|
|
|
4654
4661
|
r[t] = n.convertValue(i, e);
|
|
4655
4662
|
})), r;
|
|
4656
4663
|
}, t.prototype.convertGeoPoint = function(t) {
|
|
4657
|
-
return new
|
|
4664
|
+
return new gn(Vt(t.latitude), Vt(t.longitude));
|
|
4658
4665
|
}, t.prototype.convertArray = function(t, e) {
|
|
4659
4666
|
var n = this;
|
|
4660
4667
|
return (t.values || []).map((function(t) {
|
|
@@ -4677,7 +4684,7 @@ var vr = /** @class */ function(e) {
|
|
|
4677
4684
|
return new bt(e.seconds, e.nanos);
|
|
4678
4685
|
}, t.prototype.convertDocumentKey = function(t, e) {
|
|
4679
4686
|
var n = Z.fromString(t);
|
|
4680
|
-
E(
|
|
4687
|
+
E(ze(n));
|
|
4681
4688
|
var r = new X(n.get(1), n.get(3)), i = new nt(n.popFirst(5));
|
|
4682
4689
|
return r.isEqual(e) ||
|
|
4683
4690
|
// TODO(b/64130202): Somehow support foreign references.
|
|
@@ -4698,12 +4705,12 @@ var vr = /** @class */ function(e) {
|
|
|
4698
4705
|
* @param reference - The reference of the document to fetch.
|
|
4699
4706
|
* @returns A Promise resolved with a `DocumentSnapshot` containing the current
|
|
4700
4707
|
* document contents.
|
|
4701
|
-
*/ function
|
|
4702
|
-
var e =
|
|
4703
|
-
return
|
|
4708
|
+
*/ function vr(t) {
|
|
4709
|
+
var e = Je((t = st(t, an)).firestore), n = new yr(t.firestore);
|
|
4710
|
+
return Ye(e, [ t._key ]).then((function(e) {
|
|
4704
4711
|
E(1 === e.length);
|
|
4705
4712
|
var r = e[0];
|
|
4706
|
-
return new
|
|
4713
|
+
return new Qn(t.firestore, n, t._key, r.isFoundDocument() ? r : null, t.converter);
|
|
4707
4714
|
}));
|
|
4708
4715
|
}
|
|
4709
4716
|
|
|
@@ -4718,35 +4725,35 @@ var vr = /** @class */ function(e) {
|
|
|
4718
4725
|
*
|
|
4719
4726
|
* @param query - The `Query` to execute.
|
|
4720
4727
|
* @returns A Promise that will be resolved with the results of the query.
|
|
4721
|
-
*/ function
|
|
4728
|
+
*/ function gr(t) {
|
|
4722
4729
|
!function(t) {
|
|
4723
|
-
if (ue(t) && 0 === t.explicitOrderBy.length) throw new U(
|
|
4724
|
-
}((t = st(t,
|
|
4725
|
-
var e =
|
|
4726
|
-
return
|
|
4730
|
+
if (ue(t) && 0 === t.explicitOrderBy.length) throw new U(j, "limitToLast() queries require specifying at least one orderBy() clause");
|
|
4731
|
+
}((t = st(t, sn))._query);
|
|
4732
|
+
var e = Je(t.firestore), n = new yr(t.firestore);
|
|
4733
|
+
return $e(e, t._query).then((function(e) {
|
|
4727
4734
|
var r = e.map((function(e) {
|
|
4728
|
-
return new
|
|
4735
|
+
return new Kn(t.firestore, n, e.key, e, t.converter);
|
|
4729
4736
|
}));
|
|
4730
4737
|
return ue(t._query) &&
|
|
4731
4738
|
// Limit to last queries reverse the orderBy constraint that was
|
|
4732
4739
|
// specified by the user. As such, we need to reverse the order of the
|
|
4733
4740
|
// results to return the documents in the expected order.
|
|
4734
|
-
r.reverse(), new
|
|
4741
|
+
r.reverse(), new Hn(t, r);
|
|
4735
4742
|
}));
|
|
4736
4743
|
}
|
|
4737
4744
|
|
|
4738
|
-
function
|
|
4739
|
-
var r =
|
|
4740
|
-
return
|
|
4745
|
+
function wr(t, e, n) {
|
|
4746
|
+
var r = mr((t = st(t, an)).converter, e, n), i = An(In(t.firestore), "setDoc", t._key, r, null !== t.converter, n);
|
|
4747
|
+
return We(Je(t.firestore), [ i.toMutation(t._key, _e.none()) ]);
|
|
4741
4748
|
}
|
|
4742
4749
|
|
|
4743
|
-
function
|
|
4750
|
+
function br(t, e, n) {
|
|
4744
4751
|
for (var r = [], i = 3; i < arguments.length; i++) r[i - 3] = arguments[i];
|
|
4745
|
-
var o, a =
|
|
4752
|
+
var o, a = In((t = st(t, an)).firestore);
|
|
4746
4753
|
// For Compat types, we have to "extract" the underlying types before
|
|
4747
4754
|
// performing validation.
|
|
4748
|
-
return o = "string" == typeof (e = p(e)) || e instanceof
|
|
4749
|
-
|
|
4755
|
+
return o = "string" == typeof (e = p(e)) || e instanceof dn ? On(a, "updateDoc", t._key, e, n, r) : Fn(a, "updateDoc", t._key, e),
|
|
4756
|
+
We(Je(t.firestore), [ o.toMutation(t._key, _e.exists(!0)) ]);
|
|
4750
4757
|
}
|
|
4751
4758
|
|
|
4752
4759
|
/**
|
|
@@ -4760,8 +4767,8 @@ function _r(t, e, n) {
|
|
|
4760
4767
|
* @param reference - A reference to the document to delete.
|
|
4761
4768
|
* @returns A `Promise` resolved once the document has been successfully
|
|
4762
4769
|
* deleted from the backend.
|
|
4763
|
-
*/ function
|
|
4764
|
-
return
|
|
4770
|
+
*/ function _r(t) {
|
|
4771
|
+
return We(Je((t = st(t, an)).firestore), [ new Ie(t._key, _e.none()) ]);
|
|
4765
4772
|
}
|
|
4766
4773
|
|
|
4767
4774
|
/**
|
|
@@ -4778,9 +4785,9 @@ function _r(t, e, n) {
|
|
|
4778
4785
|
* @throws Error - If the provided input is not a valid Firestore document.
|
|
4779
4786
|
* @returns A `Promise` resolved with a `DocumentReference` pointing to the
|
|
4780
4787
|
* newly created document after it has been written to the backend.
|
|
4781
|
-
*/ function
|
|
4782
|
-
var n =
|
|
4783
|
-
return
|
|
4788
|
+
*/ function Tr(t, e) {
|
|
4789
|
+
var n = fn(t = st(t, un)), r = mr(t.converter, e), i = An(In(t.firestore), "addDoc", n._key, r, null !== n.converter, {});
|
|
4790
|
+
return We(Je(t.firestore), [ i.toMutation(n._key, _e.exists(!1)) ]).then((function() {
|
|
4784
4791
|
return n;
|
|
4785
4792
|
}));
|
|
4786
4793
|
}
|
|
@@ -4804,15 +4811,15 @@ function _r(t, e, n) {
|
|
|
4804
4811
|
/**
|
|
4805
4812
|
* Returns a sentinel for use with {@link @firebase/firestore/lite#(updateDoc:1)} or
|
|
4806
4813
|
* {@link @firebase/firestore/lite#(setDoc:1)} with `{merge: true}` to mark a field for deletion.
|
|
4807
|
-
*/ function
|
|
4808
|
-
return new
|
|
4814
|
+
*/ function Sr() {
|
|
4815
|
+
return new kn("deleteField");
|
|
4809
4816
|
}
|
|
4810
4817
|
|
|
4811
4818
|
/**
|
|
4812
4819
|
* Returns a sentinel used with {@link @firebase/firestore/lite#(setDoc:1)} or {@link @firebase/firestore/lite#(updateDoc:1)} to
|
|
4813
4820
|
* include a server-generated timestamp in the written data.
|
|
4814
|
-
*/ function
|
|
4815
|
-
return new
|
|
4821
|
+
*/ function Er() {
|
|
4822
|
+
return new Dn("serverTimestamp");
|
|
4816
4823
|
}
|
|
4817
4824
|
|
|
4818
4825
|
/**
|
|
@@ -4826,11 +4833,11 @@ function _r(t, e, n) {
|
|
|
4826
4833
|
* @param elements - The elements to union into the array.
|
|
4827
4834
|
* @returns The `FieldValue` sentinel for use in a call to `setDoc()` or
|
|
4828
4835
|
* `updateDoc()`.
|
|
4829
|
-
*/ function
|
|
4836
|
+
*/ function Ir() {
|
|
4830
4837
|
for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
|
|
4831
4838
|
// NOTE: We don't actually parse the data until it's used in set() or
|
|
4832
4839
|
// update() since we'd need the Firestore instance to do this.
|
|
4833
|
-
return new
|
|
4840
|
+
return new Pn("arrayUnion", t);
|
|
4834
4841
|
}
|
|
4835
4842
|
|
|
4836
4843
|
/**
|
|
@@ -4843,11 +4850,11 @@ function _r(t, e, n) {
|
|
|
4843
4850
|
* @param elements - The elements to remove from the array.
|
|
4844
4851
|
* @returns The `FieldValue` sentinel for use in a call to `setDoc()` or
|
|
4845
4852
|
* `updateDoc()`
|
|
4846
|
-
*/ function
|
|
4853
|
+
*/ function Ar() {
|
|
4847
4854
|
for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
|
|
4848
4855
|
// NOTE: We don't actually parse the data until it's used in set() or
|
|
4849
4856
|
// update() since we'd need the Firestore instance to do this.
|
|
4850
|
-
return new
|
|
4857
|
+
return new Nn("arrayRemove", t);
|
|
4851
4858
|
}
|
|
4852
4859
|
|
|
4853
4860
|
/**
|
|
@@ -4868,8 +4875,8 @@ function _r(t, e, n) {
|
|
|
4868
4875
|
* @param n - The value to increment by.
|
|
4869
4876
|
* @returns The `FieldValue` sentinel for use in a call to `setDoc()` or
|
|
4870
4877
|
* `updateDoc()`
|
|
4871
|
-
*/ function
|
|
4872
|
-
return new
|
|
4878
|
+
*/ function kr(t) {
|
|
4879
|
+
return new qn("increment", t);
|
|
4873
4880
|
}
|
|
4874
4881
|
|
|
4875
4882
|
/**
|
|
@@ -4895,23 +4902,23 @@ function _r(t, e, n) {
|
|
|
4895
4902
|
* provides methods for adding writes to the write batch. None of the writes
|
|
4896
4903
|
* will be committed (or visible locally) until {@link WriteBatch.commit} is
|
|
4897
4904
|
* called.
|
|
4898
|
-
*/ var
|
|
4905
|
+
*/ var Vr = /** @class */ function() {
|
|
4899
4906
|
/** @hideconstructor */
|
|
4900
4907
|
function t(t, e) {
|
|
4901
4908
|
this._firestore = t, this._commitHandler = e, this._mutations = [], this._committed = !1,
|
|
4902
|
-
this._dataReader =
|
|
4909
|
+
this._dataReader = In(t);
|
|
4903
4910
|
}
|
|
4904
4911
|
return t.prototype.set = function(t, e, n) {
|
|
4905
4912
|
this._verifyNotCommitted();
|
|
4906
|
-
var r =
|
|
4913
|
+
var r = Dr(t, this._firestore), i = mr(r.converter, e, n), o = An(this._dataReader, "WriteBatch.set", r._key, i, null !== r.converter, n);
|
|
4907
4914
|
return this._mutations.push(o.toMutation(r._key, _e.none())), this;
|
|
4908
4915
|
}, t.prototype.update = function(t, e, n) {
|
|
4909
4916
|
for (var r = [], i = 3; i < arguments.length; i++) r[i - 3] = arguments[i];
|
|
4910
4917
|
this._verifyNotCommitted();
|
|
4911
|
-
var o, a =
|
|
4918
|
+
var o, a = Dr(t, this._firestore);
|
|
4912
4919
|
// For Compat types, we have to "extract" the underlying types before
|
|
4913
4920
|
// performing validation.
|
|
4914
|
-
return o = "string" == typeof (e = p(e)) || e instanceof
|
|
4921
|
+
return o = "string" == typeof (e = p(e)) || e instanceof dn ? On(this._dataReader, "WriteBatch.update", a._key, e, n, r) : Fn(this._dataReader, "WriteBatch.update", a._key, e),
|
|
4915
4922
|
this._mutations.push(o.toMutation(a._key, _e.exists(!0))), this;
|
|
4916
4923
|
},
|
|
4917
4924
|
/**
|
|
@@ -4922,7 +4929,7 @@ function _r(t, e, n) {
|
|
|
4922
4929
|
*/
|
|
4923
4930
|
t.prototype.delete = function(t) {
|
|
4924
4931
|
this._verifyNotCommitted();
|
|
4925
|
-
var e =
|
|
4932
|
+
var e = Dr(t, this._firestore);
|
|
4926
4933
|
return this._mutations = this._mutations.concat(new Ie(e._key, _e.none())), this;
|
|
4927
4934
|
},
|
|
4928
4935
|
/**
|
|
@@ -4944,7 +4951,7 @@ function _r(t, e, n) {
|
|
|
4944
4951
|
}, t;
|
|
4945
4952
|
}();
|
|
4946
4953
|
|
|
4947
|
-
function
|
|
4954
|
+
function Dr(t, e) {
|
|
4948
4955
|
if ((t = p(t)).firestore !== e) throw new U(V, "Provided document reference is from a different Firestore instance.");
|
|
4949
4956
|
return t;
|
|
4950
4957
|
}
|
|
@@ -4961,10 +4968,10 @@ function Pr(t, e) {
|
|
|
4961
4968
|
*
|
|
4962
4969
|
* @returns A `WriteBatch` that can be used to atomically execute multiple
|
|
4963
4970
|
* writes.
|
|
4964
|
-
*/ function
|
|
4965
|
-
var e =
|
|
4966
|
-
return new
|
|
4967
|
-
return
|
|
4971
|
+
*/ function Pr(t) {
|
|
4972
|
+
var e = Je(t = st(t, tn));
|
|
4973
|
+
return new Vr(t, (function(t) {
|
|
4974
|
+
return We(e, t);
|
|
4968
4975
|
}));
|
|
4969
4976
|
}
|
|
4970
4977
|
|
|
@@ -4987,7 +4994,7 @@ function Pr(t, e) {
|
|
|
4987
4994
|
/**
|
|
4988
4995
|
* Internal transaction object responsible for accumulating the mutations to
|
|
4989
4996
|
* perform and the base versions for any documents read.
|
|
4990
|
-
*/ var
|
|
4997
|
+
*/ var Nr = /** @class */ function() {
|
|
4991
4998
|
function t(t) {
|
|
4992
4999
|
this.datastore = t,
|
|
4993
5000
|
// The version of each document that was read during this transaction.
|
|
@@ -5012,7 +5019,7 @@ function Pr(t, e) {
|
|
|
5012
5019
|
switch (n.label) {
|
|
5013
5020
|
case 0:
|
|
5014
5021
|
if (this.ensureCommitNotCalled(), this.mutations.length > 0) throw new U(V, "Firestore transactions require all reads to be executed before all writes.");
|
|
5015
|
-
return [ 4 /*yield*/ ,
|
|
5022
|
+
return [ 4 /*yield*/ , Ye(this.datastore, t) ];
|
|
5016
5023
|
|
|
5017
5024
|
case 1:
|
|
5018
5025
|
return [ 2 /*return*/ , ((e = n.sent()).forEach((function(t) {
|
|
@@ -5049,7 +5056,7 @@ function Pr(t, e) {
|
|
|
5049
5056
|
t.forEach((function(t, n) {
|
|
5050
5057
|
var r = nt.fromPath(n);
|
|
5051
5058
|
e.mutations.push(new Ae(r, e.precondition(r)));
|
|
5052
|
-
})), [ 4 /*yield*/ ,
|
|
5059
|
+
})), [ 4 /*yield*/ , We(this.datastore, this.mutations) ];
|
|
5053
5060
|
|
|
5054
5061
|
case 1:
|
|
5055
5062
|
// For each mutation, note that the doc was written.
|
|
@@ -5107,10 +5114,10 @@ function Pr(t, e) {
|
|
|
5107
5114
|
}, t.prototype.write = function(t) {
|
|
5108
5115
|
this.ensureCommitNotCalled(), this.mutations.push(t);
|
|
5109
5116
|
}, t.prototype.ensureCommitNotCalled = function() {}, t;
|
|
5110
|
-
}(),
|
|
5117
|
+
}(), qr = /** @class */ function() {
|
|
5111
5118
|
function t(t, e, n, r) {
|
|
5112
5119
|
this.asyncQueue = t, this.datastore = e, this.updateFunction = n, this.deferred = r,
|
|
5113
|
-
this.Tt = 5, this.It = new
|
|
5120
|
+
this.Tt = 5, this.It = new Ke(this.asyncQueue, "transaction_retry" /* TransactionRetry */)
|
|
5114
5121
|
/** Runs the transaction and sets the result on deferred. */;
|
|
5115
5122
|
}
|
|
5116
5123
|
return t.prototype.run = function() {
|
|
@@ -5121,7 +5128,7 @@ function Pr(t, e) {
|
|
|
5121
5128
|
return e(t, void 0, void 0, (function() {
|
|
5122
5129
|
var t, e, r = this;
|
|
5123
5130
|
return n(this, (function(n) {
|
|
5124
|
-
return t = new
|
|
5131
|
+
return t = new Nr(this.datastore), (e = this.Rt(t)) && e.then((function(e) {
|
|
5125
5132
|
r.asyncQueue.enqueueAndForget((function() {
|
|
5126
5133
|
return t.commit().then((function() {
|
|
5127
5134
|
r.deferred.resolve(e);
|
|
@@ -5186,8 +5193,8 @@ function Pr(t, e) {
|
|
|
5186
5193
|
// the context and should handled individually by the calling code.
|
|
5187
5194
|
// See https://cloud.google.com/apis/design/errors.
|
|
5188
5195
|
case C:
|
|
5189
|
-
case j:
|
|
5190
5196
|
case L:
|
|
5197
|
+
case j:
|
|
5191
5198
|
case "data-loss":
|
|
5192
5199
|
return !0;
|
|
5193
5200
|
}
|
|
@@ -5233,7 +5240,7 @@ function Pr(t, e) {
|
|
|
5233
5240
|
* See the License for the specific language governing permissions and
|
|
5234
5241
|
* limitations under the License.
|
|
5235
5242
|
*/
|
|
5236
|
-
/** The Platform's 'document' implementation or null if not available. */ function
|
|
5243
|
+
/** The Platform's 'document' implementation or null if not available. */ function Fr() {
|
|
5237
5244
|
// `document` is not always available, e.g. in ReactNative and WebWorkers.
|
|
5238
5245
|
// eslint-disable-next-line no-restricted-globals
|
|
5239
5246
|
return "undefined" != typeof document ? document : null;
|
|
@@ -5265,7 +5272,7 @@ function Pr(t, e) {
|
|
|
5265
5272
|
* Note: We implement `PromiseLike` instead of `Promise`, as the `Promise` type
|
|
5266
5273
|
* in newer versions of TypeScript defines `finally`, which is not available in
|
|
5267
5274
|
* IE.
|
|
5268
|
-
*/ var
|
|
5275
|
+
*/ var Or = /** @class */ function() {
|
|
5269
5276
|
function t(t, e, n, r, i) {
|
|
5270
5277
|
this.asyncQueue = t, this.timerId = e, this.targetTimeMs = n, this.op = r, this.removalCallback = i,
|
|
5271
5278
|
this.deferred = new x, this.then = this.deferred.promise.then.bind(this.deferred.promise),
|
|
@@ -5329,7 +5336,7 @@ function Pr(t, e) {
|
|
|
5329
5336
|
null !== this.timerHandle && (this.removalCallback(this), clearTimeout(this.timerHandle),
|
|
5330
5337
|
this.timerHandle = null);
|
|
5331
5338
|
}, t;
|
|
5332
|
-
}(),
|
|
5339
|
+
}(), Cr = /** @class */ function() {
|
|
5333
5340
|
function t() {
|
|
5334
5341
|
var t = this;
|
|
5335
5342
|
// The last promise in the queue.
|
|
@@ -5353,15 +5360,15 @@ function Pr(t, e) {
|
|
|
5353
5360
|
// List of TimerIds to fast-forward delays for.
|
|
5354
5361
|
this.Ot = [],
|
|
5355
5362
|
// Backoff timer used to schedule retries for retryable operations
|
|
5356
|
-
this.It = new
|
|
5363
|
+
this.It = new Ke(this, "async_queue_retry" /* AsyncQueueRetry */),
|
|
5357
5364
|
// Visibility handler that triggers an immediate retry of all retryable
|
|
5358
5365
|
// operations. Meant to speed up recovery when we regain file system access
|
|
5359
5366
|
// after page comes into foreground.
|
|
5360
5367
|
this.Ct = function() {
|
|
5361
|
-
var e =
|
|
5368
|
+
var e = Fr();
|
|
5362
5369
|
e && w("AsyncQueue", "Visibility state changed to " + e.visibilityState), t.It.H();
|
|
5363
5370
|
};
|
|
5364
|
-
var e =
|
|
5371
|
+
var e = Fr();
|
|
5365
5372
|
e && "function" == typeof e.addEventListener && e.addEventListener("visibilitychange", this.Ct);
|
|
5366
5373
|
}
|
|
5367
5374
|
return Object.defineProperty(t.prototype, "isShuttingDown", {
|
|
@@ -5385,7 +5392,7 @@ function Pr(t, e) {
|
|
|
5385
5392
|
}, t.prototype.enterRestrictedMode = function(t) {
|
|
5386
5393
|
if (!this.$t) {
|
|
5387
5394
|
this.$t = !0, this.qt = t || !1;
|
|
5388
|
-
var e =
|
|
5395
|
+
var e = Fr();
|
|
5389
5396
|
e && "function" == typeof e.removeEventListener && e.removeEventListener("visibilitychange", this.Ct);
|
|
5390
5397
|
}
|
|
5391
5398
|
}, t.prototype.enqueue = function(t) {
|
|
@@ -5483,7 +5490,7 @@ function Pr(t, e) {
|
|
|
5483
5490
|
this.Lt(),
|
|
5484
5491
|
// Fast-forward delays for timerIds that have been overriden.
|
|
5485
5492
|
this.Ot.indexOf(t) > -1 && (e = 0);
|
|
5486
|
-
var i =
|
|
5493
|
+
var i = Or.createAndSchedule(this, t, e, n, (function(t) {
|
|
5487
5494
|
return r.jt(t);
|
|
5488
5495
|
}));
|
|
5489
5496
|
return this.St.push(i), i;
|
|
@@ -5561,7 +5568,7 @@ function Pr(t, e) {
|
|
|
5561
5568
|
}(), Lr = /** @class */ function() {
|
|
5562
5569
|
/** @hideconstructor */
|
|
5563
5570
|
function t(t, e) {
|
|
5564
|
-
this._firestore = t, this._transaction = e, this._dataReader =
|
|
5571
|
+
this._firestore = t, this._transaction = e, this._dataReader = In(t)
|
|
5565
5572
|
/**
|
|
5566
5573
|
* Reads the document referenced by the provided {@link DocumentReference}.
|
|
5567
5574
|
*
|
|
@@ -5570,23 +5577,23 @@ function Pr(t, e) {
|
|
|
5570
5577
|
*/;
|
|
5571
5578
|
}
|
|
5572
5579
|
return t.prototype.get = function(t) {
|
|
5573
|
-
var e = this, n =
|
|
5580
|
+
var e = this, n = Dr(t, this._firestore), r = new yr(this._firestore);
|
|
5574
5581
|
return this._transaction.lookup([ n._key ]).then((function(t) {
|
|
5575
5582
|
if (!t || 1 !== t.length) return S();
|
|
5576
5583
|
var i = t[0];
|
|
5577
|
-
if (i.isFoundDocument()) return new
|
|
5578
|
-
if (i.isNoDocument()) return new
|
|
5584
|
+
if (i.isFoundDocument()) return new Qn(e._firestore, r, i.key, i, n.converter);
|
|
5585
|
+
if (i.isNoDocument()) return new Qn(e._firestore, r, n._key, null, n.converter);
|
|
5579
5586
|
throw S();
|
|
5580
5587
|
}));
|
|
5581
5588
|
}, t.prototype.set = function(t, e, n) {
|
|
5582
|
-
var r =
|
|
5589
|
+
var r = Dr(t, this._firestore), i = mr(r.converter, e, n), o = An(this._dataReader, "Transaction.set", r._key, i, null !== r.converter, n);
|
|
5583
5590
|
return this._transaction.set(r._key, o), this;
|
|
5584
5591
|
}, t.prototype.update = function(t, e, n) {
|
|
5585
5592
|
for (var r = [], i = 3; i < arguments.length; i++) r[i - 3] = arguments[i];
|
|
5586
|
-
var o, a =
|
|
5593
|
+
var o, a = Dr(t, this._firestore);
|
|
5587
5594
|
// For Compat types, we have to "extract" the underlying types before
|
|
5588
5595
|
// performing validation.
|
|
5589
|
-
return o = "string" == typeof (e = p(e)) || e instanceof
|
|
5596
|
+
return o = "string" == typeof (e = p(e)) || e instanceof dn ? On(this._dataReader, "Transaction.update", a._key, e, n, r) : Fn(this._dataReader, "Transaction.update", a._key, e),
|
|
5590
5597
|
this._transaction.update(a._key, o), this;
|
|
5591
5598
|
},
|
|
5592
5599
|
/**
|
|
@@ -5596,7 +5603,7 @@ function Pr(t, e) {
|
|
|
5596
5603
|
* @returns This `Transaction` instance. Used for chaining method calls.
|
|
5597
5604
|
*/
|
|
5598
5605
|
t.prototype.delete = function(t) {
|
|
5599
|
-
var e =
|
|
5606
|
+
var e = Dr(t, this._firestore);
|
|
5600
5607
|
return this._transaction.delete(e._key), this;
|
|
5601
5608
|
}, t;
|
|
5602
5609
|
}();
|
|
@@ -5634,9 +5641,9 @@ function Pr(t, e) {
|
|
|
5634
5641
|
* `updateFunction `is returned here. Otherwise, if the transaction failed, a
|
|
5635
5642
|
* rejected promise with the corresponding failure error is returned.
|
|
5636
5643
|
*/
|
|
5637
|
-
function
|
|
5638
|
-
var n =
|
|
5639
|
-
return new
|
|
5644
|
+
function jr(t, e) {
|
|
5645
|
+
var n = Je(t = st(t, tn)), r = new x;
|
|
5646
|
+
return new qr(new Cr, n, (function(n) {
|
|
5640
5647
|
return e(new Lr(t, n));
|
|
5641
5648
|
}), r).run(), r.promise
|
|
5642
5649
|
/**
|
|
@@ -5650,11 +5657,11 @@ function Rr(t, e) {
|
|
|
5650
5657
|
}
|
|
5651
5658
|
|
|
5652
5659
|
y = i + "_lite", o(new c("firestore/lite", (function(t, e) {
|
|
5653
|
-
var n = e.options, r = t.getProvider("app").getImmediate(), i = new
|
|
5660
|
+
var n = e.options, r = t.getProvider("app").getImmediate(), i = new tn(r, new Q(t.getProvider("auth-internal")), new Y(t.getProvider("app-check-internal")));
|
|
5654
5661
|
return n && i._setSettings(n), i;
|
|
5655
5662
|
}), "PUBLIC")),
|
|
5656
5663
|
// RUNTIME_ENV and BUILD_TARGET are replaced by real values during the compilation
|
|
5657
|
-
a("firestore-lite", "3.4.4-canary.
|
|
5664
|
+
a("firestore-lite", "3.4.4-canary.3e9f3e253", ""), a("firestore-lite", "3.4.4-canary.3e9f3e253", "esm5");
|
|
5658
5665
|
|
|
5659
|
-
export {
|
|
5666
|
+
export { yn as Bytes, un as CollectionReference, an as DocumentReference, Qn as DocumentSnapshot, dn as FieldPath, vn as FieldValue, tn as Firestore, U as FirestoreError, gn as GeoPoint, sn as Query, $n as QueryConstraint, Kn as QueryDocumentSnapshot, Hn as QuerySnapshot, bt as Timestamp, Lr as Transaction, Vr as WriteBatch, Tr as addDoc, Ar as arrayRemove, Ir as arrayUnion, cn as collection, ln as collectionGroup, rn as connectFirestoreEmulator, _r as deleteDoc, Sr as deleteField, fn as doc, mn as documentId, lr as endAt, cr as endBefore, vr as getDoc, gr as getDocs, nn as getFirestore, kr as increment, en as initializeFirestore, rr as limit, ir as limitToLast, er as orderBy, Xn as query, pn as queryEqual, hn as refEqual, jr as runTransaction, Er as serverTimestamp, wr as setDoc, g as setLogLevel, Wn as snapshotEqual, sr as startAfter, ar as startAt, on as terminate, br as updateDoc, Zn as where, Pr as writeBatch };
|
|
5660
5667
|
//# sourceMappingURL=index.browser.esm5.js.map
|