@beam3_dev/api_module 0.0.152 → 0.0.154

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
  },
@@ -250,7 +250,7 @@ function be(e, t, n = void 0, s = void 0) {
250
250
  }
251
251
  });
252
252
  }
253
- const k = {
253
+ const U = {
254
254
  "Content-Type": "application/json",
255
255
  Accept: "application/json,text/javascript,*/*"
256
256
  };
@@ -271,7 +271,7 @@ function Ne(e, t, n = void 0, s = void 0) {
271
271
  };
272
272
  m(i, {
273
273
  method: "POST",
274
- headers: k,
274
+ headers: U,
275
275
  data: JSON.stringify(c),
276
276
  onComplete(d) {
277
277
  n && n(JSON.parse(d));
@@ -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);
@@ -366,7 +366,7 @@ function Ae(e, t, n, s = void 0, a = void 0) {
366
366
  OPTsTenant: `tenant=dstenant:${o}`
367
367
  }, c = n, d = `${r}${i.URIUGr}/${t}`, p = JSON.stringify(c);
368
368
  m(d, {
369
- headers: k,
369
+ headers: U,
370
370
  method: "PATCH",
371
371
  data: p,
372
372
  type: "json",
@@ -378,11 +378,11 @@ function Ae(e, t, n, s = void 0, a = void 0) {
378
378
  }
379
379
  });
380
380
  }
381
- function Ue(e, t, n, s = void 0, a = void 0) {
381
+ function ke(e, t, n, s = void 0, a = void 0) {
382
382
  const { space: r } = e, i = `${r}/3drdfpersist/resources/v1/usersgroup/${t}/sharing`;
383
383
  m(i, {
384
384
  method: "PATCH",
385
- headers: k,
385
+ headers: U,
386
386
  data: JSON.stringify(n),
387
387
  type: "json",
388
388
  onComplete(d) {
@@ -393,7 +393,7 @@ function Ue(e, t, n, s = void 0, a = void 0) {
393
393
  }
394
394
  });
395
395
  }
396
- function ke(e, t, n = void 0, s = void 0) {
396
+ function Ue(e, t, n = void 0, s = void 0) {
397
397
  const { space: a } = e, o = `${a}/3drdfpersist/resources/v1/usersgroup/${t}/sharing`;
398
398
  m(o, {
399
399
  opts: {
@@ -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) {
@@ -595,20 +595,21 @@ function je(e, t, n, s = void 0, a = void 0) {
595
595
  });
596
596
  }
597
597
  function z(e, t, n, s, a, r = void 0, o = void 0) {
598
- A(
598
+ const i = () => q(
599
599
  e,
600
600
  t,
601
- (i) => {
602
- q(
603
- e,
604
- t,
605
- n,
606
- s,
607
- a,
608
- i.csrf.value,
609
- r,
610
- o
611
- );
601
+ n,
602
+ s,
603
+ a,
604
+ e.token,
605
+ r,
606
+ o
607
+ );
608
+ e.token ? i() : A(
609
+ e,
610
+ t,
611
+ (c) => {
612
+ e.token = c.csrf.value, i();
612
613
  }
613
614
  );
614
615
  }
@@ -620,10 +621,10 @@ function q(e, t, n, s, a, r, o = void 0, i = void 0) {
620
621
  ENO_CSRF_TOKEN: r
621
622
  },
622
623
  onComplete(d, p, l) {
623
- const u = JSON.parse(d).data[0].dataelements, f = new FormData();
624
- 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);
625
626
  const g = {};
626
- g.method = "POST", g.data = f, g.onComplete = function(h) {
627
+ g.method = "POST", g.data = u, g.onComplete = function(h) {
627
628
  let S = "temp_" + Date.now(), y = {
628
629
  method: "PUT",
629
630
  headers: {
@@ -659,7 +660,7 @@ function q(e, t, n, s, a, r, o = void 0, i = void 0) {
659
660
  );
660
661
  }, g.onFailure = function(h) {
661
662
  i && i(h);
662
- }, g.timeout = 0, m(u.ticketURL, g);
663
+ }, g.timeout = 0, m(f.ticketURL, g);
663
664
  }
664
665
  });
665
666
  }
@@ -679,15 +680,15 @@ async function Re(e, t, n, s, a = void 0, r = void 0) {
679
680
  headers: {
680
681
  ENO_CSRF_TOKEN: i.value
681
682
  },
682
- onComplete(u, f, g) {
683
- const h = JSON.parse(u).data[0].dataelements;
683
+ onComplete(f, u, g) {
684
+ const h = JSON.parse(f).data[0].dataelements;
684
685
  d.append("__fcs__jobTicket", h.ticket), d.append("filename", p, n);
685
686
  const S = {
686
687
  method: "POST",
687
688
  data: d,
688
689
  onComplete(C) {
689
690
  if (c !== "" && i !== "") {
690
- const U = {
691
+ const k = {
691
692
  method: "POST",
692
693
  headers: {
693
694
  ENO_CSRF_TOKEN: i,
@@ -718,7 +719,7 @@ async function Re(e, t, n, s, a = void 0, r = void 0) {
718
719
  onComplete: y,
719
720
  onFailure: _
720
721
  };
721
- c !== "" && m(l.url_Post, U);
722
+ c !== "" && m(l.url_Post, k);
722
723
  } else
723
724
  console.warn("le store est vide");
724
725
  },
@@ -727,9 +728,9 @@ async function Re(e, t, n, s, a = void 0, r = void 0) {
727
728
  function y(C) {
728
729
  console.log("Success -- response ", C.data[0]), a && a(C);
729
730
  }
730
- function _(C, U) {
731
+ function _(C, k) {
731
732
  console.log("Erreur -- response ", C, `
732
- headers `, U), r && r(C);
733
+ headers `, k), r && r(C);
733
734
  }
734
735
  m(h.ticketURL, S);
735
736
  }
@@ -741,7 +742,7 @@ function b(e, t = void 0, n = void 0, s = void 0, a = void 0, r = void 0, o = !1
741
742
  method: "GET",
742
743
  onComplete(c) {
743
744
  const d = JSON.parse(c);
744
- let p = "", l, u, f;
745
+ let p = "", l, f, u;
745
746
  if (t) {
746
747
  let g = d.collabspaces.find((h) => h.title === t);
747
748
  if (g) {
@@ -752,29 +753,29 @@ function b(e, t = void 0, n = void 0, s = void 0, a = void 0, r = void 0, o = !1
752
753
  (C) => C.organization.pid === S.organization.pid && C.role.pid === S.role.pid
753
754
  )
754
755
  ), n && (Array.isArray(n) ? n.forEach((S) => {
755
- f || h.forEach((y) => {
756
+ u || h.forEach((y) => {
756
757
  if (S === y.role.name && s === y.organization.title)
757
- f = S, u = s;
758
+ u = S, f = s;
758
759
  else if (S === y.role.name) {
759
760
  let _ = h.filter(
760
761
  (C) => C.role.name === S
761
762
  );
762
- _.length === 1 ? (f = _[0].role.name, u = _[0].organization.title) : r(_);
763
+ _.length === 1 ? (u = _[0].role.name, f = _[0].organization.title) : r(_);
763
764
  }
764
765
  });
765
766
  }) : h.forEach((S) => {
766
767
  if (n === S.role.name && s === S.organization.title)
767
- f = n, u = s;
768
+ u = n, f = s;
768
769
  else if (n === S.role.name) {
769
770
  let y = h.filter(
770
771
  (_) => _.role.name === n
771
772
  );
772
- 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);
773
774
  }
774
775
  }));
775
776
  }
776
777
  }
777
- 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));
778
779
  },
779
780
  onFailure(c, d) {
780
781
  console.log("Erreur de récupération du contexte de sécurité. => ", {
@@ -884,17 +885,23 @@ function Z(e, t, n = void 0, s = void 0, a = void 0) {
884
885
  const d = c.data;
885
886
  c.success === !0 && (n && n(), d.forEach((p) => {
886
887
  try {
887
- const l = p.dataelements.fileName, u = p.dataelements.ticketURL;
888
- m(u, {
889
- onComplete: (f) => {
888
+ const l = p.dataelements.fileName, f = p.dataelements.ticketURL;
889
+ m(f, {
890
+ onComplete: (u) => {
891
+ let g;
892
+ try {
893
+ g = JSON.parse(u);
894
+ } catch {
895
+ g = u;
896
+ }
890
897
  s && s({
891
898
  objectId: p.id,
892
899
  fileName: l,
893
- data: JSON.parse(f)
900
+ data: g
894
901
  });
895
902
  },
896
- onFailure: (f) => {
897
- console.log("error http", f);
903
+ onFailure: (u) => {
904
+ console.log("error http", u);
898
905
  }
899
906
  });
900
907
  } catch (l) {
@@ -1352,16 +1359,16 @@ function He(e, t, n = void 0, s = void 0) {
1352
1359
  Accept: "application/json"
1353
1360
  },
1354
1361
  data: JSON.stringify(l),
1355
- onComplete(u) {
1356
- JSON.parse(u);
1357
- const f = {};
1362
+ onComplete(f) {
1363
+ JSON.parse(f);
1364
+ const u = {};
1358
1365
  setTimeout(() => {
1359
1366
  H(
1360
1367
  e,
1361
1368
  o,
1362
1369
  (g) => {
1363
1370
  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;
1364
- f.name = h, f.ext = S, f.createBy = y, t.info = { ...f }, ie(
1371
+ u.name = h, u.ext = S, u.createBy = y, t.info = { ...u }, ie(
1365
1372
  e,
1366
1373
  t,
1367
1374
  (_) => {
@@ -1379,9 +1386,9 @@ function He(e, t, n = void 0, s = void 0) {
1379
1386
  );
1380
1387
  }, 2e3);
1381
1388
  },
1382
- onFailure(u, f) {
1383
- const g = u;
1384
- g.msg = f.errormsg, g.errCode = f.errorcode, console.log("❌ sendDirectMessage => ", g), s && s(g);
1389
+ onFailure(f, u) {
1390
+ const g = f;
1391
+ g.msg = u.errormsg, g.errCode = u.errorcode, console.log("❌ sendDirectMessage => ", g), s && s(g);
1385
1392
  }
1386
1393
  });
1387
1394
  }
@@ -1463,8 +1470,8 @@ function ie(e, t, n = void 0, s = void 0) {
1463
1470
  n(l);
1464
1471
  },
1465
1472
  onFailure(p, l) {
1466
- const u = p;
1467
- 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);
1473
+ const f = p;
1474
+ 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);
1468
1475
  }
1469
1476
  });
1470
1477
  }
@@ -1499,8 +1506,8 @@ function ze(e, t, n = void 0, s = void 0) {
1499
1506
  n && n(p);
1500
1507
  },
1501
1508
  onFailure(p, l) {
1502
- const u = p;
1503
- u.msg = l.errormsg, u.errCode = l.errorcode, console.log("❌ sendDirectMessage => ", u), s && s(u);
1509
+ const f = p;
1510
+ f.msg = l.errormsg, f.errCode = l.errorcode, console.log("❌ sendDirectMessage => ", f), s && s(f);
1504
1511
  }
1505
1512
  });
1506
1513
  }
@@ -1615,21 +1622,21 @@ function et(e, t = void 0, n = void 0) {
1615
1622
  },
1616
1623
  onComplete(i, c, d) {
1617
1624
  const l = JSON.parse(i).result;
1618
- let u = 0;
1619
- l.forEach((f) => {
1625
+ let f = 0;
1626
+ l.forEach((u) => {
1620
1627
  const g = {
1621
- description: f.description,
1622
- id: f.id,
1623
- title: f.title,
1624
- owner: f.owner,
1625
- role: f.role,
1626
- access: f.access
1628
+ description: u.description,
1629
+ id: u.id,
1630
+ title: u.title,
1631
+ owner: u.owner,
1632
+ role: u.role,
1633
+ access: u.access
1627
1634
  };
1628
1635
  ae(
1629
1636
  e,
1630
- f.id,
1637
+ u.id,
1631
1638
  (h) => {
1632
- u++, g.members = h, r.push(g), u === l.length && t && t(r);
1639
+ f++, g.members = h, r.push(g), f === l.length && t && t(r);
1633
1640
  },
1634
1641
  (h) => n(h)
1635
1642
  );
@@ -1724,13 +1731,13 @@ function nt(e, t, n = void 0, s = void 0) {
1724
1731
  },
1725
1732
  data: JSON.stringify(i),
1726
1733
  type: "json",
1727
- onComplete(l, u, f) {
1734
+ onComplete(l, f, u) {
1728
1735
  const g = l;
1729
- g.reponse = JSON.parse(f.response), g.status = f.status, n && n(g), c.id_msg = g.result.id, R(e, c);
1736
+ g.reponse = JSON.parse(u.response), g.status = u.status, n && n(g), c.id_msg = g.result.id, R(e, c);
1730
1737
  },
1731
- onFailure(l, u, f) {
1738
+ onFailure(l, f, u) {
1732
1739
  const g = l;
1733
- g.msg = u.errormsg, g.status = u.status, s && s(g);
1740
+ g.msg = f.errormsg, g.status = f.status, s && s(g);
1734
1741
  }
1735
1742
  });
1736
1743
  });
@@ -1748,13 +1755,13 @@ function oe(e, t, n, s) {
1748
1755
  onComplete(o) {
1749
1756
  const i = JSON.parse(o), c = [];
1750
1757
  i.result.forEach((l) => {
1751
- l.users = l.users.sort((u, f) => u.login.localeCompare(f.login)), l.users.length === t.length && c.push(l);
1758
+ l.users = l.users.sort((f, u) => f.login.localeCompare(u.login)), l.users.length === t.length && c.push(l);
1752
1759
  });
1753
1760
  const d = t.sort(), p = c.find((l) => {
1754
- const u = [];
1755
- return l.users.forEach((f) => {
1756
- u.push(f.login);
1757
- }), JSON.stringify(u) === JSON.stringify(d);
1761
+ const f = [];
1762
+ return l.users.forEach((u) => {
1763
+ f.push(u.login);
1764
+ }), JSON.stringify(f) === JSON.stringify(d);
1758
1765
  });
1759
1766
  n && p !== void 0 ? n(p) : (s || p === void 0) && s(p);
1760
1767
  },
@@ -1847,13 +1854,13 @@ function st(e, t, n = void 0, s = void 0) {
1847
1854
  headers: d,
1848
1855
  data: JSON.stringify(i),
1849
1856
  type: "json",
1850
- onComplete(p, l, u) {
1851
- const f = JSON.parse(p);
1852
- f.status = u.status, f.response = u.response, n && n(f);
1857
+ onComplete(p, l, f) {
1858
+ const u = JSON.parse(p);
1859
+ u.status = f.status, u.response = f.response, n && n(u);
1853
1860
  },
1854
- onFailure(p, l, u) {
1855
- const f = p;
1856
- f.status = l.status, f.response = l.errormsg, s && s(f);
1861
+ onFailure(p, l, f) {
1862
+ const u = p;
1863
+ u.status = l.status, u.response = l.errormsg, s && s(u);
1857
1864
  }
1858
1865
  });
1859
1866
  });
@@ -2274,9 +2281,9 @@ export {
2274
2281
  V as getUsersGroupRules,
2275
2282
  Be as get_3DSpace_csrf,
2276
2283
  Ae as patchUserGroups,
2277
- Ue as patchUserGroupsControl,
2284
+ ke as patchUserGroupsControl,
2278
2285
  We as pushDataIn3DSpace,
2279
- ke as readUserGroupControl,
2286
+ Ue as readUserGroupControl,
2280
2287
  ze as removeTagToDoc,
2281
2288
  mt as sayHello,
2282
2289
  he as updateEvent