@beam3_dev/api_module 0.0.69 → 0.0.71

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
@@ -428,7 +428,7 @@ function C(e, t = void 0, n = void 0) {
428
428
  f(s, {
429
429
  onComplete(o, c, r) {
430
430
  const a = JSON.parse(o);
431
- console.log("_3DSpace_csrf() / info => ", a), t && t(a.csrf.value);
431
+ t && t(a.csrf.value);
432
432
  },
433
433
  onFailure(o, c, r) {
434
434
  n && n({ response: o, headers: c, xhr: r });
@@ -442,18 +442,14 @@ function U(e, t = void 0, n = void 0) {
442
442
  k(
443
443
  e,
444
444
  (o) => {
445
- console.log(
446
- "_3DSpace_get_ticket / onComplete / ☠️ info => ",
447
- o,
448
- e.token
449
- ), f(s, {
445
+ f(s, {
450
446
  method: "PUT",
451
447
  headers: {
452
448
  ENO_CSRF_TOKEN: e.token
453
449
  },
454
450
  onComplete(c) {
455
451
  const a = JSON.parse(c).data[0].dataelements.ticketURL;
456
- console.log("le ticket est dans la callback"), t && t(a);
452
+ t && t(a);
457
453
  },
458
454
  onFailure(c, r) {
459
455
  console.warn("☠️ error => ", c, r), n && n(c, r);
@@ -697,29 +693,23 @@ async function R(e, t = void 0, n = void 0) {
697
693
  }
698
694
  ), console.warn(
699
695
  "_3DSpace_download_doc() / Le paramètre token est obligatoire"
700
- )), console.log("_3DSpace_download_doc / credentials", e), new Promise((o, c) => {
696
+ )), new Promise((o, c) => {
701
697
  U(
702
698
  e,
703
699
  (r) => {
704
- setTimeout(() => {
705
- f(r, {
706
- headers: {
707
- // ENO_CSRF_TOKEN: credentials.token,
708
- "Content-Type": "application/json",
709
- Accept: "application/json"
710
- },
711
- onComplete(i) {
712
- const d = JSON.parse(i);
713
- console.log(
714
- "_3DSpace_download_doc / reponse (liste d'objetsID) ",
715
- d
716
- ), t && t(d), o(d);
717
- },
718
- onFailure(i, d, l) {
719
- n && (console.log("error http", i), n({ msg: JSON.parse(i), headers: d, xhr: l }), c({ msg: JSON.parse(i), headers: d, xhr: l }));
720
- }
721
- });
722
- }, 1e3);
700
+ f(r, {
701
+ headers: {
702
+ "Content-Type": "application/json",
703
+ Accept: "application/json"
704
+ },
705
+ onComplete(i) {
706
+ const d = JSON.parse(i);
707
+ t && t(d), o(d);
708
+ },
709
+ onFailure(i, d, l) {
710
+ n && (console.log("error http", i), n({ msg: JSON.parse(i), headers: d, xhr: l }), c({ msg: JSON.parse(i), headers: d, xhr: l }));
711
+ }
712
+ });
723
713
  },
724
714
  (r) => {
725
715
  n && n(r), console.log("*_3dspace_download_doc / error file URL *", r), c(r);
@@ -917,7 +907,7 @@ function Ue(e, t, n = void 0, s = void 0) {
917
907
  }
918
908
  });
919
909
  }
920
- function $e(e, t, n = void 0, s = void 0) {
910
+ function je(e, t, n = void 0, s = void 0) {
921
911
  return new Promise((o) => {
922
912
  if (e.token === "" && C(e), t !== void 0 && t !== "" && t !== null) {
923
913
  const c = `${e.space}/resources/lifecycle/revise/prepare_revise_maskattributes?tenant=${e.tenant}`;
@@ -964,7 +954,7 @@ function $e(e, t, n = void 0, s = void 0) {
964
954
  }
965
955
  });
966
956
  }
967
- function je(e, t, n, s = void 0, o = void 0) {
957
+ function $e(e, t, n, s = void 0, o = void 0) {
968
958
  return new Promise((c) => {
969
959
  if (e.token === "" && C(e), t !== void 0 && t !== "" && t !== null) {
970
960
  const r = `${e.space}/resources/lifecycle/revise/major?tenant=${e.tenant}`;
@@ -1086,7 +1076,7 @@ function ve(e, t, n, s = void 0, o = void 0) {
1086
1076
  );
1087
1077
  }
1088
1078
  let v, P;
1089
- const $ = [];
1079
+ const j = [];
1090
1080
  async function Pe(e, t = void 0, n = void 0) {
1091
1081
  e.objID && e.objID !== "" ? (console.log("obj est présent"), k(
1092
1082
  e,
@@ -1120,12 +1110,16 @@ async function xe(e, t = void 0, n = void 0) {
1120
1110
  }
1121
1111
  function Me(e, t = void 0, n = void 0) {
1122
1112
  const s = [];
1113
+ if (!e.objIds && !Array.isArray(e.objIds) && e.objIds.length === 0) {
1114
+ console.warn("la liste est vide ou n'est pas un tableau");
1115
+ return;
1116
+ }
1123
1117
  e.objIds.forEach((o, c) => {
1124
1118
  R(
1125
1119
  e,
1126
- o.objId,
1120
+ o.objID,
1127
1121
  (r) => {
1128
- s.push({ [o.name]: r }), o.name === "dbProjets" && (v = r.affaires.map((a) => a.objectID), B(e, P)), c === e.objIds.length - 1 && t && t(s);
1122
+ s.push({ [o.name]: r }), o.name === "dbProjets" && (v = r.affaires.map((a) => a.objectID), B(e, P)), c === e.objIds.length - 1 && (t && t(s), delete e.objIds, delete e.datas);
1129
1123
  }
1130
1124
  );
1131
1125
  });
@@ -1136,7 +1130,7 @@ function B(e, t, n = void 0, s = void 0) {
1136
1130
  v,
1137
1131
  (o) => {
1138
1132
  const c = [...t];
1139
- c.find((r) => r.objectID === o.objectId).data = o.data, P = c, $.push(o.data), n && n($);
1133
+ c.find((r) => r.objectID === o.objectId).data = o.data, P = c, j.push(o.data), n && n(j);
1140
1134
  },
1141
1135
  (o) => {
1142
1136
  s && (s(o), console.log(o));
@@ -1546,7 +1540,7 @@ function Ve(e, t, n = void 0, s = void 0) {
1546
1540
  Z(
1547
1541
  a.users,
1548
1542
  (l) => {
1549
- l !== void 0 && (i.id_msg = l.id, d = !0, j(e, i));
1543
+ l !== void 0 && (i.id_msg = l.id, d = !0, $(e, i));
1550
1544
  },
1551
1545
  (l) => {
1552
1546
  d = !1, console.log("_3dSwym_findCommunityToInstantMSG callback", l), s && s(l), i.id_msg = "";
@@ -1564,7 +1558,7 @@ function Ve(e, t, n = void 0, s = void 0) {
1564
1558
  type: "json",
1565
1559
  onComplete(p, u, m) {
1566
1560
  const g = p;
1567
- g.reponse = JSON.parse(m.response), g.status = m.status, n && n(g), i.id_msg = g.result.id, j(e, i);
1561
+ g.reponse = JSON.parse(m.response), g.status = m.status, n && n(g), i.id_msg = g.result.id, $(e, i);
1568
1562
  },
1569
1563
  onFailure(p, u, m) {
1570
1564
  const g = p;
@@ -1603,7 +1597,7 @@ function Z(e, t, n, s) {
1603
1597
  });
1604
1598
  });
1605
1599
  }
1606
- function j(e, t, n = void 0, s = void 0) {
1600
+ function $(e, t, n = void 0, s = void 0) {
1607
1601
  const o = {
1608
1602
  base: e.space,
1609
1603
  uri: "/api/community",
@@ -1907,10 +1901,10 @@ export {
1907
1901
  V as _3DSpace_get_downloadTicket_multidoc,
1908
1902
  b as _3DSpace_get_securityContexts,
1909
1903
  U as _3DSpace_get_ticket,
1910
- je as _3DSpace_lifecycle_changeRevision,
1904
+ $e as _3DSpace_lifecycle_changeRevision,
1911
1905
  Fe as _3DSpace_lifecycle_changeState,
1912
1906
  Ue as _3DSpace_lifecycle_getGraph,
1913
- $e as _3DSpace_lifecycle_getNextRevision,
1907
+ je as _3DSpace_lifecycle_getNextRevision,
1914
1908
  De as _3DSpace_lifecycle_getNextStates,
1915
1909
  We as _3DSwim_getAllCommunities,
1916
1910
  Q as _3DSwim_getMembersCommunity,
@@ -1926,7 +1920,7 @@ export {
1926
1920
  Qe as _3DSwym_get_findUser,
1927
1921
  w as _3DSwym_get_version,
1928
1922
  Be as _3DSwym_postIdea,
1929
- j as _3DSwym_sendMessageData,
1923
+ $ as _3DSwym_sendMessageData,
1930
1924
  Se as _AppMngt_get_info_user,
1931
1925
  he as _AppMngt_get_users,
1932
1926
  me as _getPlateformInfos,