@beam3_dev/api_module 0.0.191 → 0.0.193

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
@@ -250,7 +250,7 @@ function $e(e, t, s = void 0, n = void 0) {
250
250
  }
251
251
  });
252
252
  }
253
- const j = {
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, s = void 0, n = void 0) {
271
271
  };
272
272
  m(a, {
273
273
  method: "POST",
274
- headers: j,
274
+ headers: F,
275
275
  data: JSON.stringify(c),
276
276
  onComplete(d) {
277
277
  s && s(JSON.parse(d));
@@ -366,7 +366,7 @@ function Ue(e, t, s, n = void 0, i = void 0) {
366
366
  OPTsTenant: `tenant=dstenant:${o}`
367
367
  }, c = s, d = `${r}${a.URIUGr}/${t}`, p = JSON.stringify(c);
368
368
  m(d, {
369
- headers: j,
369
+ headers: F,
370
370
  method: "PATCH",
371
371
  data: p,
372
372
  type: "json",
@@ -378,11 +378,11 @@ function Ue(e, t, s, n = void 0, i = void 0) {
378
378
  }
379
379
  });
380
380
  }
381
- function Fe(e, t, s, n = void 0, i = void 0) {
381
+ function ke(e, t, s, n = void 0, i = void 0) {
382
382
  const { space: r } = e, a = `${r}/3drdfpersist/resources/v1/usersgroup/${t}/sharing`;
383
383
  m(a, {
384
384
  method: "PATCH",
385
- headers: j,
385
+ headers: F,
386
386
  data: JSON.stringify(s),
387
387
  type: "json",
388
388
  onComplete(d) {
@@ -393,7 +393,7 @@ function Fe(e, t, s, n = void 0, i = void 0) {
393
393
  }
394
394
  });
395
395
  }
396
- function je(e, t, s = void 0, n = void 0) {
396
+ function Fe(e, t, s = void 0, n = void 0) {
397
397
  const { space: i } = e, o = `${i}/3drdfpersist/resources/v1/usersgroup/${t}/sharing`;
398
398
  m(o, {
399
399
  opts: {
@@ -482,7 +482,7 @@ async function L(e, t = void 0, s = void 0, n = void 0) {
482
482
  }
483
483
  });
484
484
  }
485
- async function ke(e, t = void 0, s = void 0, n = void 0) {
485
+ async function je(e, t = void 0, s = void 0, n = void 0) {
486
486
  const i = e.space;
487
487
  if (t === void 0) {
488
488
  console.log("Le paramètre docids est obligatoire");
@@ -548,7 +548,7 @@ function b(e, t = void 0, s = void 0) {
548
548
  } else
549
549
  s && s("ERROR : url du 3DSpace non défini.");
550
550
  }
551
- function k(e, t = void 0, s = void 0) {
551
+ function j(e, t = void 0, s = void 0) {
552
552
  let n = e.space + `/resources/v1/modeler/documents/${e.objID}/files/DownloadTicket`;
553
553
  U(
554
554
  e,
@@ -748,11 +748,11 @@ async function Re(e, t, s, n, i = void 0, r = void 0) {
748
748
  ]
749
749
  }),
750
750
  type: "json",
751
- onComplete(F) {
752
- i && i(F);
751
+ onComplete(k) {
752
+ i && i(k);
753
753
  },
754
- onFailure(F) {
755
- r && r(F);
754
+ onFailure(k) {
755
+ r && r(k);
756
756
  }
757
757
  };
758
758
  m(
@@ -835,7 +835,7 @@ async function J(e, t = void 0, s = void 0) {
835
835
  console.log("☠️ error => ", n);
836
836
  }
837
837
  ), new Promise((n, i) => {
838
- k(
838
+ j(
839
839
  e,
840
840
  (r) => {
841
841
  e?.returnType === "blob" ? (console.log("ticketURL blob", r), fetch(r).then((o) => o.blob()).then((o) => {
@@ -1248,7 +1248,7 @@ function Be(e, t = void 0, s = void 0) {
1248
1248
  });
1249
1249
  }
1250
1250
  function Ve(e, t, s, n) {
1251
- k(
1251
+ j(
1252
1252
  e.space,
1253
1253
  t,
1254
1254
  (i) => {
@@ -1266,7 +1266,7 @@ function Ve(e, t, s, n) {
1266
1266
  }
1267
1267
  async function We(e, t, s = void 0, n = void 0) {
1268
1268
  return new Promise((i) => {
1269
- k(e, t, (r) => {
1269
+ j(e, t, (r) => {
1270
1270
  m(r, {
1271
1271
  onComplete: (o, a, c) => (i(JSON.parse(o)), s && s(JSON.parse(o), a, c), i),
1272
1272
  onFailure: (o, a, c) => {
@@ -1955,15 +1955,18 @@ function ot(e, t = void 0, s = void 0) {
1955
1955
  }
1956
1956
  };
1957
1957
  w(e, (o) => {
1958
- if (o)
1959
- throw new Error(o, {
1960
- cause: o
1961
- });
1958
+ if (!o)
1959
+ throw new Error(
1960
+ `☠️ token n'est pas disponible pour cette requête : ${n.base + n.uri}`,
1961
+ {
1962
+ cause: o
1963
+ }
1964
+ );
1962
1965
  const a = {
1963
1966
  headers: {
1964
1967
  "Content-type": "application/json;charset=UTF-8",
1965
1968
  Accept: "application/json",
1966
- "X-DS-SWYM-CSRFTOKEN": o.result.ServerToken
1969
+ "X-DS-SWYM-CSRFTOKEN": o?.result?.ServerToken
1967
1970
  },
1968
1971
  method: "POST",
1969
1972
  data: JSON.stringify(r),
@@ -1997,7 +2000,7 @@ function rt(e, t, s = void 0, n = void 0) {
1997
2000
  headers: {
1998
2001
  "Content-type": "application/json;charset=UTF-8",
1999
2002
  Accept: "application/json",
2000
- "X-DS-SWYM-CSRFTOKEN": o.result.ServerToken
2003
+ "X-DS-SWYM-CSRFTOKEN": o?.result?.ServerToken
2001
2004
  },
2002
2005
  data: JSON.stringify(r),
2003
2006
  type: "json",
@@ -2061,13 +2064,15 @@ function dt(e, t, s) {
2061
2064
  const o = {
2062
2065
  method: "POST",
2063
2066
  headers: {
2064
- "X-DS-SWYM-CSRFTOKEN": r.result.ServerToken,
2067
+ "X-DS-SWYM-CSRFTOKEN": r?.result?.ServerToken,
2065
2068
  "Content-type": "application/json;charset=UTF-8"
2066
2069
  },
2067
2070
  data: JSON.stringify(i),
2068
- onComplete(a) {
2069
- const c = JSON.parse(a);
2070
- t && t(c);
2071
+ onComplete(a, c, d) {
2072
+ const p = {
2073
+ response: typeof a == "string" ? JSON.parse(a) : a
2074
+ };
2075
+ p.status = d.status, t && t(p);
2071
2076
  },
2072
2077
  onFailure(a) {
2073
2078
  s && s(a);
@@ -2479,9 +2484,9 @@ export {
2479
2484
  U as _3DSpace_get_csrf,
2480
2485
  L as _3DSpace_get_docInfo,
2481
2486
  ee as _3DSpace_get_downloadTicket_multidoc,
2482
- ke as _3DSpace_get_multiDocInfo,
2487
+ je as _3DSpace_get_multiDocInfo,
2483
2488
  $ as _3DSpace_get_securityContexts,
2484
- k as _3DSpace_get_ticket,
2489
+ j as _3DSpace_get_ticket,
2485
2490
  Ee as _3DSpace_lifecycle_changeRevision,
2486
2491
  Le as _3DSpace_lifecycle_changeState,
2487
2492
  Me as _3DSpace_lifecycle_getGraph,
@@ -2547,9 +2552,9 @@ export {
2547
2552
  X as getUsersGroupRules,
2548
2553
  Ye as get_3DSpace_csrf,
2549
2554
  Ue as patchUserGroups,
2550
- Fe as patchUserGroupsControl,
2555
+ ke as patchUserGroupsControl,
2551
2556
  Xe as pushDataIn3DSpace,
2552
- je as readUserGroupControl,
2557
+ Fe as readUserGroupControl,
2553
2558
  Qe as removeTagToDoc,
2554
2559
  $t as sayHello,
2555
2560
  Se as updateEvent