@beam3_dev/api_module 0.0.311 → 0.0.312
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 +173 -171
- package/dist/wb3Api.js.map +1 -1
- package/dist/wb3Api.umd.cjs +5 -5
- package/dist/wb3Api.umd.cjs.map +1 -1
- package/package.json +1 -1
package/dist/wb3Api.js
CHANGED
|
@@ -89,7 +89,7 @@ async function Ie(e, t = z) {
|
|
|
89
89
|
} : s;
|
|
90
90
|
for (let c of i)
|
|
91
91
|
o.events.findIndex(
|
|
92
|
-
(
|
|
92
|
+
(u) => u.start === O.fromISO(c.date).toISODate() && u.name === "Férié : " + c.comment
|
|
93
93
|
) === -1 && o.events.push({
|
|
94
94
|
name: "Férié : " + c.comment,
|
|
95
95
|
start: O.fromISO(c.date).toISODate(),
|
|
@@ -258,9 +258,9 @@ function Ae(e, t, n) {
|
|
|
258
258
|
Accept: "application/json"
|
|
259
259
|
},
|
|
260
260
|
onComplete(r, a, o) {
|
|
261
|
-
const c = JSON.parse(r), d = c.data.map((
|
|
262
|
-
const
|
|
263
|
-
return { name:
|
|
261
|
+
const c = JSON.parse(r), d = c.data.map((u) => {
|
|
262
|
+
const p = u.attributes.name, f = u.id;
|
|
263
|
+
return { name: p, id: f };
|
|
264
264
|
});
|
|
265
265
|
t && t(d, c);
|
|
266
266
|
},
|
|
@@ -322,10 +322,10 @@ function Me(e, t, n = void 0, s = void 0) {
|
|
|
322
322
|
onComplete(d) {
|
|
323
323
|
n && n(JSON.parse(d));
|
|
324
324
|
},
|
|
325
|
-
onFailure(d,
|
|
325
|
+
onFailure(d, u) {
|
|
326
326
|
console.log(d);
|
|
327
|
-
const
|
|
328
|
-
|
|
327
|
+
const p = d;
|
|
328
|
+
p.msg = u.errormsg, p.errCode = u.errorcode, console.log("❌ sendDirectMessage => ", p), s && s(p);
|
|
329
329
|
}
|
|
330
330
|
});
|
|
331
331
|
}
|
|
@@ -355,31 +355,33 @@ function ee(e, t = void 0, n = void 0) {
|
|
|
355
355
|
}, d = `${r}${a}${o}`;
|
|
356
356
|
m(d, {
|
|
357
357
|
OPTsH: c,
|
|
358
|
-
onComplete(
|
|
359
|
-
t && t(JSON.parse(
|
|
358
|
+
onComplete(u) {
|
|
359
|
+
t && t(JSON.parse(u));
|
|
360
360
|
},
|
|
361
|
-
onFailure(
|
|
362
|
-
const f =
|
|
363
|
-
f.function = "getUsersGroupRules()", f.msg =
|
|
361
|
+
onFailure(u, p) {
|
|
362
|
+
const f = u;
|
|
363
|
+
f.function = "getUsersGroupRules()", f.msg = p.errormsg, f.errCode = p.errorcode, n && n(f);
|
|
364
364
|
}
|
|
365
365
|
});
|
|
366
366
|
}
|
|
367
367
|
function Ge(e, t = void 0, n = void 0) {
|
|
368
|
-
const { _usersgroup: s, currentUser: i
|
|
368
|
+
const { _usersgroup: s, currentUser: i, numMax: r } = e;
|
|
369
|
+
r || (r = 50);
|
|
370
|
+
const a = "/3drdfpersist/resources/v1/usersgroup", o = "?select=uri,title,description,owner,members,pending_members,creation_date,modification_date,visibility", c = `&top=${r}`, d = `${s}${a}${o}${c}`, p = { method: "GET", headers: {
|
|
369
371
|
"Content-Type": "application/json",
|
|
370
372
|
Accept: "application/json,text/javascript,*/*"
|
|
371
373
|
} };
|
|
372
374
|
try {
|
|
373
|
-
m(
|
|
375
|
+
m(d, {
|
|
374
376
|
opts: p,
|
|
375
|
-
onComplete(
|
|
376
|
-
const
|
|
377
|
+
onComplete(f) {
|
|
378
|
+
const l = JSON.parse(f), g = {}, h = l.groups.filter((_) => _.uri.startsWith("uuid:"));
|
|
377
379
|
if (i && Object.keys(i).length > 0) {
|
|
378
|
-
const
|
|
379
|
-
|
|
380
|
+
const _ = h.filter((y) => y.owner === i.email), S = h.filter((y) => y.members.includes(i.email)), w = _.concat(S);
|
|
381
|
+
g.iam = w, g.UG = h, g.iamMember = S, g.all = l, ee(
|
|
380
382
|
e,
|
|
381
383
|
(y) => {
|
|
382
|
-
|
|
384
|
+
g.rules = y, t && t(g);
|
|
383
385
|
},
|
|
384
386
|
(y) => {
|
|
385
387
|
y.function += ", getUserGroupsList()", n && n(y);
|
|
@@ -387,21 +389,21 @@ function Ge(e, t = void 0, n = void 0) {
|
|
|
387
389
|
);
|
|
388
390
|
}
|
|
389
391
|
},
|
|
390
|
-
onFailure(
|
|
391
|
-
const
|
|
392
|
-
|
|
392
|
+
onFailure(f, l) {
|
|
393
|
+
const g = f;
|
|
394
|
+
g.function = "getUserGroupsList()", g.msg = l.errormsg, g.errCode = l.errorcode, n && n(g);
|
|
393
395
|
}
|
|
394
396
|
});
|
|
395
|
-
} catch (
|
|
396
|
-
console.log(
|
|
397
|
-
const
|
|
398
|
-
infoError:
|
|
397
|
+
} catch (f) {
|
|
398
|
+
console.log(f);
|
|
399
|
+
const l = {
|
|
400
|
+
infoError: f,
|
|
399
401
|
fonction: "getUserGroupsList()",
|
|
400
402
|
catch: new Error("Erreur sur la fonction getUserGroupsList()", {
|
|
401
|
-
cause:
|
|
403
|
+
cause: f
|
|
402
404
|
})
|
|
403
405
|
};
|
|
404
|
-
n(
|
|
406
|
+
n(l);
|
|
405
407
|
}
|
|
406
408
|
}
|
|
407
409
|
function Ke(e, t) {
|
|
@@ -419,17 +421,17 @@ function qe(e, t, n, s = void 0, i = void 0) {
|
|
|
419
421
|
nexURImem: "/members",
|
|
420
422
|
OPTsTI: "?$mask=dsaccess:Mask.GroupUI.Properties",
|
|
421
423
|
OPTsTenant: `tenant=dstenant:${a}`
|
|
422
|
-
}, c = n, d = `${r}${o.URIUGr}/${t}`,
|
|
424
|
+
}, c = n, d = `${r}${o.URIUGr}/${t}`, u = JSON.stringify(c);
|
|
423
425
|
m(d, {
|
|
424
426
|
headers: j,
|
|
425
427
|
method: "PATCH",
|
|
426
|
-
data:
|
|
428
|
+
data: u,
|
|
427
429
|
type: "json",
|
|
428
|
-
onComplete(
|
|
429
|
-
s && s(
|
|
430
|
+
onComplete(p) {
|
|
431
|
+
s && s(p);
|
|
430
432
|
},
|
|
431
|
-
onFailure(
|
|
432
|
-
i && i(
|
|
433
|
+
onFailure(p) {
|
|
434
|
+
i && i(p);
|
|
433
435
|
}
|
|
434
436
|
});
|
|
435
437
|
}
|
|
@@ -495,8 +497,8 @@ var se = function(e, t, n, s) {
|
|
|
495
497
|
var o = e.length;
|
|
496
498
|
a > 0 && o > a && (o = a);
|
|
497
499
|
for (var c = 0; c < o; ++c) {
|
|
498
|
-
var d = e[c].replace(r, "%20"),
|
|
499
|
-
|
|
500
|
+
var d = e[c].replace(r, "%20"), u = d.indexOf(n), p, f, l, g;
|
|
501
|
+
u >= 0 ? (p = d.substr(0, u), f = d.substr(u + 1)) : (p = d, f = ""), l = decodeURIComponent(p), g = decodeURIComponent(f), ne(i, l) ? Array.isArray(i[l]) ? i[l].push(g) : i[l] = [i[l], g] : i[l] = g;
|
|
500
502
|
}
|
|
501
503
|
return i;
|
|
502
504
|
}, x = function(e) {
|
|
@@ -553,8 +555,8 @@ async function Xe(e, t = void 0, n = void 0, s = void 0) {
|
|
|
553
555
|
},
|
|
554
556
|
data: a,
|
|
555
557
|
onComplete(o, c, d) {
|
|
556
|
-
const
|
|
557
|
-
n && n(
|
|
558
|
+
const u = JSON.parse(o);
|
|
559
|
+
n && n(u);
|
|
558
560
|
},
|
|
559
561
|
onFailure(o) {
|
|
560
562
|
s && s(o);
|
|
@@ -686,7 +688,7 @@ function ae(e, t, n, s, i, r, a = void 0, o = void 0) {
|
|
|
686
688
|
}
|
|
687
689
|
}),
|
|
688
690
|
type: "json",
|
|
689
|
-
onComplete(d,
|
|
691
|
+
onComplete(d, u, p) {
|
|
690
692
|
const f = d.csrf, l = d.data[0].dataelements, g = new FormData();
|
|
691
693
|
let h;
|
|
692
694
|
s instanceof Blob ? h = s : h = new Blob([s], {
|
|
@@ -694,7 +696,7 @@ function ae(e, t, n, s, i, r, a = void 0, o = void 0) {
|
|
|
694
696
|
}), g.append(l.ticketparamname, l.ticket), g.append("file_0", h, i);
|
|
695
697
|
const _ = {};
|
|
696
698
|
_.method = "POST", _.data = g, _.onComplete = function(S) {
|
|
697
|
-
let
|
|
699
|
+
let w = {
|
|
698
700
|
method: "PUT",
|
|
699
701
|
headers: {
|
|
700
702
|
SecurityContext: "ctx::" + e.ctx
|
|
@@ -720,16 +722,16 @@ function ae(e, t, n, s, i, r, a = void 0, o = void 0) {
|
|
|
720
722
|
]
|
|
721
723
|
}),
|
|
722
724
|
type: "json",
|
|
723
|
-
onComplete(
|
|
724
|
-
a && a(
|
|
725
|
+
onComplete(y) {
|
|
726
|
+
a && a(y);
|
|
725
727
|
},
|
|
726
|
-
onFailure(
|
|
727
|
-
o && o(
|
|
728
|
+
onFailure(y) {
|
|
729
|
+
o && o(y);
|
|
728
730
|
}
|
|
729
731
|
};
|
|
730
732
|
e.tenant.toUpperCase(), m(
|
|
731
733
|
e.space + `/resources/v1/modeler/documents/?$include=versions&tenant=${e.tenant.toUpperCase()}&e6w-lang=fr&e6w-timezone=-60&xrequestedwith=xmlhttprequest`,
|
|
732
|
-
|
|
734
|
+
w
|
|
733
735
|
);
|
|
734
736
|
}, _.onFailure = function(S) {
|
|
735
737
|
o && o(S);
|
|
@@ -788,11 +790,11 @@ async function Ye(e, t = void 0, n = void 0, s = void 0, i = void 0, r = void 0)
|
|
|
788
790
|
`https://${a.toLowerCase()}-eu1-space.3dexperience.3ds.com/enovia/resources/enocsmrest/session?tenant=${a.toUpperCase()}&xrequestedwith=xmlhttprequest`,
|
|
789
791
|
{
|
|
790
792
|
method: "GET",
|
|
791
|
-
onComplete(
|
|
793
|
+
onComplete(u) {
|
|
792
794
|
try {
|
|
793
|
-
|
|
794
|
-
const { csrftoken:
|
|
795
|
-
|
|
795
|
+
u = JSON.parse(u);
|
|
796
|
+
const { csrftoken: p, isadmin: f } = u;
|
|
797
|
+
p && m(d, {
|
|
796
798
|
method: "GET",
|
|
797
799
|
headers: {
|
|
798
800
|
//"x-ds-csrftoken": csrftoken,
|
|
@@ -801,14 +803,14 @@ async function Ye(e, t = void 0, n = void 0, s = void 0, i = void 0, r = void 0)
|
|
|
801
803
|
onComplete(l, g, h) {
|
|
802
804
|
try {
|
|
803
805
|
if (l = JSON.parse(l), l?.ticket) {
|
|
804
|
-
const { ticket: _, actionurl: S, jobticket:
|
|
806
|
+
const { ticket: _, actionurl: S, jobticket: w } = l;
|
|
805
807
|
K(
|
|
806
808
|
{ dataelements: { ticket: _, ticketURL: S } },
|
|
807
809
|
n,
|
|
808
810
|
t,
|
|
809
|
-
(
|
|
811
|
+
(y) => {
|
|
810
812
|
const R = new DOMParser().parseFromString(
|
|
811
|
-
|
|
813
|
+
y,
|
|
812
814
|
"text/html"
|
|
813
815
|
).body.firstChild.querySelector("input").getAttributeNode("value").value, k = `https://${a.toLowerCase()}-eu1-space.3dexperience.3ds.com/enovia/resources/enocsmrest/collabspaces/${encodeURIComponent(o)}/contents?receipt=${encodeURIComponent(R)}`;
|
|
814
816
|
let W = /(?:\.([^.]+))?$/.exec(t)[1];
|
|
@@ -833,7 +835,7 @@ async function Ye(e, t = void 0, n = void 0, s = void 0, i = void 0, r = void 0)
|
|
|
833
835
|
headers: {
|
|
834
836
|
Accept: "application/json",
|
|
835
837
|
"Content-Type": "application/json;charset=UTF-8",
|
|
836
|
-
"X-DS-CSRFTOKEN":
|
|
838
|
+
"X-DS-CSRFTOKEN": p
|
|
837
839
|
},
|
|
838
840
|
data: v,
|
|
839
841
|
type: "json",
|
|
@@ -848,11 +850,11 @@ async function Ye(e, t = void 0, n = void 0, s = void 0, i = void 0, r = void 0)
|
|
|
848
850
|
}
|
|
849
851
|
});
|
|
850
852
|
},
|
|
851
|
-
(
|
|
852
|
-
console.warn("pushFileInFcs",
|
|
853
|
+
(y) => {
|
|
854
|
+
console.warn("pushFileInFcs", y), i && i(y);
|
|
853
855
|
},
|
|
854
|
-
(
|
|
855
|
-
r && r({ fileName: t, progress:
|
|
856
|
+
(y) => {
|
|
857
|
+
r && r({ fileName: t, progress: y });
|
|
856
858
|
}
|
|
857
859
|
);
|
|
858
860
|
}
|
|
@@ -868,8 +870,8 @@ async function Ye(e, t = void 0, n = void 0, s = void 0, i = void 0, r = void 0)
|
|
|
868
870
|
i && i();
|
|
869
871
|
}
|
|
870
872
|
},
|
|
871
|
-
onFailure(
|
|
872
|
-
i && i(
|
|
873
|
+
onFailure(u) {
|
|
874
|
+
i && i(u);
|
|
873
875
|
}
|
|
874
876
|
}
|
|
875
877
|
);
|
|
@@ -965,8 +967,8 @@ function K(e, t, n, s = void 0, i = void 0, r = void 0) {
|
|
|
965
967
|
const c = new XMLHttpRequest();
|
|
966
968
|
c.open("POST", o, !0), c.upload.onprogress = function(d) {
|
|
967
969
|
if (d.lengthComputable) {
|
|
968
|
-
const
|
|
969
|
-
r && r(
|
|
970
|
+
const u = d.loaded / d.total * 100;
|
|
971
|
+
r && r(u);
|
|
970
972
|
}
|
|
971
973
|
}, c.onload = function() {
|
|
972
974
|
c.status === 200 ? s && s(c.responseText.replace(/[\n\r]/g, "")) : i && i(c.statusText);
|
|
@@ -1027,25 +1029,25 @@ function F(e, t = void 0, n = void 0, s = void 0, i = void 0, r = void 0, a = !1
|
|
|
1027
1029
|
method: "GET",
|
|
1028
1030
|
onComplete(c) {
|
|
1029
1031
|
const d = JSON.parse(c);
|
|
1030
|
-
let
|
|
1032
|
+
let u = "", p, f, l;
|
|
1031
1033
|
if (t) {
|
|
1032
1034
|
let g = d.collabspaces.find((h) => h.title === t);
|
|
1033
1035
|
if (g) {
|
|
1034
|
-
|
|
1036
|
+
p = t;
|
|
1035
1037
|
let h = g.couples;
|
|
1036
1038
|
h = h.filter(
|
|
1037
|
-
(_, S,
|
|
1038
|
-
(
|
|
1039
|
+
(_, S, w) => S === w.findIndex(
|
|
1040
|
+
(y) => y.organization.pid === _.organization.pid && y.role.pid === _.role.pid
|
|
1039
1041
|
)
|
|
1040
1042
|
), n && (Array.isArray(n) ? n.forEach((_) => {
|
|
1041
1043
|
l || h.forEach((S) => {
|
|
1042
1044
|
if (_ === S.role.name && s === S.organization.title)
|
|
1043
1045
|
l = _, f = s;
|
|
1044
1046
|
else if (_ === S.role.name) {
|
|
1045
|
-
let
|
|
1046
|
-
(
|
|
1047
|
+
let w = h.filter(
|
|
1048
|
+
(y) => y.role.name === _
|
|
1047
1049
|
);
|
|
1048
|
-
|
|
1050
|
+
w.length === 1 ? (l = w[0].role.name, f = w[0].organization.title) : r(w);
|
|
1049
1051
|
}
|
|
1050
1052
|
});
|
|
1051
1053
|
}) : h.forEach((_) => {
|
|
@@ -1053,14 +1055,14 @@ function F(e, t = void 0, n = void 0, s = void 0, i = void 0, r = void 0, a = !1
|
|
|
1053
1055
|
l = n, f = s;
|
|
1054
1056
|
else if (n === _.role.name) {
|
|
1055
1057
|
let S = h.filter(
|
|
1056
|
-
(
|
|
1058
|
+
(w) => w.role.name === n
|
|
1057
1059
|
);
|
|
1058
1060
|
S.length === 1 ? (l = S[0].role.name, f = S[0].organization.title) : r(S);
|
|
1059
1061
|
}
|
|
1060
1062
|
}));
|
|
1061
1063
|
}
|
|
1062
1064
|
}
|
|
1063
|
-
|
|
1065
|
+
p && f && l ? (u = l + "." + f + "." + p, i(u)) : d.preferredcredentials && a ? (u = d.preferredcredentials.role.name + "." + d.preferredcredentials.organization.title + "." + d.preferredcredentials.collabspace.title, i(u)) : r && (u = l + "." + f + "." + p, r(u));
|
|
1064
1066
|
},
|
|
1065
1067
|
onFailure(c, d) {
|
|
1066
1068
|
console.warn("Erreur de récupération du contexte de sécurité. => ", {
|
|
@@ -1157,9 +1159,9 @@ function de(e, t, n = void 0, s = void 0, i = void 0) {
|
|
|
1157
1159
|
type: "json",
|
|
1158
1160
|
onComplete(c) {
|
|
1159
1161
|
const d = c.data;
|
|
1160
|
-
c.success === !0 && (n && n(), d.forEach((
|
|
1162
|
+
c.success === !0 && (n && n(), d.forEach((u) => {
|
|
1161
1163
|
try {
|
|
1162
|
-
const
|
|
1164
|
+
const p = u.dataelements.fileName, f = u.dataelements.ticketURL;
|
|
1163
1165
|
m(f, {
|
|
1164
1166
|
onComplete: (l, g) => {
|
|
1165
1167
|
let h;
|
|
@@ -1169,9 +1171,9 @@ function de(e, t, n = void 0, s = void 0, i = void 0) {
|
|
|
1169
1171
|
h = l.blob();
|
|
1170
1172
|
}
|
|
1171
1173
|
s && s({
|
|
1172
|
-
objectId:
|
|
1174
|
+
objectId: u.id,
|
|
1173
1175
|
headers: g,
|
|
1174
|
-
fileName:
|
|
1176
|
+
fileName: p,
|
|
1175
1177
|
data: h
|
|
1176
1178
|
});
|
|
1177
1179
|
},
|
|
@@ -1179,8 +1181,8 @@ function de(e, t, n = void 0, s = void 0, i = void 0) {
|
|
|
1179
1181
|
console.log("error http", l);
|
|
1180
1182
|
}
|
|
1181
1183
|
});
|
|
1182
|
-
} catch (
|
|
1183
|
-
console.log(
|
|
1184
|
+
} catch (p) {
|
|
1185
|
+
console.log(p), i && i(p);
|
|
1184
1186
|
}
|
|
1185
1187
|
}));
|
|
1186
1188
|
},
|
|
@@ -1406,14 +1408,14 @@ function st(e, t, n = void 0, s = void 0) {
|
|
|
1406
1408
|
const { tenant: a, ctx: o, space: c } = e;
|
|
1407
1409
|
(!a || !o || !c) && r({ error: "Erreur de credentials", tenant: a, ctx: o, space: c });
|
|
1408
1410
|
const d = `${e.space}/resources/v1/dslc/versiongraph?withThumbnail=0&withIsLastVersion=1&withAttributes=1&withCopyFrom=1&tenant=${e.tenant.toUpperCase()}&xrequestedwith=xmlhttprequest`;
|
|
1409
|
-
let
|
|
1411
|
+
let u;
|
|
1410
1412
|
await ue(e).then(
|
|
1411
|
-
(f) =>
|
|
1413
|
+
(f) => u = f?.SecurityContext
|
|
1412
1414
|
);
|
|
1413
|
-
let
|
|
1415
|
+
let p = {
|
|
1414
1416
|
method: "POST",
|
|
1415
1417
|
headers: {
|
|
1416
|
-
securitycontext: "ctx::" +
|
|
1418
|
+
securitycontext: "ctx::" + u,
|
|
1417
1419
|
Accept: "application/json",
|
|
1418
1420
|
"Content-Type": "application/json"
|
|
1419
1421
|
},
|
|
@@ -1433,7 +1435,7 @@ function st(e, t, n = void 0, s = void 0) {
|
|
|
1433
1435
|
s && s(f), r(f);
|
|
1434
1436
|
}
|
|
1435
1437
|
};
|
|
1436
|
-
m(d,
|
|
1438
|
+
m(d, p);
|
|
1437
1439
|
});
|
|
1438
1440
|
}
|
|
1439
1441
|
function it(e, t, n, s, i = void 0, r = void 0) {
|
|
@@ -1449,7 +1451,7 @@ function it(e, t, n, s, i = void 0, r = void 0) {
|
|
|
1449
1451
|
items: []
|
|
1450
1452
|
};
|
|
1451
1453
|
t && (d.parentId = t), d.items.push(c);
|
|
1452
|
-
let
|
|
1454
|
+
let u = {
|
|
1453
1455
|
method: "POST",
|
|
1454
1456
|
headers: {
|
|
1455
1457
|
Accept: "application/json",
|
|
@@ -1459,14 +1461,14 @@ function it(e, t, n, s, i = void 0, r = void 0) {
|
|
|
1459
1461
|
},
|
|
1460
1462
|
data: JSON.stringify(d),
|
|
1461
1463
|
type: "json",
|
|
1462
|
-
onComplete(
|
|
1463
|
-
i && i(
|
|
1464
|
+
onComplete(p) {
|
|
1465
|
+
i && i(p);
|
|
1464
1466
|
},
|
|
1465
|
-
onFailure(
|
|
1466
|
-
r && r(
|
|
1467
|
+
onFailure(p) {
|
|
1468
|
+
r && r(p);
|
|
1467
1469
|
}
|
|
1468
1470
|
};
|
|
1469
|
-
m(o,
|
|
1471
|
+
m(o, u);
|
|
1470
1472
|
});
|
|
1471
1473
|
}
|
|
1472
1474
|
function at(e, t, n, s, i = void 0, r = void 0) {
|
|
@@ -1656,7 +1658,7 @@ function ft(e, t, n = void 0, s = void 0) {
|
|
|
1656
1658
|
uri: "/resources/6w/tags",
|
|
1657
1659
|
otpCTX: "SecurityContext=preferred",
|
|
1658
1660
|
optTenant: `tenant=${r}`
|
|
1659
|
-
},
|
|
1661
|
+
}, u = `${i}${d.uri}?${d.otpCTX}&${d.optTenant}`, p = {
|
|
1660
1662
|
tag: [
|
|
1661
1663
|
{
|
|
1662
1664
|
subject: [
|
|
@@ -1671,13 +1673,13 @@ function ft(e, t, n = void 0, s = void 0) {
|
|
|
1671
1673
|
}
|
|
1672
1674
|
]
|
|
1673
1675
|
};
|
|
1674
|
-
m(
|
|
1676
|
+
m(u, {
|
|
1675
1677
|
method: "PUT",
|
|
1676
1678
|
headers: {
|
|
1677
1679
|
"Content-Type": "application/json",
|
|
1678
1680
|
Accept: "application/json"
|
|
1679
1681
|
},
|
|
1680
|
-
data: JSON.stringify(
|
|
1682
|
+
data: JSON.stringify(p),
|
|
1681
1683
|
onComplete(f) {
|
|
1682
1684
|
JSON.parse(f);
|
|
1683
1685
|
const l = {};
|
|
@@ -1690,11 +1692,11 @@ function ft(e, t, n = void 0, s = void 0) {
|
|
|
1690
1692
|
l.name = h, l.ext = _, l.createBy = S, t.info = { ...l }, ge(
|
|
1691
1693
|
e,
|
|
1692
1694
|
t,
|
|
1693
|
-
(
|
|
1694
|
-
n && n(
|
|
1695
|
+
(w) => {
|
|
1696
|
+
n && n(w);
|
|
1695
1697
|
},
|
|
1696
|
-
(
|
|
1697
|
-
s && s(
|
|
1698
|
+
(w) => {
|
|
1699
|
+
s && s(w);
|
|
1698
1700
|
}
|
|
1699
1701
|
);
|
|
1700
1702
|
},
|
|
@@ -1784,13 +1786,13 @@ function ge(e, t, n = void 0, s = void 0) {
|
|
|
1784
1786
|
method: "POST",
|
|
1785
1787
|
headers: o,
|
|
1786
1788
|
data: JSON.stringify(d),
|
|
1787
|
-
onComplete(
|
|
1788
|
-
const
|
|
1789
|
-
n(
|
|
1789
|
+
onComplete(u) {
|
|
1790
|
+
const p = JSON.parse(u);
|
|
1791
|
+
n(p);
|
|
1790
1792
|
},
|
|
1791
|
-
onFailure(
|
|
1792
|
-
const f =
|
|
1793
|
-
f.msg =
|
|
1793
|
+
onFailure(u, p) {
|
|
1794
|
+
const f = u;
|
|
1795
|
+
f.msg = p.errormsg, f.errCode = p.errorcode, console.log("❌ sendDirectMessage => ", f), s && s(f), console.log("Erreur de recuperation d'id du doc et des tags", u);
|
|
1794
1796
|
}
|
|
1795
1797
|
});
|
|
1796
1798
|
}
|
|
@@ -1821,12 +1823,12 @@ function mt(e, t, n = void 0, s = void 0) {
|
|
|
1821
1823
|
"Content-Type": "application/json",
|
|
1822
1824
|
Accept: "application/json,text/javascript,*/*"
|
|
1823
1825
|
},
|
|
1824
|
-
onComplete(
|
|
1825
|
-
n && n(
|
|
1826
|
+
onComplete(u) {
|
|
1827
|
+
n && n(u);
|
|
1826
1828
|
},
|
|
1827
|
-
onFailure(
|
|
1828
|
-
const f =
|
|
1829
|
-
f.msg =
|
|
1829
|
+
onFailure(u, p) {
|
|
1830
|
+
const f = u;
|
|
1831
|
+
f.msg = p.errormsg, f.errCode = p.errorcode, console.log("❌ sendDirectMessage => ", f), s && s(f);
|
|
1830
1832
|
}
|
|
1831
1833
|
});
|
|
1832
1834
|
}
|
|
@@ -1847,9 +1849,9 @@ function gt(e, t = "", n = void 0, s = void 0) {
|
|
|
1847
1849
|
onComplete(d) {
|
|
1848
1850
|
n && n(JSON.parse(d));
|
|
1849
1851
|
},
|
|
1850
|
-
onFailure(d,
|
|
1851
|
-
const
|
|
1852
|
-
|
|
1852
|
+
onFailure(d, u) {
|
|
1853
|
+
const p = d;
|
|
1854
|
+
p.msg = u.error, s && s(p);
|
|
1853
1855
|
}
|
|
1854
1856
|
});
|
|
1855
1857
|
}
|
|
@@ -1940,9 +1942,9 @@ function yt(e, t = void 0, n = void 0) {
|
|
|
1940
1942
|
"X-DS-SWYM-CSRFTOKEN": a.result.ServerToken
|
|
1941
1943
|
},
|
|
1942
1944
|
onComplete(o, c, d) {
|
|
1943
|
-
const
|
|
1945
|
+
const p = JSON.parse(o).result;
|
|
1944
1946
|
let f = 0;
|
|
1945
|
-
|
|
1947
|
+
p.forEach((l) => {
|
|
1946
1948
|
const g = {
|
|
1947
1949
|
description: l.description,
|
|
1948
1950
|
id: l.id,
|
|
@@ -1955,7 +1957,7 @@ function yt(e, t = void 0, n = void 0) {
|
|
|
1955
1957
|
e,
|
|
1956
1958
|
l.id,
|
|
1957
1959
|
(h) => {
|
|
1958
|
-
f++, g.members = h, r.push(g), f ===
|
|
1960
|
+
f++, g.members = h, r.push(g), f === p.length && t && t(r);
|
|
1959
1961
|
},
|
|
1960
1962
|
(h) => n(h)
|
|
1961
1963
|
);
|
|
@@ -2030,23 +2032,23 @@ function wt(e, t, n = void 0, s = void 0) {
|
|
|
2030
2032
|
senderName: `${e.currentUser.first_name} ${e.currentUser.last_name}`,
|
|
2031
2033
|
msg: ye(t.msg)
|
|
2032
2034
|
};
|
|
2033
|
-
let
|
|
2035
|
+
let u = !1;
|
|
2034
2036
|
_e(
|
|
2035
2037
|
c.users,
|
|
2036
|
-
(
|
|
2037
|
-
|
|
2038
|
+
(p) => {
|
|
2039
|
+
p !== void 0 && (d.id_msg = p.id, u = !0, P(e, d));
|
|
2038
2040
|
},
|
|
2039
|
-
(
|
|
2040
|
-
|
|
2041
|
+
(p) => {
|
|
2042
|
+
u = !1, console.log("_3dSwym_findCommunityToInstantMSG callback", p), s && s(p), d.id_msg = "";
|
|
2041
2043
|
}
|
|
2042
|
-
),
|
|
2043
|
-
|
|
2044
|
+
), u === !1 && setTimeout(() => {
|
|
2045
|
+
u === !1 && C(e, (p) => {
|
|
2044
2046
|
m(o, {
|
|
2045
2047
|
method: "POST",
|
|
2046
2048
|
headers: {
|
|
2047
2049
|
"Content-Type": "application/json",
|
|
2048
2050
|
Accept: "application/json",
|
|
2049
|
-
"X-DS-SWYM-CSRFTOKEN":
|
|
2051
|
+
"X-DS-SWYM-CSRFTOKEN": p.result.ServerToken
|
|
2050
2052
|
},
|
|
2051
2053
|
data: JSON.stringify(c),
|
|
2052
2054
|
type: "json",
|
|
@@ -2073,16 +2075,16 @@ function _e(e, t, n, s) {
|
|
|
2073
2075
|
},
|
|
2074
2076
|
onComplete(a) {
|
|
2075
2077
|
const o = JSON.parse(a), c = [];
|
|
2076
|
-
o.result.forEach((
|
|
2077
|
-
|
|
2078
|
+
o.result.forEach((p) => {
|
|
2079
|
+
p.users = p.users.sort((f, l) => f.login.localeCompare(l.login)), p.users.length === t.length && c.push(p);
|
|
2078
2080
|
});
|
|
2079
|
-
const d = t.sort(),
|
|
2081
|
+
const d = t.sort(), u = c.find((p) => {
|
|
2080
2082
|
const f = [];
|
|
2081
|
-
return
|
|
2083
|
+
return p.users.forEach((l) => {
|
|
2082
2084
|
f.push(l.login);
|
|
2083
2085
|
}), JSON.stringify(f) === JSON.stringify(d);
|
|
2084
2086
|
});
|
|
2085
|
-
n &&
|
|
2087
|
+
n && u !== void 0 ? n(u) : (s || u === void 0) && s(u);
|
|
2086
2088
|
},
|
|
2087
2089
|
onFailure(a) {
|
|
2088
2090
|
const o = a;
|
|
@@ -2117,13 +2119,13 @@ function P(e, t, n = void 0, s = void 0) {
|
|
|
2117
2119
|
},
|
|
2118
2120
|
data: JSON.stringify(a),
|
|
2119
2121
|
type: "json",
|
|
2120
|
-
onComplete(c, d,
|
|
2121
|
-
const
|
|
2122
|
-
|
|
2122
|
+
onComplete(c, d, u) {
|
|
2123
|
+
const p = c;
|
|
2124
|
+
p.status = u.status, p.response = JSON.parse(u.response), console.log("✅ _3dSwym_sendDirectMessageData => ", p), n && n(p);
|
|
2123
2125
|
},
|
|
2124
2126
|
onFailure(c, d) {
|
|
2125
|
-
const
|
|
2126
|
-
|
|
2127
|
+
const u = c;
|
|
2128
|
+
u.msg = d.errormsg, u.errCode = d.errorcode, console.log("❌ sendDirectMessage => ", u), s && s(u);
|
|
2127
2129
|
}
|
|
2128
2130
|
});
|
|
2129
2131
|
});
|
|
@@ -2163,13 +2165,13 @@ function Ct(e, t, n = void 0, s = void 0) {
|
|
|
2163
2165
|
headers: d,
|
|
2164
2166
|
data: JSON.stringify(o),
|
|
2165
2167
|
type: "json",
|
|
2166
|
-
onComplete(
|
|
2167
|
-
const l = JSON.parse(
|
|
2168
|
+
onComplete(u, p, f) {
|
|
2169
|
+
const l = JSON.parse(u);
|
|
2168
2170
|
l.status = f.status, l.response = f.response, n && n(l);
|
|
2169
2171
|
},
|
|
2170
|
-
onFailure(
|
|
2171
|
-
const l =
|
|
2172
|
-
l.status =
|
|
2172
|
+
onFailure(u, p, f) {
|
|
2173
|
+
const l = u;
|
|
2174
|
+
l.status = p.status, l.response = p.errormsg, s && s(l);
|
|
2173
2175
|
}
|
|
2174
2176
|
});
|
|
2175
2177
|
});
|
|
@@ -2230,15 +2232,15 @@ function bt(e, t = void 0, n = void 0) {
|
|
|
2230
2232
|
},
|
|
2231
2233
|
method: "POST",
|
|
2232
2234
|
data: JSON.stringify(r),
|
|
2233
|
-
onComplete(c, d,
|
|
2234
|
-
const
|
|
2235
|
-
typeof
|
|
2235
|
+
onComplete(c, d, u) {
|
|
2236
|
+
const p = { response: c };
|
|
2237
|
+
typeof p.response == "string" && (p.response = JSON.parse(p.response)), p.status = u.status, t && t(p);
|
|
2236
2238
|
},
|
|
2237
|
-
onFailure(c, d,
|
|
2238
|
-
const
|
|
2239
|
+
onFailure(c, d, u) {
|
|
2240
|
+
const p = JSON.parse(d), f = JSON.parse(c), l = new Error(
|
|
2239
2241
|
`Erreur sur cette requête : ${s.base + s.uri}`,
|
|
2240
2242
|
{
|
|
2241
|
-
cause: { head:
|
|
2243
|
+
cause: { head: p, rep: f }
|
|
2242
2244
|
}
|
|
2243
2245
|
);
|
|
2244
2246
|
n && n(l);
|
|
@@ -2268,8 +2270,8 @@ function Tt(e, t, n = void 0, s = void 0) {
|
|
|
2268
2270
|
n && n(o);
|
|
2269
2271
|
},
|
|
2270
2272
|
onFailure(o, c, d) {
|
|
2271
|
-
const
|
|
2272
|
-
|
|
2273
|
+
const u = o;
|
|
2274
|
+
u.status = c.status, u.response = c.errormsg, s && s(u);
|
|
2273
2275
|
}
|
|
2274
2276
|
});
|
|
2275
2277
|
});
|
|
@@ -2311,8 +2313,8 @@ function $t(e, t, n) {
|
|
|
2311
2313
|
community_id: o,
|
|
2312
2314
|
status_comment: c,
|
|
2313
2315
|
status_id: d,
|
|
2314
|
-
message:
|
|
2315
|
-
} = e,
|
|
2316
|
+
message: u
|
|
2317
|
+
} = e, p = {
|
|
2316
2318
|
base: `${s}`,
|
|
2317
2319
|
uri: "/api/idea/edit"
|
|
2318
2320
|
}, l = {
|
|
@@ -2330,7 +2332,7 @@ function $t(e, t, n) {
|
|
|
2330
2332
|
community_id: o,
|
|
2331
2333
|
status_comment: c,
|
|
2332
2334
|
status_id: d,
|
|
2333
|
-
message:
|
|
2335
|
+
message: u,
|
|
2334
2336
|
published: "1"
|
|
2335
2337
|
}
|
|
2336
2338
|
}),
|
|
@@ -2345,14 +2347,14 @@ function $t(e, t, n) {
|
|
|
2345
2347
|
n && n(g);
|
|
2346
2348
|
}
|
|
2347
2349
|
};
|
|
2348
|
-
m(
|
|
2350
|
+
m(p.base + p.uri, l);
|
|
2349
2351
|
}
|
|
2350
2352
|
function xt(e, t, n = void 0, s = void 0) {
|
|
2351
2353
|
const { _3DSwym: i } = e;
|
|
2352
2354
|
let { community_id: r, limit: a, page: o, search: c } = t;
|
|
2353
|
-
const d = [],
|
|
2354
|
-
let
|
|
2355
|
-
o || (o =
|
|
2355
|
+
const d = [], u = 1;
|
|
2356
|
+
let p = !1, f = 2;
|
|
2357
|
+
o || (o = u), a || (a = 100);
|
|
2356
2358
|
const l = {
|
|
2357
2359
|
uri: "/api/idea/list",
|
|
2358
2360
|
comId: `/community_id/${r}`,
|
|
@@ -2367,13 +2369,13 @@ function xt(e, t, n = void 0, s = void 0) {
|
|
|
2367
2369
|
headers: {
|
|
2368
2370
|
"X-DS-SWYM-CSRFTOKEN": h.result.ServerToken
|
|
2369
2371
|
},
|
|
2370
|
-
onComplete(
|
|
2371
|
-
const
|
|
2372
|
-
if (f = Math.ceil(Number(
|
|
2372
|
+
onComplete(w) {
|
|
2373
|
+
const y = { response: JSON.parse(w) };
|
|
2374
|
+
if (f = Math.ceil(Number(y.response.nb_result) / 100), w && f >= o) {
|
|
2373
2375
|
if (o++, l.page = `/page/${o}`, S = `${i}${l.uri}${l.comId}${l.limit}${l.page}`, !c)
|
|
2374
|
-
d.push(
|
|
2376
|
+
d.push(y.response.result);
|
|
2375
2377
|
else {
|
|
2376
|
-
const T =
|
|
2378
|
+
const T = y.response.result.find(
|
|
2377
2379
|
(R) => R.title.includes(c)
|
|
2378
2380
|
);
|
|
2379
2381
|
if (T) {
|
|
@@ -2382,19 +2384,19 @@ function xt(e, t, n = void 0, s = void 0) {
|
|
|
2382
2384
|
}
|
|
2383
2385
|
}
|
|
2384
2386
|
if (n && f < o && !c) {
|
|
2385
|
-
|
|
2387
|
+
p = !0, n(d);
|
|
2386
2388
|
return;
|
|
2387
2389
|
}
|
|
2388
2390
|
_(S);
|
|
2389
2391
|
}
|
|
2390
2392
|
},
|
|
2391
|
-
onFailure(
|
|
2392
|
-
const T =
|
|
2393
|
-
T.status =
|
|
2393
|
+
onFailure(w, y) {
|
|
2394
|
+
const T = w;
|
|
2395
|
+
T.status = y.status, T.response = y.errormsg, s && s(T);
|
|
2394
2396
|
}
|
|
2395
2397
|
});
|
|
2396
2398
|
};
|
|
2397
|
-
|
|
2399
|
+
p || _(g);
|
|
2398
2400
|
});
|
|
2399
2401
|
}
|
|
2400
2402
|
function Se(e) {
|
|
@@ -2492,9 +2494,9 @@ function Ut(e, t = void 0, n = void 0) {
|
|
|
2492
2494
|
onComplete(d) {
|
|
2493
2495
|
t && t(d);
|
|
2494
2496
|
},
|
|
2495
|
-
onFailure(d,
|
|
2496
|
-
const
|
|
2497
|
-
|
|
2497
|
+
onFailure(d, u) {
|
|
2498
|
+
const p = d;
|
|
2499
|
+
p.status = u.status, p.response = u.errormsg, n && n(p);
|
|
2498
2500
|
}
|
|
2499
2501
|
});
|
|
2500
2502
|
} else
|
|
@@ -2514,15 +2516,15 @@ function It(e, t = void 0, n = void 0) {
|
|
|
2514
2516
|
console.log("_3DSwym_get_currentUser | url", a), m(a, {
|
|
2515
2517
|
method: "GET",
|
|
2516
2518
|
onComplete(o, c, d) {
|
|
2517
|
-
let
|
|
2518
|
-
|
|
2519
|
-
let
|
|
2519
|
+
let u = o.replace(/\"\[/g, "[").replace(/\]\"/g, "]").replace(/\"{/g, "{").replace(/}\"/g, "}").replace(/\\/g, "");
|
|
2520
|
+
u = u.replace(/\"\[/g, "[").replace(/\]\"/g, "]").replace(/\"{/g, "{").replace(/}\"/g, "}").replace(/\\/g, ""), console.log("result", u);
|
|
2521
|
+
let p = {};
|
|
2520
2522
|
try {
|
|
2521
|
-
|
|
2523
|
+
p = JSON.parse(u);
|
|
2522
2524
|
} catch (f) {
|
|
2523
2525
|
i("ERROR | _3DSwym_get_currentUser => JSON.Parse()", f);
|
|
2524
2526
|
}
|
|
2525
|
-
console.log(
|
|
2527
|
+
console.log(p), p.first_name = p?.firstName ? p.firstName : "", p.last_name = p?.lastName ? p.lastName : "", console.log("_3DSwym_get_currentUser | info", p), r = p, s(p);
|
|
2526
2528
|
},
|
|
2527
2529
|
onFailure(o) {
|
|
2528
2530
|
i("ERROR | _3DSwym_get_currentUser => _3DDashboard + /api/users/current", o);
|
|
@@ -2570,14 +2572,14 @@ function Ft(e, t = void 0, n = void 0) {
|
|
|
2570
2572
|
},
|
|
2571
2573
|
data: JSON.stringify({ richMessage: a }),
|
|
2572
2574
|
type: "json",
|
|
2573
|
-
onComplete(
|
|
2575
|
+
onComplete(u, p, f) {
|
|
2574
2576
|
const l = {
|
|
2575
|
-
response: typeof
|
|
2577
|
+
response: typeof u == "string" ? JSON.parse(u) : u
|
|
2576
2578
|
};
|
|
2577
2579
|
l.status = f.status, t && t(l);
|
|
2578
2580
|
},
|
|
2579
|
-
onFailure(
|
|
2580
|
-
n && n(
|
|
2581
|
+
onFailure(u) {
|
|
2582
|
+
n && n(u);
|
|
2581
2583
|
}
|
|
2582
2584
|
};
|
|
2583
2585
|
m(o, d);
|