@stoker-platform/web-client 0.3.0 → 0.4.1
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/bundle.js +290 -290
- package/package.json +3 -3
package/dist/bundle.js
CHANGED
|
@@ -2,13 +2,13 @@ import { getApp as nt, registerVersion as xm, initializeApp as Wn, setLogLevel a
|
|
|
2
2
|
import { isSupported as Fm, initializeAnalytics as Dm, setConsent as Mm } from "firebase/analytics";
|
|
3
3
|
import { getAuth as dr, validatePassword as gd, initializeAuth as bc, indexedDBLocalPersistence as Pm, browserLocalPersistence as qm, browserSessionPersistence as Oc, inMemoryPersistence as Ec, beforeAuthStateChanged as Lm, connectAuthEmulator as $m, onAuthStateChanged as zn, getIdTokenResult as jm, signOut as _d, signInWithEmailAndPassword as Um, getMultiFactorResolver as Vm, TotpMultiFactorGenerator as Qa, signInWithCustomToken as Wm, multiFactor as Sc } from "firebase/auth";
|
|
4
4
|
import { getDatabase as vd, onValue as zm, ref as Bm, connectDatabaseEmulator as Zm } from "firebase/database";
|
|
5
|
-
import { getFirestore as Ue, where as ge, query as pe, collection as Pr, and as Qr, or as Tc, onSnapshot as hr, doc as Ae, Timestamp as
|
|
5
|
+
import { getFirestore as Ue, where as ge, query as pe, collection as Pr, and as Qr, or as Tc, onSnapshot as hr, doc as Ae, Timestamp as Bt, setDoc as Gm, getDoc as wd, orderBy as et, limit as er, startAfter as Xa, endBefore as eo, limitToLast as xr, getDocsFromCache as bd, getDocsFromServer as Hm, getDocs as Km, getCountFromServer as Od, getDocFromCache as Ym, getDocFromServer as Jm, writeBatch as Ao, serverTimestamp as qr, deleteField as Rn, arrayRemove as Co, arrayUnion as ko, collectionGroup as Qm, connectFirestoreEmulator as Rc, persistentLocalCache as Ac, persistentSingleTabManager as Cc, persistentMultipleTabManager as kc, memoryEagerGarbageCollector as Xm, memoryLruGarbageCollector as ep, memoryLocalCache as tp, initializeFirestore as Bn, getPersistentCacheIndexManager as rp, enablePersistentCacheIndexAutoCreation as np, terminate as sp, clearIndexedDbPersistence as Ic, waitForPendingWrites as ip, onSnapshotsInSync as Ed, startAt as ap, endAt as op, addDoc as Sd } from "firebase/firestore";
|
|
6
6
|
import { connectStorageEmulator as cp, getStorage as lp } from "firebase/storage";
|
|
7
7
|
import { getFunctions as je, httpsCallable as Ye, connectFunctionsEmulator as up } from "firebase/functions";
|
|
8
8
|
import { ReCaptchaEnterpriseProvider as fp, initializeAppCheck as Zn, onTokenChanged as Gn } from "firebase/app-check";
|
|
9
9
|
import { getPerformance as dp } from "firebase/performance";
|
|
10
10
|
import { getRemoteConfig as hp, fetchAndActivate as mp } from "firebase/remote-config";
|
|
11
|
-
const pp = "0.
|
|
11
|
+
const pp = "0.4.1", yp = (r) => !!r.auth, _t = (r, e) => {
|
|
12
12
|
if (e?.operations)
|
|
13
13
|
return e.operations.includes(r);
|
|
14
14
|
}, An = (r, e) => e ? e.Role ? r.access?.includes(e.Role) : !1 : !0, gp = (r, e) => r.restrictCreate === !0 ? !1 : e && typeof r.restrictCreate == "object" ? e.Role ? r.restrictCreate?.includes(e.Role) : !1 : !0, _p = (r, e) => r.restrictUpdate === !0 ? !1 : e && typeof r.restrictUpdate == "object" ? e.Role ? r.restrictUpdate?.includes(e.Role) : !1 : !0, ne = (r, e) => r.filter((t) => t.name === e)[0], _e = (r) => ["OneToOne", "OneToMany", "ManyToOne", "ManyToMany"].includes(r.type), Td = (r, e) => {
|
|
@@ -83,19 +83,19 @@ const pp = "0.2.9", yp = (r) => !!r.auth, _t = (r, e) => {
|
|
|
83
83
|
u?.filter((S) => S.type === "Individual").forEach(() => {
|
|
84
84
|
h = !0, o.individualEntities?.includes(i.id) || (d = !1);
|
|
85
85
|
});
|
|
86
|
-
let m = !0,
|
|
86
|
+
let m = !0, b = !1;
|
|
87
87
|
if (u?.filter((S) => S.type === "Parent").forEach((S) => {
|
|
88
|
-
|
|
88
|
+
b = !0;
|
|
89
89
|
const E = ne(a, S.collectionField);
|
|
90
90
|
o.parentEntities?.some((x) => i[`${E.name}_Array`].includes(x)) || (m = !1);
|
|
91
91
|
}), u?.filter((S) => S.type === "Parent_Property").forEach((S) => {
|
|
92
|
-
|
|
92
|
+
b = !0;
|
|
93
93
|
const E = ne(a, S.collectionField), x = ne(a, S.propertyField);
|
|
94
94
|
Object.entries(o.parentPropertyEntities || {}).some((C) => {
|
|
95
95
|
const [_, k] = C;
|
|
96
96
|
return _ === i[x.name] && i[`${E.name}_Array`].some((p) => k.includes(p));
|
|
97
97
|
}) || (m = !1);
|
|
98
|
-
}), h &&
|
|
98
|
+
}), h && b) {
|
|
99
99
|
if (!(d || m)) {
|
|
100
100
|
c = !1;
|
|
101
101
|
return;
|
|
@@ -152,7 +152,7 @@ const pp = "0.2.9", yp = (r) => !!r.auth, _t = (r, e) => {
|
|
|
152
152
|
_t(r, o) || (c = !1);
|
|
153
153
|
const u = Io(e, s)?.filter((f) => f.type === "Individual").length > 0;
|
|
154
154
|
return r === "Create" && u && (c = !1), vp(r, e, t, n, s, i) || (c = !1), c;
|
|
155
|
-
},
|
|
155
|
+
}, jt = (r, e, t) => {
|
|
156
156
|
const n = [];
|
|
157
157
|
for (const s of r.fields)
|
|
158
158
|
if (_e(s)) {
|
|
@@ -451,7 +451,7 @@ function Dp() {
|
|
|
451
451
|
return _s = r, _s;
|
|
452
452
|
}
|
|
453
453
|
var vs, rl;
|
|
454
|
-
function
|
|
454
|
+
function Zt() {
|
|
455
455
|
if (rl) return vs;
|
|
456
456
|
rl = 1;
|
|
457
457
|
var r = Fp(), e = Dp();
|
|
@@ -465,14 +465,14 @@ var ws, nl;
|
|
|
465
465
|
function No() {
|
|
466
466
|
if (nl) return ws;
|
|
467
467
|
nl = 1;
|
|
468
|
-
var r =
|
|
468
|
+
var r = Zt(), e = ct(), t = r(e, "Map");
|
|
469
469
|
return ws = t, ws;
|
|
470
470
|
}
|
|
471
471
|
var bs, sl;
|
|
472
472
|
function Nn() {
|
|
473
473
|
if (sl) return bs;
|
|
474
474
|
sl = 1;
|
|
475
|
-
var r =
|
|
475
|
+
var r = Zt(), e = r(Object, "create");
|
|
476
476
|
return bs = e, bs;
|
|
477
477
|
}
|
|
478
478
|
var Os, il;
|
|
@@ -726,9 +726,9 @@ function Id() {
|
|
|
726
726
|
var d = c & n, h = a.length, m = o.length;
|
|
727
727
|
if (h != m && !(d && m > h))
|
|
728
728
|
return !1;
|
|
729
|
-
var
|
|
730
|
-
if (
|
|
731
|
-
return
|
|
729
|
+
var b = f.get(a), y = f.get(o);
|
|
730
|
+
if (b && y)
|
|
731
|
+
return b == o && y == a;
|
|
732
732
|
var g = -1, T = !0, A = c & s ? new r() : void 0;
|
|
733
733
|
for (f.set(a, o), f.set(o, a); ++g < h; ) {
|
|
734
734
|
var S = a[g], E = o[g];
|
|
@@ -792,7 +792,7 @@ var Gs, Il;
|
|
|
792
792
|
function ty() {
|
|
793
793
|
if (Il) return Gs;
|
|
794
794
|
Il = 1;
|
|
795
|
-
var r = Vr(), e = xd(), t = Ur(), n = Id(), s = Xp(), i = ey(), a = 1, o = 2, c = "[object Boolean]", l = "[object Date]", u = "[object Error]", f = "[object Map]", d = "[object Number]", h = "[object RegExp]", m = "[object Set]",
|
|
795
|
+
var r = Vr(), e = xd(), t = Ur(), n = Id(), s = Xp(), i = ey(), a = 1, o = 2, c = "[object Boolean]", l = "[object Date]", u = "[object Error]", f = "[object Map]", d = "[object Number]", h = "[object RegExp]", m = "[object Set]", b = "[object String]", y = "[object Symbol]", g = "[object ArrayBuffer]", T = "[object DataView]", A = r ? r.prototype : void 0, S = A ? A.valueOf : void 0;
|
|
796
796
|
function E(x, C, _, k, p, I, v) {
|
|
797
797
|
switch (_) {
|
|
798
798
|
case T:
|
|
@@ -808,7 +808,7 @@ function ty() {
|
|
|
808
808
|
case u:
|
|
809
809
|
return x.name == C.name && x.message == C.message;
|
|
810
810
|
case h:
|
|
811
|
-
case
|
|
811
|
+
case b:
|
|
812
812
|
return x == C + "";
|
|
813
813
|
case f:
|
|
814
814
|
var R = s;
|
|
@@ -816,9 +816,9 @@ function ty() {
|
|
|
816
816
|
var w = k & a;
|
|
817
817
|
if (R || (R = i), x.size != C.size && !w)
|
|
818
818
|
return !1;
|
|
819
|
-
var
|
|
820
|
-
if (
|
|
821
|
-
return
|
|
819
|
+
var O = v.get(x);
|
|
820
|
+
if (O)
|
|
821
|
+
return O == C;
|
|
822
822
|
k |= o, v.set(x, C);
|
|
823
823
|
var M = n(R(x), R(C), k, p, I, v);
|
|
824
824
|
return v.delete(x), M;
|
|
@@ -975,8 +975,8 @@ var oi, Bl;
|
|
|
975
975
|
function ay() {
|
|
976
976
|
if (Bl) return oi;
|
|
977
977
|
Bl = 1;
|
|
978
|
-
var r = mr(), e = Pd(), t = wt(), n = "[object Arguments]", s = "[object Array]", i = "[object Boolean]", a = "[object Date]", o = "[object Error]", c = "[object Function]", l = "[object Map]", u = "[object Number]", f = "[object Object]", d = "[object RegExp]", h = "[object Set]", m = "[object String]",
|
|
979
|
-
I[T] = I[A] = I[S] = I[E] = I[x] = I[C] = I[_] = I[k] = I[p] = !0, I[n] = I[s] = I[y] = I[i] = I[g] = I[a] = I[o] = I[c] = I[l] = I[u] = I[f] = I[d] = I[h] = I[m] = I[
|
|
978
|
+
var r = mr(), e = Pd(), t = wt(), n = "[object Arguments]", s = "[object Array]", i = "[object Boolean]", a = "[object Date]", o = "[object Error]", c = "[object Function]", l = "[object Map]", u = "[object Number]", f = "[object Object]", d = "[object RegExp]", h = "[object Set]", m = "[object String]", b = "[object WeakMap]", y = "[object ArrayBuffer]", g = "[object DataView]", T = "[object Float32Array]", A = "[object Float64Array]", S = "[object Int8Array]", E = "[object Int16Array]", x = "[object Int32Array]", C = "[object Uint8Array]", _ = "[object Uint8ClampedArray]", k = "[object Uint16Array]", p = "[object Uint32Array]", I = {};
|
|
979
|
+
I[T] = I[A] = I[S] = I[E] = I[x] = I[C] = I[_] = I[k] = I[p] = !0, I[n] = I[s] = I[y] = I[i] = I[g] = I[a] = I[o] = I[c] = I[l] = I[u] = I[f] = I[d] = I[h] = I[m] = I[b] = !1;
|
|
980
980
|
function v(R) {
|
|
981
981
|
return t(R) && e(R.length) && !!I[r(R)];
|
|
982
982
|
}
|
|
@@ -1021,9 +1021,9 @@ function qd() {
|
|
|
1021
1021
|
Kl = 1;
|
|
1022
1022
|
var r = ny(), e = Md(), t = Dt(), n = Dn(), s = Po(), i = $o(), a = Object.prototype, o = a.hasOwnProperty;
|
|
1023
1023
|
function c(l, u) {
|
|
1024
|
-
var f = t(l), d = !f && e(l), h = !f && !d && n(l), m = !f && !d && !h && i(l),
|
|
1024
|
+
var f = t(l), d = !f && e(l), h = !f && !d && n(l), m = !f && !d && !h && i(l), b = f || d || h || m, y = b ? r(l.length, String) : [], g = y.length;
|
|
1025
1025
|
for (var T in l)
|
|
1026
|
-
(u || o.call(l, T)) && !(
|
|
1026
|
+
(u || o.call(l, T)) && !(b && // Safari 9 has enumerable `arguments.length` in strict mode.
|
|
1027
1027
|
(T == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
|
|
1028
1028
|
h && (T == "offset" || T == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
|
|
1029
1029
|
m && (T == "buffer" || T == "byteLength" || T == "byteOffset") || // Skip index properties.
|
|
@@ -1112,8 +1112,8 @@ function ly() {
|
|
|
1112
1112
|
nu = 1;
|
|
1113
1113
|
var r = $d(), e = 1, t = Object.prototype, n = t.hasOwnProperty;
|
|
1114
1114
|
function s(i, a, o, c, l, u) {
|
|
1115
|
-
var f = o & e, d = r(i), h = d.length, m = r(a),
|
|
1116
|
-
if (h !=
|
|
1115
|
+
var f = o & e, d = r(i), h = d.length, m = r(a), b = m.length;
|
|
1116
|
+
if (h != b && !f)
|
|
1117
1117
|
return !1;
|
|
1118
1118
|
for (var y = h; y--; ) {
|
|
1119
1119
|
var g = d[y];
|
|
@@ -1148,35 +1148,35 @@ var vi, su;
|
|
|
1148
1148
|
function uy() {
|
|
1149
1149
|
if (su) return vi;
|
|
1150
1150
|
su = 1;
|
|
1151
|
-
var r =
|
|
1151
|
+
var r = Zt(), e = ct(), t = r(e, "DataView");
|
|
1152
1152
|
return vi = t, vi;
|
|
1153
1153
|
}
|
|
1154
1154
|
var wi, iu;
|
|
1155
1155
|
function fy() {
|
|
1156
1156
|
if (iu) return wi;
|
|
1157
1157
|
iu = 1;
|
|
1158
|
-
var r =
|
|
1158
|
+
var r = Zt(), e = ct(), t = r(e, "Promise");
|
|
1159
1159
|
return wi = t, wi;
|
|
1160
1160
|
}
|
|
1161
1161
|
var bi, au;
|
|
1162
1162
|
function dy() {
|
|
1163
1163
|
if (au) return bi;
|
|
1164
1164
|
au = 1;
|
|
1165
|
-
var r =
|
|
1165
|
+
var r = Zt(), e = ct(), t = r(e, "Set");
|
|
1166
1166
|
return bi = t, bi;
|
|
1167
1167
|
}
|
|
1168
1168
|
var Oi, ou;
|
|
1169
1169
|
function hy() {
|
|
1170
1170
|
if (ou) return Oi;
|
|
1171
1171
|
ou = 1;
|
|
1172
|
-
var r =
|
|
1172
|
+
var r = Zt(), e = ct(), t = r(e, "WeakMap");
|
|
1173
1173
|
return Oi = t, Oi;
|
|
1174
1174
|
}
|
|
1175
1175
|
var Ei, cu;
|
|
1176
1176
|
function Pn() {
|
|
1177
1177
|
if (cu) return Ei;
|
|
1178
1178
|
cu = 1;
|
|
1179
|
-
var r = uy(), e = No(), t = fy(), n = dy(), s = hy(), i = mr(), a = kd(), o = "[object Map]", c = "[object Object]", l = "[object Promise]", u = "[object Set]", f = "[object WeakMap]", d = "[object DataView]", h = a(r), m = a(e),
|
|
1179
|
+
var r = uy(), e = No(), t = fy(), n = dy(), s = hy(), i = mr(), a = kd(), o = "[object Map]", c = "[object Object]", l = "[object Promise]", u = "[object Set]", f = "[object WeakMap]", d = "[object DataView]", h = a(r), m = a(e), b = a(t), y = a(n), g = a(s), T = i;
|
|
1180
1180
|
return (r && T(new r(new ArrayBuffer(1))) != d || e && T(new e()) != o || t && T(t.resolve()) != l || n && T(new n()) != u || s && T(new s()) != f) && (T = function(A) {
|
|
1181
1181
|
var S = i(A), E = S == c ? A.constructor : void 0, x = E ? a(E) : "";
|
|
1182
1182
|
if (x)
|
|
@@ -1185,7 +1185,7 @@ function Pn() {
|
|
|
1185
1185
|
return d;
|
|
1186
1186
|
case m:
|
|
1187
1187
|
return o;
|
|
1188
|
-
case
|
|
1188
|
+
case b:
|
|
1189
1189
|
return l;
|
|
1190
1190
|
case y:
|
|
1191
1191
|
return u;
|
|
@@ -1200,25 +1200,25 @@ function my() {
|
|
|
1200
1200
|
if (lu) return Si;
|
|
1201
1201
|
lu = 1;
|
|
1202
1202
|
var r = Do(), e = Id(), t = ty(), n = ly(), s = Pn(), i = Dt(), a = Dn(), o = $o(), c = 1, l = "[object Arguments]", u = "[object Array]", f = "[object Object]", d = Object.prototype, h = d.hasOwnProperty;
|
|
1203
|
-
function m(
|
|
1204
|
-
var E = i(
|
|
1203
|
+
function m(b, y, g, T, A, S) {
|
|
1204
|
+
var E = i(b), x = i(y), C = E ? u : s(b), _ = x ? u : s(y);
|
|
1205
1205
|
C = C == l ? f : C, _ = _ == l ? f : _;
|
|
1206
1206
|
var k = C == f, p = _ == f, I = C == _;
|
|
1207
|
-
if (I && a(
|
|
1207
|
+
if (I && a(b)) {
|
|
1208
1208
|
if (!a(y))
|
|
1209
1209
|
return !1;
|
|
1210
1210
|
E = !0, k = !1;
|
|
1211
1211
|
}
|
|
1212
1212
|
if (I && !k)
|
|
1213
|
-
return S || (S = new r()), E || o(
|
|
1213
|
+
return S || (S = new r()), E || o(b) ? e(b, y, g, T, A, S) : t(b, y, C, g, T, A, S);
|
|
1214
1214
|
if (!(g & c)) {
|
|
1215
|
-
var v = k && h.call(
|
|
1215
|
+
var v = k && h.call(b, "__wrapped__"), R = p && h.call(y, "__wrapped__");
|
|
1216
1216
|
if (v || R) {
|
|
1217
|
-
var w = v ?
|
|
1218
|
-
return S || (S = new r()), A(w,
|
|
1217
|
+
var w = v ? b.value() : b, O = R ? y.value() : y;
|
|
1218
|
+
return S || (S = new r()), A(w, O, g, T, S);
|
|
1219
1219
|
}
|
|
1220
1220
|
}
|
|
1221
|
-
return I ? (S || (S = new r()), n(
|
|
1221
|
+
return I ? (S || (S = new r()), n(b, y, g, T, A, S)) : !1;
|
|
1222
1222
|
}
|
|
1223
1223
|
return Si = m, Si;
|
|
1224
1224
|
}
|
|
@@ -1273,18 +1273,18 @@ const _y = /* @__PURE__ */ kn(gy), vy = (r, e, t, n, s, i, a, o, c) => {
|
|
|
1273
1273
|
}, Oy = (r, e, t, n, s, i, a, o, c, l) => {
|
|
1274
1274
|
const { labels: u, fields: f } = n, d = a?.collections?.[u.collection], h = { ...e, ...r };
|
|
1275
1275
|
rr(h);
|
|
1276
|
-
let m = !0,
|
|
1276
|
+
let m = !0, b = "";
|
|
1277
1277
|
if (i && !d)
|
|
1278
1278
|
throw new Error("PERMISSION_DENIED");
|
|
1279
|
-
i && !_t("Update", d) && (m = !1,
|
|
1279
|
+
i && !_t("Update", d) && (m = !1, b = "Authenticated user does not have Update access to this collection"), i && // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
1280
1280
|
(!fn("Update", n, s, i, a, e) || // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
1281
|
-
!fn("Update", n, s, i, a, h)) && (m = !1,
|
|
1281
|
+
!fn("Update", n, s, i, a, h)) && (m = !1, b = "Authenticated user does not have Update access to this document");
|
|
1282
1282
|
for (const y of f) {
|
|
1283
1283
|
const g = r[y.name];
|
|
1284
|
-
y.access && !An(y, a) && g !== void 0 && (
|
|
1284
|
+
y.access && !An(y, a) && g !== void 0 && (b = `Authenticated user does not have access to field ${y.name}`, m = !1), g !== void 0 && !_p(y, a) && (b = `Authenticated user does not have Update access to field ${y.name}`, m = !1);
|
|
1285
1285
|
}
|
|
1286
1286
|
if (!m)
|
|
1287
|
-
throw
|
|
1287
|
+
throw b && console.error(`PERMISSION_DENIED: ${b}`), new Error("PERMISSION_DENIED");
|
|
1288
1288
|
}, Ey = (r, e, t, n, s, i) => {
|
|
1289
1289
|
const { labels: a } = t, o = i.collections?.[a.collection];
|
|
1290
1290
|
let c = !0;
|
|
@@ -1332,7 +1332,7 @@ var Ai, du;
|
|
|
1332
1332
|
function Ud() {
|
|
1333
1333
|
if (du) return Ai;
|
|
1334
1334
|
du = 1;
|
|
1335
|
-
var r =
|
|
1335
|
+
var r = Zt(), e = (function() {
|
|
1336
1336
|
try {
|
|
1337
1337
|
var t = r(Object, "defineProperty");
|
|
1338
1338
|
return t({}, "", {}), t;
|
|
@@ -1590,7 +1590,7 @@ function Dy() {
|
|
|
1590
1590
|
if (Fu) return Gi;
|
|
1591
1591
|
Fu = 1;
|
|
1592
1592
|
var r = Vd(), e = Wd(), t = zd(), n = Bd(), s = Zd(), i = Md(), a = Dt(), o = ky(), c = Dn(), l = xo(), u = vt(), f = Iy(), d = $o(), h = Gd(), m = Fy();
|
|
1593
|
-
function
|
|
1593
|
+
function b(y, g, T, A, S, E, x) {
|
|
1594
1594
|
var C = h(y, T), _ = h(g, T), k = x.get(_);
|
|
1595
1595
|
if (k) {
|
|
1596
1596
|
r(y, T, k);
|
|
@@ -1603,7 +1603,7 @@ function Dy() {
|
|
|
1603
1603
|
}
|
|
1604
1604
|
I && (x.set(_, p), S(p, _, A, E, x), x.delete(_)), r(y, T, p);
|
|
1605
1605
|
}
|
|
1606
|
-
return Gi =
|
|
1606
|
+
return Gi = b, Gi;
|
|
1607
1607
|
}
|
|
1608
1608
|
var Hi, Du;
|
|
1609
1609
|
function My() {
|
|
@@ -1615,8 +1615,8 @@ function My() {
|
|
|
1615
1615
|
if (d || (d = new r()), s(h))
|
|
1616
1616
|
n(c, l, m, u, o, f, d);
|
|
1617
1617
|
else {
|
|
1618
|
-
var
|
|
1619
|
-
|
|
1618
|
+
var b = f ? f(a(c, m), h, m + "", c, l, d) : void 0;
|
|
1619
|
+
b === void 0 && (b = h), e(c, m, b);
|
|
1620
1620
|
}
|
|
1621
1621
|
}, i);
|
|
1622
1622
|
}
|
|
@@ -1907,14 +1907,14 @@ function ng() {
|
|
|
1907
1907
|
return a;
|
|
1908
1908
|
o = e(o, a);
|
|
1909
1909
|
for (var u = -1, f = o.length, d = f - 1, h = a; h != null && ++u < f; ) {
|
|
1910
|
-
var m = s(o[u]),
|
|
1910
|
+
var m = s(o[u]), b = c;
|
|
1911
1911
|
if (m === "__proto__" || m === "constructor" || m === "prototype")
|
|
1912
1912
|
return a;
|
|
1913
1913
|
if (u != d) {
|
|
1914
1914
|
var y = h[m];
|
|
1915
|
-
|
|
1915
|
+
b = l ? l(y, m, h) : void 0, b === void 0 && (b = n(y) ? y : t(o[u + 1]) ? [] : {});
|
|
1916
1916
|
}
|
|
1917
|
-
r(h, m,
|
|
1917
|
+
r(h, m, b), h = h[m];
|
|
1918
1918
|
}
|
|
1919
1919
|
return a;
|
|
1920
1920
|
}
|
|
@@ -3800,7 +3800,7 @@ function Xt(r) {
|
|
|
3800
3800
|
} else return r instanceof at ? new at({
|
|
3801
3801
|
...r._def,
|
|
3802
3802
|
type: Xt(r.element)
|
|
3803
|
-
}) : r instanceof It ? It.create(Xt(r.unwrap())) : r instanceof ur ? ur.create(Xt(r.unwrap())) : r instanceof
|
|
3803
|
+
}) : r instanceof It ? It.create(Xt(r.unwrap())) : r instanceof ur ? ur.create(Xt(r.unwrap())) : r instanceof Wt ? Wt.create(r.items.map((e) => Xt(e))) : r;
|
|
3804
3804
|
}
|
|
3805
3805
|
class Te extends ce {
|
|
3806
3806
|
constructor() {
|
|
@@ -4226,7 +4226,7 @@ pn.create = (r, e, t) => new pn({
|
|
|
4226
4226
|
typeName: X.ZodIntersection,
|
|
4227
4227
|
...ae(t)
|
|
4228
4228
|
});
|
|
4229
|
-
class
|
|
4229
|
+
class Wt extends ce {
|
|
4230
4230
|
_parse(e) {
|
|
4231
4231
|
const { status: t, ctx: n } = this._processInputParams(e);
|
|
4232
4232
|
if (n.parsedType !== U.array)
|
|
@@ -4260,16 +4260,16 @@ class Vt extends ce {
|
|
|
4260
4260
|
return this._def.items;
|
|
4261
4261
|
}
|
|
4262
4262
|
rest(e) {
|
|
4263
|
-
return new
|
|
4263
|
+
return new Wt({
|
|
4264
4264
|
...this._def,
|
|
4265
4265
|
rest: e
|
|
4266
4266
|
});
|
|
4267
4267
|
}
|
|
4268
4268
|
}
|
|
4269
|
-
|
|
4269
|
+
Wt.create = (r, e) => {
|
|
4270
4270
|
if (!Array.isArray(r))
|
|
4271
4271
|
throw new Error("You must pass an array of schemas to z.tuple([ ... ])");
|
|
4272
|
-
return new
|
|
4272
|
+
return new Wt({
|
|
4273
4273
|
items: r,
|
|
4274
4274
|
typeName: X.ZodTuple,
|
|
4275
4275
|
rest: null,
|
|
@@ -4849,25 +4849,25 @@ var X;
|
|
|
4849
4849
|
(function(r) {
|
|
4850
4850
|
r.ZodString = "ZodString", r.ZodNumber = "ZodNumber", r.ZodNaN = "ZodNaN", r.ZodBigInt = "ZodBigInt", r.ZodBoolean = "ZodBoolean", r.ZodDate = "ZodDate", r.ZodSymbol = "ZodSymbol", r.ZodUndefined = "ZodUndefined", r.ZodNull = "ZodNull", r.ZodAny = "ZodAny", r.ZodUnknown = "ZodUnknown", r.ZodNever = "ZodNever", r.ZodVoid = "ZodVoid", r.ZodArray = "ZodArray", r.ZodObject = "ZodObject", r.ZodUnion = "ZodUnion", r.ZodDiscriminatedUnion = "ZodDiscriminatedUnion", r.ZodIntersection = "ZodIntersection", r.ZodTuple = "ZodTuple", r.ZodRecord = "ZodRecord", r.ZodMap = "ZodMap", r.ZodSet = "ZodSet", r.ZodFunction = "ZodFunction", r.ZodLazy = "ZodLazy", r.ZodLiteral = "ZodLiteral", r.ZodEnum = "ZodEnum", r.ZodEffects = "ZodEffects", r.ZodNativeEnum = "ZodNativeEnum", r.ZodOptional = "ZodOptional", r.ZodNullable = "ZodNullable", r.ZodDefault = "ZodDefault", r.ZodCatch = "ZodCatch", r.ZodPromise = "ZodPromise", r.ZodBranded = "ZodBranded", r.ZodPipeline = "ZodPipeline", r.ZodReadonly = "ZodReadonly";
|
|
4851
4851
|
})(X || (X = {}));
|
|
4852
|
-
const mt = pt.create, lo = or.create, jg = ro.create,
|
|
4852
|
+
const mt = pt.create, lo = or.create, jg = ro.create, Ut = no.create;
|
|
4853
4853
|
Ft.create;
|
|
4854
4854
|
const qn = at.create, nh = Te.create, _n = mn.create;
|
|
4855
4855
|
pn.create;
|
|
4856
|
-
|
|
4856
|
+
Wt.create;
|
|
4857
4857
|
const Yo = yn.create, uo = io.create, fo = cr.create;
|
|
4858
4858
|
gn.create;
|
|
4859
4859
|
It.create;
|
|
4860
4860
|
ur.create;
|
|
4861
|
-
const an = () =>
|
|
4861
|
+
const an = () => Ut().refine((r) => r && (r.seconds !== void 0 && r.nanoseconds !== void 0 || r._seconds !== void 0 && r._nanoseconds !== void 0), {
|
|
4862
4862
|
message: "Value is not a valid timestamp"
|
|
4863
|
-
}), _f = () =>
|
|
4863
|
+
}), _f = () => Ut().refine((r) => r && (r._methodName === "serverTimestamp" || r.constructor.name === "ServerTimestampTransform"), {
|
|
4864
4864
|
message: "Value is not a valid server timestamp"
|
|
4865
4865
|
}), sh = (r, e) => {
|
|
4866
4866
|
const t = {};
|
|
4867
4867
|
if (r.includeFields) {
|
|
4868
4868
|
const n = e.collections[r.collection];
|
|
4869
4869
|
if (!n)
|
|
4870
|
-
return Yo(
|
|
4870
|
+
return Yo(Ut());
|
|
4871
4871
|
r.includeFields.forEach((s) => {
|
|
4872
4872
|
const i = n.fields.find((o) => o.name === s);
|
|
4873
4873
|
if (!i)
|
|
@@ -4908,7 +4908,7 @@ const an = () => jt().refine((r) => r && (r.seconds !== void 0 && r.nanoseconds
|
|
|
4908
4908
|
})));
|
|
4909
4909
|
break;
|
|
4910
4910
|
case "Timestamp":
|
|
4911
|
-
e.name === s ? i =
|
|
4911
|
+
e.name === s ? i = Ut().refine((a) => a && (a._methodName === "serverTimestamp" || a.constructor.name === "ServerTimestampTransform" || a.seconds !== void 0 && a.nanoseconds !== void 0 || a._seconds !== void 0 && a._nanoseconds !== void 0), {
|
|
4912
4912
|
message: "Value is not a valid timestamp"
|
|
4913
4913
|
}) : (i = an(), e.min && (i = i.refine((a) => a.toMillis() >= e.min, {
|
|
4914
4914
|
message: `Value is less than the minimum allowed value of ${e.min}`
|
|
@@ -4917,7 +4917,7 @@ const an = () => jt().refine((r) => r && (r.seconds !== void 0 && r.nanoseconds
|
|
|
4917
4917
|
})));
|
|
4918
4918
|
break;
|
|
4919
4919
|
case "Array":
|
|
4920
|
-
i = qn(
|
|
4920
|
+
i = qn(Ut()), e.length && (i = i.length(e.length)), e.minlength ? i = i.min(e.minlength) : e.required && (i = i.nonempty()), e.maxlength && (i = i.max(e.maxlength)), e.values && (i = i.refine((a) => {
|
|
4921
4921
|
let o = !0;
|
|
4922
4922
|
return a.forEach((c) => {
|
|
4923
4923
|
e.values && !e.values.includes(c) && (o = !1);
|
|
@@ -4925,12 +4925,12 @@ const an = () => jt().refine((r) => r && (r.seconds !== void 0 && r.nanoseconds
|
|
|
4925
4925
|
}, { message: "Value is not an allowed value" }));
|
|
4926
4926
|
break;
|
|
4927
4927
|
case "Map":
|
|
4928
|
-
i = Yo(
|
|
4928
|
+
i = Yo(Ut()), e.required && (i = i.refine((a) => a && typeof a == "object" && Object.keys(a).length > 0, {
|
|
4929
4929
|
message: "Value must have at least one object property"
|
|
4930
4930
|
}));
|
|
4931
4931
|
break;
|
|
4932
4932
|
case "Embedding":
|
|
4933
|
-
i =
|
|
4933
|
+
i = Ut();
|
|
4934
4934
|
break;
|
|
4935
4935
|
}
|
|
4936
4936
|
return !_e(e) && e.nullable && (i = i.nullable()), e.required || (i = i.optional()), i;
|
|
@@ -4963,33 +4963,33 @@ const an = () => jt().refine((r) => r && (r.seconds !== void 0 && r.nanoseconds
|
|
|
4963
4963
|
const o = nh(n);
|
|
4964
4964
|
return e.allowSchemalessFields ? o.passthrough() : o.strict();
|
|
4965
4965
|
};
|
|
4966
|
-
class
|
|
4966
|
+
class Gt extends Error {
|
|
4967
4967
|
}
|
|
4968
|
-
class zg extends
|
|
4968
|
+
class zg extends Gt {
|
|
4969
4969
|
constructor(e) {
|
|
4970
4970
|
super(`Invalid DateTime: ${e.toMessage()}`);
|
|
4971
4971
|
}
|
|
4972
4972
|
}
|
|
4973
|
-
class Bg extends
|
|
4973
|
+
class Bg extends Gt {
|
|
4974
4974
|
constructor(e) {
|
|
4975
4975
|
super(`Invalid Interval: ${e.toMessage()}`);
|
|
4976
4976
|
}
|
|
4977
4977
|
}
|
|
4978
|
-
class Zg extends
|
|
4978
|
+
class Zg extends Gt {
|
|
4979
4979
|
constructor(e) {
|
|
4980
4980
|
super(`Invalid Duration: ${e.toMessage()}`);
|
|
4981
4981
|
}
|
|
4982
4982
|
}
|
|
4983
|
-
class tr extends
|
|
4983
|
+
class tr extends Gt {
|
|
4984
4984
|
}
|
|
4985
|
-
class ih extends
|
|
4985
|
+
class ih extends Gt {
|
|
4986
4986
|
constructor(e) {
|
|
4987
4987
|
super(`Invalid unit ${e}`);
|
|
4988
4988
|
}
|
|
4989
4989
|
}
|
|
4990
|
-
class Ne extends
|
|
4990
|
+
class Ne extends Gt {
|
|
4991
4991
|
}
|
|
4992
|
-
class St extends
|
|
4992
|
+
class St extends Gt {
|
|
4993
4993
|
constructor() {
|
|
4994
4994
|
super("Zone is an abstract class");
|
|
4995
4995
|
}
|
|
@@ -6243,7 +6243,7 @@ function At(r) {
|
|
|
6243
6243
|
if (!(Q(r) || r === null || r === ""))
|
|
6244
6244
|
return parseInt(r, 10);
|
|
6245
6245
|
}
|
|
6246
|
-
function
|
|
6246
|
+
function qt(r) {
|
|
6247
6247
|
if (!(Q(r) || r === null || r === ""))
|
|
6248
6248
|
return parseFloat(r);
|
|
6249
6249
|
}
|
|
@@ -6721,8 +6721,8 @@ class Fe {
|
|
|
6721
6721
|
const h = s(d);
|
|
6722
6722
|
if (h) {
|
|
6723
6723
|
const m = f.isNegativeDuration && h !== f.largestUnit ? n : 1;
|
|
6724
|
-
let
|
|
6725
|
-
return this.opts.signMode === "negativeLargestOnly" && h !== f.largestUnit ?
|
|
6724
|
+
let b;
|
|
6725
|
+
return this.opts.signMode === "negativeLargestOnly" && h !== f.largestUnit ? b = "never" : this.opts.signMode === "all" ? b = "always" : b = "auto", this.num(u.get(h) * m, d.length, b);
|
|
6726
6726
|
} else
|
|
6727
6727
|
return d;
|
|
6728
6728
|
}, a = Fe.parseFormat(t), o = a.reduce(
|
|
@@ -6805,13 +6805,13 @@ function Z_(r) {
|
|
|
6805
6805
|
const [e, t, n, s, i, a, o, c, l] = r, u = e[0] === "-", f = c && c[0] === "-", d = (h, m = !1) => h !== void 0 && (m || h && u) ? -h : h;
|
|
6806
6806
|
return [
|
|
6807
6807
|
{
|
|
6808
|
-
years: d(
|
|
6809
|
-
months: d(
|
|
6810
|
-
weeks: d(
|
|
6811
|
-
days: d(
|
|
6812
|
-
hours: d(
|
|
6813
|
-
minutes: d(
|
|
6814
|
-
seconds: d(
|
|
6808
|
+
years: d(qt(t)),
|
|
6809
|
+
months: d(qt(n)),
|
|
6810
|
+
weeks: d(qt(s)),
|
|
6811
|
+
days: d(qt(i)),
|
|
6812
|
+
hours: d(qt(a)),
|
|
6813
|
+
minutes: d(qt(o)),
|
|
6814
|
+
seconds: d(qt(c), c === "-0"),
|
|
6815
6815
|
milliseconds: d(ec(l), f)
|
|
6816
6816
|
}
|
|
6817
6817
|
];
|
|
@@ -7002,7 +7002,7 @@ const Pf = "Invalid Duration", Yh = {
|
|
|
7002
7002
|
milliseconds: Yt * 24 * 60 * 60 * 1e3
|
|
7003
7003
|
},
|
|
7004
7004
|
...Yh
|
|
7005
|
-
},
|
|
7005
|
+
}, Vt = [
|
|
7006
7006
|
"years",
|
|
7007
7007
|
"quarters",
|
|
7008
7008
|
"months",
|
|
@@ -7012,7 +7012,7 @@ const Pf = "Invalid Duration", Yh = {
|
|
|
7012
7012
|
"minutes",
|
|
7013
7013
|
"seconds",
|
|
7014
7014
|
"milliseconds"
|
|
7015
|
-
], wv =
|
|
7015
|
+
], wv = Vt.slice(0).reverse();
|
|
7016
7016
|
function ut(r, e, t = !1) {
|
|
7017
7017
|
const n = {
|
|
7018
7018
|
values: t ? e.values : { ...r.values, ...e.values || {} },
|
|
@@ -7030,7 +7030,7 @@ function Jh(r, e) {
|
|
|
7030
7030
|
}
|
|
7031
7031
|
function qf(r, e) {
|
|
7032
7032
|
const t = Jh(r, e) < 0 ? -1 : 1;
|
|
7033
|
-
|
|
7033
|
+
Vt.reduceRight((n, s) => {
|
|
7034
7034
|
if (Q(e[s]))
|
|
7035
7035
|
return n;
|
|
7036
7036
|
if (n) {
|
|
@@ -7038,7 +7038,7 @@ function qf(r, e) {
|
|
|
7038
7038
|
e[s] += o * t, e[n] -= o * a * t;
|
|
7039
7039
|
}
|
|
7040
7040
|
return s;
|
|
7041
|
-
}, null),
|
|
7041
|
+
}, null), Vt.reduce((n, s) => {
|
|
7042
7042
|
if (Q(e[s]))
|
|
7043
7043
|
return n;
|
|
7044
7044
|
if (n) {
|
|
@@ -7281,7 +7281,7 @@ class le {
|
|
|
7281
7281
|
*/
|
|
7282
7282
|
toHuman(e = {}) {
|
|
7283
7283
|
if (!this.isValid) return Pf;
|
|
7284
|
-
const t = e.showZeros !== !1, n =
|
|
7284
|
+
const t = e.showZeros !== !1, n = Vt.map((s) => {
|
|
7285
7285
|
const i = this.values[s];
|
|
7286
7286
|
return Q(i) || i === 0 && !t ? null : this.loc.numberFormatter({ style: "unit", unitDisplay: "long", ...e, unit: s.slice(0, -1) }).format(i);
|
|
7287
7287
|
}).filter((s) => s);
|
|
@@ -7381,7 +7381,7 @@ class le {
|
|
|
7381
7381
|
plus(e) {
|
|
7382
7382
|
if (!this.isValid) return this;
|
|
7383
7383
|
const t = le.fromDurationLike(e), n = {};
|
|
7384
|
-
for (const s of
|
|
7384
|
+
for (const s of Vt)
|
|
7385
7385
|
(fr(t.values, s) || fr(this.values, s)) && (n[s] = t.get(s) + this.get(s));
|
|
7386
7386
|
return ut(this, { values: n }, !0);
|
|
7387
7387
|
}
|
|
@@ -7494,7 +7494,7 @@ class le {
|
|
|
7494
7494
|
e = e.map((a) => le.normalizeUnit(a));
|
|
7495
7495
|
const t = {}, n = {}, s = this.toObject();
|
|
7496
7496
|
let i;
|
|
7497
|
-
for (const a of
|
|
7497
|
+
for (const a of Vt)
|
|
7498
7498
|
if (e.indexOf(a) >= 0) {
|
|
7499
7499
|
i = a;
|
|
7500
7500
|
let o = 0;
|
|
@@ -7644,7 +7644,7 @@ class le {
|
|
|
7644
7644
|
function t(n, s) {
|
|
7645
7645
|
return n === void 0 || n === 0 ? s === void 0 || s === 0 : n === s;
|
|
7646
7646
|
}
|
|
7647
|
-
for (const n of
|
|
7647
|
+
for (const n of Vt)
|
|
7648
7648
|
if (!t(this.values[n], e.values[n]))
|
|
7649
7649
|
return !1;
|
|
7650
7650
|
return !0;
|
|
@@ -8347,7 +8347,7 @@ function Av(r) {
|
|
|
8347
8347
|
return r.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&");
|
|
8348
8348
|
}
|
|
8349
8349
|
function Cv(r, e) {
|
|
8350
|
-
const t = Qe(e), n = Qe(e, "{2}"), s = Qe(e, "{3}"), i = Qe(e, "{4}"), a = Qe(e, "{6}"), o = Qe(e, "{1,2}"), c = Qe(e, "{1,3}"), l = Qe(e, "{1,6}"), u = Qe(e, "{1,9}"), f = Qe(e, "{2,4}"), d = Qe(e, "{4,6}"), h = (y) => ({ regex: RegExp(Av(y.val)), deser: ([g]) => g, literal: !0 }),
|
|
8350
|
+
const t = Qe(e), n = Qe(e, "{2}"), s = Qe(e, "{3}"), i = Qe(e, "{4}"), a = Qe(e, "{6}"), o = Qe(e, "{1,2}"), c = Qe(e, "{1,3}"), l = Qe(e, "{1,6}"), u = Qe(e, "{1,9}"), f = Qe(e, "{2,4}"), d = Qe(e, "{4,6}"), h = (y) => ({ regex: RegExp(Av(y.val)), deser: ([g]) => g, literal: !0 }), b = ((y) => {
|
|
8351
8351
|
if (r.literal)
|
|
8352
8352
|
return h(y);
|
|
8353
8353
|
switch (y.val) {
|
|
@@ -8470,7 +8470,7 @@ function Cv(r, e) {
|
|
|
8470
8470
|
})(r) || {
|
|
8471
8471
|
invalidReason: Sv
|
|
8472
8472
|
};
|
|
8473
|
-
return
|
|
8473
|
+
return b.token = r, b;
|
|
8474
8474
|
}
|
|
8475
8475
|
const kv = {
|
|
8476
8476
|
year: {
|
|
@@ -8664,7 +8664,7 @@ function Aa(r) {
|
|
|
8664
8664
|
r.loc.getStartOfWeek()
|
|
8665
8665
|
)), r.localWeekData;
|
|
8666
8666
|
}
|
|
8667
|
-
function
|
|
8667
|
+
function Lt(r, e) {
|
|
8668
8668
|
const t = {
|
|
8669
8669
|
ts: r.ts,
|
|
8670
8670
|
zone: r.zone,
|
|
@@ -9076,18 +9076,18 @@ class B {
|
|
|
9076
9076
|
);
|
|
9077
9077
|
if (d && u)
|
|
9078
9078
|
throw new tr("Can't mix ordinal dates with month/day");
|
|
9079
|
-
const
|
|
9079
|
+
const b = m || i.weekday && !h;
|
|
9080
9080
|
let y, g, T = nn(c, l);
|
|
9081
|
-
|
|
9081
|
+
b ? (y = $v, g = qv, T = bn(T, a, o)) : u ? (y = jv, g = Lv, T = Ea(T)) : (y = cn, g = im);
|
|
9082
9082
|
let A = !1;
|
|
9083
9083
|
for (const p of y) {
|
|
9084
9084
|
const I = i[p];
|
|
9085
9085
|
Q(I) ? A ? i[p] = g[p] : i[p] = T[p] : A = !0;
|
|
9086
9086
|
}
|
|
9087
|
-
const S =
|
|
9087
|
+
const S = b ? y_(i, a, o) : u ? g_(i) : xh(i), E = S || Nh(i);
|
|
9088
9088
|
if (E)
|
|
9089
9089
|
return B.invalid(E);
|
|
9090
|
-
const x =
|
|
9090
|
+
const x = b ? kf(i, a, o) : u ? If(i) : i, [C, _] = on(x, l, n), k = new B({
|
|
9091
9091
|
ts: C,
|
|
9092
9092
|
zone: n,
|
|
9093
9093
|
o: _,
|
|
@@ -9558,7 +9558,7 @@ class B {
|
|
|
9558
9558
|
if (a === o)
|
|
9559
9559
|
return [this];
|
|
9560
9560
|
const c = n - a * t, l = n - o * t, u = nn(c, a), f = nn(l, o);
|
|
9561
|
-
return u.hour === f.hour && u.minute === f.minute && u.second === f.second && u.millisecond === f.millisecond ? [
|
|
9561
|
+
return u.hour === f.hour && u.minute === f.minute && u.second === f.second && u.millisecond === f.millisecond ? [Lt(this, { ts: c }), Lt(this, { ts: l })] : [this];
|
|
9562
9562
|
}
|
|
9563
9563
|
/**
|
|
9564
9564
|
* Returns true if this DateTime is in a leap year, false otherwise
|
|
@@ -9662,7 +9662,7 @@ class B {
|
|
|
9662
9662
|
const i = e.offset(this.ts), a = this.toObject();
|
|
9663
9663
|
[s] = on(a, i, e);
|
|
9664
9664
|
}
|
|
9665
|
-
return
|
|
9665
|
+
return Lt(this, { ts: s, zone: e });
|
|
9666
9666
|
} else
|
|
9667
9667
|
return B.invalid(Ar(e));
|
|
9668
9668
|
}
|
|
@@ -9674,7 +9674,7 @@ class B {
|
|
|
9674
9674
|
*/
|
|
9675
9675
|
reconfigure({ locale: e, numberingSystem: t, outputCalendar: n } = {}) {
|
|
9676
9676
|
const s = this.loc.clone({ locale: e, numberingSystem: t, outputCalendar: n });
|
|
9677
|
-
return
|
|
9677
|
+
return Lt(this, { loc: s });
|
|
9678
9678
|
}
|
|
9679
9679
|
/**
|
|
9680
9680
|
* "Set" the locale. Returns a newly-constructed DateTime.
|
|
@@ -9714,7 +9714,7 @@ class B {
|
|
|
9714
9714
|
s
|
|
9715
9715
|
) : Q(t.ordinal) ? (f = { ...this.toObject(), ...t }, Q(t.day) && (f.day = Math.min(On(f.year, f.month), f.day))) : f = If({ ...Ea(this.c), ...t });
|
|
9716
9716
|
const [d, h] = on(f, this.o, this.zone);
|
|
9717
|
-
return
|
|
9717
|
+
return Lt(this, { ts: d, o: h });
|
|
9718
9718
|
}
|
|
9719
9719
|
/**
|
|
9720
9720
|
* Add a period of time to this DateTime and return the resulting DateTime
|
|
@@ -9732,7 +9732,7 @@ class B {
|
|
|
9732
9732
|
plus(e) {
|
|
9733
9733
|
if (!this.isValid) return this;
|
|
9734
9734
|
const t = le.fromDurationLike(e);
|
|
9735
|
-
return
|
|
9735
|
+
return Lt(this, Wf(this, t));
|
|
9736
9736
|
}
|
|
9737
9737
|
/**
|
|
9738
9738
|
* Subtract a period of time to this DateTime and return the resulting DateTime
|
|
@@ -9743,7 +9743,7 @@ class B {
|
|
|
9743
9743
|
minus(e) {
|
|
9744
9744
|
if (!this.isValid) return this;
|
|
9745
9745
|
const t = le.fromDurationLike(e).negate();
|
|
9746
|
-
return
|
|
9746
|
+
return Lt(this, Wf(this, t));
|
|
9747
9747
|
}
|
|
9748
9748
|
/**
|
|
9749
9749
|
* "Set" this DateTime to the beginning of a unit of time.
|
|
@@ -10486,7 +10486,7 @@ const Kf = async (r, e) => {
|
|
|
10486
10486
|
for (const o of n.fields)
|
|
10487
10487
|
await Kf(o.custom?.preValidate, s);
|
|
10488
10488
|
return Wg(r, t, i).parse(e), e;
|
|
10489
|
-
}, ic = (r, e, t, n, s, i, a, o, c, l, u, f, d, h, m,
|
|
10489
|
+
}, ic = (r, e, t, n, s, i, a, o, c, l, u, f, d, h, m, b, y, g, T, A, S) => {
|
|
10490
10490
|
const { fields: E } = a;
|
|
10491
10491
|
E.filter((_) => "unique" in _ && _.unique).forEach((_) => {
|
|
10492
10492
|
r !== "delete" && (typeof s[_.name] == "string" || typeof s[_.name] == "number") && e.set(h(_, s[_.name].toString().toLowerCase().replace(/\s/g, "---").replaceAll("/", "|||")), {
|
|
@@ -10639,7 +10639,7 @@ var ja, od;
|
|
|
10639
10639
|
function Qv() {
|
|
10640
10640
|
if (od) return ja;
|
|
10641
10641
|
od = 1;
|
|
10642
|
-
var r = Wo(), e = Kv(), t = Yv(), n = Jv(), s = zd(), i = "[object Boolean]", a = "[object Date]", o = "[object Map]", c = "[object Number]", l = "[object RegExp]", u = "[object Set]", f = "[object String]", d = "[object Symbol]", h = "[object ArrayBuffer]", m = "[object DataView]",
|
|
10642
|
+
var r = Wo(), e = Kv(), t = Yv(), n = Jv(), s = zd(), i = "[object Boolean]", a = "[object Date]", o = "[object Map]", c = "[object Number]", l = "[object RegExp]", u = "[object Set]", f = "[object String]", d = "[object Symbol]", h = "[object ArrayBuffer]", m = "[object DataView]", b = "[object Float32Array]", y = "[object Float64Array]", g = "[object Int8Array]", T = "[object Int16Array]", A = "[object Int32Array]", S = "[object Uint8Array]", E = "[object Uint8ClampedArray]", x = "[object Uint16Array]", C = "[object Uint32Array]";
|
|
10643
10643
|
function _(k, p, I) {
|
|
10644
10644
|
var v = k.constructor;
|
|
10645
10645
|
switch (p) {
|
|
@@ -10650,7 +10650,7 @@ function Qv() {
|
|
|
10650
10650
|
return new v(+k);
|
|
10651
10651
|
case m:
|
|
10652
10652
|
return e(k, I);
|
|
10653
|
-
case
|
|
10653
|
+
case b:
|
|
10654
10654
|
case y:
|
|
10655
10655
|
case g:
|
|
10656
10656
|
case T:
|
|
@@ -10713,7 +10713,7 @@ var Ba, dd;
|
|
|
10713
10713
|
function nw() {
|
|
10714
10714
|
if (dd) return Ba;
|
|
10715
10715
|
dd = 1;
|
|
10716
|
-
var r = Do(), e = Vv(), t = Bo(), n = Wv(), s = zv(), i = Wd(), a = Bd(), o = Bv(), c = Zv(), l = $d(), u = Gv(), f = Pn(), d = Hv(), h = Qv(), m = Zd(),
|
|
10716
|
+
var r = Do(), e = Vv(), t = Bo(), n = Wv(), s = zv(), i = Wd(), a = Bd(), o = Bv(), c = Zv(), l = $d(), u = Gv(), f = Pn(), d = Hv(), h = Qv(), m = Zd(), b = Dt(), y = Dn(), g = ew(), T = vt(), A = rw(), S = Uo(), E = zr(), x = 1, C = 2, _ = 4, k = "[object Arguments]", p = "[object Array]", I = "[object Boolean]", v = "[object Date]", R = "[object Error]", w = "[object Function]", O = "[object GeneratorFunction]", M = "[object Map]", N = "[object Number]", D = "[object Object]", P = "[object RegExp]", H = "[object Set]", re = "[object String]", W = "[object Symbol]", q = "[object WeakMap]", Z = "[object ArrayBuffer]", Ie = "[object DataView]", We = "[object Float32Array]", Ce = "[object Float64Array]", st = "[object Int8Array]", G = "[object Int16Array]", K = "[object Int32Array]", j = "[object Uint8Array]", J = "[object Uint8ClampedArray]", z = "[object Uint16Array]", de = "[object Uint32Array]", ee = {};
|
|
10717
10717
|
ee[k] = ee[p] = ee[Z] = ee[Ie] = ee[I] = ee[v] = ee[We] = ee[Ce] = ee[st] = ee[G] = ee[K] = ee[M] = ee[N] = ee[D] = ee[P] = ee[H] = ee[re] = ee[W] = ee[j] = ee[J] = ee[z] = ee[de] = !0, ee[R] = ee[w] = ee[q] = !1;
|
|
10718
10718
|
function me(Y, se, xe, Ht, bt, it) {
|
|
10719
10719
|
var Me, Se = se & x, Ot = se & C, km = se & _;
|
|
@@ -10721,12 +10721,12 @@ function nw() {
|
|
|
10721
10721
|
return Me;
|
|
10722
10722
|
if (!T(Y))
|
|
10723
10723
|
return Y;
|
|
10724
|
-
var gc =
|
|
10724
|
+
var gc = b(Y);
|
|
10725
10725
|
if (gc) {
|
|
10726
10726
|
if (Me = d(Y), !Se)
|
|
10727
10727
|
return a(Y, Me);
|
|
10728
10728
|
} else {
|
|
10729
|
-
var Kt = f(Y), _c = Kt == w || Kt ==
|
|
10729
|
+
var Kt = f(Y), _c = Kt == w || Kt == O;
|
|
10730
10730
|
if (y(Y))
|
|
10731
10731
|
return i(Y, Se);
|
|
10732
10732
|
if (Kt == D || Kt == k || _c && !bt) {
|
|
@@ -10744,12 +10744,12 @@ function nw() {
|
|
|
10744
10744
|
return vc;
|
|
10745
10745
|
it.set(Y, Me), A(Y) ? Y.forEach(function(Et) {
|
|
10746
10746
|
Me.add(me(Et, se, xe, Et, Y, it));
|
|
10747
|
-
}) : g(Y) && Y.forEach(function(Et,
|
|
10748
|
-
Me.set(
|
|
10747
|
+
}) : g(Y) && Y.forEach(function(Et, Pt) {
|
|
10748
|
+
Me.set(Pt, me(Et, se, xe, Pt, Y, it));
|
|
10749
10749
|
});
|
|
10750
10750
|
var Im = km ? Ot ? u : l : Ot ? E : S, wc = gc ? void 0 : Im(Y);
|
|
10751
|
-
return e(wc || Y, function(Et,
|
|
10752
|
-
wc && (
|
|
10751
|
+
return e(wc || Y, function(Et, Pt) {
|
|
10752
|
+
wc && (Pt = Et, Et = Y[Pt]), t(Me, Pt, me(Et, se, xe, Pt, Y, it));
|
|
10753
10753
|
}), Me;
|
|
10754
10754
|
}
|
|
10755
10755
|
return Ba = me, Ba;
|
|
@@ -10851,20 +10851,20 @@ const Oe = /* @__PURE__ */ kn(iw), Nt = (r) => {
|
|
|
10851
10851
|
throw new Error("Email body is too long");
|
|
10852
10852
|
return e;
|
|
10853
10853
|
}, ac = (r, e, t) => {
|
|
10854
|
-
const n = Ue(), s =
|
|
10854
|
+
const n = Ue(), s = Mt(), i = Ke(), a = De(), o = r.at(-1);
|
|
10855
10855
|
if (!o)
|
|
10856
10856
|
throw new Error("EMPTY_PATH");
|
|
10857
10857
|
const c = i.collections[o], { labels: l, fields: u, preloadCache: f } = c, d = lt(o), h = a.collections?.[l.collection];
|
|
10858
10858
|
if (!a.Role)
|
|
10859
10859
|
throw new Error("PERMISSION_DENIED");
|
|
10860
|
-
const m = h && _t("Read", h),
|
|
10861
|
-
const
|
|
10860
|
+
const m = h && _t("Read", h), b = Cn(c, i, a), y = Td(c, a), g = Io(c, a), T = Rd(c, i, a), A = (w = []) => {
|
|
10861
|
+
const O = [];
|
|
10862
10862
|
if (m)
|
|
10863
|
-
|
|
10864
|
-
else if (
|
|
10865
|
-
for (const M of
|
|
10866
|
-
|
|
10867
|
-
return
|
|
10863
|
+
O.push(pe(Pr(n, "tenants", s, "system_fields", l.collection, `${l.collection}-${e.key}`), ge("Collection_Path_String", "==", r.join("/")), ...w));
|
|
10864
|
+
else if (b)
|
|
10865
|
+
for (const M of b)
|
|
10866
|
+
O.push(pe(Pr(n, "tenants", s, "system_fields", l.collection, `${l.collection}-${M.field}`), ge("Collection_Path_String", "==", r.join("/")), ...w));
|
|
10867
|
+
return O;
|
|
10868
10868
|
}, S = y.filter((w) => "operations" in w && w.operations ? w.operations.includes("Read") : !0);
|
|
10869
10869
|
if (t || S.length === 0 && g.length === 0 && T.length === 0)
|
|
10870
10870
|
return A();
|
|
@@ -10875,10 +10875,10 @@ const Oe = /* @__PURE__ */ kn(iw), Nt = (r) => {
|
|
|
10875
10875
|
if (S) {
|
|
10876
10876
|
for (const w of S)
|
|
10877
10877
|
if (w.type === "Record_Property") {
|
|
10878
|
-
const
|
|
10879
|
-
if (!
|
|
10878
|
+
const O = w.roles.find((M) => M.role === a.Role);
|
|
10879
|
+
if (!O)
|
|
10880
10880
|
throw new Error("PERMISSION_DENIED");
|
|
10881
|
-
x(
|
|
10881
|
+
x(O.values?.length);
|
|
10882
10882
|
}
|
|
10883
10883
|
}
|
|
10884
10884
|
f?.roles.includes(a.Role) && f.range && x(f.range.fields.length);
|
|
@@ -10887,25 +10887,25 @@ const Oe = /* @__PURE__ */ kn(iw), Nt = (r) => {
|
|
|
10887
10887
|
const _ = E === 0 ? 30 : Math.max(1, Math.floor(30 / E)), k = [];
|
|
10888
10888
|
S.filter((w) => w.type === "Record_Owner").forEach(() => k.push(ge("Created_By", "==", a.User_ID))), S.filter((w) => w.type === "Record_User").forEach((w) => {
|
|
10889
10889
|
if ("collectionField" in w) {
|
|
10890
|
-
const
|
|
10891
|
-
k.push(ge(`${
|
|
10890
|
+
const O = ne(u, w.collectionField);
|
|
10891
|
+
k.push(ge(`${O.name}_Array`, "array-contains", a.Doc_ID));
|
|
10892
10892
|
}
|
|
10893
10893
|
}), S.filter((w) => w.type === "Record_Property").forEach((w) => {
|
|
10894
10894
|
if ("propertyField" in w) {
|
|
10895
|
-
const
|
|
10896
|
-
if (!
|
|
10895
|
+
const O = w.roles.find((N) => N.role === a.Role);
|
|
10896
|
+
if (!O)
|
|
10897
10897
|
throw new Error("PERMISSION_DENIED");
|
|
10898
10898
|
const M = ne(u, w.propertyField);
|
|
10899
|
-
M.type === "Array" ? k.push(ge(M.name, "array-contains-any",
|
|
10899
|
+
M.type === "Array" ? k.push(ge(M.name, "array-contains-any", O.values)) : k.push(ge(M.name, "in", O.values));
|
|
10900
10900
|
}
|
|
10901
10901
|
});
|
|
10902
10902
|
const p = [];
|
|
10903
10903
|
g.filter((w) => w.type === "Individual").forEach((w) => {
|
|
10904
|
-
const
|
|
10905
|
-
if (
|
|
10904
|
+
const O = h?.individualEntities, M = [];
|
|
10905
|
+
if (O) {
|
|
10906
10906
|
const N = w.singleQuery ? w.singleQuery : _;
|
|
10907
|
-
for (let D = 0; D <
|
|
10908
|
-
const P =
|
|
10907
|
+
for (let D = 0; D < O.length; D += N) {
|
|
10908
|
+
const P = O.slice(D, D + N);
|
|
10909
10909
|
M.push(P);
|
|
10910
10910
|
}
|
|
10911
10911
|
if (!w.singleQuery)
|
|
@@ -10913,15 +10913,15 @@ const Oe = /* @__PURE__ */ kn(iw), Nt = (r) => {
|
|
|
10913
10913
|
p.push(...A(k.concat(ge("id", "in", D))));
|
|
10914
10914
|
});
|
|
10915
10915
|
else {
|
|
10916
|
-
if (
|
|
10916
|
+
if (O.length > N)
|
|
10917
10917
|
throw new Error(`INPUT_ERROR: Individual entity restriction with singleQuery set to true must not have more than ${w.singleQuery} entities`);
|
|
10918
|
-
k.push(ge("id", "in",
|
|
10918
|
+
k.push(ge("id", "in", O));
|
|
10919
10919
|
}
|
|
10920
10920
|
}
|
|
10921
10921
|
}), T.filter((w) => w.parentFilter.type === "Individual").forEach((w) => {
|
|
10922
|
-
const { parentFilter:
|
|
10923
|
-
if ("collectionField" in
|
|
10924
|
-
const N = ne(u,
|
|
10922
|
+
const { parentFilter: O, parentRestriction: M } = w;
|
|
10923
|
+
if ("collectionField" in O) {
|
|
10924
|
+
const N = ne(u, O.collectionField);
|
|
10925
10925
|
if ("collection" in N) {
|
|
10926
10926
|
const D = a.collections?.[N.collection];
|
|
10927
10927
|
if (!D)
|
|
@@ -10949,8 +10949,8 @@ const Oe = /* @__PURE__ */ kn(iw), Nt = (r) => {
|
|
|
10949
10949
|
const I = [];
|
|
10950
10950
|
g.filter((w) => w.type === "Parent").forEach((w) => {
|
|
10951
10951
|
if ("collectionField" in w) {
|
|
10952
|
-
const
|
|
10953
|
-
if ("collection" in
|
|
10952
|
+
const O = ne(u, w.collectionField);
|
|
10953
|
+
if ("collection" in O) {
|
|
10954
10954
|
const M = h?.parentEntities, N = [];
|
|
10955
10955
|
if (M) {
|
|
10956
10956
|
const D = w.singleQuery ? w.singleQuery : _;
|
|
@@ -10960,20 +10960,20 @@ const Oe = /* @__PURE__ */ kn(iw), Nt = (r) => {
|
|
|
10960
10960
|
}
|
|
10961
10961
|
if (!w.singleQuery)
|
|
10962
10962
|
N.forEach((P) => {
|
|
10963
|
-
I.push(...A(k.concat(ge(`${
|
|
10963
|
+
I.push(...A(k.concat(ge(`${O.name}_Array`, "array-contains-any", P))));
|
|
10964
10964
|
});
|
|
10965
10965
|
else {
|
|
10966
10966
|
if (M && M.length > D)
|
|
10967
10967
|
throw new Error(`INPUT_ERROR: Parent entity restriction with singleQuery set to true must not have more than ${w.singleQuery} entities`);
|
|
10968
|
-
k.push(ge(`${
|
|
10968
|
+
k.push(ge(`${O.name}_Array`, "array-contains-any", M));
|
|
10969
10969
|
}
|
|
10970
10970
|
}
|
|
10971
10971
|
}
|
|
10972
10972
|
}
|
|
10973
10973
|
}), T.filter((w) => w.parentFilter.type === "Parent").forEach((w) => {
|
|
10974
|
-
const { parentFilter:
|
|
10975
|
-
if ("collectionField" in
|
|
10976
|
-
const N = ne(u,
|
|
10974
|
+
const { parentFilter: O, parentRestriction: M } = w;
|
|
10975
|
+
if ("collectionField" in O && "parentCollectionField" in O) {
|
|
10976
|
+
const N = ne(u, O.collectionField), D = ne(u, O.parentCollectionField);
|
|
10977
10977
|
if ("collection" in N && "collection" in D) {
|
|
10978
10978
|
const P = a.collections?.[N.collection];
|
|
10979
10979
|
if (!P)
|
|
@@ -11001,8 +11001,8 @@ const Oe = /* @__PURE__ */ kn(iw), Nt = (r) => {
|
|
|
11001
11001
|
const v = [];
|
|
11002
11002
|
I.length === 0 && (g.filter((w) => w.type === "Parent_Property").forEach((w) => {
|
|
11003
11003
|
if ("collectionField" in w && "propertyField" in w) {
|
|
11004
|
-
const
|
|
11005
|
-
if ("collection" in
|
|
11004
|
+
const O = ne(u, w.collectionField), M = ne(u, w.propertyField);
|
|
11005
|
+
if ("collection" in O) {
|
|
11006
11006
|
const N = h?.parentPropertyEntities || {};
|
|
11007
11007
|
Object.entries(N).forEach(([D, P]) => {
|
|
11008
11008
|
if (P.length > 0) {
|
|
@@ -11013,7 +11013,7 @@ const Oe = /* @__PURE__ */ kn(iw), Nt = (r) => {
|
|
|
11013
11013
|
}
|
|
11014
11014
|
H.forEach((re) => {
|
|
11015
11015
|
v.push(...A(k.concat([
|
|
11016
|
-
ge(`${
|
|
11016
|
+
ge(`${O.name}_Array`, "array-contains-any", re),
|
|
11017
11017
|
ge(M.name, "==", D)
|
|
11018
11018
|
])));
|
|
11019
11019
|
});
|
|
@@ -11022,9 +11022,9 @@ const Oe = /* @__PURE__ */ kn(iw), Nt = (r) => {
|
|
|
11022
11022
|
}
|
|
11023
11023
|
}
|
|
11024
11024
|
}), T.filter((w) => w.parentFilter.type === "Parent_Property").forEach((w) => {
|
|
11025
|
-
const { parentFilter:
|
|
11026
|
-
if ("collectionField" in
|
|
11027
|
-
const M = ne(u,
|
|
11025
|
+
const { parentFilter: O } = w;
|
|
11026
|
+
if ("collectionField" in O && "parentCollectionField" in O && "parentPropertyField" in O) {
|
|
11027
|
+
const M = ne(u, O.collectionField), N = ne(u, O.parentCollectionField), D = ne(u, O.parentPropertyField);
|
|
11028
11028
|
if ("collection" in M && "collection" in N) {
|
|
11029
11029
|
const P = a.collections?.[M.collection];
|
|
11030
11030
|
if (!P)
|
|
@@ -11085,12 +11085,12 @@ const Oe = /* @__PURE__ */ kn(iw), Nt = (r) => {
|
|
|
11085
11085
|
]), t ||= i.range;
|
|
11086
11086
|
const d = ac([s.collection], o).map((m) => {
|
|
11087
11087
|
if (t) {
|
|
11088
|
-
const { start:
|
|
11088
|
+
const { start: b, end: y } = aw(t), g = t.fields.filter((A) => !t.ranges?.some((S) => S.includes(A))).map((A) => Qr(ge(A, ">=", b), ge(A, "<=", y))), T = t.ranges?.map((A) => Qr(ge(A[0], "<=", y), ge(A[1], ">=", b)));
|
|
11089
11089
|
m = pe(m, Tc(...g, ...T || []));
|
|
11090
11090
|
}
|
|
11091
|
-
return n && (m = pe(m, Qr(Tc(...n.map((
|
|
11091
|
+
return n && (m = pe(m, Qr(Tc(...n.map((b) => ge(...b)))))), e && (m = pe(m, Qr(...e.map((b) => ge(...b))))), m;
|
|
11092
11092
|
}), h = /* @__PURE__ */ new Map();
|
|
11093
|
-
return new Promise((m,
|
|
11093
|
+
return new Promise((m, b) => {
|
|
11094
11094
|
if (d.length === 0) {
|
|
11095
11095
|
m({});
|
|
11096
11096
|
return;
|
|
@@ -11100,7 +11100,7 @@ const Oe = /* @__PURE__ */ kn(iw), Nt = (r) => {
|
|
|
11100
11100
|
const T = hr(y, { includeMetadataChanges: !0 }, (A) => {
|
|
11101
11101
|
(!A.metadata.fromCache || g) && (g || (g = !0, h.set(y, !0), h.size === d.length && m({})));
|
|
11102
11102
|
}, (A) => {
|
|
11103
|
-
console.error(A),
|
|
11103
|
+
console.error(A), b(A);
|
|
11104
11104
|
});
|
|
11105
11105
|
f[s.collection].push(T);
|
|
11106
11106
|
});
|
|
@@ -11122,12 +11122,12 @@ const Oe = /* @__PURE__ */ kn(iw), Nt = (r) => {
|
|
|
11122
11122
|
document.dispatchEvent(f);
|
|
11123
11123
|
try {
|
|
11124
11124
|
if (await uw(a, e, t, n), c?.relationCollections && await Ee(c.relationCollections)) {
|
|
11125
|
-
const m =
|
|
11126
|
-
for (const
|
|
11127
|
-
if (!s.collections[
|
|
11125
|
+
const m = jt(a, s, i);
|
|
11126
|
+
for (const b of m) {
|
|
11127
|
+
if (!s.collections[b].preloadCache?.roles.includes(i.Role))
|
|
11128
11128
|
continue;
|
|
11129
|
-
const g = So()[
|
|
11130
|
-
g === "Loading" || g === "Loaded" || g === "Error" || g || await Dr(
|
|
11129
|
+
const g = So()[b];
|
|
11130
|
+
g === "Loading" || g === "Loaded" || g === "Error" || g || await Dr(b);
|
|
11131
11131
|
}
|
|
11132
11132
|
}
|
|
11133
11133
|
l[o.collection] = "Loaded";
|
|
@@ -11137,48 +11137,48 @@ const Oe = /* @__PURE__ */ kn(iw), Nt = (r) => {
|
|
|
11137
11137
|
throw l[o.collection] = "Error", d;
|
|
11138
11138
|
}
|
|
11139
11139
|
};
|
|
11140
|
-
let
|
|
11140
|
+
let $t = null;
|
|
11141
11141
|
const fw = async (r, e) => {
|
|
11142
|
-
const t = [], n =
|
|
11142
|
+
const t = [], n = Mt(), s = Ue(), i = ke();
|
|
11143
11143
|
if (!e.claims.doc)
|
|
11144
11144
|
throw new Error("User document ID not found in claims");
|
|
11145
|
-
let
|
|
11146
|
-
return await new Promise((
|
|
11147
|
-
const
|
|
11148
|
-
if (
|
|
11149
|
-
if (
|
|
11145
|
+
let a = !1, o = null;
|
|
11146
|
+
return await new Promise((l, u) => {
|
|
11147
|
+
const f = hr(Ae(s, "tenants", n, "system_user_permissions", r.uid), (d) => {
|
|
11148
|
+
if (d.exists()) {
|
|
11149
|
+
if ($t = d.data(), $t.User_ID = d.id, !$t.Role)
|
|
11150
11150
|
throw new Error("PERMISSION_DENIED");
|
|
11151
|
-
if (!
|
|
11152
|
-
|
|
11151
|
+
if (!a)
|
|
11152
|
+
a = !0, l();
|
|
11153
11153
|
else {
|
|
11154
|
-
const
|
|
11155
|
-
if (document.dispatchEvent(
|
|
11154
|
+
const h = new Event("stoker:permissionsChange");
|
|
11155
|
+
if (document.dispatchEvent(h), i.auth.signOutOnPermissionsChange)
|
|
11156
11156
|
Om();
|
|
11157
11157
|
else {
|
|
11158
|
-
const
|
|
11159
|
-
if (
|
|
11160
|
-
for (const [
|
|
11161
|
-
|
|
11162
|
-
(!
|
|
11163
|
-
!_y(
|
|
11158
|
+
const m = $t.collections;
|
|
11159
|
+
if (m)
|
|
11160
|
+
for (const [b, y] of Object.entries(m))
|
|
11161
|
+
o && // eslint-disable-next-line security/detect-object-injection
|
|
11162
|
+
(!o.collections?.[b] || // eslint-disable-next-line security/detect-object-injection
|
|
11163
|
+
!_y(y, o.collections[b])) && Dr(b);
|
|
11164
11164
|
}
|
|
11165
11165
|
}
|
|
11166
|
-
|
|
11166
|
+
o = $t;
|
|
11167
11167
|
} else
|
|
11168
|
-
|
|
11169
|
-
}, (
|
|
11170
|
-
|
|
11168
|
+
u(new Error("Permissions not found"));
|
|
11169
|
+
}, (d) => {
|
|
11170
|
+
u(new Error(`Error getting permissions for user ${r.uid}`, { cause: d }));
|
|
11171
11171
|
});
|
|
11172
|
-
t.push(
|
|
11172
|
+
t.push(f);
|
|
11173
11173
|
}), t;
|
|
11174
|
-
}, De = () =>
|
|
11175
|
-
|
|
11174
|
+
}, De = () => $t, dw = () => {
|
|
11175
|
+
$t = null;
|
|
11176
11176
|
}, oc = (r) => {
|
|
11177
11177
|
if (typeof r == "object")
|
|
11178
11178
|
for (const e in r)
|
|
11179
11179
|
Object.prototype.hasOwnProperty.call(r, e) && (ir(r[e]) ? r[e] = "_DELETE_FIELD" : oc(r[e]));
|
|
11180
11180
|
}, He = async (r, e, t, n, s, i, a, o, c) => {
|
|
11181
|
-
const l =
|
|
11181
|
+
const l = Mt(), { labels: u } = i, f = ke(), d = yc(), h = await ie(f, ["global", "firebase", "writeLogTTL"]), m = {
|
|
11182
11182
|
operation: r,
|
|
11183
11183
|
collection: u.collection,
|
|
11184
11184
|
docId: s,
|
|
@@ -11194,16 +11194,16 @@ const fw = async (r, e) => {
|
|
|
11194
11194
|
};
|
|
11195
11195
|
if (h) {
|
|
11196
11196
|
const T = /* @__PURE__ */ new Date(), A = new Date((/* @__PURE__ */ new Date()).setDate(T.getDate() + h));
|
|
11197
|
-
m.TTL =
|
|
11197
|
+
m.TTL = Bt.fromDate(A);
|
|
11198
11198
|
}
|
|
11199
|
-
const
|
|
11200
|
-
r !== "delete" && (m.data.data =
|
|
11199
|
+
const b = Oe(t);
|
|
11200
|
+
r !== "delete" && (m.data.data = b, e === "written" && oc(m.data.data)), r !== "delete" && e !== "written" && rr(b), r === "update" && (m.data.originalRecord = Oe(c)), r !== "delete" && ["started", "written"].includes(e) && (delete m.data.data.Saved_At, delete m.data.data.Last_Save_At), e === "failed" && (m.data.error = JSON.stringify(o));
|
|
11201
11201
|
const y = t.Last_Write_At, g = Ae(d, "tenants", l, "system_write_log", `${a}-${y.valueOf()}`);
|
|
11202
11202
|
Gm(g, m).catch((T) => {
|
|
11203
11203
|
console.error(`Error saving "${e}" ${r} log entry for record ${s} in ${u.collection} collection.`, { cause: T });
|
|
11204
11204
|
});
|
|
11205
11205
|
}, cc = async (r, e, t, n, s) => {
|
|
11206
|
-
const i =
|
|
11206
|
+
const i = Mt(), a = Ue(), o = n.labels.collection, c = n.fields.filter((u) => "unique" in u && u.unique), l = [];
|
|
11207
11207
|
if (!s.Role)
|
|
11208
11208
|
throw new Error("No role found in permissions");
|
|
11209
11209
|
if (await Promise.all(c.map(async (u) => {
|
|
@@ -11222,7 +11222,7 @@ const fw = async (r, e) => {
|
|
|
11222
11222
|
})), l.length > 0)
|
|
11223
11223
|
throw new Error(l.join(", "));
|
|
11224
11224
|
}, fm = (r, e, t) => {
|
|
11225
|
-
const n = Ue(), s =
|
|
11225
|
+
const n = Ue(), s = Mt(), i = Ke(), a = De(), o = r.at(-1);
|
|
11226
11226
|
if (!o)
|
|
11227
11227
|
throw new Error("EMPTY_PATH");
|
|
11228
11228
|
const c = i.collections[o], { labels: l } = c, u = a.collections?.[l.collection];
|
|
@@ -11238,7 +11238,7 @@ const fw = async (r, e) => {
|
|
|
11238
11238
|
}, pd = (r) => r !== null && typeof r == "object" && !Array.isArray(r), dm = (r) => {
|
|
11239
11239
|
const e = (t) => {
|
|
11240
11240
|
Object.entries(t).forEach(([n, s]) => {
|
|
11241
|
-
pd(s) && Object.keys(s).length === 2 && typeof s._seconds == "number" && typeof s._nanoseconds == "number" ? t[n] = new
|
|
11241
|
+
pd(s) && Object.keys(s).length === 2 && typeof s._seconds == "number" && typeof s._nanoseconds == "number" ? t[n] = new Bt(s._seconds, s._nanoseconds) : pd(s) && e(s);
|
|
11242
11242
|
});
|
|
11243
11243
|
};
|
|
11244
11244
|
e(r);
|
|
@@ -11306,7 +11306,7 @@ const fw = async (r, e) => {
|
|
|
11306
11306
|
continue;
|
|
11307
11307
|
const d = Object.keys(f);
|
|
11308
11308
|
for (const h of d) {
|
|
11309
|
-
const m = f[h],
|
|
11309
|
+
const m = f[h], b = vr(m.Collection_Path, h, { only: s, noEmbeddingFields: i }).then((y) => {
|
|
11310
11310
|
if (f[h] = y, c > 0)
|
|
11311
11311
|
return lc(
|
|
11312
11312
|
// eslint-disable-next-line security/detect-object-injection
|
|
@@ -11323,7 +11323,7 @@ const fw = async (r, e) => {
|
|
|
11323
11323
|
else
|
|
11324
11324
|
throw y;
|
|
11325
11325
|
});
|
|
11326
|
-
l.push(
|
|
11326
|
+
l.push(b);
|
|
11327
11327
|
}
|
|
11328
11328
|
}
|
|
11329
11329
|
await Promise.all(l);
|
|
@@ -11343,7 +11343,7 @@ const fw = async (r, e) => {
|
|
|
11343
11343
|
const s = Ke(!0), a = Yr()[n], o = s.collections[n], { labels: c, access: l, preloadCache: u } = o, { serverReadOnly: f } = l, d = ke(), h = Object.keys(s.collections).includes(n), m = d.disabledCollections?.includes(n);
|
|
11344
11344
|
if (!h || m)
|
|
11345
11345
|
throw new Error("COLLECTION_NOT_FOUND");
|
|
11346
|
-
const
|
|
11346
|
+
const b = await lt(c.collection), y = await ie(d, [
|
|
11347
11347
|
"global",
|
|
11348
11348
|
"firebase",
|
|
11349
11349
|
"serverTimestampOptions"
|
|
@@ -11366,10 +11366,10 @@ const fw = async (r, e) => {
|
|
|
11366
11366
|
const v = t.pagination.startAfter || t.pagination.endBefore, R = jd(g.Role, o, s);
|
|
11367
11367
|
if (v && R !== !0)
|
|
11368
11368
|
throw new Error("INPUT_ERROR: Pagination is not allowed when using " + R);
|
|
11369
|
-
t.pagination.orderByField && t.pagination.orderByDirection ? t.pagination.startAfter || t.pagination.endBefore ? t.pagination.startAfter ? A = A.map((w,
|
|
11369
|
+
t.pagination.orderByField && t.pagination.orderByDirection ? t.pagination.startAfter || t.pagination.endBefore ? t.pagination.startAfter ? A = A.map((w, O) => pe(w, et(t.pagination.orderByField, t.pagination.orderByDirection), Xa(S.last.get(O)), er(t.pagination.number))) : A = A.map((w, O) => pe(w, et(t.pagination.orderByField, t.pagination.orderByDirection), eo(S.first.get(O)), xr(t.pagination.number))) : A = A.map((w) => pe(w, et(t.pagination.orderByField, t.pagination.orderByDirection), er(t.pagination.number))) : !t.pagination.startAfter && !t.pagination.endBefore ? A = A.map((w) => pe(w, er(t.pagination.number))) : t.pagination.startAfter ? A = A.map((w, O) => pe(w, Xa(S.last.get(O)), er(t.pagination.number))) : A = A.map((w, O) => pe(w, eo(S.first.get(O)), xr(t.pagination.number)));
|
|
11370
11370
|
}
|
|
11371
11371
|
const E = { collection: c.collection };
|
|
11372
|
-
await oe("preOperation", d,
|
|
11372
|
+
await oe("preOperation", d, b, ["read", void 0, void 0, E]), await oe("preRead", d, b, [E, A, !0, !1]);
|
|
11373
11373
|
const _ = /* @__PURE__ */ new Map(), k = A.map(async (v) => {
|
|
11374
11374
|
let R;
|
|
11375
11375
|
return t?.only === "cache" ? R = await bd(v) : t?.only === "server" ? R = await Hm(v) : R = await Km(v), R;
|
|
@@ -11377,9 +11377,9 @@ const fw = async (r, e) => {
|
|
|
11377
11377
|
for (const v of p) {
|
|
11378
11378
|
for (const R of v.docs) {
|
|
11379
11379
|
_.has(R.id) || _.set(R.id, {});
|
|
11380
|
-
const w = R.data({ serverTimestamps: y || "none" }),
|
|
11381
|
-
|
|
11382
|
-
const M = { ...
|
|
11380
|
+
const w = R.data({ serverTimestamps: y || "none" }), O = _.get(R.id);
|
|
11381
|
+
O.id ||= R.id;
|
|
11382
|
+
const M = { ...O, ...w };
|
|
11383
11383
|
delete M.Collection_Path_String, _.set(R.id, M);
|
|
11384
11384
|
}
|
|
11385
11385
|
S.first.set(p.indexOf(v), v.docs[0]), S.last.set(p.indexOf(v), v.docs.at(-1) || v.docs[0]);
|
|
@@ -11391,8 +11391,8 @@ const fw = async (r, e) => {
|
|
|
11391
11391
|
const R = await Od(v).catch(() => {
|
|
11392
11392
|
});
|
|
11393
11393
|
if (R) {
|
|
11394
|
-
const w = R.data().count,
|
|
11395
|
-
I =
|
|
11394
|
+
const w = R.data().count, O = t.pagination.number;
|
|
11395
|
+
I = O > 0 ? Math.floor(w / O) : 0;
|
|
11396
11396
|
}
|
|
11397
11397
|
}
|
|
11398
11398
|
for (const v of _.values()) {
|
|
@@ -11426,8 +11426,8 @@ const fw = async (r, e) => {
|
|
|
11426
11426
|
for (const N of _.values())
|
|
11427
11427
|
for (const D of o.fields)
|
|
11428
11428
|
D.type === "Computed" && !t?.noComputedFields && (N[D.name] = await D.formula(N)), t?.noEmbeddingFields && D.type === "Embedding" && delete N[D.name];
|
|
11429
|
-
const
|
|
11430
|
-
await oe("postOperation", d,
|
|
11429
|
+
const O = ["read", v, v.id, E];
|
|
11430
|
+
await oe("postOperation", d, b, O), await oe("postRead", d, b, [E, T, v, !1]);
|
|
11431
11431
|
}
|
|
11432
11432
|
return { cursor: S, pages: I, docs: Array.from(_.values()) };
|
|
11433
11433
|
}, mw = async (r, e, t) => {
|
|
@@ -11474,7 +11474,7 @@ const fw = async (r, e) => {
|
|
|
11474
11474
|
if (!d)
|
|
11475
11475
|
continue;
|
|
11476
11476
|
for (const [h, m] of Object.entries(d)) {
|
|
11477
|
-
const
|
|
11477
|
+
const b = vr(m.Collection_Path, h, {
|
|
11478
11478
|
only: s,
|
|
11479
11479
|
noComputedFields: i,
|
|
11480
11480
|
noEmbeddingFields: a
|
|
@@ -11496,7 +11496,7 @@ const fw = async (r, e) => {
|
|
|
11496
11496
|
else
|
|
11497
11497
|
throw y;
|
|
11498
11498
|
});
|
|
11499
|
-
u.push(
|
|
11499
|
+
u.push(b);
|
|
11500
11500
|
}
|
|
11501
11501
|
}
|
|
11502
11502
|
await Promise.all(u);
|
|
@@ -11515,7 +11515,7 @@ const fw = async (r, e) => {
|
|
|
11515
11515
|
"global",
|
|
11516
11516
|
"firebase",
|
|
11517
11517
|
"serverTimestampOptions"
|
|
11518
|
-
]), f = s.collections[n], { labels: d, access: h } = f, { serverReadOnly: m } = h,
|
|
11518
|
+
]), f = s.collections[n], { labels: d, access: h } = f, { serverReadOnly: m } = h, b = lt(d.collection), y = De();
|
|
11519
11519
|
if (!y?.Role)
|
|
11520
11520
|
throw new Error("PERMISSIONS_DENIED");
|
|
11521
11521
|
if (m?.includes(y.Role))
|
|
@@ -11524,7 +11524,7 @@ const fw = async (r, e) => {
|
|
|
11524
11524
|
if (g.length === 0)
|
|
11525
11525
|
throw new Error("PERMISSION_DENIED");
|
|
11526
11526
|
const T = { collection: d.collection };
|
|
11527
|
-
await oe("preOperation", o,
|
|
11527
|
+
await oe("preOperation", o, b, ["read", void 0, e, T]), await oe("preRead", o, b, [T, g, !1, !1]);
|
|
11528
11528
|
let E = {};
|
|
11529
11529
|
const x = g.map(async (v) => {
|
|
11530
11530
|
let R;
|
|
@@ -11549,11 +11549,11 @@ const fw = async (r, e) => {
|
|
|
11549
11549
|
if (t?.noEmbeddingFields)
|
|
11550
11550
|
for (const v of f.fields)
|
|
11551
11551
|
v.type === "Embedding" && delete E[v.name];
|
|
11552
|
-
return await oe("postOperation", o,
|
|
11552
|
+
return await oe("postOperation", o, b, ["read", E, e, T]), await oe("postRead", o, b, [T, g, E, !1]), E;
|
|
11553
11553
|
}, pw = (r) => r !== null && typeof r == "object", gm = (r) => {
|
|
11554
11554
|
const e = (t) => {
|
|
11555
11555
|
Object.entries(t).forEach(([n, s]) => {
|
|
11556
|
-
s instanceof
|
|
11556
|
+
s instanceof Bt ? t[n] = {
|
|
11557
11557
|
_seconds: s.seconds,
|
|
11558
11558
|
_nanoseconds: s.nanoseconds
|
|
11559
11559
|
} : pw(s) && e(s);
|
|
@@ -11570,11 +11570,11 @@ const fw = async (r, e) => {
|
|
|
11570
11570
|
user: n
|
|
11571
11571
|
})).data?.result;
|
|
11572
11572
|
}, uc = async (r, e, t, n, s, i) => {
|
|
11573
|
-
const a =
|
|
11573
|
+
const a = Mt(), o = Ke(), c = Ke(!0), l = pc(), u = ke(), f = dr(), d = Ue(), h = De();
|
|
11574
11574
|
if (r.length === 0)
|
|
11575
11575
|
throw new Error("EMPTY_PATH");
|
|
11576
|
-
const m = r.at(-1),
|
|
11577
|
-
if (!
|
|
11576
|
+
const m = r.at(-1), b = Object.keys(o.collections).includes(m), y = u.disabledCollections?.includes(m);
|
|
11577
|
+
if (!b || y)
|
|
11578
11578
|
throw new Error("COLLECTION_NOT_FOUND");
|
|
11579
11579
|
const g = o.collections[m], { labels: T, access: A, fields: S, enableWriteLog: E } = g, { serverWriteOnly: x } = A, C = lt(T.collection), _ = await ie(u, ["global", "appName"]), k = s?.retry, p = f.currentUser;
|
|
11580
11580
|
if (!p)
|
|
@@ -11586,16 +11586,16 @@ const fw = async (r, e) => {
|
|
|
11586
11586
|
i = k?.originalRecord || i || await vr(r, e, { noComputedFields: !0, noEmbeddingFields: !0 });
|
|
11587
11587
|
for (const q of c.collections[m].fields)
|
|
11588
11588
|
q.type === "Computed" && (delete t[q.name], delete i[q.name]);
|
|
11589
|
-
const I = Ao(d), v = { collection: T.collection }, R = g.auth && n?.operation === "create", w = g.auth && n?.operation === "delete",
|
|
11589
|
+
const I = Ao(d), v = { collection: T.collection }, R = g.auth && n?.operation === "create", w = g.auth && n?.operation === "delete", O = g.auth && !R && !w && (n?.operation === "update" || t.Role || t.Enabled !== void 0 || t.Name || t.Email || t.Photo_URL), M = await ie(C, [
|
|
11590
11590
|
"collections",
|
|
11591
11591
|
T.collection,
|
|
11592
11592
|
"custom",
|
|
11593
11593
|
"disableOfflineUpdate"
|
|
11594
11594
|
]), N = () => {
|
|
11595
|
-
if (
|
|
11595
|
+
if (zt() === "Offline" && (M || x || g.auth && (R || O || w)))
|
|
11596
11596
|
throw new Error("CLIENT_OFFLINE");
|
|
11597
11597
|
};
|
|
11598
|
-
if (N(), x || R ||
|
|
11598
|
+
if (N(), x || R || O || w) {
|
|
11599
11599
|
if (R) {
|
|
11600
11600
|
if (!n.password)
|
|
11601
11601
|
throw new Error("VALIDATION_ERROR: Password is required");
|
|
@@ -11617,7 +11617,7 @@ const fw = async (r, e) => {
|
|
|
11617
11617
|
return await yw(r, e, t, n ? { operation: n.operation, permissions: n.permissions, password: n.password } : void 0);
|
|
11618
11618
|
}
|
|
11619
11619
|
delete t.id;
|
|
11620
|
-
const D = Ho("update", r, t, o, _,
|
|
11620
|
+
const D = Ho("update", r, t, o, _, zt(), p.uid, Bt.now(), qr(), !!k);
|
|
11621
11621
|
for (const q of S)
|
|
11622
11622
|
!_e(q) && ir(D[q.name]) && q.nullable && (D[q.name] = null);
|
|
11623
11623
|
if (Nt(D), Nt(i), !k && E && He("update", "started", D, r, e, g, p.uid, void 0, i), !k) {
|
|
@@ -11650,7 +11650,7 @@ const fw = async (r, e) => {
|
|
|
11650
11650
|
const re = { ...i, ...D };
|
|
11651
11651
|
return rr(re), { id: e, ...re };
|
|
11652
11652
|
}, fc = async (r, e, t, n, s, i, a, o, c, l, u, f, d) => {
|
|
11653
|
-
const h = Ke(), m = ke(), { labels:
|
|
11653
|
+
const h = Ke(), m = ke(), { labels: b } = i;
|
|
11654
11654
|
let y = 0;
|
|
11655
11655
|
const g = async () => {
|
|
11656
11656
|
try {
|
|
@@ -11660,7 +11660,7 @@ const fw = async (r, e) => {
|
|
|
11660
11660
|
let A;
|
|
11661
11661
|
const S = await ie(a, [
|
|
11662
11662
|
"collections",
|
|
11663
|
-
|
|
11663
|
+
b.collection,
|
|
11664
11664
|
"custom",
|
|
11665
11665
|
"autoCorrectUnique"
|
|
11666
11666
|
]);
|
|
@@ -11671,22 +11671,22 @@ const fw = async (r, e) => {
|
|
|
11671
11671
|
const p = k.message.split(", "), I = [], v = [];
|
|
11672
11672
|
let R = !1;
|
|
11673
11673
|
for (const w of p) {
|
|
11674
|
-
const
|
|
11674
|
+
const O = w.split(" ")[0], M = h.collections[b.collection].fields.find((N) => N.name === O);
|
|
11675
11675
|
if (!M)
|
|
11676
|
-
throw new Error(`SCHEMA_ERROR: Field ${
|
|
11676
|
+
throw new Error(`SCHEMA_ERROR: Field ${O} not found in ${b.collection} schema`);
|
|
11677
11677
|
M.type === "Number" && I.push(w), M.type === "String" && v.push(w);
|
|
11678
11678
|
}
|
|
11679
11679
|
if ((!S || I.length > 0) && (A = new Error(`VALIDATION_ERROR: ${p.join(", ")}`)), S && v.length > 0) {
|
|
11680
11680
|
for (const w of v) {
|
|
11681
|
-
const
|
|
11682
|
-
if (h.collections[
|
|
11681
|
+
const O = w.split(" ")[0];
|
|
11682
|
+
if (h.collections[b.collection].fields.find((D) => D.name === O).type === "Number")
|
|
11683
11683
|
continue;
|
|
11684
11684
|
let N = 1;
|
|
11685
|
-
n[
|
|
11685
|
+
n[O].match(/ - DUPLICATE-\d+/) ? (N = parseInt(
|
|
11686
11686
|
// eslint-disable-next-line security/detect-object-injection
|
|
11687
|
-
n[
|
|
11688
|
-
), n[
|
|
11689
|
-
n[
|
|
11687
|
+
n[O].match(/ - DUPLICATE-\d+/)[0].split("-")[2]
|
|
11688
|
+
), n[O] = // eslint-disable-next-line security/detect-object-injection
|
|
11689
|
+
n[O].replace(/ - DUPLICATE-\d+/g, "") + ` - DUPLICATE-${N + 1}`) : n[O] = n[O] + " - DUPLICATE-1", N < 10 ? R = !0 : A = new Error(p.map((D) => D.replace(/ - DUPLICATE-\d+/g, "")).join(", "));
|
|
11690
11690
|
}
|
|
11691
11691
|
if (R) {
|
|
11692
11692
|
r === "create" && await _m(e, n, void 0, { retry: { type: "unique", docId: t } }), r === "update" && await uc(e, t, n, void 0, {
|
|
@@ -11742,11 +11742,11 @@ const fw = async (r, e) => {
|
|
|
11742
11742
|
id: n
|
|
11743
11743
|
})).data?.result;
|
|
11744
11744
|
}, _m = async (r, e, t, n, s, i) => {
|
|
11745
|
-
const a =
|
|
11745
|
+
const a = Mt(), o = Ke(), c = pc(), l = ke(), u = dr(), f = Ue(), d = De();
|
|
11746
11746
|
if (r.length === 0)
|
|
11747
11747
|
throw new Error("EMPTY_PATH");
|
|
11748
|
-
const h = r.at(-1), m = Object.keys(o.collections).includes(h),
|
|
11749
|
-
if (!m ||
|
|
11748
|
+
const h = r.at(-1), m = Object.keys(o.collections).includes(h), b = l.disabledCollections?.includes(h);
|
|
11749
|
+
if (!m || b)
|
|
11750
11750
|
throw new Error("COLLECTION_NOT_FOUND");
|
|
11751
11751
|
const y = o.collections[h], { labels: g, access: T, enableWriteLog: A, softDelete: S } = y, { serverWriteOnly: E } = T, x = lt(g.collection), C = await ie(l, ["global", "appName"]), _ = n?.retry, k = u.currentUser;
|
|
11752
11752
|
if (!k)
|
|
@@ -11759,7 +11759,7 @@ const fw = async (r, e) => {
|
|
|
11759
11759
|
"custom",
|
|
11760
11760
|
"disableOfflineCreate"
|
|
11761
11761
|
]), I = () => {
|
|
11762
|
-
if (
|
|
11762
|
+
if (zt() === "Offline" && (p || E || y.auth && t))
|
|
11763
11763
|
throw new Error("CLIENT_OFFLINE");
|
|
11764
11764
|
};
|
|
11765
11765
|
I();
|
|
@@ -11786,18 +11786,18 @@ const fw = async (r, e) => {
|
|
|
11786
11786
|
return i && i(), await gw(r, e, t ? { permissions: t.permissions, password: t.password } : void 0, R);
|
|
11787
11787
|
}
|
|
11788
11788
|
e.id = R;
|
|
11789
|
-
const
|
|
11790
|
-
if (S && (
|
|
11789
|
+
const O = Ho("create", r, e, o, C, zt(), k.uid, Bt.now(), qr(), !!_);
|
|
11790
|
+
if (S && (O[S.archivedField] = !1), Nt(O), !_ && A && He("create", "started", O, r, R, y, k.uid), _ || (await oe("preOperation", l, x, ["create", O, R, w, v]), await oe("preWrite", l, x, ["create", O, R, w, v])), Qd(y, O, o), Xd(y, O), _ || await hg(O, y, x, d.Role), !_)
|
|
11791
11791
|
try {
|
|
11792
|
-
await am("create",
|
|
11792
|
+
await am("create", O, y, x, ["create", O, w, v], o), p && (I(), await cc("create", R, O, y, d));
|
|
11793
11793
|
} catch (P) {
|
|
11794
11794
|
throw new Error(`VALIDATION_ERROR: ${P.message}`);
|
|
11795
11795
|
}
|
|
11796
|
-
if (i && i(), Nt(
|
|
11797
|
-
return { docId: R, record:
|
|
11798
|
-
A && He("create", "success",
|
|
11799
|
-
const M = ["create",
|
|
11800
|
-
return await oe("postWrite", l, x, M), await oe("postOperation", l, x, N), { id: R, ...
|
|
11796
|
+
if (i && i(), Nt(O), by(O, R, y, o, k.uid, d), ic("create", v, r, R, O, o, y, n, c, ko, Co, Rn, (P) => Ae(f, "tenants", a, "system_fields", g.collection, `${g.collection}-${P.name}`, R), (P, H) => Ae(f, "tenants", a, "system_unique", g.collection, `Unique-${g.collection}-${P.name}`, H), (P) => Ae(f, "tenants", a, "system_fields", g.collection, `${g.collection}-${P}`, R)), v.set(Ae(f, "tenants", a, r.join("/"), R), O), !_ && A && He("create", "written", O, r, R, y, k.uid), await fc("create", r, R, O, w, y, x, v, k.uid, A || !1, d, !!_), _?.type === "unique")
|
|
11797
|
+
return { docId: R, record: O };
|
|
11798
|
+
A && He("create", "success", O, r, R, y, k.uid);
|
|
11799
|
+
const M = ["create", O, R, w, !!_], N = [...M];
|
|
11800
|
+
return await oe("postWrite", l, x, M), await oe("postOperation", l, x, N), { id: R, ...O };
|
|
11801
11801
|
}, _w = async (r, e) => {
|
|
11802
11802
|
const t = nt(), n = Ve(), s = je(t, n.STOKER_FB_FUNCTIONS_REGION);
|
|
11803
11803
|
return (await Ye(s, "stoker-writeapi", { timeout: 540 * 1e3 })({
|
|
@@ -11806,13 +11806,13 @@ const fw = async (r, e) => {
|
|
|
11806
11806
|
id: e
|
|
11807
11807
|
})).data?.result;
|
|
11808
11808
|
}, vw = async (r, e, t) => {
|
|
11809
|
-
const n =
|
|
11809
|
+
const n = Mt(), s = Ke(), i = pc(), a = dr(), o = Ue(), c = ke(), l = De();
|
|
11810
11810
|
if (r.length === 0)
|
|
11811
11811
|
throw new Error("EMPTY_PATH");
|
|
11812
11812
|
const u = r.at(-1), f = Object.keys(s.collections).includes(u), d = c.disabledCollections?.includes(u);
|
|
11813
11813
|
if (!f || d)
|
|
11814
11814
|
throw new Error("COLLECTION_NOT_FOUND");
|
|
11815
|
-
const h = s.collections[u], { labels: m, access:
|
|
11815
|
+
const h = s.collections[u], { labels: m, access: b, enableWriteLog: y, softDelete: g } = h, { serverWriteOnly: T } = b, A = lt(m.collection), S = await ie(c, ["global", "appName"]), E = t?.retry, x = a.currentUser;
|
|
11816
11816
|
if (!x)
|
|
11817
11817
|
throw new Error("NOT_AUTHENTICATED");
|
|
11818
11818
|
if (!l)
|
|
@@ -11829,7 +11829,7 @@ const fw = async (r, e) => {
|
|
|
11829
11829
|
"disableOfflineDelete"
|
|
11830
11830
|
]);
|
|
11831
11831
|
if ((() => {
|
|
11832
|
-
if (
|
|
11832
|
+
if (zt() === "Offline" && (C || T || h.auth))
|
|
11833
11833
|
throw new Error("CLIENT_OFFLINE");
|
|
11834
11834
|
})(), T || h.auth)
|
|
11835
11835
|
return await _w(r, e);
|
|
@@ -11842,10 +11842,10 @@ const fw = async (r, e) => {
|
|
|
11842
11842
|
throw y && E?.record && N.message.indexOf("NOT_FOUND") !== -1 && await He("delete", "failed", E?.record, r, e, h, x.uid, N), N;
|
|
11843
11843
|
}
|
|
11844
11844
|
delete k.id;
|
|
11845
|
-
const p = Ao(o), I = { collection: m.collection }, v = Ho("delete", r, k, s, S,
|
|
11845
|
+
const p = Ao(o), I = { collection: m.collection }, v = Ho("delete", r, k, s, S, zt(), x.uid, Bt.now(), qr(), !!E);
|
|
11846
11846
|
Nt(v), !E && y && He("delete", "started", v, r, e, h, x.uid), E || (await oe("preOperation", c, A, ["delete", v, e, I, p]), await oe("preWrite", c, A, ["delete", v, e, I, p])), Nt(v), Ey(v, e, h, s, x.uid, l), ic("delete", p, r, e, v, s, h, t, i, ko, Co, Rn, (N) => Ae(o, "tenants", n, "system_fields", m.collection, `${m.collection}-${N.name}`, e), (N, D) => Ae(o, "tenants", n, "system_unique", m.collection, `Unique-${m.collection}-${N.name}`, D), (N) => Ae(o, "tenants", n, "system_fields", m.collection, `${m.collection}-${N}`, e)), p.delete(Ae(o, "tenants", n, r.join("/"), e)), !E && y && He("delete", "written", v, r, e, h, x.uid), await fc("delete", r, e, v, I, h, A, p, x.uid, y || !1, l, !!E), y && He("delete", "success", { ...v, ...E?.record || {} }, r, e, h, x.uid);
|
|
11847
|
-
const w = ["delete", v, e, I, !!E],
|
|
11848
|
-
return await oe("postWrite", c, A, w), await oe("postOperation", c, A,
|
|
11847
|
+
const w = ["delete", v, e, I, !!E], O = [...w];
|
|
11848
|
+
return await oe("postWrite", c, A, w), await oe("postOperation", c, A, O), { id: e, ...v };
|
|
11849
11849
|
}, vm = (r) => {
|
|
11850
11850
|
if (typeof r == "object")
|
|
11851
11851
|
for (const e in r)
|
|
@@ -11867,12 +11867,12 @@ const bw = async (r, e) => {
|
|
|
11867
11867
|
ht[o.id] ??= 0;
|
|
11868
11868
|
const c = o.data(), { data: l, operation: u, docId: f, collection: d, Collection_Path: h, Last_Write_Version: m } = c;
|
|
11869
11869
|
await new Promise((g) => setTimeout(g, 1e3));
|
|
11870
|
-
const
|
|
11870
|
+
const b = await ww("stoker-writelog", {
|
|
11871
11871
|
path: h,
|
|
11872
11872
|
id: f,
|
|
11873
11873
|
log: o.id
|
|
11874
11874
|
});
|
|
11875
|
-
if (!
|
|
11875
|
+
if (!b || b.status !== "written")
|
|
11876
11876
|
continue;
|
|
11877
11877
|
if (s?.uid !== e.uid)
|
|
11878
11878
|
return;
|
|
@@ -11964,7 +11964,7 @@ const Rw = () => {
|
|
|
11964
11964
|
Ir = "Offline", Ee(e.onConnectionStatusChange, [Ir]);
|
|
11965
11965
|
}, 5e3));
|
|
11966
11966
|
});
|
|
11967
|
-
},
|
|
11967
|
+
}, zt = () => Ir, Aw = () => navigator.onLine ? "Online" : "Offline", Om = async () => {
|
|
11968
11968
|
const r = ke(), e = dr(), t = e.currentUser;
|
|
11969
11969
|
if (r.preLogout && await Ee(r.preLogout, [t]) === !1)
|
|
11970
11970
|
throw new Error("Operation cancelled by preLogout");
|
|
@@ -12010,7 +12010,7 @@ const Ka = {
|
|
|
12010
12010
|
getTimezone() {
|
|
12011
12011
|
return Em;
|
|
12012
12012
|
},
|
|
12013
|
-
getConnectionStatus:
|
|
12013
|
+
getConnectionStatus: zt,
|
|
12014
12014
|
getNetworkStatus: Aw,
|
|
12015
12015
|
getSchema(r = !1) {
|
|
12016
12016
|
const e = Oe(Mr);
|
|
@@ -12095,8 +12095,8 @@ const Gw = async (r, e, t, n) => {
|
|
|
12095
12095
|
if (I = !0, ye.onAppCheckTokenFailure)
|
|
12096
12096
|
Ee(ye.onAppCheckTokenFailure, [R]);
|
|
12097
12097
|
else {
|
|
12098
|
-
const
|
|
12099
|
-
!
|
|
12098
|
+
const O = sessionStorage.getItem("stoker-app-check-reload");
|
|
12099
|
+
!O || new Date(O).getTime() < Date.now() - 3e5 ? (sessionStorage.setItem("stoker-app-check-reload", (/* @__PURE__ */ new Date()).toISOString()), window.location.reload()) : alert("For security reasons, please close this tab and wait a while before restarting it.");
|
|
12100
12100
|
}
|
|
12101
12101
|
};
|
|
12102
12102
|
Gn(Ct.main, () => {
|
|
@@ -12120,7 +12120,7 @@ const Gw = async (r, e, t, n) => {
|
|
|
12120
12120
|
"global",
|
|
12121
12121
|
"firebase",
|
|
12122
12122
|
"enableEmulators"
|
|
12123
|
-
]),
|
|
12123
|
+
]), b = await ie(ye, ["global", "enableUserIDLogging"]), y = await ie(ye, [
|
|
12124
12124
|
"global",
|
|
12125
12125
|
"firebase",
|
|
12126
12126
|
"logLevel",
|
|
@@ -12178,7 +12178,7 @@ const Gw = async (r, e, t, n) => {
|
|
|
12178
12178
|
up(je(ft, ve.STOKER_FB_FUNCTIONS_REGION), "localhost", p);
|
|
12179
12179
|
}
|
|
12180
12180
|
}
|
|
12181
|
-
if (Ew(), Sw(), Rw(), Tt === "development" && (y ? Jr(y) : Jr("debug")), Tt === "production" && (g ? Jr(g) : Jr("error")),
|
|
12181
|
+
if (Ew(), Sw(), Rw(), Tt === "development" && (y ? Jr(y) : Jr("debug")), Tt === "production" && (g ? Jr(g) : Jr("error")), b) {
|
|
12182
12182
|
const p = zn(x, async (I) => {
|
|
12183
12183
|
if (I) {
|
|
12184
12184
|
const v = JSON.parse(ve.STOKER_FB_WEB_APP_CONFIG);
|
|
@@ -12214,7 +12214,7 @@ const Gw = async (r, e, t, n) => {
|
|
|
12214
12214
|
});
|
|
12215
12215
|
}));
|
|
12216
12216
|
await Promise.all(R), yd || (Cw(ye), yd = !0), k = await ie(ye, ["global", "auth", "offlinePersistenceType"], [Le, v]);
|
|
12217
|
-
const w = await ie(ye, ["global", "auth", "tabManager"], [Le, v]),
|
|
12217
|
+
const w = await ie(ye, ["global", "auth", "tabManager"], [Le, v]), O = await ie(ye, ["global", "auth", "garbageCollectionStrategy"], [Le, v]), M = await ie(ye, ["global", "auth", "maxCacheSize"], [Le, v]) || -1, N = await ie(ye, ["global", "auth", "maxWriteCacheSize"], [Le, v]);
|
|
12218
12218
|
let D;
|
|
12219
12219
|
const P = {
|
|
12220
12220
|
localCache: Ac({
|
|
@@ -12228,7 +12228,7 @@ const Gw = async (r, e, t, n) => {
|
|
|
12228
12228
|
})
|
|
12229
12229
|
};
|
|
12230
12230
|
let re;
|
|
12231
|
-
if (
|
|
12231
|
+
if (O === "EAGER" ? re = Xm() : re = ep({ cacheSizeBytes: M }), k === "ALL" ? D = P : D = {
|
|
12232
12232
|
localCache: tp({
|
|
12233
12233
|
garbageCollector: re
|
|
12234
12234
|
})
|
|
@@ -12252,22 +12252,22 @@ const Gw = async (r, e, t, n) => {
|
|
|
12252
12252
|
const We = new Event("stoker:ready");
|
|
12253
12253
|
document.dispatchEvent(We);
|
|
12254
12254
|
} else if (Le) {
|
|
12255
|
-
kw(), Iw().forEach((
|
|
12256
|
-
|
|
12255
|
+
kw(), Iw().forEach((O) => {
|
|
12256
|
+
O();
|
|
12257
12257
|
}), xw();
|
|
12258
12258
|
const v = new Event("stoker:signOut");
|
|
12259
12259
|
document.dispatchEvent(v);
|
|
12260
12260
|
const R = { error: !1, instances: [] };
|
|
12261
|
-
await Promise.all(Object.values(dt).map(async (
|
|
12262
|
-
|
|
12261
|
+
await Promise.all(Object.values(dt).map(async (O) => {
|
|
12262
|
+
O.currentUser && await _d(O).catch((M) => {
|
|
12263
12263
|
R.error = !0, R.instances.push({
|
|
12264
|
-
instance:
|
|
12264
|
+
instance: O.app.name,
|
|
12265
12265
|
code: "SIGN_OUT",
|
|
12266
12266
|
error: M
|
|
12267
|
-
}), console.error(`Error signing out of ${
|
|
12267
|
+
}), console.error(`Error signing out of ${O.app.name}.`);
|
|
12268
12268
|
});
|
|
12269
|
-
})), await Promise.all(Object.entries(Be).map(async ([
|
|
12270
|
-
|
|
12269
|
+
})), await Promise.all(Object.entries(Be).map(async ([O, M]) => {
|
|
12270
|
+
O !== "maintenance" && Object.keys(M).length !== 0 && await sp(M).catch((N) => {
|
|
12271
12271
|
console.error(`Error terminating ${M.app.name}.`), R.error = !0, R.instances.push({
|
|
12272
12272
|
instance: M.app.name,
|
|
12273
12273
|
code: "TERMINATE_APP",
|
|
@@ -12278,14 +12278,14 @@ const Gw = async (r, e, t, n) => {
|
|
|
12278
12278
|
"global",
|
|
12279
12279
|
"auth",
|
|
12280
12280
|
"clearPersistenceOnSignOut"
|
|
12281
|
-
]) ?? !0) && (k === "ALL" && await Ic(Be.main).catch((
|
|
12282
|
-
console.error('Error clearing indexedDB persistence in "[DEFAULT]".'), R.error = !0, R.instances.push({ instance: "[DEFAULT]", code: "CLEAR_CACHE", error:
|
|
12283
|
-
}), ["ALL", "WRITE"].includes(k) && await Ic(Be.firestoreWrite).catch((
|
|
12284
|
-
console.error('Error clearing indexedDB persistence in "firestoreWrite".'), R.error = !0, R.instances.push({ instance: "firestoreWrite", code: "CLEAR_CACHE", error:
|
|
12281
|
+
]) ?? !0) && (k === "ALL" && await Ic(Be.main).catch((O) => {
|
|
12282
|
+
console.error('Error clearing indexedDB persistence in "[DEFAULT]".'), R.error = !0, R.instances.push({ instance: "[DEFAULT]", code: "CLEAR_CACHE", error: O });
|
|
12283
|
+
}), ["ALL", "WRITE"].includes(k) && await Ic(Be.firestoreWrite).catch((O) => {
|
|
12284
|
+
console.error('Error clearing indexedDB persistence in "firestoreWrite".'), R.error = !0, R.instances.push({ instance: "firestoreWrite", code: "CLEAR_CACHE", error: O });
|
|
12285
12285
|
})), R.error ? console.info("Sign out operation completed with errors.") : console.info("Sign out operation completed successfully."), await Ee(ye.postLogout, [R]);
|
|
12286
12286
|
}
|
|
12287
|
-
}), _ ? !1 : x.currentUser ? (
|
|
12288
|
-
}, { getTenant:
|
|
12287
|
+
}), _ ? !1 : x.currentUser ? (b && console.info(`${x.currentUser.uid} successfully logged in.`), !0) : !1;
|
|
12288
|
+
}, { getTenant: Mt, getEnv: Ve, getTimezone: Rm, getSchema: Ke, getCurrentUser: Hw, getCurrentUserRoleGroups: Yr, getAllRoleGroups: pc, getGlobalConfigModule: ke, getCollectionConfigModule: lt, getAppCheck: Kw, getAppCheckFirestoreWrite: Yw, getFirestoreWriteAuth: Nw, getFirestoreWrite: yc, getFirestoreMaintenance: Am } = Ro, Jw = async (r, e, t) => {
|
|
12289
12289
|
const [n, s] = [dr(), Nw()], i = ke();
|
|
12290
12290
|
if (!r || !e)
|
|
12291
12291
|
throw new Error("Email and password are required.");
|
|
@@ -12375,8 +12375,8 @@ const Gw = async (r, e, t, n) => {
|
|
|
12375
12375
|
const o = Ke(!0), l = Yr()[i], u = Ue(), f = o.collections[i];
|
|
12376
12376
|
if (!f)
|
|
12377
12377
|
throw new Error("COLLECTION_NOT_FOUND");
|
|
12378
|
-
const { labels: d, preloadCache: h } = f, m = ke(),
|
|
12379
|
-
if (!
|
|
12378
|
+
const { labels: d, preloadCache: h } = f, m = ke(), b = Object.keys(o.collections).includes(i), y = m.disabledCollections?.includes(i);
|
|
12379
|
+
if (!b || y)
|
|
12380
12380
|
throw new Error("COLLECTION_NOT_FOUND");
|
|
12381
12381
|
const g = lt(d.collection), T = await ie(m, [
|
|
12382
12382
|
"global",
|
|
@@ -12416,12 +12416,12 @@ const Gw = async (r, e, t, n) => {
|
|
|
12416
12416
|
}
|
|
12417
12417
|
t(Oe(p));
|
|
12418
12418
|
});
|
|
12419
|
-
}, R = /* @__PURE__ */ new Map(), w = /* @__PURE__ */ new Map(),
|
|
12419
|
+
}, R = /* @__PURE__ */ new Map(), w = /* @__PURE__ */ new Map(), O = (N) => typeof N == "object" ? N.fields.filter((P) => typeof P == "object" && _e(P) && jt(f, o, a).includes(P.collection)) : f.fields.filter((P) => _e(P) && jt(f, o, a).includes(P.collection)), M = () => new Promise((N) => {
|
|
12420
12420
|
if (!s?.relations) {
|
|
12421
12421
|
N({});
|
|
12422
12422
|
return;
|
|
12423
12423
|
}
|
|
12424
|
-
const D = Oe(s.relations), P = /* @__PURE__ */ new Map(), H = /* @__PURE__ */ new Map(), re =
|
|
12424
|
+
const D = Oe(s.relations), P = /* @__PURE__ */ new Map(), H = /* @__PURE__ */ new Map(), re = O(D);
|
|
12425
12425
|
for (const W of re)
|
|
12426
12426
|
for (const q of w.values())
|
|
12427
12427
|
q.type === W.type && q.field === W.name && // eslint-disable-next-line security/detect-object-injection
|
|
@@ -12528,7 +12528,7 @@ const Gw = async (r, e, t, n) => {
|
|
|
12528
12528
|
if (P.exists()) {
|
|
12529
12529
|
const H = P.data({ serverTimestamps: T || "none" });
|
|
12530
12530
|
if (_.has(N.path) && s?.relations) {
|
|
12531
|
-
const W =
|
|
12531
|
+
const W = O(s?.relations);
|
|
12532
12532
|
for (const q of W)
|
|
12533
12533
|
"collection" in q && H[q.name] && (H[q.name] = p?.[q.name]);
|
|
12534
12534
|
}
|
|
@@ -12574,7 +12574,7 @@ const Gw = async (r, e, t, n) => {
|
|
|
12574
12574
|
const a = De();
|
|
12575
12575
|
if (!a?.Role)
|
|
12576
12576
|
throw new Error("PERMISSION_DENIED");
|
|
12577
|
-
const o = Ke(!0), l = Yr()[i], u = Ue(), f = o.collections[i], { labels: d, preloadCache: h, access: m } = f, { serverReadOnly:
|
|
12577
|
+
const o = Ke(!0), l = Yr()[i], u = Ue(), f = o.collections[i], { labels: d, preloadCache: h, access: m } = f, { serverReadOnly: b } = m, y = ke(), g = Object.keys(o.collections).includes(i), T = y.disabledCollections?.includes(i);
|
|
12578
12578
|
if (!g || T)
|
|
12579
12579
|
throw new Error("COLLECTION_NOT_FOUND");
|
|
12580
12580
|
const A = lt(d.collection), S = await ie(y, [
|
|
@@ -12630,7 +12630,7 @@ const Gw = async (r, e, t, n) => {
|
|
|
12630
12630
|
const k = { collection: d.collection };
|
|
12631
12631
|
await oe("preOperation", y, A, ["read", void 0, void 0, k]), await oe("preRead", y, A, [k, C, !0, !0]);
|
|
12632
12632
|
let v = !0;
|
|
12633
|
-
const R = /* @__PURE__ */ new Map(), w = /* @__PURE__ */ new Map(),
|
|
12633
|
+
const R = /* @__PURE__ */ new Map(), w = /* @__PURE__ */ new Map(), O = [], M = /* @__PURE__ */ new Map(), N = /* @__PURE__ */ new Map(), D = /* @__PURE__ */ new Map(), P = (G, K) => {
|
|
12634
12634
|
let j = !0;
|
|
12635
12635
|
if (s?.relations && M.forEach((J) => {
|
|
12636
12636
|
const z = w.get(J.id);
|
|
@@ -12669,7 +12669,7 @@ const Gw = async (r, e, t, n) => {
|
|
|
12669
12669
|
return;
|
|
12670
12670
|
const j = G.id;
|
|
12671
12671
|
w.set(j, "loading"), re[j] ||= /* @__PURE__ */ new Map();
|
|
12672
|
-
const J = Oe(s?.relations), z = typeof J == "object" ? J.fields.filter((me) => typeof me == "object" && _e(me) &&
|
|
12672
|
+
const J = Oe(s?.relations), z = typeof J == "object" ? J.fields.filter((me) => typeof me == "object" && _e(me) && jt(f, o, a).includes(me.collection)) : f.fields.filter((me) => _e(me) && jt(f, o, a).includes(me.collection)), de = /* @__PURE__ */ new Map(), ee = /* @__PURE__ */ new Map();
|
|
12673
12673
|
H[j] ||= /* @__PURE__ */ new Map();
|
|
12674
12674
|
for (const me of z)
|
|
12675
12675
|
for (const Y of re[j].entries()) {
|
|
@@ -12741,7 +12741,7 @@ const Gw = async (r, e, t, n) => {
|
|
|
12741
12741
|
Se(), H[j].delete(se);
|
|
12742
12742
|
return;
|
|
12743
12743
|
}
|
|
12744
|
-
|
|
12744
|
+
O.push(Se), re[j].set(se, {
|
|
12745
12745
|
doc: j,
|
|
12746
12746
|
type: me.type,
|
|
12747
12747
|
field: me.name,
|
|
@@ -12751,7 +12751,7 @@ const Gw = async (r, e, t, n) => {
|
|
|
12751
12751
|
}
|
|
12752
12752
|
}
|
|
12753
12753
|
}, q = (G) => {
|
|
12754
|
-
const K = Oe(s?.relations), j = typeof K == "object" ? K.fields.filter((J) => typeof J == "object" && _e(J) &&
|
|
12754
|
+
const K = Oe(s?.relations), j = typeof K == "object" ? K.fields.filter((J) => typeof J == "object" && _e(J) && jt(f, o, a).includes(J.collection)) : f.fields.filter((J) => _e(J) && jt(f, o, a).includes(J.collection));
|
|
12755
12755
|
for (const J of j)
|
|
12756
12756
|
if (re[G])
|
|
12757
12757
|
for (const z of re[G].entries()) {
|
|
@@ -12779,12 +12779,12 @@ const Gw = async (r, e, t, n) => {
|
|
|
12779
12779
|
W(z, _);
|
|
12780
12780
|
})));
|
|
12781
12781
|
}, (J) => {
|
|
12782
|
-
n && n(new Error(`Error fetching documents at location ${r.join("/")}`, { cause: J })),
|
|
12782
|
+
n && n(new Error(`Error fetching documents at location ${r.join("/")}`, { cause: J })), O.forEach((z) => z());
|
|
12783
12783
|
});
|
|
12784
|
-
|
|
12784
|
+
O.push(j);
|
|
12785
12785
|
}
|
|
12786
12786
|
let We, Ce;
|
|
12787
|
-
if (s?.pagination && !h?.roles.includes(a.Role) && !
|
|
12787
|
+
if (s?.pagination && !h?.roles.includes(a.Role) && !b?.includes(a.Role)) {
|
|
12788
12788
|
let G = pe(x[0], ...e);
|
|
12789
12789
|
s.pagination.orderByField && s.pagination.orderByDirection && (G = pe(G, et(s.pagination.orderByField, s.pagination.orderByDirection)));
|
|
12790
12790
|
const K = await Od(G).catch(() => {
|
|
@@ -12796,7 +12796,7 @@ const Gw = async (r, e, t, n) => {
|
|
|
12796
12796
|
}
|
|
12797
12797
|
}
|
|
12798
12798
|
return { pages: Ce, count: We, unsubscribe: (G) => {
|
|
12799
|
-
G === "first" && Ya(_), G === "last" && Ja(_),
|
|
12799
|
+
G === "first" && Ya(_), G === "last" && Ja(_), O.forEach((K) => K());
|
|
12800
12800
|
} };
|
|
12801
12801
|
}, ib = async (r, e) => {
|
|
12802
12802
|
const t = nt(), n = Ve(), s = je(t, n.STOKER_FB_FUNCTIONS_REGION);
|
|
@@ -12820,13 +12820,13 @@ const Gw = async (r, e, t, n) => {
|
|
|
12820
12820
|
await Fw(e, t, n, s, i, a);
|
|
12821
12821
|
return;
|
|
12822
12822
|
}
|
|
12823
|
-
const f = Ga(r), d = cw(e), h = t ? md(t) : void 0, m = n ? md(n) : void 0,
|
|
12823
|
+
const f = Ga(r), d = cw(e), h = t ? md(t) : void 0, m = n ? md(n) : void 0, b = s ? Ga(s) : void 0, y = i ? Ga(i) : void 0, g = a ? Sn(a) : void 0, T = c ? Sn(c) : void 0, A = Array.isArray(f) ? f : [f];
|
|
12824
12824
|
if (A.length === 0 || A.length === 1 && !A[0])
|
|
12825
12825
|
throw new Error("No valid email addresses provided");
|
|
12826
12826
|
const S = Ue(), E = { to: f, message: { subject: d } };
|
|
12827
|
-
if (h && (E.message.text = h), m && (E.message.html = m),
|
|
12828
|
-
const x = Array.isArray(
|
|
12829
|
-
x.length > 0 && x[0] && (E.cc =
|
|
12827
|
+
if (h && (E.message.text = h), m && (E.message.html = m), b) {
|
|
12828
|
+
const x = Array.isArray(b) ? b : [b];
|
|
12829
|
+
x.length > 0 && x[0] && (E.cc = b);
|
|
12830
12830
|
}
|
|
12831
12831
|
if (y) {
|
|
12832
12832
|
const x = Array.isArray(y) ? y : [y];
|
|
@@ -12857,7 +12857,7 @@ const Gw = async (r, e, t, n) => {
|
|
|
12857
12857
|
}, ub = (r, e) => {
|
|
12858
12858
|
const n = B.fromJSDate(r, { zone: e }).offset, i = B.fromJSDate(r).offset, a = n - i;
|
|
12859
12859
|
return B.fromJSDate(r).minus({ minutes: a }).toJSDate();
|
|
12860
|
-
}, fb = (r) => "seconds" in r && "nanoseconds" in r ? Mw(new
|
|
12860
|
+
}, fb = (r) => "seconds" in r && "nanoseconds" in r ? Mw(new Bt(r.seconds, r.nanoseconds)).toFormat("MMMM d, yyyy '@' h:mm a") : "";
|
|
12861
12861
|
export {
|
|
12862
12862
|
_m as addRecord,
|
|
12863
12863
|
gw as addRecordServer,
|
|
@@ -12877,7 +12877,7 @@ export {
|
|
|
12877
12877
|
ie as getCachedConfigValue,
|
|
12878
12878
|
lt as getCollectionConfigModule,
|
|
12879
12879
|
ac as getCollectionRefs,
|
|
12880
|
-
|
|
12880
|
+
zt as getConnectionStatus,
|
|
12881
12881
|
Hw as getCurrentUser,
|
|
12882
12882
|
De as getCurrentUserPermissions,
|
|
12883
12883
|
Yr as getCurrentUserRoleGroups,
|
|
@@ -12896,7 +12896,7 @@ export {
|
|
|
12896
12896
|
Ke as getSchema,
|
|
12897
12897
|
mm as getSome,
|
|
12898
12898
|
hw as getSomeServer,
|
|
12899
|
-
|
|
12899
|
+
Mt as getTenant,
|
|
12900
12900
|
Rm as getTimezone,
|
|
12901
12901
|
Iw as getUnsubscribes,
|
|
12902
12902
|
bm as getVersionInfo,
|