@beam3_dev/api_module 0.0.148 → 0.0.150

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