@beam3_dev/api_module 0.0.68 → 0.0.70

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 M } from "uuid";
2
- import { DateTime as b } from "luxon";
2
+ import { DateTime as N } from "luxon";
3
3
  import { requirejs as O, widget as A } from "@widget-lab/3ddashboard-utils";
4
- function R() {
4
+ function I() {
5
5
  return M();
6
6
  }
7
7
  const L = {
@@ -66,7 +66,7 @@ async function re(e, t = void 0, n = void 0) {
66
66
  });
67
67
  }
68
68
  async function ce(e, t = L) {
69
- let n = b.now().year;
69
+ let n = N.now().year;
70
70
  const s = e, o = [], c = (a) => {
71
71
  for (let i in a)
72
72
  o.push({ date: i, comment: a[i] });
@@ -89,11 +89,11 @@ async function ce(e, t = L) {
89
89
  } : s;
90
90
  for (let i of o)
91
91
  a.events.findIndex(
92
- (l) => l.start === b.fromISO(i.date).toISODate() && l.name === "Férié : " + i.comment
92
+ (l) => l.start === N.fromISO(i.date).toISODate() && l.name === "Férié : " + i.comment
93
93
  ) === -1 && a.events.push({
94
94
  name: "Férié : " + i.comment,
95
- start: b.fromISO(i.date).toISODate(),
96
- end: b.fromISO(i.date).toISODate(),
95
+ start: N.fromISO(i.date).toISODate(),
96
+ end: N.fromISO(i.date).toISODate(),
97
97
  color: t.b3BusinnessDays,
98
98
  timed: !1
99
99
  });
@@ -351,7 +351,7 @@ function Oe(e, t, n, s = void 0, o = void 0) {
351
351
  }
352
352
  });
353
353
  }
354
- function Ne(e, t, n = void 0, s = void 0) {
354
+ function be(e, t, n = void 0, s = void 0) {
355
355
  const { space: o } = e, r = `${o}/3drdfpersist/resources/v1/usersgroup/${t}/sharing`;
356
356
  f(r, {
357
357
  opts: {
@@ -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);
@@ -465,7 +461,7 @@ function U(e, t = void 0, n = void 0) {
465
461
  }
466
462
  );
467
463
  }
468
- function be(e, t, n, s = void 0, o = void 0) {
464
+ function Ne(e, t, n, s = void 0, o = void 0) {
469
465
  const c = `${e.space}/resources/v1/modeler/documents/${t}/files/DownloadTicket`;
470
466
  n || (n = e.token), f(c, {
471
467
  method: "PUT",
@@ -610,7 +606,7 @@ async function ke(e, t, n, s, o = void 0, c = void 0) {
610
606
  }
611
607
  ]
612
608
  },
613
- tempId: R()
609
+ tempId: I()
614
610
  }
615
611
  ]
616
612
  }),
@@ -636,7 +632,7 @@ async function ke(e, t, n, s, o = void 0, c = void 0) {
636
632
  }
637
633
  });
638
634
  }
639
- function N(e, t = void 0, n = void 0, s = void 0, o = void 0, c = void 0) {
635
+ function b(e, t = void 0, n = void 0, s = void 0, o = void 0, c = void 0) {
640
636
  const r = `${e.space}/resources/modeler/pno/person?current=true&select=preferredcredentials&select=collabspaces`;
641
637
  f(r, {
642
638
  method: "GET",
@@ -682,7 +678,7 @@ function N(e, t = void 0, n = void 0, s = void 0, o = void 0, c = void 0) {
682
678
  }
683
679
  });
684
680
  }
685
- async function I(e, t = void 0, n = void 0) {
681
+ async function R(e, t = void 0, n = void 0) {
686
682
  return (!e.objID || e.objID === "") && console.warn(
687
683
  "_3DSpace_download_doc() / Le paramètre objectId est obligatoire"
688
684
  ), (e.space === "" || !e.space) && console.warn(
@@ -697,28 +693,23 @@ async function I(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
- const a = {
706
- ENO_CSRF_TOKEN: e.token
707
- };
708
- f(r, {
709
- headers: a,
710
- onComplete(i) {
711
- const d = JSON.parse(i);
712
- console.log(
713
- "_3DSpace_download_doc / reponse (liste d'objetsID) ",
714
- d
715
- ), t && t(d), o(d);
716
- },
717
- onFailure(i, d, l) {
718
- n && (console.log("error http", i), n({ msg: JSON.parse(i), headers: d, xhr: l }), c({ msg: JSON.parse(i), headers: d, xhr: l }));
719
- }
720
- });
721
- }, 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
+ });
722
713
  },
723
714
  (r) => {
724
715
  n && n(r), console.log("*_3dspace_download_doc / error file URL *", r), c(r);
@@ -796,7 +787,7 @@ function De(e, t, n = void 0, s = void 0) {
796
787
  return new Promise((o) => {
797
788
  if (e.token === "" && C(e), t !== void 0 && t !== "" && t !== null) {
798
789
  const c = `${e.space}/resources/v1/modeler/dslc/maturity/getNextStates`;
799
- N(
790
+ b(
800
791
  e.space,
801
792
  "ESPACE COMMUN",
802
793
  ["VPLMProjectLeader", "VPLMCreator"],
@@ -837,7 +828,7 @@ function Fe(e, t, n, s = void 0, o = void 0) {
837
828
  return new Promise((c) => {
838
829
  if (e.token === "" && C(e), t !== void 0 && t !== "" && t !== null) {
839
830
  const r = `${e.space}/resources/v1/modeler/dslc/maturity/changeState`;
840
- N(
831
+ b(
841
832
  e.space,
842
833
  "ESPACE COMMUN",
843
834
  ["VPLMProjectLeader", "VPLMCreator"],
@@ -879,7 +870,7 @@ function Ue(e, t, n = void 0, s = void 0) {
879
870
  return new Promise((o) => {
880
871
  if (e.token === "" && C(e), t !== void 0 && t !== "" && t !== null) {
881
872
  const c = `${e.space}/resources/v1/dslc/versiongraph?withThumbnail=0&withIsLastVersion=0&withAttributes=0&withCopyFrom=0&tenant=${e.tenant}`;
882
- N(
873
+ b(
883
874
  e.space,
884
875
  "ESPACE COMMUN",
885
876
  ["VPLMProjectLeader", "VPLMCreator"],
@@ -916,11 +907,11 @@ function Ue(e, t, n = void 0, s = void 0) {
916
907
  }
917
908
  });
918
909
  }
919
- function $e(e, t, n = void 0, s = void 0) {
910
+ function je(e, t, n = void 0, s = void 0) {
920
911
  return new Promise((o) => {
921
912
  if (e.token === "" && C(e), t !== void 0 && t !== "" && t !== null) {
922
913
  const c = `${e.space}/resources/lifecycle/revise/prepare_revise_maskattributes?tenant=${e.tenant}`;
923
- N(
914
+ b(
924
915
  e.space,
925
916
  "ESPACE COMMUN",
926
917
  ["VPLMProjectLeader", "VPLMCreator"],
@@ -963,11 +954,11 @@ function $e(e, t, n = void 0, s = void 0) {
963
954
  }
964
955
  });
965
956
  }
966
- function je(e, t, n, s = void 0, o = void 0) {
957
+ function $e(e, t, n, s = void 0, o = void 0) {
967
958
  return new Promise((c) => {
968
959
  if (e.token === "" && C(e), t !== void 0 && t !== "" && t !== null) {
969
960
  const r = `${e.space}/resources/lifecycle/revise/major?tenant=${e.tenant}`;
970
- N(
961
+ b(
971
962
  e.space,
972
963
  "ESPACE COMMUN",
973
964
  ["VPLMProjectLeader", "VPLMCreator"],
@@ -1032,7 +1023,7 @@ function Ae(e, t = void 0, n = void 0) {
1032
1023
  }
1033
1024
  });
1034
1025
  }
1035
- function Re(e, t, n, s) {
1026
+ function Ie(e, t, n, s) {
1036
1027
  U(
1037
1028
  e.space,
1038
1029
  t,
@@ -1049,7 +1040,7 @@ function Re(e, t, n, s) {
1049
1040
  }
1050
1041
  );
1051
1042
  }
1052
- async function Ie(e, t, n = void 0, s = void 0) {
1043
+ async function Re(e, t, n = void 0, s = void 0) {
1053
1044
  return new Promise((o) => {
1054
1045
  U(e, t, (c) => {
1055
1046
  f(c, {
@@ -1085,7 +1076,7 @@ function ve(e, t, n, s = void 0, o = void 0) {
1085
1076
  );
1086
1077
  }
1087
1078
  let v, P;
1088
- const $ = [];
1079
+ const j = [];
1089
1080
  async function Pe(e, t = void 0, n = void 0) {
1090
1081
  e.objID && e.objID !== "" ? (console.log("obj est présent"), k(
1091
1082
  e,
@@ -1106,7 +1097,7 @@ async function Pe(e, t = void 0, n = void 0) {
1106
1097
  );
1107
1098
  }
1108
1099
  async function xe(e, t = void 0, n = void 0) {
1109
- console.log("getDatasByTenant (getDocuments)", e), await I(
1100
+ console.log("getDatasByTenant (getDocuments)", e), await R(
1110
1101
  e,
1111
1102
  (s) => {
1112
1103
  const o = {};
@@ -1119,10 +1110,14 @@ async function xe(e, t = void 0, n = void 0) {
1119
1110
  }
1120
1111
  function Me(e, t = void 0, n = void 0) {
1121
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
+ }
1122
1117
  e.objIds.forEach((o, c) => {
1123
- I(
1118
+ R(
1124
1119
  e,
1125
- o.objId,
1120
+ o.objID,
1126
1121
  (r) => {
1127
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);
1128
1123
  }
@@ -1135,7 +1130,7 @@ function B(e, t, n = void 0, s = void 0) {
1135
1130
  v,
1136
1131
  (o) => {
1137
1132
  const c = [...t];
1138
- 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);
1139
1134
  },
1140
1135
  (o) => {
1141
1136
  s && (s(o), console.log(o));
@@ -1230,7 +1225,7 @@ function q(e, t, n = void 0, s = void 0) {
1230
1225
  }, r = `${c.baseUrl}${c.uri}`, a = {
1231
1226
  "Content-Type": "application/json",
1232
1227
  Accept: "application/json,text/javascript,*/*"
1233
- }, i = R(), d = {
1228
+ }, i = I(), d = {
1234
1229
  with_indexing_date: !0,
1235
1230
  with_synthesis: !0,
1236
1231
  with_nls: !1,
@@ -1545,7 +1540,7 @@ function Ve(e, t, n = void 0, s = void 0) {
1545
1540
  Z(
1546
1541
  a.users,
1547
1542
  (l) => {
1548
- 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));
1549
1544
  },
1550
1545
  (l) => {
1551
1546
  d = !1, console.log("_3dSwym_findCommunityToInstantMSG callback", l), s && s(l), i.id_msg = "";
@@ -1563,7 +1558,7 @@ function Ve(e, t, n = void 0, s = void 0) {
1563
1558
  type: "json",
1564
1559
  onComplete(p, u, m) {
1565
1560
  const g = p;
1566
- 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);
1567
1562
  },
1568
1563
  onFailure(p, u, m) {
1569
1564
  const g = p;
@@ -1602,7 +1597,7 @@ function Z(e, t, n, s) {
1602
1597
  });
1603
1598
  });
1604
1599
  }
1605
- function j(e, t, n = void 0, s = void 0) {
1600
+ function $(e, t, n = void 0, s = void 0) {
1606
1601
  const o = {
1607
1602
  base: e.space,
1608
1603
  uri: "/api/community",
@@ -1893,23 +1888,23 @@ function Ze(e) {
1893
1888
  return console.log(t), t;
1894
1889
  }
1895
1890
  export {
1896
- R as UUID,
1891
+ I as UUID,
1897
1892
  ke as _3DSpace_Create_Doc,
1898
1893
  C as _3DSpace_csrf,
1899
- I as _3DSpace_download_doc,
1894
+ R as _3DSpace_download_doc,
1900
1895
  X as _3DSpace_download_multidoc,
1901
1896
  K as _3DSpace_file_update,
1902
1897
  W as _3DSpace_file_update_csr,
1903
- be as _3DSpace_file_url_csr,
1898
+ Ne as _3DSpace_file_url_csr,
1904
1899
  k as _3DSpace_get_csrf,
1905
1900
  G as _3DSpace_get_docInfo,
1906
1901
  V as _3DSpace_get_downloadTicket_multidoc,
1907
- N as _3DSpace_get_securityContexts,
1902
+ b as _3DSpace_get_securityContexts,
1908
1903
  U as _3DSpace_get_ticket,
1909
- je as _3DSpace_lifecycle_changeRevision,
1904
+ $e as _3DSpace_lifecycle_changeRevision,
1910
1905
  Fe as _3DSpace_lifecycle_changeState,
1911
1906
  Ue as _3DSpace_lifecycle_getGraph,
1912
- $e as _3DSpace_lifecycle_getNextRevision,
1907
+ je as _3DSpace_lifecycle_getNextRevision,
1913
1908
  De as _3DSpace_lifecycle_getNextStates,
1914
1909
  We as _3DSwim_getAllCommunities,
1915
1910
  Q as _3DSwim_getMembersCommunity,
@@ -1925,7 +1920,7 @@ export {
1925
1920
  Qe as _3DSwym_get_findUser,
1926
1921
  w as _3DSwym_get_version,
1927
1922
  Be as _3DSwym_postIdea,
1928
- j as _3DSwym_sendMessageData,
1923
+ $ as _3DSwym_sendMessageData,
1929
1924
  Se as _AppMngt_get_info_user,
1930
1925
  he as _AppMngt_get_users,
1931
1926
  me as _getPlateformInfos,
@@ -1945,11 +1940,11 @@ export {
1945
1940
  J as getCSRFToken,
1946
1941
  ie as getCommunes,
1947
1942
  ye as getComplementUG,
1948
- Re as getDataFrom3DSpace,
1943
+ Ie as getDataFrom3DSpace,
1949
1944
  ce as getDataFromGouvFr,
1950
1945
  xe as getDatasByTenant,
1951
1946
  Me as getDatasFrom3DSpace,
1952
- Ie as getDownloadDocument,
1947
+ Re as getDownloadDocument,
1953
1948
  Je as getInfoDocTags,
1954
1949
  we as getUserGroupsList,
1955
1950
  E as getUsersGroupRules,
@@ -1957,7 +1952,7 @@ export {
1957
1952
  Ce as patchUserGroups,
1958
1953
  Oe as patchUserGroupsControl,
1959
1954
  ve as pushDataIn3DSpace,
1960
- Ne as readUserGroupControl,
1955
+ be as readUserGroupControl,
1961
1956
  Ee as removeTagToDoc,
1962
1957
  Ze as sayHello,
1963
1958
  de as updateEvent