@beam3_dev/api_module 0.0.125 → 0.0.126

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 N } from "luxon";
3
- import { requirejs as O, widget as U } from "@widget-lab/3ddashboard-utils";
4
- function j() {
2
+ import { DateTime as b } from "luxon";
3
+ import { requirejs as O, widget as D } from "@widget-lab/3ddashboard-utils";
4
+ function I() {
5
5
  return M();
6
6
  }
7
7
  const L = {
@@ -66,7 +66,7 @@ async function de(e, t = void 0, n = void 0) {
66
66
  });
67
67
  }
68
68
  async function le(e, t = L) {
69
- let n = N.now().year;
69
+ let n = b.now().year;
70
70
  const s = e, i = [], r = (a) => {
71
71
  for (let c in a)
72
72
  i.push({ date: c, comment: a[c] });
@@ -89,11 +89,11 @@ async function le(e, t = L) {
89
89
  } : s;
90
90
  for (let c of i)
91
91
  a.events.findIndex(
92
- (l) => l.start === N.fromISO(c.date).toISODate() && l.name === "Férié : " + c.comment
92
+ (l) => l.start === b.fromISO(c.date).toISODate() && l.name === "Férié : " + c.comment
93
93
  ) === -1 && a.events.push({
94
94
  name: "Férié : " + c.comment,
95
- start: N.fromISO(c.date).toISODate(),
96
- end: N.fromISO(c.date).toISODate(),
95
+ start: b.fromISO(c.date).toISODate(),
96
+ end: b.fromISO(c.date).toISODate(),
97
97
  color: t.b3BusinnessDays,
98
98
  timed: !1
99
99
  });
@@ -121,7 +121,7 @@ function fe(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: U.id,
124
+ widgetId: D.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 ge(e, t = void 0, n = void 0) {
137
137
  await O(
138
138
  ["DS/i3DXCompassServices/i3DXCompassServices"],
139
139
  (s) => {
140
- (!e || e === "") && (e = U.getValue("PlatFormInstanceId")), (!e || e === "") && (e = void 0), t && t(
140
+ (!e || e === "") && (e = D.getValue("PlatFormInstanceId")), (!e || e === "") && (e = void 0), t && t(
141
141
  s.getPlatformServices({
142
142
  platformId: e,
143
143
  onComplete: t,
@@ -250,7 +250,7 @@ function ye(e, t, n = void 0, s = void 0) {
250
250
  }
251
251
  });
252
252
  }
253
- const F = {
253
+ const $ = {
254
254
  "Content-Type": "application/json",
255
255
  Accept: "application/json,text/javascript,*/*"
256
256
  };
@@ -271,7 +271,7 @@ function we(e, t, n = void 0, s = void 0) {
271
271
  };
272
272
  f(a, {
273
273
  method: "POST",
274
- headers: F,
274
+ headers: $,
275
275
  data: JSON.stringify(c),
276
276
  onComplete(d) {
277
277
  n && n(JSON.parse(d));
@@ -355,7 +355,7 @@ function Oe(e, t) {
355
355
  method: "DELETE"
356
356
  });
357
357
  }
358
- function be(e, t, n, s = void 0, i = void 0) {
358
+ function Ne(e, t, n, s = void 0, i = void 0) {
359
359
  const { space: r, tenant: o } = e, a = {
360
360
  URITI: "/3drdfpersist/resources/v1/template-instances",
361
361
  URIUGr: "/3drdfpersist/resources/v1/usersgroup",
@@ -366,7 +366,7 @@ function be(e, t, n, s = void 0, i = void 0) {
366
366
  OPTsTenant: `tenant=dstenant:${o}`
367
367
  }, c = n, d = `${r}${a.URIUGr}/${t}`, l = JSON.stringify(c);
368
368
  f(d, {
369
- headers: F,
369
+ headers: $,
370
370
  method: "PATCH",
371
371
  data: l,
372
372
  type: "json",
@@ -378,11 +378,11 @@ function be(e, t, n, s = void 0, i = void 0) {
378
378
  }
379
379
  });
380
380
  }
381
- function Ne(e, t, n, s = void 0, i = void 0) {
381
+ function be(e, t, n, s = void 0, i = void 0) {
382
382
  const { space: r } = e, a = `${r}/3drdfpersist/resources/v1/usersgroup/${t}/sharing`;
383
383
  f(a, {
384
384
  method: "PATCH",
385
- headers: F,
385
+ headers: $,
386
386
  data: JSON.stringify(n),
387
387
  type: "json",
388
388
  onComplete(d) {
@@ -483,7 +483,7 @@ function T(e, t = void 0, n = void 0) {
483
483
  } else
484
484
  n && n("ERROR : url du 3DSpace non défini.");
485
485
  }
486
- function $(e, t = void 0, n = void 0) {
486
+ function F(e, t = void 0, n = void 0) {
487
487
  let s = e.space + `/resources/v1/modeler/documents/${e.objID}/files/DownloadTicket`;
488
488
  v(
489
489
  e,
@@ -598,7 +598,7 @@ function W(e, t, n, s, i, r, o = void 0, a = void 0) {
598
598
  }
599
599
  });
600
600
  }
601
- async function Fe(e, t, n, s, i = void 0, r = void 0) {
601
+ async function $e(e, t, n, s, i = void 0, r = void 0) {
602
602
  const o = e.space, a = e.token, c = e.ctx, d = new FormData(), l = new Blob([JSON.stringify(t)], {
603
603
  type: "text/plain"
604
604
  }), p = {
@@ -645,7 +645,7 @@ async function Fe(e, t, n, s, i = void 0, r = void 0) {
645
645
  }
646
646
  }]
647
647
  },
648
- tempId: j()
648
+ tempId: I()
649
649
  }]
650
650
  }),
651
651
  type: "json",
@@ -670,7 +670,7 @@ async function Fe(e, t, n, s, i = void 0, r = void 0) {
670
670
  }
671
671
  });
672
672
  }
673
- function b(e, t = void 0, n = void 0, s = void 0, i = void 0, r = void 0, o = !1) {
673
+ function N(e, t = void 0, n = void 0, s = void 0, i = void 0, r = void 0, o = !1) {
674
674
  const a = `${e.space}/resources/modeler/pno/person?current=true&select=preferredcredentials&select=collabspaces`;
675
675
  f(a, {
676
676
  method: "GET",
@@ -719,7 +719,7 @@ function b(e, t = void 0, n = void 0, s = void 0, i = void 0, r = void 0, o = !1
719
719
  }
720
720
  });
721
721
  }
722
- async function I(e, t = void 0, n = void 0) {
722
+ async function j(e, t = void 0, n = void 0) {
723
723
  return (!e.objID || e.objID === "") && console.warn(
724
724
  "_3DSpace_download_doc() / Le paramètre objectId est obligatoire"
725
725
  ), (e.space === "" || !e.space) && console.warn(
@@ -735,7 +735,7 @@ async function I(e, t = void 0, n = void 0) {
735
735
  ), console.warn(
736
736
  "_3DSpace_download_doc() / Le paramètre token est obligatoire"
737
737
  )), new Promise((s, i) => {
738
- $(
738
+ F(
739
739
  e,
740
740
  (r) => {
741
741
  f(r, {
@@ -840,11 +840,11 @@ function Y(e, t, n = void 0, s = void 0, i = void 0) {
840
840
  }
841
841
  });
842
842
  }
843
- function $e(e, t, n = void 0, s = void 0) {
843
+ function Fe(e, t, n = void 0, s = void 0) {
844
844
  return new Promise((i) => {
845
845
  if (e.token === "" && T(e), t !== void 0 && t !== "" && t !== null) {
846
846
  const r = `${e.space}/resources/v1/modeler/dslc/maturity/getNextStates`;
847
- b(
847
+ N(
848
848
  e.space,
849
849
  "ESPACE COMMUN",
850
850
  ["VPLMProjectLeader", "VPLMCreator"],
@@ -883,7 +883,7 @@ function Ae(e, t, n, s = void 0, i = void 0) {
883
883
  return new Promise((r) => {
884
884
  if (e.token === "" && T(e), t !== void 0 && t !== "" && t !== null) {
885
885
  const o = `${e.space}/resources/v1/modeler/dslc/maturity/changeState`;
886
- b(
886
+ N(
887
887
  e.space,
888
888
  "ESPACE COMMUN",
889
889
  ["VPLMProjectLeader", "VPLMCreator"],
@@ -919,11 +919,11 @@ function Ae(e, t, n, s = void 0, i = void 0) {
919
919
  }
920
920
  });
921
921
  }
922
- function De(e, t, n = void 0, s = void 0) {
922
+ function Ue(e, t, n = void 0, s = void 0) {
923
923
  return new Promise((i) => {
924
924
  if (e.token === "" && T(e), t !== void 0 && t !== "" && t !== null) {
925
925
  const r = `${e.space}/resources/v1/dslc/versiongraph?withThumbnail=0&withIsLastVersion=0&withAttributes=0&withCopyFrom=0&tenant=${e.tenant}`;
926
- b(
926
+ N(
927
927
  e.space,
928
928
  "ESPACE COMMUN",
929
929
  ["VPLMProjectLeader", "VPLMCreator"],
@@ -958,11 +958,11 @@ function De(e, t, n = void 0, s = void 0) {
958
958
  }
959
959
  });
960
960
  }
961
- function Ue(e, t, n = void 0, s = void 0) {
961
+ function De(e, t, n = void 0, s = void 0) {
962
962
  return new Promise((i) => {
963
963
  if (e.token === "" && T(e), t !== void 0 && t !== "" && t !== null) {
964
964
  const r = `${e.space}/resources/lifecycle/revise/prepare_revise_maskattributes?tenant=${e.tenant}`;
965
- b(
965
+ N(
966
966
  e.space,
967
967
  "ESPACE COMMUN",
968
968
  ["VPLMProjectLeader", "VPLMCreator"],
@@ -1003,11 +1003,11 @@ function Ue(e, t, n = void 0, s = void 0) {
1003
1003
  }
1004
1004
  });
1005
1005
  }
1006
- function je(e, t, n, s = void 0, i = void 0) {
1006
+ function Ie(e, t, n, s = void 0, i = void 0) {
1007
1007
  return new Promise((r) => {
1008
1008
  if (e.token === "" && T(e), t !== void 0 && t !== "" && t !== null) {
1009
1009
  const o = `${e.space}/resources/lifecycle/revise/major?tenant=${e.tenant}`;
1010
- b(
1010
+ N(
1011
1011
  e.space,
1012
1012
  "ESPACE COMMUN",
1013
1013
  ["VPLMProjectLeader", "VPLMCreator"],
@@ -1048,7 +1048,7 @@ function je(e, t, n, s = void 0, i = void 0) {
1048
1048
  }
1049
1049
  });
1050
1050
  }
1051
- function Ie(e, t, n, s, i = void 0, r = void 0) {
1051
+ function je(e, t, n, s, i = void 0, r = void 0) {
1052
1052
  return console.log("credentials", e), new Promise((o) => {
1053
1053
  `${e.space}`, JSON.stringify({
1054
1054
  csrf: {
@@ -1092,7 +1092,7 @@ function Re(e, t = void 0, n = void 0) {
1092
1092
  });
1093
1093
  }
1094
1094
  function xe(e, t, n, s) {
1095
- $(
1095
+ F(
1096
1096
  e.space,
1097
1097
  t,
1098
1098
  (i) => {
@@ -1110,7 +1110,7 @@ function xe(e, t, n, s) {
1110
1110
  }
1111
1111
  async function Pe(e, t, n = void 0, s = void 0) {
1112
1112
  return new Promise((i) => {
1113
- $(e, t, (r) => {
1113
+ F(e, t, (r) => {
1114
1114
  f(r, {
1115
1115
  onComplete: (o, a, c) => (i(JSON.parse(o)), n && n(JSON.parse(o), a, c), i),
1116
1116
  onFailure: (o, a, c) => {
@@ -1165,7 +1165,7 @@ async function Le(e, t = void 0, n = void 0) {
1165
1165
  );
1166
1166
  }
1167
1167
  async function Je(e, t = void 0, n = void 0) {
1168
- console.log("getDatasByTenant (getDocuments)", e), await I(
1168
+ console.log("getDatasByTenant (getDocuments)", e), await j(
1169
1169
  e,
1170
1170
  (s) => {
1171
1171
  const i = {};
@@ -1183,7 +1183,7 @@ function Ee(e, t = void 0, n = void 0) {
1183
1183
  return;
1184
1184
  }
1185
1185
  e.objIds.forEach((i, r) => {
1186
- I(
1186
+ j(
1187
1187
  e,
1188
1188
  i.objID,
1189
1189
  (o) => {
@@ -1293,7 +1293,7 @@ function Z(e, t, n = void 0, s = void 0) {
1293
1293
  }, o = `${r.baseUrl}${r.uri}`, a = {
1294
1294
  "Content-Type": "application/json",
1295
1295
  Accept: "application/json,text/javascript,*/*"
1296
- }, c = j(), d = {
1296
+ }, c = I(), d = {
1297
1297
  with_indexing_date: !0,
1298
1298
  with_synthesis: !0,
1299
1299
  with_nls: !1,
@@ -1608,7 +1608,7 @@ function qe(e, t, n = void 0, s = void 0) {
1608
1608
  te(
1609
1609
  a.users,
1610
1610
  (l) => {
1611
- l !== void 0 && (c.id_msg = l.id, d = !0, D(e, c));
1611
+ l !== void 0 && (c.id_msg = l.id, d = !0, U(e, c));
1612
1612
  },
1613
1613
  (l) => {
1614
1614
  d = !1, console.log("_3dSwym_findCommunityToInstantMSG callback", l), s && s(l), c.id_msg = "";
@@ -1626,7 +1626,7 @@ function qe(e, t, n = void 0, s = void 0) {
1626
1626
  type: "json",
1627
1627
  onComplete(p, u, m) {
1628
1628
  const g = p;
1629
- g.reponse = JSON.parse(m.response), g.status = m.status, n && n(g), c.id_msg = g.result.id, D(e, c);
1629
+ g.reponse = JSON.parse(m.response), g.status = m.status, n && n(g), c.id_msg = g.result.id, U(e, c);
1630
1630
  },
1631
1631
  onFailure(p, u, m) {
1632
1632
  const g = p;
@@ -1665,7 +1665,7 @@ function te(e, t, n, s) {
1665
1665
  });
1666
1666
  });
1667
1667
  }
1668
- function D(e, t, n = void 0, s = void 0) {
1668
+ function U(e, t, n = void 0, s = void 0) {
1669
1669
  const i = {
1670
1670
  base: e.space,
1671
1671
  uri: "/api/community",
@@ -1952,6 +1952,23 @@ function tt(e, t, n = void 0, s = void 0) {
1952
1952
  );
1953
1953
  }
1954
1954
  function nt(e, t = void 0, n = void 0) {
1955
+ if (e.tenant) {
1956
+ const s = `https://${e.tenant}-eu1-registry.3dexperience.3ds.com/api/v1/platform/service/instance?serviceId=3dpassport&platformId=${e.tenant}`;
1957
+ f(s, {
1958
+ onComplete(i) {
1959
+ const r = JSON.parse(i);
1960
+ if (console.log("serviceId=3dpassport", r), Array.isArray(r) && r.length > 0) {
1961
+ const o = `${r[0].services[0].url}`;
1962
+ t && t(o);
1963
+ }
1964
+ },
1965
+ onFailure(i) {
1966
+ n && n(i);
1967
+ }
1968
+ });
1969
+ }
1970
+ }
1971
+ function st(e, t = void 0, n = void 0) {
1955
1972
  e.tenant && E(e, (s) => {
1956
1973
  console.log("serviceUrls", s);
1957
1974
  const i = s.services.find((a) => a.id === "3dpassport")?.url, r = s.services.find((a) => a.id === "businessprocess")?.url + "/api/v2", o = `${i}/login/?service=${r}/auth/cas`;
@@ -1971,7 +1988,7 @@ function nt(e, t = void 0, n = void 0) {
1971
1988
  });
1972
1989
  });
1973
1990
  }
1974
- function st(e, t) {
1991
+ function at(e, t) {
1975
1992
  const n = new Headers();
1976
1993
  n.append("Authorization", `Bearer ${t}`);
1977
1994
  const s = {
@@ -1981,17 +1998,17 @@ function st(e, t) {
1981
1998
  };
1982
1999
  fetch(`${e}/identity/users`, s).then((i) => i.text()).then((i) => console.log(i)).catch((i) => console.error(i));
1983
2000
  }
1984
- function at(e) {
2001
+ function it(e) {
1985
2002
  const t = "Hello " + e;
1986
2003
  return console.log(t), t;
1987
2004
  }
1988
- function it(e, t = void 0, n = void 0) {
2005
+ function ot(e, t = void 0, n = void 0) {
1989
2006
  return console.log("credentials", e), new Promise((s) => {
1990
2007
  if (e.token === "" && T(e), !e.space || e.space === "") {
1991
2008
  const o = J();
1992
2009
  console.log("platformeInfo", o);
1993
2010
  }
1994
- b(
2011
+ N(
1995
2012
  e,
1996
2013
  "Common space",
1997
2014
  ["VPLMProjectLeader", "VPLMCreator"],
@@ -2002,7 +2019,7 @@ function it(e, t = void 0, n = void 0) {
2002
2019
  },
2003
2020
  !0
2004
2021
  );
2005
- const i = N.now().ts, r = `https://${e.tenant}-eu1-registry.3dexperience.3ds.com/api/v1/platform/service/instance?serviceId=3dsearch&platformId=${e.tenant}`;
2022
+ const i = b.now().ts, r = `https://${e.tenant}-eu1-registry.3dexperience.3ds.com/api/v1/platform/service/instance?serviceId=3dsearch&platformId=${e.tenant}`;
2006
2023
  f(r, {
2007
2024
  onComplete(o) {
2008
2025
  if (Array.isArray(JSON.parse(o))) {
@@ -2065,12 +2082,12 @@ function it(e, t = void 0, n = void 0) {
2065
2082
  });
2066
2083
  }
2067
2084
  export {
2068
- j as UUID,
2069
- it as _3DSearch_usersGroup,
2070
- Fe as _3DSpace_Create_Doc,
2071
- Ie as _3DSpace_bookmark_addSubsciptions,
2085
+ I as UUID,
2086
+ ot as _3DSearch_usersGroup,
2087
+ $e as _3DSpace_Create_Doc,
2088
+ je as _3DSpace_bookmark_addSubsciptions,
2072
2089
  T as _3DSpace_csrf,
2073
- I as _3DSpace_download_doc,
2090
+ j as _3DSpace_download_doc,
2074
2091
  B as _3DSpace_download_multidoc,
2075
2092
  V as _3DSpace_file_update,
2076
2093
  W as _3DSpace_file_update_csr,
@@ -2078,13 +2095,13 @@ export {
2078
2095
  v as _3DSpace_get_csrf,
2079
2096
  X as _3DSpace_get_docInfo,
2080
2097
  Y as _3DSpace_get_downloadTicket_multidoc,
2081
- b as _3DSpace_get_securityContexts,
2082
- $ as _3DSpace_get_ticket,
2083
- je as _3DSpace_lifecycle_changeRevision,
2098
+ N as _3DSpace_get_securityContexts,
2099
+ F as _3DSpace_get_ticket,
2100
+ Ie as _3DSpace_lifecycle_changeRevision,
2084
2101
  Ae as _3DSpace_lifecycle_changeState,
2085
- De as _3DSpace_lifecycle_getGraph,
2086
- Ue as _3DSpace_lifecycle_getNextRevision,
2087
- $e as _3DSpace_lifecycle_getNextStates,
2102
+ Ue as _3DSpace_lifecycle_getGraph,
2103
+ De as _3DSpace_lifecycle_getNextRevision,
2104
+ Fe as _3DSpace_lifecycle_getNextStates,
2088
2105
  qe as _3DSwym_buildDirectMessage,
2089
2106
  ze as _3DSwym_deleteIdea,
2090
2107
  te as _3DSwym_findCommunityToInstantMSG,
@@ -2099,15 +2116,16 @@ export {
2099
2116
  tt as _3DSwym_get_findUser,
2100
2117
  w as _3DSwym_get_version,
2101
2118
  He as _3DSwym_postIdea,
2102
- D as _3DSwym_sendMessageData,
2119
+ U as _3DSwym_sendMessageData,
2103
2120
  ye as _AppMngt_get_info_user,
2104
2121
  _e as _AppMngt_get_users,
2105
- nt as _Iterop_Auth_CAS,
2106
- st as _Iterop_ListUsers,
2122
+ st as _Iterop_Auth_CAS,
2123
+ at as _Iterop_ListUsers,
2107
2124
  J as _getPlateformInfos,
2108
2125
  ge as _getPlatformServices,
2109
2126
  E as _getServiceUrl,
2110
2127
  he as _getServiceUrl_3DPassport,
2128
+ nt as _getServiceUrl_Iterop,
2111
2129
  f as _httpCallAuthenticated,
2112
2130
  ue as _setDraggable,
2113
2131
  me as _setDroppable,
@@ -2132,12 +2150,12 @@ export {
2132
2150
  Te as getUserGroupsList,
2133
2151
  G as getUsersGroupRules,
2134
2152
  Le as get_3DSpace_csrf,
2135
- be as patchUserGroups,
2136
- Ne as patchUserGroupsControl,
2153
+ Ne as patchUserGroups,
2154
+ be as patchUserGroupsControl,
2137
2155
  Me as pushDataIn3DSpace,
2138
2156
  ve as readUserGroupControl,
2139
2157
  Ke as removeTagToDoc,
2140
- at as sayHello,
2158
+ it as sayHello,
2141
2159
  pe as updateEvent
2142
2160
  };
2143
2161
  //# sourceMappingURL=wb3Api.js.map