@beam3_dev/api_module 0.0.124 → 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 A(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
- A(
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 Ae(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"],
@@ -879,11 +879,11 @@ function Ae(e, t, n = void 0, s = void 0) {
879
879
  }
880
880
  });
881
881
  }
882
- function $e(e, t, n, s = void 0, i = void 0) {
882
+ 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 $e(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
- A(
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
- A(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) => {
@@ -1144,7 +1144,7 @@ function Me(e, t, n, s = void 0, i = void 0) {
1144
1144
  );
1145
1145
  }
1146
1146
  let R, x;
1147
- const $ = [];
1147
+ const A = [];
1148
1148
  async function Le(e, t = void 0, n = void 0) {
1149
1149
  e.objID && e.objID !== "" ? v(
1150
1150
  e,
@@ -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) => {
@@ -1198,7 +1198,7 @@ function q(e, t, n = void 0, s = void 0) {
1198
1198
  R,
1199
1199
  (i) => {
1200
1200
  const r = [...t];
1201
- r.find((o) => o.objectID === i.objectId).data = i.data, x = r, $.push(i.data), n && n($);
1201
+ r.find((o) => o.objectID === i.objectId).data = i.data, x = r, A.push(i.data), n && n(A);
1202
1202
  },
1203
1203
  (i) => {
1204
1204
  s && (s(i), console.log(i));
@@ -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,11 +1952,26 @@ 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
- const i = s.services.find((a) => a.id === "3dpassport")?.url;
1958
- s.services.find((a) => a.id === "3dcompass")?.url;
1959
- const r = s.services.find((a) => a.id === "businessprocess")?.url + "/api/v2", o = `${i}/login/?service=${r}/auth/cas`;
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`;
1960
1975
  f(o, {
1961
1976
  async onComplete(a) {
1962
1977
  console.log("response", a);
@@ -1973,17 +1988,27 @@ function nt(e, t = void 0, n = void 0) {
1973
1988
  });
1974
1989
  });
1975
1990
  }
1976
- function st(e) {
1991
+ function at(e, t) {
1992
+ const n = new Headers();
1993
+ n.append("Authorization", `Bearer ${t}`);
1994
+ const s = {
1995
+ method: "GET",
1996
+ headers: n,
1997
+ redirect: "follow"
1998
+ };
1999
+ fetch(`${e}/identity/users`, s).then((i) => i.text()).then((i) => console.log(i)).catch((i) => console.error(i));
2000
+ }
2001
+ function it(e) {
1977
2002
  const t = "Hello " + e;
1978
2003
  return console.log(t), t;
1979
2004
  }
1980
- function at(e, t = void 0, n = void 0) {
2005
+ function ot(e, t = void 0, n = void 0) {
1981
2006
  return console.log("credentials", e), new Promise((s) => {
1982
2007
  if (e.token === "" && T(e), !e.space || e.space === "") {
1983
2008
  const o = J();
1984
2009
  console.log("platformeInfo", o);
1985
2010
  }
1986
- b(
2011
+ N(
1987
2012
  e,
1988
2013
  "Common space",
1989
2014
  ["VPLMProjectLeader", "VPLMCreator"],
@@ -1994,7 +2019,7 @@ function at(e, t = void 0, n = void 0) {
1994
2019
  },
1995
2020
  !0
1996
2021
  );
1997
- 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}`;
1998
2023
  f(r, {
1999
2024
  onComplete(o) {
2000
2025
  if (Array.isArray(JSON.parse(o))) {
@@ -2057,12 +2082,12 @@ function at(e, t = void 0, n = void 0) {
2057
2082
  });
2058
2083
  }
2059
2084
  export {
2060
- j as UUID,
2061
- at as _3DSearch_usersGroup,
2062
- Fe as _3DSpace_Create_Doc,
2063
- 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,
2064
2089
  T as _3DSpace_csrf,
2065
- I as _3DSpace_download_doc,
2090
+ j as _3DSpace_download_doc,
2066
2091
  B as _3DSpace_download_multidoc,
2067
2092
  V as _3DSpace_file_update,
2068
2093
  W as _3DSpace_file_update_csr,
@@ -2070,13 +2095,13 @@ export {
2070
2095
  v as _3DSpace_get_csrf,
2071
2096
  X as _3DSpace_get_docInfo,
2072
2097
  Y as _3DSpace_get_downloadTicket_multidoc,
2073
- b as _3DSpace_get_securityContexts,
2074
- A as _3DSpace_get_ticket,
2075
- je as _3DSpace_lifecycle_changeRevision,
2076
- $e as _3DSpace_lifecycle_changeState,
2077
- De as _3DSpace_lifecycle_getGraph,
2078
- Ue as _3DSpace_lifecycle_getNextRevision,
2079
- Ae as _3DSpace_lifecycle_getNextStates,
2098
+ N as _3DSpace_get_securityContexts,
2099
+ F as _3DSpace_get_ticket,
2100
+ Ie as _3DSpace_lifecycle_changeRevision,
2101
+ Ae as _3DSpace_lifecycle_changeState,
2102
+ Ue as _3DSpace_lifecycle_getGraph,
2103
+ De as _3DSpace_lifecycle_getNextRevision,
2104
+ Fe as _3DSpace_lifecycle_getNextStates,
2080
2105
  qe as _3DSwym_buildDirectMessage,
2081
2106
  ze as _3DSwym_deleteIdea,
2082
2107
  te as _3DSwym_findCommunityToInstantMSG,
@@ -2091,14 +2116,16 @@ export {
2091
2116
  tt as _3DSwym_get_findUser,
2092
2117
  w as _3DSwym_get_version,
2093
2118
  He as _3DSwym_postIdea,
2094
- D as _3DSwym_sendMessageData,
2119
+ U as _3DSwym_sendMessageData,
2095
2120
  ye as _AppMngt_get_info_user,
2096
2121
  _e as _AppMngt_get_users,
2097
- nt as _Iterop_Auth_CAS,
2122
+ st as _Iterop_Auth_CAS,
2123
+ at as _Iterop_ListUsers,
2098
2124
  J as _getPlateformInfos,
2099
2125
  ge as _getPlatformServices,
2100
2126
  E as _getServiceUrl,
2101
2127
  he as _getServiceUrl_3DPassport,
2128
+ nt as _getServiceUrl_Iterop,
2102
2129
  f as _httpCallAuthenticated,
2103
2130
  ue as _setDraggable,
2104
2131
  me as _setDroppable,
@@ -2123,12 +2150,12 @@ export {
2123
2150
  Te as getUserGroupsList,
2124
2151
  G as getUsersGroupRules,
2125
2152
  Le as get_3DSpace_csrf,
2126
- be as patchUserGroups,
2127
- Ne as patchUserGroupsControl,
2153
+ Ne as patchUserGroups,
2154
+ be as patchUserGroupsControl,
2128
2155
  Me as pushDataIn3DSpace,
2129
2156
  ve as readUserGroupControl,
2130
2157
  Ke as removeTagToDoc,
2131
- st as sayHello,
2158
+ it as sayHello,
2132
2159
  pe as updateEvent
2133
2160
  };
2134
2161
  //# sourceMappingURL=wb3Api.js.map