@beam3_dev/api_module 0.0.226 → 0.0.227

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,8 +1,8 @@
1
- import { v4 as V } from "uuid";
2
- import { DateTime as v } from "luxon";
3
- import { requirejs as $, widget as D } from "@widget-lab/3ddashboard-utils";
4
- function L() {
5
- return V();
1
+ import { v4 as B } from "uuid";
2
+ import { DateTime as $ } from "luxon";
3
+ import { requirejs as I, widget as D } from "@widget-lab/3ddashboard-utils";
4
+ function V() {
5
+ return B();
6
6
  }
7
7
  const W = {
8
8
  b3M3Yellow: "#FFB300",
@@ -66,7 +66,7 @@ async function ye(e, t = void 0, s = void 0) {
66
66
  });
67
67
  }
68
68
  async function Se(e, t = W) {
69
- let s = v.now().year;
69
+ let s = $.now().year;
70
70
  const n = 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 Se(e, t = W) {
89
89
  } : n;
90
90
  for (let c of i)
91
91
  a.events.findIndex(
92
- (p) => p.start === v.fromISO(c.date).toISODate() && p.name === "Férié : " + c.comment
92
+ (p) => p.start === $.fromISO(c.date).toISODate() && p.name === "Férié : " + c.comment
93
93
  ) === -1 && a.events.push({
94
94
  name: "Férié : " + c.comment,
95
- start: v.fromISO(c.date).toISODate(),
96
- end: v.fromISO(c.date).toISODate(),
95
+ start: $.fromISO(c.date).toISODate(),
96
+ end: $.fromISO(c.date).toISODate(),
97
97
  color: t.b3BusinnessDays,
98
98
  timed: !1
99
99
  });
@@ -139,12 +139,12 @@ async function _e(e, t, s = !0) {
139
139
  return n === -1 ? e.events.push(t) : s ? e.events[n] = t : e.events.splice(n, 1), e.length > 0 && e.sort((i, r) => i.start - r.start), e;
140
140
  }
141
141
  function m(e, t) {
142
- $(["DS/WAFData/WAFData"], (s) => {
142
+ I(["DS/WAFData/WAFData"], (s) => {
143
143
  s.authenticatedRequest(e, t);
144
144
  });
145
145
  }
146
146
  function we(e, t, s) {
147
- $(["DS/DataDragAndDrop/DataDragAndDrop"], (n) => {
147
+ I(["DS/DataDragAndDrop/DataDragAndDrop"], (n) => {
148
148
  n.draggable(e, {
149
149
  data: t,
150
150
  start: s
@@ -152,7 +152,7 @@ function we(e, t, s) {
152
152
  });
153
153
  }
154
154
  function Ce(e, t = void 0) {
155
- $(["DS/TagNavigatorProxy/TagNavigatorProxy"], (s) => {
155
+ I(["DS/TagNavigatorProxy/TagNavigatorProxy"], (s) => {
156
156
  let n;
157
157
  n === void 0 && (n = s.createProxy({
158
158
  widgetId: D.id,
@@ -161,14 +161,14 @@ function Ce(e, t = void 0) {
161
161
  });
162
162
  }
163
163
  function Te(e, t) {
164
- $(["DS/DataDragAndDrop/DataDragAndDrop"], (s) => {
164
+ I(["DS/DataDragAndDrop/DataDragAndDrop"], (s) => {
165
165
  s.droppable(e, {
166
166
  drop: t
167
167
  });
168
168
  });
169
169
  }
170
170
  async function be(e, t = void 0, s = void 0) {
171
- await $(
171
+ await I(
172
172
  ["DS/i3DXCompassServices/i3DXCompassServices"],
173
173
  (n) => {
174
174
  (!e || e === "") && (e = D.getValue("PlatFormInstanceId")), (!e || e === "") && (e = void 0), t && t(
@@ -183,7 +183,7 @@ async function be(e, t = void 0, s = void 0) {
183
183
  }
184
184
  function Y() {
185
185
  let e = {};
186
- return $(["DS/PlatformAPI/PlatformAPI"], (t) => {
186
+ return I(["DS/PlatformAPI/PlatformAPI"], (t) => {
187
187
  const s = t.getTenant(), n = t.getUser(), i = t.getAllApplicationConfigurations(), r = t.getApplicationConfiguration(
188
188
  "com.3ds.wp.passport.cors"
189
189
  );
@@ -284,7 +284,7 @@ function ve(e, t, s = void 0, n = void 0) {
284
284
  }
285
285
  });
286
286
  }
287
- const U = {
287
+ const x = {
288
288
  "Content-Type": "application/json",
289
289
  Accept: "application/json,text/javascript,*/*"
290
290
  };
@@ -305,7 +305,7 @@ function Ne(e, t, s = void 0, n = void 0) {
305
305
  };
306
306
  m(a, {
307
307
  method: "POST",
308
- headers: U,
308
+ headers: x,
309
309
  data: JSON.stringify(c),
310
310
  onComplete(d) {
311
311
  s && s(JSON.parse(d));
@@ -400,7 +400,7 @@ function Fe(e, t, s, n = void 0, i = void 0) {
400
400
  OPTsTenant: `tenant=dstenant:${o}`
401
401
  }, c = s, d = `${r}${a.URIUGr}/${t}`, p = JSON.stringify(c);
402
402
  m(d, {
403
- headers: U,
403
+ headers: x,
404
404
  method: "PATCH",
405
405
  data: p,
406
406
  type: "json",
@@ -412,11 +412,11 @@ function Fe(e, t, s, n = void 0, i = void 0) {
412
412
  }
413
413
  });
414
414
  }
415
- function Ue(e, t, s, n = void 0, i = void 0) {
415
+ function xe(e, t, s, n = 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: U,
419
+ headers: x,
420
420
  data: JSON.stringify(s),
421
421
  type: "json",
422
422
  onComplete(d) {
@@ -427,7 +427,7 @@ function Ue(e, t, s, n = void 0, i = void 0) {
427
427
  }
428
428
  });
429
429
  }
430
- function xe(e, t, s = void 0, n = void 0) {
430
+ function Ue(e, t, s = void 0, n = void 0) {
431
431
  const { space: i } = e, o = `${i}/3drdfpersist/resources/v1/usersgroup/${t}/sharing`;
432
432
  m(o, {
433
433
  opts: {
@@ -478,7 +478,7 @@ var Z = function(e, t, s, n) {
478
478
  p >= 0 ? (u = d.substr(0, p), f = d.substr(p + 1)) : (u = d, f = ""), l = decodeURIComponent(u), g = decodeURIComponent(f), Q(i, l) ? Array.isArray(i[l]) ? i[l].push(g) : i[l] = [i[l], g] : i[l] = g;
479
479
  }
480
480
  return i;
481
- }, I = function(e) {
481
+ }, v = function(e) {
482
482
  switch (typeof e) {
483
483
  case "string":
484
484
  return e;
@@ -491,15 +491,15 @@ var Z = function(e, t, s, n) {
491
491
  }
492
492
  }, ee = function(e, t, s, n) {
493
493
  return t = t || "&", s = s || "=", e === null && (e = void 0), typeof e == "object" ? Object.keys(e).map(function(i) {
494
- var r = encodeURIComponent(I(i)) + s;
494
+ var r = encodeURIComponent(v(i)) + s;
495
495
  return Array.isArray(e[i]) ? e[i].map(function(o) {
496
- return r + encodeURIComponent(I(o));
497
- }).join(t) : r + encodeURIComponent(I(e[i]));
498
- }).filter(Boolean).join(t) : n ? encodeURIComponent(I(n)) + s + encodeURIComponent(I(e)) : "";
496
+ return r + encodeURIComponent(v(o));
497
+ }).join(t) : r + encodeURIComponent(v(e[i]));
498
+ }).filter(Boolean).join(t) : n ? encodeURIComponent(v(n)) + s + encodeURIComponent(v(e)) : "";
499
499
  };
500
500
  N.decode = N.parse = Z;
501
501
  N.encode = N.stringify = ee;
502
- async function M(e, t = void 0, s = void 0, n = void 0) {
502
+ async function L(e, t = void 0, s = void 0, n = void 0) {
503
503
  const i = e.space;
504
504
  if (t === void 0) {
505
505
  console.log("Le paramètre docid est obligatoire");
@@ -582,7 +582,7 @@ function O(e, t = void 0, s = void 0) {
582
582
  } else
583
583
  s && s("ERROR : url du 3DSpace non défini.");
584
584
  }
585
- function x(e, t = void 0, s = void 0) {
585
+ function U(e, t = void 0, s = void 0) {
586
586
  let n = e.space + `/resources/v1/modeler/documents/${e.objID}/files/DownloadTicket`;
587
587
  k(
588
588
  e,
@@ -628,7 +628,7 @@ function Re(e, t, s, n = void 0, i = void 0) {
628
628
  }
629
629
  });
630
630
  }
631
- function J(e, t, s, n, i, r = void 0, o = void 0) {
631
+ function M(e, t, s, n, i, r = void 0, o = void 0) {
632
632
  const a = () => te(
633
633
  e,
634
634
  t,
@@ -706,12 +706,12 @@ function te(e, t, s, n, i, r, o = void 0, a = void 0) {
706
706
  });
707
707
  }
708
708
  async function De(e, t, s, n = void 0, i = void 0) {
709
- e.space, e.token, e.ctx, M(
709
+ e.space, e.token, e.ctx, L(
710
710
  e,
711
711
  t,
712
712
  (r) => {
713
713
  const o = r.data[0].relateddata.files[0].id, a = r.data[0].dataelements.secondaryTitle && r.data[0].dataelements.secondaryTitle !== "" ? r.data[0].dataelements.secondaryTitle : r.data[0].dataelements.title;
714
- J(
714
+ M(
715
715
  e,
716
716
  t,
717
717
  o,
@@ -737,7 +737,10 @@ async function Le(e, t, s, n, i = void 0, r = void 0) {
737
737
  m(d, {
738
738
  method: "PUT",
739
739
  headers: {
740
- ENO_CSRF_TOKEN: a
740
+ ENO_CSRF_TOKEN: a,
741
+ Accept: "application/json",
742
+ "Content-Type": "application/json",
743
+ SecurityContext: c
741
744
  },
742
745
  onComplete(p, u, f) {
743
746
  const l = JSON.parse(p).csrf;
@@ -750,12 +753,10 @@ async function Le(e, t, s, n, i = void 0, r = void 0) {
750
753
  method: "POST",
751
754
  data: y,
752
755
  onComplete(w) {
753
- let T = L(), j = {
756
+ let T = "temp_" + $.now().ts, j = {
754
757
  method: "POST",
755
758
  headers: {
756
- ENO_CSRF_TOKEN: a,
757
- Accept: "application/json",
758
- "Content-Type": "application/json",
759
+ ENO_CSRF_TOKEN: l.value,
759
760
  SecurityContext: encodeURIComponent("ctx::" + c)
760
761
  },
761
762
  data: JSON.stringify({
@@ -764,9 +765,7 @@ async function Le(e, t, s, n, i = void 0, r = void 0) {
764
765
  {
765
766
  type: "Document",
766
767
  dataelements: {
767
- title: S(s),
768
- description: n
769
- // policy: "Document Release",
768
+ title: S(s)
770
769
  },
771
770
  relateddata: {
772
771
  files: [
@@ -854,7 +853,7 @@ function A(e, t = void 0, s = void 0, n = void 0, i = void 0, r = void 0, o = !1
854
853
  }
855
854
  });
856
855
  }
857
- async function G(e, t = void 0, s = void 0) {
856
+ async function J(e, t = void 0, s = void 0) {
858
857
  return (!e.objID || e.objID === "") && (console.warn(
859
858
  "_3DSpace_download_doc() / Le paramètre objectId est obligatoire"
860
859
  ), s && s(
@@ -870,7 +869,7 @@ async function G(e, t = void 0, s = void 0) {
870
869
  console.log("☠️ error => ", n);
871
870
  }
872
871
  ), new Promise((n, i) => {
873
- x(
872
+ U(
874
873
  e,
875
874
  (r) => {
876
875
  e?.returnType === "blob" ? (console.log("ticketURL blob", r), fetch(r).then((o) => o.blob()).then((o) => {
@@ -1250,7 +1249,7 @@ function We(e, t = void 0, s = void 0) {
1250
1249
  });
1251
1250
  }
1252
1251
  function Xe(e, t, s, n) {
1253
- x(
1252
+ U(
1254
1253
  e.space,
1255
1254
  t,
1256
1255
  (i) => {
@@ -1268,7 +1267,7 @@ function Xe(e, t, s, n) {
1268
1267
  }
1269
1268
  async function qe(e, t, s = void 0, n = void 0) {
1270
1269
  return new Promise((i) => {
1271
- x(e, t, (r) => {
1270
+ U(e, t, (r) => {
1272
1271
  m(r, {
1273
1272
  onComplete: (o, a, c) => (i(JSON.parse(o)), s && s(JSON.parse(o), a, c), i),
1274
1273
  onFailure: (o, a, c) => {
@@ -1285,7 +1284,7 @@ function Ye(e, t, s, n = void 0, i = void 0) {
1285
1284
  s,
1286
1285
  (o) => {
1287
1286
  const a = o.data[0].relateddata.files[0].id, c = o.data[0].dataelements.secondaryTitle !== "" ? o.data[0].dataelements.secondaryTitle : o.data[0].dataelements.title;
1288
- J(
1287
+ M(
1289
1288
  e,
1290
1289
  s,
1291
1290
  a,
@@ -1301,7 +1300,7 @@ function Ye(e, t, s, n = void 0, i = void 0) {
1301
1300
  }
1302
1301
  );
1303
1302
  }
1304
- let E, K;
1303
+ let G, E;
1305
1304
  const P = [];
1306
1305
  async function He(e, t = void 0, s = void 0) {
1307
1306
  e.objID && e.objID !== "" ? k(
@@ -1323,7 +1322,7 @@ async function He(e, t = void 0, s = void 0) {
1323
1322
  );
1324
1323
  }
1325
1324
  async function ze(e, t = void 0, s = void 0) {
1326
- console.log("getDatasByTenant (getDocuments)", e), await G(
1325
+ console.log("getDatasByTenant (getDocuments)", e), await J(
1327
1326
  e,
1328
1327
  (n) => {
1329
1328
  const i = {};
@@ -1341,11 +1340,11 @@ function Qe(e, t = void 0, s = void 0) {
1341
1340
  return;
1342
1341
  }
1343
1342
  e.objIds.forEach((i, r) => {
1344
- G(
1343
+ J(
1345
1344
  e,
1346
1345
  i.objID,
1347
1346
  (o) => {
1348
- n.push({ [i.name]: o }), i.name === "dbProjets" && (E = o.affaires.map((a) => a.objectID), ie(e, K)), r === e.objIds.length - 1 && (t && t(n), delete e.objIds, delete e.datas);
1347
+ n.push({ [i.name]: o }), i.name === "dbProjets" && (G = o.affaires.map((a) => a.objectID), ie(e, E)), r === e.objIds.length - 1 && (t && t(n), delete e.objIds, delete e.datas);
1349
1348
  }
1350
1349
  );
1351
1350
  });
@@ -1353,10 +1352,10 @@ function Qe(e, t = void 0, s = void 0) {
1353
1352
  function ie(e, t, s = void 0, n = void 0) {
1354
1353
  ne(
1355
1354
  e,
1356
- E,
1355
+ G,
1357
1356
  (i) => {
1358
1357
  const r = [...t];
1359
- r.find((o) => o.objectID === i.objectId).data = i.data, K = r, P.push(i.data), s && s(P);
1358
+ r.find((o) => o.objectID === i.objectId).data = i.data, E = r, P.push(i.data), s && s(P);
1360
1359
  },
1361
1360
  (i) => {
1362
1361
  n && (n(i), console.log(i));
@@ -1370,7 +1369,7 @@ const ae = "FA35FB9B177A280065800EA0000F599C", oe = [
1370
1369
  "usersgroup",
1371
1370
  "3dplan",
1372
1371
  "dashboard"
1373
- ], B = {
1372
+ ], K = {
1374
1373
  how: "ds6w:how",
1375
1374
  what: "ds6w:what",
1376
1375
  when: "ds6w:when",
@@ -1396,7 +1395,7 @@ function Ze(e, t, s = void 0, n = void 0) {
1396
1395
  uri: `pid://${o}`
1397
1396
  }
1398
1397
  ],
1399
- predicate: B[a],
1398
+ predicate: K[a],
1400
1399
  object: {
1401
1400
  literal: c
1402
1401
  }
@@ -1414,7 +1413,7 @@ function Ze(e, t, s = void 0, n = void 0) {
1414
1413
  JSON.parse(f);
1415
1414
  const l = {};
1416
1415
  setTimeout(() => {
1417
- M(
1416
+ L(
1418
1417
  e,
1419
1418
  o,
1420
1419
  (g) => {
@@ -1451,7 +1450,7 @@ function ce(e, t, s = void 0, n = void 0) {
1451
1450
  }, o = `${r.baseUrl}${r.uri}`, a = {
1452
1451
  "Content-Type": "application/json",
1453
1452
  Accept: "application/json,text/javascript,*/*"
1454
- }, c = L(), d = {
1453
+ }, c = V(), d = {
1455
1454
  with_indexing_date: !0,
1456
1455
  with_synthesis: !0,
1457
1456
  with_nls: !1,
@@ -1539,7 +1538,7 @@ function et(e, t, s = void 0, n = void 0) {
1539
1538
  uri: `pid://${i}`
1540
1539
  }
1541
1540
  ],
1542
- predicate: B[r],
1541
+ predicate: K[r],
1543
1542
  object: {
1544
1543
  literal: o
1545
1544
  }
@@ -2472,7 +2471,7 @@ function jt(e, t = void 0, s = void 0) {
2472
2471
  },
2473
2472
  !0
2474
2473
  );
2475
- const i = v.now().ts, r = `https://${e.tenant}-eu1-registry.3dexperience.3ds.com/api/v1/platform/service/instance?serviceId=3dsearch&platformId=${e.tenant}`;
2474
+ const i = $.now().ts, r = `https://${e.tenant}-eu1-registry.3dexperience.3ds.com/api/v1/platform/service/instance?serviceId=3dsearch&platformId=${e.tenant}`;
2476
2475
  m(r, {
2477
2476
  onComplete(o) {
2478
2477
  if (Array.isArray(JSON.parse(o))) {
@@ -2535,24 +2534,24 @@ function jt(e, t = void 0, s = void 0) {
2535
2534
  });
2536
2535
  }
2537
2536
  export {
2538
- L as UUID,
2537
+ V as UUID,
2539
2538
  jt as _3DSearch_usersGroup,
2540
2539
  Le as _3DSpace_Create_Doc,
2541
2540
  De as _3DSpace_Update_Doc,
2542
2541
  Ve as _3DSpace_bookmark_addSubsciptions,
2543
2542
  Be as _3DSpace_bookmark_newWorkspace,
2544
2543
  O as _3DSpace_csrf,
2545
- G as _3DSpace_download_doc,
2544
+ J as _3DSpace_download_doc,
2546
2545
  ne as _3DSpace_download_multidoc,
2547
- J as _3DSpace_file_update,
2546
+ M as _3DSpace_file_update,
2548
2547
  te as _3DSpace_file_update_csr,
2549
2548
  Re as _3DSpace_file_url_csr,
2550
2549
  k as _3DSpace_get_csrf,
2551
- M as _3DSpace_get_docInfo,
2550
+ L as _3DSpace_get_docInfo,
2552
2551
  se as _3DSpace_get_downloadTicket_multidoc,
2553
2552
  Pe as _3DSpace_get_multiDocInfo,
2554
2553
  A as _3DSpace_get_securityContexts,
2555
- x as _3DSpace_get_ticket,
2554
+ U as _3DSpace_get_ticket,
2556
2555
  Ke as _3DSpace_lifecycle_changeRevision,
2557
2556
  Je as _3DSpace_lifecycle_changeState,
2558
2557
  Ge as _3DSpace_lifecycle_getGraph,
@@ -2622,9 +2621,9 @@ export {
2622
2621
  H as getUsersGroupRules,
2623
2622
  He as get_3DSpace_csrf,
2624
2623
  Fe as patchUserGroups,
2625
- Ue as patchUserGroupsControl,
2624
+ xe as patchUserGroupsControl,
2626
2625
  Ye as pushDataIn3DSpace,
2627
- xe as readUserGroupControl,
2626
+ Ue as readUserGroupControl,
2628
2627
  et as removeTagToDoc,
2629
2628
  At as sayHello,
2630
2629
  _e as updateEvent