@beam3_dev/api_module 0.0.172 → 0.0.173

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
@@ -1,7 +1,7 @@
1
1
  import { v4 as G } from "uuid";
2
2
  import { DateTime as v } from "luxon";
3
- import { requirejs as O, widget as R } from "@widget-lab/3ddashboard-utils";
4
- function x() {
3
+ import { requirejs as O, widget as P } from "@widget-lab/3ddashboard-utils";
4
+ function R() {
5
5
  return G();
6
6
  }
7
7
  const E = {
@@ -121,7 +121,7 @@ function _e(e, t = void 0) {
121
121
  O(["DS/TagNavigatorProxy/TagNavigatorProxy"], (n) => {
122
122
  let s;
123
123
  s === void 0 && (s = n.createProxy({
124
- widgetId: R.id,
124
+ widgetId: P.id,
125
125
  filteringMode: "WithFilteringServices"
126
126
  }), t !== void 0 && s.addEvent("onFilterSubjectsChange", t)), s.setSubjectsTags(e);
127
127
  });
@@ -137,7 +137,7 @@ async function we(e, t = void 0, n = void 0) {
137
137
  await O(
138
138
  ["DS/i3DXCompassServices/i3DXCompassServices"],
139
139
  (s) => {
140
- (!e || e === "") && (e = R.getValue("PlatFormInstanceId")), (!e || e === "") && (e = void 0), t && t(
140
+ (!e || e === "") && (e = P.getValue("PlatFormInstanceId")), (!e || e === "") && (e = void 0), t && t(
141
141
  s.getPlatformServices({
142
142
  platformId: e,
143
143
  onComplete: t,
@@ -213,8 +213,8 @@ function Te(e, t, n) {
213
213
  },
214
214
  onComplete(c, o, a) {
215
215
  const r = JSON.parse(c), d = r.data.map((p) => {
216
- const l = p.attributes.name, f = p.id;
217
- return { name: l, id: f };
216
+ const l = p.attributes.name, u = p.id;
217
+ return { name: l, id: u };
218
218
  });
219
219
  t && t(d, r);
220
220
  },
@@ -293,12 +293,12 @@ function $e(e, t, n = void 0, s = void 0) {
293
293
  Accept: "application/json,text/javascript,*/*"
294
294
  }
295
295
  },
296
- onComplete(f) {
297
- n && n(JSON.parse(f));
296
+ onComplete(u) {
297
+ n && n(JSON.parse(u));
298
298
  },
299
- onFailure(f, u) {
300
- const g = f;
301
- g.msg = u.errormsg, g.errCode = u.errorcode, s && s(g);
299
+ onFailure(u, f) {
300
+ const g = u;
301
+ g.msg = f.errormsg, g.errCode = f.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 f = p;
317
- f.msg = l.errormsg, f.errCode = l.errorcode, n && n(f);
316
+ const u = p;
317
+ u.msg = l.errormsg, u.errCode = l.errorcode, n && n(u);
318
318
  }
319
319
  });
320
320
  }
@@ -327,13 +327,13 @@ function ve(e, t = void 0, n = void 0) {
327
327
  m(a, {
328
328
  opts: d,
329
329
  onComplete(p) {
330
- const l = JSON.parse(p), f = {}, u = l.groups.filter((g) => g.uri.startsWith("uuid:"));
330
+ const l = JSON.parse(p), u = {}, f = l.groups.filter((g) => g.uri.startsWith("uuid:"));
331
331
  if (i && Object.keys(i).length > 0) {
332
- const g = u.filter((_) => _.owner === i.email), h = u.filter((_) => _.members.includes(i.email)), S = g.concat(h);
333
- f.iam = S, f.UG = u, f.iamMember = h, V(
332
+ const g = f.filter((_) => _.owner === i.email), h = f.filter((_) => _.members.includes(i.email)), S = g.concat(h);
333
+ u.iam = S, u.UG = f, u.iamMember = h, V(
334
334
  e,
335
335
  (_) => {
336
- f.rules = _, t && t(f);
336
+ u.rules = _, t && t(u);
337
337
  },
338
338
  (_) => {
339
339
  n && n(_);
@@ -440,8 +440,8 @@ var X = function(e, t, n, s) {
440
440
  var a = e.length;
441
441
  o > 0 && a > o && (a = o);
442
442
  for (var r = 0; r < a; ++r) {
443
- var d = e[r].replace(c, "%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), W(i, u) ? Array.isArray(i[u]) ? i[u].push(g) : i[u] = [i[u], g] : i[u] = g;
443
+ var d = e[r].replace(c, "%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), W(i, f) ? Array.isArray(i[f]) ? i[f].push(g) : i[f] = [i[f], g] : i[f] = g;
445
445
  }
446
446
  return i;
447
447
  }, $ = function(e) {
@@ -621,8 +621,8 @@ function q(e, t, n, s, i, c, o = void 0, a = void 0) {
621
621
  ENO_CSRF_TOKEN: e.token
622
622
  },
623
623
  onComplete(d, p, l) {
624
- const f = JSON.parse(d).csrf, u = JSON.parse(d).data[0].dataelements, g = new FormData();
625
- g.append("__fcs__jobTicket", u.ticket), g.append("file_0", s, i);
624
+ const u = JSON.parse(d).csrf, f = JSON.parse(d).data[0].dataelements, g = new FormData();
625
+ g.append("__fcs__jobTicket", f.ticket), g.append("file_0", s, i);
626
626
  const h = {};
627
627
  h.method = "POST", h.data = g, h.onComplete = function(S) {
628
628
  let _ = {
@@ -631,7 +631,7 @@ function q(e, t, n, s, i, c, o = void 0, a = void 0) {
631
631
  SecurityContext: "ctx::" + e.ctx
632
632
  },
633
633
  data: JSON.stringify({
634
- csrf: f,
634
+ csrf: u,
635
635
  data: [{
636
636
  relateddata: {
637
637
  files: [{
@@ -660,11 +660,11 @@ function q(e, t, n, s, i, c, o = void 0, a = void 0) {
660
660
  );
661
661
  }, h.onFailure = function(S) {
662
662
  a && a(S);
663
- }, h.timeout = 0, m(u.ticketURL, h);
663
+ }, h.timeout = 0, m(f.ticketURL, h);
664
664
  }
665
665
  });
666
666
  }
667
- async function Pe(e, t, n, s, i = void 0, c = void 0) {
667
+ async function xe(e, t, n, s, i = void 0, c = void 0) {
668
668
  const o = e.space, a = e.token, r = e.ctx, d = new FormData(), p = new Blob([JSON.stringify(t)], {
669
669
  type: "text/plain"
670
670
  }), l = {
@@ -678,16 +678,17 @@ async function Pe(e, t, n, s, i = void 0, c = void 0) {
678
678
  m(l.url_Ticket, {
679
679
  method: "PUT",
680
680
  headers: {
681
- ENO_CSRF_TOKEN: a.value
681
+ ENO_CSRF_TOKEN: a.value,
682
+ SecurityContext: `ctx::${r}`
682
683
  },
683
- onComplete(f, u, g) {
684
- const h = JSON.parse(f).data[0].dataelements;
685
- d.append("__fcs__jobTicket", h.ticket), d.append("filename", p, n);
684
+ onComplete(u, f, g) {
685
+ const h = JSON.parse(u).data[0].dataelements;
686
+ d.append("__fcs__jobTicket", h.ticket), d.append("file_0", p, n);
686
687
  const S = {
687
688
  method: "POST",
688
689
  data: d,
689
690
  onComplete(w) {
690
- if (r !== "" && a !== "") {
691
+ if (r && r !== "" && a && a !== "") {
691
692
  const k = {
692
693
  method: "POST",
693
694
  headers: {
@@ -696,6 +697,7 @@ async function Pe(e, t, n, s, i = void 0, c = void 0) {
696
697
  "Content-Type": "application/json"
697
698
  },
698
699
  data: JSON.stringify({
700
+ csrf: u.csrf,
699
701
  data: [{
700
702
  type: "Document",
701
703
  dataelements: {
@@ -711,7 +713,7 @@ async function Pe(e, t, n, s, i = void 0, c = void 0) {
711
713
  }
712
714
  }]
713
715
  },
714
- tempId: x()
716
+ tempId: "temp_" + R()
715
717
  }]
716
718
  }),
717
719
  type: "json",
@@ -742,7 +744,7 @@ function N(e, t = void 0, n = void 0, s = void 0, i = void 0, c = void 0, o = !1
742
744
  method: "GET",
743
745
  onComplete(r) {
744
746
  const d = JSON.parse(r);
745
- let p = "", l, f, u;
747
+ let p = "", l, u, f;
746
748
  if (t) {
747
749
  let g = d.collabspaces.find((h) => h.title === t);
748
750
  if (g) {
@@ -753,29 +755,29 @@ function N(e, t = void 0, n = void 0, s = void 0, i = void 0, c = void 0, o = !1
753
755
  (w) => w.organization.pid === S.organization.pid && w.role.pid === S.role.pid
754
756
  )
755
757
  ), n && (Array.isArray(n) ? n.forEach((S) => {
756
- u || h.forEach((_) => {
758
+ f || h.forEach((_) => {
757
759
  if (S === _.role.name && s === _.organization.title)
758
- u = S, f = s;
760
+ f = S, u = s;
759
761
  else if (S === _.role.name) {
760
762
  let y = h.filter(
761
763
  (w) => w.role.name === S
762
764
  );
763
- y.length === 1 ? (u = y[0].role.name, f = y[0].organization.title) : c(y);
765
+ y.length === 1 ? (f = y[0].role.name, u = y[0].organization.title) : c(y);
764
766
  }
765
767
  });
766
768
  }) : h.forEach((S) => {
767
769
  if (n === S.role.name && s === S.organization.title)
768
- u = n, f = s;
770
+ f = n, u = s;
769
771
  else if (n === S.role.name) {
770
772
  let _ = h.filter(
771
773
  (y) => y.role.name === n
772
774
  );
773
- _.length === 1 ? (u = _[0].role.name, f = _[0].organization.title) : c(_);
775
+ _.length === 1 ? (f = _[0].role.name, u = _[0].organization.title) : c(_);
774
776
  }
775
777
  }));
776
778
  }
777
779
  }
778
- l && f && u ? (p = u + "." + f + "." + l, i(p)) : d.preferredcredentials && o ? (p = d.preferredcredentials.role.name + "." + d.preferredcredentials.organization.title + "." + d.preferredcredentials.collabspace.title, i(p)) : c && (p = u + "." + f + "." + l, c(p));
780
+ l && u && f ? (p = f + "." + u + "." + l, i(p)) : d.preferredcredentials && o ? (p = d.preferredcredentials.role.name + "." + d.preferredcredentials.organization.title + "." + d.preferredcredentials.collabspace.title, i(p)) : c && (p = f + "." + u + "." + l, c(p));
779
781
  },
780
782
  onFailure(r, d) {
781
783
  console.log("Erreur de récupération du contexte de sécurité. => ", {
@@ -885,14 +887,14 @@ function Z(e, t, n = void 0, s = void 0, i = void 0) {
885
887
  const d = r.data;
886
888
  r.success === !0 && (n && n(), d.forEach((p) => {
887
889
  try {
888
- const l = p.dataelements.fileName, f = p.dataelements.ticketURL;
889
- m(f, {
890
- onComplete: (u, g) => {
890
+ const l = p.dataelements.fileName, u = p.dataelements.ticketURL;
891
+ m(u, {
892
+ onComplete: (f, g) => {
891
893
  let h;
892
894
  try {
893
- h = JSON.parse(u);
895
+ h = JSON.parse(f);
894
896
  } catch {
895
- h = u.blob();
897
+ h = f.blob();
896
898
  }
897
899
  s && s({
898
900
  objectId: p.id,
@@ -901,8 +903,8 @@ function Z(e, t, n = void 0, s = void 0, i = void 0) {
901
903
  data: h
902
904
  });
903
905
  },
904
- onFailure: (u) => {
905
- console.log("error http", u);
906
+ onFailure: (f) => {
907
+ console.log("error http", f);
906
908
  }
907
909
  });
908
910
  } catch (l) {
@@ -915,7 +917,7 @@ function Z(e, t, n = void 0, s = void 0, i = void 0) {
915
917
  }
916
918
  });
917
919
  }
918
- function Re(e, t, n = void 0, s = void 0) {
920
+ function Pe(e, t, n = void 0, s = void 0) {
919
921
  return new Promise((i) => {
920
922
  if (e.token === "" && T(e), t !== void 0 && t !== "" && t !== null) {
921
923
  const c = `${e.space}/resources/v1/modeler/dslc/maturity/getNextStates`;
@@ -954,7 +956,7 @@ function Re(e, t, n = void 0, s = void 0) {
954
956
  }
955
957
  });
956
958
  }
957
- function xe(e, t, n, s = void 0, i = void 0) {
959
+ function Re(e, t, n, s = void 0, i = void 0) {
958
960
  return new Promise((c) => {
959
961
  if (e.token === "" && T(e), t !== void 0 && t !== "" && t !== null) {
960
962
  const o = `${e.space}/resources/v1/modeler/dslc/maturity/changeState`;
@@ -1360,16 +1362,16 @@ function He(e, t, n = void 0, s = void 0) {
1360
1362
  Accept: "application/json"
1361
1363
  },
1362
1364
  data: JSON.stringify(l),
1363
- onComplete(f) {
1364
- JSON.parse(f);
1365
- const u = {};
1365
+ onComplete(u) {
1366
+ JSON.parse(u);
1367
+ const f = {};
1366
1368
  setTimeout(() => {
1367
1369
  H(
1368
1370
  e,
1369
1371
  o,
1370
1372
  (g) => {
1371
1373
  const h = g.data[0].dataelements.title, S = g.data[0].dataelements.fileExtension !== void 0 ? g.data[0].dataelements.fileExtension : "", _ = g.data[0].relateddata.ownerInfo[0].dataelements.name;
1372
- u.name = h, u.ext = S, u.createBy = _, t.info = { ...u }, ie(
1374
+ f.name = h, f.ext = S, f.createBy = _, t.info = { ...f }, ie(
1373
1375
  e,
1374
1376
  t,
1375
1377
  (y) => {
@@ -1387,9 +1389,9 @@ function He(e, t, n = void 0, s = void 0) {
1387
1389
  );
1388
1390
  }, 2e3);
1389
1391
  },
1390
- onFailure(f, u) {
1391
- const g = f;
1392
- g.msg = u.errormsg, g.errCode = u.errorcode, console.log("❌ sendDirectMessage => ", g), s && s(g);
1392
+ onFailure(u, f) {
1393
+ const g = u;
1394
+ g.msg = f.errormsg, g.errCode = f.errorcode, console.log("❌ sendDirectMessage => ", g), s && s(g);
1393
1395
  }
1394
1396
  });
1395
1397
  }
@@ -1401,7 +1403,7 @@ function ie(e, t, n = void 0, s = void 0) {
1401
1403
  }, o = `${c.baseUrl}${c.uri}`, a = {
1402
1404
  "Content-Type": "application/json",
1403
1405
  Accept: "application/json,text/javascript,*/*"
1404
- }, r = x(), d = {
1406
+ }, r = R(), d = {
1405
1407
  with_indexing_date: !0,
1406
1408
  with_synthesis: !0,
1407
1409
  with_nls: !1,
@@ -1471,8 +1473,8 @@ function ie(e, t, n = void 0, s = void 0) {
1471
1473
  n(l);
1472
1474
  },
1473
1475
  onFailure(p, l) {
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);
1476
+ const u = p;
1477
+ 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);
1476
1478
  }
1477
1479
  });
1478
1480
  }
@@ -1507,8 +1509,8 @@ function ze(e, t, n = void 0, s = void 0) {
1507
1509
  n && n(p);
1508
1510
  },
1509
1511
  onFailure(p, l) {
1510
- const f = p;
1511
- f.msg = l.errormsg, f.errCode = l.errorcode, console.log("❌ sendDirectMessage => ", f), s && s(f);
1512
+ const u = p;
1513
+ u.msg = l.errormsg, u.errCode = l.errorcode, console.log("❌ sendDirectMessage => ", u), s && s(u);
1512
1514
  }
1513
1515
  });
1514
1516
  }
@@ -1623,21 +1625,21 @@ function et(e, t = void 0, n = void 0) {
1623
1625
  },
1624
1626
  onComplete(a, r, d) {
1625
1627
  const l = JSON.parse(a).result;
1626
- let f = 0;
1627
- l.forEach((u) => {
1628
+ let u = 0;
1629
+ l.forEach((f) => {
1628
1630
  const g = {
1629
- description: u.description,
1630
- id: u.id,
1631
- title: u.title,
1632
- owner: u.owner,
1633
- role: u.role,
1634
- access: u.access
1631
+ description: f.description,
1632
+ id: f.id,
1633
+ title: f.title,
1634
+ owner: f.owner,
1635
+ role: f.role,
1636
+ access: f.access
1635
1637
  };
1636
1638
  ae(
1637
1639
  e,
1638
- u.id,
1640
+ f.id,
1639
1641
  (h) => {
1640
- f++, g.members = h, c.push(g), f === l.length && t && t(c);
1642
+ u++, g.members = h, c.push(g), u === l.length && t && t(c);
1641
1643
  },
1642
1644
  (h) => n(h)
1643
1645
  );
@@ -1716,7 +1718,7 @@ function nt(e, t, n = void 0, s = void 0) {
1716
1718
  oe(
1717
1719
  a.users,
1718
1720
  (p) => {
1719
- p !== void 0 && (r.id_msg = p.id, d = !0, P(e, r));
1721
+ p !== void 0 && (r.id_msg = p.id, d = !0, x(e, r));
1720
1722
  },
1721
1723
  (p) => {
1722
1724
  d = !1, console.log("_3dSwym_findCommunityToInstantMSG callback", p), s && s(p), r.id_msg = "";
@@ -1732,13 +1734,13 @@ function nt(e, t, n = void 0, s = void 0) {
1732
1734
  },
1733
1735
  data: JSON.stringify(a),
1734
1736
  type: "json",
1735
- onComplete(l, f, u) {
1737
+ onComplete(l, u, f) {
1736
1738
  const g = l;
1737
- g.reponse = JSON.parse(u.response), g.status = u.status, n && n(g), r.id_msg = g.result.id, P(e, r);
1739
+ g.reponse = JSON.parse(f.response), g.status = f.status, n && n(g), r.id_msg = g.result.id, x(e, r);
1738
1740
  },
1739
- onFailure(l, f, u) {
1741
+ onFailure(l, u, f) {
1740
1742
  const g = l;
1741
- g.msg = f.errormsg, g.status = f.status, s && s(g);
1743
+ g.msg = u.errormsg, g.status = u.status, s && s(g);
1742
1744
  }
1743
1745
  });
1744
1746
  });
@@ -1756,13 +1758,13 @@ function oe(e, t, n, s) {
1756
1758
  onComplete(o) {
1757
1759
  const a = JSON.parse(o), r = [];
1758
1760
  a.result.forEach((l) => {
1759
- l.users = l.users.sort((f, u) => f.login.localeCompare(u.login)), l.users.length === t.length && r.push(l);
1761
+ l.users = l.users.sort((u, f) => u.login.localeCompare(f.login)), l.users.length === t.length && r.push(l);
1760
1762
  });
1761
1763
  const d = t.sort(), p = r.find((l) => {
1762
- const f = [];
1763
- return l.users.forEach((u) => {
1764
- f.push(u.login);
1765
- }), JSON.stringify(f) === JSON.stringify(d);
1764
+ const u = [];
1765
+ return l.users.forEach((f) => {
1766
+ u.push(f.login);
1767
+ }), JSON.stringify(u) === JSON.stringify(d);
1766
1768
  });
1767
1769
  n && p !== void 0 ? n(p) : (s || p === void 0) && s(p);
1768
1770
  },
@@ -1773,7 +1775,7 @@ function oe(e, t, n, s) {
1773
1775
  });
1774
1776
  });
1775
1777
  }
1776
- function P(e, t, n = void 0, s = void 0) {
1778
+ function x(e, t, n = void 0, s = void 0) {
1777
1779
  const i = {
1778
1780
  base: e.space,
1779
1781
  uri: "/api/community",
@@ -1855,13 +1857,13 @@ function st(e, t, n = void 0, s = void 0) {
1855
1857
  headers: d,
1856
1858
  data: JSON.stringify(a),
1857
1859
  type: "json",
1858
- onComplete(p, l, f) {
1859
- const u = JSON.parse(p);
1860
- u.status = f.status, u.response = f.response, n && n(u);
1860
+ onComplete(p, l, u) {
1861
+ const f = JSON.parse(p);
1862
+ f.status = u.status, f.response = u.response, n && n(f);
1861
1863
  },
1862
- onFailure(p, l, f) {
1863
- const u = p;
1864
- u.status = l.status, u.response = l.errormsg, s && s(u);
1864
+ onFailure(p, l, u) {
1865
+ const f = p;
1866
+ f.status = l.status, f.response = l.errormsg, s && s(f);
1865
1867
  }
1866
1868
  });
1867
1869
  });
@@ -2250,9 +2252,9 @@ function _t(e, t = void 0, n = void 0) {
2250
2252
  });
2251
2253
  }
2252
2254
  export {
2253
- x as UUID,
2255
+ R as UUID,
2254
2256
  _t as _3DSearch_usersGroup,
2255
- Pe as _3DSpace_Create_Doc,
2257
+ xe as _3DSpace_Create_Doc,
2256
2258
  Ge as _3DSpace_bookmark_addSubsciptions,
2257
2259
  Je as _3DSpace_bookmark_newWorkspace,
2258
2260
  T as _3DSpace_csrf,
@@ -2268,10 +2270,10 @@ export {
2268
2270
  N as _3DSpace_get_securityContexts,
2269
2271
  F as _3DSpace_get_ticket,
2270
2272
  Me as _3DSpace_lifecycle_changeRevision,
2271
- xe as _3DSpace_lifecycle_changeState,
2273
+ Re as _3DSpace_lifecycle_changeState,
2272
2274
  De as _3DSpace_lifecycle_getGraph,
2273
2275
  Le as _3DSpace_lifecycle_getNextRevision,
2274
- Re as _3DSpace_lifecycle_getNextStates,
2276
+ Pe as _3DSpace_lifecycle_getNextStates,
2275
2277
  nt as _3DSwym_buildDirectMessage,
2276
2278
  it as _3DSwym_deleteIdea,
2277
2279
  oe as _3DSwym_findCommunityToInstantMSG,
@@ -2286,7 +2288,7 @@ export {
2286
2288
  ct as _3DSwym_get_findUser,
2287
2289
  C as _3DSwym_get_version,
2288
2290
  st as _3DSwym_postIdea,
2289
- P as _3DSwym_sendMessageData,
2291
+ x as _3DSwym_sendMessageData,
2290
2292
  be as _AppMngt_get_info_user,
2291
2293
  Oe as _AppMngt_get_users,
2292
2294
  ht as _Iterop_AddOrRemoveRows,