@beam3_dev/api_module 0.0.290 → 0.0.291

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,6 +1,6 @@
1
1
  import { v4 as V } from "uuid";
2
2
  import { DateTime as O } from "luxon";
3
- import { requirejs as $, widget as A } from "@widget-lab/3ddashboard-utils";
3
+ import { requirejs as $, widget as L } from "@widget-lab/3ddashboard-utils";
4
4
  function Y() {
5
5
  return V();
6
6
  }
@@ -155,7 +155,7 @@ function Re(e, t = void 0) {
155
155
  $(["DS/TagNavigatorProxy/TagNavigatorProxy"], (n) => {
156
156
  let s;
157
157
  s === void 0 && (s = n.createProxy({
158
- widgetId: A.id,
158
+ widgetId: L.id,
159
159
  filteringMode: "WithFilteringServices"
160
160
  }), t !== void 0 && s.addEvent("onFilterSubjectsChange", t)), s.setSubjectsTags(e);
161
161
  });
@@ -171,7 +171,7 @@ async function ke(e, t = void 0, n = void 0) {
171
171
  await $(
172
172
  ["DS/i3DXCompassServices/i3DXCompassServices"],
173
173
  (s) => {
174
- (!e || e === "") && (e = A.getValue("PlatFormInstanceId")), (!e || e === "") && (e = void 0), t && t(
174
+ (!e || e === "") && (e = L.getValue("PlatFormInstanceId")), (!e || e === "") && (e = void 0), t && t(
175
175
  s.getPlatformServices({
176
176
  platformId: e,
177
177
  onComplete: t,
@@ -209,7 +209,7 @@ function ve(e, t = void 0, n = void 0) {
209
209
  });
210
210
  }
211
211
  }
212
- function P(e, t = void 0, n = void 0) {
212
+ function M(e, t = void 0, n = void 0) {
213
213
  if (e.tenant) {
214
214
  const s = `https://${e.tenant}-eu1-apps.3dexperience.3ds.com/enovia/resources/AppsMngt/api/v1/services?tenant=${e.tenant}&cors=true&xrequestedwith=xmlhttprequest`;
215
215
  m(s, {
@@ -513,7 +513,7 @@ var se = function(e, t, n, s) {
513
513
  };
514
514
  x.decode = x.parse = se;
515
515
  x.encode = x.stringify = ie;
516
- async function L(e, t = void 0, n = void 0, s = void 0) {
516
+ async function J(e, t = void 0, n = void 0, s = void 0) {
517
517
  const i = e.space;
518
518
  if (t === void 0) {
519
519
  console.log("Le paramètre docid est obligatoire");
@@ -554,7 +554,7 @@ async function Xe(e, t = void 0, n = void 0, s = void 0) {
554
554
  }
555
555
  });
556
556
  }
557
- function F(e, t = void 0, n = void 0) {
557
+ function I(e, t = void 0, n = void 0) {
558
558
  if (e.objID && e.objID !== "") {
559
559
  let s = `${e.space}/resources/v1/modeler/documents/${e.objID}`;
560
560
  m(s, {
@@ -598,7 +598,7 @@ function b(e, t = void 0, n = void 0) {
598
598
  }
599
599
  function k(e, t = void 0, n = void 0) {
600
600
  let s = e.space + `/resources/v1/modeler/documents/${e.objID}/files/DownloadTicket`;
601
- F(
601
+ I(
602
602
  e,
603
603
  (i) => {
604
604
  m(s, {
@@ -642,7 +642,7 @@ function We(e, t, n = void 0, s = void 0, i = void 0) {
642
642
  }
643
643
  });
644
644
  }
645
- function M(e, t, n, s, i, r = void 0, a = void 0) {
645
+ function G(e, t, n, s, i, r = void 0, a = void 0) {
646
646
  const o = () => ae(
647
647
  e,
648
648
  t,
@@ -653,7 +653,7 @@ function M(e, t, n, s, i, r = void 0, a = void 0) {
653
653
  r,
654
654
  a
655
655
  );
656
- e.token ? o() : F(
656
+ e.token ? o() : I(
657
657
  e,
658
658
  t,
659
659
  (c) => {
@@ -780,19 +780,19 @@ async function Ye(e, t = void 0, n = void 0, s = void 0, i = void 0, r = void 0)
780
780
  try {
781
781
  if (l = JSON.parse(l), l?.ticket) {
782
782
  const { ticket: y, actionurl: _, jobticket: S } = l;
783
- J(
783
+ K(
784
784
  { dataelements: { ticket: y, ticketURL: _ } },
785
785
  n,
786
786
  t,
787
787
  (w) => {
788
- const U = new DOMParser().parseFromString(
788
+ const R = new DOMParser().parseFromString(
789
789
  w,
790
790
  "text/html"
791
- ).body.firstChild.querySelector("input").getAttributeNode("value").value, E = `https://${a.toLowerCase()}-eu1-space.3dexperience.3ds.com/enovia/resources/enocsmrest/collabspaces/${o}/contents?receipt=${encodeURIComponent(
792
- U
791
+ ).body.firstChild.querySelector("input").getAttributeNode("value").value, v = `https://${a.toLowerCase()}-eu1-space.3dexperience.3ds.com/enovia/resources/enocsmrest/collabspaces/${o}/contents?receipt=${encodeURIComponent(
792
+ R
793
793
  )}`;
794
- let X = /(?:\.([^.]+))?$/.exec(t)[1];
795
- const W = JSON.stringify({
794
+ let W = /(?:\.([^.]+))?$/.exec(t)[1];
795
+ const D = JSON.stringify({
796
796
  actions: [],
797
797
  businessobj: {
798
798
  description: e?.description,
@@ -803,27 +803,28 @@ async function Ye(e, t = void 0, n = void 0, s = void 0, i = void 0, r = void 0)
803
803
  modified: "",
804
804
  owner: {},
805
805
  thumbnail: "",
806
- title: X ? t.split(".").slice(0, -1).join(".") : t,
806
+ title: W ? t.split(".").slice(0, -1).join(".") : t,
807
807
  type: {}
808
808
  },
809
809
  collabspace: o
810
810
  });
811
- m(E, {
811
+ m(v, {
812
812
  method: "POST",
813
813
  headers: {
814
814
  Accept: "application/json",
815
815
  "Content-Type": "application/json;charset=UTF-8",
816
816
  "X-DS-CSRFTOKEN": p
817
817
  },
818
- data: W,
818
+ data: D,
819
819
  type: "json",
820
- onComplete(R, Ce, Te) {
821
- s && s(R);
820
+ onComplete(F, Ce, Te) {
821
+ s && s(F);
822
822
  },
823
- onFailure(R) {
823
+ onFailure(F) {
824
824
  console.warn(
825
- "_3DSpace_Upload_Doc | pushFileInFcs | onFailure"
826
- ), i && i(R);
825
+ "_3DSpace_Upload_Doc | pushFileInFcs | onFailure",
826
+ { url: v, bodyRequest: D, err: F }
827
+ ), i && i(F);
827
828
  }
828
829
  });
829
830
  },
@@ -854,12 +855,12 @@ async function Ye(e, t = void 0, n = void 0, s = void 0, i = void 0, r = void 0)
854
855
  );
855
856
  }
856
857
  async function He(e, t, n, s = void 0, i = void 0) {
857
- e.space, e.token, e.ctx, L(
858
+ e.space, e.token, e.ctx, J(
858
859
  e,
859
860
  t,
860
861
  (r) => {
861
862
  const a = r.data[0].relateddata.files[0].id, o = r.data[0].dataelements.secondaryTitle && r.data[0].dataelements.secondaryTitle !== "" ? r.data[0].dataelements.secondaryTitle : r.data[0].dataelements.title;
862
- M(
863
+ G(
863
864
  e,
864
865
  t,
865
866
  a,
@@ -883,7 +884,7 @@ async function ze(e, t, n, s, i = void 0, r = void 0) {
883
884
  e,
884
885
  (a) => {
885
886
  a?.items >= 1 && a.data.forEach((o) => {
886
- J(
887
+ K(
887
888
  o,
888
889
  t,
889
890
  n,
@@ -934,7 +935,7 @@ function oe(e, t = void 0, n = void 0) {
934
935
  } else
935
936
  console.log("Error de credentials", e);
936
937
  }
937
- function J(e, t, n, s = void 0, i = void 0, r = void 0) {
938
+ function K(e, t, n, s = void 0, i = void 0, r = void 0) {
938
939
  let a = new FormData();
939
940
  t instanceof Blob || (t = new Blob([t], {
940
941
  type: "text/plain"
@@ -999,7 +1000,7 @@ function re(e, t, n, s = void 0, i = void 0, r = void 0) {
999
1000
  }
1000
1001
  });
1001
1002
  }
1002
- function I(e, t = void 0, n = void 0, s = void 0, i = void 0, r = void 0, a = !1) {
1003
+ function U(e, t = void 0, n = void 0, s = void 0, i = void 0, r = void 0, a = !1) {
1003
1004
  const o = `${e.space}/resources/modeler/pno/person?current=true&select=preferredcredentials&select=collabspaces`;
1004
1005
  m(o, {
1005
1006
  method: "GET",
@@ -1048,7 +1049,7 @@ function I(e, t = void 0, n = void 0, s = void 0, i = void 0, r = void 0, a = !1
1048
1049
  }
1049
1050
  });
1050
1051
  }
1051
- async function G(e, t = void 0, n = void 0) {
1052
+ async function B(e, t = void 0, n = void 0) {
1052
1053
  return (!e.objID || e.objID === "") && (console.warn(
1053
1054
  "_3DSpace_download_doc() / Le paramètre objectId est obligatoire"
1054
1055
  ), n && n(
@@ -1234,7 +1235,7 @@ function et(e, t, n = void 0, s = void 0) {
1234
1235
  return new Promise((i) => {
1235
1236
  if (e.token === "" && b(e), t !== void 0 && t !== "" && t !== null) {
1236
1237
  const r = `${e.space}/resources/v1/dslc/versiongraph?withThumbnail=0&withIsLastVersion=0&withAttributes=0&withCopyFrom=0&tenant=${e.tenant}`;
1237
- I(
1238
+ U(
1238
1239
  e.space,
1239
1240
  "ESPACE COMMUN",
1240
1241
  ["VPLMProjectLeader", "VPLMCreator"],
@@ -1275,7 +1276,7 @@ function tt(e, t, n = void 0, s = void 0) {
1275
1276
  return new Promise((i) => {
1276
1277
  if (e.token === "" && b(e), t !== void 0 && t !== "" && t !== null) {
1277
1278
  const r = `${e.space}/resources/lifecycle/revise/prepare_revise_maskattributes?tenant=${e.tenant}`;
1278
- I(
1279
+ U(
1279
1280
  e.space,
1280
1281
  "ESPACE COMMUN",
1281
1282
  ["VPLMProjectLeader", "VPLMCreator"],
@@ -1322,7 +1323,7 @@ function nt(e, t, n, s = void 0, i = void 0) {
1322
1323
  return new Promise((r) => {
1323
1324
  if (e.token === "" && b(e), t !== void 0 && t !== "" && t !== null) {
1324
1325
  const a = `${e.space}/resources/lifecycle/revise/major?tenant=${e.tenant}`;
1325
- I(
1326
+ U(
1326
1327
  e.space,
1327
1328
  "ESPACE COMMUN",
1328
1329
  ["VPLMProjectLeader", "VPLMCreator"],
@@ -1521,12 +1522,12 @@ async function ct(e, t, n = void 0, s = void 0) {
1521
1522
  }
1522
1523
  function dt(e, t, n, s = void 0, i = void 0) {
1523
1524
  const r = new Blob([JSON.stringify(t)], { type: "text/plain" });
1524
- F(
1525
+ I(
1525
1526
  e,
1526
1527
  n,
1527
1528
  (a) => {
1528
1529
  const o = a.data[0].relateddata.files[0].id, c = a.data[0].dataelements.secondaryTitle !== "" ? a.data[0].dataelements.secondaryTitle : a.data[0].dataelements.title;
1529
- M(
1530
+ G(
1530
1531
  e,
1531
1532
  n,
1532
1533
  o,
@@ -1542,10 +1543,10 @@ function dt(e, t, n, s = void 0, i = void 0) {
1542
1543
  }
1543
1544
  );
1544
1545
  }
1545
- let K, B;
1546
- const v = [];
1546
+ let q, E;
1547
+ const A = [];
1547
1548
  async function ut(e, t = void 0, n = void 0) {
1548
- e.objID && e.objID !== "" ? F(
1549
+ e.objID && e.objID !== "" ? I(
1549
1550
  e,
1550
1551
  (s) => {
1551
1552
  t && t(s);
@@ -1564,7 +1565,7 @@ async function ut(e, t = void 0, n = void 0) {
1564
1565
  );
1565
1566
  }
1566
1567
  async function pt(e, t = void 0, n = void 0) {
1567
- console.log("getDatasByTenant (getDocuments)", e), await G(
1568
+ console.log("getDatasByTenant (getDocuments)", e), await B(
1568
1569
  e,
1569
1570
  (s) => {
1570
1571
  const i = {};
@@ -1582,11 +1583,11 @@ function lt(e, t = void 0, n = void 0) {
1582
1583
  return;
1583
1584
  }
1584
1585
  e.objIds.forEach((i, r) => {
1585
- G(
1586
+ B(
1586
1587
  e,
1587
1588
  i.objID,
1588
1589
  (a) => {
1589
- s.push({ [i.name]: a }), i.name === "dbProjets" && (K = a.affaires.map((o) => o.objectID), pe(e, B)), r === e.objIds.length - 1 && (t && t(s), delete e.objIds, delete e.datas);
1590
+ s.push({ [i.name]: a }), i.name === "dbProjets" && (q = a.affaires.map((o) => o.objectID), pe(e, E)), r === e.objIds.length - 1 && (t && t(s), delete e.objIds, delete e.datas);
1590
1591
  }
1591
1592
  );
1592
1593
  });
@@ -1594,10 +1595,10 @@ function lt(e, t = void 0, n = void 0) {
1594
1595
  function pe(e, t, n = void 0, s = void 0) {
1595
1596
  ce(
1596
1597
  e,
1597
- K,
1598
+ q,
1598
1599
  (i) => {
1599
1600
  const r = [...t];
1600
- r.find((a) => a.objectID === i.objectId).data = i.data, B = r, v.push(i.data), n && n(v);
1601
+ r.find((a) => a.objectID === i.objectId).data = i.data, E = r, A.push(i.data), n && n(A);
1601
1602
  },
1602
1603
  (i) => {
1603
1604
  s && (s(i), console.log(i));
@@ -1611,7 +1612,7 @@ const le = "FA35FB9B177A280065800EA0000F599C", fe = [
1611
1612
  "usersgroup",
1612
1613
  "3dplan",
1613
1614
  "dashboard"
1614
- ], q = {
1615
+ ], X = {
1615
1616
  how: "ds6w:how",
1616
1617
  what: "ds6w:what",
1617
1618
  when: "ds6w:when",
@@ -1637,7 +1638,7 @@ function ft(e, t, n = void 0, s = void 0) {
1637
1638
  uri: `pid://${a}`
1638
1639
  }
1639
1640
  ],
1640
- predicate: q[o],
1641
+ predicate: X[o],
1641
1642
  object: {
1642
1643
  literal: c
1643
1644
  }
@@ -1655,7 +1656,7 @@ function ft(e, t, n = void 0, s = void 0) {
1655
1656
  JSON.parse(f);
1656
1657
  const l = {};
1657
1658
  setTimeout(() => {
1658
- L(
1659
+ J(
1659
1660
  e,
1660
1661
  a,
1661
1662
  (h) => {
@@ -1780,7 +1781,7 @@ function mt(e, t, n = void 0, s = void 0) {
1780
1781
  uri: `pid://${i}`
1781
1782
  }
1782
1783
  ],
1783
- predicate: q[r],
1784
+ predicate: X[r],
1784
1785
  object: {
1785
1786
  literal: a
1786
1787
  }
@@ -2007,7 +2008,7 @@ function wt(e, t, n = void 0, s = void 0) {
2007
2008
  ye(
2008
2009
  c.users,
2009
2010
  (p) => {
2010
- p !== void 0 && (d.id_msg = p.id, u = !0, D(e, d));
2011
+ p !== void 0 && (d.id_msg = p.id, u = !0, P(e, d));
2011
2012
  },
2012
2013
  (p) => {
2013
2014
  u = !1, console.log("_3dSwym_findCommunityToInstantMSG callback", p), s && s(p), d.id_msg = "";
@@ -2025,7 +2026,7 @@ function wt(e, t, n = void 0, s = void 0) {
2025
2026
  type: "json",
2026
2027
  onComplete(f, l, h) {
2027
2028
  const g = f;
2028
- g.reponse = JSON.parse(h.response), g.status = h.status, n && n(g), d.id_msg = g.result.id, D(e, d);
2029
+ g.reponse = JSON.parse(h.response), g.status = h.status, n && n(g), d.id_msg = g.result.id, P(e, d);
2029
2030
  },
2030
2031
  onFailure(f, l, h) {
2031
2032
  const g = f;
@@ -2064,7 +2065,7 @@ function ye(e, t, n, s) {
2064
2065
  });
2065
2066
  });
2066
2067
  }
2067
- function D(e, t, n = void 0, s = void 0) {
2068
+ function P(e, t, n = void 0, s = void 0) {
2068
2069
  const i = {
2069
2070
  base: e._3DSwym,
2070
2071
  uri: "/api/community",
@@ -2347,7 +2348,7 @@ function Nt(e, t, n = void 0, s = void 0) {
2347
2348
  d.push(w.response.result);
2348
2349
  else {
2349
2350
  const T = w.response.result.find(
2350
- (U) => U.title.includes(c)
2351
+ (R) => R.title.includes(c)
2351
2352
  );
2352
2353
  if (T) {
2353
2354
  n(T);
@@ -2556,13 +2557,13 @@ function Ut(e, t = void 0, n = void 0) {
2556
2557
  m(o, d);
2557
2558
  }
2558
2559
  function Rt(e, t = void 0, n = void 0) {
2559
- e.tenant && P(e, (s) => {
2560
+ e.tenant && M(e, (s) => {
2560
2561
  const i = s.services.find((r) => r.id === "businessprocess")?.url + "/api/v2";
2561
2562
  return t && t(i), i;
2562
2563
  });
2563
2564
  }
2564
2565
  function jt(e, t = void 0, n = void 0) {
2565
- e.tenant && P(e, (s) => {
2566
+ e.tenant && M(e, (s) => {
2566
2567
  const i = s.services.find(
2567
2568
  (o) => o.id === "3dpassport"
2568
2569
  )?.url, r = s.services.find((o) => o.id === "businessprocess")?.url + "/api/v2", a = `${i}/login/?service=${r}/auth/cas`;
@@ -2793,7 +2794,7 @@ function Wt(e, t = void 0, n = void 0) {
2793
2794
  const a = Z();
2794
2795
  console.log("platformeInfo", a);
2795
2796
  }
2796
- I(
2797
+ U(
2797
2798
  e,
2798
2799
  "Common space",
2799
2800
  ["VPLMProjectLeader", "VPLMCreator"],
@@ -2875,16 +2876,16 @@ export {
2875
2876
  at as _3DSpace_bookmark_addSubsciptions,
2876
2877
  it as _3DSpace_bookmark_newWorkspace,
2877
2878
  b as _3DSpace_csrf,
2878
- G as _3DSpace_download_doc,
2879
+ B as _3DSpace_download_doc,
2879
2880
  ce as _3DSpace_download_multidoc,
2880
- M as _3DSpace_file_update,
2881
+ G as _3DSpace_file_update,
2881
2882
  ae as _3DSpace_file_update_csr,
2882
2883
  We as _3DSpace_file_url_csr,
2883
- F as _3DSpace_get_csrf,
2884
- L as _3DSpace_get_docInfo,
2884
+ I as _3DSpace_get_csrf,
2885
+ J as _3DSpace_get_docInfo,
2885
2886
  de as _3DSpace_get_downloadTicket_multidoc,
2886
2887
  Xe as _3DSpace_get_multiDocInfo,
2887
- I as _3DSpace_get_securityContexts,
2888
+ U as _3DSpace_get_securityContexts,
2888
2889
  k as _3DSpace_get_ticket,
2889
2890
  nt as _3DSpace_lifecycle_changeRevision,
2890
2891
  Ze as _3DSpace_lifecycle_changeState,
@@ -2911,7 +2912,7 @@ export {
2911
2912
  It as _3DSwym_get_findUser,
2912
2913
  Tt as _3DSwym_postIdea,
2913
2914
  Ct as _3DSwym_postIdeaTemplate,
2914
- D as _3DSwym_sendMessageData,
2915
+ P as _3DSwym_sendMessageData,
2915
2916
  Le as _AppMngt_get_info_user,
2916
2917
  Pe as _AppMngt_get_users,
2917
2918
  Pt as _Iterop_AddOrRemoveRows,
@@ -2931,7 +2932,7 @@ export {
2931
2932
  ve as _getMe,
2932
2933
  Z as _getPlateformInfos,
2933
2934
  ke as _getPlatformServices,
2934
- P as _getServiceUrl,
2935
+ M as _getServiceUrl,
2935
2936
  De as _getServiceUrl_3DPassport,
2936
2937
  Rt as _getServiceUrl_Iterop,
2937
2938
  m as _httpCallAuthenticated,