@beam3_dev/api_module 0.0.34 → 0.0.35
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 +103 -101
- package/dist/wb3Api.umd.cjs +4 -4
- package/package.json +1 -1
package/dist/wb3Api.js
CHANGED
|
@@ -34,7 +34,7 @@ const E = {
|
|
|
34
34
|
b3Edit8: "#616161",
|
|
35
35
|
b3Edit9: "#795548"
|
|
36
36
|
};
|
|
37
|
-
async function
|
|
37
|
+
async function ce(e, t = void 0, s = void 0) {
|
|
38
38
|
const n = parseInt(e);
|
|
39
39
|
await fetch(
|
|
40
40
|
"https://apicarto.ign.fr/api/codes-postaux/communes/" + n,
|
|
@@ -50,7 +50,7 @@ async function de(e, t = void 0, s = void 0) {
|
|
|
50
50
|
s && s(i), console.error("Erreur : " + i);
|
|
51
51
|
});
|
|
52
52
|
}
|
|
53
|
-
async function
|
|
53
|
+
async function de(e, t = void 0, s = void 0) {
|
|
54
54
|
e = encodeURIComponent(e), await fetch(
|
|
55
55
|
"https://api-adresse.data.gouv.fr/search/?q=" + e + "&limit=15",
|
|
56
56
|
{
|
|
@@ -65,7 +65,7 @@ async function le(e, t = void 0, s = void 0) {
|
|
|
65
65
|
s && s(n), console.error("Erreur : " + n);
|
|
66
66
|
});
|
|
67
67
|
}
|
|
68
|
-
async function
|
|
68
|
+
async function le(e, t = E) {
|
|
69
69
|
let s = b.now().year;
|
|
70
70
|
const n = e, i = [], c = (a) => {
|
|
71
71
|
for (let o in a)
|
|
@@ -100,7 +100,7 @@ async function pe(e, t = E) {
|
|
|
100
100
|
return a;
|
|
101
101
|
})();
|
|
102
102
|
}
|
|
103
|
-
async function
|
|
103
|
+
async function pe(e, t, s = !0) {
|
|
104
104
|
const n = e.events.findIndex((i) => i.uuid === t.uuid);
|
|
105
105
|
return n === -1 ? e.events.push(t) : s ? e.events[n] = t : e.events.splice(n, 1), e.length > 0 && e.sort((i, c) => i.start - c.start), e;
|
|
106
106
|
}
|
|
@@ -109,12 +109,12 @@ function f(e, t) {
|
|
|
109
109
|
s.authenticatedRequest(e, t);
|
|
110
110
|
});
|
|
111
111
|
}
|
|
112
|
-
function
|
|
112
|
+
function ue(e, t, s) {
|
|
113
113
|
O(["DS/DataDragAndDrop/DataDragAndDrop"], (n) => {
|
|
114
114
|
n.draggable(e, { data: t, start: s });
|
|
115
115
|
});
|
|
116
116
|
}
|
|
117
|
-
function
|
|
117
|
+
function fe(e, t = void 0) {
|
|
118
118
|
O(["DS/TagNavigatorProxy/TagNavigatorProxy"], (s) => {
|
|
119
119
|
let n;
|
|
120
120
|
n === void 0 && (n = s.createProxy({
|
|
@@ -123,7 +123,7 @@ function me(e, t = void 0) {
|
|
|
123
123
|
}), t !== void 0 && n.addEvent("onFilterSubjectsChange", t)), n.setSubjectsTags(e);
|
|
124
124
|
});
|
|
125
125
|
}
|
|
126
|
-
function
|
|
126
|
+
function me(e, t) {
|
|
127
127
|
O(["DS/DataDragAndDrop/DataDragAndDrop"], (s) => {
|
|
128
128
|
s.droppable(e, { drop: t });
|
|
129
129
|
});
|
|
@@ -132,26 +132,27 @@ function j(e, t = void 0, s = void 0) {
|
|
|
132
132
|
O(
|
|
133
133
|
["DS/i3DXCompassServices/i3DXCompassServices"],
|
|
134
134
|
(n) => {
|
|
135
|
-
(!e || e === "") && (e = U.getValue("PlatFormInstanceId")), (!e || e === "") && (e = void 0),
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
135
|
+
(!e || e === "") && (e = U.getValue("PlatFormInstanceId")), (!e || e === "") && (e = void 0), t && t(
|
|
136
|
+
n.getPlatformServices({
|
|
137
|
+
platformId: e,
|
|
138
|
+
onComplete: t,
|
|
139
|
+
onFailure: s
|
|
140
|
+
})
|
|
141
|
+
);
|
|
140
142
|
}
|
|
141
|
-
)
|
|
143
|
+
);
|
|
142
144
|
}
|
|
143
|
-
function
|
|
145
|
+
function ge() {
|
|
144
146
|
let e = {};
|
|
145
147
|
return O(["DS/PlatformAPI/PlatformAPI"], (t) => {
|
|
146
|
-
const s = t.getTenant(), n = t.getUser(), i = t.getAllApplicationConfigurations(), c = t.
|
|
148
|
+
const s = t.getTenant(), n = t.getUser(), i = t.getAllApplicationConfigurations(), c = t.getApplicationConfiguration(
|
|
147
149
|
"com.3ds.wp.passport.cors"
|
|
148
150
|
);
|
|
149
151
|
e = {
|
|
150
152
|
tenant: s,
|
|
151
153
|
user: n,
|
|
152
154
|
appsConfiguration: i,
|
|
153
|
-
|
|
154
|
-
appConf: r
|
|
155
|
+
appConf: c
|
|
155
156
|
};
|
|
156
157
|
}), console.log("%cRETOUR API :", "color:blue", e), e;
|
|
157
158
|
}
|
|
@@ -240,7 +241,7 @@ function _e(e, t, s = void 0, n = void 0) {
|
|
|
240
241
|
}
|
|
241
242
|
});
|
|
242
243
|
}
|
|
243
|
-
function
|
|
244
|
+
function we(e, t, s = void 0, n = void 0) {
|
|
244
245
|
const { space: i, tenant: c } = e, r = i, a = `/3drdfpersist/v1/resources/${t}`, o = `?$mask=dsaccess:Mask.GroupUI.Properties&tenant=dstenant:${c}`, d = `${r}${a}${o}`;
|
|
245
246
|
f(d, {
|
|
246
247
|
opts: {
|
|
@@ -259,7 +260,7 @@ function Te(e, t, s = void 0, n = void 0) {
|
|
|
259
260
|
}
|
|
260
261
|
});
|
|
261
262
|
}
|
|
262
|
-
function
|
|
263
|
+
function J(e, t = void 0, s = void 0) {
|
|
263
264
|
const { space: n, tenant: i } = e, c = n, r = "/3drdfpersist/resources/v1/option-sets/dsusergroup:ListOfGroupResponsibilities/options", a = `?tenant=dstenant:${i}`, o = {
|
|
264
265
|
method: "GET",
|
|
265
266
|
Accept: "application/json,*/*,test/javascript"
|
|
@@ -275,7 +276,7 @@ function G(e, t = void 0, s = void 0) {
|
|
|
275
276
|
}
|
|
276
277
|
});
|
|
277
278
|
}
|
|
278
|
-
function
|
|
279
|
+
function Te(e, t = void 0, s = void 0) {
|
|
279
280
|
const { space: n, currentUser: i } = e, a = `${n}/3drdfpersist/resources/v1/usersgroup?select=uri,title,description,owner,members,pending_members,creation_date,modification_date,visibility`, d = { method: "GET", headers: {
|
|
280
281
|
"Content-Type": "application/json",
|
|
281
282
|
Accept: "application/json,text/javascript,*/*"
|
|
@@ -287,7 +288,7 @@ function we(e, t = void 0, s = void 0) {
|
|
|
287
288
|
const p = JSON.parse(l), u = {}, m = p.groups.filter((g) => g.uri.startsWith("uuid:"));
|
|
288
289
|
if (i && Object.keys(i).length > 0) {
|
|
289
290
|
const g = m.filter((y) => y.owner === i.email), h = m.filter((y) => y.members.includes(i.email)), S = g.concat(h);
|
|
290
|
-
u.iam = S, u.UG = m, u.iamMember = h,
|
|
291
|
+
u.iam = S, u.UG = m, u.iamMember = h, J(
|
|
291
292
|
e,
|
|
292
293
|
(y) => {
|
|
293
294
|
u.rules = y, t && t(u);
|
|
@@ -368,7 +369,7 @@ function be(e, t, s = void 0, n = void 0) {
|
|
|
368
369
|
}
|
|
369
370
|
});
|
|
370
371
|
}
|
|
371
|
-
async function
|
|
372
|
+
async function G(e, t = void 0, s = void 0, n = void 0) {
|
|
372
373
|
const i = e.space;
|
|
373
374
|
if (t === void 0) {
|
|
374
375
|
console.log("Le paramètre docid est obligatoire");
|
|
@@ -466,12 +467,12 @@ function ke(e, t, s, n = void 0, i = void 0) {
|
|
|
466
467
|
}
|
|
467
468
|
});
|
|
468
469
|
}
|
|
469
|
-
function
|
|
470
|
+
function K(e, t, s, n, i, c = void 0, r = void 0) {
|
|
470
471
|
k(
|
|
471
472
|
e,
|
|
472
473
|
t,
|
|
473
474
|
(a) => {
|
|
474
|
-
|
|
475
|
+
V(
|
|
475
476
|
e,
|
|
476
477
|
t,
|
|
477
478
|
s,
|
|
@@ -485,7 +486,7 @@ function V(e, t, s, n, i, c = void 0, r = void 0) {
|
|
|
485
486
|
r
|
|
486
487
|
);
|
|
487
488
|
}
|
|
488
|
-
function
|
|
489
|
+
function V(e, t, s, n, i, c, r = void 0, a = void 0) {
|
|
489
490
|
const o = e.space + `/resources/v1/modeler/documents/${t}/files/CheckinTicket`;
|
|
490
491
|
f(o, {
|
|
491
492
|
method: "PUT",
|
|
@@ -562,7 +563,7 @@ async function Fe(e, t, s, n, i = void 0, c = void 0) {
|
|
|
562
563
|
const S = {
|
|
563
564
|
method: "POST",
|
|
564
565
|
data: d,
|
|
565
|
-
onComplete(
|
|
566
|
+
onComplete(T) {
|
|
566
567
|
if (o !== "" && a !== "") {
|
|
567
568
|
const F = {
|
|
568
569
|
method: "POST",
|
|
@@ -585,7 +586,7 @@ async function Fe(e, t, s, n, i = void 0, c = void 0) {
|
|
|
585
586
|
{
|
|
586
587
|
dataelements: {
|
|
587
588
|
title: `${s}.json`,
|
|
588
|
-
receipt:
|
|
589
|
+
receipt: T
|
|
589
590
|
}
|
|
590
591
|
}
|
|
591
592
|
]
|
|
@@ -605,12 +606,12 @@ async function Fe(e, t, s, n, i = void 0, c = void 0) {
|
|
|
605
606
|
},
|
|
606
607
|
onFailure: _
|
|
607
608
|
};
|
|
608
|
-
function y(
|
|
609
|
-
console.log("Success -- response ",
|
|
609
|
+
function y(T) {
|
|
610
|
+
console.log("Success -- response ", T.data[0]), i && i(T);
|
|
610
611
|
}
|
|
611
|
-
function _(
|
|
612
|
-
console.log("Erreur -- response ",
|
|
613
|
-
headers `, F), c && c(
|
|
612
|
+
function _(T, F) {
|
|
613
|
+
console.log("Erreur -- response ", T, `
|
|
614
|
+
headers `, F), c && c(T);
|
|
614
615
|
}
|
|
615
616
|
f(h.ticketURL, S);
|
|
616
617
|
}
|
|
@@ -693,7 +694,7 @@ async function X(e, t, s = void 0, n = void 0) {
|
|
|
693
694
|
i.push(o);
|
|
694
695
|
}
|
|
695
696
|
const r = (a) => {
|
|
696
|
-
|
|
697
|
+
W(
|
|
697
698
|
e,
|
|
698
699
|
i[a],
|
|
699
700
|
() => {
|
|
@@ -706,7 +707,7 @@ async function X(e, t, s = void 0, n = void 0) {
|
|
|
706
707
|
};
|
|
707
708
|
r(0);
|
|
708
709
|
}
|
|
709
|
-
function
|
|
710
|
+
function W(e, t, s = void 0, n = void 0, i = void 0) {
|
|
710
711
|
const c = [];
|
|
711
712
|
t.forEach((o) => {
|
|
712
713
|
c.push({
|
|
@@ -971,12 +972,13 @@ function Re(e, t, s, n = void 0, i = void 0) {
|
|
|
971
972
|
});
|
|
972
973
|
}
|
|
973
974
|
//!SECTION
|
|
974
|
-
function
|
|
975
|
+
async function w(e, t = void 0, s = void 0) {
|
|
975
976
|
const n = e.space + "/api/index/tk";
|
|
976
|
-
f(n, {
|
|
977
|
+
return console.log("_3DSwym_get_version", n, e), f(n, {
|
|
977
978
|
onComplete(i, c, r) {
|
|
978
979
|
const a = JSON.parse(i);
|
|
979
|
-
|
|
980
|
+
if (t)
|
|
981
|
+
return t(a), e.token = a?.result?.ServerToken;
|
|
980
982
|
},
|
|
981
983
|
onFailure(i) {
|
|
982
984
|
s && s(i);
|
|
@@ -994,7 +996,7 @@ function ve(e, t = void 0, s = void 0) {
|
|
|
994
996
|
start: 0
|
|
995
997
|
}
|
|
996
998
|
};
|
|
997
|
-
|
|
999
|
+
w(e, (c) => {
|
|
998
1000
|
f(n, {
|
|
999
1001
|
method: "POST",
|
|
1000
1002
|
headers: {
|
|
@@ -1023,7 +1025,7 @@ function je(e, t = void 0, s = void 0) {
|
|
|
1023
1025
|
maxNbOfCommonElements: "5"
|
|
1024
1026
|
}
|
|
1025
1027
|
};
|
|
1026
|
-
|
|
1028
|
+
w(e, (c) => {
|
|
1027
1029
|
f(n, {
|
|
1028
1030
|
method: "POST",
|
|
1029
1031
|
headers: {
|
|
@@ -1043,9 +1045,9 @@ function je(e, t = void 0, s = void 0) {
|
|
|
1043
1045
|
});
|
|
1044
1046
|
});
|
|
1045
1047
|
}
|
|
1046
|
-
function
|
|
1048
|
+
function Y(e, t = void 0, s = void 0) {
|
|
1047
1049
|
const n = e.space + "/api/user/getcurrent/";
|
|
1048
|
-
|
|
1050
|
+
w(
|
|
1049
1051
|
e,
|
|
1050
1052
|
(i) => {
|
|
1051
1053
|
f(n, {
|
|
@@ -1065,7 +1067,7 @@ function B(e, t = void 0, s = void 0) {
|
|
|
1065
1067
|
}
|
|
1066
1068
|
function Ie(e, t, s = void 0, n = void 0) {
|
|
1067
1069
|
const i = e.space + "/api/user/find/login/" + t;
|
|
1068
|
-
|
|
1070
|
+
w(
|
|
1069
1071
|
e,
|
|
1070
1072
|
(c) => {
|
|
1071
1073
|
f(i, {
|
|
@@ -1111,7 +1113,7 @@ function Pe(e, t = void 0, s = void 0) {
|
|
|
1111
1113
|
(o) => {
|
|
1112
1114
|
console.log("on Error CTX =>", o);
|
|
1113
1115
|
}
|
|
1114
|
-
),
|
|
1116
|
+
), Y(
|
|
1115
1117
|
e,
|
|
1116
1118
|
(o) => {
|
|
1117
1119
|
t && t({ reponse: o, activeSpace: a, credentials: e });
|
|
@@ -1197,7 +1199,7 @@ function Je(e, t, s, n = void 0, i = void 0) {
|
|
|
1197
1199
|
s,
|
|
1198
1200
|
(r) => {
|
|
1199
1201
|
const a = r.data[0].relateddata.files[0].id, o = r.data[0].dataelements.secondaryTitle !== "" ? r.data[0].dataelements.secondaryTitle : r.data[0].dataelements.title;
|
|
1200
|
-
|
|
1202
|
+
K(
|
|
1201
1203
|
e,
|
|
1202
1204
|
s,
|
|
1203
1205
|
a,
|
|
@@ -1238,7 +1240,7 @@ async function Ke(e, t = void 0, s = void 0) {
|
|
|
1238
1240
|
e,
|
|
1239
1241
|
(n) => {
|
|
1240
1242
|
const i = {};
|
|
1241
|
-
i.obj = n,
|
|
1243
|
+
i.obj = n, B(
|
|
1242
1244
|
e,
|
|
1243
1245
|
(c) => {
|
|
1244
1246
|
i.datas = c, t && t(i);
|
|
@@ -1253,14 +1255,14 @@ async function Ke(e, t = void 0, s = void 0) {
|
|
|
1253
1255
|
}
|
|
1254
1256
|
);
|
|
1255
1257
|
}
|
|
1256
|
-
function
|
|
1258
|
+
function B(e, t = void 0, s = void 0) {
|
|
1257
1259
|
const n = [];
|
|
1258
1260
|
e.objIds.forEach((i, c) => {
|
|
1259
1261
|
I(
|
|
1260
1262
|
e,
|
|
1261
1263
|
i.objId,
|
|
1262
1264
|
(r) => {
|
|
1263
|
-
n.push({ [i.name]: r }), i.name === "dbProjets" && (P = r.affaires.map((a) => a.objectID),
|
|
1265
|
+
n.push({ [i.name]: r }), i.name === "dbProjets" && (P = r.affaires.map((a) => a.objectID), z(e, x)), c === e.objIds.length - 1 && t && t(n);
|
|
1264
1266
|
},
|
|
1265
1267
|
(r) => {
|
|
1266
1268
|
s && s(r);
|
|
@@ -1268,7 +1270,7 @@ function z(e, t = void 0, s = void 0) {
|
|
|
1268
1270
|
);
|
|
1269
1271
|
});
|
|
1270
1272
|
}
|
|
1271
|
-
function
|
|
1273
|
+
function z(e, t, s = void 0, n = void 0) {
|
|
1272
1274
|
X(
|
|
1273
1275
|
e,
|
|
1274
1276
|
P,
|
|
@@ -1281,7 +1283,7 @@ function H(e, t, s = void 0, n = void 0) {
|
|
|
1281
1283
|
}
|
|
1282
1284
|
);
|
|
1283
1285
|
}
|
|
1284
|
-
const
|
|
1286
|
+
const H = "FA35FB9B177A280065800EA0000F599C", q = [
|
|
1285
1287
|
"swym",
|
|
1286
1288
|
"3dspace",
|
|
1287
1289
|
"drive",
|
|
@@ -1295,8 +1297,8 @@ const q = "FA35FB9B177A280065800EA0000F599C", Q = [
|
|
|
1295
1297
|
where: "ds6w:where",
|
|
1296
1298
|
who: "ds6w:who",
|
|
1297
1299
|
why: "ds6w:why"
|
|
1298
|
-
},
|
|
1299
|
-
objId:
|
|
1300
|
+
}, Q = {
|
|
1301
|
+
objId: H,
|
|
1300
1302
|
pred: "who",
|
|
1301
1303
|
order_by: "desc",
|
|
1302
1304
|
tag: "testTag"
|
|
@@ -1332,12 +1334,12 @@ function Ve(e, t, s = void 0, n = void 0) {
|
|
|
1332
1334
|
JSON.parse(u);
|
|
1333
1335
|
const m = {};
|
|
1334
1336
|
setTimeout(() => {
|
|
1335
|
-
|
|
1337
|
+
G(
|
|
1336
1338
|
e,
|
|
1337
1339
|
r,
|
|
1338
1340
|
(g) => {
|
|
1339
1341
|
const h = g.data[0].dataelements.title, S = g.data[0].dataelements.fileExtension !== void 0 ? g.data[0].dataelements.fileExtension : "", y = g.data[0].relateddata.ownerInfo[0].dataelements.name;
|
|
1340
|
-
m.name = h, m.ext = S, m.createBy = y, t.info = { ...m },
|
|
1342
|
+
m.name = h, m.ext = S, m.createBy = y, t.info = { ...m }, Z(
|
|
1341
1343
|
e,
|
|
1342
1344
|
t,
|
|
1343
1345
|
(_) => {
|
|
@@ -1361,7 +1363,7 @@ function Ve(e, t, s = void 0, n = void 0) {
|
|
|
1361
1363
|
}
|
|
1362
1364
|
});
|
|
1363
1365
|
}
|
|
1364
|
-
function
|
|
1366
|
+
function Z(e, t, s = void 0, n = void 0) {
|
|
1365
1367
|
console.log("obj ", t);
|
|
1366
1368
|
const i = t.info.name, c = {
|
|
1367
1369
|
baseUrl: `https://${e.tenant.toLowerCase()}-eu1-fedsearch.3dexperience.3ds.com`,
|
|
@@ -1411,7 +1413,7 @@ function ee(e, t, s = void 0, n = void 0) {
|
|
|
1411
1413
|
}
|
|
1412
1414
|
},
|
|
1413
1415
|
select_exclude_synthesis: ["ds6w:what/ds6w:topic"],
|
|
1414
|
-
order_by:
|
|
1416
|
+
order_by: Q.order_by,
|
|
1415
1417
|
order_field: "relevance",
|
|
1416
1418
|
select_snippets: [
|
|
1417
1419
|
"ds6w:snippet",
|
|
@@ -1422,7 +1424,7 @@ function ee(e, t, s = void 0, n = void 0) {
|
|
|
1422
1424
|
],
|
|
1423
1425
|
nresults: 40,
|
|
1424
1426
|
start: "0",
|
|
1425
|
-
source:
|
|
1427
|
+
source: q,
|
|
1426
1428
|
tenant: e.tenant,
|
|
1427
1429
|
login: {
|
|
1428
1430
|
"3dspace": {
|
|
@@ -1444,7 +1446,7 @@ function ee(e, t, s = void 0, n = void 0) {
|
|
|
1444
1446
|
}
|
|
1445
1447
|
});
|
|
1446
1448
|
}
|
|
1447
|
-
function
|
|
1449
|
+
function Xe(e, t, s = void 0, n = void 0) {
|
|
1448
1450
|
const { objId: i, pred: c, tag: r } = t, a = {
|
|
1449
1451
|
uri: "/resources/6w/tags",
|
|
1450
1452
|
otpCTX: "SecurityContext=preferred",
|
|
@@ -1480,7 +1482,7 @@ function We(e, t, s = void 0, n = void 0) {
|
|
|
1480
1482
|
}
|
|
1481
1483
|
});
|
|
1482
1484
|
}
|
|
1483
|
-
function
|
|
1485
|
+
function We(e, t = "", s = void 0, n = void 0) {
|
|
1484
1486
|
const { space: i } = e;
|
|
1485
1487
|
if (t === "")
|
|
1486
1488
|
return;
|
|
@@ -1510,7 +1512,7 @@ function Ye(e, t = void 0, s = void 0) {
|
|
|
1510
1512
|
limit: `/limit/${e.limit ? e.limit : 128}`,
|
|
1511
1513
|
page: `/page/${e.page ? e.page : "1"}`
|
|
1512
1514
|
}, i = `${n.base}${n.uri}${n.limit}${n.page}`, c = [];
|
|
1513
|
-
|
|
1515
|
+
w(e, (r) => {
|
|
1514
1516
|
f(i, {
|
|
1515
1517
|
method: "GET",
|
|
1516
1518
|
headers: {
|
|
@@ -1528,7 +1530,7 @@ function Ye(e, t = void 0, s = void 0) {
|
|
|
1528
1530
|
role: m.role,
|
|
1529
1531
|
access: m.access
|
|
1530
1532
|
};
|
|
1531
|
-
|
|
1533
|
+
ee(
|
|
1532
1534
|
e,
|
|
1533
1535
|
m.id,
|
|
1534
1536
|
(h) => {
|
|
@@ -1545,7 +1547,7 @@ function Ye(e, t = void 0, s = void 0) {
|
|
|
1545
1547
|
});
|
|
1546
1548
|
});
|
|
1547
1549
|
}
|
|
1548
|
-
function
|
|
1550
|
+
function ee(e, t, s, n) {
|
|
1549
1551
|
const i = `${e.space}/api/community/listmembers`, c = {
|
|
1550
1552
|
params: {
|
|
1551
1553
|
page: e.page ? e.page : 1,
|
|
@@ -1553,7 +1555,7 @@ function te(e, t, s, n) {
|
|
|
1553
1555
|
community_id: t
|
|
1554
1556
|
}
|
|
1555
1557
|
};
|
|
1556
|
-
|
|
1558
|
+
w(e, (r) => {
|
|
1557
1559
|
f(i, {
|
|
1558
1560
|
method: "POST",
|
|
1559
1561
|
headers: {
|
|
@@ -1577,7 +1579,7 @@ function Be(e, t = void 0, s = void 0) {
|
|
|
1577
1579
|
const n = "YXdA5x4DSUKtlAi2wmnyTA";
|
|
1578
1580
|
e.commu_id || (e.commu_id = n);
|
|
1579
1581
|
const i = `${e.space}/api/v2/communities/${e.commu_id}/ideas/statuses`;
|
|
1580
|
-
|
|
1582
|
+
w(e, (c) => {
|
|
1581
1583
|
f(i, {
|
|
1582
1584
|
method: "GET",
|
|
1583
1585
|
headers: {
|
|
@@ -1605,10 +1607,10 @@ function ze(e, t, s = void 0, n = void 0) {
|
|
|
1605
1607
|
id_msg: "",
|
|
1606
1608
|
senderId: e.currentUser.login,
|
|
1607
1609
|
senderName: `${e.currentUser.first_name} ${e.currentUser.last_name}`,
|
|
1608
|
-
msg:
|
|
1610
|
+
msg: ne(t.msg)
|
|
1609
1611
|
};
|
|
1610
1612
|
let d = !1;
|
|
1611
|
-
|
|
1613
|
+
te(
|
|
1612
1614
|
a.users,
|
|
1613
1615
|
(l) => {
|
|
1614
1616
|
l !== void 0 && (o.id_msg = l.id, d = !0, R(e, o));
|
|
@@ -1617,7 +1619,7 @@ function ze(e, t, s = void 0, n = void 0) {
|
|
|
1617
1619
|
d = !1, console.log("_3dSwym_findCommunityToInstantMSG callback", l), n && n(l), o.id_msg = "";
|
|
1618
1620
|
}
|
|
1619
1621
|
), d === !1 && setTimeout(() => {
|
|
1620
|
-
d === !1 &&
|
|
1622
|
+
d === !1 && w(e, (l) => {
|
|
1621
1623
|
f(r, {
|
|
1622
1624
|
method: "POST",
|
|
1623
1625
|
headers: {
|
|
@@ -1639,9 +1641,9 @@ function ze(e, t, s = void 0, n = void 0) {
|
|
|
1639
1641
|
});
|
|
1640
1642
|
}, 500);
|
|
1641
1643
|
}
|
|
1642
|
-
function
|
|
1644
|
+
function te(e, t, s, n) {
|
|
1643
1645
|
const i = `${e.space}/api/directmessages/lite?with_favorites=false`;
|
|
1644
|
-
|
|
1646
|
+
w(e, (c) => {
|
|
1645
1647
|
f(i, {
|
|
1646
1648
|
method: "GET",
|
|
1647
1649
|
headers: {
|
|
@@ -1684,7 +1686,7 @@ function R(e, t, s = void 0, n = void 0) {
|
|
|
1684
1686
|
parentCommentUri: null,
|
|
1685
1687
|
richMessage: t.msg
|
|
1686
1688
|
};
|
|
1687
|
-
console.log("_3dSwym_sendDirectMessageData url ", c),
|
|
1689
|
+
console.log("_3dSwym_sendDirectMessageData url ", c), w(e, (a) => {
|
|
1688
1690
|
f(c, {
|
|
1689
1691
|
method: "POST",
|
|
1690
1692
|
headers: {
|
|
@@ -1705,14 +1707,14 @@ function R(e, t, s = void 0, n = void 0) {
|
|
|
1705
1707
|
});
|
|
1706
1708
|
});
|
|
1707
1709
|
}
|
|
1708
|
-
function
|
|
1710
|
+
function ne(e) {
|
|
1709
1711
|
const t = (/* @__PURE__ */ new Date()).toLocaleDateString(), s = (/* @__PURE__ */ new Date()).toLocaleTimeString();
|
|
1710
1712
|
return `<p>${e} </p>
|
|
1711
1713
|
<br/>
|
|
1712
1714
|
<hr/>
|
|
1713
1715
|
<p><u>envoyer :</u>Le <b>${t} à ${s}</b></p>`;
|
|
1714
1716
|
}
|
|
1715
|
-
const
|
|
1717
|
+
const se = {
|
|
1716
1718
|
title: "TEST DEV COMMUNITY IDEA",
|
|
1717
1719
|
// titre du post
|
|
1718
1720
|
community_id: "YXdA5x4DSUKtlAi2wmnyTA",
|
|
@@ -1733,13 +1735,13 @@ function He(e, t, s = void 0, n = void 0) {
|
|
|
1733
1735
|
// String, le nom de l'affaire
|
|
1734
1736
|
community_id: c?.id !== void 0 ? c.id : r.id,
|
|
1735
1737
|
// String, l'id de la communauté
|
|
1736
|
-
message:
|
|
1738
|
+
message: ae(t.text_html),
|
|
1737
1739
|
// STRING => le contenue du message doit être au format HTML
|
|
1738
1740
|
published: 1
|
|
1739
1741
|
// 1 publier, 0 non publier
|
|
1740
1742
|
}
|
|
1741
1743
|
};
|
|
1742
|
-
|
|
1744
|
+
w(e, (o) => {
|
|
1743
1745
|
const d = {
|
|
1744
1746
|
"Content-type": "application/json;charset=UTF-8",
|
|
1745
1747
|
Accept: "application/json",
|
|
@@ -1768,7 +1770,7 @@ function qe(e, t, s = void 0, n = void 0) {
|
|
|
1768
1770
|
ideationIds: [t.idee_id]
|
|
1769
1771
|
}
|
|
1770
1772
|
};
|
|
1771
|
-
|
|
1773
|
+
w(e, (r) => {
|
|
1772
1774
|
f(i, {
|
|
1773
1775
|
method: "POST",
|
|
1774
1776
|
headers: {
|
|
@@ -1796,7 +1798,7 @@ function Qe(e, t = "", s = void 0, n = void 0) {
|
|
|
1796
1798
|
id: t
|
|
1797
1799
|
}
|
|
1798
1800
|
};
|
|
1799
|
-
|
|
1801
|
+
w(e, (a) => {
|
|
1800
1802
|
f(c, {
|
|
1801
1803
|
method: "POST",
|
|
1802
1804
|
headers: {
|
|
@@ -1817,13 +1819,13 @@ function Qe(e, t = "", s = void 0, n = void 0) {
|
|
|
1817
1819
|
});
|
|
1818
1820
|
});
|
|
1819
1821
|
}
|
|
1820
|
-
function Ze(e, t =
|
|
1822
|
+
function Ze(e, t = se, s = void 0, n = void 0) {
|
|
1821
1823
|
const i = {
|
|
1822
1824
|
uri: "/api/idea/list",
|
|
1823
1825
|
comId: `/community_id/${e.tenant.toLowerCase() === "r1132101716373" ? t.community_id : "bgnIsG74SUWswyGzS6NC6g"}`,
|
|
1824
1826
|
limit: `/limit/${t.limit ? t.limit : 10}`
|
|
1825
1827
|
}, c = `${e.space}${i.uri}${i.comId}${i.limit}`;
|
|
1826
|
-
|
|
1828
|
+
w(e, (r) => {
|
|
1827
1829
|
f(c, {
|
|
1828
1830
|
method: "GET",
|
|
1829
1831
|
headers: {
|
|
@@ -1840,7 +1842,7 @@ function Ze(e, t = ae, s = void 0, n = void 0) {
|
|
|
1840
1842
|
});
|
|
1841
1843
|
});
|
|
1842
1844
|
}
|
|
1843
|
-
function
|
|
1845
|
+
function ae(e) {
|
|
1844
1846
|
return !e || e === "" ? `<h2><u>INFORMATIONS AFFAIRE :</u></h2>
|
|
1845
1847
|
<p><u>|⚠️<em> Merci de respecter l'écriture des tags, en MAJUSCULES, nom complet, pas de caractères</em></u></p>
|
|
1846
1848
|
<p><u><em>|spéciaux, séparation par "_" si besoin !</em></u></p>
|
|
@@ -1925,13 +1927,13 @@ export {
|
|
|
1925
1927
|
C as _3DSpace_csrf,
|
|
1926
1928
|
I as _3DSpace_download_doc,
|
|
1927
1929
|
X as _3DSpace_download_multidoc,
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
+
K as _3DSpace_file_update,
|
|
1931
|
+
V as _3DSpace_file_update_csr,
|
|
1930
1932
|
A as _3DSpace_file_url,
|
|
1931
1933
|
ke as _3DSpace_file_url_csr,
|
|
1932
1934
|
k as _3DSpace_get_csrf,
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
+
G as _3DSpace_get_docInfo,
|
|
1936
|
+
W as _3DSpace_get_downloadTicket_multidoc,
|
|
1935
1937
|
N as _3DSpace_get_securityContexts,
|
|
1936
1938
|
Re as _3DSpace_lifecycle_changeRevision,
|
|
1937
1939
|
$e as _3DSpace_lifecycle_changeState,
|
|
@@ -1939,54 +1941,54 @@ export {
|
|
|
1939
1941
|
De as _3DSpace_lifecycle_getNextRevision,
|
|
1940
1942
|
Ue as _3DSpace_lifecycle_getNextStates,
|
|
1941
1943
|
Ye as _3DSwim_getAllCommunities,
|
|
1942
|
-
|
|
1944
|
+
ee as _3DSwim_getMembersCommunity,
|
|
1943
1945
|
ze as _3DSwym_buildDirectMessage,
|
|
1944
1946
|
qe as _3DSwym_deleteIdea,
|
|
1945
|
-
|
|
1947
|
+
te as _3DSwym_findCommunityToInstantMSG,
|
|
1946
1948
|
ve as _3DSwym_getAllNews,
|
|
1947
1949
|
je as _3DSwym_getFamiliarPeople,
|
|
1948
1950
|
Be as _3DSwym_getIdeaStatusMaturity,
|
|
1949
1951
|
Qe as _3DSwym_getSWYMIdea,
|
|
1950
1952
|
Ze as _3DSwym_get_AllSWYMIdeas,
|
|
1951
|
-
|
|
1953
|
+
Y as _3DSwym_get_currentUser,
|
|
1952
1954
|
Ie as _3DSwym_get_findUser,
|
|
1953
|
-
|
|
1955
|
+
w as _3DSwym_get_version,
|
|
1954
1956
|
He as _3DSwym_postIdea,
|
|
1955
1957
|
R as _3DSwym_sendMessageData,
|
|
1956
1958
|
ye as _AppMngt_get_info_user,
|
|
1957
1959
|
Se as _AppMngt_get_users,
|
|
1958
|
-
|
|
1960
|
+
ge as _getPlateformInfos,
|
|
1959
1961
|
j as _getPlatformServices,
|
|
1960
1962
|
f as _httpCallAuthenticated,
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1963
|
+
ue as _setDraggable,
|
|
1964
|
+
me as _setDroppable,
|
|
1965
|
+
fe as _setupTagger,
|
|
1964
1966
|
Ve as addTagToDoc,
|
|
1965
1967
|
he as compass_getListAdditionalApps,
|
|
1966
1968
|
E as couleurs,
|
|
1967
1969
|
_e as createUserGroups,
|
|
1968
|
-
|
|
1970
|
+
z as dataMixing,
|
|
1969
1971
|
Ce as deleteUserGroups,
|
|
1970
|
-
|
|
1972
|
+
de as findAdresse,
|
|
1971
1973
|
Pe as getActiveServices,
|
|
1972
1974
|
Me as getAllContextSecurity,
|
|
1973
1975
|
xe as getCSRFToken,
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
+
ce as getCommunes,
|
|
1977
|
+
we as getComplementUG,
|
|
1976
1978
|
Le as getDataFrom3DSpace,
|
|
1977
|
-
|
|
1979
|
+
le as getDataFromGouvFr,
|
|
1978
1980
|
Ke as getDatasByTenant,
|
|
1979
|
-
|
|
1981
|
+
B as getDatasFrom3DSpace,
|
|
1980
1982
|
Ee as getDownloadDocument,
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1983
|
+
We as getInfoDocTags,
|
|
1984
|
+
Te as getUserGroupsList,
|
|
1985
|
+
J as getUsersGroupRules,
|
|
1984
1986
|
Ge as get_3DSpace_csrf,
|
|
1985
1987
|
Oe as patchUserGroups,
|
|
1986
1988
|
Ne as patchUserGroupsControl,
|
|
1987
1989
|
Je as pushDataIn3DSpace,
|
|
1988
1990
|
be as readUserGroupControl,
|
|
1989
|
-
|
|
1991
|
+
Xe as removeTagToDoc,
|
|
1990
1992
|
et as sayHello,
|
|
1991
|
-
|
|
1993
|
+
pe as updateEvent
|
|
1992
1994
|
};
|
package/dist/wb3Api.umd.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
(function(u,b){typeof exports=="object"&&typeof module<"u"?b(exports,require("uuid"),require("luxon"),require("@widget-lab/3ddashboard-utils")):typeof define=="function"&&define.amd?define(["exports","uuid","luxon","@widget-lab/3ddashboard-utils"],b):(u=typeof globalThis<"u"?globalThis:u||self,b(u["@beam3_dev/api_module"]={},u.uuid,u.luxon,u["@widget-lab/3ddashboard-utils"]))})(this,function(u,b,U,C){"use strict";function A(){return b.v4()}const M={b3M3Yellow:"#FFB300",b3AboutageBlue:"#42A5F5",b3UsinageGreen:"#689F38",b3PanneauOrange:"#ff8000",b3M350percent:"#fafa6e",b3M380percent:"#aae479",b3M390percent:"#64c987",b3M3100percent:"#23aa8f",b3M3105percent:"#00898a",b3M3110percent:"#176877",b3M3120percent:"#2a4858",b3Aboutage50percent:"#fafa6e",b3Aboutage80percent:"#aae479",b3Aboutage90percent:"#64c987",b3Aboutage100percent:"#23aa8f",b3Aboutage105percent:"#00898a",b3Aboutage110percent:"#176877",b3Aboutage120percent:"#2a4858",b3Warning:"#FF0000",b3Edit1:"#AD1457",b3Edit2:"#F4511E",b3Edit3:"#009688",b3Edit4:"#D50000",b3Edit5:"#039BE5",b3Edit6:"#9E69AF",b3Edit7:"#A79B8E",b3Edit8:"#616161",b3Edit9:"#795548"};async function Z(e,t=void 0,s=void 0){const n=parseInt(e);await fetch("https://apicarto.ign.fr/api/codes-postaux/communes/"+n,{method:"GET",headers:{Accept:"application/json"}}).then(i=>i.json()).then(i=>{t&&t(i)}).catch(i=>{s&&s(i),console.error("Erreur : "+i)})}async function ee(e,t=void 0,s=void 0){e=encodeURIComponent(e),await fetch("https://api-adresse.data.gouv.fr/search/?q="+e+"&limit=15",{method:"GET",headers:{Accept:"application/json"}}).then(n=>n.json()).then(n=>{t&&t(n)}).catch(n=>{s&&s(n),console.error("Erreur : "+n)})}async function te(e,t=M){let s=U.DateTime.now().year;const n=e,i=[],c=a=>{for(let o in a)i.push({date:o,comment:a[o]})};for(let a=s;a<=s+1;a++)await fetch("https://calendrier.api.gouv.fr/jours-feries/metropole/"+a+".json",{method:"GET",headers:{Accept:"application/json"}}).then(o=>o.json()).then(o=>{c(o)}).catch(o=>console.error("Erreur : "+o));return(()=>{const a=n.length===0?{events:[]}:n;for(let o of i)a.events.findIndex(l=>l.start===U.DateTime.fromISO(o.date).toISODate()&&l.name==="Férié : "+o.comment)===-1&&a.events.push({name:"Férié : "+o.comment,start:U.DateTime.fromISO(o.date).toISODate(),end:U.DateTime.fromISO(o.date).toISODate(),color:t.b3BusinnessDays,timed:!1});return a})()}async function ne(e,t,s=!0){const n=e.events.findIndex(i=>i.uuid===t.uuid);return n===-1?e.events.push(t):s?e.events[n]=t:e.events.splice(n,1),e.length>0&&e.sort((i,c)=>i.start-c.start),e}function m(e,t){C.requirejs(["DS/WAFData/WAFData"],s=>{s.authenticatedRequest(e,t)})}function se(e,t,s){C.requirejs(["DS/DataDragAndDrop/DataDragAndDrop"],n=>{n.draggable(e,{data:t,start:s})})}function ae(e,t=void 0){C.requirejs(["DS/TagNavigatorProxy/TagNavigatorProxy"],s=>{let n;n===void 0&&(n=s.createProxy({widgetId:C.widget.id,filteringMode:"WithFilteringServices"}),t!==void 0&&n.addEvent("onFilterSubjectsChange",t)),n.setSubjectsTags(e)})}function ie(e,t){C.requirejs(["DS/DataDragAndDrop/DataDragAndDrop"],s=>{s.droppable(e,{drop:t})})}function $(e,t=void 0,s=void 0){C.requirejs(["DS/i3DXCompassServices/i3DXCompassServices"],n=>{(!e||e==="")&&(e=C.widget.getValue("PlatFormInstanceId")),(!e||e==="")&&(e=void 0),n.getPlatformServices({platformId:e,onComplete:t,onFailure:s})}),t&&t(P())}function P(){let e={};return C.requirejs(["DS/PlatformAPI/PlatformAPI"],t=>{const s=t.getTenant(),n=t.getUser(),i=t.getAllApplicationConfigurations(),c=t.getWidgetTenant(),r=t.getApplicationConfiguration("com.3ds.wp.passport.cors");e={tenant:s,user:n,appsConfiguration:i,widgetTenant:c,appConf:r}}),console.log("%cRETOUR API :","color:blue",e),e}function oe(e,t,s){const n={base:`${e.space}`,uri:"/resources/AppsMngt/api/custom/applications",option:`?filter=${e.tenant}`},i=`${n.base}${n.uri}${n.option}`;m(i,{method:"GET",headers:{"Content-Type":"application/json",Accept:"application/json"},onComplete(c,r,a){const o=JSON.parse(c),d=o.data.map(l=>{const p=l.attributes.name,f=l.id;return{name:p,id:f}});t&&t(d,o)},onFailure(c,r){const a=c;a.msg=r.errormsg,a.errCode=r.errorcode,s&&s(a)}})}function re(e,t=void 0,s=void 0){let n=`${e.space}/resources/AppsMngt/user?platform=${e.tenant}&limit=-1`;m(n,{onComplete(i,c,r){const a=JSON.parse(i);console.log("_AppMngt_get_users => ",a),t&&t(a)},onFailure(i,c){const r=i;r.msg=c.errormsg,r.errCode=c.errorcode,s&&s(r)}})}function ce(e,t,s=void 0,n=void 0){let i=`${e.space}/resources/AppsMngt/user?platform=${e.tenant}&id=${t}`;m(i,{onComplete(c,r,a){const o=JSON.parse(c);s&&s(o)},onFailure(c,r){const a=c;a.msg=r.errormsg,a.errCode=r.errorcode,n&&n(a)}})}const v={"Content-Type":"application/json",Accept:"application/json,text/javascript,*/*"};function de(e,t,s=void 0,n=void 0){const{space:i,currentUser:c}=e,a=`${i}${{URIUGr:"/3drdfpersist/resources/v1/usersgroup"}.URIUGr}`,o={groups:[{title:t.title,description:t.description,members:t.members||[c.email,"samuel.mureau@beam3.fr"],pending_members:[],sharing:t.sharing,visibility:t.visibility}]};m(a,{method:"POST",headers:v,data:JSON.stringify(o),onComplete(d){s&&s(JSON.parse(d))},onFailure(d,l){console.log(d);const p=d;p.msg=l.errormsg,p.errCode=l.errorcode,console.log("❌ sendDirectMessage => ",p),n&&n(p)}})}function le(e,t,s=void 0,n=void 0){const{space:i,tenant:c}=e,r=i,a=`/3drdfpersist/v1/resources/${t}`,o=`?$mask=dsaccess:Mask.GroupUI.Properties&tenant=dstenant:${c}`,d=`${r}${a}${o}`;m(d,{opts:{method:"GET",headers:{"Content-Type":"application/json",Accept:"application/json,text/javascript,*/*"}},onComplete(f){s&&s(JSON.parse(f))},onFailure(f,g){const _=f;_.msg=g.errormsg,_.errCode=g.errorcode,n&&n(_)}})}function L(e,t=void 0,s=void 0){const{space:n,tenant:i}=e,c=n,r="/3drdfpersist/resources/v1/option-sets/dsusergroup:ListOfGroupResponsibilities/options",a=`?tenant=dstenant:${i}`,o={method:"GET",Accept:"application/json,*/*,test/javascript"},d=`${c}${r}${a}`;m(d,{OPTsH:o,onComplete(l){t&&t(JSON.parse(l))},onFailure(l,p){const f=l;f.msg=p.errormsg,f.errCode=p.errorcode,s&&s(f)}})}function ue(e,t=void 0,s=void 0){const{space:n,currentUser:i}=e,a=`${n}/3drdfpersist/resources/v1/usersgroup?select=uri,title,description,owner,members,pending_members,creation_date,modification_date,visibility`,d={method:"GET",headers:{"Content-Type":"application/json",Accept:"application/json,text/javascript,*/*"}};try{m(a,{opts:d,onComplete(l){const p=JSON.parse(l),f={},g=p.groups.filter(_=>_.uri.startsWith("uuid:"));if(i&&Object.keys(i).length>0){const _=g.filter(y=>y.owner===i.email),S=g.filter(y=>y.members.includes(i.email)),h=_.concat(S);f.iam=h,f.UG=g,f.iamMember=S,L(e,y=>{f.rules=y,t&&t(f)},y=>{s&&s(y)})}},onFailure(l){s&&s(l)}})}catch(l){console.log(l)}}function pe(e,t){const{space:s}=e,i=`${s}/3drdfpersist/resources/v1/usersgroup/${t}`;m(i,{method:"DELETE"})}function fe(e,t,s,n=void 0,i=void 0){const{space:c,tenant:r}=e,a={URITI:"/3drdfpersist/resources/v1/template-instances",URIUGr:"/3drdfpersist/resources/v1/usersgroup",nextURICh:"/characteristics",nextURIGr:"/group",nexURImem:"/members",OPTsTI:"?$mask=dsaccess:Mask.GroupUI.Properties",OPTsTenant:`tenant=dstenant:${r}`},o=s,d=`${c}${a.URIUGr}/${t}`,l=JSON.stringify(o);m(d,{headers:v,method:"PATCH",data:l,type:"json",onComplete(p){n&&n(p)},onFailure(p){i&&i(p)}})}function me(e,t,s,n=void 0,i=void 0){const{space:c}=e,a=`${c}/3drdfpersist/resources/v1/usersgroup/${t}/sharing`;m(a,{method:"PATCH",headers:v,data:JSON.stringify(s),type:"json",onComplete(d){n&&n(d)},onFailure(d){i&&i(d)}})}function ge(e,t,s=void 0,n=void 0){const{space:i}=e,r=`${i}/3drdfpersist/resources/v1/usersgroup/${t}/sharing`;m(r,{opts:{method:"GET",headers:{"Content-Type":"application/json",Accept:"application/json,text/javascript,*/*"}},onComplete(d){s&&s(JSON.parse(d))},onFailure(d){n&&n(d)}})}async function E(e,t=void 0,s=void 0,n=void 0){const i=e.space;if(t===void 0){console.log("Le paramètre docid est obligatoire");return}const c=i+`/resources/v1/modeler/documents/${t}`;m(c,{onComplete(r,a,o){const d=JSON.parse(r);s&&s(d)},onFailure(r){n&&n(r)}})}function F(e,t,s=void 0,n=void 0){if(t!==null){let i=`${e.space}/resources/v1/modeler/documents/${t}`;m(i,{onComplete(c,r,a){const o=JSON.parse(c);s&&s(o)},onFailure(c){n&&n(c)}})}else O(e)}function O(e,t=void 0,s=void 0){if(e.space){const n=e.space+"/resources/v1/application/CSRF";m(n,{onComplete(i,c,r){const a=JSON.parse(i);t&&t(a.csrf.value)},onFailure(i){s&&s(i)}})}else s&&s("ERROR : url du 3DSpace non défini.")}function k(e,t,s=void 0,n=void 0){let i=e.space+`/resources/v1/modeler/documents/${t}/files/DownloadTicket`;F(e,t,c=>{m(i,{method:"PUT",headers:{ENO_CSRF_TOKEN:c.csrf.value},onComplete(r){let a=JSON.parse(r);if(a.success===!0)try{const o=a.data[0].dataelements.ticketURL;s&&s(o)}catch(o){n&&n(o)}},onFailure(r,a){console.log("☠️ error => ",r,a),n&&n(r,a)}})},n)}function _e(e,t,s,n=void 0,i=void 0){const c=`${e.space}/resources/v1/modeler/documents/${t}/files/DownloadTicket`;m(c,{method:"PUT",headers:{ENO_CSRF_TOKEN:s},onComplete(r){let a=JSON.parse(r);if(a.success===!0)try{const o=a.data[0].dataelements.ticketURL;n&&n(o)}catch(o){i&&i(o)}},onFailure(r){i&&i(r)}})}function J(e,t,s,n,i,c=void 0,r=void 0){F(e,t,a=>{G(e,t,s,n,i,a.csrf.value,c,r)},r)}function G(e,t,s,n,i,c,r=void 0,a=void 0){const o=e.space+`/resources/v1/modeler/documents/${t}/files/CheckinTicket`;m(o,{method:"PUT",headers:{ENO_CSRF_TOKEN:c},onComplete(d,l,p){const f=JSON.parse(d).data[0].dataelements,g=new FormData;g.append("__fcs__jobTicket",f.ticket),g.append("file_0",n,i);const _={};_.method="POST",_.data=g,_.onComplete=function(S){let h="temp_"+Date.now(),y={method:"PUT",headers:{ENO_CSRF_TOKEN:c},data:JSON.stringify({data:[{id:t,relateddata:{files:[{id:s,dataelements:{title:i,receipt:S},updateAction:"REVISE"}]},tempId:h}]}),type:"json",onComplete(T){r&&r(T)},onFailure(T){a&&a(T)}};m(e.space+"/resources/v1/modeler/documents",y)},_.onFailure=function(S){a&&a(S)},_.timeout=0,m(f.ticketURL,_)}})}async function Se(e,t,s,n,i=void 0,c=void 0){const r=e.space,a=e.token,o=e.ctx,d=new FormData,l=new Blob([JSON.stringify(t)],{type:"text/plain"}),p={url_Ticket:`${r}/resources/v1/modeler/documents/files/CheckinTicket`,url_Post:`${r}/resources/v1/modeler/documents/?SecurityContext=ctx::${o}`};if(!r&&r!==""){console.log("le store._3DSpace est vide");return}m(p.url_Ticket,{method:"PUT",headers:{ENO_CSRF_TOKEN:a.value},onComplete(f,g,_){const S=JSON.parse(f).data[0].dataelements;d.append("__fcs__jobTicket",S.ticket),d.append("filename",l,s);const h={method:"POST",data:d,onComplete(N){if(o!==""&&a!==""){const j={method:"POST",headers:{ENO_CSRF_TOKEN:a,Accept:"application/json","Content-Type":"application/json"},data:JSON.stringify({data:[{type:"Document",dataelements:{title:`Title_${s.toLowerCase().split(" ").join("_")}`,policy:"Document Release",description:n},relateddata:{files:[{dataelements:{title:`${s}.json`,receipt:N}}]},tempId:A()}]}),type:"json",timeout:0,onComplete:y,onFailure:T};o!==""&&m(p.url_Post,j)}else console.warn("le store est vide")},onFailure:T};function y(N){console.log("Success -- response ",N.data[0]),i&&i(N)}function T(N,j){console.log("Erreur -- response ",N,`
|
|
2
|
-
headers `,j),c&&c(N)}m(S.ticketURL,h)}})}function
|
|
3
|
-
function w(e,t=void 0,s=void 0){const n=e.space+"/api/index/tk";m(n,{onComplete(i,c,r){const a=JSON.parse(i);t&&(e.token=a?.result?.ServerToken,t(a))},onFailure(i){s&&s(i)}})}function Oe(e,t=void 0,s=void 0){const n=`${e.space}/api/exalead/whatsnew`,i={params:{community_id:null,hash_key:null,legacyFormat:!1,nresults:1,query:"#all",start:0}};w(e,c=>{m(n,{method:"POST",headers:{"X-DS-SWYM-CSRFTOKEN":c.result.ServerToken,"Content-type":"application/json;charset=UTF-8",Accept:"application/json"},data:JSON.stringify(i),type:"json",onComplete(r,a){t&&t(r,a)},onFailure(r,a){s&&s(r,a)}})})}function De(e,t=void 0,s=void 0){const n=`${e.space}/api/Recommendation/getpeoplefamiliartocurrentuser`,i={params:{idsToFilterArr:[],mode:"offline",limit:30,itemType:"User",maxNbOfCommonElements:"5"}};w(e,c=>{m(n,{method:"POST",headers:{"X-DS-SWYM-CSRFTOKEN":c.result.ServerToken,"Content-type":"application/json;charset=UTF-8",Accept:"application/json"},data:JSON.stringify(i),type:"json",onComplete(r,a){const o=r.result.hits.map(d=>({login:d.login,fullName:d.name}));t&&t(o,r)},onFailure(r,a){s&&s(r,a)}})})}function V(e,t=void 0,s=void 0){const n=e.space+"/api/user/getcurrent/";w(e,i=>{m(n,{method:"GET",headers:{"X-DS-SWYM-CSRFTOKEN":i.result.ServerToken},onComplete(c,r,a){const o=JSON.parse(c);t&&t(o.result)},onFailure(c,r,a){s&&s({response:c,headers:r,xhr:a})}})},s)}function Ne(e,t,s=void 0,n=void 0){const i=e.space+"/api/user/find/login/"+t;w(e,c=>{m(i,{method:"GET",headers:{"X-DS-SWYM-CSRFTOKEN":c.result.ServerToken},onComplete(r,a,o){const d=JSON.parse(r);s&&s(d)},onFailure(r){n&&n(r)}})},n)}function be(e,t=void 0,s=void 0){$(null,n=>{let i=[],c=[],r,a={};for(let o of n)"3DSpace"in o&&(c.push({label:`${o.displayName} ( ${o.platformId} )`,value:`${c.length}`}),c.sort(),i.push(o));for(let[o,d]of i.entries())d.platformId===e.tenant&&(a=d,r=o);C.widget.addPreference({name:"_CurrentTenantID_",type:"list",label:"Tenant",defaultValue:r,options:c}),Object.keys(a).length>0,D(e,"ESPACE COMMUN",["VPLMProjectLeader","VPLMCreator"],void 0,o=>e.ctx=o,o=>{console.log("on Error CTX =>",o)}),V(e,o=>{t&&t({reponse:o,activeSpace:a,credentials:e})},o=>{s&&s(o)})},n=>{console.log("** _getPlatformServices Erreur **",n)})}async function Fe(e,t,s){const n=`${e.space}/resources/v1/application/CSRF`;m(n,{onComplete(i){i=JSON.parse(i),t&&t(i.csrf)},onFailure(i){s&&s(i)}})}function Ue(e,t=void 0,s=void 0){const n={base:`${e.space}`,uri:"/resources/bps/cspaces",optTenant:`tenant=${e.tenant}`},i=`${n.base}${n.uri}?${n.optTenant}`;m(i,{method:"GET",headers:{Accept:"application/json,text/javascript,*/*","Content-Type":"application/ds-json"},onComplete(c,r){const a=JSON.parse(c);t&&t(a,r)},onFailure(c,r,a){s&&s(c,r,a)}})}function ke(e,t,s,n){k(e.space,t,i=>{m(i,{header:{ENO_CSRF_TOKEN:e.token},onComplete:c=>{s&&s(c)},onFailure:c=>{console.log("error http",c),n&&n(c)}})},i=>{console.log("error file URL",i),n&&n(i)})}async function Ae(e,t,s=void 0,n=void 0){return new Promise(i=>{k(e.space,t,c=>{m(c,{onComplete:(r,a,o)=>(i(JSON.parse(r)),s&&s(JSON.parse(r),a,o),i),onFailure:(r,a,o)=>{n&&n(r,a,o),console.log(r,a?.errormsg)}})})})}function $e(e,t,s,n=void 0,i=void 0){const c=new Blob([JSON.stringify(t)],{type:"text/plain"});F(e,s,r=>{const a=r.data[0].relateddata.files[0].id,o=r.data[0].dataelements.secondaryTitle!==""?r.data[0].dataelements.secondaryTitle:r.data[0].dataelements.title;J(e,s,a,c,o,d=>{n&&n(d)},d=>{i&&i(d)})},r=>{console.log("En cas d'erreur nous avons :",r),alert("Erreur lors de la sauvegarde, Veuillez réessayez"),i&&i(r)})}let W,X;const Y=[];async function ve(e,t=void 0,s=void 0){console.log(`%c 3ds & objID ok ${e.space} et ${e.objID} *`,"color: green"),e.objID&&e.objID!==""?F(e.space,e.objID,n=>{t&&t(n.csrf.value)},n=>{s&&s(n)}):e.objID===null&&O(e)}async function Re(e,t=void 0,s=void 0){await R(e,n=>{const i={};i.obj=n,B(e,c=>{i.datas=c,t&&t(i)},c=>{s&&s(c)})},n=>{s&&s(n)})}function B(e,t=void 0,s=void 0){const n=[];e.objIds.forEach((i,c)=>{R(e,i.objId,r=>{n.push({[i.name]:r}),i.name==="dbProjets"&&(W=r.affaires.map(a=>a.objectID),q(e,X)),c===e.objIds.length-1&&t&&t(n)},r=>{s&&s(r)})})}function q(e,t,s=void 0,n=void 0){x(e,W,i=>{const c=[...t];c.find(r=>r.objectID===i.objectId).data=i.data,X=c,Y.push(i.data),s&&s(Y)},i=>{n&&(n(i),console.log(i))})}const Ie="FA35FB9B177A280065800EA0000F599C",je=["swym","3dspace","drive","usersgroup","3dplan","dashboard"],H={how:"ds6w:how",what:"ds6w:what",when:"ds6w:when",where:"ds6w:where",who:"ds6w:who",why:"ds6w:why"},Me={objId:Ie,pred:"who",order_by:"desc",tag:"testTag"};function Pe(e,t,s=void 0,n=void 0){const{space:i,tenant:c}=e,{objId:r,pred:a,tag:o}=t,d={uri:"/resources/6w/tags",otpCTX:"SecurityContext=preferred",optTenant:`tenant=${c}`},l=`${i}${d.uri}?${d.otpCTX}&${d.optTenant}`,p={tag:[{subject:[{uri:`pid://${r}`}],predicate:H[a],object:{literal:o}}]};m(l,{method:"PUT",headers:{"Content-Type":"application/json",Accept:"application/json"},data:JSON.stringify(p),onComplete(f){JSON.parse(f);const g={};setTimeout(()=>{E(e,r,_=>{const S=_.data[0].dataelements.title,h=_.data[0].dataelements.fileExtension!==void 0?_.data[0].dataelements.fileExtension:"",y=_.data[0].relateddata.ownerInfo[0].dataelements.name;g.name=S,g.ext=h,g.createBy=y,t.info={...g},Le(e,t,T=>{s&&s(T)},T=>{n&&n(T)})},(_,S)=>{const h=_;h.msg=S.errormsg,h.errCode=S.errorcode,console.log("❌ sendDirectMessage => ",h),n&&n(h)})},2e3)},onFailure(f,g){const _=f;_.msg=g.errormsg,_.errCode=g.errorcode,console.log("❌ sendDirectMessage => ",_),n&&n(_)}})}function Le(e,t,s=void 0,n=void 0){console.log("obj ",t);const i=t.info.name,c={baseUrl:`https://${e.tenant.toLowerCase()}-eu1-fedsearch.3dexperience.3ds.com`,uri:"/federated/search"},r=`${c.baseUrl}${c.uri}`,a={"Content-Type":"application/json",Accept:"application/json,text/javascript,*/*"},o=A(),d={with_indexing_date:!0,with_synthesis:!0,with_nls:!1,label:`3DSearch-${e.currentUser.username}-AjoutDeTagBeam-${o}`,locale:"fr",select_predicate:["ds6w:label","ds6w:type","ds6w:description","ds6w:identifier","ds6w:modified","ds6w:created","ds6wg:revision","ds6w:status","ds6w:responsible","owner","ds6w:responsibleUid","ds6wg:filesize","ds6w:project","ds6w:dataSource","ds6w:community","ds6w:originator","dsgeo:referential","ds6w:lastModifiedBy","ds6w:repository","dcterms:title","dcterms:description","ds6w:containerUid"],with_synthesis_hierarchical:!0,select_file:["icon","thumbnail_2d"],query:i,specific_source_parameter:{"3dspace":{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)'},drive:{additional_query:' AND NOT ([flattenedtaxonomies]:"types/DriveNode" AND ( [current]:"Trashed" OR [policy]:"Drive File Iteration") )'}},select_exclude_synthesis:["ds6w:what/ds6w:topic"],order_by:Me.order_by,order_field:"relevance",select_snippets:["ds6w:snippet","ds6w:label:snippet","ds6w:responsible:snippet","ds6w:community:snippet","swym:message_text:snippet"],nresults:40,start:"0",source:je,tenant:e.tenant,login:{"3dspace":{SecurityContext:e.ctx}}};console.log("dataPattern => ",d),m(r,{method:"POST",headers:a,data:JSON.stringify(d),onComplete(l){const p=JSON.parse(l);s(p)},onFailure(l,p){const f=l;f.msg=p.errormsg,f.errCode=p.errorcode,console.log("❌ sendDirectMessage => ",f),n&&n(f),console.log("Erreur de recuperation d'id du doc et des tags",l)}})}function Ee(e,t,s=void 0,n=void 0){const{objId:i,pred:c,tag:r}=t,a={uri:"/resources/6w/tags",otpCTX:"SecurityContext=preferred",optTenant:`tenant=${e.tenant}`},o=`${e.space}${a.uri}?${a.otpCTX}&${a.optTenant}`,d={tag:[{subject:[{uri:`pid://${i}`}],predicate:H[c],object:{literal:r}}]};m(o,{method:"DELETE",data:JSON.stringify(d),headers:{"Content-Type":"application/json",Accept:"application/json,text/javascript,*/*"},onComplete(l){s&&s(l)},onFailure(l,p){const f=l;f.msg=p.errormsg,f.errCode=p.errorcode,console.log("❌ sendDirectMessage => ",f),n&&n(f)}})}function Je(e,t="",s=void 0,n=void 0){const{space:i}=e;if(t==="")return;const c={uri:"/enovia/resources/v1/modeler/documents"},r={"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8",Accept:"application/json,text/javascript,*/*"},a=`${i}${c.uri}`,o=`$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}`;m(a,{method:"POST",headers:r,data:o,onComplete(d){s&&s(JSON.parse(d))},onFailure(d,l){const p=d;p.msg=l.error,n&&n(p)}})}function Ge(e,t=void 0,s=void 0){const n={base:e.space,uri:"/api/community/listmycommunities",limit:`/limit/${e.limit?e.limit:128}`,page:`/page/${e.page?e.page:"1"}`},i=`${n.base}${n.uri}${n.limit}${n.page}`,c=[];w(e,r=>{m(i,{method:"GET",headers:{"X-DS-SWYM-CSRFTOKEN":r.result.ServerToken},onComplete(a,o,d){const p=JSON.parse(a).result;let f=0;p.forEach(g=>{const _={description:g.description,id:g.id,title:g.title,owner:g.owner,role:g.role,access:g.access};z(e,g.id,S=>{f++,_.members=S,c.push(_),f===p.length&&t&&t(c)},S=>s(S))})},onFailure(a,o){const d=a;d.status=o.status,d.response=o.errormsg,s&&s(d)}})})}function z(e,t,s,n){const i=`${e.space}/api/community/listmembers`,c={params:{page:e.page?e.page:1,limit:e.limit?e.limit:50,community_id:t}};w(e,r=>{m(i,{method:"POST",headers:{"Content-type":"application/json;charset=UTF-8",Accept:"application/json","X-DS-SWYM-CSRFTOKEN":r.result.ServerToken},data:JSON.stringify(c),type:"json",onComplete(a,o,d){s&&s(a)},onFailure(a,o){const d=a;d.status=o.status,d.response=o.errormsg,n&&n(d)}})})}function xe(e,t=void 0,s=void 0){const n="YXdA5x4DSUKtlAi2wmnyTA";e.commu_id||(e.commu_id=n);const i=`${e.space}/api/v2/communities/${e.commu_id}/ideas/statuses`;w(e,c=>{m(i,{method:"GET",headers:{"Content-type":"application/json;charset=UTF-8",Accept:"application/json","X-DS-SWYM-CSRFTOKEN":c.result.ServerToken},onComplete(r){const a=JSON.parse(r);t&&t(a)},onFailure(r,a){const o=r;o.status=a.status,o.response=a.errormsg,s&&s(o)}})})}function Ke(e,t,s=void 0,n=void 0){const{listAllContacts:i,currentUser:c}=e;console.log("__listAllContacts",i.hits);const r=`${e.space}/api/directmessages`,a={users:[c.login].concat(t.receipt)},o={id_msg:"",senderId:e.currentUser.login,senderName:`${e.currentUser.first_name} ${e.currentUser.last_name}`,msg:Ve(t.msg)};let d=!1;Q(a.users,l=>{l!==void 0&&(o.id_msg=l.id,d=!0,I(e,o))},l=>{d=!1,console.log("_3dSwym_findCommunityToInstantMSG callback",l),n&&n(l),o.id_msg=""}),d===!1&&setTimeout(()=>{d===!1&&w(e,l=>{m(r,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json","X-DS-SWYM-CSRFTOKEN":l.result.ServerToken},data:JSON.stringify(a),type:"json",onComplete(p,f,g){const _=p;_.reponse=JSON.parse(g.response),_.status=g.status,s&&s(_),o.id_msg=_.result.id,I(e,o)},onFailure(p,f,g){const _=p;_.msg=f.errormsg,_.status=f.status,n&&n(_)}})})},500)}function Q(e,t,s,n){const i=`${e.space}/api/directmessages/lite?with_favorites=false`;w(e,c=>{m(i,{method:"GET",headers:{Accept:"application/json,text/javascript,*/*","X-DS-SWYM-CSRFTOKEN":c.result.ServerToken},onComplete(r){const a=JSON.parse(r),o=[];a.result.forEach(p=>{p.users=p.users.sort((f,g)=>f.login.localeCompare(g.login)),p.users.length===t.length&&o.push(p)});const d=t.sort(),l=o.find(p=>{const f=[];return p.users.forEach(g=>{f.push(g.login)}),JSON.stringify(f)===JSON.stringify(d)});s&&l!==void 0?s(l):(n||l===void 0)&&n(l)},onFailure(r){const a=r;a.msg=headers.errormsg,a.errCode=headers.errorcode,console.log("❌ sendDirectMessageLite => ",a),n&&n(a)}})})}function I(e,t,s=void 0,n=void 0){const i={base:e.space,uri:"/api/community",id_msg:`${t.id_msg}`,endUri:"/instantmessages"},c=`${i.base}${i.uri}/${i.id_msg}${i.endUri}`,r={author:{login:t.senderId,displayName:t.senderName},accessState:null,commentUri:null,comments:null,endorsements:null,moderationState:null,parentCommentUri:null,richMessage:t.msg};console.log("_3dSwym_sendDirectMessageData url ",c),w(e,a=>{m(c,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json","X-DS-SWYM-CSRFTOKEN":a.result.ServerToken},data:JSON.stringify(r),type:"json",onComplete(o,d,l){const p=o;p.status=l.status,p.response=JSON.parse(l.response),console.log("✅ _3dSwym_sendDirectMessageData => ",p),s&&s(p)},onFailure(o,d){const l=o;l.msg=d.errormsg,l.errCode=d.errorcode,console.log("❌ sendDirectMessage => ",l),n&&n(l)}})})}function Ve(e){const t=new Date().toLocaleDateString(),s=new Date().toLocaleTimeString();return`<p>${e} </p>
|
|
1
|
+
(function(u,b){typeof exports=="object"&&typeof module<"u"?b(exports,require("uuid"),require("luxon"),require("@widget-lab/3ddashboard-utils")):typeof define=="function"&&define.amd?define(["exports","uuid","luxon","@widget-lab/3ddashboard-utils"],b):(u=typeof globalThis<"u"?globalThis:u||self,b(u["@beam3_dev/api_module"]={},u.uuid,u.luxon,u["@widget-lab/3ddashboard-utils"]))})(this,function(u,b,U,C){"use strict";function A(){return b.v4()}const M={b3M3Yellow:"#FFB300",b3AboutageBlue:"#42A5F5",b3UsinageGreen:"#689F38",b3PanneauOrange:"#ff8000",b3M350percent:"#fafa6e",b3M380percent:"#aae479",b3M390percent:"#64c987",b3M3100percent:"#23aa8f",b3M3105percent:"#00898a",b3M3110percent:"#176877",b3M3120percent:"#2a4858",b3Aboutage50percent:"#fafa6e",b3Aboutage80percent:"#aae479",b3Aboutage90percent:"#64c987",b3Aboutage100percent:"#23aa8f",b3Aboutage105percent:"#00898a",b3Aboutage110percent:"#176877",b3Aboutage120percent:"#2a4858",b3Warning:"#FF0000",b3Edit1:"#AD1457",b3Edit2:"#F4511E",b3Edit3:"#009688",b3Edit4:"#D50000",b3Edit5:"#039BE5",b3Edit6:"#9E69AF",b3Edit7:"#A79B8E",b3Edit8:"#616161",b3Edit9:"#795548"};async function Q(e,t=void 0,s=void 0){const n=parseInt(e);await fetch("https://apicarto.ign.fr/api/codes-postaux/communes/"+n,{method:"GET",headers:{Accept:"application/json"}}).then(i=>i.json()).then(i=>{t&&t(i)}).catch(i=>{s&&s(i),console.error("Erreur : "+i)})}async function Z(e,t=void 0,s=void 0){e=encodeURIComponent(e),await fetch("https://api-adresse.data.gouv.fr/search/?q="+e+"&limit=15",{method:"GET",headers:{Accept:"application/json"}}).then(n=>n.json()).then(n=>{t&&t(n)}).catch(n=>{s&&s(n),console.error("Erreur : "+n)})}async function ee(e,t=M){let s=U.DateTime.now().year;const n=e,i=[],c=a=>{for(let o in a)i.push({date:o,comment:a[o]})};for(let a=s;a<=s+1;a++)await fetch("https://calendrier.api.gouv.fr/jours-feries/metropole/"+a+".json",{method:"GET",headers:{Accept:"application/json"}}).then(o=>o.json()).then(o=>{c(o)}).catch(o=>console.error("Erreur : "+o));return(()=>{const a=n.length===0?{events:[]}:n;for(let o of i)a.events.findIndex(l=>l.start===U.DateTime.fromISO(o.date).toISODate()&&l.name==="Férié : "+o.comment)===-1&&a.events.push({name:"Férié : "+o.comment,start:U.DateTime.fromISO(o.date).toISODate(),end:U.DateTime.fromISO(o.date).toISODate(),color:t.b3BusinnessDays,timed:!1});return a})()}async function te(e,t,s=!0){const n=e.events.findIndex(i=>i.uuid===t.uuid);return n===-1?e.events.push(t):s?e.events[n]=t:e.events.splice(n,1),e.length>0&&e.sort((i,c)=>i.start-c.start),e}function m(e,t){C.requirejs(["DS/WAFData/WAFData"],s=>{s.authenticatedRequest(e,t)})}function ne(e,t,s){C.requirejs(["DS/DataDragAndDrop/DataDragAndDrop"],n=>{n.draggable(e,{data:t,start:s})})}function se(e,t=void 0){C.requirejs(["DS/TagNavigatorProxy/TagNavigatorProxy"],s=>{let n;n===void 0&&(n=s.createProxy({widgetId:C.widget.id,filteringMode:"WithFilteringServices"}),t!==void 0&&n.addEvent("onFilterSubjectsChange",t)),n.setSubjectsTags(e)})}function ae(e,t){C.requirejs(["DS/DataDragAndDrop/DataDragAndDrop"],s=>{s.droppable(e,{drop:t})})}function $(e,t=void 0,s=void 0){C.requirejs(["DS/i3DXCompassServices/i3DXCompassServices"],n=>{(!e||e==="")&&(e=C.widget.getValue("PlatFormInstanceId")),(!e||e==="")&&(e=void 0),t&&t(n.getPlatformServices({platformId:e,onComplete:t,onFailure:s}))})}function ie(){let e={};return C.requirejs(["DS/PlatformAPI/PlatformAPI"],t=>{const s=t.getTenant(),n=t.getUser(),i=t.getAllApplicationConfigurations(),c=t.getApplicationConfiguration("com.3ds.wp.passport.cors");e={tenant:s,user:n,appsConfiguration:i,appConf:c}}),console.log("%cRETOUR API :","color:blue",e),e}function oe(e,t,s){const n={base:`${e.space}`,uri:"/resources/AppsMngt/api/custom/applications",option:`?filter=${e.tenant}`},i=`${n.base}${n.uri}${n.option}`;m(i,{method:"GET",headers:{"Content-Type":"application/json",Accept:"application/json"},onComplete(c,r,a){const o=JSON.parse(c),d=o.data.map(l=>{const p=l.attributes.name,f=l.id;return{name:p,id:f}});t&&t(d,o)},onFailure(c,r){const a=c;a.msg=r.errormsg,a.errCode=r.errorcode,s&&s(a)}})}function re(e,t=void 0,s=void 0){let n=`${e.space}/resources/AppsMngt/user?platform=${e.tenant}&limit=-1`;m(n,{onComplete(i,c,r){const a=JSON.parse(i);console.log("_AppMngt_get_users => ",a),t&&t(a)},onFailure(i,c){const r=i;r.msg=c.errormsg,r.errCode=c.errorcode,s&&s(r)}})}function ce(e,t,s=void 0,n=void 0){let i=`${e.space}/resources/AppsMngt/user?platform=${e.tenant}&id=${t}`;m(i,{onComplete(c,r,a){const o=JSON.parse(c);s&&s(o)},onFailure(c,r){const a=c;a.msg=r.errormsg,a.errCode=r.errorcode,n&&n(a)}})}const v={"Content-Type":"application/json",Accept:"application/json,text/javascript,*/*"};function de(e,t,s=void 0,n=void 0){const{space:i,currentUser:c}=e,a=`${i}${{URIUGr:"/3drdfpersist/resources/v1/usersgroup"}.URIUGr}`,o={groups:[{title:t.title,description:t.description,members:t.members||[c.email,"samuel.mureau@beam3.fr"],pending_members:[],sharing:t.sharing,visibility:t.visibility}]};m(a,{method:"POST",headers:v,data:JSON.stringify(o),onComplete(d){s&&s(JSON.parse(d))},onFailure(d,l){console.log(d);const p=d;p.msg=l.errormsg,p.errCode=l.errorcode,console.log("❌ sendDirectMessage => ",p),n&&n(p)}})}function le(e,t,s=void 0,n=void 0){const{space:i,tenant:c}=e,r=i,a=`/3drdfpersist/v1/resources/${t}`,o=`?$mask=dsaccess:Mask.GroupUI.Properties&tenant=dstenant:${c}`,d=`${r}${a}${o}`;m(d,{opts:{method:"GET",headers:{"Content-Type":"application/json",Accept:"application/json,text/javascript,*/*"}},onComplete(f){s&&s(JSON.parse(f))},onFailure(f,g){const _=f;_.msg=g.errormsg,_.errCode=g.errorcode,n&&n(_)}})}function P(e,t=void 0,s=void 0){const{space:n,tenant:i}=e,c=n,r="/3drdfpersist/resources/v1/option-sets/dsusergroup:ListOfGroupResponsibilities/options",a=`?tenant=dstenant:${i}`,o={method:"GET",Accept:"application/json,*/*,test/javascript"},d=`${c}${r}${a}`;m(d,{OPTsH:o,onComplete(l){t&&t(JSON.parse(l))},onFailure(l,p){const f=l;f.msg=p.errormsg,f.errCode=p.errorcode,s&&s(f)}})}function ue(e,t=void 0,s=void 0){const{space:n,currentUser:i}=e,a=`${n}/3drdfpersist/resources/v1/usersgroup?select=uri,title,description,owner,members,pending_members,creation_date,modification_date,visibility`,d={method:"GET",headers:{"Content-Type":"application/json",Accept:"application/json,text/javascript,*/*"}};try{m(a,{opts:d,onComplete(l){const p=JSON.parse(l),f={},g=p.groups.filter(_=>_.uri.startsWith("uuid:"));if(i&&Object.keys(i).length>0){const _=g.filter(y=>y.owner===i.email),S=g.filter(y=>y.members.includes(i.email)),h=_.concat(S);f.iam=h,f.UG=g,f.iamMember=S,P(e,y=>{f.rules=y,t&&t(f)},y=>{s&&s(y)})}},onFailure(l){s&&s(l)}})}catch(l){console.log(l)}}function pe(e,t){const{space:s}=e,i=`${s}/3drdfpersist/resources/v1/usersgroup/${t}`;m(i,{method:"DELETE"})}function fe(e,t,s,n=void 0,i=void 0){const{space:c,tenant:r}=e,a={URITI:"/3drdfpersist/resources/v1/template-instances",URIUGr:"/3drdfpersist/resources/v1/usersgroup",nextURICh:"/characteristics",nextURIGr:"/group",nexURImem:"/members",OPTsTI:"?$mask=dsaccess:Mask.GroupUI.Properties",OPTsTenant:`tenant=dstenant:${r}`},o=s,d=`${c}${a.URIUGr}/${t}`,l=JSON.stringify(o);m(d,{headers:v,method:"PATCH",data:l,type:"json",onComplete(p){n&&n(p)},onFailure(p){i&&i(p)}})}function me(e,t,s,n=void 0,i=void 0){const{space:c}=e,a=`${c}/3drdfpersist/resources/v1/usersgroup/${t}/sharing`;m(a,{method:"PATCH",headers:v,data:JSON.stringify(s),type:"json",onComplete(d){n&&n(d)},onFailure(d){i&&i(d)}})}function ge(e,t,s=void 0,n=void 0){const{space:i}=e,r=`${i}/3drdfpersist/resources/v1/usersgroup/${t}/sharing`;m(r,{opts:{method:"GET",headers:{"Content-Type":"application/json",Accept:"application/json,text/javascript,*/*"}},onComplete(d){s&&s(JSON.parse(d))},onFailure(d){n&&n(d)}})}async function L(e,t=void 0,s=void 0,n=void 0){const i=e.space;if(t===void 0){console.log("Le paramètre docid est obligatoire");return}const c=i+`/resources/v1/modeler/documents/${t}`;m(c,{onComplete(r,a,o){const d=JSON.parse(r);s&&s(d)},onFailure(r){n&&n(r)}})}function F(e,t,s=void 0,n=void 0){if(t!==null){let i=`${e.space}/resources/v1/modeler/documents/${t}`;m(i,{onComplete(c,r,a){const o=JSON.parse(c);s&&s(o)},onFailure(c){n&&n(c)}})}else D(e)}function D(e,t=void 0,s=void 0){if(e.space){const n=e.space+"/resources/v1/application/CSRF";m(n,{onComplete(i,c,r){const a=JSON.parse(i);t&&t(a.csrf.value)},onFailure(i){s&&s(i)}})}else s&&s("ERROR : url du 3DSpace non défini.")}function k(e,t,s=void 0,n=void 0){let i=e.space+`/resources/v1/modeler/documents/${t}/files/DownloadTicket`;F(e,t,c=>{m(i,{method:"PUT",headers:{ENO_CSRF_TOKEN:c.csrf.value},onComplete(r){let a=JSON.parse(r);if(a.success===!0)try{const o=a.data[0].dataelements.ticketURL;s&&s(o)}catch(o){n&&n(o)}},onFailure(r,a){console.log("☠️ error => ",r,a),n&&n(r,a)}})},n)}function _e(e,t,s,n=void 0,i=void 0){const c=`${e.space}/resources/v1/modeler/documents/${t}/files/DownloadTicket`;m(c,{method:"PUT",headers:{ENO_CSRF_TOKEN:s},onComplete(r){let a=JSON.parse(r);if(a.success===!0)try{const o=a.data[0].dataelements.ticketURL;n&&n(o)}catch(o){i&&i(o)}},onFailure(r){i&&i(r)}})}function E(e,t,s,n,i,c=void 0,r=void 0){F(e,t,a=>{J(e,t,s,n,i,a.csrf.value,c,r)},r)}function J(e,t,s,n,i,c,r=void 0,a=void 0){const o=e.space+`/resources/v1/modeler/documents/${t}/files/CheckinTicket`;m(o,{method:"PUT",headers:{ENO_CSRF_TOKEN:c},onComplete(d,l,p){const f=JSON.parse(d).data[0].dataelements,g=new FormData;g.append("__fcs__jobTicket",f.ticket),g.append("file_0",n,i);const _={};_.method="POST",_.data=g,_.onComplete=function(S){let h="temp_"+Date.now(),y={method:"PUT",headers:{ENO_CSRF_TOKEN:c},data:JSON.stringify({data:[{id:t,relateddata:{files:[{id:s,dataelements:{title:i,receipt:S},updateAction:"REVISE"}]},tempId:h}]}),type:"json",onComplete(T){r&&r(T)},onFailure(T){a&&a(T)}};m(e.space+"/resources/v1/modeler/documents",y)},_.onFailure=function(S){a&&a(S)},_.timeout=0,m(f.ticketURL,_)}})}async function Se(e,t,s,n,i=void 0,c=void 0){const r=e.space,a=e.token,o=e.ctx,d=new FormData,l=new Blob([JSON.stringify(t)],{type:"text/plain"}),p={url_Ticket:`${r}/resources/v1/modeler/documents/files/CheckinTicket`,url_Post:`${r}/resources/v1/modeler/documents/?SecurityContext=ctx::${o}`};if(!r&&r!==""){console.log("le store._3DSpace est vide");return}m(p.url_Ticket,{method:"PUT",headers:{ENO_CSRF_TOKEN:a.value},onComplete(f,g,_){const S=JSON.parse(f).data[0].dataelements;d.append("__fcs__jobTicket",S.ticket),d.append("filename",l,s);const h={method:"POST",data:d,onComplete(N){if(o!==""&&a!==""){const j={method:"POST",headers:{ENO_CSRF_TOKEN:a,Accept:"application/json","Content-Type":"application/json"},data:JSON.stringify({data:[{type:"Document",dataelements:{title:`Title_${s.toLowerCase().split(" ").join("_")}`,policy:"Document Release",description:n},relateddata:{files:[{dataelements:{title:`${s}.json`,receipt:N}}]},tempId:A()}]}),type:"json",timeout:0,onComplete:y,onFailure:T};o!==""&&m(p.url_Post,j)}else console.warn("le store est vide")},onFailure:T};function y(N){console.log("Success -- response ",N.data[0]),i&&i(N)}function T(N,j){console.log("Erreur -- response ",N,`
|
|
2
|
+
headers `,j),c&&c(N)}m(S.ticketURL,h)}})}function O(e,t=void 0,s=void 0,n=void 0,i=void 0,c=void 0){const r=`${e.space}/resources/modeler/pno/person?current=true&select=preferredcredentials&select=collabspaces`;m(r,{method:"GET",onComplete(a){const o=JSON.parse(a);let d="",l,p,f;if(t){let g=o.collabspaces.find(_=>_.title===t);if(g){l=t;let _=g.couples;_=_.filter((S,h,y)=>h===y.findIndex(T=>T.organization.pid===S.organization.pid&&T.role.pid===S.role.pid)),s&&(Array.isArray(s)?s.forEach(S=>{f||_.forEach(h=>{if(S===h.role.name&&n===h.organization.title)f=S,p=n;else if(S===h.role.name){let y=_.filter(T=>T.role.name===S);y.length===1?(f=y[0].role.name,p=y[0].organization.title):c(y)}})}):_.forEach(S=>{if(s===S.role.name&&n===S.organization.title)f=s,p=n;else if(s===S.role.name){let h=_.filter(y=>y.role.name===s);h.length===1?(f=h[0].role.name,p=h[0].organization.title):c(h)}}))}}l&&p&&f?(d=f+"."+p+"."+l,i(d)):o.preferredcredentials?(d=o.preferredcredentials.role.name+"."+o.preferredcredentials.organization.title+"."+o.preferredcredentials.collabspace.title,i(d)):c&&(d=f+"."+p+"."+l,c(d))},onFailure(a){console.log("Erreur de récupération du contexte de sécurité. => ",a)}})}async function R(e,t,s=void 0,n=void 0,i=void 0){return t===void 0||t===""?"Le paramètre objectId est obligatoire":new Promise(c=>{(e.space===""||!e.space)&&$(),t!==void 0&&t!==""&&t!==null&&k(e.space,t,r=>{m(r,{headers:{ENO_CSRF_TOKEN:e.token},onComplete(a){return s&&s(JSON.parse(a)),c=JSON.parse(a),c},onFailure(a){n&&(console.log("error http",a),n(a))}})},r=>{n&&n(r),console.log("*_3dspace_download_doc / error file URL *",r)})})}async function G(e,t,s=void 0,n=void 0){let i=[];for(let a=0;a<t.length;a+=80){const o=t.slice(a,a+80);i.push(o)}const r=a=>{x(e,i[a],()=>{a++,a<i.length&&r(a)},o=>{s&&s(o)})};r(0)}function x(e,t,s=void 0,n=void 0,i=void 0){const c=[];t.forEach(o=>{c.push({id:o})});let r=JSON.stringify({csrf:{name:"ENO_CSRF_TOKEN",value:e.token},data:c});const a=`${e.space}/resources/v1/modeler/documents/DownloadTicket?tenant=${e.tenant}&e6w-lang=fr&e6w-timezone=-120`;m(a,{method:"PUT",data:r,type:"json",onComplete(o){const d=o.data;o.success===!0&&(s&&s(),d.forEach(l=>{try{const p=l.dataelements.fileName,f=l.dataelements.ticketURL;m(f,{onComplete:g=>{n&&n({objectId:l.id,fileName:p,data:JSON.parse(g)})},onFailure:g=>{console.log("error http",g)}})}catch(p){console.log(p),i&&i(p)}}))},onFailure(o){console.log(o),i&&i(o)}})}function he(e,t,s=void 0,n=void 0){return new Promise(i=>{if(e.token===""&&D(e),t!==void 0&&t!==""&&t!==null){const c=`${e.space}/resources/v1/modeler/dslc/maturity/getNextStates`;O(e.space,"ESPACE COMMUN",["VPLMProjectLeader","VPLMCreator"],void 0,a=>e.ctx=a,a=>{console.log("onError =>",a)});let r={method:"POST",headers:{SecurityContext:"ctx::"+e.ctx,ENO_CSRF_TOKEN:e.token,Accept:"application/json","Content-Type":"application/json"},data:JSON.stringify({data:[{id:t}]}),type:"json",onComplete(a){s&&s(a)},onFailure(a){n&&n(a)}};m(c,r)}})}function ye(e,t,s,n=void 0,i=void 0){return new Promise(c=>{if(e.token===""&&D(e),t!==void 0&&t!==""&&t!==null){const r=`${e.space}/resources/v1/modeler/dslc/maturity/changeState`;O(e.space,"ESPACE COMMUN",["VPLMProjectLeader","VPLMCreator"],void 0,o=>e.ctx=o,o=>{console.log("onError =>",o)});let a={method:"POST",headers:{SecurityContext:"ctx::"+e.ctx,ENO_CSRF_TOKEN:e.token,Accept:"application/json","Content-Type":"application/json"},data:JSON.stringify({data:[{id:t,nextState:s}]}),type:"json",onComplete(o){n&&n(o)},onFailure(o){i&&i(o)}};m(r,a)}})}function we(e,t,s=void 0,n=void 0){return new Promise(i=>{if(e.token===""&&D(e),t!==void 0&&t!==""&&t!==null){const c=`${e.space}/resources/v1/dslc/versiongraph?withThumbnail=0&withIsLastVersion=0&withAttributes=0&withCopyFrom=0&tenant=${e.tenant}`;O(e.space,"ESPACE COMMUN",["VPLMProjectLeader","VPLMCreator"],void 0,a=>e.ctx=a,a=>{console.log("onError =>",a)});let r={method:"POST",headers:{securitycontext:"ctx::"+e.ctx,ENO_CSRF_TOKEN:e.token,Accept:"application/json","Content-Type":"application/json"},data:JSON.stringify({graphRequests:[{id:t}]}),type:"json",onComplete(a){s&&s(a)},onFailure(a){n&&n(a)}};m(c,r)}})}function Te(e,t,s=void 0,n=void 0){return new Promise(i=>{if(e.token===""&&D(e),t!==void 0&&t!==""&&t!==null){const c=`${e.space}/resources/lifecycle/revise/prepare_revise_maskattributes?tenant=${e.tenant}`;O(e.space,"ESPACE COMMUN",["VPLMProjectLeader","VPLMCreator"],void 0,a=>e.ctx=a,a=>{console.log("onError =>",a)});let r={method:"POST",headers:{SecurityContext:"ctx::"+e.ctx,ENO_CSRF_TOKEN:e.token,Accept:"application/json","Content-Type":"application/json"},data:JSON.stringify({data:[{"attribute[PLMReference.V_versionComment]":null,physicalid:t,type:"Document",tenant:e.tenant,objectId:t,policy:"Document Release",availableSemantic:["E","LAST","NEW","DUP"]}]}),type:"json",onComplete(a){s&&s(a)},onFailure(a){n&&n(a)}};m(c,r)}})}function Ce(e,t,s,n=void 0,i=void 0){return new Promise(c=>{if(e.token===""&&D(e),t!==void 0&&t!==""&&t!==null){const r=`${e.space}/resources/lifecycle/revise/major?tenant=${e.tenant}`;O(e.space,"ESPACE COMMUN",["VPLMProjectLeader","VPLMCreator"],void 0,o=>e.ctx=o,o=>{console.log("onError =>",o)});let a={method:"POST",headers:{securitycontext:"ctx::"+e.ctx,ENO_CSRF_TOKEN:e.token,Accept:"application/json","Content-Type":"application/json"},data:JSON.stringify({data:[{physicalid:t,proposedRevision:s,modifiedAttributes:{revision:s}}],folderid:null,notificationTimeout:600}),type:"json",onComplete(o){n&&n(o)},onFailure(o){i&&i(o)}};m(r,a)}})}//!SECTION
|
|
3
|
+
async function w(e,t=void 0,s=void 0){const n=e.space+"/api/index/tk";return console.log("_3DSwym_get_version",n,e),m(n,{onComplete(i,c,r){const a=JSON.parse(i);if(t)return t(a),e.token=a?.result?.ServerToken},onFailure(i){s&&s(i)}})}function De(e,t=void 0,s=void 0){const n=`${e.space}/api/exalead/whatsnew`,i={params:{community_id:null,hash_key:null,legacyFormat:!1,nresults:1,query:"#all",start:0}};w(e,c=>{m(n,{method:"POST",headers:{"X-DS-SWYM-CSRFTOKEN":c.result.ServerToken,"Content-type":"application/json;charset=UTF-8",Accept:"application/json"},data:JSON.stringify(i),type:"json",onComplete(r,a){t&&t(r,a)},onFailure(r,a){s&&s(r,a)}})})}function Oe(e,t=void 0,s=void 0){const n=`${e.space}/api/Recommendation/getpeoplefamiliartocurrentuser`,i={params:{idsToFilterArr:[],mode:"offline",limit:30,itemType:"User",maxNbOfCommonElements:"5"}};w(e,c=>{m(n,{method:"POST",headers:{"X-DS-SWYM-CSRFTOKEN":c.result.ServerToken,"Content-type":"application/json;charset=UTF-8",Accept:"application/json"},data:JSON.stringify(i),type:"json",onComplete(r,a){const o=r.result.hits.map(d=>({login:d.login,fullName:d.name}));t&&t(o,r)},onFailure(r,a){s&&s(r,a)}})})}function K(e,t=void 0,s=void 0){const n=e.space+"/api/user/getcurrent/";w(e,i=>{m(n,{method:"GET",headers:{"X-DS-SWYM-CSRFTOKEN":i.result.ServerToken},onComplete(c,r,a){const o=JSON.parse(c);t&&t(o.result)},onFailure(c,r,a){s&&s({response:c,headers:r,xhr:a})}})},s)}function Ne(e,t,s=void 0,n=void 0){const i=e.space+"/api/user/find/login/"+t;w(e,c=>{m(i,{method:"GET",headers:{"X-DS-SWYM-CSRFTOKEN":c.result.ServerToken},onComplete(r,a,o){const d=JSON.parse(r);s&&s(d)},onFailure(r){n&&n(r)}})},n)}function be(e,t=void 0,s=void 0){$(null,n=>{let i=[],c=[],r,a={};for(let o of n)"3DSpace"in o&&(c.push({label:`${o.displayName} ( ${o.platformId} )`,value:`${c.length}`}),c.sort(),i.push(o));for(let[o,d]of i.entries())d.platformId===e.tenant&&(a=d,r=o);C.widget.addPreference({name:"_CurrentTenantID_",type:"list",label:"Tenant",defaultValue:r,options:c}),Object.keys(a).length>0,O(e,"ESPACE COMMUN",["VPLMProjectLeader","VPLMCreator"],void 0,o=>e.ctx=o,o=>{console.log("on Error CTX =>",o)}),K(e,o=>{t&&t({reponse:o,activeSpace:a,credentials:e})},o=>{s&&s(o)})},n=>{console.log("** _getPlatformServices Erreur **",n)})}async function Fe(e,t,s){const n=`${e.space}/resources/v1/application/CSRF`;m(n,{onComplete(i){i=JSON.parse(i),t&&t(i.csrf)},onFailure(i){s&&s(i)}})}function Ue(e,t=void 0,s=void 0){const n={base:`${e.space}`,uri:"/resources/bps/cspaces",optTenant:`tenant=${e.tenant}`},i=`${n.base}${n.uri}?${n.optTenant}`;m(i,{method:"GET",headers:{Accept:"application/json,text/javascript,*/*","Content-Type":"application/ds-json"},onComplete(c,r){const a=JSON.parse(c);t&&t(a,r)},onFailure(c,r,a){s&&s(c,r,a)}})}function ke(e,t,s,n){k(e.space,t,i=>{m(i,{header:{ENO_CSRF_TOKEN:e.token},onComplete:c=>{s&&s(c)},onFailure:c=>{console.log("error http",c),n&&n(c)}})},i=>{console.log("error file URL",i),n&&n(i)})}async function Ae(e,t,s=void 0,n=void 0){return new Promise(i=>{k(e.space,t,c=>{m(c,{onComplete:(r,a,o)=>(i(JSON.parse(r)),s&&s(JSON.parse(r),a,o),i),onFailure:(r,a,o)=>{n&&n(r,a,o),console.log(r,a?.errormsg)}})})})}function $e(e,t,s,n=void 0,i=void 0){const c=new Blob([JSON.stringify(t)],{type:"text/plain"});F(e,s,r=>{const a=r.data[0].relateddata.files[0].id,o=r.data[0].dataelements.secondaryTitle!==""?r.data[0].dataelements.secondaryTitle:r.data[0].dataelements.title;E(e,s,a,c,o,d=>{n&&n(d)},d=>{i&&i(d)})},r=>{console.log("En cas d'erreur nous avons :",r),alert("Erreur lors de la sauvegarde, Veuillez réessayez"),i&&i(r)})}let V,W;const X=[];async function ve(e,t=void 0,s=void 0){console.log(`%c 3ds & objID ok ${e.space} et ${e.objID} *`,"color: green"),e.objID&&e.objID!==""?F(e.space,e.objID,n=>{t&&t(n.csrf.value)},n=>{s&&s(n)}):e.objID===null&&D(e)}async function Re(e,t=void 0,s=void 0){await R(e,n=>{const i={};i.obj=n,Y(e,c=>{i.datas=c,t&&t(i)},c=>{s&&s(c)})},n=>{s&&s(n)})}function Y(e,t=void 0,s=void 0){const n=[];e.objIds.forEach((i,c)=>{R(e,i.objId,r=>{n.push({[i.name]:r}),i.name==="dbProjets"&&(V=r.affaires.map(a=>a.objectID),B(e,W)),c===e.objIds.length-1&&t&&t(n)},r=>{s&&s(r)})})}function B(e,t,s=void 0,n=void 0){G(e,V,i=>{const c=[...t];c.find(r=>r.objectID===i.objectId).data=i.data,W=c,X.push(i.data),s&&s(X)},i=>{n&&(n(i),console.log(i))})}const Ie="FA35FB9B177A280065800EA0000F599C",je=["swym","3dspace","drive","usersgroup","3dplan","dashboard"],q={how:"ds6w:how",what:"ds6w:what",when:"ds6w:when",where:"ds6w:where",who:"ds6w:who",why:"ds6w:why"},Me={objId:Ie,pred:"who",order_by:"desc",tag:"testTag"};function Pe(e,t,s=void 0,n=void 0){const{space:i,tenant:c}=e,{objId:r,pred:a,tag:o}=t,d={uri:"/resources/6w/tags",otpCTX:"SecurityContext=preferred",optTenant:`tenant=${c}`},l=`${i}${d.uri}?${d.otpCTX}&${d.optTenant}`,p={tag:[{subject:[{uri:`pid://${r}`}],predicate:q[a],object:{literal:o}}]};m(l,{method:"PUT",headers:{"Content-Type":"application/json",Accept:"application/json"},data:JSON.stringify(p),onComplete(f){JSON.parse(f);const g={};setTimeout(()=>{L(e,r,_=>{const S=_.data[0].dataelements.title,h=_.data[0].dataelements.fileExtension!==void 0?_.data[0].dataelements.fileExtension:"",y=_.data[0].relateddata.ownerInfo[0].dataelements.name;g.name=S,g.ext=h,g.createBy=y,t.info={...g},Le(e,t,T=>{s&&s(T)},T=>{n&&n(T)})},(_,S)=>{const h=_;h.msg=S.errormsg,h.errCode=S.errorcode,console.log("❌ sendDirectMessage => ",h),n&&n(h)})},2e3)},onFailure(f,g){const _=f;_.msg=g.errormsg,_.errCode=g.errorcode,console.log("❌ sendDirectMessage => ",_),n&&n(_)}})}function Le(e,t,s=void 0,n=void 0){console.log("obj ",t);const i=t.info.name,c={baseUrl:`https://${e.tenant.toLowerCase()}-eu1-fedsearch.3dexperience.3ds.com`,uri:"/federated/search"},r=`${c.baseUrl}${c.uri}`,a={"Content-Type":"application/json",Accept:"application/json,text/javascript,*/*"},o=A(),d={with_indexing_date:!0,with_synthesis:!0,with_nls:!1,label:`3DSearch-${e.currentUser.username}-AjoutDeTagBeam-${o}`,locale:"fr",select_predicate:["ds6w:label","ds6w:type","ds6w:description","ds6w:identifier","ds6w:modified","ds6w:created","ds6wg:revision","ds6w:status","ds6w:responsible","owner","ds6w:responsibleUid","ds6wg:filesize","ds6w:project","ds6w:dataSource","ds6w:community","ds6w:originator","dsgeo:referential","ds6w:lastModifiedBy","ds6w:repository","dcterms:title","dcterms:description","ds6w:containerUid"],with_synthesis_hierarchical:!0,select_file:["icon","thumbnail_2d"],query:i,specific_source_parameter:{"3dspace":{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)'},drive:{additional_query:' AND NOT ([flattenedtaxonomies]:"types/DriveNode" AND ( [current]:"Trashed" OR [policy]:"Drive File Iteration") )'}},select_exclude_synthesis:["ds6w:what/ds6w:topic"],order_by:Me.order_by,order_field:"relevance",select_snippets:["ds6w:snippet","ds6w:label:snippet","ds6w:responsible:snippet","ds6w:community:snippet","swym:message_text:snippet"],nresults:40,start:"0",source:je,tenant:e.tenant,login:{"3dspace":{SecurityContext:e.ctx}}};console.log("dataPattern => ",d),m(r,{method:"POST",headers:a,data:JSON.stringify(d),onComplete(l){const p=JSON.parse(l);s(p)},onFailure(l,p){const f=l;f.msg=p.errormsg,f.errCode=p.errorcode,console.log("❌ sendDirectMessage => ",f),n&&n(f),console.log("Erreur de recuperation d'id du doc et des tags",l)}})}function Ee(e,t,s=void 0,n=void 0){const{objId:i,pred:c,tag:r}=t,a={uri:"/resources/6w/tags",otpCTX:"SecurityContext=preferred",optTenant:`tenant=${e.tenant}`},o=`${e.space}${a.uri}?${a.otpCTX}&${a.optTenant}`,d={tag:[{subject:[{uri:`pid://${i}`}],predicate:q[c],object:{literal:r}}]};m(o,{method:"DELETE",data:JSON.stringify(d),headers:{"Content-Type":"application/json",Accept:"application/json,text/javascript,*/*"},onComplete(l){s&&s(l)},onFailure(l,p){const f=l;f.msg=p.errormsg,f.errCode=p.errorcode,console.log("❌ sendDirectMessage => ",f),n&&n(f)}})}function Je(e,t="",s=void 0,n=void 0){const{space:i}=e;if(t==="")return;const c={uri:"/enovia/resources/v1/modeler/documents"},r={"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8",Accept:"application/json,text/javascript,*/*"},a=`${i}${c.uri}`,o=`$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}`;m(a,{method:"POST",headers:r,data:o,onComplete(d){s&&s(JSON.parse(d))},onFailure(d,l){const p=d;p.msg=l.error,n&&n(p)}})}function Ge(e,t=void 0,s=void 0){const n={base:e.space,uri:"/api/community/listmycommunities",limit:`/limit/${e.limit?e.limit:128}`,page:`/page/${e.page?e.page:"1"}`},i=`${n.base}${n.uri}${n.limit}${n.page}`,c=[];w(e,r=>{m(i,{method:"GET",headers:{"X-DS-SWYM-CSRFTOKEN":r.result.ServerToken},onComplete(a,o,d){const p=JSON.parse(a).result;let f=0;p.forEach(g=>{const _={description:g.description,id:g.id,title:g.title,owner:g.owner,role:g.role,access:g.access};H(e,g.id,S=>{f++,_.members=S,c.push(_),f===p.length&&t&&t(c)},S=>s(S))})},onFailure(a,o){const d=a;d.status=o.status,d.response=o.errormsg,s&&s(d)}})})}function H(e,t,s,n){const i=`${e.space}/api/community/listmembers`,c={params:{page:e.page?e.page:1,limit:e.limit?e.limit:50,community_id:t}};w(e,r=>{m(i,{method:"POST",headers:{"Content-type":"application/json;charset=UTF-8",Accept:"application/json","X-DS-SWYM-CSRFTOKEN":r.result.ServerToken},data:JSON.stringify(c),type:"json",onComplete(a,o,d){s&&s(a)},onFailure(a,o){const d=a;d.status=o.status,d.response=o.errormsg,n&&n(d)}})})}function xe(e,t=void 0,s=void 0){const n="YXdA5x4DSUKtlAi2wmnyTA";e.commu_id||(e.commu_id=n);const i=`${e.space}/api/v2/communities/${e.commu_id}/ideas/statuses`;w(e,c=>{m(i,{method:"GET",headers:{"Content-type":"application/json;charset=UTF-8",Accept:"application/json","X-DS-SWYM-CSRFTOKEN":c.result.ServerToken},onComplete(r){const a=JSON.parse(r);t&&t(a)},onFailure(r,a){const o=r;o.status=a.status,o.response=a.errormsg,s&&s(o)}})})}function Ke(e,t,s=void 0,n=void 0){const{listAllContacts:i,currentUser:c}=e;console.log("__listAllContacts",i.hits);const r=`${e.space}/api/directmessages`,a={users:[c.login].concat(t.receipt)},o={id_msg:"",senderId:e.currentUser.login,senderName:`${e.currentUser.first_name} ${e.currentUser.last_name}`,msg:Ve(t.msg)};let d=!1;z(a.users,l=>{l!==void 0&&(o.id_msg=l.id,d=!0,I(e,o))},l=>{d=!1,console.log("_3dSwym_findCommunityToInstantMSG callback",l),n&&n(l),o.id_msg=""}),d===!1&&setTimeout(()=>{d===!1&&w(e,l=>{m(r,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json","X-DS-SWYM-CSRFTOKEN":l.result.ServerToken},data:JSON.stringify(a),type:"json",onComplete(p,f,g){const _=p;_.reponse=JSON.parse(g.response),_.status=g.status,s&&s(_),o.id_msg=_.result.id,I(e,o)},onFailure(p,f,g){const _=p;_.msg=f.errormsg,_.status=f.status,n&&n(_)}})})},500)}function z(e,t,s,n){const i=`${e.space}/api/directmessages/lite?with_favorites=false`;w(e,c=>{m(i,{method:"GET",headers:{Accept:"application/json,text/javascript,*/*","X-DS-SWYM-CSRFTOKEN":c.result.ServerToken},onComplete(r){const a=JSON.parse(r),o=[];a.result.forEach(p=>{p.users=p.users.sort((f,g)=>f.login.localeCompare(g.login)),p.users.length===t.length&&o.push(p)});const d=t.sort(),l=o.find(p=>{const f=[];return p.users.forEach(g=>{f.push(g.login)}),JSON.stringify(f)===JSON.stringify(d)});s&&l!==void 0?s(l):(n||l===void 0)&&n(l)},onFailure(r){const a=r;a.msg=headers.errormsg,a.errCode=headers.errorcode,console.log("❌ sendDirectMessageLite => ",a),n&&n(a)}})})}function I(e,t,s=void 0,n=void 0){const i={base:e.space,uri:"/api/community",id_msg:`${t.id_msg}`,endUri:"/instantmessages"},c=`${i.base}${i.uri}/${i.id_msg}${i.endUri}`,r={author:{login:t.senderId,displayName:t.senderName},accessState:null,commentUri:null,comments:null,endorsements:null,moderationState:null,parentCommentUri:null,richMessage:t.msg};console.log("_3dSwym_sendDirectMessageData url ",c),w(e,a=>{m(c,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json","X-DS-SWYM-CSRFTOKEN":a.result.ServerToken},data:JSON.stringify(r),type:"json",onComplete(o,d,l){const p=o;p.status=l.status,p.response=JSON.parse(l.response),console.log("✅ _3dSwym_sendDirectMessageData => ",p),s&&s(p)},onFailure(o,d){const l=o;l.msg=d.errormsg,l.errCode=d.errorcode,console.log("❌ sendDirectMessage => ",l),n&&n(l)}})})}function Ve(e){const t=new Date().toLocaleDateString(),s=new Date().toLocaleTimeString();return`<p>${e} </p>
|
|
4
4
|
<br/>
|
|
5
5
|
<hr/>
|
|
6
6
|
<p><u>envoyer :</u>Le <b>${t} à ${s}</b></p>`}const We={title:"TEST DEV COMMUNITY IDEA",community_id:"YXdA5x4DSUKtlAi2wmnyTA",community_title:"TEST DEV COMMUNITY",idee_id:"THhRI8rlQNWKRxpv3Xqqug"};function Xe(e,t,s=void 0,n=void 0){const i=`${e.space}/api/idea/add`,c=e.swymCommunities.find(o=>o.id===t.community_id),r=e.swymCommunities.find(o=>o.title.toLowerCase()===t.community_title.toLowerCase()),a={params:{title:t.title,community_id:c?.id!==void 0?c.id:r.id,message:He(t.text_html),published:1}};w(e,o=>{const d={"Content-type":"application/json;charset=UTF-8",Accept:"application/json","X-DS-SWYM-CSRFTOKEN":o.result.ServerToken};m(i,{method:"POST",headers:d,data:JSON.stringify(a),type:"json",onComplete(l,p,f){const g=JSON.parse(l);g.status=f.status,g.response=f.response,s&&s(g)},onFailure(l,p,f){const g=l;g.status=p.status,g.response=p.errormsg,n&&n(g)}})})}function Ye(e,t,s=void 0,n=void 0){const i=`${e.space}/api/idea/delete`,c={params:{community_id:t.community_id,ideationIds:[t.idee_id]}};w(e,r=>{m(i,{method:"POST",headers:{"Content-type":"application/json;charset=UTF-8",Accept:"application/json","X-DS-SWYM-CSRFTOKEN":r.result.ServerToken},data:JSON.stringify(c),type:"json",onComplete(a,o,d){s&&s(a)},onFailure(a,o,d){const l=a;l.status=o.status,l.response=o.errormsg,n&&n(l)}})})}function Be(e,t="",s=void 0,n=void 0){const i=e.tenant.toLowerCase()==="r1132101716373"?"tFtz0G4MR6qNtKgJjNfTog":e.tenant.toLowerCase()==="r1132101286859"?"Qpv3HN-tTDOsU-7_c5DnDg":"Template_d'idée_à_créer";t===""&&(t=i);const c=`${e.space}/api/idea/get`,r={params:{id:t}};w(e,a=>{m(c,{method:"POST",headers:{"Content-type":"application/json;charset=UTF-8",Accept:"application/json","X-DS-SWYM-CSRFTOKEN":a.result.ServerToken},data:JSON.stringify(r),type:"json",onComplete(o){const d=o;d.msg=d.result.message,s&&s(d)},onFailure(o){const d=o;d.status=headers.status,d.response=headers.errormsg,n&&n(d)}})})}function qe(e,t=We,s=void 0,n=void 0){const i={uri:"/api/idea/list",comId:`/community_id/${e.tenant.toLowerCase()==="r1132101716373"?t.community_id:"bgnIsG74SUWswyGzS6NC6g"}`,limit:`/limit/${t.limit?t.limit:10}`},c=`${e.space}${i.uri}${i.comId}${i.limit}`;w(e,r=>{m(c,{method:"GET",headers:{"X-DS-SWYM-CSRFTOKEN":r.result.ServerToken},onComplete(a){const o=JSON.parse(a);s&&s(o)},onFailure(a,o){const d=a;d.status=o.status,d.response=o.errormsg,n&&n(d)}})})}function He(e){return!e||e===""?`<h2><u>INFORMATIONS AFFAIRE :</u></h2>
|
|
@@ -75,4 +75,4 @@ function w(e,t=void 0,s=void 0){const n=e.space+"/api/index/tk";m(n,{onComplete(
|
|
|
75
75
|
<tr><td><strong>Service études de prix</strong></td><td><br /></td></tr>
|
|
76
76
|
</tbody></table>
|
|
77
77
|
<p>
|
|
78
|
-
</p>`:e}function ze(e){const t="Hello "+e;return console.log(t),t}u.UUID=A,u._3DSpace_Create_Doc=Se,u._3DSpace_csrf=
|
|
78
|
+
</p>`:e}function ze(e){const t="Hello "+e;return console.log(t),t}u.UUID=A,u._3DSpace_Create_Doc=Se,u._3DSpace_csrf=D,u._3DSpace_download_doc=R,u._3DSpace_download_multidoc=G,u._3DSpace_file_update=E,u._3DSpace_file_update_csr=J,u._3DSpace_file_url=k,u._3DSpace_file_url_csr=_e,u._3DSpace_get_csrf=F,u._3DSpace_get_docInfo=L,u._3DSpace_get_downloadTicket_multidoc=x,u._3DSpace_get_securityContexts=O,u._3DSpace_lifecycle_changeRevision=Ce,u._3DSpace_lifecycle_changeState=ye,u._3DSpace_lifecycle_getGraph=we,u._3DSpace_lifecycle_getNextRevision=Te,u._3DSpace_lifecycle_getNextStates=he,u._3DSwim_getAllCommunities=Ge,u._3DSwim_getMembersCommunity=H,u._3DSwym_buildDirectMessage=Ke,u._3DSwym_deleteIdea=Ye,u._3DSwym_findCommunityToInstantMSG=z,u._3DSwym_getAllNews=De,u._3DSwym_getFamiliarPeople=Oe,u._3DSwym_getIdeaStatusMaturity=xe,u._3DSwym_getSWYMIdea=Be,u._3DSwym_get_AllSWYMIdeas=qe,u._3DSwym_get_currentUser=K,u._3DSwym_get_findUser=Ne,u._3DSwym_get_version=w,u._3DSwym_postIdea=Xe,u._3DSwym_sendMessageData=I,u._AppMngt_get_info_user=ce,u._AppMngt_get_users=re,u._getPlateformInfos=ie,u._getPlatformServices=$,u._httpCallAuthenticated=m,u._setDraggable=ne,u._setDroppable=ae,u._setupTagger=se,u.addTagToDoc=Pe,u.compass_getListAdditionalApps=oe,u.couleurs=M,u.createUserGroups=de,u.dataMixing=B,u.deleteUserGroups=pe,u.findAdresse=Z,u.getActiveServices=be,u.getAllContextSecurity=Ue,u.getCSRFToken=Fe,u.getCommunes=Q,u.getComplementUG=le,u.getDataFrom3DSpace=ke,u.getDataFromGouvFr=ee,u.getDatasByTenant=Re,u.getDatasFrom3DSpace=Y,u.getDownloadDocument=Ae,u.getInfoDocTags=Je,u.getUserGroupsList=ue,u.getUsersGroupRules=P,u.get_3DSpace_csrf=ve,u.patchUserGroups=fe,u.patchUserGroupsControl=me,u.pushDataIn3DSpace=$e,u.readUserGroupControl=ge,u.removeTagToDoc=Ee,u.sayHello=ze,u.updateEvent=te,Object.defineProperty(u,Symbol.toStringTag,{value:"Module"})});
|