@beam3_dev/api_module 0.0.156 → 0.0.158

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 E } from "uuid";
2
2
  import { DateTime as v } from "luxon";
3
- import { requirejs as O, widget as D } from "@widget-lab/3ddashboard-utils";
4
- function P() {
3
+ import { requirejs as O, widget as P } from "@widget-lab/3ddashboard-utils";
4
+ function R() {
5
5
  return E();
6
6
  }
7
7
  const G = {
@@ -117,16 +117,16 @@ function Se(e, t, n) {
117
117
  });
118
118
  });
119
119
  }
120
- function ye(e, t = void 0) {
120
+ function _e(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: D.id,
124
+ widgetId: P.id,
125
125
  filteringMode: "WithFilteringServices"
126
126
  }), t !== void 0 && s.addEvent("onFilterSubjectsChange", t)), s.setSubjectsTags(e);
127
127
  });
128
128
  }
129
- function _e(e, t) {
129
+ function ye(e, t) {
130
130
  O(["DS/DataDragAndDrop/DataDragAndDrop"], (n) => {
131
131
  n.droppable(e, {
132
132
  drop: t
@@ -137,7 +137,7 @@ async function we(e, t = void 0, n = void 0) {
137
137
  await O(
138
138
  ["DS/i3DXCompassServices/i3DXCompassServices"],
139
139
  (s) => {
140
- (!e || e === "") && (e = D.getValue("PlatFormInstanceId")), (!e || e === "") && (e = void 0), t && t(
140
+ (!e || e === "") && (e = P.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 be(e, t, n = void 0, s = void 0) {
250
250
  }
251
251
  });
252
252
  }
253
- const U = {
253
+ const F = {
254
254
  "Content-Type": "application/json",
255
255
  Accept: "application/json,text/javascript,*/*"
256
256
  };
@@ -271,7 +271,7 @@ function Ne(e, t, n = void 0, s = void 0) {
271
271
  };
272
272
  m(i, {
273
273
  method: "POST",
274
- headers: U,
274
+ headers: F,
275
275
  data: JSON.stringify(c),
276
276
  onComplete(d) {
277
277
  n && n(JSON.parse(d));
@@ -329,14 +329,14 @@ function Ie(e, t = void 0, n = void 0) {
329
329
  onComplete(l) {
330
330
  const p = JSON.parse(l), f = {}, u = p.groups.filter((g) => g.uri.startsWith("uuid:"));
331
331
  if (a && Object.keys(a).length > 0) {
332
- const g = u.filter((y) => y.owner === a.email), h = u.filter((y) => y.members.includes(a.email)), S = g.concat(h);
332
+ const g = u.filter((_) => _.owner === a.email), h = u.filter((_) => _.members.includes(a.email)), S = g.concat(h);
333
333
  f.iam = S, f.UG = u, f.iamMember = h, V(
334
334
  e,
335
- (y) => {
336
- f.rules = y, t && t(f);
335
+ (_) => {
336
+ f.rules = _, t && t(f);
337
337
  },
338
- (y) => {
339
- n && n(y);
338
+ (_) => {
339
+ n && n(_);
340
340
  }
341
341
  );
342
342
  }
@@ -366,7 +366,7 @@ function Ae(e, t, n, s = void 0, a = void 0) {
366
366
  OPTsTenant: `tenant=dstenant:${o}`
367
367
  }, c = n, d = `${r}${i.URIUGr}/${t}`, l = JSON.stringify(c);
368
368
  m(d, {
369
- headers: U,
369
+ headers: F,
370
370
  method: "PATCH",
371
371
  data: l,
372
372
  type: "json",
@@ -382,7 +382,7 @@ function ke(e, t, n, s = void 0, a = void 0) {
382
382
  const { space: r } = e, i = `${r}/3drdfpersist/resources/v1/usersgroup/${t}/sharing`;
383
383
  m(i, {
384
384
  method: "PATCH",
385
- headers: U,
385
+ headers: F,
386
386
  data: JSON.stringify(n),
387
387
  type: "json",
388
388
  onComplete(d) {
@@ -393,7 +393,7 @@ function ke(e, t, n, s = void 0, a = void 0) {
393
393
  }
394
394
  });
395
395
  }
396
- function Ue(e, t, n = void 0, s = void 0) {
396
+ function Fe(e, t, n = void 0, s = void 0) {
397
397
  const { space: a } = e, o = `${a}/3drdfpersist/resources/v1/usersgroup/${t}/sharing`;
398
398
  m(o, {
399
399
  opts: {
@@ -482,7 +482,7 @@ async function H(e, t = void 0, n = void 0, s = void 0) {
482
482
  }
483
483
  });
484
484
  }
485
- async function Fe(e, t = void 0, n = void 0, s = void 0) {
485
+ async function Ue(e, t = void 0, n = void 0, s = void 0) {
486
486
  const a = e.space;
487
487
  if (t === void 0) {
488
488
  console.log("Le paramètre docids est obligatoire");
@@ -548,7 +548,7 @@ function T(e, t = void 0, n = void 0) {
548
548
  } else
549
549
  n && n("ERROR : url du 3DSpace non défini.");
550
550
  }
551
- function F(e, t = void 0, n = void 0) {
551
+ function U(e, t = void 0, n = void 0) {
552
552
  let s = e.space + `/resources/v1/modeler/documents/${e.objID}/files/DownloadTicket`;
553
553
  A(
554
554
  e,
@@ -625,7 +625,7 @@ function q(e, t, n, s, a, r, o = void 0, i = void 0) {
625
625
  u.append("__fcs__jobTicket", f.ticket), u.append("file_0", s, a);
626
626
  const g = {};
627
627
  g.method = "POST", g.data = u, g.onComplete = function(h) {
628
- let S = "temp_" + Date.now(), y = {
628
+ let S = "temp_" + Date.now(), _ = {
629
629
  method: "PUT",
630
630
  headers: {
631
631
  ENO_CSRF_TOKEN: r
@@ -647,16 +647,16 @@ function q(e, t, n, s, a, r, o = void 0, i = void 0) {
647
647
  }]
648
648
  }),
649
649
  type: "json",
650
- onComplete(_) {
651
- o && o(_);
650
+ onComplete(y) {
651
+ o && o(y);
652
652
  },
653
- onFailure(_) {
654
- i && i(_);
653
+ onFailure(y) {
654
+ i && i(y);
655
655
  }
656
656
  };
657
657
  m(
658
658
  e.space + "/resources/v1/modeler/documents",
659
- y
659
+ _
660
660
  );
661
661
  }, g.onFailure = function(h) {
662
662
  i && i(h);
@@ -664,7 +664,7 @@ function q(e, t, n, s, a, r, o = void 0, i = void 0) {
664
664
  }
665
665
  });
666
666
  }
667
- async function Re(e, t, n, s, a = void 0, r = void 0) {
667
+ async function De(e, t, n, s, a = void 0, r = void 0) {
668
668
  const o = e.space, i = e.token, c = e.ctx, d = new FormData(), l = new Blob([JSON.stringify(t)], {
669
669
  type: "text/plain"
670
670
  }), p = {
@@ -711,24 +711,24 @@ async function Re(e, t, n, s, a = void 0, r = void 0) {
711
711
  }
712
712
  }]
713
713
  },
714
- tempId: P()
714
+ tempId: R()
715
715
  }]
716
716
  }),
717
717
  type: "json",
718
718
  timeout: 0,
719
- onComplete: y,
720
- onFailure: _
719
+ onComplete: _,
720
+ onFailure: y
721
721
  };
722
722
  c !== "" && m(p.url_Post, k);
723
723
  } else
724
724
  console.warn("le store est vide");
725
725
  },
726
- onFailure: _
726
+ onFailure: y
727
727
  };
728
- function y(C) {
728
+ function _(C) {
729
729
  console.log("Success -- response ", C.data[0]), a && a(C);
730
730
  }
731
- function _(C, k) {
731
+ function y(C, k) {
732
732
  console.log("Erreur -- response ", C, `
733
733
  headers `, k), r && r(C);
734
734
  }
@@ -749,28 +749,28 @@ function b(e, t = void 0, n = void 0, s = void 0, a = void 0, r = void 0, o = !1
749
749
  p = t;
750
750
  let h = g.couples;
751
751
  h = h.filter(
752
- (S, y, _) => y === _.findIndex(
752
+ (S, _, y) => _ === y.findIndex(
753
753
  (C) => C.organization.pid === S.organization.pid && C.role.pid === S.role.pid
754
754
  )
755
755
  ), n && (Array.isArray(n) ? n.forEach((S) => {
756
- u || h.forEach((y) => {
757
- if (S === y.role.name && s === y.organization.title)
756
+ u || h.forEach((_) => {
757
+ if (S === _.role.name && s === _.organization.title)
758
758
  u = S, f = s;
759
- else if (S === y.role.name) {
760
- let _ = h.filter(
759
+ else if (S === _.role.name) {
760
+ let y = h.filter(
761
761
  (C) => C.role.name === S
762
762
  );
763
- _.length === 1 ? (u = _[0].role.name, f = _[0].organization.title) : r(_);
763
+ y.length === 1 ? (u = y[0].role.name, f = y[0].organization.title) : r(y);
764
764
  }
765
765
  });
766
766
  }) : h.forEach((S) => {
767
767
  if (n === S.role.name && s === S.organization.title)
768
768
  u = n, f = s;
769
769
  else if (n === S.role.name) {
770
- let y = h.filter(
771
- (_) => _.role.name === n
770
+ let _ = h.filter(
771
+ (y) => y.role.name === n
772
772
  );
773
- y.length === 1 ? (u = y[0].role.name, f = y[0].organization.title) : r(y);
773
+ _.length === 1 ? (u = _[0].role.name, f = _[0].organization.title) : r(_);
774
774
  }
775
775
  }));
776
776
  }
@@ -786,11 +786,11 @@ function b(e, t = void 0, n = void 0, s = void 0, a = void 0, r = void 0, o = !1
786
786
  });
787
787
  }
788
788
  async function x(e, t = void 0, n = void 0) {
789
- return (!e.objID || e.objID === "") && console.warn(
789
+ return (!e.objID || e.objID === "") && (console.warn(
790
790
  "_3DSpace_download_doc() / Le paramètre objectId est obligatoire"
791
- ), (e.space === "" || !e.space) && console.warn(
791
+ ), n && n("_3DSpace_download_doc() / Le paramètre objectId est obligatoire")), (e.space === "" || !e.space) && (console.warn(
792
792
  "_3DSpace_download_doc() / Le paramètre space est obligatoire"
793
- ), (e.token === "" || !e.token) && W(
793
+ ), n && n("_3DSpace_download_doc() / Le paramètre space est obligatoire")), (e.token === "" || !e.token) && W(
794
794
  e,
795
795
  (s) => {
796
796
  e.token = s;
@@ -799,10 +799,14 @@ async function x(e, t = void 0, n = void 0) {
799
799
  console.log("☠️ error => ", s);
800
800
  }
801
801
  ), new Promise((s, a) => {
802
- F(
802
+ U(
803
803
  e,
804
804
  (r) => {
805
- m(r, {
805
+ e?.returnType === "blob" ? (console.log("ticketURL blob", r), fetch(r).then((o) => o.blob()).then((o) => {
806
+ t && t(o);
807
+ }).catch((o) => {
808
+ n && n(o);
809
+ })) : m(r, {
806
810
  onComplete(o) {
807
811
  let i;
808
812
  try {
@@ -911,7 +915,7 @@ function Z(e, t, n = void 0, s = void 0, a = void 0) {
911
915
  }
912
916
  });
913
917
  }
914
- function De(e, t, n = void 0, s = void 0) {
918
+ function Pe(e, t, n = void 0, s = void 0) {
915
919
  return new Promise((a) => {
916
920
  if (e.token === "" && T(e), t !== void 0 && t !== "" && t !== null) {
917
921
  const r = `${e.space}/resources/v1/modeler/dslc/maturity/getNextStates`;
@@ -950,7 +954,7 @@ function De(e, t, n = void 0, s = void 0) {
950
954
  }
951
955
  });
952
956
  }
953
- function Pe(e, t, n, s = void 0, a = void 0) {
957
+ function Re(e, t, n, s = void 0, a = void 0) {
954
958
  return new Promise((r) => {
955
959
  if (e.token === "" && T(e), t !== void 0 && t !== "" && t !== null) {
956
960
  const o = `${e.space}/resources/v1/modeler/dslc/maturity/changeState`;
@@ -1196,7 +1200,7 @@ function Ge(e, t = void 0, n = void 0) {
1196
1200
  });
1197
1201
  }
1198
1202
  function Ke(e, t, n, s) {
1199
- F(
1203
+ U(
1200
1204
  e.space,
1201
1205
  t,
1202
1206
  (a) => {
@@ -1214,7 +1218,7 @@ function Ke(e, t, n, s) {
1214
1218
  }
1215
1219
  async function Ve(e, t, n = void 0, s = void 0) {
1216
1220
  return new Promise((a) => {
1217
- F(e, t, (r) => {
1221
+ U(e, t, (r) => {
1218
1222
  m(r, {
1219
1223
  onComplete: (o, i, c) => (a(JSON.parse(o)), n && n(JSON.parse(o), i, c), a),
1220
1224
  onFailure: (o, i, c) => {
@@ -1364,15 +1368,15 @@ function He(e, t, n = void 0, s = void 0) {
1364
1368
  e,
1365
1369
  o,
1366
1370
  (g) => {
1367
- const h = g.data[0].dataelements.title, S = g.data[0].dataelements.fileExtension !== void 0 ? g.data[0].dataelements.fileExtension : "", y = g.data[0].relateddata.ownerInfo[0].dataelements.name;
1368
- u.name = h, u.ext = S, u.createBy = y, t.info = { ...u }, ie(
1371
+ const h = g.data[0].dataelements.title, S = g.data[0].dataelements.fileExtension !== void 0 ? g.data[0].dataelements.fileExtension : "", _ = g.data[0].relateddata.ownerInfo[0].dataelements.name;
1372
+ u.name = h, u.ext = S, u.createBy = _, t.info = { ...u }, ie(
1369
1373
  e,
1370
1374
  t,
1371
- (_) => {
1372
- n && n(_);
1375
+ (y) => {
1376
+ n && n(y);
1373
1377
  },
1374
- (_) => {
1375
- s && s(_);
1378
+ (y) => {
1379
+ s && s(y);
1376
1380
  }
1377
1381
  );
1378
1382
  },
@@ -1397,7 +1401,7 @@ function ie(e, t, n = void 0, s = void 0) {
1397
1401
  }, o = `${r.baseUrl}${r.uri}`, i = {
1398
1402
  "Content-Type": "application/json",
1399
1403
  Accept: "application/json,text/javascript,*/*"
1400
- }, c = P(), d = {
1404
+ }, c = R(), d = {
1401
1405
  with_indexing_date: !0,
1402
1406
  with_synthesis: !0,
1403
1407
  with_nls: !1,
@@ -1712,7 +1716,7 @@ function nt(e, t, n = void 0, s = void 0) {
1712
1716
  oe(
1713
1717
  i.users,
1714
1718
  (l) => {
1715
- l !== void 0 && (c.id_msg = l.id, d = !0, R(e, c));
1719
+ l !== void 0 && (c.id_msg = l.id, d = !0, D(e, c));
1716
1720
  },
1717
1721
  (l) => {
1718
1722
  d = !1, console.log("_3dSwym_findCommunityToInstantMSG callback", l), s && s(l), c.id_msg = "";
@@ -1730,7 +1734,7 @@ function nt(e, t, n = void 0, s = void 0) {
1730
1734
  type: "json",
1731
1735
  onComplete(p, f, u) {
1732
1736
  const g = p;
1733
- g.reponse = JSON.parse(u.response), g.status = u.status, n && n(g), c.id_msg = g.result.id, R(e, c);
1737
+ g.reponse = JSON.parse(u.response), g.status = u.status, n && n(g), c.id_msg = g.result.id, D(e, c);
1734
1738
  },
1735
1739
  onFailure(p, f, u) {
1736
1740
  const g = p;
@@ -1769,7 +1773,7 @@ function oe(e, t, n, s) {
1769
1773
  });
1770
1774
  });
1771
1775
  }
1772
- function R(e, t, n = void 0, s = void 0) {
1776
+ function D(e, t, n = void 0, s = void 0) {
1773
1777
  const a = {
1774
1778
  base: e.space,
1775
1779
  uri: "/api/community",
@@ -2205,9 +2209,9 @@ function gt(e, t = void 0, n = void 0) {
2205
2209
  });
2206
2210
  }
2207
2211
  export {
2208
- P as UUID,
2212
+ R as UUID,
2209
2213
  gt as _3DSearch_usersGroup,
2210
- Re as _3DSpace_Create_Doc,
2214
+ De as _3DSpace_Create_Doc,
2211
2215
  Ee as _3DSpace_bookmark_addSubsciptions,
2212
2216
  Je as _3DSpace_bookmark_newWorkspace,
2213
2217
  T as _3DSpace_csrf,
@@ -2219,14 +2223,14 @@ export {
2219
2223
  A as _3DSpace_get_csrf,
2220
2224
  H as _3DSpace_get_docInfo,
2221
2225
  Z as _3DSpace_get_downloadTicket_multidoc,
2222
- Fe as _3DSpace_get_multiDocInfo,
2226
+ Ue as _3DSpace_get_multiDocInfo,
2223
2227
  b as _3DSpace_get_securityContexts,
2224
- F as _3DSpace_get_ticket,
2228
+ U as _3DSpace_get_ticket,
2225
2229
  Le as _3DSpace_lifecycle_changeRevision,
2226
- Pe as _3DSpace_lifecycle_changeState,
2230
+ Re as _3DSpace_lifecycle_changeState,
2227
2231
  xe as _3DSpace_lifecycle_getGraph,
2228
2232
  Me as _3DSpace_lifecycle_getNextRevision,
2229
- De as _3DSpace_lifecycle_getNextStates,
2233
+ Pe as _3DSpace_lifecycle_getNextStates,
2230
2234
  nt as _3DSwym_buildDirectMessage,
2231
2235
  it as _3DSwym_deleteIdea,
2232
2236
  oe as _3DSwym_findCommunityToInstantMSG,
@@ -2241,7 +2245,7 @@ export {
2241
2245
  ct as _3DSwym_get_findUser,
2242
2246
  w as _3DSwym_get_version,
2243
2247
  st as _3DSwym_postIdea,
2244
- R as _3DSwym_sendMessageData,
2248
+ D as _3DSwym_sendMessageData,
2245
2249
  be as _AppMngt_get_info_user,
2246
2250
  Oe as _AppMngt_get_users,
2247
2251
  lt as _Iterop_Auth_CAS,
@@ -2255,8 +2259,8 @@ export {
2255
2259
  dt as _getServiceUrl_Iterop,
2256
2260
  m as _httpCallAuthenticated,
2257
2261
  Se as _setDraggable,
2258
- _e as _setDroppable,
2259
- ye as _setupTagger,
2262
+ ye as _setDroppable,
2263
+ _e as _setupTagger,
2260
2264
  He as addTagToDoc,
2261
2265
  Te as compass_getListAdditionalApps,
2262
2266
  G as couleurs,
@@ -2280,7 +2284,7 @@ export {
2280
2284
  Ae as patchUserGroups,
2281
2285
  ke as patchUserGroupsControl,
2282
2286
  We as pushDataIn3DSpace,
2283
- Ue as readUserGroupControl,
2287
+ Fe as readUserGroupControl,
2284
2288
  ze as removeTagToDoc,
2285
2289
  mt as sayHello,
2286
2290
  he as updateEvent