@beam3_dev/api_module 0.0.301 → 0.0.302

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
@@ -34,7 +34,7 @@ const z = {
34
34
  b3Edit8: "#616161",
35
35
  b3Edit9: "#795548"
36
36
  };
37
- async function Ne(e, t = void 0, s = void 0) {
37
+ async function xe(e, t = void 0, s = void 0) {
38
38
  const n = parseInt(e);
39
39
  await fetch(
40
40
  "https://apicarto.ign.fr/api/codes-postaux/communes/" + n,
@@ -50,7 +50,7 @@ async function Ne(e, t = void 0, s = void 0) {
50
50
  s && s(i), console.error("Erreur : " + i);
51
51
  });
52
52
  }
53
- async function xe(e, t = void 0, s = void 0) {
53
+ async function Ne(e, t = void 0, s = void 0) {
54
54
  e = encodeURIComponent(e), await fetch(
55
55
  "https://api-adresse.data.gouv.fr/search/?q=" + e + "&limit=15",
56
56
  {
@@ -65,7 +65,7 @@ async function xe(e, t = void 0, s = void 0) {
65
65
  s && s(n), console.error("Erreur : " + n);
66
66
  });
67
67
  }
68
- async function Fe(e, t = z) {
68
+ async function Ie(e, t = z) {
69
69
  let s = O.now().year;
70
70
  const n = e, i = [], r = (o) => {
71
71
  for (let c in o)
@@ -134,7 +134,7 @@ function Q(e, t, s) {
134
134
  };
135
135
  o(r);
136
136
  }
137
- async function Ie(e, t, s = !0) {
137
+ async function Ue(e, t, s = !0) {
138
138
  const n = e.events.findIndex((i) => i.uuid === t.uuid);
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
  }
@@ -143,7 +143,7 @@ function m(e, t) {
143
143
  s.authenticatedRequest(e, t);
144
144
  });
145
145
  }
146
- function Ue(e, t, s) {
146
+ function Fe(e, t, s) {
147
147
  $(["DS/DataDragAndDrop/DataDragAndDrop"], (n) => {
148
148
  n.draggable(e, {
149
149
  data: t,
@@ -470,7 +470,7 @@ async function te(e, t, s) {
470
470
  });
471
471
  }
472
472
  }
473
- var x = {};
473
+ var N = {};
474
474
  function ne(e, t) {
475
475
  return Object.prototype.hasOwnProperty.call(e, t);
476
476
  }
@@ -490,7 +490,7 @@ var se = function(e, t, s, n) {
490
490
  u >= 0 ? (p = d.substr(0, u), f = d.substr(u + 1)) : (p = d, f = ""), l = decodeURIComponent(p), h = decodeURIComponent(f), ne(i, l) ? Array.isArray(i[l]) ? i[l].push(h) : i[l] = [i[l], h] : i[l] = h;
491
491
  }
492
492
  return i;
493
- }, N = function(e) {
493
+ }, x = function(e) {
494
494
  switch (typeof e) {
495
495
  case "string":
496
496
  return e;
@@ -503,14 +503,14 @@ var se = function(e, t, s, n) {
503
503
  }
504
504
  }, ie = function(e, t, s, n) {
505
505
  return t = t || "&", s = s || "=", e === null && (e = void 0), typeof e == "object" ? Object.keys(e).map(function(i) {
506
- var r = encodeURIComponent(N(i)) + s;
506
+ var r = encodeURIComponent(x(i)) + s;
507
507
  return Array.isArray(e[i]) ? e[i].map(function(a) {
508
- return r + encodeURIComponent(N(a));
509
- }).join(t) : r + encodeURIComponent(N(e[i]));
510
- }).filter(Boolean).join(t) : n ? encodeURIComponent(N(n)) + s + encodeURIComponent(N(e)) : "";
508
+ return r + encodeURIComponent(x(a));
509
+ }).join(t) : r + encodeURIComponent(x(e[i]));
510
+ }).filter(Boolean).join(t) : n ? encodeURIComponent(x(n)) + s + encodeURIComponent(x(e)) : "";
511
511
  };
512
- x.decode = x.parse = se;
513
- x.encode = x.stringify = ie;
512
+ N.decode = N.parse = se;
513
+ N.encode = N.stringify = ie;
514
514
  async function J(e, t = void 0, s = void 0, n = void 0) {
515
515
  const i = e.space;
516
516
  if (t === void 0) {
@@ -534,7 +534,7 @@ async function Xe(e, t = void 0, s = void 0, n = void 0) {
534
534
  console.log("Le paramètre docids est obligatoire");
535
535
  return;
536
536
  }
537
- let r = `${i}/resources/v1/modeler/documents/ids?$include=!files,!ownerInfo,!originatorInfo,!relOwnerInfo'`, a = x.stringify({
537
+ let r = `${i}/resources/v1/modeler/documents/ids?$include=!files,!ownerInfo,!originatorInfo,!relOwnerInfo'`, a = N.stringify({
538
538
  $ids: t.toString().replace('"', "").replace("[", "").replace("]", "")
539
539
  });
540
540
  m(r, {
@@ -552,7 +552,7 @@ async function Xe(e, t = void 0, s = void 0, n = void 0) {
552
552
  }
553
553
  });
554
554
  }
555
- function I(e, t = void 0, s = void 0) {
555
+ function U(e, t = void 0, s = void 0) {
556
556
  if (e.objID && e.objID !== "") {
557
557
  let n = `${e.space}/resources/v1/modeler/documents/${e.objID}`;
558
558
  m(n, {
@@ -565,7 +565,7 @@ function I(e, t = void 0, s = void 0) {
565
565
  }
566
566
  });
567
567
  } else
568
- T(
568
+ b(
569
569
  e,
570
570
  (n) => {
571
571
  console.log("_3DSpace_get_csrf / _3DSpace_csrf", n), e.token = n, t && t(e);
@@ -575,7 +575,7 @@ function I(e, t = void 0, s = void 0) {
575
575
  }
576
576
  );
577
577
  }
578
- function T(e, t = void 0, s = void 0) {
578
+ function b(e, t = void 0, s = void 0) {
579
579
  if (e.space) {
580
580
  const n = e.space + "/resources/v1/application/CSRF";
581
581
  m(n, {
@@ -596,7 +596,7 @@ function T(e, t = void 0, s = void 0) {
596
596
  }
597
597
  function k(e, t = void 0, s = void 0) {
598
598
  let n = e.space + `/resources/v1/modeler/documents/${e.objID}/files/DownloadTicket`;
599
- I(
599
+ U(
600
600
  e,
601
601
  (i) => {
602
602
  m(n, {
@@ -651,7 +651,7 @@ function G(e, t, s, n, i, r = void 0, a = void 0) {
651
651
  r,
652
652
  a
653
653
  );
654
- e.token ? o() : I(
654
+ e.token ? o() : U(
655
655
  e,
656
656
  t,
657
657
  (c) => {
@@ -667,7 +667,8 @@ function ae(e, t, s, n, i, r, a = void 0, o = void 0) {
667
667
  m(c, {
668
668
  method: "PUT",
669
669
  headers: {
670
- ENO_CSRF_TOKEN: e.token
670
+ SecurityContext: encodeURIComponent("ctx::" + e.ctx)
671
+ //ENO_CSRF_TOKEN: credentials.token,
671
672
  },
672
673
  data: JSON.stringify({
673
674
  csrf: {
@@ -681,7 +682,7 @@ function ae(e, t, s, n, i, r, a = void 0, o = void 0) {
681
682
  let g;
682
683
  n instanceof Blob ? g = n : g = new Blob([n], {
683
684
  type: "text/plain"
684
- }), h.append("__fcs__jobTicket", l.ticket), h.append("file_0", g, i);
685
+ }), h.append(l.ticketparamname, l.ticket), h.append("file_0", g, i);
685
686
  const _ = {};
686
687
  _.method = "POST", _.data = h, _.onComplete = function(y) {
687
688
  let w = {
@@ -829,14 +830,14 @@ async function Ye(e, t = void 0, s = void 0, n = void 0, i = void 0, r = void 0)
829
830
  },
830
831
  data: v,
831
832
  type: "json",
832
- onComplete(F, Ce, Te) {
833
- n && n(F);
833
+ onComplete(I, Ce, be) {
834
+ n && n(I);
834
835
  },
835
- onFailure(F) {
836
+ onFailure(I) {
836
837
  console.warn(
837
838
  "_3DSpace_Upload_Doc | pushFileInFcs | onFailure",
838
- { url: D, bodyRequest: v, err: F }
839
- ), i && i(F);
839
+ { url: D, bodyRequest: v, err: I }
840
+ ), i && i(I);
840
841
  }
841
842
  });
842
843
  },
@@ -871,7 +872,7 @@ async function ze(e, t, s, n = void 0, i = void 0) {
871
872
  e,
872
873
  t,
873
874
  (r) => {
874
- const a = r.data[0].relateddata.files[0].id, o = r.data[0].dataelements.secondaryTitle && r.data[0].dataelements.secondaryTitle !== "" ? r.data[0].dataelements.secondaryTitle : r.data[0].dataelements.title;
875
+ const a = r.data[0].relateddata.files[0].id, o = r.data[0].relateddata.files[0].dataelements.title;
875
876
  G(
876
877
  e,
877
878
  t,
@@ -1012,7 +1013,7 @@ function re(e, t, s, n = void 0, i = void 0, r = void 0) {
1012
1013
  }
1013
1014
  });
1014
1015
  }
1015
- function U(e, t = void 0, s = void 0, n = void 0, i = void 0, r = void 0, a = !1) {
1016
+ function F(e, t = void 0, s = void 0, n = void 0, i = void 0, r = void 0, a = !1) {
1016
1017
  const o = `${e.space}/resources/modeler/pno/person?current=true&select=preferredcredentials&select=collabspaces`;
1017
1018
  m(o, {
1018
1019
  method: "GET",
@@ -1182,7 +1183,7 @@ function de(e, t, s = void 0, n = void 0, i = void 0) {
1182
1183
  }
1183
1184
  function Qe(e, t, s = void 0, n = void 0) {
1184
1185
  return new Promise((i) => {
1185
- if (e.token === "" && T(e), t !== void 0 && t !== "" && t !== null) {
1186
+ if (e.token === "" && b(e), t !== void 0 && t !== "" && t !== null) {
1186
1187
  const r = `${e.space}/resources/v1/modeler/dslc/maturity/getNextStates`;
1187
1188
  let a = {
1188
1189
  method: "POST",
@@ -1213,7 +1214,7 @@ function Qe(e, t, s = void 0, n = void 0) {
1213
1214
  }
1214
1215
  function Ze(e, t, s, n = void 0, i = void 0) {
1215
1216
  return new Promise((r) => {
1216
- if (e.token === "" && T(e), t !== void 0 && t !== "" && t !== null) {
1217
+ if (e.token === "" && b(e), t !== void 0 && t !== "" && t !== null) {
1217
1218
  const a = `${e.space}/resources/v1/modeler/dslc/maturity/changeState`;
1218
1219
  let o = {
1219
1220
  method: "POST",
@@ -1245,9 +1246,9 @@ function Ze(e, t, s, n = void 0, i = void 0) {
1245
1246
  }
1246
1247
  function et(e, t, s = void 0, n = void 0) {
1247
1248
  return new Promise((i) => {
1248
- if (e.token === "" && T(e), t !== void 0 && t !== "" && t !== null) {
1249
+ if (e.token === "" && b(e), t !== void 0 && t !== "" && t !== null) {
1249
1250
  const r = `${e.space}/resources/v1/dslc/versiongraph?withThumbnail=0&withIsLastVersion=0&withAttributes=0&withCopyFrom=0&tenant=${e.tenant}`;
1250
- U(
1251
+ F(
1251
1252
  e.space,
1252
1253
  "ESPACE COMMUN",
1253
1254
  ["VPLMProjectLeader", "VPLMCreator"],
@@ -1286,9 +1287,9 @@ function et(e, t, s = void 0, n = void 0) {
1286
1287
  }
1287
1288
  function tt(e, t, s = void 0, n = void 0) {
1288
1289
  return new Promise((i) => {
1289
- if (e.token === "" && T(e), t !== void 0 && t !== "" && t !== null) {
1290
+ if (e.token === "" && b(e), t !== void 0 && t !== "" && t !== null) {
1290
1291
  const r = `${e.space}/resources/lifecycle/revise/prepare_revise_maskattributes?tenant=${e.tenant}`;
1291
- U(
1292
+ F(
1292
1293
  e.space,
1293
1294
  "ESPACE COMMUN",
1294
1295
  ["VPLMProjectLeader", "VPLMCreator"],
@@ -1333,9 +1334,9 @@ function tt(e, t, s = void 0, n = void 0) {
1333
1334
  }
1334
1335
  function nt(e, t, s, n = void 0, i = void 0) {
1335
1336
  return new Promise((r) => {
1336
- if (e.token === "" && T(e), t !== void 0 && t !== "" && t !== null) {
1337
+ if (e.token === "" && b(e), t !== void 0 && t !== "" && t !== null) {
1337
1338
  const a = `${e.space}/resources/lifecycle/revise/major?tenant=${e.tenant}`;
1338
- U(
1339
+ F(
1339
1340
  e.space,
1340
1341
  "ESPACE COMMUN",
1341
1342
  ["VPLMProjectLeader", "VPLMCreator"],
@@ -1536,7 +1537,7 @@ async function ct(e, t, s = void 0, n = void 0) {
1536
1537
  }
1537
1538
  function dt(e, t, s, n = void 0, i = void 0) {
1538
1539
  const r = new Blob([JSON.stringify(t)], { type: "text/plain" });
1539
- e = { ...e, objID: s }, I(
1540
+ e = { ...e, objID: s }, U(
1540
1541
  e,
1541
1542
  (a) => {
1542
1543
  console.log("_3DSpace_get_csrf | onDone | data", a);
@@ -1563,7 +1564,7 @@ function dt(e, t, s, n = void 0, i = void 0) {
1563
1564
  let B, E;
1564
1565
  const A = [];
1565
1566
  async function ut(e, t = void 0, s = void 0) {
1566
- e.objID && e.objID !== "" ? I(
1567
+ e.objID && e.objID !== "" ? U(
1567
1568
  e,
1568
1569
  (n) => {
1569
1570
  t && t(n);
@@ -1571,7 +1572,7 @@ async function ut(e, t = void 0, s = void 0) {
1571
1572
  (n) => {
1572
1573
  s && s(n);
1573
1574
  }
1574
- ) : (e.objID === null || e.objID === "") && T(
1575
+ ) : (e.objID === null || e.objID === "") && b(
1575
1576
  e,
1576
1577
  (n) => {
1577
1578
  t && t({ rep: n, msg: "Pas d'objID, ou invalide" });
@@ -2165,7 +2166,7 @@ function Ct(e, t, s = void 0, n = void 0) {
2165
2166
  });
2166
2167
  });
2167
2168
  }
2168
- function Tt(e, t = void 0, s = void 0) {
2169
+ function bt(e, t = void 0, s = void 0) {
2169
2170
  const n = { base: e.space, uri: "/api/idea/add" };
2170
2171
  if (!Array.isArray(e.swymCommunities)) {
2171
2172
  const a = "☠️ swymCommunities doit être un tableau d'objets de communautés";
@@ -2238,7 +2239,7 @@ function Tt(e, t = void 0, s = void 0) {
2238
2239
  m(n.base + n.uri, o);
2239
2240
  });
2240
2241
  }
2241
- function bt(e, t, s = void 0, n = void 0) {
2242
+ function Tt(e, t, s = void 0, n = void 0) {
2242
2243
  const i = `${e.space}/api/idea/delete`, r = {
2243
2244
  params: {
2244
2245
  community_id: t.community_id,
@@ -2338,7 +2339,7 @@ function $t(e, t, s) {
2338
2339
  };
2339
2340
  m(p.base + p.uri, l);
2340
2341
  }
2341
- function Nt(e, t, s = void 0, n = void 0) {
2342
+ function xt(e, t, s = void 0, n = void 0) {
2342
2343
  const { _3DSwym: i } = e;
2343
2344
  let { community_id: r, limit: a, page: o, search: c } = t;
2344
2345
  const d = [], u = 1;
@@ -2364,11 +2365,11 @@ function Nt(e, t, s = void 0, n = void 0) {
2364
2365
  if (o++, l.page = `/page/${o}`, y = `${i}${l.uri}${l.comId}${l.limit}${l.page}`, !c)
2365
2366
  d.push(S.response.result);
2366
2367
  else {
2367
- const b = S.response.result.find(
2368
+ const T = S.response.result.find(
2368
2369
  (R) => R.title.includes(c)
2369
2370
  );
2370
- if (b) {
2371
- s(b);
2371
+ if (T) {
2372
+ s(T);
2372
2373
  return;
2373
2374
  }
2374
2375
  }
@@ -2380,8 +2381,8 @@ function Nt(e, t, s = void 0, n = void 0) {
2380
2381
  }
2381
2382
  },
2382
2383
  onFailure(w, S) {
2383
- const b = w;
2384
- b.status = S.status, b.response = S.errormsg, n && n(b);
2384
+ const T = w;
2385
+ T.status = S.status, T.response = S.errormsg, n && n(T);
2385
2386
  }
2386
2387
  });
2387
2388
  };
@@ -2463,7 +2464,7 @@ function Se(e) {
2463
2464
  <p>
2464
2465
  </p>` : e;
2465
2466
  }
2466
- function xt(e, t = void 0, s = void 0) {
2467
+ function Nt(e, t = void 0, s = void 0) {
2467
2468
  const { tenant: n, _3DSwym: i, _3DSwym_token: r, community_id: a, idea_id: o } = e;
2468
2469
  if (n && i && r && a && o) {
2469
2470
  const c = `${i}/api/idea/forward`;
@@ -2496,7 +2497,7 @@ function xt(e, t = void 0, s = void 0) {
2496
2497
  credentials: e
2497
2498
  });
2498
2499
  }
2499
- function Ft(e, t = void 0, s = void 0) {
2500
+ function It(e, t = void 0, s = void 0) {
2500
2501
  return new Promise((n, i) => {
2501
2502
  try {
2502
2503
  let r;
@@ -2526,7 +2527,7 @@ function Ft(e, t = void 0, s = void 0) {
2526
2527
  }
2527
2528
  });
2528
2529
  }
2529
- function It(e, t, s = void 0, n = void 0) {
2530
+ function Ut(e, t, s = void 0, n = void 0) {
2530
2531
  const i = e.space + "/api/user/find/login/" + t;
2531
2532
  C(
2532
2533
  e,
@@ -2546,7 +2547,7 @@ function It(e, t, s = void 0, n = void 0) {
2546
2547
  n
2547
2548
  );
2548
2549
  }
2549
- function Ut(e, t = void 0, s = void 0) {
2550
+ function Ft(e, t = void 0, s = void 0) {
2550
2551
  const {
2551
2552
  _3DSwym: n,
2552
2553
  _3DSwym_token: i,
@@ -2809,11 +2810,11 @@ function Xt(e) {
2809
2810
  }
2810
2811
  function Wt(e, t = void 0, s = void 0) {
2811
2812
  return console.log("credentials", e), new Promise((n) => {
2812
- if (e.token === "" && T(e), !e.space || e.space === "") {
2813
+ if (e.token === "" && b(e), !e.space || e.space === "") {
2813
2814
  const a = Z();
2814
2815
  console.log("platformeInfo", a);
2815
2816
  }
2816
- U(
2817
+ F(
2817
2818
  e,
2818
2819
  "Common space",
2819
2820
  ["VPLMProjectLeader", "VPLMCreator"],
@@ -2894,17 +2895,17 @@ export {
2894
2895
  Ye as _3DSpace_Upload_File,
2895
2896
  at as _3DSpace_bookmark_addSubsciptions,
2896
2897
  it as _3DSpace_bookmark_newWorkspace,
2897
- T as _3DSpace_csrf,
2898
+ b as _3DSpace_csrf,
2898
2899
  q as _3DSpace_download_doc,
2899
2900
  ce as _3DSpace_download_multidoc,
2900
2901
  G as _3DSpace_file_update,
2901
2902
  ae as _3DSpace_file_update_csr,
2902
2903
  We as _3DSpace_file_url_csr,
2903
- I as _3DSpace_get_csrf,
2904
+ U as _3DSpace_get_csrf,
2904
2905
  J as _3DSpace_get_docInfo,
2905
2906
  de as _3DSpace_get_downloadTicket_multidoc,
2906
2907
  Xe as _3DSpace_get_multiDocInfo,
2907
- U as _3DSpace_get_securityContexts,
2908
+ F as _3DSpace_get_securityContexts,
2908
2909
  k as _3DSpace_get_ticket,
2909
2910
  nt as _3DSpace_lifecycle_changeRevision,
2910
2911
  Ze as _3DSpace_lifecycle_changeState,
@@ -2913,23 +2914,23 @@ export {
2913
2914
  Qe as _3DSpace_lifecycle_getNextStates,
2914
2915
  st as _3DSpace_lifecycle_getRevisions,
2915
2916
  Ve as _3DSpace_put_docInfo,
2916
- xt as _3DSwym_ForwardIdea,
2917
- Ut as _3DSwym_addComment,
2917
+ Nt as _3DSwym_ForwardIdea,
2918
+ Ft as _3DSwym_addComment,
2918
2919
  wt as _3DSwym_buildDirectMessage,
2919
- bt as _3DSwym_deleteIdea,
2920
+ Tt as _3DSwym_deleteIdea,
2920
2921
  $t as _3DSwym_editIdea,
2921
2922
  _e as _3DSwym_findCommunityToInstantMSG,
2922
2923
  yt as _3DSwym_getAllCommunities,
2923
- Nt as _3DSwym_getAllListIdeas,
2924
+ xt as _3DSwym_getAllListIdeas,
2924
2925
  gt as _3DSwym_getAllNews,
2925
2926
  _t as _3DSwym_getFamiliarPeople,
2926
2927
  St as _3DSwym_getIdeaStatusMaturity,
2927
2928
  ge as _3DSwym_getMembersCommunity,
2928
2929
  Ot as _3DSwym_getOneIdea,
2929
2930
  C as _3DSwym_get_Token,
2930
- Ft as _3DSwym_get_currentUser,
2931
- It as _3DSwym_get_findUser,
2932
- Tt as _3DSwym_postIdea,
2931
+ It as _3DSwym_get_currentUser,
2932
+ Ut as _3DSwym_get_findUser,
2933
+ bt as _3DSwym_postIdea,
2933
2934
  Ct as _3DSwym_postIdeaTemplate,
2934
2935
  P as _3DSwym_sendMessageData,
2935
2936
  Le as _AppMngt_get_info_user,
@@ -2955,7 +2956,7 @@ export {
2955
2956
  ve as _getServiceUrl_3DPassport,
2956
2957
  Rt as _getServiceUrl_Iterop,
2957
2958
  m as _httpCallAuthenticated,
2958
- Ue as _setDraggable,
2959
+ Fe as _setDraggable,
2959
2960
  je as _setDroppable,
2960
2961
  Re as _setupTagger,
2961
2962
  ft as addTagToDoc,
@@ -2965,13 +2966,13 @@ export {
2965
2966
  Me as createUserGroups,
2966
2967
  pe as dataMixing,
2967
2968
  Ke as deleteUserGroups,
2968
- xe as findAdresse,
2969
+ Ne as findAdresse,
2969
2970
  ot as getAllContextSecurity,
2970
2971
  te as getCSRFToken,
2971
- Ne as getCommunes,
2972
+ xe as getCommunes,
2972
2973
  Je as getComplementUG,
2973
2974
  rt as getDataFrom3DSpace,
2974
- Fe as getDataFromGouvFr,
2975
+ Ie as getDataFromGouvFr,
2975
2976
  pt as getDatasByTenant,
2976
2977
  lt as getDatasFrom3DSpace,
2977
2978
  ct as getDownloadDocument,
@@ -2985,6 +2986,6 @@ export {
2985
2986
  Ee as readUserGroupControl,
2986
2987
  mt as removeTagToDoc,
2987
2988
  Xt as sayHello,
2988
- Ie as updateEvent
2989
+ Ue as updateEvent
2989
2990
  };
2990
2991
  //# sourceMappingURL=wb3Api.js.map