@beam3_dev/api_module 0.0.126 → 0.0.127

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,10 +1,10 @@
1
- import { v4 as M } from "uuid";
2
- import { DateTime as b } from "luxon";
1
+ import { v4 as L } from "uuid";
2
+ import { DateTime as N } from "luxon";
3
3
  import { requirejs as O, widget as D } from "@widget-lab/3ddashboard-utils";
4
4
  function I() {
5
- return M();
5
+ return L();
6
6
  }
7
- const L = {
7
+ const J = {
8
8
  b3M3Yellow: "#FFB300",
9
9
  b3AboutageBlue: "#42A5F5",
10
10
  b3UsinageGreen: "#689F38",
@@ -65,8 +65,8 @@ async function de(e, t = void 0, n = void 0) {
65
65
  n && n(s), console.error("Erreur : " + s);
66
66
  });
67
67
  }
68
- async function le(e, t = L) {
69
- let n = b.now().year;
68
+ async function le(e, t = J) {
69
+ let n = N.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 === b.fromISO(c.date).toISODate() && l.name === "Férié : " + c.comment
92
+ (l) => l.start === N.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: b.fromISO(c.date).toISODate(),
96
- end: b.fromISO(c.date).toISODate(),
95
+ start: N.fromISO(c.date).toISODate(),
96
+ end: N.fromISO(c.date).toISODate(),
97
97
  color: t.b3BusinnessDays,
98
98
  timed: !1
99
99
  });
@@ -147,7 +147,7 @@ async function ge(e, t = void 0, n = void 0) {
147
147
  }
148
148
  );
149
149
  }
150
- function J() {
150
+ function E() {
151
151
  let e = {};
152
152
  return O(["DS/PlatformAPI/PlatformAPI"], (t) => {
153
153
  const n = t.getTenant(), s = t.getUser(), i = t.getAllApplicationConfigurations(), r = t.getApplicationConfiguration(
@@ -161,7 +161,7 @@ function J() {
161
161
  };
162
162
  }), console.log("%cRETOUR API :", "color:blue", e), e;
163
163
  }
164
- function E(e, t = void 0, n = void 0) {
164
+ function j(e, t = void 0, n = void 0) {
165
165
  if (e.tenant) {
166
166
  const s = `https://${e.tenant}-eu1-apps.3dexperience.3ds.com/enovia/resources/AppsMngt/api/v1/services?tenant=${e.tenant}&cors=true&xrequestedwith=xmlhttprequest`;
167
167
  f(s, {
@@ -250,7 +250,7 @@ function ye(e, t, n = void 0, s = void 0) {
250
250
  }
251
251
  });
252
252
  }
253
- const $ = {
253
+ const F = {
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: $,
274
+ headers: F,
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 Ne(e, t, n, s = void 0, i = void 0) {
358
+ function be(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 Ne(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: $,
369
+ headers: F,
370
370
  method: "PATCH",
371
371
  data: l,
372
372
  type: "json",
@@ -378,11 +378,11 @@ function Ne(e, t, n, s = void 0, i = void 0) {
378
378
  }
379
379
  });
380
380
  }
381
- function be(e, t, n, s = void 0, i = void 0) {
381
+ function Ne(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: $,
385
+ headers: F,
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 F(e, t = void 0, n = void 0) {
486
+ function A(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 $e(e, t, n, s, i = void 0, r = void 0) {
601
+ async function Fe(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 = {
@@ -670,7 +670,7 @@ async function $e(e, t, n, s, i = void 0, r = void 0) {
670
670
  }
671
671
  });
672
672
  }
673
- function N(e, t = void 0, n = void 0, s = void 0, i = void 0, r = void 0, o = !1) {
673
+ function b(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 N(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 j(e, t = void 0, n = void 0) {
722
+ async function R(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 j(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
- F(
738
+ A(
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 Fe(e, t, n = void 0, s = void 0) {
843
+ function Ae(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
- N(
847
+ b(
848
848
  e.space,
849
849
  "ESPACE COMMUN",
850
850
  ["VPLMProjectLeader", "VPLMCreator"],
@@ -879,11 +879,11 @@ function Fe(e, t, n = void 0, s = void 0) {
879
879
  }
880
880
  });
881
881
  }
882
- function Ae(e, t, n, s = void 0, i = void 0) {
882
+ function $e(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
- N(
886
+ b(
887
887
  e.space,
888
888
  "ESPACE COMMUN",
889
889
  ["VPLMProjectLeader", "VPLMCreator"],
@@ -923,7 +923,7 @@ 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
- N(
926
+ b(
927
927
  e.space,
928
928
  "ESPACE COMMUN",
929
929
  ["VPLMProjectLeader", "VPLMCreator"],
@@ -962,7 +962,7 @@ 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
- N(
965
+ b(
966
966
  e.space,
967
967
  "ESPACE COMMUN",
968
968
  ["VPLMProjectLeader", "VPLMCreator"],
@@ -1007,7 +1007,7 @@ 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
- N(
1010
+ b(
1011
1011
  e.space,
1012
1012
  "ESPACE COMMUN",
1013
1013
  ["VPLMProjectLeader", "VPLMCreator"],
@@ -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
- F(
1095
+ A(
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
- F(e, t, (r) => {
1113
+ A(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) => {
@@ -1143,8 +1143,8 @@ function Me(e, t, n, s = void 0, i = void 0) {
1143
1143
  }
1144
1144
  );
1145
1145
  }
1146
- let R, x;
1147
- const A = [];
1146
+ let x, P;
1147
+ const $ = [];
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 j(
1168
+ console.log("getDatasByTenant (getDocuments)", e), await R(
1169
1169
  e,
1170
1170
  (s) => {
1171
1171
  const i = {};
@@ -1183,11 +1183,11 @@ function Ee(e, t = void 0, n = void 0) {
1183
1183
  return;
1184
1184
  }
1185
1185
  e.objIds.forEach((i, r) => {
1186
- j(
1186
+ R(
1187
1187
  e,
1188
1188
  i.objID,
1189
1189
  (o) => {
1190
- s.push({ [i.name]: o }), i.name === "dbProjets" && (R = o.affaires.map((a) => a.objectID), q(e, x)), r === e.objIds.length - 1 && (t && t(s), delete e.objIds, delete e.datas);
1190
+ s.push({ [i.name]: o }), i.name === "dbProjets" && (x = o.affaires.map((a) => a.objectID), q(e, P)), r === e.objIds.length - 1 && (t && t(s), delete e.objIds, delete e.datas);
1191
1191
  }
1192
1192
  );
1193
1193
  });
@@ -1195,10 +1195,10 @@ function Ee(e, t = void 0, n = void 0) {
1195
1195
  function q(e, t, n = void 0, s = void 0) {
1196
1196
  B(
1197
1197
  e,
1198
- R,
1198
+ x,
1199
1199
  (i) => {
1200
1200
  const r = [...t];
1201
- r.find((o) => o.objectID === i.objectId).data = i.data, x = r, A.push(i.data), n && n(A);
1201
+ r.find((o) => o.objectID === i.objectId).data = i.data, P = r, $.push(i.data), n && n($);
1202
1202
  },
1203
1203
  (i) => {
1204
1204
  s && (s(i), console.log(i));
@@ -1212,7 +1212,7 @@ const H = "FA35FB9B177A280065800EA0000F599C", z = [
1212
1212
  "usersgroup",
1213
1213
  "3dplan",
1214
1214
  "dashboard"
1215
- ], P = {
1215
+ ], M = {
1216
1216
  how: "ds6w:how",
1217
1217
  what: "ds6w:what",
1218
1218
  when: "ds6w:when",
@@ -1238,7 +1238,7 @@ function Ge(e, t, n = void 0, s = void 0) {
1238
1238
  uri: `pid://${o}`
1239
1239
  }
1240
1240
  ],
1241
- predicate: P[a],
1241
+ predicate: M[a],
1242
1242
  object: {
1243
1243
  literal: c
1244
1244
  }
@@ -1381,7 +1381,7 @@ function Ke(e, t, n = void 0, s = void 0) {
1381
1381
  uri: `pid://${i}`
1382
1382
  }
1383
1383
  ],
1384
- predicate: P[r],
1384
+ predicate: M[r],
1385
1385
  object: {
1386
1386
  literal: o
1387
1387
  }
@@ -1952,24 +1952,14 @@ 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
- }
1955
+ e.tenant && j(e, (s) => {
1956
+ console.log("serviceUrls", s);
1957
+ const i = s.services.find((r) => r.id === "businessprocess")?.url + "/api/v2";
1958
+ t && t(i);
1959
+ });
1970
1960
  }
1971
1961
  function st(e, t = void 0, n = void 0) {
1972
- e.tenant && E(e, (s) => {
1962
+ e.tenant && j(e, (s) => {
1973
1963
  console.log("serviceUrls", s);
1974
1964
  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`;
1975
1965
  f(o, {
@@ -2005,10 +1995,10 @@ function it(e) {
2005
1995
  function ot(e, t = void 0, n = void 0) {
2006
1996
  return console.log("credentials", e), new Promise((s) => {
2007
1997
  if (e.token === "" && T(e), !e.space || e.space === "") {
2008
- const o = J();
1998
+ const o = E();
2009
1999
  console.log("platformeInfo", o);
2010
2000
  }
2011
- N(
2001
+ b(
2012
2002
  e,
2013
2003
  "Common space",
2014
2004
  ["VPLMProjectLeader", "VPLMCreator"],
@@ -2019,7 +2009,7 @@ function ot(e, t = void 0, n = void 0) {
2019
2009
  },
2020
2010
  !0
2021
2011
  );
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}`;
2012
+ const i = N.now().ts, r = `https://${e.tenant}-eu1-registry.3dexperience.3ds.com/api/v1/platform/service/instance?serviceId=3dsearch&platformId=${e.tenant}`;
2023
2013
  f(r, {
2024
2014
  onComplete(o) {
2025
2015
  if (Array.isArray(JSON.parse(o))) {
@@ -2084,10 +2074,10 @@ function ot(e, t = void 0, n = void 0) {
2084
2074
  export {
2085
2075
  I as UUID,
2086
2076
  ot as _3DSearch_usersGroup,
2087
- $e as _3DSpace_Create_Doc,
2077
+ Fe as _3DSpace_Create_Doc,
2088
2078
  je as _3DSpace_bookmark_addSubsciptions,
2089
2079
  T as _3DSpace_csrf,
2090
- j as _3DSpace_download_doc,
2080
+ R as _3DSpace_download_doc,
2091
2081
  B as _3DSpace_download_multidoc,
2092
2082
  V as _3DSpace_file_update,
2093
2083
  W as _3DSpace_file_update_csr,
@@ -2095,13 +2085,13 @@ export {
2095
2085
  v as _3DSpace_get_csrf,
2096
2086
  X as _3DSpace_get_docInfo,
2097
2087
  Y as _3DSpace_get_downloadTicket_multidoc,
2098
- N as _3DSpace_get_securityContexts,
2099
- F as _3DSpace_get_ticket,
2088
+ b as _3DSpace_get_securityContexts,
2089
+ A as _3DSpace_get_ticket,
2100
2090
  Ie as _3DSpace_lifecycle_changeRevision,
2101
- Ae as _3DSpace_lifecycle_changeState,
2091
+ $e as _3DSpace_lifecycle_changeState,
2102
2092
  Ue as _3DSpace_lifecycle_getGraph,
2103
2093
  De as _3DSpace_lifecycle_getNextRevision,
2104
- Fe as _3DSpace_lifecycle_getNextStates,
2094
+ Ae as _3DSpace_lifecycle_getNextStates,
2105
2095
  qe as _3DSwym_buildDirectMessage,
2106
2096
  ze as _3DSwym_deleteIdea,
2107
2097
  te as _3DSwym_findCommunityToInstantMSG,
@@ -2121,9 +2111,9 @@ export {
2121
2111
  _e as _AppMngt_get_users,
2122
2112
  st as _Iterop_Auth_CAS,
2123
2113
  at as _Iterop_ListUsers,
2124
- J as _getPlateformInfos,
2114
+ E as _getPlateformInfos,
2125
2115
  ge as _getPlatformServices,
2126
- E as _getServiceUrl,
2116
+ j as _getServiceUrl,
2127
2117
  he as _getServiceUrl_3DPassport,
2128
2118
  nt as _getServiceUrl_Iterop,
2129
2119
  f as _httpCallAuthenticated,
@@ -2132,7 +2122,7 @@ export {
2132
2122
  fe as _setupTagger,
2133
2123
  Ge as addTagToDoc,
2134
2124
  Se as compass_getListAdditionalApps,
2135
- L as couleurs,
2125
+ J as couleurs,
2136
2126
  we as createUserGroups,
2137
2127
  q as dataMixing,
2138
2128
  Oe as deleteUserGroups,
@@ -2150,8 +2140,8 @@ export {
2150
2140
  Te as getUserGroupsList,
2151
2141
  G as getUsersGroupRules,
2152
2142
  Le as get_3DSpace_csrf,
2153
- Ne as patchUserGroups,
2154
- be as patchUserGroupsControl,
2143
+ be as patchUserGroups,
2144
+ Ne as patchUserGroupsControl,
2155
2145
  Me as pushDataIn3DSpace,
2156
2146
  ve as readUserGroupControl,
2157
2147
  Ke as removeTagToDoc,