@beam3_dev/api_module 0.0.64 → 0.0.66

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,10 +34,10 @@ const L = {
34
34
  b3Edit8: "#616161",
35
35
  b3Edit9: "#795548"
36
36
  };
37
- async function ie(e, t = void 0, n = void 0) {
38
- const s = parseInt(e);
37
+ async function ie(e, t = void 0, s = void 0) {
38
+ const n = parseInt(e);
39
39
  await fetch(
40
- "https://apicarto.ign.fr/api/codes-postaux/communes/" + s,
40
+ "https://apicarto.ign.fr/api/codes-postaux/communes/" + n,
41
41
  {
42
42
  method: "GET",
43
43
  headers: {
@@ -47,10 +47,10 @@ async function ie(e, t = void 0, n = void 0) {
47
47
  ).then((o) => o.json()).then((o) => {
48
48
  t && t(o);
49
49
  }).catch((o) => {
50
- n && n(o), console.error("Erreur : " + o);
50
+ s && s(o), console.error("Erreur : " + o);
51
51
  });
52
52
  }
53
- async function re(e, t = void 0, n = void 0) {
53
+ async function re(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
  {
@@ -59,19 +59,19 @@ async function re(e, t = void 0, n = void 0) {
59
59
  Accept: "application/json"
60
60
  }
61
61
  }
62
- ).then((s) => s.json()).then((s) => {
63
- t && t(s);
64
- }).catch((s) => {
65
- n && n(s), console.error("Erreur : " + s);
62
+ ).then((n) => n.json()).then((n) => {
63
+ t && t(n);
64
+ }).catch((n) => {
65
+ s && s(n), console.error("Erreur : " + n);
66
66
  });
67
67
  }
68
68
  async function ce(e, t = L) {
69
- let n = N.now().year;
70
- const s = e, o = [], r = (a) => {
71
- for (let c in a)
72
- o.push({ date: c, comment: a[c] });
69
+ let s = N.now().year;
70
+ const n = e, o = [], c = (a) => {
71
+ for (let i in a)
72
+ o.push({ date: i, comment: a[i] });
73
73
  };
74
- for (let a = n; a <= n + 1; a++)
74
+ for (let a = s; a <= s + 1; a++)
75
75
  await fetch(
76
76
  "https://calendrier.api.gouv.fr/jours-feries/metropole/" + a + ".json",
77
77
  {
@@ -80,63 +80,63 @@ async function ce(e, t = L) {
80
80
  Accept: "application/json"
81
81
  }
82
82
  }
83
- ).then((c) => c.json()).then((c) => {
84
- r(c);
85
- }).catch((c) => console.error("Erreur : " + c));
83
+ ).then((i) => i.json()).then((i) => {
84
+ c(i);
85
+ }).catch((i) => console.error("Erreur : " + i));
86
86
  return (() => {
87
- const a = s.length === 0 ? {
87
+ const a = n.length === 0 ? {
88
88
  events: []
89
- } : s;
90
- for (let c of o)
89
+ } : n;
90
+ for (let i of o)
91
91
  a.events.findIndex(
92
- (l) => l.start === N.fromISO(c.date).toISODate() && l.name === "Férié : " + c.comment
92
+ (l) => l.start === N.fromISO(i.date).toISODate() && l.name === "Férié : " + i.comment
93
93
  ) === -1 && a.events.push({
94
- name: "Férié : " + c.comment,
95
- start: N.fromISO(c.date).toISODate(),
96
- end: N.fromISO(c.date).toISODate(),
94
+ name: "Férié : " + i.comment,
95
+ start: N.fromISO(i.date).toISODate(),
96
+ end: N.fromISO(i.date).toISODate(),
97
97
  color: t.b3BusinnessDays,
98
98
  timed: !1
99
99
  });
100
100
  return a;
101
101
  })();
102
102
  }
103
- async function de(e, t, n = !0) {
104
- const s = e.events.findIndex((o) => o.uuid === t.uuid);
105
- return s === -1 ? e.events.push(t) : n ? e.events[s] = t : e.events.splice(s, 1), e.length > 0 && e.sort((o, r) => o.start - r.start), e;
103
+ async function de(e, t, s = !0) {
104
+ const n = e.events.findIndex((o) => o.uuid === t.uuid);
105
+ return n === -1 ? e.events.push(t) : s ? e.events[n] = t : e.events.splice(n, 1), e.length > 0 && e.sort((o, c) => o.start - c.start), e;
106
106
  }
107
107
  function f(e, t) {
108
- O(["DS/WAFData/WAFData"], (n) => {
109
- n.authenticatedRequest(e, t);
108
+ O(["DS/WAFData/WAFData"], (s) => {
109
+ s.authenticatedRequest(e, t);
110
110
  });
111
111
  }
112
- function le(e, t, n) {
113
- O(["DS/DataDragAndDrop/DataDragAndDrop"], (s) => {
114
- s.draggable(e, { data: t, start: n });
112
+ function le(e, t, s) {
113
+ O(["DS/DataDragAndDrop/DataDragAndDrop"], (n) => {
114
+ n.draggable(e, { data: t, start: s });
115
115
  });
116
116
  }
117
117
  function pe(e, t = void 0) {
118
- O(["DS/TagNavigatorProxy/TagNavigatorProxy"], (n) => {
119
- let s;
120
- s === void 0 && (s = n.createProxy({
118
+ O(["DS/TagNavigatorProxy/TagNavigatorProxy"], (s) => {
119
+ let n;
120
+ n === void 0 && (n = s.createProxy({
121
121
  widgetId: A.id,
122
122
  filteringMode: "WithFilteringServices"
123
- }), t !== void 0 && s.addEvent("onFilterSubjectsChange", t)), s.setSubjectsTags(e);
123
+ }), t !== void 0 && n.addEvent("onFilterSubjectsChange", t)), n.setSubjectsTags(e);
124
124
  });
125
125
  }
126
126
  function ue(e, t) {
127
- O(["DS/DataDragAndDrop/DataDragAndDrop"], (n) => {
128
- n.droppable(e, { drop: t });
127
+ O(["DS/DataDragAndDrop/DataDragAndDrop"], (s) => {
128
+ s.droppable(e, { drop: t });
129
129
  });
130
130
  }
131
- async function fe(e, t = void 0, n = void 0) {
131
+ async function fe(e, t = void 0, s = void 0) {
132
132
  await O(
133
133
  ["DS/i3DXCompassServices/i3DXCompassServices"],
134
- (s) => {
135
- (!e || e === "") && (e = A.getValue("PlatFormInstanceId")), (!e || e === "") && (e = void 0), t && (console.log("i3DXCompassServices", s), t(
136
- s.getPlatformServices({
134
+ (n) => {
135
+ (!e || e === "") && (e = A.getValue("PlatFormInstanceId")), (!e || e === "") && (e = void 0), t && (console.log("i3DXCompassServices", n), t(
136
+ n.getPlatformServices({
137
137
  platformId: e,
138
138
  onComplete: t,
139
- onFailure: n
139
+ onFailure: s
140
140
  })
141
141
  ));
142
142
  }
@@ -145,66 +145,66 @@ async function fe(e, t = void 0, n = void 0) {
145
145
  function me() {
146
146
  let e = {};
147
147
  return O(["DS/PlatformAPI/PlatformAPI"], (t) => {
148
- const n = t.getTenant(), s = t.getUser(), o = t.getAllApplicationConfigurations(), r = t.getApplicationConfiguration(
148
+ const s = t.getTenant(), n = t.getUser(), o = t.getAllApplicationConfigurations(), c = t.getApplicationConfiguration(
149
149
  "com.3ds.wp.passport.cors"
150
150
  );
151
151
  e = {
152
- tenant: n,
153
- user: s,
152
+ tenant: s,
153
+ user: n,
154
154
  appsConfiguration: o,
155
- appConf: r
155
+ appConf: c
156
156
  };
157
157
  }), console.log("%cRETOUR API :", "color:blue", e), e;
158
158
  }
159
- function ge(e, t, n) {
160
- const s = {
159
+ function ge(e, t, s) {
160
+ const n = {
161
161
  base: `${e.space}`,
162
162
  uri: "/resources/AppsMngt/api/custom/applications",
163
163
  option: `?filter=${e.tenant}`
164
164
  // facultatif
165
- }, o = `${s.base}${s.uri}${s.option}`;
165
+ }, o = `${n.base}${n.uri}${n.option}`;
166
166
  f(o, {
167
167
  method: "GET",
168
168
  headers: {
169
169
  "Content-Type": "application/json",
170
170
  Accept: "application/json"
171
171
  },
172
- onComplete(r, i, a) {
173
- const c = JSON.parse(r), d = c.data.map((l) => {
172
+ onComplete(c, r, a) {
173
+ const i = JSON.parse(c), d = i.data.map((l) => {
174
174
  const p = l.attributes.name, u = l.id;
175
175
  return { name: p, id: u };
176
176
  });
177
- t && t(d, c);
177
+ t && t(d, i);
178
178
  },
179
- onFailure(r, i) {
180
- const a = r;
181
- a.msg = i.errormsg, a.errCode = i.errorcode, n && n(a);
179
+ onFailure(c, r) {
180
+ const a = c;
181
+ a.msg = r.errormsg, a.errCode = r.errorcode, s && s(a);
182
182
  }
183
183
  });
184
184
  }
185
- function he(e, t = void 0, n = void 0) {
186
- let s = `${e.space}/resources/AppsMngt/user?platform=${e.tenant}&limit=-1`;
187
- f(s, {
188
- onComplete(o, r, i) {
185
+ function he(e, t = void 0, s = void 0) {
186
+ let n = `${e.space}/resources/AppsMngt/user?platform=${e.tenant}&limit=-1`;
187
+ f(n, {
188
+ onComplete(o, c, r) {
189
189
  const a = JSON.parse(o);
190
190
  console.log("_AppMngt_get_users => ", a), t && t(a);
191
191
  },
192
- onFailure(o, r) {
193
- const i = o;
194
- i.msg = r.errormsg, i.errCode = r.errorcode, n && n(i);
192
+ onFailure(o, c) {
193
+ const r = o;
194
+ r.msg = c.errormsg, r.errCode = c.errorcode, s && s(r);
195
195
  }
196
196
  });
197
197
  }
198
- function Se(e, t, n = void 0, s = void 0) {
198
+ function Se(e, t, s = void 0, n = void 0) {
199
199
  let o = `${e.space}/resources/AppsMngt/user?platform=${e.tenant}&id=${t}`;
200
200
  f(o, {
201
- onComplete(r, i, a) {
202
- const c = JSON.parse(r);
203
- n && n(c);
201
+ onComplete(c, r, a) {
202
+ const i = JSON.parse(c);
203
+ s && s(i);
204
204
  },
205
- onFailure(r, i) {
206
- const a = r;
207
- a.msg = i.errormsg, a.errCode = i.errorcode, s && s(a);
205
+ onFailure(c, r) {
206
+ const a = c;
207
+ a.msg = r.errormsg, a.errCode = r.errorcode, n && n(a);
208
208
  }
209
209
  });
210
210
  }
@@ -212,15 +212,15 @@ const F = {
212
212
  "Content-Type": "application/json",
213
213
  Accept: "application/json,text/javascript,*/*"
214
214
  };
215
- function _e(e, t, n = void 0, s = void 0) {
216
- const { space: o, currentUser: r } = e, a = `${o}${{
215
+ function _e(e, t, s = void 0, n = void 0) {
216
+ const { space: o, currentUser: c } = e, a = `${o}${{
217
217
  URIUGr: "/3drdfpersist/resources/v1/usersgroup"
218
- }.URIUGr}`, c = {
218
+ }.URIUGr}`, i = {
219
219
  groups: [
220
220
  {
221
221
  title: t.title,
222
222
  description: t.description,
223
- members: t.members || [r.email, "samuel.mureau@beam3.fr"],
223
+ members: t.members || [c.email, "samuel.mureau@beam3.fr"],
224
224
  pending_members: [],
225
225
  sharing: t.sharing,
226
226
  visibility: t.visibility
@@ -230,19 +230,19 @@ function _e(e, t, n = void 0, s = void 0) {
230
230
  f(a, {
231
231
  method: "POST",
232
232
  headers: F,
233
- data: JSON.stringify(c),
233
+ data: JSON.stringify(i),
234
234
  onComplete(d) {
235
- n && n(JSON.parse(d));
235
+ s && s(JSON.parse(d));
236
236
  },
237
237
  onFailure(d, l) {
238
238
  console.log(d);
239
239
  const p = d;
240
- p.msg = l.errormsg, p.errCode = l.errorcode, console.log("❌ sendDirectMessage => ", p), s && s(p);
240
+ p.msg = l.errormsg, p.errCode = l.errorcode, console.log("❌ sendDirectMessage => ", p), n && n(p);
241
241
  }
242
242
  });
243
243
  }
244
- function ye(e, t, n = void 0, s = void 0) {
245
- const { space: o, tenant: r } = e, i = o, a = `/3drdfpersist/v1/resources/${t}`, c = `?$mask=dsaccess:Mask.GroupUI.Properties&tenant=dstenant:${r}`, d = `${i}${a}${c}`;
244
+ function ye(e, t, s = void 0, n = void 0) {
245
+ const { space: o, tenant: c } = e, r = o, a = `/3drdfpersist/v1/resources/${t}`, i = `?$mask=dsaccess:Mask.GroupUI.Properties&tenant=dstenant:${c}`, d = `${r}${a}${i}`;
246
246
  f(d, {
247
247
  opts: {
248
248
  method: "GET",
@@ -252,32 +252,32 @@ function ye(e, t, n = void 0, s = void 0) {
252
252
  }
253
253
  },
254
254
  onComplete(u) {
255
- n && n(JSON.parse(u));
255
+ s && s(JSON.parse(u));
256
256
  },
257
257
  onFailure(u, m) {
258
258
  const g = u;
259
- g.msg = m.errormsg, g.errCode = m.errorcode, s && s(g);
259
+ g.msg = m.errormsg, g.errCode = m.errorcode, n && n(g);
260
260
  }
261
261
  });
262
262
  }
263
- function E(e, t = void 0, n = void 0) {
264
- const { space: s, tenant: o } = e, r = s, i = "/3drdfpersist/resources/v1/option-sets/dsusergroup:ListOfGroupResponsibilities/options", a = `?tenant=dstenant:${o}`, c = {
263
+ function E(e, t = void 0, s = void 0) {
264
+ const { space: n, tenant: o } = e, c = n, r = "/3drdfpersist/resources/v1/option-sets/dsusergroup:ListOfGroupResponsibilities/options", a = `?tenant=dstenant:${o}`, i = {
265
265
  method: "GET",
266
266
  Accept: "application/json,*/*,test/javascript"
267
- }, d = `${r}${i}${a}`;
267
+ }, d = `${c}${r}${a}`;
268
268
  f(d, {
269
- OPTsH: c,
269
+ OPTsH: i,
270
270
  onComplete(l) {
271
271
  t && t(JSON.parse(l));
272
272
  },
273
273
  onFailure(l, p) {
274
274
  const u = l;
275
- u.msg = p.errormsg, u.errCode = p.errorcode, n && n(u);
275
+ u.msg = p.errormsg, u.errCode = p.errorcode, s && s(u);
276
276
  }
277
277
  });
278
278
  }
279
- function we(e, t = void 0, n = void 0) {
280
- const { space: s, currentUser: o } = e, a = `${s}/3drdfpersist/resources/v1/usersgroup?select=uri,title,description,owner,members,pending_members,creation_date,modification_date,visibility`, d = { method: "GET", headers: {
279
+ function we(e, t = void 0, s = void 0) {
280
+ const { space: n, currentUser: o } = e, a = `${n}/3drdfpersist/resources/v1/usersgroup?select=uri,title,description,owner,members,pending_members,creation_date,modification_date,visibility`, d = { method: "GET", headers: {
281
281
  "Content-Type": "application/json",
282
282
  Accept: "application/json,text/javascript,*/*"
283
283
  } };
@@ -294,13 +294,13 @@ function we(e, t = void 0, n = void 0) {
294
294
  u.rules = _, t && t(u);
295
295
  },
296
296
  (_) => {
297
- n && n(_);
297
+ s && s(_);
298
298
  }
299
299
  );
300
300
  }
301
301
  },
302
302
  onFailure(l) {
303
- n && n(l);
303
+ s && s(l);
304
304
  }
305
305
  });
306
306
  } catch (l) {
@@ -308,52 +308,52 @@ function we(e, t = void 0, n = void 0) {
308
308
  }
309
309
  }
310
310
  function Te(e, t) {
311
- const { space: n } = e, o = `${n}/3drdfpersist/resources/v1/usersgroup/${t}`;
311
+ const { space: s } = e, o = `${s}/3drdfpersist/resources/v1/usersgroup/${t}`;
312
312
  f(o, {
313
313
  method: "DELETE"
314
314
  });
315
315
  }
316
- function Ce(e, t, n, s = void 0, o = void 0) {
317
- const { space: r, tenant: i } = e, a = {
316
+ function Ce(e, t, s, n = void 0, o = void 0) {
317
+ const { space: c, tenant: r } = e, a = {
318
318
  URITI: "/3drdfpersist/resources/v1/template-instances",
319
319
  URIUGr: "/3drdfpersist/resources/v1/usersgroup",
320
320
  nextURICh: "/characteristics",
321
321
  nextURIGr: "/group",
322
322
  nexURImem: "/members",
323
323
  OPTsTI: "?$mask=dsaccess:Mask.GroupUI.Properties",
324
- OPTsTenant: `tenant=dstenant:${i}`
325
- }, c = n, d = `${r}${a.URIUGr}/${t}`, l = JSON.stringify(c);
324
+ OPTsTenant: `tenant=dstenant:${r}`
325
+ }, i = s, d = `${c}${a.URIUGr}/${t}`, l = JSON.stringify(i);
326
326
  f(d, {
327
327
  headers: F,
328
328
  method: "PATCH",
329
329
  data: l,
330
330
  type: "json",
331
331
  onComplete(p) {
332
- s && s(p);
332
+ n && n(p);
333
333
  },
334
334
  onFailure(p) {
335
335
  o && o(p);
336
336
  }
337
337
  });
338
338
  }
339
- function Oe(e, t, n, s = void 0, o = void 0) {
340
- const { space: r } = e, a = `${r}/3drdfpersist/resources/v1/usersgroup/${t}/sharing`;
339
+ function Oe(e, t, s, n = void 0, o = void 0) {
340
+ const { space: c } = e, a = `${c}/3drdfpersist/resources/v1/usersgroup/${t}/sharing`;
341
341
  f(a, {
342
342
  method: "PATCH",
343
343
  headers: F,
344
- data: JSON.stringify(n),
344
+ data: JSON.stringify(s),
345
345
  type: "json",
346
346
  onComplete(d) {
347
- s && s(d);
347
+ n && n(d);
348
348
  },
349
349
  onFailure(d) {
350
350
  o && o(d);
351
351
  }
352
352
  });
353
353
  }
354
- function be(e, t, n = void 0, s = void 0) {
355
- const { space: o } = e, i = `${o}/3drdfpersist/resources/v1/usersgroup/${t}/sharing`;
356
- f(i, {
354
+ function be(e, t, s = void 0, n = void 0) {
355
+ const { space: o } = e, r = `${o}/3drdfpersist/resources/v1/usersgroup/${t}/sharing`;
356
+ f(r, {
357
357
  opts: {
358
358
  method: "GET",
359
359
  headers: {
@@ -362,83 +362,83 @@ function be(e, t, n = void 0, s = void 0) {
362
362
  }
363
363
  },
364
364
  onComplete(d) {
365
- n && n(JSON.parse(d));
365
+ s && s(JSON.parse(d));
366
366
  },
367
367
  onFailure(d) {
368
- s && s(d);
368
+ n && n(d);
369
369
  }
370
370
  });
371
371
  }
372
- async function J(e, t, n) {
372
+ async function J(e, t, s) {
373
373
  if (e.space) {
374
- const s = `${e.space}/resources/v1/application/CSRF`;
375
- f(s, {
374
+ const n = `${e.space}/resources/v1/application/CSRF`;
375
+ f(n, {
376
376
  onComplete(o) {
377
377
  o = JSON.parse(o), console.log("getCSRFToken() / response => ", o), t && t(o.csrf);
378
378
  },
379
- onFailure(o, r, i) {
380
- n && n({ error: o, headers: r, xhr: i });
379
+ onFailure(o, c, r) {
380
+ s && s({ error: o, headers: c, xhr: r });
381
381
  }
382
382
  });
383
383
  }
384
384
  }
385
- async function G(e, t = void 0, n = void 0, s = void 0) {
385
+ async function G(e, t = void 0, s = void 0, n = void 0) {
386
386
  const o = e.space;
387
387
  if (t === void 0) {
388
388
  console.log("Le paramètre docid est obligatoire");
389
389
  return;
390
390
  }
391
- const r = o + `/resources/v1/modeler/documents/${t}`;
392
- f(r, {
393
- onComplete(i, a, c) {
394
- const d = JSON.parse(i);
395
- n && n(d);
391
+ const c = o + `/resources/v1/modeler/documents/${t}`;
392
+ f(c, {
393
+ onComplete(r, a, i) {
394
+ const d = JSON.parse(r);
395
+ s && s(d);
396
396
  },
397
- onFailure(i) {
398
- s && s(i);
397
+ onFailure(r) {
398
+ n && n(r);
399
399
  }
400
400
  });
401
401
  }
402
- function k(e, t = void 0, n = void 0) {
402
+ function k(e, t = void 0, s = void 0) {
403
403
  if (e.objID && e.objID !== "") {
404
- let s = `${e.space}/resources/v1/modeler/documents/${e.objID}`;
405
- console.log("_3DSpace_get_csrf / url", s), f(s, {
406
- onComplete(o, r, i) {
404
+ let n = `${e.space}/resources/v1/modeler/documents/${e.objID}`;
405
+ console.log("_3DSpace_get_csrf / url", n), f(n, {
406
+ onComplete(o, c, r) {
407
407
  const a = JSON.parse(o);
408
408
  e.token = a?.csrf?.value, e.datas = a?.data[0], t && t(e);
409
409
  },
410
410
  onFailure(o) {
411
- n && n(o);
411
+ s && s(o);
412
412
  }
413
413
  });
414
414
  } else
415
415
  C(
416
416
  e,
417
- (s) => {
418
- console.log("_3DSpace_get_csrf / _3DSpace_csrf", s), t && t(s);
417
+ (n) => {
418
+ console.log("_3DSpace_get_csrf / _3DSpace_csrf", n), t && t(n);
419
419
  },
420
- (s) => {
421
- n && n(s);
420
+ (n) => {
421
+ s && s(n);
422
422
  }
423
423
  );
424
424
  }
425
- function C(e, t = void 0, n = void 0) {
425
+ function C(e, t = void 0, s = void 0) {
426
426
  if (e.space) {
427
- const s = e.space + "/resources/v1/application/CSRF";
428
- f(s, {
429
- onComplete(o, r, i) {
427
+ const n = e.space + "/resources/v1/application/CSRF";
428
+ f(n, {
429
+ onComplete(o, c, r) {
430
430
  const a = JSON.parse(o);
431
431
  console.log("_3DSpace_csrf() / info => ", a), t && t(a.csrf.value);
432
432
  },
433
- onFailure(o, r, i) {
434
- n && n({ response: o, headers: r, xhr: i });
433
+ onFailure(o, c, r) {
434
+ s && s({ response: o, headers: c, xhr: r });
435
435
  }
436
436
  });
437
437
  } else
438
- n && n("ERROR : url du 3DSpace non défini.");
438
+ s && s("ERROR : url du 3DSpace non défini.");
439
439
  }
440
- function U(e, t = void 0, n = void 0) {
441
- let s = e.space + `/resources/v1/modeler/documents/${e.objID}/files/DownloadTicket`;
440
+ function U(e, t = void 0, s = void 0) {
441
+ let n = e.space + `/resources/v1/modeler/documents/${e.objID}/files/DownloadTicket`;
442
442
  k(
443
443
  e,
444
444
  (o) => {
@@ -446,48 +446,48 @@ function U(e, t = void 0, n = void 0) {
446
446
  "_3DSpace_get_ticket / onComplete / ☠️ info => ",
447
447
  o,
448
448
  e.token
449
- ), f(s, {
449
+ ), f(n, {
450
450
  method: "PUT",
451
451
  headers: {
452
452
  ENO_CSRF_TOKEN: e.token
453
453
  },
454
- onComplete(r) {
455
- const a = JSON.parse(r).data[0].dataelements.ticketURL;
454
+ onComplete(c) {
455
+ const a = JSON.parse(c).data[0].dataelements.ticketURL;
456
456
  console.log("le ticket est dans la callback"), t && t(a);
457
457
  },
458
- onFailure(r, i) {
459
- console.warn("☠️ error => ", r, i), n && n(r, i);
458
+ onFailure(c, r) {
459
+ console.warn("☠️ error => ", c, r), s && s(c, r);
460
460
  }
461
461
  });
462
462
  },
463
463
  (o) => {
464
- console.warn("_3DSpace_get_ticket / error => ", o), n && n(o);
464
+ console.warn("_3DSpace_get_ticket / error => ", o), s && s(o);
465
465
  }
466
466
  );
467
467
  }
468
- function Ne(e, t, n, s = void 0, o = void 0) {
469
- const r = `${e.space}/resources/v1/modeler/documents/${t}/files/DownloadTicket`;
470
- n || (n = e.token), f(r, {
468
+ function Ne(e, t, s, n = void 0, o = void 0) {
469
+ const c = `${e.space}/resources/v1/modeler/documents/${t}/files/DownloadTicket`;
470
+ s || (s = e.token), f(c, {
471
471
  method: "PUT",
472
472
  headers: {
473
- ENO_CSRF_TOKEN: n
473
+ ENO_CSRF_TOKEN: s
474
474
  },
475
- onComplete(i) {
476
- let a = JSON.parse(i);
475
+ onComplete(r) {
476
+ let a = JSON.parse(r);
477
477
  if (console.log("☠️ info => ", a), a.success === !0)
478
478
  try {
479
- const c = a.data[0].dataelements.ticketURL;
480
- s && s(c);
481
- } catch (c) {
482
- o && o(c);
479
+ const i = a.data[0].dataelements.ticketURL;
480
+ n && n(i);
481
+ } catch (i) {
482
+ o && o(i);
483
483
  }
484
484
  },
485
- onFailure(i) {
486
- o && o(i);
485
+ onFailure(r) {
486
+ o && o(r);
487
487
  }
488
488
  });
489
489
  }
490
- function K(e, t, n, s, o, r = void 0, i = void 0) {
490
+ function K(e, t, s, n, o, c = void 0, r = void 0) {
491
491
  k(
492
492
  e,
493
493
  t,
@@ -495,32 +495,32 @@ function K(e, t, n, s, o, r = void 0, i = void 0) {
495
495
  W(
496
496
  e,
497
497
  t,
498
- n,
499
498
  s,
499
+ n,
500
500
  o,
501
501
  a.csrf.value,
502
- r,
503
- i
502
+ c,
503
+ r
504
504
  );
505
505
  }
506
506
  );
507
507
  }
508
- function W(e, t, n, s, o, r, i = void 0, a = void 0) {
509
- const c = e.space + `/resources/v1/modeler/documents/${t}/files/CheckinTicket`;
510
- f(c, {
508
+ function W(e, t, s, n, o, c, r = void 0, a = void 0) {
509
+ const i = e.space + `/resources/v1/modeler/documents/${t}/files/CheckinTicket`;
510
+ f(i, {
511
511
  method: "PUT",
512
512
  headers: {
513
- ENO_CSRF_TOKEN: r
513
+ ENO_CSRF_TOKEN: c
514
514
  },
515
515
  onComplete(d, l, p) {
516
516
  const u = JSON.parse(d).data[0].dataelements, m = new FormData();
517
- m.append("__fcs__jobTicket", u.ticket), m.append("file_0", s, o);
517
+ m.append("__fcs__jobTicket", u.ticket), m.append("file_0", n, o);
518
518
  const g = {};
519
519
  g.method = "POST", g.data = m, g.onComplete = function(h) {
520
520
  let S = "temp_" + Date.now(), _ = {
521
521
  method: "PUT",
522
522
  headers: {
523
- ENO_CSRF_TOKEN: r
523
+ ENO_CSRF_TOKEN: c
524
524
  },
525
525
  data: JSON.stringify({
526
526
  data: [
@@ -529,7 +529,7 @@ function W(e, t, n, s, o, r, i = void 0, a = void 0) {
529
529
  relateddata: {
530
530
  files: [
531
531
  {
532
- id: n,
532
+ id: s,
533
533
  dataelements: {
534
534
  title: o,
535
535
  receipt: h
@@ -544,7 +544,7 @@ function W(e, t, n, s, o, r, i = void 0, a = void 0) {
544
544
  }),
545
545
  type: "json",
546
546
  onComplete(y) {
547
- i && i(y);
547
+ r && r(y);
548
548
  },
549
549
  onFailure(y) {
550
550
  a && a(y);
@@ -560,14 +560,14 @@ function W(e, t, n, s, o, r, i = void 0, a = void 0) {
560
560
  }
561
561
  });
562
562
  }
563
- async function ke(e, t, n, s, o = void 0, r = void 0) {
564
- const i = e.space, a = e.token, c = e.ctx, d = new FormData(), l = new Blob([JSON.stringify(t)], {
563
+ async function ke(e, t, s, n, o = void 0, c = void 0) {
564
+ const r = e.space, a = e.token, i = e.ctx, d = new FormData(), l = new Blob([JSON.stringify(t)], {
565
565
  type: "text/plain"
566
566
  }), p = {
567
- url_Ticket: `${i}/resources/v1/modeler/documents/files/CheckinTicket`,
568
- url_Post: `${i}/resources/v1/modeler/documents/?SecurityContext=ctx::${c}`
567
+ url_Ticket: `${r}/resources/v1/modeler/documents/files/CheckinTicket`,
568
+ url_Post: `${r}/resources/v1/modeler/documents/?SecurityContext=ctx::${i}`
569
569
  };
570
- if (!i && i !== "") {
570
+ if (!r && r !== "") {
571
571
  console.log("le store._3DSpace est vide");
572
572
  return;
573
573
  }
@@ -578,12 +578,12 @@ async function ke(e, t, n, s, o = void 0, r = void 0) {
578
578
  },
579
579
  onComplete(u, m, g) {
580
580
  const h = JSON.parse(u).data[0].dataelements;
581
- d.append("__fcs__jobTicket", h.ticket), d.append("filename", l, n);
581
+ d.append("__fcs__jobTicket", h.ticket), d.append("filename", l, s);
582
582
  const S = {
583
583
  method: "POST",
584
584
  data: d,
585
585
  onComplete(T) {
586
- if (c !== "" && a !== "") {
586
+ if (i !== "" && a !== "") {
587
587
  const D = {
588
588
  method: "POST",
589
589
  headers: {
@@ -596,15 +596,15 @@ async function ke(e, t, n, s, o = void 0, r = void 0) {
596
596
  {
597
597
  type: "Document",
598
598
  dataelements: {
599
- title: `Title_${n.toLowerCase().split(" ").join("_")}`,
599
+ title: `Title_${s.toLowerCase().split(" ").join("_")}`,
600
600
  policy: "Document Release",
601
- description: s
601
+ description: n
602
602
  },
603
603
  relateddata: {
604
604
  files: [
605
605
  {
606
606
  dataelements: {
607
- title: `${n}.json`,
607
+ title: `${s}.json`,
608
608
  receipt: T
609
609
  }
610
610
  }
@@ -619,7 +619,7 @@ async function ke(e, t, n, s, o = void 0, r = void 0) {
619
619
  onComplete: _,
620
620
  onFailure: y
621
621
  };
622
- c !== "" && f(p.url_Post, D);
622
+ i !== "" && f(p.url_Post, D);
623
623
  } else
624
624
  console.warn("le store est vide");
625
625
  },
@@ -630,21 +630,21 @@ async function ke(e, t, n, s, o = void 0, r = void 0) {
630
630
  }
631
631
  function y(T, D) {
632
632
  console.log("Erreur -- response ", T, `
633
- headers `, D), r && r(T);
633
+ headers `, D), c && c(T);
634
634
  }
635
635
  f(h.ticketURL, S);
636
636
  }
637
637
  });
638
638
  }
639
- function b(e, t = void 0, n = void 0, s = void 0, o = void 0, r = void 0) {
640
- const i = `${e.space}/resources/modeler/pno/person?current=true&select=preferredcredentials&select=collabspaces`;
641
- f(i, {
639
+ function b(e, t = void 0, s = void 0, n = void 0, o = void 0, c = void 0) {
640
+ const r = `${e.space}/resources/modeler/pno/person?current=true&select=preferredcredentials&select=collabspaces`;
641
+ f(r, {
642
642
  method: "GET",
643
643
  onComplete(a) {
644
- const c = JSON.parse(a);
644
+ const i = JSON.parse(a);
645
645
  let d = "", l, p, u;
646
646
  if (t) {
647
- let m = c.collabspaces.find((g) => g.title === t);
647
+ let m = i.collabspaces.find((g) => g.title === t);
648
648
  if (m) {
649
649
  l = t;
650
650
  let g = m.couples;
@@ -652,120 +652,124 @@ function b(e, t = void 0, n = void 0, s = void 0, o = void 0, r = void 0) {
652
652
  (h, S, _) => S === _.findIndex(
653
653
  (y) => y.organization.pid === h.organization.pid && y.role.pid === h.role.pid
654
654
  )
655
- ), n && (Array.isArray(n) ? n.forEach((h) => {
655
+ ), s && (Array.isArray(s) ? s.forEach((h) => {
656
656
  u || g.forEach((S) => {
657
- if (h === S.role.name && s === S.organization.title)
658
- u = h, p = s;
657
+ if (h === S.role.name && n === S.organization.title)
658
+ u = h, p = n;
659
659
  else if (h === S.role.name) {
660
660
  let _ = g.filter(
661
661
  (y) => y.role.name === h
662
662
  );
663
- _.length === 1 ? (u = _[0].role.name, p = _[0].organization.title) : r(_);
663
+ _.length === 1 ? (u = _[0].role.name, p = _[0].organization.title) : c(_);
664
664
  }
665
665
  });
666
666
  }) : g.forEach((h) => {
667
- if (n === h.role.name && s === h.organization.title)
668
- u = n, p = s;
669
- else if (n === h.role.name) {
667
+ if (s === h.role.name && n === h.organization.title)
668
+ u = s, p = n;
669
+ else if (s === h.role.name) {
670
670
  let S = g.filter(
671
- (_) => _.role.name === n
671
+ (_) => _.role.name === s
672
672
  );
673
- S.length === 1 ? (u = S[0].role.name, p = S[0].organization.title) : r(S);
673
+ S.length === 1 ? (u = S[0].role.name, p = S[0].organization.title) : c(S);
674
674
  }
675
675
  }));
676
676
  }
677
677
  }
678
- l && p && u ? (d = u + "." + p + "." + l, o(d)) : c.preferredcredentials ? (d = c.preferredcredentials.role.name + "." + c.preferredcredentials.organization.title + "." + c.preferredcredentials.collabspace.title, o(d)) : r && (d = u + "." + p + "." + l, r(d));
678
+ l && p && u ? (d = u + "." + p + "." + l, o(d)) : i.preferredcredentials ? (d = i.preferredcredentials.role.name + "." + i.preferredcredentials.organization.title + "." + i.preferredcredentials.collabspace.title, o(d)) : c && (d = u + "." + p + "." + l, c(d));
679
679
  },
680
680
  onFailure(a) {
681
681
  console.log("Erreur de récupération du contexte de sécurité. => ", a);
682
682
  }
683
683
  });
684
684
  }
685
- async function I(e, t = void 0, n = void 0, s = void 0) {
686
- const o = e.objID;
687
- delete e.token, (!o || o === "") && console.warn(
685
+ async function I(e, t = void 0, s = void 0) {
686
+ const n = e.objID;
687
+ return (!n || n === "") && console.warn(
688
688
  "_3DSpace_download_doc() / Le paramètre objectId est obligatoire"
689
689
  ), (e.space === "" || !e.space) && console.warn(
690
690
  "_3DSpace_download_doc() / Le paramètre space est obligatoire"
691
- ), (e.token === "" || !e.token) && (console.log("je récupère un nouveau token"), J(
691
+ ), (e.token === "" || !e.token) && (J(
692
692
  e,
693
- (r) => {
694
- e.token = r;
693
+ (c) => {
694
+ e.token = c;
695
695
  },
696
- (r) => {
697
- console.log("☠️ error => ", r);
696
+ (c) => {
697
+ console.log("☠️ error => ", c);
698
698
  }
699
699
  ), console.warn(
700
700
  "_3DSpace_download_doc() / Le paramètre token est obligatoire"
701
- )), console.log("_3DSpace_download_doc / credentials", e), U(
702
- e,
703
- (r) => {
704
- f(r, {
705
- headers: {
706
- ENO_CSRF_TOKEN: e.token
707
- },
708
- onComplete(i) {
709
- const a = JSON.parse(i);
710
- console.log("_3DSpace_download_doc / reponse ", a), t && t(a);
711
- },
712
- onFailure(i, a, c) {
713
- n && (console.log("error http", i), n({ error: i, headers: a, xhr: c }));
714
- }
715
- });
716
- },
717
- (r) => {
718
- n && n(r), console.log("*_3dspace_download_doc / error file URL *", r);
719
- }
720
- );
701
+ )), console.log("_3DSpace_download_doc / credentials", e), new Promise((c, r) => {
702
+ U(
703
+ e,
704
+ (a) => {
705
+ f(a, {
706
+ headers: {
707
+ "Content-Type": "application/json",
708
+ Accept: "application/json",
709
+ ENO_CSRF_TOKEN: e.token
710
+ },
711
+ onComplete(i) {
712
+ const d = JSON.parse(i);
713
+ console.log("_3DSpace_download_doc / reponse ", d), t && t(d), c(d);
714
+ },
715
+ onFailure(i, d, l) {
716
+ s && (console.log("error http", i), s({ error: i, headers: d, xhr: l }), r({ error: i, headers: d, xhr: l }));
717
+ }
718
+ });
719
+ },
720
+ (a) => {
721
+ s && s(a), console.log("*_3dspace_download_doc / error file URL *", a), r(a);
722
+ }
723
+ );
724
+ });
721
725
  }
722
- async function X(e, t, n = void 0, s = void 0) {
726
+ async function X(e, t, s = void 0, n = void 0) {
723
727
  let o = [];
724
728
  for (let a = 0; a < t.length; a += 80) {
725
- const c = t.slice(a, a + 80);
726
- o.push(c);
729
+ const i = t.slice(a, a + 80);
730
+ o.push(i);
727
731
  }
728
- const i = (a) => {
732
+ const r = (a) => {
729
733
  V(
730
734
  e,
731
735
  o[a],
732
736
  () => {
733
- a++, a < o.length && i(a);
737
+ a++, a < o.length && r(a);
734
738
  },
735
- (c) => {
736
- n && n(c);
739
+ (i) => {
740
+ s && s(i);
737
741
  }
738
742
  );
739
743
  };
740
- i(0);
744
+ r(0);
741
745
  }
742
- function V(e, t, n = void 0, s = void 0, o = void 0) {
743
- const r = [];
744
- t.forEach((c) => {
745
- r.push({
746
- id: c
746
+ function V(e, t, s = void 0, n = void 0, o = void 0) {
747
+ const c = [];
748
+ t.forEach((i) => {
749
+ c.push({
750
+ id: i
747
751
  });
748
752
  });
749
- let i = JSON.stringify({
753
+ let r = JSON.stringify({
750
754
  csrf: {
751
755
  name: "ENO_CSRF_TOKEN",
752
756
  value: e.token
753
757
  },
754
- data: r
758
+ data: c
755
759
  });
756
760
  const a = `${e.space}/resources/v1/modeler/documents/DownloadTicket?tenant=${e.tenant}&e6w-lang=fr&e6w-timezone=-120`;
757
761
  f(a, {
758
762
  method: "PUT",
759
- data: i,
763
+ data: r,
760
764
  type: "json",
761
- onComplete(c) {
762
- const d = c.data;
763
- c.success === !0 && (n && n(), d.forEach((l) => {
765
+ onComplete(i) {
766
+ const d = i.data;
767
+ i.success === !0 && (s && s(), d.forEach((l) => {
764
768
  try {
765
769
  const p = l.dataelements.fileName, u = l.dataelements.ticketURL;
766
770
  f(u, {
767
771
  onComplete: (m) => {
768
- s && s({
772
+ n && n({
769
773
  objectId: l.id,
770
774
  fileName: p,
771
775
  data: JSON.parse(m)
@@ -780,15 +784,15 @@ function V(e, t, n = void 0, s = void 0, o = void 0) {
780
784
  }
781
785
  }));
782
786
  },
783
- onFailure(c) {
784
- console.log(c), o && o(c);
787
+ onFailure(i) {
788
+ console.log(i), o && o(i);
785
789
  }
786
790
  });
787
791
  }
788
- function De(e, t, n = void 0, s = void 0) {
792
+ function De(e, t, s = void 0, n = void 0) {
789
793
  return new Promise((o) => {
790
794
  if (e.token === "" && C(e), t !== void 0 && t !== "" && t !== null) {
791
- const r = `${e.space}/resources/v1/modeler/dslc/maturity/getNextStates`;
795
+ const c = `${e.space}/resources/v1/modeler/dslc/maturity/getNextStates`;
792
796
  b(
793
797
  e.space,
794
798
  "ESPACE COMMUN",
@@ -799,7 +803,7 @@ function De(e, t, n = void 0, s = void 0) {
799
803
  console.log("onError =>", a);
800
804
  }
801
805
  );
802
- let i = {
806
+ let r = {
803
807
  method: "POST",
804
808
  headers: {
805
809
  SecurityContext: "ctx::" + e.ctx,
@@ -816,28 +820,28 @@ function De(e, t, n = void 0, s = void 0) {
816
820
  }),
817
821
  type: "json",
818
822
  onComplete(a) {
819
- n && n(a);
823
+ s && s(a);
820
824
  },
821
825
  onFailure(a) {
822
- s && s(a);
826
+ n && n(a);
823
827
  }
824
828
  };
825
- f(r, i);
829
+ f(c, r);
826
830
  }
827
831
  });
828
832
  }
829
- function Fe(e, t, n, s = void 0, o = void 0) {
830
- return new Promise((r) => {
833
+ function Fe(e, t, s, n = void 0, o = void 0) {
834
+ return new Promise((c) => {
831
835
  if (e.token === "" && C(e), t !== void 0 && t !== "" && t !== null) {
832
- const i = `${e.space}/resources/v1/modeler/dslc/maturity/changeState`;
836
+ const r = `${e.space}/resources/v1/modeler/dslc/maturity/changeState`;
833
837
  b(
834
838
  e.space,
835
839
  "ESPACE COMMUN",
836
840
  ["VPLMProjectLeader", "VPLMCreator"],
837
841
  void 0,
838
- (c) => e.ctx = c,
839
- (c) => {
840
- console.log("onError =>", c);
842
+ (i) => e.ctx = i,
843
+ (i) => {
844
+ console.log("onError =>", i);
841
845
  }
842
846
  );
843
847
  let a = {
@@ -852,26 +856,26 @@ function Fe(e, t, n, s = void 0, o = void 0) {
852
856
  data: [
853
857
  {
854
858
  id: t,
855
- nextState: n
859
+ nextState: s
856
860
  }
857
861
  ]
858
862
  }),
859
863
  type: "json",
860
- onComplete(c) {
861
- s && s(c);
864
+ onComplete(i) {
865
+ n && n(i);
862
866
  },
863
- onFailure(c) {
864
- o && o(c);
867
+ onFailure(i) {
868
+ o && o(i);
865
869
  }
866
870
  };
867
- f(i, a);
871
+ f(r, a);
868
872
  }
869
873
  });
870
874
  }
871
- function Ue(e, t, n = void 0, s = void 0) {
875
+ function Ue(e, t, s = void 0, n = void 0) {
872
876
  return new Promise((o) => {
873
877
  if (e.token === "" && C(e), t !== void 0 && t !== "" && t !== null) {
874
- const r = `${e.space}/resources/v1/dslc/versiongraph?withThumbnail=0&withIsLastVersion=0&withAttributes=0&withCopyFrom=0&tenant=${e.tenant}`;
878
+ const c = `${e.space}/resources/v1/dslc/versiongraph?withThumbnail=0&withIsLastVersion=0&withAttributes=0&withCopyFrom=0&tenant=${e.tenant}`;
875
879
  b(
876
880
  e.space,
877
881
  "ESPACE COMMUN",
@@ -882,7 +886,7 @@ function Ue(e, t, n = void 0, s = void 0) {
882
886
  console.log("onError =>", a);
883
887
  }
884
888
  );
885
- let i = {
889
+ let r = {
886
890
  method: "POST",
887
891
  headers: {
888
892
  securitycontext: "ctx::" + e.ctx,
@@ -899,20 +903,20 @@ function Ue(e, t, n = void 0, s = void 0) {
899
903
  }),
900
904
  type: "json",
901
905
  onComplete(a) {
902
- n && n(a);
906
+ s && s(a);
903
907
  },
904
908
  onFailure(a) {
905
- s && s(a);
909
+ n && n(a);
906
910
  }
907
911
  };
908
- f(r, i);
912
+ f(c, r);
909
913
  }
910
914
  });
911
915
  }
912
- function $e(e, t, n = void 0, s = void 0) {
916
+ function $e(e, t, s = void 0, n = void 0) {
913
917
  return new Promise((o) => {
914
918
  if (e.token === "" && C(e), t !== void 0 && t !== "" && t !== null) {
915
- const r = `${e.space}/resources/lifecycle/revise/prepare_revise_maskattributes?tenant=${e.tenant}`;
919
+ const c = `${e.space}/resources/lifecycle/revise/prepare_revise_maskattributes?tenant=${e.tenant}`;
916
920
  b(
917
921
  e.space,
918
922
  "ESPACE COMMUN",
@@ -923,7 +927,7 @@ function $e(e, t, n = void 0, s = void 0) {
923
927
  console.log("onError =>", a);
924
928
  }
925
929
  );
926
- let i = {
930
+ let r = {
927
931
  method: "POST",
928
932
  headers: {
929
933
  SecurityContext: "ctx::" + e.ctx,
@@ -946,28 +950,28 @@ function $e(e, t, n = void 0, s = void 0) {
946
950
  }),
947
951
  type: "json",
948
952
  onComplete(a) {
949
- n && n(a);
953
+ s && s(a);
950
954
  },
951
955
  onFailure(a) {
952
- s && s(a);
956
+ n && n(a);
953
957
  }
954
958
  };
955
- f(r, i);
959
+ f(c, r);
956
960
  }
957
961
  });
958
962
  }
959
- function je(e, t, n, s = void 0, o = void 0) {
960
- return new Promise((r) => {
963
+ function je(e, t, s, n = void 0, o = void 0) {
964
+ return new Promise((c) => {
961
965
  if (e.token === "" && C(e), t !== void 0 && t !== "" && t !== null) {
962
- const i = `${e.space}/resources/lifecycle/revise/major?tenant=${e.tenant}`;
966
+ const r = `${e.space}/resources/lifecycle/revise/major?tenant=${e.tenant}`;
963
967
  b(
964
968
  e.space,
965
969
  "ESPACE COMMUN",
966
970
  ["VPLMProjectLeader", "VPLMCreator"],
967
971
  void 0,
968
- (c) => e.ctx = c,
969
- (c) => {
970
- console.log("onError =>", c);
972
+ (i) => e.ctx = i,
973
+ (i) => {
974
+ console.log("onError =>", i);
971
975
  }
972
976
  );
973
977
  let a = {
@@ -982,9 +986,9 @@ function je(e, t, n, s = void 0, o = void 0) {
982
986
  data: [
983
987
  {
984
988
  physicalid: t,
985
- proposedRevision: n,
989
+ proposedRevision: s,
986
990
  modifiedAttributes: {
987
- revision: n
991
+ revision: s
988
992
  }
989
993
  }
990
994
  ],
@@ -992,83 +996,83 @@ function je(e, t, n, s = void 0, o = void 0) {
992
996
  notificationTimeout: 600
993
997
  }),
994
998
  type: "json",
995
- onComplete(c) {
996
- s && s(c);
999
+ onComplete(i) {
1000
+ n && n(i);
997
1001
  },
998
- onFailure(c) {
999
- o && o(c);
1002
+ onFailure(i) {
1003
+ o && o(i);
1000
1004
  }
1001
1005
  };
1002
- f(i, a);
1006
+ f(r, a);
1003
1007
  }
1004
1008
  });
1005
1009
  }
1006
1010
  //!SECTION
1007
- function Ae(e, t = void 0, n = void 0) {
1008
- const s = {
1011
+ function Ae(e, t = void 0, s = void 0) {
1012
+ const n = {
1009
1013
  base: `${e.space}`,
1010
1014
  uri: "/resources/bps/cspaces",
1011
1015
  optTenant: `tenant=${e.tenant}`
1012
- }, o = `${s.base}${s.uri}?${s.optTenant}`;
1016
+ }, o = `${n.base}${n.uri}?${n.optTenant}`;
1013
1017
  f(o, {
1014
1018
  method: "GET",
1015
1019
  headers: {
1016
1020
  Accept: "application/json,text/javascript,*/*",
1017
1021
  "Content-Type": "application/ds-json"
1018
1022
  },
1019
- onComplete(r, i) {
1020
- const a = JSON.parse(r);
1021
- t && t(a, i);
1023
+ onComplete(c, r) {
1024
+ const a = JSON.parse(c);
1025
+ t && t(a, r);
1022
1026
  },
1023
- onFailure(r, i, a) {
1024
- n && n({ response: r, headers: i, xhr: a });
1027
+ onFailure(c, r, a) {
1028
+ s && s({ response: c, headers: r, xhr: a });
1025
1029
  }
1026
1030
  });
1027
1031
  }
1028
- function Re(e, t, n, s) {
1032
+ function Re(e, t, s, n) {
1029
1033
  U(
1030
1034
  e.space,
1031
1035
  t,
1032
1036
  (o) => {
1033
1037
  f(o, {
1034
1038
  header: { ENO_CSRF_TOKEN: e.token },
1035
- onComplete: (r) => {
1036
- n && n(r);
1039
+ onComplete: (c) => {
1040
+ s && s(c);
1037
1041
  },
1038
- onFailure: (r) => {
1039
- console.log("error http", r), s && s(r);
1042
+ onFailure: (c) => {
1043
+ console.log("error http", c), n && n(c);
1040
1044
  }
1041
1045
  });
1042
1046
  }
1043
1047
  );
1044
1048
  }
1045
- async function Ie(e, t, n = void 0, s = void 0) {
1049
+ async function Ie(e, t, s = void 0, n = void 0) {
1046
1050
  return new Promise((o) => {
1047
- U(e, t, (r) => {
1048
- f(r, {
1049
- onComplete: (i, a, c) => (o(JSON.parse(i)), n && n(JSON.parse(i), a, c), o),
1050
- onFailure: (i, a, c) => {
1051
- s && s(i, a, c), console.log(i, a?.errormsg);
1051
+ U(e, t, (c) => {
1052
+ f(c, {
1053
+ onComplete: (r, a, i) => (o(JSON.parse(r)), s && s(JSON.parse(r), a, i), o),
1054
+ onFailure: (r, a, i) => {
1055
+ n && n(r, a, i), console.log(r, a?.errormsg);
1052
1056
  }
1053
1057
  });
1054
1058
  });
1055
1059
  });
1056
1060
  }
1057
- function ve(e, t, n, s = void 0, o = void 0) {
1058
- const r = new Blob([JSON.stringify(t)], { type: "text/plain" });
1061
+ function ve(e, t, s, n = void 0, o = void 0) {
1062
+ const c = new Blob([JSON.stringify(t)], { type: "text/plain" });
1059
1063
  k(
1060
1064
  e,
1061
- n,
1062
- (i) => {
1063
- const a = i.data[0].relateddata.files[0].id, c = i.data[0].dataelements.secondaryTitle !== "" ? i.data[0].dataelements.secondaryTitle : i.data[0].dataelements.title;
1065
+ s,
1066
+ (r) => {
1067
+ const a = r.data[0].relateddata.files[0].id, i = r.data[0].dataelements.secondaryTitle !== "" ? r.data[0].dataelements.secondaryTitle : r.data[0].dataelements.title;
1064
1068
  K(
1065
1069
  e,
1066
- n,
1070
+ s,
1067
1071
  a,
1068
- r,
1069
1072
  c,
1073
+ i,
1070
1074
  (d) => {
1071
- s && s(d);
1075
+ n && n(d);
1072
1076
  },
1073
1077
  (d) => {
1074
1078
  o && o(d);
@@ -1077,64 +1081,61 @@ function ve(e, t, n, s = void 0, o = void 0) {
1077
1081
  }
1078
1082
  );
1079
1083
  }
1080
- let v, x;
1084
+ let v, P;
1081
1085
  const $ = [];
1082
- async function xe(e, t = void 0, n = void 0) {
1086
+ async function Pe(e, t = void 0, s = void 0) {
1083
1087
  e.objID && e.objID !== "" ? (console.log("obj est présent"), k(
1084
1088
  e,
1085
- (s) => {
1086
- t && t(s);
1089
+ (n) => {
1090
+ t && t(n);
1087
1091
  },
1088
- (s) => {
1089
- n && n(s);
1092
+ (n) => {
1093
+ s && s(n);
1090
1094
  }
1091
1095
  )) : (e.objID === null || e.objID === "") && C(
1092
1096
  e,
1093
- (s) => {
1094
- t && t({ rep: s, msg: "Pas d'objID, ou invalide" });
1097
+ (n) => {
1098
+ t && t({ rep: n, msg: "Pas d'objID, ou invalide" });
1095
1099
  },
1096
- (s) => {
1097
- n && n({ msg: "Pas d'objID et erreur sur le Space", err: s });
1100
+ (n) => {
1101
+ s && s({ msg: "Pas d'objID et erreur sur le Space", err: n });
1098
1102
  }
1099
1103
  );
1100
1104
  }
1101
- async function Pe(e, t = void 0, n = void 0) {
1105
+ async function xe(e, t = void 0, s = void 0) {
1102
1106
  console.log("getDatasByTenant (getDocuments)", e), await I(
1103
1107
  e,
1104
- (s) => {
1108
+ (n) => {
1105
1109
  const o = {};
1106
- o.obj = s, console.log("getDatasByTenant (getDocuments) _datas", o), t && t?.(o);
1110
+ o.obj = n, console.log("getDatasByTenant (getDocuments) _datas", o), t && t?.(o);
1107
1111
  },
1108
- (s) => {
1109
- n && n?.(s);
1112
+ (n) => {
1113
+ s && s?.(n);
1110
1114
  }
1111
1115
  );
1112
1116
  }
1113
- function Me(e, t = void 0, n = void 0) {
1114
- const s = [];
1115
- e.objIds.forEach((o, r) => {
1117
+ function Me(e, t = void 0, s = void 0) {
1118
+ const n = [];
1119
+ e.objIds.forEach((o, c) => {
1116
1120
  I(
1117
1121
  e,
1118
1122
  o.objId,
1119
- (i) => {
1120
- s.push({ [o.name]: i }), o.name === "dbProjets" && (v = i.affaires.map((a) => a.objectID), B(e, x)), r === e.objIds.length - 1 && t && t(s);
1121
- },
1122
- (i) => {
1123
- n && n(i);
1123
+ (r) => {
1124
+ n.push({ [o.name]: r }), o.name === "dbProjets" && (v = r.affaires.map((a) => a.objectID), B(e, P)), c === e.objIds.length - 1 && t && t(n);
1124
1125
  }
1125
1126
  );
1126
1127
  });
1127
1128
  }
1128
- function B(e, t, n = void 0, s = void 0) {
1129
+ function B(e, t, s = void 0, n = void 0) {
1129
1130
  X(
1130
1131
  e,
1131
1132
  v,
1132
1133
  (o) => {
1133
- const r = [...t];
1134
- r.find((i) => i.objectID === o.objectId).data = o.data, x = r, $.push(o.data), n && n($);
1134
+ const c = [...t];
1135
+ c.find((r) => r.objectID === o.objectId).data = o.data, P = c, $.push(o.data), s && s($);
1135
1136
  },
1136
1137
  (o) => {
1137
- s && (s(o), console.log(o));
1138
+ n && (n(o), console.log(o));
1138
1139
  }
1139
1140
  );
1140
1141
  }
@@ -1145,7 +1146,7 @@ const Y = "FA35FB9B177A280065800EA0000F599C", H = [
1145
1146
  "usersgroup",
1146
1147
  "3dplan",
1147
1148
  "dashboard"
1148
- ], P = {
1149
+ ], x = {
1149
1150
  how: "ds6w:how",
1150
1151
  what: "ds6w:what",
1151
1152
  when: "ds6w:when",
@@ -1158,22 +1159,22 @@ const Y = "FA35FB9B177A280065800EA0000F599C", H = [
1158
1159
  order_by: "desc",
1159
1160
  tag: "testTag"
1160
1161
  };
1161
- function Le(e, t, n = void 0, s = void 0) {
1162
- const { space: o, tenant: r } = e, { objId: i, pred: a, tag: c } = t, d = {
1162
+ function Le(e, t, s = void 0, n = void 0) {
1163
+ const { space: o, tenant: c } = e, { objId: r, pred: a, tag: i } = t, d = {
1163
1164
  uri: "/resources/6w/tags",
1164
1165
  otpCTX: "SecurityContext=preferred",
1165
- optTenant: `tenant=${r}`
1166
+ optTenant: `tenant=${c}`
1166
1167
  }, l = `${o}${d.uri}?${d.otpCTX}&${d.optTenant}`, p = {
1167
1168
  tag: [
1168
1169
  {
1169
1170
  subject: [
1170
1171
  {
1171
- uri: `pid://${i}`
1172
+ uri: `pid://${r}`
1172
1173
  }
1173
1174
  ],
1174
- predicate: P[a],
1175
+ predicate: x[a],
1175
1176
  object: {
1176
- literal: c
1177
+ literal: i
1177
1178
  }
1178
1179
  }
1179
1180
  ]
@@ -1191,46 +1192,46 @@ function Le(e, t, n = void 0, s = void 0) {
1191
1192
  setTimeout(() => {
1192
1193
  G(
1193
1194
  e,
1194
- i,
1195
+ r,
1195
1196
  (g) => {
1196
1197
  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;
1197
1198
  m.name = h, m.ext = S, m.createBy = _, t.info = { ...m }, q(
1198
1199
  e,
1199
1200
  t,
1200
1201
  (y) => {
1201
- n && n(y);
1202
+ s && s(y);
1202
1203
  },
1203
1204
  (y) => {
1204
- s && s(y);
1205
+ n && n(y);
1205
1206
  }
1206
1207
  );
1207
1208
  },
1208
1209
  (g, h) => {
1209
1210
  const S = g;
1210
- S.msg = h.errormsg, S.errCode = h.errorcode, console.log("❌ sendDirectMessage => ", S), s && s(S);
1211
+ S.msg = h.errormsg, S.errCode = h.errorcode, console.log("❌ sendDirectMessage => ", S), n && n(S);
1211
1212
  }
1212
1213
  );
1213
1214
  }, 2e3);
1214
1215
  },
1215
1216
  onFailure(u, m) {
1216
1217
  const g = u;
1217
- g.msg = m.errormsg, g.errCode = m.errorcode, console.log("❌ sendDirectMessage => ", g), s && s(g);
1218
+ g.msg = m.errormsg, g.errCode = m.errorcode, console.log("❌ sendDirectMessage => ", g), n && n(g);
1218
1219
  }
1219
1220
  });
1220
1221
  }
1221
- function q(e, t, n = void 0, s = void 0) {
1222
+ function q(e, t, s = void 0, n = void 0) {
1222
1223
  console.log("obj ", t);
1223
- const o = t.info.name, r = {
1224
+ const o = t.info.name, c = {
1224
1225
  baseUrl: `https://${e.tenant.toLowerCase()}-eu1-fedsearch.3dexperience.3ds.com`,
1225
1226
  uri: "/federated/search"
1226
- }, i = `${r.baseUrl}${r.uri}`, a = {
1227
+ }, r = `${c.baseUrl}${c.uri}`, a = {
1227
1228
  "Content-Type": "application/json",
1228
1229
  Accept: "application/json,text/javascript,*/*"
1229
- }, c = R(), d = {
1230
+ }, i = R(), d = {
1230
1231
  with_indexing_date: !0,
1231
1232
  with_synthesis: !0,
1232
1233
  with_nls: !1,
1233
- label: `3DSearch-${e.currentUser.username}-AjoutDeTagBeam-${c}`,
1234
+ label: `3DSearch-${e.currentUser.username}-AjoutDeTagBeam-${i}`,
1234
1235
  locale: "fr",
1235
1236
  select_predicate: [
1236
1237
  "ds6w:label",
@@ -1287,26 +1288,26 @@ function q(e, t, n = void 0, s = void 0) {
1287
1288
  }
1288
1289
  }
1289
1290
  };
1290
- console.log("dataPattern => ", d), f(i, {
1291
+ console.log("dataPattern => ", d), f(r, {
1291
1292
  method: "POST",
1292
1293
  headers: a,
1293
1294
  data: JSON.stringify(d),
1294
1295
  onComplete(l) {
1295
1296
  const p = JSON.parse(l);
1296
- n(p);
1297
+ s(p);
1297
1298
  },
1298
1299
  onFailure(l, p) {
1299
1300
  const u = l;
1300
- u.msg = p.errormsg, u.errCode = p.errorcode, console.log("❌ sendDirectMessage => ", u), s && s(u), console.log("Erreur de recuperation d'id du doc et des tags", l);
1301
+ u.msg = p.errormsg, u.errCode = p.errorcode, console.log("❌ sendDirectMessage => ", u), n && n(u), console.log("Erreur de recuperation d'id du doc et des tags", l);
1301
1302
  }
1302
1303
  });
1303
1304
  }
1304
- function Ee(e, t, n = void 0, s = void 0) {
1305
- const { objId: o, pred: r, tag: i } = t, a = {
1305
+ function Ee(e, t, s = void 0, n = void 0) {
1306
+ const { objId: o, pred: c, tag: r } = t, a = {
1306
1307
  uri: "/resources/6w/tags",
1307
1308
  otpCTX: "SecurityContext=preferred",
1308
1309
  optTenant: `tenant=${e.tenant}`
1309
- }, c = `${e.space}${a.uri}?${a.otpCTX}&${a.optTenant}`, d = {
1310
+ }, i = `${e.space}${a.uri}?${a.otpCTX}&${a.optTenant}`, d = {
1310
1311
  tag: [
1311
1312
  {
1312
1313
  subject: [
@@ -1314,14 +1315,14 @@ function Ee(e, t, n = void 0, s = void 0) {
1314
1315
  uri: `pid://${o}`
1315
1316
  }
1316
1317
  ],
1317
- predicate: P[r],
1318
+ predicate: x[c],
1318
1319
  object: {
1319
- literal: i
1320
+ literal: r
1320
1321
  }
1321
1322
  }
1322
1323
  ]
1323
1324
  };
1324
- f(c, {
1325
+ f(i, {
1325
1326
  method: "DELETE",
1326
1327
  data: JSON.stringify(d),
1327
1328
  headers: {
@@ -1329,52 +1330,52 @@ function Ee(e, t, n = void 0, s = void 0) {
1329
1330
  Accept: "application/json,text/javascript,*/*"
1330
1331
  },
1331
1332
  onComplete(l) {
1332
- n && n(l);
1333
+ s && s(l);
1333
1334
  },
1334
1335
  onFailure(l, p) {
1335
1336
  const u = l;
1336
- u.msg = p.errormsg, u.errCode = p.errorcode, console.log("❌ sendDirectMessage => ", u), s && s(u);
1337
+ u.msg = p.errormsg, u.errCode = p.errorcode, console.log("❌ sendDirectMessage => ", u), n && n(u);
1337
1338
  }
1338
1339
  });
1339
1340
  }
1340
- function Je(e, t = "", n = void 0, s = void 0) {
1341
+ function Je(e, t = "", s = void 0, n = void 0) {
1341
1342
  const { space: o } = e;
1342
1343
  if (t === "")
1343
1344
  return;
1344
- const r = {
1345
+ const c = {
1345
1346
  uri: "/resources/v1/modeler/documents"
1346
- }, i = {
1347
+ }, r = {
1347
1348
  "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8",
1348
1349
  Accept: "application/json,text/javascript,*/*"
1349
- }, a = `${o}${r.uri}`, c = `$include=none,lockerInfo,ownerInfo,originatorInfo,files,ownerInfo,originatorInfo&$fields=none,title,name,typeNLS,collabSpaceTitle,revision,isLatestRevision,files,lockStatus,lockerInfo.name,lockerInfo.firstname,lockerInfo.lastname,owner,ownerInfo.name,ownerInfo.firstname,ownerInfo.lastname,stateNLS,modified,policy,state,organizationTitle,originator,originatorInfo.name,originatorInfo.firstname,originatorInfo.lastname,hasModifyAccess,fileExtension,files.name,files.title,files.revision,files.locker,ownerInfo,ownerInfo.name,ownerInfo.firstname,ownerInfo.lastname,originatorInfo,originatorInfo.name,originatorInfo.firstname,originatorInfo.lastname&$ids=${t}`;
1350
+ }, a = `${o}${c.uri}`, i = `$include=none,lockerInfo,ownerInfo,originatorInfo,files,ownerInfo,originatorInfo&$fields=none,title,name,typeNLS,collabSpaceTitle,revision,isLatestRevision,files,lockStatus,lockerInfo.name,lockerInfo.firstname,lockerInfo.lastname,owner,ownerInfo.name,ownerInfo.firstname,ownerInfo.lastname,stateNLS,modified,policy,state,organizationTitle,originator,originatorInfo.name,originatorInfo.firstname,originatorInfo.lastname,hasModifyAccess,fileExtension,files.name,files.title,files.revision,files.locker,ownerInfo,ownerInfo.name,ownerInfo.firstname,ownerInfo.lastname,originatorInfo,originatorInfo.name,originatorInfo.firstname,originatorInfo.lastname&$ids=${t}`;
1350
1351
  f(a, {
1351
1352
  method: "POST",
1352
- headers: i,
1353
- data: c,
1353
+ headers: r,
1354
+ data: i,
1354
1355
  onComplete(d) {
1355
- n && n(JSON.parse(d));
1356
+ s && s(JSON.parse(d));
1356
1357
  },
1357
1358
  onFailure(d, l) {
1358
1359
  const p = d;
1359
- p.msg = l.error, s && s(p);
1360
+ p.msg = l.error, n && n(p);
1360
1361
  }
1361
1362
  });
1362
1363
  }
1363
- async function w(e, t = void 0, n = void 0) {
1364
- const s = e.space + "/api/index/tk";
1365
- return f(s, {
1366
- onComplete(o, r, i) {
1364
+ async function w(e, t = void 0, s = void 0) {
1365
+ const n = e.space + "/api/index/tk";
1366
+ return f(n, {
1367
+ onComplete(o, c, r) {
1367
1368
  const a = JSON.parse(o);
1368
1369
  if (t)
1369
1370
  return t(a), e.token = a?.result?.ServerToken;
1370
1371
  },
1371
1372
  onFailure(o) {
1372
- n && n(o);
1373
+ s && s(o);
1373
1374
  }
1374
1375
  });
1375
1376
  }
1376
- function Ge(e, t = void 0, n = void 0) {
1377
- const s = `${e.space}/api/exalead/whatsnew`, o = {
1377
+ function Ge(e, t = void 0, s = void 0) {
1378
+ const n = `${e.space}/api/exalead/whatsnew`, o = {
1378
1379
  params: {
1379
1380
  community_id: null,
1380
1381
  hash_key: null,
@@ -1384,27 +1385,27 @@ function Ge(e, t = void 0, n = void 0) {
1384
1385
  start: 0
1385
1386
  }
1386
1387
  };
1387
- w(e, (r) => {
1388
- f(s, {
1388
+ w(e, (c) => {
1389
+ f(n, {
1389
1390
  method: "POST",
1390
1391
  headers: {
1391
- "X-DS-SWYM-CSRFTOKEN": r.result.ServerToken,
1392
+ "X-DS-SWYM-CSRFTOKEN": c.result.ServerToken,
1392
1393
  "Content-type": "application/json;charset=UTF-8",
1393
1394
  Accept: "application/json"
1394
1395
  },
1395
1396
  data: JSON.stringify(o),
1396
1397
  type: "json",
1397
- onComplete(i, a) {
1398
- t && t(i, a);
1398
+ onComplete(r, a) {
1399
+ t && t(r, a);
1399
1400
  },
1400
- onFailure(i, a) {
1401
- n && n(i, a);
1401
+ onFailure(r, a) {
1402
+ s && s(r, a);
1402
1403
  }
1403
1404
  });
1404
1405
  });
1405
1406
  }
1406
- function Ke(e, t = void 0, n = void 0) {
1407
- const s = `${e.space}/api/Recommendation/getpeoplefamiliartocurrentuser`, o = {
1407
+ function Ke(e, t = void 0, s = void 0) {
1408
+ const n = `${e.space}/api/Recommendation/getpeoplefamiliartocurrentuser`, o = {
1408
1409
  params: {
1409
1410
  idsToFilterArr: [],
1410
1411
  mode: "offline",
@@ -1413,40 +1414,40 @@ function Ke(e, t = void 0, n = void 0) {
1413
1414
  maxNbOfCommonElements: "5"
1414
1415
  }
1415
1416
  };
1416
- w(e, (r) => {
1417
- f(s, {
1417
+ w(e, (c) => {
1418
+ f(n, {
1418
1419
  method: "POST",
1419
1420
  headers: {
1420
- "X-DS-SWYM-CSRFTOKEN": r.result.ServerToken,
1421
+ "X-DS-SWYM-CSRFTOKEN": c.result.ServerToken,
1421
1422
  "Content-type": "application/json;charset=UTF-8",
1422
1423
  Accept: "application/json"
1423
1424
  },
1424
1425
  data: JSON.stringify(o),
1425
1426
  type: "json",
1426
- onComplete(i, a) {
1427
- const c = i.result.hits.map((d) => ({ login: d.login, fullName: d.name }));
1428
- t && t(c, i);
1427
+ onComplete(r, a) {
1428
+ const i = r.result.hits.map((d) => ({ login: d.login, fullName: d.name }));
1429
+ t && t(i, r);
1429
1430
  },
1430
- onFailure(i, a) {
1431
- n && n(i, a);
1431
+ onFailure(r, a) {
1432
+ s && s(r, a);
1432
1433
  }
1433
1434
  });
1434
1435
  });
1435
1436
  }
1436
- function We(e, t = void 0, n = void 0) {
1437
- const s = {
1437
+ function We(e, t = void 0, s = void 0) {
1438
+ const n = {
1438
1439
  base: e.space,
1439
1440
  uri: "/api/community/listmycommunities",
1440
1441
  limit: `/limit/${e.limit ? e.limit : 128}`,
1441
1442
  page: `/page/${e.page ? e.page : "1"}`
1442
- }, o = `${s.base}${s.uri}${s.limit}${s.page}`, r = [];
1443
- w(e, (i) => {
1443
+ }, o = `${n.base}${n.uri}${n.limit}${n.page}`, c = [];
1444
+ w(e, (r) => {
1444
1445
  f(o, {
1445
1446
  method: "GET",
1446
1447
  headers: {
1447
- "X-DS-SWYM-CSRFTOKEN": i.result.ServerToken
1448
+ "X-DS-SWYM-CSRFTOKEN": r.result.ServerToken
1448
1449
  },
1449
- onComplete(a, c, d) {
1450
+ onComplete(a, i, d) {
1450
1451
  const p = JSON.parse(a).result;
1451
1452
  let u = 0;
1452
1453
  p.forEach((m) => {
@@ -1462,76 +1463,76 @@ function We(e, t = void 0, n = void 0) {
1462
1463
  e,
1463
1464
  m.id,
1464
1465
  (h) => {
1465
- u++, g.members = h, r.push(g), u === p.length && t && t(r);
1466
+ u++, g.members = h, c.push(g), u === p.length && t && t(c);
1466
1467
  },
1467
- (h) => n(h)
1468
+ (h) => s(h)
1468
1469
  );
1469
1470
  });
1470
1471
  },
1471
- onFailure(a, c) {
1472
+ onFailure(a, i) {
1472
1473
  const d = a;
1473
- d.status = c.status, d.response = c.errormsg, n && n(d);
1474
+ d.status = i.status, d.response = i.errormsg, s && s(d);
1474
1475
  }
1475
1476
  });
1476
1477
  });
1477
1478
  }
1478
- function Q(e, t, n, s) {
1479
- const o = `${e.space}/api/community/listmembers`, r = {
1479
+ function Q(e, t, s, n) {
1480
+ const o = `${e.space}/api/community/listmembers`, c = {
1480
1481
  params: {
1481
1482
  page: e.page ? e.page : 1,
1482
1483
  limit: e.limit ? e.limit : 50,
1483
1484
  community_id: t
1484
1485
  }
1485
1486
  };
1486
- w(e, (i) => {
1487
+ w(e, (r) => {
1487
1488
  f(o, {
1488
1489
  method: "POST",
1489
1490
  headers: {
1490
1491
  "Content-type": "application/json;charset=UTF-8",
1491
1492
  Accept: "application/json",
1492
- "X-DS-SWYM-CSRFTOKEN": i.result.ServerToken
1493
+ "X-DS-SWYM-CSRFTOKEN": r.result.ServerToken
1493
1494
  },
1494
- data: JSON.stringify(r),
1495
+ data: JSON.stringify(c),
1495
1496
  type: "json",
1496
- onComplete(a, c, d) {
1497
- n && n(a);
1497
+ onComplete(a, i, d) {
1498
+ s && s(a);
1498
1499
  },
1499
- onFailure(a, c) {
1500
+ onFailure(a, i) {
1500
1501
  const d = a;
1501
- d.status = c.status, d.response = c.errormsg, s && s(d);
1502
+ d.status = i.status, d.response = i.errormsg, n && n(d);
1502
1503
  }
1503
1504
  });
1504
1505
  });
1505
1506
  }
1506
- function Xe(e, t = void 0, n = void 0) {
1507
- const s = "YXdA5x4DSUKtlAi2wmnyTA";
1508
- e.commu_id || (e.commu_id = s);
1507
+ function Xe(e, t = void 0, s = void 0) {
1508
+ const n = "YXdA5x4DSUKtlAi2wmnyTA";
1509
+ e.commu_id || (e.commu_id = n);
1509
1510
  const o = `${e.space}/api/v2/communities/${e.commu_id}/ideas/statuses`;
1510
- w(e, (r) => {
1511
+ w(e, (c) => {
1511
1512
  f(o, {
1512
1513
  method: "GET",
1513
1514
  headers: {
1514
1515
  "Content-type": "application/json;charset=UTF-8",
1515
1516
  Accept: "application/json",
1516
- "X-DS-SWYM-CSRFTOKEN": r.result.ServerToken
1517
+ "X-DS-SWYM-CSRFTOKEN": c.result.ServerToken
1517
1518
  },
1518
- onComplete(i) {
1519
- const a = JSON.parse(i);
1519
+ onComplete(r) {
1520
+ const a = JSON.parse(r);
1520
1521
  t && t(a);
1521
1522
  },
1522
- onFailure(i, a) {
1523
- const c = i;
1524
- c.status = a.status, c.response = a.errormsg, n && n(c);
1523
+ onFailure(r, a) {
1524
+ const i = r;
1525
+ i.status = a.status, i.response = a.errormsg, s && s(i);
1525
1526
  }
1526
1527
  });
1527
1528
  });
1528
1529
  }
1529
- function Ve(e, t, n = void 0, s = void 0) {
1530
- const { listAllContacts: o, currentUser: r } = e;
1530
+ function Ve(e, t, s = void 0, n = void 0) {
1531
+ const { listAllContacts: o, currentUser: c } = e;
1531
1532
  console.log("__listAllContacts", o.hits);
1532
- const i = `${e.space}/api/directmessages`, a = {
1533
- users: [r.login].concat(t.receipt)
1534
- }, c = {
1533
+ const r = `${e.space}/api/directmessages`, a = {
1534
+ users: [c.login].concat(t.receipt)
1535
+ }, i = {
1535
1536
  id_msg: "",
1536
1537
  senderId: e.currentUser.login,
1537
1538
  senderName: `${e.currentUser.first_name} ${e.currentUser.last_name}`,
@@ -1541,14 +1542,14 @@ function Ve(e, t, n = void 0, s = void 0) {
1541
1542
  Z(
1542
1543
  a.users,
1543
1544
  (l) => {
1544
- l !== void 0 && (c.id_msg = l.id, d = !0, j(e, c));
1545
+ l !== void 0 && (i.id_msg = l.id, d = !0, j(e, i));
1545
1546
  },
1546
1547
  (l) => {
1547
- d = !1, console.log("_3dSwym_findCommunityToInstantMSG callback", l), s && s(l), c.id_msg = "";
1548
+ d = !1, console.log("_3dSwym_findCommunityToInstantMSG callback", l), n && n(l), i.id_msg = "";
1548
1549
  }
1549
1550
  ), d === !1 && setTimeout(() => {
1550
1551
  d === !1 && w(e, (l) => {
1551
- f(i, {
1552
+ f(r, {
1552
1553
  method: "POST",
1553
1554
  headers: {
1554
1555
  "Content-Type": "application/json",
@@ -1559,52 +1560,52 @@ function Ve(e, t, n = void 0, s = void 0) {
1559
1560
  type: "json",
1560
1561
  onComplete(p, u, m) {
1561
1562
  const g = p;
1562
- g.reponse = JSON.parse(m.response), g.status = m.status, n && n(g), c.id_msg = g.result.id, j(e, c);
1563
+ g.reponse = JSON.parse(m.response), g.status = m.status, s && s(g), i.id_msg = g.result.id, j(e, i);
1563
1564
  },
1564
1565
  onFailure(p, u, m) {
1565
1566
  const g = p;
1566
- g.msg = u.errormsg, g.status = u.status, s && s(g);
1567
+ g.msg = u.errormsg, g.status = u.status, n && n(g);
1567
1568
  }
1568
1569
  });
1569
1570
  });
1570
1571
  }, 500);
1571
1572
  }
1572
- function Z(e, t, n, s) {
1573
+ function Z(e, t, s, n) {
1573
1574
  const o = `${e.space}/api/directmessages/lite?with_favorites=false`;
1574
- w(e, (r) => {
1575
+ w(e, (c) => {
1575
1576
  f(o, {
1576
1577
  method: "GET",
1577
1578
  headers: {
1578
1579
  Accept: "application/json,text/javascript,*/*",
1579
- "X-DS-SWYM-CSRFTOKEN": r.result.ServerToken
1580
+ "X-DS-SWYM-CSRFTOKEN": c.result.ServerToken
1580
1581
  },
1581
- onComplete(i) {
1582
- const a = JSON.parse(i), c = [];
1582
+ onComplete(r) {
1583
+ const a = JSON.parse(r), i = [];
1583
1584
  a.result.forEach((p) => {
1584
- p.users = p.users.sort((u, m) => u.login.localeCompare(m.login)), p.users.length === t.length && c.push(p);
1585
+ p.users = p.users.sort((u, m) => u.login.localeCompare(m.login)), p.users.length === t.length && i.push(p);
1585
1586
  });
1586
- const d = t.sort(), l = c.find((p) => {
1587
+ const d = t.sort(), l = i.find((p) => {
1587
1588
  const u = [];
1588
1589
  return p.users.forEach((m) => {
1589
1590
  u.push(m.login);
1590
1591
  }), JSON.stringify(u) === JSON.stringify(d);
1591
1592
  });
1592
- n && l !== void 0 ? n(l) : (s || l === void 0) && s(l);
1593
+ s && l !== void 0 ? s(l) : (n || l === void 0) && n(l);
1593
1594
  },
1594
- onFailure(i) {
1595
- const a = i;
1596
- a.msg = headers.errormsg, a.errCode = headers.errorcode, console.log("❌ sendDirectMessageLite => ", a), s && s(a);
1595
+ onFailure(r) {
1596
+ const a = r;
1597
+ a.msg = headers.errormsg, a.errCode = headers.errorcode, console.log("❌ sendDirectMessageLite => ", a), n && n(a);
1597
1598
  }
1598
1599
  });
1599
1600
  });
1600
1601
  }
1601
- function j(e, t, n = void 0, s = void 0) {
1602
+ function j(e, t, s = void 0, n = void 0) {
1602
1603
  const o = {
1603
1604
  base: e.space,
1604
1605
  uri: "/api/community",
1605
1606
  id_msg: `${t.id_msg}`,
1606
1607
  endUri: "/instantmessages"
1607
- }, r = `${o.base}${o.uri}/${o.id_msg}${o.endUri}`, i = {
1608
+ }, c = `${o.base}${o.uri}/${o.id_msg}${o.endUri}`, r = {
1608
1609
  author: { login: t.senderId, displayName: t.senderName },
1609
1610
  accessState: null,
1610
1611
  commentUri: null,
@@ -1614,33 +1615,33 @@ function j(e, t, n = void 0, s = void 0) {
1614
1615
  parentCommentUri: null,
1615
1616
  richMessage: t.msg
1616
1617
  };
1617
- console.log("_3dSwym_sendDirectMessageData url ", r), w(e, (a) => {
1618
- f(r, {
1618
+ console.log("_3dSwym_sendDirectMessageData url ", c), w(e, (a) => {
1619
+ f(c, {
1619
1620
  method: "POST",
1620
1621
  headers: {
1621
1622
  "Content-Type": "application/json",
1622
1623
  Accept: "application/json",
1623
1624
  "X-DS-SWYM-CSRFTOKEN": a.result.ServerToken
1624
1625
  },
1625
- data: JSON.stringify(i),
1626
+ data: JSON.stringify(r),
1626
1627
  type: "json",
1627
- onComplete(c, d, l) {
1628
- const p = c;
1629
- p.status = l.status, p.response = JSON.parse(l.response), console.log("✅ _3dSwym_sendDirectMessageData => ", p), n && n(p);
1628
+ onComplete(i, d, l) {
1629
+ const p = i;
1630
+ p.status = l.status, p.response = JSON.parse(l.response), console.log("✅ _3dSwym_sendDirectMessageData => ", p), s && s(p);
1630
1631
  },
1631
- onFailure(c, d) {
1632
- const l = c;
1633
- l.msg = d.errormsg, l.errCode = d.errorcode, console.log("❌ sendDirectMessage => ", l), s && s(l);
1632
+ onFailure(i, d) {
1633
+ const l = i;
1634
+ l.msg = d.errormsg, l.errCode = d.errorcode, console.log("❌ sendDirectMessage => ", l), n && n(l);
1634
1635
  }
1635
1636
  });
1636
1637
  });
1637
1638
  }
1638
1639
  function ee(e) {
1639
- const t = (/* @__PURE__ */ new Date()).toLocaleDateString(), n = (/* @__PURE__ */ new Date()).toLocaleTimeString();
1640
+ const t = (/* @__PURE__ */ new Date()).toLocaleDateString(), s = (/* @__PURE__ */ new Date()).toLocaleTimeString();
1640
1641
  return `<p>${e} </p>
1641
1642
  <br/>
1642
1643
  <hr/>
1643
- <p><u>envoyer :</u>Le <b>${t} à ${n}</b></p>`;
1644
+ <p><u>envoyer :</u>Le <b>${t} à ${s}</b></p>`;
1644
1645
  }
1645
1646
  const te = {
1646
1647
  title: "TEST DEV COMMUNITY IDEA",
@@ -1652,16 +1653,16 @@ const te = {
1652
1653
  idee_id: "THhRI8rlQNWKRxpv3Xqqug"
1653
1654
  // id de l'idee qui est créer au post (_3dSwym_postIdea)
1654
1655
  };
1655
- function Be(e, t, n = void 0, s = void 0) {
1656
- const o = `${e.space}/api/idea/add`, r = e.swymCommunities.find(
1657
- (c) => c.id === t.community_id
1658
- ), i = e.swymCommunities.find(
1659
- (c) => c.title.toLowerCase() === t.community_title.toLowerCase()
1656
+ function Be(e, t, s = void 0, n = void 0) {
1657
+ const o = `${e.space}/api/idea/add`, c = e.swymCommunities.find(
1658
+ (i) => i.id === t.community_id
1659
+ ), r = e.swymCommunities.find(
1660
+ (i) => i.title.toLowerCase() === t.community_title.toLowerCase()
1660
1661
  ), a = {
1661
1662
  params: {
1662
1663
  title: t.title,
1663
1664
  // String, le nom de l'affaire
1664
- community_id: r?.id !== void 0 ? r.id : i.id,
1665
+ community_id: c?.id !== void 0 ? c.id : r.id,
1665
1666
  // String, l'id de la communauté
1666
1667
  message: ne(t.text_html),
1667
1668
  // STRING => le contenue du message doit être au format HTML
@@ -1669,11 +1670,11 @@ function Be(e, t, n = void 0, s = void 0) {
1669
1670
  // 1 publier, 0 non publier
1670
1671
  }
1671
1672
  };
1672
- w(e, (c) => {
1673
+ w(e, (i) => {
1673
1674
  const d = {
1674
1675
  "Content-type": "application/json;charset=UTF-8",
1675
1676
  Accept: "application/json",
1676
- "X-DS-SWYM-CSRFTOKEN": c.result.ServerToken
1677
+ "X-DS-SWYM-CSRFTOKEN": i.result.ServerToken
1677
1678
  };
1678
1679
  f(o, {
1679
1680
  method: "POST",
@@ -1682,90 +1683,90 @@ function Be(e, t, n = void 0, s = void 0) {
1682
1683
  type: "json",
1683
1684
  onComplete(l, p, u) {
1684
1685
  const m = JSON.parse(l);
1685
- m.status = u.status, m.response = u.response, n && n(m);
1686
+ m.status = u.status, m.response = u.response, s && s(m);
1686
1687
  },
1687
1688
  onFailure(l, p, u) {
1688
1689
  const m = l;
1689
- m.status = p.status, m.response = p.errormsg, s && s(m);
1690
+ m.status = p.status, m.response = p.errormsg, n && n(m);
1690
1691
  }
1691
1692
  });
1692
1693
  });
1693
1694
  }
1694
- function Ye(e, t, n = void 0, s = void 0) {
1695
- const o = `${e.space}/api/idea/delete`, r = {
1695
+ function Ye(e, t, s = void 0, n = void 0) {
1696
+ const o = `${e.space}/api/idea/delete`, c = {
1696
1697
  params: {
1697
1698
  community_id: t.community_id,
1698
1699
  ideationIds: [t.idee_id]
1699
1700
  }
1700
1701
  };
1701
- w(e, (i) => {
1702
+ w(e, (r) => {
1702
1703
  f(o, {
1703
1704
  method: "POST",
1704
1705
  headers: {
1705
1706
  "Content-type": "application/json;charset=UTF-8",
1706
1707
  Accept: "application/json",
1707
- "X-DS-SWYM-CSRFTOKEN": i.result.ServerToken
1708
+ "X-DS-SWYM-CSRFTOKEN": r.result.ServerToken
1708
1709
  },
1709
- data: JSON.stringify(r),
1710
+ data: JSON.stringify(c),
1710
1711
  type: "json",
1711
- onComplete(a, c, d) {
1712
- n && n(a);
1712
+ onComplete(a, i, d) {
1713
+ s && s(a);
1713
1714
  },
1714
- onFailure(a, c, d) {
1715
+ onFailure(a, i, d) {
1715
1716
  const l = a;
1716
- l.status = c.status, l.response = c.errormsg, s && s(l);
1717
+ l.status = i.status, l.response = i.errormsg, n && n(l);
1717
1718
  }
1718
1719
  });
1719
1720
  });
1720
1721
  }
1721
- function He(e, t = "", n = void 0, s = void 0) {
1722
+ function He(e, t = "", s = void 0, n = void 0) {
1722
1723
  const o = e.tenant.toLowerCase() === "r1132101716373" ? "tFtz0G4MR6qNtKgJjNfTog" : e.tenant.toLowerCase() === "r1132101286859" ? "Qpv3HN-tTDOsU-7_c5DnDg" : "Template_d'idée_à_créer";
1723
1724
  t === "" && (t = o);
1724
- const r = `${e.space}/api/idea/get`, i = {
1725
+ const c = `${e.space}/api/idea/get`, r = {
1725
1726
  params: {
1726
1727
  id: t
1727
1728
  }
1728
1729
  };
1729
1730
  w(e, (a) => {
1730
- f(r, {
1731
+ f(c, {
1731
1732
  method: "POST",
1732
1733
  headers: {
1733
1734
  "Content-type": "application/json;charset=UTF-8",
1734
1735
  Accept: "application/json",
1735
1736
  "X-DS-SWYM-CSRFTOKEN": a.result.ServerToken
1736
1737
  },
1737
- data: JSON.stringify(i),
1738
+ data: JSON.stringify(r),
1738
1739
  type: "json",
1739
- onComplete(c) {
1740
- const d = c;
1741
- d.msg = d.result.message, n && n(d);
1740
+ onComplete(i) {
1741
+ const d = i;
1742
+ d.msg = d.result.message, s && s(d);
1742
1743
  },
1743
- onFailure(c) {
1744
- const d = c;
1745
- d.status = headers.status, d.response = headers.errormsg, s && s(d);
1744
+ onFailure(i) {
1745
+ const d = i;
1746
+ d.status = headers.status, d.response = headers.errormsg, n && n(d);
1746
1747
  }
1747
1748
  });
1748
1749
  });
1749
1750
  }
1750
- function ze(e, t = te, n = void 0, s = void 0) {
1751
+ function ze(e, t = te, s = void 0, n = void 0) {
1751
1752
  const o = {
1752
1753
  uri: "/api/idea/list",
1753
1754
  comId: `/community_id/${e.tenant.toLowerCase() === "r1132101716373" ? t.community_id : "bgnIsG74SUWswyGzS6NC6g"}`,
1754
1755
  limit: `/limit/${t.limit ? t.limit : 10}`
1755
- }, r = `${e.space}${o.uri}${o.comId}${o.limit}`;
1756
- w(e, (i) => {
1757
- f(r, {
1756
+ }, c = `${e.space}${o.uri}${o.comId}${o.limit}`;
1757
+ w(e, (r) => {
1758
+ f(c, {
1758
1759
  method: "GET",
1759
1760
  headers: {
1760
- "X-DS-SWYM-CSRFTOKEN": i.result.ServerToken
1761
+ "X-DS-SWYM-CSRFTOKEN": r.result.ServerToken
1761
1762
  },
1762
1763
  onComplete(a) {
1763
- const c = JSON.parse(a);
1764
- n && n(c);
1764
+ const i = JSON.parse(a);
1765
+ s && s(i);
1765
1766
  },
1766
- onFailure(a, c) {
1767
+ onFailure(a, i) {
1767
1768
  const d = a;
1768
- d.status = c.status, d.response = c.errormsg, s && s(d);
1769
+ d.status = i.status, d.response = i.errormsg, n && n(d);
1769
1770
  }
1770
1771
  });
1771
1772
  });
@@ -1845,43 +1846,43 @@ function ne(e) {
1845
1846
  <p>
1846
1847
  </p>` : e;
1847
1848
  }
1848
- function qe(e, t = void 0, n = void 0) {
1849
- const s = e.space + "/api/user/getcurrent/";
1849
+ function qe(e, t = void 0, s = void 0) {
1850
+ const n = e.space + "/api/user/getcurrent/";
1850
1851
  w(e, (o) => {
1851
- f(s, {
1852
+ f(n, {
1852
1853
  method: "GET",
1853
1854
  headers: {
1854
1855
  "X-DS-SWYM-CSRFTOKEN": o.result.ServerToken
1855
1856
  },
1856
- onComplete(r, i, a) {
1857
- const c = JSON.parse(r);
1858
- t && t(c.result);
1857
+ onComplete(c, r, a) {
1858
+ const i = JSON.parse(c);
1859
+ t && t(i.result);
1859
1860
  },
1860
- onFailure(r, i, a) {
1861
- const c = { erreur: JSON.parse(r), headers: i, xhr: a };
1862
- n && n(c);
1861
+ onFailure(c, r, a) {
1862
+ const i = { erreur: JSON.parse(c), headers: r, xhr: a };
1863
+ s && s(i);
1863
1864
  }
1864
1865
  });
1865
1866
  });
1866
1867
  }
1867
- function Qe(e, t, n = void 0, s = void 0) {
1868
+ function Qe(e, t, s = void 0, n = void 0) {
1868
1869
  const o = e.space + "/api/user/find/login/" + t;
1869
1870
  w(
1870
1871
  e,
1871
- (r) => {
1872
+ (c) => {
1872
1873
  f(o, {
1873
1874
  method: "GET",
1874
- headers: { "X-DS-SWYM-CSRFTOKEN": r.result.ServerToken },
1875
- onComplete(i, a, c) {
1876
- const d = JSON.parse(i);
1877
- n && n(d);
1875
+ headers: { "X-DS-SWYM-CSRFTOKEN": c.result.ServerToken },
1876
+ onComplete(r, a, i) {
1877
+ const d = JSON.parse(r);
1878
+ s && s(d);
1878
1879
  },
1879
- onFailure(i) {
1880
- s && s(i);
1880
+ onFailure(r) {
1881
+ n && n(r);
1881
1882
  }
1882
1883
  });
1883
1884
  },
1884
- s
1885
+ n
1885
1886
  );
1886
1887
  }
1887
1888
  function Ze(e) {
@@ -1943,13 +1944,13 @@ export {
1943
1944
  ye as getComplementUG,
1944
1945
  Re as getDataFrom3DSpace,
1945
1946
  ce as getDataFromGouvFr,
1946
- Pe as getDatasByTenant,
1947
+ xe as getDatasByTenant,
1947
1948
  Me as getDatasFrom3DSpace,
1948
1949
  Ie as getDownloadDocument,
1949
1950
  Je as getInfoDocTags,
1950
1951
  we as getUserGroupsList,
1951
1952
  E as getUsersGroupRules,
1952
- xe as get_3DSpace_csrf,
1953
+ Pe as get_3DSpace_csrf,
1953
1954
  Ce as patchUserGroups,
1954
1955
  Oe as patchUserGroupsControl,
1955
1956
  ve as pushDataIn3DSpace,