@firebase/firestore 3.4.4 → 3.4.5-2022116201138
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/CHANGELOG.md +12 -0
- package/dist/firestore/src/api/credentials.d.ts +1 -0
- package/dist/firestore/src/api/{query.d.ts → filter.d.ts} +0 -0
- package/dist/firestore/src/api/snapshot.d.ts +1 -2
- package/dist/firestore/src/api.d.ts +1 -1
- package/dist/firestore/src/core/database_info.d.ts +1 -0
- package/dist/firestore/src/core/target.d.ts +34 -5
- 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 +19 -3
- 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/remote_document_change_buffer.d.ts +3 -12
- package/dist/firestore/src/local/simple_db.d.ts +1 -0
- package/dist/firestore/src/model/document.d.ts +7 -0
- package/dist/firestore/src/model/document_key.d.ts +6 -0
- package/dist/firestore/src/model/field_index.d.ts +87 -7
- 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/model/values.d.ts +7 -0
- package/dist/firestore/src/platform/node/grpc_connection.d.ts +2 -2
- package/dist/firestore/src/platform/node/load_protos.d.ts +2 -2
- 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 +5 -3
- package/dist/firestore/test/unit/local/test_remote_document_change_buffer.d.ts +1 -1
- package/dist/firestore/test/unit/model/field_index.test.d.ts +17 -0
- package/dist/firestore/test/unit/model/target.test.d.ts +17 -0
- package/dist/firestore/test/unit/model/target_index_matcher.test.d.ts +17 -0
- package/dist/firestore/test/util/helpers.d.ts +8 -2
- package/dist/index.d.ts +1 -2
- package/dist/index.esm2017.js +4815 -3708
- package/dist/index.esm2017.js.map +1 -1
- package/dist/index.esm5.js +4500 -3545
- package/dist/index.esm5.js.map +1 -1
- package/dist/index.node.cjs.js +2001 -389
- package/dist/index.node.cjs.js.map +1 -1
- package/dist/index.node.mjs +1981 -390
- package/dist/index.node.mjs.map +1 -1
- package/dist/index.rn.js +4798 -3733
- package/dist/index.rn.js.map +1 -1
- package/dist/internal.d.ts +265 -26
- package/dist/lite/firestore/src/api/credentials.d.ts +1 -0
- package/dist/lite/firestore/src/api/{query.d.ts → filter.d.ts} +0 -0
- package/dist/lite/firestore/src/api/snapshot.d.ts +1 -2
- package/dist/lite/firestore/src/api.d.ts +1 -1
- package/dist/lite/firestore/src/core/database_info.d.ts +1 -0
- package/dist/lite/firestore/src/core/target.d.ts +34 -5
- 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 +19 -3
- 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/remote_document_change_buffer.d.ts +3 -12
- package/dist/lite/firestore/src/local/simple_db.d.ts +1 -0
- package/dist/lite/firestore/src/model/document.d.ts +7 -0
- package/dist/lite/firestore/src/model/document_key.d.ts +6 -0
- package/dist/lite/firestore/src/model/field_index.d.ts +87 -7
- 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/model/values.d.ts +7 -0
- package/dist/lite/firestore/src/platform/node/grpc_connection.d.ts +2 -2
- package/dist/lite/firestore/src/platform/node/load_protos.d.ts +2 -2
- 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 +5 -3
- package/dist/lite/firestore/test/unit/local/test_remote_document_change_buffer.d.ts +1 -1
- package/dist/lite/firestore/test/unit/model/field_index.test.d.ts +17 -0
- package/dist/lite/firestore/test/unit/model/target.test.d.ts +17 -0
- package/dist/lite/firestore/test/unit/model/target_index_matcher.test.d.ts +17 -0
- package/dist/lite/firestore/test/util/helpers.d.ts +8 -2
- package/dist/lite/index.browser.esm2017.js +1166 -1143
- package/dist/lite/index.browser.esm2017.js.map +1 -1
- package/dist/lite/index.browser.esm5.js +357 -337
- package/dist/lite/index.browser.esm5.js.map +1 -1
- package/dist/lite/index.node.cjs.js +64 -34
- package/dist/lite/index.node.cjs.js.map +1 -1
- package/dist/lite/index.node.mjs +64 -34
- package/dist/lite/index.node.mjs.map +1 -1
- package/dist/lite/index.rn.esm2017.js +344 -321
- package/dist/lite/index.rn.esm2017.js.map +1 -1
- package/dist/lite/internal.d.ts +16 -2
- package/dist/lite/packages/firestore/dist/lite/index.browser.esm2017.d.ts +122 -121
- package/dist/lite/packages/firestore/src/api/credentials.d.ts +1 -0
- package/dist/lite/packages/firestore/src/api/{query.d.ts → filter.d.ts} +0 -0
- package/dist/lite/packages/firestore/src/api/snapshot.d.ts +1 -2
- package/dist/lite/packages/firestore/src/api.d.ts +1 -1
- package/dist/lite/packages/firestore/src/core/database_info.d.ts +1 -0
- package/dist/lite/packages/firestore/src/core/target.d.ts +34 -5
- 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 +19 -3
- 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/remote_document_change_buffer.d.ts +3 -12
- package/dist/lite/packages/firestore/src/local/simple_db.d.ts +1 -0
- package/dist/lite/packages/firestore/src/model/document.d.ts +7 -0
- package/dist/lite/packages/firestore/src/model/document_key.d.ts +6 -0
- package/dist/lite/packages/firestore/src/model/field_index.d.ts +87 -7
- 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/model/values.d.ts +7 -0
- package/dist/lite/packages/firestore/src/platform/node/grpc_connection.d.ts +2 -2
- package/dist/lite/packages/firestore/src/platform/node/load_protos.d.ts +2 -2
- 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 +5 -3
- 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/field_index.test.d.ts +17 -0
- package/dist/lite/packages/firestore/test/unit/model/target.test.d.ts +17 -0
- 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 +8 -2
- package/dist/lite/private.d.ts +9 -2
- package/dist/packages/firestore/dist/index.esm2017.d.ts +199 -194
- package/dist/packages/firestore/src/api/credentials.d.ts +1 -0
- package/dist/packages/firestore/src/api/{query.d.ts → filter.d.ts} +0 -0
- package/dist/packages/firestore/src/api/snapshot.d.ts +1 -2
- package/dist/packages/firestore/src/api.d.ts +1 -1
- package/dist/packages/firestore/src/core/database_info.d.ts +1 -0
- package/dist/packages/firestore/src/core/target.d.ts +34 -5
- 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 +19 -3
- 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/remote_document_change_buffer.d.ts +3 -12
- package/dist/packages/firestore/src/local/simple_db.d.ts +1 -0
- package/dist/packages/firestore/src/model/document.d.ts +7 -0
- package/dist/packages/firestore/src/model/document_key.d.ts +6 -0
- package/dist/packages/firestore/src/model/field_index.d.ts +87 -7
- 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/model/values.d.ts +7 -0
- package/dist/packages/firestore/src/platform/node/grpc_connection.d.ts +2 -2
- package/dist/packages/firestore/src/platform/node/load_protos.d.ts +2 -2
- 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 +5 -3
- package/dist/packages/firestore/test/unit/local/test_remote_document_change_buffer.d.ts +1 -1
- package/dist/packages/firestore/test/unit/model/field_index.test.d.ts +17 -0
- package/dist/packages/firestore/test/unit/model/target.test.d.ts +17 -0
- package/dist/packages/firestore/test/unit/model/target_index_matcher.test.d.ts +17 -0
- package/dist/packages/firestore/test/util/helpers.d.ts +8 -2
- package/dist/private.d.ts +258 -26
- package/package.json +4 -4
|
@@ -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.7-2022116201138", v = new l("@firebase/firestore");
|
|
71
71
|
|
|
72
72
|
/**
|
|
73
73
|
* @license
|
|
@@ -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",
|
|
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
|
/**
|
|
@@ -356,7 +356,9 @@ function(t, e, n, r, i, o, a, s) {
|
|
|
356
356
|
function t(t, e) {
|
|
357
357
|
this.projectId = t, this.database = e || "(default)";
|
|
358
358
|
}
|
|
359
|
-
return
|
|
359
|
+
return t.empty = function() {
|
|
360
|
+
return new t("", "");
|
|
361
|
+
}, Object.defineProperty(t.prototype, "isDefaultDatabase", {
|
|
360
362
|
get: function() {
|
|
361
363
|
return "(default)" === this.database;
|
|
362
364
|
},
|
|
@@ -523,9 +525,23 @@ function(t, e, n, r, i, o, a, s) {
|
|
|
523
525
|
return new t(Z.fromString(e));
|
|
524
526
|
}, t.fromName = function(e) {
|
|
525
527
|
return new t(Z.fromString(e).popFirst(5));
|
|
526
|
-
},
|
|
528
|
+
}, t.empty = function() {
|
|
529
|
+
return new t(Z.emptyPath());
|
|
530
|
+
}, Object.defineProperty(t.prototype, "collectionGroup", {
|
|
531
|
+
get: function() {
|
|
532
|
+
return this.path.popLast().lastSegment();
|
|
533
|
+
},
|
|
534
|
+
enumerable: !1,
|
|
535
|
+
configurable: !0
|
|
536
|
+
}),
|
|
527
537
|
/** Returns true if the document is in the specified collectionId. */ t.prototype.hasCollectionId = function(t) {
|
|
528
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();
|
|
529
545
|
}, t.prototype.isEqual = function(t) {
|
|
530
546
|
return null !== t && 0 === Z.comparator(this.path, t.path);
|
|
531
547
|
}, t.prototype.toString = function() {
|
|
@@ -741,11 +757,11 @@ function dt(t) {
|
|
|
741
757
|
|
|
742
758
|
case 403:
|
|
743
759
|
// Forbidden
|
|
744
|
-
return
|
|
760
|
+
return N;
|
|
745
761
|
|
|
746
762
|
case 404:
|
|
747
763
|
// Not Found
|
|
748
|
-
return
|
|
764
|
+
return P;
|
|
749
765
|
|
|
750
766
|
case 409:
|
|
751
767
|
// Conflict
|
|
@@ -755,7 +771,7 @@ function dt(t) {
|
|
|
755
771
|
// return Code.ALREADY_EXISTS;
|
|
756
772
|
case 416:
|
|
757
773
|
// Range Not Satisfiable
|
|
758
|
-
return
|
|
774
|
+
return L;
|
|
759
775
|
|
|
760
776
|
case 429:
|
|
761
777
|
// Too Many Requests
|
|
@@ -774,7 +790,7 @@ function dt(t) {
|
|
|
774
790
|
// return Code.DATA_LOSS;
|
|
775
791
|
case 501:
|
|
776
792
|
// Unimplemented
|
|
777
|
-
return
|
|
793
|
+
return j;
|
|
778
794
|
|
|
779
795
|
case 503:
|
|
780
796
|
// Service Unavailable
|
|
@@ -1418,7 +1434,7 @@ var At = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
|
|
|
1418
1434
|
* FieldValueOptions to value().
|
|
1419
1435
|
* - With respect to other ServerTimestampValues, they sort by their
|
|
1420
1436
|
* localWriteTime.
|
|
1421
|
-
*/ function
|
|
1437
|
+
*/ function Pt(t) {
|
|
1422
1438
|
var e, n;
|
|
1423
1439
|
return "server_timestamp" === (null === (n = ((null === (e = null == t ? void 0 : t.mapValue) || void 0 === e ? void 0 : e.fields) || {}).__type__) || void 0 === n ? void 0 : n.stringValue);
|
|
1424
1440
|
}
|
|
@@ -1428,9 +1444,9 @@ var At = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
|
|
|
1428
1444
|
*
|
|
1429
1445
|
* Preserving the previous values allows the user to display the last resoled
|
|
1430
1446
|
* value until the backend responds with the timestamp.
|
|
1431
|
-
*/ function
|
|
1447
|
+
*/ function Nt(t) {
|
|
1432
1448
|
var e = t.mapValue.fields.__previous_value__;
|
|
1433
|
-
return
|
|
1449
|
+
return Pt(e) ? Nt(e) : e;
|
|
1434
1450
|
}
|
|
1435
1451
|
|
|
1436
1452
|
/**
|
|
@@ -1457,7 +1473,7 @@ var At = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
|
|
|
1457
1473
|
* limitations under the License.
|
|
1458
1474
|
*/
|
|
1459
1475
|
/** Extracts the backend's type order for the provided value. */ function Ft(t) {
|
|
1460
|
-
return "nullValue" in t ? 0 /* NullValue */ : "booleanValue" in t ? 1 /* BooleanValue */ : "integerValue" in t || "doubleValue" in t ? 2 /* NumberValue */ : "timestampValue" in t ? 3 /* TimestampValue */ : "stringValue" in t ? 5 /* StringValue */ : "bytesValue" in t ? 6 /* BlobValue */ : "referenceValue" in t ? 7 /* RefValue */ : "geoPointValue" in t ? 8 /* GeoPointValue */ : "arrayValue" in t ? 9 /* ArrayValue */ : "mapValue" in t ?
|
|
1476
|
+
return "nullValue" in t ? 0 /* NullValue */ : "booleanValue" in t ? 1 /* BooleanValue */ : "integerValue" in t || "doubleValue" in t ? 2 /* NumberValue */ : "timestampValue" in t ? 3 /* TimestampValue */ : "stringValue" in t ? 5 /* StringValue */ : "bytesValue" in t ? 6 /* BlobValue */ : "referenceValue" in t ? 7 /* RefValue */ : "geoPointValue" in t ? 8 /* GeoPointValue */ : "arrayValue" in t ? 9 /* ArrayValue */ : "mapValue" in t ? Pt(t) ? 4 /* ServerTimestampValue */ : 10 /* ObjectValue */ : S();
|
|
1461
1477
|
}
|
|
1462
1478
|
|
|
1463
1479
|
/** Tests `left` and `right` for equality based on the backend semantics. */ function Ot(t, e) {
|
|
@@ -1531,7 +1547,7 @@ function Ct(t, e) {
|
|
|
1531
1547
|
}));
|
|
1532
1548
|
}
|
|
1533
1549
|
|
|
1534
|
-
function
|
|
1550
|
+
function Lt(t, e) {
|
|
1535
1551
|
if (t === e) return 0;
|
|
1536
1552
|
var n = Ft(t), r = Ft(e);
|
|
1537
1553
|
if (n !== r) return gt(n, r);
|
|
@@ -1551,10 +1567,10 @@ function jt(t, e) {
|
|
|
1551
1567
|
}(t, e);
|
|
1552
1568
|
|
|
1553
1569
|
case 3 /* TimestampValue */ :
|
|
1554
|
-
return
|
|
1570
|
+
return jt(t.timestampValue, e.timestampValue);
|
|
1555
1571
|
|
|
1556
1572
|
case 4 /* ServerTimestampValue */ :
|
|
1557
|
-
return
|
|
1573
|
+
return jt(qt(t), qt(e));
|
|
1558
1574
|
|
|
1559
1575
|
case 5 /* StringValue */ :
|
|
1560
1576
|
return gt(t.stringValue, e.stringValue);
|
|
@@ -1583,7 +1599,7 @@ function jt(t, e) {
|
|
|
1583
1599
|
case 9 /* ArrayValue */ :
|
|
1584
1600
|
return function(t, e) {
|
|
1585
1601
|
for (var n = t.values || [], r = e.values || [], i = 0; i < n.length && i < r.length; ++i) {
|
|
1586
|
-
var o =
|
|
1602
|
+
var o = Lt(n[i], r[i]);
|
|
1587
1603
|
if (o) return o;
|
|
1588
1604
|
}
|
|
1589
1605
|
return gt(n.length, r.length);
|
|
@@ -1600,7 +1616,7 @@ function jt(t, e) {
|
|
|
1600
1616
|
for (var a = 0; a < r.length && a < o.length; ++a) {
|
|
1601
1617
|
var s = gt(r[a], o[a]);
|
|
1602
1618
|
if (0 !== s) return s;
|
|
1603
|
-
var u =
|
|
1619
|
+
var u = Lt(n[r[a]], i[o[a]]);
|
|
1604
1620
|
if (0 !== u) return u;
|
|
1605
1621
|
}
|
|
1606
1622
|
return gt(r.length, o.length);
|
|
@@ -1611,7 +1627,7 @@ function jt(t, e) {
|
|
|
1611
1627
|
}
|
|
1612
1628
|
}
|
|
1613
1629
|
|
|
1614
|
-
function
|
|
1630
|
+
function jt(t, e) {
|
|
1615
1631
|
if ("string" == typeof t && "string" == typeof e && t.length === e.length) return gt(t, e);
|
|
1616
1632
|
var n = kt(t), r = kt(e), i = gt(n.seconds, r.seconds);
|
|
1617
1633
|
return 0 !== i ? i : gt(n.nanos, r.nanos);
|
|
@@ -1780,25 +1796,26 @@ function Rt(t, e) {
|
|
|
1780
1796
|
return new t(Gt(this.value));
|
|
1781
1797
|
}, t;
|
|
1782
1798
|
}(), Qt = /** @class */ function() {
|
|
1783
|
-
function t(t, e, n, r, i) {
|
|
1784
|
-
this.key = t, this.documentType = e, this.version = n, this.
|
|
1799
|
+
function t(t, e, n, r, i, o) {
|
|
1800
|
+
this.key = t, this.documentType = e, this.version = n, this.readTime = r, this.data = i,
|
|
1801
|
+
this.documentState = o
|
|
1785
1802
|
/**
|
|
1786
1803
|
* Creates a document with no known version or data, but which can serve as
|
|
1787
1804
|
* base document for mutations.
|
|
1788
1805
|
*/;
|
|
1789
1806
|
}
|
|
1790
1807
|
return t.newInvalidDocument = function(e) {
|
|
1791
|
-
return new t(e, 0 /* INVALID */ , _t.min(), zt.empty(), 0 /* SYNCED */);
|
|
1808
|
+
return new t(e, 0 /* INVALID */ , _t.min(), _t.min(), zt.empty(), 0 /* SYNCED */);
|
|
1792
1809
|
},
|
|
1793
1810
|
/**
|
|
1794
1811
|
* Creates a new document that is known to exist with the given data at the
|
|
1795
1812
|
* given version.
|
|
1796
1813
|
*/
|
|
1797
1814
|
t.newFoundDocument = function(e, n, r) {
|
|
1798
|
-
return new t(e, 1 /* FOUND_DOCUMENT */ , n, r, 0 /* SYNCED */);
|
|
1815
|
+
return new t(e, 1 /* FOUND_DOCUMENT */ , n, _t.min(), r, 0 /* SYNCED */);
|
|
1799
1816
|
},
|
|
1800
1817
|
/** Creates a new document that is known to not exist at the given version. */ t.newNoDocument = function(e, n) {
|
|
1801
|
-
return new t(e, 2 /* NO_DOCUMENT */ , n, zt.empty(), 0 /* SYNCED */);
|
|
1818
|
+
return new t(e, 2 /* NO_DOCUMENT */ , n, _t.min(), zt.empty(), 0 /* SYNCED */);
|
|
1802
1819
|
},
|
|
1803
1820
|
/**
|
|
1804
1821
|
* Creates a new document that is known to exist at the given version but
|
|
@@ -1806,7 +1823,7 @@ function Rt(t, e) {
|
|
|
1806
1823
|
* base document).
|
|
1807
1824
|
*/
|
|
1808
1825
|
t.newUnknownDocument = function(e, n) {
|
|
1809
|
-
return new t(e, 3 /* UNKNOWN_DOCUMENT */ , n, zt.empty(), 2 /* HAS_COMMITTED_MUTATIONS */);
|
|
1826
|
+
return new t(e, 3 /* UNKNOWN_DOCUMENT */ , n, _t.min(), zt.empty(), 2 /* HAS_COMMITTED_MUTATIONS */);
|
|
1810
1827
|
},
|
|
1811
1828
|
/**
|
|
1812
1829
|
* Changes the document type to indicate that it exists and that its version
|
|
@@ -1836,6 +1853,8 @@ function Rt(t, e) {
|
|
|
1836
1853
|
return this.documentState = 2 /* HAS_COMMITTED_MUTATIONS */ , this;
|
|
1837
1854
|
}, t.prototype.setHasLocalMutations = function() {
|
|
1838
1855
|
return this.documentState = 1 /* HAS_LOCAL_MUTATIONS */ , this;
|
|
1856
|
+
}, t.prototype.setReadTime = function(t) {
|
|
1857
|
+
return this.readTime = t, this;
|
|
1839
1858
|
}, Object.defineProperty(t.prototype, "hasLocalMutations", {
|
|
1840
1859
|
get: function() {
|
|
1841
1860
|
return 1 /* HAS_LOCAL_MUTATIONS */ === this.documentState;
|
|
@@ -1865,7 +1884,7 @@ function Rt(t, e) {
|
|
|
1865
1884
|
}, t.prototype.isEqual = function(e) {
|
|
1866
1885
|
return e instanceof t && this.key.isEqual(e.key) && this.version.isEqual(e.version) && this.documentType === e.documentType && this.documentState === e.documentState && this.data.isEqual(e.data);
|
|
1867
1886
|
}, t.prototype.mutableCopy = function() {
|
|
1868
|
-
return new t(this.key, this.documentType, this.version, this.data.clone(), this.documentState);
|
|
1887
|
+
return new t(this.key, this.documentType, this.version, this.readTime, this.data.clone(), this.documentState);
|
|
1869
1888
|
}, t.prototype.toString = function() {
|
|
1870
1889
|
return "Document(" + this.key + ", " + this.version + ", " + JSON.stringify(this.data.value) + ", {documentType: " + this.documentType + "}), {documentState: " + this.documentState + "})";
|
|
1871
1890
|
}, t;
|
|
@@ -1930,7 +1949,7 @@ var Wt = /** @class */ function(e) {
|
|
|
1930
1949
|
}, n.prototype.matches = function(t) {
|
|
1931
1950
|
var e = t.data.field(this.field);
|
|
1932
1951
|
// Types do not have to match in NOT_EQUAL filters.
|
|
1933
|
-
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));
|
|
1934
1953
|
// Only compare types with matching backend order (such as double and int).
|
|
1935
1954
|
}, n.prototype.D = function(t) {
|
|
1936
1955
|
switch (this.op) {
|
|
@@ -2037,7 +2056,7 @@ var Wt = /** @class */ function(e) {
|
|
|
2037
2056
|
}));
|
|
2038
2057
|
}, n;
|
|
2039
2058
|
}(Wt), re = function(t, e) {
|
|
2040
|
-
this.position = t, this.
|
|
2059
|
+
this.position = t, this.inclusive = e;
|
|
2041
2060
|
}, ie = function(t, e /* ASCENDING */) {
|
|
2042
2061
|
void 0 === e && (e = "asc"), this.field = t, this.dir = e;
|
|
2043
2062
|
};
|
|
@@ -2049,7 +2068,7 @@ var Wt = /** @class */ function(e) {
|
|
|
2049
2068
|
function ae(t, e) {
|
|
2050
2069
|
if (null === t) return null === e;
|
|
2051
2070
|
if (null === e) return !1;
|
|
2052
|
-
if (t.
|
|
2071
|
+
if (t.inclusive !== e.inclusive || t.position.length !== e.position.length) return !1;
|
|
2053
2072
|
for (var n = 0; n < t.position.length; n++) if (!Ot(t.position[n], e.position[n])) return !1;
|
|
2054
2073
|
return !0;
|
|
2055
2074
|
}
|
|
@@ -2159,7 +2178,7 @@ function le(t) {
|
|
|
2159
2178
|
n.push(new ie(o.field, a));
|
|
2160
2179
|
}
|
|
2161
2180
|
// We need to swap the cursors to match the now-flipped query ordering.
|
|
2162
|
-
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;
|
|
2163
2182
|
// Now return as a LimitType.First query.
|
|
2164
2183
|
e.S = Ht(e.path, e.collectionGroup, n, e.filters, e.limit, s, u);
|
|
2165
2184
|
}
|
|
@@ -2347,7 +2366,7 @@ function de(t, e) {
|
|
|
2347
2366
|
/**
|
|
2348
2367
|
* Returns a value for a Date that's appropriate to put into a proto.
|
|
2349
2368
|
*/
|
|
2350
|
-
function
|
|
2369
|
+
function Pe(t, e) {
|
|
2351
2370
|
return t.F ? new Date(1e3 * e.seconds).toISOString().replace(/\.\d*/, "").replace("Z", "") + "." + ("000000000" + e.nanoseconds).slice(-9) + "Z" : {
|
|
2352
2371
|
seconds: "" + e.seconds,
|
|
2353
2372
|
nanos: e.nanoseconds
|
|
@@ -2358,12 +2377,12 @@ function Ne(t, e) {
|
|
|
2358
2377
|
* Returns a value for bytes that's appropriate to put in a proto.
|
|
2359
2378
|
*
|
|
2360
2379
|
* Visible for testing.
|
|
2361
|
-
*/ function
|
|
2380
|
+
*/ function Ne(t, e) {
|
|
2362
2381
|
return t.F ? e.toBase64() : e.toUint8Array();
|
|
2363
2382
|
}
|
|
2364
2383
|
|
|
2365
2384
|
function qe(t, e) {
|
|
2366
|
-
return
|
|
2385
|
+
return Pe(t, e.toTimestamp());
|
|
2367
2386
|
}
|
|
2368
2387
|
|
|
2369
2388
|
function Fe(t) {
|
|
@@ -2383,17 +2402,17 @@ function Ce(t, e) {
|
|
|
2383
2402
|
return Oe(t.databaseId, e.path);
|
|
2384
2403
|
}
|
|
2385
2404
|
|
|
2386
|
-
function
|
|
2405
|
+
function Le(t, e) {
|
|
2387
2406
|
var n, r = function(t) {
|
|
2388
2407
|
var e = Z.fromString(t);
|
|
2389
|
-
return E(
|
|
2408
|
+
return E(ze(e)), e;
|
|
2390
2409
|
}(e);
|
|
2391
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);
|
|
2392
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);
|
|
2393
2412
|
return new nt((E((n = r).length > 4 && "documents" === n.get(4)), n.popFirst(5)));
|
|
2394
2413
|
}
|
|
2395
2414
|
|
|
2396
|
-
function
|
|
2415
|
+
function je(t, e) {
|
|
2397
2416
|
return Oe(t.databaseId, e);
|
|
2398
2417
|
}
|
|
2399
2418
|
|
|
@@ -2409,29 +2428,21 @@ function Me(t, e, n) {
|
|
|
2409
2428
|
}
|
|
2410
2429
|
|
|
2411
2430
|
function Ue(t) {
|
|
2412
|
-
return {
|
|
2413
|
-
before: t.before,
|
|
2414
|
-
values: t.position
|
|
2415
|
-
};
|
|
2416
|
-
}
|
|
2417
|
-
|
|
2418
|
-
// visible for testing
|
|
2419
|
-
function xe(t) {
|
|
2420
2431
|
return ke[t];
|
|
2421
2432
|
}
|
|
2422
2433
|
|
|
2423
2434
|
// visible for testing
|
|
2424
|
-
function
|
|
2435
|
+
function xe(t) {
|
|
2425
2436
|
return Ve[t];
|
|
2426
2437
|
}
|
|
2427
2438
|
|
|
2428
|
-
function
|
|
2439
|
+
function Be(t) {
|
|
2429
2440
|
return {
|
|
2430
2441
|
fieldPath: t.canonicalString()
|
|
2431
2442
|
};
|
|
2432
2443
|
}
|
|
2433
2444
|
|
|
2434
|
-
function
|
|
2445
|
+
function Ge(t) {
|
|
2435
2446
|
var e = [];
|
|
2436
2447
|
return t.fields.forEach((function(t) {
|
|
2437
2448
|
return e.push(t.canonicalString());
|
|
@@ -2440,7 +2451,7 @@ function ze(t) {
|
|
|
2440
2451
|
};
|
|
2441
2452
|
}
|
|
2442
2453
|
|
|
2443
|
-
function
|
|
2454
|
+
function ze(t) {
|
|
2444
2455
|
// Resource names have at least 4 components (project ID, database ID)
|
|
2445
2456
|
return t.length >= 4 && "projects" === t.get(0) && "databases" === t.get(2);
|
|
2446
2457
|
}
|
|
@@ -2460,7 +2471,7 @@ function Qe(t) {
|
|
|
2460
2471
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2461
2472
|
* See the License for the specific language governing permissions and
|
|
2462
2473
|
* limitations under the License.
|
|
2463
|
-
*/ function
|
|
2474
|
+
*/ function Qe(t) {
|
|
2464
2475
|
return new De(t, /* useProto3Json= */ !0);
|
|
2465
2476
|
}
|
|
2466
2477
|
|
|
@@ -2488,7 +2499,7 @@ function Qe(t) {
|
|
|
2488
2499
|
* backoff curve, and a +/- 50% "jitter" that is calculated and added to the
|
|
2489
2500
|
* base delay. This prevents clients from accidentally synchronizing their
|
|
2490
2501
|
* delays causing spikes of load to the backend.
|
|
2491
|
-
*/ var
|
|
2502
|
+
*/ var Ke = /** @class */ function() {
|
|
2492
2503
|
function t(
|
|
2493
2504
|
/**
|
|
2494
2505
|
* The AsyncQueue to run backoff operations on.
|
|
@@ -2562,7 +2573,7 @@ function Qe(t) {
|
|
|
2562
2573
|
/** Returns a random value in the range [-currentBaseMs/2, currentBaseMs/2] */ t.prototype.Y = function() {
|
|
2563
2574
|
return (Math.random() - .5) * this.j;
|
|
2564
2575
|
}, t;
|
|
2565
|
-
}(),
|
|
2576
|
+
}(), He = /** @class */ function(e) {
|
|
2566
2577
|
function n(t, n, r, i) {
|
|
2567
2578
|
var o = this;
|
|
2568
2579
|
return (o = e.call(this) || this).authCredentials = t, o.appCheckCredentials = n,
|
|
@@ -2622,7 +2633,7 @@ function Qe(t) {
|
|
|
2622
2633
|
*/
|
|
2623
2634
|
// TODO(firestorexp): Make sure there is only one Datastore instance per
|
|
2624
2635
|
// firestore-exp client.
|
|
2625
|
-
function
|
|
2636
|
+
function We(t, r) {
|
|
2626
2637
|
return e(this, void 0, void 0, (function() {
|
|
2627
2638
|
var e, i, o;
|
|
2628
2639
|
return n(this, (function(n) {
|
|
@@ -2638,7 +2649,7 @@ function Ye(t, r) {
|
|
|
2638
2649
|
delete: Ce(t, e.key)
|
|
2639
2650
|
}; else if (e instanceof Ee) n = {
|
|
2640
2651
|
update: Me(t, e.key, e.data),
|
|
2641
|
-
updateMask:
|
|
2652
|
+
updateMask: Ge(e.fieldMask)
|
|
2642
2653
|
}; else {
|
|
2643
2654
|
if (!(e instanceof Ae)) return S();
|
|
2644
2655
|
n = {
|
|
@@ -2688,7 +2699,7 @@ function Ye(t, r) {
|
|
|
2688
2699
|
}));
|
|
2689
2700
|
}
|
|
2690
2701
|
|
|
2691
|
-
function
|
|
2702
|
+
function Ye(t, r) {
|
|
2692
2703
|
return e(this, void 0, void 0, (function() {
|
|
2693
2704
|
var e, i, o, a, s, u;
|
|
2694
2705
|
return n(this, (function(n) {
|
|
@@ -2705,7 +2716,7 @@ function $e(t, r) {
|
|
|
2705
2716
|
var n = function(t, e) {
|
|
2706
2717
|
return "found" in e ? function(t, e) {
|
|
2707
2718
|
E(!!e.found), e.found.name, e.found.updateTime;
|
|
2708
|
-
var n =
|
|
2719
|
+
var n = Le(t, e.found.name), r = Fe(e.found.updateTime), i = new zt({
|
|
2709
2720
|
mapValue: {
|
|
2710
2721
|
fields: e.found.fields
|
|
2711
2722
|
}
|
|
@@ -2713,7 +2724,7 @@ function $e(t, r) {
|
|
|
2713
2724
|
return Qt.newFoundDocument(n, r, i);
|
|
2714
2725
|
}(t, e) : "missing" in e ? function(t, e) {
|
|
2715
2726
|
E(!!e.missing), E(!!e.readTime);
|
|
2716
|
-
var n =
|
|
2727
|
+
var n = Le(t, e.missing), r = Fe(e.readTime);
|
|
2717
2728
|
return Qt.newNoDocument(n, r);
|
|
2718
2729
|
}(t, e) : S();
|
|
2719
2730
|
}(e.q, t);
|
|
@@ -2727,7 +2738,7 @@ function $e(t, r) {
|
|
|
2727
2738
|
}));
|
|
2728
2739
|
}
|
|
2729
2740
|
|
|
2730
|
-
function
|
|
2741
|
+
function $e(t, r) {
|
|
2731
2742
|
return e(this, void 0, void 0, (function() {
|
|
2732
2743
|
var e, i;
|
|
2733
2744
|
return n(this, (function(n) {
|
|
@@ -2738,10 +2749,10 @@ function Xe(t, r) {
|
|
|
2738
2749
|
var n = {
|
|
2739
2750
|
structuredQuery: {}
|
|
2740
2751
|
}, r = e.path;
|
|
2741
|
-
null !== e.collectionGroup ? (n.parent =
|
|
2752
|
+
null !== e.collectionGroup ? (n.parent = je(t, r), n.structuredQuery.from = [ {
|
|
2742
2753
|
collectionId: e.collectionGroup,
|
|
2743
2754
|
allDescendants: !0
|
|
2744
|
-
} ]) : (n.parent =
|
|
2755
|
+
} ]) : (n.parent = je(t, r.popLast()), n.structuredQuery.from = [ {
|
|
2745
2756
|
collectionId: r.lastSegment()
|
|
2746
2757
|
} ]);
|
|
2747
2758
|
var i = function(t) {
|
|
@@ -2752,34 +2763,34 @@ function Xe(t, r) {
|
|
|
2752
2763
|
if ("==" /* EQUAL */ === t.op) {
|
|
2753
2764
|
if (xt(t.value)) return {
|
|
2754
2765
|
unaryFilter: {
|
|
2755
|
-
field:
|
|
2766
|
+
field: Be(t.field),
|
|
2756
2767
|
op: "IS_NAN"
|
|
2757
2768
|
}
|
|
2758
2769
|
};
|
|
2759
2770
|
if (Ut(t.value)) return {
|
|
2760
2771
|
unaryFilter: {
|
|
2761
|
-
field:
|
|
2772
|
+
field: Be(t.field),
|
|
2762
2773
|
op: "IS_NULL"
|
|
2763
2774
|
}
|
|
2764
2775
|
};
|
|
2765
2776
|
} else if ("!=" /* NOT_EQUAL */ === t.op) {
|
|
2766
2777
|
if (xt(t.value)) return {
|
|
2767
2778
|
unaryFilter: {
|
|
2768
|
-
field:
|
|
2779
|
+
field: Be(t.field),
|
|
2769
2780
|
op: "IS_NOT_NAN"
|
|
2770
2781
|
}
|
|
2771
2782
|
};
|
|
2772
2783
|
if (Ut(t.value)) return {
|
|
2773
2784
|
unaryFilter: {
|
|
2774
|
-
field:
|
|
2785
|
+
field: Be(t.field),
|
|
2775
2786
|
op: "IS_NOT_NULL"
|
|
2776
2787
|
}
|
|
2777
2788
|
};
|
|
2778
2789
|
}
|
|
2779
2790
|
return {
|
|
2780
2791
|
fieldFilter: {
|
|
2781
|
-
field:
|
|
2782
|
-
op:
|
|
2792
|
+
field: Be(t.field),
|
|
2793
|
+
op: xe(t.op),
|
|
2783
2794
|
value: t.value
|
|
2784
2795
|
}
|
|
2785
2796
|
};
|
|
@@ -2799,20 +2810,27 @@ function Xe(t, r) {
|
|
|
2799
2810
|
// visible for testing
|
|
2800
2811
|
return function(t) {
|
|
2801
2812
|
return {
|
|
2802
|
-
field:
|
|
2803
|
-
direction:
|
|
2813
|
+
field: Be(t.field),
|
|
2814
|
+
direction: Ue(t.dir)
|
|
2804
2815
|
};
|
|
2805
2816
|
}(t);
|
|
2806
2817
|
}));
|
|
2807
2818
|
}(e.orderBy);
|
|
2808
2819
|
o && (n.structuredQuery.orderBy = o);
|
|
2809
|
-
var a = function(t, e) {
|
|
2820
|
+
var a, s = function(t, e) {
|
|
2810
2821
|
return t.F || ct(e) ? e : {
|
|
2811
2822
|
value: e
|
|
2812
2823
|
};
|
|
2813
2824
|
}(t, e.limit);
|
|
2814
|
-
return null !==
|
|
2815
|
-
|
|
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;
|
|
2816
2834
|
}(e.q, pe(r)), [ 4 /*yield*/ , e.T("RunQuery", i.parent, {
|
|
2817
2835
|
structuredQuery: i.structuredQuery
|
|
2818
2836
|
}) ];
|
|
@@ -2822,7 +2840,7 @@ function Xe(t, r) {
|
|
|
2822
2840
|
return !!t.document;
|
|
2823
2841
|
})).map((function(t) {
|
|
2824
2842
|
return function(t, e, n) {
|
|
2825
|
-
var r =
|
|
2843
|
+
var r = Le(t, e.name), i = Fe(e.updateTime), o = new zt({
|
|
2826
2844
|
mapValue: {
|
|
2827
2845
|
fields: e.fields
|
|
2828
2846
|
}
|
|
@@ -2850,7 +2868,7 @@ function Xe(t, r) {
|
|
|
2850
2868
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2851
2869
|
* See the License for the specific language governing permissions and
|
|
2852
2870
|
* limitations under the License.
|
|
2853
|
-
*/ var
|
|
2871
|
+
*/ var Xe = new Map;
|
|
2854
2872
|
|
|
2855
2873
|
/**
|
|
2856
2874
|
* An instance map that ensures only one Datastore exists per Firestore
|
|
@@ -2860,17 +2878,17 @@ function Xe(t, r) {
|
|
|
2860
2878
|
* Returns an initialized and started Datastore for the given Firestore
|
|
2861
2879
|
* instance. Callers must invoke removeComponents() when the Firestore
|
|
2862
2880
|
* instance is terminated.
|
|
2863
|
-
*/ function
|
|
2881
|
+
*/ function Je(t) {
|
|
2864
2882
|
if (t._terminated) throw new U(O, "The client has already been terminated.");
|
|
2865
|
-
if (!
|
|
2883
|
+
if (!Xe.has(t)) {
|
|
2866
2884
|
w("ComponentProvider", "Initializing Datastore");
|
|
2867
2885
|
var e = function(t) {
|
|
2868
2886
|
return new mt(t, fetch.bind(null));
|
|
2869
2887
|
}((i = t._databaseId, o = t.app.options.appId || "", a = t._persistenceKey, s = t._freezeSettings(),
|
|
2870
|
-
new $(i, o, a, s.host, s.ssl, s.experimentalForceLongPolling, s.experimentalAutoDetectLongPolling, s.useFetchStreams))), n =
|
|
2871
|
-
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);
|
|
2872
2890
|
}(t._authCredentials, t._appCheckCredentials, e, n);
|
|
2873
|
-
|
|
2891
|
+
Xe.set(t, r);
|
|
2874
2892
|
}
|
|
2875
2893
|
var i, o, a, s;
|
|
2876
2894
|
/**
|
|
@@ -2888,7 +2906,7 @@ function Xe(t, r) {
|
|
|
2888
2906
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2889
2907
|
* See the License for the specific language governing permissions and
|
|
2890
2908
|
* limitations under the License.
|
|
2891
|
-
*/ return
|
|
2909
|
+
*/ return Xe.get(t);
|
|
2892
2910
|
}
|
|
2893
2911
|
|
|
2894
2912
|
/**
|
|
@@ -2899,7 +2917,7 @@ function Xe(t, r) {
|
|
|
2899
2917
|
* A concrete type describing all the values that can be applied via a
|
|
2900
2918
|
* user-supplied `FirestoreSettings` object. This is a separate type so that
|
|
2901
2919
|
* defaults can be supplied and the value can be checked for equality.
|
|
2902
|
-
*/ var
|
|
2920
|
+
*/ var Ze = /** @class */ function() {
|
|
2903
2921
|
function t(t) {
|
|
2904
2922
|
var e;
|
|
2905
2923
|
if (void 0 === t.host) {
|
|
@@ -2919,14 +2937,14 @@ function Xe(t, r) {
|
|
|
2919
2937
|
return t.prototype.isEqual = function(t) {
|
|
2920
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;
|
|
2921
2939
|
}, t;
|
|
2922
|
-
}(),
|
|
2940
|
+
}(), tn = /** @class */ function() {
|
|
2923
2941
|
/** @hideconstructor */
|
|
2924
2942
|
function t(t, e, n) {
|
|
2925
2943
|
this._authCredentials = e, this._appCheckCredentials = n,
|
|
2926
2944
|
/**
|
|
2927
2945
|
* Whether it's a Firestore or Firestore Lite instance.
|
|
2928
2946
|
*/
|
|
2929
|
-
this.type = "firestore-lite", this._persistenceKey = "(lite)", this._settings = new
|
|
2947
|
+
this.type = "firestore-lite", this._persistenceKey = "(lite)", this._settings = new Ze({}),
|
|
2930
2948
|
this._settingsFrozen = !1, t instanceof X ? this._databaseId = t : (this._app = t,
|
|
2931
2949
|
this._databaseId = function(t) {
|
|
2932
2950
|
if (!Object.prototype.hasOwnProperty.apply(t.options, [ "projectId" ])) throw new U(V, '"projectId" not provided in firebase.initializeApp.');
|
|
@@ -2958,7 +2976,7 @@ function Xe(t, r) {
|
|
|
2958
2976
|
configurable: !0
|
|
2959
2977
|
}), t.prototype._setSettings = function(t) {
|
|
2960
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.");
|
|
2961
|
-
this._settings = new
|
|
2979
|
+
this._settings = new Ze(t), void 0 !== t.credentials && (this._authCredentials = function(t) {
|
|
2962
2980
|
if (!t) return new G;
|
|
2963
2981
|
switch (t.type) {
|
|
2964
2982
|
case "gapi":
|
|
@@ -2996,8 +3014,8 @@ function Xe(t, r) {
|
|
|
2996
3014
|
* Only ever called once.
|
|
2997
3015
|
*/
|
|
2998
3016
|
t.prototype._terminate = function() {
|
|
2999
|
-
return t = this, (e =
|
|
3000
|
-
|
|
3017
|
+
return t = this, (e = Xe.get(t)) && (w("ComponentProvider", "Removing Datastore"),
|
|
3018
|
+
Xe.delete(t), e.terminate()), Promise.resolve();
|
|
3001
3019
|
var t, e;
|
|
3002
3020
|
}, t;
|
|
3003
3021
|
}();
|
|
@@ -3022,7 +3040,7 @@ function Xe(t, r) {
|
|
|
3022
3040
|
* The Cloud Firestore service interface.
|
|
3023
3041
|
*
|
|
3024
3042
|
* Do not call this constructor directly. Instead, use {@link getFirestore}.
|
|
3025
|
-
*/ function
|
|
3043
|
+
*/ function en(t, e) {
|
|
3026
3044
|
var n = _getProvider(t, "firestore/lite");
|
|
3027
3045
|
if (n.isInitialized()) throw new U(O, "Firestore can only be initialized once per app.");
|
|
3028
3046
|
return n.initialize({
|
|
@@ -3038,7 +3056,7 @@ function Xe(t, r) {
|
|
|
3038
3056
|
* @param app - The {@link @firebase/app#FirebaseApp} instance that the returned `Firestore`
|
|
3039
3057
|
* instance is associated with.
|
|
3040
3058
|
* @returns The `Firestore` instance of the provided app.
|
|
3041
|
-
*/ function
|
|
3059
|
+
*/ function nn(t) {
|
|
3042
3060
|
return void 0 === t && (t = s()), _getProvider(t, "firestore/lite").getImmediate();
|
|
3043
3061
|
}
|
|
3044
3062
|
|
|
@@ -3054,10 +3072,10 @@ function Xe(t, r) {
|
|
|
3054
3072
|
* @param port - the emulator port (ex: 9000).
|
|
3055
3073
|
* @param options.mockUserToken - the mock auth token to use for unit testing
|
|
3056
3074
|
* Security Rules.
|
|
3057
|
-
*/ function
|
|
3075
|
+
*/ function rn(t, e, n, r) {
|
|
3058
3076
|
var i;
|
|
3059
3077
|
void 0 === r && (r = {});
|
|
3060
|
-
var o = (t = st(t,
|
|
3078
|
+
var o = (t = st(t, tn))._getSettings();
|
|
3061
3079
|
if ("firestore.googleapis.com" !== o.host && o.host !== e && _("Host has been set in both settings() and useEmulator(), emulator host will be used"),
|
|
3062
3080
|
t._setSettings(Object.assign(Object.assign({}, o), {
|
|
3063
3081
|
host: e + ":" + n,
|
|
@@ -3095,8 +3113,8 @@ function Xe(t, r) {
|
|
|
3095
3113
|
* @param firestore - The `Firestore` instance to terminate.
|
|
3096
3114
|
* @returns A `Promise` that is resolved when the instance has been successfully
|
|
3097
3115
|
* terminated.
|
|
3098
|
-
*/ function
|
|
3099
|
-
return t = st(t,
|
|
3116
|
+
*/ function on(t) {
|
|
3117
|
+
return t = st(t, tn), u(t.app, "firestore/lite"), t._delete()
|
|
3100
3118
|
/**
|
|
3101
3119
|
* @license
|
|
3102
3120
|
* Copyright 2020 Google LLC
|
|
@@ -3136,7 +3154,7 @@ function Xe(t, r) {
|
|
|
3136
3154
|
*/;
|
|
3137
3155
|
}
|
|
3138
3156
|
|
|
3139
|
-
var
|
|
3157
|
+
var an = /** @class */ function() {
|
|
3140
3158
|
/** @hideconstructor */
|
|
3141
3159
|
function t(t,
|
|
3142
3160
|
/**
|
|
@@ -3177,14 +3195,14 @@ var sn = /** @class */ function() {
|
|
|
3177
3195
|
* The collection this `DocumentReference` belongs to.
|
|
3178
3196
|
*/
|
|
3179
3197
|
get: function() {
|
|
3180
|
-
return new
|
|
3198
|
+
return new un(this.firestore, this.converter, this._key.path.popLast());
|
|
3181
3199
|
},
|
|
3182
3200
|
enumerable: !1,
|
|
3183
3201
|
configurable: !0
|
|
3184
3202
|
}), t.prototype.withConverter = function(e) {
|
|
3185
3203
|
return new t(this.firestore, e, this._key);
|
|
3186
3204
|
}, t;
|
|
3187
|
-
}(),
|
|
3205
|
+
}(), sn = /** @class */ function() {
|
|
3188
3206
|
// This is the lite version of the Query class in the main SDK.
|
|
3189
3207
|
/** @hideconstructor protected */
|
|
3190
3208
|
function t(t,
|
|
@@ -3199,7 +3217,7 @@ var sn = /** @class */ function() {
|
|
|
3199
3217
|
return t.prototype.withConverter = function(e) {
|
|
3200
3218
|
return new t(this.firestore, e, this._query);
|
|
3201
3219
|
}, t;
|
|
3202
|
-
}(),
|
|
3220
|
+
}(), un = /** @class */ function(e) {
|
|
3203
3221
|
/** @hideconstructor */
|
|
3204
3222
|
function n(t, n, r) {
|
|
3205
3223
|
var i = this;
|
|
@@ -3230,7 +3248,7 @@ var sn = /** @class */ function() {
|
|
|
3230
3248
|
*/
|
|
3231
3249
|
get: function() {
|
|
3232
3250
|
var t = this._path.popLast();
|
|
3233
|
-
return t.isEmpty() ? null : new
|
|
3251
|
+
return t.isEmpty() ? null : new an(this.firestore,
|
|
3234
3252
|
/* converter= */ null, new nt(t));
|
|
3235
3253
|
},
|
|
3236
3254
|
enumerable: !1,
|
|
@@ -3238,20 +3256,20 @@ var sn = /** @class */ function() {
|
|
|
3238
3256
|
}), n.prototype.withConverter = function(t) {
|
|
3239
3257
|
return new n(this.firestore, t, this._path);
|
|
3240
3258
|
}, n;
|
|
3241
|
-
}(
|
|
3259
|
+
}(sn);
|
|
3242
3260
|
|
|
3243
3261
|
/**
|
|
3244
3262
|
* A `Query` refers to a query which you can read or listen to. You can also
|
|
3245
3263
|
* construct refined `Query` objects by adding filters and ordering.
|
|
3246
|
-
*/ function
|
|
3264
|
+
*/ function cn(t, e) {
|
|
3247
3265
|
for (var n = [], i = 2; i < arguments.length; i++) n[i - 2] = arguments[i];
|
|
3248
|
-
if (t = p(t), rt("collection", "path", e), t instanceof
|
|
3266
|
+
if (t = p(t), rt("collection", "path", e), t instanceof tn) {
|
|
3249
3267
|
var o = Z.fromString.apply(Z, r([ e ], n));
|
|
3250
|
-
return ot(o), new
|
|
3268
|
+
return ot(o), new un(t, /* converter= */ null, o);
|
|
3251
3269
|
}
|
|
3252
|
-
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");
|
|
3253
3271
|
var a = t._path.child(Z.fromString.apply(Z, r([ e ], n)));
|
|
3254
|
-
return ot(a), new
|
|
3272
|
+
return ot(a), new un(t.firestore,
|
|
3255
3273
|
/* converter= */ null, a);
|
|
3256
3274
|
}
|
|
3257
3275
|
|
|
@@ -3267,9 +3285,9 @@ var sn = /** @class */ function() {
|
|
|
3267
3285
|
* collection or subcollection with this ID as the last segment of its path
|
|
3268
3286
|
* will be included. Cannot contain a slash.
|
|
3269
3287
|
* @returns The created `Query`.
|
|
3270
|
-
*/ function
|
|
3271
|
-
if (t = st(t,
|
|
3272
|
-
return new
|
|
3288
|
+
*/ function ln(t, e) {
|
|
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,
|
|
3273
3291
|
/* converter= */ null,
|
|
3274
3292
|
/**
|
|
3275
3293
|
* Creates a new Query for a collection group query that matches all documents
|
|
@@ -3280,19 +3298,19 @@ var sn = /** @class */ function() {
|
|
|
3280
3298
|
}(e));
|
|
3281
3299
|
}
|
|
3282
3300
|
|
|
3283
|
-
function
|
|
3301
|
+
function fn(t, e) {
|
|
3284
3302
|
for (var n = [], i = 2; i < arguments.length; i++) n[i - 2] = arguments[i];
|
|
3285
3303
|
if (t = p(t),
|
|
3286
3304
|
// We allow omission of 'pathString' but explicitly prohibit passing in both
|
|
3287
3305
|
// 'undefined' and 'null'.
|
|
3288
|
-
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) {
|
|
3289
3307
|
var o = Z.fromString.apply(Z, r([ e ], n));
|
|
3290
|
-
return it(o), new
|
|
3308
|
+
return it(o), new an(t,
|
|
3291
3309
|
/* converter= */ null, new nt(o));
|
|
3292
3310
|
}
|
|
3293
|
-
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");
|
|
3294
3312
|
var a = t._path.child(Z.fromString.apply(Z, r([ e ], n)));
|
|
3295
|
-
return it(a), new
|
|
3313
|
+
return it(a), new an(t.firestore, t instanceof un ? t.converter : null, new nt(a));
|
|
3296
3314
|
}
|
|
3297
3315
|
|
|
3298
3316
|
/**
|
|
@@ -3302,8 +3320,8 @@ function hn(t, e) {
|
|
|
3302
3320
|
* @param right - A reference to compare.
|
|
3303
3321
|
* @returns true if the references point to the same location in the same
|
|
3304
3322
|
* Firestore database.
|
|
3305
|
-
*/ function
|
|
3306
|
-
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
|
|
3307
3325
|
/**
|
|
3308
3326
|
* Returns true if the provided queries point to the same collection and apply
|
|
3309
3327
|
* the same constraints.
|
|
@@ -3315,8 +3333,8 @@ function hn(t, e) {
|
|
|
3315
3333
|
*/;
|
|
3316
3334
|
}
|
|
3317
3335
|
|
|
3318
|
-
function
|
|
3319
|
-
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) {
|
|
3320
3338
|
return function(t, e) {
|
|
3321
3339
|
if (t.limit !== e.limit) return !1;
|
|
3322
3340
|
if (t.orderBy.length !== e.orderBy.length) return !1;
|
|
@@ -3354,7 +3372,7 @@ function dn(t, e) {
|
|
|
3354
3372
|
*/;
|
|
3355
3373
|
}
|
|
3356
3374
|
|
|
3357
|
-
var
|
|
3375
|
+
var dn = /** @class */ function() {
|
|
3358
3376
|
/**
|
|
3359
3377
|
* Creates a `FieldPath` from the provided field names. If more than one field
|
|
3360
3378
|
* name is provided, the path will point to a nested field in a document.
|
|
@@ -3379,8 +3397,8 @@ var mn = /** @class */ function() {
|
|
|
3379
3397
|
/**
|
|
3380
3398
|
* Returns a special sentinel `FieldPath` to refer to the ID of a document.
|
|
3381
3399
|
* It can be used in queries to sort or filter by the document ID.
|
|
3382
|
-
*/ function
|
|
3383
|
-
return new
|
|
3400
|
+
*/ function mn() {
|
|
3401
|
+
return new dn("__name__");
|
|
3384
3402
|
}
|
|
3385
3403
|
|
|
3386
3404
|
/**
|
|
@@ -3401,7 +3419,7 @@ var mn = /** @class */ function() {
|
|
|
3401
3419
|
*/
|
|
3402
3420
|
/**
|
|
3403
3421
|
* An immutable object representing an array of bytes.
|
|
3404
|
-
*/ var
|
|
3422
|
+
*/ var yn = /** @class */ function() {
|
|
3405
3423
|
/** @hideconstructor */
|
|
3406
3424
|
function t(t) {
|
|
3407
3425
|
this._byteString = t;
|
|
@@ -3459,14 +3477,14 @@ var mn = /** @class */ function() {
|
|
|
3459
3477
|
t.prototype.isEqual = function(t) {
|
|
3460
3478
|
return this._byteString.isEqual(t._byteString);
|
|
3461
3479
|
}, t;
|
|
3462
|
-
}(),
|
|
3480
|
+
}(), vn =
|
|
3463
3481
|
/**
|
|
3464
3482
|
* @param _methodName - The public API endpoint that returns this class.
|
|
3465
3483
|
* @hideconstructor
|
|
3466
3484
|
*/
|
|
3467
3485
|
function(t) {
|
|
3468
3486
|
this._methodName = t;
|
|
3469
|
-
},
|
|
3487
|
+
}, gn = /** @class */ function() {
|
|
3470
3488
|
/**
|
|
3471
3489
|
* Creates a new immutable `GeoPoint` object with the provided latitude and
|
|
3472
3490
|
* longitude values.
|
|
@@ -3519,14 +3537,14 @@ function(t) {
|
|
|
3519
3537
|
t.prototype._compareTo = function(t) {
|
|
3520
3538
|
return gt(this._lat, t._lat) || gt(this._long, t._long);
|
|
3521
3539
|
}, t;
|
|
3522
|
-
}(),
|
|
3540
|
+
}(), wn = /^__.*__$/, bn = /** @class */ function() {
|
|
3523
3541
|
function t(t, e, n) {
|
|
3524
3542
|
this.data = t, this.fieldMask = e, this.fieldTransforms = n;
|
|
3525
3543
|
}
|
|
3526
3544
|
return t.prototype.toMutation = function(t, e) {
|
|
3527
3545
|
return null !== this.fieldMask ? new Ee(t, this.data, this.fieldMask, e, this.fieldTransforms) : new Se(t, this.data, e, this.fieldTransforms);
|
|
3528
3546
|
}, t;
|
|
3529
|
-
}(),
|
|
3547
|
+
}(), _n = /** @class */ function() {
|
|
3530
3548
|
function t(t,
|
|
3531
3549
|
// The fieldMask does not include document transforms.
|
|
3532
3550
|
e, n) {
|
|
@@ -3556,7 +3574,7 @@ function(t) {
|
|
|
3556
3574
|
/**
|
|
3557
3575
|
* Sentinel values that can be used when writing document fields with `set()`
|
|
3558
3576
|
* or `update()`.
|
|
3559
|
-
*/ function
|
|
3577
|
+
*/ function Tn(t) {
|
|
3560
3578
|
switch (t) {
|
|
3561
3579
|
case 0 /* Set */ :
|
|
3562
3580
|
// fall through
|
|
@@ -3574,7 +3592,7 @@ function(t) {
|
|
|
3574
3592
|
}
|
|
3575
3593
|
}
|
|
3576
3594
|
|
|
3577
|
-
/** A "context" object passed around while parsing user data. */ var
|
|
3595
|
+
/** A "context" object passed around while parsing user data. */ var Sn = /** @class */ function() {
|
|
3578
3596
|
/**
|
|
3579
3597
|
* Initializes a ParseContext with the given source and path.
|
|
3580
3598
|
*
|
|
@@ -3612,16 +3630,16 @@ function(t) {
|
|
|
3612
3630
|
enumerable: !1,
|
|
3613
3631
|
configurable: !0
|
|
3614
3632
|
}),
|
|
3615
|
-
/** 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) {
|
|
3616
3634
|
return new t(Object.assign(Object.assign({}, this.settings), e), this.databaseId, this.q, this.ignoreUndefinedProperties, this.fieldTransforms, this.fieldMask);
|
|
3617
|
-
}, t.prototype.
|
|
3618
|
-
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({
|
|
3619
3637
|
path: n,
|
|
3620
3638
|
rt: !1
|
|
3621
3639
|
});
|
|
3622
3640
|
return r.st(t), r;
|
|
3623
3641
|
}, t.prototype.it = function(t) {
|
|
3624
|
-
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({
|
|
3625
3643
|
path: n,
|
|
3626
3644
|
rt: !1
|
|
3627
3645
|
});
|
|
@@ -3629,12 +3647,12 @@ function(t) {
|
|
|
3629
3647
|
}, t.prototype.ot = function(t) {
|
|
3630
3648
|
// TODO(b/34871131): We don't support array paths right now; so make path
|
|
3631
3649
|
// undefined.
|
|
3632
|
-
return this.
|
|
3650
|
+
return this.et({
|
|
3633
3651
|
path: void 0,
|
|
3634
3652
|
rt: !0
|
|
3635
3653
|
});
|
|
3636
3654
|
}, t.prototype.ut = function(t) {
|
|
3637
|
-
return
|
|
3655
|
+
return Gn(t, this.settings.methodName, this.settings.ct || !1, this.path, this.settings.at);
|
|
3638
3656
|
},
|
|
3639
3657
|
/** Returns 'true' if 'fieldPath' was traversed when creating this context. */ t.prototype.contains = function(t) {
|
|
3640
3658
|
return void 0 !== this.fieldMask.find((function(e) {
|
|
@@ -3648,15 +3666,15 @@ function(t) {
|
|
|
3648
3666
|
if (this.path) for (var t = 0; t < this.path.length; t++) this.st(this.path.get(t));
|
|
3649
3667
|
}, t.prototype.st = function(t) {
|
|
3650
3668
|
if (0 === t.length) throw this.ut("Document fields must not be empty");
|
|
3651
|
-
if (
|
|
3669
|
+
if (Tn(this.tt) && wn.test(t)) throw this.ut('Document fields cannot begin and end with "__"');
|
|
3652
3670
|
}, t;
|
|
3653
|
-
}(),
|
|
3671
|
+
}(), En = /** @class */ function() {
|
|
3654
3672
|
function t(t, e, n) {
|
|
3655
|
-
this.databaseId = t, this.ignoreUndefinedProperties = e, this.q = n ||
|
|
3673
|
+
this.databaseId = t, this.ignoreUndefinedProperties = e, this.q = n || Qe(t)
|
|
3656
3674
|
/** Creates a new top-level parse context. */;
|
|
3657
3675
|
}
|
|
3658
3676
|
return t.prototype.ht = function(t, e, n, r) {
|
|
3659
|
-
return void 0 === r && (r = !1), new
|
|
3677
|
+
return void 0 === r && (r = !1), new Sn({
|
|
3660
3678
|
tt: t,
|
|
3661
3679
|
methodName: e,
|
|
3662
3680
|
at: n,
|
|
@@ -3670,30 +3688,30 @@ function(t) {
|
|
|
3670
3688
|
/**
|
|
3671
3689
|
* Helper for parsing raw user input (provided via the API) into internal model
|
|
3672
3690
|
* classes.
|
|
3673
|
-
*/ function
|
|
3674
|
-
var e = t._freezeSettings(), n =
|
|
3675
|
-
return new
|
|
3691
|
+
*/ function In(t) {
|
|
3692
|
+
var e = t._freezeSettings(), n = Qe(t._databaseId);
|
|
3693
|
+
return new En(t._databaseId, !!e.ignoreUndefinedProperties, n);
|
|
3676
3694
|
}
|
|
3677
3695
|
|
|
3678
|
-
/** Parse document data from a set() call. */ function
|
|
3696
|
+
/** Parse document data from a set() call. */ function An(t, e, n, r, i, o) {
|
|
3679
3697
|
void 0 === o && (o = {});
|
|
3680
3698
|
var a = t.ht(o.merge || o.mergeFields ? 2 /* MergeSet */ : 0 /* Set */ , e, n, i);
|
|
3681
|
-
|
|
3682
|
-
var s, u, c =
|
|
3699
|
+
Mn("Data must be an object, but it was:", a, r);
|
|
3700
|
+
var s, u, c = jn(r, a);
|
|
3683
3701
|
if (o.merge) s = new Et(a.fieldMask), u = a.fieldTransforms; else if (o.mergeFields) {
|
|
3684
3702
|
for (var l = [], f = 0, h = o.mergeFields; f < h.length; f++) {
|
|
3685
|
-
var p =
|
|
3703
|
+
var p = Un(e, h[f], n);
|
|
3686
3704
|
if (!a.contains(p)) throw new U(V, "Field '" + p + "' is specified in your field mask but missing from your input data.");
|
|
3687
|
-
|
|
3705
|
+
zn(l, p) || l.push(p);
|
|
3688
3706
|
}
|
|
3689
3707
|
s = new Et(l), u = a.fieldTransforms.filter((function(t) {
|
|
3690
3708
|
return s.covers(t.field);
|
|
3691
3709
|
}));
|
|
3692
3710
|
} else s = null, u = a.fieldTransforms;
|
|
3693
|
-
return new
|
|
3711
|
+
return new bn(new zt(c), s, u);
|
|
3694
3712
|
}
|
|
3695
3713
|
|
|
3696
|
-
var
|
|
3714
|
+
var kn = /** @class */ function(e) {
|
|
3697
3715
|
function n() {
|
|
3698
3716
|
return null !== e && e.apply(this, arguments) || this;
|
|
3699
3717
|
}
|
|
@@ -3705,7 +3723,7 @@ var Vn = /** @class */ function(e) {
|
|
|
3705
3723
|
}, n.prototype.isEqual = function(t) {
|
|
3706
3724
|
return t instanceof n;
|
|
3707
3725
|
}, n;
|
|
3708
|
-
}(
|
|
3726
|
+
}(vn);
|
|
3709
3727
|
|
|
3710
3728
|
/**
|
|
3711
3729
|
* Creates a child context for parsing SerializableFieldValues.
|
|
@@ -3722,8 +3740,8 @@ var Vn = /** @class */ function(e) {
|
|
|
3722
3740
|
* context.
|
|
3723
3741
|
* @param context - The parent context.
|
|
3724
3742
|
* @param arrayElement - Whether or not the FieldValue has an array.
|
|
3725
|
-
*/ function
|
|
3726
|
-
return new
|
|
3743
|
+
*/ function Vn(t, e, n) {
|
|
3744
|
+
return new Sn({
|
|
3727
3745
|
tt: 3 /* Argument */ ,
|
|
3728
3746
|
at: e.settings.at,
|
|
3729
3747
|
methodName: t._methodName,
|
|
@@ -3731,7 +3749,7 @@ var Vn = /** @class */ function(e) {
|
|
|
3731
3749
|
}, e.databaseId, e.q, e.ignoreUndefinedProperties);
|
|
3732
3750
|
}
|
|
3733
3751
|
|
|
3734
|
-
var
|
|
3752
|
+
var Dn = /** @class */ function(e) {
|
|
3735
3753
|
function n() {
|
|
3736
3754
|
return null !== e && e.apply(this, arguments) || this;
|
|
3737
3755
|
}
|
|
@@ -3740,13 +3758,13 @@ var Nn = /** @class */ function(e) {
|
|
|
3740
3758
|
}, n.prototype.isEqual = function(t) {
|
|
3741
3759
|
return t instanceof n;
|
|
3742
3760
|
}, n;
|
|
3743
|
-
}(
|
|
3761
|
+
}(vn), Pn = /** @class */ function(e) {
|
|
3744
3762
|
function n(t, n) {
|
|
3745
3763
|
var r = this;
|
|
3746
3764
|
return (r = e.call(this, t) || this).lt = n, r;
|
|
3747
3765
|
}
|
|
3748
3766
|
return t(n, e), n.prototype._toFieldTransform = function(t) {
|
|
3749
|
-
var e =
|
|
3767
|
+
var e = Vn(this, t,
|
|
3750
3768
|
/*array=*/ !0), n = this.lt.map((function(t) {
|
|
3751
3769
|
return Ln(t, e);
|
|
3752
3770
|
})), r = new ve(n);
|
|
@@ -3755,13 +3773,13 @@ var Nn = /** @class */ function(e) {
|
|
|
3755
3773
|
// TODO(mrschmidt): Implement isEquals
|
|
3756
3774
|
return this === t;
|
|
3757
3775
|
}, n;
|
|
3758
|
-
}(
|
|
3776
|
+
}(vn), Nn = /** @class */ function(e) {
|
|
3759
3777
|
function n(t, n) {
|
|
3760
3778
|
var r = this;
|
|
3761
3779
|
return (r = e.call(this, t) || this).lt = n, r;
|
|
3762
3780
|
}
|
|
3763
3781
|
return t(n, e), n.prototype._toFieldTransform = function(t) {
|
|
3764
|
-
var e =
|
|
3782
|
+
var e = Vn(this, t,
|
|
3765
3783
|
/*array=*/ !0), n = this.lt.map((function(t) {
|
|
3766
3784
|
return Ln(t, e);
|
|
3767
3785
|
})), r = new ge(n);
|
|
@@ -3770,7 +3788,7 @@ var Nn = /** @class */ function(e) {
|
|
|
3770
3788
|
// TODO(mrschmidt): Implement isEquals
|
|
3771
3789
|
return this === t;
|
|
3772
3790
|
}, n;
|
|
3773
|
-
}(
|
|
3791
|
+
}(vn), qn = /** @class */ function(e) {
|
|
3774
3792
|
function n(t, n) {
|
|
3775
3793
|
var r = this;
|
|
3776
3794
|
return (r = e.call(this, t) || this).ft = n, r;
|
|
@@ -3782,19 +3800,19 @@ var Nn = /** @class */ function(e) {
|
|
|
3782
3800
|
// TODO(mrschmidt): Implement isEquals
|
|
3783
3801
|
return this === t;
|
|
3784
3802
|
}, n;
|
|
3785
|
-
}(
|
|
3803
|
+
}(vn);
|
|
3786
3804
|
|
|
3787
|
-
/** Parse update data from an update() call. */ function
|
|
3805
|
+
/** Parse update data from an update() call. */ function Fn(t, e, n, r) {
|
|
3788
3806
|
var i = t.ht(1 /* Update */ , e, n);
|
|
3789
|
-
|
|
3807
|
+
Mn("Data must be an object, but it was:", i, r);
|
|
3790
3808
|
var o = [], a = zt.empty();
|
|
3791
3809
|
St(r, (function(t, r) {
|
|
3792
|
-
var s =
|
|
3810
|
+
var s = Bn(e, t, n);
|
|
3793
3811
|
// For Compat types, we have to "extract" the underlying types before
|
|
3794
3812
|
// performing validation.
|
|
3795
3813
|
r = p(r);
|
|
3796
3814
|
var u = i.it(s);
|
|
3797
|
-
if (r instanceof
|
|
3815
|
+
if (r instanceof kn)
|
|
3798
3816
|
// Add it to the field mask, but don't add anything to updateData.
|
|
3799
3817
|
o.push(s); else {
|
|
3800
3818
|
var c = Ln(r, u);
|
|
@@ -3802,22 +3820,22 @@ var Nn = /** @class */ function(e) {
|
|
|
3802
3820
|
}
|
|
3803
3821
|
}));
|
|
3804
3822
|
var s = new Et(o);
|
|
3805
|
-
return new
|
|
3823
|
+
return new _n(a, s, i.fieldTransforms);
|
|
3806
3824
|
}
|
|
3807
3825
|
|
|
3808
|
-
/** Parse update data from a list of field/value arguments. */ function
|
|
3809
|
-
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 ];
|
|
3810
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.");
|
|
3811
|
-
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]);
|
|
3812
3830
|
// We iterate in reverse order to pick the last value for a field if the
|
|
3813
3831
|
// user specified the field multiple times.
|
|
3814
|
-
for (var l = [], f = zt.empty(), h = s.length - 1; h >= 0; --h) if (!
|
|
3832
|
+
for (var l = [], f = zt.empty(), h = s.length - 1; h >= 0; --h) if (!zn(l, s[h])) {
|
|
3815
3833
|
var d = s[h], m = u[h];
|
|
3816
3834
|
// For Compat types, we have to "extract" the underlying types before
|
|
3817
3835
|
// performing validation.
|
|
3818
3836
|
m = p(m);
|
|
3819
3837
|
var y = a.it(d);
|
|
3820
|
-
if (m instanceof
|
|
3838
|
+
if (m instanceof kn)
|
|
3821
3839
|
// Add it to the field mask, but don't add anything to updateData.
|
|
3822
3840
|
l.push(d); else {
|
|
3823
3841
|
var v = Ln(m, y);
|
|
@@ -3825,7 +3843,7 @@ var Nn = /** @class */ function(e) {
|
|
|
3825
3843
|
}
|
|
3826
3844
|
}
|
|
3827
3845
|
var g = new Et(l);
|
|
3828
|
-
return new
|
|
3846
|
+
return new _n(f, g, a.fieldTransforms);
|
|
3829
3847
|
}
|
|
3830
3848
|
|
|
3831
3849
|
/**
|
|
@@ -3834,7 +3852,7 @@ var Nn = /** @class */ function(e) {
|
|
|
3834
3852
|
*
|
|
3835
3853
|
* @param allowArrays - Whether the query value is an array that may directly
|
|
3836
3854
|
* contain additional arrays (e.g. the operand of an `in` query).
|
|
3837
|
-
*/ function
|
|
3855
|
+
*/ function Cn(t, e, n, r) {
|
|
3838
3856
|
return void 0 === r && (r = !1), Ln(n, t.ht(r ? 4 /* ArrayArgument */ : 3 /* Argument */ , e));
|
|
3839
3857
|
}
|
|
3840
3858
|
|
|
@@ -3847,11 +3865,11 @@ var Nn = /** @class */ function(e) {
|
|
|
3847
3865
|
* @returns The parsed value, or null if the value was a FieldValue sentinel
|
|
3848
3866
|
* that should not be included in the resulting parsed data.
|
|
3849
3867
|
*/ function Ln(t, e) {
|
|
3850
|
-
if (
|
|
3868
|
+
if (Rn(
|
|
3851
3869
|
// Unwrap the API type from the Compat SDK. This will return the API type
|
|
3852
3870
|
// from firestore-exp.
|
|
3853
|
-
t = p(t))) return
|
|
3854
|
-
if (t instanceof
|
|
3871
|
+
t = p(t))) return Mn("Unsupported field value:", e, t), jn(t, e);
|
|
3872
|
+
if (t instanceof vn)
|
|
3855
3873
|
// FieldValues usually parse into transforms (except deleteField())
|
|
3856
3874
|
// in which case we do not want to include this field in our parsed data
|
|
3857
3875
|
// (as doing so will overwrite the field directly prior to the transform
|
|
@@ -3863,7 +3881,7 @@ var Nn = /** @class */ function(e) {
|
|
|
3863
3881
|
*/
|
|
3864
3882
|
return function(t, e) {
|
|
3865
3883
|
// Sentinels are only supported with writes, and not within arrays.
|
|
3866
|
-
if (!
|
|
3884
|
+
if (!Tn(e.tt)) throw e.ut(t._methodName + "() can only be used with update() and set()");
|
|
3867
3885
|
if (!e.path) throw e.ut(t._methodName + "() is not currently supported inside arrays");
|
|
3868
3886
|
var n = t._toFieldTransform(e);
|
|
3869
3887
|
n && e.fieldTransforms.push(n);
|
|
@@ -3915,7 +3933,7 @@ var Nn = /** @class */ function(e) {
|
|
|
3915
3933
|
if (t instanceof Date) {
|
|
3916
3934
|
var n = bt.fromDate(t);
|
|
3917
3935
|
return {
|
|
3918
|
-
timestampValue:
|
|
3936
|
+
timestampValue: Pe(e.q, n)
|
|
3919
3937
|
};
|
|
3920
3938
|
}
|
|
3921
3939
|
if (t instanceof bt) {
|
|
@@ -3924,19 +3942,19 @@ var Nn = /** @class */ function(e) {
|
|
|
3924
3942
|
// truncation immediately without waiting for the backend to do that.
|
|
3925
3943
|
var r = new bt(t.seconds, 1e3 * Math.floor(t.nanoseconds / 1e3));
|
|
3926
3944
|
return {
|
|
3927
|
-
timestampValue:
|
|
3945
|
+
timestampValue: Pe(e.q, r)
|
|
3928
3946
|
};
|
|
3929
3947
|
}
|
|
3930
|
-
if (t instanceof
|
|
3948
|
+
if (t instanceof gn) return {
|
|
3931
3949
|
geoPointValue: {
|
|
3932
3950
|
latitude: t.latitude,
|
|
3933
3951
|
longitude: t.longitude
|
|
3934
3952
|
}
|
|
3935
3953
|
};
|
|
3936
|
-
if (t instanceof
|
|
3937
|
-
bytesValue:
|
|
3954
|
+
if (t instanceof yn) return {
|
|
3955
|
+
bytesValue: Ne(e.q, t._byteString)
|
|
3938
3956
|
};
|
|
3939
|
-
if (t instanceof
|
|
3957
|
+
if (t instanceof an) {
|
|
3940
3958
|
var i = e.databaseId, o = t.firestore._databaseId;
|
|
3941
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);
|
|
3942
3960
|
return {
|
|
@@ -3947,7 +3965,7 @@ var Nn = /** @class */ function(e) {
|
|
|
3947
3965
|
}(t, e);
|
|
3948
3966
|
}
|
|
3949
3967
|
|
|
3950
|
-
function
|
|
3968
|
+
function jn(t, e) {
|
|
3951
3969
|
var n = {};
|
|
3952
3970
|
return function(t) {
|
|
3953
3971
|
for (var e in t) if (Object.prototype.hasOwnProperty.call(t, e)) return !1;
|
|
@@ -3956,7 +3974,7 @@ function Rn(t, e) {
|
|
|
3956
3974
|
// If we encounter an empty object, we explicitly add it to the update
|
|
3957
3975
|
// mask to ensure that the server creates a map entry.
|
|
3958
3976
|
e.path && e.path.length > 0 && e.fieldMask.push(e.path) : St(t, (function(t, r) {
|
|
3959
|
-
var i = Ln(r, e.
|
|
3977
|
+
var i = Ln(r, e.nt(t));
|
|
3960
3978
|
null != i && (n[t] = i);
|
|
3961
3979
|
})), {
|
|
3962
3980
|
mapValue: {
|
|
@@ -3965,12 +3983,12 @@ function Rn(t, e) {
|
|
|
3965
3983
|
};
|
|
3966
3984
|
}
|
|
3967
3985
|
|
|
3968
|
-
function
|
|
3969
|
-
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);
|
|
3970
3988
|
}
|
|
3971
3989
|
|
|
3972
|
-
function
|
|
3973
|
-
if (!
|
|
3990
|
+
function Mn(t, e, n) {
|
|
3991
|
+
if (!Rn(n) || !function(t) {
|
|
3974
3992
|
return "object" == typeof t && null !== t && (Object.getPrototypeOf(t) === Object.prototype || null === Object.getPrototypeOf(t));
|
|
3975
3993
|
}(n)) {
|
|
3976
3994
|
var r = at(n);
|
|
@@ -3980,20 +3998,20 @@ function Un(t, e, n) {
|
|
|
3980
3998
|
|
|
3981
3999
|
/**
|
|
3982
4000
|
* Helper that calls fromDotSeparatedString() but wraps any error thrown.
|
|
3983
|
-
*/ function
|
|
4001
|
+
*/ function Un(t, e, n) {
|
|
3984
4002
|
if (
|
|
3985
4003
|
// If required, replace the FieldPath Compat class with with the firestore-exp
|
|
3986
4004
|
// FieldPath.
|
|
3987
|
-
(e = p(e)) instanceof
|
|
3988
|
-
if ("string" == typeof e) return
|
|
3989
|
-
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,
|
|
3990
4008
|
/* hasConverter= */ !1,
|
|
3991
4009
|
/* path= */ void 0, n);
|
|
3992
4010
|
}
|
|
3993
4011
|
|
|
3994
4012
|
/**
|
|
3995
4013
|
* Matches any characters in a field path string that are reserved.
|
|
3996
|
-
*/ var
|
|
4014
|
+
*/ var xn = new RegExp("[~\\*/\\[\\]]");
|
|
3997
4015
|
|
|
3998
4016
|
/**
|
|
3999
4017
|
* Wraps fromDotSeparatedString with an error message about the method that
|
|
@@ -4003,20 +4021,20 @@ function Un(t, e, n) {
|
|
|
4003
4021
|
* split on dots.
|
|
4004
4022
|
* @param targetDoc - The document against which the field path will be
|
|
4005
4023
|
* evaluated.
|
|
4006
|
-
*/ function
|
|
4007
|
-
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,
|
|
4008
4026
|
/* hasConverter= */ !1,
|
|
4009
4027
|
/* path= */ void 0, n);
|
|
4010
4028
|
try {
|
|
4011
|
-
return (new (
|
|
4029
|
+
return (new (dn.bind.apply(dn, r([ void 0 ], e.split(".")))))._internalPath;
|
|
4012
4030
|
} catch (r) {
|
|
4013
|
-
throw
|
|
4031
|
+
throw Gn("Invalid field path (" + e + "). Paths must not be empty, begin with '.', end with '.', or contain '..'", t,
|
|
4014
4032
|
/* hasConverter= */ !1,
|
|
4015
4033
|
/* path= */ void 0, n);
|
|
4016
4034
|
}
|
|
4017
4035
|
}
|
|
4018
4036
|
|
|
4019
|
-
function
|
|
4037
|
+
function Gn(t, e, n, r, i) {
|
|
4020
4038
|
var o = r && !r.isEmpty(), a = void 0 !== i, s = "Function " + e + "() called with invalid data";
|
|
4021
4039
|
n && (s += " (via `toFirestore()`)");
|
|
4022
4040
|
var u = "";
|
|
@@ -4025,7 +4043,7 @@ function zn(t, e, n, r, i) {
|
|
|
4025
4043
|
/** Checks `haystack` if FieldPath `needle` is present. Runs in O(n). */;
|
|
4026
4044
|
}
|
|
4027
4045
|
|
|
4028
|
-
function
|
|
4046
|
+
function zn(t, e) {
|
|
4029
4047
|
return t.some((function(t) {
|
|
4030
4048
|
return t.isEqual(e);
|
|
4031
4049
|
}));
|
|
@@ -4055,7 +4073,7 @@ function Qn(t, e) {
|
|
|
4055
4073
|
* For a `DocumentSnapshot` that points to a non-existing document, any data
|
|
4056
4074
|
* access will return 'undefined'. You can use the `exists()` method to
|
|
4057
4075
|
* explicitly verify a document's existence.
|
|
4058
|
-
*/ var
|
|
4076
|
+
*/ var Qn = /** @class */ function() {
|
|
4059
4077
|
// Note: This class is stripped down version of the DocumentSnapshot in
|
|
4060
4078
|
// the legacy SDK. The changes are:
|
|
4061
4079
|
// - No support for SnapshotMetadata.
|
|
@@ -4076,7 +4094,7 @@ function Qn(t, e) {
|
|
|
4076
4094
|
* The `DocumentReference` for the document included in the `DocumentSnapshot`.
|
|
4077
4095
|
*/
|
|
4078
4096
|
get: function() {
|
|
4079
|
-
return new
|
|
4097
|
+
return new an(this._firestore, this._converter, this._key);
|
|
4080
4098
|
},
|
|
4081
4099
|
enumerable: !1,
|
|
4082
4100
|
configurable: !0
|
|
@@ -4101,7 +4119,7 @@ function Qn(t, e) {
|
|
|
4101
4119
|
if (this._converter) {
|
|
4102
4120
|
// We only want to use the converter and create a new DocumentSnapshot
|
|
4103
4121
|
// if a converter has been provided.
|
|
4104
|
-
var t = new
|
|
4122
|
+
var t = new Kn(this._firestore, this._userDataWriter, this._key, this._document,
|
|
4105
4123
|
/* converter= */ null);
|
|
4106
4124
|
return this._converter.fromFirestore(t);
|
|
4107
4125
|
}
|
|
@@ -4121,11 +4139,11 @@ function Qn(t, e) {
|
|
|
4121
4139
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4122
4140
|
t.prototype.get = function(t) {
|
|
4123
4141
|
if (this._document) {
|
|
4124
|
-
var e = this._document.data.field(
|
|
4142
|
+
var e = this._document.data.field(Yn("DocumentSnapshot.get", t));
|
|
4125
4143
|
if (null !== e) return this._userDataWriter.convertValue(e);
|
|
4126
4144
|
}
|
|
4127
4145
|
}, t;
|
|
4128
|
-
}(),
|
|
4146
|
+
}(), Kn = /** @class */ function(e) {
|
|
4129
4147
|
function n() {
|
|
4130
4148
|
return null !== e && e.apply(this, arguments) || this;
|
|
4131
4149
|
}
|
|
@@ -4137,7 +4155,7 @@ function Qn(t, e) {
|
|
|
4137
4155
|
*/ return t(n, e), n.prototype.data = function() {
|
|
4138
4156
|
return e.prototype.data.call(this);
|
|
4139
4157
|
}, n;
|
|
4140
|
-
}(
|
|
4158
|
+
}(Qn), Hn = /** @class */ function() {
|
|
4141
4159
|
/** @hideconstructor */
|
|
4142
4160
|
function t(t, e) {
|
|
4143
4161
|
this._docs = e, this.query = t;
|
|
@@ -4191,15 +4209,15 @@ function Qn(t, e) {
|
|
|
4191
4209
|
* @param right - A snapshot to compare.
|
|
4192
4210
|
* @returns true if the snapshots are equal.
|
|
4193
4211
|
*/
|
|
4194
|
-
function
|
|
4195
|
-
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)
|
|
4196
4214
|
/**
|
|
4197
4215
|
* Helper that calls `fromDotSeparatedString()` but wraps any error thrown.
|
|
4198
4216
|
*/;
|
|
4199
4217
|
}
|
|
4200
4218
|
|
|
4201
|
-
function
|
|
4202
|
-
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;
|
|
4203
4221
|
}
|
|
4204
4222
|
|
|
4205
4223
|
/**
|
|
@@ -4225,7 +4243,7 @@ function $n(t, e) {
|
|
|
4225
4243
|
* endBefore:1}, {@link (endAt:1)}, {@link limit} or {@link limitToLast} and
|
|
4226
4244
|
* can then be passed to {@link query} to create a new query instance that
|
|
4227
4245
|
* also contains this `QueryConstraint`.
|
|
4228
|
-
*/ var
|
|
4246
|
+
*/ var $n = function() {};
|
|
4229
4247
|
|
|
4230
4248
|
/**
|
|
4231
4249
|
* Creates a new immutable instance of {@link Query} that is extended to also include
|
|
@@ -4235,7 +4253,7 @@ function $n(t, e) {
|
|
|
4235
4253
|
* @param queryConstraints - The list of {@link QueryConstraint}s to apply.
|
|
4236
4254
|
* @throws if any of the provided query constraints cannot be combined with the
|
|
4237
4255
|
* existing or new constraints.
|
|
4238
|
-
*/ function
|
|
4256
|
+
*/ function Xn(t) {
|
|
4239
4257
|
for (var e = [], n = 1; n < arguments.length; n++) e[n - 1] = arguments[n];
|
|
4240
4258
|
for (var r = 0, i = e; r < i.length; r++) {
|
|
4241
4259
|
var o = i[r];
|
|
@@ -4244,31 +4262,31 @@ function $n(t, e) {
|
|
|
4244
4262
|
return t;
|
|
4245
4263
|
}
|
|
4246
4264
|
|
|
4247
|
-
var
|
|
4265
|
+
var Jn = /** @class */ function(e) {
|
|
4248
4266
|
function n(t, n, r) {
|
|
4249
4267
|
var i = this;
|
|
4250
4268
|
return (i = e.call(this) || this).dt = t, i.wt = n, i.yt = r, i.type = "where",
|
|
4251
4269
|
i;
|
|
4252
4270
|
}
|
|
4253
4271
|
return t(n, e), n.prototype._apply = function(t) {
|
|
4254
|
-
var e =
|
|
4272
|
+
var e = In(t.firestore), n = function(t, e, n, r, i, o, a) {
|
|
4255
4273
|
var s;
|
|
4256
4274
|
if (i.isKeyField()) {
|
|
4257
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().");
|
|
4258
4276
|
if ("in" /* IN */ === o || "not-in" /* NOT_IN */ === o) {
|
|
4259
|
-
|
|
4277
|
+
pr(a, o);
|
|
4260
4278
|
for (var u = [], c = 0, l = a; c < l.length; c++) {
|
|
4261
4279
|
var f = l[c];
|
|
4262
|
-
u.push(
|
|
4280
|
+
u.push(hr(r, t, f));
|
|
4263
4281
|
}
|
|
4264
4282
|
s = {
|
|
4265
4283
|
arrayValue: {
|
|
4266
4284
|
values: u
|
|
4267
4285
|
}
|
|
4268
4286
|
};
|
|
4269
|
-
} else s =
|
|
4270
|
-
} else "in" /* IN */ !== o && "not-in" /* NOT_IN */ !== o && "array-contains-any" /* ARRAY_CONTAINS_ANY */ !== o ||
|
|
4271
|
-
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,
|
|
4272
4290
|
/* allowArrays= */ "in" /* IN */ === o || "not-in" /* NOT_IN */ === o);
|
|
4273
4291
|
var h = Wt.create(i, o, s);
|
|
4274
4292
|
return function(t, e) {
|
|
@@ -4276,7 +4294,7 @@ var Zn = /** @class */ function(e) {
|
|
|
4276
4294
|
var n = le(t);
|
|
4277
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() + "'");
|
|
4278
4296
|
var r = ce(t);
|
|
4279
|
-
null !== r &&
|
|
4297
|
+
null !== r && dr(t, e.field, r);
|
|
4280
4298
|
}
|
|
4281
4299
|
var i = function(t, e) {
|
|
4282
4300
|
for (var n = 0, r = t.filters; n < r.length; n++) {
|
|
@@ -4323,12 +4341,12 @@ var Zn = /** @class */ function(e) {
|
|
|
4323
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.");
|
|
4324
4342
|
}(t, h), h;
|
|
4325
4343
|
}(t._query, 0, e, t.firestore._databaseId, this.dt, this.wt, this.yt);
|
|
4326
|
-
return new
|
|
4344
|
+
return new sn(t.firestore, t.converter, function(t, e) {
|
|
4327
4345
|
var n = t.filters.concat([ e ]);
|
|
4328
4346
|
return new se(t.path, t.collectionGroup, t.explicitOrderBy.slice(), n, t.limit, t.limitType, t.startAt, t.endAt);
|
|
4329
4347
|
}(t._query, n));
|
|
4330
4348
|
}, n;
|
|
4331
|
-
}(
|
|
4349
|
+
}($n);
|
|
4332
4350
|
|
|
4333
4351
|
/**
|
|
4334
4352
|
* Creates a {@link QueryConstraint} that enforces that documents must contain the
|
|
@@ -4340,12 +4358,12 @@ var Zn = /** @class */ function(e) {
|
|
|
4340
4358
|
* "<=", "!=").
|
|
4341
4359
|
* @param value - The value for comparison
|
|
4342
4360
|
* @returns The created {@link Query}.
|
|
4343
|
-
*/ function
|
|
4344
|
-
var r = e, i =
|
|
4345
|
-
return new
|
|
4361
|
+
*/ function Zn(t, e, n) {
|
|
4362
|
+
var r = e, i = Yn("where", t);
|
|
4363
|
+
return new Jn(i, r, n);
|
|
4346
4364
|
}
|
|
4347
4365
|
|
|
4348
|
-
var
|
|
4366
|
+
var tr = /** @class */ function(e) {
|
|
4349
4367
|
function n(t, n) {
|
|
4350
4368
|
var r = this;
|
|
4351
4369
|
return (r = e.call(this) || this).dt = t, r._t = n, r.type = "orderBy", r;
|
|
@@ -4359,17 +4377,17 @@ var er = /** @class */ function(e) {
|
|
|
4359
4377
|
if (null === ce(t)) {
|
|
4360
4378
|
// This is the first order by. It must match any inequality.
|
|
4361
4379
|
var n = le(t);
|
|
4362
|
-
null !== n &&
|
|
4380
|
+
null !== n && dr(t, n, e.field);
|
|
4363
4381
|
}
|
|
4364
4382
|
}(t, r), r;
|
|
4365
4383
|
}(t._query, this.dt, this._t);
|
|
4366
|
-
return new
|
|
4384
|
+
return new sn(t.firestore, t.converter, function(t, e) {
|
|
4367
4385
|
// TODO(dimond): validate that orderBy does not list the same key twice.
|
|
4368
4386
|
var n = t.explicitOrderBy.concat([ e ]);
|
|
4369
4387
|
return new se(t.path, t.collectionGroup, n, t.filters.slice(), t.limit, t.limitType, t.startAt, t.endAt);
|
|
4370
4388
|
}(t._query, e));
|
|
4371
4389
|
}, n;
|
|
4372
|
-
}(
|
|
4390
|
+
}($n);
|
|
4373
4391
|
|
|
4374
4392
|
/**
|
|
4375
4393
|
* Creates a {@link QueryConstraint} that sorts the query result by the
|
|
@@ -4379,31 +4397,31 @@ var er = /** @class */ function(e) {
|
|
|
4379
4397
|
* @param directionStr - Optional direction to sort by ('asc' or 'desc'). If
|
|
4380
4398
|
* not specified, order will be ascending.
|
|
4381
4399
|
* @returns The created {@link Query}.
|
|
4382
|
-
*/ function
|
|
4400
|
+
*/ function er(t, e) {
|
|
4383
4401
|
void 0 === e && (e = "asc");
|
|
4384
|
-
var n = e, r =
|
|
4385
|
-
return new
|
|
4402
|
+
var n = e, r = Yn("orderBy", t);
|
|
4403
|
+
return new tr(r, n);
|
|
4386
4404
|
}
|
|
4387
4405
|
|
|
4388
|
-
var
|
|
4406
|
+
var nr = /** @class */ function(e) {
|
|
4389
4407
|
function n(t, n, r) {
|
|
4390
4408
|
var i = this;
|
|
4391
4409
|
return (i = e.call(this) || this).type = t, i.gt = n, i.vt = r, i;
|
|
4392
4410
|
}
|
|
4393
4411
|
return t(n, e), n.prototype._apply = function(t) {
|
|
4394
|
-
return new
|
|
4412
|
+
return new sn(t.firestore, t.converter, function(t, e, n) {
|
|
4395
4413
|
return new se(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), e, n, t.startAt, t.endAt);
|
|
4396
4414
|
}(t._query, this.gt, this.vt));
|
|
4397
4415
|
}, n;
|
|
4398
|
-
}(
|
|
4416
|
+
}($n);
|
|
4399
4417
|
|
|
4400
4418
|
/**
|
|
4401
4419
|
* Creates a {@link QueryConstraint} that only returns the first matching documents.
|
|
4402
4420
|
*
|
|
4403
4421
|
* @param limit - The maximum number of items to return.
|
|
4404
4422
|
* @returns The created {@link Query}.
|
|
4405
|
-
*/ function
|
|
4406
|
-
return ut("limit", t), new
|
|
4423
|
+
*/ function rr(t) {
|
|
4424
|
+
return ut("limit", t), new nr("limit", t, "F" /* First */)
|
|
4407
4425
|
/**
|
|
4408
4426
|
* Creates a {@link QueryConstraint} that only returns the last matching documents.
|
|
4409
4427
|
*
|
|
@@ -4415,60 +4433,62 @@ var rr = /** @class */ function(e) {
|
|
|
4415
4433
|
*/;
|
|
4416
4434
|
}
|
|
4417
4435
|
|
|
4418
|
-
function
|
|
4419
|
-
return ut("limitToLast", t), new
|
|
4436
|
+
function ir(t) {
|
|
4437
|
+
return ut("limitToLast", t), new nr("limitToLast", t, "L" /* Last */);
|
|
4420
4438
|
}
|
|
4421
4439
|
|
|
4422
|
-
var
|
|
4440
|
+
var or = /** @class */ function(e) {
|
|
4423
4441
|
function n(t, n, r) {
|
|
4424
4442
|
var i = this;
|
|
4425
4443
|
return (i = e.call(this) || this).type = t, i.bt = n, i.Et = r, i;
|
|
4426
4444
|
}
|
|
4427
4445
|
return t(n, e), n.prototype._apply = function(t) {
|
|
4428
|
-
var e =
|
|
4429
|
-
return new
|
|
4446
|
+
var e = fr(t, this.type, this.bt, this.Et);
|
|
4447
|
+
return new sn(t.firestore, t.converter, function(t, e) {
|
|
4430
4448
|
return new se(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), t.limit, t.limitType, e, t.endAt);
|
|
4431
4449
|
}(t._query, e));
|
|
4432
4450
|
}, n;
|
|
4433
|
-
}(
|
|
4451
|
+
}($n);
|
|
4434
4452
|
|
|
4435
|
-
function
|
|
4453
|
+
function ar() {
|
|
4436
4454
|
for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
|
|
4437
|
-
return new
|
|
4455
|
+
return new or("startAt", t,
|
|
4456
|
+
/*inclusive=*/ !0);
|
|
4438
4457
|
}
|
|
4439
4458
|
|
|
4440
|
-
function
|
|
4459
|
+
function sr() {
|
|
4441
4460
|
for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
|
|
4442
|
-
return new
|
|
4443
|
-
/*
|
|
4461
|
+
return new or("startAfter", t,
|
|
4462
|
+
/*inclusive=*/ !1);
|
|
4444
4463
|
}
|
|
4445
4464
|
|
|
4446
|
-
var
|
|
4465
|
+
var ur = /** @class */ function(e) {
|
|
4447
4466
|
function n(t, n, r) {
|
|
4448
4467
|
var i = this;
|
|
4449
4468
|
return (i = e.call(this) || this).type = t, i.bt = n, i.Et = r, i;
|
|
4450
4469
|
}
|
|
4451
4470
|
return t(n, e), n.prototype._apply = function(t) {
|
|
4452
|
-
var e =
|
|
4453
|
-
return new
|
|
4471
|
+
var e = fr(t, this.type, this.bt, this.Et);
|
|
4472
|
+
return new sn(t.firestore, t.converter, function(t, e) {
|
|
4454
4473
|
return new se(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), t.limit, t.limitType, t.startAt, e);
|
|
4455
4474
|
}(t._query, e));
|
|
4456
4475
|
}, n;
|
|
4457
|
-
}(
|
|
4476
|
+
}($n);
|
|
4458
4477
|
|
|
4459
|
-
function
|
|
4478
|
+
function cr() {
|
|
4460
4479
|
for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
|
|
4461
|
-
return new
|
|
4480
|
+
return new ur("endBefore", t,
|
|
4481
|
+
/*inclusive=*/ !1);
|
|
4462
4482
|
}
|
|
4463
4483
|
|
|
4464
|
-
function
|
|
4484
|
+
function lr() {
|
|
4465
4485
|
for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
|
|
4466
|
-
return new
|
|
4486
|
+
return new ur("endAt", t, /*inclusive=*/ !0);
|
|
4467
4487
|
}
|
|
4468
4488
|
|
|
4469
|
-
/** Helper function to create a bound from a document or fields */ function
|
|
4470
|
-
if (n[0] = p(n[0]), n[0] instanceof
|
|
4471
|
-
if (!r) throw new U(
|
|
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) {
|
|
4491
|
+
if (!r) throw new U(P, "Can't use a DocumentSnapshot that doesn't exist for " + n + "().");
|
|
4472
4492
|
// Because people expect to continue/end a query at the exact document
|
|
4473
4493
|
// provided, we need to use the implicit sort order rather than the explicit
|
|
4474
4494
|
// sort order, because it's guaranteed to contain the document key. That way
|
|
@@ -4480,7 +4500,7 @@ function fr() {
|
|
|
4480
4500
|
var u = s[a];
|
|
4481
4501
|
if (u.field.isKeyField()) o.push(Rt(e, r.key)); else {
|
|
4482
4502
|
var c = r.data.field(u.field);
|
|
4483
|
-
if (
|
|
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.)');
|
|
4484
4504
|
if (null === c) {
|
|
4485
4505
|
var l = u.field.canonicalString();
|
|
4486
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.");
|
|
@@ -4490,7 +4510,7 @@ function fr() {
|
|
|
4490
4510
|
}
|
|
4491
4511
|
return new re(o, i);
|
|
4492
4512
|
}(t._query, t.firestore._databaseId, e, n[0]._document, r);
|
|
4493
|
-
var i =
|
|
4513
|
+
var i = In(t.firestore);
|
|
4494
4514
|
return function(t, e, n, r, i, o) {
|
|
4495
4515
|
// Use explicit order by's because it has to match the query the user made
|
|
4496
4516
|
var a = t.explicitOrderBy;
|
|
@@ -4505,7 +4525,7 @@ function fr() {
|
|
|
4505
4525
|
var f = new nt(l);
|
|
4506
4526
|
s.push(Rt(e, f));
|
|
4507
4527
|
} else {
|
|
4508
|
-
var h =
|
|
4528
|
+
var h = Cn(n, r, c);
|
|
4509
4529
|
s.push(h);
|
|
4510
4530
|
}
|
|
4511
4531
|
}
|
|
@@ -4513,7 +4533,7 @@ function fr() {
|
|
|
4513
4533
|
}(t._query, t.firestore._databaseId, i, e, n, r);
|
|
4514
4534
|
}
|
|
4515
4535
|
|
|
4516
|
-
function
|
|
4536
|
+
function hr(t, e, n) {
|
|
4517
4537
|
if ("string" == typeof (n = p(n))) {
|
|
4518
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.");
|
|
4519
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.");
|
|
@@ -4521,19 +4541,19 @@ function pr(t, e, n) {
|
|
|
4521
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 + ").");
|
|
4522
4542
|
return Rt(t, new nt(r));
|
|
4523
4543
|
}
|
|
4524
|
-
if (n instanceof
|
|
4544
|
+
if (n instanceof an) return Rt(t, n._key);
|
|
4525
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) + ".");
|
|
4526
4546
|
}
|
|
4527
4547
|
|
|
4528
4548
|
/**
|
|
4529
4549
|
* Validates that the value passed into a disjunctive filter satisfies all
|
|
4530
4550
|
* array requirements.
|
|
4531
|
-
*/ function
|
|
4551
|
+
*/ function pr(t, e) {
|
|
4532
4552
|
if (!Array.isArray(t) || 0 === t.length) throw new U(V, "Invalid Query. A non-empty array is required for '" + e.toString() + "' filters.");
|
|
4533
4553
|
if (t.length > 10) throw new U(V, "Invalid Query. '" + e.toString() + "' filters support a maximum of 10 elements in the value array.");
|
|
4534
4554
|
}
|
|
4535
4555
|
|
|
4536
|
-
function
|
|
4556
|
+
function dr(t, e, n) {
|
|
4537
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.");
|
|
4538
4558
|
}
|
|
4539
4559
|
|
|
@@ -4583,23 +4603,23 @@ function mr(t, e, n) {
|
|
|
4583
4603
|
* because we want to provide the user with a more specific error message if
|
|
4584
4604
|
* their `set()` or fails due to invalid data originating from a `toFirestore()`
|
|
4585
4605
|
* call.
|
|
4586
|
-
*/ function
|
|
4606
|
+
*/ function mr(t, e, n) {
|
|
4587
4607
|
// Cast to `any` in order to satisfy the union type constraint on
|
|
4588
4608
|
// toFirestore().
|
|
4589
4609
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4590
4610
|
return t ? n && (n.merge || n.mergeFields) ? t.toFirestore(e, n) : t.toFirestore(e) : e;
|
|
4591
4611
|
}
|
|
4592
4612
|
|
|
4593
|
-
var
|
|
4613
|
+
var yr = /** @class */ function(e) {
|
|
4594
4614
|
function n(t) {
|
|
4595
4615
|
var n = this;
|
|
4596
4616
|
return (n = e.call(this) || this).firestore = t, n;
|
|
4597
4617
|
}
|
|
4598
4618
|
return t(n, e), n.prototype.convertBytes = function(t) {
|
|
4599
|
-
return new
|
|
4619
|
+
return new yn(t);
|
|
4600
4620
|
}, n.prototype.convertReference = function(t) {
|
|
4601
4621
|
var e = this.convertDocumentKey(t, this.firestore._databaseId);
|
|
4602
|
-
return new
|
|
4622
|
+
return new an(this.firestore, /* converter= */ null, e);
|
|
4603
4623
|
}, n;
|
|
4604
4624
|
}(/** @class */ function() {
|
|
4605
4625
|
function t() {}
|
|
@@ -4647,7 +4667,7 @@ var vr = /** @class */ function(e) {
|
|
|
4647
4667
|
r[t] = n.convertValue(i, e);
|
|
4648
4668
|
})), r;
|
|
4649
4669
|
}, t.prototype.convertGeoPoint = function(t) {
|
|
4650
|
-
return new
|
|
4670
|
+
return new gn(Vt(t.latitude), Vt(t.longitude));
|
|
4651
4671
|
}, t.prototype.convertArray = function(t, e) {
|
|
4652
4672
|
var n = this;
|
|
4653
4673
|
return (t.values || []).map((function(t) {
|
|
@@ -4656,7 +4676,7 @@ var vr = /** @class */ function(e) {
|
|
|
4656
4676
|
}, t.prototype.convertServerTimestamp = function(t, e) {
|
|
4657
4677
|
switch (e) {
|
|
4658
4678
|
case "previous":
|
|
4659
|
-
var n =
|
|
4679
|
+
var n = Nt(t);
|
|
4660
4680
|
return null == n ? null : this.convertValue(n, e);
|
|
4661
4681
|
|
|
4662
4682
|
case "estimate":
|
|
@@ -4670,7 +4690,7 @@ var vr = /** @class */ function(e) {
|
|
|
4670
4690
|
return new bt(e.seconds, e.nanos);
|
|
4671
4691
|
}, t.prototype.convertDocumentKey = function(t, e) {
|
|
4672
4692
|
var n = Z.fromString(t);
|
|
4673
|
-
E(
|
|
4693
|
+
E(ze(n));
|
|
4674
4694
|
var r = new X(n.get(1), n.get(3)), i = new nt(n.popFirst(5));
|
|
4675
4695
|
return r.isEqual(e) ||
|
|
4676
4696
|
// TODO(b/64130202): Somehow support foreign references.
|
|
@@ -4691,12 +4711,12 @@ var vr = /** @class */ function(e) {
|
|
|
4691
4711
|
* @param reference - The reference of the document to fetch.
|
|
4692
4712
|
* @returns A Promise resolved with a `DocumentSnapshot` containing the current
|
|
4693
4713
|
* document contents.
|
|
4694
|
-
*/ function
|
|
4695
|
-
var e =
|
|
4696
|
-
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) {
|
|
4697
4717
|
E(1 === e.length);
|
|
4698
4718
|
var r = e[0];
|
|
4699
|
-
return new
|
|
4719
|
+
return new Qn(t.firestore, n, t._key, r.isFoundDocument() ? r : null, t.converter);
|
|
4700
4720
|
}));
|
|
4701
4721
|
}
|
|
4702
4722
|
|
|
@@ -4711,35 +4731,35 @@ var vr = /** @class */ function(e) {
|
|
|
4711
4731
|
*
|
|
4712
4732
|
* @param query - The `Query` to execute.
|
|
4713
4733
|
* @returns A Promise that will be resolved with the results of the query.
|
|
4714
|
-
*/ function
|
|
4734
|
+
*/ function gr(t) {
|
|
4715
4735
|
!function(t) {
|
|
4716
|
-
if (ue(t) && 0 === t.explicitOrderBy.length) throw new U(
|
|
4717
|
-
}((t = st(t,
|
|
4718
|
-
var e =
|
|
4719
|
-
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) {
|
|
4720
4740
|
var r = e.map((function(e) {
|
|
4721
|
-
return new
|
|
4741
|
+
return new Kn(t.firestore, n, e.key, e, t.converter);
|
|
4722
4742
|
}));
|
|
4723
4743
|
return ue(t._query) &&
|
|
4724
4744
|
// Limit to last queries reverse the orderBy constraint that was
|
|
4725
4745
|
// specified by the user. As such, we need to reverse the order of the
|
|
4726
4746
|
// results to return the documents in the expected order.
|
|
4727
|
-
r.reverse(), new
|
|
4747
|
+
r.reverse(), new Hn(t, r);
|
|
4728
4748
|
}));
|
|
4729
4749
|
}
|
|
4730
4750
|
|
|
4731
|
-
function
|
|
4732
|
-
var r =
|
|
4733
|
-
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()) ]);
|
|
4734
4754
|
}
|
|
4735
4755
|
|
|
4736
|
-
function
|
|
4756
|
+
function br(t, e, n) {
|
|
4737
4757
|
for (var r = [], i = 3; i < arguments.length; i++) r[i - 3] = arguments[i];
|
|
4738
|
-
var o, a =
|
|
4758
|
+
var o, a = In((t = st(t, an)).firestore);
|
|
4739
4759
|
// For Compat types, we have to "extract" the underlying types before
|
|
4740
4760
|
// performing validation.
|
|
4741
|
-
return o = "string" == typeof (e = p(e)) || e instanceof
|
|
4742
|
-
|
|
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)) ]);
|
|
4743
4763
|
}
|
|
4744
4764
|
|
|
4745
4765
|
/**
|
|
@@ -4753,8 +4773,8 @@ function _r(t, e, n) {
|
|
|
4753
4773
|
* @param reference - A reference to the document to delete.
|
|
4754
4774
|
* @returns A `Promise` resolved once the document has been successfully
|
|
4755
4775
|
* deleted from the backend.
|
|
4756
|
-
*/ function
|
|
4757
|
-
return
|
|
4776
|
+
*/ function _r(t) {
|
|
4777
|
+
return We(Je((t = st(t, an)).firestore), [ new Ie(t._key, _e.none()) ]);
|
|
4758
4778
|
}
|
|
4759
4779
|
|
|
4760
4780
|
/**
|
|
@@ -4771,9 +4791,9 @@ function _r(t, e, n) {
|
|
|
4771
4791
|
* @throws Error - If the provided input is not a valid Firestore document.
|
|
4772
4792
|
* @returns A `Promise` resolved with a `DocumentReference` pointing to the
|
|
4773
4793
|
* newly created document after it has been written to the backend.
|
|
4774
|
-
*/ function
|
|
4775
|
-
var n =
|
|
4776
|
-
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() {
|
|
4777
4797
|
return n;
|
|
4778
4798
|
}));
|
|
4779
4799
|
}
|
|
@@ -4797,15 +4817,15 @@ function _r(t, e, n) {
|
|
|
4797
4817
|
/**
|
|
4798
4818
|
* Returns a sentinel for use with {@link @firebase/firestore/lite#(updateDoc:1)} or
|
|
4799
4819
|
* {@link @firebase/firestore/lite#(setDoc:1)} with `{merge: true}` to mark a field for deletion.
|
|
4800
|
-
*/ function
|
|
4801
|
-
return new
|
|
4820
|
+
*/ function Sr() {
|
|
4821
|
+
return new kn("deleteField");
|
|
4802
4822
|
}
|
|
4803
4823
|
|
|
4804
4824
|
/**
|
|
4805
4825
|
* Returns a sentinel used with {@link @firebase/firestore/lite#(setDoc:1)} or {@link @firebase/firestore/lite#(updateDoc:1)} to
|
|
4806
4826
|
* include a server-generated timestamp in the written data.
|
|
4807
|
-
*/ function
|
|
4808
|
-
return new
|
|
4827
|
+
*/ function Er() {
|
|
4828
|
+
return new Dn("serverTimestamp");
|
|
4809
4829
|
}
|
|
4810
4830
|
|
|
4811
4831
|
/**
|
|
@@ -4819,7 +4839,7 @@ function _r(t, e, n) {
|
|
|
4819
4839
|
* @param elements - The elements to union into the array.
|
|
4820
4840
|
* @returns The `FieldValue` sentinel for use in a call to `setDoc()` or
|
|
4821
4841
|
* `updateDoc()`.
|
|
4822
|
-
*/ function
|
|
4842
|
+
*/ function Ir() {
|
|
4823
4843
|
for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
|
|
4824
4844
|
// NOTE: We don't actually parse the data until it's used in set() or
|
|
4825
4845
|
// update() since we'd need the Firestore instance to do this.
|
|
@@ -4836,11 +4856,11 @@ function _r(t, e, n) {
|
|
|
4836
4856
|
* @param elements - The elements to remove from the array.
|
|
4837
4857
|
* @returns The `FieldValue` sentinel for use in a call to `setDoc()` or
|
|
4838
4858
|
* `updateDoc()`
|
|
4839
|
-
*/ function
|
|
4859
|
+
*/ function Ar() {
|
|
4840
4860
|
for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
|
|
4841
4861
|
// NOTE: We don't actually parse the data until it's used in set() or
|
|
4842
4862
|
// update() since we'd need the Firestore instance to do this.
|
|
4843
|
-
return new
|
|
4863
|
+
return new Nn("arrayRemove", t);
|
|
4844
4864
|
}
|
|
4845
4865
|
|
|
4846
4866
|
/**
|
|
@@ -4861,8 +4881,8 @@ function _r(t, e, n) {
|
|
|
4861
4881
|
* @param n - The value to increment by.
|
|
4862
4882
|
* @returns The `FieldValue` sentinel for use in a call to `setDoc()` or
|
|
4863
4883
|
* `updateDoc()`
|
|
4864
|
-
*/ function
|
|
4865
|
-
return new
|
|
4884
|
+
*/ function kr(t) {
|
|
4885
|
+
return new qn("increment", t);
|
|
4866
4886
|
}
|
|
4867
4887
|
|
|
4868
4888
|
/**
|
|
@@ -4888,23 +4908,23 @@ function _r(t, e, n) {
|
|
|
4888
4908
|
* provides methods for adding writes to the write batch. None of the writes
|
|
4889
4909
|
* will be committed (or visible locally) until {@link WriteBatch.commit} is
|
|
4890
4910
|
* called.
|
|
4891
|
-
*/ var
|
|
4911
|
+
*/ var Vr = /** @class */ function() {
|
|
4892
4912
|
/** @hideconstructor */
|
|
4893
4913
|
function t(t, e) {
|
|
4894
4914
|
this._firestore = t, this._commitHandler = e, this._mutations = [], this._committed = !1,
|
|
4895
|
-
this._dataReader =
|
|
4915
|
+
this._dataReader = In(t);
|
|
4896
4916
|
}
|
|
4897
4917
|
return t.prototype.set = function(t, e, n) {
|
|
4898
4918
|
this._verifyNotCommitted();
|
|
4899
|
-
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);
|
|
4900
4920
|
return this._mutations.push(o.toMutation(r._key, _e.none())), this;
|
|
4901
4921
|
}, t.prototype.update = function(t, e, n) {
|
|
4902
4922
|
for (var r = [], i = 3; i < arguments.length; i++) r[i - 3] = arguments[i];
|
|
4903
4923
|
this._verifyNotCommitted();
|
|
4904
|
-
var o, a =
|
|
4924
|
+
var o, a = Dr(t, this._firestore);
|
|
4905
4925
|
// For Compat types, we have to "extract" the underlying types before
|
|
4906
4926
|
// performing validation.
|
|
4907
|
-
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),
|
|
4908
4928
|
this._mutations.push(o.toMutation(a._key, _e.exists(!0))), this;
|
|
4909
4929
|
},
|
|
4910
4930
|
/**
|
|
@@ -4915,7 +4935,7 @@ function _r(t, e, n) {
|
|
|
4915
4935
|
*/
|
|
4916
4936
|
t.prototype.delete = function(t) {
|
|
4917
4937
|
this._verifyNotCommitted();
|
|
4918
|
-
var e =
|
|
4938
|
+
var e = Dr(t, this._firestore);
|
|
4919
4939
|
return this._mutations = this._mutations.concat(new Ie(e._key, _e.none())), this;
|
|
4920
4940
|
},
|
|
4921
4941
|
/**
|
|
@@ -4937,7 +4957,7 @@ function _r(t, e, n) {
|
|
|
4937
4957
|
}, t;
|
|
4938
4958
|
}();
|
|
4939
4959
|
|
|
4940
|
-
function
|
|
4960
|
+
function Dr(t, e) {
|
|
4941
4961
|
if ((t = p(t)).firestore !== e) throw new U(V, "Provided document reference is from a different Firestore instance.");
|
|
4942
4962
|
return t;
|
|
4943
4963
|
}
|
|
@@ -4955,9 +4975,9 @@ function Nr(t, e) {
|
|
|
4955
4975
|
* @returns A `WriteBatch` that can be used to atomically execute multiple
|
|
4956
4976
|
* writes.
|
|
4957
4977
|
*/ function Pr(t) {
|
|
4958
|
-
var e =
|
|
4959
|
-
return new
|
|
4960
|
-
return
|
|
4978
|
+
var e = Je(t = st(t, tn));
|
|
4979
|
+
return new Vr(t, (function(t) {
|
|
4980
|
+
return We(e, t);
|
|
4961
4981
|
}));
|
|
4962
4982
|
}
|
|
4963
4983
|
|
|
@@ -4980,7 +5000,7 @@ function Nr(t, e) {
|
|
|
4980
5000
|
/**
|
|
4981
5001
|
* Internal transaction object responsible for accumulating the mutations to
|
|
4982
5002
|
* perform and the base versions for any documents read.
|
|
4983
|
-
*/ var
|
|
5003
|
+
*/ var Nr = /** @class */ function() {
|
|
4984
5004
|
function t(t) {
|
|
4985
5005
|
this.datastore = t,
|
|
4986
5006
|
// The version of each document that was read during this transaction.
|
|
@@ -5005,7 +5025,7 @@ function Nr(t, e) {
|
|
|
5005
5025
|
switch (n.label) {
|
|
5006
5026
|
case 0:
|
|
5007
5027
|
if (this.ensureCommitNotCalled(), this.mutations.length > 0) throw new U(V, "Firestore transactions require all reads to be executed before all writes.");
|
|
5008
|
-
return [ 4 /*yield*/ ,
|
|
5028
|
+
return [ 4 /*yield*/ , Ye(this.datastore, t) ];
|
|
5009
5029
|
|
|
5010
5030
|
case 1:
|
|
5011
5031
|
return [ 2 /*return*/ , ((e = n.sent()).forEach((function(t) {
|
|
@@ -5042,7 +5062,7 @@ function Nr(t, e) {
|
|
|
5042
5062
|
t.forEach((function(t, n) {
|
|
5043
5063
|
var r = nt.fromPath(n);
|
|
5044
5064
|
e.mutations.push(new Ae(r, e.precondition(r)));
|
|
5045
|
-
})), [ 4 /*yield*/ ,
|
|
5065
|
+
})), [ 4 /*yield*/ , We(this.datastore, this.mutations) ];
|
|
5046
5066
|
|
|
5047
5067
|
case 1:
|
|
5048
5068
|
// For each mutation, note that the doc was written.
|
|
@@ -5100,10 +5120,10 @@ function Nr(t, e) {
|
|
|
5100
5120
|
}, t.prototype.write = function(t) {
|
|
5101
5121
|
this.ensureCommitNotCalled(), this.mutations.push(t);
|
|
5102
5122
|
}, t.prototype.ensureCommitNotCalled = function() {}, t;
|
|
5103
|
-
}(),
|
|
5123
|
+
}(), qr = /** @class */ function() {
|
|
5104
5124
|
function t(t, e, n, r) {
|
|
5105
5125
|
this.asyncQueue = t, this.datastore = e, this.updateFunction = n, this.deferred = r,
|
|
5106
|
-
this.Tt = 5, this.It = new
|
|
5126
|
+
this.Tt = 5, this.It = new Ke(this.asyncQueue, "transaction_retry" /* TransactionRetry */)
|
|
5107
5127
|
/** Runs the transaction and sets the result on deferred. */;
|
|
5108
5128
|
}
|
|
5109
5129
|
return t.prototype.run = function() {
|
|
@@ -5114,7 +5134,7 @@ function Nr(t, e) {
|
|
|
5114
5134
|
return e(t, void 0, void 0, (function() {
|
|
5115
5135
|
var t, e, r = this;
|
|
5116
5136
|
return n(this, (function(n) {
|
|
5117
|
-
return t = new
|
|
5137
|
+
return t = new Nr(this.datastore), (e = this.Rt(t)) && e.then((function(e) {
|
|
5118
5138
|
r.asyncQueue.enqueueAndForget((function() {
|
|
5119
5139
|
return t.commit().then((function() {
|
|
5120
5140
|
r.deferred.resolve(e);
|
|
@@ -5171,16 +5191,16 @@ function Nr(t, e) {
|
|
|
5171
5191
|
return !1;
|
|
5172
5192
|
|
|
5173
5193
|
case V:
|
|
5174
|
-
case N:
|
|
5175
|
-
case "already-exists":
|
|
5176
5194
|
case P:
|
|
5195
|
+
case "already-exists":
|
|
5196
|
+
case N:
|
|
5177
5197
|
case O:
|
|
5178
5198
|
// Aborted might be retried in some scenarios, but that is dependant on
|
|
5179
5199
|
// the context and should handled individually by the calling code.
|
|
5180
5200
|
// See https://cloud.google.com/apis/design/errors.
|
|
5181
5201
|
case C:
|
|
5182
|
-
case j:
|
|
5183
5202
|
case L:
|
|
5203
|
+
case j:
|
|
5184
5204
|
case "data-loss":
|
|
5185
5205
|
return !0;
|
|
5186
5206
|
}
|
|
@@ -5226,7 +5246,7 @@ function Nr(t, e) {
|
|
|
5226
5246
|
* See the License for the specific language governing permissions and
|
|
5227
5247
|
* limitations under the License.
|
|
5228
5248
|
*/
|
|
5229
|
-
/** The Platform's 'document' implementation or null if not available. */ function
|
|
5249
|
+
/** The Platform's 'document' implementation or null if not available. */ function Fr() {
|
|
5230
5250
|
// `document` is not always available, e.g. in ReactNative and WebWorkers.
|
|
5231
5251
|
// eslint-disable-next-line no-restricted-globals
|
|
5232
5252
|
return "undefined" != typeof document ? document : null;
|
|
@@ -5258,7 +5278,7 @@ function Nr(t, e) {
|
|
|
5258
5278
|
* Note: We implement `PromiseLike` instead of `Promise`, as the `Promise` type
|
|
5259
5279
|
* in newer versions of TypeScript defines `finally`, which is not available in
|
|
5260
5280
|
* IE.
|
|
5261
|
-
*/ var
|
|
5281
|
+
*/ var Or = /** @class */ function() {
|
|
5262
5282
|
function t(t, e, n, r, i) {
|
|
5263
5283
|
this.asyncQueue = t, this.timerId = e, this.targetTimeMs = n, this.op = r, this.removalCallback = i,
|
|
5264
5284
|
this.deferred = new x, this.then = this.deferred.promise.then.bind(this.deferred.promise),
|
|
@@ -5322,7 +5342,7 @@ function Nr(t, e) {
|
|
|
5322
5342
|
null !== this.timerHandle && (this.removalCallback(this), clearTimeout(this.timerHandle),
|
|
5323
5343
|
this.timerHandle = null);
|
|
5324
5344
|
}, t;
|
|
5325
|
-
}(),
|
|
5345
|
+
}(), Cr = /** @class */ function() {
|
|
5326
5346
|
function t() {
|
|
5327
5347
|
var t = this;
|
|
5328
5348
|
// The last promise in the queue.
|
|
@@ -5346,15 +5366,15 @@ function Nr(t, e) {
|
|
|
5346
5366
|
// List of TimerIds to fast-forward delays for.
|
|
5347
5367
|
this.Ot = [],
|
|
5348
5368
|
// Backoff timer used to schedule retries for retryable operations
|
|
5349
|
-
this.It = new
|
|
5369
|
+
this.It = new Ke(this, "async_queue_retry" /* AsyncQueueRetry */),
|
|
5350
5370
|
// Visibility handler that triggers an immediate retry of all retryable
|
|
5351
5371
|
// operations. Meant to speed up recovery when we regain file system access
|
|
5352
5372
|
// after page comes into foreground.
|
|
5353
5373
|
this.Ct = function() {
|
|
5354
|
-
var e =
|
|
5374
|
+
var e = Fr();
|
|
5355
5375
|
e && w("AsyncQueue", "Visibility state changed to " + e.visibilityState), t.It.H();
|
|
5356
5376
|
};
|
|
5357
|
-
var e =
|
|
5377
|
+
var e = Fr();
|
|
5358
5378
|
e && "function" == typeof e.addEventListener && e.addEventListener("visibilitychange", this.Ct);
|
|
5359
5379
|
}
|
|
5360
5380
|
return Object.defineProperty(t.prototype, "isShuttingDown", {
|
|
@@ -5378,7 +5398,7 @@ function Nr(t, e) {
|
|
|
5378
5398
|
}, t.prototype.enterRestrictedMode = function(t) {
|
|
5379
5399
|
if (!this.$t) {
|
|
5380
5400
|
this.$t = !0, this.qt = t || !1;
|
|
5381
|
-
var e =
|
|
5401
|
+
var e = Fr();
|
|
5382
5402
|
e && "function" == typeof e.removeEventListener && e.removeEventListener("visibilitychange", this.Ct);
|
|
5383
5403
|
}
|
|
5384
5404
|
}, t.prototype.enqueue = function(t) {
|
|
@@ -5476,7 +5496,7 @@ function Nr(t, e) {
|
|
|
5476
5496
|
this.Lt(),
|
|
5477
5497
|
// Fast-forward delays for timerIds that have been overriden.
|
|
5478
5498
|
this.Ot.indexOf(t) > -1 && (e = 0);
|
|
5479
|
-
var i =
|
|
5499
|
+
var i = Or.createAndSchedule(this, t, e, n, (function(t) {
|
|
5480
5500
|
return r.jt(t);
|
|
5481
5501
|
}));
|
|
5482
5502
|
return this.St.push(i), i;
|
|
@@ -5554,7 +5574,7 @@ function Nr(t, e) {
|
|
|
5554
5574
|
}(), Lr = /** @class */ function() {
|
|
5555
5575
|
/** @hideconstructor */
|
|
5556
5576
|
function t(t, e) {
|
|
5557
|
-
this._firestore = t, this._transaction = e, this._dataReader =
|
|
5577
|
+
this._firestore = t, this._transaction = e, this._dataReader = In(t)
|
|
5558
5578
|
/**
|
|
5559
5579
|
* Reads the document referenced by the provided {@link DocumentReference}.
|
|
5560
5580
|
*
|
|
@@ -5563,23 +5583,23 @@ function Nr(t, e) {
|
|
|
5563
5583
|
*/;
|
|
5564
5584
|
}
|
|
5565
5585
|
return t.prototype.get = function(t) {
|
|
5566
|
-
var e = this, n =
|
|
5586
|
+
var e = this, n = Dr(t, this._firestore), r = new yr(this._firestore);
|
|
5567
5587
|
return this._transaction.lookup([ n._key ]).then((function(t) {
|
|
5568
5588
|
if (!t || 1 !== t.length) return S();
|
|
5569
5589
|
var i = t[0];
|
|
5570
|
-
if (i.isFoundDocument()) return new
|
|
5571
|
-
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);
|
|
5572
5592
|
throw S();
|
|
5573
5593
|
}));
|
|
5574
5594
|
}, t.prototype.set = function(t, e, n) {
|
|
5575
|
-
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);
|
|
5576
5596
|
return this._transaction.set(r._key, o), this;
|
|
5577
5597
|
}, t.prototype.update = function(t, e, n) {
|
|
5578
5598
|
for (var r = [], i = 3; i < arguments.length; i++) r[i - 3] = arguments[i];
|
|
5579
|
-
var o, a =
|
|
5599
|
+
var o, a = Dr(t, this._firestore);
|
|
5580
5600
|
// For Compat types, we have to "extract" the underlying types before
|
|
5581
5601
|
// performing validation.
|
|
5582
|
-
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),
|
|
5583
5603
|
this._transaction.update(a._key, o), this;
|
|
5584
5604
|
},
|
|
5585
5605
|
/**
|
|
@@ -5589,7 +5609,7 @@ function Nr(t, e) {
|
|
|
5589
5609
|
* @returns This `Transaction` instance. Used for chaining method calls.
|
|
5590
5610
|
*/
|
|
5591
5611
|
t.prototype.delete = function(t) {
|
|
5592
|
-
var e =
|
|
5612
|
+
var e = Dr(t, this._firestore);
|
|
5593
5613
|
return this._transaction.delete(e._key), this;
|
|
5594
5614
|
}, t;
|
|
5595
5615
|
}();
|
|
@@ -5627,9 +5647,9 @@ function Nr(t, e) {
|
|
|
5627
5647
|
* `updateFunction `is returned here. Otherwise, if the transaction failed, a
|
|
5628
5648
|
* rejected promise with the corresponding failure error is returned.
|
|
5629
5649
|
*/
|
|
5630
|
-
function
|
|
5631
|
-
var n =
|
|
5632
|
-
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) {
|
|
5633
5653
|
return e(new Lr(t, n));
|
|
5634
5654
|
}), r).run(), r.promise
|
|
5635
5655
|
/**
|
|
@@ -5643,11 +5663,11 @@ function Rr(t, e) {
|
|
|
5643
5663
|
}
|
|
5644
5664
|
|
|
5645
5665
|
y = i + "_lite", o(new c("firestore/lite", (function(t, e) {
|
|
5646
|
-
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")));
|
|
5647
5667
|
return n && i._setSettings(n), i;
|
|
5648
5668
|
}), "PUBLIC")),
|
|
5649
5669
|
// RUNTIME_ENV and BUILD_TARGET are replaced by real values during the compilation
|
|
5650
|
-
a("firestore-lite", "3.4.
|
|
5670
|
+
a("firestore-lite", "3.4.5-2022116201138", ""), a("firestore-lite", "3.4.5-2022116201138", "esm5");
|
|
5651
5671
|
|
|
5652
|
-
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 };
|
|
5653
5673
|
//# sourceMappingURL=index.browser.esm5.js.map
|