@stoker-platform/web-client 0.4.3 → 0.4.4

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.
Files changed (2) hide show
  1. package/dist/bundle.js +5 -5
  2. package/package.json +1 -1
package/dist/bundle.js CHANGED
@@ -8,7 +8,7 @@ import { getFunctions as je, httpsCallable as Ye, connectFunctionsEmulator as up
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.4.2", yp = (r) => !!r.auth, _t = (r, e) => {
11
+ const pp = "0.4.3", 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) => {
@@ -11763,7 +11763,7 @@ const fw = async (r, e) => {
11763
11763
  throw new Error("CLIENT_OFFLINE");
11764
11764
  };
11765
11765
  I();
11766
- const v = Ao(f), R = _?.docId || s || Ae(Pr(f, g.collection)).id, w = { collection: g.collection };
11766
+ const v = Ao(f), R = _?.docId || s || Ae(Pr(f, "tenants", a, g.collection)).id, w = { collection: g.collection };
11767
11767
  if (E || y.auth && t) {
11768
11768
  if (I(), y.auth && t) {
11769
11769
  if (!t.password)
@@ -11831,9 +11831,7 @@ const fw = async (r, e) => {
11831
11831
  if ((() => {
11832
11832
  if (zt() === "Offline" && (C || T || h.auth))
11833
11833
  throw new Error("CLIENT_OFFLINE");
11834
- })(), T || h.auth)
11835
- return await _w(r, e);
11836
- if (wm(e))
11834
+ })(), wm(e))
11837
11835
  throw new Error("RECORD_BUSY");
11838
11836
  let k;
11839
11837
  try {
@@ -11841,6 +11839,8 @@ const fw = async (r, e) => {
11841
11839
  } catch (N) {
11842
11840
  throw y && E?.record && N.message.indexOf("NOT_FOUND") !== -1 && await He("delete", "failed", E?.record, r, e, h, x.uid, N), N;
11843
11841
  }
11842
+ if (T || h.auth && k.User_ID)
11843
+ return await _w(r, e);
11844
11844
  delete k.id;
11845
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);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stoker-platform/web-client",
3
- "version": "0.4.3",
3
+ "version": "0.4.4",
4
4
  "type": "module",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "files": [