@stoker-platform/web-client 0.5.91 → 0.5.92
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 +166 -166
- package/package.json +3 -3
package/dist/bundle.js
CHANGED
|
@@ -8,7 +8,7 @@ import { getFunctions as Ue, httpsCallable as Je, connectFunctionsEmulator as mp
|
|
|
8
8
|
import { ReCaptchaEnterpriseProvider as pp, initializeAppCheck as Yn, onTokenChanged as Jn } from "firebase/app-check";
|
|
9
9
|
import { getPerformance as gp } from "firebase/performance";
|
|
10
10
|
import { getRemoteConfig as yp, fetchAndActivate as _p } from "firebase/remote-config";
|
|
11
|
-
const vp = "0.5.
|
|
11
|
+
const vp = "0.5.91", wp = (t) => !!t.auth, ct = (t, e) => {
|
|
12
12
|
if (e?.operations)
|
|
13
13
|
return e.operations.includes(t);
|
|
14
14
|
}, Nn = (t, e) => e ? e.Role ? t.access?.includes(e.Role) : !1 : !0, bp = (t, e) => e ? !e.Role || t.restrictCreate === !0 ? !1 : typeof t.restrictCreate == "object" ? t.restrictCreate?.includes(e.Role) : !0 : !0, Op = (t, e) => e ? !e.Role || t.restrictUpdate === !0 ? !1 : typeof t.restrictUpdate == "object" ? t.restrictUpdate?.includes(e.Role) : !0 : !0, te = (t, e) => t.filter((r) => r.name === e)[0], we = (t) => ["OneToOne", "OneToMany", "ManyToOne", "ManyToMany"].includes(t.type), xf = (t, e) => {
|
|
@@ -92,8 +92,8 @@ const vp = "0.5.90", wp = (t) => !!t.auth, ct = (t, e) => {
|
|
|
92
92
|
g = !0;
|
|
93
93
|
const E = te(o, y.collectionField), R = te(o, y.propertyField);
|
|
94
94
|
Object.entries(c?.parentPropertyEntities || {}).some((_) => {
|
|
95
|
-
const [N,
|
|
96
|
-
return N === i[R.name] && i[`${E.name}_Array`].some((
|
|
95
|
+
const [N, w] = _;
|
|
96
|
+
return N === i[R.name] && i[`${E.name}_Array`].some((v) => w.includes(v));
|
|
97
97
|
}) || (b = !1);
|
|
98
98
|
}), p && g) {
|
|
99
99
|
if (!(h || b)) {
|
|
@@ -122,16 +122,16 @@ const vp = "0.5.90", wp = (t) => !!t.auth, ct = (t, e) => {
|
|
|
122
122
|
l = !1;
|
|
123
123
|
return;
|
|
124
124
|
}
|
|
125
|
-
N.parentEntities?.some((
|
|
125
|
+
N.parentEntities?.some((w) => i[`${_.name}_Array`].includes(w)) || (C = !1);
|
|
126
126
|
}), f?.filter((y) => y.parentFilter.type === "Parent_Property").forEach((y) => {
|
|
127
127
|
x = !0;
|
|
128
|
-
const { parentFilter: E } = y, R = te(o, E.collectionField), _ = te(o, E.parentPropertyField), N = te(o, E.parentCollectionField),
|
|
129
|
-
if (!
|
|
128
|
+
const { parentFilter: E } = y, R = te(o, E.collectionField), _ = te(o, E.parentPropertyField), N = te(o, E.parentCollectionField), w = s.collections?.[R.collection];
|
|
129
|
+
if (!w) {
|
|
130
130
|
l = !1;
|
|
131
131
|
return;
|
|
132
132
|
}
|
|
133
|
-
Object.entries(
|
|
134
|
-
const [I, m] =
|
|
133
|
+
Object.entries(w.parentPropertyEntities || {}).some((v) => {
|
|
134
|
+
const [I, m] = v;
|
|
135
135
|
return I === i[_.name] && i[`${N.name}_Array`].some((T) => m.includes(T));
|
|
136
136
|
}) || (C = !1);
|
|
137
137
|
}), S && x) {
|
|
@@ -793,14 +793,14 @@ function ig() {
|
|
|
793
793
|
if (Dl) return Js;
|
|
794
794
|
Dl = 1;
|
|
795
795
|
var t = Br(), e = qf(), r = zr(), n = Mf(), s = ng(), i = sg(), a = 1, o = 2, c = "[object Boolean]", l = "[object Date]", u = "[object Error]", d = "[object Map]", f = "[object Number]", h = "[object RegExp]", p = "[object Set]", b = "[object String]", g = "[object Symbol]", O = "[object ArrayBuffer]", S = "[object DataView]", C = t ? t.prototype : void 0, x = C ? C.valueOf : void 0;
|
|
796
|
-
function y(E, R, _, N,
|
|
796
|
+
function y(E, R, _, N, w, v, I) {
|
|
797
797
|
switch (_) {
|
|
798
798
|
case S:
|
|
799
799
|
if (E.byteLength != R.byteLength || E.byteOffset != R.byteOffset)
|
|
800
800
|
return !1;
|
|
801
801
|
E = E.buffer, R = R.buffer;
|
|
802
802
|
case O:
|
|
803
|
-
return !(E.byteLength != R.byteLength || !
|
|
803
|
+
return !(E.byteLength != R.byteLength || !v(new e(E), new e(R)));
|
|
804
804
|
case c:
|
|
805
805
|
case l:
|
|
806
806
|
case f:
|
|
@@ -820,7 +820,7 @@ function ig() {
|
|
|
820
820
|
if (A)
|
|
821
821
|
return A == R;
|
|
822
822
|
N |= o, I.set(E, R);
|
|
823
|
-
var L = n(m(E), m(R), N,
|
|
823
|
+
var L = n(m(E), m(R), N, w, v, I);
|
|
824
824
|
return I.delete(E), L;
|
|
825
825
|
case g:
|
|
826
826
|
if (x)
|
|
@@ -975,10 +975,10 @@ var di, Kl;
|
|
|
975
975
|
function ug() {
|
|
976
976
|
if (Kl) return di;
|
|
977
977
|
Kl = 1;
|
|
978
|
-
var t = pr(), e = Uf(), r = 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]", d = "[object Object]", f = "[object RegExp]", h = "[object Set]", p = "[object String]", b = "[object WeakMap]", g = "[object ArrayBuffer]", O = "[object DataView]", S = "[object Float32Array]", C = "[object Float64Array]", x = "[object Int8Array]", y = "[object Int16Array]", E = "[object Int32Array]", R = "[object Uint8Array]", _ = "[object Uint8ClampedArray]", N = "[object Uint16Array]",
|
|
979
|
-
|
|
978
|
+
var t = pr(), e = Uf(), r = 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]", d = "[object Object]", f = "[object RegExp]", h = "[object Set]", p = "[object String]", b = "[object WeakMap]", g = "[object ArrayBuffer]", O = "[object DataView]", S = "[object Float32Array]", C = "[object Float64Array]", x = "[object Int8Array]", y = "[object Int16Array]", E = "[object Int32Array]", R = "[object Uint8Array]", _ = "[object Uint8ClampedArray]", N = "[object Uint16Array]", w = "[object Uint32Array]", v = {};
|
|
979
|
+
v[S] = v[C] = v[x] = v[y] = v[E] = v[R] = v[_] = v[N] = v[w] = !0, v[n] = v[s] = v[g] = v[i] = v[O] = v[a] = v[o] = v[c] = v[l] = v[u] = v[d] = v[f] = v[h] = v[p] = v[b] = !1;
|
|
980
980
|
function I(m) {
|
|
981
|
-
return r(m) && e(m.length) && !!
|
|
981
|
+
return r(m) && e(m.length) && !!v[t(m)];
|
|
982
982
|
}
|
|
983
983
|
return di = I, di;
|
|
984
984
|
}
|
|
@@ -1137,8 +1137,8 @@ function hg() {
|
|
|
1137
1137
|
y || (y = O == "constructor");
|
|
1138
1138
|
}
|
|
1139
1139
|
if (x && !y) {
|
|
1140
|
-
var N = i.constructor,
|
|
1141
|
-
N !=
|
|
1140
|
+
var N = i.constructor, w = a.constructor;
|
|
1141
|
+
N != w && "constructor" in i && "constructor" in a && !(typeof N == "function" && N instanceof N && typeof w == "function" && w instanceof w) && (x = !1);
|
|
1142
1142
|
}
|
|
1143
1143
|
return u.delete(i), u.delete(a), x;
|
|
1144
1144
|
}
|
|
@@ -1203,22 +1203,22 @@ function _g() {
|
|
|
1203
1203
|
function p(b, g, O, S, C, x) {
|
|
1204
1204
|
var y = i(b), E = i(g), R = y ? u : s(b), _ = E ? u : s(g);
|
|
1205
1205
|
R = R == l ? d : R, _ = _ == l ? d : _;
|
|
1206
|
-
var N = R == d,
|
|
1207
|
-
if (
|
|
1206
|
+
var N = R == d, w = _ == d, v = R == _;
|
|
1207
|
+
if (v && a(b)) {
|
|
1208
1208
|
if (!a(g))
|
|
1209
1209
|
return !1;
|
|
1210
1210
|
y = !0, N = !1;
|
|
1211
1211
|
}
|
|
1212
|
-
if (
|
|
1212
|
+
if (v && !N)
|
|
1213
1213
|
return x || (x = new t()), y || o(b) ? e(b, g, O, S, C, x) : r(b, g, R, O, S, C, x);
|
|
1214
1214
|
if (!(O & c)) {
|
|
1215
|
-
var I = N && h.call(b, "__wrapped__"), m =
|
|
1215
|
+
var I = N && h.call(b, "__wrapped__"), m = w && h.call(g, "__wrapped__");
|
|
1216
1216
|
if (I || m) {
|
|
1217
1217
|
var T = I ? b.value() : b, A = m ? g.value() : g;
|
|
1218
1218
|
return x || (x = new t()), C(T, A, O, S, x);
|
|
1219
1219
|
}
|
|
1220
1220
|
}
|
|
1221
|
-
return
|
|
1221
|
+
return v ? (x || (x = new t()), n(b, g, O, S, C, x)) : !1;
|
|
1222
1222
|
}
|
|
1223
1223
|
return Ai = p, Ai;
|
|
1224
1224
|
}
|
|
@@ -1597,12 +1597,12 @@ function Lg() {
|
|
|
1597
1597
|
t(g, S, N);
|
|
1598
1598
|
return;
|
|
1599
1599
|
}
|
|
1600
|
-
var
|
|
1601
|
-
if (
|
|
1600
|
+
var w = y ? y(R, _, S + "", g, O, E) : void 0, v = w === void 0;
|
|
1601
|
+
if (v) {
|
|
1602
1602
|
var I = a(_), m = !I && c(_), T = !I && !m && f(_);
|
|
1603
|
-
|
|
1603
|
+
w = _, I || m || T ? a(R) ? w = R : o(R) ? w = n(R) : m ? (v = !1, w = e(_, !0)) : T ? (v = !1, w = r(_, !0)) : w = [] : d(_) || i(_) ? (w = R, i(R) ? w = p(R) : (!u(R) || l(R)) && (w = s(_))) : v = !1;
|
|
1604
1604
|
}
|
|
1605
|
-
|
|
1605
|
+
v && (E.set(_, w), x(w, _, C, y, E), E.delete(_)), t(g, S, w);
|
|
1606
1606
|
}
|
|
1607
1607
|
return Ji = b, Ji;
|
|
1608
1608
|
}
|
|
@@ -9093,9 +9093,9 @@ class G {
|
|
|
9093
9093
|
let g, O, S = cn(c, l);
|
|
9094
9094
|
b ? (g = zv, O = Uv, S = Tn(S, a, o)) : u ? (g = Bv, O = Wv, S = Ca(S)) : (g = fn, O = um);
|
|
9095
9095
|
let C = !1;
|
|
9096
|
-
for (const
|
|
9097
|
-
const
|
|
9098
|
-
J(
|
|
9096
|
+
for (const w of g) {
|
|
9097
|
+
const v = i[w];
|
|
9098
|
+
J(v) ? C ? i[w] = O[w] : i[w] = S[w] : C = !0;
|
|
9099
9099
|
}
|
|
9100
9100
|
const x = b ? b_(i, a, o) : u ? O_(i) : Mh(i), y = x || qh(i);
|
|
9101
9101
|
if (y)
|
|
@@ -10508,18 +10508,18 @@ const Qd = async (t, e) => {
|
|
|
10508
10508
|
});
|
|
10509
10509
|
}), y.forEach((_) => {
|
|
10510
10510
|
if (fy(_, a, i)) {
|
|
10511
|
-
const N = py(_, a, i),
|
|
10512
|
-
s[_.name] !== void 0 && (
|
|
10513
|
-
s[
|
|
10514
|
-
}), Object.keys(
|
|
10511
|
+
const N = py(_, a, i), w = {};
|
|
10512
|
+
s[_.name] !== void 0 && (w[_.name] = s[_.name], we(_) && (w[`${_.name}_Array`] = s[`${_.name}_Array`])), N.forEach((v) => {
|
|
10513
|
+
s[v.name] !== void 0 && (we(v) ? w[`${v.name}_Array`] = s[`${v.name}_Array`] : w[v.name] = s[v.name]);
|
|
10514
|
+
}), Object.keys(w).length > 0 && (t === "create" && (w.Collection_Path = r, w.Collection_Path_String = r.join("/"), e.set(f(_), w)), t === "update" && e.update(f(_), w), t === "delete" && e.delete(f(_)));
|
|
10515
10515
|
}
|
|
10516
10516
|
});
|
|
10517
10517
|
const E = c[a.labels.collection];
|
|
10518
10518
|
for (const _ of E) {
|
|
10519
|
-
const N = gy(_, a),
|
|
10520
|
-
N.forEach((
|
|
10521
|
-
delete v
|
|
10522
|
-
}), Object.keys(
|
|
10519
|
+
const N = gy(_, a), w = { ...s };
|
|
10520
|
+
N.forEach((v) => {
|
|
10521
|
+
delete w[v.name], delete w[`${v.name}_Array`], delete w[`${v.name}_Single`], delete w[`${v.name}_Lowercase`];
|
|
10522
|
+
}), Object.keys(w).length > 0 && (t === "create" && (w.Collection_Path ||= r, w.Collection_Path_String = r.join("/"), e.set(p(_.key), w)), t === "update" && e.update(p(_.key), w), t === "delete" && e.delete(p(_.key)));
|
|
10523
10523
|
}
|
|
10524
10524
|
if (t === "delete")
|
|
10525
10525
|
return;
|
|
@@ -10653,16 +10653,16 @@ function nw() {
|
|
|
10653
10653
|
if (df) return za;
|
|
10654
10654
|
df = 1;
|
|
10655
10655
|
var t = Go(), e = ew(), r = tw(), n = rw(), s = Yf(), i = "[object Boolean]", a = "[object Date]", o = "[object Map]", c = "[object Number]", l = "[object RegExp]", u = "[object Set]", d = "[object String]", f = "[object Symbol]", h = "[object ArrayBuffer]", p = "[object DataView]", b = "[object Float32Array]", g = "[object Float64Array]", O = "[object Int8Array]", S = "[object Int16Array]", C = "[object Int32Array]", x = "[object Uint8Array]", y = "[object Uint8ClampedArray]", E = "[object Uint16Array]", R = "[object Uint32Array]";
|
|
10656
|
-
function _(N,
|
|
10656
|
+
function _(N, w, v) {
|
|
10657
10657
|
var I = N.constructor;
|
|
10658
|
-
switch (
|
|
10658
|
+
switch (w) {
|
|
10659
10659
|
case h:
|
|
10660
10660
|
return t(N);
|
|
10661
10661
|
case i:
|
|
10662
10662
|
case a:
|
|
10663
10663
|
return new I(+N);
|
|
10664
10664
|
case p:
|
|
10665
|
-
return e(N,
|
|
10665
|
+
return e(N, v);
|
|
10666
10666
|
case b:
|
|
10667
10667
|
case g:
|
|
10668
10668
|
case O:
|
|
@@ -10672,7 +10672,7 @@ function nw() {
|
|
|
10672
10672
|
case y:
|
|
10673
10673
|
case E:
|
|
10674
10674
|
case R:
|
|
10675
|
-
return s(N,
|
|
10675
|
+
return s(N, v);
|
|
10676
10676
|
case o:
|
|
10677
10677
|
return new I();
|
|
10678
10678
|
case c:
|
|
@@ -10726,8 +10726,8 @@ var Ka, gf;
|
|
|
10726
10726
|
function cw() {
|
|
10727
10727
|
if (gf) return Ka;
|
|
10728
10728
|
gf = 1;
|
|
10729
|
-
var t = Lo(), e = Gv(), r = Ko(), n = Hv(), s = Kv(), i = Kf(), a = Jf(), o = Yv(), c = Jv(), l = Bf(), u = Qv(), d = Vn(), f = Xv(), h = nw(), p = Qf(), b = Ft(), g = $n(), O = iw(), S = vt(), C = ow(), x = Bo(), y = Gr(), E = 1, R = 2, _ = 4, N = "[object Arguments]",
|
|
10730
|
-
D[N] = D[
|
|
10729
|
+
var t = Lo(), e = Gv(), r = Ko(), n = Hv(), s = Kv(), i = Kf(), a = Jf(), o = Yv(), c = Jv(), l = Bf(), u = Qv(), d = Vn(), f = Xv(), h = nw(), p = Qf(), b = Ft(), g = $n(), O = iw(), S = vt(), C = ow(), x = Bo(), y = Gr(), E = 1, R = 2, _ = 4, N = "[object Arguments]", w = "[object Array]", v = "[object Boolean]", I = "[object Date]", m = "[object Error]", T = "[object Function]", A = "[object GeneratorFunction]", L = "[object Map]", k = "[object Number]", M = "[object Object]", F = "[object RegExp]", Z = "[object Set]", re = "[object String]", oe = "[object Symbol]", z = "[object WeakMap]", V = "[object ArrayBuffer]", K = "[object DataView]", xe = "[object Float32Array]", Te = "[object Float64Array]", Xe = "[object Int8Array]", bt = "[object Int16Array]", br = "[object Int32Array]", q = "[object Uint8Array]", Y = "[object Uint8ClampedArray]", U = "[object Uint16Array]", H = "[object Uint32Array]", D = {};
|
|
10730
|
+
D[N] = D[w] = D[V] = D[K] = D[v] = D[I] = D[xe] = D[Te] = D[Xe] = D[bt] = D[br] = D[L] = D[k] = D[M] = D[F] = D[Z] = D[re] = D[oe] = D[q] = D[Y] = D[U] = D[H] = !0, D[m] = D[T] = D[z] = !1;
|
|
10731
10731
|
function ue(X, pe, _e, ae, $e, je) {
|
|
10732
10732
|
var ke, Gt = pe & E, Or = pe & R, Ne = pe & _;
|
|
10733
10733
|
if (_e && (ke = $e ? _e(X, ae, $e, je) : _e(X)), ke !== void 0)
|
|
@@ -10959,7 +10959,7 @@ const ve = /* @__PURE__ */ Dn(uw), xt = (t) => {
|
|
|
10959
10959
|
}
|
|
10960
10960
|
}
|
|
10961
10961
|
});
|
|
10962
|
-
const
|
|
10962
|
+
const w = [];
|
|
10963
10963
|
g.filter((m) => m.type === "Parent").forEach((m) => {
|
|
10964
10964
|
if ("collectionField" in m) {
|
|
10965
10965
|
const T = te(l, m.collectionField);
|
|
@@ -10973,7 +10973,7 @@ const ve = /* @__PURE__ */ Dn(uw), xt = (t) => {
|
|
|
10973
10973
|
}
|
|
10974
10974
|
if (!m.singleQuery)
|
|
10975
10975
|
L.forEach((M) => {
|
|
10976
|
-
|
|
10976
|
+
w.push(...S(_.concat(ye(`${T.name}_Array`, "array-contains-any", M))));
|
|
10977
10977
|
});
|
|
10978
10978
|
else {
|
|
10979
10979
|
if (A && A.length > k)
|
|
@@ -11000,7 +11000,7 @@ const ve = /* @__PURE__ */ Dn(uw), xt = (t) => {
|
|
|
11000
11000
|
}
|
|
11001
11001
|
if (!A.singleQuery)
|
|
11002
11002
|
Z.forEach((oe) => {
|
|
11003
|
-
|
|
11003
|
+
w.push(...S(_.concat(ye(`${k.name}_Array`, "array-contains-any", oe))));
|
|
11004
11004
|
});
|
|
11005
11005
|
else {
|
|
11006
11006
|
if (F && F.length > re)
|
|
@@ -11011,8 +11011,8 @@ const ve = /* @__PURE__ */ Dn(uw), xt = (t) => {
|
|
|
11011
11011
|
}
|
|
11012
11012
|
}
|
|
11013
11013
|
});
|
|
11014
|
-
const
|
|
11015
|
-
|
|
11014
|
+
const v = [];
|
|
11015
|
+
w.length === 0 && (g.filter((m) => m.type === "Parent_Property").forEach((m) => {
|
|
11016
11016
|
if ("collectionField" in m && "propertyField" in m) {
|
|
11017
11017
|
const T = te(l, m.collectionField), A = te(l, m.propertyField);
|
|
11018
11018
|
if ("collection" in T) {
|
|
@@ -11025,7 +11025,7 @@ const ve = /* @__PURE__ */ Dn(uw), xt = (t) => {
|
|
|
11025
11025
|
F.push(re);
|
|
11026
11026
|
}
|
|
11027
11027
|
F.forEach((Z) => {
|
|
11028
|
-
|
|
11028
|
+
v.push(...S(_.concat([
|
|
11029
11029
|
ye(`${T.name}_Array`, "array-contains-any", Z),
|
|
11030
11030
|
ye(A.name, "==", k)
|
|
11031
11031
|
])));
|
|
@@ -11051,7 +11051,7 @@ const ve = /* @__PURE__ */ Dn(uw), xt = (t) => {
|
|
|
11051
11051
|
oe.push(V);
|
|
11052
11052
|
}
|
|
11053
11053
|
oe.forEach((z) => {
|
|
11054
|
-
|
|
11054
|
+
v.push(...S(_.concat([
|
|
11055
11055
|
ye(`${L.name}_Array`, "array-contains-any", z),
|
|
11056
11056
|
ye(k.name, "==", Z)
|
|
11057
11057
|
])));
|
|
@@ -11061,7 +11061,7 @@ const ve = /* @__PURE__ */ Dn(uw), xt = (t) => {
|
|
|
11061
11061
|
}
|
|
11062
11062
|
}
|
|
11063
11063
|
}));
|
|
11064
|
-
const I = [...N, ...
|
|
11064
|
+
const I = [...N, ...w, ...v];
|
|
11065
11065
|
return !g.length && !O.length ? S(_) : I;
|
|
11066
11066
|
}, pm = {}, Nr = {}, eb = async (t) => {
|
|
11067
11067
|
for (const s of Object.keys(Nr))
|
|
@@ -11393,8 +11393,8 @@ const yw = async (t, e) => {
|
|
|
11393
11393
|
const _ = /* @__PURE__ */ new Map(), N = C.map(async (m) => {
|
|
11394
11394
|
let T;
|
|
11395
11395
|
return e?.only === "cache" ? T = await Cf(m) : e?.only === "server" ? T = await Qm(m) : T = await Xm(m), T;
|
|
11396
|
-
}),
|
|
11397
|
-
for (const m of
|
|
11396
|
+
}), w = await Promise.all(N);
|
|
11397
|
+
for (const m of w) {
|
|
11398
11398
|
for (const T of m.docs) {
|
|
11399
11399
|
_.has(T.id) || _.set(T.id, {});
|
|
11400
11400
|
const A = T.data({ serverTimestamps: g || "none" }), L = _.get(T.id);
|
|
@@ -11402,9 +11402,9 @@ const yw = async (t, e) => {
|
|
|
11402
11402
|
const k = { ...L, ...A };
|
|
11403
11403
|
delete k.Collection_Path_String, _.set(T.id, k);
|
|
11404
11404
|
}
|
|
11405
|
-
x.first.set(
|
|
11405
|
+
x.first.set(w.indexOf(m), m.docs[0]), x.last.set(w.indexOf(m), m.docs.at(-1) || m.docs[0]);
|
|
11406
11406
|
}
|
|
11407
|
-
let
|
|
11407
|
+
let v;
|
|
11408
11408
|
if (e?.pagination && !u?.roles.includes(O?.Role) && !d?.includes(O?.Role)) {
|
|
11409
11409
|
let m = he(S[0], ...r || []);
|
|
11410
11410
|
e.pagination.orderByField && e.pagination.orderByDirection && (m = he(m, rt(e.pagination.orderByField, e.pagination.orderByDirection)));
|
|
@@ -11412,7 +11412,7 @@ const yw = async (t, e) => {
|
|
|
11412
11412
|
});
|
|
11413
11413
|
if (T) {
|
|
11414
11414
|
const A = T.data().count, L = e.pagination.number;
|
|
11415
|
-
|
|
11415
|
+
v = L > 0 ? Math.floor(A / L) : 0;
|
|
11416
11416
|
}
|
|
11417
11417
|
}
|
|
11418
11418
|
let I;
|
|
@@ -11454,7 +11454,7 @@ const yw = async (t, e) => {
|
|
|
11454
11454
|
const k = { operation: "read", data: m, recordId: m.id, context: y };
|
|
11455
11455
|
await ie("postOperation", f, b, k), await ie("postRead", f, b, { context: y, refs: S, record: m, listener: !1 });
|
|
11456
11456
|
}
|
|
11457
|
-
return { cursor: x, pages:
|
|
11457
|
+
return { cursor: x, pages: v, records: Array.from(_.values()) };
|
|
11458
11458
|
}, ww = async (t, e, r) => {
|
|
11459
11459
|
const n = it(), s = Be(), i = Ue(n, s.STOKER_FB_FUNCTIONS_REGION), l = (await Je(i, "stoker-readapi")({
|
|
11460
11460
|
path: t,
|
|
@@ -11609,10 +11609,10 @@ const yw = async (t, e) => {
|
|
|
11609
11609
|
throw new Error("PERMISSION_DENIED");
|
|
11610
11610
|
if (Tm(e))
|
|
11611
11611
|
throw new Error("RECORD_BUSY");
|
|
11612
|
-
const
|
|
11612
|
+
const w = _?.originalRecord || n?.originalRecord || await wr(t, e, { noComputedFields: !0, noEmbeddingFields: !0 });
|
|
11613
11613
|
for (const V of o.collections[h].fields)
|
|
11614
|
-
V.type === "Computed" && (delete r[V.name], delete
|
|
11615
|
-
const
|
|
11614
|
+
V.type === "Computed" && (delete r[V.name], delete w[V.name]);
|
|
11615
|
+
const v = xo(d), I = { collection: O.collection }, m = g.fields.filter((V) => V.saveToAuthToken), T = g.auth && s?.operation === "create", A = g.auth && s?.operation === "delete", L = g.auth && !T && !A && (s?.operation === "update" || r.Role || r.Enabled !== void 0 || r.Name || r.Email || r.Photo_URL || m.some((V) => r[V.name] !== void 0)), k = await ne(E, [
|
|
11616
11616
|
"collections",
|
|
11617
11617
|
O.collection,
|
|
11618
11618
|
"custom",
|
|
@@ -11642,10 +11642,10 @@ const yw = async (t, e) => {
|
|
|
11642
11642
|
}
|
|
11643
11643
|
const V = {
|
|
11644
11644
|
operation: "update",
|
|
11645
|
-
|
|
11645
|
+
data: r,
|
|
11646
11646
|
context: I,
|
|
11647
|
-
batch:
|
|
11648
|
-
originalRecord: ve(
|
|
11647
|
+
batch: v,
|
|
11648
|
+
originalRecord: ve(w)
|
|
11649
11649
|
};
|
|
11650
11650
|
return await ie("preValidate", l, E, V), await Ow(t, e, r, s ? { operation: s.operation, permissions: s.permissions, password: s.password } : void 0);
|
|
11651
11651
|
}
|
|
@@ -11653,14 +11653,14 @@ const yw = async (t, e) => {
|
|
|
11653
11653
|
const F = Qo("update", t, r, a, R, Wt(), N.uid, zt.now(), jr(), !!_);
|
|
11654
11654
|
for (const V of C)
|
|
11655
11655
|
!we(V) && ar(F[V.name]) && V.nullable && (F[V.name] = null);
|
|
11656
|
-
if (xt(F), xt(
|
|
11656
|
+
if (xt(F), xt(w), Mr(g, F, a), Mr(g, w, a), !_ && x && Ye("update", "started", F, t, e, g, N.uid, void 0, w), !_) {
|
|
11657
11657
|
const V = {
|
|
11658
11658
|
operation: "update",
|
|
11659
11659
|
data: F,
|
|
11660
11660
|
recordId: e,
|
|
11661
11661
|
context: I,
|
|
11662
|
-
batch:
|
|
11663
|
-
originalRecord: ve(
|
|
11662
|
+
batch: v,
|
|
11663
|
+
originalRecord: ve(w)
|
|
11664
11664
|
};
|
|
11665
11665
|
await ie("preOperation", l, E, V);
|
|
11666
11666
|
const K = {
|
|
@@ -11668,33 +11668,33 @@ const yw = async (t, e) => {
|
|
|
11668
11668
|
data: F,
|
|
11669
11669
|
recordId: e,
|
|
11670
11670
|
context: I,
|
|
11671
|
-
batch:
|
|
11672
|
-
originalRecord: ve(
|
|
11671
|
+
batch: v,
|
|
11672
|
+
originalRecord: ve(w)
|
|
11673
11673
|
};
|
|
11674
11674
|
await ie("preWrite", l, E, K);
|
|
11675
11675
|
}
|
|
11676
11676
|
if (Mr(g, F, a), sh(g, F), !_)
|
|
11677
11677
|
try {
|
|
11678
|
-
const V = { ...
|
|
11679
|
-
rr(V), await dm("update", V, g, E, { operation: "update",
|
|
11678
|
+
const V = { ...w, ...F };
|
|
11679
|
+
rr(V), await dm("update", V, g, E, { operation: "update", data: F, context: I, batch: v, originalRecord: ve(w) }, a), k && (M(), await fc("update", e, F, g, f));
|
|
11680
11680
|
} catch (V) {
|
|
11681
11681
|
throw new Error(`VALIDATION_ERROR: ${V.message}`);
|
|
11682
11682
|
}
|
|
11683
|
-
if (Rg(F,
|
|
11684
|
-
const V = { ...
|
|
11683
|
+
if (Rg(F, w, e, g, a, N.uid, f), xt(F), lc("update", v, t, e, F, a, g, n, c, Fo, No, xn, (V) => Ae(d, "tenants", i, "system_fields", O.collection, `${O.collection}-${V.name}`, e), (V, K) => Ae(d, "tenants", i, "system_unique", O.collection, `Unique-${O.collection}-${V.name}`, K), (V) => Ae(d, "tenants", i, "system_fields", O.collection, `${O.collection}-${V}`, e)), v.update(Ae(d, "tenants", i, t.join("/"), e), F), !_ && x && Ye("update", "written", F, t, e, g, N.uid, void 0, w), await pc("update", t, e, F, I, g, E, v, N.uid, x || !1, f, !!_, w), _?.type === "unique") {
|
|
11684
|
+
const V = { ...w, ...F };
|
|
11685
11685
|
return rr(V), { id: e, ...V };
|
|
11686
11686
|
}
|
|
11687
|
-
x && Ye("update", "success", F, t, e, g, N.uid, void 0,
|
|
11687
|
+
x && Ye("update", "success", F, t, e, g, N.uid, void 0, w);
|
|
11688
11688
|
const Z = {
|
|
11689
11689
|
operation: "update",
|
|
11690
11690
|
data: F,
|
|
11691
11691
|
recordId: e,
|
|
11692
11692
|
context: I,
|
|
11693
11693
|
retry: !!_,
|
|
11694
|
-
originalRecord: ve(
|
|
11694
|
+
originalRecord: ve(w)
|
|
11695
11695
|
}, re = { ...Z };
|
|
11696
11696
|
await ie("postWrite", l, E, Z), await ie("postOperation", l, E, re);
|
|
11697
|
-
const oe = { ...
|
|
11697
|
+
const oe = { ...w, ...F };
|
|
11698
11698
|
return rr(oe), { id: e, ...oe };
|
|
11699
11699
|
}, pc = async (t, e, r, n, s, i, a, o, c, l, u, d, f) => {
|
|
11700
11700
|
const h = We(), p = Ie(), { labels: b } = i;
|
|
@@ -11715,15 +11715,15 @@ const yw = async (t, e) => {
|
|
|
11715
11715
|
try {
|
|
11716
11716
|
await fc(t, r, n, i, u);
|
|
11717
11717
|
} catch (N) {
|
|
11718
|
-
const
|
|
11718
|
+
const w = N.message.split(", "), v = [], I = [];
|
|
11719
11719
|
let m = !1;
|
|
11720
|
-
for (const T of
|
|
11720
|
+
for (const T of w) {
|
|
11721
11721
|
const A = T.split(" ")[0], L = h.collections[b.collection].fields.find((k) => k.name === A);
|
|
11722
11722
|
if (!L)
|
|
11723
11723
|
throw new Error(`SCHEMA_ERROR: Field ${A} not found in ${b.collection} schema`);
|
|
11724
|
-
L.type === "Number" &&
|
|
11724
|
+
L.type === "Number" && v.push(T), L.type === "String" && I.push(T);
|
|
11725
11725
|
}
|
|
11726
|
-
if ((!x ||
|
|
11726
|
+
if ((!x || v.length > 0) && (C = new Error(`VALIDATION_ERROR: ${w.join(", ")}`)), x && I.length > 0) {
|
|
11727
11727
|
for (const T of I) {
|
|
11728
11728
|
const A = T.split(" ")[0];
|
|
11729
11729
|
if (h.collections[b.collection].fields.find((M) => M.name === A).type === "Number")
|
|
@@ -11733,7 +11733,7 @@ const yw = async (t, e) => {
|
|
|
11733
11733
|
// eslint-disable-next-line security/detect-object-injection
|
|
11734
11734
|
n[A].match(/ - DUPLICATE-\d+/)[0].split("-")[2]
|
|
11735
11735
|
), n[A] = // eslint-disable-next-line security/detect-object-injection
|
|
11736
|
-
n[A].replace(/ - DUPLICATE-\d+/g, "") + ` - DUPLICATE-${k + 1}`) : n[A] = n[A] + " - DUPLICATE-1", k < 10 ? m = !0 : C = new Error(
|
|
11736
|
+
n[A].replace(/ - DUPLICATE-\d+/g, "") + ` - DUPLICATE-${k + 1}`) : n[A] = n[A] + " - DUPLICATE-1", k < 10 ? m = !0 : C = new Error(w.map((M) => M.replace(/ - DUPLICATE-\d+/g, "")).join(", "));
|
|
11737
11737
|
}
|
|
11738
11738
|
if (m) {
|
|
11739
11739
|
t === "create" && await Em(e, n, { retry: { type: "unique", docId: r } }), t === "update" && await mc(e, r, n, {
|
|
@@ -11811,7 +11811,7 @@ const yw = async (t, e) => {
|
|
|
11811
11811
|
throw new Error("CLIENT_OFFLINE");
|
|
11812
11812
|
};
|
|
11813
11813
|
N();
|
|
11814
|
-
const
|
|
11814
|
+
const w = xo(l), v = E?.docId || r?.id || Ae($r(l, "tenants", s, b.collection)).id, I = { collection: b.collection };
|
|
11815
11815
|
if (C || p.auth && n) {
|
|
11816
11816
|
if (N(), p.auth && n) {
|
|
11817
11817
|
if (!n.password)
|
|
@@ -11833,42 +11833,42 @@ const yw = async (t, e) => {
|
|
|
11833
11833
|
}
|
|
11834
11834
|
return await ie("preValidate", o, x, {
|
|
11835
11835
|
operation: "create",
|
|
11836
|
-
|
|
11836
|
+
data: e,
|
|
11837
11837
|
context: I,
|
|
11838
|
-
batch:
|
|
11839
|
-
}), r?.onValid && r.onValid(), await Ew(t, e, n ? { permissions: n.permissions, password: n.password } : void 0,
|
|
11838
|
+
batch: w
|
|
11839
|
+
}), r?.onValid && r.onValid(), await Ew(t, e, n ? { permissions: n.permissions, password: n.password } : void 0, v);
|
|
11840
11840
|
}
|
|
11841
|
-
e.id =
|
|
11841
|
+
e.id = v;
|
|
11842
11842
|
const m = Qo("create", t, e, i, y, Wt(), R.uid, zt.now(), jr(), !!E);
|
|
11843
|
-
if (S && (m[S.archivedField] = !1), xt(m), Mr(p, m, i), !E && O && Ye("create", "started", m, t,
|
|
11843
|
+
if (S && (m[S.archivedField] = !1), xt(m), Mr(p, m, i), !E && O && Ye("create", "started", m, t, v, p, R.uid), E || (await ie("preOperation", o, x, {
|
|
11844
11844
|
operation: "create",
|
|
11845
11845
|
data: m,
|
|
11846
|
-
recordId:
|
|
11846
|
+
recordId: v,
|
|
11847
11847
|
context: I,
|
|
11848
|
-
batch:
|
|
11848
|
+
batch: w
|
|
11849
11849
|
}), await ie("preWrite", o, x, {
|
|
11850
11850
|
operation: "create",
|
|
11851
11851
|
data: m,
|
|
11852
|
-
recordId:
|
|
11852
|
+
recordId: v,
|
|
11853
11853
|
context: I,
|
|
11854
|
-
batch:
|
|
11854
|
+
batch: w
|
|
11855
11855
|
})), Mr(p, m, i), sh(p, m), E || await _y(m, p, x, u.Role), !E)
|
|
11856
11856
|
try {
|
|
11857
|
-
await dm("create", m, p, x, { operation: "create",
|
|
11857
|
+
await dm("create", m, p, x, { operation: "create", data: m, context: I, batch: w }, i), _ && (N(), await fc("create", v, m, p, u));
|
|
11858
11858
|
} catch (k) {
|
|
11859
11859
|
throw new Error(`VALIDATION_ERROR: ${k.message}`);
|
|
11860
11860
|
}
|
|
11861
|
-
if (r?.onValid && r.onValid(), xt(m), Tg(m,
|
|
11862
|
-
return { id:
|
|
11863
|
-
O && Ye("create", "success", m, t,
|
|
11861
|
+
if (r?.onValid && r.onValid(), xt(m), Tg(m, v, p, i, R.uid, u), lc("create", w, t, v, m, i, p, r, a, Fo, No, xn, (k) => Ae(l, "tenants", s, "system_fields", b.collection, `${b.collection}-${k.name}`, v), (k, M) => Ae(l, "tenants", s, "system_unique", b.collection, `Unique-${b.collection}-${k.name}`, M), (k) => Ae(l, "tenants", s, "system_fields", b.collection, `${b.collection}-${k}`, v)), w.set(Ae(l, "tenants", s, t.join("/"), v), m), !E && O && Ye("create", "written", m, t, v, p, R.uid), await pc("create", t, v, m, I, p, x, w, R.uid, O || !1, u, !!E), E?.type === "unique")
|
|
11862
|
+
return { id: v, ...m };
|
|
11863
|
+
O && Ye("create", "success", m, t, v, p, R.uid);
|
|
11864
11864
|
const T = {
|
|
11865
11865
|
operation: "create",
|
|
11866
11866
|
data: m,
|
|
11867
|
-
recordId:
|
|
11867
|
+
recordId: v,
|
|
11868
11868
|
context: I,
|
|
11869
11869
|
retry: !!E
|
|
11870
11870
|
}, A = { ...T };
|
|
11871
|
-
return await ie("postWrite", o, x, T), await ie("postOperation", o, x, A), { id:
|
|
11871
|
+
return await ie("postWrite", o, x, T), await ie("postOperation", o, x, A), { id: v, ...m };
|
|
11872
11872
|
}, Sw = async (t, e) => {
|
|
11873
11873
|
const r = it(), n = Be(), s = Ue(r, n.STOKER_FB_FUNCTIONS_REGION);
|
|
11874
11874
|
return (await Je(s, "stoker-writeapi", { timeout: 540 * 1e3 })({
|
|
@@ -11913,25 +11913,25 @@ const yw = async (t, e) => {
|
|
|
11913
11913
|
if (S || h.auth && N.User_ID)
|
|
11914
11914
|
return await Sw(t, e);
|
|
11915
11915
|
delete N.id;
|
|
11916
|
-
const
|
|
11916
|
+
const w = xo(o), v = { collection: p.collection }, I = Qo("delete", t, N, s, x, Wt(), E.uid, zt.now(), jr(), !!y);
|
|
11917
11917
|
xt(I), !y && g && Ye("delete", "started", I, t, e, h, E.uid), y || (await ie("preOperation", c, C, {
|
|
11918
11918
|
operation: "delete",
|
|
11919
11919
|
data: I,
|
|
11920
11920
|
recordId: e,
|
|
11921
|
-
context:
|
|
11922
|
-
batch:
|
|
11921
|
+
context: v,
|
|
11922
|
+
batch: w
|
|
11923
11923
|
}), await ie("preWrite", c, C, {
|
|
11924
11924
|
operation: "delete",
|
|
11925
11925
|
data: I,
|
|
11926
11926
|
recordId: e,
|
|
11927
|
-
context:
|
|
11928
|
-
batch:
|
|
11929
|
-
})), xt(I), Cg(I, e, h, s, E.uid, l), lc("delete",
|
|
11927
|
+
context: v,
|
|
11928
|
+
batch: w
|
|
11929
|
+
})), xt(I), Cg(I, e, h, s, E.uid, l), lc("delete", w, t, e, I, s, h, r, i, Fo, No, xn, (k) => Ae(o, "tenants", n, "system_fields", p.collection, `${p.collection}-${k.name}`, e), (k, M) => Ae(o, "tenants", n, "system_unique", p.collection, `Unique-${p.collection}-${k.name}`, M), (k) => Ae(o, "tenants", n, "system_fields", p.collection, `${p.collection}-${k}`, e)), w.delete(Ae(o, "tenants", n, t.join("/"), e)), !y && g && Ye("delete", "written", I, t, e, h, E.uid), await pc("delete", t, e, I, v, h, C, w, E.uid, g || !1, l, !!y), g && Ye("delete", "success", { ...I, ...y?.record || {} }, t, e, h, E.uid);
|
|
11930
11930
|
const T = {
|
|
11931
11931
|
operation: "delete",
|
|
11932
11932
|
data: I,
|
|
11933
11933
|
recordId: e,
|
|
11934
|
-
context:
|
|
11934
|
+
context: v,
|
|
11935
11935
|
retry: !!y
|
|
11936
11936
|
}, A = { ...T };
|
|
11937
11937
|
return await ie("postWrite", c, C, T), await ie("postOperation", c, C, A), { id: e, ...I };
|
|
@@ -12184,18 +12184,18 @@ const tb = async (t, e, r, n) => {
|
|
|
12184
12184
|
const o = gp(ht);
|
|
12185
12185
|
St === "development" && (o.instrumentationEnabled = !1, o.dataCollectionEnabled = !1);
|
|
12186
12186
|
const c = ["firestoreWrite"];
|
|
12187
|
-
for (const
|
|
12188
|
-
Xa[`${
|
|
12187
|
+
for (const v of c)
|
|
12188
|
+
Xa[`${v}App`] = Hn(s, v);
|
|
12189
12189
|
const { firestoreWriteApp: l } = Xa, u = Hn(s, "maintenance");
|
|
12190
12190
|
Ge.maintenance = rn(u, wf(), i);
|
|
12191
12191
|
const d = yp();
|
|
12192
12192
|
if (d.settings.minimumFetchIntervalMillis = 36e5, await _p(d), Oe.STOKER_FB_ENABLE_APP_CHECK === "true" && Oe.STOKER_FB_APP_CHECK_KEY) {
|
|
12193
12193
|
(St === "development" || window.location.hostname === "localhost") && (globalThis.FIREBASE_APPCHECK_DEBUG_TOKEN = !0);
|
|
12194
|
-
const
|
|
12194
|
+
const v = {
|
|
12195
12195
|
provider: new pp(Oe.STOKER_FB_APP_CHECK_KEY),
|
|
12196
12196
|
isTokenAutoRefreshEnabled: !0
|
|
12197
12197
|
};
|
|
12198
|
-
Ct.main = Yn(ht,
|
|
12198
|
+
Ct.main = Yn(ht, v), Ct.firestoreWrite = Yn(l, v), Ct.maintenance = Yn(u, v);
|
|
12199
12199
|
let I = !1;
|
|
12200
12200
|
const m = (T, A) => {
|
|
12201
12201
|
if (console.log(`App Check token error detected for ${A}`), !I)
|
|
@@ -12237,8 +12237,8 @@ const tb = async (t, e, r, n) => {
|
|
|
12237
12237
|
"firebase",
|
|
12238
12238
|
"logLevel",
|
|
12239
12239
|
"prod"
|
|
12240
|
-
]), C = await qm().catch((
|
|
12241
|
-
throw new Error("Error checking analytics support.", { cause:
|
|
12240
|
+
]), C = await qm().catch((v) => {
|
|
12241
|
+
throw new Error("Error checking analytics support.", { cause: v });
|
|
12242
12242
|
});
|
|
12243
12243
|
St === "production" && f && C && Lm(ht, h || {}), p && $m(p);
|
|
12244
12244
|
const x = await ne(ge, [
|
|
@@ -12250,11 +12250,11 @@ const tb = async (t, e, r, n) => {
|
|
|
12250
12250
|
persistence: x === "LOCAL" ? [jm, Vm, Tc] : x === "SESSION" ? [Tc, Rc] : [Rc]
|
|
12251
12251
|
};
|
|
12252
12252
|
mt.main = Sc(ht, E);
|
|
12253
|
-
for (const
|
|
12254
|
-
mt[
|
|
12253
|
+
for (const v of c)
|
|
12254
|
+
mt[v] = Sc(Xa[`${v}App`], E);
|
|
12255
12255
|
const { main: R } = mt;
|
|
12256
|
-
Um(R, async (
|
|
12257
|
-
if (
|
|
12256
|
+
Um(R, async (v) => {
|
|
12257
|
+
if (v && await be(ge.preLogin, [v]) === !1)
|
|
12258
12258
|
throw new Error("Operation cancelled by preLogin");
|
|
12259
12259
|
});
|
|
12260
12260
|
const _ = await ne(ge, [
|
|
@@ -12264,29 +12264,29 @@ const tb = async (t, e, r, n) => {
|
|
|
12264
12264
|
]);
|
|
12265
12265
|
if (St === "development" && b) {
|
|
12266
12266
|
if (!_?.includes("Auth")) {
|
|
12267
|
-
const
|
|
12267
|
+
const v = Oe.STOKER_FB_EMULATOR_AUTH_PORT ? parseInt(Oe.STOKER_FB_EMULATOR_AUTH_PORT) : 9099;
|
|
12268
12268
|
for (const I of Object.values(mt))
|
|
12269
|
-
Wm(I, `http://localhost:${
|
|
12269
|
+
Wm(I, `http://localhost:${v}`);
|
|
12270
12270
|
}
|
|
12271
12271
|
if (!_?.includes("Database")) {
|
|
12272
|
-
const
|
|
12273
|
-
Ym(Tf(), "localhost",
|
|
12272
|
+
const v = Oe.STOKER_FB_EMULATOR_DATABASE_PORT ? parseInt(Oe.STOKER_FB_EMULATOR_DATABASE_PORT) : 9e3;
|
|
12273
|
+
Ym(Tf(), "localhost", v);
|
|
12274
12274
|
}
|
|
12275
12275
|
if (!_?.includes("Firestore")) {
|
|
12276
|
-
const
|
|
12277
|
-
Ic(Ge.maintenance, "localhost",
|
|
12276
|
+
const v = Oe.STOKER_FB_EMULATOR_FIRESTORE_PORT ? parseInt(Oe.STOKER_FB_EMULATOR_FIRESTORE_PORT) : 8080;
|
|
12277
|
+
Ic(Ge.maintenance, "localhost", v);
|
|
12278
12278
|
}
|
|
12279
12279
|
if (!_?.includes("Storage")) {
|
|
12280
|
-
const
|
|
12281
|
-
fp(hp(), "localhost",
|
|
12280
|
+
const v = Oe.STOKER_FB_EMULATOR_STORAGE_PORT ? parseInt(Oe.STOKER_FB_EMULATOR_STORAGE_PORT) : 9199;
|
|
12281
|
+
fp(hp(), "localhost", v);
|
|
12282
12282
|
}
|
|
12283
12283
|
if (!_?.includes("Functions")) {
|
|
12284
|
-
const
|
|
12285
|
-
mp(Ue(ht, Oe.STOKER_FB_FUNCTIONS_REGION), "localhost",
|
|
12284
|
+
const v = Oe.STOKER_FB_EMULATOR_FUNCTIONS_PORT ? parseInt(Oe.STOKER_FB_EMULATOR_FUNCTIONS_PORT) : 5001;
|
|
12285
|
+
mp(Ue(ht, Oe.STOKER_FB_FUNCTIONS_REGION), "localhost", v);
|
|
12286
12286
|
}
|
|
12287
12287
|
}
|
|
12288
12288
|
if (kw(), Iw(), Nw(), St === "development" && (O ? en(O) : en("debug")), St === "production" && (S ? en(S) : en("error")), g) {
|
|
12289
|
-
const
|
|
12289
|
+
const v = Kn(R, async (I) => {
|
|
12290
12290
|
if (I) {
|
|
12291
12291
|
const m = JSON.parse(Oe.STOKER_FB_WEB_APP_CONFIG);
|
|
12292
12292
|
Mm(() => {
|
|
@@ -12294,23 +12294,23 @@ const tb = async (t, e, r, n) => {
|
|
|
12294
12294
|
});
|
|
12295
12295
|
}
|
|
12296
12296
|
});
|
|
12297
|
-
In.push(
|
|
12297
|
+
In.push(v);
|
|
12298
12298
|
}
|
|
12299
|
-
await Promise.all(Object.values(mt).map((
|
|
12300
|
-
throw new Error(`Error waiting for auth state in ${
|
|
12299
|
+
await Promise.all(Object.values(mt).map((v) => v.authStateReady().catch((I) => {
|
|
12300
|
+
throw new Error(`Error waiting for auth state in ${v.app.name}.`, { cause: I });
|
|
12301
12301
|
})));
|
|
12302
12302
|
let N = !1;
|
|
12303
|
-
for (const
|
|
12304
|
-
|
|
12305
|
-
let
|
|
12306
|
-
return Kn(R, async (
|
|
12307
|
-
if (
|
|
12303
|
+
for (const v of Object.values(mt))
|
|
12304
|
+
v.currentUser || (N = !0);
|
|
12305
|
+
let w;
|
|
12306
|
+
return Kn(R, async (v) => {
|
|
12307
|
+
if (v && Me?.uid && v.uid !== Me.uid) {
|
|
12308
12308
|
window.location.reload();
|
|
12309
12309
|
return;
|
|
12310
12310
|
}
|
|
12311
12311
|
const I = ++Of, m = () => I !== Of;
|
|
12312
|
-
if (
|
|
12313
|
-
Me =
|
|
12312
|
+
if (v) {
|
|
12313
|
+
Me = v;
|
|
12314
12314
|
const T = await zm(Me);
|
|
12315
12315
|
if (m())
|
|
12316
12316
|
return;
|
|
@@ -12330,7 +12330,7 @@ const tb = async (t, e, r, n) => {
|
|
|
12330
12330
|
}));
|
|
12331
12331
|
if (await Promise.all(L), m())
|
|
12332
12332
|
return;
|
|
12333
|
-
bf || (Dw(ge), bf = !0),
|
|
12333
|
+
bf || (Dw(ge), bf = !0), w = await ne(ge, ["global", "auth", "offlinePersistenceType"], [Me, A]);
|
|
12334
12334
|
const k = await ne(ge, ["global", "auth", "tabManager"], [Me, A]), M = await ne(ge, ["global", "auth", "garbageCollectionStrategy"], [Me, A]), F = await ne(ge, ["global", "auth", "maxCacheSize"], [Me, A]) || -1, Z = await ne(ge, ["global", "auth", "maxWriteCacheSize"], [Me, A]);
|
|
12335
12335
|
if (m())
|
|
12336
12336
|
return;
|
|
@@ -12347,7 +12347,7 @@ const tb = async (t, e, r, n) => {
|
|
|
12347
12347
|
})
|
|
12348
12348
|
};
|
|
12349
12349
|
let V;
|
|
12350
|
-
M === "EAGER" ? V = np() : V = sp({ cacheSizeBytes: F }),
|
|
12350
|
+
M === "EAGER" ? V = np() : V = sp({ cacheSizeBytes: F }), w === "ALL" ? re = oe : re = {
|
|
12351
12351
|
localCache: ip({
|
|
12352
12352
|
garbageCollector: V
|
|
12353
12353
|
})
|
|
@@ -12356,7 +12356,7 @@ const tb = async (t, e, r, n) => {
|
|
|
12356
12356
|
if (Ge.main = rn(ht, {
|
|
12357
12357
|
...re,
|
|
12358
12358
|
...K
|
|
12359
|
-
}, i), ["ALL", "WRITE"].includes(
|
|
12359
|
+
}, i), ["ALL", "WRITE"].includes(w) ? Ge.firestoreWrite = rn(l, {
|
|
12360
12360
|
...z,
|
|
12361
12361
|
...K
|
|
12362
12362
|
}, i) : Ge.firestoreWrite = rn(l, {
|
|
@@ -12367,7 +12367,7 @@ const tb = async (t, e, r, n) => {
|
|
|
12367
12367
|
for (const [Y, U] of Object.entries(Ge))
|
|
12368
12368
|
Y !== "maintenance" && Ic(U, "localhost", q);
|
|
12369
12369
|
}
|
|
12370
|
-
if (
|
|
12370
|
+
if (w === "ALL") {
|
|
12371
12371
|
const q = ap(Ge.main);
|
|
12372
12372
|
q && op(q);
|
|
12373
12373
|
}
|
|
@@ -12380,7 +12380,7 @@ const tb = async (t, e, r, n) => {
|
|
|
12380
12380
|
const Xe = Object.entries(Te.data.allRoleGroups).map(([q, Y]) => [q, new Set(Y)]);
|
|
12381
12381
|
yc = Object.fromEntries(Xe), _c = Te.data.currentUserRoleGroups, km = Ag(Object.keys(Lr.collections), e, "web", Io, n);
|
|
12382
12382
|
const bt = await yw(Me, T);
|
|
12383
|
-
if (m() || (In.push(...bt),
|
|
12383
|
+
if (m() || (In.push(...bt), w === "WRITE" && Cw(Lr, Me), await be(ge.postLogin, [Me]), m()))
|
|
12384
12384
|
return;
|
|
12385
12385
|
const br = new Event("stoker:ready");
|
|
12386
12386
|
document.dispatchEvent(br);
|
|
@@ -12411,9 +12411,9 @@ const tb = async (t, e, r, n) => {
|
|
|
12411
12411
|
"global",
|
|
12412
12412
|
"auth",
|
|
12413
12413
|
"clearPersistenceOnSignOut"
|
|
12414
|
-
]) ?? !0) && (
|
|
12414
|
+
]) ?? !0) && (w === "ALL" && await Dc(Ge.main).catch((M) => {
|
|
12415
12415
|
console.error('Error clearing indexedDB persistence in "[DEFAULT]".'), L.error = !0, L.instances.push({ instance: "[DEFAULT]", code: "CLEAR_CACHE", error: M });
|
|
12416
|
-
}), ["ALL", "WRITE"].includes(
|
|
12416
|
+
}), ["ALL", "WRITE"].includes(w) && await Dc(Ge.firestoreWrite).catch((M) => {
|
|
12417
12417
|
console.error('Error clearing indexedDB persistence in "firestoreWrite".'), L.error = !0, L.instances.push({ instance: "firestoreWrite", code: "CLEAR_CACHE", error: M });
|
|
12418
12418
|
})), L.error ? console.info("Sign out operation completed with errors.") : console.info("Sign out operation completed successfully."), await be(ge.postLogout, [L]);
|
|
12419
12419
|
}
|
|
@@ -12521,8 +12521,8 @@ const tb = async (t, e, r, n) => {
|
|
|
12521
12521
|
const x = h?.roles?.includes(a.Role), y = { collection: f.collection };
|
|
12522
12522
|
await ie("preOperation", p, O, { operation: "read", recordId: e, context: y }), await ie("preRead", p, O, { context: y, refs: C, multiple: !1, listener: !0 });
|
|
12523
12523
|
const _ = /* @__PURE__ */ new Map(), N = [];
|
|
12524
|
-
let
|
|
12525
|
-
const
|
|
12524
|
+
let w = {};
|
|
12525
|
+
const v = /* @__PURE__ */ new Map();
|
|
12526
12526
|
typeof s?.relations == "object" && (s.relations.fields = s.relations.fields.map((k) => {
|
|
12527
12527
|
if (typeof k == "string") {
|
|
12528
12528
|
const M = d.fields.find((F) => F.name === k);
|
|
@@ -12534,20 +12534,20 @@ const tb = async (t, e, r, n) => {
|
|
|
12534
12534
|
}));
|
|
12535
12535
|
const I = () => {
|
|
12536
12536
|
const k = kf(u, async () => {
|
|
12537
|
-
if (k(),
|
|
12538
|
-
if (mm(
|
|
12537
|
+
if (k(), w) {
|
|
12538
|
+
if (mm(w, v), !s?.noComputedFields) {
|
|
12539
12539
|
const M = [];
|
|
12540
12540
|
for (const F of d.fields)
|
|
12541
|
-
F.type === "Computed" && M.push(be(() => F.formula(
|
|
12542
|
-
|
|
12541
|
+
F.type === "Computed" && M.push(be(() => F.formula(w)).then((Z) => {
|
|
12542
|
+
w && (w[F.name] = Z);
|
|
12543
12543
|
}));
|
|
12544
12544
|
await Promise.all(M);
|
|
12545
12545
|
}
|
|
12546
12546
|
if (s?.noEmbeddingFields)
|
|
12547
12547
|
for (const M of d.fields)
|
|
12548
|
-
M.type === "Embedding" && delete
|
|
12548
|
+
M.type === "Embedding" && delete w[M.name];
|
|
12549
12549
|
}
|
|
12550
|
-
r(ve(
|
|
12550
|
+
r(ve(w));
|
|
12551
12551
|
});
|
|
12552
12552
|
}, m = /* @__PURE__ */ new Map(), T = /* @__PURE__ */ new Map(), A = (k) => typeof k == "object" ? k.fields.filter((F) => typeof F == "object" && we(F) && $t(d, o, a).includes(F.collection)) : d.fields.filter((F) => we(F) && $t(d, o, a).includes(F.collection)), L = (k) => new Promise((M) => {
|
|
12553
12553
|
if (!s?.relations) {
|
|
@@ -12558,10 +12558,10 @@ const tb = async (t, e, r, n) => {
|
|
|
12558
12558
|
for (const z of oe)
|
|
12559
12559
|
for (const V of T.values())
|
|
12560
12560
|
V.type === z.type && V.field === z.name && // eslint-disable-next-line security/detect-object-injection
|
|
12561
|
-
!
|
|
12561
|
+
!w[z.name][V.id] && (V.listener(), m.delete(`${z.name}_${V.id}`));
|
|
12562
12562
|
for (const z of oe)
|
|
12563
12563
|
if ("collection" in z) {
|
|
12564
|
-
const V =
|
|
12564
|
+
const V = w[z.name];
|
|
12565
12565
|
if (!V)
|
|
12566
12566
|
continue;
|
|
12567
12567
|
for (const K of Object.keys(V))
|
|
@@ -12572,7 +12572,7 @@ const tb = async (t, e, r, n) => {
|
|
|
12572
12572
|
else
|
|
12573
12573
|
for (const z of oe)
|
|
12574
12574
|
if ("collection" in z) {
|
|
12575
|
-
const V =
|
|
12575
|
+
const V = w[z.name];
|
|
12576
12576
|
if (!V)
|
|
12577
12577
|
continue;
|
|
12578
12578
|
for (const [K, xe] of Object.entries(V))
|
|
@@ -12597,13 +12597,13 @@ const tb = async (t, e, r, n) => {
|
|
|
12597
12597
|
}
|
|
12598
12598
|
V[K] = q, Z.set(`${z.name}_${K}`, !0), Array.from(Z.values()).every((Y) => Y) && (M({}), I(), k.fromCache === !1 && (ie("postOperation", p, O, {
|
|
12599
12599
|
operation: "read",
|
|
12600
|
-
data:
|
|
12600
|
+
data: w,
|
|
12601
12601
|
recordId: e,
|
|
12602
12602
|
context: y
|
|
12603
12603
|
}), ie("postRead", p, O, {
|
|
12604
12604
|
context: y,
|
|
12605
12605
|
refs: C,
|
|
12606
|
-
record:
|
|
12606
|
+
record: w,
|
|
12607
12607
|
listener: !0
|
|
12608
12608
|
})));
|
|
12609
12609
|
}).catch((q) => {
|
|
@@ -12624,13 +12624,13 @@ const tb = async (t, e, r, n) => {
|
|
|
12624
12624
|
}
|
|
12625
12625
|
V[K] = q, Z.set(`${z.name}_${K}`, !0), Array.from(Z.values()).every((Y) => Y) && (M({}), I(), k.fromCache === !1 && (ie("postOperation", p, O, {
|
|
12626
12626
|
operation: "read",
|
|
12627
|
-
data:
|
|
12627
|
+
data: w,
|
|
12628
12628
|
recordId: e,
|
|
12629
12629
|
context: y
|
|
12630
12630
|
}), ie("postRead", p, O, {
|
|
12631
12631
|
context: y,
|
|
12632
12632
|
refs: C,
|
|
12633
|
-
record:
|
|
12633
|
+
record: w,
|
|
12634
12634
|
listener: !0
|
|
12635
12635
|
})));
|
|
12636
12636
|
},
|
|
@@ -12664,7 +12664,7 @@ const tb = async (t, e, r, n) => {
|
|
|
12664
12664
|
const oe = A(s?.relations);
|
|
12665
12665
|
for (const z of oe)
|
|
12666
12666
|
if ("collection" in z && Z[z.name]) {
|
|
12667
|
-
const V =
|
|
12667
|
+
const V = w?.[z.name] || {}, K = Z[z.name];
|
|
12668
12668
|
for (const xe of Object.keys(V))
|
|
12669
12669
|
xe in K || delete V[xe];
|
|
12670
12670
|
for (const [xe, Te] of Object.entries(K))
|
|
@@ -12672,22 +12672,22 @@ const tb = async (t, e, r, n) => {
|
|
|
12672
12672
|
Z[z.name] = V;
|
|
12673
12673
|
}
|
|
12674
12674
|
}
|
|
12675
|
-
_.set(k.path, !0),
|
|
12676
|
-
const re =
|
|
12677
|
-
hm(Z, re),
|
|
12675
|
+
_.set(k.path, !0), w ||= {}, w.id ||= F.id, w = { ...w, ...Z }, delete w.Collection_Path_String;
|
|
12676
|
+
const re = v.get(k) || /* @__PURE__ */ new Set();
|
|
12677
|
+
hm(Z, re), v.set(k, re), _.size === C.length && L(F.metadata).then(() => {
|
|
12678
12678
|
I(), F.metadata.fromCache === !1 && (ie("postOperation", p, O, {
|
|
12679
12679
|
operation: "read",
|
|
12680
|
-
data:
|
|
12680
|
+
data: w,
|
|
12681
12681
|
recordId: e,
|
|
12682
12682
|
context: y
|
|
12683
12683
|
}), ie("postRead", p, O, {
|
|
12684
12684
|
context: y,
|
|
12685
12685
|
refs: C,
|
|
12686
|
-
record:
|
|
12686
|
+
record: w,
|
|
12687
12687
|
listener: !0
|
|
12688
12688
|
}));
|
|
12689
12689
|
});
|
|
12690
|
-
} else
|
|
12690
|
+
} else w && (w = void 0, I(), F.metadata.fromCache === !1 && (ie("postOperation", p, O, {
|
|
12691
12691
|
operation: "read",
|
|
12692
12692
|
recordId: e,
|
|
12693
12693
|
context: y
|
|
@@ -12776,8 +12776,8 @@ const tb = async (t, e, r, n) => {
|
|
|
12776
12776
|
return n.pagination?.orderByField && n.pagination.orderByDirection && (H = he(U, rt(n.pagination.orderByField, n.pagination.orderByDirection))), n.pagination.number && (H = he(H, er(n.pagination.number))), H;
|
|
12777
12777
|
});
|
|
12778
12778
|
}
|
|
12779
|
-
const
|
|
12780
|
-
await ie("preOperation", g, C, { operation: "read", context:
|
|
12779
|
+
const w = { collection: f.collection };
|
|
12780
|
+
await ie("preOperation", g, C, { operation: "read", context: w }), await ie("preRead", g, C, { context: w, refs: R, multiple: !0, listener: !0 });
|
|
12781
12781
|
let m = !0;
|
|
12782
12782
|
const T = /* @__PURE__ */ new Map(), A = /* @__PURE__ */ new Map(), L = [], k = /* @__PURE__ */ new Map(), M = /* @__PURE__ */ new Map(), F = /* @__PURE__ */ new Map(), Z = (q, Y, U) => {
|
|
12783
12783
|
const H = [];
|
|
@@ -12793,9 +12793,9 @@ const tb = async (t, e, r, n) => {
|
|
|
12793
12793
|
operation: "read",
|
|
12794
12794
|
data: D,
|
|
12795
12795
|
recordId: D.id,
|
|
12796
|
-
context:
|
|
12796
|
+
context: w
|
|
12797
12797
|
};
|
|
12798
|
-
ie("postOperation", g, C, ue), ie("postRead", g, C, { context:
|
|
12798
|
+
ie("postOperation", g, C, ue), ie("postRead", g, C, { context: w, refs: E, record: D, listener: !0 });
|
|
12799
12799
|
});
|
|
12800
12800
|
});
|
|
12801
12801
|
}, re = (q, Y) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stoker-platform/web-client",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.92",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
6
6
|
"files": [
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
"test": "echo \"Error: no test specified\""
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@stoker-platform/types": "0.5.
|
|
28
|
-
"@stoker-platform/utils": "0.5.
|
|
27
|
+
"@stoker-platform/types": "0.5.64",
|
|
28
|
+
"@stoker-platform/utils": "0.5.77",
|
|
29
29
|
"@types/lodash": "^4.17.24",
|
|
30
30
|
"@types/luxon": "^3.7.1",
|
|
31
31
|
"firebase": "^12.14.0",
|