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