@firebase/firestore 3.4.4-canary.2dd99ae2d → 3.4.4-canary.3a8d4c1d1
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/index/index_byte_encoder.d.ts +18 -1
- package/dist/firestore/src/index/index_entry.d.ts +26 -0
- 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 +40 -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 +195 -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 +5 -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/src/util/sorted_set.d.ts +18 -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 +4496 -3484
- package/dist/index.esm2017.js.map +1 -1
- package/dist/index.esm5.js +4452 -3556
- package/dist/index.esm5.js.map +1 -1
- package/dist/index.node.cjs.js +1728 -287
- package/dist/index.node.cjs.js.map +1 -1
- package/dist/index.node.mjs +1728 -287
- package/dist/index.node.mjs.map +1 -1
- package/dist/index.rn.js +4508 -3496
- package/dist/index.rn.js.map +1 -1
- package/dist/internal.d.ts +253 -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/index/index_byte_encoder.d.ts +18 -1
- package/dist/lite/firestore/src/index/index_entry.d.ts +26 -0
- 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 +40 -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 +195 -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 +5 -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/src/util/sorted_set.d.ts +18 -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 +1155 -1143
- package/dist/lite/index.browser.esm2017.js.map +1 -1
- package/dist/lite/index.browser.esm5.js +355 -342
- package/dist/lite/index.browser.esm5.js.map +1 -1
- package/dist/lite/index.node.cjs.js +47 -29
- package/dist/lite/index.node.cjs.js.map +1 -1
- package/dist/lite/index.node.mjs +47 -29
- package/dist/lite/index.node.mjs.map +1 -1
- package/dist/lite/index.rn.esm2017.js +332 -320
- package/dist/lite/index.rn.esm2017.js.map +1 -1
- package/dist/lite/internal.d.ts +7 -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/index/index_byte_encoder.d.ts +18 -1
- package/dist/lite/packages/firestore/src/index/index_entry.d.ts +26 -0
- 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 +40 -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 +195 -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 +5 -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/src/util/sorted_set.d.ts +18 -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 +189 -186
- 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/index/index_byte_encoder.d.ts +18 -1
- package/dist/packages/firestore/src/index/index_entry.d.ts +26 -0
- 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 +40 -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 +195 -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 +5 -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/src/util/sorted_set.d.ts +18 -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.3a8d4c1d1", 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
|
/**
|
|
@@ -527,9 +527,21 @@ function(t, e, n, r, i, o, a, s) {
|
|
|
527
527
|
return new t(Z.fromString(e).popFirst(5));
|
|
528
528
|
}, t.empty = function() {
|
|
529
529
|
return new t(Z.emptyPath());
|
|
530
|
-
},
|
|
530
|
+
}, Object.defineProperty(t.prototype, "collectionGroup", {
|
|
531
|
+
get: function() {
|
|
532
|
+
return this.path.popLast().lastSegment();
|
|
533
|
+
},
|
|
534
|
+
enumerable: !1,
|
|
535
|
+
configurable: !0
|
|
536
|
+
}),
|
|
531
537
|
/** Returns true if the document is in the specified collectionId. */ t.prototype.hasCollectionId = function(t) {
|
|
532
538
|
return this.path.length >= 2 && this.path.get(this.path.length - 2) === t;
|
|
539
|
+
},
|
|
540
|
+
/** Returns the collection group (i.e. the name of the parent collection) for this key. */ t.prototype.getCollectionGroup = function() {
|
|
541
|
+
return this.path.get(this.path.length - 2);
|
|
542
|
+
},
|
|
543
|
+
/** Returns the fully qualified path to the parent collection. */ t.prototype.getCollectionPath = function() {
|
|
544
|
+
return this.path.popLast();
|
|
533
545
|
}, t.prototype.isEqual = function(t) {
|
|
534
546
|
return null !== t && 0 === Z.comparator(this.path, t.path);
|
|
535
547
|
}, t.prototype.toString = function() {
|
|
@@ -651,7 +663,7 @@ function ut(t, e) {
|
|
|
651
663
|
return null == t;
|
|
652
664
|
}
|
|
653
665
|
|
|
654
|
-
/** Returns whether the value represents -0. */ function
|
|
666
|
+
/** Returns whether the value represents -0. */ function lt(t) {
|
|
655
667
|
// Detect if the value is -0.0. Based on polyfill from
|
|
656
668
|
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
|
|
657
669
|
return 0 === t && 1 / t == -1 / 0;
|
|
@@ -676,7 +688,7 @@ function ut(t, e) {
|
|
|
676
688
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
677
689
|
* See the License for the specific language governing permissions and
|
|
678
690
|
* limitations under the License.
|
|
679
|
-
*/ var
|
|
691
|
+
*/ var ft, ht, pt = {
|
|
680
692
|
BatchGetDocuments: "batchGet",
|
|
681
693
|
Commit: "commit",
|
|
682
694
|
RunQuery: "runQuery"
|
|
@@ -759,7 +771,7 @@ function dt(t) {
|
|
|
759
771
|
// return Code.ALREADY_EXISTS;
|
|
760
772
|
case 416:
|
|
761
773
|
// Range Not Satisfiable
|
|
762
|
-
return
|
|
774
|
+
return L;
|
|
763
775
|
|
|
764
776
|
case 429:
|
|
765
777
|
// Too Many Requests
|
|
@@ -778,7 +790,7 @@ function dt(t) {
|
|
|
778
790
|
// return Code.DATA_LOSS;
|
|
779
791
|
case 501:
|
|
780
792
|
// Unimplemented
|
|
781
|
-
return
|
|
793
|
+
return j;
|
|
782
794
|
|
|
783
795
|
case 503:
|
|
784
796
|
// Service Unavailable
|
|
@@ -812,7 +824,7 @@ function dt(t) {
|
|
|
812
824
|
/**
|
|
813
825
|
* A Rest-based connection that relies on the native HTTP stack
|
|
814
826
|
* (e.g. `fetch` or a polyfill).
|
|
815
|
-
*/ (ht =
|
|
827
|
+
*/ (ht = ft || (ft = {}))[ht.OK = 0] = "OK", ht[ht.CANCELLED = 1] = "CANCELLED",
|
|
816
828
|
ht[ht.UNKNOWN = 2] = "UNKNOWN", ht[ht.INVALID_ARGUMENT = 3] = "INVALID_ARGUMENT",
|
|
817
829
|
ht[ht.DEADLINE_EXCEEDED = 4] = "DEADLINE_EXCEEDED", ht[ht.NOT_FOUND = 5] = "NOT_FOUND",
|
|
818
830
|
ht[ht.ALREADY_EXISTS = 6] = "ALREADY_EXISTS", ht[ht.PERMISSION_DENIED = 7] = "PERMISSION_DENIED",
|
|
@@ -1508,7 +1520,7 @@ var At = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
|
|
|
1508
1520
|
if ("integerValue" in t && "integerValue" in e) return Vt(t.integerValue) === Vt(e.integerValue);
|
|
1509
1521
|
if ("doubleValue" in t && "doubleValue" in e) {
|
|
1510
1522
|
var n = Vt(t.doubleValue), r = Vt(e.doubleValue);
|
|
1511
|
-
return n === r ?
|
|
1523
|
+
return n === r ? lt(n) === lt(r) : isNaN(n) && isNaN(r);
|
|
1512
1524
|
}
|
|
1513
1525
|
return !1;
|
|
1514
1526
|
}(t, e);
|
|
@@ -1535,7 +1547,7 @@ function Ct(t, e) {
|
|
|
1535
1547
|
}));
|
|
1536
1548
|
}
|
|
1537
1549
|
|
|
1538
|
-
function
|
|
1550
|
+
function Lt(t, e) {
|
|
1539
1551
|
if (t === e) return 0;
|
|
1540
1552
|
var n = Ft(t), r = Ft(e);
|
|
1541
1553
|
if (n !== r) return gt(n, r);
|
|
@@ -1555,10 +1567,10 @@ function jt(t, e) {
|
|
|
1555
1567
|
}(t, e);
|
|
1556
1568
|
|
|
1557
1569
|
case 3 /* TimestampValue */ :
|
|
1558
|
-
return
|
|
1570
|
+
return jt(t.timestampValue, e.timestampValue);
|
|
1559
1571
|
|
|
1560
1572
|
case 4 /* ServerTimestampValue */ :
|
|
1561
|
-
return
|
|
1573
|
+
return jt(qt(t), qt(e));
|
|
1562
1574
|
|
|
1563
1575
|
case 5 /* StringValue */ :
|
|
1564
1576
|
return gt(t.stringValue, e.stringValue);
|
|
@@ -1587,7 +1599,7 @@ function jt(t, e) {
|
|
|
1587
1599
|
case 9 /* ArrayValue */ :
|
|
1588
1600
|
return function(t, e) {
|
|
1589
1601
|
for (var n = t.values || [], r = e.values || [], i = 0; i < n.length && i < r.length; ++i) {
|
|
1590
|
-
var o =
|
|
1602
|
+
var o = Lt(n[i], r[i]);
|
|
1591
1603
|
if (o) return o;
|
|
1592
1604
|
}
|
|
1593
1605
|
return gt(n.length, r.length);
|
|
@@ -1604,7 +1616,7 @@ function jt(t, e) {
|
|
|
1604
1616
|
for (var a = 0; a < r.length && a < o.length; ++a) {
|
|
1605
1617
|
var s = gt(r[a], o[a]);
|
|
1606
1618
|
if (0 !== s) return s;
|
|
1607
|
-
var u =
|
|
1619
|
+
var u = Lt(n[r[a]], i[o[a]]);
|
|
1608
1620
|
if (0 !== u) return u;
|
|
1609
1621
|
}
|
|
1610
1622
|
return gt(r.length, o.length);
|
|
@@ -1615,7 +1627,7 @@ function jt(t, e) {
|
|
|
1615
1627
|
}
|
|
1616
1628
|
}
|
|
1617
1629
|
|
|
1618
|
-
function
|
|
1630
|
+
function jt(t, e) {
|
|
1619
1631
|
if ("string" == typeof t && "string" == typeof e && t.length === e.length) return gt(t, e);
|
|
1620
1632
|
var n = kt(t), r = kt(e), i = gt(n.seconds, r.seconds);
|
|
1621
1633
|
return 0 !== i ? i : gt(n.nanos, r.nanos);
|
|
@@ -1937,7 +1949,7 @@ var Wt = /** @class */ function(e) {
|
|
|
1937
1949
|
}, n.prototype.matches = function(t) {
|
|
1938
1950
|
var e = t.data.field(this.field);
|
|
1939
1951
|
// Types do not have to match in NOT_EQUAL filters.
|
|
1940
|
-
return "!=" /* NOT_EQUAL */ === this.op ? null !== e && this.D(
|
|
1952
|
+
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
1953
|
// Only compare types with matching backend order (such as double and int).
|
|
1942
1954
|
}, n.prototype.D = function(t) {
|
|
1943
1955
|
switch (this.op) {
|
|
@@ -2044,7 +2056,7 @@ var Wt = /** @class */ function(e) {
|
|
|
2044
2056
|
}));
|
|
2045
2057
|
}, n;
|
|
2046
2058
|
}(Wt), re = function(t, e) {
|
|
2047
|
-
this.position = t, this.
|
|
2059
|
+
this.position = t, this.inclusive = e;
|
|
2048
2060
|
}, ie = function(t, e /* ASCENDING */) {
|
|
2049
2061
|
void 0 === e && (e = "asc"), this.field = t, this.dir = e;
|
|
2050
2062
|
};
|
|
@@ -2056,7 +2068,7 @@ var Wt = /** @class */ function(e) {
|
|
|
2056
2068
|
function ae(t, e) {
|
|
2057
2069
|
if (null === t) return null === e;
|
|
2058
2070
|
if (null === e) return !1;
|
|
2059
|
-
if (t.
|
|
2071
|
+
if (t.inclusive !== e.inclusive || t.position.length !== e.position.length) return !1;
|
|
2060
2072
|
for (var n = 0; n < t.position.length; n++) if (!Ot(t.position[n], e.position[n])) return !1;
|
|
2061
2073
|
return !0;
|
|
2062
2074
|
}
|
|
@@ -2106,7 +2118,7 @@ function ce(t) {
|
|
|
2106
2118
|
return t.explicitOrderBy.length > 0 ? t.explicitOrderBy[0].field : null;
|
|
2107
2119
|
}
|
|
2108
2120
|
|
|
2109
|
-
function
|
|
2121
|
+
function le(t) {
|
|
2110
2122
|
for (var e = 0, n = t.filters; e < n.length; e++) {
|
|
2111
2123
|
var r = n[e];
|
|
2112
2124
|
if (r.N()) return r.field;
|
|
@@ -2121,7 +2133,7 @@ function fe(t) {
|
|
|
2121
2133
|
/**
|
|
2122
2134
|
* Returns whether the query matches a collection group rather than a specific
|
|
2123
2135
|
* collection.
|
|
2124
|
-
*/ function
|
|
2136
|
+
*/ function fe(t) {
|
|
2125
2137
|
return null !== t.collectionGroup;
|
|
2126
2138
|
}
|
|
2127
2139
|
|
|
@@ -2133,7 +2145,7 @@ function fe(t) {
|
|
|
2133
2145
|
var e = I(t);
|
|
2134
2146
|
if (null === e.$) {
|
|
2135
2147
|
e.$ = [];
|
|
2136
|
-
var n =
|
|
2148
|
+
var n = le(e), r = ce(e);
|
|
2137
2149
|
if (null !== n && null === r)
|
|
2138
2150
|
// In order to implicitly add key ordering, we must also add the
|
|
2139
2151
|
// inequality filter field for it to be a valid query.
|
|
@@ -2166,7 +2178,7 @@ function fe(t) {
|
|
|
2166
2178
|
n.push(new ie(o.field, a));
|
|
2167
2179
|
}
|
|
2168
2180
|
// 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.
|
|
2181
|
+
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
2182
|
// Now return as a LimitType.First query.
|
|
2171
2183
|
e.S = Ht(e.path, e.collectionGroup, n, e.filters, e.limit, s, u);
|
|
2172
2184
|
}
|
|
@@ -2200,7 +2212,7 @@ function fe(t) {
|
|
|
2200
2212
|
*/
|
|
2201
2213
|
function de(t, e) {
|
|
2202
2214
|
return function(t) {
|
|
2203
|
-
return "number" == typeof t && Number.isInteger(t) && !
|
|
2215
|
+
return "number" == typeof t && Number.isInteger(t) && !lt(t) && t <= Number.MAX_SAFE_INTEGER && t >= Number.MIN_SAFE_INTEGER;
|
|
2204
2216
|
}(e) ?
|
|
2205
2217
|
/**
|
|
2206
2218
|
* Returns an IntegerValue for `value`.
|
|
@@ -2222,7 +2234,7 @@ function de(t, e) {
|
|
|
2222
2234
|
};
|
|
2223
2235
|
}
|
|
2224
2236
|
return {
|
|
2225
|
-
doubleValue:
|
|
2237
|
+
doubleValue: lt(e) ? "-0" : e
|
|
2226
2238
|
};
|
|
2227
2239
|
}(t, e);
|
|
2228
2240
|
}
|
|
@@ -2390,17 +2402,17 @@ function Ce(t, e) {
|
|
|
2390
2402
|
return Oe(t.databaseId, e.path);
|
|
2391
2403
|
}
|
|
2392
2404
|
|
|
2393
|
-
function
|
|
2405
|
+
function Le(t, e) {
|
|
2394
2406
|
var n, r = function(t) {
|
|
2395
2407
|
var e = Z.fromString(t);
|
|
2396
|
-
return E(
|
|
2408
|
+
return E(ze(e)), e;
|
|
2397
2409
|
}(e);
|
|
2398
2410
|
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
2411
|
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
2412
|
return new nt((E((n = r).length > 4 && "documents" === n.get(4)), n.popFirst(5)));
|
|
2401
2413
|
}
|
|
2402
2414
|
|
|
2403
|
-
function
|
|
2415
|
+
function je(t, e) {
|
|
2404
2416
|
return Oe(t.databaseId, e);
|
|
2405
2417
|
}
|
|
2406
2418
|
|
|
@@ -2416,29 +2428,21 @@ function Me(t, e, n) {
|
|
|
2416
2428
|
}
|
|
2417
2429
|
|
|
2418
2430
|
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
2431
|
return ke[t];
|
|
2428
2432
|
}
|
|
2429
2433
|
|
|
2430
2434
|
// visible for testing
|
|
2431
|
-
function
|
|
2435
|
+
function xe(t) {
|
|
2432
2436
|
return Ve[t];
|
|
2433
2437
|
}
|
|
2434
2438
|
|
|
2435
|
-
function
|
|
2439
|
+
function Be(t) {
|
|
2436
2440
|
return {
|
|
2437
2441
|
fieldPath: t.canonicalString()
|
|
2438
2442
|
};
|
|
2439
2443
|
}
|
|
2440
2444
|
|
|
2441
|
-
function
|
|
2445
|
+
function Ge(t) {
|
|
2442
2446
|
var e = [];
|
|
2443
2447
|
return t.fields.forEach((function(t) {
|
|
2444
2448
|
return e.push(t.canonicalString());
|
|
@@ -2447,7 +2451,7 @@ function ze(t) {
|
|
|
2447
2451
|
};
|
|
2448
2452
|
}
|
|
2449
2453
|
|
|
2450
|
-
function
|
|
2454
|
+
function ze(t) {
|
|
2451
2455
|
// Resource names have at least 4 components (project ID, database ID)
|
|
2452
2456
|
return t.length >= 4 && "projects" === t.get(0) && "databases" === t.get(2);
|
|
2453
2457
|
}
|
|
@@ -2467,7 +2471,7 @@ function Qe(t) {
|
|
|
2467
2471
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2468
2472
|
* See the License for the specific language governing permissions and
|
|
2469
2473
|
* limitations under the License.
|
|
2470
|
-
*/ function
|
|
2474
|
+
*/ function Qe(t) {
|
|
2471
2475
|
return new De(t, /* useProto3Json= */ !0);
|
|
2472
2476
|
}
|
|
2473
2477
|
|
|
@@ -2495,7 +2499,7 @@ function Qe(t) {
|
|
|
2495
2499
|
* backoff curve, and a +/- 50% "jitter" that is calculated and added to the
|
|
2496
2500
|
* base delay. This prevents clients from accidentally synchronizing their
|
|
2497
2501
|
* delays causing spikes of load to the backend.
|
|
2498
|
-
*/ var
|
|
2502
|
+
*/ var Ke = /** @class */ function() {
|
|
2499
2503
|
function t(
|
|
2500
2504
|
/**
|
|
2501
2505
|
* The AsyncQueue to run backoff operations on.
|
|
@@ -2569,7 +2573,7 @@ function Qe(t) {
|
|
|
2569
2573
|
/** Returns a random value in the range [-currentBaseMs/2, currentBaseMs/2] */ t.prototype.Y = function() {
|
|
2570
2574
|
return (Math.random() - .5) * this.j;
|
|
2571
2575
|
}, t;
|
|
2572
|
-
}(),
|
|
2576
|
+
}(), He = /** @class */ function(e) {
|
|
2573
2577
|
function n(t, n, r, i) {
|
|
2574
2578
|
var o = this;
|
|
2575
2579
|
return (o = e.call(this) || this).authCredentials = t, o.appCheckCredentials = n,
|
|
@@ -2629,7 +2633,7 @@ function Qe(t) {
|
|
|
2629
2633
|
*/
|
|
2630
2634
|
// TODO(firestorexp): Make sure there is only one Datastore instance per
|
|
2631
2635
|
// firestore-exp client.
|
|
2632
|
-
function
|
|
2636
|
+
function We(t, r) {
|
|
2633
2637
|
return e(this, void 0, void 0, (function() {
|
|
2634
2638
|
var e, i, o;
|
|
2635
2639
|
return n(this, (function(n) {
|
|
@@ -2645,7 +2649,7 @@ function Ye(t, r) {
|
|
|
2645
2649
|
delete: Ce(t, e.key)
|
|
2646
2650
|
}; else if (e instanceof Ee) n = {
|
|
2647
2651
|
update: Me(t, e.key, e.data),
|
|
2648
|
-
updateMask:
|
|
2652
|
+
updateMask: Ge(e.fieldMask)
|
|
2649
2653
|
}; else {
|
|
2650
2654
|
if (!(e instanceof Ae)) return S();
|
|
2651
2655
|
n = {
|
|
@@ -2695,7 +2699,7 @@ function Ye(t, r) {
|
|
|
2695
2699
|
}));
|
|
2696
2700
|
}
|
|
2697
2701
|
|
|
2698
|
-
function
|
|
2702
|
+
function Ye(t, r) {
|
|
2699
2703
|
return e(this, void 0, void 0, (function() {
|
|
2700
2704
|
var e, i, o, a, s, u;
|
|
2701
2705
|
return n(this, (function(n) {
|
|
@@ -2712,7 +2716,7 @@ function $e(t, r) {
|
|
|
2712
2716
|
var n = function(t, e) {
|
|
2713
2717
|
return "found" in e ? function(t, e) {
|
|
2714
2718
|
E(!!e.found), e.found.name, e.found.updateTime;
|
|
2715
|
-
var n =
|
|
2719
|
+
var n = Le(t, e.found.name), r = Fe(e.found.updateTime), i = new zt({
|
|
2716
2720
|
mapValue: {
|
|
2717
2721
|
fields: e.found.fields
|
|
2718
2722
|
}
|
|
@@ -2720,7 +2724,7 @@ function $e(t, r) {
|
|
|
2720
2724
|
return Qt.newFoundDocument(n, r, i);
|
|
2721
2725
|
}(t, e) : "missing" in e ? function(t, e) {
|
|
2722
2726
|
E(!!e.missing), E(!!e.readTime);
|
|
2723
|
-
var n =
|
|
2727
|
+
var n = Le(t, e.missing), r = Fe(e.readTime);
|
|
2724
2728
|
return Qt.newNoDocument(n, r);
|
|
2725
2729
|
}(t, e) : S();
|
|
2726
2730
|
}(e.q, t);
|
|
@@ -2734,7 +2738,7 @@ function $e(t, r) {
|
|
|
2734
2738
|
}));
|
|
2735
2739
|
}
|
|
2736
2740
|
|
|
2737
|
-
function
|
|
2741
|
+
function $e(t, r) {
|
|
2738
2742
|
return e(this, void 0, void 0, (function() {
|
|
2739
2743
|
var e, i;
|
|
2740
2744
|
return n(this, (function(n) {
|
|
@@ -2745,10 +2749,10 @@ function Xe(t, r) {
|
|
|
2745
2749
|
var n = {
|
|
2746
2750
|
structuredQuery: {}
|
|
2747
2751
|
}, r = e.path;
|
|
2748
|
-
null !== e.collectionGroup ? (n.parent =
|
|
2752
|
+
null !== e.collectionGroup ? (n.parent = je(t, r), n.structuredQuery.from = [ {
|
|
2749
2753
|
collectionId: e.collectionGroup,
|
|
2750
2754
|
allDescendants: !0
|
|
2751
|
-
} ]) : (n.parent =
|
|
2755
|
+
} ]) : (n.parent = je(t, r.popLast()), n.structuredQuery.from = [ {
|
|
2752
2756
|
collectionId: r.lastSegment()
|
|
2753
2757
|
} ]);
|
|
2754
2758
|
var i = function(t) {
|
|
@@ -2759,34 +2763,34 @@ function Xe(t, r) {
|
|
|
2759
2763
|
if ("==" /* EQUAL */ === t.op) {
|
|
2760
2764
|
if (xt(t.value)) return {
|
|
2761
2765
|
unaryFilter: {
|
|
2762
|
-
field:
|
|
2766
|
+
field: Be(t.field),
|
|
2763
2767
|
op: "IS_NAN"
|
|
2764
2768
|
}
|
|
2765
2769
|
};
|
|
2766
2770
|
if (Ut(t.value)) return {
|
|
2767
2771
|
unaryFilter: {
|
|
2768
|
-
field:
|
|
2772
|
+
field: Be(t.field),
|
|
2769
2773
|
op: "IS_NULL"
|
|
2770
2774
|
}
|
|
2771
2775
|
};
|
|
2772
2776
|
} else if ("!=" /* NOT_EQUAL */ === t.op) {
|
|
2773
2777
|
if (xt(t.value)) return {
|
|
2774
2778
|
unaryFilter: {
|
|
2775
|
-
field:
|
|
2779
|
+
field: Be(t.field),
|
|
2776
2780
|
op: "IS_NOT_NAN"
|
|
2777
2781
|
}
|
|
2778
2782
|
};
|
|
2779
2783
|
if (Ut(t.value)) return {
|
|
2780
2784
|
unaryFilter: {
|
|
2781
|
-
field:
|
|
2785
|
+
field: Be(t.field),
|
|
2782
2786
|
op: "IS_NOT_NULL"
|
|
2783
2787
|
}
|
|
2784
2788
|
};
|
|
2785
2789
|
}
|
|
2786
2790
|
return {
|
|
2787
2791
|
fieldFilter: {
|
|
2788
|
-
field:
|
|
2789
|
-
op:
|
|
2792
|
+
field: Be(t.field),
|
|
2793
|
+
op: xe(t.op),
|
|
2790
2794
|
value: t.value
|
|
2791
2795
|
}
|
|
2792
2796
|
};
|
|
@@ -2806,20 +2810,27 @@ function Xe(t, r) {
|
|
|
2806
2810
|
// visible for testing
|
|
2807
2811
|
return function(t) {
|
|
2808
2812
|
return {
|
|
2809
|
-
field:
|
|
2810
|
-
direction:
|
|
2813
|
+
field: Be(t.field),
|
|
2814
|
+
direction: Ue(t.dir)
|
|
2811
2815
|
};
|
|
2812
2816
|
}(t);
|
|
2813
2817
|
}));
|
|
2814
2818
|
}(e.orderBy);
|
|
2815
2819
|
o && (n.structuredQuery.orderBy = o);
|
|
2816
|
-
var a = function(t, e) {
|
|
2820
|
+
var a, s = function(t, e) {
|
|
2817
2821
|
return t.F || ct(e) ? e : {
|
|
2818
2822
|
value: e
|
|
2819
2823
|
};
|
|
2820
2824
|
}(t, e.limit);
|
|
2821
|
-
return null !==
|
|
2822
|
-
|
|
2825
|
+
return null !== s && (n.structuredQuery.limit = s), e.startAt && (n.structuredQuery.startAt = {
|
|
2826
|
+
before: (a = e.startAt).inclusive,
|
|
2827
|
+
values: a.position
|
|
2828
|
+
}), e.endAt && (n.structuredQuery.endAt = function(t) {
|
|
2829
|
+
return {
|
|
2830
|
+
before: !t.inclusive,
|
|
2831
|
+
values: t.position
|
|
2832
|
+
};
|
|
2833
|
+
}(e.endAt)), n;
|
|
2823
2834
|
}(e.q, pe(r)), [ 4 /*yield*/ , e.T("RunQuery", i.parent, {
|
|
2824
2835
|
structuredQuery: i.structuredQuery
|
|
2825
2836
|
}) ];
|
|
@@ -2829,7 +2840,7 @@ function Xe(t, r) {
|
|
|
2829
2840
|
return !!t.document;
|
|
2830
2841
|
})).map((function(t) {
|
|
2831
2842
|
return function(t, e, n) {
|
|
2832
|
-
var r =
|
|
2843
|
+
var r = Le(t, e.name), i = Fe(e.updateTime), o = new zt({
|
|
2833
2844
|
mapValue: {
|
|
2834
2845
|
fields: e.fields
|
|
2835
2846
|
}
|
|
@@ -2857,7 +2868,7 @@ function Xe(t, r) {
|
|
|
2857
2868
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2858
2869
|
* See the License for the specific language governing permissions and
|
|
2859
2870
|
* limitations under the License.
|
|
2860
|
-
*/ var
|
|
2871
|
+
*/ var Xe = new Map;
|
|
2861
2872
|
|
|
2862
2873
|
/**
|
|
2863
2874
|
* An instance map that ensures only one Datastore exists per Firestore
|
|
@@ -2867,17 +2878,17 @@ function Xe(t, r) {
|
|
|
2867
2878
|
* Returns an initialized and started Datastore for the given Firestore
|
|
2868
2879
|
* instance. Callers must invoke removeComponents() when the Firestore
|
|
2869
2880
|
* instance is terminated.
|
|
2870
|
-
*/ function
|
|
2881
|
+
*/ function Je(t) {
|
|
2871
2882
|
if (t._terminated) throw new U(O, "The client has already been terminated.");
|
|
2872
|
-
if (!
|
|
2883
|
+
if (!Xe.has(t)) {
|
|
2873
2884
|
w("ComponentProvider", "Initializing Datastore");
|
|
2874
2885
|
var e = function(t) {
|
|
2875
2886
|
return new mt(t, fetch.bind(null));
|
|
2876
2887
|
}((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
|
|
2888
|
+
new $(i, o, a, s.host, s.ssl, s.experimentalForceLongPolling, s.experimentalAutoDetectLongPolling, s.useFetchStreams))), n = Qe(t._databaseId), r = function(t, e, n, r) {
|
|
2889
|
+
return new He(t, e, n, r);
|
|
2879
2890
|
}(t._authCredentials, t._appCheckCredentials, e, n);
|
|
2880
|
-
|
|
2891
|
+
Xe.set(t, r);
|
|
2881
2892
|
}
|
|
2882
2893
|
var i, o, a, s;
|
|
2883
2894
|
/**
|
|
@@ -2895,7 +2906,7 @@ function Xe(t, r) {
|
|
|
2895
2906
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2896
2907
|
* See the License for the specific language governing permissions and
|
|
2897
2908
|
* limitations under the License.
|
|
2898
|
-
*/ return
|
|
2909
|
+
*/ return Xe.get(t);
|
|
2899
2910
|
}
|
|
2900
2911
|
|
|
2901
2912
|
/**
|
|
@@ -2906,7 +2917,7 @@ function Xe(t, r) {
|
|
|
2906
2917
|
* A concrete type describing all the values that can be applied via a
|
|
2907
2918
|
* user-supplied `FirestoreSettings` object. This is a separate type so that
|
|
2908
2919
|
* defaults can be supplied and the value can be checked for equality.
|
|
2909
|
-
*/ var
|
|
2920
|
+
*/ var Ze = /** @class */ function() {
|
|
2910
2921
|
function t(t) {
|
|
2911
2922
|
var e;
|
|
2912
2923
|
if (void 0 === t.host) {
|
|
@@ -2926,14 +2937,14 @@ function Xe(t, r) {
|
|
|
2926
2937
|
return t.prototype.isEqual = function(t) {
|
|
2927
2938
|
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
2939
|
}, t;
|
|
2929
|
-
}(),
|
|
2940
|
+
}(), tn = /** @class */ function() {
|
|
2930
2941
|
/** @hideconstructor */
|
|
2931
2942
|
function t(t, e, n) {
|
|
2932
2943
|
this._authCredentials = e, this._appCheckCredentials = n,
|
|
2933
2944
|
/**
|
|
2934
2945
|
* Whether it's a Firestore or Firestore Lite instance.
|
|
2935
2946
|
*/
|
|
2936
|
-
this.type = "firestore-lite", this._persistenceKey = "(lite)", this._settings = new
|
|
2947
|
+
this.type = "firestore-lite", this._persistenceKey = "(lite)", this._settings = new Ze({}),
|
|
2937
2948
|
this._settingsFrozen = !1, t instanceof X ? this._databaseId = t : (this._app = t,
|
|
2938
2949
|
this._databaseId = function(t) {
|
|
2939
2950
|
if (!Object.prototype.hasOwnProperty.apply(t.options, [ "projectId" ])) throw new U(V, '"projectId" not provided in firebase.initializeApp.');
|
|
@@ -2965,7 +2976,7 @@ function Xe(t, r) {
|
|
|
2965
2976
|
configurable: !0
|
|
2966
2977
|
}), t.prototype._setSettings = function(t) {
|
|
2967
2978
|
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
|
|
2979
|
+
this._settings = new Ze(t), void 0 !== t.credentials && (this._authCredentials = function(t) {
|
|
2969
2980
|
if (!t) return new G;
|
|
2970
2981
|
switch (t.type) {
|
|
2971
2982
|
case "gapi":
|
|
@@ -3003,8 +3014,8 @@ function Xe(t, r) {
|
|
|
3003
3014
|
* Only ever called once.
|
|
3004
3015
|
*/
|
|
3005
3016
|
t.prototype._terminate = function() {
|
|
3006
|
-
return t = this, (e =
|
|
3007
|
-
|
|
3017
|
+
return t = this, (e = Xe.get(t)) && (w("ComponentProvider", "Removing Datastore"),
|
|
3018
|
+
Xe.delete(t), e.terminate()), Promise.resolve();
|
|
3008
3019
|
var t, e;
|
|
3009
3020
|
}, t;
|
|
3010
3021
|
}();
|
|
@@ -3029,7 +3040,7 @@ function Xe(t, r) {
|
|
|
3029
3040
|
* The Cloud Firestore service interface.
|
|
3030
3041
|
*
|
|
3031
3042
|
* Do not call this constructor directly. Instead, use {@link getFirestore}.
|
|
3032
|
-
*/ function
|
|
3043
|
+
*/ function en(t, e) {
|
|
3033
3044
|
var n = _getProvider(t, "firestore/lite");
|
|
3034
3045
|
if (n.isInitialized()) throw new U(O, "Firestore can only be initialized once per app.");
|
|
3035
3046
|
return n.initialize({
|
|
@@ -3045,7 +3056,7 @@ function Xe(t, r) {
|
|
|
3045
3056
|
* @param app - The {@link @firebase/app#FirebaseApp} instance that the returned `Firestore`
|
|
3046
3057
|
* instance is associated with.
|
|
3047
3058
|
* @returns The `Firestore` instance of the provided app.
|
|
3048
|
-
*/ function
|
|
3059
|
+
*/ function nn(t) {
|
|
3049
3060
|
return void 0 === t && (t = s()), _getProvider(t, "firestore/lite").getImmediate();
|
|
3050
3061
|
}
|
|
3051
3062
|
|
|
@@ -3061,10 +3072,10 @@ function Xe(t, r) {
|
|
|
3061
3072
|
* @param port - the emulator port (ex: 9000).
|
|
3062
3073
|
* @param options.mockUserToken - the mock auth token to use for unit testing
|
|
3063
3074
|
* Security Rules.
|
|
3064
|
-
*/ function
|
|
3075
|
+
*/ function rn(t, e, n, r) {
|
|
3065
3076
|
var i;
|
|
3066
3077
|
void 0 === r && (r = {});
|
|
3067
|
-
var o = (t = st(t,
|
|
3078
|
+
var o = (t = st(t, tn))._getSettings();
|
|
3068
3079
|
if ("firestore.googleapis.com" !== o.host && o.host !== e && _("Host has been set in both settings() and useEmulator(), emulator host will be used"),
|
|
3069
3080
|
t._setSettings(Object.assign(Object.assign({}, o), {
|
|
3070
3081
|
host: e + ":" + n,
|
|
@@ -3102,8 +3113,8 @@ function Xe(t, r) {
|
|
|
3102
3113
|
* @param firestore - The `Firestore` instance to terminate.
|
|
3103
3114
|
* @returns A `Promise` that is resolved when the instance has been successfully
|
|
3104
3115
|
* terminated.
|
|
3105
|
-
*/ function
|
|
3106
|
-
return t = st(t,
|
|
3116
|
+
*/ function on(t) {
|
|
3117
|
+
return t = st(t, tn), u(t.app, "firestore/lite"), t._delete()
|
|
3107
3118
|
/**
|
|
3108
3119
|
* @license
|
|
3109
3120
|
* Copyright 2020 Google LLC
|
|
@@ -3143,7 +3154,7 @@ function Xe(t, r) {
|
|
|
3143
3154
|
*/;
|
|
3144
3155
|
}
|
|
3145
3156
|
|
|
3146
|
-
var
|
|
3157
|
+
var an = /** @class */ function() {
|
|
3147
3158
|
/** @hideconstructor */
|
|
3148
3159
|
function t(t,
|
|
3149
3160
|
/**
|
|
@@ -3184,14 +3195,14 @@ var sn = /** @class */ function() {
|
|
|
3184
3195
|
* The collection this `DocumentReference` belongs to.
|
|
3185
3196
|
*/
|
|
3186
3197
|
get: function() {
|
|
3187
|
-
return new
|
|
3198
|
+
return new un(this.firestore, this.converter, this._key.path.popLast());
|
|
3188
3199
|
},
|
|
3189
3200
|
enumerable: !1,
|
|
3190
3201
|
configurable: !0
|
|
3191
3202
|
}), t.prototype.withConverter = function(e) {
|
|
3192
3203
|
return new t(this.firestore, e, this._key);
|
|
3193
3204
|
}, t;
|
|
3194
|
-
}(),
|
|
3205
|
+
}(), sn = /** @class */ function() {
|
|
3195
3206
|
// This is the lite version of the Query class in the main SDK.
|
|
3196
3207
|
/** @hideconstructor protected */
|
|
3197
3208
|
function t(t,
|
|
@@ -3206,7 +3217,7 @@ var sn = /** @class */ function() {
|
|
|
3206
3217
|
return t.prototype.withConverter = function(e) {
|
|
3207
3218
|
return new t(this.firestore, e, this._query);
|
|
3208
3219
|
}, t;
|
|
3209
|
-
}(),
|
|
3220
|
+
}(), un = /** @class */ function(e) {
|
|
3210
3221
|
/** @hideconstructor */
|
|
3211
3222
|
function n(t, n, r) {
|
|
3212
3223
|
var i = this;
|
|
@@ -3237,7 +3248,7 @@ var sn = /** @class */ function() {
|
|
|
3237
3248
|
*/
|
|
3238
3249
|
get: function() {
|
|
3239
3250
|
var t = this._path.popLast();
|
|
3240
|
-
return t.isEmpty() ? null : new
|
|
3251
|
+
return t.isEmpty() ? null : new an(this.firestore,
|
|
3241
3252
|
/* converter= */ null, new nt(t));
|
|
3242
3253
|
},
|
|
3243
3254
|
enumerable: !1,
|
|
@@ -3245,20 +3256,20 @@ var sn = /** @class */ function() {
|
|
|
3245
3256
|
}), n.prototype.withConverter = function(t) {
|
|
3246
3257
|
return new n(this.firestore, t, this._path);
|
|
3247
3258
|
}, n;
|
|
3248
|
-
}(
|
|
3259
|
+
}(sn);
|
|
3249
3260
|
|
|
3250
3261
|
/**
|
|
3251
3262
|
* A `Query` refers to a query which you can read or listen to. You can also
|
|
3252
3263
|
* construct refined `Query` objects by adding filters and ordering.
|
|
3253
|
-
*/ function
|
|
3264
|
+
*/ function cn(t, e) {
|
|
3254
3265
|
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
|
|
3266
|
+
if (t = p(t), rt("collection", "path", e), t instanceof tn) {
|
|
3256
3267
|
var o = Z.fromString.apply(Z, r([ e ], n));
|
|
3257
|
-
return ot(o), new
|
|
3268
|
+
return ot(o), new un(t, /* converter= */ null, o);
|
|
3258
3269
|
}
|
|
3259
|
-
if (!(t instanceof
|
|
3270
|
+
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
3271
|
var a = t._path.child(Z.fromString.apply(Z, r([ e ], n)));
|
|
3261
|
-
return ot(a), new
|
|
3272
|
+
return ot(a), new un(t.firestore,
|
|
3262
3273
|
/* converter= */ null, a);
|
|
3263
3274
|
}
|
|
3264
3275
|
|
|
@@ -3275,8 +3286,8 @@ var sn = /** @class */ function() {
|
|
|
3275
3286
|
* will be included. Cannot contain a slash.
|
|
3276
3287
|
* @returns The created `Query`.
|
|
3277
3288
|
*/ function ln(t, e) {
|
|
3278
|
-
if (t = st(t,
|
|
3279
|
-
return new
|
|
3289
|
+
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 '/'.");
|
|
3290
|
+
return new sn(t,
|
|
3280
3291
|
/* converter= */ null,
|
|
3281
3292
|
/**
|
|
3282
3293
|
* Creates a new Query for a collection group query that matches all documents
|
|
@@ -3287,19 +3298,19 @@ var sn = /** @class */ function() {
|
|
|
3287
3298
|
}(e));
|
|
3288
3299
|
}
|
|
3289
3300
|
|
|
3290
|
-
function
|
|
3301
|
+
function fn(t, e) {
|
|
3291
3302
|
for (var n = [], i = 2; i < arguments.length; i++) n[i - 2] = arguments[i];
|
|
3292
3303
|
if (t = p(t),
|
|
3293
3304
|
// We allow omission of 'pathString' but explicitly prohibit passing in both
|
|
3294
3305
|
// 'undefined' and 'null'.
|
|
3295
|
-
1 === arguments.length && (e = vt.R()), rt("doc", "path", e), t instanceof
|
|
3306
|
+
1 === arguments.length && (e = vt.R()), rt("doc", "path", e), t instanceof tn) {
|
|
3296
3307
|
var o = Z.fromString.apply(Z, r([ e ], n));
|
|
3297
|
-
return it(o), new
|
|
3308
|
+
return it(o), new an(t,
|
|
3298
3309
|
/* converter= */ null, new nt(o));
|
|
3299
3310
|
}
|
|
3300
|
-
if (!(t instanceof
|
|
3311
|
+
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
3312
|
var a = t._path.child(Z.fromString.apply(Z, r([ e ], n)));
|
|
3302
|
-
return it(a), new
|
|
3313
|
+
return it(a), new an(t.firestore, t instanceof un ? t.converter : null, new nt(a));
|
|
3303
3314
|
}
|
|
3304
3315
|
|
|
3305
3316
|
/**
|
|
@@ -3309,8 +3320,8 @@ function hn(t, e) {
|
|
|
3309
3320
|
* @param right - A reference to compare.
|
|
3310
3321
|
* @returns true if the references point to the same location in the same
|
|
3311
3322
|
* Firestore database.
|
|
3312
|
-
*/ function
|
|
3313
|
-
return t = p(t), e = p(e), (t instanceof
|
|
3323
|
+
*/ function hn(t, e) {
|
|
3324
|
+
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
3325
|
/**
|
|
3315
3326
|
* Returns true if the provided queries point to the same collection and apply
|
|
3316
3327
|
* the same constraints.
|
|
@@ -3322,8 +3333,8 @@ function hn(t, e) {
|
|
|
3322
3333
|
*/;
|
|
3323
3334
|
}
|
|
3324
3335
|
|
|
3325
|
-
function
|
|
3326
|
-
return t = p(t), e = p(e), t instanceof
|
|
3336
|
+
function pn(t, e) {
|
|
3337
|
+
return t = p(t), e = p(e), t instanceof sn && e instanceof sn && t.firestore === e.firestore && function(t, e) {
|
|
3327
3338
|
return function(t, e) {
|
|
3328
3339
|
if (t.limit !== e.limit) return !1;
|
|
3329
3340
|
if (t.orderBy.length !== e.orderBy.length) return !1;
|
|
@@ -3361,7 +3372,7 @@ function dn(t, e) {
|
|
|
3361
3372
|
*/;
|
|
3362
3373
|
}
|
|
3363
3374
|
|
|
3364
|
-
var
|
|
3375
|
+
var dn = /** @class */ function() {
|
|
3365
3376
|
/**
|
|
3366
3377
|
* Creates a `FieldPath` from the provided field names. If more than one field
|
|
3367
3378
|
* name is provided, the path will point to a nested field in a document.
|
|
@@ -3386,8 +3397,8 @@ var mn = /** @class */ function() {
|
|
|
3386
3397
|
/**
|
|
3387
3398
|
* Returns a special sentinel `FieldPath` to refer to the ID of a document.
|
|
3388
3399
|
* It can be used in queries to sort or filter by the document ID.
|
|
3389
|
-
*/ function
|
|
3390
|
-
return new
|
|
3400
|
+
*/ function mn() {
|
|
3401
|
+
return new dn("__name__");
|
|
3391
3402
|
}
|
|
3392
3403
|
|
|
3393
3404
|
/**
|
|
@@ -3408,7 +3419,7 @@ var mn = /** @class */ function() {
|
|
|
3408
3419
|
*/
|
|
3409
3420
|
/**
|
|
3410
3421
|
* An immutable object representing an array of bytes.
|
|
3411
|
-
*/ var
|
|
3422
|
+
*/ var yn = /** @class */ function() {
|
|
3412
3423
|
/** @hideconstructor */
|
|
3413
3424
|
function t(t) {
|
|
3414
3425
|
this._byteString = t;
|
|
@@ -3466,14 +3477,14 @@ var mn = /** @class */ function() {
|
|
|
3466
3477
|
t.prototype.isEqual = function(t) {
|
|
3467
3478
|
return this._byteString.isEqual(t._byteString);
|
|
3468
3479
|
}, t;
|
|
3469
|
-
}(),
|
|
3480
|
+
}(), vn =
|
|
3470
3481
|
/**
|
|
3471
3482
|
* @param _methodName - The public API endpoint that returns this class.
|
|
3472
3483
|
* @hideconstructor
|
|
3473
3484
|
*/
|
|
3474
3485
|
function(t) {
|
|
3475
3486
|
this._methodName = t;
|
|
3476
|
-
},
|
|
3487
|
+
}, gn = /** @class */ function() {
|
|
3477
3488
|
/**
|
|
3478
3489
|
* Creates a new immutable `GeoPoint` object with the provided latitude and
|
|
3479
3490
|
* longitude values.
|
|
@@ -3526,14 +3537,14 @@ function(t) {
|
|
|
3526
3537
|
t.prototype._compareTo = function(t) {
|
|
3527
3538
|
return gt(this._lat, t._lat) || gt(this._long, t._long);
|
|
3528
3539
|
}, t;
|
|
3529
|
-
}(),
|
|
3540
|
+
}(), wn = /^__.*__$/, bn = /** @class */ function() {
|
|
3530
3541
|
function t(t, e, n) {
|
|
3531
3542
|
this.data = t, this.fieldMask = e, this.fieldTransforms = n;
|
|
3532
3543
|
}
|
|
3533
3544
|
return t.prototype.toMutation = function(t, e) {
|
|
3534
3545
|
return null !== this.fieldMask ? new Ee(t, this.data, this.fieldMask, e, this.fieldTransforms) : new Se(t, this.data, e, this.fieldTransforms);
|
|
3535
3546
|
}, t;
|
|
3536
|
-
}(),
|
|
3547
|
+
}(), _n = /** @class */ function() {
|
|
3537
3548
|
function t(t,
|
|
3538
3549
|
// The fieldMask does not include document transforms.
|
|
3539
3550
|
e, n) {
|
|
@@ -3563,7 +3574,7 @@ function(t) {
|
|
|
3563
3574
|
/**
|
|
3564
3575
|
* Sentinel values that can be used when writing document fields with `set()`
|
|
3565
3576
|
* or `update()`.
|
|
3566
|
-
*/ function
|
|
3577
|
+
*/ function Tn(t) {
|
|
3567
3578
|
switch (t) {
|
|
3568
3579
|
case 0 /* Set */ :
|
|
3569
3580
|
// fall through
|
|
@@ -3581,7 +3592,7 @@ function(t) {
|
|
|
3581
3592
|
}
|
|
3582
3593
|
}
|
|
3583
3594
|
|
|
3584
|
-
/** A "context" object passed around while parsing user data. */ var
|
|
3595
|
+
/** A "context" object passed around while parsing user data. */ var Sn = /** @class */ function() {
|
|
3585
3596
|
/**
|
|
3586
3597
|
* Initializes a ParseContext with the given source and path.
|
|
3587
3598
|
*
|
|
@@ -3619,16 +3630,16 @@ function(t) {
|
|
|
3619
3630
|
enumerable: !1,
|
|
3620
3631
|
configurable: !0
|
|
3621
3632
|
}),
|
|
3622
|
-
/** Returns a new context with the specified settings overwritten. */ t.prototype.
|
|
3633
|
+
/** Returns a new context with the specified settings overwritten. */ t.prototype.et = function(e) {
|
|
3623
3634
|
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.
|
|
3635
|
+
}, t.prototype.nt = function(t) {
|
|
3636
|
+
var e, n = null === (e = this.path) || void 0 === e ? void 0 : e.child(t), r = this.et({
|
|
3626
3637
|
path: n,
|
|
3627
3638
|
rt: !1
|
|
3628
3639
|
});
|
|
3629
3640
|
return r.st(t), r;
|
|
3630
3641
|
}, t.prototype.it = function(t) {
|
|
3631
|
-
var e, n = null === (e = this.path) || void 0 === e ? void 0 : e.child(t), r = this.
|
|
3642
|
+
var e, n = null === (e = this.path) || void 0 === e ? void 0 : e.child(t), r = this.et({
|
|
3632
3643
|
path: n,
|
|
3633
3644
|
rt: !1
|
|
3634
3645
|
});
|
|
@@ -3636,12 +3647,12 @@ function(t) {
|
|
|
3636
3647
|
}, t.prototype.ot = function(t) {
|
|
3637
3648
|
// TODO(b/34871131): We don't support array paths right now; so make path
|
|
3638
3649
|
// undefined.
|
|
3639
|
-
return this.
|
|
3650
|
+
return this.et({
|
|
3640
3651
|
path: void 0,
|
|
3641
3652
|
rt: !0
|
|
3642
3653
|
});
|
|
3643
3654
|
}, t.prototype.ut = function(t) {
|
|
3644
|
-
return
|
|
3655
|
+
return Gn(t, this.settings.methodName, this.settings.ct || !1, this.path, this.settings.at);
|
|
3645
3656
|
},
|
|
3646
3657
|
/** Returns 'true' if 'fieldPath' was traversed when creating this context. */ t.prototype.contains = function(t) {
|
|
3647
3658
|
return void 0 !== this.fieldMask.find((function(e) {
|
|
@@ -3655,15 +3666,15 @@ function(t) {
|
|
|
3655
3666
|
if (this.path) for (var t = 0; t < this.path.length; t++) this.st(this.path.get(t));
|
|
3656
3667
|
}, t.prototype.st = function(t) {
|
|
3657
3668
|
if (0 === t.length) throw this.ut("Document fields must not be empty");
|
|
3658
|
-
if (
|
|
3669
|
+
if (Tn(this.tt) && wn.test(t)) throw this.ut('Document fields cannot begin and end with "__"');
|
|
3659
3670
|
}, t;
|
|
3660
|
-
}(),
|
|
3671
|
+
}(), En = /** @class */ function() {
|
|
3661
3672
|
function t(t, e, n) {
|
|
3662
|
-
this.databaseId = t, this.ignoreUndefinedProperties = e, this.q = n ||
|
|
3673
|
+
this.databaseId = t, this.ignoreUndefinedProperties = e, this.q = n || Qe(t)
|
|
3663
3674
|
/** Creates a new top-level parse context. */;
|
|
3664
3675
|
}
|
|
3665
3676
|
return t.prototype.ht = function(t, e, n, r) {
|
|
3666
|
-
return void 0 === r && (r = !1), new
|
|
3677
|
+
return void 0 === r && (r = !1), new Sn({
|
|
3667
3678
|
tt: t,
|
|
3668
3679
|
methodName: e,
|
|
3669
3680
|
at: n,
|
|
@@ -3677,30 +3688,30 @@ function(t) {
|
|
|
3677
3688
|
/**
|
|
3678
3689
|
* Helper for parsing raw user input (provided via the API) into internal model
|
|
3679
3690
|
* classes.
|
|
3680
|
-
*/ function
|
|
3681
|
-
var e = t._freezeSettings(), n =
|
|
3682
|
-
return new
|
|
3691
|
+
*/ function In(t) {
|
|
3692
|
+
var e = t._freezeSettings(), n = Qe(t._databaseId);
|
|
3693
|
+
return new En(t._databaseId, !!e.ignoreUndefinedProperties, n);
|
|
3683
3694
|
}
|
|
3684
3695
|
|
|
3685
|
-
/** Parse document data from a set() call. */ function
|
|
3696
|
+
/** Parse document data from a set() call. */ function An(t, e, n, r, i, o) {
|
|
3686
3697
|
void 0 === o && (o = {});
|
|
3687
3698
|
var a = t.ht(o.merge || o.mergeFields ? 2 /* MergeSet */ : 0 /* Set */ , e, n, i);
|
|
3688
|
-
|
|
3689
|
-
var s, u, c =
|
|
3699
|
+
Mn("Data must be an object, but it was:", a, r);
|
|
3700
|
+
var s, u, c = jn(r, a);
|
|
3690
3701
|
if (o.merge) s = new Et(a.fieldMask), u = a.fieldTransforms; else if (o.mergeFields) {
|
|
3691
|
-
for (var
|
|
3692
|
-
var p =
|
|
3702
|
+
for (var l = [], f = 0, h = o.mergeFields; f < h.length; f++) {
|
|
3703
|
+
var p = Un(e, h[f], n);
|
|
3693
3704
|
if (!a.contains(p)) throw new U(V, "Field '" + p + "' is specified in your field mask but missing from your input data.");
|
|
3694
|
-
|
|
3705
|
+
zn(l, p) || l.push(p);
|
|
3695
3706
|
}
|
|
3696
|
-
s = new Et(
|
|
3707
|
+
s = new Et(l), u = a.fieldTransforms.filter((function(t) {
|
|
3697
3708
|
return s.covers(t.field);
|
|
3698
3709
|
}));
|
|
3699
3710
|
} else s = null, u = a.fieldTransforms;
|
|
3700
|
-
return new
|
|
3711
|
+
return new bn(new zt(c), s, u);
|
|
3701
3712
|
}
|
|
3702
3713
|
|
|
3703
|
-
var
|
|
3714
|
+
var kn = /** @class */ function(e) {
|
|
3704
3715
|
function n() {
|
|
3705
3716
|
return null !== e && e.apply(this, arguments) || this;
|
|
3706
3717
|
}
|
|
@@ -3712,7 +3723,7 @@ var Vn = /** @class */ function(e) {
|
|
|
3712
3723
|
}, n.prototype.isEqual = function(t) {
|
|
3713
3724
|
return t instanceof n;
|
|
3714
3725
|
}, n;
|
|
3715
|
-
}(
|
|
3726
|
+
}(vn);
|
|
3716
3727
|
|
|
3717
3728
|
/**
|
|
3718
3729
|
* Creates a child context for parsing SerializableFieldValues.
|
|
@@ -3729,8 +3740,8 @@ var Vn = /** @class */ function(e) {
|
|
|
3729
3740
|
* context.
|
|
3730
3741
|
* @param context - The parent context.
|
|
3731
3742
|
* @param arrayElement - Whether or not the FieldValue has an array.
|
|
3732
|
-
*/ function
|
|
3733
|
-
return new
|
|
3743
|
+
*/ function Vn(t, e, n) {
|
|
3744
|
+
return new Sn({
|
|
3734
3745
|
tt: 3 /* Argument */ ,
|
|
3735
3746
|
at: e.settings.at,
|
|
3736
3747
|
methodName: t._methodName,
|
|
@@ -3738,7 +3749,7 @@ var Vn = /** @class */ function(e) {
|
|
|
3738
3749
|
}, e.databaseId, e.q, e.ignoreUndefinedProperties);
|
|
3739
3750
|
}
|
|
3740
3751
|
|
|
3741
|
-
var
|
|
3752
|
+
var Dn = /** @class */ function(e) {
|
|
3742
3753
|
function n() {
|
|
3743
3754
|
return null !== e && e.apply(this, arguments) || this;
|
|
3744
3755
|
}
|
|
@@ -3747,13 +3758,13 @@ var Pn = /** @class */ function(e) {
|
|
|
3747
3758
|
}, n.prototype.isEqual = function(t) {
|
|
3748
3759
|
return t instanceof n;
|
|
3749
3760
|
}, n;
|
|
3750
|
-
}(
|
|
3761
|
+
}(vn), Pn = /** @class */ function(e) {
|
|
3751
3762
|
function n(t, n) {
|
|
3752
3763
|
var r = this;
|
|
3753
3764
|
return (r = e.call(this, t) || this).lt = n, r;
|
|
3754
3765
|
}
|
|
3755
3766
|
return t(n, e), n.prototype._toFieldTransform = function(t) {
|
|
3756
|
-
var e =
|
|
3767
|
+
var e = Vn(this, t,
|
|
3757
3768
|
/*array=*/ !0), n = this.lt.map((function(t) {
|
|
3758
3769
|
return Ln(t, e);
|
|
3759
3770
|
})), r = new ve(n);
|
|
@@ -3762,13 +3773,13 @@ var Pn = /** @class */ function(e) {
|
|
|
3762
3773
|
// TODO(mrschmidt): Implement isEquals
|
|
3763
3774
|
return this === t;
|
|
3764
3775
|
}, n;
|
|
3765
|
-
}(
|
|
3776
|
+
}(vn), Nn = /** @class */ function(e) {
|
|
3766
3777
|
function n(t, n) {
|
|
3767
3778
|
var r = this;
|
|
3768
3779
|
return (r = e.call(this, t) || this).lt = n, r;
|
|
3769
3780
|
}
|
|
3770
3781
|
return t(n, e), n.prototype._toFieldTransform = function(t) {
|
|
3771
|
-
var e =
|
|
3782
|
+
var e = Vn(this, t,
|
|
3772
3783
|
/*array=*/ !0), n = this.lt.map((function(t) {
|
|
3773
3784
|
return Ln(t, e);
|
|
3774
3785
|
})), r = new ge(n);
|
|
@@ -3777,7 +3788,7 @@ var Pn = /** @class */ function(e) {
|
|
|
3777
3788
|
// TODO(mrschmidt): Implement isEquals
|
|
3778
3789
|
return this === t;
|
|
3779
3790
|
}, n;
|
|
3780
|
-
}(
|
|
3791
|
+
}(vn), qn = /** @class */ function(e) {
|
|
3781
3792
|
function n(t, n) {
|
|
3782
3793
|
var r = this;
|
|
3783
3794
|
return (r = e.call(this, t) || this).ft = n, r;
|
|
@@ -3789,19 +3800,19 @@ var Pn = /** @class */ function(e) {
|
|
|
3789
3800
|
// TODO(mrschmidt): Implement isEquals
|
|
3790
3801
|
return this === t;
|
|
3791
3802
|
}, n;
|
|
3792
|
-
}(
|
|
3803
|
+
}(vn);
|
|
3793
3804
|
|
|
3794
|
-
/** Parse update data from an update() call. */ function
|
|
3805
|
+
/** Parse update data from an update() call. */ function Fn(t, e, n, r) {
|
|
3795
3806
|
var i = t.ht(1 /* Update */ , e, n);
|
|
3796
|
-
|
|
3807
|
+
Mn("Data must be an object, but it was:", i, r);
|
|
3797
3808
|
var o = [], a = zt.empty();
|
|
3798
3809
|
St(r, (function(t, r) {
|
|
3799
|
-
var s =
|
|
3810
|
+
var s = Bn(e, t, n);
|
|
3800
3811
|
// For Compat types, we have to "extract" the underlying types before
|
|
3801
3812
|
// performing validation.
|
|
3802
3813
|
r = p(r);
|
|
3803
3814
|
var u = i.it(s);
|
|
3804
|
-
if (r instanceof
|
|
3815
|
+
if (r instanceof kn)
|
|
3805
3816
|
// Add it to the field mask, but don't add anything to updateData.
|
|
3806
3817
|
o.push(s); else {
|
|
3807
3818
|
var c = Ln(r, u);
|
|
@@ -3809,30 +3820,30 @@ var Pn = /** @class */ function(e) {
|
|
|
3809
3820
|
}
|
|
3810
3821
|
}));
|
|
3811
3822
|
var s = new Et(o);
|
|
3812
|
-
return new
|
|
3823
|
+
return new _n(a, s, i.fieldTransforms);
|
|
3813
3824
|
}
|
|
3814
3825
|
|
|
3815
|
-
/** Parse update data from a list of field/value arguments. */ function
|
|
3816
|
-
var a = t.ht(1 /* Update */ , e, n), s = [
|
|
3826
|
+
/** Parse update data from a list of field/value arguments. */ function On(t, e, n, r, i, o) {
|
|
3827
|
+
var a = t.ht(1 /* Update */ , e, n), s = [ Un(e, r, n) ], u = [ i ];
|
|
3817
3828
|
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(
|
|
3829
|
+
for (var c = 0; c < o.length; c += 2) s.push(Un(e, o[c])), u.push(o[c + 1]);
|
|
3819
3830
|
// We iterate in reverse order to pick the last value for a field if the
|
|
3820
3831
|
// user specified the field multiple times.
|
|
3821
|
-
for (var
|
|
3832
|
+
for (var l = [], f = zt.empty(), h = s.length - 1; h >= 0; --h) if (!zn(l, s[h])) {
|
|
3822
3833
|
var d = s[h], m = u[h];
|
|
3823
3834
|
// For Compat types, we have to "extract" the underlying types before
|
|
3824
3835
|
// performing validation.
|
|
3825
3836
|
m = p(m);
|
|
3826
3837
|
var y = a.it(d);
|
|
3827
|
-
if (m instanceof
|
|
3838
|
+
if (m instanceof kn)
|
|
3828
3839
|
// Add it to the field mask, but don't add anything to updateData.
|
|
3829
|
-
|
|
3840
|
+
l.push(d); else {
|
|
3830
3841
|
var v = Ln(m, y);
|
|
3831
|
-
null != v && (
|
|
3842
|
+
null != v && (l.push(d), f.set(d, v));
|
|
3832
3843
|
}
|
|
3833
3844
|
}
|
|
3834
|
-
var g = new Et(
|
|
3835
|
-
return new
|
|
3845
|
+
var g = new Et(l);
|
|
3846
|
+
return new _n(f, g, a.fieldTransforms);
|
|
3836
3847
|
}
|
|
3837
3848
|
|
|
3838
3849
|
/**
|
|
@@ -3841,7 +3852,7 @@ var Pn = /** @class */ function(e) {
|
|
|
3841
3852
|
*
|
|
3842
3853
|
* @param allowArrays - Whether the query value is an array that may directly
|
|
3843
3854
|
* contain additional arrays (e.g. the operand of an `in` query).
|
|
3844
|
-
*/ function
|
|
3855
|
+
*/ function Cn(t, e, n, r) {
|
|
3845
3856
|
return void 0 === r && (r = !1), Ln(n, t.ht(r ? 4 /* ArrayArgument */ : 3 /* Argument */ , e));
|
|
3846
3857
|
}
|
|
3847
3858
|
|
|
@@ -3854,11 +3865,11 @@ var Pn = /** @class */ function(e) {
|
|
|
3854
3865
|
* @returns The parsed value, or null if the value was a FieldValue sentinel
|
|
3855
3866
|
* that should not be included in the resulting parsed data.
|
|
3856
3867
|
*/ function Ln(t, e) {
|
|
3857
|
-
if (
|
|
3868
|
+
if (Rn(
|
|
3858
3869
|
// Unwrap the API type from the Compat SDK. This will return the API type
|
|
3859
3870
|
// from firestore-exp.
|
|
3860
|
-
t = p(t))) return
|
|
3861
|
-
if (t instanceof
|
|
3871
|
+
t = p(t))) return Mn("Unsupported field value:", e, t), jn(t, e);
|
|
3872
|
+
if (t instanceof vn)
|
|
3862
3873
|
// FieldValues usually parse into transforms (except deleteField())
|
|
3863
3874
|
// in which case we do not want to include this field in our parsed data
|
|
3864
3875
|
// (as doing so will overwrite the field directly prior to the transform
|
|
@@ -3870,7 +3881,7 @@ var Pn = /** @class */ function(e) {
|
|
|
3870
3881
|
*/
|
|
3871
3882
|
return function(t, e) {
|
|
3872
3883
|
// Sentinels are only supported with writes, and not within arrays.
|
|
3873
|
-
if (!
|
|
3884
|
+
if (!Tn(e.tt)) throw e.ut(t._methodName + "() can only be used with update() and set()");
|
|
3874
3885
|
if (!e.path) throw e.ut(t._methodName + "() is not currently supported inside arrays");
|
|
3875
3886
|
var n = t._toFieldTransform(e);
|
|
3876
3887
|
n && e.fieldTransforms.push(n);
|
|
@@ -3934,16 +3945,16 @@ var Pn = /** @class */ function(e) {
|
|
|
3934
3945
|
timestampValue: Pe(e.q, r)
|
|
3935
3946
|
};
|
|
3936
3947
|
}
|
|
3937
|
-
if (t instanceof
|
|
3948
|
+
if (t instanceof gn) return {
|
|
3938
3949
|
geoPointValue: {
|
|
3939
3950
|
latitude: t.latitude,
|
|
3940
3951
|
longitude: t.longitude
|
|
3941
3952
|
}
|
|
3942
3953
|
};
|
|
3943
|
-
if (t instanceof
|
|
3954
|
+
if (t instanceof yn) return {
|
|
3944
3955
|
bytesValue: Ne(e.q, t._byteString)
|
|
3945
3956
|
};
|
|
3946
|
-
if (t instanceof
|
|
3957
|
+
if (t instanceof an) {
|
|
3947
3958
|
var i = e.databaseId, o = t.firestore._databaseId;
|
|
3948
3959
|
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
3960
|
return {
|
|
@@ -3954,7 +3965,7 @@ var Pn = /** @class */ function(e) {
|
|
|
3954
3965
|
}(t, e);
|
|
3955
3966
|
}
|
|
3956
3967
|
|
|
3957
|
-
function
|
|
3968
|
+
function jn(t, e) {
|
|
3958
3969
|
var n = {};
|
|
3959
3970
|
return function(t) {
|
|
3960
3971
|
for (var e in t) if (Object.prototype.hasOwnProperty.call(t, e)) return !1;
|
|
@@ -3963,7 +3974,7 @@ function Rn(t, e) {
|
|
|
3963
3974
|
// If we encounter an empty object, we explicitly add it to the update
|
|
3964
3975
|
// mask to ensure that the server creates a map entry.
|
|
3965
3976
|
e.path && e.path.length > 0 && e.fieldMask.push(e.path) : St(t, (function(t, r) {
|
|
3966
|
-
var i = Ln(r, e.
|
|
3977
|
+
var i = Ln(r, e.nt(t));
|
|
3967
3978
|
null != i && (n[t] = i);
|
|
3968
3979
|
})), {
|
|
3969
3980
|
mapValue: {
|
|
@@ -3972,12 +3983,12 @@ function Rn(t, e) {
|
|
|
3972
3983
|
};
|
|
3973
3984
|
}
|
|
3974
3985
|
|
|
3975
|
-
function
|
|
3976
|
-
return !("object" != typeof t || null === t || t instanceof Array || t instanceof Date || t instanceof bt || t instanceof
|
|
3986
|
+
function Rn(t) {
|
|
3987
|
+
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
3988
|
}
|
|
3978
3989
|
|
|
3979
|
-
function
|
|
3980
|
-
if (!
|
|
3990
|
+
function Mn(t, e, n) {
|
|
3991
|
+
if (!Rn(n) || !function(t) {
|
|
3981
3992
|
return "object" == typeof t && null !== t && (Object.getPrototypeOf(t) === Object.prototype || null === Object.getPrototypeOf(t));
|
|
3982
3993
|
}(n)) {
|
|
3983
3994
|
var r = at(n);
|
|
@@ -3987,20 +3998,20 @@ function Un(t, e, n) {
|
|
|
3987
3998
|
|
|
3988
3999
|
/**
|
|
3989
4000
|
* Helper that calls fromDotSeparatedString() but wraps any error thrown.
|
|
3990
|
-
*/ function
|
|
4001
|
+
*/ function Un(t, e, n) {
|
|
3991
4002
|
if (
|
|
3992
4003
|
// If required, replace the FieldPath Compat class with with the firestore-exp
|
|
3993
4004
|
// FieldPath.
|
|
3994
|
-
(e = p(e)) instanceof
|
|
3995
|
-
if ("string" == typeof e) return
|
|
3996
|
-
throw
|
|
4005
|
+
(e = p(e)) instanceof dn) return e._internalPath;
|
|
4006
|
+
if ("string" == typeof e) return Bn(t, e);
|
|
4007
|
+
throw Gn("Field path arguments must be of type string or ", t,
|
|
3997
4008
|
/* hasConverter= */ !1,
|
|
3998
4009
|
/* path= */ void 0, n);
|
|
3999
4010
|
}
|
|
4000
4011
|
|
|
4001
4012
|
/**
|
|
4002
4013
|
* Matches any characters in a field path string that are reserved.
|
|
4003
|
-
*/ var
|
|
4014
|
+
*/ var xn = new RegExp("[~\\*/\\[\\]]");
|
|
4004
4015
|
|
|
4005
4016
|
/**
|
|
4006
4017
|
* Wraps fromDotSeparatedString with an error message about the method that
|
|
@@ -4010,20 +4021,20 @@ function Un(t, e, n) {
|
|
|
4010
4021
|
* split on dots.
|
|
4011
4022
|
* @param targetDoc - The document against which the field path will be
|
|
4012
4023
|
* evaluated.
|
|
4013
|
-
*/ function
|
|
4014
|
-
if (e.search(
|
|
4024
|
+
*/ function Bn(t, e, n) {
|
|
4025
|
+
if (e.search(xn) >= 0) throw Gn("Invalid field path (" + e + "). Paths must not contain '~', '*', '/', '[', or ']'", t,
|
|
4015
4026
|
/* hasConverter= */ !1,
|
|
4016
4027
|
/* path= */ void 0, n);
|
|
4017
4028
|
try {
|
|
4018
|
-
return (new (
|
|
4029
|
+
return (new (dn.bind.apply(dn, r([ void 0 ], e.split(".")))))._internalPath;
|
|
4019
4030
|
} catch (r) {
|
|
4020
|
-
throw
|
|
4031
|
+
throw Gn("Invalid field path (" + e + "). Paths must not be empty, begin with '.', end with '.', or contain '..'", t,
|
|
4021
4032
|
/* hasConverter= */ !1,
|
|
4022
4033
|
/* path= */ void 0, n);
|
|
4023
4034
|
}
|
|
4024
4035
|
}
|
|
4025
4036
|
|
|
4026
|
-
function
|
|
4037
|
+
function Gn(t, e, n, r, i) {
|
|
4027
4038
|
var o = r && !r.isEmpty(), a = void 0 !== i, s = "Function " + e + "() called with invalid data";
|
|
4028
4039
|
n && (s += " (via `toFirestore()`)");
|
|
4029
4040
|
var u = "";
|
|
@@ -4032,7 +4043,7 @@ function zn(t, e, n, r, i) {
|
|
|
4032
4043
|
/** Checks `haystack` if FieldPath `needle` is present. Runs in O(n). */;
|
|
4033
4044
|
}
|
|
4034
4045
|
|
|
4035
|
-
function
|
|
4046
|
+
function zn(t, e) {
|
|
4036
4047
|
return t.some((function(t) {
|
|
4037
4048
|
return t.isEqual(e);
|
|
4038
4049
|
}));
|
|
@@ -4062,7 +4073,7 @@ function Qn(t, e) {
|
|
|
4062
4073
|
* For a `DocumentSnapshot` that points to a non-existing document, any data
|
|
4063
4074
|
* access will return 'undefined'. You can use the `exists()` method to
|
|
4064
4075
|
* explicitly verify a document's existence.
|
|
4065
|
-
*/ var
|
|
4076
|
+
*/ var Qn = /** @class */ function() {
|
|
4066
4077
|
// Note: This class is stripped down version of the DocumentSnapshot in
|
|
4067
4078
|
// the legacy SDK. The changes are:
|
|
4068
4079
|
// - No support for SnapshotMetadata.
|
|
@@ -4083,7 +4094,7 @@ function Qn(t, e) {
|
|
|
4083
4094
|
* The `DocumentReference` for the document included in the `DocumentSnapshot`.
|
|
4084
4095
|
*/
|
|
4085
4096
|
get: function() {
|
|
4086
|
-
return new
|
|
4097
|
+
return new an(this._firestore, this._converter, this._key);
|
|
4087
4098
|
},
|
|
4088
4099
|
enumerable: !1,
|
|
4089
4100
|
configurable: !0
|
|
@@ -4108,7 +4119,7 @@ function Qn(t, e) {
|
|
|
4108
4119
|
if (this._converter) {
|
|
4109
4120
|
// We only want to use the converter and create a new DocumentSnapshot
|
|
4110
4121
|
// if a converter has been provided.
|
|
4111
|
-
var t = new
|
|
4122
|
+
var t = new Kn(this._firestore, this._userDataWriter, this._key, this._document,
|
|
4112
4123
|
/* converter= */ null);
|
|
4113
4124
|
return this._converter.fromFirestore(t);
|
|
4114
4125
|
}
|
|
@@ -4128,11 +4139,11 @@ function Qn(t, e) {
|
|
|
4128
4139
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4129
4140
|
t.prototype.get = function(t) {
|
|
4130
4141
|
if (this._document) {
|
|
4131
|
-
var e = this._document.data.field(
|
|
4142
|
+
var e = this._document.data.field(Yn("DocumentSnapshot.get", t));
|
|
4132
4143
|
if (null !== e) return this._userDataWriter.convertValue(e);
|
|
4133
4144
|
}
|
|
4134
4145
|
}, t;
|
|
4135
|
-
}(),
|
|
4146
|
+
}(), Kn = /** @class */ function(e) {
|
|
4136
4147
|
function n() {
|
|
4137
4148
|
return null !== e && e.apply(this, arguments) || this;
|
|
4138
4149
|
}
|
|
@@ -4144,7 +4155,7 @@ function Qn(t, e) {
|
|
|
4144
4155
|
*/ return t(n, e), n.prototype.data = function() {
|
|
4145
4156
|
return e.prototype.data.call(this);
|
|
4146
4157
|
}, n;
|
|
4147
|
-
}(
|
|
4158
|
+
}(Qn), Hn = /** @class */ function() {
|
|
4148
4159
|
/** @hideconstructor */
|
|
4149
4160
|
function t(t, e) {
|
|
4150
4161
|
this._docs = e, this.query = t;
|
|
@@ -4198,15 +4209,15 @@ function Qn(t, e) {
|
|
|
4198
4209
|
* @param right - A snapshot to compare.
|
|
4199
4210
|
* @returns true if the snapshots are equal.
|
|
4200
4211
|
*/
|
|
4201
|
-
function
|
|
4202
|
-
return t = p(t), e = p(e), t instanceof
|
|
4212
|
+
function Wn(t, e) {
|
|
4213
|
+
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
4214
|
/**
|
|
4204
4215
|
* Helper that calls `fromDotSeparatedString()` but wraps any error thrown.
|
|
4205
4216
|
*/;
|
|
4206
4217
|
}
|
|
4207
4218
|
|
|
4208
|
-
function
|
|
4209
|
-
return "string" == typeof e ?
|
|
4219
|
+
function Yn(t, e) {
|
|
4220
|
+
return "string" == typeof e ? Bn(t, e) : e instanceof dn ? e._internalPath : e._delegate._internalPath;
|
|
4210
4221
|
}
|
|
4211
4222
|
|
|
4212
4223
|
/**
|
|
@@ -4232,7 +4243,7 @@ function $n(t, e) {
|
|
|
4232
4243
|
* endBefore:1}, {@link (endAt:1)}, {@link limit} or {@link limitToLast} and
|
|
4233
4244
|
* can then be passed to {@link query} to create a new query instance that
|
|
4234
4245
|
* also contains this `QueryConstraint`.
|
|
4235
|
-
*/ var
|
|
4246
|
+
*/ var $n = function() {};
|
|
4236
4247
|
|
|
4237
4248
|
/**
|
|
4238
4249
|
* Creates a new immutable instance of {@link Query} that is extended to also include
|
|
@@ -4242,7 +4253,7 @@ function $n(t, e) {
|
|
|
4242
4253
|
* @param queryConstraints - The list of {@link QueryConstraint}s to apply.
|
|
4243
4254
|
* @throws if any of the provided query constraints cannot be combined with the
|
|
4244
4255
|
* existing or new constraints.
|
|
4245
|
-
*/ function
|
|
4256
|
+
*/ function Xn(t) {
|
|
4246
4257
|
for (var e = [], n = 1; n < arguments.length; n++) e[n - 1] = arguments[n];
|
|
4247
4258
|
for (var r = 0, i = e; r < i.length; r++) {
|
|
4248
4259
|
var o = i[r];
|
|
@@ -4251,39 +4262,39 @@ function $n(t, e) {
|
|
|
4251
4262
|
return t;
|
|
4252
4263
|
}
|
|
4253
4264
|
|
|
4254
|
-
var
|
|
4265
|
+
var Jn = /** @class */ function(e) {
|
|
4255
4266
|
function n(t, n, r) {
|
|
4256
4267
|
var i = this;
|
|
4257
4268
|
return (i = e.call(this) || this).dt = t, i.wt = n, i.yt = r, i.type = "where",
|
|
4258
4269
|
i;
|
|
4259
4270
|
}
|
|
4260
4271
|
return t(n, e), n.prototype._apply = function(t) {
|
|
4261
|
-
var e =
|
|
4272
|
+
var e = In(t.firestore), n = function(t, e, n, r, i, o, a) {
|
|
4262
4273
|
var s;
|
|
4263
4274
|
if (i.isKeyField()) {
|
|
4264
4275
|
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
4276
|
if ("in" /* IN */ === o || "not-in" /* NOT_IN */ === o) {
|
|
4266
|
-
|
|
4267
|
-
for (var u = [], c = 0,
|
|
4268
|
-
var
|
|
4269
|
-
u.push(
|
|
4277
|
+
pr(a, o);
|
|
4278
|
+
for (var u = [], c = 0, l = a; c < l.length; c++) {
|
|
4279
|
+
var f = l[c];
|
|
4280
|
+
u.push(hr(r, t, f));
|
|
4270
4281
|
}
|
|
4271
4282
|
s = {
|
|
4272
4283
|
arrayValue: {
|
|
4273
4284
|
values: u
|
|
4274
4285
|
}
|
|
4275
4286
|
};
|
|
4276
|
-
} else s =
|
|
4277
|
-
} else "in" /* IN */ !== o && "not-in" /* NOT_IN */ !== o && "array-contains-any" /* ARRAY_CONTAINS_ANY */ !== o ||
|
|
4278
|
-
s =
|
|
4287
|
+
} else s = hr(r, t, a);
|
|
4288
|
+
} else "in" /* IN */ !== o && "not-in" /* NOT_IN */ !== o && "array-contains-any" /* ARRAY_CONTAINS_ANY */ !== o || pr(a, o),
|
|
4289
|
+
s = Cn(n, "where", a,
|
|
4279
4290
|
/* allowArrays= */ "in" /* IN */ === o || "not-in" /* NOT_IN */ === o);
|
|
4280
4291
|
var h = Wt.create(i, o, s);
|
|
4281
4292
|
return function(t, e) {
|
|
4282
4293
|
if (e.N()) {
|
|
4283
|
-
var n =
|
|
4294
|
+
var n = le(t);
|
|
4284
4295
|
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
4296
|
var r = ce(t);
|
|
4286
|
-
null !== r &&
|
|
4297
|
+
null !== r && dr(t, e.field, r);
|
|
4287
4298
|
}
|
|
4288
4299
|
var i = function(t, e) {
|
|
4289
4300
|
for (var n = 0, r = t.filters; n < r.length; n++) {
|
|
@@ -4330,12 +4341,12 @@ var Zn = /** @class */ function(e) {
|
|
|
4330
4341
|
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
4342
|
}(t, h), h;
|
|
4332
4343
|
}(t._query, 0, e, t.firestore._databaseId, this.dt, this.wt, this.yt);
|
|
4333
|
-
return new
|
|
4344
|
+
return new sn(t.firestore, t.converter, function(t, e) {
|
|
4334
4345
|
var n = t.filters.concat([ e ]);
|
|
4335
4346
|
return new se(t.path, t.collectionGroup, t.explicitOrderBy.slice(), n, t.limit, t.limitType, t.startAt, t.endAt);
|
|
4336
4347
|
}(t._query, n));
|
|
4337
4348
|
}, n;
|
|
4338
|
-
}(
|
|
4349
|
+
}($n);
|
|
4339
4350
|
|
|
4340
4351
|
/**
|
|
4341
4352
|
* Creates a {@link QueryConstraint} that enforces that documents must contain the
|
|
@@ -4347,12 +4358,12 @@ var Zn = /** @class */ function(e) {
|
|
|
4347
4358
|
* "<=", "!=").
|
|
4348
4359
|
* @param value - The value for comparison
|
|
4349
4360
|
* @returns The created {@link Query}.
|
|
4350
|
-
*/ function
|
|
4351
|
-
var r = e, i =
|
|
4352
|
-
return new
|
|
4361
|
+
*/ function Zn(t, e, n) {
|
|
4362
|
+
var r = e, i = Yn("where", t);
|
|
4363
|
+
return new Jn(i, r, n);
|
|
4353
4364
|
}
|
|
4354
4365
|
|
|
4355
|
-
var
|
|
4366
|
+
var tr = /** @class */ function(e) {
|
|
4356
4367
|
function n(t, n) {
|
|
4357
4368
|
var r = this;
|
|
4358
4369
|
return (r = e.call(this) || this).dt = t, r._t = n, r.type = "orderBy", r;
|
|
@@ -4365,18 +4376,18 @@ var er = /** @class */ function(e) {
|
|
|
4365
4376
|
return function(t, e) {
|
|
4366
4377
|
if (null === ce(t)) {
|
|
4367
4378
|
// This is the first order by. It must match any inequality.
|
|
4368
|
-
var n =
|
|
4369
|
-
null !== n &&
|
|
4379
|
+
var n = le(t);
|
|
4380
|
+
null !== n && dr(t, n, e.field);
|
|
4370
4381
|
}
|
|
4371
4382
|
}(t, r), r;
|
|
4372
4383
|
}(t._query, this.dt, this._t);
|
|
4373
|
-
return new
|
|
4384
|
+
return new sn(t.firestore, t.converter, function(t, e) {
|
|
4374
4385
|
// TODO(dimond): validate that orderBy does not list the same key twice.
|
|
4375
4386
|
var n = t.explicitOrderBy.concat([ e ]);
|
|
4376
4387
|
return new se(t.path, t.collectionGroup, n, t.filters.slice(), t.limit, t.limitType, t.startAt, t.endAt);
|
|
4377
4388
|
}(t._query, e));
|
|
4378
4389
|
}, n;
|
|
4379
|
-
}(
|
|
4390
|
+
}($n);
|
|
4380
4391
|
|
|
4381
4392
|
/**
|
|
4382
4393
|
* Creates a {@link QueryConstraint} that sorts the query result by the
|
|
@@ -4386,31 +4397,31 @@ var er = /** @class */ function(e) {
|
|
|
4386
4397
|
* @param directionStr - Optional direction to sort by ('asc' or 'desc'). If
|
|
4387
4398
|
* not specified, order will be ascending.
|
|
4388
4399
|
* @returns The created {@link Query}.
|
|
4389
|
-
*/ function
|
|
4400
|
+
*/ function er(t, e) {
|
|
4390
4401
|
void 0 === e && (e = "asc");
|
|
4391
|
-
var n = e, r =
|
|
4392
|
-
return new
|
|
4402
|
+
var n = e, r = Yn("orderBy", t);
|
|
4403
|
+
return new tr(r, n);
|
|
4393
4404
|
}
|
|
4394
4405
|
|
|
4395
|
-
var
|
|
4406
|
+
var nr = /** @class */ function(e) {
|
|
4396
4407
|
function n(t, n, r) {
|
|
4397
4408
|
var i = this;
|
|
4398
4409
|
return (i = e.call(this) || this).type = t, i.gt = n, i.vt = r, i;
|
|
4399
4410
|
}
|
|
4400
4411
|
return t(n, e), n.prototype._apply = function(t) {
|
|
4401
|
-
return new
|
|
4412
|
+
return new sn(t.firestore, t.converter, function(t, e, n) {
|
|
4402
4413
|
return new se(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), e, n, t.startAt, t.endAt);
|
|
4403
4414
|
}(t._query, this.gt, this.vt));
|
|
4404
4415
|
}, n;
|
|
4405
|
-
}(
|
|
4416
|
+
}($n);
|
|
4406
4417
|
|
|
4407
4418
|
/**
|
|
4408
4419
|
* Creates a {@link QueryConstraint} that only returns the first matching documents.
|
|
4409
4420
|
*
|
|
4410
4421
|
* @param limit - The maximum number of items to return.
|
|
4411
4422
|
* @returns The created {@link Query}.
|
|
4412
|
-
*/ function
|
|
4413
|
-
return ut("limit", t), new
|
|
4423
|
+
*/ function rr(t) {
|
|
4424
|
+
return ut("limit", t), new nr("limit", t, "F" /* First */)
|
|
4414
4425
|
/**
|
|
4415
4426
|
* Creates a {@link QueryConstraint} that only returns the last matching documents.
|
|
4416
4427
|
*
|
|
@@ -4422,59 +4433,61 @@ var rr = /** @class */ function(e) {
|
|
|
4422
4433
|
*/;
|
|
4423
4434
|
}
|
|
4424
4435
|
|
|
4425
|
-
function
|
|
4426
|
-
return ut("limitToLast", t), new
|
|
4436
|
+
function ir(t) {
|
|
4437
|
+
return ut("limitToLast", t), new nr("limitToLast", t, "L" /* Last */);
|
|
4427
4438
|
}
|
|
4428
4439
|
|
|
4429
|
-
var
|
|
4440
|
+
var or = /** @class */ function(e) {
|
|
4430
4441
|
function n(t, n, r) {
|
|
4431
4442
|
var i = this;
|
|
4432
4443
|
return (i = e.call(this) || this).type = t, i.bt = n, i.Et = r, i;
|
|
4433
4444
|
}
|
|
4434
4445
|
return t(n, e), n.prototype._apply = function(t) {
|
|
4435
|
-
var e =
|
|
4436
|
-
return new
|
|
4446
|
+
var e = fr(t, this.type, this.bt, this.Et);
|
|
4447
|
+
return new sn(t.firestore, t.converter, function(t, e) {
|
|
4437
4448
|
return new se(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), t.limit, t.limitType, e, t.endAt);
|
|
4438
4449
|
}(t._query, e));
|
|
4439
4450
|
}, n;
|
|
4440
|
-
}(
|
|
4451
|
+
}($n);
|
|
4441
4452
|
|
|
4442
|
-
function
|
|
4453
|
+
function ar() {
|
|
4443
4454
|
for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
|
|
4444
|
-
return new
|
|
4455
|
+
return new or("startAt", t,
|
|
4456
|
+
/*inclusive=*/ !0);
|
|
4445
4457
|
}
|
|
4446
4458
|
|
|
4447
|
-
function
|
|
4459
|
+
function sr() {
|
|
4448
4460
|
for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
|
|
4449
|
-
return new
|
|
4450
|
-
/*
|
|
4461
|
+
return new or("startAfter", t,
|
|
4462
|
+
/*inclusive=*/ !1);
|
|
4451
4463
|
}
|
|
4452
4464
|
|
|
4453
|
-
var
|
|
4465
|
+
var ur = /** @class */ function(e) {
|
|
4454
4466
|
function n(t, n, r) {
|
|
4455
4467
|
var i = this;
|
|
4456
4468
|
return (i = e.call(this) || this).type = t, i.bt = n, i.Et = r, i;
|
|
4457
4469
|
}
|
|
4458
4470
|
return t(n, e), n.prototype._apply = function(t) {
|
|
4459
|
-
var e =
|
|
4460
|
-
return new
|
|
4471
|
+
var e = fr(t, this.type, this.bt, this.Et);
|
|
4472
|
+
return new sn(t.firestore, t.converter, function(t, e) {
|
|
4461
4473
|
return new se(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), t.limit, t.limitType, t.startAt, e);
|
|
4462
4474
|
}(t._query, e));
|
|
4463
4475
|
}, n;
|
|
4464
|
-
}(
|
|
4476
|
+
}($n);
|
|
4465
4477
|
|
|
4466
|
-
function
|
|
4478
|
+
function cr() {
|
|
4467
4479
|
for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
|
|
4468
|
-
return new
|
|
4480
|
+
return new ur("endBefore", t,
|
|
4481
|
+
/*inclusive=*/ !1);
|
|
4469
4482
|
}
|
|
4470
4483
|
|
|
4471
4484
|
function lr() {
|
|
4472
4485
|
for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
|
|
4473
|
-
return new
|
|
4486
|
+
return new ur("endAt", t, /*inclusive=*/ !0);
|
|
4474
4487
|
}
|
|
4475
4488
|
|
|
4476
|
-
/** Helper function to create a bound from a document or fields */ function
|
|
4477
|
-
if (n[0] = p(n[0]), n[0] instanceof
|
|
4489
|
+
/** Helper function to create a bound from a document or fields */ function fr(t, e, n, r) {
|
|
4490
|
+
if (n[0] = p(n[0]), n[0] instanceof Qn) return function(t, e, n, r, i) {
|
|
4478
4491
|
if (!r) throw new U(P, "Can't use a DocumentSnapshot that doesn't exist for " + n + "().");
|
|
4479
4492
|
// Because people expect to continue/end a query at the exact document
|
|
4480
4493
|
// provided, we need to use the implicit sort order rather than the explicit
|
|
@@ -4489,15 +4502,15 @@ function lr() {
|
|
|
4489
4502
|
var c = r.data.field(u.field);
|
|
4490
4503
|
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
4504
|
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 '" +
|
|
4505
|
+
var l = u.field.canonicalString();
|
|
4506
|
+
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
4507
|
}
|
|
4495
4508
|
o.push(c);
|
|
4496
4509
|
}
|
|
4497
4510
|
}
|
|
4498
4511
|
return new re(o, i);
|
|
4499
4512
|
}(t._query, t.firestore._databaseId, e, n[0]._document, r);
|
|
4500
|
-
var i =
|
|
4513
|
+
var i = In(t.firestore);
|
|
4501
4514
|
return function(t, e, n, r, i, o) {
|
|
4502
4515
|
// Use explicit order by's because it has to match the query the user made
|
|
4503
4516
|
var a = t.explicitOrderBy;
|
|
@@ -4506,13 +4519,13 @@ function lr() {
|
|
|
4506
4519
|
var c = i[u];
|
|
4507
4520
|
if (a[u].field.isKeyField()) {
|
|
4508
4521
|
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,
|
|
4522
|
+
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.");
|
|
4523
|
+
var l = t.path.child(Z.fromString(c));
|
|
4524
|
+
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.");
|
|
4525
|
+
var f = new nt(l);
|
|
4526
|
+
s.push(Rt(e, f));
|
|
4514
4527
|
} else {
|
|
4515
|
-
var h =
|
|
4528
|
+
var h = Cn(n, r, c);
|
|
4516
4529
|
s.push(h);
|
|
4517
4530
|
}
|
|
4518
4531
|
}
|
|
@@ -4520,27 +4533,27 @@ function lr() {
|
|
|
4520
4533
|
}(t._query, t.firestore._databaseId, i, e, n, r);
|
|
4521
4534
|
}
|
|
4522
4535
|
|
|
4523
|
-
function
|
|
4536
|
+
function hr(t, e, n) {
|
|
4524
4537
|
if ("string" == typeof (n = p(n))) {
|
|
4525
4538
|
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 (!
|
|
4539
|
+
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
4540
|
var r = e.path.child(Z.fromString(n));
|
|
4528
4541
|
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
4542
|
return Rt(t, new nt(r));
|
|
4530
4543
|
}
|
|
4531
|
-
if (n instanceof
|
|
4544
|
+
if (n instanceof an) return Rt(t, n._key);
|
|
4532
4545
|
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
4546
|
}
|
|
4534
4547
|
|
|
4535
4548
|
/**
|
|
4536
4549
|
* Validates that the value passed into a disjunctive filter satisfies all
|
|
4537
4550
|
* array requirements.
|
|
4538
|
-
*/ function
|
|
4551
|
+
*/ function pr(t, e) {
|
|
4539
4552
|
if (!Array.isArray(t) || 0 === t.length) throw new U(V, "Invalid Query. A non-empty array is required for '" + e.toString() + "' filters.");
|
|
4540
4553
|
if (t.length > 10) throw new U(V, "Invalid Query. '" + e.toString() + "' filters support a maximum of 10 elements in the value array.");
|
|
4541
4554
|
}
|
|
4542
4555
|
|
|
4543
|
-
function
|
|
4556
|
+
function dr(t, e, n) {
|
|
4544
4557
|
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
4558
|
}
|
|
4546
4559
|
|
|
@@ -4590,23 +4603,23 @@ function mr(t, e, n) {
|
|
|
4590
4603
|
* because we want to provide the user with a more specific error message if
|
|
4591
4604
|
* their `set()` or fails due to invalid data originating from a `toFirestore()`
|
|
4592
4605
|
* call.
|
|
4593
|
-
*/ function
|
|
4606
|
+
*/ function mr(t, e, n) {
|
|
4594
4607
|
// Cast to `any` in order to satisfy the union type constraint on
|
|
4595
4608
|
// toFirestore().
|
|
4596
4609
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4597
4610
|
return t ? n && (n.merge || n.mergeFields) ? t.toFirestore(e, n) : t.toFirestore(e) : e;
|
|
4598
4611
|
}
|
|
4599
4612
|
|
|
4600
|
-
var
|
|
4613
|
+
var yr = /** @class */ function(e) {
|
|
4601
4614
|
function n(t) {
|
|
4602
4615
|
var n = this;
|
|
4603
4616
|
return (n = e.call(this) || this).firestore = t, n;
|
|
4604
4617
|
}
|
|
4605
4618
|
return t(n, e), n.prototype.convertBytes = function(t) {
|
|
4606
|
-
return new
|
|
4619
|
+
return new yn(t);
|
|
4607
4620
|
}, n.prototype.convertReference = function(t) {
|
|
4608
4621
|
var e = this.convertDocumentKey(t, this.firestore._databaseId);
|
|
4609
|
-
return new
|
|
4622
|
+
return new an(this.firestore, /* converter= */ null, e);
|
|
4610
4623
|
}, n;
|
|
4611
4624
|
}(/** @class */ function() {
|
|
4612
4625
|
function t() {}
|
|
@@ -4654,7 +4667,7 @@ var vr = /** @class */ function(e) {
|
|
|
4654
4667
|
r[t] = n.convertValue(i, e);
|
|
4655
4668
|
})), r;
|
|
4656
4669
|
}, t.prototype.convertGeoPoint = function(t) {
|
|
4657
|
-
return new
|
|
4670
|
+
return new gn(Vt(t.latitude), Vt(t.longitude));
|
|
4658
4671
|
}, t.prototype.convertArray = function(t, e) {
|
|
4659
4672
|
var n = this;
|
|
4660
4673
|
return (t.values || []).map((function(t) {
|
|
@@ -4677,7 +4690,7 @@ var vr = /** @class */ function(e) {
|
|
|
4677
4690
|
return new bt(e.seconds, e.nanos);
|
|
4678
4691
|
}, t.prototype.convertDocumentKey = function(t, e) {
|
|
4679
4692
|
var n = Z.fromString(t);
|
|
4680
|
-
E(
|
|
4693
|
+
E(ze(n));
|
|
4681
4694
|
var r = new X(n.get(1), n.get(3)), i = new nt(n.popFirst(5));
|
|
4682
4695
|
return r.isEqual(e) ||
|
|
4683
4696
|
// TODO(b/64130202): Somehow support foreign references.
|
|
@@ -4698,12 +4711,12 @@ var vr = /** @class */ function(e) {
|
|
|
4698
4711
|
* @param reference - The reference of the document to fetch.
|
|
4699
4712
|
* @returns A Promise resolved with a `DocumentSnapshot` containing the current
|
|
4700
4713
|
* document contents.
|
|
4701
|
-
*/ function
|
|
4702
|
-
var e =
|
|
4703
|
-
return
|
|
4714
|
+
*/ function vr(t) {
|
|
4715
|
+
var e = Je((t = st(t, an)).firestore), n = new yr(t.firestore);
|
|
4716
|
+
return Ye(e, [ t._key ]).then((function(e) {
|
|
4704
4717
|
E(1 === e.length);
|
|
4705
4718
|
var r = e[0];
|
|
4706
|
-
return new
|
|
4719
|
+
return new Qn(t.firestore, n, t._key, r.isFoundDocument() ? r : null, t.converter);
|
|
4707
4720
|
}));
|
|
4708
4721
|
}
|
|
4709
4722
|
|
|
@@ -4718,35 +4731,35 @@ var vr = /** @class */ function(e) {
|
|
|
4718
4731
|
*
|
|
4719
4732
|
* @param query - The `Query` to execute.
|
|
4720
4733
|
* @returns A Promise that will be resolved with the results of the query.
|
|
4721
|
-
*/ function
|
|
4734
|
+
*/ function gr(t) {
|
|
4722
4735
|
!function(t) {
|
|
4723
|
-
if (ue(t) && 0 === t.explicitOrderBy.length) throw new U(
|
|
4724
|
-
}((t = st(t,
|
|
4725
|
-
var e =
|
|
4726
|
-
return
|
|
4736
|
+
if (ue(t) && 0 === t.explicitOrderBy.length) throw new U(j, "limitToLast() queries require specifying at least one orderBy() clause");
|
|
4737
|
+
}((t = st(t, sn))._query);
|
|
4738
|
+
var e = Je(t.firestore), n = new yr(t.firestore);
|
|
4739
|
+
return $e(e, t._query).then((function(e) {
|
|
4727
4740
|
var r = e.map((function(e) {
|
|
4728
|
-
return new
|
|
4741
|
+
return new Kn(t.firestore, n, e.key, e, t.converter);
|
|
4729
4742
|
}));
|
|
4730
4743
|
return ue(t._query) &&
|
|
4731
4744
|
// Limit to last queries reverse the orderBy constraint that was
|
|
4732
4745
|
// specified by the user. As such, we need to reverse the order of the
|
|
4733
4746
|
// results to return the documents in the expected order.
|
|
4734
|
-
r.reverse(), new
|
|
4747
|
+
r.reverse(), new Hn(t, r);
|
|
4735
4748
|
}));
|
|
4736
4749
|
}
|
|
4737
4750
|
|
|
4738
|
-
function
|
|
4739
|
-
var r =
|
|
4740
|
-
return
|
|
4751
|
+
function wr(t, e, n) {
|
|
4752
|
+
var r = mr((t = st(t, an)).converter, e, n), i = An(In(t.firestore), "setDoc", t._key, r, null !== t.converter, n);
|
|
4753
|
+
return We(Je(t.firestore), [ i.toMutation(t._key, _e.none()) ]);
|
|
4741
4754
|
}
|
|
4742
4755
|
|
|
4743
|
-
function
|
|
4756
|
+
function br(t, e, n) {
|
|
4744
4757
|
for (var r = [], i = 3; i < arguments.length; i++) r[i - 3] = arguments[i];
|
|
4745
|
-
var o, a =
|
|
4758
|
+
var o, a = In((t = st(t, an)).firestore);
|
|
4746
4759
|
// For Compat types, we have to "extract" the underlying types before
|
|
4747
4760
|
// performing validation.
|
|
4748
|
-
return o = "string" == typeof (e = p(e)) || e instanceof
|
|
4749
|
-
|
|
4761
|
+
return o = "string" == typeof (e = p(e)) || e instanceof dn ? On(a, "updateDoc", t._key, e, n, r) : Fn(a, "updateDoc", t._key, e),
|
|
4762
|
+
We(Je(t.firestore), [ o.toMutation(t._key, _e.exists(!0)) ]);
|
|
4750
4763
|
}
|
|
4751
4764
|
|
|
4752
4765
|
/**
|
|
@@ -4760,8 +4773,8 @@ function _r(t, e, n) {
|
|
|
4760
4773
|
* @param reference - A reference to the document to delete.
|
|
4761
4774
|
* @returns A `Promise` resolved once the document has been successfully
|
|
4762
4775
|
* deleted from the backend.
|
|
4763
|
-
*/ function
|
|
4764
|
-
return
|
|
4776
|
+
*/ function _r(t) {
|
|
4777
|
+
return We(Je((t = st(t, an)).firestore), [ new Ie(t._key, _e.none()) ]);
|
|
4765
4778
|
}
|
|
4766
4779
|
|
|
4767
4780
|
/**
|
|
@@ -4778,9 +4791,9 @@ function _r(t, e, n) {
|
|
|
4778
4791
|
* @throws Error - If the provided input is not a valid Firestore document.
|
|
4779
4792
|
* @returns A `Promise` resolved with a `DocumentReference` pointing to the
|
|
4780
4793
|
* newly created document after it has been written to the backend.
|
|
4781
|
-
*/ function
|
|
4782
|
-
var n =
|
|
4783
|
-
return
|
|
4794
|
+
*/ function Tr(t, e) {
|
|
4795
|
+
var n = fn(t = st(t, un)), r = mr(t.converter, e), i = An(In(t.firestore), "addDoc", n._key, r, null !== n.converter, {});
|
|
4796
|
+
return We(Je(t.firestore), [ i.toMutation(n._key, _e.exists(!1)) ]).then((function() {
|
|
4784
4797
|
return n;
|
|
4785
4798
|
}));
|
|
4786
4799
|
}
|
|
@@ -4804,15 +4817,15 @@ function _r(t, e, n) {
|
|
|
4804
4817
|
/**
|
|
4805
4818
|
* Returns a sentinel for use with {@link @firebase/firestore/lite#(updateDoc:1)} or
|
|
4806
4819
|
* {@link @firebase/firestore/lite#(setDoc:1)} with `{merge: true}` to mark a field for deletion.
|
|
4807
|
-
*/ function
|
|
4808
|
-
return new
|
|
4820
|
+
*/ function Sr() {
|
|
4821
|
+
return new kn("deleteField");
|
|
4809
4822
|
}
|
|
4810
4823
|
|
|
4811
4824
|
/**
|
|
4812
4825
|
* Returns a sentinel used with {@link @firebase/firestore/lite#(setDoc:1)} or {@link @firebase/firestore/lite#(updateDoc:1)} to
|
|
4813
4826
|
* include a server-generated timestamp in the written data.
|
|
4814
|
-
*/ function
|
|
4815
|
-
return new
|
|
4827
|
+
*/ function Er() {
|
|
4828
|
+
return new Dn("serverTimestamp");
|
|
4816
4829
|
}
|
|
4817
4830
|
|
|
4818
4831
|
/**
|
|
@@ -4826,11 +4839,11 @@ function _r(t, e, n) {
|
|
|
4826
4839
|
* @param elements - The elements to union into the array.
|
|
4827
4840
|
* @returns The `FieldValue` sentinel for use in a call to `setDoc()` or
|
|
4828
4841
|
* `updateDoc()`.
|
|
4829
|
-
*/ function
|
|
4842
|
+
*/ function Ir() {
|
|
4830
4843
|
for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
|
|
4831
4844
|
// NOTE: We don't actually parse the data until it's used in set() or
|
|
4832
4845
|
// update() since we'd need the Firestore instance to do this.
|
|
4833
|
-
return new
|
|
4846
|
+
return new Pn("arrayUnion", t);
|
|
4834
4847
|
}
|
|
4835
4848
|
|
|
4836
4849
|
/**
|
|
@@ -4843,11 +4856,11 @@ function _r(t, e, n) {
|
|
|
4843
4856
|
* @param elements - The elements to remove from the array.
|
|
4844
4857
|
* @returns The `FieldValue` sentinel for use in a call to `setDoc()` or
|
|
4845
4858
|
* `updateDoc()`
|
|
4846
|
-
*/ function
|
|
4859
|
+
*/ function Ar() {
|
|
4847
4860
|
for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
|
|
4848
4861
|
// NOTE: We don't actually parse the data until it's used in set() or
|
|
4849
4862
|
// update() since we'd need the Firestore instance to do this.
|
|
4850
|
-
return new
|
|
4863
|
+
return new Nn("arrayRemove", t);
|
|
4851
4864
|
}
|
|
4852
4865
|
|
|
4853
4866
|
/**
|
|
@@ -4868,8 +4881,8 @@ function _r(t, e, n) {
|
|
|
4868
4881
|
* @param n - The value to increment by.
|
|
4869
4882
|
* @returns The `FieldValue` sentinel for use in a call to `setDoc()` or
|
|
4870
4883
|
* `updateDoc()`
|
|
4871
|
-
*/ function
|
|
4872
|
-
return new
|
|
4884
|
+
*/ function kr(t) {
|
|
4885
|
+
return new qn("increment", t);
|
|
4873
4886
|
}
|
|
4874
4887
|
|
|
4875
4888
|
/**
|
|
@@ -4895,23 +4908,23 @@ function _r(t, e, n) {
|
|
|
4895
4908
|
* provides methods for adding writes to the write batch. None of the writes
|
|
4896
4909
|
* will be committed (or visible locally) until {@link WriteBatch.commit} is
|
|
4897
4910
|
* called.
|
|
4898
|
-
*/ var
|
|
4911
|
+
*/ var Vr = /** @class */ function() {
|
|
4899
4912
|
/** @hideconstructor */
|
|
4900
4913
|
function t(t, e) {
|
|
4901
4914
|
this._firestore = t, this._commitHandler = e, this._mutations = [], this._committed = !1,
|
|
4902
|
-
this._dataReader =
|
|
4915
|
+
this._dataReader = In(t);
|
|
4903
4916
|
}
|
|
4904
4917
|
return t.prototype.set = function(t, e, n) {
|
|
4905
4918
|
this._verifyNotCommitted();
|
|
4906
|
-
var r =
|
|
4919
|
+
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
4920
|
return this._mutations.push(o.toMutation(r._key, _e.none())), this;
|
|
4908
4921
|
}, t.prototype.update = function(t, e, n) {
|
|
4909
4922
|
for (var r = [], i = 3; i < arguments.length; i++) r[i - 3] = arguments[i];
|
|
4910
4923
|
this._verifyNotCommitted();
|
|
4911
|
-
var o, a =
|
|
4924
|
+
var o, a = Dr(t, this._firestore);
|
|
4912
4925
|
// For Compat types, we have to "extract" the underlying types before
|
|
4913
4926
|
// performing validation.
|
|
4914
|
-
return o = "string" == typeof (e = p(e)) || e instanceof
|
|
4927
|
+
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
4928
|
this._mutations.push(o.toMutation(a._key, _e.exists(!0))), this;
|
|
4916
4929
|
},
|
|
4917
4930
|
/**
|
|
@@ -4922,7 +4935,7 @@ function _r(t, e, n) {
|
|
|
4922
4935
|
*/
|
|
4923
4936
|
t.prototype.delete = function(t) {
|
|
4924
4937
|
this._verifyNotCommitted();
|
|
4925
|
-
var e =
|
|
4938
|
+
var e = Dr(t, this._firestore);
|
|
4926
4939
|
return this._mutations = this._mutations.concat(new Ie(e._key, _e.none())), this;
|
|
4927
4940
|
},
|
|
4928
4941
|
/**
|
|
@@ -4944,7 +4957,7 @@ function _r(t, e, n) {
|
|
|
4944
4957
|
}, t;
|
|
4945
4958
|
}();
|
|
4946
4959
|
|
|
4947
|
-
function
|
|
4960
|
+
function Dr(t, e) {
|
|
4948
4961
|
if ((t = p(t)).firestore !== e) throw new U(V, "Provided document reference is from a different Firestore instance.");
|
|
4949
4962
|
return t;
|
|
4950
4963
|
}
|
|
@@ -4961,10 +4974,10 @@ function Pr(t, e) {
|
|
|
4961
4974
|
*
|
|
4962
4975
|
* @returns A `WriteBatch` that can be used to atomically execute multiple
|
|
4963
4976
|
* writes.
|
|
4964
|
-
*/ function
|
|
4965
|
-
var e =
|
|
4966
|
-
return new
|
|
4967
|
-
return
|
|
4977
|
+
*/ function Pr(t) {
|
|
4978
|
+
var e = Je(t = st(t, tn));
|
|
4979
|
+
return new Vr(t, (function(t) {
|
|
4980
|
+
return We(e, t);
|
|
4968
4981
|
}));
|
|
4969
4982
|
}
|
|
4970
4983
|
|
|
@@ -4987,7 +5000,7 @@ function Pr(t, e) {
|
|
|
4987
5000
|
/**
|
|
4988
5001
|
* Internal transaction object responsible for accumulating the mutations to
|
|
4989
5002
|
* perform and the base versions for any documents read.
|
|
4990
|
-
*/ var
|
|
5003
|
+
*/ var Nr = /** @class */ function() {
|
|
4991
5004
|
function t(t) {
|
|
4992
5005
|
this.datastore = t,
|
|
4993
5006
|
// The version of each document that was read during this transaction.
|
|
@@ -5012,7 +5025,7 @@ function Pr(t, e) {
|
|
|
5012
5025
|
switch (n.label) {
|
|
5013
5026
|
case 0:
|
|
5014
5027
|
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*/ ,
|
|
5028
|
+
return [ 4 /*yield*/ , Ye(this.datastore, t) ];
|
|
5016
5029
|
|
|
5017
5030
|
case 1:
|
|
5018
5031
|
return [ 2 /*return*/ , ((e = n.sent()).forEach((function(t) {
|
|
@@ -5049,7 +5062,7 @@ function Pr(t, e) {
|
|
|
5049
5062
|
t.forEach((function(t, n) {
|
|
5050
5063
|
var r = nt.fromPath(n);
|
|
5051
5064
|
e.mutations.push(new Ae(r, e.precondition(r)));
|
|
5052
|
-
})), [ 4 /*yield*/ ,
|
|
5065
|
+
})), [ 4 /*yield*/ , We(this.datastore, this.mutations) ];
|
|
5053
5066
|
|
|
5054
5067
|
case 1:
|
|
5055
5068
|
// For each mutation, note that the doc was written.
|
|
@@ -5107,10 +5120,10 @@ function Pr(t, e) {
|
|
|
5107
5120
|
}, t.prototype.write = function(t) {
|
|
5108
5121
|
this.ensureCommitNotCalled(), this.mutations.push(t);
|
|
5109
5122
|
}, t.prototype.ensureCommitNotCalled = function() {}, t;
|
|
5110
|
-
}(),
|
|
5123
|
+
}(), qr = /** @class */ function() {
|
|
5111
5124
|
function t(t, e, n, r) {
|
|
5112
5125
|
this.asyncQueue = t, this.datastore = e, this.updateFunction = n, this.deferred = r,
|
|
5113
|
-
this.Tt = 5, this.It = new
|
|
5126
|
+
this.Tt = 5, this.It = new Ke(this.asyncQueue, "transaction_retry" /* TransactionRetry */)
|
|
5114
5127
|
/** Runs the transaction and sets the result on deferred. */;
|
|
5115
5128
|
}
|
|
5116
5129
|
return t.prototype.run = function() {
|
|
@@ -5121,7 +5134,7 @@ function Pr(t, e) {
|
|
|
5121
5134
|
return e(t, void 0, void 0, (function() {
|
|
5122
5135
|
var t, e, r = this;
|
|
5123
5136
|
return n(this, (function(n) {
|
|
5124
|
-
return t = new
|
|
5137
|
+
return t = new Nr(this.datastore), (e = this.Rt(t)) && e.then((function(e) {
|
|
5125
5138
|
r.asyncQueue.enqueueAndForget((function() {
|
|
5126
5139
|
return t.commit().then((function() {
|
|
5127
5140
|
r.deferred.resolve(e);
|
|
@@ -5186,8 +5199,8 @@ function Pr(t, e) {
|
|
|
5186
5199
|
// the context and should handled individually by the calling code.
|
|
5187
5200
|
// See https://cloud.google.com/apis/design/errors.
|
|
5188
5201
|
case C:
|
|
5189
|
-
case j:
|
|
5190
5202
|
case L:
|
|
5203
|
+
case j:
|
|
5191
5204
|
case "data-loss":
|
|
5192
5205
|
return !0;
|
|
5193
5206
|
}
|
|
@@ -5233,7 +5246,7 @@ function Pr(t, e) {
|
|
|
5233
5246
|
* See the License for the specific language governing permissions and
|
|
5234
5247
|
* limitations under the License.
|
|
5235
5248
|
*/
|
|
5236
|
-
/** The Platform's 'document' implementation or null if not available. */ function
|
|
5249
|
+
/** The Platform's 'document' implementation or null if not available. */ function Fr() {
|
|
5237
5250
|
// `document` is not always available, e.g. in ReactNative and WebWorkers.
|
|
5238
5251
|
// eslint-disable-next-line no-restricted-globals
|
|
5239
5252
|
return "undefined" != typeof document ? document : null;
|
|
@@ -5265,7 +5278,7 @@ function Pr(t, e) {
|
|
|
5265
5278
|
* Note: We implement `PromiseLike` instead of `Promise`, as the `Promise` type
|
|
5266
5279
|
* in newer versions of TypeScript defines `finally`, which is not available in
|
|
5267
5280
|
* IE.
|
|
5268
|
-
*/ var
|
|
5281
|
+
*/ var Or = /** @class */ function() {
|
|
5269
5282
|
function t(t, e, n, r, i) {
|
|
5270
5283
|
this.asyncQueue = t, this.timerId = e, this.targetTimeMs = n, this.op = r, this.removalCallback = i,
|
|
5271
5284
|
this.deferred = new x, this.then = this.deferred.promise.then.bind(this.deferred.promise),
|
|
@@ -5329,7 +5342,7 @@ function Pr(t, e) {
|
|
|
5329
5342
|
null !== this.timerHandle && (this.removalCallback(this), clearTimeout(this.timerHandle),
|
|
5330
5343
|
this.timerHandle = null);
|
|
5331
5344
|
}, t;
|
|
5332
|
-
}(),
|
|
5345
|
+
}(), Cr = /** @class */ function() {
|
|
5333
5346
|
function t() {
|
|
5334
5347
|
var t = this;
|
|
5335
5348
|
// The last promise in the queue.
|
|
@@ -5353,15 +5366,15 @@ function Pr(t, e) {
|
|
|
5353
5366
|
// List of TimerIds to fast-forward delays for.
|
|
5354
5367
|
this.Ot = [],
|
|
5355
5368
|
// Backoff timer used to schedule retries for retryable operations
|
|
5356
|
-
this.It = new
|
|
5369
|
+
this.It = new Ke(this, "async_queue_retry" /* AsyncQueueRetry */),
|
|
5357
5370
|
// Visibility handler that triggers an immediate retry of all retryable
|
|
5358
5371
|
// operations. Meant to speed up recovery when we regain file system access
|
|
5359
5372
|
// after page comes into foreground.
|
|
5360
5373
|
this.Ct = function() {
|
|
5361
|
-
var e =
|
|
5374
|
+
var e = Fr();
|
|
5362
5375
|
e && w("AsyncQueue", "Visibility state changed to " + e.visibilityState), t.It.H();
|
|
5363
5376
|
};
|
|
5364
|
-
var e =
|
|
5377
|
+
var e = Fr();
|
|
5365
5378
|
e && "function" == typeof e.addEventListener && e.addEventListener("visibilitychange", this.Ct);
|
|
5366
5379
|
}
|
|
5367
5380
|
return Object.defineProperty(t.prototype, "isShuttingDown", {
|
|
@@ -5385,7 +5398,7 @@ function Pr(t, e) {
|
|
|
5385
5398
|
}, t.prototype.enterRestrictedMode = function(t) {
|
|
5386
5399
|
if (!this.$t) {
|
|
5387
5400
|
this.$t = !0, this.qt = t || !1;
|
|
5388
|
-
var e =
|
|
5401
|
+
var e = Fr();
|
|
5389
5402
|
e && "function" == typeof e.removeEventListener && e.removeEventListener("visibilitychange", this.Ct);
|
|
5390
5403
|
}
|
|
5391
5404
|
}, t.prototype.enqueue = function(t) {
|
|
@@ -5483,7 +5496,7 @@ function Pr(t, e) {
|
|
|
5483
5496
|
this.Lt(),
|
|
5484
5497
|
// Fast-forward delays for timerIds that have been overriden.
|
|
5485
5498
|
this.Ot.indexOf(t) > -1 && (e = 0);
|
|
5486
|
-
var i =
|
|
5499
|
+
var i = Or.createAndSchedule(this, t, e, n, (function(t) {
|
|
5487
5500
|
return r.jt(t);
|
|
5488
5501
|
}));
|
|
5489
5502
|
return this.St.push(i), i;
|
|
@@ -5561,7 +5574,7 @@ function Pr(t, e) {
|
|
|
5561
5574
|
}(), Lr = /** @class */ function() {
|
|
5562
5575
|
/** @hideconstructor */
|
|
5563
5576
|
function t(t, e) {
|
|
5564
|
-
this._firestore = t, this._transaction = e, this._dataReader =
|
|
5577
|
+
this._firestore = t, this._transaction = e, this._dataReader = In(t)
|
|
5565
5578
|
/**
|
|
5566
5579
|
* Reads the document referenced by the provided {@link DocumentReference}.
|
|
5567
5580
|
*
|
|
@@ -5570,23 +5583,23 @@ function Pr(t, e) {
|
|
|
5570
5583
|
*/;
|
|
5571
5584
|
}
|
|
5572
5585
|
return t.prototype.get = function(t) {
|
|
5573
|
-
var e = this, n =
|
|
5586
|
+
var e = this, n = Dr(t, this._firestore), r = new yr(this._firestore);
|
|
5574
5587
|
return this._transaction.lookup([ n._key ]).then((function(t) {
|
|
5575
5588
|
if (!t || 1 !== t.length) return S();
|
|
5576
5589
|
var i = t[0];
|
|
5577
|
-
if (i.isFoundDocument()) return new
|
|
5578
|
-
if (i.isNoDocument()) return new
|
|
5590
|
+
if (i.isFoundDocument()) return new Qn(e._firestore, r, i.key, i, n.converter);
|
|
5591
|
+
if (i.isNoDocument()) return new Qn(e._firestore, r, n._key, null, n.converter);
|
|
5579
5592
|
throw S();
|
|
5580
5593
|
}));
|
|
5581
5594
|
}, t.prototype.set = function(t, e, n) {
|
|
5582
|
-
var r =
|
|
5595
|
+
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
5596
|
return this._transaction.set(r._key, o), this;
|
|
5584
5597
|
}, t.prototype.update = function(t, e, n) {
|
|
5585
5598
|
for (var r = [], i = 3; i < arguments.length; i++) r[i - 3] = arguments[i];
|
|
5586
|
-
var o, a =
|
|
5599
|
+
var o, a = Dr(t, this._firestore);
|
|
5587
5600
|
// For Compat types, we have to "extract" the underlying types before
|
|
5588
5601
|
// performing validation.
|
|
5589
|
-
return o = "string" == typeof (e = p(e)) || e instanceof
|
|
5602
|
+
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
5603
|
this._transaction.update(a._key, o), this;
|
|
5591
5604
|
},
|
|
5592
5605
|
/**
|
|
@@ -5596,7 +5609,7 @@ function Pr(t, e) {
|
|
|
5596
5609
|
* @returns This `Transaction` instance. Used for chaining method calls.
|
|
5597
5610
|
*/
|
|
5598
5611
|
t.prototype.delete = function(t) {
|
|
5599
|
-
var e =
|
|
5612
|
+
var e = Dr(t, this._firestore);
|
|
5600
5613
|
return this._transaction.delete(e._key), this;
|
|
5601
5614
|
}, t;
|
|
5602
5615
|
}();
|
|
@@ -5634,9 +5647,9 @@ function Pr(t, e) {
|
|
|
5634
5647
|
* `updateFunction `is returned here. Otherwise, if the transaction failed, a
|
|
5635
5648
|
* rejected promise with the corresponding failure error is returned.
|
|
5636
5649
|
*/
|
|
5637
|
-
function
|
|
5638
|
-
var n =
|
|
5639
|
-
return new
|
|
5650
|
+
function jr(t, e) {
|
|
5651
|
+
var n = Je(t = st(t, tn)), r = new x;
|
|
5652
|
+
return new qr(new Cr, n, (function(n) {
|
|
5640
5653
|
return e(new Lr(t, n));
|
|
5641
5654
|
}), r).run(), r.promise
|
|
5642
5655
|
/**
|
|
@@ -5650,11 +5663,11 @@ function Rr(t, e) {
|
|
|
5650
5663
|
}
|
|
5651
5664
|
|
|
5652
5665
|
y = i + "_lite", o(new c("firestore/lite", (function(t, e) {
|
|
5653
|
-
var n = e.options, r = t.getProvider("app").getImmediate(), i = new
|
|
5666
|
+
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
5667
|
return n && i._setSettings(n), i;
|
|
5655
5668
|
}), "PUBLIC")),
|
|
5656
5669
|
// RUNTIME_ENV and BUILD_TARGET are replaced by real values during the compilation
|
|
5657
|
-
a("firestore-lite", "3.4.4-canary.
|
|
5670
|
+
a("firestore-lite", "3.4.4-canary.3a8d4c1d1", ""), a("firestore-lite", "3.4.4-canary.3a8d4c1d1", "esm5");
|
|
5658
5671
|
|
|
5659
|
-
export {
|
|
5672
|
+
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
5673
|
//# sourceMappingURL=index.browser.esm5.js.map
|