@beam3_dev/api_module 0.0.147 → 0.0.148

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 DELETED
@@ -1,2182 +0,0 @@
1
- import { v4 as L } from "uuid";
2
- import { DateTime as N } from "luxon";
3
- import { requirejs as O, widget as j } from "@widget-lab/3ddashboard-utils";
4
- function D() {
5
- return L();
6
- }
7
- const J = {
8
- b3M3Yellow: "#FFB300",
9
- b3AboutageBlue: "#42A5F5",
10
- b3UsinageGreen: "#689F38",
11
- b3PanneauOrange: "#ff8000",
12
- b3M350percent: "#fafa6e",
13
- b3M380percent: "#aae479",
14
- b3M390percent: "#64c987",
15
- b3M3100percent: "#23aa8f",
16
- b3M3105percent: "#00898a",
17
- b3M3110percent: "#176877",
18
- b3M3120percent: "#2a4858",
19
- b3Aboutage50percent: "#fafa6e",
20
- b3Aboutage80percent: "#aae479",
21
- b3Aboutage90percent: "#64c987",
22
- b3Aboutage100percent: "#23aa8f",
23
- b3Aboutage105percent: "#00898a",
24
- b3Aboutage110percent: "#176877",
25
- b3Aboutage120percent: "#2a4858",
26
- b3Warning: "#FF0000",
27
- b3Edit1: "#AD1457",
28
- b3Edit2: "#F4511E",
29
- b3Edit3: "#009688",
30
- b3Edit4: "#D50000",
31
- b3Edit5: "#039BE5",
32
- b3Edit6: "#9E69AF",
33
- b3Edit7: "#A79B8E",
34
- b3Edit8: "#616161",
35
- b3Edit9: "#795548"
36
- };
37
- async function ce(e, t = void 0, n = void 0) {
38
- const s = parseInt(e);
39
- await fetch(
40
- "https://apicarto.ign.fr/api/codes-postaux/communes/" + s,
41
- {
42
- method: "GET",
43
- headers: {
44
- Accept: "application/json"
45
- }
46
- }
47
- ).then((a) => a.json()).then((a) => {
48
- t && t(a);
49
- }).catch((a) => {
50
- n && n(a), console.error("Erreur : " + a);
51
- });
52
- }
53
- async function de(e, t = void 0, n = void 0) {
54
- e = encodeURIComponent(e), await fetch(
55
- "https://api-adresse.data.gouv.fr/search/?q=" + e + "&limit=15",
56
- {
57
- method: "GET",
58
- headers: {
59
- Accept: "application/json"
60
- }
61
- }
62
- ).then((s) => s.json()).then((s) => {
63
- t && t(s);
64
- }).catch((s) => {
65
- n && n(s), console.error("Erreur : " + s);
66
- });
67
- }
68
- async function pe(e, t = J) {
69
- let n = N.now().year;
70
- const s = e, a = [], r = (i) => {
71
- for (let c in i)
72
- a.push({ date: c, comment: i[c] });
73
- };
74
- for (let i = n; i <= n + 1; i++)
75
- await fetch(
76
- "https://calendrier.api.gouv.fr/jours-feries/metropole/" + i + ".json",
77
- {
78
- method: "GET",
79
- headers: {
80
- Accept: "application/json"
81
- }
82
- }
83
- ).then((c) => c.json()).then((c) => {
84
- r(c);
85
- }).catch((c) => console.error("Erreur : " + c));
86
- return (() => {
87
- const i = s.length === 0 ? {
88
- events: []
89
- } : s;
90
- for (let c of a)
91
- i.events.findIndex(
92
- (p) => p.start === N.fromISO(c.date).toISODate() && p.name === "Férié : " + c.comment
93
- ) === -1 && i.events.push({
94
- name: "Férié : " + c.comment,
95
- start: N.fromISO(c.date).toISODate(),
96
- end: N.fromISO(c.date).toISODate(),
97
- color: t.b3BusinnessDays,
98
- timed: !1
99
- });
100
- return i;
101
- })();
102
- }
103
- async function le(e, t, n = !0) {
104
- const s = e.events.findIndex((a) => a.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((a, r) => a.start - r.start), e;
106
- }
107
- function f(e, t) {
108
- O(["DS/WAFData/WAFData"], (n) => {
109
- n.authenticatedRequest(e, t);
110
- });
111
- }
112
- function ue(e, t, n) {
113
- O(["DS/DataDragAndDrop/DataDragAndDrop"], (s) => {
114
- s.draggable(e, {
115
- data: t,
116
- start: n
117
- });
118
- });
119
- }
120
- function fe(e, t = void 0) {
121
- O(["DS/TagNavigatorProxy/TagNavigatorProxy"], (n) => {
122
- let s;
123
- s === void 0 && (s = n.createProxy({
124
- widgetId: j.id,
125
- filteringMode: "WithFilteringServices"
126
- }), t !== void 0 && s.addEvent("onFilterSubjectsChange", t)), s.setSubjectsTags(e);
127
- });
128
- }
129
- function me(e, t) {
130
- O(["DS/DataDragAndDrop/DataDragAndDrop"], (n) => {
131
- n.droppable(e, {
132
- drop: t
133
- });
134
- });
135
- }
136
- async function ge(e, t = void 0, n = void 0) {
137
- await O(
138
- ["DS/i3DXCompassServices/i3DXCompassServices"],
139
- (s) => {
140
- (!e || e === "") && (e = j.getValue("PlatFormInstanceId")), (!e || e === "") && (e = void 0), t && t(
141
- s.getPlatformServices({
142
- platformId: e,
143
- onComplete: t,
144
- onFailure: n
145
- })
146
- );
147
- }
148
- );
149
- }
150
- function E() {
151
- let e = {};
152
- return O(["DS/PlatformAPI/PlatformAPI"], (t) => {
153
- const n = t.getTenant(), s = t.getUser(), a = t.getAllApplicationConfigurations(), r = t.getApplicationConfiguration(
154
- "com.3ds.wp.passport.cors"
155
- );
156
- e = {
157
- tenant: n,
158
- user: s,
159
- appsConfiguration: a,
160
- appConf: r
161
- };
162
- }), console.log("%cRETOUR API :", "color:blue", e), e;
163
- }
164
- function v(e, t = void 0, n = void 0) {
165
- if (e.tenant) {
166
- const s = `https://${e.tenant}-eu1-apps.3dexperience.3ds.com/enovia/resources/AppsMngt/api/v1/services?tenant=${e.tenant}&cors=true&xrequestedwith=xmlhttprequest`;
167
- f(s, {
168
- onComplete(a) {
169
- const r = typeof a == "string" ? JSON.parse(a) : a;
170
- if (r && "platforms" in r) {
171
- const o = r.platforms.find(
172
- (i) => i.id === e.tenant.toUpperCase()
173
- );
174
- t && o ? t(o) : n && n("_getServiceUrl return listServiceUrl = undefined");
175
- } else
176
- n && n("_getServiceUrl return oResponse = undefined");
177
- },
178
- onFailure(a) {
179
- n && n(a);
180
- }
181
- });
182
- }
183
- }
184
- function he(e, t = void 0, n = void 0) {
185
- if (e.tenant) {
186
- const s = `https://${e.tenant}-eu1-registry.3dexperience.3ds.com/api/v1/platform/service/instance?serviceId=3dpassport&platformId=${e.tenant}`;
187
- f(s, {
188
- onComplete(a) {
189
- const r = JSON.parse(a);
190
- if (console.log("serviceId=3dpassport", r), Array.isArray(r) && r.length > 0) {
191
- const o = `${r[0].services[0].url}`;
192
- t && t(o);
193
- }
194
- },
195
- onFailure(a) {
196
- n && n(a);
197
- }
198
- });
199
- }
200
- }
201
- function Se(e, t, n) {
202
- const s = {
203
- base: `${e.space}`,
204
- uri: "/resources/AppsMngt/api/custom/applications",
205
- option: `?filter=${e.tenant}`
206
- // facultatif
207
- }, a = `${s.base}${s.uri}${s.option}`;
208
- f(a, {
209
- method: "GET",
210
- headers: {
211
- "Content-Type": "application/json",
212
- Accept: "application/json"
213
- },
214
- onComplete(r, o, i) {
215
- const c = JSON.parse(r), d = c.data.map((p) => {
216
- const l = p.attributes.name, u = p.id;
217
- return { name: l, id: u };
218
- });
219
- t && t(d, c);
220
- },
221
- onFailure(r, o) {
222
- const i = r;
223
- i.msg = o.errormsg, i.errCode = o.errorcode, n && n(i);
224
- }
225
- });
226
- }
227
- function _e(e, t = void 0, n = void 0) {
228
- let s = `${e.space}/resources/AppsMngt/user?platform=${e.tenant}&limit=-1`;
229
- f(s, {
230
- onComplete(a, r, o) {
231
- const i = JSON.parse(a);
232
- console.log("_AppMngt_get_users => ", i), t && t(i);
233
- },
234
- onFailure(a, r) {
235
- const o = a;
236
- o.msg = r.errormsg, o.errCode = r.errorcode, n && n(o);
237
- }
238
- });
239
- }
240
- function ye(e, t, n = void 0, s = void 0) {
241
- let a = `${e.space}/resources/AppsMngt/user?platform=${e.tenant}&id=${t}`;
242
- f(a, {
243
- onComplete(r, o, i) {
244
- const c = JSON.parse(r);
245
- n && n(c);
246
- },
247
- onFailure(r, o) {
248
- const i = r;
249
- i.msg = o.errormsg, i.errCode = o.errorcode, s && s(i);
250
- }
251
- });
252
- }
253
- const k = {
254
- "Content-Type": "application/json",
255
- Accept: "application/json,text/javascript,*/*"
256
- };
257
- function we(e, t, n = void 0, s = void 0) {
258
- const { space: a, currentUser: r } = e, i = `${a}${{
259
- URIUGr: "/3drdfpersist/resources/v1/usersgroup"
260
- }.URIUGr}`, c = {
261
- groups: [
262
- {
263
- title: t.title,
264
- description: t.description,
265
- members: t.members || [r.email, "samuel.mureau@beam3.fr"],
266
- pending_members: [],
267
- sharing: t.sharing,
268
- visibility: t.visibility
269
- }
270
- ]
271
- };
272
- f(i, {
273
- method: "POST",
274
- headers: k,
275
- data: JSON.stringify(c),
276
- onComplete(d) {
277
- n && n(JSON.parse(d));
278
- },
279
- onFailure(d, p) {
280
- console.log(d);
281
- const l = d;
282
- l.msg = p.errormsg, l.errCode = p.errorcode, console.log("❌ sendDirectMessage => ", l), s && s(l);
283
- }
284
- });
285
- }
286
- function Ce(e, t, n = void 0, s = void 0) {
287
- const { space: a, tenant: r } = e, o = a, i = `/3drdfpersist/v1/resources/${t}`, c = `?$mask=dsaccess:Mask.GroupUI.Properties&tenant=dstenant:${r}`, d = `${o}${i}${c}`;
288
- f(d, {
289
- opts: {
290
- method: "GET",
291
- headers: {
292
- "Content-Type": "application/json",
293
- Accept: "application/json,text/javascript,*/*"
294
- }
295
- },
296
- onComplete(u) {
297
- n && n(JSON.parse(u));
298
- },
299
- onFailure(u, m) {
300
- const g = u;
301
- g.msg = m.errormsg, g.errCode = m.errorcode, s && s(g);
302
- }
303
- });
304
- }
305
- function G(e, t = void 0, n = void 0) {
306
- const { space: s, tenant: a } = e, r = s, o = "/3drdfpersist/resources/v1/option-sets/dsusergroup:ListOfGroupResponsibilities/options", i = `?tenant=dstenant:${a}`, c = {
307
- method: "GET",
308
- Accept: "application/json,*/*,test/javascript"
309
- }, d = `${r}${o}${i}`;
310
- f(d, {
311
- OPTsH: c,
312
- onComplete(p) {
313
- t && t(JSON.parse(p));
314
- },
315
- onFailure(p, l) {
316
- const u = p;
317
- u.msg = l.errormsg, u.errCode = l.errorcode, n && n(u);
318
- }
319
- });
320
- }
321
- function Te(e, t = void 0, n = void 0) {
322
- const { space: s, currentUser: a } = e, i = `${s}/3drdfpersist/resources/v1/usersgroup?select=uri,title,description,owner,members,pending_members,creation_date,modification_date,visibility`, d = { method: "GET", headers: {
323
- "Content-Type": "application/json",
324
- Accept: "application/json,text/javascript,*/*"
325
- } };
326
- try {
327
- f(i, {
328
- opts: d,
329
- onComplete(p) {
330
- const l = JSON.parse(p), u = {}, m = l.groups.filter((g) => g.uri.startsWith("uuid:"));
331
- if (a && Object.keys(a).length > 0) {
332
- const g = m.filter((_) => _.owner === a.email), h = m.filter((_) => _.members.includes(a.email)), S = g.concat(h);
333
- u.iam = S, u.UG = m, u.iamMember = h, G(
334
- e,
335
- (_) => {
336
- u.rules = _, t && t(u);
337
- },
338
- (_) => {
339
- n && n(_);
340
- }
341
- );
342
- }
343
- },
344
- onFailure(p) {
345
- n && n(p);
346
- }
347
- });
348
- } catch (p) {
349
- console.log(p);
350
- }
351
- }
352
- function Oe(e, t) {
353
- const { space: n } = e, a = `${n}/3drdfpersist/resources/v1/usersgroup/${t}`;
354
- f(a, {
355
- method: "DELETE"
356
- });
357
- }
358
- function be(e, t, n, s = void 0, a = void 0) {
359
- const { space: r, tenant: o } = e, i = {
360
- URITI: "/3drdfpersist/resources/v1/template-instances",
361
- URIUGr: "/3drdfpersist/resources/v1/usersgroup",
362
- nextURICh: "/characteristics",
363
- nextURIGr: "/group",
364
- nexURImem: "/members",
365
- OPTsTI: "?$mask=dsaccess:Mask.GroupUI.Properties",
366
- OPTsTenant: `tenant=dstenant:${o}`
367
- }, c = n, d = `${r}${i.URIUGr}/${t}`, p = JSON.stringify(c);
368
- f(d, {
369
- headers: k,
370
- method: "PATCH",
371
- data: p,
372
- type: "json",
373
- onComplete(l) {
374
- s && s(l);
375
- },
376
- onFailure(l) {
377
- a && a(l);
378
- }
379
- });
380
- }
381
- function Ne(e, t, n, s = void 0, a = void 0) {
382
- const { space: r } = e, i = `${r}/3drdfpersist/resources/v1/usersgroup/${t}/sharing`;
383
- f(i, {
384
- method: "PATCH",
385
- headers: k,
386
- data: JSON.stringify(n),
387
- type: "json",
388
- onComplete(d) {
389
- s && s(d);
390
- },
391
- onFailure(d) {
392
- a && a(d);
393
- }
394
- });
395
- }
396
- function ve(e, t, n = void 0, s = void 0) {
397
- const { space: a } = e, o = `${a}/3drdfpersist/resources/v1/usersgroup/${t}/sharing`;
398
- f(o, {
399
- opts: {
400
- method: "GET",
401
- headers: {
402
- "Content-Type": "application/json",
403
- Accept: "application/json,text/javascript,*/*"
404
- }
405
- },
406
- onComplete(d) {
407
- n && n(JSON.parse(d));
408
- },
409
- onFailure(d) {
410
- s && s(d);
411
- }
412
- });
413
- }
414
- async function K(e, t, n) {
415
- if (e.space) {
416
- const s = `${e.space}/resources/v1/application/CSRF`;
417
- f(s, {
418
- onComplete(a) {
419
- a = JSON.parse(a), t && t(a.csrf);
420
- },
421
- onFailure(a, r, o) {
422
- n && n({ error: a, headers: r, xhr: o });
423
- }
424
- });
425
- }
426
- }
427
- async function V(e, t = void 0, n = void 0, s = void 0) {
428
- const a = e.space;
429
- if (t === void 0) {
430
- console.log("Le paramètre docid est obligatoire");
431
- return;
432
- }
433
- const r = a + `/resources/v1/modeler/documents/${t}`;
434
- f(r, {
435
- onComplete(o, i, c) {
436
- const d = JSON.parse(o);
437
- n && n(d);
438
- },
439
- onFailure(o) {
440
- s && s(o);
441
- }
442
- });
443
- }
444
- function $(e, t = void 0, n = void 0) {
445
- if (e.objID && e.objID !== "") {
446
- let s = `${e.space}/resources/v1/modeler/documents/${e.objID}`;
447
- f(s, {
448
- onComplete(a, r, o) {
449
- const i = JSON.parse(a);
450
- e.token = i?.csrf?.value, e.datas = i?.data[0], t && t(e);
451
- },
452
- onFailure(a) {
453
- n && n(a);
454
- }
455
- });
456
- } else
457
- T(
458
- e,
459
- (s) => {
460
- console.log("_3DSpace_get_csrf / _3DSpace_csrf", s), t && t(s);
461
- },
462
- (s) => {
463
- n && n(s);
464
- }
465
- );
466
- }
467
- function T(e, t = void 0, n = void 0) {
468
- if (e.space) {
469
- const s = e.space + "/resources/v1/application/CSRF";
470
- f(s, {
471
- onComplete(a, r, o) {
472
- const i = JSON.parse(a);
473
- t && t(i.csrf.value);
474
- },
475
- onFailure(a, r, o) {
476
- n && n({
477
- response: a,
478
- headers: r,
479
- xhr: o
480
- });
481
- }
482
- });
483
- } else
484
- n && n("ERROR : url du 3DSpace non défini.");
485
- }
486
- function A(e, t = void 0, n = void 0) {
487
- let s = e.space + `/resources/v1/modeler/documents/${e.objID}/files/DownloadTicket`;
488
- $(
489
- e,
490
- (a) => {
491
- f(s, {
492
- method: "PUT",
493
- headers: {
494
- ENO_CSRF_TOKEN: e.token
495
- },
496
- onComplete(r) {
497
- const i = JSON.parse(r).data[0].dataelements.ticketURL;
498
- t && t(i);
499
- },
500
- onFailure(r, o) {
501
- console.warn("☠️ error => ", r, o), n && n(r, o);
502
- }
503
- });
504
- },
505
- (a) => {
506
- console.warn("_3DSpace_get_ticket / error => ", a), n && n(a);
507
- }
508
- );
509
- }
510
- function $e(e, t, n, s = void 0, a = void 0) {
511
- const r = `${e.space}/resources/v1/modeler/documents/${t}/files/DownloadTicket`;
512
- n || (n = e.token), f(r, {
513
- method: "PUT",
514
- headers: {
515
- ENO_CSRF_TOKEN: n
516
- },
517
- onComplete(o) {
518
- let i = JSON.parse(o);
519
- if (console.log("☠️ info => ", i), i.success === !0)
520
- try {
521
- const c = i.data[0].dataelements.ticketURL;
522
- s && s(c);
523
- } catch (c) {
524
- a && a(c);
525
- }
526
- },
527
- onFailure(o) {
528
- a && a(o);
529
- }
530
- });
531
- }
532
- function X(e, t, n, s, a, r = void 0, o = void 0) {
533
- $(
534
- e,
535
- t,
536
- (i) => {
537
- W(
538
- e,
539
- t,
540
- n,
541
- s,
542
- a,
543
- i.csrf.value,
544
- r,
545
- o
546
- );
547
- }
548
- );
549
- }
550
- function W(e, t, n, s, a, r, o = void 0, i = void 0) {
551
- const c = e.space + `/resources/v1/modeler/documents/${t}/files/CheckinTicket`;
552
- f(c, {
553
- method: "PUT",
554
- headers: {
555
- ENO_CSRF_TOKEN: r
556
- },
557
- onComplete(d, p, l) {
558
- const u = JSON.parse(d).data[0].dataelements, m = new FormData();
559
- m.append("__fcs__jobTicket", u.ticket), m.append("file_0", s, a);
560
- const g = {};
561
- g.method = "POST", g.data = m, g.onComplete = function(h) {
562
- let S = "temp_" + Date.now(), _ = {
563
- method: "PUT",
564
- headers: {
565
- ENO_CSRF_TOKEN: r
566
- },
567
- data: JSON.stringify({
568
- data: [{
569
- id: t,
570
- relateddata: {
571
- files: [{
572
- id: n,
573
- dataelements: {
574
- title: a,
575
- receipt: h
576
- },
577
- updateAction: "REVISE"
578
- }]
579
- },
580
- tempId: S
581
- }]
582
- }),
583
- type: "json",
584
- onComplete(y) {
585
- o && o(y);
586
- },
587
- onFailure(y) {
588
- i && i(y);
589
- }
590
- };
591
- f(
592
- e.space + "/resources/v1/modeler/documents",
593
- _
594
- );
595
- }, g.onFailure = function(h) {
596
- i && i(h);
597
- }, g.timeout = 0, f(u.ticketURL, g);
598
- }
599
- });
600
- }
601
- async function Ie(e, t, n, s, a = void 0, r = void 0) {
602
- const o = e.space, i = e.token, c = e.ctx, d = new FormData(), p = new Blob([JSON.stringify(t)], {
603
- type: "text/plain"
604
- }), l = {
605
- url_Ticket: `${o}/resources/v1/modeler/documents/files/CheckinTicket`,
606
- url_Post: `${o}/resources/v1/modeler/documents/?SecurityContext=ctx::${c}`
607
- };
608
- if (!o && o !== "") {
609
- console.log("le store._3DSpace est vide");
610
- return;
611
- }
612
- f(l.url_Ticket, {
613
- method: "PUT",
614
- headers: {
615
- ENO_CSRF_TOKEN: i.value
616
- },
617
- onComplete(u, m, g) {
618
- const h = JSON.parse(u).data[0].dataelements;
619
- d.append("__fcs__jobTicket", h.ticket), d.append("filename", p, n);
620
- const S = {
621
- method: "POST",
622
- data: d,
623
- onComplete(C) {
624
- if (c !== "" && i !== "") {
625
- const I = {
626
- method: "POST",
627
- headers: {
628
- ENO_CSRF_TOKEN: i,
629
- Accept: "application/json",
630
- "Content-Type": "application/json"
631
- },
632
- data: JSON.stringify({
633
- data: [{
634
- type: "Document",
635
- dataelements: {
636
- title: `Title_${n.toLowerCase().split(" ").join("_")}`,
637
- policy: "Document Release",
638
- description: s
639
- },
640
- relateddata: {
641
- files: [{
642
- dataelements: {
643
- title: `${n}.json`,
644
- receipt: C
645
- }
646
- }]
647
- },
648
- tempId: D()
649
- }]
650
- }),
651
- type: "json",
652
- timeout: 0,
653
- onComplete: _,
654
- onFailure: y
655
- };
656
- c !== "" && f(l.url_Post, I);
657
- } else
658
- console.warn("le store est vide");
659
- },
660
- onFailure: y
661
- };
662
- function _(C) {
663
- console.log("Success -- response ", C.data[0]), a && a(C);
664
- }
665
- function y(C, I) {
666
- console.log("Erreur -- response ", C, `
667
- headers `, I), r && r(C);
668
- }
669
- f(h.ticketURL, S);
670
- }
671
- });
672
- }
673
- function b(e, t = void 0, n = void 0, s = void 0, a = void 0, r = void 0, o = !1) {
674
- const i = `${e.space}/resources/modeler/pno/person?current=true&select=preferredcredentials&select=collabspaces`;
675
- f(i, {
676
- method: "GET",
677
- onComplete(c) {
678
- const d = JSON.parse(c);
679
- let p = "", l, u, m;
680
- if (t) {
681
- let g = d.collabspaces.find((h) => h.title === t);
682
- if (g) {
683
- l = t;
684
- let h = g.couples;
685
- h = h.filter(
686
- (S, _, y) => _ === y.findIndex(
687
- (C) => C.organization.pid === S.organization.pid && C.role.pid === S.role.pid
688
- )
689
- ), n && (Array.isArray(n) ? n.forEach((S) => {
690
- m || h.forEach((_) => {
691
- if (S === _.role.name && s === _.organization.title)
692
- m = S, u = s;
693
- else if (S === _.role.name) {
694
- let y = h.filter(
695
- (C) => C.role.name === S
696
- );
697
- y.length === 1 ? (m = y[0].role.name, u = y[0].organization.title) : r(y);
698
- }
699
- });
700
- }) : h.forEach((S) => {
701
- if (n === S.role.name && s === S.organization.title)
702
- m = n, u = s;
703
- else if (n === S.role.name) {
704
- let _ = h.filter(
705
- (y) => y.role.name === n
706
- );
707
- _.length === 1 ? (m = _[0].role.name, u = _[0].organization.title) : r(_);
708
- }
709
- }));
710
- }
711
- }
712
- l && u && m ? (p = m + "." + u + "." + l, a(p)) : d.preferredcredentials && o ? (p = d.preferredcredentials.role.name + "." + d.preferredcredentials.organization.title + "." + d.preferredcredentials.collabspace.title, a(p)) : r && (p = m + "." + u + "." + l, r(p));
713
- },
714
- onFailure(c, d) {
715
- console.log("Erreur de récupération du contexte de sécurité. => ", {
716
- err: c,
717
- headers: d
718
- });
719
- }
720
- });
721
- }
722
- async function P(e, t = void 0, n = void 0) {
723
- return (!e.objID || e.objID === "") && console.warn(
724
- "_3DSpace_download_doc() / Le paramètre objectId est obligatoire"
725
- ), (e.space === "" || !e.space) && console.warn(
726
- "_3DSpace_download_doc() / Le paramètre space est obligatoire"
727
- ), (e.token === "" || !e.token) && (K(
728
- e,
729
- (s) => {
730
- e.token = s;
731
- },
732
- (s) => {
733
- console.log("☠️ error => ", s);
734
- }
735
- ), console.warn(
736
- "_3DSpace_download_doc() / Le paramètre token est obligatoire"
737
- )), new Promise((s, a) => {
738
- A(
739
- e,
740
- (r) => {
741
- f(r, {
742
- headers: {
743
- "Content-Type": "application/json",
744
- Accept: "application/json"
745
- },
746
- onComplete(i) {
747
- let c;
748
- try {
749
- c = JSON.parse(i);
750
- } catch {
751
- c = i;
752
- }
753
- t && typeof t == "function" && t(c), s(c);
754
- },
755
- onFailure(i, c, d) {
756
- n && (console.log("error http", i), n({
757
- msg: JSON.parse(i),
758
- headers: c,
759
- xhr: d
760
- }), a({
761
- msg: JSON.parse(i),
762
- headers: c,
763
- xhr: d
764
- }));
765
- }
766
- });
767
- },
768
- (r) => {
769
- n && n(r), console.log("*_3dspace_download_doc / error file URL *", r), a(r);
770
- }
771
- );
772
- });
773
- }
774
- async function B(e, t, n = void 0, s = void 0) {
775
- let a = [];
776
- if (typeof t < "u" && Array.isArray(t) && t?.length > 0) {
777
- for (let i = 0; i < t.length; i += 80) {
778
- const c = t.slice(i, i + 80);
779
- a.push(c);
780
- }
781
- const o = (i) => {
782
- Y(
783
- e,
784
- a[i],
785
- () => {
786
- i++, i < a.length && o(i);
787
- },
788
- (c) => {
789
- n && n(c);
790
- }
791
- );
792
- };
793
- o(0);
794
- } else
795
- console.warn("La liste d'objects dans la fonction _3DSpace_download_multidoc est vide ou non défini."), s && s("La liste d'objects dans la fonction _3DSpace_download_multidoc est vide ou non défini.");
796
- }
797
- function Y(e, t, n = void 0, s = void 0, a = void 0) {
798
- const r = [];
799
- t.forEach((c) => {
800
- r.push({
801
- id: c
802
- });
803
- });
804
- let o = JSON.stringify({
805
- csrf: {
806
- name: "ENO_CSRF_TOKEN",
807
- value: e.token
808
- },
809
- data: r
810
- });
811
- const i = `${e.space}/resources/v1/modeler/documents/DownloadTicket?tenant=${e.tenant}&e6w-lang=fr&e6w-timezone=-120`;
812
- f(i, {
813
- method: "PUT",
814
- data: o,
815
- type: "json",
816
- onComplete(c) {
817
- const d = c.data;
818
- c.success === !0 && (n && n(), d.forEach((p) => {
819
- try {
820
- const l = p.dataelements.fileName, u = p.dataelements.ticketURL;
821
- f(u, {
822
- onComplete: (m) => {
823
- s && s({
824
- objectId: p.id,
825
- fileName: l,
826
- data: JSON.parse(m)
827
- });
828
- },
829
- onFailure: (m) => {
830
- console.log("error http", m);
831
- }
832
- });
833
- } catch (l) {
834
- console.log(l), a && a(l);
835
- }
836
- }));
837
- },
838
- onFailure(c) {
839
- console.log(c), a && a(c);
840
- }
841
- });
842
- }
843
- function ke(e, t, n = void 0, s = void 0) {
844
- return new Promise((a) => {
845
- if (e.token === "" && T(e), t !== void 0 && t !== "" && t !== null) {
846
- const r = `${e.space}/resources/v1/modeler/dslc/maturity/getNextStates`;
847
- b(
848
- e.space,
849
- "ESPACE COMMUN",
850
- ["VPLMProjectLeader", "VPLMCreator"],
851
- void 0,
852
- (i) => e.ctx = i,
853
- (i) => {
854
- console.log("onError =>", i);
855
- }
856
- );
857
- let o = {
858
- method: "POST",
859
- headers: {
860
- SecurityContext: "ctx::" + e.ctx,
861
- ENO_CSRF_TOKEN: e.token,
862
- Accept: "application/json",
863
- "Content-Type": "application/json"
864
- },
865
- data: JSON.stringify({
866
- data: [{
867
- id: t
868
- }]
869
- }),
870
- type: "json",
871
- onComplete(i) {
872
- n && n(i);
873
- },
874
- onFailure(i) {
875
- s && s(i);
876
- }
877
- };
878
- f(r, o);
879
- }
880
- });
881
- }
882
- function Ae(e, t, n, s = void 0, a = void 0) {
883
- return new Promise((r) => {
884
- if (e.token === "" && T(e), t !== void 0 && t !== "" && t !== null) {
885
- const o = `${e.space}/resources/v1/modeler/dslc/maturity/changeState`;
886
- b(
887
- e.space,
888
- "ESPACE COMMUN",
889
- ["VPLMProjectLeader", "VPLMCreator"],
890
- void 0,
891
- (c) => e.ctx = c,
892
- (c) => {
893
- console.log("onError =>", c);
894
- }
895
- );
896
- let i = {
897
- method: "POST",
898
- headers: {
899
- SecurityContext: "ctx::" + e.ctx,
900
- ENO_CSRF_TOKEN: e.token,
901
- Accept: "application/json",
902
- "Content-Type": "application/json"
903
- },
904
- data: JSON.stringify({
905
- data: [{
906
- id: t,
907
- nextState: n
908
- }]
909
- }),
910
- type: "json",
911
- onComplete(c) {
912
- s && s(c);
913
- },
914
- onFailure(c) {
915
- a && a(c);
916
- }
917
- };
918
- f(o, i);
919
- }
920
- });
921
- }
922
- function Fe(e, t, n = void 0, s = void 0) {
923
- return new Promise((a) => {
924
- if (e.token === "" && T(e), t !== void 0 && t !== "" && t !== null) {
925
- const r = `${e.space}/resources/v1/dslc/versiongraph?withThumbnail=0&withIsLastVersion=0&withAttributes=0&withCopyFrom=0&tenant=${e.tenant}`;
926
- b(
927
- e.space,
928
- "ESPACE COMMUN",
929
- ["VPLMProjectLeader", "VPLMCreator"],
930
- void 0,
931
- (i) => e.ctx = i,
932
- (i) => {
933
- console.log("onError =>", i);
934
- }
935
- );
936
- let o = {
937
- method: "POST",
938
- headers: {
939
- securitycontext: "ctx::" + e.ctx,
940
- ENO_CSRF_TOKEN: e.token,
941
- Accept: "application/json",
942
- "Content-Type": "application/json"
943
- },
944
- data: JSON.stringify({
945
- graphRequests: [{
946
- id: t
947
- }]
948
- }),
949
- type: "json",
950
- onComplete(i) {
951
- n && n(i);
952
- },
953
- onFailure(i) {
954
- s && s(i);
955
- }
956
- };
957
- f(r, o);
958
- }
959
- });
960
- }
961
- function Ue(e, t, n = void 0, s = void 0) {
962
- return new Promise((a) => {
963
- if (e.token === "" && T(e), t !== void 0 && t !== "" && t !== null) {
964
- const r = `${e.space}/resources/lifecycle/revise/prepare_revise_maskattributes?tenant=${e.tenant}`;
965
- b(
966
- e.space,
967
- "ESPACE COMMUN",
968
- ["VPLMProjectLeader", "VPLMCreator"],
969
- void 0,
970
- (i) => e.ctx = i,
971
- (i) => {
972
- console.log("onError =>", i);
973
- }
974
- );
975
- let o = {
976
- method: "POST",
977
- headers: {
978
- SecurityContext: "ctx::" + e.ctx,
979
- ENO_CSRF_TOKEN: e.token,
980
- Accept: "application/json",
981
- "Content-Type": "application/json"
982
- },
983
- data: JSON.stringify({
984
- data: [{
985
- "attribute[PLMReference.V_versionComment]": null,
986
- physicalid: t,
987
- type: "Document",
988
- tenant: e.tenant,
989
- objectId: t,
990
- policy: "Document Release",
991
- availableSemantic: ["E", "LAST", "NEW", "DUP"]
992
- }]
993
- }),
994
- type: "json",
995
- onComplete(i) {
996
- n && n(i);
997
- },
998
- onFailure(i) {
999
- s && s(i);
1000
- }
1001
- };
1002
- f(r, o);
1003
- }
1004
- });
1005
- }
1006
- function je(e, t, n, s = void 0, a = void 0) {
1007
- return new Promise((r) => {
1008
- if (e.token === "" && T(e), t !== void 0 && t !== "" && t !== null) {
1009
- const o = `${e.space}/resources/lifecycle/revise/major?tenant=${e.tenant}`;
1010
- b(
1011
- e.space,
1012
- "ESPACE COMMUN",
1013
- ["VPLMProjectLeader", "VPLMCreator"],
1014
- void 0,
1015
- (c) => e.ctx = c,
1016
- (c) => {
1017
- console.log("onError =>", c);
1018
- }
1019
- );
1020
- let i = {
1021
- method: "POST",
1022
- headers: {
1023
- securitycontext: "ctx::" + e.ctx,
1024
- ENO_CSRF_TOKEN: e.token,
1025
- Accept: "application/json",
1026
- "Content-Type": "application/json"
1027
- },
1028
- data: JSON.stringify({
1029
- data: [{
1030
- physicalid: t,
1031
- proposedRevision: n,
1032
- modifiedAttributes: {
1033
- revision: n
1034
- }
1035
- }],
1036
- folderid: null,
1037
- notificationTimeout: 600
1038
- }),
1039
- type: "json",
1040
- onComplete(c) {
1041
- s && s(c);
1042
- },
1043
- onFailure(c) {
1044
- a && a(c);
1045
- }
1046
- };
1047
- f(o, i);
1048
- }
1049
- });
1050
- }
1051
- function De(e, t, n, s, a = void 0, r = void 0) {
1052
- return console.log("credentials", e), new Promise((o) => {
1053
- `${e.space}`, JSON.stringify({
1054
- csrf: {
1055
- name: "ENO_CSRF_TOKEN",
1056
- value: e.token
1057
- },
1058
- data: [{
1059
- type: "Workspace",
1060
- cestamp: "businessobject",
1061
- relId: t,
1062
- id: t,
1063
- dataelements: {
1064
- personList: "<uuid:5ca25b8e-98d0-46c3-ac43-3faa83c4295a>",
1065
- eventsList: "NXFolderCreated,NXFolderDeleted,NXContentAdded,NXContentRemoved"
1066
- },
1067
- tenant: e.tenant
1068
- }]
1069
- });
1070
- });
1071
- }
1072
- //!SECTION
1073
- function Pe(e, t = void 0, n = void 0) {
1074
- const s = {
1075
- base: `${e.space}`,
1076
- uri: "/resources/bps/cspaces",
1077
- optTenant: `tenant=${e.tenant}`
1078
- }, a = `${s.base}${s.uri}?${s.optTenant}`;
1079
- f(a, {
1080
- method: "GET",
1081
- headers: {
1082
- Accept: "application/json,text/javascript,*/*",
1083
- "Content-Type": "application/ds-json"
1084
- },
1085
- onComplete(r, o) {
1086
- const i = JSON.parse(r);
1087
- t && t(i, o);
1088
- },
1089
- onFailure(r, o, i) {
1090
- n && n({ response: r, headers: o, xhr: i });
1091
- }
1092
- });
1093
- }
1094
- function Re(e, t, n, s) {
1095
- A(
1096
- e.space,
1097
- t,
1098
- (a) => {
1099
- f(a, {
1100
- header: { ENO_CSRF_TOKEN: e.token },
1101
- onComplete: (r) => {
1102
- n && n(r);
1103
- },
1104
- onFailure: (r) => {
1105
- console.log("error http", r), s && s(r);
1106
- }
1107
- });
1108
- }
1109
- );
1110
- }
1111
- async function xe(e, t, n = void 0, s = void 0) {
1112
- return new Promise((a) => {
1113
- A(e, t, (r) => {
1114
- f(r, {
1115
- onComplete: (o, i, c) => (a(JSON.parse(o)), n && n(JSON.parse(o), i, c), a),
1116
- onFailure: (o, i, c) => {
1117
- s && s(o, i, c), console.log(o, i?.errormsg);
1118
- }
1119
- });
1120
- });
1121
- });
1122
- }
1123
- function Me(e, t, n, s = void 0, a = void 0) {
1124
- const r = new Blob([JSON.stringify(t)], { type: "text/plain" });
1125
- $(
1126
- e,
1127
- n,
1128
- (o) => {
1129
- const i = o.data[0].relateddata.files[0].id, c = o.data[0].dataelements.secondaryTitle !== "" ? o.data[0].dataelements.secondaryTitle : o.data[0].dataelements.title;
1130
- X(
1131
- e,
1132
- n,
1133
- i,
1134
- r,
1135
- c,
1136
- (d) => {
1137
- s && s(d);
1138
- },
1139
- (d) => {
1140
- a && a(d);
1141
- }
1142
- );
1143
- }
1144
- );
1145
- }
1146
- let R, x;
1147
- const F = [];
1148
- async function Le(e, t = void 0, n = void 0) {
1149
- e.objID && e.objID !== "" ? $(
1150
- e,
1151
- (s) => {
1152
- t && t(s);
1153
- },
1154
- (s) => {
1155
- n && n(s);
1156
- }
1157
- ) : (e.objID === null || e.objID === "") && T(
1158
- e,
1159
- (s) => {
1160
- t && t({ rep: s, msg: "Pas d'objID, ou invalide" });
1161
- },
1162
- (s) => {
1163
- n && n({ msg: "Pas d'objID et erreur sur le Space", err: s });
1164
- }
1165
- );
1166
- }
1167
- async function Je(e, t = void 0, n = void 0) {
1168
- console.log("getDatasByTenant (getDocuments)", e), await P(
1169
- e,
1170
- (s) => {
1171
- const a = {};
1172
- a.obj = s, console.log("getDatasByTenant (getDocuments) _datas", a), t && t?.(a);
1173
- },
1174
- (s) => {
1175
- n && n?.(s);
1176
- }
1177
- );
1178
- }
1179
- function Ee(e, t = void 0, n = void 0) {
1180
- const s = [];
1181
- if (!e.objIds && !Array.isArray(e.objIds) && e.objIds.length === 0) {
1182
- console.warn("la liste est vide ou n'est pas un tableau");
1183
- return;
1184
- }
1185
- e.objIds.forEach((a, r) => {
1186
- P(
1187
- e,
1188
- a.objID,
1189
- (o) => {
1190
- s.push({ [a.name]: o }), a.name === "dbProjets" && (R = o.affaires.map((i) => i.objectID), q(e, x)), r === e.objIds.length - 1 && (t && t(s), delete e.objIds, delete e.datas);
1191
- }
1192
- );
1193
- });
1194
- }
1195
- function q(e, t, n = void 0, s = void 0) {
1196
- B(
1197
- e,
1198
- R,
1199
- (a) => {
1200
- const r = [...t];
1201
- r.find((o) => o.objectID === a.objectId).data = a.data, x = r, F.push(a.data), n && n(F);
1202
- },
1203
- (a) => {
1204
- s && (s(a), console.log(a));
1205
- }
1206
- );
1207
- }
1208
- const H = "FA35FB9B177A280065800EA0000F599C", z = [
1209
- "swym",
1210
- "3dspace",
1211
- "drive",
1212
- "usersgroup",
1213
- "3dplan",
1214
- "dashboard"
1215
- ], M = {
1216
- how: "ds6w:how",
1217
- what: "ds6w:what",
1218
- when: "ds6w:when",
1219
- where: "ds6w:where",
1220
- who: "ds6w:who",
1221
- why: "ds6w:why"
1222
- }, Q = {
1223
- objId: H,
1224
- pred: "who",
1225
- order_by: "desc",
1226
- tag: "testTag"
1227
- };
1228
- function Ge(e, t, n = void 0, s = void 0) {
1229
- const { space: a, tenant: r } = e, { objId: o, pred: i, tag: c } = t, d = {
1230
- uri: "/resources/6w/tags",
1231
- otpCTX: "SecurityContext=preferred",
1232
- optTenant: `tenant=${r}`
1233
- }, p = `${a}${d.uri}?${d.otpCTX}&${d.optTenant}`, l = {
1234
- tag: [
1235
- {
1236
- subject: [
1237
- {
1238
- uri: `pid://${o}`
1239
- }
1240
- ],
1241
- predicate: M[i],
1242
- object: {
1243
- literal: c
1244
- }
1245
- }
1246
- ]
1247
- };
1248
- f(p, {
1249
- method: "PUT",
1250
- headers: {
1251
- "Content-Type": "application/json",
1252
- Accept: "application/json"
1253
- },
1254
- data: JSON.stringify(l),
1255
- onComplete(u) {
1256
- JSON.parse(u);
1257
- const m = {};
1258
- setTimeout(() => {
1259
- V(
1260
- e,
1261
- o,
1262
- (g) => {
1263
- 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;
1264
- m.name = h, m.ext = S, m.createBy = _, t.info = { ...m }, Z(
1265
- e,
1266
- t,
1267
- (y) => {
1268
- n && n(y);
1269
- },
1270
- (y) => {
1271
- s && s(y);
1272
- }
1273
- );
1274
- },
1275
- (g, h) => {
1276
- const S = g;
1277
- S.msg = h.errormsg, S.errCode = h.errorcode, console.log("❌ sendDirectMessage => ", S), s && s(S);
1278
- }
1279
- );
1280
- }, 2e3);
1281
- },
1282
- onFailure(u, m) {
1283
- const g = u;
1284
- g.msg = m.errormsg, g.errCode = m.errorcode, console.log("❌ sendDirectMessage => ", g), s && s(g);
1285
- }
1286
- });
1287
- }
1288
- function Z(e, t, n = void 0, s = void 0) {
1289
- console.log("obj ", t);
1290
- const a = t.info.name, r = {
1291
- baseUrl: `https://${e.tenant.toLowerCase()}-eu1-fedsearch.3dexperience.3ds.com`,
1292
- uri: "/federated/search"
1293
- }, o = `${r.baseUrl}${r.uri}`, i = {
1294
- "Content-Type": "application/json",
1295
- Accept: "application/json,text/javascript,*/*"
1296
- }, c = D(), d = {
1297
- with_indexing_date: !0,
1298
- with_synthesis: !0,
1299
- with_nls: !1,
1300
- label: `3DSearch-${e.currentUser.username}-AjoutDeTagBeam-${c}`,
1301
- locale: "fr",
1302
- select_predicate: [
1303
- "ds6w:label",
1304
- "ds6w:type",
1305
- "ds6w:description",
1306
- "ds6w:identifier",
1307
- "ds6w:modified",
1308
- "ds6w:created",
1309
- "ds6wg:revision",
1310
- "ds6w:status",
1311
- "ds6w:responsible",
1312
- "owner",
1313
- "ds6w:responsibleUid",
1314
- "ds6wg:filesize",
1315
- "ds6w:project",
1316
- "ds6w:dataSource",
1317
- "ds6w:community",
1318
- "ds6w:originator",
1319
- "dsgeo:referential",
1320
- "ds6w:lastModifiedBy",
1321
- "ds6w:repository",
1322
- "dcterms:title",
1323
- "dcterms:description",
1324
- "ds6w:containerUid"
1325
- ],
1326
- with_synthesis_hierarchical: !0,
1327
- select_file: ["icon", "thumbnail_2d"],
1328
- query: a,
1329
- specific_source_parameter: {
1330
- "3dspace": {
1331
- additional_query: ' AND NOT (owner:"ENOVIA_CLOUD" OR owner:"Service Creator" OR owner:"Corporate" OR owner:"User Agent" OR owner:"SLMInstallerAdmin" OR owner:"Creator" OR owner:"VPLMAdminUser") AND (ds6w_58_islastrevisionperstate:true OR NOT listoffields:ds6w_58_islastrevisionperstate)'
1332
- },
1333
- drive: {
1334
- additional_query: ' AND NOT ([flattenedtaxonomies]:"types/DriveNode" AND ( [current]:"Trashed" OR [policy]:"Drive File Iteration") )'
1335
- }
1336
- },
1337
- select_exclude_synthesis: ["ds6w:what/ds6w:topic"],
1338
- order_by: Q.order_by,
1339
- order_field: "relevance",
1340
- select_snippets: [
1341
- "ds6w:snippet",
1342
- "ds6w:label:snippet",
1343
- "ds6w:responsible:snippet",
1344
- "ds6w:community:snippet",
1345
- "swym:message_text:snippet"
1346
- ],
1347
- nresults: 40,
1348
- start: "0",
1349
- source: z,
1350
- tenant: e.tenant,
1351
- login: {
1352
- "3dspace": {
1353
- SecurityContext: e.ctx
1354
- }
1355
- }
1356
- };
1357
- console.log("dataPattern => ", d), f(o, {
1358
- method: "POST",
1359
- headers: i,
1360
- data: JSON.stringify(d),
1361
- onComplete(p) {
1362
- const l = JSON.parse(p);
1363
- n(l);
1364
- },
1365
- onFailure(p, l) {
1366
- const u = p;
1367
- u.msg = l.errormsg, u.errCode = l.errorcode, console.log("❌ sendDirectMessage => ", u), s && s(u), console.log("Erreur de recuperation d'id du doc et des tags", p);
1368
- }
1369
- });
1370
- }
1371
- function Ke(e, t, n = void 0, s = void 0) {
1372
- const { objId: a, pred: r, tag: o } = t, i = {
1373
- uri: "/resources/6w/tags",
1374
- otpCTX: "SecurityContext=preferred",
1375
- optTenant: `tenant=${e.tenant}`
1376
- }, c = `${e.space}${i.uri}?${i.otpCTX}&${i.optTenant}`, d = {
1377
- tag: [
1378
- {
1379
- subject: [
1380
- {
1381
- uri: `pid://${a}`
1382
- }
1383
- ],
1384
- predicate: M[r],
1385
- object: {
1386
- literal: o
1387
- }
1388
- }
1389
- ]
1390
- };
1391
- f(c, {
1392
- method: "DELETE",
1393
- data: JSON.stringify(d),
1394
- headers: {
1395
- "Content-Type": "application/json",
1396
- Accept: "application/json,text/javascript,*/*"
1397
- },
1398
- onComplete(p) {
1399
- n && n(p);
1400
- },
1401
- onFailure(p, l) {
1402
- const u = p;
1403
- u.msg = l.errormsg, u.errCode = l.errorcode, console.log("❌ sendDirectMessage => ", u), s && s(u);
1404
- }
1405
- });
1406
- }
1407
- function Ve(e, t = "", n = void 0, s = void 0) {
1408
- const { space: a } = e;
1409
- if (t === "")
1410
- return;
1411
- const r = {
1412
- uri: "/resources/v1/modeler/documents"
1413
- }, o = {
1414
- "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8",
1415
- Accept: "application/json,text/javascript,*/*"
1416
- }, i = `${a}${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}`;
1417
- f(i, {
1418
- method: "POST",
1419
- headers: o,
1420
- data: c,
1421
- onComplete(d) {
1422
- n && n(JSON.parse(d));
1423
- },
1424
- onFailure(d, p) {
1425
- const l = d;
1426
- l.msg = p.error, s && s(l);
1427
- }
1428
- });
1429
- }
1430
- async function w(e, t = void 0, n = void 0) {
1431
- const s = e.space + "/api/index/tk";
1432
- return f(s, {
1433
- onComplete(a, r, o) {
1434
- const i = JSON.parse(a);
1435
- if (t)
1436
- return t(i), e.token = i?.result?.ServerToken;
1437
- },
1438
- onFailure(a) {
1439
- n && n(a);
1440
- }
1441
- });
1442
- }
1443
- function Xe(e, t = void 0, n = void 0) {
1444
- const s = `${e.space}/api/exalead/whatsnew`, a = {
1445
- params: {
1446
- community_id: null,
1447
- hash_key: null,
1448
- legacyFormat: !1,
1449
- nresults: 1,
1450
- query: "#all",
1451
- start: 0
1452
- }
1453
- };
1454
- w(e, (r) => {
1455
- f(s, {
1456
- method: "POST",
1457
- headers: {
1458
- "X-DS-SWYM-CSRFTOKEN": r.result.ServerToken,
1459
- "Content-type": "application/json;charset=UTF-8",
1460
- Accept: "application/json"
1461
- },
1462
- data: JSON.stringify(a),
1463
- type: "json",
1464
- onComplete(o, i) {
1465
- t && t(o, i);
1466
- },
1467
- onFailure(o, i) {
1468
- n && n(o, i);
1469
- }
1470
- });
1471
- });
1472
- }
1473
- function We(e, t = void 0, n = void 0) {
1474
- const s = `${e.space}/api/Recommendation/getpeoplefamiliartocurrentuser`, a = {
1475
- params: {
1476
- idsToFilterArr: [],
1477
- mode: "offline",
1478
- limit: 30,
1479
- itemType: "User",
1480
- maxNbOfCommonElements: "5"
1481
- }
1482
- };
1483
- w(e, (r) => {
1484
- f(s, {
1485
- method: "POST",
1486
- headers: {
1487
- "X-DS-SWYM-CSRFTOKEN": r.result.ServerToken,
1488
- "Content-type": "application/json;charset=UTF-8",
1489
- Accept: "application/json"
1490
- },
1491
- data: JSON.stringify(a),
1492
- type: "json",
1493
- onComplete(o, i) {
1494
- const c = o.result.hits.map((d) => ({ login: d.login, fullName: d.name }));
1495
- t && t(c, o);
1496
- },
1497
- onFailure(o, i) {
1498
- n && n(o, i);
1499
- }
1500
- });
1501
- });
1502
- }
1503
- function Be(e, t = void 0, n = void 0) {
1504
- const s = {
1505
- base: e.space,
1506
- uri: "/api/community/listmycommunities",
1507
- limit: `/limit/${e.limit ? e.limit : 128}`,
1508
- page: `/page/${e.page ? e.page : "1"}`
1509
- }, a = `${s.base}${s.uri}${s.limit}${s.page}`, r = [];
1510
- w(e, (o) => {
1511
- f(a, {
1512
- method: "GET",
1513
- headers: {
1514
- "X-DS-SWYM-CSRFTOKEN": o.result.ServerToken
1515
- },
1516
- onComplete(i, c, d) {
1517
- const l = JSON.parse(i).result;
1518
- let u = 0;
1519
- l.forEach((m) => {
1520
- const g = {
1521
- description: m.description,
1522
- id: m.id,
1523
- title: m.title,
1524
- owner: m.owner,
1525
- role: m.role,
1526
- access: m.access
1527
- };
1528
- ee(
1529
- e,
1530
- m.id,
1531
- (h) => {
1532
- u++, g.members = h, r.push(g), u === l.length && t && t(r);
1533
- },
1534
- (h) => n(h)
1535
- );
1536
- });
1537
- },
1538
- onFailure(i, c) {
1539
- const d = i;
1540
- d.status = c.status, d.response = c.errormsg, n && n(d);
1541
- }
1542
- });
1543
- });
1544
- }
1545
- function ee(e, t, n, s) {
1546
- const a = `${e.space}/api/community/listmembers`, r = {
1547
- params: {
1548
- page: e.page ? e.page : 1,
1549
- limit: e.limit ? e.limit : 50,
1550
- community_id: t
1551
- }
1552
- };
1553
- w(e, (o) => {
1554
- f(a, {
1555
- method: "POST",
1556
- headers: {
1557
- "Content-type": "application/json;charset=UTF-8",
1558
- Accept: "application/json",
1559
- "X-DS-SWYM-CSRFTOKEN": o.result.ServerToken
1560
- },
1561
- data: JSON.stringify(r),
1562
- type: "json",
1563
- onComplete(i, c, d) {
1564
- n && n(i);
1565
- },
1566
- onFailure(i, c) {
1567
- const d = i;
1568
- d.status = c.status, d.response = c.errormsg, s && s(d);
1569
- }
1570
- });
1571
- });
1572
- }
1573
- function Ye(e, t = void 0, n = void 0) {
1574
- const s = "YXdA5x4DSUKtlAi2wmnyTA";
1575
- e.commu_id || (e.commu_id = s);
1576
- const a = `${e.space}/api/v2/communities/${e.commu_id}/ideas/statuses`;
1577
- w(e, (r) => {
1578
- f(a, {
1579
- method: "GET",
1580
- headers: {
1581
- "Content-type": "application/json;charset=UTF-8",
1582
- Accept: "application/json",
1583
- "X-DS-SWYM-CSRFTOKEN": r.result.ServerToken
1584
- },
1585
- onComplete(o) {
1586
- const i = JSON.parse(o);
1587
- t && t(i);
1588
- },
1589
- onFailure(o, i) {
1590
- const c = o;
1591
- c.status = i.status, c.response = i.errormsg, n && n(c);
1592
- }
1593
- });
1594
- });
1595
- }
1596
- function qe(e, t, n = void 0, s = void 0) {
1597
- const { listAllContacts: a, currentUser: r } = e;
1598
- console.log("__listAllContacts", a.hits);
1599
- const o = `${e.space}/api/directmessages`, i = {
1600
- users: [r.login].concat(t.receipt)
1601
- }, c = {
1602
- id_msg: "",
1603
- senderId: e.currentUser.login,
1604
- senderName: `${e.currentUser.first_name} ${e.currentUser.last_name}`,
1605
- msg: ne(t.msg)
1606
- };
1607
- let d = !1;
1608
- te(
1609
- i.users,
1610
- (p) => {
1611
- p !== void 0 && (c.id_msg = p.id, d = !0, U(e, c));
1612
- },
1613
- (p) => {
1614
- d = !1, console.log("_3dSwym_findCommunityToInstantMSG callback", p), s && s(p), c.id_msg = "";
1615
- }
1616
- ), d === !1 && setTimeout(() => {
1617
- d === !1 && w(e, (p) => {
1618
- f(o, {
1619
- method: "POST",
1620
- headers: {
1621
- "Content-Type": "application/json",
1622
- Accept: "application/json",
1623
- "X-DS-SWYM-CSRFTOKEN": p.result.ServerToken
1624
- },
1625
- data: JSON.stringify(i),
1626
- type: "json",
1627
- onComplete(l, u, m) {
1628
- const g = l;
1629
- g.reponse = JSON.parse(m.response), g.status = m.status, n && n(g), c.id_msg = g.result.id, U(e, c);
1630
- },
1631
- onFailure(l, u, m) {
1632
- const g = l;
1633
- g.msg = u.errormsg, g.status = u.status, s && s(g);
1634
- }
1635
- });
1636
- });
1637
- }, 500);
1638
- }
1639
- function te(e, t, n, s) {
1640
- const a = `${e.space}/api/directmessages/lite?with_favorites=false`;
1641
- w(e, (r) => {
1642
- f(a, {
1643
- method: "GET",
1644
- headers: {
1645
- Accept: "application/json,text/javascript,*/*",
1646
- "X-DS-SWYM-CSRFTOKEN": r.result.ServerToken
1647
- },
1648
- onComplete(o) {
1649
- const i = JSON.parse(o), c = [];
1650
- i.result.forEach((l) => {
1651
- l.users = l.users.sort((u, m) => u.login.localeCompare(m.login)), l.users.length === t.length && c.push(l);
1652
- });
1653
- const d = t.sort(), p = c.find((l) => {
1654
- const u = [];
1655
- return l.users.forEach((m) => {
1656
- u.push(m.login);
1657
- }), JSON.stringify(u) === JSON.stringify(d);
1658
- });
1659
- n && p !== void 0 ? n(p) : (s || p === void 0) && s(p);
1660
- },
1661
- onFailure(o) {
1662
- const i = o;
1663
- i.msg = headers.errormsg, i.errCode = headers.errorcode, console.log("❌ sendDirectMessageLite => ", i), s && s(i);
1664
- }
1665
- });
1666
- });
1667
- }
1668
- function U(e, t, n = void 0, s = void 0) {
1669
- const a = {
1670
- base: e.space,
1671
- uri: "/api/community",
1672
- id_msg: `${t.id_msg}`,
1673
- endUri: "/instantmessages"
1674
- }, r = `${a.base}${a.uri}/${a.id_msg}${a.endUri}`, o = {
1675
- author: { login: t.senderId, displayName: t.senderName },
1676
- accessState: null,
1677
- commentUri: null,
1678
- comments: null,
1679
- endorsements: null,
1680
- moderationState: null,
1681
- parentCommentUri: null,
1682
- richMessage: t.msg
1683
- };
1684
- console.log("_3dSwym_sendDirectMessageData url ", r), w(e, (i) => {
1685
- f(r, {
1686
- method: "POST",
1687
- headers: {
1688
- "Content-Type": "application/json",
1689
- Accept: "application/json",
1690
- "X-DS-SWYM-CSRFTOKEN": i.result.ServerToken
1691
- },
1692
- data: JSON.stringify(o),
1693
- type: "json",
1694
- onComplete(c, d, p) {
1695
- const l = c;
1696
- l.status = p.status, l.response = JSON.parse(p.response), console.log("✅ _3dSwym_sendDirectMessageData => ", l), n && n(l);
1697
- },
1698
- onFailure(c, d) {
1699
- const p = c;
1700
- p.msg = d.errormsg, p.errCode = d.errorcode, console.log("❌ sendDirectMessage => ", p), s && s(p);
1701
- }
1702
- });
1703
- });
1704
- }
1705
- function ne(e) {
1706
- const t = (/* @__PURE__ */ new Date()).toLocaleDateString(), n = (/* @__PURE__ */ new Date()).toLocaleTimeString();
1707
- return `<p>${e} </p>
1708
- <br/>
1709
- <hr/>
1710
- <p><u>envoyer :</u>Le <b>${t} à ${n}</b></p>`;
1711
- }
1712
- const se = {
1713
- title: "TEST DEV COMMUNITY IDEA",
1714
- // titre du post
1715
- community_id: "YXdA5x4DSUKtlAi2wmnyTA",
1716
- // STATUT PROJETS - Phase commerciale, tenant PIVETEAU TEST
1717
- community_title: "TEST DEV COMMUNITY",
1718
- // Possibilité de recherche par titre de la communauté (option)
1719
- idee_id: "THhRI8rlQNWKRxpv3Xqqug"
1720
- // id de l'idee qui est créer au post (_3dSwym_postIdea)
1721
- };
1722
- function He(e, t, n = void 0, s = void 0) {
1723
- const a = `${e.space}/api/idea/add`, r = e.swymCommunities.find(
1724
- (c) => c.id === t.community_id
1725
- ), o = e.swymCommunities.find(
1726
- (c) => c.title.toLowerCase() === t.community_title.toLowerCase()
1727
- ), i = {
1728
- params: {
1729
- title: t.title,
1730
- // String, le nom de l'affaire
1731
- community_id: r?.id !== void 0 ? r.id : o.id,
1732
- // String, l'id de la communauté
1733
- message: ie(t.text_html),
1734
- // STRING => le contenue du message doit être au format HTML
1735
- published: 1
1736
- // 1 publier, 0 non publier
1737
- }
1738
- };
1739
- w(e, (c) => {
1740
- const d = {
1741
- "Content-type": "application/json;charset=UTF-8",
1742
- Accept: "application/json",
1743
- "X-DS-SWYM-CSRFTOKEN": c.result.ServerToken
1744
- };
1745
- f(a, {
1746
- method: "POST",
1747
- headers: d,
1748
- data: JSON.stringify(i),
1749
- type: "json",
1750
- onComplete(p, l, u) {
1751
- const m = JSON.parse(p);
1752
- m.status = u.status, m.response = u.response, n && n(m);
1753
- },
1754
- onFailure(p, l, u) {
1755
- const m = p;
1756
- m.status = l.status, m.response = l.errormsg, s && s(m);
1757
- }
1758
- });
1759
- });
1760
- }
1761
- function ze(e, t, n = void 0, s = void 0) {
1762
- const a = `${e.space}/api/idea/delete`, r = {
1763
- params: {
1764
- community_id: t.community_id,
1765
- ideationIds: [t.idee_id]
1766
- }
1767
- };
1768
- w(e, (o) => {
1769
- f(a, {
1770
- method: "POST",
1771
- headers: {
1772
- "Content-type": "application/json;charset=UTF-8",
1773
- Accept: "application/json",
1774
- "X-DS-SWYM-CSRFTOKEN": o.result.ServerToken
1775
- },
1776
- data: JSON.stringify(r),
1777
- type: "json",
1778
- onComplete(i, c, d) {
1779
- n && n(i);
1780
- },
1781
- onFailure(i, c, d) {
1782
- const p = i;
1783
- p.status = c.status, p.response = c.errormsg, s && s(p);
1784
- }
1785
- });
1786
- });
1787
- }
1788
- function Qe(e, t = "", n = void 0, s = void 0) {
1789
- const a = e.tenant.toLowerCase() === "r1132101716373" ? "tFtz0G4MR6qNtKgJjNfTog" : e.tenant.toLowerCase() === "r1132101286859" ? "Qpv3HN-tTDOsU-7_c5DnDg" : "Template_d'idée_à_créer";
1790
- t === "" && (t = a);
1791
- const r = `${e.space}/api/idea/get`, o = {
1792
- params: {
1793
- id: t
1794
- }
1795
- };
1796
- w(e, (i) => {
1797
- f(r, {
1798
- method: "POST",
1799
- headers: {
1800
- "Content-type": "application/json;charset=UTF-8",
1801
- Accept: "application/json",
1802
- "X-DS-SWYM-CSRFTOKEN": i.result.ServerToken
1803
- },
1804
- data: JSON.stringify(o),
1805
- type: "json",
1806
- onComplete(c) {
1807
- const d = c;
1808
- d.msg = d.result.message, n && n(d);
1809
- },
1810
- onFailure(c) {
1811
- const d = c;
1812
- d.status = headers.status, d.response = headers.errormsg, s && s(d);
1813
- }
1814
- });
1815
- });
1816
- }
1817
- function Ze(e, t = se, n = void 0, s = void 0) {
1818
- const a = {
1819
- uri: "/api/idea/list",
1820
- comId: `/community_id/${e.tenant.toLowerCase() === "r1132101716373" ? t.community_id : "bgnIsG74SUWswyGzS6NC6g"}`,
1821
- limit: `/limit/${t.limit ? t.limit : 10}`
1822
- }, r = `${e.space}${a.uri}${a.comId}${a.limit}`;
1823
- w(e, (o) => {
1824
- f(r, {
1825
- method: "GET",
1826
- headers: {
1827
- "X-DS-SWYM-CSRFTOKEN": o.result.ServerToken
1828
- },
1829
- onComplete(i) {
1830
- const c = JSON.parse(i);
1831
- n && n(c);
1832
- },
1833
- onFailure(i, c) {
1834
- const d = i;
1835
- d.status = c.status, d.response = c.errormsg, s && s(d);
1836
- }
1837
- });
1838
- });
1839
- }
1840
- function ie(e) {
1841
- return !e || e === "" ? `<h2><u>INFORMATIONS AFFAIRE :</u></h2>
1842
- <p><u>|⚠️<em> Merci de respecter l&#39;écriture des tags, en MAJUSCULES, nom complet, pas de caractères</em></u></p>
1843
- <p><u><em>|spéciaux, séparation par &#34;_&#34; si besoin !</em></u></p>
1844
- <p><strong>Référence client </strong>: <em>
1845
- <a data-predicate="ds6w:who" data-type="internal" class="s6m-tag-link s6m-link">CLIENT</a>
1846
- </em></p>
1847
- <p><strong>Référence projet </strong>: <em>
1848
- <a data-predicate="ds6w:what" data-type="internal" class="s6m-tag-link s6m-link">NOM AFFAIRE</a>
1849
- <a data-predicate="ds6w:where" data-type="internal" class="s6m-tag-link s6m-link">VILLE</a>
1850
- <a data-predicate="ds6w:where" data-type="internal" class="s6m-tag-link s6m-link">DPT</a>
1851
- </em></p>
1852
- <p>&#x1f4dd; <strong>Base documentaire</strong> : LIEN projet</p>
1853
- <p>&#x1f4dd; <strong>Fiche COCLICO</strong> : LIEN projet<em><strong></strong>
1854
- </em></p>
1855
- <p><br /></p>
1856
- <table border="1">
1857
- <tbody>
1858
- <tr><td><strong>Description projet </strong>:
1859
- <br /><br /></td></tr>
1860
- </tbody>
1861
- </table>
1862
- <p><br /></p>
1863
- <p><br /></p>
1864
- <p><strong>Produit :<em> </em></strong><em>
1865
- <a data-predicate="ds6w:what" data-type="internal" class="s6m-tag-link s6m-link">Hexapli Usiné</a>
1866
- <a data-predicate="ds6w:what" data-type="internal" class="s6m-tag-link s6m-link">Hexapli MP</a>
1867
- <a data-predicate="ds6w:what" data-type="internal" class="s6m-tag-link s6m-link">Lamwood</a>
1868
- </em></p>
1869
- <p><strong>Type de Bâtiment :</strong><em>
1870
- <a data-predicate="ds6w:what" data-type="internal" class="s6m-tag-link s6m-link">Logements</a>
1871
- <a data-predicate="ds6w:what" data-type="internal" class="s6m-tag-link s6m-link">BUP</a>
1872
- <a data-predicate="ds6w:what" data-type="internal" class="s6m-tag-link s6m-link">ERP</a>
1873
- <a data-predicate="ds6w:what" data-type="internal" class="s6m-tag-link s6m-link">Plateforme Logistique</a>
1874
- </em></p>
1875
- <p><strong>Essence :</strong> <em>
1876
- <a data-predicate="ds6w:how" data-type="internal" class="s6m-tag-link s6m-link">DOUGLAS</a>
1877
- <a data-predicate="ds6w:how" data-type="internal" class="s6m-tag-link s6m-link">PIN</a>
1878
- <a data-predicate="ds6w:how" data-type="internal" class="s6m-tag-link s6m-link">MIXTE</a>
1879
- <a data-predicate="ds6w:how" data-type="internal" class="s6m-tag-link s6m-link">EPICEA</a>
1880
- </em></p>
1881
- <p><strong>Qualité : </strong><em>
1882
- <a data-predicate="ds6w:how" data-type="internal" class="s6m-tag-link s6m-link">NVI</a>
1883
- <a data-predicate="ds6w:how" data-type="internal" class="s6m-tag-link s6m-link">VI1F</a>
1884
- <a data-predicate="ds6w:how" data-type="internal" class="s6m-tag-link s6m-link">VI2F</a>
1885
- </em><strong></strong></p>
1886
- <p><strong>Traitement : </strong><em>
1887
- <a data-predicate="ds6w:how" data-type="internal" class="s6m-tag-link s6m-link">PARKA</a>
1888
- <a data-predicate="ds6w:how" data-type="internal" class="s6m-tag-link s6m-link">CT2</a>
1889
- </em></p>
1890
- <p><strong>Type de Paroi : </strong><em>
1891
- <a data-predicate="ds6w:what" data-type="internal" class="s6m-tag-link s6m-link">Murs Intérieurs</a>
1892
- <a data-predicate="ds6w:what" data-type="internal" class="s6m-tag-link s6m-link">Murs Extérieurs</a>
1893
- <a data-predicate="ds6w:what" data-type="internal" class="s6m-tag-link s6m-link">Planchers</a>
1894
- <a data-predicate="ds6w:what" data-type="internal" class="s6m-tag-link s6m-link">Couverture</a>
1895
- </em></p>
1896
- <p><em>
1897
- <a data-predicate="ds6w:what" data-type="internal" class="s6m-tag-link s6m-link">Etanchéité Accessible</a>
1898
- <a data-predicate="ds6w:what" data-type="internal" class="s6m-tag-link s6m-link">Etanchéité Non-Accessible</a>
1899
- </em></p>
1900
- <p><strong>Hauteur Dernier Plancher :</strong><em><strong> </strong>
1901
- <a data-predicate="ds6w:how" data-type="internal" class="s6m-tag-link s6m-link">Hauteur &lt;8m</a>
1902
- <a data-predicate="ds6w:how" data-type="internal" class="s6m-tag-link s6m-link">8m&lt; Hauteur &lt;28m</a>
1903
- <a data-predicate="ds6w:how" data-type="internal" class="s6m-tag-link s6m-link">28m&lt; Hauteur &lt;50m</a>
1904
- </em></p>
1905
- <h2><br /></h2>
1906
- <h2><u>EQUIPE PIVETEAU :</u></h2>
1907
- <table border="1">
1908
- <tbody>
1909
- <tr><td><strong>Chargé d&#39;Affaires</strong></td><td><br /></td></tr>
1910
- <tr><td><strong>Service études de prix</strong></td><td><br /></td></tr>
1911
- </tbody></table>
1912
- <p>
1913
- </p>` : e;
1914
- }
1915
- function et(e, t = void 0, n = void 0) {
1916
- const s = e.space + "/api/user/getcurrent/";
1917
- w(e, (a) => {
1918
- f(s, {
1919
- method: "GET",
1920
- headers: {
1921
- "X-DS-SWYM-CSRFTOKEN": a.result.ServerToken
1922
- },
1923
- onComplete(r, o, i) {
1924
- const c = JSON.parse(r);
1925
- t && t(c.result);
1926
- },
1927
- onFailure(r, o, i) {
1928
- const c = { erreur: JSON.parse(r), headers: o, xhr: i };
1929
- n && n(c);
1930
- }
1931
- });
1932
- });
1933
- }
1934
- function tt(e, t, n = void 0, s = void 0) {
1935
- const a = e.space + "/api/user/find/login/" + t;
1936
- w(
1937
- e,
1938
- (r) => {
1939
- f(a, {
1940
- method: "GET",
1941
- headers: { "X-DS-SWYM-CSRFTOKEN": r.result.ServerToken },
1942
- onComplete(o, i, c) {
1943
- const d = JSON.parse(o);
1944
- n && n(d);
1945
- },
1946
- onFailure(o) {
1947
- s && s(o);
1948
- }
1949
- });
1950
- },
1951
- s
1952
- );
1953
- }
1954
- function nt(e, t = void 0, n = void 0) {
1955
- e.tenant && v(e, (s) => {
1956
- console.log("serviceUrls", s);
1957
- const a = s.services.find((r) => r.id === "businessprocess")?.url + "/api/v2";
1958
- t && t(a);
1959
- });
1960
- }
1961
- function st(e, t = void 0, n = void 0) {
1962
- e.tenant && v(e, (s) => {
1963
- console.log("serviceUrls", s);
1964
- const a = s.services.find((i) => i.id === "3dpassport")?.url, r = s.services.find((i) => i.id === "businessprocess")?.url + "/api/v2", o = `${a}/login/?service=${r}/auth/cas`;
1965
- f(o, {
1966
- async onComplete(i) {
1967
- console.log("response", i);
1968
- const c = typeof i == "string" ? JSON.parse(i)?.x3ds_service_redirect_url : i?.x3ds_service_redirect_url;
1969
- await fetch(c, {
1970
- method: "POST"
1971
- }).then((d) => d.json()).then(async (d) => {
1972
- t && t(d?.token);
1973
- });
1974
- },
1975
- onFailure(i) {
1976
- n && n(i);
1977
- }
1978
- });
1979
- });
1980
- }
1981
- async function it(e, t, n = void 0, s = void 0) {
1982
- e.tenant && v(e, (a) => {
1983
- const o = `${a.services.find((i) => i.id === "businessprocess")?.url + "/api/v2"}/identity/users`;
1984
- fetch(`https://api.uixhome.fr/iterop/listusers?t=${t}&s=${o}`, {
1985
- method: "POST"
1986
- }).then((i) => i.json()).then((i) => {
1987
- n && n(i);
1988
- }).catch((i) => {
1989
- s && s(i);
1990
- });
1991
- });
1992
- }
1993
- async function at(e, t, n = void 0, s = void 0) {
1994
- e.tenant && v(e, (a) => {
1995
- const o = `${a.services.find((i) => i.id === "businessprocess")?.url + "/api/v2"}/repository/data/tables`;
1996
- fetch(`https://api.uixhome.fr/iterop/repository/data/tables?t=${t}&s=${o}`, {
1997
- method: "GET"
1998
- }).then((i) => i.json()).then((i) => {
1999
- n && n(i);
2000
- }).catch((i) => {
2001
- s && s(i);
2002
- });
2003
- });
2004
- }
2005
- async function ot(e, t, n, s, a = void 0, r = void 0) {
2006
- e.tenant && v(e, (o) => {
2007
- const i = o.services.find((d) => d.id === "businessprocess")?.url + "/api/v2", c = encodeURIComponent(`${i}`);
2008
- fetch(
2009
- `https://api.uixhome.fr/iterop/runtime/processes/${n}?t=${t}&s=${c}&b=${s}`,
2010
- {
2011
- method: "POST"
2012
- }
2013
- ).then((d) => d.json()).then((d) => {
2014
- a && a(d);
2015
- }).catch((d) => {
2016
- r && r(d);
2017
- });
2018
- });
2019
- }
2020
- function rt(e) {
2021
- const t = "Hello " + e;
2022
- return console.log(t), t;
2023
- }
2024
- function ct(e, t = void 0, n = void 0) {
2025
- return console.log("credentials", e), new Promise((s) => {
2026
- if (e.token === "" && T(e), !e.space || e.space === "") {
2027
- const o = E();
2028
- console.log("platformeInfo", o);
2029
- }
2030
- b(
2031
- e,
2032
- "Common space",
2033
- ["VPLMProjectLeader", "VPLMCreator"],
2034
- void 0,
2035
- (o) => e.ctx = o,
2036
- (o) => {
2037
- console.log("onError =>", o);
2038
- },
2039
- !0
2040
- );
2041
- const a = N.now().ts, r = `https://${e.tenant}-eu1-registry.3dexperience.3ds.com/api/v1/platform/service/instance?serviceId=3dsearch&platformId=${e.tenant}`;
2042
- f(r, {
2043
- onComplete(o) {
2044
- if (Array.isArray(JSON.parse(o))) {
2045
- const i = JSON.parse(o);
2046
- console.log("serviceId=3dsearch", i);
2047
- const c = `${i[0].services[0].url}/search?xrequestedwith=xmlhttprequest`;
2048
- f(c, {
2049
- method: "POST",
2050
- headers: {
2051
- Accept: "application/json",
2052
- "Content-Type": "application/json"
2053
- },
2054
- data: JSON.stringify({
2055
- with_indexing_date: !0,
2056
- with_nls: !1,
2057
- label: `3DSearch-${a}`,
2058
- locale: "en",
2059
- select_predicate: [
2060
- "ds6w:label",
2061
- "ds6w:type",
2062
- "ds6w:description",
2063
- "ds6w:identifier",
2064
- "ds6w:responsible",
2065
- "ds6wg:fullname"
2066
- ],
2067
- select_file: [
2068
- "icon",
2069
- "thumbnail_2d"
2070
- ],
2071
- query: '([ds6w:type]:(Group) AND [ds6w:status]:(Public)) OR (flattenedtaxonomies:"types/Person" AND current:"active")',
2072
- order_by: "desc",
2073
- order_field: "relevance",
2074
- nresults: 1e3,
2075
- start: "0",
2076
- source: [
2077
- "3dspace",
2078
- "usersgroup"
2079
- ],
2080
- tenant: e.tenant,
2081
- login: {
2082
- "3dspace": {
2083
- SecurityContext: `ctx::${e.ctx}`
2084
- }
2085
- }
2086
- }),
2087
- type: "json",
2088
- onComplete(d) {
2089
- t && t(d);
2090
- },
2091
- onFailure(d) {
2092
- n && n(d);
2093
- }
2094
- });
2095
- }
2096
- },
2097
- onFailure(o) {
2098
- n && n(o);
2099
- }
2100
- });
2101
- });
2102
- }
2103
- export {
2104
- D as UUID,
2105
- ct as _3DSearch_usersGroup,
2106
- Ie as _3DSpace_Create_Doc,
2107
- De as _3DSpace_bookmark_addSubsciptions,
2108
- T as _3DSpace_csrf,
2109
- P as _3DSpace_download_doc,
2110
- B as _3DSpace_download_multidoc,
2111
- X as _3DSpace_file_update,
2112
- W as _3DSpace_file_update_csr,
2113
- $e as _3DSpace_file_url_csr,
2114
- $ as _3DSpace_get_csrf,
2115
- V as _3DSpace_get_docInfo,
2116
- Y as _3DSpace_get_downloadTicket_multidoc,
2117
- b as _3DSpace_get_securityContexts,
2118
- A as _3DSpace_get_ticket,
2119
- je as _3DSpace_lifecycle_changeRevision,
2120
- Ae as _3DSpace_lifecycle_changeState,
2121
- Fe as _3DSpace_lifecycle_getGraph,
2122
- Ue as _3DSpace_lifecycle_getNextRevision,
2123
- ke as _3DSpace_lifecycle_getNextStates,
2124
- qe as _3DSwym_buildDirectMessage,
2125
- ze as _3DSwym_deleteIdea,
2126
- te as _3DSwym_findCommunityToInstantMSG,
2127
- Be as _3DSwym_getAllCommunities,
2128
- Xe as _3DSwym_getAllNews,
2129
- We as _3DSwym_getFamiliarPeople,
2130
- Ye as _3DSwym_getIdeaStatusMaturity,
2131
- ee as _3DSwym_getMembersCommunity,
2132
- Qe as _3DSwym_getSWYMIdea,
2133
- Ze as _3DSwym_get_AllSWYMIdeas,
2134
- et as _3DSwym_get_currentUser,
2135
- tt as _3DSwym_get_findUser,
2136
- w as _3DSwym_get_version,
2137
- He as _3DSwym_postIdea,
2138
- U as _3DSwym_sendMessageData,
2139
- ye as _AppMngt_get_info_user,
2140
- _e as _AppMngt_get_users,
2141
- st as _Iterop_Auth_CAS,
2142
- it as _Iterop_ListUsers,
2143
- at as _Iterop_getAllBusinessTables,
2144
- ot as _Iterop_runProcess,
2145
- E as _getPlateformInfos,
2146
- ge as _getPlatformServices,
2147
- v as _getServiceUrl,
2148
- he as _getServiceUrl_3DPassport,
2149
- nt as _getServiceUrl_Iterop,
2150
- f as _httpCallAuthenticated,
2151
- ue as _setDraggable,
2152
- me as _setDroppable,
2153
- fe as _setupTagger,
2154
- Ge as addTagToDoc,
2155
- Se as compass_getListAdditionalApps,
2156
- J as couleurs,
2157
- we as createUserGroups,
2158
- q as dataMixing,
2159
- Oe as deleteUserGroups,
2160
- de as findAdresse,
2161
- Pe as getAllContextSecurity,
2162
- K as getCSRFToken,
2163
- ce as getCommunes,
2164
- Ce as getComplementUG,
2165
- Re as getDataFrom3DSpace,
2166
- pe as getDataFromGouvFr,
2167
- Je as getDatasByTenant,
2168
- Ee as getDatasFrom3DSpace,
2169
- xe as getDownloadDocument,
2170
- Ve as getInfoDocTags,
2171
- Te as getUserGroupsList,
2172
- G as getUsersGroupRules,
2173
- Le as get_3DSpace_csrf,
2174
- be as patchUserGroups,
2175
- Ne as patchUserGroupsControl,
2176
- Me as pushDataIn3DSpace,
2177
- ve as readUserGroupControl,
2178
- Ke as removeTagToDoc,
2179
- rt as sayHello,
2180
- le as updateEvent
2181
- };
2182
- //# sourceMappingURL=wb3Api.js.map