@firebase/firestore 3.4.9 → 3.4.10-canary.ebc17e27f
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 +14 -0
- package/dist/firestore/src/api/transaction.d.ts +2 -0
- package/dist/firestore/src/core/component_provider.d.ts +11 -6
- package/dist/firestore/src/lite-api/transaction.d.ts +2 -0
- package/dist/firestore/src/local/document_overlay_cache.d.ts +5 -0
- package/dist/firestore/src/local/index_backfiller.d.ts +44 -0
- package/dist/firestore/src/local/index_manager.d.ts +2 -0
- package/dist/firestore/src/local/indexeddb_document_overlay_cache.d.ts +1 -0
- package/dist/firestore/src/local/indexeddb_index_manager.d.ts +1 -0
- package/dist/firestore/src/local/indexeddb_schema.d.ts +3 -2
- package/dist/firestore/src/local/indexeddb_schema_converter.d.ts +1 -0
- package/dist/firestore/src/local/indexeddb_sentinels.d.ts +1 -0
- package/dist/firestore/src/local/local_documents_view.d.ts +64 -9
- package/dist/firestore/src/local/local_store.d.ts +9 -0
- package/dist/firestore/src/local/lru_garbage_collector_impl.d.ts +5 -5
- package/dist/firestore/src/local/memory_document_overlay_cache.d.ts +1 -0
- package/dist/firestore/src/local/memory_index_manager.d.ts +1 -0
- package/dist/firestore/src/local/overlayed_document.d.ts +36 -0
- package/dist/firestore/src/local/persistence.d.ts +3 -5
- package/dist/firestore/src/local/persistence_promise.d.ts +11 -0
- package/dist/firestore/src/local/query_engine.d.ts +1 -1
- package/dist/firestore/src/model/collections.d.ts +8 -2
- package/dist/firestore/src/model/field_mask.d.ts +6 -0
- package/dist/firestore/src/model/mutation.d.ts +19 -1
- package/dist/firestore/src/model/mutation_batch.d.ts +8 -4
- package/dist/firestore/src/tsdoc-metadata.json +11 -11
- package/dist/firestore/src/util/async_queue.d.ts +5 -1
- package/dist/firestore/test/unit/local/index_backfiller.test.d.ts +17 -0
- package/dist/firestore/test/unit/local/test_document_overlay_cache.d.ts +1 -0
- package/dist/firestore/test/unit/specs/spec_test_components.d.ts +5 -3
- package/dist/firestore/test/util/helpers.d.ts +13 -0
- package/dist/index.d.ts +4 -2
- package/dist/index.esm2017.js +10689 -10296
- package/dist/index.esm2017.js.map +1 -1
- package/dist/index.esm5.js +9353 -8844
- package/dist/index.esm5.js.map +1 -1
- package/dist/index.node.cjs.js +6738 -6123
- package/dist/index.node.cjs.js.map +1 -1
- package/dist/index.node.mjs +6738 -6123
- package/dist/index.node.mjs.map +1 -1
- package/dist/index.rn.js +9818 -9424
- package/dist/index.rn.js.map +1 -1
- package/dist/internal.d.ts +6137 -5964
- package/dist/lite/firestore/src/api/transaction.d.ts +2 -0
- package/dist/lite/firestore/src/core/component_provider.d.ts +11 -6
- package/dist/lite/firestore/src/lite-api/transaction.d.ts +2 -0
- package/dist/lite/firestore/src/local/document_overlay_cache.d.ts +5 -0
- package/dist/lite/firestore/src/local/index_backfiller.d.ts +44 -0
- package/dist/lite/firestore/src/local/index_manager.d.ts +2 -0
- package/dist/lite/firestore/src/local/indexeddb_document_overlay_cache.d.ts +1 -0
- package/dist/lite/firestore/src/local/indexeddb_index_manager.d.ts +1 -0
- package/dist/lite/firestore/src/local/indexeddb_schema.d.ts +3 -2
- package/dist/lite/firestore/src/local/indexeddb_schema_converter.d.ts +1 -0
- package/dist/lite/firestore/src/local/indexeddb_sentinels.d.ts +1 -0
- package/dist/lite/firestore/src/local/local_documents_view.d.ts +64 -9
- package/dist/lite/firestore/src/local/local_store.d.ts +9 -0
- package/dist/lite/firestore/src/local/lru_garbage_collector_impl.d.ts +5 -5
- package/dist/lite/firestore/src/local/memory_document_overlay_cache.d.ts +1 -0
- package/dist/lite/firestore/src/local/memory_index_manager.d.ts +1 -0
- package/dist/lite/firestore/src/local/overlayed_document.d.ts +36 -0
- package/dist/lite/firestore/src/local/persistence.d.ts +3 -5
- package/dist/lite/firestore/src/local/persistence_promise.d.ts +11 -0
- package/dist/lite/firestore/src/local/query_engine.d.ts +1 -1
- package/dist/lite/firestore/src/model/collections.d.ts +8 -2
- package/dist/lite/firestore/src/model/field_mask.d.ts +6 -0
- package/dist/lite/firestore/src/model/mutation.d.ts +19 -1
- package/dist/lite/firestore/src/model/mutation_batch.d.ts +8 -4
- package/dist/lite/firestore/src/util/async_queue.d.ts +5 -1
- package/dist/lite/firestore/test/unit/local/index_backfiller.test.d.ts +17 -0
- package/dist/lite/firestore/test/unit/local/test_document_overlay_cache.d.ts +1 -0
- package/dist/lite/firestore/test/unit/specs/spec_test_components.d.ts +5 -3
- package/dist/lite/firestore/test/util/helpers.d.ts +13 -0
- package/dist/lite/index.browser.esm2017.js +1220 -738
- package/dist/lite/index.browser.esm2017.js.map +1 -1
- package/dist/lite/index.browser.esm5.js +1156 -764
- package/dist/lite/index.browser.esm5.js.map +1 -1
- package/dist/lite/index.d.ts +2 -0
- package/dist/lite/index.node.cjs.js +655 -2
- package/dist/lite/index.node.cjs.js.map +1 -1
- package/dist/lite/index.node.mjs +655 -2
- package/dist/lite/index.node.mjs.map +1 -1
- package/dist/lite/index.rn.esm2017.js +1184 -702
- package/dist/lite/index.rn.esm2017.js.map +1 -1
- package/dist/lite/internal.d.ts +2916 -2898
- package/dist/lite/packages/firestore/dist/lite/index.browser.esm2017.d.ts +106 -104
- package/dist/lite/packages/firestore/src/api/transaction.d.ts +2 -0
- package/dist/lite/packages/firestore/src/core/component_provider.d.ts +11 -6
- package/dist/lite/packages/firestore/src/lite-api/transaction.d.ts +2 -0
- package/dist/lite/packages/firestore/src/local/document_overlay_cache.d.ts +5 -0
- package/dist/lite/packages/firestore/src/local/index_backfiller.d.ts +44 -0
- package/dist/lite/packages/firestore/src/local/index_manager.d.ts +2 -0
- package/dist/lite/packages/firestore/src/local/indexeddb_document_overlay_cache.d.ts +1 -0
- package/dist/lite/packages/firestore/src/local/indexeddb_index_manager.d.ts +1 -0
- package/dist/lite/packages/firestore/src/local/indexeddb_schema.d.ts +3 -2
- package/dist/lite/packages/firestore/src/local/indexeddb_schema_converter.d.ts +1 -0
- package/dist/lite/packages/firestore/src/local/indexeddb_sentinels.d.ts +1 -0
- package/dist/lite/packages/firestore/src/local/local_documents_view.d.ts +64 -9
- package/dist/lite/packages/firestore/src/local/local_store.d.ts +9 -0
- package/dist/lite/packages/firestore/src/local/lru_garbage_collector_impl.d.ts +5 -5
- package/dist/lite/packages/firestore/src/local/memory_document_overlay_cache.d.ts +1 -0
- package/dist/lite/packages/firestore/src/local/memory_index_manager.d.ts +1 -0
- package/dist/lite/packages/firestore/src/local/overlayed_document.d.ts +36 -0
- package/dist/lite/packages/firestore/src/local/persistence.d.ts +3 -5
- package/dist/lite/packages/firestore/src/local/persistence_promise.d.ts +11 -0
- package/dist/lite/packages/firestore/src/local/query_engine.d.ts +1 -1
- package/dist/lite/packages/firestore/src/model/collections.d.ts +8 -2
- package/dist/lite/packages/firestore/src/model/field_mask.d.ts +6 -0
- package/dist/lite/packages/firestore/src/model/mutation.d.ts +19 -1
- package/dist/lite/packages/firestore/src/model/mutation_batch.d.ts +8 -4
- package/dist/lite/packages/firestore/src/util/async_queue.d.ts +5 -1
- package/dist/lite/packages/firestore/test/unit/local/index_backfiller.test.d.ts +17 -0
- package/dist/lite/packages/firestore/test/unit/local/test_document_overlay_cache.d.ts +1 -0
- package/dist/lite/packages/firestore/test/unit/specs/spec_test_components.d.ts +5 -3
- package/dist/lite/packages/firestore/test/util/helpers.d.ts +13 -0
- package/dist/lite/private.d.ts +2776 -2758
- package/dist/packages/firestore/dist/index.esm2017.d.ts +203 -201
- package/dist/packages/firestore/src/api/transaction.d.ts +2 -0
- package/dist/packages/firestore/src/core/component_provider.d.ts +11 -6
- package/dist/packages/firestore/src/lite-api/transaction.d.ts +2 -0
- package/dist/packages/firestore/src/local/document_overlay_cache.d.ts +5 -0
- package/dist/packages/firestore/src/local/index_backfiller.d.ts +44 -0
- package/dist/packages/firestore/src/local/index_manager.d.ts +2 -0
- package/dist/packages/firestore/src/local/indexeddb_document_overlay_cache.d.ts +1 -0
- package/dist/packages/firestore/src/local/indexeddb_index_manager.d.ts +1 -0
- package/dist/packages/firestore/src/local/indexeddb_schema.d.ts +3 -2
- package/dist/packages/firestore/src/local/indexeddb_schema_converter.d.ts +1 -0
- package/dist/packages/firestore/src/local/indexeddb_sentinels.d.ts +1 -0
- package/dist/packages/firestore/src/local/local_documents_view.d.ts +64 -9
- package/dist/packages/firestore/src/local/local_store.d.ts +9 -0
- package/dist/packages/firestore/src/local/lru_garbage_collector_impl.d.ts +5 -5
- package/dist/packages/firestore/src/local/memory_document_overlay_cache.d.ts +1 -0
- package/dist/packages/firestore/src/local/memory_index_manager.d.ts +1 -0
- package/dist/packages/firestore/src/local/overlayed_document.d.ts +36 -0
- package/dist/packages/firestore/src/local/persistence.d.ts +3 -5
- package/dist/packages/firestore/src/local/persistence_promise.d.ts +11 -0
- package/dist/packages/firestore/src/local/query_engine.d.ts +1 -1
- package/dist/packages/firestore/src/model/collections.d.ts +8 -2
- package/dist/packages/firestore/src/model/field_mask.d.ts +6 -0
- package/dist/packages/firestore/src/model/mutation.d.ts +19 -1
- package/dist/packages/firestore/src/model/mutation_batch.d.ts +8 -4
- package/dist/packages/firestore/src/util/async_queue.d.ts +5 -1
- package/dist/packages/firestore/test/unit/local/index_backfiller.test.d.ts +17 -0
- package/dist/packages/firestore/test/unit/local/test_document_overlay_cache.d.ts +1 -0
- package/dist/packages/firestore/test/unit/specs/spec_test_components.d.ts +5 -3
- package/dist/packages/firestore/test/util/helpers.d.ts +13 -0
- package/dist/private.d.ts +5845 -5672
- package/package.json +19 -17
|
@@ -27,7 +27,7 @@ import { FirebaseError as h, getModularInstance as p, createMockUserToken as d }
|
|
|
27
27
|
/**
|
|
28
28
|
* Simple wrapper around a nullable UID. Mostly exists to make code more
|
|
29
29
|
* readable.
|
|
30
|
-
*/ var
|
|
30
|
+
*/ var y = /** @class */ function() {
|
|
31
31
|
function t(t) {
|
|
32
32
|
this.uid = t;
|
|
33
33
|
}
|
|
@@ -45,11 +45,11 @@ import { FirebaseError as h, getModularInstance as p, createMockUserToken as d }
|
|
|
45
45
|
}, t;
|
|
46
46
|
}();
|
|
47
47
|
|
|
48
|
-
/** A user with a null UID. */
|
|
48
|
+
/** A user with a null UID. */ y.UNAUTHENTICATED = new y(null),
|
|
49
49
|
// TODO(mikelehen): Look into getting a proper uid-equivalent for
|
|
50
50
|
// non-FirebaseAuth providers.
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
y.GOOGLE_CREDENTIALS = new y("google-credentials-uid"), y.FIRST_PARTY = new y("first-party-uid"),
|
|
52
|
+
y.MOCK_USER = new y("mock-user");
|
|
53
53
|
|
|
54
54
|
/**
|
|
55
55
|
* @license
|
|
@@ -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
|
|
70
|
+
var m = "9.8.3-canary.ebc17e27f", v = new l("@firebase/firestore");
|
|
71
71
|
|
|
72
72
|
/**
|
|
73
73
|
* @license
|
|
@@ -106,7 +106,7 @@ function w(t) {
|
|
|
106
106
|
for (var e = [], n = 1; n < arguments.length; n++) e[n - 1] = arguments[n];
|
|
107
107
|
if (v.logLevel <= f.DEBUG) {
|
|
108
108
|
var i = e.map(T);
|
|
109
|
-
v.debug.apply(v, r([ "Firestore (" +
|
|
109
|
+
v.debug.apply(v, r([ "Firestore (" + m + "): " + t ], i));
|
|
110
110
|
}
|
|
111
111
|
}
|
|
112
112
|
|
|
@@ -114,7 +114,7 @@ function b(t) {
|
|
|
114
114
|
for (var e = [], n = 1; n < arguments.length; n++) e[n - 1] = arguments[n];
|
|
115
115
|
if (v.logLevel <= f.ERROR) {
|
|
116
116
|
var i = e.map(T);
|
|
117
|
-
v.error.apply(v, r([ "Firestore (" +
|
|
117
|
+
v.error.apply(v, r([ "Firestore (" + m + "): " + t ], i));
|
|
118
118
|
}
|
|
119
119
|
}
|
|
120
120
|
|
|
@@ -124,7 +124,7 @@ function b(t) {
|
|
|
124
124
|
for (var e = [], n = 1; n < arguments.length; n++) e[n - 1] = arguments[n];
|
|
125
125
|
if (v.logLevel <= f.WARN) {
|
|
126
126
|
var i = e.map(T);
|
|
127
|
-
v.warn.apply(v, r([ "Firestore (" +
|
|
127
|
+
v.warn.apply(v, r([ "Firestore (" + m + "): " + t ], i));
|
|
128
128
|
}
|
|
129
129
|
}
|
|
130
130
|
|
|
@@ -180,11 +180,11 @@ function b(t) {
|
|
|
180
180
|
* Returns `never` and can be used in expressions:
|
|
181
181
|
* @example
|
|
182
182
|
* let futureVar = fail('not implemented yet');
|
|
183
|
-
*/ function
|
|
183
|
+
*/ function E(t) {
|
|
184
184
|
void 0 === t && (t = "Unexpected state");
|
|
185
185
|
// Log the failure in addition to throw an exception, just in case the
|
|
186
186
|
// exception is swallowed.
|
|
187
|
-
var e = "FIRESTORE (" +
|
|
187
|
+
var e = "FIRESTORE (" + m + ") INTERNAL ASSERTION FAILED: " + t;
|
|
188
188
|
// NOTE: We don't use FirestoreError here because these are internal failures
|
|
189
189
|
// that cannot be handled by the user. (Also it would create a circular
|
|
190
190
|
// dependency between the error and assert modules which doesn't work.)
|
|
@@ -197,14 +197,14 @@ function b(t) {
|
|
|
197
197
|
*/;
|
|
198
198
|
}
|
|
199
199
|
|
|
200
|
-
function
|
|
201
|
-
t ||
|
|
200
|
+
function S(t, e) {
|
|
201
|
+
t || E();
|
|
202
202
|
}
|
|
203
203
|
|
|
204
204
|
/**
|
|
205
205
|
* Casts `obj` to `T`. In non-production builds, verifies that `obj` is an
|
|
206
206
|
* instance of `T` before casting.
|
|
207
|
-
*/ function
|
|
207
|
+
*/ function k(t,
|
|
208
208
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
209
209
|
e) {
|
|
210
210
|
return t;
|
|
@@ -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 I = "cancelled",
|
|
228
|
+
*/ var I = "cancelled", A = "unknown", V = "invalid-argument", D = "deadline-exceeded", P = "not-found", N = "permission-denied", F = "unauthenticated", O = "resource-exhausted", q = "failed-precondition", R = "aborted", x = "out-of-range", C = "unimplemented", L = "internal", j = "unavailable", M = /** @class */ function(e) {
|
|
229
229
|
/** @hideconstructor */
|
|
230
230
|
function n(
|
|
231
231
|
/**
|
|
@@ -253,17 +253,17 @@ e) {
|
|
|
253
253
|
}));
|
|
254
254
|
}, B = function(t, e) {
|
|
255
255
|
this.user = e, this.type = "OAuth", this.headers = new Map, this.headers.set("Authorization", "Bearer " + t);
|
|
256
|
-
},
|
|
256
|
+
}, z = /** @class */ function() {
|
|
257
257
|
function t() {}
|
|
258
258
|
return t.prototype.getToken = function() {
|
|
259
259
|
return Promise.resolve(null);
|
|
260
260
|
}, t.prototype.invalidateToken = function() {}, t.prototype.start = function(t, e) {
|
|
261
261
|
// Fire with initial user.
|
|
262
262
|
t.enqueueRetryable((function() {
|
|
263
|
-
return e(
|
|
263
|
+
return e(y.UNAUTHENTICATED);
|
|
264
264
|
}));
|
|
265
265
|
}, t.prototype.shutdown = function() {}, t;
|
|
266
|
-
}(),
|
|
266
|
+
}(), G = /** @class */ function() {
|
|
267
267
|
function t(t) {
|
|
268
268
|
this.token = t,
|
|
269
269
|
/**
|
|
@@ -285,7 +285,7 @@ e) {
|
|
|
285
285
|
}, t.prototype.shutdown = function() {
|
|
286
286
|
this.changeListener = null;
|
|
287
287
|
}, t;
|
|
288
|
-
}(),
|
|
288
|
+
}(), K = /** @class */ function() {
|
|
289
289
|
function t(t) {
|
|
290
290
|
var e = this;
|
|
291
291
|
this.auth = null, t.onInit((function(t) {
|
|
@@ -295,28 +295,28 @@ e) {
|
|
|
295
295
|
return t.prototype.getToken = function() {
|
|
296
296
|
var t = this;
|
|
297
297
|
return this.auth ? this.auth.getToken().then((function(e) {
|
|
298
|
-
return e ? (
|
|
298
|
+
return e ? (S("string" == typeof e.accessToken), new B(e.accessToken, new y(t.auth.getUid()))) : null;
|
|
299
299
|
})) : Promise.resolve(null);
|
|
300
300
|
}, t.prototype.invalidateToken = function() {}, t.prototype.start = function(t, e) {},
|
|
301
301
|
t.prototype.shutdown = function() {}, t;
|
|
302
|
-
}(),
|
|
303
|
-
this.type = "FirstParty", this.user =
|
|
302
|
+
}(), Q = function(t, e, n) {
|
|
303
|
+
this.type = "FirstParty", this.user = y.FIRST_PARTY, this.headers = new Map, this.headers.set("X-Goog-AuthUser", e);
|
|
304
304
|
var r = t.auth.getAuthHeaderValueForFirstParty([]);
|
|
305
305
|
r && this.headers.set("Authorization", r), n && this.headers.set("X-Goog-Iam-Authorization-Token", n);
|
|
306
|
-
},
|
|
306
|
+
}, W = /** @class */ function() {
|
|
307
307
|
function t(t, e, n) {
|
|
308
308
|
this.t = t, this.i = e, this.o = n;
|
|
309
309
|
}
|
|
310
310
|
return t.prototype.getToken = function() {
|
|
311
|
-
return Promise.resolve(new
|
|
311
|
+
return Promise.resolve(new Q(this.t, this.i, this.o));
|
|
312
312
|
}, t.prototype.start = function(t, e) {
|
|
313
313
|
// Fire with initial uid.
|
|
314
314
|
t.enqueueRetryable((function() {
|
|
315
|
-
return e(
|
|
315
|
+
return e(y.FIRST_PARTY);
|
|
316
316
|
}));
|
|
317
317
|
}, t.prototype.shutdown = function() {}, t.prototype.invalidateToken = function() {},
|
|
318
318
|
t;
|
|
319
|
-
}(),
|
|
319
|
+
}(), H = function(t) {
|
|
320
320
|
this.value = t, this.type = "AppCheck", this.headers = new Map, t && t.length > 0 && this.headers.set("x-firebase-appcheck", this.value);
|
|
321
321
|
}, Y = /** @class */ function() {
|
|
322
322
|
function t(t) {
|
|
@@ -327,7 +327,7 @@ e) {
|
|
|
327
327
|
}
|
|
328
328
|
return t.prototype.getToken = function() {
|
|
329
329
|
return this.appCheck ? this.appCheck.getToken().then((function(t) {
|
|
330
|
-
return t ? (
|
|
330
|
+
return t ? (S("string" == typeof t.token), new H(t.token)) : null;
|
|
331
331
|
})) : Promise.resolve(null);
|
|
332
332
|
}, t.prototype.invalidateToken = function() {}, t.prototype.start = function(t, e) {},
|
|
333
333
|
t.prototype.shutdown = function() {}, t;
|
|
@@ -369,7 +369,7 @@ function(t, e, n, r, i, o, a, s) {
|
|
|
369
369
|
}, t;
|
|
370
370
|
}(), J = /** @class */ function() {
|
|
371
371
|
function t(t, e, n) {
|
|
372
|
-
void 0 === e ? e = 0 : e > t.length &&
|
|
372
|
+
void 0 === e ? e = 0 : e > t.length && E(), void 0 === n ? n = t.length - e : n > t.length - e && E(),
|
|
373
373
|
this.segments = t, this.offset = e, this.len = n;
|
|
374
374
|
}
|
|
375
375
|
return Object.defineProperty(t.prototype, "length", {
|
|
@@ -620,7 +620,7 @@ function rt(t, e, n) {
|
|
|
620
620
|
}(t);
|
|
621
621
|
return e ? "a custom " + e + " object" : "an object";
|
|
622
622
|
}
|
|
623
|
-
return "function" == typeof t ? "a function" :
|
|
623
|
+
return "function" == typeof t ? "a function" : E();
|
|
624
624
|
}
|
|
625
625
|
|
|
626
626
|
function st(t,
|
|
@@ -733,7 +733,7 @@ function ut(t, e) {
|
|
|
733
733
|
* Code.UNKNOWN.
|
|
734
734
|
*/
|
|
735
735
|
function dt(t) {
|
|
736
|
-
if (void 0 === t) return b("RPC_ERROR", "HTTP error has no status"),
|
|
736
|
+
if (void 0 === t) return b("RPC_ERROR", "HTTP error has no status"), A;
|
|
737
737
|
// The canonical error codes for Google APIs [1] specify mapping onto HTTP
|
|
738
738
|
// status codes but the mapping is not bijective. In each case of ambiguity
|
|
739
739
|
// this function chooses a primary error.
|
|
@@ -746,14 +746,14 @@ function dt(t) {
|
|
|
746
746
|
|
|
747
747
|
case 400:
|
|
748
748
|
// Bad Request
|
|
749
|
-
return
|
|
749
|
+
return q;
|
|
750
750
|
|
|
751
751
|
// Other possibilities based on the forward mapping
|
|
752
752
|
// return Code.INVALID_ARGUMENT;
|
|
753
753
|
// return Code.OUT_OF_RANGE;
|
|
754
754
|
case 401:
|
|
755
755
|
// Unauthorized
|
|
756
|
-
return
|
|
756
|
+
return F;
|
|
757
757
|
|
|
758
758
|
case 403:
|
|
759
759
|
// Forbidden
|
|
@@ -765,17 +765,17 @@ function dt(t) {
|
|
|
765
765
|
|
|
766
766
|
case 409:
|
|
767
767
|
// Conflict
|
|
768
|
-
return
|
|
768
|
+
return R;
|
|
769
769
|
|
|
770
770
|
// Other possibilities:
|
|
771
771
|
// return Code.ALREADY_EXISTS;
|
|
772
772
|
case 416:
|
|
773
773
|
// Range Not Satisfiable
|
|
774
|
-
return
|
|
774
|
+
return x;
|
|
775
775
|
|
|
776
776
|
case 429:
|
|
777
777
|
// Too Many Requests
|
|
778
|
-
return
|
|
778
|
+
return O;
|
|
779
779
|
|
|
780
780
|
case 499:
|
|
781
781
|
// Client Closed Request
|
|
@@ -783,25 +783,25 @@ function dt(t) {
|
|
|
783
783
|
|
|
784
784
|
case 500:
|
|
785
785
|
// Internal Server Error
|
|
786
|
-
return
|
|
786
|
+
return A;
|
|
787
787
|
|
|
788
788
|
// Other possibilities:
|
|
789
789
|
// return Code.INTERNAL;
|
|
790
790
|
// return Code.DATA_LOSS;
|
|
791
791
|
case 501:
|
|
792
792
|
// Unimplemented
|
|
793
|
-
return
|
|
793
|
+
return C;
|
|
794
794
|
|
|
795
795
|
case 503:
|
|
796
796
|
// Service Unavailable
|
|
797
|
-
return
|
|
797
|
+
return j;
|
|
798
798
|
|
|
799
799
|
case 504:
|
|
800
800
|
// Gateway Timeout
|
|
801
801
|
return D;
|
|
802
802
|
|
|
803
803
|
default:
|
|
804
|
-
return t >= 200 && t < 300 ? "ok" : t >= 400 && t < 500 ?
|
|
804
|
+
return t >= 200 && t < 300 ? "ok" : t >= 400 && t < 500 ? q : t >= 500 && t < 600 ? L : A;
|
|
805
805
|
}
|
|
806
806
|
}
|
|
807
807
|
|
|
@@ -833,20 +833,20 @@ ht[ht.FAILED_PRECONDITION = 9] = "FAILED_PRECONDITION", ht[ht.ABORTED = 10] = "A
|
|
|
833
833
|
ht[ht.OUT_OF_RANGE = 11] = "OUT_OF_RANGE", ht[ht.UNIMPLEMENTED = 12] = "UNIMPLEMENTED",
|
|
834
834
|
ht[ht.INTERNAL = 13] = "INTERNAL", ht[ht.UNAVAILABLE = 14] = "UNAVAILABLE", ht[ht.DATA_LOSS = 15] = "DATA_LOSS";
|
|
835
835
|
|
|
836
|
-
var
|
|
836
|
+
var yt = /** @class */ function(r) {
|
|
837
837
|
/**
|
|
838
838
|
* @param databaseInfo - The connection info.
|
|
839
839
|
* @param fetchImpl - `fetch` or a Polyfill that implements the fetch API.
|
|
840
840
|
*/
|
|
841
841
|
function i(t, e) {
|
|
842
842
|
var n = this;
|
|
843
|
-
return (n = r.call(this, t) || this).
|
|
843
|
+
return (n = r.call(this, t) || this).I = e, n;
|
|
844
844
|
}
|
|
845
845
|
/**
|
|
846
846
|
* Base class for all Rest-based connections to the backend (WebChannel and
|
|
847
847
|
* HTTP).
|
|
848
848
|
*/
|
|
849
|
-
return t(i, r), i.prototype.
|
|
849
|
+
return t(i, r), i.prototype.A = function(t, e) {
|
|
850
850
|
throw new Error("Not supported by FetchConnection");
|
|
851
851
|
}, i.prototype.v = function(t, r, i, o) {
|
|
852
852
|
return e(this, void 0, void 0, (function() {
|
|
@@ -857,7 +857,7 @@ var mt = /** @class */ function(r) {
|
|
|
857
857
|
t = JSON.stringify(o), n.label = 1;
|
|
858
858
|
|
|
859
859
|
case 1:
|
|
860
|
-
return n.trys.push([ 1, 3, , 4 ]), [ 4 /*yield*/ , this.
|
|
860
|
+
return n.trys.push([ 1, 3, , 4 ]), [ 4 /*yield*/ , this.I(r, {
|
|
861
861
|
method: "POST",
|
|
862
862
|
headers: i,
|
|
863
863
|
body: t
|
|
@@ -902,7 +902,7 @@ var mt = /** @class */ function(r) {
|
|
|
902
902
|
* present and any additional headers for the request.
|
|
903
903
|
*/
|
|
904
904
|
t.prototype.g = function(t, e, n) {
|
|
905
|
-
t["X-Goog-Api-Client"] = "gl-js/ fire/" +
|
|
905
|
+
t["X-Goog-Api-Client"] = "gl-js/ fire/" + m,
|
|
906
906
|
// Content-Type: text/plain will avoid preflight requests which might
|
|
907
907
|
// mess with CORS and redirects by proxies. If we add custom headers
|
|
908
908
|
// we will need to change this code to potentially use the $httpOverwrite
|
|
@@ -956,7 +956,7 @@ var mt = /** @class */ function(r) {
|
|
|
956
956
|
* Generates `nBytes` of random bytes.
|
|
957
957
|
*
|
|
958
958
|
* If `nBytes < 0` , an error will be thrown.
|
|
959
|
-
*/ function
|
|
959
|
+
*/ function mt(t) {
|
|
960
960
|
// Polyfills for IE and WebWorker by using `self` and `msCrypto` when `crypto` is not available.
|
|
961
961
|
var e =
|
|
962
962
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -989,7 +989,7 @@ var mt = /** @class */ function(r) {
|
|
|
989
989
|
// Alphanumeric characters
|
|
990
990
|
var t = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", e = Math.floor(256 / t.length) * t.length, n = ""
|
|
991
991
|
// The largest byte value that is a multiple of `char.length`.
|
|
992
|
-
; n.length < 20; ) for (var r =
|
|
992
|
+
; n.length < 20; ) for (var r = mt(40), i = 0; i < r.length; ++i)
|
|
993
993
|
// Only accept values that are [0, maxMultiple), this ensures they can
|
|
994
994
|
// be evenly mapped to indices of `chars` via a modulo operation.
|
|
995
995
|
n.length < 20 && r[i] < e && (n += t.charAt(r[i] % t.length));
|
|
@@ -1218,13 +1218,13 @@ function Tt(t) {
|
|
|
1218
1218
|
return e;
|
|
1219
1219
|
}
|
|
1220
1220
|
|
|
1221
|
-
function
|
|
1221
|
+
function Et(t, e) {
|
|
1222
1222
|
for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && e(n, t[n]);
|
|
1223
1223
|
}
|
|
1224
1224
|
|
|
1225
1225
|
/**
|
|
1226
1226
|
* @license
|
|
1227
|
-
* Copyright
|
|
1227
|
+
* Copyright 2017 Google LLC
|
|
1228
1228
|
*
|
|
1229
1229
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1230
1230
|
* you may not use this file except in compliance with the License.
|
|
@@ -1238,29 +1238,451 @@ function St(t, e) {
|
|
|
1238
1238
|
* See the License for the specific language governing permissions and
|
|
1239
1239
|
* limitations under the License.
|
|
1240
1240
|
*/
|
|
1241
|
+
// An immutable sorted map implementation, based on a Left-leaning Red-Black
|
|
1242
|
+
// tree.
|
|
1243
|
+
var St = /** @class */ function() {
|
|
1244
|
+
function t(t, e) {
|
|
1245
|
+
this.comparator = t, this.root = e || It.EMPTY;
|
|
1246
|
+
}
|
|
1247
|
+
// Returns a copy of the map, with the specified key/value added or replaced.
|
|
1248
|
+
return t.prototype.insert = function(e, n) {
|
|
1249
|
+
return new t(this.comparator, this.root.insert(e, n, this.comparator).copy(null, null, It.BLACK, null, null));
|
|
1250
|
+
},
|
|
1251
|
+
// Returns a copy of the map, with the specified key removed.
|
|
1252
|
+
t.prototype.remove = function(e) {
|
|
1253
|
+
return new t(this.comparator, this.root.remove(e, this.comparator).copy(null, null, It.BLACK, null, null));
|
|
1254
|
+
},
|
|
1255
|
+
// Returns the value of the node with the given key, or null.
|
|
1256
|
+
t.prototype.get = function(t) {
|
|
1257
|
+
for (var e = this.root; !e.isEmpty(); ) {
|
|
1258
|
+
var n = this.comparator(t, e.key);
|
|
1259
|
+
if (0 === n) return e.value;
|
|
1260
|
+
n < 0 ? e = e.left : n > 0 && (e = e.right);
|
|
1261
|
+
}
|
|
1262
|
+
return null;
|
|
1263
|
+
},
|
|
1264
|
+
// Returns the index of the element in this sorted map, or -1 if it doesn't
|
|
1265
|
+
// exist.
|
|
1266
|
+
t.prototype.indexOf = function(t) {
|
|
1267
|
+
for (
|
|
1268
|
+
// Number of nodes that were pruned when descending right
|
|
1269
|
+
var e = 0, n = this.root; !n.isEmpty(); ) {
|
|
1270
|
+
var r = this.comparator(t, n.key);
|
|
1271
|
+
if (0 === r) return e + n.left.size;
|
|
1272
|
+
r < 0 ? n = n.left : (
|
|
1273
|
+
// Count all nodes left of the node plus the node itself
|
|
1274
|
+
e += n.left.size + 1, n = n.right);
|
|
1275
|
+
}
|
|
1276
|
+
// Node not found
|
|
1277
|
+
return -1;
|
|
1278
|
+
}, t.prototype.isEmpty = function() {
|
|
1279
|
+
return this.root.isEmpty();
|
|
1280
|
+
}, Object.defineProperty(t.prototype, "size", {
|
|
1281
|
+
// Returns the total number of nodes in the map.
|
|
1282
|
+
get: function() {
|
|
1283
|
+
return this.root.size;
|
|
1284
|
+
},
|
|
1285
|
+
enumerable: !1,
|
|
1286
|
+
configurable: !0
|
|
1287
|
+
}),
|
|
1288
|
+
// Returns the minimum key in the map.
|
|
1289
|
+
t.prototype.minKey = function() {
|
|
1290
|
+
return this.root.minKey();
|
|
1291
|
+
},
|
|
1292
|
+
// Returns the maximum key in the map.
|
|
1293
|
+
t.prototype.maxKey = function() {
|
|
1294
|
+
return this.root.maxKey();
|
|
1295
|
+
},
|
|
1296
|
+
// Traverses the map in key order and calls the specified action function
|
|
1297
|
+
// for each key/value pair. If action returns true, traversal is aborted.
|
|
1298
|
+
// Returns the first truthy value returned by action, or the last falsey
|
|
1299
|
+
// value returned by action.
|
|
1300
|
+
t.prototype.inorderTraversal = function(t) {
|
|
1301
|
+
return this.root.inorderTraversal(t);
|
|
1302
|
+
}, t.prototype.forEach = function(t) {
|
|
1303
|
+
this.inorderTraversal((function(e, n) {
|
|
1304
|
+
return t(e, n), !1;
|
|
1305
|
+
}));
|
|
1306
|
+
}, t.prototype.toString = function() {
|
|
1307
|
+
var t = [];
|
|
1308
|
+
return this.inorderTraversal((function(e, n) {
|
|
1309
|
+
return t.push(e + ":" + n), !1;
|
|
1310
|
+
})), "{" + t.join(", ") + "}";
|
|
1311
|
+
},
|
|
1312
|
+
// Traverses the map in reverse key order and calls the specified action
|
|
1313
|
+
// function for each key/value pair. If action returns true, traversal is
|
|
1314
|
+
// aborted.
|
|
1315
|
+
// Returns the first truthy value returned by action, or the last falsey
|
|
1316
|
+
// value returned by action.
|
|
1317
|
+
t.prototype.reverseTraversal = function(t) {
|
|
1318
|
+
return this.root.reverseTraversal(t);
|
|
1319
|
+
},
|
|
1320
|
+
// Returns an iterator over the SortedMap.
|
|
1321
|
+
t.prototype.getIterator = function() {
|
|
1322
|
+
return new kt(this.root, null, this.comparator, !1);
|
|
1323
|
+
}, t.prototype.getIteratorFrom = function(t) {
|
|
1324
|
+
return new kt(this.root, t, this.comparator, !1);
|
|
1325
|
+
}, t.prototype.getReverseIterator = function() {
|
|
1326
|
+
return new kt(this.root, null, this.comparator, !0);
|
|
1327
|
+
}, t.prototype.getReverseIteratorFrom = function(t) {
|
|
1328
|
+
return new kt(this.root, t, this.comparator, !0);
|
|
1329
|
+
}, t;
|
|
1330
|
+
}(), kt = /** @class */ function() {
|
|
1331
|
+
function t(t, e, n, r) {
|
|
1332
|
+
this.isReverse = r, this.nodeStack = [];
|
|
1333
|
+
for (var i = 1; !t.isEmpty(); ) if (i = e ? n(t.key, e) : 1,
|
|
1334
|
+
// flip the comparison if we're going in reverse
|
|
1335
|
+
e && r && (i *= -1), i < 0)
|
|
1336
|
+
// This node is less than our start key. ignore it
|
|
1337
|
+
t = this.isReverse ? t.left : t.right; else {
|
|
1338
|
+
if (0 === i) {
|
|
1339
|
+
// This node is exactly equal to our start key. Push it on the stack,
|
|
1340
|
+
// but stop iterating;
|
|
1341
|
+
this.nodeStack.push(t);
|
|
1342
|
+
break;
|
|
1343
|
+
}
|
|
1344
|
+
// This node is greater than our start key, add it to the stack and move
|
|
1345
|
+
// to the next one
|
|
1346
|
+
this.nodeStack.push(t), t = this.isReverse ? t.right : t.left;
|
|
1347
|
+
}
|
|
1348
|
+
}
|
|
1349
|
+
return t.prototype.getNext = function() {
|
|
1350
|
+
var t = this.nodeStack.pop(), e = {
|
|
1351
|
+
key: t.key,
|
|
1352
|
+
value: t.value
|
|
1353
|
+
};
|
|
1354
|
+
if (this.isReverse) for (t = t.left; !t.isEmpty(); ) this.nodeStack.push(t), t = t.right; else for (t = t.right; !t.isEmpty(); ) this.nodeStack.push(t),
|
|
1355
|
+
t = t.left;
|
|
1356
|
+
return e;
|
|
1357
|
+
}, t.prototype.hasNext = function() {
|
|
1358
|
+
return this.nodeStack.length > 0;
|
|
1359
|
+
}, t.prototype.peek = function() {
|
|
1360
|
+
if (0 === this.nodeStack.length) return null;
|
|
1361
|
+
var t = this.nodeStack[this.nodeStack.length - 1];
|
|
1362
|
+
return {
|
|
1363
|
+
key: t.key,
|
|
1364
|
+
value: t.value
|
|
1365
|
+
};
|
|
1366
|
+
}, t;
|
|
1367
|
+
}(), It = /** @class */ function() {
|
|
1368
|
+
function t(e, n, r, i, o) {
|
|
1369
|
+
this.key = e, this.value = n, this.color = null != r ? r : t.RED, this.left = null != i ? i : t.EMPTY,
|
|
1370
|
+
this.right = null != o ? o : t.EMPTY, this.size = this.left.size + 1 + this.right.size;
|
|
1371
|
+
}
|
|
1372
|
+
// Returns a copy of the current node, optionally replacing pieces of it.
|
|
1373
|
+
return t.prototype.copy = function(e, n, r, i, o) {
|
|
1374
|
+
return new t(null != e ? e : this.key, null != n ? n : this.value, null != r ? r : this.color, null != i ? i : this.left, null != o ? o : this.right);
|
|
1375
|
+
}, t.prototype.isEmpty = function() {
|
|
1376
|
+
return !1;
|
|
1377
|
+
},
|
|
1378
|
+
// Traverses the tree in key order and calls the specified action function
|
|
1379
|
+
// for each node. If action returns true, traversal is aborted.
|
|
1380
|
+
// Returns the first truthy value returned by action, or the last falsey
|
|
1381
|
+
// value returned by action.
|
|
1382
|
+
t.prototype.inorderTraversal = function(t) {
|
|
1383
|
+
return this.left.inorderTraversal(t) || t(this.key, this.value) || this.right.inorderTraversal(t);
|
|
1384
|
+
},
|
|
1385
|
+
// Traverses the tree in reverse key order and calls the specified action
|
|
1386
|
+
// function for each node. If action returns true, traversal is aborted.
|
|
1387
|
+
// Returns the first truthy value returned by action, or the last falsey
|
|
1388
|
+
// value returned by action.
|
|
1389
|
+
t.prototype.reverseTraversal = function(t) {
|
|
1390
|
+
return this.right.reverseTraversal(t) || t(this.key, this.value) || this.left.reverseTraversal(t);
|
|
1391
|
+
},
|
|
1392
|
+
// Returns the minimum node in the tree.
|
|
1393
|
+
t.prototype.min = function() {
|
|
1394
|
+
return this.left.isEmpty() ? this : this.left.min();
|
|
1395
|
+
},
|
|
1396
|
+
// Returns the maximum key in the tree.
|
|
1397
|
+
t.prototype.minKey = function() {
|
|
1398
|
+
return this.min().key;
|
|
1399
|
+
},
|
|
1400
|
+
// Returns the maximum key in the tree.
|
|
1401
|
+
t.prototype.maxKey = function() {
|
|
1402
|
+
return this.right.isEmpty() ? this.key : this.right.maxKey();
|
|
1403
|
+
},
|
|
1404
|
+
// Returns new tree, with the key/value added.
|
|
1405
|
+
t.prototype.insert = function(t, e, n) {
|
|
1406
|
+
var r = this, i = n(t, r.key);
|
|
1407
|
+
return (r = i < 0 ? r.copy(null, null, null, r.left.insert(t, e, n), null) : 0 === i ? r.copy(null, e, null, null, null) : r.copy(null, null, null, null, r.right.insert(t, e, n))).fixUp();
|
|
1408
|
+
}, t.prototype.removeMin = function() {
|
|
1409
|
+
if (this.left.isEmpty()) return t.EMPTY;
|
|
1410
|
+
var e = this;
|
|
1411
|
+
return e.left.isRed() || e.left.left.isRed() || (e = e.moveRedLeft()), (e = e.copy(null, null, null, e.left.removeMin(), null)).fixUp();
|
|
1412
|
+
},
|
|
1413
|
+
// Returns new tree, with the specified item removed.
|
|
1414
|
+
t.prototype.remove = function(e, n) {
|
|
1415
|
+
var r, i = this;
|
|
1416
|
+
if (n(e, i.key) < 0) i.left.isEmpty() || i.left.isRed() || i.left.left.isRed() || (i = i.moveRedLeft()),
|
|
1417
|
+
i = i.copy(null, null, null, i.left.remove(e, n), null); else {
|
|
1418
|
+
if (i.left.isRed() && (i = i.rotateRight()), i.right.isEmpty() || i.right.isRed() || i.right.left.isRed() || (i = i.moveRedRight()),
|
|
1419
|
+
0 === n(e, i.key)) {
|
|
1420
|
+
if (i.right.isEmpty()) return t.EMPTY;
|
|
1421
|
+
r = i.right.min(), i = i.copy(r.key, r.value, null, null, i.right.removeMin());
|
|
1422
|
+
}
|
|
1423
|
+
i = i.copy(null, null, null, null, i.right.remove(e, n));
|
|
1424
|
+
}
|
|
1425
|
+
return i.fixUp();
|
|
1426
|
+
}, t.prototype.isRed = function() {
|
|
1427
|
+
return this.color;
|
|
1428
|
+
},
|
|
1429
|
+
// Returns new tree after performing any needed rotations.
|
|
1430
|
+
t.prototype.fixUp = function() {
|
|
1431
|
+
var t = this;
|
|
1432
|
+
return t.right.isRed() && !t.left.isRed() && (t = t.rotateLeft()), t.left.isRed() && t.left.left.isRed() && (t = t.rotateRight()),
|
|
1433
|
+
t.left.isRed() && t.right.isRed() && (t = t.colorFlip()), t;
|
|
1434
|
+
}, t.prototype.moveRedLeft = function() {
|
|
1435
|
+
var t = this.colorFlip();
|
|
1436
|
+
return t.right.left.isRed() && (t = (t = (t = t.copy(null, null, null, null, t.right.rotateRight())).rotateLeft()).colorFlip()),
|
|
1437
|
+
t;
|
|
1438
|
+
}, t.prototype.moveRedRight = function() {
|
|
1439
|
+
var t = this.colorFlip();
|
|
1440
|
+
return t.left.left.isRed() && (t = (t = t.rotateRight()).colorFlip()), t;
|
|
1441
|
+
}, t.prototype.rotateLeft = function() {
|
|
1442
|
+
var e = this.copy(null, null, t.RED, null, this.right.left);
|
|
1443
|
+
return this.right.copy(null, null, this.color, e, null);
|
|
1444
|
+
}, t.prototype.rotateRight = function() {
|
|
1445
|
+
var e = this.copy(null, null, t.RED, this.left.right, null);
|
|
1446
|
+
return this.left.copy(null, null, this.color, null, e);
|
|
1447
|
+
}, t.prototype.colorFlip = function() {
|
|
1448
|
+
var t = this.left.copy(null, null, !this.left.color, null, null), e = this.right.copy(null, null, !this.right.color, null, null);
|
|
1449
|
+
return this.copy(null, null, !this.color, t, e);
|
|
1450
|
+
},
|
|
1451
|
+
// For testing.
|
|
1452
|
+
t.prototype.checkMaxDepth = function() {
|
|
1453
|
+
var t = this.check();
|
|
1454
|
+
return Math.pow(2, t) <= this.size + 1;
|
|
1455
|
+
},
|
|
1456
|
+
// In a balanced RB tree, the black-depth (number of black nodes) from root to
|
|
1457
|
+
// leaves is equal on both sides. This function verifies that or asserts.
|
|
1458
|
+
t.prototype.check = function() {
|
|
1459
|
+
if (this.isRed() && this.left.isRed()) throw E();
|
|
1460
|
+
if (this.right.isRed()) throw E();
|
|
1461
|
+
var t = this.left.check();
|
|
1462
|
+
if (t !== this.right.check()) throw E();
|
|
1463
|
+
return t + (this.isRed() ? 0 : 1);
|
|
1464
|
+
}, t;
|
|
1465
|
+
}();
|
|
1466
|
+
|
|
1467
|
+
// end SortedMap
|
|
1468
|
+
// An iterator over an LLRBNode.
|
|
1469
|
+
// end LLRBNode
|
|
1470
|
+
// Empty node is shared between all LLRB trees.
|
|
1471
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1472
|
+
It.EMPTY = null, It.RED = !0, It.BLACK = !1,
|
|
1473
|
+
// end LLRBEmptyNode
|
|
1474
|
+
It.EMPTY = new (/** @class */ function() {
|
|
1475
|
+
function t() {
|
|
1476
|
+
this.size = 0;
|
|
1477
|
+
}
|
|
1478
|
+
return Object.defineProperty(t.prototype, "key", {
|
|
1479
|
+
get: function() {
|
|
1480
|
+
throw E();
|
|
1481
|
+
},
|
|
1482
|
+
enumerable: !1,
|
|
1483
|
+
configurable: !0
|
|
1484
|
+
}), Object.defineProperty(t.prototype, "value", {
|
|
1485
|
+
get: function() {
|
|
1486
|
+
throw E();
|
|
1487
|
+
},
|
|
1488
|
+
enumerable: !1,
|
|
1489
|
+
configurable: !0
|
|
1490
|
+
}), Object.defineProperty(t.prototype, "color", {
|
|
1491
|
+
get: function() {
|
|
1492
|
+
throw E();
|
|
1493
|
+
},
|
|
1494
|
+
enumerable: !1,
|
|
1495
|
+
configurable: !0
|
|
1496
|
+
}), Object.defineProperty(t.prototype, "left", {
|
|
1497
|
+
get: function() {
|
|
1498
|
+
throw E();
|
|
1499
|
+
},
|
|
1500
|
+
enumerable: !1,
|
|
1501
|
+
configurable: !0
|
|
1502
|
+
}), Object.defineProperty(t.prototype, "right", {
|
|
1503
|
+
get: function() {
|
|
1504
|
+
throw E();
|
|
1505
|
+
},
|
|
1506
|
+
enumerable: !1,
|
|
1507
|
+
configurable: !0
|
|
1508
|
+
}),
|
|
1509
|
+
// Returns a copy of the current node.
|
|
1510
|
+
t.prototype.copy = function(t, e, n, r, i) {
|
|
1511
|
+
return this;
|
|
1512
|
+
},
|
|
1513
|
+
// Returns a copy of the tree, with the specified key/value added.
|
|
1514
|
+
t.prototype.insert = function(t, e, n) {
|
|
1515
|
+
return new It(t, e);
|
|
1516
|
+
},
|
|
1517
|
+
// Returns a copy of the tree, with the specified key removed.
|
|
1518
|
+
t.prototype.remove = function(t, e) {
|
|
1519
|
+
return this;
|
|
1520
|
+
}, t.prototype.isEmpty = function() {
|
|
1521
|
+
return !0;
|
|
1522
|
+
}, t.prototype.inorderTraversal = function(t) {
|
|
1523
|
+
return !1;
|
|
1524
|
+
}, t.prototype.reverseTraversal = function(t) {
|
|
1525
|
+
return !1;
|
|
1526
|
+
}, t.prototype.minKey = function() {
|
|
1527
|
+
return null;
|
|
1528
|
+
}, t.prototype.maxKey = function() {
|
|
1529
|
+
return null;
|
|
1530
|
+
}, t.prototype.isRed = function() {
|
|
1531
|
+
return !1;
|
|
1532
|
+
},
|
|
1533
|
+
// For testing.
|
|
1534
|
+
t.prototype.checkMaxDepth = function() {
|
|
1535
|
+
return !0;
|
|
1536
|
+
}, t.prototype.check = function() {
|
|
1537
|
+
return 0;
|
|
1538
|
+
}, t;
|
|
1539
|
+
}());
|
|
1540
|
+
|
|
1241
1541
|
/**
|
|
1242
|
-
*
|
|
1243
|
-
*
|
|
1244
|
-
*
|
|
1245
|
-
*
|
|
1246
|
-
*
|
|
1247
|
-
*
|
|
1248
|
-
*
|
|
1249
|
-
*
|
|
1250
|
-
|
|
1542
|
+
* @license
|
|
1543
|
+
* Copyright 2017 Google LLC
|
|
1544
|
+
*
|
|
1545
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1546
|
+
* you may not use this file except in compliance with the License.
|
|
1547
|
+
* You may obtain a copy of the License at
|
|
1548
|
+
*
|
|
1549
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1550
|
+
*
|
|
1551
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
1552
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1553
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1554
|
+
* See the License for the specific language governing permissions and
|
|
1555
|
+
* limitations under the License.
|
|
1556
|
+
*/
|
|
1557
|
+
/**
|
|
1558
|
+
* SortedSet is an immutable (copy-on-write) collection that holds elements
|
|
1559
|
+
* in order specified by the provided comparator.
|
|
1560
|
+
*
|
|
1561
|
+
* NOTE: if provided comparator returns 0 for two elements, we consider them to
|
|
1562
|
+
* be equal!
|
|
1563
|
+
*/
|
|
1564
|
+
var At = /** @class */ function() {
|
|
1565
|
+
function t(t) {
|
|
1566
|
+
this.comparator = t, this.data = new St(this.comparator);
|
|
1567
|
+
}
|
|
1568
|
+
return t.prototype.has = function(t) {
|
|
1569
|
+
return null !== this.data.get(t);
|
|
1570
|
+
}, t.prototype.first = function() {
|
|
1571
|
+
return this.data.minKey();
|
|
1572
|
+
}, t.prototype.last = function() {
|
|
1573
|
+
return this.data.maxKey();
|
|
1574
|
+
}, Object.defineProperty(t.prototype, "size", {
|
|
1575
|
+
get: function() {
|
|
1576
|
+
return this.data.size;
|
|
1577
|
+
},
|
|
1578
|
+
enumerable: !1,
|
|
1579
|
+
configurable: !0
|
|
1580
|
+
}), t.prototype.indexOf = function(t) {
|
|
1581
|
+
return this.data.indexOf(t);
|
|
1582
|
+
},
|
|
1583
|
+
/** Iterates elements in order defined by "comparator" */ t.prototype.forEach = function(t) {
|
|
1584
|
+
this.data.inorderTraversal((function(e, n) {
|
|
1585
|
+
return t(e), !1;
|
|
1586
|
+
}));
|
|
1587
|
+
},
|
|
1588
|
+
/** Iterates over `elem`s such that: range[0] <= elem < range[1]. */ t.prototype.forEachInRange = function(t, e) {
|
|
1589
|
+
for (var n = this.data.getIteratorFrom(t[0]); n.hasNext(); ) {
|
|
1590
|
+
var r = n.getNext();
|
|
1591
|
+
if (this.comparator(r.key, t[1]) >= 0) return;
|
|
1592
|
+
e(r.key);
|
|
1593
|
+
}
|
|
1594
|
+
},
|
|
1595
|
+
/**
|
|
1596
|
+
* Iterates over `elem`s such that: start <= elem until false is returned.
|
|
1597
|
+
*/
|
|
1598
|
+
t.prototype.forEachWhile = function(t, e) {
|
|
1599
|
+
var n;
|
|
1600
|
+
for (n = void 0 !== e ? this.data.getIteratorFrom(e) : this.data.getIterator(); n.hasNext(); ) if (!t(n.getNext().key)) return;
|
|
1601
|
+
},
|
|
1602
|
+
/** Finds the least element greater than or equal to `elem`. */ t.prototype.firstAfterOrEqual = function(t) {
|
|
1603
|
+
var e = this.data.getIteratorFrom(t);
|
|
1604
|
+
return e.hasNext() ? e.getNext().key : null;
|
|
1605
|
+
}, t.prototype.getIterator = function() {
|
|
1606
|
+
return new Vt(this.data.getIterator());
|
|
1607
|
+
}, t.prototype.getIteratorFrom = function(t) {
|
|
1608
|
+
return new Vt(this.data.getIteratorFrom(t));
|
|
1609
|
+
},
|
|
1610
|
+
/** Inserts or updates an element */ t.prototype.add = function(t) {
|
|
1611
|
+
return this.copy(this.data.remove(t).insert(t, !0));
|
|
1612
|
+
},
|
|
1613
|
+
/** Deletes an element */ t.prototype.delete = function(t) {
|
|
1614
|
+
return this.has(t) ? this.copy(this.data.remove(t)) : this;
|
|
1615
|
+
}, t.prototype.isEmpty = function() {
|
|
1616
|
+
return this.data.isEmpty();
|
|
1617
|
+
}, t.prototype.unionWith = function(t) {
|
|
1618
|
+
var e = this;
|
|
1619
|
+
// Make sure `result` always refers to the larger one of the two sets.
|
|
1620
|
+
return e.size < t.size && (e = t, t = this), t.forEach((function(t) {
|
|
1621
|
+
e = e.add(t);
|
|
1622
|
+
})), e;
|
|
1623
|
+
}, t.prototype.isEqual = function(e) {
|
|
1624
|
+
if (!(e instanceof t)) return !1;
|
|
1625
|
+
if (this.size !== e.size) return !1;
|
|
1626
|
+
for (var n = this.data.getIterator(), r = e.data.getIterator(); n.hasNext(); ) {
|
|
1627
|
+
var i = n.getNext().key, o = r.getNext().key;
|
|
1628
|
+
if (0 !== this.comparator(i, o)) return !1;
|
|
1629
|
+
}
|
|
1630
|
+
return !0;
|
|
1631
|
+
}, t.prototype.toArray = function() {
|
|
1632
|
+
var t = [];
|
|
1633
|
+
return this.forEach((function(e) {
|
|
1634
|
+
t.push(e);
|
|
1635
|
+
})), t;
|
|
1636
|
+
}, t.prototype.toString = function() {
|
|
1637
|
+
var t = [];
|
|
1638
|
+
return this.forEach((function(e) {
|
|
1639
|
+
return t.push(e);
|
|
1640
|
+
})), "SortedSet(" + t.toString() + ")";
|
|
1641
|
+
}, t.prototype.copy = function(e) {
|
|
1642
|
+
var n = new t(this.comparator);
|
|
1643
|
+
return n.data = e, n;
|
|
1644
|
+
}, t;
|
|
1645
|
+
}(), Vt = /** @class */ function() {
|
|
1646
|
+
function t(t) {
|
|
1647
|
+
this.iter = t;
|
|
1648
|
+
}
|
|
1649
|
+
return t.prototype.getNext = function() {
|
|
1650
|
+
return this.iter.getNext().key;
|
|
1651
|
+
}, t.prototype.hasNext = function() {
|
|
1652
|
+
return this.iter.hasNext();
|
|
1653
|
+
}, t;
|
|
1654
|
+
}(), Dt = /** @class */ function() {
|
|
1251
1655
|
function t(t) {
|
|
1252
1656
|
this.fields = t,
|
|
1253
1657
|
// TODO(dimond): validation of FieldMask
|
|
1254
1658
|
// Sort the field mask to support `FieldMask.isEqual()` and assert below.
|
|
1255
|
-
t.sort(et.comparator)
|
|
1256
|
-
|
|
1659
|
+
t.sort(et.comparator);
|
|
1660
|
+
}
|
|
1661
|
+
return t.empty = function() {
|
|
1662
|
+
return new t([]);
|
|
1663
|
+
},
|
|
1664
|
+
/**
|
|
1665
|
+
* Returns a new FieldMask object that is the result of adding all the given
|
|
1666
|
+
* fields paths to this field mask.
|
|
1667
|
+
*/
|
|
1668
|
+
t.prototype.unionWith = function(e) {
|
|
1669
|
+
for (var n = new At(et.comparator), r = 0, i = this.fields; r < i.length; r++) {
|
|
1670
|
+
var o = i[r];
|
|
1671
|
+
n = n.add(o);
|
|
1672
|
+
}
|
|
1673
|
+
for (var a = 0, s = e; a < s.length; a++) {
|
|
1674
|
+
var u = s[a];
|
|
1675
|
+
n = n.add(u);
|
|
1676
|
+
}
|
|
1677
|
+
return new t(n.toArray());
|
|
1678
|
+
},
|
|
1679
|
+
/**
|
|
1257
1680
|
* Verifies that `fieldPath` is included by at least one field in this field
|
|
1258
1681
|
* mask.
|
|
1259
1682
|
*
|
|
1260
1683
|
* This is an O(n) operation, where `n` is the size of the field mask.
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
return t.prototype.covers = function(t) {
|
|
1684
|
+
*/
|
|
1685
|
+
t.prototype.covers = function(t) {
|
|
1264
1686
|
for (var e = 0, n = this.fields; e < n.length; e++) {
|
|
1265
1687
|
if (n[e].isPrefixOf(t)) return !0;
|
|
1266
1688
|
}
|
|
@@ -1270,7 +1692,7 @@ function St(t, e) {
|
|
|
1270
1692
|
return t.isEqual(e);
|
|
1271
1693
|
}));
|
|
1272
1694
|
}, t;
|
|
1273
|
-
}(),
|
|
1695
|
+
}(), Pt = /** @class */ function() {
|
|
1274
1696
|
function t(t) {
|
|
1275
1697
|
this.binaryString = t;
|
|
1276
1698
|
}
|
|
@@ -1318,64 +1740,23 @@ function St(t, e) {
|
|
|
1318
1740
|
}, t;
|
|
1319
1741
|
}();
|
|
1320
1742
|
|
|
1321
|
-
|
|
1322
|
-
* @license
|
|
1323
|
-
* Copyright 2020 Google LLC
|
|
1324
|
-
*
|
|
1325
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1326
|
-
* you may not use this file except in compliance with the License.
|
|
1327
|
-
* You may obtain a copy of the License at
|
|
1328
|
-
*
|
|
1329
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1330
|
-
*
|
|
1331
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1332
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1333
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1334
|
-
* See the License for the specific language governing permissions and
|
|
1335
|
-
* limitations under the License.
|
|
1336
|
-
*/
|
|
1337
|
-
/** Converts a Base64 encoded string to a binary string. */
|
|
1338
|
-
/**
|
|
1339
|
-
* @license
|
|
1340
|
-
* Copyright 2020 Google LLC
|
|
1341
|
-
*
|
|
1342
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1343
|
-
* you may not use this file except in compliance with the License.
|
|
1344
|
-
* You may obtain a copy of the License at
|
|
1345
|
-
*
|
|
1346
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1347
|
-
*
|
|
1348
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1349
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1350
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1351
|
-
* See the License for the specific language governing permissions and
|
|
1352
|
-
* limitations under the License.
|
|
1353
|
-
*/
|
|
1354
|
-
/**
|
|
1355
|
-
* Immutable class that represents a "proto" byte string.
|
|
1356
|
-
*
|
|
1357
|
-
* Proto byte strings can either be Base64-encoded strings or Uint8Arrays when
|
|
1358
|
-
* sent on the wire. This class abstracts away this differentiation by holding
|
|
1359
|
-
* the proto byte string in a common class that must be converted into a string
|
|
1360
|
-
* before being sent as a proto.
|
|
1361
|
-
* @internal
|
|
1362
|
-
*/ At.EMPTY_BYTE_STRING = new At("");
|
|
1743
|
+
Pt.EMPTY_BYTE_STRING = new Pt("");
|
|
1363
1744
|
|
|
1364
|
-
var
|
|
1745
|
+
var Nt = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
|
|
1365
1746
|
|
|
1366
1747
|
/**
|
|
1367
1748
|
* Converts the possible Proto values for a timestamp value into a "seconds and
|
|
1368
1749
|
* nanos" representation.
|
|
1369
|
-
*/ function
|
|
1750
|
+
*/ function Ft(t) {
|
|
1370
1751
|
// The json interface (for the browser) will return an iso timestamp string,
|
|
1371
1752
|
// while the proto js library (for node) will return a
|
|
1372
1753
|
// google.protobuf.Timestamp instance.
|
|
1373
|
-
if (
|
|
1754
|
+
if (S(!!t), "string" == typeof t) {
|
|
1374
1755
|
// The date string can have higher precision (nanos) than the Date class
|
|
1375
1756
|
// (millis), so we do some custom parsing here.
|
|
1376
1757
|
// Parse the nanos right out of the string.
|
|
1377
|
-
var e = 0, n =
|
|
1378
|
-
if (
|
|
1758
|
+
var e = 0, n = Nt.exec(t);
|
|
1759
|
+
if (S(!!n), n[1]) {
|
|
1379
1760
|
// Pad the fraction out to 9 digits (nanos).
|
|
1380
1761
|
var r = n[1];
|
|
1381
1762
|
r = (r + "000000000").substr(0, 9), e = Number(r);
|
|
@@ -1388,21 +1769,21 @@ var It = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
|
|
|
1388
1769
|
};
|
|
1389
1770
|
}
|
|
1390
1771
|
return {
|
|
1391
|
-
seconds:
|
|
1392
|
-
nanos:
|
|
1772
|
+
seconds: Ot(t.seconds),
|
|
1773
|
+
nanos: Ot(t.nanos)
|
|
1393
1774
|
};
|
|
1394
1775
|
}
|
|
1395
1776
|
|
|
1396
1777
|
/**
|
|
1397
1778
|
* Converts the possible Proto types for numbers into a JavaScript number.
|
|
1398
1779
|
* Returns 0 if the value is not numeric.
|
|
1399
|
-
*/ function
|
|
1780
|
+
*/ function Ot(t) {
|
|
1400
1781
|
// TODO(bjornick): Handle int64 greater than 53 bits.
|
|
1401
1782
|
return "number" == typeof t ? t : "string" == typeof t ? Number(t) : 0;
|
|
1402
1783
|
}
|
|
1403
1784
|
|
|
1404
|
-
/** Converts the possible Proto types for Blobs into a ByteString. */ function
|
|
1405
|
-
return "string" == typeof t ?
|
|
1785
|
+
/** Converts the possible Proto types for Blobs into a ByteString. */ function qt(t) {
|
|
1786
|
+
return "string" == typeof t ? Pt.fromBase64String(t) : Pt.fromUint8Array(t);
|
|
1406
1787
|
}
|
|
1407
1788
|
|
|
1408
1789
|
/**
|
|
@@ -1438,7 +1819,7 @@ var It = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
|
|
|
1438
1819
|
* FieldValueOptions to value().
|
|
1439
1820
|
* - With respect to other ServerTimestampValues, they sort by their
|
|
1440
1821
|
* localWriteTime.
|
|
1441
|
-
*/ function
|
|
1822
|
+
*/ function Rt(t) {
|
|
1442
1823
|
var e, n;
|
|
1443
1824
|
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);
|
|
1444
1825
|
}
|
|
@@ -1448,15 +1829,15 @@ var It = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
|
|
|
1448
1829
|
*
|
|
1449
1830
|
* Preserving the previous values allows the user to display the last resoled
|
|
1450
1831
|
* value until the backend responds with the timestamp.
|
|
1451
|
-
*/ function
|
|
1832
|
+
*/ function xt(t) {
|
|
1452
1833
|
var e = t.mapValue.fields.__previous_value__;
|
|
1453
|
-
return
|
|
1834
|
+
return Rt(e) ? xt(e) : e;
|
|
1454
1835
|
}
|
|
1455
1836
|
|
|
1456
1837
|
/**
|
|
1457
1838
|
* Returns the local time at which this timestamp was first set.
|
|
1458
|
-
*/ function
|
|
1459
|
-
var e =
|
|
1839
|
+
*/ function Ct(t) {
|
|
1840
|
+
var e = Ft(t.mapValue.fields.__local_write_time__.timestampValue);
|
|
1460
1841
|
return new bt(e.seconds, e.nanos);
|
|
1461
1842
|
}
|
|
1462
1843
|
|
|
@@ -1475,7 +1856,7 @@ var It = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
|
|
|
1475
1856
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1476
1857
|
* See the License for the specific language governing permissions and
|
|
1477
1858
|
* limitations under the License.
|
|
1478
|
-
*/ var
|
|
1859
|
+
*/ var Lt = {
|
|
1479
1860
|
fields: {
|
|
1480
1861
|
__type__: {
|
|
1481
1862
|
stringValue: "__max__"
|
|
@@ -1483,18 +1864,18 @@ var It = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
|
|
|
1483
1864
|
}
|
|
1484
1865
|
};
|
|
1485
1866
|
|
|
1486
|
-
/** Extracts the backend's type order for the provided value. */ function
|
|
1487
|
-
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 ?
|
|
1867
|
+
/** Extracts the backend's type order for the provided value. */ function jt(t) {
|
|
1868
|
+
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 ? Rt(t) ? 4 /* ServerTimestampValue */ :
|
|
1488
1869
|
/** Returns true if the Value represents the canonical {@link #MAX_VALUE} . */
|
|
1489
1870
|
function(t) {
|
|
1490
1871
|
return "__max__" === (((t.mapValue || {}).fields || {}).__type__ || {}).stringValue;
|
|
1491
|
-
}(t) ? 9007199254740991 /* MaxValue */ : 10 /* ObjectValue */ :
|
|
1872
|
+
}(t) ? 9007199254740991 /* MaxValue */ : 10 /* ObjectValue */ : E();
|
|
1492
1873
|
}
|
|
1493
1874
|
|
|
1494
|
-
/** Tests `left` and `right` for equality based on the backend semantics. */ function
|
|
1875
|
+
/** Tests `left` and `right` for equality based on the backend semantics. */ function Mt(t, e) {
|
|
1495
1876
|
if (t === e) return !0;
|
|
1496
|
-
var n =
|
|
1497
|
-
if (n !==
|
|
1877
|
+
var n = jt(t);
|
|
1878
|
+
if (n !== jt(e)) return !1;
|
|
1498
1879
|
switch (n) {
|
|
1499
1880
|
case 0 /* NullValue */ :
|
|
1500
1881
|
case 9007199254740991 /* MaxValue */ :
|
|
@@ -1504,14 +1885,14 @@ var It = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
|
|
|
1504
1885
|
return t.booleanValue === e.booleanValue;
|
|
1505
1886
|
|
|
1506
1887
|
case 4 /* ServerTimestampValue */ :
|
|
1507
|
-
return
|
|
1888
|
+
return Ct(t).isEqual(Ct(e));
|
|
1508
1889
|
|
|
1509
1890
|
case 3 /* TimestampValue */ :
|
|
1510
1891
|
return function(t, e) {
|
|
1511
1892
|
if ("string" == typeof t.timestampValue && "string" == typeof e.timestampValue && t.timestampValue.length === e.timestampValue.length)
|
|
1512
1893
|
// Use string equality for ISO 8601 timestamps
|
|
1513
1894
|
return t.timestampValue === e.timestampValue;
|
|
1514
|
-
var n =
|
|
1895
|
+
var n = Ft(t.timestampValue), r = Ft(e.timestampValue);
|
|
1515
1896
|
return n.seconds === r.seconds && n.nanos === r.nanos;
|
|
1516
1897
|
}(t, e);
|
|
1517
1898
|
|
|
@@ -1520,7 +1901,7 @@ var It = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
|
|
|
1520
1901
|
|
|
1521
1902
|
case 6 /* BlobValue */ :
|
|
1522
1903
|
return function(t, e) {
|
|
1523
|
-
return
|
|
1904
|
+
return qt(t.bytesValue).isEqual(qt(e.bytesValue));
|
|
1524
1905
|
}(t, e);
|
|
1525
1906
|
|
|
1526
1907
|
case 7 /* RefValue */ :
|
|
@@ -1528,44 +1909,44 @@ var It = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
|
|
|
1528
1909
|
|
|
1529
1910
|
case 8 /* GeoPointValue */ :
|
|
1530
1911
|
return function(t, e) {
|
|
1531
|
-
return
|
|
1912
|
+
return Ot(t.geoPointValue.latitude) === Ot(e.geoPointValue.latitude) && Ot(t.geoPointValue.longitude) === Ot(e.geoPointValue.longitude);
|
|
1532
1913
|
}(t, e);
|
|
1533
1914
|
|
|
1534
1915
|
case 2 /* NumberValue */ :
|
|
1535
1916
|
return function(t, e) {
|
|
1536
|
-
if ("integerValue" in t && "integerValue" in e) return
|
|
1917
|
+
if ("integerValue" in t && "integerValue" in e) return Ot(t.integerValue) === Ot(e.integerValue);
|
|
1537
1918
|
if ("doubleValue" in t && "doubleValue" in e) {
|
|
1538
|
-
var n =
|
|
1919
|
+
var n = Ot(t.doubleValue), r = Ot(e.doubleValue);
|
|
1539
1920
|
return n === r ? lt(n) === lt(r) : isNaN(n) && isNaN(r);
|
|
1540
1921
|
}
|
|
1541
1922
|
return !1;
|
|
1542
1923
|
}(t, e);
|
|
1543
1924
|
|
|
1544
1925
|
case 9 /* ArrayValue */ :
|
|
1545
|
-
return wt(t.arrayValue.values || [], e.arrayValue.values || [],
|
|
1926
|
+
return wt(t.arrayValue.values || [], e.arrayValue.values || [], Mt);
|
|
1546
1927
|
|
|
1547
1928
|
case 10 /* ObjectValue */ :
|
|
1548
1929
|
return function(t, e) {
|
|
1549
1930
|
var n = t.mapValue.fields || {}, r = e.mapValue.fields || {};
|
|
1550
1931
|
if (Tt(n) !== Tt(r)) return !1;
|
|
1551
|
-
for (var i in n) if (n.hasOwnProperty(i) && (void 0 === r[i] || !
|
|
1932
|
+
for (var i in n) if (n.hasOwnProperty(i) && (void 0 === r[i] || !Mt(n[i], r[i]))) return !1;
|
|
1552
1933
|
return !0;
|
|
1553
1934
|
}(t, e);
|
|
1554
1935
|
|
|
1555
1936
|
default:
|
|
1556
|
-
return
|
|
1937
|
+
return E();
|
|
1557
1938
|
}
|
|
1558
1939
|
}
|
|
1559
1940
|
|
|
1560
|
-
function
|
|
1941
|
+
function Ut(t, e) {
|
|
1561
1942
|
return void 0 !== (t.values || []).find((function(t) {
|
|
1562
|
-
return
|
|
1943
|
+
return Mt(t, e);
|
|
1563
1944
|
}));
|
|
1564
1945
|
}
|
|
1565
1946
|
|
|
1566
|
-
function
|
|
1947
|
+
function Bt(t, e) {
|
|
1567
1948
|
if (t === e) return 0;
|
|
1568
|
-
var n =
|
|
1949
|
+
var n = jt(t), r = jt(e);
|
|
1569
1950
|
if (n !== r) return gt(n, r);
|
|
1570
1951
|
switch (n) {
|
|
1571
1952
|
case 0 /* NullValue */ :
|
|
@@ -1577,24 +1958,24 @@ function Lt(t, e) {
|
|
|
1577
1958
|
|
|
1578
1959
|
case 2 /* NumberValue */ :
|
|
1579
1960
|
return function(t, e) {
|
|
1580
|
-
var n =
|
|
1961
|
+
var n = Ot(t.integerValue || t.doubleValue), r = Ot(e.integerValue || e.doubleValue);
|
|
1581
1962
|
return n < r ? -1 : n > r ? 1 : n === r ? 0 :
|
|
1582
1963
|
// one or both are NaN.
|
|
1583
1964
|
isNaN(n) ? isNaN(r) ? 0 : -1 : 1;
|
|
1584
1965
|
}(t, e);
|
|
1585
1966
|
|
|
1586
1967
|
case 3 /* TimestampValue */ :
|
|
1587
|
-
return
|
|
1968
|
+
return zt(t.timestampValue, e.timestampValue);
|
|
1588
1969
|
|
|
1589
1970
|
case 4 /* ServerTimestampValue */ :
|
|
1590
|
-
return
|
|
1971
|
+
return zt(Ct(t), Ct(e));
|
|
1591
1972
|
|
|
1592
1973
|
case 5 /* StringValue */ :
|
|
1593
1974
|
return gt(t.stringValue, e.stringValue);
|
|
1594
1975
|
|
|
1595
1976
|
case 6 /* BlobValue */ :
|
|
1596
1977
|
return function(t, e) {
|
|
1597
|
-
var n =
|
|
1978
|
+
var n = qt(t), r = qt(e);
|
|
1598
1979
|
return n.compareTo(r);
|
|
1599
1980
|
}(t.bytesValue, e.bytesValue);
|
|
1600
1981
|
|
|
@@ -1609,14 +1990,14 @@ function Lt(t, e) {
|
|
|
1609
1990
|
|
|
1610
1991
|
case 8 /* GeoPointValue */ :
|
|
1611
1992
|
return function(t, e) {
|
|
1612
|
-
var n = gt(
|
|
1613
|
-
return 0 !== n ? n : gt(
|
|
1993
|
+
var n = gt(Ot(t.latitude), Ot(e.latitude));
|
|
1994
|
+
return 0 !== n ? n : gt(Ot(t.longitude), Ot(e.longitude));
|
|
1614
1995
|
}(t.geoPointValue, e.geoPointValue);
|
|
1615
1996
|
|
|
1616
1997
|
case 9 /* ArrayValue */ :
|
|
1617
1998
|
return function(t, e) {
|
|
1618
1999
|
for (var n = t.values || [], r = e.values || [], i = 0; i < n.length && i < r.length; ++i) {
|
|
1619
|
-
var o =
|
|
2000
|
+
var o = Bt(n[i], r[i]);
|
|
1620
2001
|
if (o) return o;
|
|
1621
2002
|
}
|
|
1622
2003
|
return gt(n.length, r.length);
|
|
@@ -1624,9 +2005,9 @@ function Lt(t, e) {
|
|
|
1624
2005
|
|
|
1625
2006
|
case 10 /* ObjectValue */ :
|
|
1626
2007
|
return function(t, e) {
|
|
1627
|
-
if (t ===
|
|
1628
|
-
if (t ===
|
|
1629
|
-
if (e ===
|
|
2008
|
+
if (t === Lt && e === Lt) return 0;
|
|
2009
|
+
if (t === Lt) return 1;
|
|
2010
|
+
if (e === Lt) return -1;
|
|
1630
2011
|
var n = t.fields || {}, r = Object.keys(n), i = e.fields || {}, o = Object.keys(i);
|
|
1631
2012
|
// Even though MapValues are likely sorted correctly based on their insertion
|
|
1632
2013
|
// order (e.g. when received from the backend), local modifications can bring
|
|
@@ -1636,46 +2017,46 @@ function Lt(t, e) {
|
|
|
1636
2017
|
for (var a = 0; a < r.length && a < o.length; ++a) {
|
|
1637
2018
|
var s = gt(r[a], o[a]);
|
|
1638
2019
|
if (0 !== s) return s;
|
|
1639
|
-
var u =
|
|
2020
|
+
var u = Bt(n[r[a]], i[o[a]]);
|
|
1640
2021
|
if (0 !== u) return u;
|
|
1641
2022
|
}
|
|
1642
2023
|
return gt(r.length, o.length);
|
|
1643
2024
|
}(t.mapValue, e.mapValue);
|
|
1644
2025
|
|
|
1645
2026
|
default:
|
|
1646
|
-
throw
|
|
2027
|
+
throw E();
|
|
1647
2028
|
}
|
|
1648
2029
|
}
|
|
1649
2030
|
|
|
1650
|
-
function
|
|
2031
|
+
function zt(t, e) {
|
|
1651
2032
|
if ("string" == typeof t && "string" == typeof e && t.length === e.length) return gt(t, e);
|
|
1652
|
-
var n =
|
|
2033
|
+
var n = Ft(t), r = Ft(e), i = gt(n.seconds, r.seconds);
|
|
1653
2034
|
return 0 !== i ? i : gt(n.nanos, r.nanos);
|
|
1654
2035
|
}
|
|
1655
2036
|
|
|
1656
|
-
function
|
|
2037
|
+
function Gt(t, e) {
|
|
1657
2038
|
return {
|
|
1658
2039
|
referenceValue: "projects/" + t.projectId + "/databases/" + t.database + "/documents/" + e.path.canonicalString()
|
|
1659
2040
|
};
|
|
1660
2041
|
}
|
|
1661
2042
|
|
|
1662
|
-
/** Returns true if `value` is an ArrayValue. */ function
|
|
2043
|
+
/** Returns true if `value` is an ArrayValue. */ function Kt(t) {
|
|
1663
2044
|
return !!t && "arrayValue" in t;
|
|
1664
2045
|
}
|
|
1665
2046
|
|
|
1666
|
-
/** Returns true if `value` is a NullValue. */ function
|
|
2047
|
+
/** Returns true if `value` is a NullValue. */ function Qt(t) {
|
|
1667
2048
|
return !!t && "nullValue" in t;
|
|
1668
2049
|
}
|
|
1669
2050
|
|
|
1670
|
-
/** Returns true if `value` is NaN. */ function
|
|
2051
|
+
/** Returns true if `value` is NaN. */ function Wt(t) {
|
|
1671
2052
|
return !!t && "doubleValue" in t && isNaN(Number(t.doubleValue));
|
|
1672
2053
|
}
|
|
1673
2054
|
|
|
1674
|
-
/** Returns true if `value` is a MapValue. */ function
|
|
2055
|
+
/** Returns true if `value` is a MapValue. */ function Ht(t) {
|
|
1675
2056
|
return !!t && "mapValue" in t;
|
|
1676
2057
|
}
|
|
1677
2058
|
|
|
1678
|
-
/** Creates a deep copy of `source`. */ function
|
|
2059
|
+
/** Creates a deep copy of `source`. */ function Yt(t) {
|
|
1679
2060
|
if (t.geoPointValue) return {
|
|
1680
2061
|
geoPointValue: Object.assign({}, t.geoPointValue)
|
|
1681
2062
|
};
|
|
@@ -1688,8 +2069,8 @@ function xt(t, e) {
|
|
|
1688
2069
|
fields: {}
|
|
1689
2070
|
}
|
|
1690
2071
|
};
|
|
1691
|
-
return
|
|
1692
|
-
return e.mapValue.fields[t] =
|
|
2072
|
+
return Et(t.mapValue.fields, (function(t, n) {
|
|
2073
|
+
return e.mapValue.fields[t] = Yt(n);
|
|
1693
2074
|
})), e;
|
|
1694
2075
|
}
|
|
1695
2076
|
if (t.arrayValue) {
|
|
@@ -1697,13 +2078,13 @@ function xt(t, e) {
|
|
|
1697
2078
|
arrayValue: {
|
|
1698
2079
|
values: []
|
|
1699
2080
|
}
|
|
1700
|
-
}, r = 0; r < (t.arrayValue.values || []).length; ++r) n.arrayValue.values[r] =
|
|
2081
|
+
}, r = 0; r < (t.arrayValue.values || []).length; ++r) n.arrayValue.values[r] = Yt(t.arrayValue.values[r]);
|
|
1701
2082
|
return n;
|
|
1702
2083
|
}
|
|
1703
2084
|
return Object.assign({}, t);
|
|
1704
2085
|
}
|
|
1705
2086
|
|
|
1706
|
-
var
|
|
2087
|
+
var $t = /** @class */ function() {
|
|
1707
2088
|
function t(t) {
|
|
1708
2089
|
this.value = t;
|
|
1709
2090
|
}
|
|
@@ -1720,7 +2101,7 @@ var Qt = /** @class */ function() {
|
|
|
1720
2101
|
*/
|
|
1721
2102
|
t.prototype.field = function(t) {
|
|
1722
2103
|
if (t.isEmpty()) return this.value;
|
|
1723
|
-
for (var e = this.value, n = 0; n < t.length - 1; ++n) if (!
|
|
2104
|
+
for (var e = this.value, n = 0; n < t.length - 1; ++n) if (!Ht(e = (e.mapValue.fields || {})[t.get(n)])) return null;
|
|
1724
2105
|
return (e = (e.mapValue.fields || {})[t.lastSegment()]) || null;
|
|
1725
2106
|
},
|
|
1726
2107
|
/**
|
|
@@ -1730,7 +2111,7 @@ var Qt = /** @class */ function() {
|
|
|
1730
2111
|
* @param value - The value to set.
|
|
1731
2112
|
*/
|
|
1732
2113
|
t.prototype.set = function(t, e) {
|
|
1733
|
-
this.getFieldsMap(t.popLast())[t.lastSegment()] =
|
|
2114
|
+
this.getFieldsMap(t.popLast())[t.lastSegment()] = Yt(e);
|
|
1734
2115
|
},
|
|
1735
2116
|
/**
|
|
1736
2117
|
* Sets the provided fields to the provided values.
|
|
@@ -1745,7 +2126,7 @@ var Qt = /** @class */ function() {
|
|
|
1745
2126
|
var a = e.getFieldsMap(n);
|
|
1746
2127
|
e.applyChanges(a, r, i), r = {}, i = [], n = o.popLast();
|
|
1747
2128
|
}
|
|
1748
|
-
t ? r[o.lastSegment()] =
|
|
2129
|
+
t ? r[o.lastSegment()] = Yt(t) : i.push(o.lastSegment());
|
|
1749
2130
|
}));
|
|
1750
2131
|
var o = this.getFieldsMap(n);
|
|
1751
2132
|
this.applyChanges(o, r, i);
|
|
@@ -1758,9 +2139,9 @@ var Qt = /** @class */ function() {
|
|
|
1758
2139
|
*/
|
|
1759
2140
|
t.prototype.delete = function(t) {
|
|
1760
2141
|
var e = this.field(t.popLast());
|
|
1761
|
-
|
|
2142
|
+
Ht(e) && e.mapValue.fields && delete e.mapValue.fields[t.lastSegment()];
|
|
1762
2143
|
}, t.prototype.isEqual = function(t) {
|
|
1763
|
-
return
|
|
2144
|
+
return Mt(this.value, t.value);
|
|
1764
2145
|
},
|
|
1765
2146
|
/**
|
|
1766
2147
|
* Returns the map that contains the leaf element of `path`. If the parent
|
|
@@ -1773,7 +2154,7 @@ var Qt = /** @class */ function() {
|
|
|
1773
2154
|
});
|
|
1774
2155
|
for (var n = 0; n < t.length; ++n) {
|
|
1775
2156
|
var r = e.mapValue.fields[t.get(n)];
|
|
1776
|
-
|
|
2157
|
+
Ht(r) && r.mapValue.fields || (r = {
|
|
1777
2158
|
mapValue: {
|
|
1778
2159
|
fields: {}
|
|
1779
2160
|
}
|
|
@@ -1786,7 +2167,7 @@ var Qt = /** @class */ function() {
|
|
|
1786
2167
|
* entries.
|
|
1787
2168
|
*/
|
|
1788
2169
|
t.prototype.applyChanges = function(t, e, n) {
|
|
1789
|
-
|
|
2170
|
+
Et(e, (function(e, n) {
|
|
1790
2171
|
return t[e] = n;
|
|
1791
2172
|
}));
|
|
1792
2173
|
for (var r = 0, i = n; r < i.length; r++) {
|
|
@@ -1794,9 +2175,9 @@ var Qt = /** @class */ function() {
|
|
|
1794
2175
|
delete t[o];
|
|
1795
2176
|
}
|
|
1796
2177
|
}, t.prototype.clone = function() {
|
|
1797
|
-
return new t(
|
|
2178
|
+
return new t(Yt(this.value));
|
|
1798
2179
|
}, t;
|
|
1799
|
-
}(),
|
|
2180
|
+
}(), Xt = /** @class */ function() {
|
|
1800
2181
|
function t(t, e, n, r, i, o) {
|
|
1801
2182
|
this.key = t, this.documentType = e, this.version = n, this.readTime = r, this.data = i,
|
|
1802
2183
|
this.documentState = o
|
|
@@ -1806,7 +2187,7 @@ var Qt = /** @class */ function() {
|
|
|
1806
2187
|
*/;
|
|
1807
2188
|
}
|
|
1808
2189
|
return t.newInvalidDocument = function(e) {
|
|
1809
|
-
return new t(e, 0 /* INVALID */ , _t.min(), _t.min(),
|
|
2190
|
+
return new t(e, 0 /* INVALID */ , _t.min(), _t.min(), $t.empty(), 0 /* SYNCED */);
|
|
1810
2191
|
},
|
|
1811
2192
|
/**
|
|
1812
2193
|
* Creates a new document that is known to exist with the given data at the
|
|
@@ -1816,7 +2197,7 @@ var Qt = /** @class */ function() {
|
|
|
1816
2197
|
return new t(e, 1 /* FOUND_DOCUMENT */ , n, _t.min(), r, 0 /* SYNCED */);
|
|
1817
2198
|
},
|
|
1818
2199
|
/** Creates a new document that is known to not exist at the given version. */ t.newNoDocument = function(e, n) {
|
|
1819
|
-
return new t(e, 2 /* NO_DOCUMENT */ , n, _t.min(),
|
|
2200
|
+
return new t(e, 2 /* NO_DOCUMENT */ , n, _t.min(), $t.empty(), 0 /* SYNCED */);
|
|
1820
2201
|
},
|
|
1821
2202
|
/**
|
|
1822
2203
|
* Creates a new document that is known to exist at the given version but
|
|
@@ -1824,7 +2205,7 @@ var Qt = /** @class */ function() {
|
|
|
1824
2205
|
* base document).
|
|
1825
2206
|
*/
|
|
1826
2207
|
t.newUnknownDocument = function(e, n) {
|
|
1827
|
-
return new t(e, 3 /* UNKNOWN_DOCUMENT */ , n, _t.min(),
|
|
2208
|
+
return new t(e, 3 /* UNKNOWN_DOCUMENT */ , n, _t.min(), $t.empty(), 2 /* HAS_COMMITTED_MUTATIONS */);
|
|
1828
2209
|
},
|
|
1829
2210
|
/**
|
|
1830
2211
|
* Changes the document type to indicate that it exists and that its version
|
|
@@ -1839,7 +2220,7 @@ var Qt = /** @class */ function() {
|
|
|
1839
2220
|
* version.
|
|
1840
2221
|
*/
|
|
1841
2222
|
t.prototype.convertToNoDocument = function(t) {
|
|
1842
|
-
return this.version = t, this.documentType = 2 /* NO_DOCUMENT */ , this.data =
|
|
2223
|
+
return this.version = t, this.documentType = 2 /* NO_DOCUMENT */ , this.data = $t.empty(),
|
|
1843
2224
|
this.documentState = 0 /* SYNCED */ , this;
|
|
1844
2225
|
},
|
|
1845
2226
|
/**
|
|
@@ -1848,12 +2229,13 @@ var Qt = /** @class */ function() {
|
|
|
1848
2229
|
* base document).
|
|
1849
2230
|
*/
|
|
1850
2231
|
t.prototype.convertToUnknownDocument = function(t) {
|
|
1851
|
-
return this.version = t, this.documentType = 3 /* UNKNOWN_DOCUMENT */ , this.data =
|
|
2232
|
+
return this.version = t, this.documentType = 3 /* UNKNOWN_DOCUMENT */ , this.data = $t.empty(),
|
|
1852
2233
|
this.documentState = 2 /* HAS_COMMITTED_MUTATIONS */ , this;
|
|
1853
2234
|
}, t.prototype.setHasCommittedMutations = function() {
|
|
1854
2235
|
return this.documentState = 2 /* HAS_COMMITTED_MUTATIONS */ , this;
|
|
1855
2236
|
}, t.prototype.setHasLocalMutations = function() {
|
|
1856
|
-
return this.documentState = 1 /* HAS_LOCAL_MUTATIONS */ , this
|
|
2237
|
+
return this.documentState = 1 /* HAS_LOCAL_MUTATIONS */ , this.version = _t.min(),
|
|
2238
|
+
this;
|
|
1857
2239
|
}, t.prototype.setReadTime = function(t) {
|
|
1858
2240
|
return this.readTime = t, this;
|
|
1859
2241
|
}, Object.defineProperty(t.prototype, "hasLocalMutations", {
|
|
@@ -1889,7 +2271,7 @@ var Qt = /** @class */ function() {
|
|
|
1889
2271
|
}, t.prototype.toString = function() {
|
|
1890
2272
|
return "Document(" + this.key + ", " + this.version + ", " + JSON.stringify(this.data.value) + ", {documentType: " + this.documentType + "}), {documentState: " + this.documentState + "})";
|
|
1891
2273
|
}, t;
|
|
1892
|
-
}(),
|
|
2274
|
+
}(), Jt = function(t, e, n, r, i, o, a) {
|
|
1893
2275
|
void 0 === e && (e = null), void 0 === n && (n = []), void 0 === r && (r = []),
|
|
1894
2276
|
void 0 === i && (i = null), void 0 === o && (o = null), void 0 === a && (a = null),
|
|
1895
2277
|
this.path = t, this.collectionGroup = e, this.orderBy = n, this.filters = r, this.limit = i,
|
|
@@ -1930,13 +2312,13 @@ var Qt = /** @class */ function() {
|
|
|
1930
2312
|
* using this factory method, because `Query` provides an implicit `orderBy`
|
|
1931
2313
|
* property.
|
|
1932
2314
|
*/
|
|
1933
|
-
function
|
|
2315
|
+
function Zt(t, e, n, r, i, o, a) {
|
|
1934
2316
|
return void 0 === e && (e = null), void 0 === n && (n = []), void 0 === r && (r = []),
|
|
1935
2317
|
void 0 === i && (i = null), void 0 === o && (o = null), void 0 === a && (a = null),
|
|
1936
|
-
new
|
|
2318
|
+
new Jt(t, e, n, r, i, o, a);
|
|
1937
2319
|
}
|
|
1938
2320
|
|
|
1939
|
-
var
|
|
2321
|
+
var te = /** @class */ function(e) {
|
|
1940
2322
|
function n(t, n, r) {
|
|
1941
2323
|
var i = this;
|
|
1942
2324
|
return (i = e.call(this) || this).field = t, i.op = n, i.value = r, i;
|
|
@@ -1944,15 +2326,15 @@ var Yt = /** @class */ function(e) {
|
|
|
1944
2326
|
/**
|
|
1945
2327
|
* Creates a filter based on the provided arguments.
|
|
1946
2328
|
*/ return t(n, e), n.create = function(t, e, r) {
|
|
1947
|
-
return t.isKeyField() ? "in" /* IN */ === e || "not-in" /* NOT_IN */ === e ? this.V(t, e, r) : new
|
|
2329
|
+
return t.isKeyField() ? "in" /* IN */ === e || "not-in" /* NOT_IN */ === e ? this.V(t, e, r) : new ee(t, e, r) : "array-contains" /* ARRAY_CONTAINS */ === e ? new oe(t, r) : "in" /* IN */ === e ? new ae(t, r) : "not-in" /* NOT_IN */ === e ? new se(t, r) : "array-contains-any" /* ARRAY_CONTAINS_ANY */ === e ? new ue(t, r) : new n(t, e, r);
|
|
1948
2330
|
}, n.V = function(t, e, n) {
|
|
1949
|
-
return "in" /* IN */ === e ? new
|
|
2331
|
+
return "in" /* IN */ === e ? new ne(t, n) : new re(t, n);
|
|
1950
2332
|
}, n.prototype.matches = function(t) {
|
|
1951
2333
|
var e = t.data.field(this.field);
|
|
1952
2334
|
// Types do not have to match in NOT_EQUAL filters.
|
|
1953
|
-
return "!=" /* NOT_EQUAL */ === this.op ? null !== e && this.
|
|
2335
|
+
return "!=" /* NOT_EQUAL */ === this.op ? null !== e && this.N(Bt(e, this.value)) : null !== e && jt(this.value) === jt(e) && this.N(Bt(e, this.value));
|
|
1954
2336
|
// Only compare types with matching backend order (such as double and int).
|
|
1955
|
-
}, n.prototype.
|
|
2337
|
+
}, n.prototype.N = function(t) {
|
|
1956
2338
|
switch (this.op) {
|
|
1957
2339
|
case "<" /* LESS_THAN */ :
|
|
1958
2340
|
return t < 0;
|
|
@@ -1973,12 +2355,12 @@ var Yt = /** @class */ function(e) {
|
|
|
1973
2355
|
return t >= 0;
|
|
1974
2356
|
|
|
1975
2357
|
default:
|
|
1976
|
-
return
|
|
2358
|
+
return E();
|
|
1977
2359
|
}
|
|
1978
|
-
}, n.prototype.
|
|
2360
|
+
}, n.prototype.D = function() {
|
|
1979
2361
|
return [ "<" /* LESS_THAN */ , "<=" /* LESS_THAN_OR_EQUAL */ , ">" /* GREATER_THAN */ , ">=" /* GREATER_THAN_OR_EQUAL */ , "!=" /* NOT_EQUAL */ , "not-in" /* NOT_IN */ ].indexOf(this.op) >= 0;
|
|
1980
2362
|
}, n;
|
|
1981
|
-
}((function() {})),
|
|
2363
|
+
}((function() {})), ee = /** @class */ function(e) {
|
|
1982
2364
|
function n(t, n, r) {
|
|
1983
2365
|
var i = this;
|
|
1984
2366
|
return (i = e.call(this, t, n, r) || this).key = nt.fromName(r.referenceValue),
|
|
@@ -1986,12 +2368,12 @@ var Yt = /** @class */ function(e) {
|
|
|
1986
2368
|
}
|
|
1987
2369
|
return t(n, e), n.prototype.matches = function(t) {
|
|
1988
2370
|
var e = nt.comparator(t.key, this.key);
|
|
1989
|
-
return this.
|
|
2371
|
+
return this.N(e);
|
|
1990
2372
|
}, n;
|
|
1991
|
-
}(
|
|
2373
|
+
}(te), ne = /** @class */ function(e) {
|
|
1992
2374
|
function n(t, n) {
|
|
1993
2375
|
var r = this;
|
|
1994
|
-
return (r = e.call(this, t, "in" /* IN */ , n) || this).keys =
|
|
2376
|
+
return (r = e.call(this, t, "in" /* IN */ , n) || this).keys = ie("in" /* IN */ , n),
|
|
1995
2377
|
r;
|
|
1996
2378
|
}
|
|
1997
2379
|
return t(n, e), n.prototype.matches = function(t) {
|
|
@@ -1999,10 +2381,10 @@ var Yt = /** @class */ function(e) {
|
|
|
1999
2381
|
return e.isEqual(t.key);
|
|
2000
2382
|
}));
|
|
2001
2383
|
}, n;
|
|
2002
|
-
}(
|
|
2384
|
+
}(te), re = /** @class */ function(e) {
|
|
2003
2385
|
function n(t, n) {
|
|
2004
2386
|
var r = this;
|
|
2005
|
-
return (r = e.call(this, t, "not-in" /* NOT_IN */ , n) || this).keys =
|
|
2387
|
+
return (r = e.call(this, t, "not-in" /* NOT_IN */ , n) || this).keys = ie("not-in" /* NOT_IN */ , n),
|
|
2006
2388
|
r;
|
|
2007
2389
|
}
|
|
2008
2390
|
return t(n, e), n.prototype.matches = function(t) {
|
|
@@ -2010,67 +2392,67 @@ var Yt = /** @class */ function(e) {
|
|
|
2010
2392
|
return e.isEqual(t.key);
|
|
2011
2393
|
}));
|
|
2012
2394
|
}, n;
|
|
2013
|
-
}(
|
|
2395
|
+
}(te);
|
|
2014
2396
|
|
|
2015
|
-
/** Filter that matches on key fields (i.e. '__name__'). */ function
|
|
2397
|
+
/** Filter that matches on key fields (i.e. '__name__'). */ function ie(t, e) {
|
|
2016
2398
|
var n;
|
|
2017
2399
|
return ((null === (n = e.arrayValue) || void 0 === n ? void 0 : n.values) || []).map((function(t) {
|
|
2018
2400
|
return nt.fromName(t.referenceValue);
|
|
2019
2401
|
}));
|
|
2020
2402
|
}
|
|
2021
2403
|
|
|
2022
|
-
/** A Filter that implements the array-contains operator. */ var
|
|
2404
|
+
/** A Filter that implements the array-contains operator. */ var oe = /** @class */ function(e) {
|
|
2023
2405
|
function n(t, n) {
|
|
2024
2406
|
return e.call(this, t, "array-contains" /* ARRAY_CONTAINS */ , n) || this;
|
|
2025
2407
|
}
|
|
2026
2408
|
return t(n, e), n.prototype.matches = function(t) {
|
|
2027
2409
|
var e = t.data.field(this.field);
|
|
2028
|
-
return
|
|
2410
|
+
return Kt(e) && Ut(e.arrayValue, this.value);
|
|
2029
2411
|
}, n;
|
|
2030
|
-
}(
|
|
2412
|
+
}(te), ae = /** @class */ function(e) {
|
|
2031
2413
|
function n(t, n) {
|
|
2032
2414
|
return e.call(this, t, "in" /* IN */ , n) || this;
|
|
2033
2415
|
}
|
|
2034
2416
|
return t(n, e), n.prototype.matches = function(t) {
|
|
2035
2417
|
var e = t.data.field(this.field);
|
|
2036
|
-
return null !== e &&
|
|
2418
|
+
return null !== e && Ut(this.value.arrayValue, e);
|
|
2037
2419
|
}, n;
|
|
2038
|
-
}(
|
|
2420
|
+
}(te), se = /** @class */ function(e) {
|
|
2039
2421
|
function n(t, n) {
|
|
2040
2422
|
return e.call(this, t, "not-in" /* NOT_IN */ , n) || this;
|
|
2041
2423
|
}
|
|
2042
2424
|
return t(n, e), n.prototype.matches = function(t) {
|
|
2043
|
-
if (
|
|
2425
|
+
if (Ut(this.value.arrayValue, {
|
|
2044
2426
|
nullValue: "NULL_VALUE"
|
|
2045
2427
|
})) return !1;
|
|
2046
2428
|
var e = t.data.field(this.field);
|
|
2047
|
-
return null !== e && !
|
|
2429
|
+
return null !== e && !Ut(this.value.arrayValue, e);
|
|
2048
2430
|
}, n;
|
|
2049
|
-
}(
|
|
2431
|
+
}(te), ue = /** @class */ function(e) {
|
|
2050
2432
|
function n(t, n) {
|
|
2051
2433
|
return e.call(this, t, "array-contains-any" /* ARRAY_CONTAINS_ANY */ , n) || this;
|
|
2052
2434
|
}
|
|
2053
2435
|
return t(n, e), n.prototype.matches = function(t) {
|
|
2054
2436
|
var e = this, n = t.data.field(this.field);
|
|
2055
|
-
return !(!
|
|
2056
|
-
return
|
|
2437
|
+
return !(!Kt(n) || !n.arrayValue.values) && n.arrayValue.values.some((function(t) {
|
|
2438
|
+
return Ut(e.value.arrayValue, t);
|
|
2057
2439
|
}));
|
|
2058
2440
|
}, n;
|
|
2059
|
-
}(
|
|
2441
|
+
}(te), ce = function(t, e) {
|
|
2060
2442
|
this.position = t, this.inclusive = e;
|
|
2061
|
-
},
|
|
2443
|
+
}, le = function(t, e /* ASCENDING */) {
|
|
2062
2444
|
void 0 === e && (e = "asc"), this.field = t, this.dir = e;
|
|
2063
2445
|
};
|
|
2064
2446
|
|
|
2065
|
-
/** A Filter that implements the IN operator. */ function
|
|
2447
|
+
/** A Filter that implements the IN operator. */ function fe(t, e) {
|
|
2066
2448
|
return t.dir === e.dir && t.field.isEqual(e.field);
|
|
2067
2449
|
}
|
|
2068
2450
|
|
|
2069
|
-
function
|
|
2451
|
+
function he(t, e) {
|
|
2070
2452
|
if (null === t) return null === e;
|
|
2071
2453
|
if (null === e) return !1;
|
|
2072
2454
|
if (t.inclusive !== e.inclusive || t.position.length !== e.position.length) return !1;
|
|
2073
|
-
for (var n = 0; n < t.position.length; n++) if (!
|
|
2455
|
+
for (var n = 0; n < t.position.length; n++) if (!Mt(t.position[n], e.position[n])) return !1;
|
|
2074
2456
|
return !0;
|
|
2075
2457
|
}
|
|
2076
2458
|
|
|
@@ -2096,7 +2478,7 @@ function se(t, e) {
|
|
|
2096
2478
|
* query the RemoteStore results.
|
|
2097
2479
|
*
|
|
2098
2480
|
* Visible for testing.
|
|
2099
|
-
*/ var
|
|
2481
|
+
*/ var pe =
|
|
2100
2482
|
/**
|
|
2101
2483
|
* Initializes a Query with a path and optional additional query constraints.
|
|
2102
2484
|
* Path must currently be empty if this is a collection group query.
|
|
@@ -2108,17 +2490,17 @@ function(t, e, n, r, i, o /* First */ , a, s) {
|
|
|
2108
2490
|
this.filters = r, this.limit = i, this.limitType = o, this.startAt = a, this.endAt = s,
|
|
2109
2491
|
this.$ = null,
|
|
2110
2492
|
// The corresponding `Target` of this `Query` instance.
|
|
2111
|
-
this.
|
|
2493
|
+
this.F = null, this.startAt, this.endAt;
|
|
2112
2494
|
};
|
|
2113
2495
|
|
|
2114
|
-
/** Creates a new Query for a query that matches all documents at `path` */ function
|
|
2496
|
+
/** Creates a new Query for a query that matches all documents at `path` */ function de(t) {
|
|
2115
2497
|
return t.explicitOrderBy.length > 0 ? t.explicitOrderBy[0].field : null;
|
|
2116
2498
|
}
|
|
2117
2499
|
|
|
2118
|
-
function
|
|
2500
|
+
function ye(t) {
|
|
2119
2501
|
for (var e = 0, n = t.filters; e < n.length; e++) {
|
|
2120
2502
|
var r = n[e];
|
|
2121
|
-
if (r.
|
|
2503
|
+
if (r.D()) return r.field;
|
|
2122
2504
|
}
|
|
2123
2505
|
return null;
|
|
2124
2506
|
}
|
|
@@ -2130,7 +2512,7 @@ function le(t) {
|
|
|
2130
2512
|
/**
|
|
2131
2513
|
* Returns whether the query matches a collection group rather than a specific
|
|
2132
2514
|
* collection.
|
|
2133
|
-
*/ function
|
|
2515
|
+
*/ function me(t) {
|
|
2134
2516
|
return null !== t.collectionGroup;
|
|
2135
2517
|
}
|
|
2136
2518
|
|
|
@@ -2138,16 +2520,16 @@ function le(t) {
|
|
|
2138
2520
|
* Returns the implicit order by constraint that is used to execute the Query,
|
|
2139
2521
|
* which can be different from the order by constraints the user provided (e.g.
|
|
2140
2522
|
* the SDK and backend always orders by `__name__`).
|
|
2141
|
-
*/ function
|
|
2142
|
-
var e =
|
|
2523
|
+
*/ function ve(t) {
|
|
2524
|
+
var e = k(t);
|
|
2143
2525
|
if (null === e.$) {
|
|
2144
2526
|
e.$ = [];
|
|
2145
|
-
var n =
|
|
2527
|
+
var n = ye(e), r = de(e);
|
|
2146
2528
|
if (null !== n && null === r)
|
|
2147
2529
|
// In order to implicitly add key ordering, we must also add the
|
|
2148
2530
|
// inequality filter field for it to be a valid query.
|
|
2149
2531
|
// Note that the default inequality field and key ordering is ascending.
|
|
2150
|
-
n.isKeyField() || e.$.push(new
|
|
2532
|
+
n.isKeyField() || e.$.push(new le(n)), e.$.push(new le(et.keyField(), "asc" /* ASCENDING */)); else {
|
|
2151
2533
|
for (var i = !1, o = 0, a = e.explicitOrderBy; o < a.length; o++) {
|
|
2152
2534
|
var s = a[o];
|
|
2153
2535
|
e.$.push(s), s.field.isKeyField() && (i = !0);
|
|
@@ -2156,7 +2538,7 @@ function le(t) {
|
|
|
2156
2538
|
// The order of the implicit key ordering always matches the last
|
|
2157
2539
|
// explicit order by
|
|
2158
2540
|
var u = e.explicitOrderBy.length > 0 ? e.explicitOrderBy[e.explicitOrderBy.length - 1].dir : "asc" /* ASCENDING */;
|
|
2159
|
-
e.$.push(new
|
|
2541
|
+
e.$.push(new le(et.keyField(), u));
|
|
2160
2542
|
}
|
|
2161
2543
|
}
|
|
2162
2544
|
}
|
|
@@ -2165,21 +2547,21 @@ function le(t) {
|
|
|
2165
2547
|
|
|
2166
2548
|
/**
|
|
2167
2549
|
* Converts this `Query` instance to it's corresponding `Target` representation.
|
|
2168
|
-
*/ function
|
|
2169
|
-
var e =
|
|
2170
|
-
if (!e.
|
|
2550
|
+
*/ function ge(t) {
|
|
2551
|
+
var e = k(t);
|
|
2552
|
+
if (!e.F) if ("F" /* First */ === e.limitType) e.F = Zt(e.path, e.collectionGroup, ve(e), e.filters, e.limit, e.startAt, e.endAt); else {
|
|
2171
2553
|
for (
|
|
2172
2554
|
// Flip the orderBy directions since we want the last results
|
|
2173
|
-
var n = [], r = 0, i =
|
|
2555
|
+
var n = [], r = 0, i = ve(e); r < i.length; r++) {
|
|
2174
2556
|
var o = i[r], a = "desc" /* DESCENDING */ === o.dir ? "asc" /* ASCENDING */ : "desc" /* DESCENDING */;
|
|
2175
|
-
n.push(new
|
|
2557
|
+
n.push(new le(o.field, a));
|
|
2176
2558
|
}
|
|
2177
2559
|
// We need to swap the cursors to match the now-flipped query ordering.
|
|
2178
|
-
var s = e.endAt ? new
|
|
2560
|
+
var s = e.endAt ? new ce(e.endAt.position, e.endAt.inclusive) : null, u = e.startAt ? new ce(e.startAt.position, e.startAt.inclusive) : null;
|
|
2179
2561
|
// Now return as a LimitType.First query.
|
|
2180
|
-
e.
|
|
2562
|
+
e.F = Zt(e.path, e.collectionGroup, n, e.filters, e.limit, s, u);
|
|
2181
2563
|
}
|
|
2182
|
-
return e.
|
|
2564
|
+
return e.F;
|
|
2183
2565
|
}
|
|
2184
2566
|
|
|
2185
2567
|
/**
|
|
@@ -2207,7 +2589,7 @@ function le(t) {
|
|
|
2207
2589
|
* The return value is an IntegerValue if it can safely represent the value,
|
|
2208
2590
|
* otherwise a DoubleValue is returned.
|
|
2209
2591
|
*/
|
|
2210
|
-
function
|
|
2592
|
+
function we(t, e) {
|
|
2211
2593
|
return function(t) {
|
|
2212
2594
|
return "number" == typeof t && Number.isInteger(t) && !lt(t) && t <= Number.MAX_SAFE_INTEGER && t >= Number.MIN_SAFE_INTEGER;
|
|
2213
2595
|
}(e) ?
|
|
@@ -2219,7 +2601,7 @@ function de(t, e) {
|
|
|
2219
2601
|
integerValue: "" + t
|
|
2220
2602
|
};
|
|
2221
2603
|
}(e) : function(t, e) {
|
|
2222
|
-
if (t.
|
|
2604
|
+
if (t.S) {
|
|
2223
2605
|
if (isNaN(e)) return {
|
|
2224
2606
|
doubleValue: "NaN"
|
|
2225
2607
|
};
|
|
@@ -2252,36 +2634,36 @@ function de(t, e) {
|
|
|
2252
2634
|
* See the License for the specific language governing permissions and
|
|
2253
2635
|
* limitations under the License.
|
|
2254
2636
|
*/
|
|
2255
|
-
/** Used to represent a field transform on a mutation. */ var
|
|
2637
|
+
/** Used to represent a field transform on a mutation. */ var be = function() {
|
|
2256
2638
|
// Make sure that the structural type of `TransformOperation` is unique.
|
|
2257
2639
|
// See https://github.com/microsoft/TypeScript/issues/5451
|
|
2258
2640
|
this._ = void 0;
|
|
2259
|
-
},
|
|
2641
|
+
}, _e = /** @class */ function(e) {
|
|
2260
2642
|
function n() {
|
|
2261
2643
|
return null !== e && e.apply(this, arguments) || this;
|
|
2262
2644
|
}
|
|
2263
2645
|
return t(n, e), n;
|
|
2264
|
-
}(
|
|
2646
|
+
}(be), Te = /** @class */ function(e) {
|
|
2265
2647
|
function n(t) {
|
|
2266
2648
|
var n = this;
|
|
2267
2649
|
return (n = e.call(this) || this).elements = t, n;
|
|
2268
2650
|
}
|
|
2269
2651
|
return t(n, e), n;
|
|
2270
|
-
}(
|
|
2652
|
+
}(be), Ee = /** @class */ function(e) {
|
|
2271
2653
|
function n(t) {
|
|
2272
2654
|
var n = this;
|
|
2273
2655
|
return (n = e.call(this) || this).elements = t, n;
|
|
2274
2656
|
}
|
|
2275
2657
|
return t(n, e), n;
|
|
2276
|
-
}(
|
|
2658
|
+
}(be), Se = /** @class */ function(e) {
|
|
2277
2659
|
function n(t, n) {
|
|
2278
2660
|
var r = this;
|
|
2279
2661
|
return (r = e.call(this) || this).q = t, r.O = n, r;
|
|
2280
2662
|
}
|
|
2281
2663
|
return t(n, e), n;
|
|
2282
|
-
}(
|
|
2664
|
+
}(be), ke = function(t, e) {
|
|
2283
2665
|
this.field = t, this.transform = e;
|
|
2284
|
-
},
|
|
2666
|
+
}, Ie = /** @class */ function() {
|
|
2285
2667
|
function t(t, e) {
|
|
2286
2668
|
this.updateTime = t, this.exists = e
|
|
2287
2669
|
/** Creates a new empty Precondition. */;
|
|
@@ -2303,40 +2685,48 @@ function de(t, e) {
|
|
|
2303
2685
|
}), t.prototype.isEqual = function(t) {
|
|
2304
2686
|
return this.exists === t.exists && (this.updateTime ? !!t.updateTime && this.updateTime.isEqual(t.updateTime) : !t.updateTime);
|
|
2305
2687
|
}, t;
|
|
2306
|
-
}(),
|
|
2688
|
+
}(), Ae = function() {}, Ve = /** @class */ function(e) {
|
|
2307
2689
|
function n(t, n, r, i) {
|
|
2308
2690
|
void 0 === i && (i = []);
|
|
2309
2691
|
var o = this;
|
|
2310
2692
|
return (o = e.call(this) || this).key = t, o.value = n, o.precondition = r, o.fieldTransforms = i,
|
|
2311
2693
|
o.type = 0 /* Set */ , o;
|
|
2312
2694
|
}
|
|
2313
|
-
return t(n, e), n
|
|
2314
|
-
|
|
2695
|
+
return t(n, e), n.prototype.getFieldMask = function() {
|
|
2696
|
+
return null;
|
|
2697
|
+
}, n;
|
|
2698
|
+
}(Ae), De = /** @class */ function(e) {
|
|
2315
2699
|
function n(t, n, r, i, o) {
|
|
2316
2700
|
void 0 === o && (o = []);
|
|
2317
2701
|
var a = this;
|
|
2318
2702
|
return (a = e.call(this) || this).key = t, a.data = n, a.fieldMask = r, a.precondition = i,
|
|
2319
2703
|
a.fieldTransforms = o, a.type = 1 /* Patch */ , a;
|
|
2320
2704
|
}
|
|
2321
|
-
return t(n, e), n
|
|
2322
|
-
|
|
2705
|
+
return t(n, e), n.prototype.getFieldMask = function() {
|
|
2706
|
+
return this.fieldMask;
|
|
2707
|
+
}, n;
|
|
2708
|
+
}(Ae), Pe = /** @class */ function(e) {
|
|
2323
2709
|
function n(t, n) {
|
|
2324
2710
|
var r = this;
|
|
2325
2711
|
return (r = e.call(this) || this).key = t, r.precondition = n, r.type = 2 /* Delete */ ,
|
|
2326
2712
|
r.fieldTransforms = [], r;
|
|
2327
2713
|
}
|
|
2328
|
-
return t(n, e), n
|
|
2329
|
-
|
|
2714
|
+
return t(n, e), n.prototype.getFieldMask = function() {
|
|
2715
|
+
return null;
|
|
2716
|
+
}, n;
|
|
2717
|
+
}(Ae), Ne = /** @class */ function(e) {
|
|
2330
2718
|
function n(t, n) {
|
|
2331
2719
|
var r = this;
|
|
2332
2720
|
return (r = e.call(this) || this).key = t, r.precondition = n, r.type = 3 /* Verify */ ,
|
|
2333
2721
|
r.fieldTransforms = [], r;
|
|
2334
2722
|
}
|
|
2335
|
-
return t(n, e), n
|
|
2336
|
-
|
|
2723
|
+
return t(n, e), n.prototype.getFieldMask = function() {
|
|
2724
|
+
return null;
|
|
2725
|
+
}, n;
|
|
2726
|
+
}(Ae), Fe = {
|
|
2337
2727
|
asc: "ASCENDING",
|
|
2338
2728
|
desc: "DESCENDING"
|
|
2339
|
-
},
|
|
2729
|
+
}, Oe = {
|
|
2340
2730
|
"<": "LESS_THAN",
|
|
2341
2731
|
"<=": "LESS_THAN_OR_EQUAL",
|
|
2342
2732
|
">": "GREATER_THAN",
|
|
@@ -2347,8 +2737,8 @@ function de(t, e) {
|
|
|
2347
2737
|
in: "IN",
|
|
2348
2738
|
"not-in": "NOT_IN",
|
|
2349
2739
|
"array-contains-any": "ARRAY_CONTAINS_ANY"
|
|
2350
|
-
},
|
|
2351
|
-
this.databaseId = t, this.
|
|
2740
|
+
}, qe = function(t, e) {
|
|
2741
|
+
this.databaseId = t, this.S = e;
|
|
2352
2742
|
};
|
|
2353
2743
|
|
|
2354
2744
|
/** Transforms a value into a server-generated timestamp. */
|
|
@@ -2363,8 +2753,8 @@ function de(t, e) {
|
|
|
2363
2753
|
/**
|
|
2364
2754
|
* Returns a value for a Date that's appropriate to put into a proto.
|
|
2365
2755
|
*/
|
|
2366
|
-
function
|
|
2367
|
-
return t.
|
|
2756
|
+
function Re(t, e) {
|
|
2757
|
+
return t.S ? new Date(1e3 * e.seconds).toISOString().replace(/\.\d*/, "").replace("Z", "") + "." + ("000000000" + e.nanoseconds).slice(-9) + "Z" : {
|
|
2368
2758
|
seconds: "" + e.seconds,
|
|
2369
2759
|
nanos: e.nanoseconds
|
|
2370
2760
|
};
|
|
@@ -2374,72 +2764,72 @@ function Pe(t, e) {
|
|
|
2374
2764
|
* Returns a value for bytes that's appropriate to put in a proto.
|
|
2375
2765
|
*
|
|
2376
2766
|
* Visible for testing.
|
|
2377
|
-
*/ function
|
|
2378
|
-
return t.
|
|
2767
|
+
*/ function xe(t, e) {
|
|
2768
|
+
return t.S ? e.toBase64() : e.toUint8Array();
|
|
2379
2769
|
}
|
|
2380
2770
|
|
|
2381
|
-
function
|
|
2382
|
-
return
|
|
2771
|
+
function Ce(t, e) {
|
|
2772
|
+
return Re(t, e.toTimestamp());
|
|
2383
2773
|
}
|
|
2384
2774
|
|
|
2385
|
-
function
|
|
2386
|
-
return
|
|
2387
|
-
var e =
|
|
2775
|
+
function Le(t) {
|
|
2776
|
+
return S(!!t), _t.fromTimestamp(function(t) {
|
|
2777
|
+
var e = Ft(t);
|
|
2388
2778
|
return new bt(e.seconds, e.nanos);
|
|
2389
2779
|
}(t));
|
|
2390
2780
|
}
|
|
2391
2781
|
|
|
2392
|
-
function
|
|
2782
|
+
function je(t, e) {
|
|
2393
2783
|
return function(t) {
|
|
2394
2784
|
return new Z([ "projects", t.projectId, "databases", t.database ]);
|
|
2395
2785
|
}(t).child("documents").child(e).canonicalString();
|
|
2396
2786
|
}
|
|
2397
2787
|
|
|
2398
|
-
function
|
|
2399
|
-
return
|
|
2788
|
+
function Me(t, e) {
|
|
2789
|
+
return je(t.databaseId, e.path);
|
|
2400
2790
|
}
|
|
2401
2791
|
|
|
2402
|
-
function
|
|
2792
|
+
function Ue(t, e) {
|
|
2403
2793
|
var n, r = function(t) {
|
|
2404
2794
|
var e = Z.fromString(t);
|
|
2405
|
-
return
|
|
2795
|
+
return S(Ye(e)), e;
|
|
2406
2796
|
}(e);
|
|
2407
2797
|
if (r.get(1) !== t.databaseId.projectId) throw new M(V, "Tried to deserialize key from different project: " + r.get(1) + " vs " + t.databaseId.projectId);
|
|
2408
2798
|
if (r.get(3) !== t.databaseId.database) throw new M(V, "Tried to deserialize key from different database: " + r.get(3) + " vs " + t.databaseId.database);
|
|
2409
|
-
return new nt((
|
|
2799
|
+
return new nt((S((n = r).length > 4 && "documents" === n.get(4)), n.popFirst(5)));
|
|
2410
2800
|
}
|
|
2411
2801
|
|
|
2412
|
-
function
|
|
2413
|
-
return
|
|
2802
|
+
function Be(t, e) {
|
|
2803
|
+
return je(t.databaseId, e);
|
|
2414
2804
|
}
|
|
2415
2805
|
|
|
2416
|
-
function
|
|
2806
|
+
function ze(t) {
|
|
2417
2807
|
return new Z([ "projects", t.databaseId.projectId, "databases", t.databaseId.database ]).canonicalString();
|
|
2418
2808
|
}
|
|
2419
2809
|
|
|
2420
|
-
function
|
|
2810
|
+
function Ge(t, e, n) {
|
|
2421
2811
|
return {
|
|
2422
|
-
name:
|
|
2812
|
+
name: Me(t, e),
|
|
2423
2813
|
fields: n.value.mapValue.fields
|
|
2424
2814
|
};
|
|
2425
2815
|
}
|
|
2426
2816
|
|
|
2427
|
-
function
|
|
2428
|
-
return
|
|
2817
|
+
function Ke(t) {
|
|
2818
|
+
return Fe[t];
|
|
2429
2819
|
}
|
|
2430
2820
|
|
|
2431
2821
|
// visible for testing
|
|
2432
|
-
function
|
|
2433
|
-
return
|
|
2822
|
+
function Qe(t) {
|
|
2823
|
+
return Oe[t];
|
|
2434
2824
|
}
|
|
2435
2825
|
|
|
2436
|
-
function
|
|
2826
|
+
function We(t) {
|
|
2437
2827
|
return {
|
|
2438
2828
|
fieldPath: t.canonicalString()
|
|
2439
2829
|
};
|
|
2440
2830
|
}
|
|
2441
2831
|
|
|
2442
|
-
function
|
|
2832
|
+
function He(t) {
|
|
2443
2833
|
var e = [];
|
|
2444
2834
|
return t.fields.forEach((function(t) {
|
|
2445
2835
|
return e.push(t.canonicalString());
|
|
@@ -2448,7 +2838,7 @@ function Ge(t) {
|
|
|
2448
2838
|
};
|
|
2449
2839
|
}
|
|
2450
2840
|
|
|
2451
|
-
function
|
|
2841
|
+
function Ye(t) {
|
|
2452
2842
|
// Resource names have at least 4 components (project ID, database ID)
|
|
2453
2843
|
return t.length >= 4 && "projects" === t.get(0) && "databases" === t.get(2);
|
|
2454
2844
|
}
|
|
@@ -2468,8 +2858,8 @@ function ze(t) {
|
|
|
2468
2858
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2469
2859
|
* See the License for the specific language governing permissions and
|
|
2470
2860
|
* limitations under the License.
|
|
2471
|
-
*/ function
|
|
2472
|
-
return new
|
|
2861
|
+
*/ function $e(t) {
|
|
2862
|
+
return new qe(t, /* useProto3Json= */ !0);
|
|
2473
2863
|
}
|
|
2474
2864
|
|
|
2475
2865
|
/**
|
|
@@ -2496,7 +2886,7 @@ function ze(t) {
|
|
|
2496
2886
|
* backoff curve, and a +/- 50% "jitter" that is calculated and added to the
|
|
2497
2887
|
* base delay. This prevents clients from accidentally synchronizing their
|
|
2498
2888
|
* delays causing spikes of load to the backend.
|
|
2499
|
-
*/ var
|
|
2889
|
+
*/ var Xe = /** @class */ function() {
|
|
2500
2890
|
function t(
|
|
2501
2891
|
/**
|
|
2502
2892
|
* The AsyncQueue to run backoff operations on.
|
|
@@ -2522,7 +2912,7 @@ function ze(t) {
|
|
|
2522
2912
|
* much as 1.5*maxDelayMs.
|
|
2523
2913
|
*/ , i) {
|
|
2524
2914
|
void 0 === n && (n = 1e3), void 0 === r && (r = 1.5), void 0 === i && (i = 6e4),
|
|
2525
|
-
this.
|
|
2915
|
+
this.k = t, this.timerId = e, this.C = n, this.L = r, this.M = i, this.U = 0, this.j = null,
|
|
2526
2916
|
/** The last backoff attempt, as epoch milliseconds. */
|
|
2527
2917
|
this.B = Date.now(), this.reset();
|
|
2528
2918
|
}
|
|
@@ -2533,14 +2923,14 @@ function ze(t) {
|
|
|
2533
2923
|
* (i.e. due to an error), initialDelayMs (plus jitter) will be used, and
|
|
2534
2924
|
* subsequent ones will increase according to the backoffFactor.
|
|
2535
2925
|
*/ return t.prototype.reset = function() {
|
|
2536
|
-
this.
|
|
2926
|
+
this.U = 0;
|
|
2537
2927
|
},
|
|
2538
2928
|
/**
|
|
2539
2929
|
* Resets the backoff delay to the maximum delay (e.g. for use after a
|
|
2540
2930
|
* RESOURCE_EXHAUSTED error).
|
|
2541
2931
|
*/
|
|
2542
2932
|
t.prototype.G = function() {
|
|
2543
|
-
this.
|
|
2933
|
+
this.U = this.M;
|
|
2544
2934
|
},
|
|
2545
2935
|
/**
|
|
2546
2936
|
* Returns a promise that resolves after currentDelayMs, and increases the
|
|
@@ -2553,50 +2943,50 @@ function ze(t) {
|
|
|
2553
2943
|
this.cancel();
|
|
2554
2944
|
// First schedule using the current base (which may be 0 and should be
|
|
2555
2945
|
// honored as such).
|
|
2556
|
-
var n = Math.floor(this.
|
|
2946
|
+
var n = Math.floor(this.U + this.K()), r = Math.max(0, Date.now() - this.B), i = Math.max(0, n - r);
|
|
2557
2947
|
// Guard against lastAttemptTime being in the future due to a clock change.
|
|
2558
|
-
i > 0 && w("ExponentialBackoff", "Backing off for " + i + " ms (base delay: " + this.
|
|
2559
|
-
this.
|
|
2948
|
+
i > 0 && w("ExponentialBackoff", "Backing off for " + i + " ms (base delay: " + this.U + " ms, delay with jitter: " + n + " ms, last attempt: " + r + " ms ago)"),
|
|
2949
|
+
this.j = this.k.enqueueAfterDelay(this.timerId, i, (function() {
|
|
2560
2950
|
return e.B = Date.now(), t();
|
|
2561
2951
|
})),
|
|
2562
2952
|
// Apply backoff factor to determine next delay and ensure it is within
|
|
2563
2953
|
// bounds.
|
|
2564
|
-
this.
|
|
2565
|
-
}, t.prototype.
|
|
2566
|
-
null !== this.
|
|
2954
|
+
this.U *= this.L, this.U < this.C && (this.U = this.C), this.U > this.M && (this.U = this.M);
|
|
2955
|
+
}, t.prototype.Y = function() {
|
|
2956
|
+
null !== this.j && (this.j.skipDelay(), this.j = null);
|
|
2567
2957
|
}, t.prototype.cancel = function() {
|
|
2568
|
-
null !== this.
|
|
2958
|
+
null !== this.j && (this.j.cancel(), this.j = null);
|
|
2569
2959
|
},
|
|
2570
|
-
/** Returns a random value in the range [-currentBaseMs/2, currentBaseMs/2] */ t.prototype.
|
|
2571
|
-
return (Math.random() - .5) * this.
|
|
2960
|
+
/** Returns a random value in the range [-currentBaseMs/2, currentBaseMs/2] */ t.prototype.K = function() {
|
|
2961
|
+
return (Math.random() - .5) * this.U;
|
|
2572
2962
|
}, t;
|
|
2573
|
-
}(),
|
|
2963
|
+
}(), Je = /** @class */ function(e) {
|
|
2574
2964
|
function n(t, n, r, i) {
|
|
2575
2965
|
var o = this;
|
|
2576
2966
|
return (o = e.call(this) || this).authCredentials = t, o.appCheckCredentials = n,
|
|
2577
|
-
o.
|
|
2967
|
+
o.H = r, o.q = i, o.J = !1, o;
|
|
2578
2968
|
}
|
|
2579
2969
|
return t(n, e), n.prototype.X = function() {
|
|
2580
|
-
if (this.J) throw new M(
|
|
2970
|
+
if (this.J) throw new M(q, "The client has already been terminated.");
|
|
2581
2971
|
},
|
|
2582
2972
|
/** Invokes the provided RPC with auth and AppCheck tokens. */ n.prototype.m = function(t, e, n) {
|
|
2583
2973
|
var r = this;
|
|
2584
2974
|
return this.X(), Promise.all([ this.authCredentials.getToken(), this.appCheckCredentials.getToken() ]).then((function(i) {
|
|
2585
2975
|
var o = i[0], a = i[1];
|
|
2586
|
-
return r.
|
|
2976
|
+
return r.H.m(t, e, n, o, a);
|
|
2587
2977
|
})).catch((function(t) {
|
|
2588
|
-
throw "FirebaseError" === t.name ? (t.code ===
|
|
2589
|
-
r.appCheckCredentials.invalidateToken()), t) : new M(
|
|
2978
|
+
throw "FirebaseError" === t.name ? (t.code === F && (r.authCredentials.invalidateToken(),
|
|
2979
|
+
r.appCheckCredentials.invalidateToken()), t) : new M(A, t.toString());
|
|
2590
2980
|
}));
|
|
2591
2981
|
},
|
|
2592
2982
|
/** Invokes the provided RPC with streamed results with auth and AppCheck tokens. */ n.prototype.T = function(t, e, n) {
|
|
2593
2983
|
var r = this;
|
|
2594
2984
|
return this.X(), Promise.all([ this.authCredentials.getToken(), this.appCheckCredentials.getToken() ]).then((function(i) {
|
|
2595
2985
|
var o = i[0], a = i[1];
|
|
2596
|
-
return r.
|
|
2986
|
+
return r.H.T(t, e, n, o, a);
|
|
2597
2987
|
})).catch((function(t) {
|
|
2598
|
-
throw "FirebaseError" === t.name ? (t.code ===
|
|
2599
|
-
r.appCheckCredentials.invalidateToken()), t) : new M(
|
|
2988
|
+
throw "FirebaseError" === t.name ? (t.code === F && (r.authCredentials.invalidateToken(),
|
|
2989
|
+
r.appCheckCredentials.invalidateToken()), t) : new M(A, t.toString());
|
|
2600
2990
|
}));
|
|
2601
2991
|
}, n.prototype.terminate = function() {
|
|
2602
2992
|
this.J = !0;
|
|
@@ -2630,60 +3020,60 @@ function ze(t) {
|
|
|
2630
3020
|
*/
|
|
2631
3021
|
// TODO(firestorexp): Make sure there is only one Datastore instance per
|
|
2632
3022
|
// firestore-exp client.
|
|
2633
|
-
function
|
|
3023
|
+
function Ze(t, r) {
|
|
2634
3024
|
return e(this, void 0, void 0, (function() {
|
|
2635
3025
|
var e, i, o;
|
|
2636
3026
|
return n(this, (function(n) {
|
|
2637
3027
|
switch (n.label) {
|
|
2638
3028
|
case 0:
|
|
2639
|
-
return e =
|
|
3029
|
+
return e = k(t), i = ze(e.q) + "/documents", o = {
|
|
2640
3030
|
writes: r.map((function(t) {
|
|
2641
3031
|
return function(t, e) {
|
|
2642
3032
|
var n;
|
|
2643
|
-
if (e instanceof
|
|
2644
|
-
update:
|
|
2645
|
-
}; else if (e instanceof
|
|
2646
|
-
delete:
|
|
2647
|
-
}; else if (e instanceof
|
|
2648
|
-
update:
|
|
2649
|
-
updateMask:
|
|
3033
|
+
if (e instanceof Ve) n = {
|
|
3034
|
+
update: Ge(t, e.key, e.value)
|
|
3035
|
+
}; else if (e instanceof Pe) n = {
|
|
3036
|
+
delete: Me(t, e.key)
|
|
3037
|
+
}; else if (e instanceof De) n = {
|
|
3038
|
+
update: Ge(t, e.key, e.data),
|
|
3039
|
+
updateMask: He(e.fieldMask)
|
|
2650
3040
|
}; else {
|
|
2651
|
-
if (!(e instanceof
|
|
3041
|
+
if (!(e instanceof Ne)) return E();
|
|
2652
3042
|
n = {
|
|
2653
|
-
verify:
|
|
3043
|
+
verify: Me(t, e.key)
|
|
2654
3044
|
};
|
|
2655
3045
|
}
|
|
2656
3046
|
return e.fieldTransforms.length > 0 && (n.updateTransforms = e.fieldTransforms.map((function(t) {
|
|
2657
3047
|
return function(t, e) {
|
|
2658
3048
|
var n = e.transform;
|
|
2659
|
-
if (n instanceof
|
|
3049
|
+
if (n instanceof _e) return {
|
|
2660
3050
|
fieldPath: e.field.canonicalString(),
|
|
2661
3051
|
setToServerValue: "REQUEST_TIME"
|
|
2662
3052
|
};
|
|
2663
|
-
if (n instanceof
|
|
3053
|
+
if (n instanceof Te) return {
|
|
2664
3054
|
fieldPath: e.field.canonicalString(),
|
|
2665
3055
|
appendMissingElements: {
|
|
2666
3056
|
values: n.elements
|
|
2667
3057
|
}
|
|
2668
3058
|
};
|
|
2669
|
-
if (n instanceof
|
|
3059
|
+
if (n instanceof Ee) return {
|
|
2670
3060
|
fieldPath: e.field.canonicalString(),
|
|
2671
3061
|
removeAllFromArray: {
|
|
2672
3062
|
values: n.elements
|
|
2673
3063
|
}
|
|
2674
3064
|
};
|
|
2675
|
-
if (n instanceof
|
|
3065
|
+
if (n instanceof Se) return {
|
|
2676
3066
|
fieldPath: e.field.canonicalString(),
|
|
2677
3067
|
increment: n.O
|
|
2678
3068
|
};
|
|
2679
|
-
throw
|
|
3069
|
+
throw E();
|
|
2680
3070
|
}(0, t);
|
|
2681
3071
|
}))), e.precondition.isNone || (n.currentDocument = function(t, e) {
|
|
2682
3072
|
return void 0 !== e.updateTime ? {
|
|
2683
|
-
updateTime:
|
|
3073
|
+
updateTime: Ce(t, e.updateTime)
|
|
2684
3074
|
} : void 0 !== e.exists ? {
|
|
2685
3075
|
exists: e.exists
|
|
2686
|
-
} :
|
|
3076
|
+
} : E();
|
|
2687
3077
|
}(t, e.precondition)), n;
|
|
2688
3078
|
}(e.q, t);
|
|
2689
3079
|
}))
|
|
@@ -2696,15 +3086,15 @@ function We(t, r) {
|
|
|
2696
3086
|
}));
|
|
2697
3087
|
}
|
|
2698
3088
|
|
|
2699
|
-
function
|
|
3089
|
+
function tn(t, r) {
|
|
2700
3090
|
return e(this, void 0, void 0, (function() {
|
|
2701
3091
|
var e, i, o, a, s, u;
|
|
2702
3092
|
return n(this, (function(n) {
|
|
2703
3093
|
switch (n.label) {
|
|
2704
3094
|
case 0:
|
|
2705
|
-
return e =
|
|
3095
|
+
return e = k(t), i = ze(e.q) + "/documents", o = {
|
|
2706
3096
|
documents: r.map((function(t) {
|
|
2707
|
-
return
|
|
3097
|
+
return Me(e.q, t);
|
|
2708
3098
|
}))
|
|
2709
3099
|
}, [ 4 /*yield*/ , e.T("BatchGetDocuments", i, o) ];
|
|
2710
3100
|
|
|
@@ -2712,44 +3102,44 @@ function Ye(t, r) {
|
|
|
2712
3102
|
return a = n.sent(), s = new Map, a.forEach((function(t) {
|
|
2713
3103
|
var n = function(t, e) {
|
|
2714
3104
|
return "found" in e ? function(t, e) {
|
|
2715
|
-
|
|
2716
|
-
var n =
|
|
3105
|
+
S(!!e.found), e.found.name, e.found.updateTime;
|
|
3106
|
+
var n = Ue(t, e.found.name), r = Le(e.found.updateTime), i = new $t({
|
|
2717
3107
|
mapValue: {
|
|
2718
3108
|
fields: e.found.fields
|
|
2719
3109
|
}
|
|
2720
3110
|
});
|
|
2721
|
-
return
|
|
3111
|
+
return Xt.newFoundDocument(n, r, i);
|
|
2722
3112
|
}(t, e) : "missing" in e ? function(t, e) {
|
|
2723
|
-
|
|
2724
|
-
var n =
|
|
2725
|
-
return
|
|
2726
|
-
}(t, e) :
|
|
3113
|
+
S(!!e.missing), S(!!e.readTime);
|
|
3114
|
+
var n = Ue(t, e.missing), r = Le(e.readTime);
|
|
3115
|
+
return Xt.newNoDocument(n, r);
|
|
3116
|
+
}(t, e) : E();
|
|
2727
3117
|
}(e.q, t);
|
|
2728
3118
|
s.set(n.key.toString(), n);
|
|
2729
3119
|
})), u = [], [ 2 /*return*/ , (r.forEach((function(t) {
|
|
2730
3120
|
var e = s.get(t.toString());
|
|
2731
|
-
|
|
3121
|
+
S(!!e), u.push(e);
|
|
2732
3122
|
})), u) ];
|
|
2733
3123
|
}
|
|
2734
3124
|
}));
|
|
2735
3125
|
}));
|
|
2736
3126
|
}
|
|
2737
3127
|
|
|
2738
|
-
function
|
|
3128
|
+
function en(t, r) {
|
|
2739
3129
|
return e(this, void 0, void 0, (function() {
|
|
2740
3130
|
var e, i;
|
|
2741
3131
|
return n(this, (function(n) {
|
|
2742
3132
|
switch (n.label) {
|
|
2743
3133
|
case 0:
|
|
2744
|
-
return e =
|
|
3134
|
+
return e = k(t), i = function(t, e) {
|
|
2745
3135
|
// Dissect the path into parent, collectionId, and optional key filter.
|
|
2746
3136
|
var n = {
|
|
2747
3137
|
structuredQuery: {}
|
|
2748
3138
|
}, r = e.path;
|
|
2749
|
-
null !== e.collectionGroup ? (n.parent =
|
|
3139
|
+
null !== e.collectionGroup ? (n.parent = Be(t, r), n.structuredQuery.from = [ {
|
|
2750
3140
|
collectionId: e.collectionGroup,
|
|
2751
3141
|
allDescendants: !0
|
|
2752
|
-
} ]) : (n.parent =
|
|
3142
|
+
} ]) : (n.parent = Be(t, r.popLast()), n.structuredQuery.from = [ {
|
|
2753
3143
|
collectionId: r.lastSegment()
|
|
2754
3144
|
} ]);
|
|
2755
3145
|
var i = function(t) {
|
|
@@ -2758,36 +3148,36 @@ function $e(t, r) {
|
|
|
2758
3148
|
// visible for testing
|
|
2759
3149
|
return function(t) {
|
|
2760
3150
|
if ("==" /* EQUAL */ === t.op) {
|
|
2761
|
-
if (
|
|
3151
|
+
if (Wt(t.value)) return {
|
|
2762
3152
|
unaryFilter: {
|
|
2763
|
-
field:
|
|
3153
|
+
field: We(t.field),
|
|
2764
3154
|
op: "IS_NAN"
|
|
2765
3155
|
}
|
|
2766
3156
|
};
|
|
2767
|
-
if (
|
|
3157
|
+
if (Qt(t.value)) return {
|
|
2768
3158
|
unaryFilter: {
|
|
2769
|
-
field:
|
|
3159
|
+
field: We(t.field),
|
|
2770
3160
|
op: "IS_NULL"
|
|
2771
3161
|
}
|
|
2772
3162
|
};
|
|
2773
3163
|
} else if ("!=" /* NOT_EQUAL */ === t.op) {
|
|
2774
|
-
if (
|
|
3164
|
+
if (Wt(t.value)) return {
|
|
2775
3165
|
unaryFilter: {
|
|
2776
|
-
field:
|
|
3166
|
+
field: We(t.field),
|
|
2777
3167
|
op: "IS_NOT_NAN"
|
|
2778
3168
|
}
|
|
2779
3169
|
};
|
|
2780
|
-
if (
|
|
3170
|
+
if (Qt(t.value)) return {
|
|
2781
3171
|
unaryFilter: {
|
|
2782
|
-
field:
|
|
3172
|
+
field: We(t.field),
|
|
2783
3173
|
op: "IS_NOT_NULL"
|
|
2784
3174
|
}
|
|
2785
3175
|
};
|
|
2786
3176
|
}
|
|
2787
3177
|
return {
|
|
2788
3178
|
fieldFilter: {
|
|
2789
|
-
field:
|
|
2790
|
-
op:
|
|
3179
|
+
field: We(t.field),
|
|
3180
|
+
op: Qe(t.op),
|
|
2791
3181
|
value: t.value
|
|
2792
3182
|
}
|
|
2793
3183
|
};
|
|
@@ -2807,15 +3197,15 @@ function $e(t, r) {
|
|
|
2807
3197
|
// visible for testing
|
|
2808
3198
|
return function(t) {
|
|
2809
3199
|
return {
|
|
2810
|
-
field:
|
|
2811
|
-
direction:
|
|
3200
|
+
field: We(t.field),
|
|
3201
|
+
direction: Ke(t.dir)
|
|
2812
3202
|
};
|
|
2813
3203
|
}(t);
|
|
2814
3204
|
}));
|
|
2815
3205
|
}(e.orderBy);
|
|
2816
3206
|
o && (n.structuredQuery.orderBy = o);
|
|
2817
3207
|
var a, s = function(t, e) {
|
|
2818
|
-
return t.
|
|
3208
|
+
return t.S || ct(e) ? e : {
|
|
2819
3209
|
value: e
|
|
2820
3210
|
};
|
|
2821
3211
|
}(t, e.limit);
|
|
@@ -2828,7 +3218,7 @@ function $e(t, r) {
|
|
|
2828
3218
|
values: t.position
|
|
2829
3219
|
};
|
|
2830
3220
|
}(e.endAt)), n;
|
|
2831
|
-
}(e.q,
|
|
3221
|
+
}(e.q, ge(r)), [ 4 /*yield*/ , e.T("RunQuery", i.parent, {
|
|
2832
3222
|
structuredQuery: i.structuredQuery
|
|
2833
3223
|
}) ];
|
|
2834
3224
|
|
|
@@ -2837,11 +3227,11 @@ function $e(t, r) {
|
|
|
2837
3227
|
return !!t.document;
|
|
2838
3228
|
})).map((function(t) {
|
|
2839
3229
|
return function(t, e, n) {
|
|
2840
|
-
var r =
|
|
3230
|
+
var r = Ue(t, e.name), i = Le(e.updateTime), o = new $t({
|
|
2841
3231
|
mapValue: {
|
|
2842
3232
|
fields: e.fields
|
|
2843
3233
|
}
|
|
2844
|
-
}), a =
|
|
3234
|
+
}), a = Xt.newFoundDocument(r, i, o);
|
|
2845
3235
|
return a;
|
|
2846
3236
|
}(e.q, t.document);
|
|
2847
3237
|
})) ];
|
|
@@ -2865,7 +3255,7 @@ function $e(t, r) {
|
|
|
2865
3255
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2866
3256
|
* See the License for the specific language governing permissions and
|
|
2867
3257
|
* limitations under the License.
|
|
2868
|
-
*/ var
|
|
3258
|
+
*/ var nn = new Map;
|
|
2869
3259
|
|
|
2870
3260
|
/**
|
|
2871
3261
|
* An instance map that ensures only one Datastore exists per Firestore
|
|
@@ -2875,17 +3265,17 @@ function $e(t, r) {
|
|
|
2875
3265
|
* Returns an initialized and started Datastore for the given Firestore
|
|
2876
3266
|
* instance. Callers must invoke removeComponents() when the Firestore
|
|
2877
3267
|
* instance is terminated.
|
|
2878
|
-
*/ function
|
|
2879
|
-
if (t._terminated) throw new M(
|
|
2880
|
-
if (!
|
|
3268
|
+
*/ function rn(t) {
|
|
3269
|
+
if (t._terminated) throw new M(q, "The client has already been terminated.");
|
|
3270
|
+
if (!nn.has(t)) {
|
|
2881
3271
|
w("ComponentProvider", "Initializing Datastore");
|
|
2882
3272
|
var e = function(t) {
|
|
2883
|
-
return new
|
|
3273
|
+
return new yt(t, fetch.bind(null));
|
|
2884
3274
|
}((i = t._databaseId, o = t.app.options.appId || "", a = t._persistenceKey, s = t._freezeSettings(),
|
|
2885
|
-
new $(i, o, a, s.host, s.ssl, s.experimentalForceLongPolling, s.experimentalAutoDetectLongPolling, s.useFetchStreams))), n =
|
|
2886
|
-
return new
|
|
3275
|
+
new $(i, o, a, s.host, s.ssl, s.experimentalForceLongPolling, s.experimentalAutoDetectLongPolling, s.useFetchStreams))), n = $e(t._databaseId), r = function(t, e, n, r) {
|
|
3276
|
+
return new Je(t, e, n, r);
|
|
2887
3277
|
}(t._authCredentials, t._appCheckCredentials, e, n);
|
|
2888
|
-
|
|
3278
|
+
nn.set(t, r);
|
|
2889
3279
|
}
|
|
2890
3280
|
var i, o, a, s;
|
|
2891
3281
|
/**
|
|
@@ -2903,7 +3293,7 @@ function $e(t, r) {
|
|
|
2903
3293
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2904
3294
|
* See the License for the specific language governing permissions and
|
|
2905
3295
|
* limitations under the License.
|
|
2906
|
-
*/ return
|
|
3296
|
+
*/ return nn.get(t);
|
|
2907
3297
|
}
|
|
2908
3298
|
|
|
2909
3299
|
/**
|
|
@@ -2914,7 +3304,7 @@ function $e(t, r) {
|
|
|
2914
3304
|
* A concrete type describing all the values that can be applied via a
|
|
2915
3305
|
* user-supplied `FirestoreSettings` object. This is a separate type so that
|
|
2916
3306
|
* defaults can be supplied and the value can be checked for equality.
|
|
2917
|
-
*/ var
|
|
3307
|
+
*/ var on = /** @class */ function() {
|
|
2918
3308
|
function t(t) {
|
|
2919
3309
|
var e;
|
|
2920
3310
|
if (void 0 === t.host) {
|
|
@@ -2934,14 +3324,14 @@ function $e(t, r) {
|
|
|
2934
3324
|
return t.prototype.isEqual = function(t) {
|
|
2935
3325
|
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;
|
|
2936
3326
|
}, t;
|
|
2937
|
-
}(),
|
|
3327
|
+
}(), an = /** @class */ function() {
|
|
2938
3328
|
/** @hideconstructor */
|
|
2939
3329
|
function t(t, e, n) {
|
|
2940
3330
|
this._authCredentials = e, this._appCheckCredentials = n,
|
|
2941
3331
|
/**
|
|
2942
3332
|
* Whether it's a Firestore or Firestore Lite instance.
|
|
2943
3333
|
*/
|
|
2944
|
-
this.type = "firestore-lite", this._persistenceKey = "(lite)", this._settings = new
|
|
3334
|
+
this.type = "firestore-lite", this._persistenceKey = "(lite)", this._settings = new on({}),
|
|
2945
3335
|
this._settingsFrozen = !1, t instanceof X ? this._databaseId = t : (this._app = t,
|
|
2946
3336
|
this._databaseId = function(t) {
|
|
2947
3337
|
if (!Object.prototype.hasOwnProperty.apply(t.options, [ "projectId" ])) throw new M(V, '"projectId" not provided in firebase.initializeApp.');
|
|
@@ -2954,7 +3344,7 @@ function $e(t, r) {
|
|
|
2954
3344
|
* instance.
|
|
2955
3345
|
*/
|
|
2956
3346
|
get: function() {
|
|
2957
|
-
if (!this._app) throw new M(
|
|
3347
|
+
if (!this._app) throw new M(q, "Firestore was not initialized using the Firebase SDK. 'app' is not available");
|
|
2958
3348
|
return this._app;
|
|
2959
3349
|
},
|
|
2960
3350
|
enumerable: !1,
|
|
@@ -2972,15 +3362,15 @@ function $e(t, r) {
|
|
|
2972
3362
|
enumerable: !1,
|
|
2973
3363
|
configurable: !0
|
|
2974
3364
|
}), t.prototype._setSettings = function(t) {
|
|
2975
|
-
if (this._settingsFrozen) throw new M(
|
|
2976
|
-
this._settings = new
|
|
2977
|
-
if (!t) return new
|
|
3365
|
+
if (this._settingsFrozen) throw new M(q, "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.");
|
|
3366
|
+
this._settings = new on(t), void 0 !== t.credentials && (this._authCredentials = function(t) {
|
|
3367
|
+
if (!t) return new z;
|
|
2978
3368
|
switch (t.type) {
|
|
2979
3369
|
case "gapi":
|
|
2980
3370
|
var e = t.client;
|
|
2981
3371
|
// Make sure this really is a Gapi client.
|
|
2982
|
-
return
|
|
2983
|
-
new
|
|
3372
|
+
return S(!("object" != typeof e || null === e || !e.auth || !e.auth.getAuthHeaderValueForFirstParty)),
|
|
3373
|
+
new W(e, t.sessionIndex || "0", t.iamToken || null);
|
|
2984
3374
|
|
|
2985
3375
|
case "provider":
|
|
2986
3376
|
return t.client;
|
|
@@ -3011,8 +3401,8 @@ function $e(t, r) {
|
|
|
3011
3401
|
* Only ever called once.
|
|
3012
3402
|
*/
|
|
3013
3403
|
t.prototype._terminate = function() {
|
|
3014
|
-
return t = this, (e =
|
|
3015
|
-
|
|
3404
|
+
return t = this, (e = nn.get(t)) && (w("ComponentProvider", "Removing Datastore"),
|
|
3405
|
+
nn.delete(t), e.terminate()), Promise.resolve();
|
|
3016
3406
|
var t, e;
|
|
3017
3407
|
}, t;
|
|
3018
3408
|
}();
|
|
@@ -3037,9 +3427,9 @@ function $e(t, r) {
|
|
|
3037
3427
|
* The Cloud Firestore service interface.
|
|
3038
3428
|
*
|
|
3039
3429
|
* Do not call this constructor directly. Instead, use {@link getFirestore}.
|
|
3040
|
-
*/ function
|
|
3430
|
+
*/ function sn(t, e) {
|
|
3041
3431
|
var n = _getProvider(t, "firestore/lite");
|
|
3042
|
-
if (n.isInitialized()) throw new M(
|
|
3432
|
+
if (n.isInitialized()) throw new M(q, "Firestore can only be initialized once per app.");
|
|
3043
3433
|
return n.initialize({
|
|
3044
3434
|
options: e
|
|
3045
3435
|
});
|
|
@@ -3053,7 +3443,7 @@ function $e(t, r) {
|
|
|
3053
3443
|
* @param app - The {@link @firebase/app#FirebaseApp} instance that the returned `Firestore`
|
|
3054
3444
|
* instance is associated with.
|
|
3055
3445
|
* @returns The `Firestore` instance of the provided app.
|
|
3056
|
-
*/ function
|
|
3446
|
+
*/ function un(t) {
|
|
3057
3447
|
return void 0 === t && (t = s()), _getProvider(t, "firestore/lite").getImmediate();
|
|
3058
3448
|
}
|
|
3059
3449
|
|
|
@@ -3069,25 +3459,25 @@ function $e(t, r) {
|
|
|
3069
3459
|
* @param port - the emulator port (ex: 9000).
|
|
3070
3460
|
* @param options.mockUserToken - the mock auth token to use for unit testing
|
|
3071
3461
|
* Security Rules.
|
|
3072
|
-
*/ function
|
|
3462
|
+
*/ function cn(t, e, n, r) {
|
|
3073
3463
|
var i;
|
|
3074
3464
|
void 0 === r && (r = {});
|
|
3075
|
-
var o = (t = st(t,
|
|
3465
|
+
var o = (t = st(t, an))._getSettings();
|
|
3076
3466
|
if ("firestore.googleapis.com" !== o.host && o.host !== e && _("Host has been set in both settings() and useEmulator(), emulator host will be used"),
|
|
3077
3467
|
t._setSettings(Object.assign(Object.assign({}, o), {
|
|
3078
3468
|
host: e + ":" + n,
|
|
3079
3469
|
ssl: !1
|
|
3080
3470
|
})), r.mockUserToken) {
|
|
3081
3471
|
var a, s;
|
|
3082
|
-
if ("string" == typeof r.mockUserToken) a = r.mockUserToken, s =
|
|
3472
|
+
if ("string" == typeof r.mockUserToken) a = r.mockUserToken, s = y.MOCK_USER; else {
|
|
3083
3473
|
// Let createMockUserToken validate first (catches common mistakes like
|
|
3084
3474
|
// invalid field "uid" and missing field "sub" / "user_id".)
|
|
3085
3475
|
a = d(r.mockUserToken, null === (i = t._app) || void 0 === i ? void 0 : i.options.projectId);
|
|
3086
3476
|
var u = r.mockUserToken.sub || r.mockUserToken.user_id;
|
|
3087
3477
|
if (!u) throw new M(V, "mockUserToken must contain 'sub' or 'user_id' field!");
|
|
3088
|
-
s = new
|
|
3478
|
+
s = new y(u);
|
|
3089
3479
|
}
|
|
3090
|
-
t._authCredentials = new
|
|
3480
|
+
t._authCredentials = new G(new B(a, s));
|
|
3091
3481
|
}
|
|
3092
3482
|
}
|
|
3093
3483
|
|
|
@@ -3110,8 +3500,8 @@ function $e(t, r) {
|
|
|
3110
3500
|
* @param firestore - The `Firestore` instance to terminate.
|
|
3111
3501
|
* @returns A `Promise` that is resolved when the instance has been successfully
|
|
3112
3502
|
* terminated.
|
|
3113
|
-
*/ function
|
|
3114
|
-
return t = st(t,
|
|
3503
|
+
*/ function ln(t) {
|
|
3504
|
+
return t = st(t, an), u(t.app, "firestore/lite"), t._delete()
|
|
3115
3505
|
/**
|
|
3116
3506
|
* @license
|
|
3117
3507
|
* Copyright 2020 Google LLC
|
|
@@ -3151,7 +3541,7 @@ function $e(t, r) {
|
|
|
3151
3541
|
*/;
|
|
3152
3542
|
}
|
|
3153
3543
|
|
|
3154
|
-
var
|
|
3544
|
+
var fn = /** @class */ function() {
|
|
3155
3545
|
/** @hideconstructor */
|
|
3156
3546
|
function t(t,
|
|
3157
3547
|
/**
|
|
@@ -3192,14 +3582,14 @@ var an = /** @class */ function() {
|
|
|
3192
3582
|
* The collection this `DocumentReference` belongs to.
|
|
3193
3583
|
*/
|
|
3194
3584
|
get: function() {
|
|
3195
|
-
return new
|
|
3585
|
+
return new pn(this.firestore, this.converter, this._key.path.popLast());
|
|
3196
3586
|
},
|
|
3197
3587
|
enumerable: !1,
|
|
3198
3588
|
configurable: !0
|
|
3199
3589
|
}), t.prototype.withConverter = function(e) {
|
|
3200
3590
|
return new t(this.firestore, e, this._key);
|
|
3201
3591
|
}, t;
|
|
3202
|
-
}(),
|
|
3592
|
+
}(), hn = /** @class */ function() {
|
|
3203
3593
|
// This is the lite version of the Query class in the main SDK.
|
|
3204
3594
|
/** @hideconstructor protected */
|
|
3205
3595
|
function t(t,
|
|
@@ -3214,11 +3604,11 @@ var an = /** @class */ function() {
|
|
|
3214
3604
|
return t.prototype.withConverter = function(e) {
|
|
3215
3605
|
return new t(this.firestore, e, this._query);
|
|
3216
3606
|
}, t;
|
|
3217
|
-
}(),
|
|
3607
|
+
}(), pn = /** @class */ function(e) {
|
|
3218
3608
|
/** @hideconstructor */
|
|
3219
3609
|
function n(t, n, r) {
|
|
3220
3610
|
var i = this;
|
|
3221
|
-
return (i = e.call(this, t, n, new
|
|
3611
|
+
return (i = e.call(this, t, n, new pe(r)) || this)._path = r,
|
|
3222
3612
|
/** The type of this Firestore reference. */
|
|
3223
3613
|
i.type = "collection", i;
|
|
3224
3614
|
}
|
|
@@ -3245,7 +3635,7 @@ var an = /** @class */ function() {
|
|
|
3245
3635
|
*/
|
|
3246
3636
|
get: function() {
|
|
3247
3637
|
var t = this._path.popLast();
|
|
3248
|
-
return t.isEmpty() ? null : new
|
|
3638
|
+
return t.isEmpty() ? null : new fn(this.firestore,
|
|
3249
3639
|
/* converter= */ null, new nt(t));
|
|
3250
3640
|
},
|
|
3251
3641
|
enumerable: !1,
|
|
@@ -3253,20 +3643,20 @@ var an = /** @class */ function() {
|
|
|
3253
3643
|
}), n.prototype.withConverter = function(t) {
|
|
3254
3644
|
return new n(this.firestore, t, this._path);
|
|
3255
3645
|
}, n;
|
|
3256
|
-
}(
|
|
3646
|
+
}(hn);
|
|
3257
3647
|
|
|
3258
3648
|
/**
|
|
3259
3649
|
* A `Query` refers to a query which you can read or listen to. You can also
|
|
3260
3650
|
* construct refined `Query` objects by adding filters and ordering.
|
|
3261
|
-
*/ function
|
|
3651
|
+
*/ function dn(t, e) {
|
|
3262
3652
|
for (var n = [], i = 2; i < arguments.length; i++) n[i - 2] = arguments[i];
|
|
3263
|
-
if (t = p(t), rt("collection", "path", e), t instanceof
|
|
3653
|
+
if (t = p(t), rt("collection", "path", e), t instanceof an) {
|
|
3264
3654
|
var o = Z.fromString.apply(Z, r([ e ], n));
|
|
3265
|
-
return ot(o), new
|
|
3655
|
+
return ot(o), new pn(t, /* converter= */ null, o);
|
|
3266
3656
|
}
|
|
3267
|
-
if (!(t instanceof
|
|
3657
|
+
if (!(t instanceof fn || t instanceof pn)) throw new M(V, "Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");
|
|
3268
3658
|
var a = t._path.child(Z.fromString.apply(Z, r([ e ], n)));
|
|
3269
|
-
return ot(a), new
|
|
3659
|
+
return ot(a), new pn(t.firestore,
|
|
3270
3660
|
/* converter= */ null, a);
|
|
3271
3661
|
}
|
|
3272
3662
|
|
|
@@ -3282,32 +3672,32 @@ var an = /** @class */ function() {
|
|
|
3282
3672
|
* collection or subcollection with this ID as the last segment of its path
|
|
3283
3673
|
* will be included. Cannot contain a slash.
|
|
3284
3674
|
* @returns The created `Query`.
|
|
3285
|
-
*/ function
|
|
3286
|
-
if (t = st(t,
|
|
3287
|
-
return new
|
|
3675
|
+
*/ function yn(t, e) {
|
|
3676
|
+
if (t = st(t, an), rt("collectionGroup", "collection id", e), e.indexOf("/") >= 0) throw new M(V, "Invalid collection ID '" + e + "' passed to function collectionGroup(). Collection IDs must not contain '/'.");
|
|
3677
|
+
return new hn(t,
|
|
3288
3678
|
/* converter= */ null,
|
|
3289
3679
|
/**
|
|
3290
3680
|
* Creates a new Query for a collection group query that matches all documents
|
|
3291
3681
|
* within the provided collection group.
|
|
3292
3682
|
*/
|
|
3293
3683
|
function(t) {
|
|
3294
|
-
return new
|
|
3684
|
+
return new pe(Z.emptyPath(), t);
|
|
3295
3685
|
}(e));
|
|
3296
3686
|
}
|
|
3297
3687
|
|
|
3298
|
-
function
|
|
3688
|
+
function mn(t, e) {
|
|
3299
3689
|
for (var n = [], i = 2; i < arguments.length; i++) n[i - 2] = arguments[i];
|
|
3300
3690
|
if (t = p(t),
|
|
3301
3691
|
// We allow omission of 'pathString' but explicitly prohibit passing in both
|
|
3302
3692
|
// 'undefined' and 'null'.
|
|
3303
|
-
1 === arguments.length && (e = vt.R()), rt("doc", "path", e), t instanceof
|
|
3693
|
+
1 === arguments.length && (e = vt.R()), rt("doc", "path", e), t instanceof an) {
|
|
3304
3694
|
var o = Z.fromString.apply(Z, r([ e ], n));
|
|
3305
|
-
return it(o), new
|
|
3695
|
+
return it(o), new fn(t,
|
|
3306
3696
|
/* converter= */ null, new nt(o));
|
|
3307
3697
|
}
|
|
3308
|
-
if (!(t instanceof
|
|
3698
|
+
if (!(t instanceof fn || t instanceof pn)) throw new M(V, "Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");
|
|
3309
3699
|
var a = t._path.child(Z.fromString.apply(Z, r([ e ], n)));
|
|
3310
|
-
return it(a), new
|
|
3700
|
+
return it(a), new fn(t.firestore, t instanceof pn ? t.converter : null, new nt(a));
|
|
3311
3701
|
}
|
|
3312
3702
|
|
|
3313
3703
|
/**
|
|
@@ -3317,8 +3707,8 @@ function fn(t, e) {
|
|
|
3317
3707
|
* @param right - A reference to compare.
|
|
3318
3708
|
* @returns true if the references point to the same location in the same
|
|
3319
3709
|
* Firestore database.
|
|
3320
|
-
*/ function
|
|
3321
|
-
return t = p(t), e = p(e), (t instanceof
|
|
3710
|
+
*/ function vn(t, e) {
|
|
3711
|
+
return t = p(t), e = p(e), (t instanceof fn || t instanceof pn) && (e instanceof fn || e instanceof pn) && t.firestore === e.firestore && t.path === e.path && t.converter === e.converter
|
|
3322
3712
|
/**
|
|
3323
3713
|
* Returns true if the provided queries point to the same collection and apply
|
|
3324
3714
|
* the same constraints.
|
|
@@ -3330,18 +3720,18 @@ function fn(t, e) {
|
|
|
3330
3720
|
*/;
|
|
3331
3721
|
}
|
|
3332
3722
|
|
|
3333
|
-
function
|
|
3334
|
-
return t = p(t), e = p(e), t instanceof
|
|
3723
|
+
function gn(t, e) {
|
|
3724
|
+
return t = p(t), e = p(e), t instanceof hn && e instanceof hn && t.firestore === e.firestore && function(t, e) {
|
|
3335
3725
|
return function(t, e) {
|
|
3336
3726
|
if (t.limit !== e.limit) return !1;
|
|
3337
3727
|
if (t.orderBy.length !== e.orderBy.length) return !1;
|
|
3338
|
-
for (var n = 0; n < t.orderBy.length; n++) if (!
|
|
3728
|
+
for (var n = 0; n < t.orderBy.length; n++) if (!fe(t.orderBy[n], e.orderBy[n])) return !1;
|
|
3339
3729
|
if (t.filters.length !== e.filters.length) return !1;
|
|
3340
3730
|
for (var r = 0; r < t.filters.length; r++) if (i = t.filters[r], o = e.filters[r],
|
|
3341
|
-
i.op !== o.op || !i.field.isEqual(o.field) || !
|
|
3731
|
+
i.op !== o.op || !i.field.isEqual(o.field) || !Mt(i.value, o.value)) return !1;
|
|
3342
3732
|
var i, o;
|
|
3343
|
-
return t.collectionGroup === e.collectionGroup && !!t.path.isEqual(e.path) && !!
|
|
3344
|
-
}(
|
|
3733
|
+
return t.collectionGroup === e.collectionGroup && !!t.path.isEqual(e.path) && !!he(t.startAt, e.startAt) && he(t.endAt, e.endAt);
|
|
3734
|
+
}(ge(t), ge(e)) && t.limitType === e.limitType;
|
|
3345
3735
|
}(t._query, e._query) && t.converter === e.converter
|
|
3346
3736
|
/**
|
|
3347
3737
|
* @license
|
|
@@ -3369,7 +3759,7 @@ function pn(t, e) {
|
|
|
3369
3759
|
*/;
|
|
3370
3760
|
}
|
|
3371
3761
|
|
|
3372
|
-
var
|
|
3762
|
+
var wn = /** @class */ function() {
|
|
3373
3763
|
/**
|
|
3374
3764
|
* Creates a `FieldPath` from the provided field names. If more than one field
|
|
3375
3765
|
* name is provided, the path will point to a nested field in a document.
|
|
@@ -3394,8 +3784,8 @@ var dn = /** @class */ function() {
|
|
|
3394
3784
|
/**
|
|
3395
3785
|
* Returns a special sentinel `FieldPath` to refer to the ID of a document.
|
|
3396
3786
|
* It can be used in queries to sort or filter by the document ID.
|
|
3397
|
-
*/ function
|
|
3398
|
-
return new
|
|
3787
|
+
*/ function bn() {
|
|
3788
|
+
return new wn("__name__");
|
|
3399
3789
|
}
|
|
3400
3790
|
|
|
3401
3791
|
/**
|
|
@@ -3416,7 +3806,7 @@ var dn = /** @class */ function() {
|
|
|
3416
3806
|
*/
|
|
3417
3807
|
/**
|
|
3418
3808
|
* An immutable object representing an array of bytes.
|
|
3419
|
-
*/ var
|
|
3809
|
+
*/ var _n = /** @class */ function() {
|
|
3420
3810
|
/** @hideconstructor */
|
|
3421
3811
|
function t(t) {
|
|
3422
3812
|
this._byteString = t;
|
|
@@ -3428,7 +3818,7 @@ var dn = /** @class */ function() {
|
|
|
3428
3818
|
* @param base64 - The Base64 string used to create the `Bytes` object.
|
|
3429
3819
|
*/ return t.fromBase64String = function(e) {
|
|
3430
3820
|
try {
|
|
3431
|
-
return new t(
|
|
3821
|
+
return new t(Pt.fromBase64String(e));
|
|
3432
3822
|
} catch (e) {
|
|
3433
3823
|
throw new M(V, "Failed to construct data from Base64 string: " + e);
|
|
3434
3824
|
}
|
|
@@ -3439,7 +3829,7 @@ var dn = /** @class */ function() {
|
|
|
3439
3829
|
* @param array - The Uint8Array used to create the `Bytes` object.
|
|
3440
3830
|
*/
|
|
3441
3831
|
t.fromUint8Array = function(e) {
|
|
3442
|
-
return new t(
|
|
3832
|
+
return new t(Pt.fromUint8Array(e));
|
|
3443
3833
|
},
|
|
3444
3834
|
/**
|
|
3445
3835
|
* Returns the underlying bytes as a Base64-encoded string.
|
|
@@ -3474,14 +3864,14 @@ var dn = /** @class */ function() {
|
|
|
3474
3864
|
t.prototype.isEqual = function(t) {
|
|
3475
3865
|
return this._byteString.isEqual(t._byteString);
|
|
3476
3866
|
}, t;
|
|
3477
|
-
}(),
|
|
3867
|
+
}(), Tn =
|
|
3478
3868
|
/**
|
|
3479
3869
|
* @param _methodName - The public API endpoint that returns this class.
|
|
3480
3870
|
* @hideconstructor
|
|
3481
3871
|
*/
|
|
3482
3872
|
function(t) {
|
|
3483
3873
|
this._methodName = t;
|
|
3484
|
-
},
|
|
3874
|
+
}, En = /** @class */ function() {
|
|
3485
3875
|
/**
|
|
3486
3876
|
* Creates a new immutable `GeoPoint` object with the provided latitude and
|
|
3487
3877
|
* longitude values.
|
|
@@ -3534,21 +3924,21 @@ function(t) {
|
|
|
3534
3924
|
t.prototype._compareTo = function(t) {
|
|
3535
3925
|
return gt(this._lat, t._lat) || gt(this._long, t._long);
|
|
3536
3926
|
}, t;
|
|
3537
|
-
}(),
|
|
3927
|
+
}(), Sn = /^__.*__$/, kn = /** @class */ function() {
|
|
3538
3928
|
function t(t, e, n) {
|
|
3539
3929
|
this.data = t, this.fieldMask = e, this.fieldTransforms = n;
|
|
3540
3930
|
}
|
|
3541
3931
|
return t.prototype.toMutation = function(t, e) {
|
|
3542
|
-
return null !== this.fieldMask ? new
|
|
3932
|
+
return null !== this.fieldMask ? new De(t, this.data, this.fieldMask, e, this.fieldTransforms) : new Ve(t, this.data, e, this.fieldTransforms);
|
|
3543
3933
|
}, t;
|
|
3544
|
-
}(),
|
|
3934
|
+
}(), In = /** @class */ function() {
|
|
3545
3935
|
function t(t,
|
|
3546
3936
|
// The fieldMask does not include document transforms.
|
|
3547
3937
|
e, n) {
|
|
3548
3938
|
this.data = t, this.fieldMask = e, this.fieldTransforms = n;
|
|
3549
3939
|
}
|
|
3550
3940
|
return t.prototype.toMutation = function(t, e) {
|
|
3551
|
-
return new
|
|
3941
|
+
return new De(t, this.data, this.fieldMask, e, this.fieldTransforms);
|
|
3552
3942
|
}, t;
|
|
3553
3943
|
}();
|
|
3554
3944
|
|
|
@@ -3571,7 +3961,7 @@ function(t) {
|
|
|
3571
3961
|
/**
|
|
3572
3962
|
* Sentinel values that can be used when writing document fields with `set()`
|
|
3573
3963
|
* or `update()`.
|
|
3574
|
-
*/ function
|
|
3964
|
+
*/ function An(t) {
|
|
3575
3965
|
switch (t) {
|
|
3576
3966
|
case 0 /* Set */ :
|
|
3577
3967
|
// fall through
|
|
@@ -3585,11 +3975,11 @@ function(t) {
|
|
|
3585
3975
|
return !1;
|
|
3586
3976
|
|
|
3587
3977
|
default:
|
|
3588
|
-
throw
|
|
3978
|
+
throw E();
|
|
3589
3979
|
}
|
|
3590
3980
|
}
|
|
3591
3981
|
|
|
3592
|
-
/** A "context" object passed around while parsing user data. */ var
|
|
3982
|
+
/** A "context" object passed around while parsing user data. */ var Vn = /** @class */ function() {
|
|
3593
3983
|
/**
|
|
3594
3984
|
* Initializes a ParseContext with the given source and path.
|
|
3595
3985
|
*
|
|
@@ -3649,7 +4039,7 @@ function(t) {
|
|
|
3649
4039
|
rt: !0
|
|
3650
4040
|
});
|
|
3651
4041
|
}, t.prototype.ut = function(t) {
|
|
3652
|
-
return
|
|
4042
|
+
return Hn(t, this.settings.methodName, this.settings.ct || !1, this.path, this.settings.at);
|
|
3653
4043
|
},
|
|
3654
4044
|
/** Returns 'true' if 'fieldPath' was traversed when creating this context. */ t.prototype.contains = function(t) {
|
|
3655
4045
|
return void 0 !== this.fieldMask.find((function(e) {
|
|
@@ -3663,15 +4053,15 @@ function(t) {
|
|
|
3663
4053
|
if (this.path) for (var t = 0; t < this.path.length; t++) this.st(this.path.get(t));
|
|
3664
4054
|
}, t.prototype.st = function(t) {
|
|
3665
4055
|
if (0 === t.length) throw this.ut("Document fields must not be empty");
|
|
3666
|
-
if (
|
|
4056
|
+
if (An(this.tt) && Sn.test(t)) throw this.ut('Document fields cannot begin and end with "__"');
|
|
3667
4057
|
}, t;
|
|
3668
|
-
}(),
|
|
4058
|
+
}(), Dn = /** @class */ function() {
|
|
3669
4059
|
function t(t, e, n) {
|
|
3670
|
-
this.databaseId = t, this.ignoreUndefinedProperties = e, this.q = n ||
|
|
4060
|
+
this.databaseId = t, this.ignoreUndefinedProperties = e, this.q = n || $e(t)
|
|
3671
4061
|
/** Creates a new top-level parse context. */;
|
|
3672
4062
|
}
|
|
3673
4063
|
return t.prototype.ht = function(t, e, n, r) {
|
|
3674
|
-
return void 0 === r && (r = !1), new
|
|
4064
|
+
return void 0 === r && (r = !1), new Vn({
|
|
3675
4065
|
tt: t,
|
|
3676
4066
|
methodName: e,
|
|
3677
4067
|
at: n,
|
|
@@ -3685,30 +4075,30 @@ function(t) {
|
|
|
3685
4075
|
/**
|
|
3686
4076
|
* Helper for parsing raw user input (provided via the API) into internal model
|
|
3687
4077
|
* classes.
|
|
3688
|
-
*/ function
|
|
3689
|
-
var e = t._freezeSettings(), n =
|
|
3690
|
-
return new
|
|
4078
|
+
*/ function Pn(t) {
|
|
4079
|
+
var e = t._freezeSettings(), n = $e(t._databaseId);
|
|
4080
|
+
return new Dn(t._databaseId, !!e.ignoreUndefinedProperties, n);
|
|
3691
4081
|
}
|
|
3692
4082
|
|
|
3693
|
-
/** Parse document data from a set() call. */ function
|
|
4083
|
+
/** Parse document data from a set() call. */ function Nn(t, e, n, r, i, o) {
|
|
3694
4084
|
void 0 === o && (o = {});
|
|
3695
4085
|
var a = t.ht(o.merge || o.mergeFields ? 2 /* MergeSet */ : 0 /* Set */ , e, n, i);
|
|
3696
|
-
|
|
3697
|
-
var s, u, c =
|
|
3698
|
-
if (o.merge) s = new
|
|
4086
|
+
Gn("Data must be an object, but it was:", a, r);
|
|
4087
|
+
var s, u, c = Bn(r, a);
|
|
4088
|
+
if (o.merge) s = new Dt(a.fieldMask), u = a.fieldTransforms; else if (o.mergeFields) {
|
|
3699
4089
|
for (var l = [], f = 0, h = o.mergeFields; f < h.length; f++) {
|
|
3700
|
-
var p =
|
|
4090
|
+
var p = Kn(e, h[f], n);
|
|
3701
4091
|
if (!a.contains(p)) throw new M(V, "Field '" + p + "' is specified in your field mask but missing from your input data.");
|
|
3702
|
-
|
|
4092
|
+
Yn(l, p) || l.push(p);
|
|
3703
4093
|
}
|
|
3704
|
-
s = new
|
|
4094
|
+
s = new Dt(l), u = a.fieldTransforms.filter((function(t) {
|
|
3705
4095
|
return s.covers(t.field);
|
|
3706
4096
|
}));
|
|
3707
4097
|
} else s = null, u = a.fieldTransforms;
|
|
3708
|
-
return new
|
|
4098
|
+
return new kn(new $t(c), s, u);
|
|
3709
4099
|
}
|
|
3710
4100
|
|
|
3711
|
-
var
|
|
4101
|
+
var Fn = /** @class */ function(e) {
|
|
3712
4102
|
function n() {
|
|
3713
4103
|
return null !== e && e.apply(this, arguments) || this;
|
|
3714
4104
|
}
|
|
@@ -3720,7 +4110,7 @@ var kn = /** @class */ function(e) {
|
|
|
3720
4110
|
}, n.prototype.isEqual = function(t) {
|
|
3721
4111
|
return t instanceof n;
|
|
3722
4112
|
}, n;
|
|
3723
|
-
}(
|
|
4113
|
+
}(Tn);
|
|
3724
4114
|
|
|
3725
4115
|
/**
|
|
3726
4116
|
* Creates a child context for parsing SerializableFieldValues.
|
|
@@ -3737,8 +4127,8 @@ var kn = /** @class */ function(e) {
|
|
|
3737
4127
|
* context.
|
|
3738
4128
|
* @param context - The parent context.
|
|
3739
4129
|
* @param arrayElement - Whether or not the FieldValue has an array.
|
|
3740
|
-
*/ function
|
|
3741
|
-
return new
|
|
4130
|
+
*/ function On(t, e, n) {
|
|
4131
|
+
return new Vn({
|
|
3742
4132
|
tt: 3 /* Argument */ ,
|
|
3743
4133
|
at: e.settings.at,
|
|
3744
4134
|
methodName: t._methodName,
|
|
@@ -3746,101 +4136,101 @@ var kn = /** @class */ function(e) {
|
|
|
3746
4136
|
}, e.databaseId, e.q, e.ignoreUndefinedProperties);
|
|
3747
4137
|
}
|
|
3748
4138
|
|
|
3749
|
-
var
|
|
4139
|
+
var qn = /** @class */ function(e) {
|
|
3750
4140
|
function n() {
|
|
3751
4141
|
return null !== e && e.apply(this, arguments) || this;
|
|
3752
4142
|
}
|
|
3753
4143
|
return t(n, e), n.prototype._toFieldTransform = function(t) {
|
|
3754
|
-
return new
|
|
4144
|
+
return new ke(t.path, new _e);
|
|
3755
4145
|
}, n.prototype.isEqual = function(t) {
|
|
3756
4146
|
return t instanceof n;
|
|
3757
4147
|
}, n;
|
|
3758
|
-
}(
|
|
4148
|
+
}(Tn), Rn = /** @class */ function(e) {
|
|
3759
4149
|
function n(t, n) {
|
|
3760
4150
|
var r = this;
|
|
3761
4151
|
return (r = e.call(this, t) || this).lt = n, r;
|
|
3762
4152
|
}
|
|
3763
4153
|
return t(n, e), n.prototype._toFieldTransform = function(t) {
|
|
3764
|
-
var e =
|
|
4154
|
+
var e = On(this, t,
|
|
3765
4155
|
/*array=*/ !0), n = this.lt.map((function(t) {
|
|
3766
|
-
return
|
|
3767
|
-
})), r = new
|
|
3768
|
-
return new
|
|
4156
|
+
return Un(t, e);
|
|
4157
|
+
})), r = new Te(n);
|
|
4158
|
+
return new ke(t.path, r);
|
|
3769
4159
|
}, n.prototype.isEqual = function(t) {
|
|
3770
4160
|
// TODO(mrschmidt): Implement isEquals
|
|
3771
4161
|
return this === t;
|
|
3772
4162
|
}, n;
|
|
3773
|
-
}(
|
|
4163
|
+
}(Tn), xn = /** @class */ function(e) {
|
|
3774
4164
|
function n(t, n) {
|
|
3775
4165
|
var r = this;
|
|
3776
4166
|
return (r = e.call(this, t) || this).lt = n, r;
|
|
3777
4167
|
}
|
|
3778
4168
|
return t(n, e), n.prototype._toFieldTransform = function(t) {
|
|
3779
|
-
var e =
|
|
4169
|
+
var e = On(this, t,
|
|
3780
4170
|
/*array=*/ !0), n = this.lt.map((function(t) {
|
|
3781
|
-
return
|
|
3782
|
-
})), r = new
|
|
3783
|
-
return new
|
|
4171
|
+
return Un(t, e);
|
|
4172
|
+
})), r = new Ee(n);
|
|
4173
|
+
return new ke(t.path, r);
|
|
3784
4174
|
}, n.prototype.isEqual = function(t) {
|
|
3785
4175
|
// TODO(mrschmidt): Implement isEquals
|
|
3786
4176
|
return this === t;
|
|
3787
4177
|
}, n;
|
|
3788
|
-
}(
|
|
4178
|
+
}(Tn), Cn = /** @class */ function(e) {
|
|
3789
4179
|
function n(t, n) {
|
|
3790
4180
|
var r = this;
|
|
3791
4181
|
return (r = e.call(this, t) || this).ft = n, r;
|
|
3792
4182
|
}
|
|
3793
4183
|
return t(n, e), n.prototype._toFieldTransform = function(t) {
|
|
3794
|
-
var e = new
|
|
3795
|
-
return new
|
|
4184
|
+
var e = new Se(t.q, we(t.q, this.ft));
|
|
4185
|
+
return new ke(t.path, e);
|
|
3796
4186
|
}, n.prototype.isEqual = function(t) {
|
|
3797
4187
|
// TODO(mrschmidt): Implement isEquals
|
|
3798
4188
|
return this === t;
|
|
3799
4189
|
}, n;
|
|
3800
|
-
}(
|
|
4190
|
+
}(Tn);
|
|
3801
4191
|
|
|
3802
|
-
/** Parse update data from an update() call. */ function
|
|
4192
|
+
/** Parse update data from an update() call. */ function Ln(t, e, n, r) {
|
|
3803
4193
|
var i = t.ht(1 /* Update */ , e, n);
|
|
3804
|
-
|
|
3805
|
-
var o = [], a =
|
|
3806
|
-
|
|
3807
|
-
var s =
|
|
4194
|
+
Gn("Data must be an object, but it was:", i, r);
|
|
4195
|
+
var o = [], a = $t.empty();
|
|
4196
|
+
Et(r, (function(t, r) {
|
|
4197
|
+
var s = Wn(e, t, n);
|
|
3808
4198
|
// For Compat types, we have to "extract" the underlying types before
|
|
3809
4199
|
// performing validation.
|
|
3810
4200
|
r = p(r);
|
|
3811
4201
|
var u = i.it(s);
|
|
3812
|
-
if (r instanceof
|
|
4202
|
+
if (r instanceof Fn)
|
|
3813
4203
|
// Add it to the field mask, but don't add anything to updateData.
|
|
3814
4204
|
o.push(s); else {
|
|
3815
|
-
var c =
|
|
4205
|
+
var c = Un(r, u);
|
|
3816
4206
|
null != c && (o.push(s), a.set(s, c));
|
|
3817
4207
|
}
|
|
3818
4208
|
}));
|
|
3819
|
-
var s = new
|
|
3820
|
-
return new
|
|
4209
|
+
var s = new Dt(o);
|
|
4210
|
+
return new In(a, s, i.fieldTransforms);
|
|
3821
4211
|
}
|
|
3822
4212
|
|
|
3823
|
-
/** Parse update data from a list of field/value arguments. */ function
|
|
3824
|
-
var a = t.ht(1 /* Update */ , e, n), s = [
|
|
4213
|
+
/** Parse update data from a list of field/value arguments. */ function jn(t, e, n, r, i, o) {
|
|
4214
|
+
var a = t.ht(1 /* Update */ , e, n), s = [ Kn(e, r, n) ], u = [ i ];
|
|
3825
4215
|
if (o.length % 2 != 0) throw new M(V, "Function " + e + "() needs to be called with an even number of arguments that alternate between field names and values.");
|
|
3826
|
-
for (var c = 0; c < o.length; c += 2) s.push(
|
|
4216
|
+
for (var c = 0; c < o.length; c += 2) s.push(Kn(e, o[c])), u.push(o[c + 1]);
|
|
3827
4217
|
// We iterate in reverse order to pick the last value for a field if the
|
|
3828
4218
|
// user specified the field multiple times.
|
|
3829
|
-
for (var l = [], f =
|
|
3830
|
-
var d = s[h],
|
|
4219
|
+
for (var l = [], f = $t.empty(), h = s.length - 1; h >= 0; --h) if (!Yn(l, s[h])) {
|
|
4220
|
+
var d = s[h], y = u[h];
|
|
3831
4221
|
// For Compat types, we have to "extract" the underlying types before
|
|
3832
4222
|
// performing validation.
|
|
3833
|
-
|
|
3834
|
-
var
|
|
3835
|
-
if (
|
|
4223
|
+
y = p(y);
|
|
4224
|
+
var m = a.it(d);
|
|
4225
|
+
if (y instanceof Fn)
|
|
3836
4226
|
// Add it to the field mask, but don't add anything to updateData.
|
|
3837
4227
|
l.push(d); else {
|
|
3838
|
-
var v =
|
|
4228
|
+
var v = Un(y, m);
|
|
3839
4229
|
null != v && (l.push(d), f.set(d, v));
|
|
3840
4230
|
}
|
|
3841
4231
|
}
|
|
3842
|
-
var g = new
|
|
3843
|
-
return new
|
|
4232
|
+
var g = new Dt(l);
|
|
4233
|
+
return new In(f, g, a.fieldTransforms);
|
|
3844
4234
|
}
|
|
3845
4235
|
|
|
3846
4236
|
/**
|
|
@@ -3849,8 +4239,8 @@ var Dn = /** @class */ function(e) {
|
|
|
3849
4239
|
*
|
|
3850
4240
|
* @param allowArrays - Whether the query value is an array that may directly
|
|
3851
4241
|
* contain additional arrays (e.g. the operand of an `in` query).
|
|
3852
|
-
*/ function
|
|
3853
|
-
return void 0 === r && (r = !1),
|
|
4242
|
+
*/ function Mn(t, e, n, r) {
|
|
4243
|
+
return void 0 === r && (r = !1), Un(n, t.ht(r ? 4 /* ArrayArgument */ : 3 /* Argument */ , e));
|
|
3854
4244
|
}
|
|
3855
4245
|
|
|
3856
4246
|
/**
|
|
@@ -3861,12 +4251,12 @@ var Dn = /** @class */ function(e) {
|
|
|
3861
4251
|
* the source of the data being parsed, etc.
|
|
3862
4252
|
* @returns The parsed value, or null if the value was a FieldValue sentinel
|
|
3863
4253
|
* that should not be included in the resulting parsed data.
|
|
3864
|
-
*/ function
|
|
3865
|
-
if (
|
|
4254
|
+
*/ function Un(t, e) {
|
|
4255
|
+
if (zn(
|
|
3866
4256
|
// Unwrap the API type from the Compat SDK. This will return the API type
|
|
3867
4257
|
// from firestore-exp.
|
|
3868
|
-
t = p(t))) return
|
|
3869
|
-
if (t instanceof
|
|
4258
|
+
t = p(t))) return Gn("Unsupported field value:", e, t), Bn(t, e);
|
|
4259
|
+
if (t instanceof Tn)
|
|
3870
4260
|
// FieldValues usually parse into transforms (except deleteField())
|
|
3871
4261
|
// in which case we do not want to include this field in our parsed data
|
|
3872
4262
|
// (as doing so will overwrite the field directly prior to the transform
|
|
@@ -3878,7 +4268,7 @@ var Dn = /** @class */ function(e) {
|
|
|
3878
4268
|
*/
|
|
3879
4269
|
return function(t, e) {
|
|
3880
4270
|
// Sentinels are only supported with writes, and not within arrays.
|
|
3881
|
-
if (!
|
|
4271
|
+
if (!An(e.tt)) throw e.ut(t._methodName + "() can only be used with update() and set()");
|
|
3882
4272
|
if (!e.path) throw e.ut(t._methodName + "() is not currently supported inside arrays");
|
|
3883
4273
|
var n = t._toFieldTransform(e);
|
|
3884
4274
|
n && e.fieldTransforms.push(n);
|
|
@@ -3901,7 +4291,7 @@ var Dn = /** @class */ function(e) {
|
|
|
3901
4291
|
if (e.settings.rt && 4 /* ArrayArgument */ !== e.tt) throw e.ut("Nested arrays are not supported");
|
|
3902
4292
|
return function(t, e) {
|
|
3903
4293
|
for (var n = [], r = 0, i = 0, o = t; i < o.length; i++) {
|
|
3904
|
-
var a =
|
|
4294
|
+
var a = Un(o[i], e.ot(r));
|
|
3905
4295
|
null == a && (
|
|
3906
4296
|
// Just include nulls in the array for fields being replaced with a
|
|
3907
4297
|
// sentinel.
|
|
@@ -3920,7 +4310,7 @@ var Dn = /** @class */ function(e) {
|
|
|
3920
4310
|
if (null === (t = p(t))) return {
|
|
3921
4311
|
nullValue: "NULL_VALUE"
|
|
3922
4312
|
};
|
|
3923
|
-
if ("number" == typeof t) return
|
|
4313
|
+
if ("number" == typeof t) return we(e.q, t);
|
|
3924
4314
|
if ("boolean" == typeof t) return {
|
|
3925
4315
|
booleanValue: t
|
|
3926
4316
|
};
|
|
@@ -3930,7 +4320,7 @@ var Dn = /** @class */ function(e) {
|
|
|
3930
4320
|
if (t instanceof Date) {
|
|
3931
4321
|
var n = bt.fromDate(t);
|
|
3932
4322
|
return {
|
|
3933
|
-
timestampValue:
|
|
4323
|
+
timestampValue: Re(e.q, n)
|
|
3934
4324
|
};
|
|
3935
4325
|
}
|
|
3936
4326
|
if (t instanceof bt) {
|
|
@@ -3939,30 +4329,30 @@ var Dn = /** @class */ function(e) {
|
|
|
3939
4329
|
// truncation immediately without waiting for the backend to do that.
|
|
3940
4330
|
var r = new bt(t.seconds, 1e3 * Math.floor(t.nanoseconds / 1e3));
|
|
3941
4331
|
return {
|
|
3942
|
-
timestampValue:
|
|
4332
|
+
timestampValue: Re(e.q, r)
|
|
3943
4333
|
};
|
|
3944
4334
|
}
|
|
3945
|
-
if (t instanceof
|
|
4335
|
+
if (t instanceof En) return {
|
|
3946
4336
|
geoPointValue: {
|
|
3947
4337
|
latitude: t.latitude,
|
|
3948
4338
|
longitude: t.longitude
|
|
3949
4339
|
}
|
|
3950
4340
|
};
|
|
3951
|
-
if (t instanceof
|
|
3952
|
-
bytesValue:
|
|
4341
|
+
if (t instanceof _n) return {
|
|
4342
|
+
bytesValue: xe(e.q, t._byteString)
|
|
3953
4343
|
};
|
|
3954
|
-
if (t instanceof
|
|
4344
|
+
if (t instanceof fn) {
|
|
3955
4345
|
var i = e.databaseId, o = t.firestore._databaseId;
|
|
3956
4346
|
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);
|
|
3957
4347
|
return {
|
|
3958
|
-
referenceValue:
|
|
4348
|
+
referenceValue: je(t.firestore._databaseId || e.databaseId, t._key.path)
|
|
3959
4349
|
};
|
|
3960
4350
|
}
|
|
3961
4351
|
throw e.ut("Unsupported field value: " + at(t));
|
|
3962
4352
|
}(t, e);
|
|
3963
4353
|
}
|
|
3964
4354
|
|
|
3965
|
-
function
|
|
4355
|
+
function Bn(t, e) {
|
|
3966
4356
|
var n = {};
|
|
3967
4357
|
return function(t) {
|
|
3968
4358
|
for (var e in t) if (Object.prototype.hasOwnProperty.call(t, e)) return !1;
|
|
@@ -3970,8 +4360,8 @@ function Ln(t, e) {
|
|
|
3970
4360
|
}(t) ?
|
|
3971
4361
|
// If we encounter an empty object, we explicitly add it to the update
|
|
3972
4362
|
// mask to ensure that the server creates a map entry.
|
|
3973
|
-
e.path && e.path.length > 0 && e.fieldMask.push(e.path) :
|
|
3974
|
-
var i =
|
|
4363
|
+
e.path && e.path.length > 0 && e.fieldMask.push(e.path) : Et(t, (function(t, r) {
|
|
4364
|
+
var i = Un(r, e.nt(t));
|
|
3975
4365
|
null != i && (n[t] = i);
|
|
3976
4366
|
})), {
|
|
3977
4367
|
mapValue: {
|
|
@@ -3980,12 +4370,12 @@ function Ln(t, e) {
|
|
|
3980
4370
|
};
|
|
3981
4371
|
}
|
|
3982
4372
|
|
|
3983
|
-
function
|
|
3984
|
-
return !("object" != typeof t || null === t || t instanceof Array || t instanceof Date || t instanceof bt || t instanceof
|
|
4373
|
+
function zn(t) {
|
|
4374
|
+
return !("object" != typeof t || null === t || t instanceof Array || t instanceof Date || t instanceof bt || t instanceof En || t instanceof _n || t instanceof fn || t instanceof Tn);
|
|
3985
4375
|
}
|
|
3986
4376
|
|
|
3987
|
-
function
|
|
3988
|
-
if (!
|
|
4377
|
+
function Gn(t, e, n) {
|
|
4378
|
+
if (!zn(n) || !function(t) {
|
|
3989
4379
|
return "object" == typeof t && null !== t && (Object.getPrototypeOf(t) === Object.prototype || null === Object.getPrototypeOf(t));
|
|
3990
4380
|
}(n)) {
|
|
3991
4381
|
var r = at(n);
|
|
@@ -3995,20 +4385,20 @@ function xn(t, e, n) {
|
|
|
3995
4385
|
|
|
3996
4386
|
/**
|
|
3997
4387
|
* Helper that calls fromDotSeparatedString() but wraps any error thrown.
|
|
3998
|
-
*/ function
|
|
4388
|
+
*/ function Kn(t, e, n) {
|
|
3999
4389
|
if (
|
|
4000
4390
|
// If required, replace the FieldPath Compat class with with the firestore-exp
|
|
4001
4391
|
// FieldPath.
|
|
4002
|
-
(e = p(e)) instanceof
|
|
4003
|
-
if ("string" == typeof e) return
|
|
4004
|
-
throw
|
|
4392
|
+
(e = p(e)) instanceof wn) return e._internalPath;
|
|
4393
|
+
if ("string" == typeof e) return Wn(t, e);
|
|
4394
|
+
throw Hn("Field path arguments must be of type string or ", t,
|
|
4005
4395
|
/* hasConverter= */ !1,
|
|
4006
4396
|
/* path= */ void 0, n);
|
|
4007
4397
|
}
|
|
4008
4398
|
|
|
4009
4399
|
/**
|
|
4010
4400
|
* Matches any characters in a field path string that are reserved.
|
|
4011
|
-
*/ var
|
|
4401
|
+
*/ var Qn = new RegExp("[~\\*/\\[\\]]");
|
|
4012
4402
|
|
|
4013
4403
|
/**
|
|
4014
4404
|
* Wraps fromDotSeparatedString with an error message about the method that
|
|
@@ -4018,20 +4408,20 @@ function xn(t, e, n) {
|
|
|
4018
4408
|
* split on dots.
|
|
4019
4409
|
* @param targetDoc - The document against which the field path will be
|
|
4020
4410
|
* evaluated.
|
|
4021
|
-
*/ function
|
|
4022
|
-
if (e.search(
|
|
4411
|
+
*/ function Wn(t, e, n) {
|
|
4412
|
+
if (e.search(Qn) >= 0) throw Hn("Invalid field path (" + e + "). Paths must not contain '~', '*', '/', '[', or ']'", t,
|
|
4023
4413
|
/* hasConverter= */ !1,
|
|
4024
4414
|
/* path= */ void 0, n);
|
|
4025
4415
|
try {
|
|
4026
|
-
return (new (
|
|
4416
|
+
return (new (wn.bind.apply(wn, r([ void 0 ], e.split(".")))))._internalPath;
|
|
4027
4417
|
} catch (r) {
|
|
4028
|
-
throw
|
|
4418
|
+
throw Hn("Invalid field path (" + e + "). Paths must not be empty, begin with '.', end with '.', or contain '..'", t,
|
|
4029
4419
|
/* hasConverter= */ !1,
|
|
4030
4420
|
/* path= */ void 0, n);
|
|
4031
4421
|
}
|
|
4032
4422
|
}
|
|
4033
4423
|
|
|
4034
|
-
function
|
|
4424
|
+
function Hn(t, e, n, r, i) {
|
|
4035
4425
|
var o = r && !r.isEmpty(), a = void 0 !== i, s = "Function " + e + "() called with invalid data";
|
|
4036
4426
|
n && (s += " (via `toFirestore()`)");
|
|
4037
4427
|
var u = "";
|
|
@@ -4040,7 +4430,7 @@ function Gn(t, e, n, r, i) {
|
|
|
4040
4430
|
/** Checks `haystack` if FieldPath `needle` is present. Runs in O(n). */;
|
|
4041
4431
|
}
|
|
4042
4432
|
|
|
4043
|
-
function
|
|
4433
|
+
function Yn(t, e) {
|
|
4044
4434
|
return t.some((function(t) {
|
|
4045
4435
|
return t.isEqual(e);
|
|
4046
4436
|
}));
|
|
@@ -4070,7 +4460,7 @@ function zn(t, e) {
|
|
|
4070
4460
|
* For a `DocumentSnapshot` that points to a non-existing document, any data
|
|
4071
4461
|
* access will return 'undefined'. You can use the `exists()` method to
|
|
4072
4462
|
* explicitly verify a document's existence.
|
|
4073
|
-
*/ var
|
|
4463
|
+
*/ var $n = /** @class */ function() {
|
|
4074
4464
|
// Note: This class is stripped down version of the DocumentSnapshot in
|
|
4075
4465
|
// the legacy SDK. The changes are:
|
|
4076
4466
|
// - No support for SnapshotMetadata.
|
|
@@ -4091,7 +4481,7 @@ function zn(t, e) {
|
|
|
4091
4481
|
* The `DocumentReference` for the document included in the `DocumentSnapshot`.
|
|
4092
4482
|
*/
|
|
4093
4483
|
get: function() {
|
|
4094
|
-
return new
|
|
4484
|
+
return new fn(this._firestore, this._converter, this._key);
|
|
4095
4485
|
},
|
|
4096
4486
|
enumerable: !1,
|
|
4097
4487
|
configurable: !0
|
|
@@ -4116,7 +4506,7 @@ function zn(t, e) {
|
|
|
4116
4506
|
if (this._converter) {
|
|
4117
4507
|
// We only want to use the converter and create a new DocumentSnapshot
|
|
4118
4508
|
// if a converter has been provided.
|
|
4119
|
-
var t = new
|
|
4509
|
+
var t = new Xn(this._firestore, this._userDataWriter, this._key, this._document,
|
|
4120
4510
|
/* converter= */ null);
|
|
4121
4511
|
return this._converter.fromFirestore(t);
|
|
4122
4512
|
}
|
|
@@ -4136,11 +4526,11 @@ function zn(t, e) {
|
|
|
4136
4526
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4137
4527
|
t.prototype.get = function(t) {
|
|
4138
4528
|
if (this._document) {
|
|
4139
|
-
var e = this._document.data.field(
|
|
4529
|
+
var e = this._document.data.field(tr("DocumentSnapshot.get", t));
|
|
4140
4530
|
if (null !== e) return this._userDataWriter.convertValue(e);
|
|
4141
4531
|
}
|
|
4142
4532
|
}, t;
|
|
4143
|
-
}(),
|
|
4533
|
+
}(), Xn = /** @class */ function(e) {
|
|
4144
4534
|
function n() {
|
|
4145
4535
|
return null !== e && e.apply(this, arguments) || this;
|
|
4146
4536
|
}
|
|
@@ -4152,7 +4542,7 @@ function zn(t, e) {
|
|
|
4152
4542
|
*/ return t(n, e), n.prototype.data = function() {
|
|
4153
4543
|
return e.prototype.data.call(this);
|
|
4154
4544
|
}, n;
|
|
4155
|
-
}(
|
|
4545
|
+
}($n), Jn = /** @class */ function() {
|
|
4156
4546
|
/** @hideconstructor */
|
|
4157
4547
|
function t(t, e) {
|
|
4158
4548
|
this._docs = e, this.query = t;
|
|
@@ -4206,15 +4596,15 @@ function zn(t, e) {
|
|
|
4206
4596
|
* @param right - A snapshot to compare.
|
|
4207
4597
|
* @returns true if the snapshots are equal.
|
|
4208
4598
|
*/
|
|
4209
|
-
function
|
|
4210
|
-
return t = p(t), e = p(e), t instanceof
|
|
4599
|
+
function Zn(t, e) {
|
|
4600
|
+
return t = p(t), e = p(e), t instanceof $n && e instanceof $n ? 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 Jn && e instanceof Jn && gn(t.query, e.query) && wt(t.docs, e.docs, Zn)
|
|
4211
4601
|
/**
|
|
4212
4602
|
* Helper that calls `fromDotSeparatedString()` but wraps any error thrown.
|
|
4213
4603
|
*/;
|
|
4214
4604
|
}
|
|
4215
4605
|
|
|
4216
|
-
function
|
|
4217
|
-
return "string" == typeof e ?
|
|
4606
|
+
function tr(t, e) {
|
|
4607
|
+
return "string" == typeof e ? Wn(t, e) : e instanceof wn ? e._internalPath : e._delegate._internalPath;
|
|
4218
4608
|
}
|
|
4219
4609
|
|
|
4220
4610
|
/**
|
|
@@ -4240,7 +4630,7 @@ function Yn(t, e) {
|
|
|
4240
4630
|
* endBefore:1}, {@link (endAt:1)}, {@link limit} or {@link limitToLast} and
|
|
4241
4631
|
* can then be passed to {@link query} to create a new query instance that
|
|
4242
4632
|
* also contains this `QueryConstraint`.
|
|
4243
|
-
*/ var
|
|
4633
|
+
*/ var er = function() {};
|
|
4244
4634
|
|
|
4245
4635
|
/**
|
|
4246
4636
|
* Creates a new immutable instance of {@link Query} that is extended to also include
|
|
@@ -4250,7 +4640,7 @@ function Yn(t, e) {
|
|
|
4250
4640
|
* @param queryConstraints - The list of {@link QueryConstraint}s to apply.
|
|
4251
4641
|
* @throws if any of the provided query constraints cannot be combined with the
|
|
4252
4642
|
* existing or new constraints.
|
|
4253
|
-
*/ function
|
|
4643
|
+
*/ function nr(t) {
|
|
4254
4644
|
for (var e = [], n = 1; n < arguments.length; n++) e[n - 1] = arguments[n];
|
|
4255
4645
|
for (var r = 0, i = e; r < i.length; r++) {
|
|
4256
4646
|
var o = i[r];
|
|
@@ -4259,39 +4649,39 @@ function Yn(t, e) {
|
|
|
4259
4649
|
return t;
|
|
4260
4650
|
}
|
|
4261
4651
|
|
|
4262
|
-
var
|
|
4652
|
+
var rr = /** @class */ function(e) {
|
|
4263
4653
|
function n(t, n, r) {
|
|
4264
4654
|
var i = this;
|
|
4265
4655
|
return (i = e.call(this) || this).dt = t, i.wt = n, i.yt = r, i.type = "where",
|
|
4266
4656
|
i;
|
|
4267
4657
|
}
|
|
4268
4658
|
return t(n, e), n.prototype._apply = function(t) {
|
|
4269
|
-
var e =
|
|
4659
|
+
var e = Pn(t.firestore), n = function(t, e, n, r, i, o, a) {
|
|
4270
4660
|
var s;
|
|
4271
4661
|
if (i.isKeyField()) {
|
|
4272
4662
|
if ("array-contains" /* ARRAY_CONTAINS */ === o || "array-contains-any" /* ARRAY_CONTAINS_ANY */ === o) throw new M(V, "Invalid Query. You can't perform '" + o + "' queries on documentId().");
|
|
4273
4663
|
if ("in" /* IN */ === o || "not-in" /* NOT_IN */ === o) {
|
|
4274
|
-
|
|
4664
|
+
gr(a, o);
|
|
4275
4665
|
for (var u = [], c = 0, l = a; c < l.length; c++) {
|
|
4276
4666
|
var f = l[c];
|
|
4277
|
-
u.push(
|
|
4667
|
+
u.push(vr(r, t, f));
|
|
4278
4668
|
}
|
|
4279
4669
|
s = {
|
|
4280
4670
|
arrayValue: {
|
|
4281
4671
|
values: u
|
|
4282
4672
|
}
|
|
4283
4673
|
};
|
|
4284
|
-
} else s =
|
|
4285
|
-
} else "in" /* IN */ !== o && "not-in" /* NOT_IN */ !== o && "array-contains-any" /* ARRAY_CONTAINS_ANY */ !== o ||
|
|
4286
|
-
s =
|
|
4674
|
+
} else s = vr(r, t, a);
|
|
4675
|
+
} else "in" /* IN */ !== o && "not-in" /* NOT_IN */ !== o && "array-contains-any" /* ARRAY_CONTAINS_ANY */ !== o || gr(a, o),
|
|
4676
|
+
s = Mn(n, "where", a,
|
|
4287
4677
|
/* allowArrays= */ "in" /* IN */ === o || "not-in" /* NOT_IN */ === o);
|
|
4288
|
-
var h =
|
|
4678
|
+
var h = te.create(i, o, s);
|
|
4289
4679
|
return function(t, e) {
|
|
4290
|
-
if (e.
|
|
4291
|
-
var n =
|
|
4680
|
+
if (e.D()) {
|
|
4681
|
+
var n = ye(t);
|
|
4292
4682
|
if (null !== n && !n.isEqual(e.field)) throw new M(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() + "'");
|
|
4293
|
-
var r =
|
|
4294
|
-
null !== r &&
|
|
4683
|
+
var r = de(t);
|
|
4684
|
+
null !== r && wr(t, e.field, r);
|
|
4295
4685
|
}
|
|
4296
4686
|
var i = function(t, e) {
|
|
4297
4687
|
for (var n = 0, r = t.filters; n < r.length; n++) {
|
|
@@ -4338,12 +4728,12 @@ var Jn = /** @class */ function(e) {
|
|
|
4338
4728
|
throw i === e.op ? new M(V, "Invalid query. You cannot use more than one '" + e.op.toString() + "' filter.") : new M(V, "Invalid query. You cannot use '" + e.op.toString() + "' filters with '" + i.toString() + "' filters.");
|
|
4339
4729
|
}(t, h), h;
|
|
4340
4730
|
}(t._query, 0, e, t.firestore._databaseId, this.dt, this.wt, this.yt);
|
|
4341
|
-
return new
|
|
4731
|
+
return new hn(t.firestore, t.converter, function(t, e) {
|
|
4342
4732
|
var n = t.filters.concat([ e ]);
|
|
4343
|
-
return new
|
|
4733
|
+
return new pe(t.path, t.collectionGroup, t.explicitOrderBy.slice(), n, t.limit, t.limitType, t.startAt, t.endAt);
|
|
4344
4734
|
}(t._query, n));
|
|
4345
4735
|
}, n;
|
|
4346
|
-
}(
|
|
4736
|
+
}(er);
|
|
4347
4737
|
|
|
4348
4738
|
/**
|
|
4349
4739
|
* Creates a {@link QueryConstraint} that enforces that documents must contain the
|
|
@@ -4355,12 +4745,12 @@ var Jn = /** @class */ function(e) {
|
|
|
4355
4745
|
* "<=", "!=").
|
|
4356
4746
|
* @param value - The value for comparison
|
|
4357
4747
|
* @returns The created {@link Query}.
|
|
4358
|
-
*/ function
|
|
4359
|
-
var r = e, i =
|
|
4360
|
-
return new
|
|
4748
|
+
*/ function ir(t, e, n) {
|
|
4749
|
+
var r = e, i = tr("where", t);
|
|
4750
|
+
return new rr(i, r, n);
|
|
4361
4751
|
}
|
|
4362
4752
|
|
|
4363
|
-
var
|
|
4753
|
+
var or = /** @class */ function(e) {
|
|
4364
4754
|
function n(t, n) {
|
|
4365
4755
|
var r = this;
|
|
4366
4756
|
return (r = e.call(this) || this).dt = t, r._t = n, r.type = "orderBy", r;
|
|
@@ -4369,22 +4759,22 @@ var tr = /** @class */ function(e) {
|
|
|
4369
4759
|
var e = function(t, e, n) {
|
|
4370
4760
|
if (null !== t.startAt) throw new M(V, "Invalid query. You must not call startAt() or startAfter() before calling orderBy().");
|
|
4371
4761
|
if (null !== t.endAt) throw new M(V, "Invalid query. You must not call endAt() or endBefore() before calling orderBy().");
|
|
4372
|
-
var r = new
|
|
4762
|
+
var r = new le(e, n);
|
|
4373
4763
|
return function(t, e) {
|
|
4374
|
-
if (null ===
|
|
4764
|
+
if (null === de(t)) {
|
|
4375
4765
|
// This is the first order by. It must match any inequality.
|
|
4376
|
-
var n =
|
|
4377
|
-
null !== n &&
|
|
4766
|
+
var n = ye(t);
|
|
4767
|
+
null !== n && wr(t, n, e.field);
|
|
4378
4768
|
}
|
|
4379
4769
|
}(t, r), r;
|
|
4380
4770
|
}(t._query, this.dt, this._t);
|
|
4381
|
-
return new
|
|
4771
|
+
return new hn(t.firestore, t.converter, function(t, e) {
|
|
4382
4772
|
// TODO(dimond): validate that orderBy does not list the same key twice.
|
|
4383
4773
|
var n = t.explicitOrderBy.concat([ e ]);
|
|
4384
|
-
return new
|
|
4774
|
+
return new pe(t.path, t.collectionGroup, n, t.filters.slice(), t.limit, t.limitType, t.startAt, t.endAt);
|
|
4385
4775
|
}(t._query, e));
|
|
4386
4776
|
}, n;
|
|
4387
|
-
}(
|
|
4777
|
+
}(er);
|
|
4388
4778
|
|
|
4389
4779
|
/**
|
|
4390
4780
|
* Creates a {@link QueryConstraint} that sorts the query result by the
|
|
@@ -4394,31 +4784,31 @@ var tr = /** @class */ function(e) {
|
|
|
4394
4784
|
* @param directionStr - Optional direction to sort by ('asc' or 'desc'). If
|
|
4395
4785
|
* not specified, order will be ascending.
|
|
4396
4786
|
* @returns The created {@link Query}.
|
|
4397
|
-
*/ function
|
|
4787
|
+
*/ function ar(t, e) {
|
|
4398
4788
|
void 0 === e && (e = "asc");
|
|
4399
|
-
var n = e, r =
|
|
4400
|
-
return new
|
|
4789
|
+
var n = e, r = tr("orderBy", t);
|
|
4790
|
+
return new or(r, n);
|
|
4401
4791
|
}
|
|
4402
4792
|
|
|
4403
|
-
var
|
|
4793
|
+
var sr = /** @class */ function(e) {
|
|
4404
4794
|
function n(t, n, r) {
|
|
4405
4795
|
var i = this;
|
|
4406
|
-
return (i = e.call(this) || this).type = t, i.gt = n, i.
|
|
4796
|
+
return (i = e.call(this) || this).type = t, i.gt = n, i.vt = r, i;
|
|
4407
4797
|
}
|
|
4408
4798
|
return t(n, e), n.prototype._apply = function(t) {
|
|
4409
|
-
return new
|
|
4410
|
-
return new
|
|
4411
|
-
}(t._query, this.gt, this.
|
|
4799
|
+
return new hn(t.firestore, t.converter, function(t, e, n) {
|
|
4800
|
+
return new pe(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), e, n, t.startAt, t.endAt);
|
|
4801
|
+
}(t._query, this.gt, this.vt));
|
|
4412
4802
|
}, n;
|
|
4413
|
-
}(
|
|
4803
|
+
}(er);
|
|
4414
4804
|
|
|
4415
4805
|
/**
|
|
4416
4806
|
* Creates a {@link QueryConstraint} that only returns the first matching documents.
|
|
4417
4807
|
*
|
|
4418
4808
|
* @param limit - The maximum number of items to return.
|
|
4419
4809
|
* @returns The created {@link Query}.
|
|
4420
|
-
*/ function
|
|
4421
|
-
return ut("limit", t), new
|
|
4810
|
+
*/ function ur(t) {
|
|
4811
|
+
return ut("limit", t), new sr("limit", t, "F" /* First */)
|
|
4422
4812
|
/**
|
|
4423
4813
|
* Creates a {@link QueryConstraint} that only returns the last matching documents.
|
|
4424
4814
|
*
|
|
@@ -4430,61 +4820,61 @@ var nr = /** @class */ function(e) {
|
|
|
4430
4820
|
*/;
|
|
4431
4821
|
}
|
|
4432
4822
|
|
|
4433
|
-
function
|
|
4434
|
-
return ut("limitToLast", t), new
|
|
4823
|
+
function cr(t) {
|
|
4824
|
+
return ut("limitToLast", t), new sr("limitToLast", t, "L" /* Last */);
|
|
4435
4825
|
}
|
|
4436
4826
|
|
|
4437
|
-
var
|
|
4827
|
+
var lr = /** @class */ function(e) {
|
|
4438
4828
|
function n(t, n, r) {
|
|
4439
4829
|
var i = this;
|
|
4440
|
-
return (i = e.call(this) || this).type = t, i.
|
|
4830
|
+
return (i = e.call(this) || this).type = t, i.bt = n, i.Et = r, i;
|
|
4441
4831
|
}
|
|
4442
4832
|
return t(n, e), n.prototype._apply = function(t) {
|
|
4443
|
-
var e =
|
|
4444
|
-
return new
|
|
4445
|
-
return new
|
|
4833
|
+
var e = mr(t, this.type, this.bt, this.Et);
|
|
4834
|
+
return new hn(t.firestore, t.converter, function(t, e) {
|
|
4835
|
+
return new pe(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), t.limit, t.limitType, e, t.endAt);
|
|
4446
4836
|
}(t._query, e));
|
|
4447
4837
|
}, n;
|
|
4448
|
-
}(
|
|
4838
|
+
}(er);
|
|
4449
4839
|
|
|
4450
|
-
function
|
|
4840
|
+
function fr() {
|
|
4451
4841
|
for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
|
|
4452
|
-
return new
|
|
4842
|
+
return new lr("startAt", t,
|
|
4453
4843
|
/*inclusive=*/ !0);
|
|
4454
4844
|
}
|
|
4455
4845
|
|
|
4456
|
-
function
|
|
4846
|
+
function hr() {
|
|
4457
4847
|
for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
|
|
4458
|
-
return new
|
|
4848
|
+
return new lr("startAfter", t,
|
|
4459
4849
|
/*inclusive=*/ !1);
|
|
4460
4850
|
}
|
|
4461
4851
|
|
|
4462
|
-
var
|
|
4852
|
+
var pr = /** @class */ function(e) {
|
|
4463
4853
|
function n(t, n, r) {
|
|
4464
4854
|
var i = this;
|
|
4465
|
-
return (i = e.call(this) || this).type = t, i.
|
|
4855
|
+
return (i = e.call(this) || this).type = t, i.bt = n, i.Et = r, i;
|
|
4466
4856
|
}
|
|
4467
4857
|
return t(n, e), n.prototype._apply = function(t) {
|
|
4468
|
-
var e =
|
|
4469
|
-
return new
|
|
4470
|
-
return new
|
|
4858
|
+
var e = mr(t, this.type, this.bt, this.Et);
|
|
4859
|
+
return new hn(t.firestore, t.converter, function(t, e) {
|
|
4860
|
+
return new pe(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), t.limit, t.limitType, t.startAt, e);
|
|
4471
4861
|
}(t._query, e));
|
|
4472
4862
|
}, n;
|
|
4473
|
-
}(
|
|
4863
|
+
}(er);
|
|
4474
4864
|
|
|
4475
|
-
function
|
|
4865
|
+
function dr() {
|
|
4476
4866
|
for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
|
|
4477
|
-
return new
|
|
4867
|
+
return new pr("endBefore", t,
|
|
4478
4868
|
/*inclusive=*/ !1);
|
|
4479
4869
|
}
|
|
4480
4870
|
|
|
4481
|
-
function
|
|
4871
|
+
function yr() {
|
|
4482
4872
|
for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
|
|
4483
|
-
return new
|
|
4873
|
+
return new pr("endAt", t, /*inclusive=*/ !0);
|
|
4484
4874
|
}
|
|
4485
4875
|
|
|
4486
|
-
/** Helper function to create a bound from a document or fields */ function
|
|
4487
|
-
if (n[0] = p(n[0]), n[0] instanceof
|
|
4876
|
+
/** Helper function to create a bound from a document or fields */ function mr(t, e, n, r) {
|
|
4877
|
+
if (n[0] = p(n[0]), n[0] instanceof $n) return function(t, e, n, r, i) {
|
|
4488
4878
|
if (!r) throw new M(P, "Can't use a DocumentSnapshot that doesn't exist for " + n + "().");
|
|
4489
4879
|
// Because people expect to continue/end a query at the exact document
|
|
4490
4880
|
// provided, we need to use the implicit sort order rather than the explicit
|
|
@@ -4493,11 +4883,11 @@ function lr() {
|
|
|
4493
4883
|
// the provided document. Without the key (by using the explicit sort
|
|
4494
4884
|
// orders), multiple documents could match the position, yielding duplicate
|
|
4495
4885
|
// results.
|
|
4496
|
-
for (var o = [], a = 0, s =
|
|
4886
|
+
for (var o = [], a = 0, s = ve(t); a < s.length; a++) {
|
|
4497
4887
|
var u = s[a];
|
|
4498
|
-
if (u.field.isKeyField()) o.push(
|
|
4888
|
+
if (u.field.isKeyField()) o.push(Gt(e, r.key)); else {
|
|
4499
4889
|
var c = r.data.field(u.field);
|
|
4500
|
-
if (
|
|
4890
|
+
if (Rt(c)) throw new M(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.)');
|
|
4501
4891
|
if (null === c) {
|
|
4502
4892
|
var l = u.field.canonicalString();
|
|
4503
4893
|
throw new M(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.");
|
|
@@ -4505,9 +4895,9 @@ function lr() {
|
|
|
4505
4895
|
o.push(c);
|
|
4506
4896
|
}
|
|
4507
4897
|
}
|
|
4508
|
-
return new
|
|
4898
|
+
return new ce(o, i);
|
|
4509
4899
|
}(t._query, t.firestore._databaseId, e, n[0]._document, r);
|
|
4510
|
-
var i =
|
|
4900
|
+
var i = Pn(t.firestore);
|
|
4511
4901
|
return function(t, e, n, r, i, o) {
|
|
4512
4902
|
// Use explicit order by's because it has to match the query the user made
|
|
4513
4903
|
var a = t.explicitOrderBy;
|
|
@@ -4516,41 +4906,41 @@ function lr() {
|
|
|
4516
4906
|
var c = i[u];
|
|
4517
4907
|
if (a[u].field.isKeyField()) {
|
|
4518
4908
|
if ("string" != typeof c) throw new M(V, "Invalid query. Expected a string for document ID in " + r + "(), but got a " + typeof c);
|
|
4519
|
-
if (!
|
|
4909
|
+
if (!me(t) && -1 !== c.indexOf("/")) throw new M(V, "Invalid query. When querying a collection and ordering by documentId(), the value passed to " + r + "() must be a plain document ID, but '" + c + "' contains a slash.");
|
|
4520
4910
|
var l = t.path.child(Z.fromString(c));
|
|
4521
4911
|
if (!nt.isDocumentKey(l)) throw new M(V, "Invalid query. When querying a collection group and ordering by documentId(), the value passed to " + r + "() must result in a valid document path, but '" + l + "' is not because it contains an odd number of segments.");
|
|
4522
4912
|
var f = new nt(l);
|
|
4523
|
-
s.push(
|
|
4913
|
+
s.push(Gt(e, f));
|
|
4524
4914
|
} else {
|
|
4525
|
-
var h =
|
|
4915
|
+
var h = Mn(n, r, c);
|
|
4526
4916
|
s.push(h);
|
|
4527
4917
|
}
|
|
4528
4918
|
}
|
|
4529
|
-
return new
|
|
4919
|
+
return new ce(s, o);
|
|
4530
4920
|
}(t._query, t.firestore._databaseId, i, e, n, r);
|
|
4531
4921
|
}
|
|
4532
4922
|
|
|
4533
|
-
function
|
|
4923
|
+
function vr(t, e, n) {
|
|
4534
4924
|
if ("string" == typeof (n = p(n))) {
|
|
4535
4925
|
if ("" === n) throw new M(V, "Invalid query. When querying with documentId(), you must provide a valid document ID, but it was an empty string.");
|
|
4536
|
-
if (!
|
|
4926
|
+
if (!me(e) && -1 !== n.indexOf("/")) throw new M(V, "Invalid query. When querying a collection by documentId(), you must provide a plain document ID, but '" + n + "' contains a '/' character.");
|
|
4537
4927
|
var r = e.path.child(Z.fromString(n));
|
|
4538
4928
|
if (!nt.isDocumentKey(r)) throw new M(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 + ").");
|
|
4539
|
-
return
|
|
4929
|
+
return Gt(t, new nt(r));
|
|
4540
4930
|
}
|
|
4541
|
-
if (n instanceof
|
|
4931
|
+
if (n instanceof fn) return Gt(t, n._key);
|
|
4542
4932
|
throw new M(V, "Invalid query. When querying with documentId(), you must provide a valid string or a DocumentReference, but it was: " + at(n) + ".");
|
|
4543
4933
|
}
|
|
4544
4934
|
|
|
4545
4935
|
/**
|
|
4546
4936
|
* Validates that the value passed into a disjunctive filter satisfies all
|
|
4547
4937
|
* array requirements.
|
|
4548
|
-
*/ function
|
|
4938
|
+
*/ function gr(t, e) {
|
|
4549
4939
|
if (!Array.isArray(t) || 0 === t.length) throw new M(V, "Invalid Query. A non-empty array is required for '" + e.toString() + "' filters.");
|
|
4550
4940
|
if (t.length > 10) throw new M(V, "Invalid Query. '" + e.toString() + "' filters support a maximum of 10 elements in the value array.");
|
|
4551
4941
|
}
|
|
4552
4942
|
|
|
4553
|
-
function
|
|
4943
|
+
function wr(t, e, n) {
|
|
4554
4944
|
if (!n.isEqual(e)) throw new M(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.");
|
|
4555
4945
|
}
|
|
4556
4946
|
|
|
@@ -4600,28 +4990,28 @@ function dr(t, e, n) {
|
|
|
4600
4990
|
* because we want to provide the user with a more specific error message if
|
|
4601
4991
|
* their `set()` or fails due to invalid data originating from a `toFirestore()`
|
|
4602
4992
|
* call.
|
|
4603
|
-
*/ function
|
|
4993
|
+
*/ function br(t, e, n) {
|
|
4604
4994
|
// Cast to `any` in order to satisfy the union type constraint on
|
|
4605
4995
|
// toFirestore().
|
|
4606
4996
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4607
4997
|
return t ? n && (n.merge || n.mergeFields) ? t.toFirestore(e, n) : t.toFirestore(e) : e;
|
|
4608
4998
|
}
|
|
4609
4999
|
|
|
4610
|
-
var
|
|
5000
|
+
var _r = /** @class */ function(e) {
|
|
4611
5001
|
function n(t) {
|
|
4612
5002
|
var n = this;
|
|
4613
5003
|
return (n = e.call(this) || this).firestore = t, n;
|
|
4614
5004
|
}
|
|
4615
5005
|
return t(n, e), n.prototype.convertBytes = function(t) {
|
|
4616
|
-
return new
|
|
5006
|
+
return new _n(t);
|
|
4617
5007
|
}, n.prototype.convertReference = function(t) {
|
|
4618
5008
|
var e = this.convertDocumentKey(t, this.firestore._databaseId);
|
|
4619
|
-
return new
|
|
5009
|
+
return new fn(this.firestore, /* converter= */ null, e);
|
|
4620
5010
|
}, n;
|
|
4621
5011
|
}(/** @class */ function() {
|
|
4622
5012
|
function t() {}
|
|
4623
5013
|
return t.prototype.convertValue = function(t, e) {
|
|
4624
|
-
switch (void 0 === e && (e = "none"),
|
|
5014
|
+
switch (void 0 === e && (e = "none"), jt(t)) {
|
|
4625
5015
|
case 0 /* NullValue */ :
|
|
4626
5016
|
return null;
|
|
4627
5017
|
|
|
@@ -4629,7 +5019,7 @@ var yr = /** @class */ function(e) {
|
|
|
4629
5019
|
return t.booleanValue;
|
|
4630
5020
|
|
|
4631
5021
|
case 2 /* NumberValue */ :
|
|
4632
|
-
return
|
|
5022
|
+
return Ot(t.integerValue || t.doubleValue);
|
|
4633
5023
|
|
|
4634
5024
|
case 3 /* TimestampValue */ :
|
|
4635
5025
|
return this.convertTimestamp(t.timestampValue);
|
|
@@ -4641,7 +5031,7 @@ var yr = /** @class */ function(e) {
|
|
|
4641
5031
|
return t.stringValue;
|
|
4642
5032
|
|
|
4643
5033
|
case 6 /* BlobValue */ :
|
|
4644
|
-
return this.convertBytes(
|
|
5034
|
+
return this.convertBytes(qt(t.bytesValue));
|
|
4645
5035
|
|
|
4646
5036
|
case 7 /* RefValue */ :
|
|
4647
5037
|
return this.convertReference(t.referenceValue);
|
|
@@ -4656,15 +5046,15 @@ var yr = /** @class */ function(e) {
|
|
|
4656
5046
|
return this.convertObject(t.mapValue, e);
|
|
4657
5047
|
|
|
4658
5048
|
default:
|
|
4659
|
-
throw
|
|
5049
|
+
throw E();
|
|
4660
5050
|
}
|
|
4661
5051
|
}, t.prototype.convertObject = function(t, e) {
|
|
4662
5052
|
var n = this, r = {};
|
|
4663
|
-
return
|
|
5053
|
+
return Et(t.fields, (function(t, i) {
|
|
4664
5054
|
r[t] = n.convertValue(i, e);
|
|
4665
5055
|
})), r;
|
|
4666
5056
|
}, t.prototype.convertGeoPoint = function(t) {
|
|
4667
|
-
return new
|
|
5057
|
+
return new En(Ot(t.latitude), Ot(t.longitude));
|
|
4668
5058
|
}, t.prototype.convertArray = function(t, e) {
|
|
4669
5059
|
var n = this;
|
|
4670
5060
|
return (t.values || []).map((function(t) {
|
|
@@ -4673,21 +5063,21 @@ var yr = /** @class */ function(e) {
|
|
|
4673
5063
|
}, t.prototype.convertServerTimestamp = function(t, e) {
|
|
4674
5064
|
switch (e) {
|
|
4675
5065
|
case "previous":
|
|
4676
|
-
var n =
|
|
5066
|
+
var n = xt(t);
|
|
4677
5067
|
return null == n ? null : this.convertValue(n, e);
|
|
4678
5068
|
|
|
4679
5069
|
case "estimate":
|
|
4680
|
-
return this.convertTimestamp(
|
|
5070
|
+
return this.convertTimestamp(Ct(t));
|
|
4681
5071
|
|
|
4682
5072
|
default:
|
|
4683
5073
|
return null;
|
|
4684
5074
|
}
|
|
4685
5075
|
}, t.prototype.convertTimestamp = function(t) {
|
|
4686
|
-
var e =
|
|
5076
|
+
var e = Ft(t);
|
|
4687
5077
|
return new bt(e.seconds, e.nanos);
|
|
4688
5078
|
}, t.prototype.convertDocumentKey = function(t, e) {
|
|
4689
5079
|
var n = Z.fromString(t);
|
|
4690
|
-
|
|
5080
|
+
S(Ye(n));
|
|
4691
5081
|
var r = new X(n.get(1), n.get(3)), i = new nt(n.popFirst(5));
|
|
4692
5082
|
return r.isEqual(e) ||
|
|
4693
5083
|
// TODO(b/64130202): Somehow support foreign references.
|
|
@@ -4708,12 +5098,12 @@ var yr = /** @class */ function(e) {
|
|
|
4708
5098
|
* @param reference - The reference of the document to fetch.
|
|
4709
5099
|
* @returns A Promise resolved with a `DocumentSnapshot` containing the current
|
|
4710
5100
|
* document contents.
|
|
4711
|
-
*/ function
|
|
4712
|
-
var e =
|
|
4713
|
-
return
|
|
4714
|
-
|
|
5101
|
+
*/ function Tr(t) {
|
|
5102
|
+
var e = rn((t = st(t, fn)).firestore), n = new _r(t.firestore);
|
|
5103
|
+
return tn(e, [ t._key ]).then((function(e) {
|
|
5104
|
+
S(1 === e.length);
|
|
4715
5105
|
var r = e[0];
|
|
4716
|
-
return new
|
|
5106
|
+
return new $n(t.firestore, n, t._key, r.isFoundDocument() ? r : null, t.converter);
|
|
4717
5107
|
}));
|
|
4718
5108
|
}
|
|
4719
5109
|
|
|
@@ -4728,35 +5118,35 @@ var yr = /** @class */ function(e) {
|
|
|
4728
5118
|
*
|
|
4729
5119
|
* @param query - The `Query` to execute.
|
|
4730
5120
|
* @returns A Promise that will be resolved with the results of the query.
|
|
4731
|
-
*/ function
|
|
5121
|
+
*/ function Er(t) {
|
|
4732
5122
|
!function(t) {
|
|
4733
|
-
if ("L" /* Last */ === t.limitType && 0 === t.explicitOrderBy.length) throw new M(
|
|
4734
|
-
}((t = st(t,
|
|
4735
|
-
var e =
|
|
4736
|
-
return
|
|
5123
|
+
if ("L" /* Last */ === t.limitType && 0 === t.explicitOrderBy.length) throw new M(C, "limitToLast() queries require specifying at least one orderBy() clause");
|
|
5124
|
+
}((t = st(t, hn))._query);
|
|
5125
|
+
var e = rn(t.firestore), n = new _r(t.firestore);
|
|
5126
|
+
return en(e, t._query).then((function(e) {
|
|
4737
5127
|
var r = e.map((function(e) {
|
|
4738
|
-
return new
|
|
5128
|
+
return new Xn(t.firestore, n, e.key, e, t.converter);
|
|
4739
5129
|
}));
|
|
4740
5130
|
return "L" /* Last */ === t._query.limitType &&
|
|
4741
5131
|
// Limit to last queries reverse the orderBy constraint that was
|
|
4742
5132
|
// specified by the user. As such, we need to reverse the order of the
|
|
4743
5133
|
// results to return the documents in the expected order.
|
|
4744
|
-
r.reverse(), new
|
|
5134
|
+
r.reverse(), new Jn(t, r);
|
|
4745
5135
|
}));
|
|
4746
5136
|
}
|
|
4747
5137
|
|
|
4748
|
-
function
|
|
4749
|
-
var r =
|
|
4750
|
-
return
|
|
5138
|
+
function Sr(t, e, n) {
|
|
5139
|
+
var r = br((t = st(t, fn)).converter, e, n), i = Nn(Pn(t.firestore), "setDoc", t._key, r, null !== t.converter, n);
|
|
5140
|
+
return Ze(rn(t.firestore), [ i.toMutation(t._key, Ie.none()) ]);
|
|
4751
5141
|
}
|
|
4752
5142
|
|
|
4753
|
-
function
|
|
5143
|
+
function kr(t, e, n) {
|
|
4754
5144
|
for (var r = [], i = 3; i < arguments.length; i++) r[i - 3] = arguments[i];
|
|
4755
|
-
var o, a =
|
|
5145
|
+
var o, a = Pn((t = st(t, fn)).firestore);
|
|
4756
5146
|
// For Compat types, we have to "extract" the underlying types before
|
|
4757
5147
|
// performing validation.
|
|
4758
|
-
return o = "string" == typeof (e = p(e)) || e instanceof
|
|
4759
|
-
|
|
5148
|
+
return o = "string" == typeof (e = p(e)) || e instanceof wn ? jn(a, "updateDoc", t._key, e, n, r) : Ln(a, "updateDoc", t._key, e),
|
|
5149
|
+
Ze(rn(t.firestore), [ o.toMutation(t._key, Ie.exists(!0)) ]);
|
|
4760
5150
|
}
|
|
4761
5151
|
|
|
4762
5152
|
/**
|
|
@@ -4770,8 +5160,8 @@ function br(t, e, n) {
|
|
|
4770
5160
|
* @param reference - A reference to the document to delete.
|
|
4771
5161
|
* @returns A `Promise` resolved once the document has been successfully
|
|
4772
5162
|
* deleted from the backend.
|
|
4773
|
-
*/ function
|
|
4774
|
-
return
|
|
5163
|
+
*/ function Ir(t) {
|
|
5164
|
+
return Ze(rn((t = st(t, fn)).firestore), [ new Pe(t._key, Ie.none()) ]);
|
|
4775
5165
|
}
|
|
4776
5166
|
|
|
4777
5167
|
/**
|
|
@@ -4788,9 +5178,9 @@ function br(t, e, n) {
|
|
|
4788
5178
|
* @throws Error - If the provided input is not a valid Firestore document.
|
|
4789
5179
|
* @returns A `Promise` resolved with a `DocumentReference` pointing to the
|
|
4790
5180
|
* newly created document after it has been written to the backend.
|
|
4791
|
-
*/ function
|
|
4792
|
-
var n =
|
|
4793
|
-
return
|
|
5181
|
+
*/ function Ar(t, e) {
|
|
5182
|
+
var n = mn(t = st(t, pn)), r = br(t.converter, e), i = Nn(Pn(t.firestore), "addDoc", n._key, r, null !== n.converter, {});
|
|
5183
|
+
return Ze(rn(t.firestore), [ i.toMutation(n._key, Ie.exists(!1)) ]).then((function() {
|
|
4794
5184
|
return n;
|
|
4795
5185
|
}));
|
|
4796
5186
|
}
|
|
@@ -4814,15 +5204,15 @@ function br(t, e, n) {
|
|
|
4814
5204
|
/**
|
|
4815
5205
|
* Returns a sentinel for use with {@link @firebase/firestore/lite#(updateDoc:1)} or
|
|
4816
5206
|
* {@link @firebase/firestore/lite#(setDoc:1)} with `{merge: true}` to mark a field for deletion.
|
|
4817
|
-
*/ function
|
|
4818
|
-
return new
|
|
5207
|
+
*/ function Vr() {
|
|
5208
|
+
return new Fn("deleteField");
|
|
4819
5209
|
}
|
|
4820
5210
|
|
|
4821
5211
|
/**
|
|
4822
5212
|
* Returns a sentinel used with {@link @firebase/firestore/lite#(setDoc:1)} or {@link @firebase/firestore/lite#(updateDoc:1)} to
|
|
4823
5213
|
* include a server-generated timestamp in the written data.
|
|
4824
|
-
*/ function
|
|
4825
|
-
return new
|
|
5214
|
+
*/ function Dr() {
|
|
5215
|
+
return new qn("serverTimestamp");
|
|
4826
5216
|
}
|
|
4827
5217
|
|
|
4828
5218
|
/**
|
|
@@ -4836,11 +5226,11 @@ function br(t, e, n) {
|
|
|
4836
5226
|
* @param elements - The elements to union into the array.
|
|
4837
5227
|
* @returns The `FieldValue` sentinel for use in a call to `setDoc()` or
|
|
4838
5228
|
* `updateDoc()`.
|
|
4839
|
-
*/ function
|
|
5229
|
+
*/ function Pr() {
|
|
4840
5230
|
for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
|
|
4841
5231
|
// NOTE: We don't actually parse the data until it's used in set() or
|
|
4842
5232
|
// update() since we'd need the Firestore instance to do this.
|
|
4843
|
-
return new
|
|
5233
|
+
return new Rn("arrayUnion", t);
|
|
4844
5234
|
}
|
|
4845
5235
|
|
|
4846
5236
|
/**
|
|
@@ -4853,11 +5243,11 @@ function br(t, e, n) {
|
|
|
4853
5243
|
* @param elements - The elements to remove from the array.
|
|
4854
5244
|
* @returns The `FieldValue` sentinel for use in a call to `setDoc()` or
|
|
4855
5245
|
* `updateDoc()`
|
|
4856
|
-
*/ function
|
|
5246
|
+
*/ function Nr() {
|
|
4857
5247
|
for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
|
|
4858
5248
|
// NOTE: We don't actually parse the data until it's used in set() or
|
|
4859
5249
|
// update() since we'd need the Firestore instance to do this.
|
|
4860
|
-
return new
|
|
5250
|
+
return new xn("arrayRemove", t);
|
|
4861
5251
|
}
|
|
4862
5252
|
|
|
4863
5253
|
/**
|
|
@@ -4878,8 +5268,8 @@ function br(t, e, n) {
|
|
|
4878
5268
|
* @param n - The value to increment by.
|
|
4879
5269
|
* @returns The `FieldValue` sentinel for use in a call to `setDoc()` or
|
|
4880
5270
|
* `updateDoc()`
|
|
4881
|
-
*/ function
|
|
4882
|
-
return new
|
|
5271
|
+
*/ function Fr(t) {
|
|
5272
|
+
return new Cn("increment", t);
|
|
4883
5273
|
}
|
|
4884
5274
|
|
|
4885
5275
|
/**
|
|
@@ -4905,24 +5295,24 @@ function br(t, e, n) {
|
|
|
4905
5295
|
* provides methods for adding writes to the write batch. None of the writes
|
|
4906
5296
|
* will be committed (or visible locally) until {@link WriteBatch.commit} is
|
|
4907
5297
|
* called.
|
|
4908
|
-
*/ var
|
|
5298
|
+
*/ var Or = /** @class */ function() {
|
|
4909
5299
|
/** @hideconstructor */
|
|
4910
5300
|
function t(t, e) {
|
|
4911
5301
|
this._firestore = t, this._commitHandler = e, this._mutations = [], this._committed = !1,
|
|
4912
|
-
this._dataReader =
|
|
5302
|
+
this._dataReader = Pn(t);
|
|
4913
5303
|
}
|
|
4914
5304
|
return t.prototype.set = function(t, e, n) {
|
|
4915
5305
|
this._verifyNotCommitted();
|
|
4916
|
-
var r =
|
|
4917
|
-
return this._mutations.push(o.toMutation(r._key,
|
|
5306
|
+
var r = qr(t, this._firestore), i = br(r.converter, e, n), o = Nn(this._dataReader, "WriteBatch.set", r._key, i, null !== r.converter, n);
|
|
5307
|
+
return this._mutations.push(o.toMutation(r._key, Ie.none())), this;
|
|
4918
5308
|
}, t.prototype.update = function(t, e, n) {
|
|
4919
5309
|
for (var r = [], i = 3; i < arguments.length; i++) r[i - 3] = arguments[i];
|
|
4920
5310
|
this._verifyNotCommitted();
|
|
4921
|
-
var o, a =
|
|
5311
|
+
var o, a = qr(t, this._firestore);
|
|
4922
5312
|
// For Compat types, we have to "extract" the underlying types before
|
|
4923
5313
|
// performing validation.
|
|
4924
|
-
return o = "string" == typeof (e = p(e)) || e instanceof
|
|
4925
|
-
this._mutations.push(o.toMutation(a._key,
|
|
5314
|
+
return o = "string" == typeof (e = p(e)) || e instanceof wn ? jn(this._dataReader, "WriteBatch.update", a._key, e, n, r) : Ln(this._dataReader, "WriteBatch.update", a._key, e),
|
|
5315
|
+
this._mutations.push(o.toMutation(a._key, Ie.exists(!0))), this;
|
|
4926
5316
|
},
|
|
4927
5317
|
/**
|
|
4928
5318
|
* Deletes the document referred to by the provided {@link DocumentReference}.
|
|
@@ -4932,8 +5322,8 @@ function br(t, e, n) {
|
|
|
4932
5322
|
*/
|
|
4933
5323
|
t.prototype.delete = function(t) {
|
|
4934
5324
|
this._verifyNotCommitted();
|
|
4935
|
-
var e =
|
|
4936
|
-
return this._mutations = this._mutations.concat(new
|
|
5325
|
+
var e = qr(t, this._firestore);
|
|
5326
|
+
return this._mutations = this._mutations.concat(new Pe(e._key, Ie.none())), this;
|
|
4937
5327
|
},
|
|
4938
5328
|
/**
|
|
4939
5329
|
* Commits all of the writes in this write batch as a single atomic unit.
|
|
@@ -4950,11 +5340,11 @@ function br(t, e, n) {
|
|
|
4950
5340
|
t.prototype.commit = function() {
|
|
4951
5341
|
return this._verifyNotCommitted(), this._committed = !0, this._mutations.length > 0 ? this._commitHandler(this._mutations) : Promise.resolve();
|
|
4952
5342
|
}, t.prototype._verifyNotCommitted = function() {
|
|
4953
|
-
if (this._committed) throw new M(
|
|
5343
|
+
if (this._committed) throw new M(q, "A write batch can no longer be used after commit() has been called.");
|
|
4954
5344
|
}, t;
|
|
4955
5345
|
}();
|
|
4956
5346
|
|
|
4957
|
-
function
|
|
5347
|
+
function qr(t, e) {
|
|
4958
5348
|
if ((t = p(t)).firestore !== e) throw new M(V, "Provided document reference is from a different Firestore instance.");
|
|
4959
5349
|
return t;
|
|
4960
5350
|
}
|
|
@@ -4971,10 +5361,10 @@ function Dr(t, e) {
|
|
|
4971
5361
|
*
|
|
4972
5362
|
* @returns A `WriteBatch` that can be used to atomically execute multiple
|
|
4973
5363
|
* writes.
|
|
4974
|
-
*/ function
|
|
4975
|
-
var e =
|
|
4976
|
-
return new
|
|
4977
|
-
return
|
|
5364
|
+
*/ function Rr(t) {
|
|
5365
|
+
var e = rn(t = st(t, an));
|
|
5366
|
+
return new Or(t, (function(t) {
|
|
5367
|
+
return Ze(e, t);
|
|
4978
5368
|
}));
|
|
4979
5369
|
}
|
|
4980
5370
|
|
|
@@ -4997,7 +5387,7 @@ function Dr(t, e) {
|
|
|
4997
5387
|
/**
|
|
4998
5388
|
* Internal transaction object responsible for accumulating the mutations to
|
|
4999
5389
|
* perform and the base versions for any documents read.
|
|
5000
|
-
*/ var
|
|
5390
|
+
*/ var xr = /** @class */ function() {
|
|
5001
5391
|
function t(t) {
|
|
5002
5392
|
this.datastore = t,
|
|
5003
5393
|
// The version of each document that was read during this transaction.
|
|
@@ -5022,7 +5412,7 @@ function Dr(t, e) {
|
|
|
5022
5412
|
switch (n.label) {
|
|
5023
5413
|
case 0:
|
|
5024
5414
|
if (this.ensureCommitNotCalled(), this.mutations.length > 0) throw new M(V, "Firestore transactions require all reads to be executed before all writes.");
|
|
5025
|
-
return [ 4 /*yield*/ ,
|
|
5415
|
+
return [ 4 /*yield*/ , tn(this.datastore, t) ];
|
|
5026
5416
|
|
|
5027
5417
|
case 1:
|
|
5028
5418
|
return [ 2 /*return*/ , ((e = n.sent()).forEach((function(t) {
|
|
@@ -5041,7 +5431,7 @@ function Dr(t, e) {
|
|
|
5041
5431
|
}
|
|
5042
5432
|
this.writtenDocs.add(t.toString());
|
|
5043
5433
|
}, t.prototype.delete = function(t) {
|
|
5044
|
-
this.write(new
|
|
5434
|
+
this.write(new Pe(t, this.precondition(t))), this.writtenDocs.add(t.toString());
|
|
5045
5435
|
}, t.prototype.commit = function() {
|
|
5046
5436
|
return e(this, void 0, void 0, (function() {
|
|
5047
5437
|
var t, e = this;
|
|
@@ -5058,8 +5448,8 @@ function Dr(t, e) {
|
|
|
5058
5448
|
// a `verify` operation.
|
|
5059
5449
|
t.forEach((function(t, n) {
|
|
5060
5450
|
var r = nt.fromPath(n);
|
|
5061
|
-
e.mutations.push(new
|
|
5062
|
-
})), [ 4 /*yield*/ ,
|
|
5451
|
+
e.mutations.push(new Ne(r, e.precondition(r)));
|
|
5452
|
+
})), [ 4 /*yield*/ , Ze(this.datastore, this.mutations) ];
|
|
5063
5453
|
|
|
5064
5454
|
case 1:
|
|
5065
5455
|
// For each mutation, note that the doc was written.
|
|
@@ -5070,7 +5460,7 @@ function Dr(t, e) {
|
|
|
5070
5460
|
}, t.prototype.recordVersion = function(t) {
|
|
5071
5461
|
var e;
|
|
5072
5462
|
if (t.isFoundDocument()) e = t.version; else {
|
|
5073
|
-
if (!t.isNoDocument()) throw
|
|
5463
|
+
if (!t.isNoDocument()) throw E();
|
|
5074
5464
|
// For deleted docs, we must use baseVersion 0 when we overwrite them.
|
|
5075
5465
|
e = _t.min();
|
|
5076
5466
|
}
|
|
@@ -5078,7 +5468,7 @@ function Dr(t, e) {
|
|
|
5078
5468
|
if (n) {
|
|
5079
5469
|
if (!e.isEqual(n))
|
|
5080
5470
|
// This transaction will fail no matter what.
|
|
5081
|
-
throw new M(
|
|
5471
|
+
throw new M(R, "Document version changed between two reads.");
|
|
5082
5472
|
} else this.readVersions.set(t.key.toString(), e);
|
|
5083
5473
|
},
|
|
5084
5474
|
/**
|
|
@@ -5087,7 +5477,7 @@ function Dr(t, e) {
|
|
|
5087
5477
|
*/
|
|
5088
5478
|
t.prototype.precondition = function(t) {
|
|
5089
5479
|
var e = this.readVersions.get(t.toString());
|
|
5090
|
-
return !this.writtenDocs.has(t.toString()) && e ?
|
|
5480
|
+
return !this.writtenDocs.has(t.toString()) && e ? Ie.updateTime(e) : Ie.none();
|
|
5091
5481
|
},
|
|
5092
5482
|
/**
|
|
5093
5483
|
* Returns the precondition for a document if the operation is an update.
|
|
@@ -5109,31 +5499,31 @@ function Dr(t, e) {
|
|
|
5109
5499
|
// transaction.
|
|
5110
5500
|
throw new M(V, "Can't update a document that doesn't exist.");
|
|
5111
5501
|
// Document exists, base precondition on document update time.
|
|
5112
|
-
return
|
|
5502
|
+
return Ie.updateTime(e);
|
|
5113
5503
|
}
|
|
5114
5504
|
// Document was not read, so we just use the preconditions for a blind
|
|
5115
5505
|
// update.
|
|
5116
|
-
return
|
|
5506
|
+
return Ie.exists(!0);
|
|
5117
5507
|
}, t.prototype.write = function(t) {
|
|
5118
5508
|
this.ensureCommitNotCalled(), this.mutations.push(t);
|
|
5119
5509
|
}, t.prototype.ensureCommitNotCalled = function() {}, t;
|
|
5120
|
-
}(),
|
|
5510
|
+
}(), Cr = {
|
|
5121
5511
|
maxAttempts: 5
|
|
5122
|
-
},
|
|
5512
|
+
}, Lr = /** @class */ function() {
|
|
5123
5513
|
function t(t, e, n, r, i) {
|
|
5124
5514
|
this.asyncQueue = t, this.datastore = e, this.options = n, this.updateFunction = r,
|
|
5125
|
-
this.deferred = i, this.Tt = n.maxAttempts, this.
|
|
5515
|
+
this.deferred = i, this.Tt = n.maxAttempts, this.It = new Xe(this.asyncQueue, "transaction_retry" /* TransactionRetry */)
|
|
5126
5516
|
/** Runs the transaction and sets the result on deferred. */;
|
|
5127
5517
|
}
|
|
5128
5518
|
return t.prototype.run = function() {
|
|
5129
|
-
this.Tt -= 1, this.
|
|
5130
|
-
}, t.prototype.
|
|
5519
|
+
this.Tt -= 1, this.At();
|
|
5520
|
+
}, t.prototype.At = function() {
|
|
5131
5521
|
var t = this;
|
|
5132
|
-
this.
|
|
5522
|
+
this.It.W((function() {
|
|
5133
5523
|
return e(t, void 0, void 0, (function() {
|
|
5134
5524
|
var t, e, r = this;
|
|
5135
5525
|
return n(this, (function(n) {
|
|
5136
|
-
return t = new
|
|
5526
|
+
return t = new xr(this.datastore), (e = this.Rt(t)) && e.then((function(e) {
|
|
5137
5527
|
r.asyncQueue.enqueueAndForget((function() {
|
|
5138
5528
|
return t.commit().then((function() {
|
|
5139
5529
|
r.deferred.resolve(e);
|
|
@@ -5159,7 +5549,7 @@ function Dr(t, e) {
|
|
|
5159
5549
|
}, t.prototype.Pt = function(t) {
|
|
5160
5550
|
var e = this;
|
|
5161
5551
|
this.Tt > 0 && this.Vt(t) ? (this.Tt -= 1, this.asyncQueue.enqueueAndForget((function() {
|
|
5162
|
-
return e.
|
|
5552
|
+
return e.At(), Promise.resolve();
|
|
5163
5553
|
}))) : this.deferred.reject(t);
|
|
5164
5554
|
}, t.prototype.Vt = function(t) {
|
|
5165
5555
|
if ("FirebaseError" === t.name) {
|
|
@@ -5176,30 +5566,30 @@ function Dr(t, e) {
|
|
|
5176
5566
|
function(t) {
|
|
5177
5567
|
switch (t) {
|
|
5178
5568
|
default:
|
|
5179
|
-
return
|
|
5569
|
+
return E();
|
|
5180
5570
|
|
|
5181
5571
|
case I:
|
|
5182
|
-
case
|
|
5572
|
+
case A:
|
|
5183
5573
|
case D:
|
|
5184
|
-
case
|
|
5185
|
-
case
|
|
5186
|
-
case
|
|
5574
|
+
case O:
|
|
5575
|
+
case L:
|
|
5576
|
+
case j:
|
|
5187
5577
|
// Unauthenticated means something went wrong with our token and we need
|
|
5188
5578
|
// to retry with new credentials which will happen automatically.
|
|
5189
|
-
case
|
|
5579
|
+
case F:
|
|
5190
5580
|
return !1;
|
|
5191
5581
|
|
|
5192
5582
|
case V:
|
|
5193
5583
|
case P:
|
|
5194
5584
|
case "already-exists":
|
|
5195
5585
|
case N:
|
|
5196
|
-
case
|
|
5586
|
+
case q:
|
|
5197
5587
|
// Aborted might be retried in some scenarios, but that is dependant on
|
|
5198
5588
|
// the context and should handled individually by the calling code.
|
|
5199
5589
|
// See https://cloud.google.com/apis/design/errors.
|
|
5200
|
-
case
|
|
5201
|
-
case
|
|
5202
|
-
case
|
|
5590
|
+
case R:
|
|
5591
|
+
case x:
|
|
5592
|
+
case C:
|
|
5203
5593
|
case "data-loss":
|
|
5204
5594
|
return !0;
|
|
5205
5595
|
}
|
|
@@ -5241,7 +5631,7 @@ function Dr(t, e) {
|
|
|
5241
5631
|
* See the License for the specific language governing permissions and
|
|
5242
5632
|
* limitations under the License.
|
|
5243
5633
|
*/
|
|
5244
|
-
/** The Platform's 'document' implementation or null if not available. */ function
|
|
5634
|
+
/** The Platform's 'document' implementation or null if not available. */ function jr() {
|
|
5245
5635
|
// `document` is not always available, e.g. in ReactNative and WebWorkers.
|
|
5246
5636
|
// eslint-disable-next-line no-restricted-globals
|
|
5247
5637
|
return "undefined" != typeof document ? document : null;
|
|
@@ -5273,7 +5663,7 @@ function Dr(t, e) {
|
|
|
5273
5663
|
* Note: We implement `PromiseLike` instead of `Promise`, as the `Promise` type
|
|
5274
5664
|
* in newer versions of TypeScript defines `finally`, which is not available in
|
|
5275
5665
|
* IE.
|
|
5276
|
-
*/ var
|
|
5666
|
+
*/ var Mr = /** @class */ function() {
|
|
5277
5667
|
function t(t, e, n, r, i) {
|
|
5278
5668
|
this.asyncQueue = t, this.timerId = e, this.targetTimeMs = n, this.op = r, this.removalCallback = i,
|
|
5279
5669
|
this.deferred = new U, this.then = this.deferred.promise.then.bind(this.deferred.promise),
|
|
@@ -5337,40 +5727,40 @@ function Dr(t, e) {
|
|
|
5337
5727
|
null !== this.timerHandle && (this.removalCallback(this), clearTimeout(this.timerHandle),
|
|
5338
5728
|
this.timerHandle = null);
|
|
5339
5729
|
}, t;
|
|
5340
|
-
}(),
|
|
5730
|
+
}(), Ur = /** @class */ function() {
|
|
5341
5731
|
function t() {
|
|
5342
5732
|
var t = this;
|
|
5343
5733
|
// The last promise in the queue.
|
|
5344
|
-
this.
|
|
5734
|
+
this.Nt = Promise.resolve(),
|
|
5345
5735
|
// A list of retryable operations. Retryable operations are run in order and
|
|
5346
5736
|
// retried with backoff.
|
|
5347
|
-
this.
|
|
5737
|
+
this.Dt = [],
|
|
5348
5738
|
// Is this AsyncQueue being shut down? Once it is set to true, it will not
|
|
5349
5739
|
// be changed again.
|
|
5350
5740
|
this.$t = !1,
|
|
5351
5741
|
// Operations scheduled to be queued in the future. Operations are
|
|
5352
5742
|
// automatically removed after they are run or canceled.
|
|
5353
|
-
this.
|
|
5743
|
+
this.xt = [],
|
|
5354
5744
|
// visible for testing
|
|
5355
|
-
this.
|
|
5745
|
+
this.Ft = null,
|
|
5356
5746
|
// Flag set while there's an outstanding AsyncQueue operation, used for
|
|
5357
5747
|
// assertion sanity-checks.
|
|
5358
|
-
this.
|
|
5748
|
+
this.St = !1,
|
|
5359
5749
|
// Enabled during shutdown on Safari to prevent future access to IndexedDB.
|
|
5360
5750
|
this.qt = !1,
|
|
5361
5751
|
// List of TimerIds to fast-forward delays for.
|
|
5362
5752
|
this.Ot = [],
|
|
5363
5753
|
// Backoff timer used to schedule retries for retryable operations
|
|
5364
|
-
this.
|
|
5754
|
+
this.It = new Xe(this, "async_queue_retry" /* AsyncQueueRetry */),
|
|
5365
5755
|
// Visibility handler that triggers an immediate retry of all retryable
|
|
5366
5756
|
// operations. Meant to speed up recovery when we regain file system access
|
|
5367
5757
|
// after page comes into foreground.
|
|
5368
|
-
this.
|
|
5369
|
-
var e =
|
|
5370
|
-
e && w("AsyncQueue", "Visibility state changed to " + e.visibilityState), t.
|
|
5758
|
+
this.kt = function() {
|
|
5759
|
+
var e = jr();
|
|
5760
|
+
e && w("AsyncQueue", "Visibility state changed to " + e.visibilityState), t.It.Y();
|
|
5371
5761
|
};
|
|
5372
|
-
var e =
|
|
5373
|
-
e && "function" == typeof e.addEventListener && e.addEventListener("visibilitychange", this.
|
|
5762
|
+
var e = jr();
|
|
5763
|
+
e && "function" == typeof e.addEventListener && e.addEventListener("visibilitychange", this.kt);
|
|
5374
5764
|
}
|
|
5375
5765
|
return Object.defineProperty(t.prototype, "isShuttingDown", {
|
|
5376
5766
|
get: function() {
|
|
@@ -5387,25 +5777,25 @@ function Dr(t, e) {
|
|
|
5387
5777
|
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
5388
5778
|
this.enqueue(t);
|
|
5389
5779
|
}, t.prototype.enqueueAndForgetEvenWhileRestricted = function(t) {
|
|
5390
|
-
this.
|
|
5780
|
+
this.Ct(),
|
|
5391
5781
|
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
5392
|
-
this.
|
|
5782
|
+
this.Lt(t);
|
|
5393
5783
|
}, t.prototype.enterRestrictedMode = function(t) {
|
|
5394
5784
|
if (!this.$t) {
|
|
5395
5785
|
this.$t = !0, this.qt = t || !1;
|
|
5396
|
-
var e =
|
|
5397
|
-
e && "function" == typeof e.removeEventListener && e.removeEventListener("visibilitychange", this.
|
|
5786
|
+
var e = jr();
|
|
5787
|
+
e && "function" == typeof e.removeEventListener && e.removeEventListener("visibilitychange", this.kt);
|
|
5398
5788
|
}
|
|
5399
5789
|
}, t.prototype.enqueue = function(t) {
|
|
5400
5790
|
var e = this;
|
|
5401
|
-
if (this.
|
|
5791
|
+
if (this.Ct(), this.$t)
|
|
5402
5792
|
// Return a Promise which never resolves.
|
|
5403
5793
|
return new Promise((function() {}));
|
|
5404
5794
|
// Create a deferred Promise that we can return to the callee. This
|
|
5405
5795
|
// allows us to return a "hanging Promise" only to the callee and still
|
|
5406
5796
|
// advance the queue even when the operation is not run.
|
|
5407
5797
|
var n = new U;
|
|
5408
|
-
return this.
|
|
5798
|
+
return this.Lt((function() {
|
|
5409
5799
|
return e.$t && e.qt ? Promise.resolve() : (t().then(n.resolve, n.reject), n.promise);
|
|
5410
5800
|
})).then((function() {
|
|
5411
5801
|
return n.promise;
|
|
@@ -5413,27 +5803,27 @@ function Dr(t, e) {
|
|
|
5413
5803
|
}, t.prototype.enqueueRetryable = function(t) {
|
|
5414
5804
|
var e = this;
|
|
5415
5805
|
this.enqueueAndForget((function() {
|
|
5416
|
-
return e.
|
|
5806
|
+
return e.Dt.push(t), e.Mt();
|
|
5417
5807
|
}));
|
|
5418
5808
|
},
|
|
5419
5809
|
/**
|
|
5420
5810
|
* Runs the next operation from the retryable queue. If the operation fails,
|
|
5421
5811
|
* reschedules with backoff.
|
|
5422
5812
|
*/
|
|
5423
|
-
t.prototype.
|
|
5813
|
+
t.prototype.Mt = function() {
|
|
5424
5814
|
return e(this, void 0, void 0, (function() {
|
|
5425
5815
|
var t, e = this;
|
|
5426
5816
|
return n(this, (function(n) {
|
|
5427
5817
|
switch (n.label) {
|
|
5428
5818
|
case 0:
|
|
5429
|
-
if (0 === this.
|
|
5819
|
+
if (0 === this.Dt.length) return [ 3 /*break*/ , 5 ];
|
|
5430
5820
|
n.label = 1;
|
|
5431
5821
|
|
|
5432
5822
|
case 1:
|
|
5433
|
-
return n.trys.push([ 1, 3, , 4 ]), [ 4 /*yield*/ , this.
|
|
5823
|
+
return n.trys.push([ 1, 3, , 4 ]), [ 4 /*yield*/ , this.Dt[0]() ];
|
|
5434
5824
|
|
|
5435
5825
|
case 2:
|
|
5436
|
-
return n.sent(), this.
|
|
5826
|
+
return n.sent(), this.Dt.shift(), this.It.reset(), [ 3 /*break*/ , 4 ];
|
|
5437
5827
|
|
|
5438
5828
|
case 3:
|
|
5439
5829
|
if (t = n.sent(), "IndexedDbTransactionError" !== t.name) throw t;
|
|
@@ -5442,7 +5832,7 @@ function Dr(t, e) {
|
|
|
5442
5832
|
[ 3 /*break*/ , 4 ];
|
|
5443
5833
|
|
|
5444
5834
|
case 4:
|
|
5445
|
-
this.
|
|
5835
|
+
this.Dt.length > 0 &&
|
|
5446
5836
|
// If there are additional operations, we re-schedule `retryNextOp()`.
|
|
5447
5837
|
// This is necessary to run retryable operations that failed during
|
|
5448
5838
|
// their initial attempt since we don't know whether they are already
|
|
@@ -5453,8 +5843,8 @@ function Dr(t, e) {
|
|
|
5453
5843
|
// Since `backoffAndRun()` cancels an existing backoff and schedules a
|
|
5454
5844
|
// new backoff on every call, there is only ever a single additional
|
|
5455
5845
|
// operation in the queue.
|
|
5456
|
-
this.
|
|
5457
|
-
return e.
|
|
5846
|
+
this.It.W((function() {
|
|
5847
|
+
return e.Mt();
|
|
5458
5848
|
})), n.label = 5;
|
|
5459
5849
|
|
|
5460
5850
|
case 5:
|
|
@@ -5462,10 +5852,10 @@ function Dr(t, e) {
|
|
|
5462
5852
|
}
|
|
5463
5853
|
}));
|
|
5464
5854
|
}));
|
|
5465
|
-
}, t.prototype.
|
|
5466
|
-
var e = this, n = this.
|
|
5467
|
-
return e.
|
|
5468
|
-
e.
|
|
5855
|
+
}, t.prototype.Lt = function(t) {
|
|
5856
|
+
var e = this, n = this.Nt.then((function() {
|
|
5857
|
+
return e.St = !0, t().catch((function(t) {
|
|
5858
|
+
e.Ft = t, e.St = !1;
|
|
5469
5859
|
var n =
|
|
5470
5860
|
/**
|
|
5471
5861
|
* Chrome includes Error.message in Error.stack. Other browsers do not.
|
|
@@ -5482,39 +5872,39 @@ function Dr(t, e) {
|
|
|
5482
5872
|
// and return the rejected Promise.
|
|
5483
5873
|
throw b("INTERNAL UNHANDLED ERROR: ", n), t;
|
|
5484
5874
|
})).then((function(t) {
|
|
5485
|
-
return e.
|
|
5875
|
+
return e.St = !1, t;
|
|
5486
5876
|
}));
|
|
5487
5877
|
}));
|
|
5488
|
-
return this.
|
|
5878
|
+
return this.Nt = n, n;
|
|
5489
5879
|
}, t.prototype.enqueueAfterDelay = function(t, e, n) {
|
|
5490
5880
|
var r = this;
|
|
5491
|
-
this.
|
|
5881
|
+
this.Ct(),
|
|
5492
5882
|
// Fast-forward delays for timerIds that have been overriden.
|
|
5493
5883
|
this.Ot.indexOf(t) > -1 && (e = 0);
|
|
5494
|
-
var i =
|
|
5495
|
-
return r.
|
|
5884
|
+
var i = Mr.createAndSchedule(this, t, e, n, (function(t) {
|
|
5885
|
+
return r.Ut(t);
|
|
5496
5886
|
}));
|
|
5497
|
-
return this.
|
|
5498
|
-
}, t.prototype.
|
|
5499
|
-
this.
|
|
5887
|
+
return this.xt.push(i), i;
|
|
5888
|
+
}, t.prototype.Ct = function() {
|
|
5889
|
+
this.Ft && E();
|
|
5500
5890
|
}, t.prototype.verifyOperationInProgress = function() {},
|
|
5501
5891
|
/**
|
|
5502
5892
|
* Waits until all currently queued tasks are finished executing. Delayed
|
|
5503
5893
|
* operations are not run.
|
|
5504
5894
|
*/
|
|
5505
|
-
t.prototype.
|
|
5895
|
+
t.prototype.jt = function() {
|
|
5506
5896
|
return e(this, void 0, void 0, (function() {
|
|
5507
5897
|
var t;
|
|
5508
5898
|
return n(this, (function(e) {
|
|
5509
5899
|
switch (e.label) {
|
|
5510
5900
|
case 0:
|
|
5511
|
-
return [ 4 /*yield*/ , t = this.
|
|
5901
|
+
return [ 4 /*yield*/ , t = this.Nt ];
|
|
5512
5902
|
|
|
5513
5903
|
case 1:
|
|
5514
5904
|
e.sent(), e.label = 2;
|
|
5515
5905
|
|
|
5516
5906
|
case 2:
|
|
5517
|
-
if (t !== this.
|
|
5907
|
+
if (t !== this.Nt) return [ 3 /*break*/ , 0 ];
|
|
5518
5908
|
e.label = 3;
|
|
5519
5909
|
|
|
5520
5910
|
case 3:
|
|
@@ -5528,7 +5918,7 @@ function Dr(t, e) {
|
|
|
5528
5918
|
* exists.
|
|
5529
5919
|
*/
|
|
5530
5920
|
t.prototype.Bt = function(t) {
|
|
5531
|
-
for (var e = 0, n = this.
|
|
5921
|
+
for (var e = 0, n = this.xt; e < n.length; e++) {
|
|
5532
5922
|
if (n[e].timerId === t) return !0;
|
|
5533
5923
|
}
|
|
5534
5924
|
return !1;
|
|
@@ -5543,16 +5933,16 @@ function Dr(t, e) {
|
|
|
5543
5933
|
t.prototype.zt = function(t) {
|
|
5544
5934
|
var e = this;
|
|
5545
5935
|
// Note that draining may generate more delayed ops, so we do that first.
|
|
5546
|
-
return this.
|
|
5936
|
+
return this.jt().then((function() {
|
|
5547
5937
|
// Run ops in the same order they'd run if they ran naturally.
|
|
5548
|
-
e.
|
|
5938
|
+
e.xt.sort((function(t, e) {
|
|
5549
5939
|
return t.targetTimeMs - e.targetTimeMs;
|
|
5550
5940
|
}));
|
|
5551
|
-
for (var n = 0, r = e.
|
|
5941
|
+
for (var n = 0, r = e.xt; n < r.length; n++) {
|
|
5552
5942
|
var i = r[n];
|
|
5553
5943
|
if (i.skipDelay(), "all" /* All */ !== t && i.timerId === t) break;
|
|
5554
5944
|
}
|
|
5555
|
-
return e.
|
|
5945
|
+
return e.jt();
|
|
5556
5946
|
}));
|
|
5557
5947
|
},
|
|
5558
5948
|
/**
|
|
@@ -5561,15 +5951,15 @@ function Dr(t, e) {
|
|
|
5561
5951
|
t.prototype.Gt = function(t) {
|
|
5562
5952
|
this.Ot.push(t);
|
|
5563
5953
|
},
|
|
5564
|
-
/** Called once a DelayedOperation is run or canceled. */ t.prototype.
|
|
5954
|
+
/** Called once a DelayedOperation is run or canceled. */ t.prototype.Ut = function(t) {
|
|
5565
5955
|
// NOTE: indexOf / slice are O(n), but delayedOperations is expected to be small.
|
|
5566
|
-
var e = this.
|
|
5567
|
-
this.
|
|
5956
|
+
var e = this.xt.indexOf(t);
|
|
5957
|
+
this.xt.splice(e, 1);
|
|
5568
5958
|
}, t;
|
|
5569
|
-
}(),
|
|
5959
|
+
}(), Br = /** @class */ function() {
|
|
5570
5960
|
/** @hideconstructor */
|
|
5571
5961
|
function t(t, e) {
|
|
5572
|
-
this._firestore = t, this._transaction = e, this._dataReader =
|
|
5962
|
+
this._firestore = t, this._transaction = e, this._dataReader = Pn(t)
|
|
5573
5963
|
/**
|
|
5574
5964
|
* Reads the document referenced by the provided {@link DocumentReference}.
|
|
5575
5965
|
*
|
|
@@ -5578,23 +5968,23 @@ function Dr(t, e) {
|
|
|
5578
5968
|
*/;
|
|
5579
5969
|
}
|
|
5580
5970
|
return t.prototype.get = function(t) {
|
|
5581
|
-
var e = this, n =
|
|
5971
|
+
var e = this, n = qr(t, this._firestore), r = new _r(this._firestore);
|
|
5582
5972
|
return this._transaction.lookup([ n._key ]).then((function(t) {
|
|
5583
|
-
if (!t || 1 !== t.length) return
|
|
5973
|
+
if (!t || 1 !== t.length) return E();
|
|
5584
5974
|
var i = t[0];
|
|
5585
|
-
if (i.isFoundDocument()) return new
|
|
5586
|
-
if (i.isNoDocument()) return new
|
|
5587
|
-
throw
|
|
5975
|
+
if (i.isFoundDocument()) return new $n(e._firestore, r, i.key, i, n.converter);
|
|
5976
|
+
if (i.isNoDocument()) return new $n(e._firestore, r, n._key, null, n.converter);
|
|
5977
|
+
throw E();
|
|
5588
5978
|
}));
|
|
5589
5979
|
}, t.prototype.set = function(t, e, n) {
|
|
5590
|
-
var r =
|
|
5980
|
+
var r = qr(t, this._firestore), i = br(r.converter, e, n), o = Nn(this._dataReader, "Transaction.set", r._key, i, null !== r.converter, n);
|
|
5591
5981
|
return this._transaction.set(r._key, o), this;
|
|
5592
5982
|
}, t.prototype.update = function(t, e, n) {
|
|
5593
5983
|
for (var r = [], i = 3; i < arguments.length; i++) r[i - 3] = arguments[i];
|
|
5594
|
-
var o, a =
|
|
5984
|
+
var o, a = qr(t, this._firestore);
|
|
5595
5985
|
// For Compat types, we have to "extract" the underlying types before
|
|
5596
5986
|
// performing validation.
|
|
5597
|
-
return o = "string" == typeof (e = p(e)) || e instanceof
|
|
5987
|
+
return o = "string" == typeof (e = p(e)) || e instanceof wn ? jn(this._dataReader, "Transaction.update", a._key, e, n, r) : Ln(this._dataReader, "Transaction.update", a._key, e),
|
|
5598
5988
|
this._transaction.update(a._key, o), this;
|
|
5599
5989
|
},
|
|
5600
5990
|
/**
|
|
@@ -5604,7 +5994,7 @@ function Dr(t, e) {
|
|
|
5604
5994
|
* @returns This `Transaction` instance. Used for chaining method calls.
|
|
5605
5995
|
*/
|
|
5606
5996
|
t.prototype.delete = function(t) {
|
|
5607
|
-
var e =
|
|
5997
|
+
var e = qr(t, this._firestore);
|
|
5608
5998
|
return this._transaction.delete(e._key), this;
|
|
5609
5999
|
}, t;
|
|
5610
6000
|
}();
|
|
@@ -5637,19 +6027,21 @@ function Dr(t, e) {
|
|
|
5637
6027
|
* transaction against.
|
|
5638
6028
|
* @param updateFunction - The function to execute within the transaction
|
|
5639
6029
|
* context.
|
|
6030
|
+
* @param options - An options object to configure maximum number of attempts to
|
|
6031
|
+
* commit.
|
|
5640
6032
|
* @returns If the transaction completed successfully or was explicitly aborted
|
|
5641
6033
|
* (the `updateFunction` returned a failed promise), the promise returned by the
|
|
5642
6034
|
* `updateFunction `is returned here. Otherwise, if the transaction failed, a
|
|
5643
6035
|
* rejected promise with the corresponding failure error is returned.
|
|
5644
6036
|
*/
|
|
5645
|
-
function
|
|
5646
|
-
var r =
|
|
6037
|
+
function zr(t, e, n) {
|
|
6038
|
+
var r = rn(t = st(t, an)), i = Object.assign(Object.assign({}, Cr), n);
|
|
5647
6039
|
!function(t) {
|
|
5648
6040
|
if (t.maxAttempts < 1) throw new M(V, "Max attempts must be at least 1");
|
|
5649
6041
|
}(i);
|
|
5650
6042
|
var o = new U;
|
|
5651
|
-
return new
|
|
5652
|
-
return e(new
|
|
6043
|
+
return new Lr(new Ur, r, i, (function(n) {
|
|
6044
|
+
return e(new Br(t, n));
|
|
5653
6045
|
}), o).run(), o.promise
|
|
5654
6046
|
/**
|
|
5655
6047
|
* Firestore Lite
|
|
@@ -5661,12 +6053,12 @@ function Rr(t, e, n) {
|
|
|
5661
6053
|
*/;
|
|
5662
6054
|
}
|
|
5663
6055
|
|
|
5664
|
-
|
|
5665
|
-
var n = e.options, r = t.getProvider("app").getImmediate(), i = new
|
|
6056
|
+
m = i + "_lite", o(new c("firestore/lite", (function(t, e) {
|
|
6057
|
+
var n = e.options, r = t.getProvider("app").getImmediate(), i = new an(r, new K(t.getProvider("auth-internal")), new Y(t.getProvider("app-check-internal")));
|
|
5666
6058
|
return n && i._setSettings(n), i;
|
|
5667
6059
|
}), "PUBLIC")),
|
|
5668
6060
|
// RUNTIME_ENV and BUILD_TARGET are replaced by real values during the compilation
|
|
5669
|
-
a("firestore-lite", "3.4.
|
|
6061
|
+
a("firestore-lite", "3.4.10-canary.ebc17e27f", ""), a("firestore-lite", "3.4.10-canary.ebc17e27f", "esm5");
|
|
5670
6062
|
|
|
5671
|
-
export {
|
|
6063
|
+
export { _n as Bytes, pn as CollectionReference, fn as DocumentReference, $n as DocumentSnapshot, wn as FieldPath, Tn as FieldValue, an as Firestore, M as FirestoreError, En as GeoPoint, hn as Query, er as QueryConstraint, Xn as QueryDocumentSnapshot, Jn as QuerySnapshot, bt as Timestamp, Br as Transaction, Or as WriteBatch, Ar as addDoc, Nr as arrayRemove, Pr as arrayUnion, dn as collection, yn as collectionGroup, cn as connectFirestoreEmulator, Ir as deleteDoc, Vr as deleteField, mn as doc, bn as documentId, yr as endAt, dr as endBefore, Tr as getDoc, Er as getDocs, un as getFirestore, Fr as increment, sn as initializeFirestore, ur as limit, cr as limitToLast, ar as orderBy, nr as query, gn as queryEqual, vn as refEqual, zr as runTransaction, Dr as serverTimestamp, Sr as setDoc, g as setLogLevel, Zn as snapshotEqual, hr as startAfter, fr as startAt, ln as terminate, kr as updateDoc, ir as where, Rr as writeBatch };
|
|
5672
6064
|
//# sourceMappingURL=index.browser.esm5.js.map
|