@beam3_dev/api_module 0.0.153 → 0.0.155

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/wb3Api.js CHANGED
@@ -213,8 +213,8 @@ function Te(e, t, n) {
213
213
  },
214
214
  onComplete(r, o, i) {
215
215
  const c = JSON.parse(r), d = c.data.map((p) => {
216
- const l = p.attributes.name, u = p.id;
217
- return { name: l, id: u };
216
+ const l = p.attributes.name, f = p.id;
217
+ return { name: l, id: f };
218
218
  });
219
219
  t && t(d, c);
220
220
  },
@@ -293,12 +293,12 @@ function ve(e, t, n = void 0, s = void 0) {
293
293
  Accept: "application/json,text/javascript,*/*"
294
294
  }
295
295
  },
296
- onComplete(u) {
297
- n && n(JSON.parse(u));
296
+ onComplete(f) {
297
+ n && n(JSON.parse(f));
298
298
  },
299
- onFailure(u, f) {
300
- const g = u;
301
- g.msg = f.errormsg, g.errCode = f.errorcode, s && s(g);
299
+ onFailure(f, u) {
300
+ const g = f;
301
+ g.msg = u.errormsg, g.errCode = u.errorcode, s && s(g);
302
302
  }
303
303
  });
304
304
  }
@@ -313,8 +313,8 @@ function V(e, t = void 0, n = void 0) {
313
313
  t && t(JSON.parse(p));
314
314
  },
315
315
  onFailure(p, l) {
316
- const u = p;
317
- u.msg = l.errormsg, u.errCode = l.errorcode, n && n(u);
316
+ const f = p;
317
+ f.msg = l.errormsg, f.errCode = l.errorcode, n && n(f);
318
318
  }
319
319
  });
320
320
  }
@@ -327,13 +327,13 @@ function Ie(e, t = void 0, n = void 0) {
327
327
  m(i, {
328
328
  opts: d,
329
329
  onComplete(p) {
330
- const l = JSON.parse(p), u = {}, f = l.groups.filter((g) => g.uri.startsWith("uuid:"));
330
+ const l = JSON.parse(p), f = {}, u = l.groups.filter((g) => g.uri.startsWith("uuid:"));
331
331
  if (a && Object.keys(a).length > 0) {
332
- const g = f.filter((y) => y.owner === a.email), h = f.filter((y) => y.members.includes(a.email)), S = g.concat(h);
333
- u.iam = S, u.UG = f, u.iamMember = h, V(
332
+ const g = u.filter((y) => y.owner === a.email), h = u.filter((y) => y.members.includes(a.email)), S = g.concat(h);
333
+ f.iam = S, f.UG = u, f.iamMember = h, V(
334
334
  e,
335
335
  (y) => {
336
- u.rules = y, t && t(u);
336
+ f.rules = y, t && t(f);
337
337
  },
338
338
  (y) => {
339
339
  n && n(y);
@@ -440,8 +440,8 @@ var X = function(e, t, n, s) {
440
440
  var i = e.length;
441
441
  o > 0 && i > o && (i = o);
442
442
  for (var c = 0; c < i; ++c) {
443
- var d = e[c].replace(r, "%20"), p = d.indexOf(n), l, u, f, g;
444
- p >= 0 ? (l = d.substr(0, p), u = d.substr(p + 1)) : (l = d, u = ""), f = decodeURIComponent(l), g = decodeURIComponent(u), B(a, f) ? Array.isArray(a[f]) ? a[f].push(g) : a[f] = [a[f], g] : a[f] = g;
443
+ var d = e[c].replace(r, "%20"), p = d.indexOf(n), l, f, u, g;
444
+ p >= 0 ? (l = d.substr(0, p), f = d.substr(p + 1)) : (l = d, f = ""), u = decodeURIComponent(l), g = decodeURIComponent(f), B(a, u) ? Array.isArray(a[u]) ? a[u].push(g) : a[u] = [a[u], g] : a[u] = g;
445
445
  }
446
446
  return a;
447
447
  }, N = function(e) {
@@ -621,10 +621,10 @@ function q(e, t, n, s, a, r, o = void 0, i = void 0) {
621
621
  ENO_CSRF_TOKEN: r
622
622
  },
623
623
  onComplete(d, p, l) {
624
- const u = JSON.parse(d).data[0].dataelements, f = new FormData();
625
- f.append("__fcs__jobTicket", u.ticket), f.append("file_0", s, a);
624
+ const f = JSON.parse(d).data[0].dataelements, u = new FormData();
625
+ u.append("__fcs__jobTicket", f.ticket), u.append("file_0", s, a);
626
626
  const g = {};
627
- g.method = "POST", g.data = f, g.onComplete = function(h) {
627
+ g.method = "POST", g.data = u, g.onComplete = function(h) {
628
628
  let S = "temp_" + Date.now(), y = {
629
629
  method: "PUT",
630
630
  headers: {
@@ -660,7 +660,7 @@ function q(e, t, n, s, a, r, o = void 0, i = void 0) {
660
660
  );
661
661
  }, g.onFailure = function(h) {
662
662
  i && i(h);
663
- }, g.timeout = 0, m(u.ticketURL, g);
663
+ }, g.timeout = 0, m(f.ticketURL, g);
664
664
  }
665
665
  });
666
666
  }
@@ -680,8 +680,8 @@ async function Re(e, t, n, s, a = void 0, r = void 0) {
680
680
  headers: {
681
681
  ENO_CSRF_TOKEN: i.value
682
682
  },
683
- onComplete(u, f, g) {
684
- const h = JSON.parse(u).data[0].dataelements;
683
+ onComplete(f, u, g) {
684
+ const h = JSON.parse(f).data[0].dataelements;
685
685
  d.append("__fcs__jobTicket", h.ticket), d.append("filename", p, n);
686
686
  const S = {
687
687
  method: "POST",
@@ -742,7 +742,7 @@ function b(e, t = void 0, n = void 0, s = void 0, a = void 0, r = void 0, o = !1
742
742
  method: "GET",
743
743
  onComplete(c) {
744
744
  const d = JSON.parse(c);
745
- let p = "", l, u, f;
745
+ let p = "", l, f, u;
746
746
  if (t) {
747
747
  let g = d.collabspaces.find((h) => h.title === t);
748
748
  if (g) {
@@ -753,29 +753,29 @@ function b(e, t = void 0, n = void 0, s = void 0, a = void 0, r = void 0, o = !1
753
753
  (C) => C.organization.pid === S.organization.pid && C.role.pid === S.role.pid
754
754
  )
755
755
  ), n && (Array.isArray(n) ? n.forEach((S) => {
756
- f || h.forEach((y) => {
756
+ u || h.forEach((y) => {
757
757
  if (S === y.role.name && s === y.organization.title)
758
- f = S, u = s;
758
+ u = S, f = s;
759
759
  else if (S === y.role.name) {
760
760
  let _ = h.filter(
761
761
  (C) => C.role.name === S
762
762
  );
763
- _.length === 1 ? (f = _[0].role.name, u = _[0].organization.title) : r(_);
763
+ _.length === 1 ? (u = _[0].role.name, f = _[0].organization.title) : r(_);
764
764
  }
765
765
  });
766
766
  }) : h.forEach((S) => {
767
767
  if (n === S.role.name && s === S.organization.title)
768
- f = n, u = s;
768
+ u = n, f = s;
769
769
  else if (n === S.role.name) {
770
770
  let y = h.filter(
771
771
  (_) => _.role.name === n
772
772
  );
773
- y.length === 1 ? (f = y[0].role.name, u = y[0].organization.title) : r(y);
773
+ y.length === 1 ? (u = y[0].role.name, f = y[0].organization.title) : r(y);
774
774
  }
775
775
  }));
776
776
  }
777
777
  }
778
- l && u && f ? (p = f + "." + u + "." + l, a(p)) : d.preferredcredentials && o ? (p = d.preferredcredentials.role.name + "." + d.preferredcredentials.organization.title + "." + d.preferredcredentials.collabspace.title, a(p)) : r && (p = f + "." + u + "." + l, r(p));
778
+ l && f && u ? (p = u + "." + f + "." + l, a(p)) : d.preferredcredentials && o ? (p = d.preferredcredentials.role.name + "." + d.preferredcredentials.organization.title + "." + d.preferredcredentials.collabspace.title, a(p)) : r && (p = u + "." + f + "." + l, r(p));
779
779
  },
780
780
  onFailure(c, d) {
781
781
  console.log("Erreur de récupération du contexte de sécurité. => ", {
@@ -885,17 +885,24 @@ function Z(e, t, n = void 0, s = void 0, a = void 0) {
885
885
  const d = c.data;
886
886
  c.success === !0 && (n && n(), d.forEach((p) => {
887
887
  try {
888
- const l = p.dataelements.fileName, u = p.dataelements.ticketURL;
889
- m(u, {
890
- onComplete: (f) => {
888
+ const l = p.dataelements.fileName, f = p.dataelements.ticketURL;
889
+ m(f, {
890
+ onComplete: (u, g) => {
891
+ let h;
892
+ try {
893
+ h = JSON.parse(u);
894
+ } catch {
895
+ h = u;
896
+ }
891
897
  s && s({
892
898
  objectId: p.id,
899
+ headers: g,
893
900
  fileName: l,
894
- data: JSON.parse(f)
901
+ data: h
895
902
  });
896
903
  },
897
- onFailure: (f) => {
898
- console.log("error http", f);
904
+ onFailure: (u) => {
905
+ console.log("error http", u);
899
906
  }
900
907
  });
901
908
  } catch (l) {
@@ -1353,16 +1360,16 @@ function He(e, t, n = void 0, s = void 0) {
1353
1360
  Accept: "application/json"
1354
1361
  },
1355
1362
  data: JSON.stringify(l),
1356
- onComplete(u) {
1357
- JSON.parse(u);
1358
- const f = {};
1363
+ onComplete(f) {
1364
+ JSON.parse(f);
1365
+ const u = {};
1359
1366
  setTimeout(() => {
1360
1367
  H(
1361
1368
  e,
1362
1369
  o,
1363
1370
  (g) => {
1364
1371
  const h = g.data[0].dataelements.title, S = g.data[0].dataelements.fileExtension !== void 0 ? g.data[0].dataelements.fileExtension : "", y = g.data[0].relateddata.ownerInfo[0].dataelements.name;
1365
- f.name = h, f.ext = S, f.createBy = y, t.info = { ...f }, ie(
1372
+ u.name = h, u.ext = S, u.createBy = y, t.info = { ...u }, ie(
1366
1373
  e,
1367
1374
  t,
1368
1375
  (_) => {
@@ -1380,9 +1387,9 @@ function He(e, t, n = void 0, s = void 0) {
1380
1387
  );
1381
1388
  }, 2e3);
1382
1389
  },
1383
- onFailure(u, f) {
1384
- const g = u;
1385
- g.msg = f.errormsg, g.errCode = f.errorcode, console.log("❌ sendDirectMessage => ", g), s && s(g);
1390
+ onFailure(f, u) {
1391
+ const g = f;
1392
+ g.msg = u.errormsg, g.errCode = u.errorcode, console.log("❌ sendDirectMessage => ", g), s && s(g);
1386
1393
  }
1387
1394
  });
1388
1395
  }
@@ -1464,8 +1471,8 @@ function ie(e, t, n = void 0, s = void 0) {
1464
1471
  n(l);
1465
1472
  },
1466
1473
  onFailure(p, l) {
1467
- const u = p;
1468
- u.msg = l.errormsg, u.errCode = l.errorcode, console.log("❌ sendDirectMessage => ", u), s && s(u), console.log("Erreur de recuperation d'id du doc et des tags", p);
1474
+ const f = p;
1475
+ f.msg = l.errormsg, f.errCode = l.errorcode, console.log("❌ sendDirectMessage => ", f), s && s(f), console.log("Erreur de recuperation d'id du doc et des tags", p);
1469
1476
  }
1470
1477
  });
1471
1478
  }
@@ -1500,8 +1507,8 @@ function ze(e, t, n = void 0, s = void 0) {
1500
1507
  n && n(p);
1501
1508
  },
1502
1509
  onFailure(p, l) {
1503
- const u = p;
1504
- u.msg = l.errormsg, u.errCode = l.errorcode, console.log("❌ sendDirectMessage => ", u), s && s(u);
1510
+ const f = p;
1511
+ f.msg = l.errormsg, f.errCode = l.errorcode, console.log("❌ sendDirectMessage => ", f), s && s(f);
1505
1512
  }
1506
1513
  });
1507
1514
  }
@@ -1616,21 +1623,21 @@ function et(e, t = void 0, n = void 0) {
1616
1623
  },
1617
1624
  onComplete(i, c, d) {
1618
1625
  const l = JSON.parse(i).result;
1619
- let u = 0;
1620
- l.forEach((f) => {
1626
+ let f = 0;
1627
+ l.forEach((u) => {
1621
1628
  const g = {
1622
- description: f.description,
1623
- id: f.id,
1624
- title: f.title,
1625
- owner: f.owner,
1626
- role: f.role,
1627
- access: f.access
1629
+ description: u.description,
1630
+ id: u.id,
1631
+ title: u.title,
1632
+ owner: u.owner,
1633
+ role: u.role,
1634
+ access: u.access
1628
1635
  };
1629
1636
  ae(
1630
1637
  e,
1631
- f.id,
1638
+ u.id,
1632
1639
  (h) => {
1633
- u++, g.members = h, r.push(g), u === l.length && t && t(r);
1640
+ f++, g.members = h, r.push(g), f === l.length && t && t(r);
1634
1641
  },
1635
1642
  (h) => n(h)
1636
1643
  );
@@ -1725,13 +1732,13 @@ function nt(e, t, n = void 0, s = void 0) {
1725
1732
  },
1726
1733
  data: JSON.stringify(i),
1727
1734
  type: "json",
1728
- onComplete(l, u, f) {
1735
+ onComplete(l, f, u) {
1729
1736
  const g = l;
1730
- g.reponse = JSON.parse(f.response), g.status = f.status, n && n(g), c.id_msg = g.result.id, R(e, c);
1737
+ g.reponse = JSON.parse(u.response), g.status = u.status, n && n(g), c.id_msg = g.result.id, R(e, c);
1731
1738
  },
1732
- onFailure(l, u, f) {
1739
+ onFailure(l, f, u) {
1733
1740
  const g = l;
1734
- g.msg = u.errormsg, g.status = u.status, s && s(g);
1741
+ g.msg = f.errormsg, g.status = f.status, s && s(g);
1735
1742
  }
1736
1743
  });
1737
1744
  });
@@ -1749,13 +1756,13 @@ function oe(e, t, n, s) {
1749
1756
  onComplete(o) {
1750
1757
  const i = JSON.parse(o), c = [];
1751
1758
  i.result.forEach((l) => {
1752
- l.users = l.users.sort((u, f) => u.login.localeCompare(f.login)), l.users.length === t.length && c.push(l);
1759
+ l.users = l.users.sort((f, u) => f.login.localeCompare(u.login)), l.users.length === t.length && c.push(l);
1753
1760
  });
1754
1761
  const d = t.sort(), p = c.find((l) => {
1755
- const u = [];
1756
- return l.users.forEach((f) => {
1757
- u.push(f.login);
1758
- }), JSON.stringify(u) === JSON.stringify(d);
1762
+ const f = [];
1763
+ return l.users.forEach((u) => {
1764
+ f.push(u.login);
1765
+ }), JSON.stringify(f) === JSON.stringify(d);
1759
1766
  });
1760
1767
  n && p !== void 0 ? n(p) : (s || p === void 0) && s(p);
1761
1768
  },
@@ -1848,13 +1855,13 @@ function st(e, t, n = void 0, s = void 0) {
1848
1855
  headers: d,
1849
1856
  data: JSON.stringify(i),
1850
1857
  type: "json",
1851
- onComplete(p, l, u) {
1852
- const f = JSON.parse(p);
1853
- f.status = u.status, f.response = u.response, n && n(f);
1858
+ onComplete(p, l, f) {
1859
+ const u = JSON.parse(p);
1860
+ u.status = f.status, u.response = f.response, n && n(u);
1854
1861
  },
1855
- onFailure(p, l, u) {
1856
- const f = p;
1857
- f.status = l.status, f.response = l.errormsg, s && s(f);
1862
+ onFailure(p, l, f) {
1863
+ const u = p;
1864
+ u.status = l.status, u.response = l.errormsg, s && s(u);
1858
1865
  }
1859
1866
  });
1860
1867
  });