@firebase/firestore 3.4.8-canary.5ce067663 → 3.4.8-canary.63caee2a5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/firestore/lite/index.d.ts +1 -0
- package/dist/firestore/src/api/transaction.d.ts +2 -1
- package/dist/firestore/src/api/transaction_options.d.ts +17 -0
- package/dist/firestore/src/api.d.ts +1 -0
- package/dist/firestore/src/core/firestore_client.d.ts +2 -1
- package/dist/firestore/src/core/transaction_options.d.ts +25 -0
- package/dist/firestore/src/core/transaction_runner.d.ts +3 -2
- package/dist/firestore/src/lite-api/transaction.d.ts +2 -1
- package/dist/firestore/src/lite-api/transaction_options.d.ts +23 -0
- package/dist/index.d.ts +24 -1
- package/dist/index.esm2017.js +224 -200
- package/dist/index.esm2017.js.map +1 -1
- package/dist/index.esm5.js +158 -135
- package/dist/index.esm5.js.map +1 -1
- package/dist/index.node.cjs.js +36 -9
- package/dist/index.node.cjs.js.map +1 -1
- package/dist/index.node.mjs +36 -9
- package/dist/index.node.mjs.map +1 -1
- package/dist/index.rn.js +95 -71
- package/dist/index.rn.js.map +1 -1
- package/dist/internal.d.ts +25 -1
- package/dist/lite/firestore/lite/index.d.ts +1 -0
- package/dist/lite/firestore/src/api/transaction.d.ts +2 -1
- package/dist/lite/firestore/src/api/transaction_options.d.ts +17 -0
- package/dist/lite/firestore/src/api.d.ts +1 -0
- package/dist/lite/firestore/src/core/firestore_client.d.ts +2 -1
- package/dist/lite/firestore/src/core/transaction_options.d.ts +25 -0
- package/dist/lite/firestore/src/core/transaction_runner.d.ts +3 -2
- package/dist/lite/firestore/src/lite-api/transaction.d.ts +2 -1
- package/dist/lite/firestore/src/lite-api/transaction_options.d.ts +23 -0
- package/dist/lite/index.browser.esm2017.js +246 -223
- package/dist/lite/index.browser.esm2017.js.map +1 -1
- package/dist/lite/index.browser.esm5.js +118 -116
- package/dist/lite/index.browser.esm5.js.map +1 -1
- package/dist/lite/index.d.ts +24 -1
- package/dist/lite/index.node.cjs.js +34 -7
- package/dist/lite/index.node.cjs.js.map +1 -1
- package/dist/lite/index.node.mjs +34 -7
- package/dist/lite/index.node.mjs.map +1 -1
- package/dist/lite/index.rn.esm2017.js +127 -104
- package/dist/lite/index.rn.esm2017.js.map +1 -1
- package/dist/lite/internal.d.ts +25 -1
- package/dist/lite/packages/firestore/dist/lite/index.browser.esm2017.d.ts +28 -28
- package/dist/lite/packages/firestore/lite/index.d.ts +1 -0
- package/dist/lite/packages/firestore/src/api/transaction.d.ts +2 -1
- package/dist/lite/packages/firestore/src/api/transaction_options.d.ts +17 -0
- package/dist/lite/packages/firestore/src/api.d.ts +1 -0
- package/dist/lite/packages/firestore/src/core/firestore_client.d.ts +2 -1
- package/dist/lite/packages/firestore/src/core/transaction_options.d.ts +25 -0
- package/dist/lite/packages/firestore/src/core/transaction_runner.d.ts +3 -2
- package/dist/lite/packages/firestore/src/lite-api/transaction.d.ts +2 -1
- package/dist/lite/packages/firestore/src/lite-api/transaction_options.d.ts +23 -0
- package/dist/lite/private.d.ts +25 -1
- package/dist/packages/firestore/dist/index.esm2017.d.ts +37 -36
- package/dist/packages/firestore/lite/index.d.ts +1 -0
- package/dist/packages/firestore/src/api/transaction.d.ts +2 -1
- package/dist/packages/firestore/src/api/transaction_options.d.ts +17 -0
- package/dist/packages/firestore/src/api.d.ts +1 -0
- package/dist/packages/firestore/src/core/firestore_client.d.ts +2 -1
- package/dist/packages/firestore/src/core/transaction_options.d.ts +25 -0
- package/dist/packages/firestore/src/core/transaction_runner.d.ts +3 -2
- package/dist/packages/firestore/src/lite-api/transaction.d.ts +2 -1
- package/dist/packages/firestore/src/lite-api/transaction_options.d.ts +23 -0
- package/dist/private.d.ts +25 -1
- package/package.json +10 -10
|
@@ -66,7 +66,7 @@ f.MOCK_USER = new f("mock-user");
|
|
|
66
66
|
* See the License for the specific language governing permissions and
|
|
67
67
|
* limitations under the License.
|
|
68
68
|
*/
|
|
69
|
-
let d = "9.7.0-canary.
|
|
69
|
+
let d = "9.7.0-canary.63caee2a5";
|
|
70
70
|
|
|
71
71
|
/**
|
|
72
72
|
* @license
|
|
@@ -221,7 +221,7 @@ e) {
|
|
|
221
221
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
222
222
|
* See the License for the specific language governing permissions and
|
|
223
223
|
* limitations under the License.
|
|
224
|
-
*/ const T = "ok",
|
|
224
|
+
*/ const T = "ok", A = "cancelled", I = "unknown", R = "invalid-argument", P = "deadline-exceeded", V = "not-found", N = "already-exists", D = "permission-denied", $ = "unauthenticated", S = "resource-exhausted", x = "failed-precondition", F = "aborted", q = "out-of-range", O = "unimplemented", C = "internal", L = "unavailable", k = "data-loss";
|
|
225
225
|
|
|
226
226
|
/** An error returned by a Firestore operation. */ class U extends c {
|
|
227
227
|
/** @hideconstructor */
|
|
@@ -902,7 +902,7 @@ var ft, dt;
|
|
|
902
902
|
* Code.UNKNOWN.
|
|
903
903
|
*/
|
|
904
904
|
function wt(t) {
|
|
905
|
-
if (void 0 === t) return y("RPC_ERROR", "HTTP error has no status"),
|
|
905
|
+
if (void 0 === t) return y("RPC_ERROR", "HTTP error has no status"), I;
|
|
906
906
|
// The canonical error codes for Google APIs [1] specify mapping onto HTTP
|
|
907
907
|
// status codes but the mapping is not bijective. In each case of ambiguity
|
|
908
908
|
// this function chooses a primary error.
|
|
@@ -916,7 +916,7 @@ function wt(t) {
|
|
|
916
916
|
|
|
917
917
|
case 400:
|
|
918
918
|
// Bad Request
|
|
919
|
-
return
|
|
919
|
+
return x;
|
|
920
920
|
|
|
921
921
|
// Other possibilities based on the forward mapping
|
|
922
922
|
// return Code.INVALID_ARGUMENT;
|
|
@@ -935,7 +935,7 @@ function wt(t) {
|
|
|
935
935
|
|
|
936
936
|
case 409:
|
|
937
937
|
// Conflict
|
|
938
|
-
return
|
|
938
|
+
return F;
|
|
939
939
|
|
|
940
940
|
// Other possibilities:
|
|
941
941
|
// return Code.ALREADY_EXISTS;
|
|
@@ -949,11 +949,11 @@ function wt(t) {
|
|
|
949
949
|
|
|
950
950
|
case 499:
|
|
951
951
|
// Client Closed Request
|
|
952
|
-
return
|
|
952
|
+
return A;
|
|
953
953
|
|
|
954
954
|
case 500:
|
|
955
955
|
// Internal Server Error
|
|
956
|
-
return
|
|
956
|
+
return I;
|
|
957
957
|
|
|
958
958
|
// Other possibilities:
|
|
959
959
|
// return Code.INTERNAL;
|
|
@@ -971,7 +971,7 @@ function wt(t) {
|
|
|
971
971
|
return P;
|
|
972
972
|
|
|
973
973
|
default:
|
|
974
|
-
return t >= 200 && t < 300 ? T : t >= 400 && t < 500 ?
|
|
974
|
+
return t >= 200 && t < 300 ? T : t >= 400 && t < 500 ? x : t >= 500 && t < 600 ? C : I;
|
|
975
975
|
}
|
|
976
976
|
}
|
|
977
977
|
|
|
@@ -1051,16 +1051,16 @@ class {
|
|
|
1051
1051
|
* @param fetchImpl - `fetch` or a Polyfill that implements the fetch API.
|
|
1052
1052
|
*/
|
|
1053
1053
|
constructor(t, e) {
|
|
1054
|
-
super(t), this.
|
|
1054
|
+
super(t), this.A = e;
|
|
1055
1055
|
}
|
|
1056
|
-
|
|
1056
|
+
I(t, e) {
|
|
1057
1057
|
throw new Error("Not supported by FetchConnection");
|
|
1058
1058
|
}
|
|
1059
1059
|
async v(t, e, n, r) {
|
|
1060
1060
|
const s = JSON.stringify(r);
|
|
1061
1061
|
let i;
|
|
1062
1062
|
try {
|
|
1063
|
-
i = await this.
|
|
1063
|
+
i = await this.A(e, {
|
|
1064
1064
|
method: "POST",
|
|
1065
1065
|
headers: n,
|
|
1066
1066
|
body: s
|
|
@@ -1405,7 +1405,7 @@ function Tt(t, e) {
|
|
|
1405
1405
|
* If foo is not an object, foo is replaced with an object
|
|
1406
1406
|
* containing foo
|
|
1407
1407
|
*/
|
|
1408
|
-
class
|
|
1408
|
+
class At {
|
|
1409
1409
|
constructor(t) {
|
|
1410
1410
|
this.fields = t,
|
|
1411
1411
|
// TODO(dimond): validation of FieldMask
|
|
@@ -1445,7 +1445,7 @@ class It {
|
|
|
1445
1445
|
// WebSafe uses a different URL-encoding safe alphabet that doesn't match
|
|
1446
1446
|
// the encoding used on the backend.
|
|
1447
1447
|
/** Converts a Base64 encoded string to a binary string. */
|
|
1448
|
-
function
|
|
1448
|
+
function It(t) {
|
|
1449
1449
|
return String.fromCharCode.apply(null,
|
|
1450
1450
|
// We use `decodeStringToByteArray()` instead of `decodeString()` since
|
|
1451
1451
|
// `decodeString()` returns Unicode strings, which doesn't match the values
|
|
@@ -1484,7 +1484,7 @@ class Rt {
|
|
|
1484
1484
|
this.binaryString = t;
|
|
1485
1485
|
}
|
|
1486
1486
|
static fromBase64String(t) {
|
|
1487
|
-
const e =
|
|
1487
|
+
const e = It(t);
|
|
1488
1488
|
return new Rt(e);
|
|
1489
1489
|
}
|
|
1490
1490
|
static fromUint8Array(t) {
|
|
@@ -1656,7 +1656,7 @@ const Pt = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
|
|
|
1656
1656
|
|
|
1657
1657
|
/**
|
|
1658
1658
|
* Returns the local time at which this timestamp was first set.
|
|
1659
|
-
*/ function
|
|
1659
|
+
*/ function xt(t) {
|
|
1660
1660
|
const e = Vt(t.mapValue.fields.__local_write_time__.timestampValue);
|
|
1661
1661
|
return new vt(e.seconds, e.nanos);
|
|
1662
1662
|
}
|
|
@@ -1676,7 +1676,7 @@ const Pt = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
|
|
|
1676
1676
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1677
1677
|
* See the License for the specific language governing permissions and
|
|
1678
1678
|
* limitations under the License.
|
|
1679
|
-
*/ const
|
|
1679
|
+
*/ const Ft = {
|
|
1680
1680
|
fields: {
|
|
1681
1681
|
__type__: {
|
|
1682
1682
|
stringValue: "__max__"
|
|
@@ -1726,7 +1726,7 @@ function qt(t) {
|
|
|
1726
1726
|
return t.booleanValue === e.booleanValue;
|
|
1727
1727
|
|
|
1728
1728
|
case 4 /* ServerTimestampValue */ :
|
|
1729
|
-
return
|
|
1729
|
+
return xt(t).isEqual(xt(e));
|
|
1730
1730
|
|
|
1731
1731
|
case 3 /* TimestampValue */ :
|
|
1732
1732
|
return function(t, e) {
|
|
@@ -1808,7 +1808,7 @@ function Lt(t, e) {
|
|
|
1808
1808
|
return kt(t.timestampValue, e.timestampValue);
|
|
1809
1809
|
|
|
1810
1810
|
case 4 /* ServerTimestampValue */ :
|
|
1811
|
-
return kt(
|
|
1811
|
+
return kt(xt(t), xt(e));
|
|
1812
1812
|
|
|
1813
1813
|
case 5 /* StringValue */ :
|
|
1814
1814
|
return _t(t.stringValue, e.stringValue);
|
|
@@ -1848,9 +1848,9 @@ function Lt(t, e) {
|
|
|
1848
1848
|
|
|
1849
1849
|
case 10 /* ObjectValue */ :
|
|
1850
1850
|
return function(t, e) {
|
|
1851
|
-
if (t ===
|
|
1852
|
-
if (t ===
|
|
1853
|
-
if (e ===
|
|
1851
|
+
if (t === Ft && e === Ft) return 0;
|
|
1852
|
+
if (t === Ft) return 1;
|
|
1853
|
+
if (e === Ft) return -1;
|
|
1854
1854
|
const n = t.fields || {}, r = Object.keys(n), s = e.fields || {}, i = Object.keys(s);
|
|
1855
1855
|
// Even though MapValues are likely sorted correctly based on their insertion
|
|
1856
1856
|
// order (e.g. when received from the backend), local modifications can bring
|
|
@@ -2640,12 +2640,12 @@ function pe(t, e) {
|
|
|
2640
2640
|
* applyToLocalView() to implement the actual behavior of applying the mutation
|
|
2641
2641
|
* to some source document (see `setMutationApplyToRemoteDocument()` for an
|
|
2642
2642
|
* example).
|
|
2643
|
-
*/ class
|
|
2643
|
+
*/ class Ae {}
|
|
2644
2644
|
|
|
2645
2645
|
/**
|
|
2646
2646
|
* A mutation that creates or replaces the document at the given key with the
|
|
2647
2647
|
* object value contents.
|
|
2648
|
-
*/ class
|
|
2648
|
+
*/ class Ie extends Ae {
|
|
2649
2649
|
constructor(t, e, n, r = []) {
|
|
2650
2650
|
super(), this.key = t, this.value = e, this.precondition = n, this.fieldTransforms = r,
|
|
2651
2651
|
this.type = 0 /* Set */;
|
|
@@ -2664,14 +2664,14 @@ function pe(t, e) {
|
|
|
2664
2664
|
* is deleted.
|
|
2665
2665
|
* * When a field is not in the mask but is in the values, the values map is
|
|
2666
2666
|
* ignored.
|
|
2667
|
-
*/ class Re extends
|
|
2667
|
+
*/ class Re extends Ae {
|
|
2668
2668
|
constructor(t, e, n, r, s = []) {
|
|
2669
2669
|
super(), this.key = t, this.data = e, this.fieldMask = n, this.precondition = r,
|
|
2670
2670
|
this.fieldTransforms = s, this.type = 1 /* Patch */;
|
|
2671
2671
|
}
|
|
2672
2672
|
}
|
|
2673
2673
|
|
|
2674
|
-
/** A mutation that deletes the document at the given key. */ class Pe extends
|
|
2674
|
+
/** A mutation that deletes the document at the given key. */ class Pe extends Ae {
|
|
2675
2675
|
constructor(t, e) {
|
|
2676
2676
|
super(), this.key = t, this.precondition = e, this.type = 2 /* Delete */ , this.fieldTransforms = [];
|
|
2677
2677
|
}
|
|
@@ -2683,7 +2683,7 @@ function pe(t, e) {
|
|
|
2683
2683
|
*
|
|
2684
2684
|
* The `verify` operation is only used in Transactions, and this class serves
|
|
2685
2685
|
* primarily to facilitate serialization into protos.
|
|
2686
|
-
*/ class Ve extends
|
|
2686
|
+
*/ class Ve extends Ae {
|
|
2687
2687
|
constructor(t, e) {
|
|
2688
2688
|
super(), this.key = t, this.precondition = e, this.type = 3 /* Verify */ , this.fieldTransforms = [];
|
|
2689
2689
|
}
|
|
@@ -2772,11 +2772,11 @@ function Se(t, e) {
|
|
|
2772
2772
|
*
|
|
2773
2773
|
* Visible for testing.
|
|
2774
2774
|
*/
|
|
2775
|
-
function
|
|
2775
|
+
function xe(t, e) {
|
|
2776
2776
|
return t.F ? e.toBase64() : e.toUint8Array();
|
|
2777
2777
|
}
|
|
2778
2778
|
|
|
2779
|
-
function
|
|
2779
|
+
function Fe(t, e) {
|
|
2780
2780
|
return Se(t, e.toTimestamp());
|
|
2781
2781
|
}
|
|
2782
2782
|
|
|
@@ -2841,7 +2841,7 @@ function Me(t, e) {
|
|
|
2841
2841
|
|
|
2842
2842
|
function Be(t, e) {
|
|
2843
2843
|
let n;
|
|
2844
|
-
if (e instanceof
|
|
2844
|
+
if (e instanceof Ie) n = {
|
|
2845
2845
|
update: je(t, e.key, e.value)
|
|
2846
2846
|
}; else if (e instanceof Pe) n = {
|
|
2847
2847
|
delete: Ce(t, e.key)
|
|
@@ -2879,7 +2879,7 @@ function Be(t, e) {
|
|
|
2879
2879
|
throw v();
|
|
2880
2880
|
}(0, t)))), e.precondition.isNone || (n.currentDocument = function(t, e) {
|
|
2881
2881
|
return void 0 !== e.updateTime ? {
|
|
2882
|
-
updateTime:
|
|
2882
|
+
updateTime: Fe(t, e.updateTime)
|
|
2883
2883
|
} : void 0 !== e.exists ? {
|
|
2884
2884
|
exists: e.exists
|
|
2885
2885
|
} : v();
|
|
@@ -3152,18 +3152,18 @@ class Xe extends class {} {
|
|
|
3152
3152
|
this.J = !1;
|
|
3153
3153
|
}
|
|
3154
3154
|
X() {
|
|
3155
|
-
if (this.J) throw new U(
|
|
3155
|
+
if (this.J) throw new U(x, "The client has already been terminated.");
|
|
3156
3156
|
}
|
|
3157
3157
|
/** Invokes the provided RPC with auth and AppCheck tokens. */ m(t, e, n) {
|
|
3158
3158
|
return this.X(), Promise.all([ this.authCredentials.getToken(), this.appCheckCredentials.getToken() ]).then((([r, s]) => this.K.m(t, e, n, r, s))).catch((t => {
|
|
3159
3159
|
throw "FirebaseError" === t.name ? (t.code === $ && (this.authCredentials.invalidateToken(),
|
|
3160
|
-
this.appCheckCredentials.invalidateToken()), t) : new U(
|
|
3160
|
+
this.appCheckCredentials.invalidateToken()), t) : new U(I, t.toString());
|
|
3161
3161
|
}));
|
|
3162
3162
|
}
|
|
3163
3163
|
/** Invokes the provided RPC with streamed results with auth and AppCheck tokens. */ T(t, e, n) {
|
|
3164
3164
|
return this.X(), Promise.all([ this.authCredentials.getToken(), this.appCheckCredentials.getToken() ]).then((([r, s]) => this.K.T(t, e, n, r, s))).catch((t => {
|
|
3165
3165
|
throw "FirebaseError" === t.name ? (t.code === $ && (this.authCredentials.invalidateToken(),
|
|
3166
|
-
this.appCheckCredentials.invalidateToken()), t) : new U(
|
|
3166
|
+
this.appCheckCredentials.invalidateToken()), t) : new U(I, t.toString());
|
|
3167
3167
|
}));
|
|
3168
3168
|
}
|
|
3169
3169
|
terminate() {
|
|
@@ -3236,7 +3236,7 @@ async function en(t, e) {
|
|
|
3236
3236
|
* instance is terminated.
|
|
3237
3237
|
*/
|
|
3238
3238
|
function rn(t) {
|
|
3239
|
-
if (t._terminated) throw new U(
|
|
3239
|
+
if (t._terminated) throw new U(x, "The client has already been terminated.");
|
|
3240
3240
|
if (!nn.has(t)) {
|
|
3241
3241
|
p("ComponentProvider", "Initializing Datastore");
|
|
3242
3242
|
const i = function(t) {
|
|
@@ -3346,7 +3346,7 @@ class sn {
|
|
|
3346
3346
|
* The {@link @firebase/app#FirebaseApp} associated with this `Firestore` service
|
|
3347
3347
|
* instance.
|
|
3348
3348
|
*/ get app() {
|
|
3349
|
-
if (!this._app) throw new U(
|
|
3349
|
+
if (!this._app) throw new U(x, "Firestore was not initialized using the Firebase SDK. 'app' is not available");
|
|
3350
3350
|
return this._app;
|
|
3351
3351
|
}
|
|
3352
3352
|
get _initialized() {
|
|
@@ -3356,7 +3356,7 @@ class sn {
|
|
|
3356
3356
|
return void 0 !== this._terminateTask;
|
|
3357
3357
|
}
|
|
3358
3358
|
_setSettings(t) {
|
|
3359
|
-
if (this._settingsFrozen) throw new U(
|
|
3359
|
+
if (this._settingsFrozen) throw new U(x, "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.");
|
|
3360
3360
|
this._settings = new sn(t), void 0 !== t.credentials && (this._authCredentials = function(t) {
|
|
3361
3361
|
if (!t) return new B;
|
|
3362
3362
|
switch (t.type) {
|
|
@@ -3406,7 +3406,7 @@ class sn {
|
|
|
3406
3406
|
|
|
3407
3407
|
function un(t, e) {
|
|
3408
3408
|
const n = _getProvider(t, "firestore/lite");
|
|
3409
|
-
if (n.isInitialized()) throw new U(
|
|
3409
|
+
if (n.isInitialized()) throw new U(x, "Firestore can only be initialized once per app.");
|
|
3410
3410
|
return n.initialize({
|
|
3411
3411
|
options: e
|
|
3412
3412
|
});
|
|
@@ -3915,14 +3915,14 @@ function pn(t, e, ...n) {
|
|
|
3915
3915
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
3916
3916
|
* See the License for the specific language governing permissions and
|
|
3917
3917
|
* limitations under the License.
|
|
3918
|
-
*/ const
|
|
3918
|
+
*/ const An = /^__.*__$/;
|
|
3919
3919
|
|
|
3920
|
-
/** The result of parsing document data (e.g. for a setData call). */ class
|
|
3920
|
+
/** The result of parsing document data (e.g. for a setData call). */ class In {
|
|
3921
3921
|
constructor(t, e, n) {
|
|
3922
3922
|
this.data = t, this.fieldMask = e, this.fieldTransforms = n;
|
|
3923
3923
|
}
|
|
3924
3924
|
toMutation(t, e) {
|
|
3925
|
-
return null !== this.fieldMask ? new Re(t, this.data, this.fieldMask, e, this.fieldTransforms) : new
|
|
3925
|
+
return null !== this.fieldMask ? new Re(t, this.data, this.fieldMask, e, this.fieldTransforms) : new Ie(t, this.data, e, this.fieldTransforms);
|
|
3926
3926
|
}
|
|
3927
3927
|
}
|
|
3928
3928
|
|
|
@@ -4026,7 +4026,7 @@ function Pn(t) {
|
|
|
4026
4026
|
}
|
|
4027
4027
|
st(t) {
|
|
4028
4028
|
if (0 === t.length) throw this.ut("Document fields must not be empty");
|
|
4029
|
-
if (Pn(this.tt) &&
|
|
4029
|
+
if (Pn(this.tt) && An.test(t)) throw this.ut('Document fields cannot begin and end with "__"');
|
|
4030
4030
|
}
|
|
4031
4031
|
}
|
|
4032
4032
|
|
|
@@ -4059,16 +4059,16 @@ function Dn(t) {
|
|
|
4059
4059
|
zn("Data must be an object, but it was:", o, r);
|
|
4060
4060
|
const u = Mn(r, o);
|
|
4061
4061
|
let c, a;
|
|
4062
|
-
if (i.merge) c = new
|
|
4062
|
+
if (i.merge) c = new At(o.fieldMask), a = o.fieldTransforms; else if (i.mergeFields) {
|
|
4063
4063
|
const t = [];
|
|
4064
4064
|
for (const r of i.mergeFields) {
|
|
4065
4065
|
const s = Gn(e, r, n);
|
|
4066
4066
|
if (!o.contains(s)) throw new U(R, `Field '${s}' is specified in your field mask but missing from your input data.`);
|
|
4067
4067
|
Hn(t, s) || t.push(s);
|
|
4068
4068
|
}
|
|
4069
|
-
c = new
|
|
4069
|
+
c = new At(t), a = o.fieldTransforms.filter((t => c.covers(t.field)));
|
|
4070
4070
|
} else c = null, a = o.fieldTransforms;
|
|
4071
|
-
return new
|
|
4071
|
+
return new In(new Qt(u), c, a);
|
|
4072
4072
|
}
|
|
4073
4073
|
|
|
4074
4074
|
class Sn extends En {
|
|
@@ -4098,7 +4098,7 @@ class Sn extends En {
|
|
|
4098
4098
|
* context.
|
|
4099
4099
|
* @param context - The parent context.
|
|
4100
4100
|
* @param arrayElement - Whether or not the FieldValue has an array.
|
|
4101
|
-
*/ function
|
|
4101
|
+
*/ function xn(t, e, n) {
|
|
4102
4102
|
return new Vn({
|
|
4103
4103
|
tt: 3 /* Argument */ ,
|
|
4104
4104
|
at: e.settings.at,
|
|
@@ -4107,12 +4107,12 @@ class Sn extends En {
|
|
|
4107
4107
|
}, e.databaseId, e.q, e.ignoreUndefinedProperties);
|
|
4108
4108
|
}
|
|
4109
4109
|
|
|
4110
|
-
class
|
|
4110
|
+
class Fn extends En {
|
|
4111
4111
|
_toFieldTransform(t) {
|
|
4112
4112
|
return new Ee(t.path, new _e);
|
|
4113
4113
|
}
|
|
4114
4114
|
isEqual(t) {
|
|
4115
|
-
return t instanceof
|
|
4115
|
+
return t instanceof Fn;
|
|
4116
4116
|
}
|
|
4117
4117
|
}
|
|
4118
4118
|
|
|
@@ -4121,7 +4121,7 @@ class qn extends En {
|
|
|
4121
4121
|
super(t), this.lt = e;
|
|
4122
4122
|
}
|
|
4123
4123
|
_toFieldTransform(t) {
|
|
4124
|
-
const e =
|
|
4124
|
+
const e = xn(this, t,
|
|
4125
4125
|
/*array=*/ !0), n = this.lt.map((t => jn(t, e))), r = new ge(n);
|
|
4126
4126
|
return new Ee(t.path, r);
|
|
4127
4127
|
}
|
|
@@ -4136,7 +4136,7 @@ class On extends En {
|
|
|
4136
4136
|
super(t), this.lt = e;
|
|
4137
4137
|
}
|
|
4138
4138
|
_toFieldTransform(t) {
|
|
4139
|
-
const e =
|
|
4139
|
+
const e = xn(this, t,
|
|
4140
4140
|
/*array=*/ !0), n = this.lt.map((t => jn(t, e))), r = new ve(n);
|
|
4141
4141
|
return new Ee(t.path, r);
|
|
4142
4142
|
}
|
|
@@ -4177,7 +4177,7 @@ class Cn extends En {
|
|
|
4177
4177
|
null != t && (i.push(u), o.set(u, t));
|
|
4178
4178
|
}
|
|
4179
4179
|
}));
|
|
4180
|
-
const u = new
|
|
4180
|
+
const u = new At(i);
|
|
4181
4181
|
return new Rn(o, u, s.fieldTransforms);
|
|
4182
4182
|
}
|
|
4183
4183
|
|
|
@@ -4202,7 +4202,7 @@ class Cn extends En {
|
|
|
4202
4202
|
null != t && (a.push(e), h.set(e, t));
|
|
4203
4203
|
}
|
|
4204
4204
|
}
|
|
4205
|
-
const f = new
|
|
4205
|
+
const f = new At(a);
|
|
4206
4206
|
return new Rn(h, f, o.fieldTransforms);
|
|
4207
4207
|
}
|
|
4208
4208
|
|
|
@@ -4319,7 +4319,7 @@ class Cn extends En {
|
|
|
4319
4319
|
}
|
|
4320
4320
|
};
|
|
4321
4321
|
if (t instanceof bn) return {
|
|
4322
|
-
bytesValue:
|
|
4322
|
+
bytesValue: xe(e.q, t._byteString)
|
|
4323
4323
|
};
|
|
4324
4324
|
if (t instanceof ln) {
|
|
4325
4325
|
const n = e.databaseId, r = t.firestore._databaseId;
|
|
@@ -5028,7 +5028,7 @@ class br extends class {
|
|
|
5028
5028
|
return null == n ? null : this.convertValue(n, e);
|
|
5029
5029
|
|
|
5030
5030
|
case "estimate":
|
|
5031
|
-
return this.convertTimestamp(
|
|
5031
|
+
return this.convertTimestamp(xt(t));
|
|
5032
5032
|
|
|
5033
5033
|
default:
|
|
5034
5034
|
return null;
|
|
@@ -5107,12 +5107,12 @@ class br extends class {
|
|
|
5107
5107
|
}));
|
|
5108
5108
|
}
|
|
5109
5109
|
|
|
5110
|
-
function
|
|
5110
|
+
function Ar(t, e, n) {
|
|
5111
5111
|
const r = vr((t = ut(t, ln)).converter, e, n), s = $n(Dn(t.firestore), "setDoc", t._key, r, null !== t.converter, n);
|
|
5112
5112
|
return Ze(rn(t.firestore), [ s.toMutation(t._key, Te.none()) ]);
|
|
5113
5113
|
}
|
|
5114
5114
|
|
|
5115
|
-
function
|
|
5115
|
+
function Ir(t, e, n, ...r) {
|
|
5116
5116
|
const s = Dn((t = ut(t, ln)).firestore);
|
|
5117
5117
|
// For Compat types, we have to "extract" the underlying types before
|
|
5118
5118
|
// performing validation.
|
|
@@ -5182,7 +5182,7 @@ function Ar(t, e, n, ...r) {
|
|
|
5182
5182
|
* Returns a sentinel used with {@link @firebase/firestore/lite#(setDoc:1)} or {@link @firebase/firestore/lite#(updateDoc:1)} to
|
|
5183
5183
|
* include a server-generated timestamp in the written data.
|
|
5184
5184
|
*/ function Nr() {
|
|
5185
|
-
return new
|
|
5185
|
+
return new Fn("serverTimestamp");
|
|
5186
5186
|
}
|
|
5187
5187
|
|
|
5188
5188
|
/**
|
|
@@ -5263,7 +5263,7 @@ function Ar(t, e, n, ...r) {
|
|
|
5263
5263
|
* provides methods for adding writes to the write batch. None of the writes
|
|
5264
5264
|
* will be committed (or visible locally) until {@link WriteBatch.commit} is
|
|
5265
5265
|
* called.
|
|
5266
|
-
*/ class
|
|
5266
|
+
*/ class xr {
|
|
5267
5267
|
/** @hideconstructor */
|
|
5268
5268
|
constructor(t, e) {
|
|
5269
5269
|
this._firestore = t, this._commitHandler = e, this._mutations = [], this._committed = !1,
|
|
@@ -5271,12 +5271,12 @@ function Ar(t, e, n, ...r) {
|
|
|
5271
5271
|
}
|
|
5272
5272
|
set(t, e, n) {
|
|
5273
5273
|
this._verifyNotCommitted();
|
|
5274
|
-
const r =
|
|
5274
|
+
const r = Fr(t, this._firestore), s = vr(r.converter, e, n), i = $n(this._dataReader, "WriteBatch.set", r._key, s, null !== r.converter, n);
|
|
5275
5275
|
return this._mutations.push(i.toMutation(r._key, Te.none())), this;
|
|
5276
5276
|
}
|
|
5277
5277
|
update(t, e, n, ...r) {
|
|
5278
5278
|
this._verifyNotCommitted();
|
|
5279
|
-
const s =
|
|
5279
|
+
const s = Fr(t, this._firestore);
|
|
5280
5280
|
// For Compat types, we have to "extract" the underlying types before
|
|
5281
5281
|
// performing validation.
|
|
5282
5282
|
let i;
|
|
@@ -5290,7 +5290,7 @@ function Ar(t, e, n, ...r) {
|
|
|
5290
5290
|
* @returns This `WriteBatch` instance. Used for chaining method calls.
|
|
5291
5291
|
*/ delete(t) {
|
|
5292
5292
|
this._verifyNotCommitted();
|
|
5293
|
-
const e =
|
|
5293
|
+
const e = Fr(t, this._firestore);
|
|
5294
5294
|
return this._mutations = this._mutations.concat(new Pe(e._key, Te.none())), this;
|
|
5295
5295
|
}
|
|
5296
5296
|
/**
|
|
@@ -5308,11 +5308,11 @@ function Ar(t, e, n, ...r) {
|
|
|
5308
5308
|
return this._verifyNotCommitted(), this._committed = !0, this._mutations.length > 0 ? this._commitHandler(this._mutations) : Promise.resolve();
|
|
5309
5309
|
}
|
|
5310
5310
|
_verifyNotCommitted() {
|
|
5311
|
-
if (this._committed) throw new U(
|
|
5311
|
+
if (this._committed) throw new U(x, "A write batch can no longer be used after commit() has been called.");
|
|
5312
5312
|
}
|
|
5313
5313
|
}
|
|
5314
5314
|
|
|
5315
|
-
function
|
|
5315
|
+
function Fr(t, e) {
|
|
5316
5316
|
if ((t = l(t)).firestore !== e) throw new U(R, "Provided document reference is from a different Firestore instance.");
|
|
5317
5317
|
return t;
|
|
5318
5318
|
}
|
|
@@ -5331,7 +5331,7 @@ function xr(t, e) {
|
|
|
5331
5331
|
* writes.
|
|
5332
5332
|
*/ function qr(t) {
|
|
5333
5333
|
const e = rn(t = ut(t, on));
|
|
5334
|
-
return new
|
|
5334
|
+
return new xr(t, (t => Ze(e, t)));
|
|
5335
5335
|
}
|
|
5336
5336
|
|
|
5337
5337
|
/**
|
|
@@ -5415,7 +5415,7 @@ function xr(t, e) {
|
|
|
5415
5415
|
if (n) {
|
|
5416
5416
|
if (!e.isEqual(n))
|
|
5417
5417
|
// This transaction will fail no matter what.
|
|
5418
|
-
throw new U(
|
|
5418
|
+
throw new U(F, "Document version changed between two reads.");
|
|
5419
5419
|
} else this.readVersions.set(t.key.toString(), e);
|
|
5420
5420
|
}
|
|
5421
5421
|
/**
|
|
@@ -5456,6 +5456,25 @@ function xr(t, e) {
|
|
|
5456
5456
|
ensureCommitNotCalled() {}
|
|
5457
5457
|
}
|
|
5458
5458
|
|
|
5459
|
+
/**
|
|
5460
|
+
* @license
|
|
5461
|
+
* Copyright 2022 Google LLC
|
|
5462
|
+
*
|
|
5463
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5464
|
+
* you may not use this file except in compliance with the License.
|
|
5465
|
+
* You may obtain a copy of the License at
|
|
5466
|
+
*
|
|
5467
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
5468
|
+
*
|
|
5469
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
5470
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
5471
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
5472
|
+
* See the License for the specific language governing permissions and
|
|
5473
|
+
* limitations under the License.
|
|
5474
|
+
*/ const Cr = {
|
|
5475
|
+
maxAttempts: 5
|
|
5476
|
+
};
|
|
5477
|
+
|
|
5459
5478
|
/**
|
|
5460
5479
|
* @license
|
|
5461
5480
|
* Copyright 2019 Google LLC
|
|
@@ -5476,16 +5495,16 @@ function xr(t, e) {
|
|
|
5476
5495
|
* TransactionRunner encapsulates the logic needed to run and retry transactions
|
|
5477
5496
|
* with backoff.
|
|
5478
5497
|
*/
|
|
5479
|
-
class
|
|
5480
|
-
constructor(t, e, n, r) {
|
|
5481
|
-
this.asyncQueue = t, this.datastore = e, this.
|
|
5482
|
-
this.Tt =
|
|
5498
|
+
class Lr {
|
|
5499
|
+
constructor(t, e, n, r, s) {
|
|
5500
|
+
this.asyncQueue = t, this.datastore = e, this.options = n, this.updateFunction = r,
|
|
5501
|
+
this.deferred = s, this.Tt = n.maxAttempts, this.At = new Je(this.asyncQueue, "transaction_retry" /* TransactionRetry */);
|
|
5483
5502
|
}
|
|
5484
5503
|
/** Runs the transaction and sets the result on deferred. */ run() {
|
|
5485
|
-
this.Tt -= 1, this.
|
|
5504
|
+
this.Tt -= 1, this.It();
|
|
5486
5505
|
}
|
|
5487
|
-
|
|
5488
|
-
this.
|
|
5506
|
+
It() {
|
|
5507
|
+
this.At.W((async () => {
|
|
5489
5508
|
const t = new Or(this.datastore), e = this.Rt(t);
|
|
5490
5509
|
e && e.then((e => {
|
|
5491
5510
|
this.asyncQueue.enqueueAndForget((() => t.commit().then((() => {
|
|
@@ -5509,7 +5528,7 @@ class Cr {
|
|
|
5509
5528
|
}
|
|
5510
5529
|
}
|
|
5511
5530
|
Pt(t) {
|
|
5512
|
-
this.Tt > 0 && this.Vt(t) ? (this.Tt -= 1, this.asyncQueue.enqueueAndForget((() => (this.
|
|
5531
|
+
this.Tt > 0 && this.Vt(t) ? (this.Tt -= 1, this.asyncQueue.enqueueAndForget((() => (this.It(),
|
|
5513
5532
|
Promise.resolve())))) : this.deferred.reject(t);
|
|
5514
5533
|
}
|
|
5515
5534
|
Vt(t) {
|
|
@@ -5529,8 +5548,8 @@ class Cr {
|
|
|
5529
5548
|
default:
|
|
5530
5549
|
return v();
|
|
5531
5550
|
|
|
5532
|
-
case I:
|
|
5533
5551
|
case A:
|
|
5552
|
+
case I:
|
|
5534
5553
|
case P:
|
|
5535
5554
|
case S:
|
|
5536
5555
|
case C:
|
|
@@ -5544,11 +5563,11 @@ class Cr {
|
|
|
5544
5563
|
case V:
|
|
5545
5564
|
case N:
|
|
5546
5565
|
case D:
|
|
5547
|
-
case
|
|
5566
|
+
case x:
|
|
5548
5567
|
// Aborted might be retried in some scenarios, but that is dependant on
|
|
5549
5568
|
// the context and should handled individually by the calling code.
|
|
5550
5569
|
// See https://cloud.google.com/apis/design/errors.
|
|
5551
|
-
case
|
|
5570
|
+
case F:
|
|
5552
5571
|
case q:
|
|
5553
5572
|
case O:
|
|
5554
5573
|
case k:
|
|
@@ -5576,7 +5595,7 @@ class Cr {
|
|
|
5576
5595
|
* See the License for the specific language governing permissions and
|
|
5577
5596
|
* limitations under the License.
|
|
5578
5597
|
*/
|
|
5579
|
-
/** The Platform's 'document' implementation or null if not available. */ function
|
|
5598
|
+
/** The Platform's 'document' implementation or null if not available. */ function kr() {
|
|
5580
5599
|
// `document` is not always available, e.g. in ReactNative and WebWorkers.
|
|
5581
5600
|
// eslint-disable-next-line no-restricted-globals
|
|
5582
5601
|
return "undefined" != typeof document ? document : null;
|
|
@@ -5608,7 +5627,7 @@ class Cr {
|
|
|
5608
5627
|
* Note: We implement `PromiseLike` instead of `Promise`, as the `Promise` type
|
|
5609
5628
|
* in newer versions of TypeScript defines `finally`, which is not available in
|
|
5610
5629
|
* IE.
|
|
5611
|
-
*/ class
|
|
5630
|
+
*/ class Ur {
|
|
5612
5631
|
constructor(t, e, n, r, s) {
|
|
5613
5632
|
this.asyncQueue = t, this.timerId = e, this.targetTimeMs = n, this.op = r, this.removalCallback = s,
|
|
5614
5633
|
this.deferred = new j, this.then = this.deferred.promise.then.bind(this.deferred.promise),
|
|
@@ -5631,7 +5650,7 @@ class Cr {
|
|
|
5631
5650
|
* PORTING NOTE: This exists to prevent making removeDelayedOperation() and
|
|
5632
5651
|
* the DelayedOperation class public.
|
|
5633
5652
|
*/ static createAndSchedule(t, e, n, r, s) {
|
|
5634
|
-
const i = Date.now() + n, o = new
|
|
5653
|
+
const i = Date.now() + n, o = new Ur(t, e, i, r, s);
|
|
5635
5654
|
return o.start(n), o;
|
|
5636
5655
|
}
|
|
5637
5656
|
/**
|
|
@@ -5653,7 +5672,7 @@ class Cr {
|
|
|
5653
5672
|
* As long as the operation has not yet been run, calling cancel() provides a
|
|
5654
5673
|
* guarantee that the operation will not be run.
|
|
5655
5674
|
*/ cancel(t) {
|
|
5656
|
-
null !== this.timerHandle && (this.clearTimeout(), this.deferred.reject(new U(
|
|
5675
|
+
null !== this.timerHandle && (this.clearTimeout(), this.deferred.reject(new U(A, "Operation cancelled" + (t ? ": " + t : ""))));
|
|
5657
5676
|
}
|
|
5658
5677
|
handleDelayElapsed() {
|
|
5659
5678
|
this.asyncQueue.enqueueAndForget((() => null !== this.timerHandle ? (this.clearTimeout(),
|
|
@@ -5680,7 +5699,7 @@ class Cr {
|
|
|
5680
5699
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
5681
5700
|
* See the License for the specific language governing permissions and
|
|
5682
5701
|
* limitations under the License.
|
|
5683
|
-
*/ class
|
|
5702
|
+
*/ class jr {
|
|
5684
5703
|
constructor() {
|
|
5685
5704
|
// The last promise in the queue.
|
|
5686
5705
|
this.Nt = Promise.resolve(),
|
|
@@ -5694,24 +5713,24 @@ class Cr {
|
|
|
5694
5713
|
// automatically removed after they are run or canceled.
|
|
5695
5714
|
this.St = [],
|
|
5696
5715
|
// visible for testing
|
|
5697
|
-
this.
|
|
5716
|
+
this.xt = null,
|
|
5698
5717
|
// Flag set while there's an outstanding AsyncQueue operation, used for
|
|
5699
5718
|
// assertion sanity-checks.
|
|
5700
|
-
this.
|
|
5719
|
+
this.Ft = !1,
|
|
5701
5720
|
// Enabled during shutdown on Safari to prevent future access to IndexedDB.
|
|
5702
5721
|
this.qt = !1,
|
|
5703
5722
|
// List of TimerIds to fast-forward delays for.
|
|
5704
5723
|
this.Ot = [],
|
|
5705
5724
|
// Backoff timer used to schedule retries for retryable operations
|
|
5706
|
-
this.
|
|
5725
|
+
this.At = new Je(this, "async_queue_retry" /* AsyncQueueRetry */),
|
|
5707
5726
|
// Visibility handler that triggers an immediate retry of all retryable
|
|
5708
5727
|
// operations. Meant to speed up recovery when we regain file system access
|
|
5709
5728
|
// after page comes into foreground.
|
|
5710
5729
|
this.Ct = () => {
|
|
5711
|
-
const t =
|
|
5712
|
-
t && p("AsyncQueue", "Visibility state changed to " + t.visibilityState), this.
|
|
5730
|
+
const t = kr();
|
|
5731
|
+
t && p("AsyncQueue", "Visibility state changed to " + t.visibilityState), this.At.H();
|
|
5713
5732
|
};
|
|
5714
|
-
const t =
|
|
5733
|
+
const t = kr();
|
|
5715
5734
|
t && "function" == typeof t.addEventListener && t.addEventListener("visibilitychange", this.Ct);
|
|
5716
5735
|
}
|
|
5717
5736
|
get isShuttingDown() {
|
|
@@ -5732,7 +5751,7 @@ class Cr {
|
|
|
5732
5751
|
enterRestrictedMode(t) {
|
|
5733
5752
|
if (!this.$t) {
|
|
5734
5753
|
this.$t = !0, this.qt = t || !1;
|
|
5735
|
-
const e =
|
|
5754
|
+
const e = kr();
|
|
5736
5755
|
e && "function" == typeof e.removeEventListener && e.removeEventListener("visibilitychange", this.Ct);
|
|
5737
5756
|
}
|
|
5738
5757
|
}
|
|
@@ -5756,7 +5775,7 @@ class Cr {
|
|
|
5756
5775
|
*/ async Ut() {
|
|
5757
5776
|
if (0 !== this.Dt.length) {
|
|
5758
5777
|
try {
|
|
5759
|
-
await this.Dt[0](), this.Dt.shift(), this.
|
|
5778
|
+
await this.Dt[0](), this.Dt.shift(), this.At.reset();
|
|
5760
5779
|
} catch (t) {
|
|
5761
5780
|
if (!
|
|
5762
5781
|
/**
|
|
@@ -5811,12 +5830,12 @@ class Cr {
|
|
|
5811
5830
|
// Since `backoffAndRun()` cancels an existing backoff and schedules a
|
|
5812
5831
|
// new backoff on every call, there is only ever a single additional
|
|
5813
5832
|
// operation in the queue.
|
|
5814
|
-
this.
|
|
5833
|
+
this.At.W((() => this.Ut()));
|
|
5815
5834
|
}
|
|
5816
5835
|
}
|
|
5817
5836
|
kt(t) {
|
|
5818
|
-
const e = this.Nt.then((() => (this.
|
|
5819
|
-
this.
|
|
5837
|
+
const e = this.Nt.then((() => (this.Ft = !0, t().catch((t => {
|
|
5838
|
+
this.xt = t, this.Ft = !1;
|
|
5820
5839
|
const e =
|
|
5821
5840
|
/**
|
|
5822
5841
|
* Chrome includes Error.message in Error.stack. Other browsers do not.
|
|
@@ -5857,18 +5876,18 @@ class Cr {
|
|
|
5857
5876
|
// all further attempts to chain (via .then) will just short-circuit
|
|
5858
5877
|
// and return the rejected Promise.
|
|
5859
5878
|
throw y("INTERNAL UNHANDLED ERROR: ", e), t;
|
|
5860
|
-
})).then((t => (this.
|
|
5879
|
+
})).then((t => (this.Ft = !1, t))))));
|
|
5861
5880
|
return this.Nt = e, e;
|
|
5862
5881
|
}
|
|
5863
5882
|
enqueueAfterDelay(t, e, n) {
|
|
5864
5883
|
this.Lt(),
|
|
5865
5884
|
// Fast-forward delays for timerIds that have been overriden.
|
|
5866
5885
|
this.Ot.indexOf(t) > -1 && (e = 0);
|
|
5867
|
-
const r =
|
|
5886
|
+
const r = Ur.createAndSchedule(this, t, e, n, (t => this.jt(t)));
|
|
5868
5887
|
return this.St.push(r), r;
|
|
5869
5888
|
}
|
|
5870
5889
|
Lt() {
|
|
5871
|
-
this.
|
|
5890
|
+
this.xt && v();
|
|
5872
5891
|
}
|
|
5873
5892
|
verifyOperationInProgress() {}
|
|
5874
5893
|
/**
|
|
@@ -5918,7 +5937,7 @@ class Cr {
|
|
|
5918
5937
|
}
|
|
5919
5938
|
}
|
|
5920
5939
|
|
|
5921
|
-
class
|
|
5940
|
+
class Mr {
|
|
5922
5941
|
/** @hideconstructor */
|
|
5923
5942
|
constructor(t, e) {
|
|
5924
5943
|
this._firestore = t, this._transaction = e, this._dataReader = Dn(t);
|
|
@@ -5929,7 +5948,7 @@ class jr {
|
|
|
5929
5948
|
* @param documentRef - A reference to the document to be read.
|
|
5930
5949
|
* @returns A `DocumentSnapshot` with the read data.
|
|
5931
5950
|
*/ get(t) {
|
|
5932
|
-
const e =
|
|
5951
|
+
const e = Fr(t, this._firestore), n = new br(this._firestore);
|
|
5933
5952
|
return this._transaction.lookup([ e._key ]).then((t => {
|
|
5934
5953
|
if (!t || 1 !== t.length) return v();
|
|
5935
5954
|
const r = t[0];
|
|
@@ -5939,11 +5958,11 @@ class jr {
|
|
|
5939
5958
|
}));
|
|
5940
5959
|
}
|
|
5941
5960
|
set(t, e, n) {
|
|
5942
|
-
const r =
|
|
5961
|
+
const r = Fr(t, this._firestore), s = vr(r.converter, e, n), i = $n(this._dataReader, "Transaction.set", r._key, s, null !== r.converter, n);
|
|
5943
5962
|
return this._transaction.set(r._key, i), this;
|
|
5944
5963
|
}
|
|
5945
5964
|
update(t, e, n, ...r) {
|
|
5946
|
-
const s =
|
|
5965
|
+
const s = Fr(t, this._firestore);
|
|
5947
5966
|
// For Compat types, we have to "extract" the underlying types before
|
|
5948
5967
|
// performing validation.
|
|
5949
5968
|
let i;
|
|
@@ -5956,7 +5975,7 @@ class jr {
|
|
|
5956
5975
|
* @param documentRef - A reference to the document to be deleted.
|
|
5957
5976
|
* @returns This `Transaction` instance. Used for chaining method calls.
|
|
5958
5977
|
*/ delete(t) {
|
|
5959
|
-
const e =
|
|
5978
|
+
const e = Fr(t, this._firestore);
|
|
5960
5979
|
return this._transaction.delete(e._key), this;
|
|
5961
5980
|
}
|
|
5962
5981
|
}
|
|
@@ -5977,9 +5996,13 @@ class jr {
|
|
|
5977
5996
|
* (the `updateFunction` returned a failed promise), the promise returned by the
|
|
5978
5997
|
* `updateFunction `is returned here. Otherwise, if the transaction failed, a
|
|
5979
5998
|
* rejected promise with the corresponding failure error is returned.
|
|
5980
|
-
*/ function
|
|
5981
|
-
const
|
|
5982
|
-
|
|
5999
|
+
*/ function Br(t, e, n) {
|
|
6000
|
+
const r = rn(t = ut(t, on)), s = Object.assign(Object.assign({}, Cr), n);
|
|
6001
|
+
!function(t) {
|
|
6002
|
+
if (t.maxAttempts < 1) throw new U(R, "Max attempts must be at least 1");
|
|
6003
|
+
}(s);
|
|
6004
|
+
const i = new j;
|
|
6005
|
+
return new Lr(new jr, r, s, (n => e(new Mr(t, n))), i).run(), i.promise;
|
|
5983
6006
|
}
|
|
5984
6007
|
|
|
5985
6008
|
/**
|
|
@@ -5996,7 +6019,7 @@ class jr {
|
|
|
5996
6019
|
return e && r._setSettings(e), r;
|
|
5997
6020
|
}), "PUBLIC")),
|
|
5998
6021
|
// RUNTIME_ENV and BUILD_TARGET are replaced by real values during the compilation
|
|
5999
|
-
r("firestore-lite", "3.4.8-canary.
|
|
6022
|
+
r("firestore-lite", "3.4.8-canary.63caee2a5", "rn"), r("firestore-lite", "3.4.8-canary.63caee2a5", "esm2017");
|
|
6000
6023
|
|
|
6001
|
-
export { bn as Bytes, dn as CollectionReference, ln as DocumentReference, Kn as DocumentSnapshot, gn as FieldPath, En as FieldValue, on as Firestore, U as FirestoreError, Tn as GeoPoint, fn as Query, er as QueryConstraint, Jn as QueryDocumentSnapshot, Xn as QuerySnapshot, vt as Timestamp,
|
|
6024
|
+
export { bn as Bytes, dn as CollectionReference, ln as DocumentReference, Kn as DocumentSnapshot, gn as FieldPath, En as FieldValue, on as Firestore, U as FirestoreError, Tn as GeoPoint, fn as Query, er as QueryConstraint, Jn as QueryDocumentSnapshot, Xn as QuerySnapshot, vt as Timestamp, Mr as Transaction, xr as WriteBatch, Pr as addDoc, $r as arrayRemove, Dr as arrayUnion, wn as collection, mn as collectionGroup, an as connectFirestoreEmulator, Rr as deleteDoc, Vr as deleteField, pn as doc, vn as documentId, mr as endAt, wr as endBefore, Er as getDoc, Tr as getDocs, cn as getFirestore, Sr as increment, un as initializeFirestore, cr as limit, ar as limitToLast, or as orderBy, nr as query, _n as queryEqual, yn as refEqual, Br as runTransaction, Nr as serverTimestamp, Ar as setDoc, m as setLogLevel, Zn as snapshotEqual, fr as startAfter, lr as startAt, hn as terminate, Ir as updateDoc, sr as where, qr as writeBatch };
|
|
6002
6025
|
//# sourceMappingURL=index.rn.esm2017.js.map
|