@beam3_dev/api_module 0.0.263 → 0.0.265

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,5 +1,5 @@
1
1
  import { v4 as K } from "uuid";
2
- import { DateTime as O } from "luxon";
2
+ import { DateTime as b } from "luxon";
3
3
  import { requirejs as $, widget as A } from "@widget-lab/3ddashboard-utils";
4
4
  function B() {
5
5
  return K();
@@ -66,7 +66,7 @@ async function Se(e, t = void 0, n = void 0) {
66
66
  });
67
67
  }
68
68
  async function we(e, t = W) {
69
- let n = O.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 we(e, t = W) {
89
89
  } : s;
90
90
  for (let c of i)
91
91
  a.events.findIndex(
92
- (u) => u.start === O.fromISO(c.date).toISODate() && u.name === "Férié : " + c.comment
92
+ (u) => u.start === b.fromISO(c.date).toISODate() && u.name === "Férié : " + c.comment
93
93
  ) === -1 && a.events.push({
94
94
  name: "Férié : " + c.comment,
95
- start: O.fromISO(c.date).toISODate(),
96
- end: O.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
  });
@@ -151,7 +151,7 @@ function Te(e, t, n) {
151
151
  });
152
152
  });
153
153
  }
154
- function be(e, t = void 0) {
154
+ function Oe(e, t = void 0) {
155
155
  $(["DS/TagNavigatorProxy/TagNavigatorProxy"], (n) => {
156
156
  let s;
157
157
  s === void 0 && (s = n.createProxy({
@@ -160,7 +160,7 @@ function be(e, t = void 0) {
160
160
  }), t !== void 0 && s.addEvent("onFilterSubjectsChange", t)), s.setSubjectsTags(e);
161
161
  });
162
162
  }
163
- function Oe(e, t) {
163
+ function be(e, t) {
164
164
  $(["DS/DataDragAndDrop/DataDragAndDrop"], (n) => {
165
165
  n.droppable(e, {
166
166
  drop: t
@@ -271,7 +271,7 @@ function Fe(e, t = void 0, n = void 0) {
271
271
  }
272
272
  });
273
273
  }
274
- function Ue(e, t, n = void 0, s = void 0) {
274
+ function Re(e, t, n = void 0, s = void 0) {
275
275
  let i = `${e.space}/resources/AppsMngt/user?platform=${e.tenant}&id=${t}`;
276
276
  m(i, {
277
277
  onComplete(r, o, a) {
@@ -284,11 +284,11 @@ function Ue(e, t, n = void 0, s = void 0) {
284
284
  }
285
285
  });
286
286
  }
287
- const R = {
287
+ const U = {
288
288
  "Content-Type": "application/json",
289
289
  Accept: "application/json,text/javascript,*/*"
290
290
  };
291
- function Re(e, t, n = void 0, s = void 0) {
291
+ function Ue(e, t, n = void 0, s = void 0) {
292
292
  const { space: i, currentUser: r } = e, a = `${i}${{
293
293
  URIUGr: "/3drdfpersist/resources/v1/usersgroup"
294
294
  }.URIUGr}`, c = {
@@ -305,7 +305,7 @@ function Re(e, t, n = void 0, s = void 0) {
305
305
  };
306
306
  m(a, {
307
307
  method: "POST",
308
- headers: R,
308
+ headers: U,
309
309
  data: JSON.stringify(c),
310
310
  onComplete(d) {
311
311
  n && n(JSON.parse(d));
@@ -400,7 +400,7 @@ function Ae(e, t, n, s = void 0, i = void 0) {
400
400
  OPTsTenant: `tenant=dstenant:${o}`
401
401
  }, c = n, d = `${r}${a.URIUGr}/${t}`, u = JSON.stringify(c);
402
402
  m(d, {
403
- headers: R,
403
+ headers: U,
404
404
  method: "PATCH",
405
405
  data: u,
406
406
  type: "json",
@@ -416,7 +416,7 @@ function xe(e, t, n, s = void 0, i = void 0) {
416
416
  const { space: r } = e, a = `${r}/3drdfpersist/resources/v1/usersgroup/${t}/sharing`;
417
417
  m(a, {
418
418
  method: "PATCH",
419
- headers: R,
419
+ headers: U,
420
420
  data: JSON.stringify(n),
421
421
  type: "json",
422
422
  onComplete(d) {
@@ -553,7 +553,7 @@ function F(e, t = void 0, n = void 0) {
553
553
  }
554
554
  });
555
555
  } else
556
- b(
556
+ O(
557
557
  e,
558
558
  (s) => {
559
559
  console.log("_3DSpace_get_csrf / _3DSpace_csrf", s), t && t(s);
@@ -563,7 +563,7 @@ function F(e, t = void 0, n = void 0) {
563
563
  }
564
564
  );
565
565
  }
566
- function b(e, t = void 0, n = void 0) {
566
+ function O(e, t = void 0, n = void 0) {
567
567
  if (e.space) {
568
568
  const s = e.space + "/resources/v1/application/CSRF";
569
569
  m(s, {
@@ -835,7 +835,7 @@ function ne(e, t, n, s = void 0, i = void 0) {
835
835
  function se(e, t, n, s = void 0, i = void 0, r = void 0) {
836
836
  console.log("relatedDocAndFile", { credentials: e, receipt: t, filename: n });
837
837
  const o = (d) => d.indexOf(".") === -1 ? d : d.split(".").slice(0, -1).join(".");
838
- let a = "temp_" + O.now().ts, c = e.space + "/resources/v1/modeler/documents/?e6w-lang=fr&e6w-timezone=-120&xrequestedwith=xmlhttprequest";
838
+ let a = "temp_" + b.now().ts, c = e.space + "/resources/v1/modeler/documents/?e6w-lang=fr&e6w-timezone=-120&xrequestedwith=xmlhttprequest";
839
839
  m(c, {
840
840
  method: "POST",
841
841
  headers: {
@@ -879,7 +879,7 @@ function se(e, t, n, s = void 0, i = void 0, r = void 0) {
879
879
  }
880
880
  });
881
881
  }
882
- function U(e, t = void 0, n = void 0, s = void 0, i = void 0, r = void 0, o = !1) {
882
+ function R(e, t = void 0, n = void 0, s = void 0, i = void 0, r = void 0, o = !1) {
883
883
  const a = `${e.space}/resources/modeler/pno/person?current=true&select=preferredcredentials&select=collabspaces`;
884
884
  m(a, {
885
885
  method: "GET",
@@ -1049,7 +1049,7 @@ function ae(e, t, n = void 0, s = void 0, i = void 0) {
1049
1049
  }
1050
1050
  function Ee(e, t, n = void 0, s = void 0) {
1051
1051
  return new Promise((i) => {
1052
- if (e.token === "" && b(e), t !== void 0 && t !== "" && t !== null) {
1052
+ if (e.token === "" && O(e), t !== void 0 && t !== "" && t !== null) {
1053
1053
  const r = `${e.space}/resources/v1/modeler/dslc/maturity/getNextStates`;
1054
1054
  let o = {
1055
1055
  method: "POST",
@@ -1080,7 +1080,7 @@ function Ee(e, t, n = void 0, s = void 0) {
1080
1080
  }
1081
1081
  function Ke(e, t, n, s = void 0, i = void 0) {
1082
1082
  return new Promise((r) => {
1083
- if (e.token === "" && b(e), t !== void 0 && t !== "" && t !== null) {
1083
+ if (e.token === "" && O(e), t !== void 0 && t !== "" && t !== null) {
1084
1084
  const o = `${e.space}/resources/v1/modeler/dslc/maturity/changeState`;
1085
1085
  let a = {
1086
1086
  method: "POST",
@@ -1112,9 +1112,9 @@ function Ke(e, t, n, s = void 0, i = void 0) {
1112
1112
  }
1113
1113
  function Be(e, t, n = void 0, s = void 0) {
1114
1114
  return new Promise((i) => {
1115
- if (e.token === "" && b(e), t !== void 0 && t !== "" && t !== null) {
1115
+ if (e.token === "" && O(e), t !== void 0 && t !== "" && t !== null) {
1116
1116
  const r = `${e.space}/resources/v1/dslc/versiongraph?withThumbnail=0&withIsLastVersion=0&withAttributes=0&withCopyFrom=0&tenant=${e.tenant}`;
1117
- U(
1117
+ R(
1118
1118
  e.space,
1119
1119
  "ESPACE COMMUN",
1120
1120
  ["VPLMProjectLeader", "VPLMCreator"],
@@ -1153,9 +1153,9 @@ function Be(e, t, n = void 0, s = void 0) {
1153
1153
  }
1154
1154
  function We(e, t, n = void 0, s = void 0) {
1155
1155
  return new Promise((i) => {
1156
- if (e.token === "" && b(e), t !== void 0 && t !== "" && t !== null) {
1156
+ if (e.token === "" && O(e), t !== void 0 && t !== "" && t !== null) {
1157
1157
  const r = `${e.space}/resources/lifecycle/revise/prepare_revise_maskattributes?tenant=${e.tenant}`;
1158
- U(
1158
+ R(
1159
1159
  e.space,
1160
1160
  "ESPACE COMMUN",
1161
1161
  ["VPLMProjectLeader", "VPLMCreator"],
@@ -1200,9 +1200,9 @@ function We(e, t, n = void 0, s = void 0) {
1200
1200
  }
1201
1201
  function Xe(e, t, n, s = void 0, i = void 0) {
1202
1202
  return new Promise((r) => {
1203
- if (e.token === "" && b(e), t !== void 0 && t !== "" && t !== null) {
1203
+ if (e.token === "" && O(e), t !== void 0 && t !== "" && t !== null) {
1204
1204
  const o = `${e.space}/resources/lifecycle/revise/major?tenant=${e.tenant}`;
1205
- U(
1205
+ R(
1206
1206
  e.space,
1207
1207
  "ESPACE COMMUN",
1208
1208
  ["VPLMProjectLeader", "VPLMCreator"],
@@ -1386,7 +1386,7 @@ async function Ze(e, t = void 0, n = void 0) {
1386
1386
  (s) => {
1387
1387
  n && n(s);
1388
1388
  }
1389
- ) : (e.objID === null || e.objID === "") && b(
1389
+ ) : (e.objID === null || e.objID === "") && O(
1390
1390
  e,
1391
1391
  (s) => {
1392
1392
  t && t({ rep: s, msg: "Pas d'objID, ou invalide" });
@@ -2314,27 +2314,48 @@ function ht(e, t = void 0, n = void 0) {
2314
2314
  function yt(e, t = void 0, n = void 0) {
2315
2315
  return new Promise((s, i) => {
2316
2316
  try {
2317
- let r = null;
2318
- const o = e._3DSwym + "/api/user/getcurrent/";
2319
- w(e, (a) => {
2320
- m(o, {
2317
+ const { _3DDashboard: r, _3DSwym: o } = e;
2318
+ let a = null;
2319
+ if (o) {
2320
+ const c = e._3DSwym + "/api/user/getcurrent/";
2321
+ w(e, (d) => {
2322
+ m(c, {
2323
+ method: "GET",
2324
+ headers: {
2325
+ "X-DS-SWYM-CSRFTOKEN": d.result.ServerToken
2326
+ },
2327
+ onComplete(u, p, f) {
2328
+ const l = JSON.parse(u);
2329
+ t && t(l.result), a = l.result;
2330
+ },
2331
+ onFailure(u, p, f) {
2332
+ const l = { erreur: JSON.parse(u), headers: p, xhr: f };
2333
+ n && n(l), n && console.error(
2334
+ "ERROR | _3DSwym_get_currentUser => _3dswym_get_version | onFailure",
2335
+ u
2336
+ );
2337
+ }
2338
+ });
2339
+ });
2340
+ }
2341
+ if (!a) {
2342
+ const c = r + "/api/users/current";
2343
+ m(c, {
2321
2344
  method: "GET",
2322
- headers: {
2323
- "X-DS-SWYM-CSRFTOKEN": a.result.ServerToken
2345
+ onComplete(d, u, p) {
2346
+ const f = JSON.parse(d);
2347
+ t && t(f), f.first_name = f.firstName, f.last_name = f.lastName, a = f;
2324
2348
  },
2325
- onComplete(c, d, u) {
2326
- const p = JSON.parse(c);
2327
- t && t(p.result), r = p.result;
2328
- },
2329
- onFailure(c, d, u) {
2330
- const p = { erreur: JSON.parse(c), headers: d, xhr: u };
2331
- n && n(p), n && console.error(
2349
+ onFailure(d, u, p) {
2350
+ const f = { erreur: JSON.parse(d), headers: u, xhr: p };
2351
+ n && n(f), n && console.error(
2332
2352
  "ERROR | _3DSwym_get_currentUser => _3dswym_get_version | onFailure",
2333
- c
2353
+ d
2334
2354
  );
2335
2355
  }
2336
2356
  });
2337
- }), r ? s(r) : i("ERROR | _3DSwym_get_currentUser => CURRENT_USER is null");
2357
+ }
2358
+ a ? s(a) : i("ERROR | _3DSwym_get_currentUser => CURRENT_USER is null");
2338
2359
  } catch {
2339
2360
  }
2340
2361
  });
@@ -2424,7 +2445,7 @@ function Tt(e, t = void 0, n = void 0) {
2424
2445
  });
2425
2446
  }
2426
2447
  }
2427
- async function bt(e, t, n = void 0, s = void 0) {
2448
+ async function Ot(e, t, n = void 0, s = void 0) {
2428
2449
  if (e.tenant) {
2429
2450
  const i = e.tenant.toLowerCase();
2430
2451
  fetch(
@@ -2439,7 +2460,7 @@ async function bt(e, t, n = void 0, s = void 0) {
2439
2460
  });
2440
2461
  }
2441
2462
  }
2442
- async function Ot(e, t, n, s = void 0, i = void 0) {
2463
+ async function bt(e, t, n, s = void 0, i = void 0) {
2443
2464
  if (e.tenant) {
2444
2465
  const r = e.tenant.toLowerCase();
2445
2466
  fetch(
@@ -2520,7 +2541,7 @@ async function Ft(e, t, n, s, i = void 0, r = void 0) {
2520
2541
  });
2521
2542
  }
2522
2543
  }
2523
- async function Ut(e, t, n, s = void 0, i = void 0) {
2544
+ async function Rt(e, t, n, s = void 0, i = void 0) {
2524
2545
  if (e.tenant) {
2525
2546
  const r = `https://api.uixhome.fr/${e.tenant.toLowerCase()}/iterop/businesstable/post/create/?t=${t}&b=${encodeURIComponent(
2526
2547
  n
@@ -2537,7 +2558,7 @@ async function Ut(e, t, n, s = void 0, i = void 0) {
2537
2558
  });
2538
2559
  }
2539
2560
  }
2540
- async function Rt(e, t, n, s, i = void 0, r = void 0) {
2561
+ async function Ut(e, t, n, s, i = void 0, r = void 0) {
2541
2562
  if (e.tenant) {
2542
2563
  const o = e.tenant.toLowerCase();
2543
2564
  fetch(
@@ -2620,11 +2641,11 @@ function xt(e) {
2620
2641
  }
2621
2642
  function Pt(e, t = void 0, n = void 0) {
2622
2643
  return console.log("credentials", e), new Promise((s) => {
2623
- if (e.token === "" && b(e), !e.space || e.space === "") {
2644
+ if (e.token === "" && O(e), !e.space || e.space === "") {
2624
2645
  const o = Y();
2625
2646
  console.log("platformeInfo", o);
2626
2647
  }
2627
- U(
2648
+ R(
2628
2649
  e,
2629
2650
  "Common space",
2630
2651
  ["VPLMProjectLeader", "VPLMCreator"],
@@ -2635,7 +2656,7 @@ function Pt(e, t = void 0, n = void 0) {
2635
2656
  },
2636
2657
  !0
2637
2658
  );
2638
- const i = O.now().ts, r = `https://${e.tenant}-eu1-registry.3dexperience.3ds.com/api/v1/platform/service/instance?serviceId=3dsearch&platformId=${e.tenant}`;
2659
+ const i = b.now().ts, r = `https://${e.tenant}-eu1-registry.3dexperience.3ds.com/api/v1/platform/service/instance?serviceId=3dsearch&platformId=${e.tenant}`;
2639
2660
  m(r, {
2640
2661
  onComplete(o) {
2641
2662
  if (Array.isArray(JSON.parse(o))) {
@@ -2704,7 +2725,7 @@ export {
2704
2725
  Je as _3DSpace_Update_Doc,
2705
2726
  Ye as _3DSpace_bookmark_addSubsciptions,
2706
2727
  Ve as _3DSpace_bookmark_newWorkspace,
2707
- b as _3DSpace_csrf,
2728
+ O as _3DSpace_csrf,
2708
2729
  L as _3DSpace_download_doc,
2709
2730
  ie as _3DSpace_download_multidoc,
2710
2731
  D as _3DSpace_file_update,
@@ -2714,7 +2735,7 @@ export {
2714
2735
  P as _3DSpace_get_docInfo,
2715
2736
  ae as _3DSpace_get_downloadTicket_multidoc,
2716
2737
  De as _3DSpace_get_multiDocInfo,
2717
- U as _3DSpace_get_securityContexts,
2738
+ R as _3DSpace_get_securityContexts,
2718
2739
  j as _3DSpace_get_ticket,
2719
2740
  Xe as _3DSpace_lifecycle_changeRevision,
2720
2741
  Ke as _3DSpace_lifecycle_changeState,
@@ -2741,7 +2762,7 @@ export {
2741
2762
  pt as _3DSwym_postIdea,
2742
2763
  ut as _3DSwym_postIdeaTemplate,
2743
2764
  v as _3DSwym_sendMessageData,
2744
- Ue as _AppMngt_get_info_user,
2765
+ Re as _AppMngt_get_info_user,
2745
2766
  Fe as _AppMngt_get_users,
2746
2767
  Nt as _Iterop_AddOrRemoveRows,
2747
2768
  Ct as _Iterop_Auth_CAS,
@@ -2750,12 +2771,12 @@ export {
2750
2771
  kt as _Iterop_PatchDependencyTable,
2751
2772
  vt as _Iterop_PutDependencyTable,
2752
2773
  It as _Iterop_businessTableSearchInRows,
2753
- Ut as _Iterop_createBusinessTable,
2754
- bt as _Iterop_getAllBusinessTables,
2755
- Ot as _Iterop_getOneBusinessTable,
2774
+ Rt as _Iterop_createBusinessTable,
2775
+ Ot as _Iterop_getAllBusinessTables,
2776
+ bt as _Iterop_getOneBusinessTable,
2756
2777
  $t as _Iterop_getOneBusinessTableRows,
2757
2778
  Tt as _Iterop_jwtUser,
2758
- Rt as _Iterop_runProcess,
2779
+ Ut as _Iterop_runProcess,
2759
2780
  Ft as _Iterop_updateBusinessTable,
2760
2781
  Y as _getPlateformInfos,
2761
2782
  $e as _getPlatformServices,
@@ -2764,13 +2785,13 @@ export {
2764
2785
  wt as _getServiceUrl_Iterop,
2765
2786
  m as _httpCallAuthenticated,
2766
2787
  Te as _setDraggable,
2767
- Oe as _setDroppable,
2768
- be as _setupTagger,
2788
+ be as _setDroppable,
2789
+ Oe as _setupTagger,
2769
2790
  nt as addTagToDoc,
2770
2791
  X as chunkArray,
2771
2792
  Ie as compass_getListAdditionalApps,
2772
2793
  W as couleurs,
2773
- Re as createUserGroups,
2794
+ Ue as createUserGroups,
2774
2795
  oe as dataMixing,
2775
2796
  ve as deleteUserGroups,
2776
2797
  Se as findAdresse,