@firebase/firestore 4.6.2-canary.8fb372afb → 4.6.2-dataconnect-preview.877f8b7d0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +294 -294
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm2017.js +294 -294
- package/dist/index.esm2017.js.map +1 -1
- package/dist/index.esm5.js +3082 -3082
- package/dist/index.esm5.js.map +1 -1
- package/dist/index.node.cjs.js +2 -2
- package/dist/index.node.mjs +2 -2
- package/dist/index.rn.js +294 -294
- package/dist/index.rn.js.map +1 -1
- package/dist/lite/index.browser.esm2017.js +153 -152
- package/dist/lite/index.browser.esm2017.js.map +1 -1
- package/dist/lite/index.browser.esm5.js +905 -904
- package/dist/lite/index.browser.esm5.js.map +1 -1
- package/dist/lite/index.cjs.js +153 -152
- package/dist/lite/index.cjs.js.map +1 -1
- package/dist/lite/index.node.cjs.js +2 -2
- package/dist/lite/index.node.mjs +2 -2
- package/dist/lite/index.rn.esm2017.js +153 -152
- package/dist/lite/index.rn.esm2017.js.map +1 -1
- package/dist/packages/firestore/dist/index.esm2017.d.ts +2 -2
- package/package.json +9 -9
|
@@ -8,6 +8,24 @@ import { Logger as l, LogLevel as f } from "@firebase/logger";
|
|
|
8
8
|
|
|
9
9
|
import { FirebaseError as h, deepEqual as p, getModularInstance as d, getDefaultEmulatorHostnameAndPort as y, createMockUserToken as m } from "@firebase/util";
|
|
10
10
|
|
|
11
|
+
var v = "4.6.2-dataconnect-preview.877f8b7d0", g = /** @class */ function() {
|
|
12
|
+
function t(t) {
|
|
13
|
+
this.uid = t;
|
|
14
|
+
}
|
|
15
|
+
return t.prototype.isAuthenticated = function() {
|
|
16
|
+
return null != this.uid;
|
|
17
|
+
},
|
|
18
|
+
/**
|
|
19
|
+
* Returns a key representing this user, suitable for inclusion in a
|
|
20
|
+
* dictionary.
|
|
21
|
+
*/
|
|
22
|
+
t.prototype.toKey = function() {
|
|
23
|
+
return this.isAuthenticated() ? "uid:" + this.uid : "anonymous-user";
|
|
24
|
+
}, t.prototype.isEqual = function(t) {
|
|
25
|
+
return t.uid === this.uid;
|
|
26
|
+
}, t;
|
|
27
|
+
}();
|
|
28
|
+
|
|
11
29
|
/**
|
|
12
30
|
* @license
|
|
13
31
|
* Copyright 2017 Google LLC
|
|
@@ -27,24 +45,7 @@ import { FirebaseError as h, deepEqual as p, getModularInstance as d, getDefault
|
|
|
27
45
|
/**
|
|
28
46
|
* Simple wrapper around a nullable UID. Mostly exists to make code more
|
|
29
47
|
* readable.
|
|
30
|
-
*/
|
|
31
|
-
function t(t) {
|
|
32
|
-
this.uid = t;
|
|
33
|
-
}
|
|
34
|
-
return t.prototype.isAuthenticated = function() {
|
|
35
|
-
return null != this.uid;
|
|
36
|
-
},
|
|
37
|
-
/**
|
|
38
|
-
* Returns a key representing this user, suitable for inclusion in a
|
|
39
|
-
* dictionary.
|
|
40
|
-
*/
|
|
41
|
-
t.prototype.toKey = function() {
|
|
42
|
-
return this.isAuthenticated() ? "uid:" + this.uid : "anonymous-user";
|
|
43
|
-
}, t.prototype.isEqual = function(t) {
|
|
44
|
-
return t.uid === this.uid;
|
|
45
|
-
}, t;
|
|
46
|
-
}();
|
|
47
|
-
|
|
48
|
+
*/
|
|
48
49
|
/** A user with a null UID. */ g.UNAUTHENTICATED = new g(null),
|
|
49
50
|
// TODO(mikelehen): Look into getting a proper uid-equivalent for
|
|
50
51
|
// non-FirebaseAuth providers.
|
|
@@ -67,7 +68,7 @@ g.MOCK_USER = new g("mock-user");
|
|
|
67
68
|
* See the License for the specific language governing permissions and
|
|
68
69
|
* limitations under the License.
|
|
69
70
|
*/
|
|
70
|
-
var
|
|
71
|
+
var w = "10.12.0-dataconnect-preview.877f8b7d0", _ = new l("@firebase/firestore");
|
|
71
72
|
|
|
72
73
|
/**
|
|
73
74
|
* @license
|
|
@@ -98,39 +99,39 @@ var v = "10.12.0-canary.8fb372afb", w = new l("@firebase/firestore");
|
|
|
98
99
|
* <li><code>`silent` to turn off logging.</li>
|
|
99
100
|
* </ul>
|
|
100
101
|
*/
|
|
101
|
-
function
|
|
102
|
-
|
|
102
|
+
function b(t) {
|
|
103
|
+
_.setLogLevel(t);
|
|
103
104
|
}
|
|
104
105
|
|
|
105
|
-
function
|
|
106
|
+
function T(t) {
|
|
106
107
|
for (var e = [], n = 1; n < arguments.length; n++) e[n - 1] = arguments[n];
|
|
107
|
-
if (
|
|
108
|
-
var i = e.map(
|
|
109
|
-
|
|
108
|
+
if (_.logLevel <= f.DEBUG) {
|
|
109
|
+
var i = e.map(k);
|
|
110
|
+
_.debug.apply(_, r([ "Firestore (".concat(w, "): ").concat(t) ], i, !1));
|
|
110
111
|
}
|
|
111
112
|
}
|
|
112
113
|
|
|
113
|
-
function
|
|
114
|
+
function E(t) {
|
|
114
115
|
for (var e = [], n = 1; n < arguments.length; n++) e[n - 1] = arguments[n];
|
|
115
|
-
if (
|
|
116
|
-
var i = e.map(
|
|
117
|
-
|
|
116
|
+
if (_.logLevel <= f.ERROR) {
|
|
117
|
+
var i = e.map(k);
|
|
118
|
+
_.error.apply(_, r([ "Firestore (".concat(w, "): ").concat(t) ], i, !1));
|
|
118
119
|
}
|
|
119
120
|
}
|
|
120
121
|
|
|
121
122
|
/**
|
|
122
123
|
* @internal
|
|
123
|
-
*/ function
|
|
124
|
+
*/ function S(t) {
|
|
124
125
|
for (var e = [], n = 1; n < arguments.length; n++) e[n - 1] = arguments[n];
|
|
125
|
-
if (
|
|
126
|
-
var i = e.map(
|
|
127
|
-
|
|
126
|
+
if (_.logLevel <= f.WARN) {
|
|
127
|
+
var i = e.map(k);
|
|
128
|
+
_.warn.apply(_, r([ "Firestore (".concat(w, "): ").concat(t) ], i, !1));
|
|
128
129
|
}
|
|
129
130
|
}
|
|
130
131
|
|
|
131
132
|
/**
|
|
132
133
|
* Converts an additional log parameter to a string representation.
|
|
133
|
-
*/ function
|
|
134
|
+
*/ function k(t) {
|
|
134
135
|
if ("string" == typeof t) return t;
|
|
135
136
|
try {
|
|
136
137
|
/**
|
|
@@ -182,15 +183,15 @@ function T(t) {
|
|
|
182
183
|
* Returns `never` and can be used in expressions:
|
|
183
184
|
* @example
|
|
184
185
|
* let futureVar = fail('not implemented yet');
|
|
185
|
-
*/ function
|
|
186
|
+
*/ function I(t) {
|
|
186
187
|
void 0 === t && (t = "Unexpected state");
|
|
187
188
|
// Log the failure in addition to throw an exception, just in case the
|
|
188
189
|
// exception is swallowed.
|
|
189
|
-
var e = "FIRESTORE (".concat(
|
|
190
|
+
var e = "FIRESTORE (".concat(w, ") INTERNAL ASSERTION FAILED: ") + t;
|
|
190
191
|
// NOTE: We don't use FirestoreError here because these are internal failures
|
|
191
192
|
// that cannot be handled by the user. (Also it would create a circular
|
|
192
193
|
// dependency between the error and assert modules which doesn't work.)
|
|
193
|
-
throw
|
|
194
|
+
throw E(e), new Error(e)
|
|
194
195
|
/**
|
|
195
196
|
* Fails if the given assertion condition is false, throwing an Error with the
|
|
196
197
|
* given message if it did.
|
|
@@ -199,14 +200,14 @@ function T(t) {
|
|
|
199
200
|
*/;
|
|
200
201
|
}
|
|
201
202
|
|
|
202
|
-
function
|
|
203
|
-
t ||
|
|
203
|
+
function A(t, e) {
|
|
204
|
+
t || I();
|
|
204
205
|
}
|
|
205
206
|
|
|
206
207
|
/**
|
|
207
208
|
* Casts `obj` to `T`. In non-production builds, verifies that `obj` is an
|
|
208
209
|
* instance of `T` before casting.
|
|
209
|
-
*/ function
|
|
210
|
+
*/ function P(t,
|
|
210
211
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
211
212
|
e) {
|
|
212
213
|
return t;
|
|
@@ -227,7 +228,7 @@ e) {
|
|
|
227
228
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
228
229
|
* See the License for the specific language governing permissions and
|
|
229
230
|
* limitations under the License.
|
|
230
|
-
*/ var
|
|
231
|
+
*/ var F = "cancelled", O = "unknown", V = "invalid-argument", N = "deadline-exceeded", D = "not-found", R = "permission-denied", q = "unauthenticated", x = "resource-exhausted", C = "failed-precondition", j = "aborted", L = "out-of-range", M = "unimplemented", U = "internal", B = "unavailable", z = /** @class */ function(e) {
|
|
231
232
|
/** @hideconstructor */
|
|
232
233
|
function n(
|
|
233
234
|
/**
|
|
@@ -248,14 +249,14 @@ e) {
|
|
|
248
249
|
}, r;
|
|
249
250
|
}
|
|
250
251
|
return t(n, e), n;
|
|
251
|
-
}(h),
|
|
252
|
+
}(h), G = function() {
|
|
252
253
|
var t = this;
|
|
253
254
|
this.promise = new Promise((function(e, n) {
|
|
254
255
|
t.resolve = e, t.reject = n;
|
|
255
256
|
}));
|
|
256
|
-
},
|
|
257
|
+
}, K = function(t, e) {
|
|
257
258
|
this.user = e, this.type = "OAuth", this.headers = new Map, this.headers.set("Authorization", "Bearer ".concat(t));
|
|
258
|
-
},
|
|
259
|
+
}, Q = /** @class */ function() {
|
|
259
260
|
function t() {}
|
|
260
261
|
return t.prototype.getToken = function() {
|
|
261
262
|
return Promise.resolve(null);
|
|
@@ -265,7 +266,7 @@ e) {
|
|
|
265
266
|
return e(g.UNAUTHENTICATED);
|
|
266
267
|
}));
|
|
267
268
|
}, t.prototype.shutdown = function() {}, t;
|
|
268
|
-
}(),
|
|
269
|
+
}(), Y = /** @class */ function() {
|
|
269
270
|
function t(t) {
|
|
270
271
|
this.token = t,
|
|
271
272
|
/**
|
|
@@ -287,7 +288,7 @@ e) {
|
|
|
287
288
|
}, t.prototype.shutdown = function() {
|
|
288
289
|
this.changeListener = null;
|
|
289
290
|
}, t;
|
|
290
|
-
}(),
|
|
291
|
+
}(), H = /** @class */ function() {
|
|
291
292
|
function t(t) {
|
|
292
293
|
var e = this;
|
|
293
294
|
this.auth = null, t.onInit((function(t) {
|
|
@@ -297,11 +298,11 @@ e) {
|
|
|
297
298
|
return t.prototype.getToken = function() {
|
|
298
299
|
var t = this;
|
|
299
300
|
return this.auth ? this.auth.getToken().then((function(e) {
|
|
300
|
-
return e ? (
|
|
301
|
+
return e ? (A("string" == typeof e.accessToken), new K(e.accessToken, new g(t.auth.getUid()))) : null;
|
|
301
302
|
})) : Promise.resolve(null);
|
|
302
303
|
}, t.prototype.invalidateToken = function() {}, t.prototype.start = function(t, e) {},
|
|
303
304
|
t.prototype.shutdown = function() {}, t;
|
|
304
|
-
}(),
|
|
305
|
+
}(), W = /** @class */ function() {
|
|
305
306
|
function t(t, e, n) {
|
|
306
307
|
this.t = t, this.i = e, this.o = n, this.type = "FirstParty", this.user = g.FIRST_PARTY,
|
|
307
308
|
this.u = new Map
|
|
@@ -323,12 +324,12 @@ e) {
|
|
|
323
324
|
enumerable: !1,
|
|
324
325
|
configurable: !0
|
|
325
326
|
}), t;
|
|
326
|
-
}(),
|
|
327
|
+
}(), J = /** @class */ function() {
|
|
327
328
|
function t(t, e, n) {
|
|
328
329
|
this.t = t, this.i = e, this.o = n;
|
|
329
330
|
}
|
|
330
331
|
return t.prototype.getToken = function() {
|
|
331
|
-
return Promise.resolve(new
|
|
332
|
+
return Promise.resolve(new W(this.t, this.i, this.o));
|
|
332
333
|
}, t.prototype.start = function(t, e) {
|
|
333
334
|
// Fire with initial uid.
|
|
334
335
|
t.enqueueRetryable((function() {
|
|
@@ -336,9 +337,9 @@ e) {
|
|
|
336
337
|
}));
|
|
337
338
|
}, t.prototype.shutdown = function() {}, t.prototype.invalidateToken = function() {},
|
|
338
339
|
t;
|
|
339
|
-
}(),
|
|
340
|
+
}(), X = function(t) {
|
|
340
341
|
this.value = t, this.type = "AppCheck", this.headers = new Map, t && t.length > 0 && this.headers.set("x-firebase-appcheck", this.value);
|
|
341
|
-
},
|
|
342
|
+
}, Z = /** @class */ function() {
|
|
342
343
|
function t(t) {
|
|
343
344
|
var e = this;
|
|
344
345
|
this.h = t, this.appCheck = null, t.onInit((function(t) {
|
|
@@ -347,11 +348,11 @@ e) {
|
|
|
347
348
|
}
|
|
348
349
|
return t.prototype.getToken = function() {
|
|
349
350
|
return this.appCheck ? this.appCheck.getToken().then((function(t) {
|
|
350
|
-
return t ? (
|
|
351
|
+
return t ? (A("string" == typeof t.token), new X(t.token)) : null;
|
|
351
352
|
})) : Promise.resolve(null);
|
|
352
353
|
}, t.prototype.invalidateToken = function() {}, t.prototype.start = function(t, e) {},
|
|
353
354
|
t.prototype.shutdown = function() {}, t;
|
|
354
|
-
}(),
|
|
355
|
+
}(), $ =
|
|
355
356
|
/**
|
|
356
357
|
* Constructs a DatabaseInfo using the provided host, databaseId and
|
|
357
358
|
* persistenceKey.
|
|
@@ -374,7 +375,7 @@ function(t, e, n, r, i, o, a, u, s) {
|
|
|
374
375
|
this.databaseId = t, this.appId = e, this.persistenceKey = n, this.host = r, this.ssl = i,
|
|
375
376
|
this.forceLongPolling = o, this.autoDetectLongPolling = a, this.longPollingOptions = u,
|
|
376
377
|
this.useFetchStreams = s;
|
|
377
|
-
},
|
|
378
|
+
}, tt = /** @class */ function() {
|
|
378
379
|
function t(t, e) {
|
|
379
380
|
this.projectId = t, this.database = e || "(default)";
|
|
380
381
|
}
|
|
@@ -389,9 +390,9 @@ function(t, e, n, r, i, o, a, u, s) {
|
|
|
389
390
|
}), t.prototype.isEqual = function(e) {
|
|
390
391
|
return e instanceof t && e.projectId === this.projectId && e.database === this.database;
|
|
391
392
|
}, t;
|
|
392
|
-
}(),
|
|
393
|
+
}(), et = /** @class */ function() {
|
|
393
394
|
function t(t, e, n) {
|
|
394
|
-
void 0 === e ? e = 0 : e > t.length &&
|
|
395
|
+
void 0 === e ? e = 0 : e > t.length && I(), void 0 === n ? n = t.length - e : n > t.length - e && I(),
|
|
395
396
|
this.segments = t, this.offset = e, this.len = n;
|
|
396
397
|
}
|
|
397
398
|
return Object.defineProperty(t.prototype, "length", {
|
|
@@ -442,7 +443,7 @@ function(t, e, n, r, i, o, a, u, s) {
|
|
|
442
443
|
}
|
|
443
444
|
return t.length < e.length ? -1 : t.length > e.length ? 1 : 0;
|
|
444
445
|
}, t;
|
|
445
|
-
}(),
|
|
446
|
+
}(), nt = /** @class */ function(e) {
|
|
446
447
|
function n() {
|
|
447
448
|
return null !== e && e.apply(this, arguments) || this;
|
|
448
449
|
}
|
|
@@ -476,7 +477,7 @@ function(t, e, n, r, i, o, a, u, s) {
|
|
|
476
477
|
// for legacy reasons and should not be used frequently).
|
|
477
478
|
for (var r = [], i = 0, o = t; i < o.length; i++) {
|
|
478
479
|
var a = o[i];
|
|
479
|
-
if (a.indexOf("//") >= 0) throw new
|
|
480
|
+
if (a.indexOf("//") >= 0) throw new z(V, "Invalid segment (".concat(a, "). Paths must not contain // in them."));
|
|
480
481
|
// Strip leading and traling slashed.
|
|
481
482
|
r.push.apply(r, a.split("/").filter((function(t) {
|
|
482
483
|
return t.length > 0;
|
|
@@ -486,7 +487,7 @@ function(t, e, n, r, i, o, a, u, s) {
|
|
|
486
487
|
}, n.emptyPath = function() {
|
|
487
488
|
return new n([]);
|
|
488
489
|
}, n;
|
|
489
|
-
}(
|
|
490
|
+
}(et), rt = /^[_a-zA-Z][_a-zA-Z0-9]*$/, it = /** @class */ function(e) {
|
|
490
491
|
function n() {
|
|
491
492
|
return null !== e && e.apply(this, arguments) || this;
|
|
492
493
|
}
|
|
@@ -498,7 +499,7 @@ function(t, e, n, r, i, o, a, u, s) {
|
|
|
498
499
|
* without escaping.
|
|
499
500
|
*/
|
|
500
501
|
n.isValidIdentifier = function(t) {
|
|
501
|
-
return
|
|
502
|
+
return rt.test(t);
|
|
502
503
|
}, n.prototype.canonicalString = function() {
|
|
503
504
|
return this.toArray().map((function(t) {
|
|
504
505
|
return t = t.replace(/\\/g, "\\\\").replace(/`/g, "\\`"), n.isValidIdentifier(t) || (t = "`" + t + "`"),
|
|
@@ -531,32 +532,32 @@ function(t, e, n, r, i, o, a, u, s) {
|
|
|
531
532
|
*/
|
|
532
533
|
n.fromServerFormat = function(t) {
|
|
533
534
|
for (var e = [], r = "", i = 0, o = function() {
|
|
534
|
-
if (0 === r.length) throw new
|
|
535
|
+
if (0 === r.length) throw new z(V, "Invalid field path (".concat(t, "). Paths must not be empty, begin with '.', end with '.', or contain '..'"));
|
|
535
536
|
e.push(r), r = "";
|
|
536
537
|
}, a = !1; i < t.length; ) {
|
|
537
538
|
var u = t[i];
|
|
538
539
|
if ("\\" === u) {
|
|
539
|
-
if (i + 1 === t.length) throw new
|
|
540
|
+
if (i + 1 === t.length) throw new z(V, "Path has trailing escape character: " + t);
|
|
540
541
|
var s = t[i + 1];
|
|
541
|
-
if ("\\" !== s && "." !== s && "`" !== s) throw new
|
|
542
|
+
if ("\\" !== s && "." !== s && "`" !== s) throw new z(V, "Path has invalid escape sequence: " + t);
|
|
542
543
|
r += s, i += 2;
|
|
543
544
|
} else "`" === u ? (a = !a, i++) : "." !== u || a ? (r += u, i++) : (o(), i++);
|
|
544
545
|
}
|
|
545
|
-
if (o(), a) throw new
|
|
546
|
+
if (o(), a) throw new z(V, "Unterminated ` in path: " + t);
|
|
546
547
|
return new n(e);
|
|
547
548
|
}, n.emptyPath = function() {
|
|
548
549
|
return new n([]);
|
|
549
550
|
}, n;
|
|
550
|
-
}(
|
|
551
|
+
}(et), ot = /** @class */ function() {
|
|
551
552
|
function t(t) {
|
|
552
553
|
this.path = t;
|
|
553
554
|
}
|
|
554
555
|
return t.fromPath = function(e) {
|
|
555
|
-
return new t(
|
|
556
|
+
return new t(nt.fromString(e));
|
|
556
557
|
}, t.fromName = function(e) {
|
|
557
|
-
return new t(
|
|
558
|
+
return new t(nt.fromString(e).popFirst(5));
|
|
558
559
|
}, t.empty = function() {
|
|
559
|
-
return new t(
|
|
560
|
+
return new t(nt.emptyPath());
|
|
560
561
|
}, Object.defineProperty(t.prototype, "collectionGroup", {
|
|
561
562
|
get: function() {
|
|
562
563
|
return this.path.popLast().lastSegment();
|
|
@@ -573,11 +574,11 @@ function(t, e, n, r, i, o, a, u, s) {
|
|
|
573
574
|
/** Returns the fully qualified path to the parent collection. */ t.prototype.getCollectionPath = function() {
|
|
574
575
|
return this.path.popLast();
|
|
575
576
|
}, t.prototype.isEqual = function(t) {
|
|
576
|
-
return null !== t && 0 ===
|
|
577
|
+
return null !== t && 0 === nt.comparator(this.path, t.path);
|
|
577
578
|
}, t.prototype.toString = function() {
|
|
578
579
|
return this.path.toString();
|
|
579
580
|
}, t.comparator = function(t, e) {
|
|
580
|
-
return
|
|
581
|
+
return nt.comparator(t.path, e.path);
|
|
581
582
|
}, t.isDocumentKey = function(t) {
|
|
582
583
|
return t.length % 2 == 0;
|
|
583
584
|
},
|
|
@@ -588,7 +589,7 @@ function(t, e, n, r, i, o, a, u, s) {
|
|
|
588
589
|
* @returns A new instance of DocumentKey
|
|
589
590
|
*/
|
|
590
591
|
t.fromSegments = function(e) {
|
|
591
|
-
return new t(new
|
|
592
|
+
return new t(new nt(e.slice()));
|
|
592
593
|
}, t;
|
|
593
594
|
}();
|
|
594
595
|
|
|
@@ -609,8 +610,8 @@ function(t, e, n, r, i, o, a, u, s) {
|
|
|
609
610
|
* See the License for the specific language governing permissions and
|
|
610
611
|
* limitations under the License.
|
|
611
612
|
*/
|
|
612
|
-
function
|
|
613
|
-
if (!n) throw new
|
|
613
|
+
function at(t, e, n) {
|
|
614
|
+
if (!n) throw new z(V, "Function ".concat(t, "() cannot be called with an empty ").concat(e, "."));
|
|
614
615
|
}
|
|
615
616
|
|
|
616
617
|
/**
|
|
@@ -620,22 +621,22 @@ function ot(t, e, n) {
|
|
|
620
621
|
/**
|
|
621
622
|
* Validates that `path` refers to a document (indicated by the fact it contains
|
|
622
623
|
* an even numbers of segments).
|
|
623
|
-
*/ function
|
|
624
|
-
if (!
|
|
624
|
+
*/ function ut(t) {
|
|
625
|
+
if (!ot.isDocumentKey(t)) throw new z(V, "Invalid document reference. Document references must have an even number of segments, but ".concat(t, " has ").concat(t.length, "."));
|
|
625
626
|
}
|
|
626
627
|
|
|
627
628
|
/**
|
|
628
629
|
* Validates that `path` refers to a collection (indicated by the fact it
|
|
629
630
|
* contains an odd numbers of segments).
|
|
630
|
-
*/ function
|
|
631
|
-
if (
|
|
631
|
+
*/ function st(t) {
|
|
632
|
+
if (ot.isDocumentKey(t)) throw new z(V, "Invalid collection reference. Collection references must have an odd number of segments, but ".concat(t, " has ").concat(t.length, "."));
|
|
632
633
|
}
|
|
633
634
|
|
|
634
635
|
/**
|
|
635
636
|
* Returns true if it's a non-null object without a custom prototype
|
|
636
637
|
* (i.e. excludes Array, Date, etc.).
|
|
637
638
|
*/
|
|
638
|
-
/** Returns a string describing the type / value of the provided input. */ function
|
|
639
|
+
/** Returns a string describing the type / value of the provided input. */ function ct(t) {
|
|
639
640
|
if (void 0 === t) return "undefined";
|
|
640
641
|
if (null === t) return "null";
|
|
641
642
|
if ("string" == typeof t) return t.length > 20 && (t = "".concat(t.substring(0, 20), "...")),
|
|
@@ -650,25 +651,25 @@ function ot(t, e, n) {
|
|
|
650
651
|
}(t);
|
|
651
652
|
return e ? "a custom ".concat(e, " object") : "an object";
|
|
652
653
|
}
|
|
653
|
-
return "function" == typeof t ? "a function" :
|
|
654
|
+
return "function" == typeof t ? "a function" : I();
|
|
654
655
|
}
|
|
655
656
|
|
|
656
|
-
function
|
|
657
|
+
function lt(t,
|
|
657
658
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
658
659
|
e) {
|
|
659
660
|
if ("_delegate" in t && (
|
|
660
661
|
// Unwrap Compat types
|
|
661
662
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
662
663
|
t = t._delegate), !(t instanceof e)) {
|
|
663
|
-
if (e.name === t.constructor.name) throw new
|
|
664
|
-
var n =
|
|
665
|
-
throw new
|
|
664
|
+
if (e.name === t.constructor.name) throw new z(V, "Type does not match the expected instance. Did you pass a reference from a different Firestore SDK?");
|
|
665
|
+
var n = ct(t);
|
|
666
|
+
throw new z(V, "Expected type '".concat(e.name, "', but it was: ").concat(n));
|
|
666
667
|
}
|
|
667
668
|
return t;
|
|
668
669
|
}
|
|
669
670
|
|
|
670
|
-
function
|
|
671
|
-
if (e <= 0) throw new
|
|
671
|
+
function ft(t, e) {
|
|
672
|
+
if (e <= 0) throw new z(V, "Function ".concat(t, "() requires a positive number, but it was: ").concat(e, "."));
|
|
672
673
|
}
|
|
673
674
|
|
|
674
675
|
/**
|
|
@@ -693,7 +694,7 @@ function lt(t, e) {
|
|
|
693
694
|
/**
|
|
694
695
|
* Creates and returns a new `ExperimentalLongPollingOptions` with the same
|
|
695
696
|
* option values as the given instance.
|
|
696
|
-
*/ function
|
|
697
|
+
*/ function ht(t) {
|
|
697
698
|
var e = {};
|
|
698
699
|
return void 0 !== t.timeoutSeconds && (e.timeoutSeconds = t.timeoutSeconds), e
|
|
699
700
|
/**
|
|
@@ -718,7 +719,7 @@ function lt(t, e) {
|
|
|
718
719
|
*/;
|
|
719
720
|
}
|
|
720
721
|
|
|
721
|
-
var
|
|
722
|
+
var pt = null;
|
|
722
723
|
|
|
723
724
|
/**
|
|
724
725
|
* Generates and returns an initial value for `lastUniqueDebugId`.
|
|
@@ -761,11 +762,11 @@ var ht = null;
|
|
|
761
762
|
/**
|
|
762
763
|
* Returns whether a variable is either undefined or null.
|
|
763
764
|
*/
|
|
764
|
-
function
|
|
765
|
+
function dt(t) {
|
|
765
766
|
return null == t;
|
|
766
767
|
}
|
|
767
768
|
|
|
768
|
-
/** Returns whether the value represents -0. */ function
|
|
769
|
+
/** Returns whether the value represents -0. */ function yt(t) {
|
|
769
770
|
// Detect if the value is -0.0. Based on polyfill from
|
|
770
771
|
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
|
|
771
772
|
return 0 === t && 1 / t == -1 / 0;
|
|
@@ -790,7 +791,7 @@ function pt(t) {
|
|
|
790
791
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
791
792
|
* See the License for the specific language governing permissions and
|
|
792
793
|
* limitations under the License.
|
|
793
|
-
*/ var
|
|
794
|
+
*/ var mt, vt, gt = {
|
|
794
795
|
BatchGetDocuments: "batchGet",
|
|
795
796
|
Commit: "commit",
|
|
796
797
|
RunQuery: "runQuery",
|
|
@@ -835,8 +836,8 @@ function pt(t) {
|
|
|
835
836
|
* @returns The equivalent Code. Unknown status codes are mapped to
|
|
836
837
|
* Code.UNKNOWN.
|
|
837
838
|
*/
|
|
838
|
-
function
|
|
839
|
-
if (void 0 === t) return
|
|
839
|
+
function wt(t) {
|
|
840
|
+
if (void 0 === t) return E("RPC_ERROR", "HTTP error has no status"), O;
|
|
840
841
|
// The canonical error codes for Google APIs [1] specify mapping onto HTTP
|
|
841
842
|
// status codes but the mapping is not bijective. In each case of ambiguity
|
|
842
843
|
// this function chooses a primary error.
|
|
@@ -849,62 +850,62 @@ function vt(t) {
|
|
|
849
850
|
|
|
850
851
|
case 400:
|
|
851
852
|
// Bad Request
|
|
852
|
-
return
|
|
853
|
+
return C;
|
|
853
854
|
|
|
854
855
|
// Other possibilities based on the forward mapping
|
|
855
856
|
// return Code.INVALID_ARGUMENT;
|
|
856
857
|
// return Code.OUT_OF_RANGE;
|
|
857
858
|
case 401:
|
|
858
859
|
// Unauthorized
|
|
859
|
-
return
|
|
860
|
+
return q;
|
|
860
861
|
|
|
861
862
|
case 403:
|
|
862
863
|
// Forbidden
|
|
863
|
-
return
|
|
864
|
+
return R;
|
|
864
865
|
|
|
865
866
|
case 404:
|
|
866
867
|
// Not Found
|
|
867
|
-
return
|
|
868
|
+
return D;
|
|
868
869
|
|
|
869
870
|
case 409:
|
|
870
871
|
// Conflict
|
|
871
|
-
return
|
|
872
|
+
return j;
|
|
872
873
|
|
|
873
874
|
// Other possibilities:
|
|
874
875
|
// return Code.ALREADY_EXISTS;
|
|
875
876
|
case 416:
|
|
876
877
|
// Range Not Satisfiable
|
|
877
|
-
return
|
|
878
|
+
return L;
|
|
878
879
|
|
|
879
880
|
case 429:
|
|
880
881
|
// Too Many Requests
|
|
881
|
-
return
|
|
882
|
+
return x;
|
|
882
883
|
|
|
883
884
|
case 499:
|
|
884
885
|
// Client Closed Request
|
|
885
|
-
return
|
|
886
|
+
return F;
|
|
886
887
|
|
|
887
888
|
case 500:
|
|
888
889
|
// Internal Server Error
|
|
889
|
-
return
|
|
890
|
+
return O;
|
|
890
891
|
|
|
891
892
|
// Other possibilities:
|
|
892
893
|
// return Code.INTERNAL;
|
|
893
894
|
// return Code.DATA_LOSS;
|
|
894
895
|
case 501:
|
|
895
896
|
// Unimplemented
|
|
896
|
-
return
|
|
897
|
+
return M;
|
|
897
898
|
|
|
898
899
|
case 503:
|
|
899
900
|
// Service Unavailable
|
|
900
|
-
return
|
|
901
|
+
return B;
|
|
901
902
|
|
|
902
903
|
case 504:
|
|
903
904
|
// Gateway Timeout
|
|
904
|
-
return
|
|
905
|
+
return N;
|
|
905
906
|
|
|
906
907
|
default:
|
|
907
|
-
return t >= 200 && t < 300 ? "ok" : t >= 400 && t < 500 ?
|
|
908
|
+
return t >= 200 && t < 300 ? "ok" : t >= 400 && t < 500 ? C : t >= 500 && t < 600 ? U : O;
|
|
908
909
|
}
|
|
909
910
|
}
|
|
910
911
|
|
|
@@ -927,16 +928,16 @@ function vt(t) {
|
|
|
927
928
|
/**
|
|
928
929
|
* A Rest-based connection that relies on the native HTTP stack
|
|
929
930
|
* (e.g. `fetch` or a polyfill).
|
|
930
|
-
*/ (
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
var
|
|
931
|
+
*/ (vt = mt || (mt = {}))[vt.OK = 0] = "OK", vt[vt.CANCELLED = 1] = "CANCELLED",
|
|
932
|
+
vt[vt.UNKNOWN = 2] = "UNKNOWN", vt[vt.INVALID_ARGUMENT = 3] = "INVALID_ARGUMENT",
|
|
933
|
+
vt[vt.DEADLINE_EXCEEDED = 4] = "DEADLINE_EXCEEDED", vt[vt.NOT_FOUND = 5] = "NOT_FOUND",
|
|
934
|
+
vt[vt.ALREADY_EXISTS = 6] = "ALREADY_EXISTS", vt[vt.PERMISSION_DENIED = 7] = "PERMISSION_DENIED",
|
|
935
|
+
vt[vt.UNAUTHENTICATED = 16] = "UNAUTHENTICATED", vt[vt.RESOURCE_EXHAUSTED = 8] = "RESOURCE_EXHAUSTED",
|
|
936
|
+
vt[vt.FAILED_PRECONDITION = 9] = "FAILED_PRECONDITION", vt[vt.ABORTED = 10] = "ABORTED",
|
|
937
|
+
vt[vt.OUT_OF_RANGE = 11] = "OUT_OF_RANGE", vt[vt.UNIMPLEMENTED = 12] = "UNIMPLEMENTED",
|
|
938
|
+
vt[vt.INTERNAL = 13] = "INTERNAL", vt[vt.UNAVAILABLE = 14] = "UNAVAILABLE", vt[vt.DATA_LOSS = 15] = "DATA_LOSS";
|
|
939
|
+
|
|
940
|
+
var _t = /** @class */ function(r) {
|
|
940
941
|
/**
|
|
941
942
|
* @param databaseInfo - The connection info.
|
|
942
943
|
* @param fetchImpl - `fetch` or a Polyfill that implements the fetch API.
|
|
@@ -970,14 +971,14 @@ var wt = /** @class */ function(r) {
|
|
|
970
971
|
return a = n.sent(), [ 3 /*break*/ , 4 ];
|
|
971
972
|
|
|
972
973
|
case 3:
|
|
973
|
-
throw u = n.sent(), new
|
|
974
|
+
throw u = n.sent(), new z(wt((s = u).status), "Request failed with error: " + s.statusText);
|
|
974
975
|
|
|
975
976
|
case 4:
|
|
976
977
|
return a.ok ? [ 3 /*break*/ , 6 ] : [ 4 /*yield*/ , a.json() ];
|
|
977
978
|
|
|
978
979
|
case 5:
|
|
979
980
|
throw c = n.sent(), Array.isArray(c) && (c = c[0]), l = null === (t = null == c ? void 0 : c.error) || void 0 === t ? void 0 : t.message,
|
|
980
|
-
new
|
|
981
|
+
new z(wt(a.status), "Request failed with error: ".concat(null != l ? l : a.statusText));
|
|
981
982
|
|
|
982
983
|
case 6:
|
|
983
984
|
return [ 2 /*return*/ , a.json() ];
|
|
@@ -1001,18 +1002,18 @@ var wt = /** @class */ function(r) {
|
|
|
1001
1002
|
enumerable: !1,
|
|
1002
1003
|
configurable: !0
|
|
1003
1004
|
}), t.prototype.P = function(t, e, n, r, i) {
|
|
1004
|
-
var o = (null ===
|
|
1005
|
-
"0x" +
|
|
1006
|
-
|
|
1005
|
+
var o = (null === pt ? pt = 268435456 + Math.round(2147483648 * Math.random()) : pt++,
|
|
1006
|
+
"0x" + pt.toString(16)), a = this.I(t, e.toUriEncodedString());
|
|
1007
|
+
T("RestConnection", "Sending RPC '".concat(t, "' ").concat(o, ":"), a, n);
|
|
1007
1008
|
var u = {
|
|
1008
1009
|
"google-cloud-resource-prefix": this.A,
|
|
1009
1010
|
"x-goog-request-params": this.T
|
|
1010
1011
|
};
|
|
1011
1012
|
return this.V(u, r, i), this.p(t, a, u, n).then((function(e) {
|
|
1012
|
-
return
|
|
1013
|
+
return T("RestConnection", "Received RPC '".concat(t, "' ").concat(o, ": "), e),
|
|
1013
1014
|
e;
|
|
1014
1015
|
}), (function(e) {
|
|
1015
|
-
throw
|
|
1016
|
+
throw S("RestConnection", "RPC '".concat(t, "' ").concat(o, " failed with error: "), e, "url: ", a, "request:", n),
|
|
1016
1017
|
e;
|
|
1017
1018
|
}));
|
|
1018
1019
|
}, t.prototype.g = function(t, e, n, r, i, o) {
|
|
@@ -1025,7 +1026,7 @@ var wt = /** @class */ function(r) {
|
|
|
1025
1026
|
* present and any additional headers for the request.
|
|
1026
1027
|
*/
|
|
1027
1028
|
t.prototype.V = function(t, e, n) {
|
|
1028
|
-
t["X-Goog-Api-Client"] = "gl-js/ fire/" +
|
|
1029
|
+
t["X-Goog-Api-Client"] = "gl-js/ fire/" + w,
|
|
1029
1030
|
// Content-Type: text/plain will avoid preflight requests which might
|
|
1030
1031
|
// mess with CORS and redirects by proxies. If we add custom headers
|
|
1031
1032
|
// we will need to change this code to potentially use the $httpOverwrite
|
|
@@ -1048,7 +1049,7 @@ var wt = /** @class */ function(r) {
|
|
|
1048
1049
|
t.prototype.terminate = function() {
|
|
1049
1050
|
// No-op
|
|
1050
1051
|
}, t;
|
|
1051
|
-
}()),
|
|
1052
|
+
}()), bt = function(t, e, n) {
|
|
1052
1053
|
this.alias = t, this.aggregateType = e, this.fieldPath = n;
|
|
1053
1054
|
};
|
|
1054
1055
|
|
|
@@ -1109,7 +1110,7 @@ var wt = /** @class */ function(r) {
|
|
|
1109
1110
|
*
|
|
1110
1111
|
* If `nBytes < 0` , an error will be thrown.
|
|
1111
1112
|
*/
|
|
1112
|
-
function
|
|
1113
|
+
function Tt(t) {
|
|
1113
1114
|
// Polyfills for IE and WebWorker by using `self` and `msCrypto` when `crypto` is not available.
|
|
1114
1115
|
var e =
|
|
1115
1116
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -1141,14 +1142,14 @@ function bt(t) {
|
|
|
1141
1142
|
*
|
|
1142
1143
|
* @internal
|
|
1143
1144
|
* Exported internally for testing purposes.
|
|
1144
|
-
*/ var
|
|
1145
|
+
*/ var Et = /** @class */ function() {
|
|
1145
1146
|
function t() {}
|
|
1146
1147
|
return t.newId = function() {
|
|
1147
1148
|
for (
|
|
1148
1149
|
// Alphanumeric characters
|
|
1149
1150
|
var t = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", e = Math.floor(256 / t.length) * t.length, n = ""
|
|
1150
1151
|
// The largest byte value that is a multiple of `char.length`.
|
|
1151
|
-
; n.length < 20; ) for (var r =
|
|
1152
|
+
; n.length < 20; ) for (var r = Tt(40), i = 0; i < r.length; ++i)
|
|
1152
1153
|
// Only accept values that are [0, maxMultiple), this ensures they can
|
|
1153
1154
|
// be evenly mapped to indices of `chars` via a modulo operation.
|
|
1154
1155
|
n.length < 20 && r[i] < e && (n += t.charAt(r[i] % t.length));
|
|
@@ -1156,11 +1157,11 @@ function bt(t) {
|
|
|
1156
1157
|
}, t;
|
|
1157
1158
|
}();
|
|
1158
1159
|
|
|
1159
|
-
function
|
|
1160
|
+
function St(t, e) {
|
|
1160
1161
|
return t < e ? -1 : t > e ? 1 : 0;
|
|
1161
1162
|
}
|
|
1162
1163
|
|
|
1163
|
-
/** Helper to compare arrays using isEqual(). */ function
|
|
1164
|
+
/** Helper to compare arrays using isEqual(). */ function kt(t, e, n) {
|
|
1164
1165
|
return t.length === e.length && t.every((function(t, r) {
|
|
1165
1166
|
return n(t, e[r]);
|
|
1166
1167
|
}));
|
|
@@ -1181,13 +1182,13 @@ function Et(t, e) {
|
|
|
1181
1182
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1182
1183
|
* See the License for the specific language governing permissions and
|
|
1183
1184
|
* limitations under the License.
|
|
1184
|
-
*/ function
|
|
1185
|
+
*/ function It(t) {
|
|
1185
1186
|
var e = 0;
|
|
1186
1187
|
for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && e++;
|
|
1187
1188
|
return e;
|
|
1188
1189
|
}
|
|
1189
1190
|
|
|
1190
|
-
function
|
|
1191
|
+
function At(t, e) {
|
|
1191
1192
|
for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && e(n, t[n]);
|
|
1192
1193
|
}
|
|
1193
1194
|
|
|
@@ -1209,13 +1210,13 @@ function It(t, e) {
|
|
|
1209
1210
|
*/
|
|
1210
1211
|
/**
|
|
1211
1212
|
* An error encountered while decoding base64 string.
|
|
1212
|
-
*/ var
|
|
1213
|
+
*/ var Pt = /** @class */ function(e) {
|
|
1213
1214
|
function n() {
|
|
1214
1215
|
var t = this;
|
|
1215
1216
|
return (t = e.apply(this, arguments) || this).name = "Base64DecodeError", t;
|
|
1216
1217
|
}
|
|
1217
1218
|
return t(n, e), n;
|
|
1218
|
-
}(Error),
|
|
1219
|
+
}(Error), Ft = /** @class */ function() {
|
|
1219
1220
|
function t(t) {
|
|
1220
1221
|
this.binaryString = t;
|
|
1221
1222
|
}
|
|
@@ -1227,7 +1228,7 @@ function It(t, e) {
|
|
|
1227
1228
|
// Check that `DOMException` is defined before using it to avoid
|
|
1228
1229
|
// "ReferenceError: Property 'DOMException' doesn't exist" in react-native.
|
|
1229
1230
|
// (https://github.com/firebase/firebase-js-sdk/issues/7115)
|
|
1230
|
-
throw "undefined" != typeof DOMException && t instanceof DOMException ? new
|
|
1231
|
+
throw "undefined" != typeof DOMException && t instanceof DOMException ? new Pt("Invalid base64 string: " + t) : t;
|
|
1231
1232
|
}
|
|
1232
1233
|
}(e);
|
|
1233
1234
|
return new t(n);
|
|
@@ -1267,7 +1268,7 @@ function It(t, e) {
|
|
|
1267
1268
|
}, t.prototype.approximateByteSize = function() {
|
|
1268
1269
|
return 2 * this.binaryString.length;
|
|
1269
1270
|
}, t.prototype.compareTo = function(t) {
|
|
1270
|
-
return
|
|
1271
|
+
return St(this.binaryString, t.binaryString);
|
|
1271
1272
|
}, t.prototype.isEqual = function(t) {
|
|
1272
1273
|
return this.binaryString === t.binaryString;
|
|
1273
1274
|
}, t;
|
|
@@ -1314,23 +1315,23 @@ function It(t, e) {
|
|
|
1314
1315
|
* the proto byte string in a common class that must be converted into a string
|
|
1315
1316
|
* before being sent as a proto.
|
|
1316
1317
|
* @internal
|
|
1317
|
-
*/
|
|
1318
|
+
*/ Ft.EMPTY_BYTE_STRING = new Ft("");
|
|
1318
1319
|
|
|
1319
|
-
var
|
|
1320
|
+
var Ot = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
|
|
1320
1321
|
|
|
1321
1322
|
/**
|
|
1322
1323
|
* Converts the possible Proto values for a timestamp value into a "seconds and
|
|
1323
1324
|
* nanos" representation.
|
|
1324
|
-
*/ function
|
|
1325
|
+
*/ function Vt(t) {
|
|
1325
1326
|
// The json interface (for the browser) will return an iso timestamp string,
|
|
1326
1327
|
// while the proto js library (for node) will return a
|
|
1327
1328
|
// google.protobuf.Timestamp instance.
|
|
1328
|
-
if (
|
|
1329
|
+
if (A(!!t), "string" == typeof t) {
|
|
1329
1330
|
// The date string can have higher precision (nanos) than the Date class
|
|
1330
1331
|
// (millis), so we do some custom parsing here.
|
|
1331
1332
|
// Parse the nanos right out of the string.
|
|
1332
|
-
var e = 0, n =
|
|
1333
|
-
if (
|
|
1333
|
+
var e = 0, n = Ot.exec(t);
|
|
1334
|
+
if (A(!!n), n[1]) {
|
|
1334
1335
|
// Pad the fraction out to 9 digits (nanos).
|
|
1335
1336
|
var r = n[1];
|
|
1336
1337
|
r = (r + "000000000").substr(0, 9), e = Number(r);
|
|
@@ -1343,21 +1344,21 @@ var Ft = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
|
|
|
1343
1344
|
};
|
|
1344
1345
|
}
|
|
1345
1346
|
return {
|
|
1346
|
-
seconds:
|
|
1347
|
-
nanos:
|
|
1347
|
+
seconds: Nt(t.seconds),
|
|
1348
|
+
nanos: Nt(t.nanos)
|
|
1348
1349
|
};
|
|
1349
1350
|
}
|
|
1350
1351
|
|
|
1351
1352
|
/**
|
|
1352
1353
|
* Converts the possible Proto types for numbers into a JavaScript number.
|
|
1353
1354
|
* Returns 0 if the value is not numeric.
|
|
1354
|
-
*/ function
|
|
1355
|
+
*/ function Nt(t) {
|
|
1355
1356
|
// TODO(bjornick): Handle int64 greater than 53 bits.
|
|
1356
1357
|
return "number" == typeof t ? t : "string" == typeof t ? Number(t) : 0;
|
|
1357
1358
|
}
|
|
1358
1359
|
|
|
1359
|
-
/** Converts the possible Proto types for Blobs into a ByteString. */ function
|
|
1360
|
-
return "string" == typeof t ?
|
|
1360
|
+
/** Converts the possible Proto types for Blobs into a ByteString. */ function Dt(t) {
|
|
1361
|
+
return "string" == typeof t ? Ft.fromBase64String(t) : Ft.fromUint8Array(t);
|
|
1361
1362
|
}
|
|
1362
1363
|
|
|
1363
1364
|
/**
|
|
@@ -1390,7 +1391,7 @@ var Ft = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
|
|
|
1390
1391
|
*
|
|
1391
1392
|
* For examples and further specifications, refer to the
|
|
1392
1393
|
* {@link https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto | Timestamp definition}.
|
|
1393
|
-
*/ var
|
|
1394
|
+
*/ var Rt = /** @class */ function() {
|
|
1394
1395
|
/**
|
|
1395
1396
|
* Creates a new timestamp.
|
|
1396
1397
|
*
|
|
@@ -1411,11 +1412,11 @@ var Ft = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
|
|
|
1411
1412
|
* The fractions of a second at nanosecond resolution.*
|
|
1412
1413
|
*/
|
|
1413
1414
|
e) {
|
|
1414
|
-
if (this.seconds = t, this.nanoseconds = e, e < 0) throw new
|
|
1415
|
-
if (e >= 1e9) throw new
|
|
1416
|
-
if (t < -62135596800) throw new
|
|
1415
|
+
if (this.seconds = t, this.nanoseconds = e, e < 0) throw new z(V, "Timestamp nanoseconds out of range: " + e);
|
|
1416
|
+
if (e >= 1e9) throw new z(V, "Timestamp nanoseconds out of range: " + e);
|
|
1417
|
+
if (t < -62135596800) throw new z(V, "Timestamp seconds out of range: " + t);
|
|
1417
1418
|
// This will break in the year 10,000.
|
|
1418
|
-
if (t >= 253402300800) throw new
|
|
1419
|
+
if (t >= 253402300800) throw new z(V, "Timestamp seconds out of range: " + t);
|
|
1419
1420
|
}
|
|
1420
1421
|
/**
|
|
1421
1422
|
* Creates a new timestamp with the current date, with millisecond precision.
|
|
@@ -1467,7 +1468,7 @@ var Ft = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
|
|
|
1467
1468
|
t.prototype.toMillis = function() {
|
|
1468
1469
|
return 1e3 * this.seconds + this.nanoseconds / 1e6;
|
|
1469
1470
|
}, t.prototype._compareTo = function(t) {
|
|
1470
|
-
return this.seconds === t.seconds ?
|
|
1471
|
+
return this.seconds === t.seconds ? St(this.nanoseconds, t.nanoseconds) : St(this.seconds, t.seconds);
|
|
1471
1472
|
},
|
|
1472
1473
|
/**
|
|
1473
1474
|
* Returns true if this `Timestamp` is equal to the provided one.
|
|
@@ -1539,7 +1540,7 @@ var Ft = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
|
|
|
1539
1540
|
* FieldValueOptions to value().
|
|
1540
1541
|
* - With respect to other ServerTimestampValues, they sort by their
|
|
1541
1542
|
* localWriteTime.
|
|
1542
|
-
*/ function
|
|
1543
|
+
*/ function qt(t) {
|
|
1543
1544
|
var e, n;
|
|
1544
1545
|
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);
|
|
1545
1546
|
}
|
|
@@ -1549,16 +1550,16 @@ var Ft = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
|
|
|
1549
1550
|
*
|
|
1550
1551
|
* Preserving the previous values allows the user to display the last resoled
|
|
1551
1552
|
* value until the backend responds with the timestamp.
|
|
1552
|
-
*/ function
|
|
1553
|
+
*/ function xt(t) {
|
|
1553
1554
|
var e = t.mapValue.fields.__previous_value__;
|
|
1554
|
-
return
|
|
1555
|
+
return qt(e) ? xt(e) : e;
|
|
1555
1556
|
}
|
|
1556
1557
|
|
|
1557
1558
|
/**
|
|
1558
1559
|
* Returns the local time at which this timestamp was first set.
|
|
1559
|
-
*/ function
|
|
1560
|
-
var e =
|
|
1561
|
-
return new
|
|
1560
|
+
*/ function Ct(t) {
|
|
1561
|
+
var e = Vt(t.mapValue.fields.__local_write_time__.timestampValue);
|
|
1562
|
+
return new Rt(e.seconds, e.nanos);
|
|
1562
1563
|
}
|
|
1563
1564
|
|
|
1564
1565
|
/**
|
|
@@ -1576,7 +1577,7 @@ var Ft = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
|
|
|
1576
1577
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1577
1578
|
* See the License for the specific language governing permissions and
|
|
1578
1579
|
* limitations under the License.
|
|
1579
|
-
*/ var
|
|
1580
|
+
*/ var jt = {
|
|
1580
1581
|
fields: {
|
|
1581
1582
|
__type__: {
|
|
1582
1583
|
stringValue: "__max__"
|
|
@@ -1584,18 +1585,18 @@ var Ft = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
|
|
|
1584
1585
|
}
|
|
1585
1586
|
};
|
|
1586
1587
|
|
|
1587
|
-
/** Extracts the backend's type order for the provided value. */ function
|
|
1588
|
-
return "nullValue" in t ? 0 /* TypeOrder.NullValue */ : "booleanValue" in t ? 1 /* TypeOrder.BooleanValue */ : "integerValue" in t || "doubleValue" in t ? 2 /* TypeOrder.NumberValue */ : "timestampValue" in t ? 3 /* TypeOrder.TimestampValue */ : "stringValue" in t ? 5 /* TypeOrder.StringValue */ : "bytesValue" in t ? 6 /* TypeOrder.BlobValue */ : "referenceValue" in t ? 7 /* TypeOrder.RefValue */ : "geoPointValue" in t ? 8 /* TypeOrder.GeoPointValue */ : "arrayValue" in t ? 9 /* TypeOrder.ArrayValue */ : "mapValue" in t ?
|
|
1588
|
+
/** Extracts the backend's type order for the provided value. */ function Lt(t) {
|
|
1589
|
+
return "nullValue" in t ? 0 /* TypeOrder.NullValue */ : "booleanValue" in t ? 1 /* TypeOrder.BooleanValue */ : "integerValue" in t || "doubleValue" in t ? 2 /* TypeOrder.NumberValue */ : "timestampValue" in t ? 3 /* TypeOrder.TimestampValue */ : "stringValue" in t ? 5 /* TypeOrder.StringValue */ : "bytesValue" in t ? 6 /* TypeOrder.BlobValue */ : "referenceValue" in t ? 7 /* TypeOrder.RefValue */ : "geoPointValue" in t ? 8 /* TypeOrder.GeoPointValue */ : "arrayValue" in t ? 9 /* TypeOrder.ArrayValue */ : "mapValue" in t ? qt(t) ? 4 /* TypeOrder.ServerTimestampValue */ :
|
|
1589
1590
|
/** Returns true if the Value represents the canonical {@link #MAX_VALUE} . */
|
|
1590
1591
|
function(t) {
|
|
1591
1592
|
return "__max__" === (((t.mapValue || {}).fields || {}).__type__ || {}).stringValue;
|
|
1592
|
-
}(t) ? 9007199254740991 /* TypeOrder.MaxValue */ : 10 /* TypeOrder.ObjectValue */ :
|
|
1593
|
+
}(t) ? 9007199254740991 /* TypeOrder.MaxValue */ : 10 /* TypeOrder.ObjectValue */ : I();
|
|
1593
1594
|
}
|
|
1594
1595
|
|
|
1595
|
-
/** Tests `left` and `right` for equality based on the backend semantics. */ function
|
|
1596
|
+
/** Tests `left` and `right` for equality based on the backend semantics. */ function Mt(t, e) {
|
|
1596
1597
|
if (t === e) return !0;
|
|
1597
|
-
var n =
|
|
1598
|
-
if (n !==
|
|
1598
|
+
var n = Lt(t);
|
|
1599
|
+
if (n !== Lt(e)) return !1;
|
|
1599
1600
|
switch (n) {
|
|
1600
1601
|
case 0 /* TypeOrder.NullValue */ :
|
|
1601
1602
|
case 9007199254740991 /* TypeOrder.MaxValue */ :
|
|
@@ -1605,14 +1606,14 @@ var Ft = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
|
|
|
1605
1606
|
return t.booleanValue === e.booleanValue;
|
|
1606
1607
|
|
|
1607
1608
|
case 4 /* TypeOrder.ServerTimestampValue */ :
|
|
1608
|
-
return
|
|
1609
|
+
return Ct(t).isEqual(Ct(e));
|
|
1609
1610
|
|
|
1610
1611
|
case 3 /* TypeOrder.TimestampValue */ :
|
|
1611
1612
|
return function(t, e) {
|
|
1612
1613
|
if ("string" == typeof t.timestampValue && "string" == typeof e.timestampValue && t.timestampValue.length === e.timestampValue.length)
|
|
1613
1614
|
// Use string equality for ISO 8601 timestamps
|
|
1614
1615
|
return t.timestampValue === e.timestampValue;
|
|
1615
|
-
var n =
|
|
1616
|
+
var n = Vt(t.timestampValue), r = Vt(e.timestampValue);
|
|
1616
1617
|
return n.seconds === r.seconds && n.nanos === r.nanos;
|
|
1617
1618
|
}(t, e);
|
|
1618
1619
|
|
|
@@ -1621,7 +1622,7 @@ var Ft = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
|
|
|
1621
1622
|
|
|
1622
1623
|
case 6 /* TypeOrder.BlobValue */ :
|
|
1623
1624
|
return function(t, e) {
|
|
1624
|
-
return
|
|
1625
|
+
return Dt(t.bytesValue).isEqual(Dt(e.bytesValue));
|
|
1625
1626
|
}(t, e);
|
|
1626
1627
|
|
|
1627
1628
|
case 7 /* TypeOrder.RefValue */ :
|
|
@@ -1629,105 +1630,105 @@ var Ft = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
|
|
|
1629
1630
|
|
|
1630
1631
|
case 8 /* TypeOrder.GeoPointValue */ :
|
|
1631
1632
|
return function(t, e) {
|
|
1632
|
-
return
|
|
1633
|
+
return Nt(t.geoPointValue.latitude) === Nt(e.geoPointValue.latitude) && Nt(t.geoPointValue.longitude) === Nt(e.geoPointValue.longitude);
|
|
1633
1634
|
}(t, e);
|
|
1634
1635
|
|
|
1635
1636
|
case 2 /* TypeOrder.NumberValue */ :
|
|
1636
1637
|
return function(t, e) {
|
|
1637
|
-
if ("integerValue" in t && "integerValue" in e) return
|
|
1638
|
+
if ("integerValue" in t && "integerValue" in e) return Nt(t.integerValue) === Nt(e.integerValue);
|
|
1638
1639
|
if ("doubleValue" in t && "doubleValue" in e) {
|
|
1639
|
-
var n =
|
|
1640
|
-
return n === r ?
|
|
1640
|
+
var n = Nt(t.doubleValue), r = Nt(e.doubleValue);
|
|
1641
|
+
return n === r ? yt(n) === yt(r) : isNaN(n) && isNaN(r);
|
|
1641
1642
|
}
|
|
1642
1643
|
return !1;
|
|
1643
1644
|
}(t, e);
|
|
1644
1645
|
|
|
1645
1646
|
case 9 /* TypeOrder.ArrayValue */ :
|
|
1646
|
-
return
|
|
1647
|
+
return kt(t.arrayValue.values || [], e.arrayValue.values || [], Mt);
|
|
1647
1648
|
|
|
1648
1649
|
case 10 /* TypeOrder.ObjectValue */ :
|
|
1649
1650
|
return function(t, e) {
|
|
1650
1651
|
var n = t.mapValue.fields || {}, r = e.mapValue.fields || {};
|
|
1651
|
-
if (
|
|
1652
|
-
for (var i in n) if (n.hasOwnProperty(i) && (void 0 === r[i] || !
|
|
1652
|
+
if (It(n) !== It(r)) return !1;
|
|
1653
|
+
for (var i in n) if (n.hasOwnProperty(i) && (void 0 === r[i] || !Mt(n[i], r[i]))) return !1;
|
|
1653
1654
|
return !0;
|
|
1654
1655
|
}(t, e);
|
|
1655
1656
|
|
|
1656
1657
|
default:
|
|
1657
|
-
return
|
|
1658
|
+
return I();
|
|
1658
1659
|
}
|
|
1659
1660
|
}
|
|
1660
1661
|
|
|
1661
|
-
function
|
|
1662
|
+
function Ut(t, e) {
|
|
1662
1663
|
return void 0 !== (t.values || []).find((function(t) {
|
|
1663
|
-
return
|
|
1664
|
+
return Mt(t, e);
|
|
1664
1665
|
}));
|
|
1665
1666
|
}
|
|
1666
1667
|
|
|
1667
|
-
function
|
|
1668
|
+
function Bt(t, e) {
|
|
1668
1669
|
if (t === e) return 0;
|
|
1669
|
-
var n =
|
|
1670
|
-
if (n !== r) return
|
|
1670
|
+
var n = Lt(t), r = Lt(e);
|
|
1671
|
+
if (n !== r) return St(n, r);
|
|
1671
1672
|
switch (n) {
|
|
1672
1673
|
case 0 /* TypeOrder.NullValue */ :
|
|
1673
1674
|
case 9007199254740991 /* TypeOrder.MaxValue */ :
|
|
1674
1675
|
return 0;
|
|
1675
1676
|
|
|
1676
1677
|
case 1 /* TypeOrder.BooleanValue */ :
|
|
1677
|
-
return
|
|
1678
|
+
return St(t.booleanValue, e.booleanValue);
|
|
1678
1679
|
|
|
1679
1680
|
case 2 /* TypeOrder.NumberValue */ :
|
|
1680
1681
|
return function(t, e) {
|
|
1681
|
-
var n =
|
|
1682
|
+
var n = Nt(t.integerValue || t.doubleValue), r = Nt(e.integerValue || e.doubleValue);
|
|
1682
1683
|
return n < r ? -1 : n > r ? 1 : n === r ? 0 :
|
|
1683
1684
|
// one or both are NaN.
|
|
1684
1685
|
isNaN(n) ? isNaN(r) ? 0 : -1 : 1;
|
|
1685
1686
|
}(t, e);
|
|
1686
1687
|
|
|
1687
1688
|
case 3 /* TypeOrder.TimestampValue */ :
|
|
1688
|
-
return
|
|
1689
|
+
return zt(t.timestampValue, e.timestampValue);
|
|
1689
1690
|
|
|
1690
1691
|
case 4 /* TypeOrder.ServerTimestampValue */ :
|
|
1691
|
-
return
|
|
1692
|
+
return zt(Ct(t), Ct(e));
|
|
1692
1693
|
|
|
1693
1694
|
case 5 /* TypeOrder.StringValue */ :
|
|
1694
|
-
return
|
|
1695
|
+
return St(t.stringValue, e.stringValue);
|
|
1695
1696
|
|
|
1696
1697
|
case 6 /* TypeOrder.BlobValue */ :
|
|
1697
1698
|
return function(t, e) {
|
|
1698
|
-
var n =
|
|
1699
|
+
var n = Dt(t), r = Dt(e);
|
|
1699
1700
|
return n.compareTo(r);
|
|
1700
1701
|
}(t.bytesValue, e.bytesValue);
|
|
1701
1702
|
|
|
1702
1703
|
case 7 /* TypeOrder.RefValue */ :
|
|
1703
1704
|
return function(t, e) {
|
|
1704
1705
|
for (var n = t.split("/"), r = e.split("/"), i = 0; i < n.length && i < r.length; i++) {
|
|
1705
|
-
var o =
|
|
1706
|
+
var o = St(n[i], r[i]);
|
|
1706
1707
|
if (0 !== o) return o;
|
|
1707
1708
|
}
|
|
1708
|
-
return
|
|
1709
|
+
return St(n.length, r.length);
|
|
1709
1710
|
}(t.referenceValue, e.referenceValue);
|
|
1710
1711
|
|
|
1711
1712
|
case 8 /* TypeOrder.GeoPointValue */ :
|
|
1712
1713
|
return function(t, e) {
|
|
1713
|
-
var n =
|
|
1714
|
-
return 0 !== n ? n :
|
|
1714
|
+
var n = St(Nt(t.latitude), Nt(e.latitude));
|
|
1715
|
+
return 0 !== n ? n : St(Nt(t.longitude), Nt(e.longitude));
|
|
1715
1716
|
}(t.geoPointValue, e.geoPointValue);
|
|
1716
1717
|
|
|
1717
1718
|
case 9 /* TypeOrder.ArrayValue */ :
|
|
1718
1719
|
return function(t, e) {
|
|
1719
1720
|
for (var n = t.values || [], r = e.values || [], i = 0; i < n.length && i < r.length; ++i) {
|
|
1720
|
-
var o =
|
|
1721
|
+
var o = Bt(n[i], r[i]);
|
|
1721
1722
|
if (o) return o;
|
|
1722
1723
|
}
|
|
1723
|
-
return
|
|
1724
|
+
return St(n.length, r.length);
|
|
1724
1725
|
}(t.arrayValue, e.arrayValue);
|
|
1725
1726
|
|
|
1726
1727
|
case 10 /* TypeOrder.ObjectValue */ :
|
|
1727
1728
|
return function(t, e) {
|
|
1728
|
-
if (t ===
|
|
1729
|
-
if (t ===
|
|
1730
|
-
if (e ===
|
|
1729
|
+
if (t === jt && e === jt) return 0;
|
|
1730
|
+
if (t === jt) return 1;
|
|
1731
|
+
if (e === jt) return -1;
|
|
1731
1732
|
var n = t.fields || {}, r = Object.keys(n), i = e.fields || {}, o = Object.keys(i);
|
|
1732
1733
|
// Even though MapValues are likely sorted correctly based on their insertion
|
|
1733
1734
|
// order (e.g. when received from the backend), local modifications can bring
|
|
@@ -1735,48 +1736,48 @@ function Ut(t, e) {
|
|
|
1735
1736
|
// canonical IDs are independent of insertion order.
|
|
1736
1737
|
r.sort(), o.sort();
|
|
1737
1738
|
for (var a = 0; a < r.length && a < o.length; ++a) {
|
|
1738
|
-
var u =
|
|
1739
|
+
var u = St(r[a], o[a]);
|
|
1739
1740
|
if (0 !== u) return u;
|
|
1740
|
-
var s =
|
|
1741
|
+
var s = Bt(n[r[a]], i[o[a]]);
|
|
1741
1742
|
if (0 !== s) return s;
|
|
1742
1743
|
}
|
|
1743
|
-
return
|
|
1744
|
+
return St(r.length, o.length);
|
|
1744
1745
|
}(t.mapValue, e.mapValue);
|
|
1745
1746
|
|
|
1746
1747
|
default:
|
|
1747
|
-
throw
|
|
1748
|
+
throw I();
|
|
1748
1749
|
}
|
|
1749
1750
|
}
|
|
1750
1751
|
|
|
1751
|
-
function
|
|
1752
|
-
if ("string" == typeof t && "string" == typeof e && t.length === e.length) return
|
|
1753
|
-
var n =
|
|
1754
|
-
return 0 !== i ? i :
|
|
1752
|
+
function zt(t, e) {
|
|
1753
|
+
if ("string" == typeof t && "string" == typeof e && t.length === e.length) return St(t, e);
|
|
1754
|
+
var n = Vt(t), r = Vt(e), i = St(n.seconds, r.seconds);
|
|
1755
|
+
return 0 !== i ? i : St(n.nanos, r.nanos);
|
|
1755
1756
|
}
|
|
1756
1757
|
|
|
1757
|
-
function
|
|
1758
|
+
function Gt(t, e) {
|
|
1758
1759
|
return {
|
|
1759
1760
|
referenceValue: "projects/".concat(t.projectId, "/databases/").concat(t.database, "/documents/").concat(e.path.canonicalString())
|
|
1760
1761
|
};
|
|
1761
1762
|
}
|
|
1762
1763
|
|
|
1763
|
-
/** Returns true if `value` is an ArrayValue. */ function
|
|
1764
|
+
/** Returns true if `value` is an ArrayValue. */ function Kt(t) {
|
|
1764
1765
|
return !!t && "arrayValue" in t;
|
|
1765
1766
|
}
|
|
1766
1767
|
|
|
1767
|
-
/** Returns true if `value` is a NullValue. */ function
|
|
1768
|
+
/** Returns true if `value` is a NullValue. */ function Qt(t) {
|
|
1768
1769
|
return !!t && "nullValue" in t;
|
|
1769
1770
|
}
|
|
1770
1771
|
|
|
1771
|
-
/** Returns true if `value` is NaN. */ function
|
|
1772
|
+
/** Returns true if `value` is NaN. */ function Yt(t) {
|
|
1772
1773
|
return !!t && "doubleValue" in t && isNaN(Number(t.doubleValue));
|
|
1773
1774
|
}
|
|
1774
1775
|
|
|
1775
|
-
/** Returns true if `value` is a MapValue. */ function
|
|
1776
|
+
/** Returns true if `value` is a MapValue. */ function Ht(t) {
|
|
1776
1777
|
return !!t && "mapValue" in t;
|
|
1777
1778
|
}
|
|
1778
1779
|
|
|
1779
|
-
/** Creates a deep copy of `source`. */ function
|
|
1780
|
+
/** Creates a deep copy of `source`. */ function Wt(t) {
|
|
1780
1781
|
if (t.geoPointValue) return {
|
|
1781
1782
|
geoPointValue: Object.assign({}, t.geoPointValue)
|
|
1782
1783
|
};
|
|
@@ -1789,8 +1790,8 @@ function zt(t, e) {
|
|
|
1789
1790
|
fields: {}
|
|
1790
1791
|
}
|
|
1791
1792
|
};
|
|
1792
|
-
return
|
|
1793
|
-
return e.mapValue.fields[t] =
|
|
1793
|
+
return At(t.mapValue.fields, (function(t, n) {
|
|
1794
|
+
return e.mapValue.fields[t] = Wt(n);
|
|
1794
1795
|
})), e;
|
|
1795
1796
|
}
|
|
1796
1797
|
if (t.arrayValue) {
|
|
@@ -1798,21 +1799,21 @@ function zt(t, e) {
|
|
|
1798
1799
|
arrayValue: {
|
|
1799
1800
|
values: []
|
|
1800
1801
|
}
|
|
1801
|
-
}, r = 0; r < (t.arrayValue.values || []).length; ++r) n.arrayValue.values[r] =
|
|
1802
|
+
}, r = 0; r < (t.arrayValue.values || []).length; ++r) n.arrayValue.values[r] = Wt(t.arrayValue.values[r]);
|
|
1802
1803
|
return n;
|
|
1803
1804
|
}
|
|
1804
1805
|
return Object.assign({}, t);
|
|
1805
1806
|
}
|
|
1806
1807
|
|
|
1807
|
-
var
|
|
1808
|
+
var Jt = function(t, e) {
|
|
1808
1809
|
this.position = t, this.inclusive = e;
|
|
1809
1810
|
};
|
|
1810
1811
|
|
|
1811
|
-
function
|
|
1812
|
+
function Xt(t, e) {
|
|
1812
1813
|
if (null === t) return null === e;
|
|
1813
1814
|
if (null === e) return !1;
|
|
1814
1815
|
if (t.inclusive !== e.inclusive || t.position.length !== e.position.length) return !1;
|
|
1815
|
-
for (var n = 0; n < t.position.length; n++) if (!
|
|
1816
|
+
for (var n = 0; n < t.position.length; n++) if (!Mt(t.position[n], e.position[n])) return !1;
|
|
1816
1817
|
return !0;
|
|
1817
1818
|
}
|
|
1818
1819
|
|
|
@@ -1831,7 +1832,7 @@ function Jt(t, e) {
|
|
|
1831
1832
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1832
1833
|
* See the License for the specific language governing permissions and
|
|
1833
1834
|
* limitations under the License.
|
|
1834
|
-
*/ var
|
|
1835
|
+
*/ var Zt = function() {}, $t = /** @class */ function(e) {
|
|
1835
1836
|
function n(t, n, r) {
|
|
1836
1837
|
var i = this;
|
|
1837
1838
|
return (i = e.call(this) || this).field = t, i.op = n, i.value = r, i;
|
|
@@ -1839,13 +1840,13 @@ function Jt(t, e) {
|
|
|
1839
1840
|
/**
|
|
1840
1841
|
* Creates a filter based on the provided arguments.
|
|
1841
1842
|
*/ return t(n, e), n.create = function(t, e, r) {
|
|
1842
|
-
return t.isKeyField() ? "in" /* Operator.IN */ === e || "not-in" /* Operator.NOT_IN */ === e ? this.createKeyFieldInFilter(t, e, r) : new
|
|
1843
|
+
return t.isKeyField() ? "in" /* Operator.IN */ === e || "not-in" /* Operator.NOT_IN */ === e ? this.createKeyFieldInFilter(t, e, r) : new ne(t, e, r) : "array-contains" /* Operator.ARRAY_CONTAINS */ === e ? new ae(t, r) : "in" /* Operator.IN */ === e ? new ue(t, r) : "not-in" /* Operator.NOT_IN */ === e ? new se(t, r) : "array-contains-any" /* Operator.ARRAY_CONTAINS_ANY */ === e ? new ce(t, r) : new n(t, e, r);
|
|
1843
1844
|
}, n.createKeyFieldInFilter = function(t, e, n) {
|
|
1844
|
-
return "in" /* Operator.IN */ === e ? new
|
|
1845
|
+
return "in" /* Operator.IN */ === e ? new re(t, n) : new ie(t, n);
|
|
1845
1846
|
}, n.prototype.matches = function(t) {
|
|
1846
1847
|
var e = t.data.field(this.field);
|
|
1847
1848
|
// Types do not have to match in NOT_EQUAL filters.
|
|
1848
|
-
return "!=" /* Operator.NOT_EQUAL */ === this.op ? null !== e && this.matchesComparison(
|
|
1849
|
+
return "!=" /* Operator.NOT_EQUAL */ === this.op ? null !== e && this.matchesComparison(Bt(e, this.value)) : null !== e && Lt(this.value) === Lt(e) && this.matchesComparison(Bt(e, this.value));
|
|
1849
1850
|
// Only compare types with matching backend order (such as double and int).
|
|
1850
1851
|
}, n.prototype.matchesComparison = function(t) {
|
|
1851
1852
|
switch (this.op) {
|
|
@@ -1868,7 +1869,7 @@ function Jt(t, e) {
|
|
|
1868
1869
|
return t >= 0;
|
|
1869
1870
|
|
|
1870
1871
|
default:
|
|
1871
|
-
return
|
|
1872
|
+
return I();
|
|
1872
1873
|
}
|
|
1873
1874
|
}, n.prototype.isInequality = function() {
|
|
1874
1875
|
return [ "<" /* Operator.LESS_THAN */ , "<=" /* Operator.LESS_THAN_OR_EQUAL */ , ">" /* Operator.GREATER_THAN */ , ">=" /* Operator.GREATER_THAN_OR_EQUAL */ , "!=" /* Operator.NOT_EQUAL */ , "not-in" /* Operator.NOT_IN */ ].indexOf(this.op) >= 0;
|
|
@@ -1877,7 +1878,7 @@ function Jt(t, e) {
|
|
|
1877
1878
|
}, n.prototype.getFilters = function() {
|
|
1878
1879
|
return [ this ];
|
|
1879
1880
|
}, n;
|
|
1880
|
-
}(
|
|
1881
|
+
}(Zt), te = /** @class */ function(e) {
|
|
1881
1882
|
function n(t, n) {
|
|
1882
1883
|
var r = this;
|
|
1883
1884
|
return (r = e.call(this) || this).filters = t, r.op = n, r.D = null, r;
|
|
@@ -1903,32 +1904,32 @@ function Jt(t, e) {
|
|
|
1903
1904
|
n.prototype.getFilters = function() {
|
|
1904
1905
|
return Object.assign([], this.filters);
|
|
1905
1906
|
}, n;
|
|
1906
|
-
}(
|
|
1907
|
-
|
|
1908
|
-
function
|
|
1909
|
-
return t instanceof
|
|
1910
|
-
return e instanceof
|
|
1911
|
-
}(t, e) : t instanceof
|
|
1912
|
-
return e instanceof
|
|
1913
|
-
return t &&
|
|
1907
|
+
}(Zt);
|
|
1908
|
+
|
|
1909
|
+
function ee(t, e) {
|
|
1910
|
+
return t instanceof $t ? function(t, e) {
|
|
1911
|
+
return e instanceof $t && t.op === e.op && t.field.isEqual(e.field) && Mt(t.value, e.value);
|
|
1912
|
+
}(t, e) : t instanceof te ? function(t, e) {
|
|
1913
|
+
return e instanceof te && t.op === e.op && t.filters.length === e.filters.length && t.filters.reduce((function(t, n, r) {
|
|
1914
|
+
return t && ee(n, e.filters[r]);
|
|
1914
1915
|
}), !0);
|
|
1915
|
-
}(t, e) : void
|
|
1916
|
+
}(t, e) : void I();
|
|
1916
1917
|
}
|
|
1917
1918
|
|
|
1918
|
-
var
|
|
1919
|
+
var ne = /** @class */ function(e) {
|
|
1919
1920
|
function n(t, n, r) {
|
|
1920
1921
|
var i = this;
|
|
1921
|
-
return (i = e.call(this, t, n, r) || this).key =
|
|
1922
|
+
return (i = e.call(this, t, n, r) || this).key = ot.fromName(r.referenceValue),
|
|
1922
1923
|
i;
|
|
1923
1924
|
}
|
|
1924
1925
|
return t(n, e), n.prototype.matches = function(t) {
|
|
1925
|
-
var e =
|
|
1926
|
+
var e = ot.comparator(t.key, this.key);
|
|
1926
1927
|
return this.matchesComparison(e);
|
|
1927
1928
|
}, n;
|
|
1928
|
-
}(
|
|
1929
|
+
}($t), re = /** @class */ function(e) {
|
|
1929
1930
|
function n(t, n) {
|
|
1930
1931
|
var r = this;
|
|
1931
|
-
return (r = e.call(this, t, "in" /* Operator.IN */ , n) || this).keys =
|
|
1932
|
+
return (r = e.call(this, t, "in" /* Operator.IN */ , n) || this).keys = oe("in" /* Operator.IN */ , n),
|
|
1932
1933
|
r;
|
|
1933
1934
|
}
|
|
1934
1935
|
return t(n, e), n.prototype.matches = function(t) {
|
|
@@ -1936,10 +1937,10 @@ var ee = /** @class */ function(e) {
|
|
|
1936
1937
|
return e.isEqual(t.key);
|
|
1937
1938
|
}));
|
|
1938
1939
|
}, n;
|
|
1939
|
-
}(
|
|
1940
|
+
}($t), ie = /** @class */ function(e) {
|
|
1940
1941
|
function n(t, n) {
|
|
1941
1942
|
var r = this;
|
|
1942
|
-
return (r = e.call(this, t, "not-in" /* Operator.NOT_IN */ , n) || this).keys =
|
|
1943
|
+
return (r = e.call(this, t, "not-in" /* Operator.NOT_IN */ , n) || this).keys = oe("not-in" /* Operator.NOT_IN */ , n),
|
|
1943
1944
|
r;
|
|
1944
1945
|
}
|
|
1945
1946
|
return t(n, e), n.prototype.matches = function(t) {
|
|
@@ -1947,57 +1948,57 @@ var ee = /** @class */ function(e) {
|
|
|
1947
1948
|
return e.isEqual(t.key);
|
|
1948
1949
|
}));
|
|
1949
1950
|
}, n;
|
|
1950
|
-
}(
|
|
1951
|
+
}($t);
|
|
1951
1952
|
|
|
1952
|
-
/** Filter that matches on key fields within an array. */ function
|
|
1953
|
+
/** Filter that matches on key fields within an array. */ function oe(t, e) {
|
|
1953
1954
|
var n;
|
|
1954
1955
|
return ((null === (n = e.arrayValue) || void 0 === n ? void 0 : n.values) || []).map((function(t) {
|
|
1955
|
-
return
|
|
1956
|
+
return ot.fromName(t.referenceValue);
|
|
1956
1957
|
}));
|
|
1957
1958
|
}
|
|
1958
1959
|
|
|
1959
|
-
/** A Filter that implements the array-contains operator. */ var
|
|
1960
|
+
/** A Filter that implements the array-contains operator. */ var ae = /** @class */ function(e) {
|
|
1960
1961
|
function n(t, n) {
|
|
1961
1962
|
return e.call(this, t, "array-contains" /* Operator.ARRAY_CONTAINS */ , n) || this;
|
|
1962
1963
|
}
|
|
1963
1964
|
return t(n, e), n.prototype.matches = function(t) {
|
|
1964
1965
|
var e = t.data.field(this.field);
|
|
1965
|
-
return
|
|
1966
|
+
return Kt(e) && Ut(e.arrayValue, this.value);
|
|
1966
1967
|
}, n;
|
|
1967
|
-
}(
|
|
1968
|
+
}($t), ue = /** @class */ function(e) {
|
|
1968
1969
|
function n(t, n) {
|
|
1969
1970
|
return e.call(this, t, "in" /* Operator.IN */ , n) || this;
|
|
1970
1971
|
}
|
|
1971
1972
|
return t(n, e), n.prototype.matches = function(t) {
|
|
1972
1973
|
var e = t.data.field(this.field);
|
|
1973
|
-
return null !== e &&
|
|
1974
|
+
return null !== e && Ut(this.value.arrayValue, e);
|
|
1974
1975
|
}, n;
|
|
1975
|
-
}(
|
|
1976
|
+
}($t), se = /** @class */ function(e) {
|
|
1976
1977
|
function n(t, n) {
|
|
1977
1978
|
return e.call(this, t, "not-in" /* Operator.NOT_IN */ , n) || this;
|
|
1978
1979
|
}
|
|
1979
1980
|
return t(n, e), n.prototype.matches = function(t) {
|
|
1980
|
-
if (
|
|
1981
|
+
if (Ut(this.value.arrayValue, {
|
|
1981
1982
|
nullValue: "NULL_VALUE"
|
|
1982
1983
|
})) return !1;
|
|
1983
1984
|
var e = t.data.field(this.field);
|
|
1984
|
-
return null !== e && !
|
|
1985
|
+
return null !== e && !Ut(this.value.arrayValue, e);
|
|
1985
1986
|
}, n;
|
|
1986
|
-
}(
|
|
1987
|
+
}($t), ce = /** @class */ function(e) {
|
|
1987
1988
|
function n(t, n) {
|
|
1988
1989
|
return e.call(this, t, "array-contains-any" /* Operator.ARRAY_CONTAINS_ANY */ , n) || this;
|
|
1989
1990
|
}
|
|
1990
1991
|
return t(n, e), n.prototype.matches = function(t) {
|
|
1991
1992
|
var e = this, n = t.data.field(this.field);
|
|
1992
|
-
return !(!
|
|
1993
|
-
return
|
|
1993
|
+
return !(!Kt(n) || !n.arrayValue.values) && n.arrayValue.values.some((function(t) {
|
|
1994
|
+
return Ut(e.value.arrayValue, t);
|
|
1994
1995
|
}));
|
|
1995
1996
|
}, n;
|
|
1996
|
-
}(
|
|
1997
|
+
}($t), le = function(t, e /* Direction.ASCENDING */) {
|
|
1997
1998
|
void 0 === e && (e = "asc"), this.field = t, this.dir = e;
|
|
1998
1999
|
};
|
|
1999
2000
|
|
|
2000
|
-
/** A Filter that implements the IN operator. */ function
|
|
2001
|
+
/** A Filter that implements the IN operator. */ function fe(t, e) {
|
|
2001
2002
|
return t.dir === e.dir && t.field.isEqual(e.field);
|
|
2002
2003
|
}
|
|
2003
2004
|
|
|
@@ -2020,16 +2021,16 @@ var ee = /** @class */ function(e) {
|
|
|
2020
2021
|
/**
|
|
2021
2022
|
* A version of a document in Firestore. This corresponds to the version
|
|
2022
2023
|
* timestamp, such as update_time or read_time.
|
|
2023
|
-
*/ var
|
|
2024
|
+
*/ var he = /** @class */ function() {
|
|
2024
2025
|
function t(t) {
|
|
2025
2026
|
this.timestamp = t;
|
|
2026
2027
|
}
|
|
2027
2028
|
return t.fromTimestamp = function(e) {
|
|
2028
2029
|
return new t(e);
|
|
2029
2030
|
}, t.min = function() {
|
|
2030
|
-
return new t(new
|
|
2031
|
+
return new t(new Rt(0, 0));
|
|
2031
2032
|
}, t.max = function() {
|
|
2032
|
-
return new t(new
|
|
2033
|
+
return new t(new Rt(253402300799, 999999999));
|
|
2033
2034
|
}, t.prototype.compareTo = function(t) {
|
|
2034
2035
|
return this.timestamp._compareTo(t.timestamp);
|
|
2035
2036
|
}, t.prototype.isEqual = function(t) {
|
|
@@ -2043,17 +2044,17 @@ var ee = /** @class */ function(e) {
|
|
|
2043
2044
|
}, t.prototype.toTimestamp = function() {
|
|
2044
2045
|
return this.timestamp;
|
|
2045
2046
|
}, t;
|
|
2046
|
-
}(),
|
|
2047
|
+
}(), pe = /** @class */ function() {
|
|
2047
2048
|
function t(t, e) {
|
|
2048
|
-
this.comparator = t, this.root = e ||
|
|
2049
|
+
this.comparator = t, this.root = e || ye.EMPTY;
|
|
2049
2050
|
}
|
|
2050
2051
|
// Returns a copy of the map, with the specified key/value added or replaced.
|
|
2051
2052
|
return t.prototype.insert = function(e, n) {
|
|
2052
|
-
return new t(this.comparator, this.root.insert(e, n, this.comparator).copy(null, null,
|
|
2053
|
+
return new t(this.comparator, this.root.insert(e, n, this.comparator).copy(null, null, ye.BLACK, null, null));
|
|
2053
2054
|
},
|
|
2054
2055
|
// Returns a copy of the map, with the specified key removed.
|
|
2055
2056
|
t.prototype.remove = function(e) {
|
|
2056
|
-
return new t(this.comparator, this.root.remove(e, this.comparator).copy(null, null,
|
|
2057
|
+
return new t(this.comparator, this.root.remove(e, this.comparator).copy(null, null, ye.BLACK, null, null));
|
|
2057
2058
|
},
|
|
2058
2059
|
// Returns the value of the node with the given key, or null.
|
|
2059
2060
|
t.prototype.get = function(t) {
|
|
@@ -2122,15 +2123,15 @@ var ee = /** @class */ function(e) {
|
|
|
2122
2123
|
},
|
|
2123
2124
|
// Returns an iterator over the SortedMap.
|
|
2124
2125
|
t.prototype.getIterator = function() {
|
|
2125
|
-
return new
|
|
2126
|
+
return new de(this.root, null, this.comparator, !1);
|
|
2126
2127
|
}, t.prototype.getIteratorFrom = function(t) {
|
|
2127
|
-
return new
|
|
2128
|
+
return new de(this.root, t, this.comparator, !1);
|
|
2128
2129
|
}, t.prototype.getReverseIterator = function() {
|
|
2129
|
-
return new
|
|
2130
|
+
return new de(this.root, null, this.comparator, !0);
|
|
2130
2131
|
}, t.prototype.getReverseIteratorFrom = function(t) {
|
|
2131
|
-
return new
|
|
2132
|
+
return new de(this.root, t, this.comparator, !0);
|
|
2132
2133
|
}, t;
|
|
2133
|
-
}(),
|
|
2134
|
+
}(), de = /** @class */ function() {
|
|
2134
2135
|
function t(t, e, n, r) {
|
|
2135
2136
|
this.isReverse = r, this.nodeStack = [];
|
|
2136
2137
|
for (var i = 1; !t.isEmpty(); ) if (i = e ? n(t.key, e) : 1,
|
|
@@ -2167,7 +2168,7 @@ var ee = /** @class */ function(e) {
|
|
|
2167
2168
|
value: t.value
|
|
2168
2169
|
};
|
|
2169
2170
|
}, t;
|
|
2170
|
-
}(),
|
|
2171
|
+
}(), ye = /** @class */ function() {
|
|
2171
2172
|
function t(e, n, r, i, o) {
|
|
2172
2173
|
this.key = e, this.value = n, this.color = null != r ? r : t.RED, this.left = null != i ? i : t.EMPTY,
|
|
2173
2174
|
this.right = null != o ? o : t.EMPTY, this.size = this.left.size + 1 + this.right.size;
|
|
@@ -2259,10 +2260,10 @@ var ee = /** @class */ function(e) {
|
|
|
2259
2260
|
// In a balanced RB tree, the black-depth (number of black nodes) from root to
|
|
2260
2261
|
// leaves is equal on both sides. This function verifies that or asserts.
|
|
2261
2262
|
t.prototype.check = function() {
|
|
2262
|
-
if (this.isRed() && this.left.isRed()) throw
|
|
2263
|
-
if (this.right.isRed()) throw
|
|
2263
|
+
if (this.isRed() && this.left.isRed()) throw I();
|
|
2264
|
+
if (this.right.isRed()) throw I();
|
|
2264
2265
|
var t = this.left.check();
|
|
2265
|
-
if (t !== this.right.check()) throw
|
|
2266
|
+
if (t !== this.right.check()) throw I();
|
|
2266
2267
|
return t + (this.isRed() ? 0 : 1);
|
|
2267
2268
|
}, t;
|
|
2268
2269
|
}();
|
|
@@ -2288,39 +2289,39 @@ var ee = /** @class */ function(e) {
|
|
|
2288
2289
|
// end LLRBNode
|
|
2289
2290
|
// Empty node is shared between all LLRB trees.
|
|
2290
2291
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2291
|
-
|
|
2292
|
+
ye.EMPTY = null, ye.RED = !0, ye.BLACK = !1,
|
|
2292
2293
|
// end LLRBEmptyNode
|
|
2293
|
-
|
|
2294
|
+
ye.EMPTY = new (/** @class */ function() {
|
|
2294
2295
|
function t() {
|
|
2295
2296
|
this.size = 0;
|
|
2296
2297
|
}
|
|
2297
2298
|
return Object.defineProperty(t.prototype, "key", {
|
|
2298
2299
|
get: function() {
|
|
2299
|
-
throw
|
|
2300
|
+
throw I();
|
|
2300
2301
|
},
|
|
2301
2302
|
enumerable: !1,
|
|
2302
2303
|
configurable: !0
|
|
2303
2304
|
}), Object.defineProperty(t.prototype, "value", {
|
|
2304
2305
|
get: function() {
|
|
2305
|
-
throw
|
|
2306
|
+
throw I();
|
|
2306
2307
|
},
|
|
2307
2308
|
enumerable: !1,
|
|
2308
2309
|
configurable: !0
|
|
2309
2310
|
}), Object.defineProperty(t.prototype, "color", {
|
|
2310
2311
|
get: function() {
|
|
2311
|
-
throw
|
|
2312
|
+
throw I();
|
|
2312
2313
|
},
|
|
2313
2314
|
enumerable: !1,
|
|
2314
2315
|
configurable: !0
|
|
2315
2316
|
}), Object.defineProperty(t.prototype, "left", {
|
|
2316
2317
|
get: function() {
|
|
2317
|
-
throw
|
|
2318
|
+
throw I();
|
|
2318
2319
|
},
|
|
2319
2320
|
enumerable: !1,
|
|
2320
2321
|
configurable: !0
|
|
2321
2322
|
}), Object.defineProperty(t.prototype, "right", {
|
|
2322
2323
|
get: function() {
|
|
2323
|
-
throw
|
|
2324
|
+
throw I();
|
|
2324
2325
|
},
|
|
2325
2326
|
enumerable: !1,
|
|
2326
2327
|
configurable: !0
|
|
@@ -2331,7 +2332,7 @@ de.EMPTY = new (/** @class */ function() {
|
|
|
2331
2332
|
},
|
|
2332
2333
|
// Returns a copy of the tree, with the specified key/value added.
|
|
2333
2334
|
t.prototype.insert = function(t, e, n) {
|
|
2334
|
-
return new
|
|
2335
|
+
return new ye(t, e);
|
|
2335
2336
|
},
|
|
2336
2337
|
// Returns a copy of the tree, with the specified key removed.
|
|
2337
2338
|
t.prototype.remove = function(t, e) {
|
|
@@ -2380,9 +2381,9 @@ de.EMPTY = new (/** @class */ function() {
|
|
|
2380
2381
|
* NOTE: if provided comparator returns 0 for two elements, we consider them to
|
|
2381
2382
|
* be equal!
|
|
2382
2383
|
*/
|
|
2383
|
-
var
|
|
2384
|
+
var me = /** @class */ function() {
|
|
2384
2385
|
function t(t) {
|
|
2385
|
-
this.comparator = t, this.data = new
|
|
2386
|
+
this.comparator = t, this.data = new pe(this.comparator);
|
|
2386
2387
|
}
|
|
2387
2388
|
return t.prototype.has = function(t) {
|
|
2388
2389
|
return null !== this.data.get(t);
|
|
@@ -2422,9 +2423,9 @@ var ye = /** @class */ function() {
|
|
|
2422
2423
|
var e = this.data.getIteratorFrom(t);
|
|
2423
2424
|
return e.hasNext() ? e.getNext().key : null;
|
|
2424
2425
|
}, t.prototype.getIterator = function() {
|
|
2425
|
-
return new
|
|
2426
|
+
return new ve(this.data.getIterator());
|
|
2426
2427
|
}, t.prototype.getIteratorFrom = function(t) {
|
|
2427
|
-
return new
|
|
2428
|
+
return new ve(this.data.getIteratorFrom(t));
|
|
2428
2429
|
},
|
|
2429
2430
|
/** Inserts or updates an element */ t.prototype.add = function(t) {
|
|
2430
2431
|
return this.copy(this.data.remove(t).insert(t, !0));
|
|
@@ -2461,7 +2462,7 @@ var ye = /** @class */ function() {
|
|
|
2461
2462
|
var n = new t(this.comparator);
|
|
2462
2463
|
return n.data = e, n;
|
|
2463
2464
|
}, t;
|
|
2464
|
-
}(),
|
|
2465
|
+
}(), ve = /** @class */ function() {
|
|
2465
2466
|
function t(t) {
|
|
2466
2467
|
this.iter = t;
|
|
2467
2468
|
}
|
|
@@ -2475,7 +2476,7 @@ var ye = /** @class */ function() {
|
|
|
2475
2476
|
this.fields = t,
|
|
2476
2477
|
// TODO(dimond): validation of FieldMask
|
|
2477
2478
|
// Sort the field mask to support `FieldMask.isEqual()` and assert below.
|
|
2478
|
-
t.sort(
|
|
2479
|
+
t.sort(it.comparator);
|
|
2479
2480
|
}
|
|
2480
2481
|
return t.empty = function() {
|
|
2481
2482
|
return new t([]);
|
|
@@ -2485,7 +2486,7 @@ var ye = /** @class */ function() {
|
|
|
2485
2486
|
* fields paths to this field mask.
|
|
2486
2487
|
*/
|
|
2487
2488
|
t.prototype.unionWith = function(e) {
|
|
2488
|
-
for (var n = new
|
|
2489
|
+
for (var n = new me(it.comparator), r = 0, i = this.fields; r < i.length; r++) {
|
|
2489
2490
|
var o = i[r];
|
|
2490
2491
|
n = n.add(o);
|
|
2491
2492
|
}
|
|
@@ -2507,11 +2508,11 @@ var ye = /** @class */ function() {
|
|
|
2507
2508
|
}
|
|
2508
2509
|
return !1;
|
|
2509
2510
|
}, t.prototype.isEqual = function(t) {
|
|
2510
|
-
return
|
|
2511
|
+
return kt(this.fields, t.fields, (function(t, e) {
|
|
2511
2512
|
return t.isEqual(e);
|
|
2512
2513
|
}));
|
|
2513
2514
|
}, t;
|
|
2514
|
-
}(),
|
|
2515
|
+
}(), we = /** @class */ function() {
|
|
2515
2516
|
function t(t) {
|
|
2516
2517
|
this.value = t;
|
|
2517
2518
|
}
|
|
@@ -2528,7 +2529,7 @@ var ye = /** @class */ function() {
|
|
|
2528
2529
|
*/
|
|
2529
2530
|
t.prototype.field = function(t) {
|
|
2530
2531
|
if (t.isEmpty()) return this.value;
|
|
2531
|
-
for (var e = this.value, n = 0; n < t.length - 1; ++n) if (!
|
|
2532
|
+
for (var e = this.value, n = 0; n < t.length - 1; ++n) if (!Ht(e = (e.mapValue.fields || {})[t.get(n)])) return null;
|
|
2532
2533
|
return (e = (e.mapValue.fields || {})[t.lastSegment()]) || null;
|
|
2533
2534
|
},
|
|
2534
2535
|
/**
|
|
@@ -2538,7 +2539,7 @@ var ye = /** @class */ function() {
|
|
|
2538
2539
|
* @param value - The value to set.
|
|
2539
2540
|
*/
|
|
2540
2541
|
t.prototype.set = function(t, e) {
|
|
2541
|
-
this.getFieldsMap(t.popLast())[t.lastSegment()] =
|
|
2542
|
+
this.getFieldsMap(t.popLast())[t.lastSegment()] = Wt(e);
|
|
2542
2543
|
},
|
|
2543
2544
|
/**
|
|
2544
2545
|
* Sets the provided fields to the provided values.
|
|
@@ -2546,14 +2547,14 @@ var ye = /** @class */ function() {
|
|
|
2546
2547
|
* @param data - A map of fields to values (or null for deletes).
|
|
2547
2548
|
*/
|
|
2548
2549
|
t.prototype.setAll = function(t) {
|
|
2549
|
-
var e = this, n =
|
|
2550
|
+
var e = this, n = it.emptyPath(), r = {}, i = [];
|
|
2550
2551
|
t.forEach((function(t, o) {
|
|
2551
2552
|
if (!n.isImmediateParentOf(o)) {
|
|
2552
2553
|
// Insert the accumulated changes at this parent location
|
|
2553
2554
|
var a = e.getFieldsMap(n);
|
|
2554
2555
|
e.applyChanges(a, r, i), r = {}, i = [], n = o.popLast();
|
|
2555
2556
|
}
|
|
2556
|
-
t ? r[o.lastSegment()] =
|
|
2557
|
+
t ? r[o.lastSegment()] = Wt(t) : i.push(o.lastSegment());
|
|
2557
2558
|
}));
|
|
2558
2559
|
var o = this.getFieldsMap(n);
|
|
2559
2560
|
this.applyChanges(o, r, i);
|
|
@@ -2566,9 +2567,9 @@ var ye = /** @class */ function() {
|
|
|
2566
2567
|
*/
|
|
2567
2568
|
t.prototype.delete = function(t) {
|
|
2568
2569
|
var e = this.field(t.popLast());
|
|
2569
|
-
|
|
2570
|
+
Ht(e) && e.mapValue.fields && delete e.mapValue.fields[t.lastSegment()];
|
|
2570
2571
|
}, t.prototype.isEqual = function(t) {
|
|
2571
|
-
return
|
|
2572
|
+
return Mt(this.value, t.value);
|
|
2572
2573
|
},
|
|
2573
2574
|
/**
|
|
2574
2575
|
* Returns the map that contains the leaf element of `path`. If the parent
|
|
@@ -2581,7 +2582,7 @@ var ye = /** @class */ function() {
|
|
|
2581
2582
|
});
|
|
2582
2583
|
for (var n = 0; n < t.length; ++n) {
|
|
2583
2584
|
var r = e.mapValue.fields[t.get(n)];
|
|
2584
|
-
|
|
2585
|
+
Ht(r) && r.mapValue.fields || (r = {
|
|
2585
2586
|
mapValue: {
|
|
2586
2587
|
fields: {}
|
|
2587
2588
|
}
|
|
@@ -2594,7 +2595,7 @@ var ye = /** @class */ function() {
|
|
|
2594
2595
|
* entries.
|
|
2595
2596
|
*/
|
|
2596
2597
|
t.prototype.applyChanges = function(t, e, n) {
|
|
2597
|
-
|
|
2598
|
+
At(e, (function(e, n) {
|
|
2598
2599
|
return t[e] = n;
|
|
2599
2600
|
}));
|
|
2600
2601
|
for (var r = 0, i = n; r < i.length; r++) {
|
|
@@ -2602,9 +2603,9 @@ var ye = /** @class */ function() {
|
|
|
2602
2603
|
delete t[o];
|
|
2603
2604
|
}
|
|
2604
2605
|
}, t.prototype.clone = function() {
|
|
2605
|
-
return new t(
|
|
2606
|
+
return new t(Wt(this.value));
|
|
2606
2607
|
}, t;
|
|
2607
|
-
}(),
|
|
2608
|
+
}(), _e = /** @class */ function() {
|
|
2608
2609
|
function t(t, e, n, r, i, o, a) {
|
|
2609
2610
|
this.key = t, this.documentType = e, this.version = n, this.readTime = r, this.createTime = i,
|
|
2610
2611
|
this.data = o, this.documentState = a
|
|
@@ -2615,9 +2616,9 @@ var ye = /** @class */ function() {
|
|
|
2615
2616
|
}
|
|
2616
2617
|
return t.newInvalidDocument = function(e) {
|
|
2617
2618
|
return new t(e, 0 /* DocumentType.INVALID */ ,
|
|
2618
|
-
/* version */
|
|
2619
|
-
/* readTime */
|
|
2620
|
-
/* createTime */
|
|
2619
|
+
/* version */ he.min(),
|
|
2620
|
+
/* readTime */ he.min(),
|
|
2621
|
+
/* createTime */ he.min(), we.empty(), 0 /* DocumentState.SYNCED */);
|
|
2621
2622
|
},
|
|
2622
2623
|
/**
|
|
2623
2624
|
* Creates a new document that is known to exist with the given data at the
|
|
@@ -2626,14 +2627,14 @@ var ye = /** @class */ function() {
|
|
|
2626
2627
|
t.newFoundDocument = function(e, n, r, i) {
|
|
2627
2628
|
return new t(e, 1 /* DocumentType.FOUND_DOCUMENT */ ,
|
|
2628
2629
|
/* version */ n,
|
|
2629
|
-
/* readTime */
|
|
2630
|
+
/* readTime */ he.min(),
|
|
2630
2631
|
/* createTime */ r, i, 0 /* DocumentState.SYNCED */);
|
|
2631
2632
|
},
|
|
2632
2633
|
/** Creates a new document that is known to not exist at the given version. */ t.newNoDocument = function(e, n) {
|
|
2633
2634
|
return new t(e, 2 /* DocumentType.NO_DOCUMENT */ ,
|
|
2634
2635
|
/* version */ n,
|
|
2635
|
-
/* readTime */
|
|
2636
|
-
/* createTime */
|
|
2636
|
+
/* readTime */ he.min(),
|
|
2637
|
+
/* createTime */ he.min(), we.empty(), 0 /* DocumentState.SYNCED */);
|
|
2637
2638
|
},
|
|
2638
2639
|
/**
|
|
2639
2640
|
* Creates a new document that is known to exist at the given version but
|
|
@@ -2643,8 +2644,8 @@ var ye = /** @class */ function() {
|
|
|
2643
2644
|
t.newUnknownDocument = function(e, n) {
|
|
2644
2645
|
return new t(e, 3 /* DocumentType.UNKNOWN_DOCUMENT */ ,
|
|
2645
2646
|
/* version */ n,
|
|
2646
|
-
/* readTime */
|
|
2647
|
-
/* createTime */
|
|
2647
|
+
/* readTime */ he.min(),
|
|
2648
|
+
/* createTime */ he.min(), we.empty(), 2 /* DocumentState.HAS_COMMITTED_MUTATIONS */);
|
|
2648
2649
|
},
|
|
2649
2650
|
/**
|
|
2650
2651
|
* Changes the document type to indicate that it exists and that its version
|
|
@@ -2656,7 +2657,7 @@ var ye = /** @class */ function() {
|
|
|
2656
2657
|
// update from Watch or due to applying a local set mutation on top
|
|
2657
2658
|
// of a deleted document, our best guess about its createTime would be the
|
|
2658
2659
|
// version at which the document transitioned to a FOUND_DOCUMENT.
|
|
2659
|
-
return !this.createTime.isEqual(
|
|
2660
|
+
return !this.createTime.isEqual(he.min()) || 2 /* DocumentType.NO_DOCUMENT */ !== this.documentType && 0 /* DocumentType.INVALID */ !== this.documentType || (this.createTime = t),
|
|
2660
2661
|
this.version = t, this.documentType = 1 /* DocumentType.FOUND_DOCUMENT */ , this.data = e,
|
|
2661
2662
|
this.documentState = 0 /* DocumentState.SYNCED */ , this;
|
|
2662
2663
|
},
|
|
@@ -2666,7 +2667,7 @@ var ye = /** @class */ function() {
|
|
|
2666
2667
|
*/
|
|
2667
2668
|
t.prototype.convertToNoDocument = function(t) {
|
|
2668
2669
|
return this.version = t, this.documentType = 2 /* DocumentType.NO_DOCUMENT */ ,
|
|
2669
|
-
this.data =
|
|
2670
|
+
this.data = we.empty(), this.documentState = 0 /* DocumentState.SYNCED */ , this;
|
|
2670
2671
|
},
|
|
2671
2672
|
/**
|
|
2672
2673
|
* Changes the document type to indicate that it exists at a given version but
|
|
@@ -2675,12 +2676,12 @@ var ye = /** @class */ function() {
|
|
|
2675
2676
|
*/
|
|
2676
2677
|
t.prototype.convertToUnknownDocument = function(t) {
|
|
2677
2678
|
return this.version = t, this.documentType = 3 /* DocumentType.UNKNOWN_DOCUMENT */ ,
|
|
2678
|
-
this.data =
|
|
2679
|
+
this.data = we.empty(), this.documentState = 2 /* DocumentState.HAS_COMMITTED_MUTATIONS */ ,
|
|
2679
2680
|
this;
|
|
2680
2681
|
}, t.prototype.setHasCommittedMutations = function() {
|
|
2681
2682
|
return this.documentState = 2 /* DocumentState.HAS_COMMITTED_MUTATIONS */ , this;
|
|
2682
2683
|
}, t.prototype.setHasLocalMutations = function() {
|
|
2683
|
-
return this.documentState = 1 /* DocumentState.HAS_LOCAL_MUTATIONS */ , this.version =
|
|
2684
|
+
return this.documentState = 1 /* DocumentState.HAS_LOCAL_MUTATIONS */ , this.version = he.min(),
|
|
2684
2685
|
this;
|
|
2685
2686
|
}, t.prototype.setReadTime = function(t) {
|
|
2686
2687
|
return this.readTime = t, this;
|
|
@@ -2717,7 +2718,7 @@ var ye = /** @class */ function() {
|
|
|
2717
2718
|
}, t.prototype.toString = function() {
|
|
2718
2719
|
return "Document(".concat(this.key, ", ").concat(this.version, ", ").concat(JSON.stringify(this.data.value), ", {createTime: ").concat(this.createTime, "}), {documentType: ").concat(this.documentType, "}), {documentState: ").concat(this.documentState, "})");
|
|
2719
2720
|
}, t;
|
|
2720
|
-
}(),
|
|
2721
|
+
}(), be = function(t, e, n, r, i, o, a) {
|
|
2721
2722
|
void 0 === e && (e = null), void 0 === n && (n = []), void 0 === r && (r = []),
|
|
2722
2723
|
void 0 === i && (i = null), void 0 === o && (o = null), void 0 === a && (a = null),
|
|
2723
2724
|
this.path = t, this.collectionGroup = e, this.orderBy = n, this.filters = r, this.limit = i,
|
|
@@ -2732,10 +2733,10 @@ var ye = /** @class */ function() {
|
|
|
2732
2733
|
* using this factory method, because `Query` provides an implicit `orderBy`
|
|
2733
2734
|
* property.
|
|
2734
2735
|
*/
|
|
2735
|
-
function
|
|
2736
|
+
function Te(t, e, n, r, i, o, a) {
|
|
2736
2737
|
return void 0 === e && (e = null), void 0 === n && (n = []), void 0 === r && (r = []),
|
|
2737
2738
|
void 0 === i && (i = null), void 0 === o && (o = null), void 0 === a && (a = null),
|
|
2738
|
-
new
|
|
2739
|
+
new be(t, e, n, r, i, o, a);
|
|
2739
2740
|
}
|
|
2740
2741
|
|
|
2741
2742
|
/**
|
|
@@ -2760,7 +2761,7 @@ function be(t, e, n, r, i, o, a) {
|
|
|
2760
2761
|
* query the RemoteStore results.
|
|
2761
2762
|
*
|
|
2762
2763
|
* Visible for testing.
|
|
2763
|
-
*/ var
|
|
2764
|
+
*/ var Ee =
|
|
2764
2765
|
/**
|
|
2765
2766
|
* Initializes a Query with a path and optional additional query constraints.
|
|
2766
2767
|
* Path must currently be empty if this is a collection group query.
|
|
@@ -2785,7 +2786,7 @@ function(t, e, n, r, i, o /* LimitType.First */ , a, u) {
|
|
|
2785
2786
|
/**
|
|
2786
2787
|
* Returns whether the query matches a collection group rather than a specific
|
|
2787
2788
|
* collection.
|
|
2788
|
-
*/ function
|
|
2789
|
+
*/ function Se(t) {
|
|
2789
2790
|
return null !== t.collectionGroup;
|
|
2790
2791
|
}
|
|
2791
2792
|
|
|
@@ -2795,8 +2796,8 @@ function(t, e, n, r, i, o /* LimitType.First */ , a, u) {
|
|
|
2795
2796
|
* the SDK and backend always orders by `__name__`). The normalized order-by
|
|
2796
2797
|
* includes implicit order-bys in addition to the explicit user provided
|
|
2797
2798
|
* order-bys.
|
|
2798
|
-
*/ function
|
|
2799
|
-
var e =
|
|
2799
|
+
*/ function ke(t) {
|
|
2800
|
+
var e = P(t);
|
|
2800
2801
|
if (null === e.S) {
|
|
2801
2802
|
e.S = [];
|
|
2802
2803
|
// Any explicit order by fields should be added as is.
|
|
@@ -2808,7 +2809,7 @@ function(t, e, n, r, i, o /* LimitType.First */ , a, u) {
|
|
|
2808
2809
|
var a = e.explicitOrderBy.length > 0 ? e.explicitOrderBy[e.explicitOrderBy.length - 1].dir : "asc" /* Direction.ASCENDING */ , u =
|
|
2809
2810
|
// Returns the sorted set of inequality filter fields used in this query.
|
|
2810
2811
|
function(t) {
|
|
2811
|
-
var e = new
|
|
2812
|
+
var e = new me(it.comparator);
|
|
2812
2813
|
return t.filters.forEach((function(t) {
|
|
2813
2814
|
t.getFlattenedFilters().forEach((function(t) {
|
|
2814
2815
|
t.isInequality() && (e = e.add(t.field));
|
|
@@ -2821,19 +2822,19 @@ function(t, e, n, r, i, o /* LimitType.First */ , a, u) {
|
|
|
2821
2822
|
// Note: `SortedSet<FieldPath>` sorts the key field before other fields. However, we want the key
|
|
2822
2823
|
// field to be sorted last.
|
|
2823
2824
|
u.forEach((function(t) {
|
|
2824
|
-
n.has(t.canonicalString()) || t.isKeyField() || e.S.push(new
|
|
2825
|
+
n.has(t.canonicalString()) || t.isKeyField() || e.S.push(new le(t, a));
|
|
2825
2826
|
})),
|
|
2826
2827
|
// Add the document key field to the last if it is not explicitly ordered.
|
|
2827
|
-
n.has(
|
|
2828
|
+
n.has(it.keyField().canonicalString()) || e.S.push(new le(it.keyField(), a));
|
|
2828
2829
|
}
|
|
2829
2830
|
return e.S;
|
|
2830
2831
|
}
|
|
2831
2832
|
|
|
2832
2833
|
/**
|
|
2833
2834
|
* Converts this `Query` instance to its corresponding `Target` representation.
|
|
2834
|
-
*/ function
|
|
2835
|
-
var e =
|
|
2836
|
-
return e.N || (e.N =
|
|
2835
|
+
*/ function Ie(t) {
|
|
2836
|
+
var e = P(t);
|
|
2837
|
+
return e.N || (e.N = Ae(e, ke(t))), e.N
|
|
2837
2838
|
/**
|
|
2838
2839
|
* Converts this `Query` instance to its corresponding `Target` representation,
|
|
2839
2840
|
* for use within an aggregate query. Unlike targets for non-aggregate queries,
|
|
@@ -2842,22 +2843,22 @@ function(t, e, n, r, i, o /* LimitType.First */ , a, u) {
|
|
|
2842
2843
|
*/;
|
|
2843
2844
|
}
|
|
2844
2845
|
|
|
2845
|
-
function
|
|
2846
|
-
if ("F" /* LimitType.First */ === t.limitType) return
|
|
2846
|
+
function Ae(t, e) {
|
|
2847
|
+
if ("F" /* LimitType.First */ === t.limitType) return Te(t.path, t.collectionGroup, e, t.filters, t.limit, t.startAt, t.endAt);
|
|
2847
2848
|
// Flip the orderBy directions since we want the last results
|
|
2848
2849
|
e = e.map((function(t) {
|
|
2849
2850
|
var e = "desc" /* Direction.DESCENDING */ === t.dir ? "asc" /* Direction.ASCENDING */ : "desc" /* Direction.DESCENDING */;
|
|
2850
|
-
return new
|
|
2851
|
+
return new le(t.field, e);
|
|
2851
2852
|
}));
|
|
2852
2853
|
// We need to swap the cursors to match the now-flipped query ordering.
|
|
2853
|
-
var n = t.endAt ? new
|
|
2854
|
+
var n = t.endAt ? new Jt(t.endAt.position, t.endAt.inclusive) : null, r = t.startAt ? new Jt(t.startAt.position, t.startAt.inclusive) : null;
|
|
2854
2855
|
// Now return as a LimitType.First query.
|
|
2855
|
-
return
|
|
2856
|
+
return Te(t.path, t.collectionGroup, e, t.filters, t.limit, n, r);
|
|
2856
2857
|
}
|
|
2857
2858
|
|
|
2858
|
-
function
|
|
2859
|
+
function Pe(t, e) {
|
|
2859
2860
|
var n = t.filters.concat([ e ]);
|
|
2860
|
-
return new
|
|
2861
|
+
return new Ee(t.path, t.collectionGroup, t.explicitOrderBy.slice(), n, t.limit, t.limitType, t.startAt, t.endAt);
|
|
2861
2862
|
}
|
|
2862
2863
|
|
|
2863
2864
|
/**
|
|
@@ -2885,9 +2886,9 @@ function Ae(t, e) {
|
|
|
2885
2886
|
* The return value is an IntegerValue if it can safely represent the value,
|
|
2886
2887
|
* otherwise a DoubleValue is returned.
|
|
2887
2888
|
*/
|
|
2888
|
-
function
|
|
2889
|
+
function Fe(t, e) {
|
|
2889
2890
|
return function(t) {
|
|
2890
|
-
return "number" == typeof t && Number.isInteger(t) && !
|
|
2891
|
+
return "number" == typeof t && Number.isInteger(t) && !yt(t) && t <= Number.MAX_SAFE_INTEGER && t >= Number.MIN_SAFE_INTEGER;
|
|
2891
2892
|
}(e) ?
|
|
2892
2893
|
/**
|
|
2893
2894
|
* Returns an IntegerValue for `value`.
|
|
@@ -2909,7 +2910,7 @@ function Pe(t, e) {
|
|
|
2909
2910
|
};
|
|
2910
2911
|
}
|
|
2911
2912
|
return {
|
|
2912
|
-
doubleValue:
|
|
2913
|
+
doubleValue: yt(e) ? "-0" : e
|
|
2913
2914
|
};
|
|
2914
2915
|
}(t, e);
|
|
2915
2916
|
}
|
|
@@ -2930,36 +2931,36 @@ function Pe(t, e) {
|
|
|
2930
2931
|
* See the License for the specific language governing permissions and
|
|
2931
2932
|
* limitations under the License.
|
|
2932
2933
|
*/
|
|
2933
|
-
/** Used to represent a field transform on a mutation. */ var
|
|
2934
|
+
/** Used to represent a field transform on a mutation. */ var Oe = function() {
|
|
2934
2935
|
// Make sure that the structural type of `TransformOperation` is unique.
|
|
2935
2936
|
// See https://github.com/microsoft/TypeScript/issues/5451
|
|
2936
2937
|
this._ = void 0;
|
|
2937
|
-
},
|
|
2938
|
+
}, Ve = /** @class */ function(e) {
|
|
2938
2939
|
function n() {
|
|
2939
2940
|
return null !== e && e.apply(this, arguments) || this;
|
|
2940
2941
|
}
|
|
2941
2942
|
return t(n, e), n;
|
|
2942
|
-
}(
|
|
2943
|
+
}(Oe), Ne = /** @class */ function(e) {
|
|
2943
2944
|
function n(t) {
|
|
2944
2945
|
var n = this;
|
|
2945
2946
|
return (n = e.call(this) || this).elements = t, n;
|
|
2946
2947
|
}
|
|
2947
2948
|
return t(n, e), n;
|
|
2948
|
-
}(
|
|
2949
|
+
}(Oe), De = /** @class */ function(e) {
|
|
2949
2950
|
function n(t) {
|
|
2950
2951
|
var n = this;
|
|
2951
2952
|
return (n = e.call(this) || this).elements = t, n;
|
|
2952
2953
|
}
|
|
2953
2954
|
return t(n, e), n;
|
|
2954
|
-
}(
|
|
2955
|
+
}(Oe), Re = /** @class */ function(e) {
|
|
2955
2956
|
function n(t, n) {
|
|
2956
2957
|
var r = this;
|
|
2957
2958
|
return (r = e.call(this) || this).serializer = t, r.q = n, r;
|
|
2958
2959
|
}
|
|
2959
2960
|
return t(n, e), n;
|
|
2960
|
-
}(
|
|
2961
|
+
}(Oe), qe = function(t, e) {
|
|
2961
2962
|
this.field = t, this.transform = e;
|
|
2962
|
-
},
|
|
2963
|
+
}, xe = /** @class */ function() {
|
|
2963
2964
|
function t(t, e) {
|
|
2964
2965
|
this.updateTime = t, this.exists = e
|
|
2965
2966
|
/** Creates a new empty Precondition. */;
|
|
@@ -2981,7 +2982,7 @@ function Pe(t, e) {
|
|
|
2981
2982
|
}), t.prototype.isEqual = function(t) {
|
|
2982
2983
|
return this.exists === t.exists && (this.updateTime ? !!t.updateTime && this.updateTime.isEqual(t.updateTime) : !t.updateTime);
|
|
2983
2984
|
}, t;
|
|
2984
|
-
}(),
|
|
2985
|
+
}(), Ce = function() {}, je = /** @class */ function(e) {
|
|
2985
2986
|
function n(t, n, r, i) {
|
|
2986
2987
|
void 0 === i && (i = []);
|
|
2987
2988
|
var o = this;
|
|
@@ -2991,7 +2992,7 @@ function Pe(t, e) {
|
|
|
2991
2992
|
return t(n, e), n.prototype.getFieldMask = function() {
|
|
2992
2993
|
return null;
|
|
2993
2994
|
}, n;
|
|
2994
|
-
}(
|
|
2995
|
+
}(Ce), Le = /** @class */ function(e) {
|
|
2995
2996
|
function n(t, n, r, i, o) {
|
|
2996
2997
|
void 0 === o && (o = []);
|
|
2997
2998
|
var a = this;
|
|
@@ -3001,7 +3002,7 @@ function Pe(t, e) {
|
|
|
3001
3002
|
return t(n, e), n.prototype.getFieldMask = function() {
|
|
3002
3003
|
return this.fieldMask;
|
|
3003
3004
|
}, n;
|
|
3004
|
-
}(
|
|
3005
|
+
}(Ce), Me = /** @class */ function(e) {
|
|
3005
3006
|
function n(t, n) {
|
|
3006
3007
|
var r = this;
|
|
3007
3008
|
return (r = e.call(this) || this).key = t, r.precondition = n, r.type = 2 /* MutationType.Delete */ ,
|
|
@@ -3010,7 +3011,7 @@ function Pe(t, e) {
|
|
|
3010
3011
|
return t(n, e), n.prototype.getFieldMask = function() {
|
|
3011
3012
|
return null;
|
|
3012
3013
|
}, n;
|
|
3013
|
-
}(
|
|
3014
|
+
}(Ce), Ue = /** @class */ function(e) {
|
|
3014
3015
|
function n(t, n) {
|
|
3015
3016
|
var r = this;
|
|
3016
3017
|
return (r = e.call(this) || this).key = t, r.precondition = n, r.type = 3 /* MutationType.Verify */ ,
|
|
@@ -3019,10 +3020,10 @@ function Pe(t, e) {
|
|
|
3019
3020
|
return t(n, e), n.prototype.getFieldMask = function() {
|
|
3020
3021
|
return null;
|
|
3021
3022
|
}, n;
|
|
3022
|
-
}(
|
|
3023
|
+
}(Ce), Be = {
|
|
3023
3024
|
asc: "ASCENDING",
|
|
3024
3025
|
desc: "DESCENDING"
|
|
3025
|
-
},
|
|
3026
|
+
}, ze = {
|
|
3026
3027
|
"<": "LESS_THAN",
|
|
3027
3028
|
"<=": "LESS_THAN_OR_EQUAL",
|
|
3028
3029
|
">": "GREATER_THAN",
|
|
@@ -3033,10 +3034,10 @@ function Pe(t, e) {
|
|
|
3033
3034
|
in: "IN",
|
|
3034
3035
|
"not-in": "NOT_IN",
|
|
3035
3036
|
"array-contains-any": "ARRAY_CONTAINS_ANY"
|
|
3036
|
-
},
|
|
3037
|
+
}, Ge = {
|
|
3037
3038
|
and: "AND",
|
|
3038
3039
|
or: "OR"
|
|
3039
|
-
},
|
|
3040
|
+
}, Ke = function(t, e) {
|
|
3040
3041
|
this.databaseId = t, this.useProto3Json = e;
|
|
3041
3042
|
};
|
|
3042
3043
|
|
|
@@ -3052,7 +3053,7 @@ function Pe(t, e) {
|
|
|
3052
3053
|
/**
|
|
3053
3054
|
* Returns a value for a Date that's appropriate to put into a proto.
|
|
3054
3055
|
*/
|
|
3055
|
-
function
|
|
3056
|
+
function Qe(t, e) {
|
|
3056
3057
|
return t.useProto3Json ? "".concat(new Date(1e3 * e.seconds).toISOString().replace(/\.\d*/, "").replace("Z", ""), ".").concat(("000000000" + e.nanoseconds).slice(-9), "Z") : {
|
|
3057
3058
|
seconds: "" + e.seconds,
|
|
3058
3059
|
nanos: e.nanoseconds
|
|
@@ -3063,56 +3064,56 @@ function Ke(t, e) {
|
|
|
3063
3064
|
* Returns a value for bytes that's appropriate to put in a proto.
|
|
3064
3065
|
*
|
|
3065
3066
|
* Visible for testing.
|
|
3066
|
-
*/ function
|
|
3067
|
+
*/ function Ye(t, e) {
|
|
3067
3068
|
return t.useProto3Json ? e.toBase64() : e.toUint8Array();
|
|
3068
3069
|
}
|
|
3069
3070
|
|
|
3070
|
-
function
|
|
3071
|
-
return
|
|
3071
|
+
function He(t, e) {
|
|
3072
|
+
return Qe(t, e.toTimestamp());
|
|
3072
3073
|
}
|
|
3073
3074
|
|
|
3074
|
-
function
|
|
3075
|
-
return
|
|
3076
|
-
var e =
|
|
3077
|
-
return new
|
|
3075
|
+
function We(t) {
|
|
3076
|
+
return A(!!t), he.fromTimestamp(function(t) {
|
|
3077
|
+
var e = Vt(t);
|
|
3078
|
+
return new Rt(e.seconds, e.nanos);
|
|
3078
3079
|
}(t));
|
|
3079
3080
|
}
|
|
3080
3081
|
|
|
3081
|
-
function
|
|
3082
|
-
return
|
|
3082
|
+
function Je(t, e) {
|
|
3083
|
+
return Xe(t, e).canonicalString();
|
|
3083
3084
|
}
|
|
3084
3085
|
|
|
3085
|
-
function
|
|
3086
|
+
function Xe(t, e) {
|
|
3086
3087
|
var n = function(t) {
|
|
3087
|
-
return new
|
|
3088
|
+
return new nt([ "projects", t.projectId, "databases", t.database ]);
|
|
3088
3089
|
}(t).child("documents");
|
|
3089
3090
|
return void 0 === e ? n : n.child(e);
|
|
3090
3091
|
}
|
|
3091
3092
|
|
|
3092
|
-
function
|
|
3093
|
-
return
|
|
3093
|
+
function Ze(t, e) {
|
|
3094
|
+
return Je(t.databaseId, e.path);
|
|
3094
3095
|
}
|
|
3095
3096
|
|
|
3096
|
-
function
|
|
3097
|
+
function $e(t, e) {
|
|
3097
3098
|
var n = function(t) {
|
|
3098
|
-
var e =
|
|
3099
|
-
return
|
|
3099
|
+
var e = nt.fromString(t);
|
|
3100
|
+
return A(cn(e)), e;
|
|
3100
3101
|
}(e);
|
|
3101
|
-
if (n.get(1) !== t.databaseId.projectId) throw new
|
|
3102
|
-
if (n.get(3) !== t.databaseId.database) throw new
|
|
3103
|
-
return new
|
|
3104
|
-
return
|
|
3102
|
+
if (n.get(1) !== t.databaseId.projectId) throw new z(V, "Tried to deserialize key from different project: " + n.get(1) + " vs " + t.databaseId.projectId);
|
|
3103
|
+
if (n.get(3) !== t.databaseId.database) throw new z(V, "Tried to deserialize key from different database: " + n.get(3) + " vs " + t.databaseId.database);
|
|
3104
|
+
return new ot(function(t) {
|
|
3105
|
+
return A(t.length > 4 && "documents" === t.get(4)), t.popFirst(5);
|
|
3105
3106
|
}(n));
|
|
3106
3107
|
}
|
|
3107
3108
|
|
|
3108
|
-
function
|
|
3109
|
+
function tn(t, e, n) {
|
|
3109
3110
|
return {
|
|
3110
|
-
name:
|
|
3111
|
+
name: Ze(t, e),
|
|
3111
3112
|
fields: n.value.mapValue.fields
|
|
3112
3113
|
};
|
|
3113
3114
|
}
|
|
3114
3115
|
|
|
3115
|
-
function
|
|
3116
|
+
function en(t, e) {
|
|
3116
3117
|
// Dissect the path into parent, collectionId, and optional key filter.
|
|
3117
3118
|
var n, r = {
|
|
3118
3119
|
structuredQuery: {}
|
|
@@ -3123,10 +3124,10 @@ function tn(t, e) {
|
|
|
3123
3124
|
} ]) : (n = i.popLast(), r.structuredQuery.from = [ {
|
|
3124
3125
|
collectionId: i.lastSegment()
|
|
3125
3126
|
} ]), r.parent = function(t, e) {
|
|
3126
|
-
return
|
|
3127
|
+
return Je(t.databaseId, e);
|
|
3127
3128
|
}(t, n);
|
|
3128
3129
|
var o = function(t) {
|
|
3129
|
-
if (0 !== t.length) return
|
|
3130
|
+
if (0 !== t.length) return un(te.create(t, "and" /* CompositeOperator.AND */));
|
|
3130
3131
|
}(e.filters);
|
|
3131
3132
|
o && (r.structuredQuery.where = o);
|
|
3132
3133
|
var a = function(t) {
|
|
@@ -3134,15 +3135,15 @@ function tn(t, e) {
|
|
|
3134
3135
|
// visible for testing
|
|
3135
3136
|
return function(t) {
|
|
3136
3137
|
return {
|
|
3137
|
-
field:
|
|
3138
|
-
direction:
|
|
3138
|
+
field: an(t.field),
|
|
3139
|
+
direction: nn(t.dir)
|
|
3139
3140
|
};
|
|
3140
3141
|
}(t);
|
|
3141
3142
|
}));
|
|
3142
3143
|
}(e.orderBy);
|
|
3143
3144
|
a && (r.structuredQuery.orderBy = a);
|
|
3144
3145
|
var u = function(t, e) {
|
|
3145
|
-
return t.useProto3Json ||
|
|
3146
|
+
return t.useProto3Json || dt(e) ? e : {
|
|
3146
3147
|
value: e
|
|
3147
3148
|
};
|
|
3148
3149
|
}(t, e.limit);
|
|
@@ -3162,75 +3163,75 @@ function tn(t, e) {
|
|
|
3162
3163
|
};
|
|
3163
3164
|
}
|
|
3164
3165
|
|
|
3165
|
-
function en(t) {
|
|
3166
|
-
return Ue[t];
|
|
3167
|
-
}
|
|
3168
|
-
|
|
3169
|
-
// visible for testing
|
|
3170
3166
|
function nn(t) {
|
|
3171
3167
|
return Be[t];
|
|
3172
3168
|
}
|
|
3173
3169
|
|
|
3170
|
+
// visible for testing
|
|
3174
3171
|
function rn(t) {
|
|
3175
3172
|
return ze[t];
|
|
3176
3173
|
}
|
|
3177
3174
|
|
|
3178
3175
|
function on(t) {
|
|
3176
|
+
return Ge[t];
|
|
3177
|
+
}
|
|
3178
|
+
|
|
3179
|
+
function an(t) {
|
|
3179
3180
|
return {
|
|
3180
3181
|
fieldPath: t.canonicalString()
|
|
3181
3182
|
};
|
|
3182
3183
|
}
|
|
3183
3184
|
|
|
3184
|
-
function
|
|
3185
|
-
return t instanceof
|
|
3185
|
+
function un(t) {
|
|
3186
|
+
return t instanceof $t ? function(t) {
|
|
3186
3187
|
if ("==" /* Operator.EQUAL */ === t.op) {
|
|
3187
|
-
if (
|
|
3188
|
+
if (Yt(t.value)) return {
|
|
3188
3189
|
unaryFilter: {
|
|
3189
|
-
field:
|
|
3190
|
+
field: an(t.field),
|
|
3190
3191
|
op: "IS_NAN"
|
|
3191
3192
|
}
|
|
3192
3193
|
};
|
|
3193
|
-
if (
|
|
3194
|
+
if (Qt(t.value)) return {
|
|
3194
3195
|
unaryFilter: {
|
|
3195
|
-
field:
|
|
3196
|
+
field: an(t.field),
|
|
3196
3197
|
op: "IS_NULL"
|
|
3197
3198
|
}
|
|
3198
3199
|
};
|
|
3199
3200
|
} else if ("!=" /* Operator.NOT_EQUAL */ === t.op) {
|
|
3200
|
-
if (
|
|
3201
|
+
if (Yt(t.value)) return {
|
|
3201
3202
|
unaryFilter: {
|
|
3202
|
-
field:
|
|
3203
|
+
field: an(t.field),
|
|
3203
3204
|
op: "IS_NOT_NAN"
|
|
3204
3205
|
}
|
|
3205
3206
|
};
|
|
3206
|
-
if (
|
|
3207
|
+
if (Qt(t.value)) return {
|
|
3207
3208
|
unaryFilter: {
|
|
3208
|
-
field:
|
|
3209
|
+
field: an(t.field),
|
|
3209
3210
|
op: "IS_NOT_NULL"
|
|
3210
3211
|
}
|
|
3211
3212
|
};
|
|
3212
3213
|
}
|
|
3213
3214
|
return {
|
|
3214
3215
|
fieldFilter: {
|
|
3215
|
-
field:
|
|
3216
|
-
op:
|
|
3216
|
+
field: an(t.field),
|
|
3217
|
+
op: rn(t.op),
|
|
3217
3218
|
value: t.value
|
|
3218
3219
|
}
|
|
3219
3220
|
};
|
|
3220
|
-
}(t) : t instanceof
|
|
3221
|
+
}(t) : t instanceof te ? function(t) {
|
|
3221
3222
|
var e = t.getFilters().map((function(t) {
|
|
3222
|
-
return
|
|
3223
|
+
return un(t);
|
|
3223
3224
|
}));
|
|
3224
3225
|
return 1 === e.length ? e[0] : {
|
|
3225
3226
|
compositeFilter: {
|
|
3226
|
-
op:
|
|
3227
|
+
op: on(t.op),
|
|
3227
3228
|
filters: e
|
|
3228
3229
|
}
|
|
3229
3230
|
};
|
|
3230
|
-
}(t) :
|
|
3231
|
+
}(t) : I();
|
|
3231
3232
|
}
|
|
3232
3233
|
|
|
3233
|
-
function
|
|
3234
|
+
function sn(t) {
|
|
3234
3235
|
var e = [];
|
|
3235
3236
|
return t.fields.forEach((function(t) {
|
|
3236
3237
|
return e.push(t.canonicalString());
|
|
@@ -3239,7 +3240,7 @@ function un(t) {
|
|
|
3239
3240
|
};
|
|
3240
3241
|
}
|
|
3241
3242
|
|
|
3242
|
-
function
|
|
3243
|
+
function cn(t) {
|
|
3243
3244
|
// Resource names have at least 4 components (project ID, database ID)
|
|
3244
3245
|
return t.length >= 4 && "projects" === t.get(0) && "databases" === t.get(2);
|
|
3245
3246
|
}
|
|
@@ -3259,8 +3260,8 @@ function sn(t) {
|
|
|
3259
3260
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
3260
3261
|
* See the License for the specific language governing permissions and
|
|
3261
3262
|
* limitations under the License.
|
|
3262
|
-
*/ function
|
|
3263
|
-
return new
|
|
3263
|
+
*/ function ln(t) {
|
|
3264
|
+
return new Ke(t, /* useProto3Json= */ !0);
|
|
3264
3265
|
}
|
|
3265
3266
|
|
|
3266
3267
|
/**
|
|
@@ -3287,7 +3288,7 @@ function sn(t) {
|
|
|
3287
3288
|
* backoff curve, and a +/- 50% "jitter" that is calculated and added to the
|
|
3288
3289
|
* base delay. This prevents clients from accidentally synchronizing their
|
|
3289
3290
|
* delays causing spikes of load to the backend.
|
|
3290
|
-
*/ var
|
|
3291
|
+
*/ var fn = /** @class */ function() {
|
|
3291
3292
|
function t(
|
|
3292
3293
|
/**
|
|
3293
3294
|
* The AsyncQueue to run backoff operations on.
|
|
@@ -3346,7 +3347,7 @@ function sn(t) {
|
|
|
3346
3347
|
// honored as such).
|
|
3347
3348
|
var n = Math.floor(this.U + this.H()), r = Math.max(0, Date.now() - this.W), i = Math.max(0, n - r);
|
|
3348
3349
|
// Guard against lastAttemptTime being in the future due to a clock change.
|
|
3349
|
-
i > 0 &&
|
|
3350
|
+
i > 0 && T("ExponentialBackoff", "Backing off for ".concat(i, " ms (base delay: ").concat(this.U, " ms, delay with jitter: ").concat(n, " ms, last attempt: ").concat(r, " ms ago)")),
|
|
3350
3351
|
this.j = this.$.enqueueAfterDelay(this.timerId, i, (function() {
|
|
3351
3352
|
return e.W = Date.now(), t();
|
|
3352
3353
|
})),
|
|
@@ -3361,33 +3362,33 @@ function sn(t) {
|
|
|
3361
3362
|
/** Returns a random value in the range [-currentBaseMs/2, currentBaseMs/2] */ t.prototype.H = function() {
|
|
3362
3363
|
return (Math.random() - .5) * this.U;
|
|
3363
3364
|
}, t;
|
|
3364
|
-
}(),
|
|
3365
|
+
}(), hn = /** @class */ function(e) {
|
|
3365
3366
|
function n(t, n, r, i) {
|
|
3366
3367
|
var o = this;
|
|
3367
3368
|
return (o = e.call(this) || this).authCredentials = t, o.appCheckCredentials = n,
|
|
3368
3369
|
o.connection = r, o.serializer = i, o.Y = !1, o;
|
|
3369
3370
|
}
|
|
3370
3371
|
return t(n, e), n.prototype.Z = function() {
|
|
3371
|
-
if (this.Y) throw new
|
|
3372
|
+
if (this.Y) throw new z(C, "The client has already been terminated.");
|
|
3372
3373
|
},
|
|
3373
3374
|
/** Invokes the provided RPC with auth and AppCheck tokens. */ n.prototype.P = function(t, e, n, r) {
|
|
3374
3375
|
var i = this;
|
|
3375
3376
|
return this.Z(), Promise.all([ this.authCredentials.getToken(), this.appCheckCredentials.getToken() ]).then((function(o) {
|
|
3376
3377
|
var a = o[0], u = o[1];
|
|
3377
|
-
return i.connection.P(t,
|
|
3378
|
+
return i.connection.P(t, Xe(e, n), r, a, u);
|
|
3378
3379
|
})).catch((function(t) {
|
|
3379
|
-
throw "FirebaseError" === t.name ? (t.code ===
|
|
3380
|
-
i.appCheckCredentials.invalidateToken()), t) : new
|
|
3380
|
+
throw "FirebaseError" === t.name ? (t.code === q && (i.authCredentials.invalidateToken(),
|
|
3381
|
+
i.appCheckCredentials.invalidateToken()), t) : new z(O, t.toString());
|
|
3381
3382
|
}));
|
|
3382
3383
|
},
|
|
3383
3384
|
/** Invokes the provided RPC with streamed results with auth and AppCheck tokens. */ n.prototype.g = function(t, e, n, r, i) {
|
|
3384
3385
|
var o = this;
|
|
3385
3386
|
return this.Z(), Promise.all([ this.authCredentials.getToken(), this.appCheckCredentials.getToken() ]).then((function(a) {
|
|
3386
3387
|
var u = a[0], s = a[1];
|
|
3387
|
-
return o.connection.g(t,
|
|
3388
|
+
return o.connection.g(t, Xe(e, n), r, u, s, i);
|
|
3388
3389
|
})).catch((function(t) {
|
|
3389
|
-
throw "FirebaseError" === t.name ? (t.code ===
|
|
3390
|
-
o.appCheckCredentials.invalidateToken()), t) : new
|
|
3390
|
+
throw "FirebaseError" === t.name ? (t.code === q && (o.authCredentials.invalidateToken(),
|
|
3391
|
+
o.appCheckCredentials.invalidateToken()), t) : new z(O, t.toString());
|
|
3391
3392
|
}));
|
|
3392
3393
|
}, n.prototype.terminate = function() {
|
|
3393
3394
|
this.Y = !0, this.connection.terminate();
|
|
@@ -3421,64 +3422,64 @@ function sn(t) {
|
|
|
3421
3422
|
*/
|
|
3422
3423
|
// TODO(firestorexp): Make sure there is only one Datastore instance per
|
|
3423
3424
|
// firestore-exp client.
|
|
3424
|
-
function
|
|
3425
|
+
function pn(t, r) {
|
|
3425
3426
|
return e(this, void 0, void 0, (function() {
|
|
3426
3427
|
var e, i;
|
|
3427
3428
|
return n(this, (function(n) {
|
|
3428
3429
|
switch (n.label) {
|
|
3429
3430
|
case 0:
|
|
3430
|
-
return e =
|
|
3431
|
+
return e = P(t), i = {
|
|
3431
3432
|
writes: r.map((function(t) {
|
|
3432
3433
|
return function(t, e) {
|
|
3433
3434
|
var n;
|
|
3434
|
-
if (e instanceof
|
|
3435
|
-
update:
|
|
3435
|
+
if (e instanceof je) n = {
|
|
3436
|
+
update: tn(t, e.key, e.value)
|
|
3437
|
+
}; else if (e instanceof Me) n = {
|
|
3438
|
+
delete: Ze(t, e.key)
|
|
3436
3439
|
}; else if (e instanceof Le) n = {
|
|
3437
|
-
|
|
3438
|
-
|
|
3439
|
-
update: $e(t, e.key, e.data),
|
|
3440
|
-
updateMask: un(e.fieldMask)
|
|
3440
|
+
update: tn(t, e.key, e.data),
|
|
3441
|
+
updateMask: sn(e.fieldMask)
|
|
3441
3442
|
}; else {
|
|
3442
|
-
if (!(e instanceof
|
|
3443
|
+
if (!(e instanceof Ue)) return I();
|
|
3443
3444
|
n = {
|
|
3444
|
-
verify:
|
|
3445
|
+
verify: Ze(t, e.key)
|
|
3445
3446
|
};
|
|
3446
3447
|
}
|
|
3447
3448
|
return e.fieldTransforms.length > 0 && (n.updateTransforms = e.fieldTransforms.map((function(t) {
|
|
3448
3449
|
return function(t, e) {
|
|
3449
3450
|
var n = e.transform;
|
|
3450
|
-
if (n instanceof
|
|
3451
|
+
if (n instanceof Ve) return {
|
|
3451
3452
|
fieldPath: e.field.canonicalString(),
|
|
3452
3453
|
setToServerValue: "REQUEST_TIME"
|
|
3453
3454
|
};
|
|
3454
|
-
if (n instanceof
|
|
3455
|
+
if (n instanceof Ne) return {
|
|
3455
3456
|
fieldPath: e.field.canonicalString(),
|
|
3456
3457
|
appendMissingElements: {
|
|
3457
3458
|
values: n.elements
|
|
3458
3459
|
}
|
|
3459
3460
|
};
|
|
3460
|
-
if (n instanceof
|
|
3461
|
+
if (n instanceof De) return {
|
|
3461
3462
|
fieldPath: e.field.canonicalString(),
|
|
3462
3463
|
removeAllFromArray: {
|
|
3463
3464
|
values: n.elements
|
|
3464
3465
|
}
|
|
3465
3466
|
};
|
|
3466
|
-
if (n instanceof
|
|
3467
|
+
if (n instanceof Re) return {
|
|
3467
3468
|
fieldPath: e.field.canonicalString(),
|
|
3468
3469
|
increment: n.q
|
|
3469
3470
|
};
|
|
3470
|
-
throw
|
|
3471
|
+
throw I();
|
|
3471
3472
|
}(0, t);
|
|
3472
3473
|
}))), e.precondition.isNone || (n.currentDocument = function(t, e) {
|
|
3473
3474
|
return void 0 !== e.updateTime ? {
|
|
3474
|
-
updateTime:
|
|
3475
|
+
updateTime: He(t, e.updateTime)
|
|
3475
3476
|
} : void 0 !== e.exists ? {
|
|
3476
3477
|
exists: e.exists
|
|
3477
|
-
} :
|
|
3478
|
+
} : I();
|
|
3478
3479
|
}(t, e.precondition)), n;
|
|
3479
3480
|
}(e.serializer, t);
|
|
3480
3481
|
}))
|
|
3481
|
-
}, [ 4 /*yield*/ , e.P("Commit", e.serializer.databaseId,
|
|
3482
|
+
}, [ 4 /*yield*/ , e.P("Commit", e.serializer.databaseId, nt.emptyPath(), i) ];
|
|
3482
3483
|
|
|
3483
3484
|
case 1:
|
|
3484
3485
|
return n.sent(), [ 2 /*return*/ ];
|
|
@@ -3487,39 +3488,39 @@ function hn(t, r) {
|
|
|
3487
3488
|
}));
|
|
3488
3489
|
}
|
|
3489
3490
|
|
|
3490
|
-
function
|
|
3491
|
+
function dn(t, r) {
|
|
3491
3492
|
return e(this, void 0, void 0, (function() {
|
|
3492
3493
|
var e, i, o, a, u;
|
|
3493
3494
|
return n(this, (function(n) {
|
|
3494
3495
|
switch (n.label) {
|
|
3495
3496
|
case 0:
|
|
3496
|
-
return e =
|
|
3497
|
+
return e = P(t), i = {
|
|
3497
3498
|
documents: r.map((function(t) {
|
|
3498
|
-
return
|
|
3499
|
+
return Ze(e.serializer, t);
|
|
3499
3500
|
}))
|
|
3500
|
-
}, [ 4 /*yield*/ , e.g("BatchGetDocuments", e.serializer.databaseId,
|
|
3501
|
+
}, [ 4 /*yield*/ , e.g("BatchGetDocuments", e.serializer.databaseId, nt.emptyPath(), i, r.length) ];
|
|
3501
3502
|
|
|
3502
3503
|
case 1:
|
|
3503
3504
|
return o = n.sent(), a = new Map, o.forEach((function(t) {
|
|
3504
3505
|
var n = function(t, e) {
|
|
3505
3506
|
return "found" in e ? function(t, e) {
|
|
3506
|
-
|
|
3507
|
-
var n =
|
|
3507
|
+
A(!!e.found), e.found.name, e.found.updateTime;
|
|
3508
|
+
var n = $e(t, e.found.name), r = We(e.found.updateTime), i = e.found.createTime ? We(e.found.createTime) : he.min(), o = new we({
|
|
3508
3509
|
mapValue: {
|
|
3509
3510
|
fields: e.found.fields
|
|
3510
3511
|
}
|
|
3511
3512
|
});
|
|
3512
|
-
return
|
|
3513
|
+
return _e.newFoundDocument(n, r, i, o);
|
|
3513
3514
|
}(t, e) : "missing" in e ? function(t, e) {
|
|
3514
|
-
|
|
3515
|
-
var n =
|
|
3516
|
-
return
|
|
3517
|
-
}(t, e) :
|
|
3515
|
+
A(!!e.missing), A(!!e.readTime);
|
|
3516
|
+
var n = $e(t, e.missing), r = We(e.readTime);
|
|
3517
|
+
return _e.newNoDocument(n, r);
|
|
3518
|
+
}(t, e) : I();
|
|
3518
3519
|
}(e.serializer, t);
|
|
3519
3520
|
a.set(n.key.toString(), n);
|
|
3520
3521
|
})), u = [], [ 2 /*return*/ , (r.forEach((function(t) {
|
|
3521
3522
|
var e = a.get(t.toString());
|
|
3522
|
-
|
|
3523
|
+
A(!!e), u.push(e);
|
|
3523
3524
|
})), u) ];
|
|
3524
3525
|
}
|
|
3525
3526
|
}));
|
|
@@ -3542,7 +3543,7 @@ function pn(t, r) {
|
|
|
3542
3543
|
* See the License for the specific language governing permissions and
|
|
3543
3544
|
* limitations under the License.
|
|
3544
3545
|
*/
|
|
3545
|
-
var
|
|
3546
|
+
var yn = new Map;
|
|
3546
3547
|
|
|
3547
3548
|
/**
|
|
3548
3549
|
* An instance map that ensures only one Datastore exists per Firestore
|
|
@@ -3552,20 +3553,20 @@ var dn = new Map;
|
|
|
3552
3553
|
* Returns an initialized and started Datastore for the given Firestore
|
|
3553
3554
|
* instance. Callers must invoke removeComponents() when the Firestore
|
|
3554
3555
|
* instance is terminated.
|
|
3555
|
-
*/ function
|
|
3556
|
-
if (t._terminated) throw new
|
|
3557
|
-
if (!
|
|
3558
|
-
|
|
3556
|
+
*/ function mn(t) {
|
|
3557
|
+
if (t._terminated) throw new z(C, "The client has already been terminated.");
|
|
3558
|
+
if (!yn.has(t)) {
|
|
3559
|
+
T("ComponentProvider", "Initializing Datastore");
|
|
3559
3560
|
var e = function(t) {
|
|
3560
|
-
return new
|
|
3561
|
+
return new _t(t, fetch.bind(null));
|
|
3561
3562
|
}(function(t, e, n, r) {
|
|
3562
|
-
return new
|
|
3563
|
-
}(t._databaseId, t.app.options.appId || "", t._persistenceKey, t._freezeSettings())), n =
|
|
3564
|
-
return new
|
|
3563
|
+
return new $(t, e, n, r.host, r.ssl, r.experimentalForceLongPolling, r.experimentalAutoDetectLongPolling, ht(r.experimentalLongPollingOptions), r.useFetchStreams);
|
|
3564
|
+
}(t._databaseId, t.app.options.appId || "", t._persistenceKey, t._freezeSettings())), n = ln(t._databaseId), r = function(t, e, n, r) {
|
|
3565
|
+
return new hn(t, e, n, r);
|
|
3565
3566
|
}(t._authCredentials, t._appCheckCredentials, e, n);
|
|
3566
|
-
|
|
3567
|
+
yn.set(t, r);
|
|
3567
3568
|
}
|
|
3568
|
-
return
|
|
3569
|
+
return yn.get(t);
|
|
3569
3570
|
}
|
|
3570
3571
|
|
|
3571
3572
|
/**
|
|
@@ -3576,32 +3577,32 @@ var dn = new Map;
|
|
|
3576
3577
|
* A concrete type describing all the values that can be applied via a
|
|
3577
3578
|
* user-supplied `FirestoreSettings` object. This is a separate type so that
|
|
3578
3579
|
* defaults can be supplied and the value can be checked for equality.
|
|
3579
|
-
*/ var
|
|
3580
|
+
*/ var vn = /** @class */ function() {
|
|
3580
3581
|
function t(t) {
|
|
3581
3582
|
var e, n;
|
|
3582
3583
|
if (void 0 === t.host) {
|
|
3583
|
-
if (void 0 !== t.ssl) throw new
|
|
3584
|
+
if (void 0 !== t.ssl) throw new z(V, "Can't provide ssl option if host option is not set");
|
|
3584
3585
|
this.host = "firestore.googleapis.com", this.ssl = !0;
|
|
3585
3586
|
} else this.host = t.host, this.ssl = null === (e = t.ssl) || void 0 === e || e;
|
|
3586
3587
|
if (this.credentials = t.credentials, this.ignoreUndefinedProperties = !!t.ignoreUndefinedProperties,
|
|
3587
3588
|
this.localCache = t.localCache, void 0 === t.cacheSizeBytes) this.cacheSizeBytes = 41943040; else {
|
|
3588
|
-
if (-1 !== t.cacheSizeBytes && t.cacheSizeBytes < 1048576) throw new
|
|
3589
|
+
if (-1 !== t.cacheSizeBytes && t.cacheSizeBytes < 1048576) throw new z(V, "cacheSizeBytes must be at least 1048576");
|
|
3589
3590
|
this.cacheSizeBytes = t.cacheSizeBytes;
|
|
3590
3591
|
}
|
|
3591
3592
|
!function(t, e, n, r) {
|
|
3592
|
-
if (!0 === e && !0 === r) throw new
|
|
3593
|
+
if (!0 === e && !0 === r) throw new z(V, "".concat(t, " and ").concat(n, " cannot be used together."));
|
|
3593
3594
|
}("experimentalForceLongPolling", t.experimentalForceLongPolling, "experimentalAutoDetectLongPolling", t.experimentalAutoDetectLongPolling),
|
|
3594
3595
|
this.experimentalForceLongPolling = !!t.experimentalForceLongPolling, this.experimentalForceLongPolling ? this.experimentalAutoDetectLongPolling = !1 : void 0 === t.experimentalAutoDetectLongPolling ? this.experimentalAutoDetectLongPolling = !0 :
|
|
3595
3596
|
// For backwards compatibility, coerce the value to boolean even though
|
|
3596
3597
|
// the TypeScript compiler has narrowed the type to boolean already.
|
|
3597
3598
|
// noinspection PointlessBooleanExpressionJS
|
|
3598
3599
|
this.experimentalAutoDetectLongPolling = !!t.experimentalAutoDetectLongPolling,
|
|
3599
|
-
this.experimentalLongPollingOptions =
|
|
3600
|
+
this.experimentalLongPollingOptions = ht(null !== (n = t.experimentalLongPollingOptions) && void 0 !== n ? n : {}),
|
|
3600
3601
|
function(t) {
|
|
3601
3602
|
if (void 0 !== t.timeoutSeconds) {
|
|
3602
|
-
if (isNaN(t.timeoutSeconds)) throw new
|
|
3603
|
-
if (t.timeoutSeconds < 5) throw new
|
|
3604
|
-
if (t.timeoutSeconds > 30) throw new
|
|
3603
|
+
if (isNaN(t.timeoutSeconds)) throw new z(V, "invalid long polling timeout: ".concat(t.timeoutSeconds, " (must not be NaN)"));
|
|
3604
|
+
if (t.timeoutSeconds < 5) throw new z(V, "invalid long polling timeout: ".concat(t.timeoutSeconds, " (minimum allowed value is 5)"));
|
|
3605
|
+
if (t.timeoutSeconds > 30) throw new z(V, "invalid long polling timeout: ".concat(t.timeoutSeconds, " (maximum allowed value is 30)"));
|
|
3605
3606
|
}
|
|
3606
3607
|
}(this.experimentalLongPollingOptions), this.useFetchStreams = !!t.useFetchStreams;
|
|
3607
3608
|
}
|
|
@@ -3618,7 +3619,7 @@ var dn = new Map;
|
|
|
3618
3619
|
/**
|
|
3619
3620
|
* Whether it's a Firestore or Firestore Lite instance.
|
|
3620
3621
|
*/
|
|
3621
|
-
this.type = "firestore-lite", this._persistenceKey = "(lite)", this._settings = new
|
|
3622
|
+
this.type = "firestore-lite", this._persistenceKey = "(lite)", this._settings = new vn({}),
|
|
3622
3623
|
this._settingsFrozen = !1;
|
|
3623
3624
|
}
|
|
3624
3625
|
return Object.defineProperty(t.prototype, "app", {
|
|
@@ -3627,7 +3628,7 @@ var dn = new Map;
|
|
|
3627
3628
|
* instance.
|
|
3628
3629
|
*/
|
|
3629
3630
|
get: function() {
|
|
3630
|
-
if (!this._app) throw new
|
|
3631
|
+
if (!this._app) throw new z(C, "Firestore was not initialized using the Firebase SDK. 'app' is not available");
|
|
3631
3632
|
return this._app;
|
|
3632
3633
|
},
|
|
3633
3634
|
enumerable: !1,
|
|
@@ -3645,18 +3646,18 @@ var dn = new Map;
|
|
|
3645
3646
|
enumerable: !1,
|
|
3646
3647
|
configurable: !0
|
|
3647
3648
|
}), t.prototype._setSettings = function(t) {
|
|
3648
|
-
if (this._settingsFrozen) throw new
|
|
3649
|
-
this._settings = new
|
|
3650
|
-
if (!t) return new
|
|
3649
|
+
if (this._settingsFrozen) throw new z(C, "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.");
|
|
3650
|
+
this._settings = new vn(t), void 0 !== t.credentials && (this._authCredentials = function(t) {
|
|
3651
|
+
if (!t) return new Q;
|
|
3651
3652
|
switch (t.type) {
|
|
3652
3653
|
case "firstParty":
|
|
3653
|
-
return new
|
|
3654
|
+
return new J(t.sessionIndex || "0", t.iamToken || null, t.authTokenFactory || null);
|
|
3654
3655
|
|
|
3655
3656
|
case "provider":
|
|
3656
3657
|
return t.client;
|
|
3657
3658
|
|
|
3658
3659
|
default:
|
|
3659
|
-
throw new
|
|
3660
|
+
throw new z(V, "makeAuthCredentialsProvider failed due to invalid credential type");
|
|
3660
3661
|
}
|
|
3661
3662
|
}(t.credentials));
|
|
3662
3663
|
}, t.prototype._getSettings = function() {
|
|
@@ -3681,29 +3682,29 @@ var dn = new Map;
|
|
|
3681
3682
|
* Only ever called once.
|
|
3682
3683
|
*/
|
|
3683
3684
|
t.prototype._terminate = function() {
|
|
3684
|
-
return t = this, (e =
|
|
3685
|
-
|
|
3685
|
+
return t = this, (e = yn.get(t)) && (T("ComponentProvider", "Removing Datastore"),
|
|
3686
|
+
yn.delete(t), e.terminate()), Promise.resolve();
|
|
3686
3687
|
var t, e;
|
|
3687
3688
|
}, t;
|
|
3688
3689
|
}();
|
|
3689
3690
|
|
|
3690
|
-
function
|
|
3691
|
+
function wn(t, e, n) {
|
|
3691
3692
|
n || (n = "(default)");
|
|
3692
3693
|
var r = _getProvider(t, "firestore/lite");
|
|
3693
|
-
if (r.isInitialized(n)) throw new
|
|
3694
|
+
if (r.isInitialized(n)) throw new z(C, "Firestore can only be initialized once per app.");
|
|
3694
3695
|
return r.initialize({
|
|
3695
3696
|
options: e,
|
|
3696
3697
|
instanceIdentifier: n
|
|
3697
3698
|
});
|
|
3698
3699
|
}
|
|
3699
3700
|
|
|
3700
|
-
function
|
|
3701
|
+
function _n(t, e) {
|
|
3701
3702
|
var n = "object" == typeof t ? t : u(), i = "string" == typeof t ? t : e || "(default)", o = _getProvider(n, "firestore/lite").getImmediate({
|
|
3702
3703
|
identifier: i
|
|
3703
3704
|
});
|
|
3704
3705
|
if (!o._initialized) {
|
|
3705
3706
|
var a = y("firestore");
|
|
3706
|
-
a &&
|
|
3707
|
+
a && bn.apply(void 0, r([ o ], a, !1));
|
|
3707
3708
|
}
|
|
3708
3709
|
return o;
|
|
3709
3710
|
}
|
|
@@ -3720,11 +3721,11 @@ function wn(t, e) {
|
|
|
3720
3721
|
* @param port - the emulator port (ex: 9000).
|
|
3721
3722
|
* @param options.mockUserToken - the mock auth token to use for unit testing
|
|
3722
3723
|
* Security Rules.
|
|
3723
|
-
*/ function
|
|
3724
|
+
*/ function bn(t, e, n, r) {
|
|
3724
3725
|
var i;
|
|
3725
3726
|
void 0 === r && (r = {});
|
|
3726
|
-
var o = (t =
|
|
3727
|
-
if ("firestore.googleapis.com" !== o.host && o.host !== a &&
|
|
3727
|
+
var o = (t = lt(t, gn))._getSettings(), a = "".concat(e, ":").concat(n);
|
|
3728
|
+
if ("firestore.googleapis.com" !== o.host && o.host !== a && S("Host has been set in both settings() and connectFirestoreEmulator(), emulator host will be used."),
|
|
3728
3729
|
t._setSettings(Object.assign(Object.assign({}, o), {
|
|
3729
3730
|
host: a,
|
|
3730
3731
|
ssl: !1
|
|
@@ -3735,10 +3736,10 @@ function wn(t, e) {
|
|
|
3735
3736
|
// invalid field "uid" and missing field "sub" / "user_id".)
|
|
3736
3737
|
u = m(r.mockUserToken, null === (i = t._app) || void 0 === i ? void 0 : i.options.projectId);
|
|
3737
3738
|
var c = r.mockUserToken.sub || r.mockUserToken.user_id;
|
|
3738
|
-
if (!c) throw new
|
|
3739
|
+
if (!c) throw new z(V, "mockUserToken must contain 'sub' or 'user_id' field!");
|
|
3739
3740
|
s = new g(c);
|
|
3740
3741
|
}
|
|
3741
|
-
t._authCredentials = new
|
|
3742
|
+
t._authCredentials = new Y(new K(u, s));
|
|
3742
3743
|
}
|
|
3743
3744
|
}
|
|
3744
3745
|
|
|
@@ -3761,8 +3762,8 @@ function wn(t, e) {
|
|
|
3761
3762
|
* @param firestore - The `Firestore` instance to terminate.
|
|
3762
3763
|
* @returns A `Promise` that is resolved when the instance has been successfully
|
|
3763
3764
|
* terminated.
|
|
3764
|
-
*/ function
|
|
3765
|
-
return t =
|
|
3765
|
+
*/ function Tn(t) {
|
|
3766
|
+
return t = lt(t, gn), s(t.app, "firestore/lite"), t._delete();
|
|
3766
3767
|
}
|
|
3767
3768
|
|
|
3768
3769
|
/**
|
|
@@ -3801,7 +3802,7 @@ function wn(t, e) {
|
|
|
3801
3802
|
* Represents an aggregation that can be performed by Firestore.
|
|
3802
3803
|
*/
|
|
3803
3804
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
3804
|
-
var
|
|
3805
|
+
var En =
|
|
3805
3806
|
/**
|
|
3806
3807
|
* Create a new AggregateField<T>
|
|
3807
3808
|
* @param aggregateType Specifies the type of aggregation operation to perform.
|
|
@@ -3812,7 +3813,7 @@ function(t, e) {
|
|
|
3812
3813
|
void 0 === t && (t = "count"), this._internalFieldPath = e,
|
|
3813
3814
|
/** A type string to uniquely identify instances of this class. */
|
|
3814
3815
|
this.type = "AggregateField", this.aggregateType = t;
|
|
3815
|
-
},
|
|
3816
|
+
}, Sn = /** @class */ function() {
|
|
3816
3817
|
/** @hideconstructor */
|
|
3817
3818
|
function t(t, e, n) {
|
|
3818
3819
|
this._userDataWriter = e, this._data = n,
|
|
@@ -3833,7 +3834,7 @@ function(t, e) {
|
|
|
3833
3834
|
return t.prototype.data = function() {
|
|
3834
3835
|
return this._userDataWriter.convertObjectMap(this._data);
|
|
3835
3836
|
}, t;
|
|
3836
|
-
}(),
|
|
3837
|
+
}(), kn = /** @class */ function() {
|
|
3837
3838
|
// This is the lite version of the Query class in the main SDK.
|
|
3838
3839
|
/** @hideconstructor protected */
|
|
3839
3840
|
function t(t,
|
|
@@ -3848,7 +3849,7 @@ function(t, e) {
|
|
|
3848
3849
|
return t.prototype.withConverter = function(e) {
|
|
3849
3850
|
return new t(this.firestore, e, this._query);
|
|
3850
3851
|
}, t;
|
|
3851
|
-
}(),
|
|
3852
|
+
}(), In = /** @class */ function() {
|
|
3852
3853
|
/** @hideconstructor */
|
|
3853
3854
|
function t(t,
|
|
3854
3855
|
/**
|
|
@@ -3889,19 +3890,19 @@ function(t, e) {
|
|
|
3889
3890
|
* The collection this `DocumentReference` belongs to.
|
|
3890
3891
|
*/
|
|
3891
3892
|
get: function() {
|
|
3892
|
-
return new
|
|
3893
|
+
return new An(this.firestore, this.converter, this._key.path.popLast());
|
|
3893
3894
|
},
|
|
3894
3895
|
enumerable: !1,
|
|
3895
3896
|
configurable: !0
|
|
3896
3897
|
}), t.prototype.withConverter = function(e) {
|
|
3897
3898
|
return new t(this.firestore, e, this._key);
|
|
3898
3899
|
}, t;
|
|
3899
|
-
}(),
|
|
3900
|
+
}(), An = /** @class */ function(e) {
|
|
3900
3901
|
/** @hideconstructor */
|
|
3901
3902
|
function n(t, n, r) {
|
|
3902
3903
|
var i = this;
|
|
3903
3904
|
return i = e.call(this, t, n, function(t) {
|
|
3904
|
-
return new
|
|
3905
|
+
return new Ee(t);
|
|
3905
3906
|
}(r)) || this, i._path = r,
|
|
3906
3907
|
/** The type of this Firestore reference. */
|
|
3907
3908
|
i.type = "collection", i;
|
|
@@ -3929,27 +3930,27 @@ function(t, e) {
|
|
|
3929
3930
|
*/
|
|
3930
3931
|
get: function() {
|
|
3931
3932
|
var t = this._path.popLast();
|
|
3932
|
-
return t.isEmpty() ? null : new
|
|
3933
|
-
/* converter= */ null, new
|
|
3933
|
+
return t.isEmpty() ? null : new In(this.firestore,
|
|
3934
|
+
/* converter= */ null, new ot(t));
|
|
3934
3935
|
},
|
|
3935
3936
|
enumerable: !1,
|
|
3936
3937
|
configurable: !0
|
|
3937
3938
|
}), n.prototype.withConverter = function(t) {
|
|
3938
3939
|
return new n(this.firestore, t, this._path);
|
|
3939
3940
|
}, n;
|
|
3940
|
-
}(
|
|
3941
|
+
}(kn);
|
|
3941
3942
|
|
|
3942
3943
|
/**
|
|
3943
3944
|
* The results of executing an aggregation query.
|
|
3944
|
-
*/ function
|
|
3945
|
+
*/ function Pn(t, e) {
|
|
3945
3946
|
for (var n = [], i = 2; i < arguments.length; i++) n[i - 2] = arguments[i];
|
|
3946
|
-
if (t = d(t),
|
|
3947
|
-
var o =
|
|
3948
|
-
return
|
|
3947
|
+
if (t = d(t), at("collection", "path", e), t instanceof gn) {
|
|
3948
|
+
var o = nt.fromString.apply(nt, r([ e ], n, !1));
|
|
3949
|
+
return st(o), new An(t, /* converter= */ null, o);
|
|
3949
3950
|
}
|
|
3950
|
-
if (!(t instanceof
|
|
3951
|
-
var a = t._path.child(
|
|
3952
|
-
return
|
|
3951
|
+
if (!(t instanceof In || t instanceof An)) throw new z(V, "Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");
|
|
3952
|
+
var a = t._path.child(nt.fromString.apply(nt, r([ e ], n, !1)));
|
|
3953
|
+
return st(a), new An(t.firestore,
|
|
3953
3954
|
/* converter= */ null, a);
|
|
3954
3955
|
}
|
|
3955
3956
|
|
|
@@ -3965,27 +3966,27 @@ function(t, e) {
|
|
|
3965
3966
|
* collection or subcollection with this ID as the last segment of its path
|
|
3966
3967
|
* will be included. Cannot contain a slash.
|
|
3967
3968
|
* @returns The created `Query`.
|
|
3968
|
-
*/ function
|
|
3969
|
-
if (t =
|
|
3970
|
-
return new
|
|
3969
|
+
*/ function Fn(t, e) {
|
|
3970
|
+
if (t = lt(t, gn), at("collectionGroup", "collection id", e), e.indexOf("/") >= 0) throw new z(V, "Invalid collection ID '".concat(e, "' passed to function collectionGroup(). Collection IDs must not contain '/'."));
|
|
3971
|
+
return new kn(t,
|
|
3971
3972
|
/* converter= */ null, function(t) {
|
|
3972
|
-
return new
|
|
3973
|
+
return new Ee(nt.emptyPath(), t);
|
|
3973
3974
|
}(e));
|
|
3974
3975
|
}
|
|
3975
3976
|
|
|
3976
|
-
function
|
|
3977
|
+
function On(t, e) {
|
|
3977
3978
|
for (var n = [], i = 2; i < arguments.length; i++) n[i - 2] = arguments[i];
|
|
3978
3979
|
if (t = d(t),
|
|
3979
3980
|
// We allow omission of 'pathString' but explicitly prohibit passing in both
|
|
3980
3981
|
// 'undefined' and 'null'.
|
|
3981
|
-
1 === arguments.length && (e =
|
|
3982
|
-
var o =
|
|
3983
|
-
return
|
|
3984
|
-
/* converter= */ null, new
|
|
3982
|
+
1 === arguments.length && (e = Et.newId()), at("doc", "path", e), t instanceof gn) {
|
|
3983
|
+
var o = nt.fromString.apply(nt, r([ e ], n, !1));
|
|
3984
|
+
return ut(o), new In(t,
|
|
3985
|
+
/* converter= */ null, new ot(o));
|
|
3985
3986
|
}
|
|
3986
|
-
if (!(t instanceof
|
|
3987
|
-
var a = t._path.child(
|
|
3988
|
-
return
|
|
3987
|
+
if (!(t instanceof In || t instanceof An)) throw new z(V, "Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");
|
|
3988
|
+
var a = t._path.child(nt.fromString.apply(nt, r([ e ], n, !1)));
|
|
3989
|
+
return ut(a), new In(t.firestore, t instanceof An ? t.converter : null, new ot(a));
|
|
3989
3990
|
}
|
|
3990
3991
|
|
|
3991
3992
|
/**
|
|
@@ -3995,8 +3996,8 @@ function Fn(t, e) {
|
|
|
3995
3996
|
* @param right - A reference to compare.
|
|
3996
3997
|
* @returns true if the references point to the same location in the same
|
|
3997
3998
|
* Firestore database.
|
|
3998
|
-
*/ function
|
|
3999
|
-
return t = d(t), e = d(e), (t instanceof
|
|
3999
|
+
*/ function Vn(t, e) {
|
|
4000
|
+
return t = d(t), e = d(e), (t instanceof In || t instanceof An) && (e instanceof In || e instanceof An) && t.firestore === e.firestore && t.path === e.path && t.converter === e.converter
|
|
4000
4001
|
/**
|
|
4001
4002
|
* Returns true if the provided queries point to the same collection and apply
|
|
4002
4003
|
* the same constraints.
|
|
@@ -4008,16 +4009,16 @@ function Fn(t, e) {
|
|
|
4008
4009
|
*/;
|
|
4009
4010
|
}
|
|
4010
4011
|
|
|
4011
|
-
function
|
|
4012
|
-
return t = d(t), e = d(e), t instanceof
|
|
4012
|
+
function Nn(t, e) {
|
|
4013
|
+
return t = d(t), e = d(e), t instanceof kn && e instanceof kn && t.firestore === e.firestore && function(t, e) {
|
|
4013
4014
|
return function(t, e) {
|
|
4014
4015
|
if (t.limit !== e.limit) return !1;
|
|
4015
4016
|
if (t.orderBy.length !== e.orderBy.length) return !1;
|
|
4016
|
-
for (var n = 0; n < t.orderBy.length; n++) if (!
|
|
4017
|
+
for (var n = 0; n < t.orderBy.length; n++) if (!fe(t.orderBy[n], e.orderBy[n])) return !1;
|
|
4017
4018
|
if (t.filters.length !== e.filters.length) return !1;
|
|
4018
|
-
for (var r = 0; r < t.filters.length; r++) if (!
|
|
4019
|
-
return t.collectionGroup === e.collectionGroup && !!t.path.isEqual(e.path) && !!
|
|
4020
|
-
}(
|
|
4019
|
+
for (var r = 0; r < t.filters.length; r++) if (!ee(t.filters[r], e.filters[r])) return !1;
|
|
4020
|
+
return t.collectionGroup === e.collectionGroup && !!t.path.isEqual(e.path) && !!Xt(t.startAt, e.startAt) && Xt(t.endAt, e.endAt);
|
|
4021
|
+
}(Ie(t), Ie(e)) && t.limitType === e.limitType;
|
|
4021
4022
|
}(t._query, e._query) && t.converter === e.converter
|
|
4022
4023
|
/**
|
|
4023
4024
|
* @license
|
|
@@ -4040,7 +4041,7 @@ function Vn(t, e) {
|
|
|
4040
4041
|
*/;
|
|
4041
4042
|
}
|
|
4042
4043
|
|
|
4043
|
-
var
|
|
4044
|
+
var Dn = /** @class */ function() {
|
|
4044
4045
|
/** @hideconstructor */
|
|
4045
4046
|
function t(t) {
|
|
4046
4047
|
this._byteString = t;
|
|
@@ -4052,9 +4053,9 @@ var Nn = /** @class */ function() {
|
|
|
4052
4053
|
* @param base64 - The Base64 string used to create the `Bytes` object.
|
|
4053
4054
|
*/ return t.fromBase64String = function(e) {
|
|
4054
4055
|
try {
|
|
4055
|
-
return new t(
|
|
4056
|
+
return new t(Ft.fromBase64String(e));
|
|
4056
4057
|
} catch (e) {
|
|
4057
|
-
throw new
|
|
4058
|
+
throw new z(V, "Failed to construct data from Base64 string: " + e);
|
|
4058
4059
|
}
|
|
4059
4060
|
},
|
|
4060
4061
|
/**
|
|
@@ -4063,7 +4064,7 @@ var Nn = /** @class */ function() {
|
|
|
4063
4064
|
* @param array - The Uint8Array used to create the `Bytes` object.
|
|
4064
4065
|
*/
|
|
4065
4066
|
t.fromUint8Array = function(e) {
|
|
4066
|
-
return new t(
|
|
4067
|
+
return new t(Ft.fromUint8Array(e));
|
|
4067
4068
|
},
|
|
4068
4069
|
/**
|
|
4069
4070
|
* Returns the underlying bytes as a Base64-encoded string.
|
|
@@ -4098,7 +4099,7 @@ var Nn = /** @class */ function() {
|
|
|
4098
4099
|
t.prototype.isEqual = function(t) {
|
|
4099
4100
|
return this._byteString.isEqual(t._byteString);
|
|
4100
4101
|
}, t;
|
|
4101
|
-
}(),
|
|
4102
|
+
}(), Rn = /** @class */ function() {
|
|
4102
4103
|
/**
|
|
4103
4104
|
* Creates a `FieldPath` from the provided field names. If more than one field
|
|
4104
4105
|
* name is provided, the path will point to a nested field in a document.
|
|
@@ -4107,8 +4108,8 @@ var Nn = /** @class */ function() {
|
|
|
4107
4108
|
*/
|
|
4108
4109
|
function t() {
|
|
4109
4110
|
for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
|
|
4110
|
-
for (var n = 0; n < t.length; ++n) if (0 === t[n].length) throw new
|
|
4111
|
-
this._internalPath = new
|
|
4111
|
+
for (var n = 0; n < t.length; ++n) if (0 === t[n].length) throw new z(V, "Invalid field name at argument $(i + 1). Field names must not be empty.");
|
|
4112
|
+
this._internalPath = new it(t);
|
|
4112
4113
|
}
|
|
4113
4114
|
/**
|
|
4114
4115
|
* Returns true if this `FieldPath` is equal to the provided one.
|
|
@@ -4148,8 +4149,8 @@ var Nn = /** @class */ function() {
|
|
|
4148
4149
|
* Returns a special sentinel `FieldPath` to refer to the ID of a document.
|
|
4149
4150
|
* It can be used in queries to sort or filter by the document ID.
|
|
4150
4151
|
*/
|
|
4151
|
-
function
|
|
4152
|
-
return new
|
|
4152
|
+
function qn() {
|
|
4153
|
+
return new Rn("__name__");
|
|
4153
4154
|
}
|
|
4154
4155
|
|
|
4155
4156
|
/**
|
|
@@ -4171,14 +4172,14 @@ function Rn() {
|
|
|
4171
4172
|
/**
|
|
4172
4173
|
* Sentinel values that can be used when writing document fields with `set()`
|
|
4173
4174
|
* or `update()`.
|
|
4174
|
-
*/ var
|
|
4175
|
+
*/ var xn =
|
|
4175
4176
|
/**
|
|
4176
4177
|
* @param _methodName - The public API endpoint that returns this class.
|
|
4177
4178
|
* @hideconstructor
|
|
4178
4179
|
*/
|
|
4179
4180
|
function(t) {
|
|
4180
4181
|
this._methodName = t;
|
|
4181
|
-
},
|
|
4182
|
+
}, Cn = /** @class */ function() {
|
|
4182
4183
|
/**
|
|
4183
4184
|
* Creates a new immutable `GeoPoint` object with the provided latitude and
|
|
4184
4185
|
* longitude values.
|
|
@@ -4186,8 +4187,8 @@ function(t) {
|
|
|
4186
4187
|
* @param longitude - The longitude as number between -180 and 180.
|
|
4187
4188
|
*/
|
|
4188
4189
|
function t(t, e) {
|
|
4189
|
-
if (!isFinite(t) || t < -90 || t > 90) throw new
|
|
4190
|
-
if (!isFinite(e) || e < -180 || e > 180) throw new
|
|
4190
|
+
if (!isFinite(t) || t < -90 || t > 90) throw new z(V, "Latitude must be a number between -90 and 90, but was: " + t);
|
|
4191
|
+
if (!isFinite(e) || e < -180 || e > 180) throw new z(V, "Longitude must be a number between -180 and 180, but was: " + e);
|
|
4191
4192
|
this._lat = t, this._long = e;
|
|
4192
4193
|
}
|
|
4193
4194
|
return Object.defineProperty(t.prototype, "latitude", {
|
|
@@ -4229,23 +4230,23 @@ function(t) {
|
|
|
4229
4230
|
* with an underscore.
|
|
4230
4231
|
*/
|
|
4231
4232
|
t.prototype._compareTo = function(t) {
|
|
4232
|
-
return
|
|
4233
|
+
return St(this._lat, t._lat) || St(this._long, t._long);
|
|
4233
4234
|
}, t;
|
|
4234
|
-
}(),
|
|
4235
|
+
}(), jn = /^__.*__$/, Ln = /** @class */ function() {
|
|
4235
4236
|
function t(t, e, n) {
|
|
4236
4237
|
this.data = t, this.fieldMask = e, this.fieldTransforms = n;
|
|
4237
4238
|
}
|
|
4238
4239
|
return t.prototype.toMutation = function(t, e) {
|
|
4239
|
-
return null !== this.fieldMask ? new
|
|
4240
|
+
return null !== this.fieldMask ? new Le(t, this.data, this.fieldMask, e, this.fieldTransforms) : new je(t, this.data, e, this.fieldTransforms);
|
|
4240
4241
|
}, t;
|
|
4241
|
-
}(),
|
|
4242
|
+
}(), Mn = /** @class */ function() {
|
|
4242
4243
|
function t(t,
|
|
4243
4244
|
// The fieldMask does not include document transforms.
|
|
4244
4245
|
e, n) {
|
|
4245
4246
|
this.data = t, this.fieldMask = e, this.fieldTransforms = n;
|
|
4246
4247
|
}
|
|
4247
4248
|
return t.prototype.toMutation = function(t, e) {
|
|
4248
|
-
return new
|
|
4249
|
+
return new Le(t, this.data, this.fieldMask, e, this.fieldTransforms);
|
|
4249
4250
|
}, t;
|
|
4250
4251
|
}();
|
|
4251
4252
|
|
|
@@ -4271,7 +4272,7 @@ function(t) {
|
|
|
4271
4272
|
*
|
|
4272
4273
|
* Latitude values are in the range of [-90, 90].
|
|
4273
4274
|
* Longitude values are in the range of [-180, 180].
|
|
4274
|
-
*/ function
|
|
4275
|
+
*/ function Un(t) {
|
|
4275
4276
|
switch (t) {
|
|
4276
4277
|
case 0 /* UserDataSource.Set */ :
|
|
4277
4278
|
// fall through
|
|
@@ -4285,11 +4286,11 @@ function(t) {
|
|
|
4285
4286
|
return !1;
|
|
4286
4287
|
|
|
4287
4288
|
default:
|
|
4288
|
-
throw
|
|
4289
|
+
throw I();
|
|
4289
4290
|
}
|
|
4290
4291
|
}
|
|
4291
4292
|
|
|
4292
|
-
/** A "context" object passed around while parsing user data. */ var
|
|
4293
|
+
/** A "context" object passed around while parsing user data. */ var Bn = /** @class */ function() {
|
|
4293
4294
|
/**
|
|
4294
4295
|
* Initializes a ParseContext with the given source and path.
|
|
4295
4296
|
*
|
|
@@ -4349,7 +4350,7 @@ function(t) {
|
|
|
4349
4350
|
it: !0
|
|
4350
4351
|
});
|
|
4351
4352
|
}, t.prototype._t = function(t) {
|
|
4352
|
-
return
|
|
4353
|
+
return sr(t, this.settings.methodName, this.settings.ct || !1, this.path, this.settings.lt);
|
|
4353
4354
|
},
|
|
4354
4355
|
/** Returns 'true' if 'fieldPath' was traversed when creating this context. */ t.prototype.contains = function(t) {
|
|
4355
4356
|
return void 0 !== this.fieldMask.find((function(e) {
|
|
@@ -4363,19 +4364,19 @@ function(t) {
|
|
|
4363
4364
|
if (this.path) for (var t = 0; t < this.path.length; t++) this.st(this.path.get(t));
|
|
4364
4365
|
}, t.prototype.st = function(t) {
|
|
4365
4366
|
if (0 === t.length) throw this._t("Document fields must not be empty");
|
|
4366
|
-
if (
|
|
4367
|
+
if (Un(this.et) && jn.test(t)) throw this._t('Document fields cannot begin and end with "__"');
|
|
4367
4368
|
}, t;
|
|
4368
|
-
}(),
|
|
4369
|
+
}(), zn = /** @class */ function() {
|
|
4369
4370
|
function t(t, e, n) {
|
|
4370
|
-
this.databaseId = t, this.ignoreUndefinedProperties = e, this.serializer = n ||
|
|
4371
|
+
this.databaseId = t, this.ignoreUndefinedProperties = e, this.serializer = n || ln(t)
|
|
4371
4372
|
/** Creates a new top-level parse context. */;
|
|
4372
4373
|
}
|
|
4373
4374
|
return t.prototype.ht = function(t, e, n, r) {
|
|
4374
|
-
return void 0 === r && (r = !1), new
|
|
4375
|
+
return void 0 === r && (r = !1), new Bn({
|
|
4375
4376
|
et: t,
|
|
4376
4377
|
methodName: e,
|
|
4377
4378
|
lt: n,
|
|
4378
|
-
path:
|
|
4379
|
+
path: it.emptyPath(),
|
|
4379
4380
|
it: !1,
|
|
4380
4381
|
ct: r
|
|
4381
4382
|
}, this.databaseId, this.serializer, this.ignoreUndefinedProperties);
|
|
@@ -4385,30 +4386,30 @@ function(t) {
|
|
|
4385
4386
|
/**
|
|
4386
4387
|
* Helper for parsing raw user input (provided via the API) into internal model
|
|
4387
4388
|
* classes.
|
|
4388
|
-
*/ function
|
|
4389
|
-
var e = t._freezeSettings(), n =
|
|
4390
|
-
return new
|
|
4389
|
+
*/ function Gn(t) {
|
|
4390
|
+
var e = t._freezeSettings(), n = ln(t._databaseId);
|
|
4391
|
+
return new zn(t._databaseId, !!e.ignoreUndefinedProperties, n);
|
|
4391
4392
|
}
|
|
4392
4393
|
|
|
4393
|
-
/** Parse document data from a set() call. */ function
|
|
4394
|
+
/** Parse document data from a set() call. */ function Kn(t, e, n, r, i, o) {
|
|
4394
4395
|
void 0 === o && (o = {});
|
|
4395
4396
|
var a = t.ht(o.merge || o.mergeFields ? 2 /* UserDataSource.MergeSet */ : 0 /* UserDataSource.Set */ , e, n, i);
|
|
4396
|
-
|
|
4397
|
-
var u, s, c =
|
|
4397
|
+
ir("Data must be an object, but it was:", a, r);
|
|
4398
|
+
var u, s, c = nr(r, a);
|
|
4398
4399
|
if (o.merge) u = new ge(a.fieldMask), s = a.fieldTransforms; else if (o.mergeFields) {
|
|
4399
4400
|
for (var l = [], f = 0, h = o.mergeFields; f < h.length; f++) {
|
|
4400
|
-
var p =
|
|
4401
|
-
if (!a.contains(p)) throw new
|
|
4402
|
-
|
|
4401
|
+
var p = or(e, h[f], n);
|
|
4402
|
+
if (!a.contains(p)) throw new z(V, "Field '".concat(p, "' is specified in your field mask but missing from your input data."));
|
|
4403
|
+
cr(l, p) || l.push(p);
|
|
4403
4404
|
}
|
|
4404
4405
|
u = new ge(l), s = a.fieldTransforms.filter((function(t) {
|
|
4405
4406
|
return u.covers(t.field);
|
|
4406
4407
|
}));
|
|
4407
4408
|
} else u = null, s = a.fieldTransforms;
|
|
4408
|
-
return new
|
|
4409
|
+
return new Ln(new we(c), u, s);
|
|
4409
4410
|
}
|
|
4410
4411
|
|
|
4411
|
-
var
|
|
4412
|
+
var Qn = /** @class */ function(e) {
|
|
4412
4413
|
function n() {
|
|
4413
4414
|
return null !== e && e.apply(this, arguments) || this;
|
|
4414
4415
|
}
|
|
@@ -4420,7 +4421,7 @@ var Kn = /** @class */ function(e) {
|
|
|
4420
4421
|
}, n.prototype.isEqual = function(t) {
|
|
4421
4422
|
return t instanceof n;
|
|
4422
4423
|
}, n;
|
|
4423
|
-
}(
|
|
4424
|
+
}(xn);
|
|
4424
4425
|
|
|
4425
4426
|
/**
|
|
4426
4427
|
* Creates a child context for parsing SerializableFieldValues.
|
|
@@ -4437,8 +4438,8 @@ var Kn = /** @class */ function(e) {
|
|
|
4437
4438
|
* context.
|
|
4438
4439
|
* @param context - The parent context.
|
|
4439
4440
|
* @param arrayElement - Whether or not the FieldValue has an array.
|
|
4440
|
-
*/ function
|
|
4441
|
-
return new
|
|
4441
|
+
*/ function Yn(t, e, n) {
|
|
4442
|
+
return new Bn({
|
|
4442
4443
|
et: 3 /* UserDataSource.Argument */ ,
|
|
4443
4444
|
lt: e.settings.lt,
|
|
4444
4445
|
methodName: t._methodName,
|
|
@@ -4446,98 +4447,98 @@ var Kn = /** @class */ function(e) {
|
|
|
4446
4447
|
}, e.databaseId, e.serializer, e.ignoreUndefinedProperties);
|
|
4447
4448
|
}
|
|
4448
4449
|
|
|
4449
|
-
var
|
|
4450
|
+
var Hn = /** @class */ function(e) {
|
|
4450
4451
|
function n() {
|
|
4451
4452
|
return null !== e && e.apply(this, arguments) || this;
|
|
4452
4453
|
}
|
|
4453
4454
|
return t(n, e), n.prototype._toFieldTransform = function(t) {
|
|
4454
|
-
return new
|
|
4455
|
+
return new qe(t.path, new Ve);
|
|
4455
4456
|
}, n.prototype.isEqual = function(t) {
|
|
4456
4457
|
return t instanceof n;
|
|
4457
4458
|
}, n;
|
|
4458
|
-
}(
|
|
4459
|
+
}(xn), Wn = /** @class */ function(e) {
|
|
4459
4460
|
function n(t, n) {
|
|
4460
4461
|
var r = this;
|
|
4461
4462
|
return (r = e.call(this, t) || this).dt = n, r;
|
|
4462
4463
|
}
|
|
4463
4464
|
return t(n, e), n.prototype._toFieldTransform = function(t) {
|
|
4464
|
-
var e =
|
|
4465
|
+
var e = Yn(this, t,
|
|
4465
4466
|
/*array=*/ !0), n = this.dt.map((function(t) {
|
|
4466
|
-
return
|
|
4467
|
-
})), r = new
|
|
4468
|
-
return new
|
|
4467
|
+
return er(t, e);
|
|
4468
|
+
})), r = new Ne(n);
|
|
4469
|
+
return new qe(t.path, r);
|
|
4469
4470
|
}, n.prototype.isEqual = function(t) {
|
|
4470
4471
|
return t instanceof n && p(this.dt, t.dt);
|
|
4471
4472
|
}, n;
|
|
4472
|
-
}(
|
|
4473
|
+
}(xn), Jn = /** @class */ function(e) {
|
|
4473
4474
|
function n(t, n) {
|
|
4474
4475
|
var r = this;
|
|
4475
4476
|
return (r = e.call(this, t) || this).dt = n, r;
|
|
4476
4477
|
}
|
|
4477
4478
|
return t(n, e), n.prototype._toFieldTransform = function(t) {
|
|
4478
|
-
var e =
|
|
4479
|
+
var e = Yn(this, t,
|
|
4479
4480
|
/*array=*/ !0), n = this.dt.map((function(t) {
|
|
4480
|
-
return
|
|
4481
|
-
})), r = new
|
|
4482
|
-
return new
|
|
4481
|
+
return er(t, e);
|
|
4482
|
+
})), r = new De(n);
|
|
4483
|
+
return new qe(t.path, r);
|
|
4483
4484
|
}, n.prototype.isEqual = function(t) {
|
|
4484
4485
|
return t instanceof n && p(this.dt, t.dt);
|
|
4485
4486
|
}, n;
|
|
4486
|
-
}(
|
|
4487
|
+
}(xn), Xn = /** @class */ function(e) {
|
|
4487
4488
|
function n(t, n) {
|
|
4488
4489
|
var r = this;
|
|
4489
4490
|
return (r = e.call(this, t) || this).ft = n, r;
|
|
4490
4491
|
}
|
|
4491
4492
|
return t(n, e), n.prototype._toFieldTransform = function(t) {
|
|
4492
|
-
var e = new
|
|
4493
|
-
return new
|
|
4493
|
+
var e = new Re(t.serializer, Fe(t.serializer, this.ft));
|
|
4494
|
+
return new qe(t.path, e);
|
|
4494
4495
|
}, n.prototype.isEqual = function(t) {
|
|
4495
4496
|
return t instanceof n && this.ft === t.ft;
|
|
4496
4497
|
}, n;
|
|
4497
|
-
}(
|
|
4498
|
+
}(xn);
|
|
4498
4499
|
|
|
4499
|
-
/** Parse update data from an update() call. */ function
|
|
4500
|
+
/** Parse update data from an update() call. */ function Zn(t, e, n, r) {
|
|
4500
4501
|
var i = t.ht(1 /* UserDataSource.Update */ , e, n);
|
|
4501
|
-
|
|
4502
|
-
var o = [], a =
|
|
4503
|
-
|
|
4504
|
-
var u =
|
|
4502
|
+
ir("Data must be an object, but it was:", i, r);
|
|
4503
|
+
var o = [], a = we.empty();
|
|
4504
|
+
At(r, (function(t, r) {
|
|
4505
|
+
var u = ur(e, t, n);
|
|
4505
4506
|
// For Compat types, we have to "extract" the underlying types before
|
|
4506
4507
|
// performing validation.
|
|
4507
4508
|
r = d(r);
|
|
4508
4509
|
var s = i.ot(u);
|
|
4509
|
-
if (r instanceof
|
|
4510
|
+
if (r instanceof Qn)
|
|
4510
4511
|
// Add it to the field mask, but don't add anything to updateData.
|
|
4511
4512
|
o.push(u); else {
|
|
4512
|
-
var c =
|
|
4513
|
+
var c = er(r, s);
|
|
4513
4514
|
null != c && (o.push(u), a.set(u, c));
|
|
4514
4515
|
}
|
|
4515
4516
|
}));
|
|
4516
4517
|
var u = new ge(o);
|
|
4517
|
-
return new
|
|
4518
|
+
return new Mn(a, u, i.fieldTransforms);
|
|
4518
4519
|
}
|
|
4519
4520
|
|
|
4520
|
-
/** Parse update data from a list of field/value arguments. */ function
|
|
4521
|
-
var a = t.ht(1 /* UserDataSource.Update */ , e, n), u = [
|
|
4522
|
-
if (o.length % 2 != 0) throw new
|
|
4523
|
-
for (var c = 0; c < o.length; c += 2) u.push(
|
|
4521
|
+
/** Parse update data from a list of field/value arguments. */ function $n(t, e, n, r, i, o) {
|
|
4522
|
+
var a = t.ht(1 /* UserDataSource.Update */ , e, n), u = [ or(e, r, n) ], s = [ i ];
|
|
4523
|
+
if (o.length % 2 != 0) throw new z(V, "Function ".concat(e, "() needs to be called with an even number of arguments that alternate between field names and values."));
|
|
4524
|
+
for (var c = 0; c < o.length; c += 2) u.push(or(e, o[c])), s.push(o[c + 1]);
|
|
4524
4525
|
// We iterate in reverse order to pick the last value for a field if the
|
|
4525
4526
|
// user specified the field multiple times.
|
|
4526
|
-
for (var l = [], f =
|
|
4527
|
+
for (var l = [], f = we.empty(), h = u.length - 1; h >= 0; --h) if (!cr(l, u[h])) {
|
|
4527
4528
|
var p = u[h], y = s[h];
|
|
4528
4529
|
// For Compat types, we have to "extract" the underlying types before
|
|
4529
4530
|
// performing validation.
|
|
4530
4531
|
y = d(y);
|
|
4531
4532
|
var m = a.ot(p);
|
|
4532
|
-
if (y instanceof
|
|
4533
|
+
if (y instanceof Qn)
|
|
4533
4534
|
// Add it to the field mask, but don't add anything to updateData.
|
|
4534
4535
|
l.push(p); else {
|
|
4535
|
-
var
|
|
4536
|
-
null !=
|
|
4536
|
+
var v = er(y, m);
|
|
4537
|
+
null != v && (l.push(p), f.set(p, v));
|
|
4537
4538
|
}
|
|
4538
4539
|
}
|
|
4539
|
-
var
|
|
4540
|
-
return new
|
|
4540
|
+
var g = new ge(l);
|
|
4541
|
+
return new Mn(f, g, a.fieldTransforms);
|
|
4541
4542
|
}
|
|
4542
4543
|
|
|
4543
4544
|
/**
|
|
@@ -4546,8 +4547,8 @@ var Yn = /** @class */ function(e) {
|
|
|
4546
4547
|
*
|
|
4547
4548
|
* @param allowArrays - Whether the query value is an array that may directly
|
|
4548
4549
|
* contain additional arrays (e.g. the operand of an `in` query).
|
|
4549
|
-
*/ function
|
|
4550
|
-
return void 0 === r && (r = !1),
|
|
4550
|
+
*/ function tr(t, e, n, r) {
|
|
4551
|
+
return void 0 === r && (r = !1), er(n, t.ht(r ? 4 /* UserDataSource.ArrayArgument */ : 3 /* UserDataSource.Argument */ , e));
|
|
4551
4552
|
}
|
|
4552
4553
|
|
|
4553
4554
|
/**
|
|
@@ -4558,12 +4559,12 @@ var Yn = /** @class */ function(e) {
|
|
|
4558
4559
|
* the source of the data being parsed, etc.
|
|
4559
4560
|
* @returns The parsed value, or null if the value was a FieldValue sentinel
|
|
4560
4561
|
* that should not be included in the resulting parsed data.
|
|
4561
|
-
*/ function
|
|
4562
|
-
if (
|
|
4562
|
+
*/ function er(t, e) {
|
|
4563
|
+
if (rr(
|
|
4563
4564
|
// Unwrap the API type from the Compat SDK. This will return the API type
|
|
4564
4565
|
// from firestore-exp.
|
|
4565
|
-
t = d(t))) return
|
|
4566
|
-
if (t instanceof
|
|
4566
|
+
t = d(t))) return ir("Unsupported field value:", e, t), nr(t, e);
|
|
4567
|
+
if (t instanceof xn)
|
|
4567
4568
|
// FieldValues usually parse into transforms (except deleteField())
|
|
4568
4569
|
// in which case we do not want to include this field in our parsed data
|
|
4569
4570
|
// (as doing so will overwrite the field directly prior to the transform
|
|
@@ -4575,7 +4576,7 @@ var Yn = /** @class */ function(e) {
|
|
|
4575
4576
|
*/
|
|
4576
4577
|
return function(t, e) {
|
|
4577
4578
|
// Sentinels are only supported with writes, and not within arrays.
|
|
4578
|
-
if (!
|
|
4579
|
+
if (!Un(e.et)) throw e._t("".concat(t._methodName, "() can only be used with update() and set()"));
|
|
4579
4580
|
if (!e.path) throw e._t("".concat(t._methodName, "() is not currently supported inside arrays"));
|
|
4580
4581
|
var n = t._toFieldTransform(e);
|
|
4581
4582
|
n && e.fieldTransforms.push(n);
|
|
@@ -4598,7 +4599,7 @@ var Yn = /** @class */ function(e) {
|
|
|
4598
4599
|
if (e.settings.it && 4 /* UserDataSource.ArrayArgument */ !== e.et) throw e._t("Nested arrays are not supported");
|
|
4599
4600
|
return function(t, e) {
|
|
4600
4601
|
for (var n = [], r = 0, i = 0, o = t; i < o.length; i++) {
|
|
4601
|
-
var a =
|
|
4602
|
+
var a = er(o[i], e.ut(r));
|
|
4602
4603
|
null == a && (
|
|
4603
4604
|
// Just include nulls in the array for fields being replaced with a
|
|
4604
4605
|
// sentinel.
|
|
@@ -4617,7 +4618,7 @@ var Yn = /** @class */ function(e) {
|
|
|
4617
4618
|
if (null === (t = d(t))) return {
|
|
4618
4619
|
nullValue: "NULL_VALUE"
|
|
4619
4620
|
};
|
|
4620
|
-
if ("number" == typeof t) return
|
|
4621
|
+
if ("number" == typeof t) return Fe(e.serializer, t);
|
|
4621
4622
|
if ("boolean" == typeof t) return {
|
|
4622
4623
|
booleanValue: t
|
|
4623
4624
|
};
|
|
@@ -4625,41 +4626,41 @@ var Yn = /** @class */ function(e) {
|
|
|
4625
4626
|
stringValue: t
|
|
4626
4627
|
};
|
|
4627
4628
|
if (t instanceof Date) {
|
|
4628
|
-
var n =
|
|
4629
|
+
var n = Rt.fromDate(t);
|
|
4629
4630
|
return {
|
|
4630
|
-
timestampValue:
|
|
4631
|
+
timestampValue: Qe(e.serializer, n)
|
|
4631
4632
|
};
|
|
4632
4633
|
}
|
|
4633
|
-
if (t instanceof
|
|
4634
|
+
if (t instanceof Rt) {
|
|
4634
4635
|
// Firestore backend truncates precision down to microseconds. To ensure
|
|
4635
4636
|
// offline mode works the same with regards to truncation, perform the
|
|
4636
4637
|
// truncation immediately without waiting for the backend to do that.
|
|
4637
|
-
var r = new
|
|
4638
|
+
var r = new Rt(t.seconds, 1e3 * Math.floor(t.nanoseconds / 1e3));
|
|
4638
4639
|
return {
|
|
4639
|
-
timestampValue:
|
|
4640
|
+
timestampValue: Qe(e.serializer, r)
|
|
4640
4641
|
};
|
|
4641
4642
|
}
|
|
4642
|
-
if (t instanceof
|
|
4643
|
+
if (t instanceof Cn) return {
|
|
4643
4644
|
geoPointValue: {
|
|
4644
4645
|
latitude: t.latitude,
|
|
4645
4646
|
longitude: t.longitude
|
|
4646
4647
|
}
|
|
4647
4648
|
};
|
|
4648
|
-
if (t instanceof
|
|
4649
|
-
bytesValue:
|
|
4649
|
+
if (t instanceof Dn) return {
|
|
4650
|
+
bytesValue: Ye(e.serializer, t._byteString)
|
|
4650
4651
|
};
|
|
4651
|
-
if (t instanceof
|
|
4652
|
+
if (t instanceof In) {
|
|
4652
4653
|
var i = e.databaseId, o = t.firestore._databaseId;
|
|
4653
4654
|
if (!o.isEqual(i)) throw e._t("Document reference is for database ".concat(o.projectId, "/").concat(o.database, " but should be for database ").concat(i.projectId, "/").concat(i.database));
|
|
4654
4655
|
return {
|
|
4655
|
-
referenceValue:
|
|
4656
|
+
referenceValue: Je(t.firestore._databaseId || e.databaseId, t._key.path)
|
|
4656
4657
|
};
|
|
4657
4658
|
}
|
|
4658
|
-
throw e._t("Unsupported field value: ".concat(
|
|
4659
|
+
throw e._t("Unsupported field value: ".concat(ct(t)));
|
|
4659
4660
|
}(t, e);
|
|
4660
4661
|
}
|
|
4661
4662
|
|
|
4662
|
-
function
|
|
4663
|
+
function nr(t, e) {
|
|
4663
4664
|
var n = {};
|
|
4664
4665
|
return function(t) {
|
|
4665
4666
|
for (var e in t) if (Object.prototype.hasOwnProperty.call(t, e)) return !1;
|
|
@@ -4667,8 +4668,8 @@ function er(t, e) {
|
|
|
4667
4668
|
}(t) ?
|
|
4668
4669
|
// If we encounter an empty object, we explicitly add it to the update
|
|
4669
4670
|
// mask to ensure that the server creates a map entry.
|
|
4670
|
-
e.path && e.path.length > 0 && e.fieldMask.push(e.path) :
|
|
4671
|
-
var i =
|
|
4671
|
+
e.path && e.path.length > 0 && e.fieldMask.push(e.path) : At(t, (function(t, r) {
|
|
4672
|
+
var i = er(r, e.nt(t));
|
|
4672
4673
|
null != i && (n[t] = i);
|
|
4673
4674
|
})), {
|
|
4674
4675
|
mapValue: {
|
|
@@ -4677,35 +4678,35 @@ function er(t, e) {
|
|
|
4677
4678
|
};
|
|
4678
4679
|
}
|
|
4679
4680
|
|
|
4680
|
-
function
|
|
4681
|
-
return !("object" != typeof t || null === t || t instanceof Array || t instanceof Date || t instanceof
|
|
4681
|
+
function rr(t) {
|
|
4682
|
+
return !("object" != typeof t || null === t || t instanceof Array || t instanceof Date || t instanceof Rt || t instanceof Cn || t instanceof Dn || t instanceof In || t instanceof xn);
|
|
4682
4683
|
}
|
|
4683
4684
|
|
|
4684
|
-
function
|
|
4685
|
-
if (!
|
|
4685
|
+
function ir(t, e, n) {
|
|
4686
|
+
if (!rr(n) || !function(t) {
|
|
4686
4687
|
return "object" == typeof t && null !== t && (Object.getPrototypeOf(t) === Object.prototype || null === Object.getPrototypeOf(t));
|
|
4687
4688
|
}(n)) {
|
|
4688
|
-
var r =
|
|
4689
|
+
var r = ct(n);
|
|
4689
4690
|
throw "an object" === r ? e._t(t + " a custom object") : e._t(t + " " + r);
|
|
4690
4691
|
}
|
|
4691
4692
|
}
|
|
4692
4693
|
|
|
4693
4694
|
/**
|
|
4694
4695
|
* Helper that calls fromDotSeparatedString() but wraps any error thrown.
|
|
4695
|
-
*/ function
|
|
4696
|
+
*/ function or(t, e, n) {
|
|
4696
4697
|
if (
|
|
4697
4698
|
// If required, replace the FieldPath Compat class with with the firestore-exp
|
|
4698
4699
|
// FieldPath.
|
|
4699
|
-
(e = d(e)) instanceof
|
|
4700
|
-
if ("string" == typeof e) return
|
|
4701
|
-
throw
|
|
4700
|
+
(e = d(e)) instanceof Rn) return e._internalPath;
|
|
4701
|
+
if ("string" == typeof e) return ur(t, e);
|
|
4702
|
+
throw sr("Field path arguments must be of type string or ", t,
|
|
4702
4703
|
/* hasConverter= */ !1,
|
|
4703
4704
|
/* path= */ void 0, n);
|
|
4704
4705
|
}
|
|
4705
4706
|
|
|
4706
4707
|
/**
|
|
4707
4708
|
* Matches any characters in a field path string that are reserved.
|
|
4708
|
-
*/ var
|
|
4709
|
+
*/ var ar = new RegExp("[~\\*/\\[\\]]");
|
|
4709
4710
|
|
|
4710
4711
|
/**
|
|
4711
4712
|
* Wraps fromDotSeparatedString with an error message about the method that
|
|
@@ -4715,29 +4716,29 @@ function rr(t, e, n) {
|
|
|
4715
4716
|
* split on dots.
|
|
4716
4717
|
* @param targetDoc - The document against which the field path will be
|
|
4717
4718
|
* evaluated.
|
|
4718
|
-
*/ function
|
|
4719
|
-
if (e.search(
|
|
4719
|
+
*/ function ur(t, e, n) {
|
|
4720
|
+
if (e.search(ar) >= 0) throw sr("Invalid field path (".concat(e, "). Paths must not contain '~', '*', '/', '[', or ']'"), t,
|
|
4720
4721
|
/* hasConverter= */ !1,
|
|
4721
4722
|
/* path= */ void 0, n);
|
|
4722
4723
|
try {
|
|
4723
|
-
return (new (
|
|
4724
|
+
return (new (Rn.bind.apply(Rn, r([ void 0 ], e.split("."), !1))))._internalPath;
|
|
4724
4725
|
} catch (r) {
|
|
4725
|
-
throw
|
|
4726
|
+
throw sr("Invalid field path (".concat(e, "). Paths must not be empty, begin with '.', end with '.', or contain '..'"), t,
|
|
4726
4727
|
/* hasConverter= */ !1,
|
|
4727
4728
|
/* path= */ void 0, n);
|
|
4728
4729
|
}
|
|
4729
4730
|
}
|
|
4730
4731
|
|
|
4731
|
-
function
|
|
4732
|
+
function sr(t, e, n, r, i) {
|
|
4732
4733
|
var o = r && !r.isEmpty(), a = void 0 !== i, u = "Function ".concat(e, "() called with invalid data");
|
|
4733
4734
|
n && (u += " (via `toFirestore()`)"), u += ". ";
|
|
4734
4735
|
var s = "";
|
|
4735
4736
|
return (o || a) && (s += " (found", o && (s += " in field ".concat(r)), a && (s += " in document ".concat(i)),
|
|
4736
|
-
s += ")"), new
|
|
4737
|
+
s += ")"), new z(V, u + t + s)
|
|
4737
4738
|
/** Checks `haystack` if FieldPath `needle` is present. Runs in O(n). */;
|
|
4738
4739
|
}
|
|
4739
4740
|
|
|
4740
|
-
function
|
|
4741
|
+
function cr(t, e) {
|
|
4741
4742
|
return t.some((function(t) {
|
|
4742
4743
|
return t.isEqual(e);
|
|
4743
4744
|
}));
|
|
@@ -4767,7 +4768,7 @@ function sr(t, e) {
|
|
|
4767
4768
|
* For a `DocumentSnapshot` that points to a non-existing document, any data
|
|
4768
4769
|
* access will return 'undefined'. You can use the `exists()` method to
|
|
4769
4770
|
* explicitly verify a document's existence.
|
|
4770
|
-
*/ var
|
|
4771
|
+
*/ var lr = /** @class */ function() {
|
|
4771
4772
|
// Note: This class is stripped down version of the DocumentSnapshot in
|
|
4772
4773
|
// the legacy SDK. The changes are:
|
|
4773
4774
|
// - No support for SnapshotMetadata.
|
|
@@ -4788,7 +4789,7 @@ function sr(t, e) {
|
|
|
4788
4789
|
* The `DocumentReference` for the document included in the `DocumentSnapshot`.
|
|
4789
4790
|
*/
|
|
4790
4791
|
get: function() {
|
|
4791
|
-
return new
|
|
4792
|
+
return new In(this._firestore, this._converter, this._key);
|
|
4792
4793
|
},
|
|
4793
4794
|
enumerable: !1,
|
|
4794
4795
|
configurable: !0
|
|
@@ -4813,7 +4814,7 @@ function sr(t, e) {
|
|
|
4813
4814
|
if (this._converter) {
|
|
4814
4815
|
// We only want to use the converter and create a new DocumentSnapshot
|
|
4815
4816
|
// if a converter has been provided.
|
|
4816
|
-
var t = new
|
|
4817
|
+
var t = new fr(this._firestore, this._userDataWriter, this._key, this._document,
|
|
4817
4818
|
/* converter= */ null);
|
|
4818
4819
|
return this._converter.fromFirestore(t);
|
|
4819
4820
|
}
|
|
@@ -4833,11 +4834,11 @@ function sr(t, e) {
|
|
|
4833
4834
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4834
4835
|
t.prototype.get = function(t) {
|
|
4835
4836
|
if (this._document) {
|
|
4836
|
-
var e = this._document.data.field(
|
|
4837
|
+
var e = this._document.data.field(dr("DocumentSnapshot.get", t));
|
|
4837
4838
|
if (null !== e) return this._userDataWriter.convertValue(e);
|
|
4838
4839
|
}
|
|
4839
4840
|
}, t;
|
|
4840
|
-
}(),
|
|
4841
|
+
}(), fr = /** @class */ function(e) {
|
|
4841
4842
|
function n() {
|
|
4842
4843
|
return null !== e && e.apply(this, arguments) || this;
|
|
4843
4844
|
}
|
|
@@ -4849,7 +4850,7 @@ function sr(t, e) {
|
|
|
4849
4850
|
*/ return t(n, e), n.prototype.data = function() {
|
|
4850
4851
|
return e.prototype.data.call(this);
|
|
4851
4852
|
}, n;
|
|
4852
|
-
}(
|
|
4853
|
+
}(lr), hr = /** @class */ function() {
|
|
4853
4854
|
/** @hideconstructor */
|
|
4854
4855
|
function t(t, e) {
|
|
4855
4856
|
this._docs = e, this.query = t;
|
|
@@ -4903,15 +4904,15 @@ function sr(t, e) {
|
|
|
4903
4904
|
* @param right - A snapshot to compare.
|
|
4904
4905
|
* @returns true if the snapshots are equal.
|
|
4905
4906
|
*/
|
|
4906
|
-
function
|
|
4907
|
-
return t = d(t), e = d(e), t instanceof
|
|
4907
|
+
function pr(t, e) {
|
|
4908
|
+
return t = d(t), e = d(e), t instanceof lr && e instanceof lr ? 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 hr && e instanceof hr && Nn(t.query, e.query) && kt(t.docs, e.docs, pr)
|
|
4908
4909
|
/**
|
|
4909
4910
|
* Helper that calls `fromDotSeparatedString()` but wraps any error thrown.
|
|
4910
4911
|
*/;
|
|
4911
4912
|
}
|
|
4912
4913
|
|
|
4913
|
-
function
|
|
4914
|
-
return "string" == typeof e ?
|
|
4914
|
+
function dr(t, e) {
|
|
4915
|
+
return "string" == typeof e ? ur(t, e) : e instanceof Rn ? e._internalPath : e._delegate._internalPath;
|
|
4915
4916
|
}
|
|
4916
4917
|
|
|
4917
4918
|
/**
|
|
@@ -4933,12 +4934,12 @@ function pr(t, e) {
|
|
|
4933
4934
|
/**
|
|
4934
4935
|
* An `AppliableConstraint` is an abstraction of a constraint that can be applied
|
|
4935
4936
|
* to a Firestore query.
|
|
4936
|
-
*/ var
|
|
4937
|
+
*/ var yr = function() {}, mr = /** @class */ function(e) {
|
|
4937
4938
|
function n() {
|
|
4938
4939
|
return null !== e && e.apply(this, arguments) || this;
|
|
4939
4940
|
}
|
|
4940
4941
|
return t(n, e), n;
|
|
4941
|
-
}(
|
|
4942
|
+
}(yr);
|
|
4942
4943
|
|
|
4943
4944
|
/**
|
|
4944
4945
|
* A `QueryConstraint` is used to narrow the set of documents returned by a
|
|
@@ -4947,16 +4948,16 @@ function pr(t, e) {
|
|
|
4947
4948
|
* (endBefore:1)}, {@link (endAt:1)}, {@link limit}, {@link limitToLast} and
|
|
4948
4949
|
* can then be passed to {@link (query:1)} to create a new query instance that
|
|
4949
4950
|
* also contains this `QueryConstraint`.
|
|
4950
|
-
*/ function
|
|
4951
|
+
*/ function vr(t, e) {
|
|
4951
4952
|
for (var n = [], r = 2; r < arguments.length; r++) n[r - 2] = arguments[r];
|
|
4952
4953
|
var i = [];
|
|
4953
|
-
e instanceof
|
|
4954
|
+
e instanceof yr && i.push(e), function(t) {
|
|
4954
4955
|
var e = t.filter((function(t) {
|
|
4955
|
-
return t instanceof
|
|
4956
|
+
return t instanceof _r;
|
|
4956
4957
|
})).length, n = t.filter((function(t) {
|
|
4957
4958
|
return t instanceof gr;
|
|
4958
4959
|
})).length;
|
|
4959
|
-
if (e > 1 || e > 0 && n > 0) throw new
|
|
4960
|
+
if (e > 1 || e > 0 && n > 0) throw new z(V, "InvalidQuery. When using composite filters, you cannot use more than one filter at the top level. Consider nesting the multiple filters within an `and(...)` statement. For example: change `query(query, where(...), or(...))` to `query(query, and(where(...), or(...)))`.");
|
|
4960
4961
|
}(i = i.concat(n));
|
|
4961
4962
|
for (var o = 0, a = i; o < a.length; o++) {
|
|
4962
4963
|
var u = a[o];
|
|
@@ -4985,32 +4986,32 @@ function pr(t, e) {
|
|
|
4985
4986
|
return new n(t, e, r);
|
|
4986
4987
|
}, n.prototype._apply = function(t) {
|
|
4987
4988
|
var e = this._parse(t);
|
|
4988
|
-
return
|
|
4989
|
+
return Cr(t._query, e), new kn(t.firestore, t.converter, Pe(t._query, e));
|
|
4989
4990
|
}, n.prototype._parse = function(t) {
|
|
4990
|
-
var e =
|
|
4991
|
+
var e = Gn(t.firestore), n = function(t, e, n, r, i, o, a) {
|
|
4991
4992
|
var u;
|
|
4992
4993
|
if (i.isKeyField()) {
|
|
4993
|
-
if ("array-contains" /* Operator.ARRAY_CONTAINS */ === o || "array-contains-any" /* Operator.ARRAY_CONTAINS_ANY */ === o) throw new
|
|
4994
|
+
if ("array-contains" /* Operator.ARRAY_CONTAINS */ === o || "array-contains-any" /* Operator.ARRAY_CONTAINS_ANY */ === o) throw new z(V, "Invalid Query. You can't perform '".concat(o, "' queries on documentId()."));
|
|
4994
4995
|
if ("in" /* Operator.IN */ === o || "not-in" /* Operator.NOT_IN */ === o) {
|
|
4995
|
-
|
|
4996
|
+
xr(a, o);
|
|
4996
4997
|
for (var s = [], c = 0, l = a; c < l.length; c++) {
|
|
4997
4998
|
var f = l[c];
|
|
4998
|
-
s.push(
|
|
4999
|
+
s.push(qr(r, t, f));
|
|
4999
5000
|
}
|
|
5000
5001
|
u = {
|
|
5001
5002
|
arrayValue: {
|
|
5002
5003
|
values: s
|
|
5003
5004
|
}
|
|
5004
5005
|
};
|
|
5005
|
-
} else u =
|
|
5006
|
-
} else "in" /* Operator.IN */ !== o && "not-in" /* Operator.NOT_IN */ !== o && "array-contains-any" /* Operator.ARRAY_CONTAINS_ANY */ !== o ||
|
|
5007
|
-
u =
|
|
5006
|
+
} else u = qr(r, t, a);
|
|
5007
|
+
} else "in" /* Operator.IN */ !== o && "not-in" /* Operator.NOT_IN */ !== o && "array-contains-any" /* Operator.ARRAY_CONTAINS_ANY */ !== o || xr(a, o),
|
|
5008
|
+
u = tr(n, e, a,
|
|
5008
5009
|
/* allowArrays= */ "in" /* Operator.IN */ === o || "not-in" /* Operator.NOT_IN */ === o);
|
|
5009
|
-
return
|
|
5010
|
+
return $t.create(i, o, u);
|
|
5010
5011
|
}(t._query, "where", e, t.firestore._databaseId, this._field, this._op, this._value);
|
|
5011
5012
|
return n;
|
|
5012
5013
|
}, n;
|
|
5013
|
-
}(
|
|
5014
|
+
}(mr);
|
|
5014
5015
|
|
|
5015
5016
|
/**
|
|
5016
5017
|
* Creates a {@link QueryFieldFilterConstraint} that enforces that documents
|
|
@@ -5022,8 +5023,8 @@ function pr(t, e) {
|
|
|
5022
5023
|
* "<=", "!=").
|
|
5023
5024
|
* @param value - The value for comparison
|
|
5024
5025
|
* @returns The created {@link QueryFieldFilterConstraint}.
|
|
5025
|
-
*/ function
|
|
5026
|
-
var r = e, i =
|
|
5026
|
+
*/ function wr(t, e, n) {
|
|
5027
|
+
var r = e, i = dr("where", t);
|
|
5027
5028
|
return gr._create(i, r, n);
|
|
5028
5029
|
}
|
|
5029
5030
|
|
|
@@ -5034,7 +5035,7 @@ function pr(t, e) {
|
|
|
5034
5035
|
* `QueryCompositeFilterConstraint`s are created by invoking {@link or} or
|
|
5035
5036
|
* {@link and} and can then be passed to {@link (query:1)} to create a new query
|
|
5036
5037
|
* instance that also contains the `QueryCompositeFilterConstraint`.
|
|
5037
|
-
*/ var
|
|
5038
|
+
*/ var _r = /** @class */ function(e) {
|
|
5038
5039
|
/**
|
|
5039
5040
|
* @internal
|
|
5040
5041
|
*/
|
|
@@ -5052,21 +5053,21 @@ function pr(t, e) {
|
|
|
5052
5053
|
})).filter((function(t) {
|
|
5053
5054
|
return t.getFilters().length > 0;
|
|
5054
5055
|
}));
|
|
5055
|
-
return 1 === e.length ? e[0] :
|
|
5056
|
+
return 1 === e.length ? e[0] : te.create(e, this._getOperator());
|
|
5056
5057
|
}, n.prototype._apply = function(t) {
|
|
5057
5058
|
var e = this._parse(t);
|
|
5058
5059
|
return 0 === e.getFilters().length ? t : (function(t, e) {
|
|
5059
5060
|
for (var n = t, r = 0, i = e.getFlattenedFilters(); r < i.length; r++) {
|
|
5060
5061
|
var o = i[r];
|
|
5061
|
-
|
|
5062
|
+
Cr(n, o), n = Pe(n, o);
|
|
5062
5063
|
}
|
|
5063
|
-
}(t._query, e), new
|
|
5064
|
+
}(t._query, e), new kn(t.firestore, t.converter, Pe(t._query, e)));
|
|
5064
5065
|
}, n.prototype._getQueryConstraints = function() {
|
|
5065
5066
|
return this._queryConstraints;
|
|
5066
5067
|
}, n.prototype._getOperator = function() {
|
|
5067
5068
|
return "and" === this.type ? "and" /* CompositeOperator.AND */ : "or" /* CompositeOperator.OR */;
|
|
5068
5069
|
}, n;
|
|
5069
|
-
}(
|
|
5070
|
+
}(yr);
|
|
5070
5071
|
|
|
5071
5072
|
/**
|
|
5072
5073
|
* Creates a new {@link QueryCompositeFilterConstraint} that is a disjunction of
|
|
@@ -5077,12 +5078,12 @@ function pr(t, e) {
|
|
|
5077
5078
|
* {@link QueryFilterConstraint}s to perform a disjunction for. These must be
|
|
5078
5079
|
* created with calls to {@link where}, {@link or}, or {@link and}.
|
|
5079
5080
|
* @returns The newly created {@link QueryCompositeFilterConstraint}.
|
|
5080
|
-
*/ function
|
|
5081
|
+
*/ function br() {
|
|
5081
5082
|
for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
|
|
5082
5083
|
// Only support QueryFilterConstraints
|
|
5083
5084
|
return t.forEach((function(t) {
|
|
5084
|
-
return
|
|
5085
|
-
})),
|
|
5085
|
+
return jr("or", t);
|
|
5086
|
+
})), _r._create("or" /* CompositeOperator.OR */ , t)
|
|
5086
5087
|
/**
|
|
5087
5088
|
* Creates a new {@link QueryCompositeFilterConstraint} that is a conjunction of
|
|
5088
5089
|
* the given filter constraints. A conjunction filter includes a document if it
|
|
@@ -5095,12 +5096,12 @@ function pr(t, e) {
|
|
|
5095
5096
|
*/;
|
|
5096
5097
|
}
|
|
5097
5098
|
|
|
5098
|
-
function
|
|
5099
|
+
function Tr() {
|
|
5099
5100
|
for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
|
|
5100
5101
|
// Only support QueryFilterConstraints
|
|
5101
5102
|
return t.forEach((function(t) {
|
|
5102
|
-
return
|
|
5103
|
-
})),
|
|
5103
|
+
return jr("and", t);
|
|
5104
|
+
})), _r._create("and" /* CompositeOperator.AND */ , t)
|
|
5104
5105
|
/**
|
|
5105
5106
|
* A `QueryOrderByConstraint` is used to sort the set of documents returned by a
|
|
5106
5107
|
* Firestore query. `QueryOrderByConstraint`s are created by invoking
|
|
@@ -5112,7 +5113,7 @@ function br() {
|
|
|
5112
5113
|
*/;
|
|
5113
5114
|
}
|
|
5114
5115
|
|
|
5115
|
-
var
|
|
5116
|
+
var Er = /** @class */ function(e) {
|
|
5116
5117
|
/**
|
|
5117
5118
|
* @internal
|
|
5118
5119
|
*/
|
|
@@ -5126,17 +5127,17 @@ var Tr = /** @class */ function(e) {
|
|
|
5126
5127
|
return new n(t, e);
|
|
5127
5128
|
}, n.prototype._apply = function(t) {
|
|
5128
5129
|
var e = function(t, e, n) {
|
|
5129
|
-
if (null !== t.startAt) throw new
|
|
5130
|
-
if (null !== t.endAt) throw new
|
|
5131
|
-
return new
|
|
5130
|
+
if (null !== t.startAt) throw new z(V, "Invalid query. You must not call startAt() or startAfter() before calling orderBy().");
|
|
5131
|
+
if (null !== t.endAt) throw new z(V, "Invalid query. You must not call endAt() or endBefore() before calling orderBy().");
|
|
5132
|
+
return new le(e, n);
|
|
5132
5133
|
}(t._query, this._field, this._direction);
|
|
5133
|
-
return new
|
|
5134
|
+
return new kn(t.firestore, t.converter, function(t, e) {
|
|
5134
5135
|
// TODO(dimond): validate that orderBy does not list the same key twice.
|
|
5135
5136
|
var n = t.explicitOrderBy.concat([ e ]);
|
|
5136
|
-
return new
|
|
5137
|
+
return new Ee(t.path, t.collectionGroup, n, t.filters.slice(), t.limit, t.limitType, t.startAt, t.endAt);
|
|
5137
5138
|
}(t._query, e));
|
|
5138
5139
|
}, n;
|
|
5139
|
-
}(
|
|
5140
|
+
}(mr);
|
|
5140
5141
|
|
|
5141
5142
|
/**
|
|
5142
5143
|
* Creates a {@link QueryOrderByConstraint} that sorts the query result by the
|
|
@@ -5149,10 +5150,10 @@ var Tr = /** @class */ function(e) {
|
|
|
5149
5150
|
* @param directionStr - Optional direction to sort by ('asc' or 'desc'). If
|
|
5150
5151
|
* not specified, order will be ascending.
|
|
5151
5152
|
* @returns The created {@link QueryOrderByConstraint}.
|
|
5152
|
-
*/ function
|
|
5153
|
+
*/ function Sr(t, e) {
|
|
5153
5154
|
void 0 === e && (e = "asc");
|
|
5154
|
-
var n = e, r =
|
|
5155
|
-
return
|
|
5155
|
+
var n = e, r = dr("orderBy", t);
|
|
5156
|
+
return Er._create(r, n);
|
|
5156
5157
|
}
|
|
5157
5158
|
|
|
5158
5159
|
/**
|
|
@@ -5161,7 +5162,7 @@ var Tr = /** @class */ function(e) {
|
|
|
5161
5162
|
* `QueryLimitConstraint`s are created by invoking {@link limit} or
|
|
5162
5163
|
* {@link limitToLast} and can then be passed to {@link (query:1)} to create a new
|
|
5163
5164
|
* query instance that also contains this `QueryLimitConstraint`.
|
|
5164
|
-
*/ var
|
|
5165
|
+
*/ var kr = /** @class */ function(e) {
|
|
5165
5166
|
/**
|
|
5166
5167
|
* @internal
|
|
5167
5168
|
*/
|
|
@@ -5174,11 +5175,11 @@ var Tr = /** @class */ function(e) {
|
|
|
5174
5175
|
return t(n, e), n._create = function(t, e, r) {
|
|
5175
5176
|
return new n(t, e, r);
|
|
5176
5177
|
}, n.prototype._apply = function(t) {
|
|
5177
|
-
return new
|
|
5178
|
-
return new
|
|
5178
|
+
return new kn(t.firestore, t.converter, function(t, e, n) {
|
|
5179
|
+
return new Ee(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), e, n, t.startAt, t.endAt);
|
|
5179
5180
|
}(t._query, this._limit, this._limitType));
|
|
5180
5181
|
}, n;
|
|
5181
|
-
}(
|
|
5182
|
+
}(mr);
|
|
5182
5183
|
|
|
5183
5184
|
/**
|
|
5184
5185
|
* Creates a {@link QueryLimitConstraint} that only returns the first matching
|
|
@@ -5186,8 +5187,8 @@ var Tr = /** @class */ function(e) {
|
|
|
5186
5187
|
*
|
|
5187
5188
|
* @param limit - The maximum number of items to return.
|
|
5188
5189
|
* @returns The created {@link QueryLimitConstraint}.
|
|
5189
|
-
*/ function
|
|
5190
|
-
return
|
|
5190
|
+
*/ function Ir(t) {
|
|
5191
|
+
return ft("limit", t), kr._create("limit", t, "F" /* LimitType.First */)
|
|
5191
5192
|
/**
|
|
5192
5193
|
* Creates a {@link QueryLimitConstraint} that only returns the last matching
|
|
5193
5194
|
* documents.
|
|
@@ -5200,8 +5201,8 @@ var Tr = /** @class */ function(e) {
|
|
|
5200
5201
|
*/;
|
|
5201
5202
|
}
|
|
5202
5203
|
|
|
5203
|
-
function
|
|
5204
|
-
return
|
|
5204
|
+
function Ar(t) {
|
|
5205
|
+
return ft("limitToLast", t), kr._create("limitToLast", t, "L" /* LimitType.Last */)
|
|
5205
5206
|
/**
|
|
5206
5207
|
* A `QueryStartAtConstraint` is used to exclude documents from the start of a
|
|
5207
5208
|
* result set returned by a Firestore query.
|
|
@@ -5211,7 +5212,7 @@ function Ir(t) {
|
|
|
5211
5212
|
*/;
|
|
5212
5213
|
}
|
|
5213
5214
|
|
|
5214
|
-
var
|
|
5215
|
+
var Pr = /** @class */ function(e) {
|
|
5215
5216
|
/**
|
|
5216
5217
|
* @internal
|
|
5217
5218
|
*/
|
|
@@ -5225,22 +5226,22 @@ var Ar = /** @class */ function(e) {
|
|
|
5225
5226
|
return t(n, e), n._create = function(t, e, r) {
|
|
5226
5227
|
return new n(t, e, r);
|
|
5227
5228
|
}, n.prototype._apply = function(t) {
|
|
5228
|
-
var e =
|
|
5229
|
-
return new
|
|
5230
|
-
return new
|
|
5229
|
+
var e = Rr(t, this.type, this._docOrFields, this._inclusive);
|
|
5230
|
+
return new kn(t.firestore, t.converter, function(t, e) {
|
|
5231
|
+
return new Ee(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), t.limit, t.limitType, e, t.endAt);
|
|
5231
5232
|
}(t._query, e));
|
|
5232
5233
|
}, n;
|
|
5233
|
-
}(
|
|
5234
|
+
}(mr);
|
|
5234
5235
|
|
|
5235
|
-
function
|
|
5236
|
+
function Fr() {
|
|
5236
5237
|
for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
|
|
5237
|
-
return
|
|
5238
|
+
return Pr._create("startAt", t,
|
|
5238
5239
|
/*inclusive=*/ !0);
|
|
5239
5240
|
}
|
|
5240
5241
|
|
|
5241
|
-
function
|
|
5242
|
+
function Or() {
|
|
5242
5243
|
for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
|
|
5243
|
-
return
|
|
5244
|
+
return Pr._create("startAfter", t,
|
|
5244
5245
|
/*inclusive=*/ !1);
|
|
5245
5246
|
}
|
|
5246
5247
|
|
|
@@ -5250,7 +5251,7 @@ function Fr() {
|
|
|
5250
5251
|
* `QueryEndAtConstraint`s are created by invoking {@link (endAt:1)} or
|
|
5251
5252
|
* {@link (endBefore:1)} and can then be passed to {@link (query:1)} to create a new
|
|
5252
5253
|
* query instance that also contains this `QueryEndAtConstraint`.
|
|
5253
|
-
*/ var
|
|
5254
|
+
*/ var Vr = /** @class */ function(e) {
|
|
5254
5255
|
/**
|
|
5255
5256
|
* @internal
|
|
5256
5257
|
*/
|
|
@@ -5264,28 +5265,28 @@ function Fr() {
|
|
|
5264
5265
|
return t(n, e), n._create = function(t, e, r) {
|
|
5265
5266
|
return new n(t, e, r);
|
|
5266
5267
|
}, n.prototype._apply = function(t) {
|
|
5267
|
-
var e =
|
|
5268
|
-
return new
|
|
5269
|
-
return new
|
|
5268
|
+
var e = Rr(t, this.type, this._docOrFields, this._inclusive);
|
|
5269
|
+
return new kn(t.firestore, t.converter, function(t, e) {
|
|
5270
|
+
return new Ee(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), t.limit, t.limitType, t.startAt, e);
|
|
5270
5271
|
}(t._query, e));
|
|
5271
5272
|
}, n;
|
|
5272
|
-
}(
|
|
5273
|
+
}(mr);
|
|
5273
5274
|
|
|
5274
|
-
function
|
|
5275
|
+
function Nr() {
|
|
5275
5276
|
for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
|
|
5276
|
-
return
|
|
5277
|
+
return Vr._create("endBefore", t,
|
|
5277
5278
|
/*inclusive=*/ !1);
|
|
5278
5279
|
}
|
|
5279
5280
|
|
|
5280
|
-
function
|
|
5281
|
+
function Dr() {
|
|
5281
5282
|
for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
|
|
5282
|
-
return
|
|
5283
|
+
return Vr._create("endAt", t,
|
|
5283
5284
|
/*inclusive=*/ !0);
|
|
5284
5285
|
}
|
|
5285
5286
|
|
|
5286
|
-
/** Helper function to create a bound from a document or fields */ function
|
|
5287
|
-
if (n[0] = d(n[0]), n[0] instanceof
|
|
5288
|
-
if (!r) throw new
|
|
5287
|
+
/** Helper function to create a bound from a document or fields */ function Rr(t, e, n, r) {
|
|
5288
|
+
if (n[0] = d(n[0]), n[0] instanceof lr) return function(t, e, n, r, i) {
|
|
5289
|
+
if (!r) throw new z(D, "Can't use a DocumentSnapshot that doesn't exist for ".concat(n, "()."));
|
|
5289
5290
|
// Because people expect to continue/end a query at the exact document
|
|
5290
5291
|
// provided, we need to use the implicit sort order rather than the explicit
|
|
5291
5292
|
// sort order, because it's guaranteed to contain the document key. That way
|
|
@@ -5293,60 +5294,60 @@ function Nr() {
|
|
|
5293
5294
|
// the provided document. Without the key (by using the explicit sort
|
|
5294
5295
|
// orders), multiple documents could match the position, yielding duplicate
|
|
5295
5296
|
// results.
|
|
5296
|
-
for (var o = [], a = 0, u =
|
|
5297
|
+
for (var o = [], a = 0, u = ke(t); a < u.length; a++) {
|
|
5297
5298
|
var s = u[a];
|
|
5298
|
-
if (s.field.isKeyField()) o.push(
|
|
5299
|
+
if (s.field.isKeyField()) o.push(Gt(e, r.key)); else {
|
|
5299
5300
|
var c = r.data.field(s.field);
|
|
5300
|
-
if (
|
|
5301
|
+
if (qt(c)) throw new z(V, 'Invalid query. You are trying to start or end a query using a document for which the field "' + s.field + '" is an uncommitted server timestamp. (Since the value of this field is unknown, you cannot start/end a query with it.)');
|
|
5301
5302
|
if (null === c) {
|
|
5302
5303
|
var l = s.field.canonicalString();
|
|
5303
|
-
throw new
|
|
5304
|
+
throw new z(V, "Invalid query. You are trying to start or end a query using a document for which the field '".concat(l, "' (used as the orderBy) does not exist."));
|
|
5304
5305
|
}
|
|
5305
5306
|
o.push(c);
|
|
5306
5307
|
}
|
|
5307
5308
|
}
|
|
5308
|
-
return new
|
|
5309
|
+
return new Jt(o, i);
|
|
5309
5310
|
}(t._query, t.firestore._databaseId, e, n[0]._document, r);
|
|
5310
|
-
var i =
|
|
5311
|
+
var i = Gn(t.firestore);
|
|
5311
5312
|
return function(t, e, n, r, i, o) {
|
|
5312
5313
|
// Use explicit order by's because it has to match the query the user made
|
|
5313
5314
|
var a = t.explicitOrderBy;
|
|
5314
|
-
if (i.length > a.length) throw new
|
|
5315
|
+
if (i.length > a.length) throw new z(V, "Too many arguments provided to ".concat(r, "(). The number of arguments must be less than or equal to the number of orderBy() clauses"));
|
|
5315
5316
|
for (var u = [], s = 0; s < i.length; s++) {
|
|
5316
5317
|
var c = i[s];
|
|
5317
5318
|
if (a[s].field.isKeyField()) {
|
|
5318
|
-
if ("string" != typeof c) throw new
|
|
5319
|
-
if (!
|
|
5320
|
-
var l = t.path.child(
|
|
5321
|
-
if (!
|
|
5322
|
-
var f = new
|
|
5323
|
-
u.push(
|
|
5319
|
+
if ("string" != typeof c) throw new z(V, "Invalid query. Expected a string for document ID in ".concat(r, "(), but got a ").concat(typeof c));
|
|
5320
|
+
if (!Se(t) && -1 !== c.indexOf("/")) throw new z(V, "Invalid query. When querying a collection and ordering by documentId(), the value passed to ".concat(r, "() must be a plain document ID, but '").concat(c, "' contains a slash."));
|
|
5321
|
+
var l = t.path.child(nt.fromString(c));
|
|
5322
|
+
if (!ot.isDocumentKey(l)) throw new z(V, "Invalid query. When querying a collection group and ordering by documentId(), the value passed to ".concat(r, "() must result in a valid document path, but '").concat(l, "' is not because it contains an odd number of segments."));
|
|
5323
|
+
var f = new ot(l);
|
|
5324
|
+
u.push(Gt(e, f));
|
|
5324
5325
|
} else {
|
|
5325
|
-
var h =
|
|
5326
|
+
var h = tr(n, r, c);
|
|
5326
5327
|
u.push(h);
|
|
5327
5328
|
}
|
|
5328
5329
|
}
|
|
5329
|
-
return new
|
|
5330
|
+
return new Jt(u, o);
|
|
5330
5331
|
}(t._query, t.firestore._databaseId, i, e, n, r);
|
|
5331
5332
|
}
|
|
5332
5333
|
|
|
5333
|
-
function
|
|
5334
|
+
function qr(t, e, n) {
|
|
5334
5335
|
if ("string" == typeof (n = d(n))) {
|
|
5335
|
-
if ("" === n) throw new
|
|
5336
|
-
if (!
|
|
5337
|
-
var r = e.path.child(
|
|
5338
|
-
if (!
|
|
5339
|
-
return
|
|
5336
|
+
if ("" === n) throw new z(V, "Invalid query. When querying with documentId(), you must provide a valid document ID, but it was an empty string.");
|
|
5337
|
+
if (!Se(e) && -1 !== n.indexOf("/")) throw new z(V, "Invalid query. When querying a collection by documentId(), you must provide a plain document ID, but '".concat(n, "' contains a '/' character."));
|
|
5338
|
+
var r = e.path.child(nt.fromString(n));
|
|
5339
|
+
if (!ot.isDocumentKey(r)) throw new z(V, "Invalid query. When querying a collection group by documentId(), the value provided must result in a valid document path, but '".concat(r, "' is not because it has an odd number of segments (").concat(r.length, ")."));
|
|
5340
|
+
return Gt(t, new ot(r));
|
|
5340
5341
|
}
|
|
5341
|
-
if (n instanceof
|
|
5342
|
-
throw new
|
|
5342
|
+
if (n instanceof In) return Gt(t, n._key);
|
|
5343
|
+
throw new z(V, "Invalid query. When querying with documentId(), you must provide a valid string or a DocumentReference, but it was: ".concat(ct(n), "."));
|
|
5343
5344
|
}
|
|
5344
5345
|
|
|
5345
5346
|
/**
|
|
5346
5347
|
* Validates that the value passed into a disjunctive filter satisfies all
|
|
5347
5348
|
* array requirements.
|
|
5348
|
-
*/ function
|
|
5349
|
-
if (!Array.isArray(t) || 0 === t.length) throw new
|
|
5349
|
+
*/ function xr(t, e) {
|
|
5350
|
+
if (!Array.isArray(t) || 0 === t.length) throw new z(V, "Invalid Query. A non-empty array is required for '".concat(e.toString(), "' filters."));
|
|
5350
5351
|
}
|
|
5351
5352
|
|
|
5352
5353
|
/**
|
|
@@ -5358,7 +5359,7 @@ function Rr(t, e, n) {
|
|
|
5358
5359
|
* Operators in a query must adhere to the following set of rules:
|
|
5359
5360
|
* 1. Only one inequality per query.
|
|
5360
5361
|
* 2. `NOT_IN` cannot be used with array, disjunctive, or `NOT_EQUAL` operators.
|
|
5361
|
-
*/ function
|
|
5362
|
+
*/ function Cr(t, e) {
|
|
5362
5363
|
var n = function(t, e) {
|
|
5363
5364
|
for (var n = 0, r = t; n < r.length; n++) for (var i = 0, o = r[n].getFlattenedFilters(); i < o.length; i++) {
|
|
5364
5365
|
var a = o[i];
|
|
@@ -5383,11 +5384,11 @@ function Rr(t, e, n) {
|
|
|
5383
5384
|
}(e.op));
|
|
5384
5385
|
if (null !== n)
|
|
5385
5386
|
// Special case when it's a duplicate op to give a slightly clearer error message.
|
|
5386
|
-
throw n === e.op ? new
|
|
5387
|
+
throw n === e.op ? new z(V, "Invalid query. You cannot use more than one '".concat(e.op.toString(), "' filter.")) : new z(V, "Invalid query. You cannot use '".concat(e.op.toString(), "' filters with '").concat(n.toString(), "' filters."));
|
|
5387
5388
|
}
|
|
5388
5389
|
|
|
5389
|
-
function
|
|
5390
|
-
if (!(e instanceof gr || e instanceof
|
|
5390
|
+
function jr(t, e) {
|
|
5391
|
+
if (!(e instanceof gr || e instanceof _r)) throw new z(V, "Function ".concat(t, "() requires AppliableConstraints created with a call to 'where(...)', 'or(...)', or 'and(...)'."));
|
|
5391
5392
|
}
|
|
5392
5393
|
|
|
5393
5394
|
/**
|
|
@@ -5414,28 +5415,28 @@ function Cr(t, e) {
|
|
|
5414
5415
|
* because we want to provide the user with a more specific error message if
|
|
5415
5416
|
* their `set()` or fails due to invalid data originating from a `toFirestore()`
|
|
5416
5417
|
* call.
|
|
5417
|
-
*/ function
|
|
5418
|
+
*/ function Lr(t, e, n) {
|
|
5418
5419
|
// Cast to `any` in order to satisfy the union type constraint on
|
|
5419
5420
|
// toFirestore().
|
|
5420
5421
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5421
5422
|
return t ? n && (n.merge || n.mergeFields) ? t.toFirestore(e, n) : t.toFirestore(e) : e;
|
|
5422
5423
|
}
|
|
5423
5424
|
|
|
5424
|
-
var
|
|
5425
|
+
var Mr = /** @class */ function(e) {
|
|
5425
5426
|
function n(t) {
|
|
5426
5427
|
var n = this;
|
|
5427
5428
|
return (n = e.call(this) || this).firestore = t, n;
|
|
5428
5429
|
}
|
|
5429
5430
|
return t(n, e), n.prototype.convertBytes = function(t) {
|
|
5430
|
-
return new
|
|
5431
|
+
return new Dn(t);
|
|
5431
5432
|
}, n.prototype.convertReference = function(t) {
|
|
5432
5433
|
var e = this.convertDocumentKey(t, this.firestore._databaseId);
|
|
5433
|
-
return new
|
|
5434
|
+
return new In(this.firestore, /* converter= */ null, e);
|
|
5434
5435
|
}, n;
|
|
5435
5436
|
}(/** @class */ function() {
|
|
5436
5437
|
function t() {}
|
|
5437
5438
|
return t.prototype.convertValue = function(t, e) {
|
|
5438
|
-
switch (void 0 === e && (e = "none"),
|
|
5439
|
+
switch (void 0 === e && (e = "none"), Lt(t)) {
|
|
5439
5440
|
case 0 /* TypeOrder.NullValue */ :
|
|
5440
5441
|
return null;
|
|
5441
5442
|
|
|
@@ -5443,7 +5444,7 @@ var Lr = /** @class */ function(e) {
|
|
|
5443
5444
|
return t.booleanValue;
|
|
5444
5445
|
|
|
5445
5446
|
case 2 /* TypeOrder.NumberValue */ :
|
|
5446
|
-
return
|
|
5447
|
+
return Nt(t.integerValue || t.doubleValue);
|
|
5447
5448
|
|
|
5448
5449
|
case 3 /* TypeOrder.TimestampValue */ :
|
|
5449
5450
|
return this.convertTimestamp(t.timestampValue);
|
|
@@ -5455,7 +5456,7 @@ var Lr = /** @class */ function(e) {
|
|
|
5455
5456
|
return t.stringValue;
|
|
5456
5457
|
|
|
5457
5458
|
case 6 /* TypeOrder.BlobValue */ :
|
|
5458
|
-
return this.convertBytes(
|
|
5459
|
+
return this.convertBytes(Dt(t.bytesValue));
|
|
5459
5460
|
|
|
5460
5461
|
case 7 /* TypeOrder.RefValue */ :
|
|
5461
5462
|
return this.convertReference(t.referenceValue);
|
|
@@ -5470,7 +5471,7 @@ var Lr = /** @class */ function(e) {
|
|
|
5470
5471
|
return this.convertObject(t.mapValue, e);
|
|
5471
5472
|
|
|
5472
5473
|
default:
|
|
5473
|
-
throw
|
|
5474
|
+
throw I();
|
|
5474
5475
|
}
|
|
5475
5476
|
}, t.prototype.convertObject = function(t, e) {
|
|
5476
5477
|
return this.convertObjectMap(t.fields, e);
|
|
@@ -5482,11 +5483,11 @@ var Lr = /** @class */ function(e) {
|
|
|
5482
5483
|
var n = this;
|
|
5483
5484
|
void 0 === e && (e = "none");
|
|
5484
5485
|
var r = {};
|
|
5485
|
-
return
|
|
5486
|
+
return At(t, (function(t, i) {
|
|
5486
5487
|
r[t] = n.convertValue(i, e);
|
|
5487
5488
|
})), r;
|
|
5488
5489
|
}, t.prototype.convertGeoPoint = function(t) {
|
|
5489
|
-
return new
|
|
5490
|
+
return new Cn(Nt(t.latitude), Nt(t.longitude));
|
|
5490
5491
|
}, t.prototype.convertArray = function(t, e) {
|
|
5491
5492
|
var n = this;
|
|
5492
5493
|
return (t.values || []).map((function(t) {
|
|
@@ -5495,25 +5496,25 @@ var Lr = /** @class */ function(e) {
|
|
|
5495
5496
|
}, t.prototype.convertServerTimestamp = function(t, e) {
|
|
5496
5497
|
switch (e) {
|
|
5497
5498
|
case "previous":
|
|
5498
|
-
var n =
|
|
5499
|
+
var n = xt(t);
|
|
5499
5500
|
return null == n ? null : this.convertValue(n, e);
|
|
5500
5501
|
|
|
5501
5502
|
case "estimate":
|
|
5502
|
-
return this.convertTimestamp(
|
|
5503
|
+
return this.convertTimestamp(Ct(t));
|
|
5503
5504
|
|
|
5504
5505
|
default:
|
|
5505
5506
|
return null;
|
|
5506
5507
|
}
|
|
5507
5508
|
}, t.prototype.convertTimestamp = function(t) {
|
|
5508
|
-
var e =
|
|
5509
|
-
return new
|
|
5509
|
+
var e = Vt(t);
|
|
5510
|
+
return new Rt(e.seconds, e.nanos);
|
|
5510
5511
|
}, t.prototype.convertDocumentKey = function(t, e) {
|
|
5511
|
-
var n =
|
|
5512
|
-
|
|
5513
|
-
var r = new
|
|
5512
|
+
var n = nt.fromString(t);
|
|
5513
|
+
A(cn(n));
|
|
5514
|
+
var r = new tt(n.get(1), n.get(3)), i = new ot(n.popFirst(5));
|
|
5514
5515
|
return r.isEqual(e) ||
|
|
5515
5516
|
// TODO(b/64130202): Somehow support foreign references.
|
|
5516
|
-
|
|
5517
|
+
E("Document ".concat(i, " contains a document reference within a different database (").concat(r.projectId, "/").concat(r.database, ") which is not supported. It will be treated as a reference in the current database (").concat(e.projectId, "/").concat(e.database, ") instead.")),
|
|
5517
5518
|
i;
|
|
5518
5519
|
}, t;
|
|
5519
5520
|
}());
|
|
@@ -5530,12 +5531,12 @@ var Lr = /** @class */ function(e) {
|
|
|
5530
5531
|
* @param reference - The reference of the document to fetch.
|
|
5531
5532
|
* @returns A Promise resolved with a `DocumentSnapshot` containing the current
|
|
5532
5533
|
* document contents.
|
|
5533
|
-
*/ function
|
|
5534
|
-
var e =
|
|
5535
|
-
return
|
|
5536
|
-
|
|
5534
|
+
*/ function Ur(t) {
|
|
5535
|
+
var e = mn((t = lt(t, In)).firestore), n = new Mr(t.firestore);
|
|
5536
|
+
return dn(e, [ t._key ]).then((function(e) {
|
|
5537
|
+
A(1 === e.length);
|
|
5537
5538
|
var r = e[0];
|
|
5538
|
-
return new
|
|
5539
|
+
return new lr(t.firestore, n, t._key, r.isFoundDocument() ? r : null, t.converter);
|
|
5539
5540
|
}));
|
|
5540
5541
|
}
|
|
5541
5542
|
|
|
@@ -5550,18 +5551,18 @@ var Lr = /** @class */ function(e) {
|
|
|
5550
5551
|
*
|
|
5551
5552
|
* @param query - The `Query` to execute.
|
|
5552
5553
|
* @returns A Promise that will be resolved with the results of the query.
|
|
5553
|
-
*/ function
|
|
5554
|
+
*/ function Br(t) {
|
|
5554
5555
|
!function(t) {
|
|
5555
|
-
if ("L" /* LimitType.Last */ === t.limitType && 0 === t.explicitOrderBy.length) throw new
|
|
5556
|
-
}((t =
|
|
5557
|
-
var r =
|
|
5556
|
+
if ("L" /* LimitType.Last */ === t.limitType && 0 === t.explicitOrderBy.length) throw new z(M, "limitToLast() queries require specifying at least one orderBy() clause");
|
|
5557
|
+
}((t = lt(t, kn))._query);
|
|
5558
|
+
var r = mn(t.firestore), i = new Mr(t.firestore);
|
|
5558
5559
|
return function(t, r) {
|
|
5559
5560
|
return e(this, void 0, void 0, (function() {
|
|
5560
5561
|
var e, i, o, a;
|
|
5561
5562
|
return n(this, (function(n) {
|
|
5562
5563
|
switch (n.label) {
|
|
5563
5564
|
case 0:
|
|
5564
|
-
return e =
|
|
5565
|
+
return e = P(t), i = en(e.serializer, Ie(r)), o = i.B, a = i.parent, [ 4 /*yield*/ , e.g("RunQuery", e.serializer.databaseId, a, {
|
|
5565
5566
|
structuredQuery: o.structuredQuery
|
|
5566
5567
|
}) ];
|
|
5567
5568
|
|
|
@@ -5570,11 +5571,11 @@ var Lr = /** @class */ function(e) {
|
|
|
5570
5571
|
return !!t.document;
|
|
5571
5572
|
})).map((function(t) {
|
|
5572
5573
|
return function(t, e, n) {
|
|
5573
|
-
var r =
|
|
5574
|
+
var r = $e(t, e.name), i = We(e.updateTime), o = e.createTime ? We(e.createTime) : he.min(), a = new we({
|
|
5574
5575
|
mapValue: {
|
|
5575
5576
|
fields: e.fields
|
|
5576
5577
|
}
|
|
5577
|
-
}), u =
|
|
5578
|
+
}), u = _e.newFoundDocument(r, i, o, a);
|
|
5578
5579
|
return n && u.setHasCommittedMutations(), n ? u.setHasCommittedMutations() : u;
|
|
5579
5580
|
}(e.serializer, t.document, void 0);
|
|
5580
5581
|
})) ];
|
|
@@ -5583,28 +5584,28 @@ var Lr = /** @class */ function(e) {
|
|
|
5583
5584
|
}));
|
|
5584
5585
|
}(r, t._query).then((function(e) {
|
|
5585
5586
|
var n = e.map((function(e) {
|
|
5586
|
-
return new
|
|
5587
|
+
return new fr(t.firestore, i, e.key, e, t.converter);
|
|
5587
5588
|
}));
|
|
5588
5589
|
return "L" /* LimitType.Last */ === t._query.limitType &&
|
|
5589
5590
|
// Limit to last queries reverse the orderBy constraint that was
|
|
5590
5591
|
// specified by the user. As such, we need to reverse the order of the
|
|
5591
5592
|
// results to return the documents in the expected order.
|
|
5592
|
-
n.reverse(), new
|
|
5593
|
+
n.reverse(), new hr(t, n);
|
|
5593
5594
|
}));
|
|
5594
5595
|
}
|
|
5595
5596
|
|
|
5596
|
-
function
|
|
5597
|
-
var r =
|
|
5598
|
-
return
|
|
5597
|
+
function zr(t, e, n) {
|
|
5598
|
+
var r = Lr((t = lt(t, In)).converter, e, n), i = Kn(Gn(t.firestore), "setDoc", t._key, r, null !== t.converter, n);
|
|
5599
|
+
return pn(mn(t.firestore), [ i.toMutation(t._key, xe.none()) ]);
|
|
5599
5600
|
}
|
|
5600
5601
|
|
|
5601
|
-
function
|
|
5602
|
+
function Gr(t, e, n) {
|
|
5602
5603
|
for (var r = [], i = 3; i < arguments.length; i++) r[i - 3] = arguments[i];
|
|
5603
|
-
var o, a =
|
|
5604
|
+
var o, a = Gn((t = lt(t, In)).firestore);
|
|
5604
5605
|
// For Compat types, we have to "extract" the underlying types before
|
|
5605
5606
|
// performing validation.
|
|
5606
|
-
return o = "string" == typeof (e = d(e)) || e instanceof
|
|
5607
|
-
|
|
5607
|
+
return o = "string" == typeof (e = d(e)) || e instanceof Rn ? $n(a, "updateDoc", t._key, e, n, r) : Zn(a, "updateDoc", t._key, e),
|
|
5608
|
+
pn(mn(t.firestore), [ o.toMutation(t._key, xe.exists(!0)) ]);
|
|
5608
5609
|
}
|
|
5609
5610
|
|
|
5610
5611
|
/**
|
|
@@ -5618,8 +5619,8 @@ function zr(t, e, n) {
|
|
|
5618
5619
|
* @param reference - A reference to the document to delete.
|
|
5619
5620
|
* @returns A `Promise` resolved once the document has been successfully
|
|
5620
5621
|
* deleted from the backend.
|
|
5621
|
-
*/ function
|
|
5622
|
-
return
|
|
5622
|
+
*/ function Kr(t) {
|
|
5623
|
+
return pn(mn((t = lt(t, In)).firestore), [ new Me(t._key, xe.none()) ]);
|
|
5623
5624
|
}
|
|
5624
5625
|
|
|
5625
5626
|
/**
|
|
@@ -5636,9 +5637,9 @@ function zr(t, e, n) {
|
|
|
5636
5637
|
* @throws Error - If the provided input is not a valid Firestore document.
|
|
5637
5638
|
* @returns A `Promise` resolved with a `DocumentReference` pointing to the
|
|
5638
5639
|
* newly created document after it has been written to the backend.
|
|
5639
|
-
*/ function
|
|
5640
|
-
var n =
|
|
5641
|
-
return
|
|
5640
|
+
*/ function Qr(t, e) {
|
|
5641
|
+
var n = On(t = lt(t, An)), r = Lr(t.converter, e), i = Kn(Gn(t.firestore), "addDoc", n._key, r, null !== n.converter, {});
|
|
5642
|
+
return pn(mn(t.firestore), [ i.toMutation(n._key, xe.exists(!1)) ]).then((function() {
|
|
5642
5643
|
return n;
|
|
5643
5644
|
}));
|
|
5644
5645
|
}
|
|
@@ -5672,9 +5673,9 @@ function zr(t, e, n) {
|
|
|
5672
5673
|
* @returns A Promise that will be resolved with the count; the count can be
|
|
5673
5674
|
* retrieved from `snapshot.data().count`, where `snapshot` is the
|
|
5674
5675
|
* `AggregateQuerySnapshot` to which the returned Promise resolves.
|
|
5675
|
-
*/ function
|
|
5676
|
-
return
|
|
5677
|
-
count:
|
|
5676
|
+
*/ function Yr(t) {
|
|
5677
|
+
return Hr(t, {
|
|
5678
|
+
count: Xr()
|
|
5678
5679
|
});
|
|
5679
5680
|
}
|
|
5680
5681
|
|
|
@@ -5703,13 +5704,13 @@ function zr(t, e, n) {
|
|
|
5703
5704
|
* const totalHours: number = aggregateSnapshot.data().totalHours;
|
|
5704
5705
|
* const averageScore: number | null = aggregateSnapshot.data().averageScore;
|
|
5705
5706
|
* ```
|
|
5706
|
-
*/ function
|
|
5707
|
-
var i =
|
|
5707
|
+
*/ function Hr(t, r) {
|
|
5708
|
+
var i = lt(t.firestore, gn), o = mn(i), a = function(t, e) {
|
|
5708
5709
|
var n = [];
|
|
5709
5710
|
for (var r in t) Object.prototype.hasOwnProperty.call(t, r) && n.push(e(t[r], r, t));
|
|
5710
5711
|
return n;
|
|
5711
5712
|
}(r, (function(t, e) {
|
|
5712
|
-
return new
|
|
5713
|
+
return new bt(e, t.aggregateType, t._internalFieldPath);
|
|
5713
5714
|
}));
|
|
5714
5715
|
// Run the aggregation and convert the results
|
|
5715
5716
|
return function(t, r, i) {
|
|
@@ -5718,8 +5719,8 @@ function zr(t, e, n) {
|
|
|
5718
5719
|
return n(this, (function(n) {
|
|
5719
5720
|
switch (n.label) {
|
|
5720
5721
|
case 0:
|
|
5721
|
-
return o =
|
|
5722
|
-
var i =
|
|
5722
|
+
return o = P(t), a = function(t, e, n, r) {
|
|
5723
|
+
var i = en(t, e), o = i.B, a = i.parent, u = {}, s = [], c = 0;
|
|
5723
5724
|
return n.forEach((function(t) {
|
|
5724
5725
|
// Map all client-side aliases to a unique short-form
|
|
5725
5726
|
// alias. This avoids issues with client-side aliases that
|
|
@@ -5731,12 +5732,12 @@ function zr(t, e, n) {
|
|
|
5731
5732
|
}) : "avg" === t.aggregateType ? s.push({
|
|
5732
5733
|
alias: e,
|
|
5733
5734
|
avg: {
|
|
5734
|
-
field:
|
|
5735
|
+
field: an(t.fieldPath)
|
|
5735
5736
|
}
|
|
5736
5737
|
}) : "sum" === t.aggregateType && s.push({
|
|
5737
5738
|
alias: e,
|
|
5738
5739
|
sum: {
|
|
5739
|
-
field:
|
|
5740
|
+
field: an(t.fieldPath)
|
|
5740
5741
|
}
|
|
5741
5742
|
});
|
|
5742
5743
|
})), {
|
|
@@ -5751,10 +5752,10 @@ function zr(t, e, n) {
|
|
|
5751
5752
|
parent: a
|
|
5752
5753
|
};
|
|
5753
5754
|
}(o.serializer, function(t) {
|
|
5754
|
-
var e =
|
|
5755
|
+
var e = P(t);
|
|
5755
5756
|
return e.O || (
|
|
5756
5757
|
// Do not include implicit order-bys for aggregate queries.
|
|
5757
|
-
e.O =
|
|
5758
|
+
e.O = Ae(e, t.explicitOrderBy)), e.O;
|
|
5758
5759
|
}(r), i), u = a.request, s = a.X, c = a.parent, o.connection.R || delete u.parent,
|
|
5759
5760
|
[ 4 /*yield*/ , o.g("RunAggregationQuery", o.serializer.databaseId, c, u,
|
|
5760
5761
|
/*expectedResponseCount=*/ 1) ];
|
|
@@ -5764,7 +5765,7 @@ function zr(t, e, n) {
|
|
|
5764
5765
|
return !!t.result;
|
|
5765
5766
|
})),
|
|
5766
5767
|
// Omit RunAggregationQueryResponse that only contain readTimes.
|
|
5767
|
-
|
|
5768
|
+
A(1 === l.length), f = null === (e = l[0].result) || void 0 === e ? void 0 : e.aggregateFields,
|
|
5768
5769
|
[ 2 /*return*/ , Object.keys(f).reduce((function(t, e) {
|
|
5769
5770
|
return t[s[e]] = f[e], t;
|
|
5770
5771
|
}), {}) ];
|
|
@@ -5773,29 +5774,29 @@ function zr(t, e, n) {
|
|
|
5773
5774
|
}));
|
|
5774
5775
|
}(o, t._query, a).then((function(e) {
|
|
5775
5776
|
return function(t, e, n) {
|
|
5776
|
-
var r = new
|
|
5777
|
-
return new
|
|
5777
|
+
var r = new Mr(t);
|
|
5778
|
+
return new Sn(e, r, n);
|
|
5778
5779
|
}(i, t, e);
|
|
5779
5780
|
}));
|
|
5780
5781
|
}
|
|
5781
5782
|
|
|
5782
|
-
function
|
|
5783
|
-
return new
|
|
5783
|
+
function Wr(t) {
|
|
5784
|
+
return new En("sum", or("sum", t));
|
|
5784
5785
|
}
|
|
5785
5786
|
|
|
5786
5787
|
/**
|
|
5787
5788
|
* Create an AggregateField object that can be used to compute the average of
|
|
5788
5789
|
* a specified field over a range of documents in the result set of a query.
|
|
5789
5790
|
* @param field Specifies the field to average across the result set.
|
|
5790
|
-
*/ function
|
|
5791
|
-
return new
|
|
5791
|
+
*/ function Jr(t) {
|
|
5792
|
+
return new En("avg", or("average", t));
|
|
5792
5793
|
}
|
|
5793
5794
|
|
|
5794
5795
|
/**
|
|
5795
5796
|
* Create an AggregateField object that can be used to compute the count of
|
|
5796
5797
|
* documents in the result set of a query.
|
|
5797
|
-
*/ function
|
|
5798
|
-
return new
|
|
5798
|
+
*/ function Xr() {
|
|
5799
|
+
return new En("count");
|
|
5799
5800
|
}
|
|
5800
5801
|
|
|
5801
5802
|
/**
|
|
@@ -5803,9 +5804,9 @@ function Hr(t) {
|
|
|
5803
5804
|
*
|
|
5804
5805
|
* @param left Compare this AggregateField to the `right`.
|
|
5805
5806
|
* @param right Compare this AggregateField to the `left`.
|
|
5806
|
-
*/ function
|
|
5807
|
+
*/ function Zr(t, e) {
|
|
5807
5808
|
var n, r;
|
|
5808
|
-
return t instanceof
|
|
5809
|
+
return t instanceof En && e instanceof En && t.aggregateType === e.aggregateType && (null === (n = t._internalFieldPath) || void 0 === n ? void 0 : n.canonicalString()) === (null === (r = e._internalFieldPath) || void 0 === r ? void 0 : r.canonicalString());
|
|
5809
5810
|
}
|
|
5810
5811
|
|
|
5811
5812
|
/**
|
|
@@ -5819,8 +5820,8 @@ function Hr(t) {
|
|
|
5819
5820
|
*
|
|
5820
5821
|
* @returns `true` if the objects are "equal", as defined above, or `false`
|
|
5821
5822
|
* otherwise.
|
|
5822
|
-
*/ function
|
|
5823
|
-
return
|
|
5823
|
+
*/ function $r(t, e) {
|
|
5824
|
+
return Nn(t.query, e.query) && p(t.data(), e.data());
|
|
5824
5825
|
}
|
|
5825
5826
|
|
|
5826
5827
|
/**
|
|
@@ -5842,15 +5843,15 @@ function Hr(t) {
|
|
|
5842
5843
|
/**
|
|
5843
5844
|
* Returns a sentinel for use with {@link @firebase/firestore/lite#(updateDoc:1)} or
|
|
5844
5845
|
* {@link @firebase/firestore/lite#(setDoc:1)} with `{merge: true}` to mark a field for deletion.
|
|
5845
|
-
*/ function
|
|
5846
|
-
return new
|
|
5846
|
+
*/ function ti() {
|
|
5847
|
+
return new Qn("deleteField");
|
|
5847
5848
|
}
|
|
5848
5849
|
|
|
5849
5850
|
/**
|
|
5850
5851
|
* Returns a sentinel used with {@link @firebase/firestore/lite#(setDoc:1)} or {@link @firebase/firestore/lite#(updateDoc:1)} to
|
|
5851
5852
|
* include a server-generated timestamp in the written data.
|
|
5852
|
-
*/ function
|
|
5853
|
-
return new
|
|
5853
|
+
*/ function ei() {
|
|
5854
|
+
return new Hn("serverTimestamp");
|
|
5854
5855
|
}
|
|
5855
5856
|
|
|
5856
5857
|
/**
|
|
@@ -5864,11 +5865,11 @@ function Hr(t) {
|
|
|
5864
5865
|
* @param elements - The elements to union into the array.
|
|
5865
5866
|
* @returns The `FieldValue` sentinel for use in a call to `setDoc()` or
|
|
5866
5867
|
* `updateDoc()`.
|
|
5867
|
-
*/ function
|
|
5868
|
+
*/ function ni() {
|
|
5868
5869
|
for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
|
|
5869
5870
|
// NOTE: We don't actually parse the data until it's used in set() or
|
|
5870
5871
|
// update() since we'd need the Firestore instance to do this.
|
|
5871
|
-
return new
|
|
5872
|
+
return new Wn("arrayUnion", t);
|
|
5872
5873
|
}
|
|
5873
5874
|
|
|
5874
5875
|
/**
|
|
@@ -5881,11 +5882,11 @@ function Hr(t) {
|
|
|
5881
5882
|
* @param elements - The elements to remove from the array.
|
|
5882
5883
|
* @returns The `FieldValue` sentinel for use in a call to `setDoc()` or
|
|
5883
5884
|
* `updateDoc()`
|
|
5884
|
-
*/ function
|
|
5885
|
+
*/ function ri() {
|
|
5885
5886
|
for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
|
|
5886
5887
|
// NOTE: We don't actually parse the data until it's used in set() or
|
|
5887
5888
|
// update() since we'd need the Firestore instance to do this.
|
|
5888
|
-
return new
|
|
5889
|
+
return new Jn("arrayRemove", t);
|
|
5889
5890
|
}
|
|
5890
5891
|
|
|
5891
5892
|
/**
|
|
@@ -5906,8 +5907,8 @@ function Hr(t) {
|
|
|
5906
5907
|
* @param n - The value to increment by.
|
|
5907
5908
|
* @returns The `FieldValue` sentinel for use in a call to `setDoc()` or
|
|
5908
5909
|
* `updateDoc()`
|
|
5909
|
-
*/ function
|
|
5910
|
-
return new
|
|
5910
|
+
*/ function ii(t) {
|
|
5911
|
+
return new Xn("increment", t);
|
|
5911
5912
|
}
|
|
5912
5913
|
|
|
5913
5914
|
/**
|
|
@@ -5933,24 +5934,24 @@ function Hr(t) {
|
|
|
5933
5934
|
* provides methods for adding writes to the write batch. None of the writes
|
|
5934
5935
|
* will be committed (or visible locally) until {@link WriteBatch.commit} is
|
|
5935
5936
|
* called.
|
|
5936
|
-
*/ var
|
|
5937
|
+
*/ var oi = /** @class */ function() {
|
|
5937
5938
|
/** @hideconstructor */
|
|
5938
5939
|
function t(t, e) {
|
|
5939
5940
|
this._firestore = t, this._commitHandler = e, this._mutations = [], this._committed = !1,
|
|
5940
|
-
this._dataReader =
|
|
5941
|
+
this._dataReader = Gn(t);
|
|
5941
5942
|
}
|
|
5942
5943
|
return t.prototype.set = function(t, e, n) {
|
|
5943
5944
|
this._verifyNotCommitted();
|
|
5944
|
-
var r =
|
|
5945
|
-
return this._mutations.push(o.toMutation(r._key,
|
|
5945
|
+
var r = ai(t, this._firestore), i = Lr(r.converter, e, n), o = Kn(this._dataReader, "WriteBatch.set", r._key, i, null !== r.converter, n);
|
|
5946
|
+
return this._mutations.push(o.toMutation(r._key, xe.none())), this;
|
|
5946
5947
|
}, t.prototype.update = function(t, e, n) {
|
|
5947
5948
|
for (var r = [], i = 3; i < arguments.length; i++) r[i - 3] = arguments[i];
|
|
5948
5949
|
this._verifyNotCommitted();
|
|
5949
|
-
var o, a =
|
|
5950
|
+
var o, a = ai(t, this._firestore);
|
|
5950
5951
|
// For Compat types, we have to "extract" the underlying types before
|
|
5951
5952
|
// performing validation.
|
|
5952
|
-
return o = "string" == typeof (e = d(e)) || e instanceof
|
|
5953
|
-
this._mutations.push(o.toMutation(a._key,
|
|
5953
|
+
return o = "string" == typeof (e = d(e)) || e instanceof Rn ? $n(this._dataReader, "WriteBatch.update", a._key, e, n, r) : Zn(this._dataReader, "WriteBatch.update", a._key, e),
|
|
5954
|
+
this._mutations.push(o.toMutation(a._key, xe.exists(!0))), this;
|
|
5954
5955
|
},
|
|
5955
5956
|
/**
|
|
5956
5957
|
* Deletes the document referred to by the provided {@link DocumentReference}.
|
|
@@ -5960,8 +5961,8 @@ function Hr(t) {
|
|
|
5960
5961
|
*/
|
|
5961
5962
|
t.prototype.delete = function(t) {
|
|
5962
5963
|
this._verifyNotCommitted();
|
|
5963
|
-
var e =
|
|
5964
|
-
return this._mutations = this._mutations.concat(new
|
|
5964
|
+
var e = ai(t, this._firestore);
|
|
5965
|
+
return this._mutations = this._mutations.concat(new Me(e._key, xe.none())), this;
|
|
5965
5966
|
},
|
|
5966
5967
|
/**
|
|
5967
5968
|
* Commits all of the writes in this write batch as a single atomic unit.
|
|
@@ -5978,12 +5979,12 @@ function Hr(t) {
|
|
|
5978
5979
|
t.prototype.commit = function() {
|
|
5979
5980
|
return this._verifyNotCommitted(), this._committed = !0, this._mutations.length > 0 ? this._commitHandler(this._mutations) : Promise.resolve();
|
|
5980
5981
|
}, t.prototype._verifyNotCommitted = function() {
|
|
5981
|
-
if (this._committed) throw new
|
|
5982
|
+
if (this._committed) throw new z(C, "A write batch can no longer be used after commit() has been called.");
|
|
5982
5983
|
}, t;
|
|
5983
5984
|
}();
|
|
5984
5985
|
|
|
5985
|
-
function
|
|
5986
|
-
if ((t = d(t)).firestore !== e) throw new
|
|
5986
|
+
function ai(t, e) {
|
|
5987
|
+
if ((t = d(t)).firestore !== e) throw new z(V, "Provided document reference is from a different Firestore instance.");
|
|
5987
5988
|
return t;
|
|
5988
5989
|
}
|
|
5989
5990
|
|
|
@@ -5999,10 +6000,10 @@ function oi(t, e) {
|
|
|
5999
6000
|
*
|
|
6000
6001
|
* @returns A `WriteBatch` that can be used to atomically execute multiple
|
|
6001
6002
|
* writes.
|
|
6002
|
-
*/ function
|
|
6003
|
-
var e =
|
|
6004
|
-
return new
|
|
6005
|
-
return
|
|
6003
|
+
*/ function ui(t) {
|
|
6004
|
+
var e = mn(t = lt(t, gn));
|
|
6005
|
+
return new oi(t, (function(t) {
|
|
6006
|
+
return pn(e, t);
|
|
6006
6007
|
}));
|
|
6007
6008
|
}
|
|
6008
6009
|
|
|
@@ -6025,7 +6026,7 @@ function oi(t, e) {
|
|
|
6025
6026
|
/**
|
|
6026
6027
|
* Internal transaction object responsible for accumulating the mutations to
|
|
6027
6028
|
* perform and the base versions for any documents read.
|
|
6028
|
-
*/ var
|
|
6029
|
+
*/ var si = /** @class */ function() {
|
|
6029
6030
|
function t(t) {
|
|
6030
6031
|
this.datastore = t,
|
|
6031
6032
|
// The version of each document that was read during this transaction.
|
|
@@ -6049,9 +6050,9 @@ function oi(t, e) {
|
|
|
6049
6050
|
return n(this, (function(n) {
|
|
6050
6051
|
switch (n.label) {
|
|
6051
6052
|
case 0:
|
|
6052
|
-
if (this.ensureCommitNotCalled(), this.mutations.length > 0) throw this.lastTransactionError = new
|
|
6053
|
+
if (this.ensureCommitNotCalled(), this.mutations.length > 0) throw this.lastTransactionError = new z(V, "Firestore transactions require all reads to be executed before all writes."),
|
|
6053
6054
|
this.lastTransactionError;
|
|
6054
|
-
return [ 4 /*yield*/ ,
|
|
6055
|
+
return [ 4 /*yield*/ , dn(this.datastore, t) ];
|
|
6055
6056
|
|
|
6056
6057
|
case 1:
|
|
6057
6058
|
return [ 2 /*return*/ , ((e = n.sent()).forEach((function(t) {
|
|
@@ -6070,7 +6071,7 @@ function oi(t, e) {
|
|
|
6070
6071
|
}
|
|
6071
6072
|
this.writtenDocs.add(t.toString());
|
|
6072
6073
|
}, t.prototype.delete = function(t) {
|
|
6073
|
-
this.write(new
|
|
6074
|
+
this.write(new Me(t, this.precondition(t))), this.writtenDocs.add(t.toString());
|
|
6074
6075
|
}, t.prototype.commit = function() {
|
|
6075
6076
|
return e(this, void 0, void 0, (function() {
|
|
6076
6077
|
var t, e = this;
|
|
@@ -6086,9 +6087,9 @@ function oi(t, e) {
|
|
|
6086
6087
|
// For each document that was read but not written to, we want to perform
|
|
6087
6088
|
// a `verify` operation.
|
|
6088
6089
|
t.forEach((function(t, n) {
|
|
6089
|
-
var r =
|
|
6090
|
-
e.mutations.push(new
|
|
6091
|
-
})), [ 4 /*yield*/ ,
|
|
6090
|
+
var r = ot.fromPath(n);
|
|
6091
|
+
e.mutations.push(new Ue(r, e.precondition(r)));
|
|
6092
|
+
})), [ 4 /*yield*/ , pn(this.datastore, this.mutations) ];
|
|
6092
6093
|
|
|
6093
6094
|
case 1:
|
|
6094
6095
|
// For each mutation, note that the doc was written.
|
|
@@ -6099,15 +6100,15 @@ function oi(t, e) {
|
|
|
6099
6100
|
}, t.prototype.recordVersion = function(t) {
|
|
6100
6101
|
var e;
|
|
6101
6102
|
if (t.isFoundDocument()) e = t.version; else {
|
|
6102
|
-
if (!t.isNoDocument()) throw
|
|
6103
|
+
if (!t.isNoDocument()) throw I();
|
|
6103
6104
|
// Represent a deleted doc using SnapshotVersion.min().
|
|
6104
|
-
e =
|
|
6105
|
+
e = he.min();
|
|
6105
6106
|
}
|
|
6106
6107
|
var n = this.readVersions.get(t.key.toString());
|
|
6107
6108
|
if (n) {
|
|
6108
6109
|
if (!e.isEqual(n))
|
|
6109
6110
|
// This transaction will fail no matter what.
|
|
6110
|
-
throw new
|
|
6111
|
+
throw new z(j, "Document version changed between two reads.");
|
|
6111
6112
|
} else this.readVersions.set(t.key.toString(), e);
|
|
6112
6113
|
},
|
|
6113
6114
|
/**
|
|
@@ -6116,7 +6117,7 @@ function oi(t, e) {
|
|
|
6116
6117
|
*/
|
|
6117
6118
|
t.prototype.precondition = function(t) {
|
|
6118
6119
|
var e = this.readVersions.get(t.toString());
|
|
6119
|
-
return !this.writtenDocs.has(t.toString()) && e ? e.isEqual(
|
|
6120
|
+
return !this.writtenDocs.has(t.toString()) && e ? e.isEqual(he.min()) ? xe.exists(!1) : xe.updateTime(e) : xe.none();
|
|
6120
6121
|
},
|
|
6121
6122
|
/**
|
|
6122
6123
|
* Returns the precondition for a document if the operation is an update.
|
|
@@ -6126,7 +6127,7 @@ function oi(t, e) {
|
|
|
6126
6127
|
// The first time a document is written, we want to take into account the
|
|
6127
6128
|
// read time and existence
|
|
6128
6129
|
if (!this.writtenDocs.has(t.toString()) && e) {
|
|
6129
|
-
if (e.isEqual(
|
|
6130
|
+
if (e.isEqual(he.min()))
|
|
6130
6131
|
// The document doesn't exist, so fail the transaction.
|
|
6131
6132
|
// This has to be validated locally because you can't send a
|
|
6132
6133
|
// precondition that a document does not exist without changing the
|
|
@@ -6136,22 +6137,22 @@ function oi(t, e) {
|
|
|
6136
6137
|
// express that to the backend, we have to validate locally.
|
|
6137
6138
|
// Note: this can change once we can send separate verify writes in the
|
|
6138
6139
|
// transaction.
|
|
6139
|
-
throw new
|
|
6140
|
+
throw new z(V, "Can't update a document that doesn't exist.");
|
|
6140
6141
|
// Document exists, base precondition on document update time.
|
|
6141
|
-
return
|
|
6142
|
+
return xe.updateTime(e);
|
|
6142
6143
|
}
|
|
6143
6144
|
// Document was not read, so we just use the preconditions for a blind
|
|
6144
6145
|
// update.
|
|
6145
|
-
return
|
|
6146
|
+
return xe.exists(!0);
|
|
6146
6147
|
}, t.prototype.write = function(t) {
|
|
6147
6148
|
this.ensureCommitNotCalled(), this.mutations.push(t);
|
|
6148
6149
|
}, t.prototype.ensureCommitNotCalled = function() {}, t;
|
|
6149
|
-
}(),
|
|
6150
|
+
}(), ci = {
|
|
6150
6151
|
maxAttempts: 5
|
|
6151
|
-
},
|
|
6152
|
+
}, li = /** @class */ function() {
|
|
6152
6153
|
function t(t, e, n, r, i) {
|
|
6153
6154
|
this.asyncQueue = t, this.datastore = e, this.options = n, this.updateFunction = r,
|
|
6154
|
-
this.deferred = i, this.Et = n.maxAttempts, this.At = new
|
|
6155
|
+
this.deferred = i, this.Et = n.maxAttempts, this.At = new fn(this.asyncQueue, "transaction_retry" /* TimerId.TransactionRetry */)
|
|
6155
6156
|
/** Runs the transaction and sets the result on deferred. */;
|
|
6156
6157
|
}
|
|
6157
6158
|
return t.prototype.Tt = function() {
|
|
@@ -6162,7 +6163,7 @@ function oi(t, e) {
|
|
|
6162
6163
|
return e(t, void 0, void 0, (function() {
|
|
6163
6164
|
var t, e, r = this;
|
|
6164
6165
|
return n(this, (function(n) {
|
|
6165
|
-
return t = new
|
|
6166
|
+
return t = new si(this.datastore), (e = this.Pt(t)) && e.then((function(e) {
|
|
6166
6167
|
r.asyncQueue.enqueueAndForget((function() {
|
|
6167
6168
|
return t.commit().then((function() {
|
|
6168
6169
|
r.deferred.resolve(e);
|
|
@@ -6179,7 +6180,7 @@ function oi(t, e) {
|
|
|
6179
6180
|
}, t.prototype.Pt = function(t) {
|
|
6180
6181
|
try {
|
|
6181
6182
|
var e = this.updateFunction(t);
|
|
6182
|
-
return !
|
|
6183
|
+
return !dt(e) && e.catch && e.then ? e : (this.deferred.reject(Error("Transaction callback must return a Promise")),
|
|
6183
6184
|
null);
|
|
6184
6185
|
} catch (t) {
|
|
6185
6186
|
// Do not retry errors thrown by user provided updateFunction.
|
|
@@ -6205,30 +6206,30 @@ function oi(t, e) {
|
|
|
6205
6206
|
function(t) {
|
|
6206
6207
|
switch (t) {
|
|
6207
6208
|
default:
|
|
6208
|
-
return
|
|
6209
|
+
return I();
|
|
6209
6210
|
|
|
6210
|
-
case P:
|
|
6211
6211
|
case F:
|
|
6212
|
-
case
|
|
6213
|
-
case
|
|
6214
|
-
case
|
|
6212
|
+
case O:
|
|
6213
|
+
case N:
|
|
6214
|
+
case x:
|
|
6215
6215
|
case U:
|
|
6216
|
+
case B:
|
|
6216
6217
|
// Unauthenticated means something went wrong with our token and we need
|
|
6217
6218
|
// to retry with new credentials which will happen automatically.
|
|
6218
|
-
case
|
|
6219
|
+
case q:
|
|
6219
6220
|
return !1;
|
|
6220
6221
|
|
|
6221
|
-
case
|
|
6222
|
-
case N:
|
|
6223
|
-
case "already-exists":
|
|
6222
|
+
case V:
|
|
6224
6223
|
case D:
|
|
6225
|
-
case
|
|
6224
|
+
case "already-exists":
|
|
6225
|
+
case R:
|
|
6226
|
+
case C:
|
|
6226
6227
|
// Aborted might be retried in some scenarios, but that is dependant on
|
|
6227
6228
|
// the context and should handled individually by the calling code.
|
|
6228
6229
|
// See https://cloud.google.com/apis/design/errors.
|
|
6229
|
-
case
|
|
6230
|
-
case j:
|
|
6230
|
+
case j:
|
|
6231
6231
|
case L:
|
|
6232
|
+
case M:
|
|
6232
6233
|
case "data-loss":
|
|
6233
6234
|
return !0;
|
|
6234
6235
|
}
|
|
@@ -6270,7 +6271,7 @@ function oi(t, e) {
|
|
|
6270
6271
|
* See the License for the specific language governing permissions and
|
|
6271
6272
|
* limitations under the License.
|
|
6272
6273
|
*/
|
|
6273
|
-
/** The Platform's 'document' implementation or null if not available. */ function
|
|
6274
|
+
/** The Platform's 'document' implementation or null if not available. */ function fi() {
|
|
6274
6275
|
// `document` is not always available, e.g. in ReactNative and WebWorkers.
|
|
6275
6276
|
// eslint-disable-next-line no-restricted-globals
|
|
6276
6277
|
return "undefined" != typeof document ? document : null;
|
|
@@ -6302,10 +6303,10 @@ function oi(t, e) {
|
|
|
6302
6303
|
* Note: We implement `PromiseLike` instead of `Promise`, as the `Promise` type
|
|
6303
6304
|
* in newer versions of TypeScript defines `finally`, which is not available in
|
|
6304
6305
|
* IE.
|
|
6305
|
-
*/ var
|
|
6306
|
+
*/ var hi, pi = /** @class */ function() {
|
|
6306
6307
|
function t(t, e, n, r, i) {
|
|
6307
6308
|
this.asyncQueue = t, this.timerId = e, this.targetTimeMs = n, this.op = r, this.removalCallback = i,
|
|
6308
|
-
this.deferred = new
|
|
6309
|
+
this.deferred = new G, this.then = this.deferred.promise.then.bind(this.deferred.promise),
|
|
6309
6310
|
// It's normal for the deferred promise to be canceled (due to cancellation)
|
|
6310
6311
|
// and so we attach a dummy catch callback to avoid
|
|
6311
6312
|
// 'UnhandledPromiseRejectionWarning' log spam.
|
|
@@ -6361,7 +6362,7 @@ function oi(t, e) {
|
|
|
6361
6362
|
* guarantee that the operation will not be run.
|
|
6362
6363
|
*/
|
|
6363
6364
|
t.prototype.cancel = function(t) {
|
|
6364
|
-
null !== this.timerHandle && (this.clearTimeout(), this.deferred.reject(new
|
|
6365
|
+
null !== this.timerHandle && (this.clearTimeout(), this.deferred.reject(new z(F, "Operation cancelled" + (t ? ": " + t : ""))));
|
|
6365
6366
|
}, t.prototype.handleDelayElapsed = function() {
|
|
6366
6367
|
var t = this;
|
|
6367
6368
|
this.asyncQueue.enqueueAndForget((function() {
|
|
@@ -6373,7 +6374,7 @@ function oi(t, e) {
|
|
|
6373
6374
|
null !== this.timerHandle && (this.removalCallback(this), clearTimeout(this.timerHandle),
|
|
6374
6375
|
this.timerHandle = null);
|
|
6375
6376
|
}, t;
|
|
6376
|
-
}(),
|
|
6377
|
+
}(), di = /** @class */ function() {
|
|
6377
6378
|
function t() {
|
|
6378
6379
|
var t = this;
|
|
6379
6380
|
// The last promise in the queue.
|
|
@@ -6397,15 +6398,15 @@ function oi(t, e) {
|
|
|
6397
6398
|
// List of TimerIds to fast-forward delays for.
|
|
6398
6399
|
this.Ct = [],
|
|
6399
6400
|
// Backoff timer used to schedule retries for retryable operations
|
|
6400
|
-
this.At = new
|
|
6401
|
+
this.At = new fn(this, "async_queue_retry" /* TimerId.AsyncQueueRetry */),
|
|
6401
6402
|
// Visibility handler that triggers an immediate retry of all retryable
|
|
6402
6403
|
// operations. Meant to speed up recovery when we regain file system access
|
|
6403
6404
|
// after page comes into foreground.
|
|
6404
6405
|
this.St = function() {
|
|
6405
|
-
var e =
|
|
6406
|
-
e &&
|
|
6406
|
+
var e = fi();
|
|
6407
|
+
e && T("AsyncQueue", "Visibility state changed to " + e.visibilityState), t.At.J();
|
|
6407
6408
|
};
|
|
6408
|
-
var e =
|
|
6409
|
+
var e = fi();
|
|
6409
6410
|
e && "function" == typeof e.addEventListener && e.addEventListener("visibilitychange", this.St);
|
|
6410
6411
|
}
|
|
6411
6412
|
return Object.defineProperty(t.prototype, "isShuttingDown", {
|
|
@@ -6429,7 +6430,7 @@ function oi(t, e) {
|
|
|
6429
6430
|
}, t.prototype.enterRestrictedMode = function(t) {
|
|
6430
6431
|
if (!this.gt) {
|
|
6431
6432
|
this.gt = !0, this.bt = t || !1;
|
|
6432
|
-
var e =
|
|
6433
|
+
var e = fi();
|
|
6433
6434
|
e && "function" == typeof e.removeEventListener && e.removeEventListener("visibilitychange", this.St);
|
|
6434
6435
|
}
|
|
6435
6436
|
}, t.prototype.enqueue = function(t) {
|
|
@@ -6440,7 +6441,7 @@ function oi(t, e) {
|
|
|
6440
6441
|
// Create a deferred Promise that we can return to the callee. This
|
|
6441
6442
|
// allows us to return a "hanging Promise" only to the callee and still
|
|
6442
6443
|
// advance the queue even when the operation is not run.
|
|
6443
|
-
var n = new
|
|
6444
|
+
var n = new G;
|
|
6444
6445
|
return this.Ot((function() {
|
|
6445
6446
|
return e.gt && e.bt ? Promise.resolve() : (t().then(n.resolve, n.reject), n.promise);
|
|
6446
6447
|
})).then((function() {
|
|
@@ -6474,7 +6475,7 @@ function oi(t, e) {
|
|
|
6474
6475
|
case 3:
|
|
6475
6476
|
if (t = n.sent(), "IndexedDbTransactionError" !== t.name) throw t;
|
|
6476
6477
|
// Failure will be handled by AsyncQueue
|
|
6477
|
-
return
|
|
6478
|
+
return T("AsyncQueue", "Operation failed with retryable error: " + t),
|
|
6478
6479
|
[ 3 /*break*/ , 4 ];
|
|
6479
6480
|
|
|
6480
6481
|
case 4:
|
|
@@ -6516,7 +6517,7 @@ function oi(t, e) {
|
|
|
6516
6517
|
// Re-throw the error so that this.tail becomes a rejected Promise and
|
|
6517
6518
|
// all further attempts to chain (via .then) will just short-circuit
|
|
6518
6519
|
// and return the rejected Promise.
|
|
6519
|
-
throw
|
|
6520
|
+
throw E("INTERNAL UNHANDLED ERROR: ", n), t;
|
|
6520
6521
|
})).then((function(t) {
|
|
6521
6522
|
return e.Dt = !1, t;
|
|
6522
6523
|
}));
|
|
@@ -6527,12 +6528,12 @@ function oi(t, e) {
|
|
|
6527
6528
|
this.Nt(),
|
|
6528
6529
|
// Fast-forward delays for timerIds that have been overriden.
|
|
6529
6530
|
this.Ct.indexOf(t) > -1 && (e = 0);
|
|
6530
|
-
var i =
|
|
6531
|
+
var i = pi.createAndSchedule(this, t, e, n, (function(t) {
|
|
6531
6532
|
return r.Bt(t);
|
|
6532
6533
|
}));
|
|
6533
6534
|
return this.Ft.push(i), i;
|
|
6534
6535
|
}, t.prototype.Nt = function() {
|
|
6535
|
-
this.vt &&
|
|
6536
|
+
this.vt && I();
|
|
6536
6537
|
}, t.prototype.verifyOperationInProgress = function() {},
|
|
6537
6538
|
/**
|
|
6538
6539
|
* Waits until all currently queued tasks are finished executing. Delayed
|
|
@@ -6602,10 +6603,10 @@ function oi(t, e) {
|
|
|
6602
6603
|
var e = this.Ft.indexOf(t);
|
|
6603
6604
|
this.Ft.splice(e, 1);
|
|
6604
6605
|
}, t;
|
|
6605
|
-
}(),
|
|
6606
|
+
}(), yi = /** @class */ function() {
|
|
6606
6607
|
/** @hideconstructor */
|
|
6607
6608
|
function t(t, e) {
|
|
6608
|
-
this._firestore = t, this._transaction = e, this._dataReader =
|
|
6609
|
+
this._firestore = t, this._transaction = e, this._dataReader = Gn(t)
|
|
6609
6610
|
/**
|
|
6610
6611
|
* Reads the document referenced by the provided {@link DocumentReference}.
|
|
6611
6612
|
*
|
|
@@ -6614,23 +6615,23 @@ function oi(t, e) {
|
|
|
6614
6615
|
*/;
|
|
6615
6616
|
}
|
|
6616
6617
|
return t.prototype.get = function(t) {
|
|
6617
|
-
var e = this, n =
|
|
6618
|
+
var e = this, n = ai(t, this._firestore), r = new Mr(this._firestore);
|
|
6618
6619
|
return this._transaction.lookup([ n._key ]).then((function(t) {
|
|
6619
|
-
if (!t || 1 !== t.length) return
|
|
6620
|
+
if (!t || 1 !== t.length) return I();
|
|
6620
6621
|
var i = t[0];
|
|
6621
|
-
if (i.isFoundDocument()) return new
|
|
6622
|
-
if (i.isNoDocument()) return new
|
|
6623
|
-
throw
|
|
6622
|
+
if (i.isFoundDocument()) return new lr(e._firestore, r, i.key, i, n.converter);
|
|
6623
|
+
if (i.isNoDocument()) return new lr(e._firestore, r, n._key, null, n.converter);
|
|
6624
|
+
throw I();
|
|
6624
6625
|
}));
|
|
6625
6626
|
}, t.prototype.set = function(t, e, n) {
|
|
6626
|
-
var r =
|
|
6627
|
+
var r = ai(t, this._firestore), i = Lr(r.converter, e, n), o = Kn(this._dataReader, "Transaction.set", r._key, i, null !== r.converter, n);
|
|
6627
6628
|
return this._transaction.set(r._key, o), this;
|
|
6628
6629
|
}, t.prototype.update = function(t, e, n) {
|
|
6629
6630
|
for (var r = [], i = 3; i < arguments.length; i++) r[i - 3] = arguments[i];
|
|
6630
|
-
var o, a =
|
|
6631
|
+
var o, a = ai(t, this._firestore);
|
|
6631
6632
|
// For Compat types, we have to "extract" the underlying types before
|
|
6632
6633
|
// performing validation.
|
|
6633
|
-
return o = "string" == typeof (e = d(e)) || e instanceof
|
|
6634
|
+
return o = "string" == typeof (e = d(e)) || e instanceof Rn ? $n(this._dataReader, "Transaction.update", a._key, e, n, r) : Zn(this._dataReader, "Transaction.update", a._key, e),
|
|
6634
6635
|
this._transaction.update(a._key, o), this;
|
|
6635
6636
|
},
|
|
6636
6637
|
/**
|
|
@@ -6640,7 +6641,7 @@ function oi(t, e) {
|
|
|
6640
6641
|
* @returns This `Transaction` instance. Used for chaining method calls.
|
|
6641
6642
|
*/
|
|
6642
6643
|
t.prototype.delete = function(t) {
|
|
6643
|
-
var e =
|
|
6644
|
+
var e = ai(t, this._firestore);
|
|
6644
6645
|
return this._transaction.delete(e._key), this;
|
|
6645
6646
|
}, t;
|
|
6646
6647
|
}();
|
|
@@ -6680,14 +6681,14 @@ function oi(t, e) {
|
|
|
6680
6681
|
* `updateFunction `is returned here. Otherwise, if the transaction failed, a
|
|
6681
6682
|
* rejected promise with the corresponding failure error is returned.
|
|
6682
6683
|
*/
|
|
6683
|
-
function
|
|
6684
|
-
var r =
|
|
6684
|
+
function mi(t, e, n) {
|
|
6685
|
+
var r = mn(t = lt(t, gn)), i = Object.assign(Object.assign({}, ci), n);
|
|
6685
6686
|
!function(t) {
|
|
6686
|
-
if (t.maxAttempts < 1) throw new
|
|
6687
|
+
if (t.maxAttempts < 1) throw new z(V, "Max attempts must be at least 1");
|
|
6687
6688
|
}(i);
|
|
6688
|
-
var o = new
|
|
6689
|
-
return new
|
|
6690
|
-
return e(new
|
|
6689
|
+
var o = new G;
|
|
6690
|
+
return new li(new di, r, i, (function(n) {
|
|
6691
|
+
return e(new yi(t, n));
|
|
6691
6692
|
}), o).Tt(), o.promise
|
|
6692
6693
|
/**
|
|
6693
6694
|
* Firestore Lite
|
|
@@ -6699,15 +6700,15 @@ function yi(t, e, n) {
|
|
|
6699
6700
|
*/;
|
|
6700
6701
|
}
|
|
6701
6702
|
|
|
6702
|
-
|
|
6703
|
-
var n = e.instanceIdentifier, r = e.options, i = t.getProvider("app").getImmediate(), o = new gn(new
|
|
6704
|
-
if (!Object.prototype.hasOwnProperty.apply(t.options, [ "projectId" ])) throw new
|
|
6705
|
-
return new
|
|
6703
|
+
hi = "".concat(i, "_lite"), w = hi, o(new c("firestore/lite", (function(t, e) {
|
|
6704
|
+
var n = e.instanceIdentifier, r = e.options, i = t.getProvider("app").getImmediate(), o = new gn(new H(t.getProvider("auth-internal")), new Z(t.getProvider("app-check-internal")), function(t, e) {
|
|
6705
|
+
if (!Object.prototype.hasOwnProperty.apply(t.options, [ "projectId" ])) throw new z(V, '"projectId" not provided in firebase.initializeApp.');
|
|
6706
|
+
return new tt(t.options.projectId, e);
|
|
6706
6707
|
}(i, n), i);
|
|
6707
6708
|
return r && o._setSettings(r), o;
|
|
6708
6709
|
}), "PUBLIC").setMultipleInstances(!0)),
|
|
6709
6710
|
// RUNTIME_ENV and BUILD_TARGET are replaced by real values during the compilation
|
|
6710
|
-
a("firestore-lite",
|
|
6711
|
+
a("firestore-lite", v, ""), a("firestore-lite", v, "esm5");
|
|
6711
6712
|
|
|
6712
|
-
export {
|
|
6713
|
+
export { En as AggregateField, Sn as AggregateQuerySnapshot, Dn as Bytes, An as CollectionReference, In as DocumentReference, lr as DocumentSnapshot, Rn as FieldPath, xn as FieldValue, gn as Firestore, z as FirestoreError, Cn as GeoPoint, kn as Query, _r as QueryCompositeFilterConstraint, mr as QueryConstraint, fr as QueryDocumentSnapshot, Vr as QueryEndAtConstraint, gr as QueryFieldFilterConstraint, kr as QueryLimitConstraint, Er as QueryOrderByConstraint, hr as QuerySnapshot, Pr as QueryStartAtConstraint, Rt as Timestamp, yi as Transaction, oi as WriteBatch, Qr as addDoc, Zr as aggregateFieldEqual, $r as aggregateQuerySnapshotEqual, Tr as and, ri as arrayRemove, ni as arrayUnion, Jr as average, Pn as collection, Fn as collectionGroup, bn as connectFirestoreEmulator, Xr as count, Kr as deleteDoc, ti as deleteField, On as doc, qn as documentId, Dr as endAt, Nr as endBefore, Hr as getAggregate, Yr as getCount, Ur as getDoc, Br as getDocs, _n as getFirestore, ii as increment, wn as initializeFirestore, Ir as limit, Ar as limitToLast, br as or, Sr as orderBy, vr as query, Nn as queryEqual, Vn as refEqual, mi as runTransaction, ei as serverTimestamp, zr as setDoc, b as setLogLevel, pr as snapshotEqual, Or as startAfter, Fr as startAt, Wr as sum, Tn as terminate, Gr as updateDoc, wr as where, ui as writeBatch };
|
|
6713
6714
|
//# sourceMappingURL=index.browser.esm5.js.map
|