@beam3_dev/api_module 0.0.64 → 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 +585 -586
- 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
|
@@ -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
|
-
r
|
|
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
|
-
|
|
118
|
+
O(["DS/TagNavigatorProxy/TagNavigatorProxy"], (s) => {
|
|
119
|
+
let n;
|
|
120
|
+
n === void 0 && (n = s.createProxy({
|
|
121
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 = A.getValue("PlatFormInstanceId")), (!e || e === "") && (e = void 0), t && (console.log("i3DXCompassServices",
|
|
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 i =
|
|
194
|
-
i.msg =
|
|
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,13 +308,13 @@ 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",
|
|
@@ -322,37 +322,37 @@ function Ce(e, t, n, s = void 0, o = void 0) {
|
|
|
322
322
|
nexURImem: "/members",
|
|
323
323
|
OPTsTI: "?$mask=dsaccess:Mask.GroupUI.Properties",
|
|
324
324
|
OPTsTenant: `tenant=dstenant:${i}`
|
|
325
|
-
},
|
|
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:
|
|
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
356
|
f(i, {
|
|
357
357
|
opts: {
|
|
358
358
|
method: "GET",
|
|
@@ -362,165 +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
|
-
async function J(e, t,
|
|
372
|
+
async function J(e, t, s) {
|
|
373
373
|
if (e.space) {
|
|
374
|
-
const
|
|
375
|
-
f(
|
|
376
|
-
onComplete(
|
|
377
|
-
|
|
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);
|
|
378
378
|
},
|
|
379
|
-
onFailure(
|
|
380
|
-
|
|
379
|
+
onFailure(a, c, i) {
|
|
380
|
+
s && s({ error: a, headers: c, xhr: i });
|
|
381
381
|
}
|
|
382
382
|
});
|
|
383
383
|
}
|
|
384
384
|
}
|
|
385
|
-
async function G(e, t = void 0,
|
|
386
|
-
const
|
|
385
|
+
async function G(e, t = void 0, s = void 0, n = void 0) {
|
|
386
|
+
const a = e.space;
|
|
387
387
|
if (t === void 0) {
|
|
388
388
|
console.log("Le paramètre docid est obligatoire");
|
|
389
389
|
return;
|
|
390
390
|
}
|
|
391
|
-
const
|
|
392
|
-
f(
|
|
393
|
-
onComplete(i,
|
|
391
|
+
const c = a + `/resources/v1/modeler/documents/${t}`;
|
|
392
|
+
f(c, {
|
|
393
|
+
onComplete(i, o, r) {
|
|
394
394
|
const d = JSON.parse(i);
|
|
395
|
-
|
|
395
|
+
s && s(d);
|
|
396
396
|
},
|
|
397
397
|
onFailure(i) {
|
|
398
|
-
|
|
398
|
+
n && n(i);
|
|
399
399
|
}
|
|
400
400
|
});
|
|
401
401
|
}
|
|
402
|
-
function k(e, t = void 0,
|
|
402
|
+
function k(e, t = void 0, s = void 0) {
|
|
403
403
|
if (e.objID && e.objID !== "") {
|
|
404
|
-
let
|
|
405
|
-
console.log("_3DSpace_get_csrf / url",
|
|
406
|
-
onComplete(
|
|
407
|
-
const
|
|
408
|
-
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);
|
|
409
409
|
},
|
|
410
|
-
onFailure(
|
|
411
|
-
|
|
410
|
+
onFailure(a) {
|
|
411
|
+
s && s(a);
|
|
412
412
|
}
|
|
413
413
|
});
|
|
414
414
|
} else
|
|
415
415
|
C(
|
|
416
416
|
e,
|
|
417
|
-
(
|
|
418
|
-
console.log("_3DSpace_get_csrf / _3DSpace_csrf",
|
|
417
|
+
(n) => {
|
|
418
|
+
console.log("_3DSpace_get_csrf / _3DSpace_csrf", n), t && t(n);
|
|
419
419
|
},
|
|
420
|
-
(
|
|
421
|
-
|
|
420
|
+
(n) => {
|
|
421
|
+
s && s(n);
|
|
422
422
|
}
|
|
423
423
|
);
|
|
424
424
|
}
|
|
425
|
-
function C(e, t = void 0,
|
|
425
|
+
function C(e, t = void 0, s = void 0) {
|
|
426
426
|
if (e.space) {
|
|
427
|
-
const
|
|
428
|
-
f(
|
|
429
|
-
onComplete(
|
|
430
|
-
const
|
|
431
|
-
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);
|
|
432
432
|
},
|
|
433
|
-
onFailure(
|
|
434
|
-
|
|
433
|
+
onFailure(a, c, i) {
|
|
434
|
+
s && s({ response: a, headers: c, xhr: i });
|
|
435
435
|
}
|
|
436
436
|
});
|
|
437
437
|
} else
|
|
438
|
-
|
|
438
|
+
s && s("ERROR : url du 3DSpace non défini.");
|
|
439
439
|
}
|
|
440
|
-
function U(e, t = void 0,
|
|
441
|
-
let
|
|
440
|
+
function U(e, t = void 0, s = void 0) {
|
|
441
|
+
let n = e.space + `/resources/v1/modeler/documents/${e.objID}/files/DownloadTicket`;
|
|
442
442
|
k(
|
|
443
443
|
e,
|
|
444
|
-
(
|
|
444
|
+
(a) => {
|
|
445
445
|
console.log(
|
|
446
446
|
"_3DSpace_get_ticket / onComplete / ☠️ info => ",
|
|
447
|
-
|
|
447
|
+
a,
|
|
448
448
|
e.token
|
|
449
|
-
), f(
|
|
449
|
+
), f(n, {
|
|
450
450
|
method: "PUT",
|
|
451
451
|
headers: {
|
|
452
452
|
ENO_CSRF_TOKEN: e.token
|
|
453
453
|
},
|
|
454
|
-
onComplete(
|
|
455
|
-
const
|
|
456
|
-
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);
|
|
457
457
|
},
|
|
458
|
-
onFailure(
|
|
459
|
-
console.warn("☠️ error => ",
|
|
458
|
+
onFailure(c, i) {
|
|
459
|
+
console.warn("☠️ error => ", c, i), s && s(c, i);
|
|
460
460
|
}
|
|
461
461
|
});
|
|
462
462
|
},
|
|
463
|
-
(
|
|
464
|
-
console.warn("_3DSpace_get_ticket / error => ",
|
|
463
|
+
(a) => {
|
|
464
|
+
console.warn("_3DSpace_get_ticket / error => ", a), s && s(a);
|
|
465
465
|
}
|
|
466
466
|
);
|
|
467
467
|
}
|
|
468
|
-
function Ne(e, t,
|
|
469
|
-
const
|
|
470
|
-
|
|
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, {
|
|
471
471
|
method: "PUT",
|
|
472
472
|
headers: {
|
|
473
|
-
ENO_CSRF_TOKEN:
|
|
473
|
+
ENO_CSRF_TOKEN: s
|
|
474
474
|
},
|
|
475
475
|
onComplete(i) {
|
|
476
|
-
let
|
|
477
|
-
if (console.log("☠️ info => ",
|
|
476
|
+
let o = JSON.parse(i);
|
|
477
|
+
if (console.log("☠️ info => ", o), o.success === !0)
|
|
478
478
|
try {
|
|
479
|
-
const
|
|
480
|
-
|
|
481
|
-
} catch (
|
|
482
|
-
|
|
479
|
+
const r = o.data[0].dataelements.ticketURL;
|
|
480
|
+
n && n(r);
|
|
481
|
+
} catch (r) {
|
|
482
|
+
a && a(r);
|
|
483
483
|
}
|
|
484
484
|
},
|
|
485
485
|
onFailure(i) {
|
|
486
|
-
|
|
486
|
+
a && a(i);
|
|
487
487
|
}
|
|
488
488
|
});
|
|
489
489
|
}
|
|
490
|
-
function K(e, t,
|
|
490
|
+
function K(e, t, s, n, a, c = void 0, i = void 0) {
|
|
491
491
|
k(
|
|
492
492
|
e,
|
|
493
493
|
t,
|
|
494
|
-
(
|
|
494
|
+
(o) => {
|
|
495
495
|
W(
|
|
496
496
|
e,
|
|
497
497
|
t,
|
|
498
|
-
n,
|
|
499
498
|
s,
|
|
500
|
-
|
|
501
|
-
a
|
|
502
|
-
|
|
499
|
+
n,
|
|
500
|
+
a,
|
|
501
|
+
o.csrf.value,
|
|
502
|
+
c,
|
|
503
503
|
i
|
|
504
504
|
);
|
|
505
505
|
}
|
|
506
506
|
);
|
|
507
507
|
}
|
|
508
|
-
function W(e, t,
|
|
509
|
-
const
|
|
510
|
-
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, {
|
|
511
511
|
method: "PUT",
|
|
512
512
|
headers: {
|
|
513
|
-
ENO_CSRF_TOKEN:
|
|
513
|
+
ENO_CSRF_TOKEN: c
|
|
514
514
|
},
|
|
515
515
|
onComplete(d, l, p) {
|
|
516
516
|
const u = JSON.parse(d).data[0].dataelements, m = new FormData();
|
|
517
|
-
m.append("__fcs__jobTicket", u.ticket), m.append("file_0",
|
|
517
|
+
m.append("__fcs__jobTicket", u.ticket), m.append("file_0", n, a);
|
|
518
518
|
const g = {};
|
|
519
519
|
g.method = "POST", g.data = m, g.onComplete = function(h) {
|
|
520
520
|
let S = "temp_" + Date.now(), _ = {
|
|
521
521
|
method: "PUT",
|
|
522
522
|
headers: {
|
|
523
|
-
ENO_CSRF_TOKEN:
|
|
523
|
+
ENO_CSRF_TOKEN: c
|
|
524
524
|
},
|
|
525
525
|
data: JSON.stringify({
|
|
526
526
|
data: [
|
|
@@ -529,9 +529,9 @@ function W(e, t, n, s, o, r, i = void 0, a = void 0) {
|
|
|
529
529
|
relateddata: {
|
|
530
530
|
files: [
|
|
531
531
|
{
|
|
532
|
-
id:
|
|
532
|
+
id: s,
|
|
533
533
|
dataelements: {
|
|
534
|
-
title:
|
|
534
|
+
title: a,
|
|
535
535
|
receipt: h
|
|
536
536
|
},
|
|
537
537
|
updateAction: "REVISE"
|
|
@@ -547,7 +547,7 @@ function W(e, t, n, s, o, r, i = void 0, a = void 0) {
|
|
|
547
547
|
i && i(y);
|
|
548
548
|
},
|
|
549
549
|
onFailure(y) {
|
|
550
|
-
|
|
550
|
+
o && o(y);
|
|
551
551
|
}
|
|
552
552
|
};
|
|
553
553
|
f(
|
|
@@ -555,17 +555,17 @@ function W(e, t, n, s, o, r, i = void 0, a = void 0) {
|
|
|
555
555
|
_
|
|
556
556
|
);
|
|
557
557
|
}, g.onFailure = function(h) {
|
|
558
|
-
|
|
558
|
+
o && o(h);
|
|
559
559
|
}, g.timeout = 0, f(u.ticketURL, g);
|
|
560
560
|
}
|
|
561
561
|
});
|
|
562
562
|
}
|
|
563
|
-
async function ke(e, t,
|
|
564
|
-
const i = e.space,
|
|
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)], {
|
|
565
565
|
type: "text/plain"
|
|
566
566
|
}), p = {
|
|
567
567
|
url_Ticket: `${i}/resources/v1/modeler/documents/files/CheckinTicket`,
|
|
568
|
-
url_Post: `${i}/resources/v1/modeler/documents/?SecurityContext=ctx::${
|
|
568
|
+
url_Post: `${i}/resources/v1/modeler/documents/?SecurityContext=ctx::${r}`
|
|
569
569
|
};
|
|
570
570
|
if (!i && i !== "") {
|
|
571
571
|
console.log("le store._3DSpace est vide");
|
|
@@ -574,20 +574,20 @@ async function ke(e, t, n, s, o = void 0, r = void 0) {
|
|
|
574
574
|
f(p.url_Ticket, {
|
|
575
575
|
method: "PUT",
|
|
576
576
|
headers: {
|
|
577
|
-
ENO_CSRF_TOKEN:
|
|
577
|
+
ENO_CSRF_TOKEN: o.value
|
|
578
578
|
},
|
|
579
579
|
onComplete(u, m, g) {
|
|
580
580
|
const h = JSON.parse(u).data[0].dataelements;
|
|
581
|
-
d.append("__fcs__jobTicket", h.ticket), d.append("filename", l,
|
|
581
|
+
d.append("__fcs__jobTicket", h.ticket), d.append("filename", l, s);
|
|
582
582
|
const S = {
|
|
583
583
|
method: "POST",
|
|
584
584
|
data: d,
|
|
585
585
|
onComplete(T) {
|
|
586
|
-
if (
|
|
586
|
+
if (r !== "" && o !== "") {
|
|
587
587
|
const D = {
|
|
588
588
|
method: "POST",
|
|
589
589
|
headers: {
|
|
590
|
-
ENO_CSRF_TOKEN:
|
|
590
|
+
ENO_CSRF_TOKEN: o,
|
|
591
591
|
Accept: "application/json",
|
|
592
592
|
"Content-Type": "application/json"
|
|
593
593
|
},
|
|
@@ -596,15 +596,15 @@ async function ke(e, t, n, s, o = void 0, r = void 0) {
|
|
|
596
596
|
{
|
|
597
597
|
type: "Document",
|
|
598
598
|
dataelements: {
|
|
599
|
-
title: `Title_${
|
|
599
|
+
title: `Title_${s.toLowerCase().split(" ").join("_")}`,
|
|
600
600
|
policy: "Document Release",
|
|
601
|
-
description:
|
|
601
|
+
description: n
|
|
602
602
|
},
|
|
603
603
|
relateddata: {
|
|
604
604
|
files: [
|
|
605
605
|
{
|
|
606
606
|
dataelements: {
|
|
607
|
-
title: `${
|
|
607
|
+
title: `${s}.json`,
|
|
608
608
|
receipt: T
|
|
609
609
|
}
|
|
610
610
|
}
|
|
@@ -619,32 +619,32 @@ async function ke(e, t, n, s, o = void 0, r = void 0) {
|
|
|
619
619
|
onComplete: _,
|
|
620
620
|
onFailure: y
|
|
621
621
|
};
|
|
622
|
-
|
|
622
|
+
r !== "" && f(p.url_Post, D);
|
|
623
623
|
} else
|
|
624
624
|
console.warn("le store est vide");
|
|
625
625
|
},
|
|
626
626
|
onFailure: y
|
|
627
627
|
};
|
|
628
628
|
function _(T) {
|
|
629
|
-
console.log("Success -- response ", T.data[0]),
|
|
629
|
+
console.log("Success -- response ", T.data[0]), a && a(T);
|
|
630
630
|
}
|
|
631
631
|
function y(T, D) {
|
|
632
632
|
console.log("Erreur -- response ", T, `
|
|
633
|
-
headers `, D),
|
|
633
|
+
headers `, D), c && c(T);
|
|
634
634
|
}
|
|
635
635
|
f(h.ticketURL, S);
|
|
636
636
|
}
|
|
637
637
|
});
|
|
638
638
|
}
|
|
639
|
-
function b(e, t = void 0,
|
|
639
|
+
function b(e, t = void 0, s = void 0, n = void 0, a = void 0, c = void 0) {
|
|
640
640
|
const i = `${e.space}/resources/modeler/pno/person?current=true&select=preferredcredentials&select=collabspaces`;
|
|
641
641
|
f(i, {
|
|
642
642
|
method: "GET",
|
|
643
|
-
onComplete(
|
|
644
|
-
const
|
|
643
|
+
onComplete(o) {
|
|
644
|
+
const r = JSON.parse(o);
|
|
645
645
|
let d = "", l, p, u;
|
|
646
646
|
if (t) {
|
|
647
|
-
let m =
|
|
647
|
+
let m = r.collabspaces.find((g) => g.title === t);
|
|
648
648
|
if (m) {
|
|
649
649
|
l = t;
|
|
650
650
|
let g = m.couples;
|
|
@@ -652,98 +652,100 @@ function b(e, t = void 0, n = void 0, s = void 0, o = void 0, r = void 0) {
|
|
|
652
652
|
(h, S, _) => S === _.findIndex(
|
|
653
653
|
(y) => y.organization.pid === h.organization.pid && y.role.pid === h.role.pid
|
|
654
654
|
)
|
|
655
|
-
),
|
|
655
|
+
), s && (Array.isArray(s) ? s.forEach((h) => {
|
|
656
656
|
u || g.forEach((S) => {
|
|
657
|
-
if (h === S.role.name &&
|
|
658
|
-
u = h, p =
|
|
657
|
+
if (h === S.role.name && n === S.organization.title)
|
|
658
|
+
u = h, p = n;
|
|
659
659
|
else if (h === S.role.name) {
|
|
660
660
|
let _ = g.filter(
|
|
661
661
|
(y) => y.role.name === h
|
|
662
662
|
);
|
|
663
|
-
_.length === 1 ? (u = _[0].role.name, p = _[0].organization.title) :
|
|
663
|
+
_.length === 1 ? (u = _[0].role.name, p = _[0].organization.title) : c(_);
|
|
664
664
|
}
|
|
665
665
|
});
|
|
666
666
|
}) : g.forEach((h) => {
|
|
667
|
-
if (
|
|
668
|
-
u =
|
|
669
|
-
else if (
|
|
667
|
+
if (s === h.role.name && n === h.organization.title)
|
|
668
|
+
u = s, p = n;
|
|
669
|
+
else if (s === h.role.name) {
|
|
670
670
|
let S = g.filter(
|
|
671
|
-
(_) => _.role.name ===
|
|
671
|
+
(_) => _.role.name === s
|
|
672
672
|
);
|
|
673
|
-
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);
|
|
674
674
|
}
|
|
675
675
|
}));
|
|
676
676
|
}
|
|
677
677
|
}
|
|
678
|
-
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));
|
|
679
679
|
},
|
|
680
|
-
onFailure(
|
|
681
|
-
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);
|
|
682
682
|
}
|
|
683
683
|
});
|
|
684
684
|
}
|
|
685
|
-
async function I(e, t = void 0,
|
|
686
|
-
const
|
|
687
|
-
|
|
685
|
+
async function I(e, t = void 0, s = void 0) {
|
|
686
|
+
const n = e.objID;
|
|
687
|
+
(!n || n === "") && console.warn(
|
|
688
688
|
"_3DSpace_download_doc() / Le paramètre objectId est obligatoire"
|
|
689
689
|
), (e.space === "" || !e.space) && console.warn(
|
|
690
690
|
"_3DSpace_download_doc() / Le paramètre space est obligatoire"
|
|
691
|
-
), (e.token === "" || !e.token) && (
|
|
691
|
+
), (e.token === "" || !e.token) && (J(
|
|
692
692
|
e,
|
|
693
|
-
(
|
|
694
|
-
e.token =
|
|
693
|
+
(a) => {
|
|
694
|
+
e.token = a;
|
|
695
695
|
},
|
|
696
|
-
(
|
|
697
|
-
console.log("☠️ error => ",
|
|
696
|
+
(a) => {
|
|
697
|
+
console.log("☠️ error => ", a);
|
|
698
698
|
}
|
|
699
699
|
), console.warn(
|
|
700
700
|
"_3DSpace_download_doc() / Le paramètre token est obligatoire"
|
|
701
701
|
)), console.log("_3DSpace_download_doc / credentials", e), U(
|
|
702
702
|
e,
|
|
703
|
-
(
|
|
704
|
-
f(
|
|
703
|
+
(a) => {
|
|
704
|
+
f(a, {
|
|
705
705
|
headers: {
|
|
706
|
+
"Content-Type": "application/json",
|
|
707
|
+
Accept: "application/json",
|
|
706
708
|
ENO_CSRF_TOKEN: e.token
|
|
707
709
|
},
|
|
708
|
-
onComplete(
|
|
709
|
-
const
|
|
710
|
-
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);
|
|
711
713
|
},
|
|
712
|
-
onFailure(
|
|
713
|
-
|
|
714
|
+
onFailure(c, i, o) {
|
|
715
|
+
s && (console.log("error http", c), s({ error: c, headers: i, xhr: o }));
|
|
714
716
|
}
|
|
715
717
|
});
|
|
716
718
|
},
|
|
717
|
-
(
|
|
718
|
-
|
|
719
|
+
(a) => {
|
|
720
|
+
s && s(a), console.log("*_3dspace_download_doc / error file URL *", a);
|
|
719
721
|
}
|
|
720
722
|
);
|
|
721
723
|
}
|
|
722
|
-
async function X(e, t,
|
|
723
|
-
let
|
|
724
|
-
for (let
|
|
725
|
-
const
|
|
726
|
-
|
|
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);
|
|
727
729
|
}
|
|
728
|
-
const i = (
|
|
730
|
+
const i = (o) => {
|
|
729
731
|
V(
|
|
730
732
|
e,
|
|
731
|
-
o
|
|
733
|
+
a[o],
|
|
732
734
|
() => {
|
|
733
|
-
|
|
735
|
+
o++, o < a.length && i(o);
|
|
734
736
|
},
|
|
735
|
-
(
|
|
736
|
-
|
|
737
|
+
(r) => {
|
|
738
|
+
s && s(r);
|
|
737
739
|
}
|
|
738
740
|
);
|
|
739
741
|
};
|
|
740
742
|
i(0);
|
|
741
743
|
}
|
|
742
|
-
function V(e, t,
|
|
743
|
-
const
|
|
744
|
-
t.forEach((
|
|
745
|
-
|
|
746
|
-
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
|
|
747
749
|
});
|
|
748
750
|
});
|
|
749
751
|
let i = JSON.stringify({
|
|
@@ -751,21 +753,21 @@ function V(e, t, n = void 0, s = void 0, o = void 0) {
|
|
|
751
753
|
name: "ENO_CSRF_TOKEN",
|
|
752
754
|
value: e.token
|
|
753
755
|
},
|
|
754
|
-
data:
|
|
756
|
+
data: c
|
|
755
757
|
});
|
|
756
|
-
const
|
|
757
|
-
f(
|
|
758
|
+
const o = `${e.space}/resources/v1/modeler/documents/DownloadTicket?tenant=${e.tenant}&e6w-lang=fr&e6w-timezone=-120`;
|
|
759
|
+
f(o, {
|
|
758
760
|
method: "PUT",
|
|
759
761
|
data: i,
|
|
760
762
|
type: "json",
|
|
761
|
-
onComplete(
|
|
762
|
-
const d =
|
|
763
|
-
|
|
763
|
+
onComplete(r) {
|
|
764
|
+
const d = r.data;
|
|
765
|
+
r.success === !0 && (s && s(), d.forEach((l) => {
|
|
764
766
|
try {
|
|
765
767
|
const p = l.dataelements.fileName, u = l.dataelements.ticketURL;
|
|
766
768
|
f(u, {
|
|
767
769
|
onComplete: (m) => {
|
|
768
|
-
|
|
770
|
+
n && n({
|
|
769
771
|
objectId: l.id,
|
|
770
772
|
fileName: p,
|
|
771
773
|
data: JSON.parse(m)
|
|
@@ -776,27 +778,27 @@ function V(e, t, n = void 0, s = void 0, o = void 0) {
|
|
|
776
778
|
}
|
|
777
779
|
});
|
|
778
780
|
} catch (p) {
|
|
779
|
-
console.log(p),
|
|
781
|
+
console.log(p), a && a(p);
|
|
780
782
|
}
|
|
781
783
|
}));
|
|
782
784
|
},
|
|
783
|
-
onFailure(
|
|
784
|
-
console.log(
|
|
785
|
+
onFailure(r) {
|
|
786
|
+
console.log(r), a && a(r);
|
|
785
787
|
}
|
|
786
788
|
});
|
|
787
789
|
}
|
|
788
|
-
function De(e, t,
|
|
789
|
-
return new Promise((
|
|
790
|
+
function De(e, t, s = void 0, n = void 0) {
|
|
791
|
+
return new Promise((a) => {
|
|
790
792
|
if (e.token === "" && C(e), t !== void 0 && t !== "" && t !== null) {
|
|
791
|
-
const
|
|
793
|
+
const c = `${e.space}/resources/v1/modeler/dslc/maturity/getNextStates`;
|
|
792
794
|
b(
|
|
793
795
|
e.space,
|
|
794
796
|
"ESPACE COMMUN",
|
|
795
797
|
["VPLMProjectLeader", "VPLMCreator"],
|
|
796
798
|
void 0,
|
|
797
|
-
(
|
|
798
|
-
(
|
|
799
|
-
console.log("onError =>",
|
|
799
|
+
(o) => e.ctx = o,
|
|
800
|
+
(o) => {
|
|
801
|
+
console.log("onError =>", o);
|
|
800
802
|
}
|
|
801
803
|
);
|
|
802
804
|
let i = {
|
|
@@ -815,19 +817,19 @@ function De(e, t, n = void 0, s = void 0) {
|
|
|
815
817
|
]
|
|
816
818
|
}),
|
|
817
819
|
type: "json",
|
|
818
|
-
onComplete(
|
|
819
|
-
|
|
820
|
+
onComplete(o) {
|
|
821
|
+
s && s(o);
|
|
820
822
|
},
|
|
821
|
-
onFailure(
|
|
822
|
-
|
|
823
|
+
onFailure(o) {
|
|
824
|
+
n && n(o);
|
|
823
825
|
}
|
|
824
826
|
};
|
|
825
|
-
f(
|
|
827
|
+
f(c, i);
|
|
826
828
|
}
|
|
827
829
|
});
|
|
828
830
|
}
|
|
829
|
-
function Fe(e, t,
|
|
830
|
-
return new Promise((
|
|
831
|
+
function Fe(e, t, s, n = void 0, a = void 0) {
|
|
832
|
+
return new Promise((c) => {
|
|
831
833
|
if (e.token === "" && C(e), t !== void 0 && t !== "" && t !== null) {
|
|
832
834
|
const i = `${e.space}/resources/v1/modeler/dslc/maturity/changeState`;
|
|
833
835
|
b(
|
|
@@ -835,12 +837,12 @@ function Fe(e, t, n, s = void 0, o = void 0) {
|
|
|
835
837
|
"ESPACE COMMUN",
|
|
836
838
|
["VPLMProjectLeader", "VPLMCreator"],
|
|
837
839
|
void 0,
|
|
838
|
-
(
|
|
839
|
-
(
|
|
840
|
-
console.log("onError =>",
|
|
840
|
+
(r) => e.ctx = r,
|
|
841
|
+
(r) => {
|
|
842
|
+
console.log("onError =>", r);
|
|
841
843
|
}
|
|
842
844
|
);
|
|
843
|
-
let
|
|
845
|
+
let o = {
|
|
844
846
|
method: "POST",
|
|
845
847
|
headers: {
|
|
846
848
|
SecurityContext: "ctx::" + e.ctx,
|
|
@@ -852,34 +854,34 @@ function Fe(e, t, n, s = void 0, o = void 0) {
|
|
|
852
854
|
data: [
|
|
853
855
|
{
|
|
854
856
|
id: t,
|
|
855
|
-
nextState:
|
|
857
|
+
nextState: s
|
|
856
858
|
}
|
|
857
859
|
]
|
|
858
860
|
}),
|
|
859
861
|
type: "json",
|
|
860
|
-
onComplete(
|
|
861
|
-
|
|
862
|
+
onComplete(r) {
|
|
863
|
+
n && n(r);
|
|
862
864
|
},
|
|
863
|
-
onFailure(
|
|
864
|
-
|
|
865
|
+
onFailure(r) {
|
|
866
|
+
a && a(r);
|
|
865
867
|
}
|
|
866
868
|
};
|
|
867
|
-
f(i,
|
|
869
|
+
f(i, o);
|
|
868
870
|
}
|
|
869
871
|
});
|
|
870
872
|
}
|
|
871
|
-
function Ue(e, t,
|
|
872
|
-
return new Promise((
|
|
873
|
+
function Ue(e, t, s = void 0, n = void 0) {
|
|
874
|
+
return new Promise((a) => {
|
|
873
875
|
if (e.token === "" && C(e), t !== void 0 && t !== "" && t !== null) {
|
|
874
|
-
const
|
|
876
|
+
const c = `${e.space}/resources/v1/dslc/versiongraph?withThumbnail=0&withIsLastVersion=0&withAttributes=0&withCopyFrom=0&tenant=${e.tenant}`;
|
|
875
877
|
b(
|
|
876
878
|
e.space,
|
|
877
879
|
"ESPACE COMMUN",
|
|
878
880
|
["VPLMProjectLeader", "VPLMCreator"],
|
|
879
881
|
void 0,
|
|
880
|
-
(
|
|
881
|
-
(
|
|
882
|
-
console.log("onError =>",
|
|
882
|
+
(o) => e.ctx = o,
|
|
883
|
+
(o) => {
|
|
884
|
+
console.log("onError =>", o);
|
|
883
885
|
}
|
|
884
886
|
);
|
|
885
887
|
let i = {
|
|
@@ -898,29 +900,29 @@ function Ue(e, t, n = void 0, s = void 0) {
|
|
|
898
900
|
]
|
|
899
901
|
}),
|
|
900
902
|
type: "json",
|
|
901
|
-
onComplete(
|
|
902
|
-
|
|
903
|
+
onComplete(o) {
|
|
904
|
+
s && s(o);
|
|
903
905
|
},
|
|
904
|
-
onFailure(
|
|
905
|
-
|
|
906
|
+
onFailure(o) {
|
|
907
|
+
n && n(o);
|
|
906
908
|
}
|
|
907
909
|
};
|
|
908
|
-
f(
|
|
910
|
+
f(c, i);
|
|
909
911
|
}
|
|
910
912
|
});
|
|
911
913
|
}
|
|
912
|
-
function $e(e, t,
|
|
913
|
-
return new Promise((
|
|
914
|
+
function $e(e, t, s = void 0, n = void 0) {
|
|
915
|
+
return new Promise((a) => {
|
|
914
916
|
if (e.token === "" && C(e), t !== void 0 && t !== "" && t !== null) {
|
|
915
|
-
const
|
|
917
|
+
const c = `${e.space}/resources/lifecycle/revise/prepare_revise_maskattributes?tenant=${e.tenant}`;
|
|
916
918
|
b(
|
|
917
919
|
e.space,
|
|
918
920
|
"ESPACE COMMUN",
|
|
919
921
|
["VPLMProjectLeader", "VPLMCreator"],
|
|
920
922
|
void 0,
|
|
921
|
-
(
|
|
922
|
-
(
|
|
923
|
-
console.log("onError =>",
|
|
923
|
+
(o) => e.ctx = o,
|
|
924
|
+
(o) => {
|
|
925
|
+
console.log("onError =>", o);
|
|
924
926
|
}
|
|
925
927
|
);
|
|
926
928
|
let i = {
|
|
@@ -945,19 +947,19 @@ function $e(e, t, n = void 0, s = void 0) {
|
|
|
945
947
|
]
|
|
946
948
|
}),
|
|
947
949
|
type: "json",
|
|
948
|
-
onComplete(
|
|
949
|
-
|
|
950
|
+
onComplete(o) {
|
|
951
|
+
s && s(o);
|
|
950
952
|
},
|
|
951
|
-
onFailure(
|
|
952
|
-
|
|
953
|
+
onFailure(o) {
|
|
954
|
+
n && n(o);
|
|
953
955
|
}
|
|
954
956
|
};
|
|
955
|
-
f(
|
|
957
|
+
f(c, i);
|
|
956
958
|
}
|
|
957
959
|
});
|
|
958
960
|
}
|
|
959
|
-
function je(e, t,
|
|
960
|
-
return new Promise((
|
|
961
|
+
function je(e, t, s, n = void 0, a = void 0) {
|
|
962
|
+
return new Promise((c) => {
|
|
961
963
|
if (e.token === "" && C(e), t !== void 0 && t !== "" && t !== null) {
|
|
962
964
|
const i = `${e.space}/resources/lifecycle/revise/major?tenant=${e.tenant}`;
|
|
963
965
|
b(
|
|
@@ -965,12 +967,12 @@ function je(e, t, n, s = void 0, o = void 0) {
|
|
|
965
967
|
"ESPACE COMMUN",
|
|
966
968
|
["VPLMProjectLeader", "VPLMCreator"],
|
|
967
969
|
void 0,
|
|
968
|
-
(
|
|
969
|
-
(
|
|
970
|
-
console.log("onError =>",
|
|
970
|
+
(r) => e.ctx = r,
|
|
971
|
+
(r) => {
|
|
972
|
+
console.log("onError =>", r);
|
|
971
973
|
}
|
|
972
974
|
);
|
|
973
|
-
let
|
|
975
|
+
let o = {
|
|
974
976
|
method: "POST",
|
|
975
977
|
headers: {
|
|
976
978
|
securitycontext: "ctx::" + e.ctx,
|
|
@@ -982,9 +984,9 @@ function je(e, t, n, s = void 0, o = void 0) {
|
|
|
982
984
|
data: [
|
|
983
985
|
{
|
|
984
986
|
physicalid: t,
|
|
985
|
-
proposedRevision:
|
|
987
|
+
proposedRevision: s,
|
|
986
988
|
modifiedAttributes: {
|
|
987
|
-
revision:
|
|
989
|
+
revision: s
|
|
988
990
|
}
|
|
989
991
|
}
|
|
990
992
|
],
|
|
@@ -992,86 +994,86 @@ function je(e, t, n, s = void 0, o = void 0) {
|
|
|
992
994
|
notificationTimeout: 600
|
|
993
995
|
}),
|
|
994
996
|
type: "json",
|
|
995
|
-
onComplete(
|
|
996
|
-
|
|
997
|
+
onComplete(r) {
|
|
998
|
+
n && n(r);
|
|
997
999
|
},
|
|
998
|
-
onFailure(
|
|
999
|
-
|
|
1000
|
+
onFailure(r) {
|
|
1001
|
+
a && a(r);
|
|
1000
1002
|
}
|
|
1001
1003
|
};
|
|
1002
|
-
f(i,
|
|
1004
|
+
f(i, o);
|
|
1003
1005
|
}
|
|
1004
1006
|
});
|
|
1005
1007
|
}
|
|
1006
1008
|
//!SECTION
|
|
1007
|
-
function Ae(e, t = void 0,
|
|
1008
|
-
const
|
|
1009
|
+
function Ae(e, t = void 0, s = void 0) {
|
|
1010
|
+
const n = {
|
|
1009
1011
|
base: `${e.space}`,
|
|
1010
1012
|
uri: "/resources/bps/cspaces",
|
|
1011
1013
|
optTenant: `tenant=${e.tenant}`
|
|
1012
|
-
},
|
|
1013
|
-
f(
|
|
1014
|
+
}, a = `${n.base}${n.uri}?${n.optTenant}`;
|
|
1015
|
+
f(a, {
|
|
1014
1016
|
method: "GET",
|
|
1015
1017
|
headers: {
|
|
1016
1018
|
Accept: "application/json,text/javascript,*/*",
|
|
1017
1019
|
"Content-Type": "application/ds-json"
|
|
1018
1020
|
},
|
|
1019
|
-
onComplete(
|
|
1020
|
-
const
|
|
1021
|
-
t && t(
|
|
1021
|
+
onComplete(c, i) {
|
|
1022
|
+
const o = JSON.parse(c);
|
|
1023
|
+
t && t(o, i);
|
|
1022
1024
|
},
|
|
1023
|
-
onFailure(
|
|
1024
|
-
|
|
1025
|
+
onFailure(c, i, o) {
|
|
1026
|
+
s && s({ response: c, headers: i, xhr: o });
|
|
1025
1027
|
}
|
|
1026
1028
|
});
|
|
1027
1029
|
}
|
|
1028
|
-
function Re(e, t,
|
|
1030
|
+
function Re(e, t, s, n) {
|
|
1029
1031
|
U(
|
|
1030
1032
|
e.space,
|
|
1031
1033
|
t,
|
|
1032
|
-
(
|
|
1033
|
-
f(
|
|
1034
|
+
(a) => {
|
|
1035
|
+
f(a, {
|
|
1034
1036
|
header: { ENO_CSRF_TOKEN: e.token },
|
|
1035
|
-
onComplete: (
|
|
1036
|
-
|
|
1037
|
+
onComplete: (c) => {
|
|
1038
|
+
s && s(c);
|
|
1037
1039
|
},
|
|
1038
|
-
onFailure: (
|
|
1039
|
-
console.log("error http",
|
|
1040
|
+
onFailure: (c) => {
|
|
1041
|
+
console.log("error http", c), n && n(c);
|
|
1040
1042
|
}
|
|
1041
1043
|
});
|
|
1042
1044
|
}
|
|
1043
1045
|
);
|
|
1044
1046
|
}
|
|
1045
|
-
async function Ie(e, t,
|
|
1046
|
-
return new Promise((
|
|
1047
|
-
U(e, t, (
|
|
1048
|
-
f(
|
|
1049
|
-
onComplete: (i,
|
|
1050
|
-
onFailure: (i,
|
|
1051
|
-
|
|
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);
|
|
1052
1054
|
}
|
|
1053
1055
|
});
|
|
1054
1056
|
});
|
|
1055
1057
|
});
|
|
1056
1058
|
}
|
|
1057
|
-
function ve(e, t,
|
|
1058
|
-
const
|
|
1059
|
+
function ve(e, t, s, n = void 0, a = void 0) {
|
|
1060
|
+
const c = new Blob([JSON.stringify(t)], { type: "text/plain" });
|
|
1059
1061
|
k(
|
|
1060
1062
|
e,
|
|
1061
|
-
|
|
1063
|
+
s,
|
|
1062
1064
|
(i) => {
|
|
1063
|
-
const
|
|
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;
|
|
1064
1066
|
K(
|
|
1065
1067
|
e,
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
r,
|
|
1068
|
+
s,
|
|
1069
|
+
o,
|
|
1069
1070
|
c,
|
|
1071
|
+
r,
|
|
1070
1072
|
(d) => {
|
|
1071
|
-
|
|
1073
|
+
n && n(d);
|
|
1072
1074
|
},
|
|
1073
1075
|
(d) => {
|
|
1074
|
-
|
|
1076
|
+
a && a(d);
|
|
1075
1077
|
}
|
|
1076
1078
|
);
|
|
1077
1079
|
}
|
|
@@ -1079,62 +1081,59 @@ function ve(e, t, n, s = void 0, o = void 0) {
|
|
|
1079
1081
|
}
|
|
1080
1082
|
let v, x;
|
|
1081
1083
|
const $ = [];
|
|
1082
|
-
async function xe(e, t = void 0,
|
|
1084
|
+
async function xe(e, t = void 0, s = void 0) {
|
|
1083
1085
|
e.objID && e.objID !== "" ? (console.log("obj est présent"), k(
|
|
1084
1086
|
e,
|
|
1085
|
-
(
|
|
1086
|
-
t && t(
|
|
1087
|
+
(n) => {
|
|
1088
|
+
t && t(n);
|
|
1087
1089
|
},
|
|
1088
|
-
(
|
|
1089
|
-
|
|
1090
|
+
(n) => {
|
|
1091
|
+
s && s(n);
|
|
1090
1092
|
}
|
|
1091
1093
|
)) : (e.objID === null || e.objID === "") && C(
|
|
1092
1094
|
e,
|
|
1093
|
-
(
|
|
1094
|
-
t && t({ rep:
|
|
1095
|
+
(n) => {
|
|
1096
|
+
t && t({ rep: n, msg: "Pas d'objID, ou invalide" });
|
|
1095
1097
|
},
|
|
1096
|
-
(
|
|
1097
|
-
|
|
1098
|
+
(n) => {
|
|
1099
|
+
s && s({ msg: "Pas d'objID et erreur sur le Space", err: n });
|
|
1098
1100
|
}
|
|
1099
1101
|
);
|
|
1100
1102
|
}
|
|
1101
|
-
async function Pe(e, t = void 0,
|
|
1103
|
+
async function Pe(e, t = void 0, s = void 0) {
|
|
1102
1104
|
console.log("getDatasByTenant (getDocuments)", e), await I(
|
|
1103
1105
|
e,
|
|
1104
|
-
(
|
|
1105
|
-
const
|
|
1106
|
-
|
|
1106
|
+
(n) => {
|
|
1107
|
+
const a = {};
|
|
1108
|
+
a.obj = n, console.log("getDatasByTenant (getDocuments) _datas", a), t && t?.(a);
|
|
1107
1109
|
},
|
|
1108
|
-
(
|
|
1109
|
-
|
|
1110
|
+
(n) => {
|
|
1111
|
+
s && s?.(n);
|
|
1110
1112
|
}
|
|
1111
1113
|
);
|
|
1112
1114
|
}
|
|
1113
|
-
function Me(e, t = void 0,
|
|
1114
|
-
const
|
|
1115
|
-
e.objIds.forEach((
|
|
1115
|
+
function Me(e, t = void 0, s = void 0) {
|
|
1116
|
+
const n = [];
|
|
1117
|
+
e.objIds.forEach((a, c) => {
|
|
1116
1118
|
I(
|
|
1117
1119
|
e,
|
|
1118
|
-
|
|
1119
|
-
(i) => {
|
|
1120
|
-
s.push({ [o.name]: i }), o.name === "dbProjets" && (v = i.affaires.map((a) => a.objectID), B(e, x)), r === e.objIds.length - 1 && t && t(s);
|
|
1121
|
-
},
|
|
1120
|
+
a.objId,
|
|
1122
1121
|
(i) => {
|
|
1123
|
-
n &&
|
|
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);
|
|
1124
1123
|
}
|
|
1125
1124
|
);
|
|
1126
1125
|
});
|
|
1127
1126
|
}
|
|
1128
|
-
function B(e, t,
|
|
1127
|
+
function B(e, t, s = void 0, n = void 0) {
|
|
1129
1128
|
X(
|
|
1130
1129
|
e,
|
|
1131
1130
|
v,
|
|
1132
|
-
(
|
|
1133
|
-
const
|
|
1134
|
-
|
|
1131
|
+
(a) => {
|
|
1132
|
+
const c = [...t];
|
|
1133
|
+
c.find((i) => i.objectID === a.objectId).data = a.data, x = c, $.push(a.data), s && s($);
|
|
1135
1134
|
},
|
|
1136
|
-
(
|
|
1137
|
-
|
|
1135
|
+
(a) => {
|
|
1136
|
+
n && (n(a), console.log(a));
|
|
1138
1137
|
}
|
|
1139
1138
|
);
|
|
1140
1139
|
}
|
|
@@ -1158,12 +1157,12 @@ const Y = "FA35FB9B177A280065800EA0000F599C", H = [
|
|
|
1158
1157
|
order_by: "desc",
|
|
1159
1158
|
tag: "testTag"
|
|
1160
1159
|
};
|
|
1161
|
-
function Le(e, t,
|
|
1162
|
-
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 = {
|
|
1163
1162
|
uri: "/resources/6w/tags",
|
|
1164
1163
|
otpCTX: "SecurityContext=preferred",
|
|
1165
|
-
optTenant: `tenant=${
|
|
1166
|
-
}, l = `${
|
|
1164
|
+
optTenant: `tenant=${c}`
|
|
1165
|
+
}, l = `${a}${d.uri}?${d.otpCTX}&${d.optTenant}`, p = {
|
|
1167
1166
|
tag: [
|
|
1168
1167
|
{
|
|
1169
1168
|
subject: [
|
|
@@ -1171,9 +1170,9 @@ function Le(e, t, n = void 0, s = void 0) {
|
|
|
1171
1170
|
uri: `pid://${i}`
|
|
1172
1171
|
}
|
|
1173
1172
|
],
|
|
1174
|
-
predicate: P[
|
|
1173
|
+
predicate: P[o],
|
|
1175
1174
|
object: {
|
|
1176
|
-
literal:
|
|
1175
|
+
literal: r
|
|
1177
1176
|
}
|
|
1178
1177
|
}
|
|
1179
1178
|
]
|
|
@@ -1198,39 +1197,39 @@ function Le(e, t, n = void 0, s = void 0) {
|
|
|
1198
1197
|
e,
|
|
1199
1198
|
t,
|
|
1200
1199
|
(y) => {
|
|
1201
|
-
|
|
1200
|
+
s && s(y);
|
|
1202
1201
|
},
|
|
1203
1202
|
(y) => {
|
|
1204
|
-
|
|
1203
|
+
n && n(y);
|
|
1205
1204
|
}
|
|
1206
1205
|
);
|
|
1207
1206
|
},
|
|
1208
1207
|
(g, h) => {
|
|
1209
1208
|
const S = g;
|
|
1210
|
-
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);
|
|
1211
1210
|
}
|
|
1212
1211
|
);
|
|
1213
1212
|
}, 2e3);
|
|
1214
1213
|
},
|
|
1215
1214
|
onFailure(u, m) {
|
|
1216
1215
|
const g = u;
|
|
1217
|
-
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);
|
|
1218
1217
|
}
|
|
1219
1218
|
});
|
|
1220
1219
|
}
|
|
1221
|
-
function q(e, t,
|
|
1220
|
+
function q(e, t, s = void 0, n = void 0) {
|
|
1222
1221
|
console.log("obj ", t);
|
|
1223
|
-
const
|
|
1222
|
+
const a = t.info.name, c = {
|
|
1224
1223
|
baseUrl: `https://${e.tenant.toLowerCase()}-eu1-fedsearch.3dexperience.3ds.com`,
|
|
1225
1224
|
uri: "/federated/search"
|
|
1226
|
-
}, i = `${
|
|
1225
|
+
}, i = `${c.baseUrl}${c.uri}`, o = {
|
|
1227
1226
|
"Content-Type": "application/json",
|
|
1228
1227
|
Accept: "application/json,text/javascript,*/*"
|
|
1229
|
-
},
|
|
1228
|
+
}, r = R(), d = {
|
|
1230
1229
|
with_indexing_date: !0,
|
|
1231
1230
|
with_synthesis: !0,
|
|
1232
1231
|
with_nls: !1,
|
|
1233
|
-
label: `3DSearch-${e.currentUser.username}-AjoutDeTagBeam-${
|
|
1232
|
+
label: `3DSearch-${e.currentUser.username}-AjoutDeTagBeam-${r}`,
|
|
1234
1233
|
locale: "fr",
|
|
1235
1234
|
select_predicate: [
|
|
1236
1235
|
"ds6w:label",
|
|
@@ -1258,7 +1257,7 @@ function q(e, t, n = void 0, s = void 0) {
|
|
|
1258
1257
|
],
|
|
1259
1258
|
with_synthesis_hierarchical: !0,
|
|
1260
1259
|
select_file: ["icon", "thumbnail_2d"],
|
|
1261
|
-
query:
|
|
1260
|
+
query: a,
|
|
1262
1261
|
specific_source_parameter: {
|
|
1263
1262
|
"3dspace": {
|
|
1264
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)'
|
|
@@ -1289,39 +1288,39 @@ function q(e, t, n = void 0, s = void 0) {
|
|
|
1289
1288
|
};
|
|
1290
1289
|
console.log("dataPattern => ", d), f(i, {
|
|
1291
1290
|
method: "POST",
|
|
1292
|
-
headers:
|
|
1291
|
+
headers: o,
|
|
1293
1292
|
data: JSON.stringify(d),
|
|
1294
1293
|
onComplete(l) {
|
|
1295
1294
|
const p = JSON.parse(l);
|
|
1296
|
-
|
|
1295
|
+
s(p);
|
|
1297
1296
|
},
|
|
1298
1297
|
onFailure(l, p) {
|
|
1299
1298
|
const u = l;
|
|
1300
|
-
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);
|
|
1301
1300
|
}
|
|
1302
1301
|
});
|
|
1303
1302
|
}
|
|
1304
|
-
function Ee(e, t,
|
|
1305
|
-
const { objId:
|
|
1303
|
+
function Ee(e, t, s = void 0, n = void 0) {
|
|
1304
|
+
const { objId: a, pred: c, tag: i } = t, o = {
|
|
1306
1305
|
uri: "/resources/6w/tags",
|
|
1307
1306
|
otpCTX: "SecurityContext=preferred",
|
|
1308
1307
|
optTenant: `tenant=${e.tenant}`
|
|
1309
|
-
},
|
|
1308
|
+
}, r = `${e.space}${o.uri}?${o.otpCTX}&${o.optTenant}`, d = {
|
|
1310
1309
|
tag: [
|
|
1311
1310
|
{
|
|
1312
1311
|
subject: [
|
|
1313
1312
|
{
|
|
1314
|
-
uri: `pid://${
|
|
1313
|
+
uri: `pid://${a}`
|
|
1315
1314
|
}
|
|
1316
1315
|
],
|
|
1317
|
-
predicate: P[
|
|
1316
|
+
predicate: P[c],
|
|
1318
1317
|
object: {
|
|
1319
1318
|
literal: i
|
|
1320
1319
|
}
|
|
1321
1320
|
}
|
|
1322
1321
|
]
|
|
1323
1322
|
};
|
|
1324
|
-
f(
|
|
1323
|
+
f(r, {
|
|
1325
1324
|
method: "DELETE",
|
|
1326
1325
|
data: JSON.stringify(d),
|
|
1327
1326
|
headers: {
|
|
@@ -1329,52 +1328,52 @@ function Ee(e, t, n = void 0, s = void 0) {
|
|
|
1329
1328
|
Accept: "application/json,text/javascript,*/*"
|
|
1330
1329
|
},
|
|
1331
1330
|
onComplete(l) {
|
|
1332
|
-
|
|
1331
|
+
s && s(l);
|
|
1333
1332
|
},
|
|
1334
1333
|
onFailure(l, p) {
|
|
1335
1334
|
const u = l;
|
|
1336
|
-
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);
|
|
1337
1336
|
}
|
|
1338
1337
|
});
|
|
1339
1338
|
}
|
|
1340
|
-
function Je(e, t = "",
|
|
1341
|
-
const { space:
|
|
1339
|
+
function Je(e, t = "", s = void 0, n = void 0) {
|
|
1340
|
+
const { space: a } = e;
|
|
1342
1341
|
if (t === "")
|
|
1343
1342
|
return;
|
|
1344
|
-
const
|
|
1343
|
+
const c = {
|
|
1345
1344
|
uri: "/resources/v1/modeler/documents"
|
|
1346
1345
|
}, i = {
|
|
1347
1346
|
"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8",
|
|
1348
1347
|
Accept: "application/json,text/javascript,*/*"
|
|
1349
|
-
},
|
|
1350
|
-
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, {
|
|
1351
1350
|
method: "POST",
|
|
1352
1351
|
headers: i,
|
|
1353
|
-
data:
|
|
1352
|
+
data: r,
|
|
1354
1353
|
onComplete(d) {
|
|
1355
|
-
|
|
1354
|
+
s && s(JSON.parse(d));
|
|
1356
1355
|
},
|
|
1357
1356
|
onFailure(d, l) {
|
|
1358
1357
|
const p = d;
|
|
1359
|
-
p.msg = l.error,
|
|
1358
|
+
p.msg = l.error, n && n(p);
|
|
1360
1359
|
}
|
|
1361
1360
|
});
|
|
1362
1361
|
}
|
|
1363
|
-
async function w(e, t = void 0,
|
|
1364
|
-
const
|
|
1365
|
-
return f(
|
|
1366
|
-
onComplete(
|
|
1367
|
-
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);
|
|
1368
1367
|
if (t)
|
|
1369
|
-
return t(
|
|
1368
|
+
return t(o), e.token = o?.result?.ServerToken;
|
|
1370
1369
|
},
|
|
1371
|
-
onFailure(
|
|
1372
|
-
|
|
1370
|
+
onFailure(a) {
|
|
1371
|
+
s && s(a);
|
|
1373
1372
|
}
|
|
1374
1373
|
});
|
|
1375
1374
|
}
|
|
1376
|
-
function Ge(e, t = void 0,
|
|
1377
|
-
const
|
|
1375
|
+
function Ge(e, t = void 0, s = void 0) {
|
|
1376
|
+
const n = `${e.space}/api/exalead/whatsnew`, a = {
|
|
1378
1377
|
params: {
|
|
1379
1378
|
community_id: null,
|
|
1380
1379
|
hash_key: null,
|
|
@@ -1384,27 +1383,27 @@ function Ge(e, t = void 0, n = void 0) {
|
|
|
1384
1383
|
start: 0
|
|
1385
1384
|
}
|
|
1386
1385
|
};
|
|
1387
|
-
w(e, (
|
|
1388
|
-
f(
|
|
1386
|
+
w(e, (c) => {
|
|
1387
|
+
f(n, {
|
|
1389
1388
|
method: "POST",
|
|
1390
1389
|
headers: {
|
|
1391
|
-
"X-DS-SWYM-CSRFTOKEN":
|
|
1390
|
+
"X-DS-SWYM-CSRFTOKEN": c.result.ServerToken,
|
|
1392
1391
|
"Content-type": "application/json;charset=UTF-8",
|
|
1393
1392
|
Accept: "application/json"
|
|
1394
1393
|
},
|
|
1395
|
-
data: JSON.stringify(
|
|
1394
|
+
data: JSON.stringify(a),
|
|
1396
1395
|
type: "json",
|
|
1397
|
-
onComplete(i,
|
|
1398
|
-
t && t(i,
|
|
1396
|
+
onComplete(i, o) {
|
|
1397
|
+
t && t(i, o);
|
|
1399
1398
|
},
|
|
1400
|
-
onFailure(i,
|
|
1401
|
-
|
|
1399
|
+
onFailure(i, o) {
|
|
1400
|
+
s && s(i, o);
|
|
1402
1401
|
}
|
|
1403
1402
|
});
|
|
1404
1403
|
});
|
|
1405
1404
|
}
|
|
1406
|
-
function Ke(e, t = void 0,
|
|
1407
|
-
const
|
|
1405
|
+
function Ke(e, t = void 0, s = void 0) {
|
|
1406
|
+
const n = `${e.space}/api/Recommendation/getpeoplefamiliartocurrentuser`, a = {
|
|
1408
1407
|
params: {
|
|
1409
1408
|
idsToFilterArr: [],
|
|
1410
1409
|
mode: "offline",
|
|
@@ -1413,41 +1412,41 @@ function Ke(e, t = void 0, n = void 0) {
|
|
|
1413
1412
|
maxNbOfCommonElements: "5"
|
|
1414
1413
|
}
|
|
1415
1414
|
};
|
|
1416
|
-
w(e, (
|
|
1417
|
-
f(
|
|
1415
|
+
w(e, (c) => {
|
|
1416
|
+
f(n, {
|
|
1418
1417
|
method: "POST",
|
|
1419
1418
|
headers: {
|
|
1420
|
-
"X-DS-SWYM-CSRFTOKEN":
|
|
1419
|
+
"X-DS-SWYM-CSRFTOKEN": c.result.ServerToken,
|
|
1421
1420
|
"Content-type": "application/json;charset=UTF-8",
|
|
1422
1421
|
Accept: "application/json"
|
|
1423
1422
|
},
|
|
1424
|
-
data: JSON.stringify(
|
|
1423
|
+
data: JSON.stringify(a),
|
|
1425
1424
|
type: "json",
|
|
1426
|
-
onComplete(i,
|
|
1427
|
-
const
|
|
1428
|
-
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);
|
|
1429
1428
|
},
|
|
1430
|
-
onFailure(i,
|
|
1431
|
-
|
|
1429
|
+
onFailure(i, o) {
|
|
1430
|
+
s && s(i, o);
|
|
1432
1431
|
}
|
|
1433
1432
|
});
|
|
1434
1433
|
});
|
|
1435
1434
|
}
|
|
1436
|
-
function We(e, t = void 0,
|
|
1437
|
-
const
|
|
1435
|
+
function We(e, t = void 0, s = void 0) {
|
|
1436
|
+
const n = {
|
|
1438
1437
|
base: e.space,
|
|
1439
1438
|
uri: "/api/community/listmycommunities",
|
|
1440
1439
|
limit: `/limit/${e.limit ? e.limit : 128}`,
|
|
1441
1440
|
page: `/page/${e.page ? e.page : "1"}`
|
|
1442
|
-
},
|
|
1441
|
+
}, a = `${n.base}${n.uri}${n.limit}${n.page}`, c = [];
|
|
1443
1442
|
w(e, (i) => {
|
|
1444
|
-
f(
|
|
1443
|
+
f(a, {
|
|
1445
1444
|
method: "GET",
|
|
1446
1445
|
headers: {
|
|
1447
1446
|
"X-DS-SWYM-CSRFTOKEN": i.result.ServerToken
|
|
1448
1447
|
},
|
|
1449
|
-
onComplete(
|
|
1450
|
-
const p = JSON.parse(
|
|
1448
|
+
onComplete(o, r, d) {
|
|
1449
|
+
const p = JSON.parse(o).result;
|
|
1451
1450
|
let u = 0;
|
|
1452
1451
|
p.forEach((m) => {
|
|
1453
1452
|
const g = {
|
|
@@ -1462,21 +1461,21 @@ function We(e, t = void 0, n = void 0) {
|
|
|
1462
1461
|
e,
|
|
1463
1462
|
m.id,
|
|
1464
1463
|
(h) => {
|
|
1465
|
-
u++, g.members = h,
|
|
1464
|
+
u++, g.members = h, c.push(g), u === p.length && t && t(c);
|
|
1466
1465
|
},
|
|
1467
|
-
(h) =>
|
|
1466
|
+
(h) => s(h)
|
|
1468
1467
|
);
|
|
1469
1468
|
});
|
|
1470
1469
|
},
|
|
1471
|
-
onFailure(
|
|
1472
|
-
const d =
|
|
1473
|
-
d.status =
|
|
1470
|
+
onFailure(o, r) {
|
|
1471
|
+
const d = o;
|
|
1472
|
+
d.status = r.status, d.response = r.errormsg, s && s(d);
|
|
1474
1473
|
}
|
|
1475
1474
|
});
|
|
1476
1475
|
});
|
|
1477
1476
|
}
|
|
1478
|
-
function Q(e, t,
|
|
1479
|
-
const
|
|
1477
|
+
function Q(e, t, s, n) {
|
|
1478
|
+
const a = `${e.space}/api/community/listmembers`, c = {
|
|
1480
1479
|
params: {
|
|
1481
1480
|
page: e.page ? e.page : 1,
|
|
1482
1481
|
limit: e.limit ? e.limit : 50,
|
|
@@ -1484,54 +1483,54 @@ function Q(e, t, n, s) {
|
|
|
1484
1483
|
}
|
|
1485
1484
|
};
|
|
1486
1485
|
w(e, (i) => {
|
|
1487
|
-
f(
|
|
1486
|
+
f(a, {
|
|
1488
1487
|
method: "POST",
|
|
1489
1488
|
headers: {
|
|
1490
1489
|
"Content-type": "application/json;charset=UTF-8",
|
|
1491
1490
|
Accept: "application/json",
|
|
1492
1491
|
"X-DS-SWYM-CSRFTOKEN": i.result.ServerToken
|
|
1493
1492
|
},
|
|
1494
|
-
data: JSON.stringify(
|
|
1493
|
+
data: JSON.stringify(c),
|
|
1495
1494
|
type: "json",
|
|
1496
|
-
onComplete(
|
|
1497
|
-
|
|
1495
|
+
onComplete(o, r, d) {
|
|
1496
|
+
s && s(o);
|
|
1498
1497
|
},
|
|
1499
|
-
onFailure(
|
|
1500
|
-
const d =
|
|
1501
|
-
d.status =
|
|
1498
|
+
onFailure(o, r) {
|
|
1499
|
+
const d = o;
|
|
1500
|
+
d.status = r.status, d.response = r.errormsg, n && n(d);
|
|
1502
1501
|
}
|
|
1503
1502
|
});
|
|
1504
1503
|
});
|
|
1505
1504
|
}
|
|
1506
|
-
function Xe(e, t = void 0,
|
|
1507
|
-
const
|
|
1508
|
-
e.commu_id || (e.commu_id =
|
|
1509
|
-
const
|
|
1510
|
-
w(e, (
|
|
1511
|
-
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, {
|
|
1512
1511
|
method: "GET",
|
|
1513
1512
|
headers: {
|
|
1514
1513
|
"Content-type": "application/json;charset=UTF-8",
|
|
1515
1514
|
Accept: "application/json",
|
|
1516
|
-
"X-DS-SWYM-CSRFTOKEN":
|
|
1515
|
+
"X-DS-SWYM-CSRFTOKEN": c.result.ServerToken
|
|
1517
1516
|
},
|
|
1518
1517
|
onComplete(i) {
|
|
1519
|
-
const
|
|
1520
|
-
t && t(
|
|
1518
|
+
const o = JSON.parse(i);
|
|
1519
|
+
t && t(o);
|
|
1521
1520
|
},
|
|
1522
|
-
onFailure(i,
|
|
1523
|
-
const
|
|
1524
|
-
|
|
1521
|
+
onFailure(i, o) {
|
|
1522
|
+
const r = i;
|
|
1523
|
+
r.status = o.status, r.response = o.errormsg, s && s(r);
|
|
1525
1524
|
}
|
|
1526
1525
|
});
|
|
1527
1526
|
});
|
|
1528
1527
|
}
|
|
1529
|
-
function Ve(e, t,
|
|
1530
|
-
const { listAllContacts:
|
|
1531
|
-
console.log("__listAllContacts",
|
|
1532
|
-
const i = `${e.space}/api/directmessages`,
|
|
1533
|
-
users: [
|
|
1534
|
-
},
|
|
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 = {
|
|
1535
1534
|
id_msg: "",
|
|
1536
1535
|
senderId: e.currentUser.login,
|
|
1537
1536
|
senderName: `${e.currentUser.first_name} ${e.currentUser.last_name}`,
|
|
@@ -1539,12 +1538,12 @@ function Ve(e, t, n = void 0, s = void 0) {
|
|
|
1539
1538
|
};
|
|
1540
1539
|
let d = !1;
|
|
1541
1540
|
Z(
|
|
1542
|
-
|
|
1541
|
+
o.users,
|
|
1543
1542
|
(l) => {
|
|
1544
|
-
l !== void 0 && (
|
|
1543
|
+
l !== void 0 && (r.id_msg = l.id, d = !0, j(e, r));
|
|
1545
1544
|
},
|
|
1546
1545
|
(l) => {
|
|
1547
|
-
d = !1, console.log("_3dSwym_findCommunityToInstantMSG callback", l),
|
|
1546
|
+
d = !1, console.log("_3dSwym_findCommunityToInstantMSG callback", l), n && n(l), r.id_msg = "";
|
|
1548
1547
|
}
|
|
1549
1548
|
), d === !1 && setTimeout(() => {
|
|
1550
1549
|
d === !1 && w(e, (l) => {
|
|
@@ -1555,56 +1554,56 @@ function Ve(e, t, n = void 0, s = void 0) {
|
|
|
1555
1554
|
Accept: "application/json",
|
|
1556
1555
|
"X-DS-SWYM-CSRFTOKEN": l.result.ServerToken
|
|
1557
1556
|
},
|
|
1558
|
-
data: JSON.stringify(
|
|
1557
|
+
data: JSON.stringify(o),
|
|
1559
1558
|
type: "json",
|
|
1560
1559
|
onComplete(p, u, m) {
|
|
1561
1560
|
const g = p;
|
|
1562
|
-
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);
|
|
1563
1562
|
},
|
|
1564
1563
|
onFailure(p, u, m) {
|
|
1565
1564
|
const g = p;
|
|
1566
|
-
g.msg = u.errormsg, g.status = u.status,
|
|
1565
|
+
g.msg = u.errormsg, g.status = u.status, n && n(g);
|
|
1567
1566
|
}
|
|
1568
1567
|
});
|
|
1569
1568
|
});
|
|
1570
1569
|
}, 500);
|
|
1571
1570
|
}
|
|
1572
|
-
function Z(e, t,
|
|
1573
|
-
const
|
|
1574
|
-
w(e, (
|
|
1575
|
-
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, {
|
|
1576
1575
|
method: "GET",
|
|
1577
1576
|
headers: {
|
|
1578
1577
|
Accept: "application/json,text/javascript,*/*",
|
|
1579
|
-
"X-DS-SWYM-CSRFTOKEN":
|
|
1578
|
+
"X-DS-SWYM-CSRFTOKEN": c.result.ServerToken
|
|
1580
1579
|
},
|
|
1581
1580
|
onComplete(i) {
|
|
1582
|
-
const
|
|
1583
|
-
|
|
1584
|
-
p.users = p.users.sort((u, m) => u.login.localeCompare(m.login)), p.users.length === t.length &&
|
|
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);
|
|
1585
1584
|
});
|
|
1586
|
-
const d = t.sort(), l =
|
|
1585
|
+
const d = t.sort(), l = r.find((p) => {
|
|
1587
1586
|
const u = [];
|
|
1588
1587
|
return p.users.forEach((m) => {
|
|
1589
1588
|
u.push(m.login);
|
|
1590
1589
|
}), JSON.stringify(u) === JSON.stringify(d);
|
|
1591
1590
|
});
|
|
1592
|
-
|
|
1591
|
+
s && l !== void 0 ? s(l) : (n || l === void 0) && n(l);
|
|
1593
1592
|
},
|
|
1594
1593
|
onFailure(i) {
|
|
1595
|
-
const
|
|
1596
|
-
|
|
1594
|
+
const o = i;
|
|
1595
|
+
o.msg = headers.errormsg, o.errCode = headers.errorcode, console.log("❌ sendDirectMessageLite => ", o), n && n(o);
|
|
1597
1596
|
}
|
|
1598
1597
|
});
|
|
1599
1598
|
});
|
|
1600
1599
|
}
|
|
1601
|
-
function j(e, t,
|
|
1602
|
-
const
|
|
1600
|
+
function j(e, t, s = void 0, n = void 0) {
|
|
1601
|
+
const a = {
|
|
1603
1602
|
base: e.space,
|
|
1604
1603
|
uri: "/api/community",
|
|
1605
1604
|
id_msg: `${t.id_msg}`,
|
|
1606
1605
|
endUri: "/instantmessages"
|
|
1607
|
-
},
|
|
1606
|
+
}, c = `${a.base}${a.uri}/${a.id_msg}${a.endUri}`, i = {
|
|
1608
1607
|
author: { login: t.senderId, displayName: t.senderName },
|
|
1609
1608
|
accessState: null,
|
|
1610
1609
|
commentUri: null,
|
|
@@ -1614,33 +1613,33 @@ function j(e, t, n = void 0, s = void 0) {
|
|
|
1614
1613
|
parentCommentUri: null,
|
|
1615
1614
|
richMessage: t.msg
|
|
1616
1615
|
};
|
|
1617
|
-
console.log("_3dSwym_sendDirectMessageData url ",
|
|
1618
|
-
f(
|
|
1616
|
+
console.log("_3dSwym_sendDirectMessageData url ", c), w(e, (o) => {
|
|
1617
|
+
f(c, {
|
|
1619
1618
|
method: "POST",
|
|
1620
1619
|
headers: {
|
|
1621
1620
|
"Content-Type": "application/json",
|
|
1622
1621
|
Accept: "application/json",
|
|
1623
|
-
"X-DS-SWYM-CSRFTOKEN":
|
|
1622
|
+
"X-DS-SWYM-CSRFTOKEN": o.result.ServerToken
|
|
1624
1623
|
},
|
|
1625
1624
|
data: JSON.stringify(i),
|
|
1626
1625
|
type: "json",
|
|
1627
|
-
onComplete(
|
|
1628
|
-
const p =
|
|
1629
|
-
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);
|
|
1630
1629
|
},
|
|
1631
|
-
onFailure(
|
|
1632
|
-
const l =
|
|
1633
|
-
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);
|
|
1634
1633
|
}
|
|
1635
1634
|
});
|
|
1636
1635
|
});
|
|
1637
1636
|
}
|
|
1638
1637
|
function ee(e) {
|
|
1639
|
-
const t = (/* @__PURE__ */ new Date()).toLocaleDateString(),
|
|
1638
|
+
const t = (/* @__PURE__ */ new Date()).toLocaleDateString(), s = (/* @__PURE__ */ new Date()).toLocaleTimeString();
|
|
1640
1639
|
return `<p>${e} </p>
|
|
1641
1640
|
<br/>
|
|
1642
1641
|
<hr/>
|
|
1643
|
-
<p><u>envoyer :</u>Le <b>${t} à ${
|
|
1642
|
+
<p><u>envoyer :</u>Le <b>${t} à ${s}</b></p>`;
|
|
1644
1643
|
}
|
|
1645
1644
|
const te = {
|
|
1646
1645
|
title: "TEST DEV COMMUNITY IDEA",
|
|
@@ -1652,16 +1651,16 @@ const te = {
|
|
|
1652
1651
|
idee_id: "THhRI8rlQNWKRxpv3Xqqug"
|
|
1653
1652
|
// id de l'idee qui est créer au post (_3dSwym_postIdea)
|
|
1654
1653
|
};
|
|
1655
|
-
function Be(e, t,
|
|
1656
|
-
const
|
|
1657
|
-
(
|
|
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
|
|
1658
1657
|
), i = e.swymCommunities.find(
|
|
1659
|
-
(
|
|
1660
|
-
),
|
|
1658
|
+
(r) => r.title.toLowerCase() === t.community_title.toLowerCase()
|
|
1659
|
+
), o = {
|
|
1661
1660
|
params: {
|
|
1662
1661
|
title: t.title,
|
|
1663
1662
|
// String, le nom de l'affaire
|
|
1664
|
-
community_id:
|
|
1663
|
+
community_id: c?.id !== void 0 ? c.id : i.id,
|
|
1665
1664
|
// String, l'id de la communauté
|
|
1666
1665
|
message: ne(t.text_html),
|
|
1667
1666
|
// STRING => le contenue du message doit être au format HTML
|
|
@@ -1669,103 +1668,103 @@ function Be(e, t, n = void 0, s = void 0) {
|
|
|
1669
1668
|
// 1 publier, 0 non publier
|
|
1670
1669
|
}
|
|
1671
1670
|
};
|
|
1672
|
-
w(e, (
|
|
1671
|
+
w(e, (r) => {
|
|
1673
1672
|
const d = {
|
|
1674
1673
|
"Content-type": "application/json;charset=UTF-8",
|
|
1675
1674
|
Accept: "application/json",
|
|
1676
|
-
"X-DS-SWYM-CSRFTOKEN":
|
|
1675
|
+
"X-DS-SWYM-CSRFTOKEN": r.result.ServerToken
|
|
1677
1676
|
};
|
|
1678
|
-
f(
|
|
1677
|
+
f(a, {
|
|
1679
1678
|
method: "POST",
|
|
1680
1679
|
headers: d,
|
|
1681
|
-
data: JSON.stringify(
|
|
1680
|
+
data: JSON.stringify(o),
|
|
1682
1681
|
type: "json",
|
|
1683
1682
|
onComplete(l, p, u) {
|
|
1684
1683
|
const m = JSON.parse(l);
|
|
1685
|
-
m.status = u.status, m.response = u.response,
|
|
1684
|
+
m.status = u.status, m.response = u.response, s && s(m);
|
|
1686
1685
|
},
|
|
1687
1686
|
onFailure(l, p, u) {
|
|
1688
1687
|
const m = l;
|
|
1689
|
-
m.status = p.status, m.response = p.errormsg,
|
|
1688
|
+
m.status = p.status, m.response = p.errormsg, n && n(m);
|
|
1690
1689
|
}
|
|
1691
1690
|
});
|
|
1692
1691
|
});
|
|
1693
1692
|
}
|
|
1694
|
-
function Ye(e, t,
|
|
1695
|
-
const
|
|
1693
|
+
function Ye(e, t, s = void 0, n = void 0) {
|
|
1694
|
+
const a = `${e.space}/api/idea/delete`, c = {
|
|
1696
1695
|
params: {
|
|
1697
1696
|
community_id: t.community_id,
|
|
1698
1697
|
ideationIds: [t.idee_id]
|
|
1699
1698
|
}
|
|
1700
1699
|
};
|
|
1701
1700
|
w(e, (i) => {
|
|
1702
|
-
f(
|
|
1701
|
+
f(a, {
|
|
1703
1702
|
method: "POST",
|
|
1704
1703
|
headers: {
|
|
1705
1704
|
"Content-type": "application/json;charset=UTF-8",
|
|
1706
1705
|
Accept: "application/json",
|
|
1707
1706
|
"X-DS-SWYM-CSRFTOKEN": i.result.ServerToken
|
|
1708
1707
|
},
|
|
1709
|
-
data: JSON.stringify(
|
|
1708
|
+
data: JSON.stringify(c),
|
|
1710
1709
|
type: "json",
|
|
1711
|
-
onComplete(
|
|
1712
|
-
|
|
1710
|
+
onComplete(o, r, d) {
|
|
1711
|
+
s && s(o);
|
|
1713
1712
|
},
|
|
1714
|
-
onFailure(
|
|
1715
|
-
const l =
|
|
1716
|
-
l.status =
|
|
1713
|
+
onFailure(o, r, d) {
|
|
1714
|
+
const l = o;
|
|
1715
|
+
l.status = r.status, l.response = r.errormsg, n && n(l);
|
|
1717
1716
|
}
|
|
1718
1717
|
});
|
|
1719
1718
|
});
|
|
1720
1719
|
}
|
|
1721
|
-
function He(e, t = "",
|
|
1722
|
-
const
|
|
1723
|
-
t === "" && (t =
|
|
1724
|
-
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 = {
|
|
1725
1724
|
params: {
|
|
1726
1725
|
id: t
|
|
1727
1726
|
}
|
|
1728
1727
|
};
|
|
1729
|
-
w(e, (
|
|
1730
|
-
f(
|
|
1728
|
+
w(e, (o) => {
|
|
1729
|
+
f(c, {
|
|
1731
1730
|
method: "POST",
|
|
1732
1731
|
headers: {
|
|
1733
1732
|
"Content-type": "application/json;charset=UTF-8",
|
|
1734
1733
|
Accept: "application/json",
|
|
1735
|
-
"X-DS-SWYM-CSRFTOKEN":
|
|
1734
|
+
"X-DS-SWYM-CSRFTOKEN": o.result.ServerToken
|
|
1736
1735
|
},
|
|
1737
1736
|
data: JSON.stringify(i),
|
|
1738
1737
|
type: "json",
|
|
1739
|
-
onComplete(
|
|
1740
|
-
const d =
|
|
1741
|
-
d.msg = d.result.message,
|
|
1738
|
+
onComplete(r) {
|
|
1739
|
+
const d = r;
|
|
1740
|
+
d.msg = d.result.message, s && s(d);
|
|
1742
1741
|
},
|
|
1743
|
-
onFailure(
|
|
1744
|
-
const d =
|
|
1745
|
-
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);
|
|
1746
1745
|
}
|
|
1747
1746
|
});
|
|
1748
1747
|
});
|
|
1749
1748
|
}
|
|
1750
|
-
function ze(e, t = te,
|
|
1751
|
-
const
|
|
1749
|
+
function ze(e, t = te, s = void 0, n = void 0) {
|
|
1750
|
+
const a = {
|
|
1752
1751
|
uri: "/api/idea/list",
|
|
1753
1752
|
comId: `/community_id/${e.tenant.toLowerCase() === "r1132101716373" ? t.community_id : "bgnIsG74SUWswyGzS6NC6g"}`,
|
|
1754
1753
|
limit: `/limit/${t.limit ? t.limit : 10}`
|
|
1755
|
-
},
|
|
1754
|
+
}, c = `${e.space}${a.uri}${a.comId}${a.limit}`;
|
|
1756
1755
|
w(e, (i) => {
|
|
1757
|
-
f(
|
|
1756
|
+
f(c, {
|
|
1758
1757
|
method: "GET",
|
|
1759
1758
|
headers: {
|
|
1760
1759
|
"X-DS-SWYM-CSRFTOKEN": i.result.ServerToken
|
|
1761
1760
|
},
|
|
1762
|
-
onComplete(
|
|
1763
|
-
const
|
|
1764
|
-
|
|
1761
|
+
onComplete(o) {
|
|
1762
|
+
const r = JSON.parse(o);
|
|
1763
|
+
s && s(r);
|
|
1765
1764
|
},
|
|
1766
|
-
onFailure(
|
|
1767
|
-
const d =
|
|
1768
|
-
d.status =
|
|
1765
|
+
onFailure(o, r) {
|
|
1766
|
+
const d = o;
|
|
1767
|
+
d.status = r.status, d.response = r.errormsg, n && n(d);
|
|
1769
1768
|
}
|
|
1770
1769
|
});
|
|
1771
1770
|
});
|
|
@@ -1845,43 +1844,43 @@ function ne(e) {
|
|
|
1845
1844
|
<p>
|
|
1846
1845
|
</p>` : e;
|
|
1847
1846
|
}
|
|
1848
|
-
function qe(e, t = void 0,
|
|
1849
|
-
const
|
|
1850
|
-
w(e, (
|
|
1851
|
-
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, {
|
|
1852
1851
|
method: "GET",
|
|
1853
1852
|
headers: {
|
|
1854
|
-
"X-DS-SWYM-CSRFTOKEN":
|
|
1853
|
+
"X-DS-SWYM-CSRFTOKEN": a.result.ServerToken
|
|
1855
1854
|
},
|
|
1856
|
-
onComplete(
|
|
1857
|
-
const
|
|
1858
|
-
t && t(
|
|
1855
|
+
onComplete(c, i, o) {
|
|
1856
|
+
const r = JSON.parse(c);
|
|
1857
|
+
t && t(r.result);
|
|
1859
1858
|
},
|
|
1860
|
-
onFailure(
|
|
1861
|
-
const
|
|
1862
|
-
|
|
1859
|
+
onFailure(c, i, o) {
|
|
1860
|
+
const r = { erreur: JSON.parse(c), headers: i, xhr: o };
|
|
1861
|
+
s && s(r);
|
|
1863
1862
|
}
|
|
1864
1863
|
});
|
|
1865
1864
|
});
|
|
1866
1865
|
}
|
|
1867
|
-
function Qe(e, t,
|
|
1868
|
-
const
|
|
1866
|
+
function Qe(e, t, s = void 0, n = void 0) {
|
|
1867
|
+
const a = e.space + "/api/user/find/login/" + t;
|
|
1869
1868
|
w(
|
|
1870
1869
|
e,
|
|
1871
|
-
(
|
|
1872
|
-
f(
|
|
1870
|
+
(c) => {
|
|
1871
|
+
f(a, {
|
|
1873
1872
|
method: "GET",
|
|
1874
|
-
headers: { "X-DS-SWYM-CSRFTOKEN":
|
|
1875
|
-
onComplete(i,
|
|
1873
|
+
headers: { "X-DS-SWYM-CSRFTOKEN": c.result.ServerToken },
|
|
1874
|
+
onComplete(i, o, r) {
|
|
1876
1875
|
const d = JSON.parse(i);
|
|
1877
|
-
|
|
1876
|
+
s && s(d);
|
|
1878
1877
|
},
|
|
1879
1878
|
onFailure(i) {
|
|
1880
|
-
|
|
1879
|
+
n && n(i);
|
|
1881
1880
|
}
|
|
1882
1881
|
});
|
|
1883
1882
|
},
|
|
1884
|
-
|
|
1883
|
+
n
|
|
1885
1884
|
);
|
|
1886
1885
|
}
|
|
1887
1886
|
function Ze(e) {
|