@edifice.io/client 2.0.5-develop-pedago.20250204132346 → 2.0.5-develop-pedago.20250211181024
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/index.cjs +1 -1
- package/dist/index.js +393 -316
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1,18 +1,93 @@
|
|
|
1
|
-
var
|
|
2
|
-
var T = (
|
|
3
|
-
var
|
|
1
|
+
var D = Object.defineProperty;
|
|
2
|
+
var T = (u, e, t) => e in u ? D(u, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : u[e] = t;
|
|
3
|
+
var n = (u, e, t) => T(u, typeof e != "symbol" ? e + "" : e, t);
|
|
4
4
|
import axios from "axios";
|
|
5
5
|
import { MimeTypeUtils } from "@edifice.io/utilities";
|
|
6
6
|
const ERROR_CODE = {
|
|
7
|
+
SUCCESS: "0000",
|
|
7
8
|
UNKNOWN: "0010",
|
|
9
|
+
NOT_INITIALIZED: "0020",
|
|
8
10
|
NOT_SUPPORTED: "0030",
|
|
9
11
|
APP_NOT_FOUND: "0040",
|
|
12
|
+
AGENT_NOT_FOUND: "0050",
|
|
13
|
+
TRANSPORT_ERROR: "0060",
|
|
10
14
|
TIME_OUT: "0070",
|
|
11
15
|
MALFORMED_DATA: "0080",
|
|
12
16
|
NOT_LOGGED_IN: "0090"
|
|
13
17
|
}, APP$4 = {
|
|
18
|
+
ADMIN: "admin",
|
|
19
|
+
ARCHIVE: "archive",
|
|
20
|
+
AUTH: "auth",
|
|
21
|
+
CAS: "cas",
|
|
22
|
+
COMMUNICATION: "communication",
|
|
23
|
+
CONVERSATION: "conversation",
|
|
24
|
+
DIRECTORY: "directory",
|
|
25
|
+
// FIXME userbook OR directory : the choice may impact some configurations, @see IXitiTrackingParams.NOM_PAGE for example
|
|
26
|
+
USERBOOK: "userbook",
|
|
27
|
+
INFRA: "infra",
|
|
28
|
+
PORTAL: "portal",
|
|
14
29
|
TIMELINE: "timeline",
|
|
15
|
-
|
|
30
|
+
WORKSPACE: "workspace",
|
|
31
|
+
// -- a few others commonly used apps
|
|
32
|
+
EXPLORER: "explorer",
|
|
33
|
+
HOMEWORKS: "homeworks",
|
|
34
|
+
VIDEO: "video",
|
|
35
|
+
MINDMAP: "mindmap",
|
|
36
|
+
SCRAPBOOK: "scrapbook",
|
|
37
|
+
COLLABORATIVEWALL: "collaborativewall",
|
|
38
|
+
WIKI: "wiki",
|
|
39
|
+
TIMELINEGENERATOR: "timelinegenerator",
|
|
40
|
+
COLLABORATIVEEDITOR: "collaborativeeditor"
|
|
41
|
+
// TODO compléter/trier les apps suivantes
|
|
42
|
+
/*
|
|
43
|
+
"competences"
|
|
44
|
+
"cahier-textes"
|
|
45
|
+
"poll"
|
|
46
|
+
"rack"
|
|
47
|
+
"rbs"
|
|
48
|
+
"searchengine"
|
|
49
|
+
"sharebigfiles"
|
|
50
|
+
"schoolbook"
|
|
51
|
+
"archive"
|
|
52
|
+
"admin"
|
|
53
|
+
"cahier-de-texte"
|
|
54
|
+
"wiki"
|
|
55
|
+
"cns"
|
|
56
|
+
"conversation"
|
|
57
|
+
"paths"
|
|
58
|
+
"parcours"
|
|
59
|
+
"notebook"
|
|
60
|
+
"account"
|
|
61
|
+
"support"
|
|
62
|
+
"workspace"
|
|
63
|
+
"admin-portal"
|
|
64
|
+
"stats"
|
|
65
|
+
"userbook" // FIXME userbook OR directory : the choice may impact some configurations, @see IXitiTrackingParams.NOM_PAGE for example
|
|
66
|
+
"directory" // FIXME Keep in mind that ode-ts-client MUST not access the locationPath of the window !
|
|
67
|
+
"mindmap"
|
|
68
|
+
"timelinegenerator"
|
|
69
|
+
"actualites"
|
|
70
|
+
"pad"
|
|
71
|
+
"collaborativeeditor"
|
|
72
|
+
"settings-class"
|
|
73
|
+
"library"
|
|
74
|
+
"visioconf"
|
|
75
|
+
"Web-conference"
|
|
76
|
+
"notes"
|
|
77
|
+
"attendance"
|
|
78
|
+
"calendar"
|
|
79
|
+
"canal-numerique"
|
|
80
|
+
"collaborative-wall"
|
|
81
|
+
"statistics"
|
|
82
|
+
"polls"
|
|
83
|
+
"community"
|
|
84
|
+
"forum"
|
|
85
|
+
"pages"
|
|
86
|
+
"website"
|
|
87
|
+
"parametrage"
|
|
88
|
+
"kne"
|
|
89
|
+
"sacoche"
|
|
90
|
+
*/
|
|
16
91
|
}, USER_PREFS = {
|
|
17
92
|
APPS: "apps",
|
|
18
93
|
WIDGETS: "widgets",
|
|
@@ -25,7 +100,7 @@ const ERROR_CODE = {
|
|
|
25
100
|
};
|
|
26
101
|
class Subscription {
|
|
27
102
|
constructor(e, t) {
|
|
28
|
-
|
|
103
|
+
n(this, "revoke");
|
|
29
104
|
this._channel = e, this.revoke = this.setReceiver(
|
|
30
105
|
(s) => t == null ? void 0 : t(s.data)
|
|
31
106
|
);
|
|
@@ -43,7 +118,7 @@ class Subject {
|
|
|
43
118
|
* => We maintain here channels for *sending* messages.
|
|
44
119
|
* *Receiving* channels will be instantiated while subscribing.
|
|
45
120
|
*/
|
|
46
|
-
|
|
121
|
+
n(this, "publishChannels", /* @__PURE__ */ new Map());
|
|
47
122
|
}
|
|
48
123
|
getChannelName(e) {
|
|
49
124
|
return "Subject:" + e;
|
|
@@ -78,9 +153,9 @@ const ASYNC_DATA_NAME = {
|
|
|
78
153
|
class Promisified {
|
|
79
154
|
constructor() {
|
|
80
155
|
//-------------------------------------
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
156
|
+
n(this, "_resolution");
|
|
157
|
+
n(this, "_rejection");
|
|
158
|
+
n(this, "_promise", new Promise((e, t) => {
|
|
84
159
|
this._resolution = e, this._rejection = t;
|
|
85
160
|
}));
|
|
86
161
|
}
|
|
@@ -97,8 +172,8 @@ class Promisified {
|
|
|
97
172
|
class NotifyFramework {
|
|
98
173
|
constructor() {
|
|
99
174
|
//-------------------------------------
|
|
100
|
-
|
|
101
|
-
|
|
175
|
+
n(this, "promises", {});
|
|
176
|
+
n(this, "subject", new Subject());
|
|
102
177
|
}
|
|
103
178
|
asyncData(e) {
|
|
104
179
|
return typeof this.promises[e] > "u" && (this.promises[e] = new Promisified()), this.promises[e];
|
|
@@ -129,8 +204,8 @@ const notify = new NotifyFramework(), loadedScripts$1 = {};
|
|
|
129
204
|
class Http {
|
|
130
205
|
constructor(e) {
|
|
131
206
|
// Axios automatically manages the XSRF-TOKEN cookie and the X-XSRF-TOKEN HTTP header.
|
|
132
|
-
|
|
133
|
-
|
|
207
|
+
n(this, "axios");
|
|
208
|
+
n(this, "_latestResponse");
|
|
134
209
|
this.axios = axios.create(e);
|
|
135
210
|
}
|
|
136
211
|
setCdn(e) {
|
|
@@ -208,15 +283,15 @@ class Http {
|
|
|
208
283
|
}
|
|
209
284
|
getScript(e, t, s) {
|
|
210
285
|
const r = s ?? "exports", i = this.toAxiosConfig(t);
|
|
211
|
-
return i.headers && (i.headers.Accept = "application/javascript"), this.axios.get(this.toCdnUrl(e), i).then((
|
|
286
|
+
return i.headers && (i.headers.Accept = "application/javascript"), this.axios.get(this.toCdnUrl(e), i).then((o) => this.mapAxiosResponse(o, t)).then((o) => {
|
|
212
287
|
try {
|
|
213
|
-
const a = `"use strict";var ${r.split(".")[0]}={};${
|
|
288
|
+
const a = `"use strict";var ${r.split(".")[0]}={};${o};return ${r};`;
|
|
214
289
|
return Function(a)();
|
|
215
290
|
} catch {
|
|
216
|
-
return
|
|
291
|
+
return o;
|
|
217
292
|
}
|
|
218
|
-
}).catch((
|
|
219
|
-
throw this.mapAxiosError(
|
|
293
|
+
}).catch((o) => {
|
|
294
|
+
throw this.mapAxiosError(o, t), o;
|
|
220
295
|
});
|
|
221
296
|
}
|
|
222
297
|
loadScript(e, t) {
|
|
@@ -227,7 +302,7 @@ class Http {
|
|
|
227
302
|
}
|
|
228
303
|
class TransportFramework {
|
|
229
304
|
constructor() {
|
|
230
|
-
|
|
305
|
+
n(this, "_http", new Http());
|
|
231
306
|
}
|
|
232
307
|
get http() {
|
|
233
308
|
return this._http;
|
|
@@ -246,11 +321,11 @@ class ConfigurationFrameworkFactory {
|
|
|
246
321
|
const http$2 = transport.http;
|
|
247
322
|
class Session {
|
|
248
323
|
constructor() {
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
324
|
+
n(this, "_me", null);
|
|
325
|
+
n(this, "_currentLanguage", "");
|
|
326
|
+
n(this, "_notLoggedIn", !0);
|
|
327
|
+
n(this, "_description");
|
|
328
|
+
n(this, "_profile");
|
|
254
329
|
}
|
|
255
330
|
get currentLanguage() {
|
|
256
331
|
return this._currentLanguage;
|
|
@@ -295,8 +370,8 @@ class Session {
|
|
|
295
370
|
hasRight(e, t) {
|
|
296
371
|
if (t === "owner")
|
|
297
372
|
return e.owner && e.owner.userId === this._me.userId;
|
|
298
|
-
const s = t.right || t, i = e.shared.filter((a) => (this._me.groupsIds || []).indexOf(a.groupId) !== -1 || a.userId === this._me.userId).find((a) => a[s] || a.manager) !== void 0,
|
|
299
|
-
return i &&
|
|
373
|
+
const s = t.right || t, i = e.shared.filter((a) => (this._me.groupsIds || []).indexOf(a.groupId) !== -1 || a.userId === this._me.userId).find((a) => a[s] || a.manager) !== void 0, o = t.workflow ? this.hasWorkflow(t.workflow) : !0;
|
|
374
|
+
return i && o;
|
|
300
375
|
}
|
|
301
376
|
////////////////////////////////////////////////////////// Storage management
|
|
302
377
|
get latestQuotaAndUsage() {
|
|
@@ -368,7 +443,7 @@ class Session {
|
|
|
368
443
|
}
|
|
369
444
|
class SessionFramework {
|
|
370
445
|
constructor() {
|
|
371
|
-
|
|
446
|
+
n(this, "session", new Session());
|
|
372
447
|
}
|
|
373
448
|
initialize() {
|
|
374
449
|
return this.session.initialize();
|
|
@@ -392,22 +467,22 @@ class SessionFramework {
|
|
|
392
467
|
const session = new SessionFramework();
|
|
393
468
|
class Theme {
|
|
394
469
|
constructor() {
|
|
395
|
-
|
|
396
|
-
|
|
470
|
+
n(this, "_conf");
|
|
471
|
+
n(this, "_loaded");
|
|
397
472
|
// legacy (readonly)
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
473
|
+
n(this, "skinName", "");
|
|
474
|
+
n(this, "themeName", "");
|
|
475
|
+
n(this, "skin", "raw");
|
|
476
|
+
n(this, "themeUrl", "/assets/themes/raw/default/");
|
|
477
|
+
n(this, "templateOverrides", {});
|
|
478
|
+
n(this, "portalTemplate", "/assets/themes/raw/portal.html");
|
|
479
|
+
n(this, "basePath", "");
|
|
480
|
+
n(this, "logoutCallback", "/");
|
|
481
|
+
n(this, "skins", []);
|
|
482
|
+
n(this, "is1D", !1);
|
|
483
|
+
n(this, "is2D", !1);
|
|
484
|
+
n(this, "_onSkinReady", notify.onSkinReady());
|
|
485
|
+
n(this, "_onOverrideReady", notify.onOverridesReady());
|
|
411
486
|
}
|
|
412
487
|
initialize(e) {
|
|
413
488
|
return notify.onSessionReady().promise.then(() => this.load(e));
|
|
@@ -740,8 +815,8 @@ class Idiom {
|
|
|
740
815
|
else {
|
|
741
816
|
const i = new Promisified();
|
|
742
817
|
promises$1[t] = i.promise;
|
|
743
|
-
const
|
|
744
|
-
e && (
|
|
818
|
+
const o = {};
|
|
819
|
+
e && (o["Accept-Language"] = e), transport.http.get(t, { headers: o }).then((a) => {
|
|
745
820
|
Object.assign(bundle$1, a), typeof s == "function" && s(), i.resolve();
|
|
746
821
|
}).catch((a) => {
|
|
747
822
|
typeof s == "function" && s(), i.reject();
|
|
@@ -779,7 +854,7 @@ class Idiom {
|
|
|
779
854
|
class UserPreferences {
|
|
780
855
|
constructor() {
|
|
781
856
|
//-------------------------------------
|
|
782
|
-
|
|
857
|
+
n(this, "data", {});
|
|
783
858
|
}
|
|
784
859
|
get(e) {
|
|
785
860
|
return this.data[e];
|
|
@@ -806,10 +881,10 @@ class UserPreferences {
|
|
|
806
881
|
class User {
|
|
807
882
|
constructor() {
|
|
808
883
|
//-------------------------------------
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
884
|
+
n(this, "_me", null);
|
|
885
|
+
n(this, "_keepOpenOnLogout", !1);
|
|
886
|
+
n(this, "_preferences", new UserPreferences());
|
|
887
|
+
n(this, "_bookmarkedApps", []);
|
|
813
888
|
}
|
|
814
889
|
get keepOpenOnLogout() {
|
|
815
890
|
return this._keepOpenOnLogout;
|
|
@@ -841,7 +916,7 @@ class User {
|
|
|
841
916
|
let s;
|
|
842
917
|
if (t && t.length && typeof t.concat == "function") {
|
|
843
918
|
this._bookmarkedApps = t, s = {
|
|
844
|
-
bookmarks: t.map((
|
|
919
|
+
bookmarks: t.map((o) => o.name),
|
|
845
920
|
applications: []
|
|
846
921
|
}, transport.http.putJson("/userbook/preference/apps", s);
|
|
847
922
|
return;
|
|
@@ -853,15 +928,15 @@ class User {
|
|
|
853
928
|
});
|
|
854
929
|
let r = !0;
|
|
855
930
|
const i = [];
|
|
856
|
-
s.bookmarks.forEach((
|
|
857
|
-
const c = this._me.apps.find((h) => h.name ===
|
|
931
|
+
s.bookmarks.forEach((o, a) => {
|
|
932
|
+
const c = this._me.apps.find((h) => h.name === o);
|
|
858
933
|
if (c) {
|
|
859
934
|
const h = Object.assign({}, c);
|
|
860
935
|
this._bookmarkedApps.push(h);
|
|
861
936
|
} else
|
|
862
|
-
i.push(
|
|
863
|
-
}), i.forEach((
|
|
864
|
-
const a = s.bookmarks.indexOf(
|
|
937
|
+
i.push(o), r = !1;
|
|
938
|
+
}), i.forEach((o) => {
|
|
939
|
+
const a = s.bookmarks.indexOf(o);
|
|
865
940
|
a !== -1 && s.bookmarks.splice(a, 1);
|
|
866
941
|
}), r || transport.http.putJson("/userbook/preference/apps", s);
|
|
867
942
|
});
|
|
@@ -883,9 +958,9 @@ const http$1 = transport == null ? void 0 : transport.http;
|
|
|
883
958
|
class AppConf {
|
|
884
959
|
constructor() {
|
|
885
960
|
//-------------------------------------
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
961
|
+
n(this, "_publicConf", {});
|
|
962
|
+
n(this, "_currentApp");
|
|
963
|
+
n(this, "_appConf", {});
|
|
889
964
|
}
|
|
890
965
|
/**
|
|
891
966
|
* Get the currently initialized App.
|
|
@@ -923,8 +998,8 @@ class AppConf {
|
|
|
923
998
|
class Analytics {
|
|
924
999
|
constructor() {
|
|
925
1000
|
//-------------------------------------
|
|
926
|
-
|
|
927
|
-
|
|
1001
|
+
n(this, "_status", "void");
|
|
1002
|
+
n(this, "_params");
|
|
928
1003
|
}
|
|
929
1004
|
get status() {
|
|
930
1005
|
return this._status;
|
|
@@ -976,8 +1051,8 @@ class Analytics {
|
|
|
976
1051
|
configure.Platform.apps.currentApp
|
|
977
1052
|
);
|
|
978
1053
|
if (!i) return;
|
|
979
|
-
const
|
|
980
|
-
if (!
|
|
1054
|
+
const o = i.xiti;
|
|
1055
|
+
if (!o || !o.LIBELLE_SERVICE || !r.UAI) return;
|
|
981
1056
|
function a(h) {
|
|
982
1057
|
let l = "";
|
|
983
1058
|
for (let E = 0; E < h.length; E++)
|
|
@@ -992,10 +1067,10 @@ class Analytics {
|
|
|
992
1067
|
Guest: "AUTRE"
|
|
993
1068
|
};
|
|
994
1069
|
return {
|
|
995
|
-
LIBELLE_SERVICE:
|
|
1070
|
+
LIBELLE_SERVICE: o.LIBELLE_SERVICE,
|
|
996
1071
|
// Which property of LIBELLE_SERVICE to use depends on the frontend.
|
|
997
|
-
TYPE:
|
|
998
|
-
OUTIL:
|
|
1072
|
+
TYPE: o.OUTIL ? "TIERS" : "NATIF",
|
|
1073
|
+
OUTIL: o.OUTIL ? o.OUTIL : "",
|
|
999
1074
|
STRUCT_ID: r.collectiviteId,
|
|
1000
1075
|
STRUCT_UAI: r.UAI,
|
|
1001
1076
|
PROJET: r.projetId ? r.projetId : e.ID_PROJET,
|
|
@@ -1009,7 +1084,7 @@ class Analytics {
|
|
|
1009
1084
|
class ConfigurationFramework {
|
|
1010
1085
|
constructor() {
|
|
1011
1086
|
//-------------------------------------
|
|
1012
|
-
|
|
1087
|
+
n(this, "Platform", {
|
|
1013
1088
|
deploymentTag: "",
|
|
1014
1089
|
cdnDomain: "",
|
|
1015
1090
|
apps: new AppConf(),
|
|
@@ -1018,15 +1093,15 @@ class ConfigurationFramework {
|
|
|
1018
1093
|
idiom: new Idiom(),
|
|
1019
1094
|
listLanguages: () => transport.http.get("/languages")
|
|
1020
1095
|
});
|
|
1021
|
-
|
|
1096
|
+
n(this, "School", {
|
|
1022
1097
|
//apps; -> pinnedApps;
|
|
1023
1098
|
});
|
|
1024
|
-
|
|
1099
|
+
n(this, "User", new User());
|
|
1025
1100
|
}
|
|
1026
1101
|
async initialize(e, t) {
|
|
1027
1102
|
if (!e) {
|
|
1028
|
-
const r = (h) => (h < 10 ? "0" : "") + h.toFixed(0), i = /* @__PURE__ */ new Date(),
|
|
1029
|
-
e = `${
|
|
1103
|
+
const r = (h) => (h < 10 ? "0" : "") + h.toFixed(0), i = /* @__PURE__ */ new Date(), o = i.getFullYear(), a = i.getMonth() + 1, c = i.getDate();
|
|
1104
|
+
e = `${o}${r(a)}${r(c)}`;
|
|
1030
1105
|
}
|
|
1031
1106
|
const s = e;
|
|
1032
1107
|
this.Platform.deploymentTag = e, typeof t == "string" && t.length > 0 && (this.Platform.cdnDomain = t), transport.http.setCdn(this.Platform.cdnDomain), await Promise.all([
|
|
@@ -1068,8 +1143,8 @@ var _;
|
|
|
1068
1143
|
const me = (_ = session == null ? void 0 : session.session) == null ? void 0 : _.user;
|
|
1069
1144
|
class Notification {
|
|
1070
1145
|
constructor(e) {
|
|
1071
|
-
|
|
1072
|
-
|
|
1146
|
+
n(this, "_id");
|
|
1147
|
+
n(this, "model");
|
|
1073
1148
|
e.reported = e.reporters && e.reporters.length > 0, this._id = e._id, this.model = e;
|
|
1074
1149
|
}
|
|
1075
1150
|
isUnread() {
|
|
@@ -1089,14 +1164,14 @@ class Notification {
|
|
|
1089
1164
|
class TimelineApp {
|
|
1090
1165
|
constructor() {
|
|
1091
1166
|
//-------------------------------------
|
|
1092
|
-
|
|
1093
|
-
|
|
1167
|
+
n(this, "_notifications", []);
|
|
1168
|
+
n(this, "_notificationTypes", []);
|
|
1094
1169
|
// ex: ["BLOG"]
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1170
|
+
n(this, "_flashMessages", []);
|
|
1171
|
+
n(this, "_pageNumber", 0);
|
|
1172
|
+
n(this, "_lastPage", !1);
|
|
1173
|
+
n(this, "_loading", !1);
|
|
1174
|
+
n(this, "showMine", !1);
|
|
1100
1175
|
}
|
|
1101
1176
|
get notifications() {
|
|
1102
1177
|
return this._notifications;
|
|
@@ -1154,10 +1229,10 @@ class TimelineApp {
|
|
|
1154
1229
|
if (this._loading = !1, r.status === "ok")
|
|
1155
1230
|
if (r.number && r.results) {
|
|
1156
1231
|
const i = r.results.filter(
|
|
1157
|
-
(
|
|
1158
|
-
(a) => a._id ===
|
|
1232
|
+
(o) => this._notifications.findIndex(
|
|
1233
|
+
(a) => a._id === o._id
|
|
1159
1234
|
) === -1
|
|
1160
|
-
).map((
|
|
1235
|
+
).map((o) => new Notification(o));
|
|
1161
1236
|
this._notifications = this._notifications.concat(i), this._pageNumber++;
|
|
1162
1237
|
} else
|
|
1163
1238
|
this._lastPage = !0;
|
|
@@ -1194,10 +1269,12 @@ class NotifyFrameworkFactory {
|
|
|
1194
1269
|
}
|
|
1195
1270
|
const LAYER_NAME = {
|
|
1196
1271
|
WIDGETS: "widgets",
|
|
1272
|
+
EXPLORER: "explorer",
|
|
1197
1273
|
TRANSPORT: "transport",
|
|
1198
1274
|
WEB_DATA: "webDataPipeline"
|
|
1199
1275
|
}, EVENT_NAME = {
|
|
1200
1276
|
USERPREF_CHANGED: "userprefChanged",
|
|
1277
|
+
SEARCH_RESULTED: "searchResulted",
|
|
1201
1278
|
ERROR_OCCURED: "error",
|
|
1202
1279
|
DATA_TRACKED: "track"
|
|
1203
1280
|
};
|
|
@@ -1243,7 +1320,7 @@ const f = class f {
|
|
|
1243
1320
|
//
|
|
1244
1321
|
// PROTECTED HELPERS
|
|
1245
1322
|
//
|
|
1246
|
-
|
|
1323
|
+
n(this, "checkHttpResponse", (e) => {
|
|
1247
1324
|
if (this.http.latestResponse.status >= 300)
|
|
1248
1325
|
throw this.http.latestResponse.statusText;
|
|
1249
1326
|
return e;
|
|
@@ -1395,7 +1472,7 @@ const f = class f {
|
|
|
1395
1472
|
});
|
|
1396
1473
|
return t.map((r) => {
|
|
1397
1474
|
const i = s.resources.find(
|
|
1398
|
-
(
|
|
1475
|
+
(o) => o.assetId === r
|
|
1399
1476
|
);
|
|
1400
1477
|
if (i === void 0)
|
|
1401
1478
|
throw "explorer.assetid.notfound";
|
|
@@ -1461,8 +1538,8 @@ const f = class f {
|
|
|
1461
1538
|
//
|
|
1462
1539
|
// STATIC REGISTRY
|
|
1463
1540
|
//
|
|
1464
|
-
|
|
1465
|
-
|
|
1541
|
+
n(f, "registry", new ServiceRegistry()), // Expose some useful functions
|
|
1542
|
+
n(f, "register", f.registry.register.bind(f.registry)), n(f, "findService", f.registry.findService.bind(f.registry)), n(f, "findMainService", f.registry.findMainService.bind(f.registry)), n(f, "isRegistered", f.registry.isRegistered.bind(f.registry));
|
|
1466
1543
|
let ResourceService = f;
|
|
1467
1544
|
const APP$3 = "scrapbook", RESOURCE$3 = "scrapbook";
|
|
1468
1545
|
class ScrapbookResourceService extends ResourceService {
|
|
@@ -1505,7 +1582,7 @@ class ScrapbookResourceService extends ResourceService {
|
|
|
1505
1582
|
}
|
|
1506
1583
|
ResourceService.register(
|
|
1507
1584
|
{ application: RESOURCE$3, resourceType: RESOURCE$3 },
|
|
1508
|
-
(
|
|
1585
|
+
(u) => new ScrapbookResourceService(u)
|
|
1509
1586
|
);
|
|
1510
1587
|
const APP$2 = "homeworks", RESOURCE$2 = "homeworks";
|
|
1511
1588
|
class HomeworksResourceService extends ResourceService {
|
|
@@ -1553,7 +1630,7 @@ class HomeworksResourceService extends ResourceService {
|
|
|
1553
1630
|
}
|
|
1554
1631
|
ResourceService.register(
|
|
1555
1632
|
{ application: RESOURCE$2, resourceType: RESOURCE$2 },
|
|
1556
|
-
(
|
|
1633
|
+
(u) => new HomeworksResourceService(u)
|
|
1557
1634
|
);
|
|
1558
1635
|
const APP$1 = "timelinegenerator", RESOURCE$1 = "timelinegenerator";
|
|
1559
1636
|
class TimelineGeneratorResourceService extends ResourceService {
|
|
@@ -1608,29 +1685,29 @@ class TimelineGeneratorResourceService extends ResourceService {
|
|
|
1608
1685
|
}
|
|
1609
1686
|
ResourceService.register(
|
|
1610
1687
|
{ application: RESOURCE$1, resourceType: RESOURCE$1 },
|
|
1611
|
-
(
|
|
1688
|
+
(u) => new TimelineGeneratorResourceService(u)
|
|
1612
1689
|
);
|
|
1613
1690
|
const APP = "collaborativeeditor", RESOURCE = "collaborativeeditor";
|
|
1614
1691
|
class CollaborativeEditorResourceService extends ResourceService {
|
|
1615
1692
|
async create(e) {
|
|
1616
|
-
const { name: t, description: s, thumbnail: r, folder: i } = e,
|
|
1693
|
+
const { name: t, description: s, thumbnail: r, folder: i } = e, o = r ? await this.getThumbnailPath(r) : "", a = await this.http.post("/collaborativeeditor", {
|
|
1617
1694
|
name: t,
|
|
1618
1695
|
description: s,
|
|
1619
|
-
thumbnail:
|
|
1696
|
+
thumbnail: o,
|
|
1620
1697
|
folder: i
|
|
1621
1698
|
});
|
|
1622
1699
|
return this.checkHttpResponse(a), a;
|
|
1623
1700
|
}
|
|
1624
1701
|
async update(e) {
|
|
1625
|
-
const { name: t, description: s, thumbnail: r, entId: i } = e,
|
|
1702
|
+
const { name: t, description: s, thumbnail: r, entId: i } = e, o = await this.getThumbnailPath(r), a = await this.http.put(
|
|
1626
1703
|
`/collaborativeeditor/${i}`,
|
|
1627
1704
|
{
|
|
1628
1705
|
name: t,
|
|
1629
1706
|
description: s,
|
|
1630
|
-
thumbnail:
|
|
1707
|
+
thumbnail: o
|
|
1631
1708
|
}
|
|
1632
1709
|
);
|
|
1633
|
-
return this.checkHttpResponse(a), { thumbnail:
|
|
1710
|
+
return this.checkHttpResponse(a), { thumbnail: o, entId: i };
|
|
1634
1711
|
}
|
|
1635
1712
|
getResourceType() {
|
|
1636
1713
|
return RESOURCE;
|
|
@@ -1656,7 +1733,7 @@ class CollaborativeEditorResourceService extends ResourceService {
|
|
|
1656
1733
|
}
|
|
1657
1734
|
ResourceService.register(
|
|
1658
1735
|
{ application: RESOURCE, resourceType: RESOURCE },
|
|
1659
|
-
(
|
|
1736
|
+
(u) => new CollaborativeEditorResourceService(u)
|
|
1660
1737
|
);
|
|
1661
1738
|
const globalCache = {}, mutexPromise = {};
|
|
1662
1739
|
class CacheService {
|
|
@@ -1725,14 +1802,14 @@ class ConfService {
|
|
|
1725
1802
|
]), [r, i] = await Promise.all([
|
|
1726
1803
|
this.getTheme({ conf: t, publicTheme: s === void 0 }),
|
|
1727
1804
|
this.getWebAppConf({ app: e, applications: s ?? [] })
|
|
1728
|
-
]),
|
|
1805
|
+
]), o = {
|
|
1729
1806
|
app: e,
|
|
1730
1807
|
applications: s ?? [],
|
|
1731
1808
|
conf: t,
|
|
1732
1809
|
currentApp: i,
|
|
1733
1810
|
theme: r
|
|
1734
1811
|
};
|
|
1735
|
-
return this.notify.onAppConfReady().resolve(
|
|
1812
|
+
return this.notify.onAppConfReady().resolve(o), o;
|
|
1736
1813
|
}
|
|
1737
1814
|
async getPublicConf(e) {
|
|
1738
1815
|
const { response: t, value: s } = await this.cache.httpGet(
|
|
@@ -1784,23 +1861,23 @@ class ConfService {
|
|
|
1784
1861
|
conf: t,
|
|
1785
1862
|
publicTheme: s
|
|
1786
1863
|
}) {
|
|
1787
|
-
const r = await this.http.get("/theme"), i = s ? null : r,
|
|
1864
|
+
const r = await this.http.get("/theme"), i = s ? null : r, o = t == null ? void 0 : t.overriding.find(
|
|
1788
1865
|
(p) => (
|
|
1789
1866
|
// Public access => simply use the 1st override
|
|
1790
1867
|
i === null || p.child === i.themeName
|
|
1791
1868
|
)
|
|
1792
|
-
), a = (i == null ? void 0 : i.skinName) ||
|
|
1869
|
+
), a = (i == null ? void 0 : i.skinName) || o.skins[0], c = (i == null ? void 0 : i.skin) || `/assets/themes/${o.child}/skins/${a}/`, h = o.skins, l = o.bootstrapVersion.split("-").slice(-1)[0], E = o.parent === "panda";
|
|
1793
1870
|
return {
|
|
1794
1871
|
basePath: `${this.cdnDomain}${c}../../`,
|
|
1795
1872
|
bootstrapVersion: l,
|
|
1796
1873
|
is1d: E,
|
|
1797
1874
|
logoutCallback: (i == null ? void 0 : i.logoutCallback) || "/",
|
|
1798
|
-
skin:
|
|
1875
|
+
skin: o.child,
|
|
1799
1876
|
skinName: a,
|
|
1800
1877
|
skins: h,
|
|
1801
|
-
themeName:
|
|
1878
|
+
themeName: o.child,
|
|
1802
1879
|
themeUrl: c,
|
|
1803
|
-
npmTheme:
|
|
1880
|
+
npmTheme: o.npmTheme ?? void 0
|
|
1804
1881
|
};
|
|
1805
1882
|
}
|
|
1806
1883
|
async getLogoutCallback(e) {
|
|
@@ -1845,13 +1922,13 @@ class DirectoryService {
|
|
|
1845
1922
|
return {
|
|
1846
1923
|
id: s,
|
|
1847
1924
|
displayName: r,
|
|
1848
|
-
groups: t.map(({ name:
|
|
1849
|
-
displayName:
|
|
1925
|
+
groups: t.map(({ name: o, id: a }) => ({
|
|
1926
|
+
displayName: o,
|
|
1850
1927
|
id: a
|
|
1851
1928
|
})),
|
|
1852
|
-
users: i.map(({ displayName:
|
|
1929
|
+
users: i.map(({ displayName: o, id: a, profile: c }) => ({
|
|
1853
1930
|
profile: c,
|
|
1854
|
-
displayName:
|
|
1931
|
+
displayName: o,
|
|
1855
1932
|
// these info are missing from api
|
|
1856
1933
|
firstName: "",
|
|
1857
1934
|
lastName: "",
|
|
@@ -1866,7 +1943,7 @@ class DirectoryService {
|
|
|
1866
1943
|
users: r
|
|
1867
1944
|
}) {
|
|
1868
1945
|
this.cache.clearCache("/directory/sharebookmark/all");
|
|
1869
|
-
const i = r.map((p) => typeof p == "string" ? p : p.id),
|
|
1946
|
+
const i = r.map((p) => typeof p == "string" ? p : p.id), o = s.map((p) => typeof p == "string" ? p : p.id), a = t.map(async (p) => {
|
|
1870
1947
|
if (typeof p == "string") {
|
|
1871
1948
|
const { displayName: d, groups: g, id: A, users: m } = await this.getBookMarkById(p), b = m.map((F) => F.id), C = g.map((F) => F.id);
|
|
1872
1949
|
return {
|
|
@@ -1878,7 +1955,7 @@ class DirectoryService {
|
|
|
1878
1955
|
return Promise.resolve(p);
|
|
1879
1956
|
}), h = (await Promise.all(a)).map((p) => p.members).reduce((p, d) => [...p, ...d], []), l = {
|
|
1880
1957
|
name: e,
|
|
1881
|
-
members: [...i, ...
|
|
1958
|
+
members: [...i, ...o, ...h]
|
|
1882
1959
|
}, { id: E } = await this.http.postJson(
|
|
1883
1960
|
"/directory/sharebookmark",
|
|
1884
1961
|
l
|
|
@@ -1894,10 +1971,10 @@ const loadedScripts = {};
|
|
|
1894
1971
|
class HttpService {
|
|
1895
1972
|
constructor(e, t) {
|
|
1896
1973
|
// Axios automatically manages the XSRF-TOKEN cookie and the X-XSRF-TOKEN HTTP header.
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1974
|
+
n(this, "axios");
|
|
1975
|
+
n(this, "baseUrl");
|
|
1976
|
+
n(this, "headers", {});
|
|
1977
|
+
n(this, "_latestResponse");
|
|
1901
1978
|
this.context = e, this.axios = axios.create(t);
|
|
1902
1979
|
}
|
|
1903
1980
|
fixBaseUrl(e) {
|
|
@@ -1942,15 +2019,15 @@ class HttpService {
|
|
|
1942
2019
|
status: 500,
|
|
1943
2020
|
statusText: ERROR_CODE.UNKNOWN
|
|
1944
2021
|
};
|
|
1945
|
-
const { status: s, statusText: r, headers: i, data:
|
|
2022
|
+
const { status: s, statusText: r, headers: i, data: o } = this._latestResponse;
|
|
1946
2023
|
return t != null && t.disableNotifications || notify.events().publish(LAYER_NAME.TRANSPORT, {
|
|
1947
2024
|
name: EVENT_NAME.ERROR_OCCURED,
|
|
1948
2025
|
data: {
|
|
1949
2026
|
params: t,
|
|
1950
2027
|
response: { status: s, statusText: r, headers: i },
|
|
1951
|
-
payload:
|
|
2028
|
+
payload: o
|
|
1952
2029
|
}
|
|
1953
|
-
}),
|
|
2030
|
+
}), o;
|
|
1954
2031
|
}
|
|
1955
2032
|
mapAxiosResponse(e, t) {
|
|
1956
2033
|
return this._latestResponse = e, e.data;
|
|
@@ -2073,15 +2150,15 @@ class HttpService {
|
|
|
2073
2150
|
}
|
|
2074
2151
|
getScript(e, t, s) {
|
|
2075
2152
|
const r = s ?? "exports", i = this.toAxiosConfig(t);
|
|
2076
|
-
return i.headers && (i.headers.Accept = "application/javascript"), this.axios.get(this.toCdnUrl(e), i).then((
|
|
2153
|
+
return i.headers && (i.headers.Accept = "application/javascript"), this.axios.get(this.toCdnUrl(e), i).then((o) => this.mapAxiosResponse(o, t)).then((o) => {
|
|
2077
2154
|
try {
|
|
2078
|
-
const a = `"use strict";var ${r.split(".")[0]}={};${
|
|
2155
|
+
const a = `"use strict";var ${r.split(".")[0]}={};${o};return ${r};`;
|
|
2079
2156
|
return Function(a)();
|
|
2080
2157
|
} catch {
|
|
2081
|
-
return
|
|
2158
|
+
return o;
|
|
2082
2159
|
}
|
|
2083
|
-
}).catch((
|
|
2084
|
-
throw this.mapAxiosError(
|
|
2160
|
+
}).catch((o) => {
|
|
2161
|
+
throw this.mapAxiosError(o, t), o;
|
|
2085
2162
|
});
|
|
2086
2163
|
}
|
|
2087
2164
|
loadScript(e, t) {
|
|
@@ -2141,13 +2218,13 @@ class RightService {
|
|
|
2141
2218
|
* @returns true if has rights
|
|
2142
2219
|
*/
|
|
2143
2220
|
hasResourceRight({ id: e, groupIds: t }, s, r) {
|
|
2144
|
-
const i = r.map((
|
|
2145
|
-
for (const
|
|
2146
|
-
if (
|
|
2221
|
+
const i = r.map((o) => typeof o == "string" ? this.parseResourceRight(o) : o).filter((o) => o !== void 0);
|
|
2222
|
+
for (const o of i) {
|
|
2223
|
+
if (o.id === e && o.type === "creator")
|
|
2147
2224
|
return !0;
|
|
2148
|
-
if (
|
|
2225
|
+
if (o.id === e && o.type === "user" && o.right === s)
|
|
2149
2226
|
return !0;
|
|
2150
|
-
if (t.includes(
|
|
2227
|
+
if (t.includes(o.id) && o.type === "group" && o.right === s)
|
|
2151
2228
|
return !0;
|
|
2152
2229
|
}
|
|
2153
2230
|
return !1;
|
|
@@ -2284,7 +2361,7 @@ class SessionService {
|
|
|
2284
2361
|
s,
|
|
2285
2362
|
r,
|
|
2286
2363
|
i,
|
|
2287
|
-
|
|
2364
|
+
o
|
|
2288
2365
|
] = await Promise.all([
|
|
2289
2366
|
this.getCurrentLanguage(e),
|
|
2290
2367
|
this.latestQuotaAndUsage(e),
|
|
@@ -2298,7 +2375,7 @@ class SessionService {
|
|
|
2298
2375
|
currentLanguage: t,
|
|
2299
2376
|
userDescription: r,
|
|
2300
2377
|
userProfile: i,
|
|
2301
|
-
bookmarkedApps:
|
|
2378
|
+
bookmarkedApps: o
|
|
2302
2379
|
};
|
|
2303
2380
|
}
|
|
2304
2381
|
login(e, t, s, r) {
|
|
@@ -2392,9 +2469,9 @@ class SessionService {
|
|
|
2392
2469
|
applications: []
|
|
2393
2470
|
});
|
|
2394
2471
|
const i = [];
|
|
2395
|
-
return r.bookmarks.forEach((
|
|
2472
|
+
return r.bookmarks.forEach((o, a) => {
|
|
2396
2473
|
const c = ((e == null ? void 0 : e.apps) || []).find(
|
|
2397
|
-
(h) => h.name ===
|
|
2474
|
+
(h) => h.name === o
|
|
2398
2475
|
);
|
|
2399
2476
|
if (c) {
|
|
2400
2477
|
const h = Object.assign({}, c);
|
|
@@ -2404,8 +2481,8 @@ class SessionService {
|
|
|
2404
2481
|
}
|
|
2405
2482
|
async getUserProfile(e = {}) {
|
|
2406
2483
|
var c, h;
|
|
2407
|
-
const { options: t = {}, params: s = {} } = e, r = new URLSearchParams(s).toString(), i = `/userbook/api/person${r ? `?${r}` : ""}`, { response:
|
|
2408
|
-
return
|
|
2484
|
+
const { options: t = {}, params: s = {} } = e, r = new URLSearchParams(s).toString(), i = `/userbook/api/person${r ? `?${r}` : ""}`, { response: o, value: a } = await this.cache.httpGet(i, t);
|
|
2485
|
+
return o.status < 200 || o.status >= 300 || typeof a == "string" ? ["Guest"] : ((h = (c = a == null ? void 0 : a.result) == null ? void 0 : c[0]) == null ? void 0 : h.type) || ["Guest"];
|
|
2409
2486
|
}
|
|
2410
2487
|
async isAdml() {
|
|
2411
2488
|
const e = await this.getUser();
|
|
@@ -2669,8 +2746,8 @@ class IdiomService {
|
|
|
2669
2746
|
else {
|
|
2670
2747
|
const i = new Promisified();
|
|
2671
2748
|
promises[t] = i.promise;
|
|
2672
|
-
const
|
|
2673
|
-
e && (
|
|
2749
|
+
const o = {};
|
|
2750
|
+
e && (o["Accept-Language"] = e), this.http.get(t, { headers: o }).then((a) => {
|
|
2674
2751
|
Object.assign(bundle, a), typeof s == "function" && s(), i.resolve();
|
|
2675
2752
|
}).catch((a) => {
|
|
2676
2753
|
typeof s == "function" && s(), i.reject();
|
|
@@ -2734,7 +2811,7 @@ class ShareService {
|
|
|
2734
2811
|
async searchShareSubjects(e, t, s) {
|
|
2735
2812
|
const r = StringUtils.removeAccents(s).toLowerCase(), i = await this.cache.httpGetJson(
|
|
2736
2813
|
`/${e}/share/json/${t}?search=${s}`
|
|
2737
|
-
),
|
|
2814
|
+
), o = i.users.visibles.filter(({ username: l, firstName: E, lastName: p, login: d }) => {
|
|
2738
2815
|
const g = StringUtils.removeAccents(
|
|
2739
2816
|
p || ""
|
|
2740
2817
|
).toLowerCase(), A = StringUtils.removeAccents(
|
|
@@ -2767,7 +2844,7 @@ class ShareService {
|
|
|
2767
2844
|
displayName: l.displayName,
|
|
2768
2845
|
id: l.id,
|
|
2769
2846
|
type: "sharebookmark"
|
|
2770
|
-
})), ...
|
|
2847
|
+
})), ...o, ...a];
|
|
2771
2848
|
}
|
|
2772
2849
|
async getShareMapping(e) {
|
|
2773
2850
|
const t = await this.cache.httpGetJson(
|
|
@@ -2781,15 +2858,15 @@ class ShareService {
|
|
|
2781
2858
|
return t;
|
|
2782
2859
|
}
|
|
2783
2860
|
getActionsAvailableFor({ id: e, type: t }, s, r) {
|
|
2784
|
-
const
|
|
2861
|
+
const o = (t === "user" ? s.users.checked[e] : s.groups.checked[e]) || [], a = Object.keys(r), c = [];
|
|
2785
2862
|
for (const h of a)
|
|
2786
2863
|
r[h].filter(
|
|
2787
|
-
(p) =>
|
|
2864
|
+
(p) => o.includes(p)
|
|
2788
2865
|
).length > 0 && c.push(h);
|
|
2789
2866
|
return c;
|
|
2790
2867
|
}
|
|
2791
2868
|
async getRightsForResource(e, t) {
|
|
2792
|
-
const s = await this.directory.getBookMarks(), r = `/${e}/share/json/${t}?search=`, i = await this.cache.httpGetJson(r),
|
|
2869
|
+
const s = await this.directory.getBookMarks(), r = `/${e}/share/json/${t}?search=`, i = await this.cache.httpGetJson(r), o = await this.getShareMapping(e), a = await this.cache.httpGetJson(
|
|
2793
2870
|
"/infra/public/json/sharing-rights.json"
|
|
2794
2871
|
), c = Object.keys(i.users.checked).map((d) => i.users.visibles.find(
|
|
2795
2872
|
(A) => A.id === d
|
|
@@ -2797,7 +2874,7 @@ class ShareService {
|
|
|
2797
2874
|
const g = this.getActionsAvailableFor(
|
|
2798
2875
|
{ id: d.id, type: "user" },
|
|
2799
2876
|
i,
|
|
2800
|
-
|
|
2877
|
+
o
|
|
2801
2878
|
);
|
|
2802
2879
|
return {
|
|
2803
2880
|
id: d.id,
|
|
@@ -2821,7 +2898,7 @@ class ShareService {
|
|
|
2821
2898
|
const g = this.getActionsAvailableFor(
|
|
2822
2899
|
{ id: d.id, type: "group" },
|
|
2823
2900
|
i,
|
|
2824
|
-
|
|
2901
|
+
o
|
|
2825
2902
|
);
|
|
2826
2903
|
return {
|
|
2827
2904
|
id: d.id,
|
|
@@ -2871,60 +2948,60 @@ class ShareService {
|
|
|
2871
2948
|
const h = c.actions.map((E) => r[E.id]).reduce((E, p) => Array.isArray(p) ? [...E, ...p] : E, []), l = [...new Set(h)];
|
|
2872
2949
|
l.length > 0 && (c.type === "user" ? i.users[c.id] = l : c.type === "group" ? i.groups[c.id] = l : i.bookmarks[c.id] = l);
|
|
2873
2950
|
}
|
|
2874
|
-
const
|
|
2875
|
-
return this.cache.clearCache(`/${e}/share/json/${t}?search=`), await this.http.putJson(
|
|
2951
|
+
const o = `/${e}/share/resource/${t}`;
|
|
2952
|
+
return this.cache.clearCache(`/${e}/share/json/${t}?search=`), await this.http.putJson(o, i);
|
|
2876
2953
|
}
|
|
2877
2954
|
async getActionsForApp(e) {
|
|
2878
2955
|
const t = await this.cache.httpGetJson(
|
|
2879
2956
|
"/infra/public/json/sharing-rights.json"
|
|
2880
2957
|
), s = await this.getShareMapping(e);
|
|
2881
2958
|
return Object.keys(t).map((i) => {
|
|
2882
|
-
const
|
|
2959
|
+
const o = t[i];
|
|
2883
2960
|
return {
|
|
2884
2961
|
displayName: i,
|
|
2885
2962
|
id: i,
|
|
2886
|
-
priority:
|
|
2887
|
-
requires:
|
|
2963
|
+
priority: o.priority,
|
|
2964
|
+
requires: o.requires
|
|
2888
2965
|
};
|
|
2889
2966
|
}).filter((i) => {
|
|
2890
|
-
var
|
|
2891
|
-
return ((
|
|
2892
|
-
}).sort((i,
|
|
2967
|
+
var o;
|
|
2968
|
+
return ((o = s[i.id]) == null ? void 0 : o.length) > 0;
|
|
2969
|
+
}).sort((i, o) => i.priority - o.priority);
|
|
2893
2970
|
}
|
|
2894
2971
|
}
|
|
2895
2972
|
const defaultMappers = {
|
|
2896
|
-
csv: function({ type:
|
|
2897
|
-
return MimeTypeUtils.INSTANCE.isCsvLike(
|
|
2973
|
+
csv: function({ type: u, extension: e }) {
|
|
2974
|
+
return MimeTypeUtils.INSTANCE.isCsvLike(u, e);
|
|
2898
2975
|
},
|
|
2899
|
-
doc: function({ type:
|
|
2900
|
-
return MimeTypeUtils.INSTANCE.isWordLike(
|
|
2976
|
+
doc: function({ type: u, extension: e }) {
|
|
2977
|
+
return MimeTypeUtils.INSTANCE.isWordLike(u, e) ? !0 : u.indexOf("document") !== -1 && u.indexOf("wordprocessing") !== -1;
|
|
2901
2978
|
},
|
|
2902
|
-
xls: function({ type:
|
|
2903
|
-
return MimeTypeUtils.INSTANCE.isExcelLike(
|
|
2979
|
+
xls: function({ type: u, extension: e }) {
|
|
2980
|
+
return MimeTypeUtils.INSTANCE.isExcelLike(u, e) ? !0 : u.indexOf("document") !== -1 && u.indexOf("spreadsheet") !== -1 || u.indexOf("ms-excel") !== -1;
|
|
2904
2981
|
},
|
|
2905
|
-
img: function({ type:
|
|
2906
|
-
return
|
|
2982
|
+
img: function({ type: u }) {
|
|
2983
|
+
return u.indexOf("image") !== -1;
|
|
2907
2984
|
},
|
|
2908
|
-
pdf: function({ type:
|
|
2909
|
-
return
|
|
2985
|
+
pdf: function({ type: u }) {
|
|
2986
|
+
return u.indexOf("pdf") !== -1 || u === "application/x-download";
|
|
2910
2987
|
},
|
|
2911
|
-
ppt: function({ type:
|
|
2912
|
-
return MimeTypeUtils.INSTANCE.isPowerpointLike(
|
|
2988
|
+
ppt: function({ type: u, extension: e }) {
|
|
2989
|
+
return MimeTypeUtils.INSTANCE.isPowerpointLike(u, e) ? !0 : u.indexOf("document") !== -1 && u.indexOf("presentation") !== -1 || u.indexOf("powerpoint") !== -1;
|
|
2913
2990
|
},
|
|
2914
|
-
txt: function({ type:
|
|
2915
|
-
return MimeTypeUtils.INSTANCE.isTxtLike(
|
|
2991
|
+
txt: function({ type: u, extension: e }) {
|
|
2992
|
+
return MimeTypeUtils.INSTANCE.isTxtLike(u, e);
|
|
2916
2993
|
},
|
|
2917
|
-
md: function({ type:
|
|
2918
|
-
return MimeTypeUtils.INSTANCE.isMdLike(
|
|
2994
|
+
md: function({ type: u, extension: e }) {
|
|
2995
|
+
return MimeTypeUtils.INSTANCE.isMdLike(u, e);
|
|
2919
2996
|
},
|
|
2920
|
-
video: function({ type:
|
|
2921
|
-
return
|
|
2997
|
+
video: function({ type: u }) {
|
|
2998
|
+
return u.indexOf("video") !== -1;
|
|
2922
2999
|
},
|
|
2923
|
-
audio: function({ type:
|
|
2924
|
-
return
|
|
3000
|
+
audio: function({ type: u }) {
|
|
3001
|
+
return u.indexOf("audio") !== -1;
|
|
2925
3002
|
},
|
|
2926
|
-
zip: function({ type:
|
|
2927
|
-
return
|
|
3003
|
+
zip: function({ type: u }) {
|
|
3004
|
+
return u.indexOf("zip") !== -1 || u.indexOf("rar") !== -1 || u.indexOf("tar") !== -1 || u.indexOf("7z") !== -1;
|
|
2928
3005
|
}
|
|
2929
3006
|
}, R = class R {
|
|
2930
3007
|
/* Similar role notion as in infra-front > workspace > Model.ts */
|
|
@@ -2942,15 +3019,15 @@ const defaultMappers = {
|
|
|
2942
3019
|
this.roleMappers || console.warn("[DocumentHelper.role] should not have empty roles", this);
|
|
2943
3020
|
const r = { type: e, previewRole: t, extension: s };
|
|
2944
3021
|
for (const i of this.roleMappers) {
|
|
2945
|
-
const
|
|
2946
|
-
if (
|
|
2947
|
-
return
|
|
3022
|
+
const o = i(r);
|
|
3023
|
+
if (o)
|
|
3024
|
+
return o;
|
|
2948
3025
|
}
|
|
2949
3026
|
return "unknown";
|
|
2950
3027
|
}
|
|
2951
3028
|
};
|
|
2952
3029
|
// FIXME add edumedia support
|
|
2953
|
-
|
|
3030
|
+
n(R, "roleMappers", [
|
|
2954
3031
|
(e) => Object.keys(defaultMappers).find((s) => defaultMappers[s](e))
|
|
2955
3032
|
]);
|
|
2956
3033
|
let DocumentHelper = R;
|
|
@@ -2962,22 +3039,22 @@ class WorkspaceService {
|
|
|
2962
3039
|
return this.context.http();
|
|
2963
3040
|
}
|
|
2964
3041
|
extractMetadata(e) {
|
|
2965
|
-
const t = e.name || "", s = t.split("."), r = e.type || "application/octet-stream", i = s.length > 1 ? s[s.length - 1] : "",
|
|
3042
|
+
const t = e.name || "", s = t.split("."), r = e.type || "application/octet-stream", i = s.length > 1 ? s[s.length - 1] : "", o = {
|
|
2966
3043
|
"content-type": r,
|
|
2967
3044
|
filename: t,
|
|
2968
3045
|
size: e.size,
|
|
2969
3046
|
extension: i,
|
|
2970
3047
|
role: DocumentHelper.role(r, !1, i)
|
|
2971
|
-
}, a = t.replace("." +
|
|
2972
|
-
return { basename: a, fullname: c, metadata:
|
|
3048
|
+
}, a = t.replace("." + o.extension, ""), c = o.extension ? a + "." + o.extension : a;
|
|
3049
|
+
return { basename: a, fullname: c, metadata: o };
|
|
2973
3050
|
}
|
|
2974
3051
|
async saveFile(e, t) {
|
|
2975
3052
|
const { fullname: s, metadata: r } = this.extractMetadata(e), i = new FormData();
|
|
2976
3053
|
i.append("file", e, s);
|
|
2977
|
-
const
|
|
2978
|
-
((t == null ? void 0 : t.visibility) === "public" || (t == null ? void 0 : t.visibility) === "protected") &&
|
|
3054
|
+
const o = [];
|
|
3055
|
+
((t == null ? void 0 : t.visibility) === "public" || (t == null ? void 0 : t.visibility) === "protected") && o.push(`${t.visibility}=true`), t != null && t.application && o.push(`application=${t.application}`), r.role === "img" && o.push("quality=1"), t != null && t.parentId && o.push(`parentId=${t.parentId}`);
|
|
2979
3056
|
const a = await this.http.postFile(
|
|
2980
|
-
`/workspace/document?${
|
|
3057
|
+
`/workspace/document?${o.join("&")}`,
|
|
2981
3058
|
i
|
|
2982
3059
|
);
|
|
2983
3060
|
if (this.http.isResponseError())
|
|
@@ -2985,13 +3062,13 @@ class WorkspaceService {
|
|
|
2985
3062
|
return a;
|
|
2986
3063
|
}
|
|
2987
3064
|
async updateFile(e, t, s) {
|
|
2988
|
-
const { fullname: r, metadata: i } = this.extractMetadata(t),
|
|
2989
|
-
|
|
3065
|
+
const { fullname: r, metadata: i } = this.extractMetadata(t), o = new FormData();
|
|
3066
|
+
o.append("file", t, r);
|
|
2990
3067
|
const a = [];
|
|
2991
3068
|
i.role === "img" && a.push("quality=1"), s != null && s.alt && a.push(`alt=${s.alt}`), s != null && s.legend && a.push(`legend=${s.legend}`), s != null && s.name && a.push(`name=${s.name}`);
|
|
2992
3069
|
const c = await this.http.putFile(
|
|
2993
3070
|
`/workspace/document/${e}?${a.join("&")}`,
|
|
2994
|
-
|
|
3071
|
+
o
|
|
2995
3072
|
);
|
|
2996
3073
|
if (this.http.isResponseError())
|
|
2997
3074
|
throw this.http.latestResponse.statusText;
|
|
@@ -3036,17 +3113,17 @@ class WorkspaceService {
|
|
|
3036
3113
|
{
|
|
3037
3114
|
application: t,
|
|
3038
3115
|
visibility: s,
|
|
3039
|
-
ids: r.map((
|
|
3116
|
+
ids: r.map((o) => o._id)
|
|
3040
3117
|
}
|
|
3041
3118
|
);
|
|
3042
3119
|
if (this.http.isResponseError())
|
|
3043
3120
|
throw this.http.latestResponse.statusText;
|
|
3044
|
-
return r.forEach((
|
|
3121
|
+
return r.forEach((o, a) => {
|
|
3045
3122
|
const c = e.findIndex(
|
|
3046
|
-
(h) => h._id ===
|
|
3123
|
+
(h) => h._id === o._id
|
|
3047
3124
|
);
|
|
3048
3125
|
0 <= c && c < e.length && (e[c] = i[a]);
|
|
3049
|
-
}), e.filter((
|
|
3126
|
+
}), e.filter((o) => !!o);
|
|
3050
3127
|
}
|
|
3051
3128
|
return e;
|
|
3052
3129
|
}
|
|
@@ -3055,13 +3132,13 @@ class WorkspaceService {
|
|
|
3055
3132
|
* or `null` if none exists or can be created.
|
|
3056
3133
|
*/
|
|
3057
3134
|
getThumbnailUrl(e, t = 0, s = 0) {
|
|
3058
|
-
var i,
|
|
3135
|
+
var i, o;
|
|
3059
3136
|
const r = t > 0 || s > 0 ? `${t}x${s}` : "120x120";
|
|
3060
3137
|
if (typeof e == "string")
|
|
3061
3138
|
return e.includes("data:image") || e.includes("thumbnail") ? e : `${e}${e.includes("?") ? "&" : "?"}thumbnail=${r}`;
|
|
3062
3139
|
{
|
|
3063
3140
|
const a = `/workspace/${e.public ? "pub/" : ""}document/${e._id}?thumbnail=`, c = e.thumbnails;
|
|
3064
|
-
if ((
|
|
3141
|
+
if ((o = (i = e.metadata) == null ? void 0 : i["content-type"]) != null && o.includes("video")) {
|
|
3065
3142
|
const h = c && Object.keys(c).length > 0 ? Object.keys(c)[0] : null;
|
|
3066
3143
|
return h ? a + h : null;
|
|
3067
3144
|
} else
|
|
@@ -3071,8 +3148,8 @@ class WorkspaceService {
|
|
|
3071
3148
|
}
|
|
3072
3149
|
let ATTag;
|
|
3073
3150
|
class AnalyticsService {
|
|
3074
|
-
constructor(
|
|
3075
|
-
this.context =
|
|
3151
|
+
constructor(u) {
|
|
3152
|
+
this.context = u;
|
|
3076
3153
|
}
|
|
3077
3154
|
get http() {
|
|
3078
3155
|
return this.context.http();
|
|
@@ -3085,7 +3162,7 @@ class AnalyticsService {
|
|
|
3085
3162
|
* @param locationPath
|
|
3086
3163
|
* @param app
|
|
3087
3164
|
*/
|
|
3088
|
-
async trackPageLoad(
|
|
3165
|
+
async trackPageLoad(u, e) {
|
|
3089
3166
|
const [t] = await Promise.all([
|
|
3090
3167
|
// get Xiti configuration
|
|
3091
3168
|
this.getXitiConfig(e.name.toLowerCase()),
|
|
@@ -3095,7 +3172,7 @@ class AnalyticsService {
|
|
|
3095
3172
|
if (!t || !ATInternet) return;
|
|
3096
3173
|
let s = t.LIBELLE_SERVICE.default || null;
|
|
3097
3174
|
for (const r in t.LIBELLE_SERVICE)
|
|
3098
|
-
if (r !== "default" &&
|
|
3175
|
+
if (r !== "default" && u.indexOf(r) >= 0) {
|
|
3099
3176
|
s = t.LIBELLE_SERVICE[r];
|
|
3100
3177
|
break;
|
|
3101
3178
|
}
|
|
@@ -3122,7 +3199,7 @@ class AnalyticsService {
|
|
|
3122
3199
|
level2: t.STRUCT_UAI
|
|
3123
3200
|
}), ATTag.dispatch();
|
|
3124
3201
|
}
|
|
3125
|
-
async getXitiConfig(
|
|
3202
|
+
async getXitiConfig(u) {
|
|
3126
3203
|
const [e, t] = await Promise.all([
|
|
3127
3204
|
this.http.get("/analyticsConf"),
|
|
3128
3205
|
//FIXME change servers config to only keep the "all-in-one" query to /analyticsConf.
|
|
@@ -3130,7 +3207,7 @@ class AnalyticsService {
|
|
|
3130
3207
|
]);
|
|
3131
3208
|
if (!(e != null && e.type))
|
|
3132
3209
|
throw ERROR_CODE.MALFORMED_DATA;
|
|
3133
|
-
return t != null && t.active && (e.xiti = await this.getXitiTrackingParams(t,
|
|
3210
|
+
return t != null && t.active && (e.xiti = await this.getXitiTrackingParams(t, u)), e.xiti;
|
|
3134
3211
|
}
|
|
3135
3212
|
async loadXitiScript() {
|
|
3136
3213
|
if (typeof ATInternet > "u") {
|
|
@@ -3142,13 +3219,13 @@ class AnalyticsService {
|
|
|
3142
3219
|
eval(response);
|
|
3143
3220
|
}
|
|
3144
3221
|
}
|
|
3145
|
-
async getXitiTrackingParams(
|
|
3146
|
-
if (!
|
|
3222
|
+
async getXitiTrackingParams(u, e) {
|
|
3223
|
+
if (!u.structureMap || !e) return;
|
|
3147
3224
|
const t = await this.session.getUser(), s = await this.session.getUserProfile();
|
|
3148
3225
|
let r;
|
|
3149
3226
|
if (!(t != null && t.structures)) return;
|
|
3150
3227
|
for (const h of t.structures) {
|
|
3151
|
-
const l =
|
|
3228
|
+
const l = u.structureMap[h];
|
|
3152
3229
|
if (l && l.collectiviteId && l.UAI) {
|
|
3153
3230
|
r = l;
|
|
3154
3231
|
break;
|
|
@@ -3157,8 +3234,8 @@ class AnalyticsService {
|
|
|
3157
3234
|
if (!r || !r.active) return;
|
|
3158
3235
|
const i = await configure.Platform.apps.getPublicConf(e);
|
|
3159
3236
|
if (!i) return;
|
|
3160
|
-
const
|
|
3161
|
-
if (!
|
|
3237
|
+
const o = i.xiti;
|
|
3238
|
+
if (!o || !o.LIBELLE_SERVICE || !r.UAI) return;
|
|
3162
3239
|
function a(h) {
|
|
3163
3240
|
let l = "";
|
|
3164
3241
|
for (let E = 0; E < h.length; E++)
|
|
@@ -3173,15 +3250,15 @@ class AnalyticsService {
|
|
|
3173
3250
|
Guest: "AUTRE"
|
|
3174
3251
|
};
|
|
3175
3252
|
return {
|
|
3176
|
-
LIBELLE_SERVICE:
|
|
3253
|
+
LIBELLE_SERVICE: o.LIBELLE_SERVICE,
|
|
3177
3254
|
// Which property of LIBELLE_SERVICE to use depends on the frontend.
|
|
3178
|
-
TYPE:
|
|
3179
|
-
OUTIL:
|
|
3255
|
+
TYPE: o.OUTIL ? "TIERS" : "NATIF",
|
|
3256
|
+
OUTIL: o.OUTIL ? o.OUTIL : "",
|
|
3180
3257
|
STRUCT_ID: r.collectiviteId,
|
|
3181
3258
|
STRUCT_UAI: r.UAI,
|
|
3182
|
-
PROJET: r.projetId ? r.projetId :
|
|
3183
|
-
EXPLOITANT:
|
|
3184
|
-
PLATFORME: r.plateformeId ? r.plateformeId :
|
|
3259
|
+
PROJET: r.projetId ? r.projetId : u.ID_PROJET,
|
|
3260
|
+
EXPLOITANT: u.ID_EXPLOITANT,
|
|
3261
|
+
PLATFORME: r.plateformeId ? r.plateformeId : u.ID_PLATEFORME,
|
|
3185
3262
|
ID_PERSO: a(t.userId),
|
|
3186
3263
|
PROFILE: s && s.length > 0 ? c[s[0]] ?? "" : ""
|
|
3187
3264
|
};
|
|
@@ -3230,13 +3307,13 @@ const w = class w {
|
|
|
3230
3307
|
throw new Error("Invalid video file.");
|
|
3231
3308
|
if (!e.filename)
|
|
3232
3309
|
throw new Error("Invalid video filename");
|
|
3233
|
-
const i = `${e.browser.name} ${e.browser.version}`,
|
|
3234
|
-
|
|
3310
|
+
const i = `${e.browser.name} ${e.browser.version}`, o = new FormData();
|
|
3311
|
+
o.append("device", e.device || ""), o.append("browser", i), o.append("url", e.url), o.append("app", t), o.append("file", e.file, e.filename), o.append("weight", "" + e.file.size), o.append("captation", "" + s);
|
|
3235
3312
|
let a = `/video/encode?captation=${s}`;
|
|
3236
3313
|
r && (a += `&duration=${r}`);
|
|
3237
3314
|
const c = await this.http.post(
|
|
3238
3315
|
a,
|
|
3239
|
-
|
|
3316
|
+
o,
|
|
3240
3317
|
{ headers: { "Content-Type": "multipart/form-data" } }
|
|
3241
3318
|
);
|
|
3242
3319
|
if (c.state == "running") {
|
|
@@ -3266,8 +3343,8 @@ const w = class w {
|
|
|
3266
3343
|
throw new Error("Video cannot be uploaded.");
|
|
3267
3344
|
}
|
|
3268
3345
|
};
|
|
3269
|
-
|
|
3270
|
-
|
|
3346
|
+
n(w, "MAX_WEIGHT", 50), // in Mbytes. Applies to uploaded videos.
|
|
3347
|
+
n(w, "MAX_DURATION", 3);
|
|
3271
3348
|
let VideoService = w;
|
|
3272
3349
|
class EmbedderService {
|
|
3273
3350
|
constructor(e) {
|
|
@@ -3304,9 +3381,9 @@ class EmbedderService {
|
|
|
3304
3381
|
urlIsFromPattern(e, t) {
|
|
3305
3382
|
const s = new RegExp("[^{}]+(?=(?:[^{}]*{[^}]*})*[^}]*$)", "g"), r = new RegExp("{[^}]*}", "g");
|
|
3306
3383
|
let i = !0;
|
|
3307
|
-
const
|
|
3384
|
+
const o = t.match(s) || [], a = [];
|
|
3308
3385
|
return (t.match(r) || []).forEach((h, l) => {
|
|
3309
|
-
h.includes("ignore") || a.push(
|
|
3386
|
+
h.includes("ignore") || a.push(o[l]);
|
|
3310
3387
|
}), a.forEach((h) => {
|
|
3311
3388
|
if (!e.includes(h)) {
|
|
3312
3389
|
i = !1;
|
|
@@ -3337,7 +3414,7 @@ class EmbedderService {
|
|
|
3337
3414
|
for (const s of e.url)
|
|
3338
3415
|
if (this.urlIsFromPattern(t, s)) {
|
|
3339
3416
|
const r = new RegExp("{[a-zA-Z0-9_.]+}", "g"), i = s.match(r) || [];
|
|
3340
|
-
let
|
|
3417
|
+
let o = e.embed;
|
|
3341
3418
|
for (const a of i) {
|
|
3342
3419
|
let c = s.split(a)[0];
|
|
3343
3420
|
const h = c.split("}");
|
|
@@ -3348,9 +3425,9 @@ class EmbedderService {
|
|
|
3348
3425
|
const E = s.split(a)[1].split("{")[0];
|
|
3349
3426
|
E && (l = l.split(E)[0]);
|
|
3350
3427
|
const p = new RegExp("\\" + a.replace(/}/, "\\}"), "g");
|
|
3351
|
-
|
|
3428
|
+
o = o.replace(p, l);
|
|
3352
3429
|
}
|
|
3353
|
-
return
|
|
3430
|
+
return o;
|
|
3354
3431
|
}
|
|
3355
3432
|
return "";
|
|
3356
3433
|
}
|
|
@@ -3363,7 +3440,7 @@ class AbstractBehaviourService {
|
|
|
3363
3440
|
//-----------------
|
|
3364
3441
|
//--- Utilities ---
|
|
3365
3442
|
//-----------------
|
|
3366
|
-
|
|
3443
|
+
n(this, "_cache");
|
|
3367
3444
|
this.context = e, this._cache = new CacheService(this.context);
|
|
3368
3445
|
}
|
|
3369
3446
|
getApplication() {
|
|
@@ -3397,8 +3474,8 @@ class AbstractBehaviourService {
|
|
|
3397
3474
|
class ActualitesBehaviour extends AbstractBehaviourService {
|
|
3398
3475
|
constructor() {
|
|
3399
3476
|
super(...arguments);
|
|
3400
|
-
|
|
3401
|
-
|
|
3477
|
+
n(this, "APP", "actualites");
|
|
3478
|
+
n(this, "RESOURCE", "actualites");
|
|
3402
3479
|
}
|
|
3403
3480
|
async loadResources() {
|
|
3404
3481
|
return (await this.httpGet(
|
|
@@ -3421,24 +3498,24 @@ class ActualitesBehaviour extends AbstractBehaviourService {
|
|
|
3421
3498
|
class BlogBehaviour extends AbstractBehaviourService {
|
|
3422
3499
|
constructor() {
|
|
3423
3500
|
super(...arguments);
|
|
3424
|
-
|
|
3425
|
-
|
|
3501
|
+
n(this, "APP", "blog");
|
|
3502
|
+
n(this, "RESOURCE", "blog");
|
|
3426
3503
|
}
|
|
3427
3504
|
loadResources() {
|
|
3428
3505
|
return new Promise(async (t, s) => {
|
|
3429
3506
|
try {
|
|
3430
3507
|
const r = await this.httpGet("/blog/linker"), i = [];
|
|
3431
|
-
r.forEach((
|
|
3432
|
-
|
|
3433
|
-
const a =
|
|
3434
|
-
owner:
|
|
3435
|
-
ownerName:
|
|
3436
|
-
title: c.title + " [" +
|
|
3437
|
-
_id: `${
|
|
3438
|
-
icon:
|
|
3439
|
-
path: `/blog/id/${
|
|
3440
|
-
shared: !!(
|
|
3441
|
-
modified:
|
|
3508
|
+
r.forEach((o) => {
|
|
3509
|
+
o.thumbnail ? o.thumbnail = o.thumbnail + "?thumbnail=48x48" : o.thumbnail = "/img/illustrations/blog.svg";
|
|
3510
|
+
const a = o.fetchPosts.map((c) => this.dataToResource({
|
|
3511
|
+
owner: o.author.userId,
|
|
3512
|
+
ownerName: o.author.username,
|
|
3513
|
+
title: c.title + " [" + o.title + "]",
|
|
3514
|
+
_id: `${o._id}#${c._id}`,
|
|
3515
|
+
icon: o.thumbnail,
|
|
3516
|
+
path: `/blog/id/${o._id}/post/${c._id}`,
|
|
3517
|
+
shared: !!(o.shared && o.shared.length >= 0),
|
|
3518
|
+
modified: o.modified
|
|
3442
3519
|
}));
|
|
3443
3520
|
i.push(...a);
|
|
3444
3521
|
}), t(i);
|
|
@@ -3451,8 +3528,8 @@ class BlogBehaviour extends AbstractBehaviourService {
|
|
|
3451
3528
|
class CollaborativewallBehaviour extends AbstractBehaviourService {
|
|
3452
3529
|
constructor() {
|
|
3453
3530
|
super(...arguments);
|
|
3454
|
-
|
|
3455
|
-
|
|
3531
|
+
n(this, "APP", "collaborativewall");
|
|
3532
|
+
n(this, "RESOURCE", "collaborativewall");
|
|
3456
3533
|
}
|
|
3457
3534
|
async loadResources() {
|
|
3458
3535
|
return (await this.httpGet(
|
|
@@ -3474,8 +3551,8 @@ class CollaborativewallBehaviour extends AbstractBehaviourService {
|
|
|
3474
3551
|
class CommunityBehaviour extends AbstractBehaviourService {
|
|
3475
3552
|
constructor() {
|
|
3476
3553
|
super(...arguments);
|
|
3477
|
-
|
|
3478
|
-
|
|
3554
|
+
n(this, "APP", "community");
|
|
3555
|
+
n(this, "RESOURCE", "community");
|
|
3479
3556
|
}
|
|
3480
3557
|
async loadResources() {
|
|
3481
3558
|
return (await this.httpGet(
|
|
@@ -3499,24 +3576,24 @@ class CommunityBehaviour extends AbstractBehaviourService {
|
|
|
3499
3576
|
class ExercizerBehaviour extends AbstractBehaviourService {
|
|
3500
3577
|
constructor() {
|
|
3501
3578
|
super(...arguments);
|
|
3502
|
-
|
|
3503
|
-
|
|
3579
|
+
n(this, "APP", "exercizer");
|
|
3580
|
+
n(this, "RESOURCE", "exercizer");
|
|
3504
3581
|
}
|
|
3505
3582
|
async loadResources() {
|
|
3506
3583
|
return (await this.httpGet(
|
|
3507
3584
|
"/exercizer/subjects-scheduled"
|
|
3508
3585
|
)).map((s) => {
|
|
3509
3586
|
const r = s.picture ? s.picture + "?thumbnail=48x48" : "/img/illustrations/exercizer.svg";
|
|
3510
|
-
let i,
|
|
3587
|
+
let i, o = !1;
|
|
3511
3588
|
const a = JSON.parse(s.scheduled_at);
|
|
3512
|
-
return a.groupList.length > 0 ? (
|
|
3589
|
+
return a.groupList.length > 0 ? (o = !0, i = a.groupList[0].name) : a.userList.length > 0 ? (o = !0, i = a.userList[0].name) : i = "", a.groupList.length + a.userList.length > 1 && (i += "..."), this.dataToResource({
|
|
3513
3590
|
title: s.title,
|
|
3514
3591
|
owner: s.owner,
|
|
3515
3592
|
ownerName: i,
|
|
3516
3593
|
icon: r,
|
|
3517
3594
|
path: "/exercizer#/linker/" + s.id,
|
|
3518
3595
|
_id: "" + s.id,
|
|
3519
|
-
shared:
|
|
3596
|
+
shared: o,
|
|
3520
3597
|
modified: s.modified
|
|
3521
3598
|
});
|
|
3522
3599
|
});
|
|
@@ -3525,8 +3602,8 @@ class ExercizerBehaviour extends AbstractBehaviourService {
|
|
|
3525
3602
|
class FormulaireBehaviour extends AbstractBehaviourService {
|
|
3526
3603
|
constructor() {
|
|
3527
3604
|
super(...arguments);
|
|
3528
|
-
|
|
3529
|
-
|
|
3605
|
+
n(this, "APP", "formulaire");
|
|
3606
|
+
n(this, "RESOURCE", "formulaire");
|
|
3530
3607
|
}
|
|
3531
3608
|
async loadResources() {
|
|
3532
3609
|
return (await this.httpGet(
|
|
@@ -3546,8 +3623,8 @@ class FormulaireBehaviour extends AbstractBehaviourService {
|
|
|
3546
3623
|
class ForumBehaviour extends AbstractBehaviourService {
|
|
3547
3624
|
constructor() {
|
|
3548
3625
|
super(...arguments);
|
|
3549
|
-
|
|
3550
|
-
|
|
3626
|
+
n(this, "APP", "forum");
|
|
3627
|
+
n(this, "RESOURCE", "forum");
|
|
3551
3628
|
}
|
|
3552
3629
|
async loadResources() {
|
|
3553
3630
|
return (await this.httpGet("/forum/categories")).map(
|
|
@@ -3567,8 +3644,8 @@ class ForumBehaviour extends AbstractBehaviourService {
|
|
|
3567
3644
|
class HomeworksBehaviour extends AbstractBehaviourService {
|
|
3568
3645
|
constructor() {
|
|
3569
3646
|
super(...arguments);
|
|
3570
|
-
|
|
3571
|
-
|
|
3647
|
+
n(this, "APP", "homeworks");
|
|
3648
|
+
n(this, "RESOURCE", "homeworks");
|
|
3572
3649
|
}
|
|
3573
3650
|
async loadResources() {
|
|
3574
3651
|
return (await this.httpGet("/homeworks/list")).filter((t) => t.owner && t.trashed === 0).map((t) => this.dataToResource({
|
|
@@ -3586,8 +3663,8 @@ class HomeworksBehaviour extends AbstractBehaviourService {
|
|
|
3586
3663
|
class MagnetoBehaviour extends AbstractBehaviourService {
|
|
3587
3664
|
constructor() {
|
|
3588
3665
|
super(...arguments);
|
|
3589
|
-
|
|
3590
|
-
|
|
3666
|
+
n(this, "APP", "magneto");
|
|
3667
|
+
n(this, "RESOURCE", "magneto");
|
|
3591
3668
|
}
|
|
3592
3669
|
async loadResources() {
|
|
3593
3670
|
const { all: t } = await this.httpGet(
|
|
@@ -3608,8 +3685,8 @@ class MagnetoBehaviour extends AbstractBehaviourService {
|
|
|
3608
3685
|
class MindmapBehaviour extends AbstractBehaviourService {
|
|
3609
3686
|
constructor() {
|
|
3610
3687
|
super(...arguments);
|
|
3611
|
-
|
|
3612
|
-
|
|
3688
|
+
n(this, "APP", "mindmap");
|
|
3689
|
+
n(this, "RESOURCE", "mindmap");
|
|
3613
3690
|
}
|
|
3614
3691
|
async loadResources() {
|
|
3615
3692
|
return (await this.httpGet("/mindmap/list/all")).map(
|
|
@@ -3629,13 +3706,13 @@ class MindmapBehaviour extends AbstractBehaviourService {
|
|
|
3629
3706
|
class PagesBehaviour extends AbstractBehaviourService {
|
|
3630
3707
|
constructor() {
|
|
3631
3708
|
super(...arguments);
|
|
3632
|
-
|
|
3633
|
-
|
|
3709
|
+
n(this, "APP", "pages");
|
|
3710
|
+
n(this, "RESOURCE", "pages");
|
|
3634
3711
|
}
|
|
3635
3712
|
async loadResources() {
|
|
3636
3713
|
const t = await this.httpGet("/pages/list/all"), s = [];
|
|
3637
3714
|
return t.forEach((r) => {
|
|
3638
|
-
var
|
|
3715
|
+
var o;
|
|
3639
3716
|
const i = r.thumbnail ? r.thumbnail + "?thumbnail=48x48" : "/img/illustrations/pages.svg";
|
|
3640
3717
|
s.push(
|
|
3641
3718
|
this.dataToResource({
|
|
@@ -3648,7 +3725,7 @@ class PagesBehaviour extends AbstractBehaviourService {
|
|
|
3648
3725
|
shared: typeof r.shared < "u",
|
|
3649
3726
|
modified: r.modified
|
|
3650
3727
|
})
|
|
3651
|
-
), (
|
|
3728
|
+
), (o = r.pages) == null || o.forEach((a) => {
|
|
3652
3729
|
s.push(
|
|
3653
3730
|
this.dataToResource({
|
|
3654
3731
|
title: a.title,
|
|
@@ -3668,8 +3745,8 @@ class PagesBehaviour extends AbstractBehaviourService {
|
|
|
3668
3745
|
class PollBehaviour extends AbstractBehaviourService {
|
|
3669
3746
|
constructor() {
|
|
3670
3747
|
super(...arguments);
|
|
3671
|
-
|
|
3672
|
-
|
|
3748
|
+
n(this, "APP", "poll");
|
|
3749
|
+
n(this, "RESOURCE", "poll");
|
|
3673
3750
|
}
|
|
3674
3751
|
async loadResources() {
|
|
3675
3752
|
return (await this.httpGet("/poll/list/all")).map((s) => {
|
|
@@ -3690,8 +3767,8 @@ class PollBehaviour extends AbstractBehaviourService {
|
|
|
3690
3767
|
class ScrapbookBehaviour extends AbstractBehaviourService {
|
|
3691
3768
|
constructor() {
|
|
3692
3769
|
super(...arguments);
|
|
3693
|
-
|
|
3694
|
-
|
|
3770
|
+
n(this, "APP", "scrapbook");
|
|
3771
|
+
n(this, "RESOURCE", "scrapbook");
|
|
3695
3772
|
}
|
|
3696
3773
|
async loadResources() {
|
|
3697
3774
|
return (await this.httpGet(
|
|
@@ -3714,25 +3791,25 @@ class ScrapbookBehaviour extends AbstractBehaviourService {
|
|
|
3714
3791
|
class TimelinegeneratorBehaviour extends AbstractBehaviourService {
|
|
3715
3792
|
constructor() {
|
|
3716
3793
|
super(...arguments);
|
|
3717
|
-
|
|
3718
|
-
|
|
3794
|
+
n(this, "APP", "timelinegenerator");
|
|
3795
|
+
n(this, "RESOURCE", "timelinegenerator");
|
|
3719
3796
|
}
|
|
3720
3797
|
loadResources() {
|
|
3721
3798
|
return new Promise(async (t, s) => {
|
|
3722
3799
|
try {
|
|
3723
3800
|
const i = (await this.httpGet(
|
|
3724
3801
|
"/timelinegenerator/timelines"
|
|
3725
|
-
)).map((
|
|
3726
|
-
const a =
|
|
3802
|
+
)).map((o) => {
|
|
3803
|
+
const a = o.icon || "/img/illustrations/timeline-default.png";
|
|
3727
3804
|
return this.dataToResource({
|
|
3728
|
-
title:
|
|
3729
|
-
ownerName:
|
|
3730
|
-
owner:
|
|
3805
|
+
title: o.headline,
|
|
3806
|
+
ownerName: o.owner.displayName,
|
|
3807
|
+
owner: o.owner.userId,
|
|
3731
3808
|
icon: a,
|
|
3732
|
-
path: "/timelinegenerator#/view/" +
|
|
3733
|
-
_id:
|
|
3734
|
-
shared: typeof
|
|
3735
|
-
modified:
|
|
3809
|
+
path: "/timelinegenerator#/view/" + o._id,
|
|
3810
|
+
_id: o._id,
|
|
3811
|
+
shared: typeof o.shared < "u",
|
|
3812
|
+
modified: o.modified
|
|
3736
3813
|
});
|
|
3737
3814
|
});
|
|
3738
3815
|
t(i);
|
|
@@ -3745,8 +3822,8 @@ class TimelinegeneratorBehaviour extends AbstractBehaviourService {
|
|
|
3745
3822
|
class WikiBehaviour extends AbstractBehaviourService {
|
|
3746
3823
|
constructor() {
|
|
3747
3824
|
super(...arguments);
|
|
3748
|
-
|
|
3749
|
-
|
|
3825
|
+
n(this, "APP", "wiki");
|
|
3826
|
+
n(this, "RESOURCE", "wiki");
|
|
3750
3827
|
}
|
|
3751
3828
|
async loadResources() {
|
|
3752
3829
|
return (await this.httpGet(
|
|
@@ -3769,15 +3846,15 @@ class WikiBehaviour extends AbstractBehaviourService {
|
|
|
3769
3846
|
class WorkspaceBehaviour extends AbstractBehaviourService {
|
|
3770
3847
|
constructor() {
|
|
3771
3848
|
super(...arguments);
|
|
3772
|
-
|
|
3773
|
-
|
|
3849
|
+
n(this, "APP", "workspace");
|
|
3850
|
+
n(this, "RESOURCE", "workspace");
|
|
3774
3851
|
}
|
|
3775
3852
|
loadResources({ search: t, asset_id: s }) {
|
|
3776
3853
|
return new Promise(async (r, i) => {
|
|
3777
3854
|
try {
|
|
3778
|
-
let
|
|
3779
|
-
s && s.length ?
|
|
3780
|
-
const c = (await this.httpGet(
|
|
3855
|
+
let o = "/workspace/documents?filter=all&hierarchical=true";
|
|
3856
|
+
s && s.length ? o += `&search=${t}` : t && t.length && (o += `&search=${t}`);
|
|
3857
|
+
const c = (await this.httpGet(o)).filter((h) => !h.deleted).map((h) => {
|
|
3781
3858
|
const l = h.metadata["content-type"] && h.metadata["content-type"].indexOf("image") !== -1 ? `/workspace/document/${h._id}?thumbnail=120x120` : "/img/icons/unknown-large.png";
|
|
3782
3859
|
return this.dataToResource({
|
|
3783
3860
|
title: h.name,
|
|
@@ -3791,8 +3868,8 @@ class WorkspaceBehaviour extends AbstractBehaviourService {
|
|
|
3791
3868
|
});
|
|
3792
3869
|
});
|
|
3793
3870
|
r(c);
|
|
3794
|
-
} catch (
|
|
3795
|
-
i(
|
|
3871
|
+
} catch (o) {
|
|
3872
|
+
i(o);
|
|
3796
3873
|
}
|
|
3797
3874
|
});
|
|
3798
3875
|
}
|
|
@@ -3808,7 +3885,7 @@ const y = class y {
|
|
|
3808
3885
|
e.session().getUser()
|
|
3809
3886
|
]);
|
|
3810
3887
|
i != null && i.apps && (r != null && r.length) && (this.resourceProducingApps = r.filter(
|
|
3811
|
-
(
|
|
3888
|
+
(o) => i.apps.some((a) => a.address.includes(o))
|
|
3812
3889
|
));
|
|
3813
3890
|
} catch (r) {
|
|
3814
3891
|
console.warn("Failed to load resource-producing apps:", r);
|
|
@@ -3885,13 +3962,13 @@ const y = class y {
|
|
|
3885
3962
|
//
|
|
3886
3963
|
// STATIC REGISTRY
|
|
3887
3964
|
//
|
|
3888
|
-
|
|
3889
|
-
|
|
3965
|
+
n(y, "registry", new ServiceRegistry()), // Expose some useful functions
|
|
3966
|
+
n(y, "findBehaviour", y.registry.findService.bind(y.registry)), n(y, "hasBehaviour", y.registry.isRegistered.bind(y.registry)), n(y, "resourceProducingApps", []);
|
|
3890
3967
|
let SnipletsService = y;
|
|
3891
3968
|
const SEND_ALL = "*";
|
|
3892
3969
|
class WebBroker {
|
|
3893
3970
|
constructor(e) {
|
|
3894
|
-
|
|
3971
|
+
n(this, "subscription");
|
|
3895
3972
|
this.odeServices = e;
|
|
3896
3973
|
}
|
|
3897
3974
|
get http() {
|
|
@@ -3923,10 +4000,10 @@ class WebBroker {
|
|
|
3923
4000
|
}
|
|
3924
4001
|
class DataService {
|
|
3925
4002
|
constructor(e) {
|
|
3926
|
-
|
|
3927
|
-
|
|
3928
|
-
|
|
3929
|
-
|
|
4003
|
+
n(this, "_webBroker");
|
|
4004
|
+
n(this, "app");
|
|
4005
|
+
n(this, "user");
|
|
4006
|
+
n(this, "profile");
|
|
3930
4007
|
this.odeServices = e;
|
|
3931
4008
|
}
|
|
3932
4009
|
get conf() {
|
|
@@ -3960,12 +4037,12 @@ class DataService {
|
|
|
3960
4037
|
addUserInfos(e) {
|
|
3961
4038
|
return this.user && (e.userId = this.user.userId, e.structure = this.user.structureNames[0]), this.profile && (e.profil = this.profile[0]), e;
|
|
3962
4039
|
}
|
|
3963
|
-
trackVideoSave(e, t, s, r, i,
|
|
4040
|
+
trackVideoSave(e, t, s, r, i, o, a) {
|
|
3964
4041
|
const c = this.addUserInfos({
|
|
3965
4042
|
"event-type": "VIDEO_SAVE",
|
|
3966
4043
|
module: "video",
|
|
3967
4044
|
video_id: e,
|
|
3968
|
-
browser:
|
|
4045
|
+
browser: o,
|
|
3969
4046
|
duration: Math.round(t),
|
|
3970
4047
|
weight: s,
|
|
3971
4048
|
source: r ? "CAPTURED" : "UPLOADED",
|
|
@@ -3974,7 +4051,7 @@ class DataService {
|
|
|
3974
4051
|
this.app && (c["override-module"] = this.app), a && (c.device_type = a), this.trackWebEvent(c);
|
|
3975
4052
|
}
|
|
3976
4053
|
trackVideoRead(e, t, s, r, i) {
|
|
3977
|
-
const
|
|
4054
|
+
const o = this.addUserInfos({
|
|
3978
4055
|
"event-type": "VIDEO_READ",
|
|
3979
4056
|
module: "video",
|
|
3980
4057
|
video_id: e,
|
|
@@ -3982,7 +4059,7 @@ class DataService {
|
|
|
3982
4059
|
source: t ? "CAPTURED" : "UPLOADED",
|
|
3983
4060
|
url: s
|
|
3984
4061
|
});
|
|
3985
|
-
this.app && (
|
|
4062
|
+
this.app && (o["override-module"] = this.app), i && (o.device_type = i), this.trackWebEvent(o);
|
|
3986
4063
|
}
|
|
3987
4064
|
trackSpeechAndText(e) {
|
|
3988
4065
|
const t = this.addUserInfos({
|
|
@@ -4088,20 +4165,20 @@ class AudienceService {
|
|
|
4088
4165
|
}
|
|
4089
4166
|
class OdeServices {
|
|
4090
4167
|
constructor() {
|
|
4091
|
-
|
|
4092
|
-
|
|
4093
|
-
|
|
4094
|
-
|
|
4095
|
-
|
|
4096
|
-
|
|
4097
|
-
|
|
4098
|
-
|
|
4099
|
-
|
|
4100
|
-
|
|
4101
|
-
|
|
4102
|
-
|
|
4103
|
-
|
|
4104
|
-
|
|
4168
|
+
n(this, "_analytics");
|
|
4169
|
+
n(this, "_cache");
|
|
4170
|
+
n(this, "_conf");
|
|
4171
|
+
n(this, "_data");
|
|
4172
|
+
n(this, "_directory");
|
|
4173
|
+
n(this, "_http");
|
|
4174
|
+
n(this, "_idiom");
|
|
4175
|
+
n(this, "_notify");
|
|
4176
|
+
n(this, "_rights");
|
|
4177
|
+
n(this, "_session");
|
|
4178
|
+
n(this, "_share");
|
|
4179
|
+
n(this, "_video");
|
|
4180
|
+
n(this, "_workspace");
|
|
4181
|
+
n(this, "_embedder");
|
|
4105
4182
|
this._analytics = new AnalyticsService(this), this._cache = new CacheService(this), this._conf = new ConfService(this), this._data = new DataService(this), this._directory = new DirectoryService(this), this._http = new HttpService(this), this._idiom = new IdiomService(this), this._notify = NotifyFrameworkFactory.instance(), this._rights = new RightService(this), this._session = new SessionService(this), this._share = new ShareService(this), this._video = new VideoService(this), this._workspace = new WorkspaceService(this), this._embedder = new EmbedderService(this);
|
|
4106
4183
|
}
|
|
4107
4184
|
initialize() {
|
|
@@ -4234,9 +4311,9 @@ class TransportFrameworkFactory {
|
|
|
4234
4311
|
return transport;
|
|
4235
4312
|
}
|
|
4236
4313
|
}
|
|
4237
|
-
const isActionAvailable = (
|
|
4314
|
+
const isActionAvailable = (u, e) => {
|
|
4238
4315
|
const t = e == null ? void 0 : e.filter(
|
|
4239
|
-
(s) => s.id ===
|
|
4316
|
+
(s) => s.id === u && s.available
|
|
4240
4317
|
);
|
|
4241
4318
|
return t && t.length > 0;
|
|
4242
4319
|
}, firstLevelWidgets = [
|
|
@@ -4303,10 +4380,10 @@ const isActionAvailable = (o, e) => {
|
|
|
4303
4380
|
class WidgetFramework {
|
|
4304
4381
|
constructor() {
|
|
4305
4382
|
//-------------------------------------
|
|
4306
|
-
|
|
4307
|
-
|
|
4383
|
+
n(this, "_initialized");
|
|
4384
|
+
n(this, "_widgets", []);
|
|
4308
4385
|
////////////////////////////////////// USER PREFERENCES
|
|
4309
|
-
|
|
4386
|
+
n(this, "_userPrefs", {});
|
|
4310
4387
|
}
|
|
4311
4388
|
initialize(e, t) {
|
|
4312
4389
|
return this._initialized || (this._initialized = new Promisified(), notify.onSessionReady().promise.then((s) => {
|
|
@@ -4317,8 +4394,8 @@ class WidgetFramework {
|
|
|
4317
4394
|
var i;
|
|
4318
4395
|
(i = this._initialized) == null || i.resolve();
|
|
4319
4396
|
}).catch((i) => {
|
|
4320
|
-
var
|
|
4321
|
-
(
|
|
4397
|
+
var o;
|
|
4398
|
+
(o = this._initialized) == null || o.reject();
|
|
4322
4399
|
})) : (r = this._initialized) == null || r.reject();
|
|
4323
4400
|
})), this._initialized.promise;
|
|
4324
4401
|
}
|
|
@@ -4359,9 +4436,9 @@ class WidgetFramework {
|
|
|
4359
4436
|
position: c.platformConf.position
|
|
4360
4437
|
}), c.platformConf.mandatory && (this._userPrefs[l].show = !0, this._userPrefs[l].index = defaultWidgetOrder[l] ?? 999), c.platformConf.i18n && s.push(c.platformConf.i18n), c.applyUserPref(this._userPrefs[l]), !0);
|
|
4361
4438
|
});
|
|
4362
|
-
const
|
|
4439
|
+
const o = new Idiom();
|
|
4363
4440
|
this._widgets = this._widgets.sort((c, h) => {
|
|
4364
|
-
const l =
|
|
4441
|
+
const l = o.translate(`timeline.settings.${c.platformConf.name}`).toLowerCase(), E = o.translate(`timeline.settings.${h.platformConf.name}`).toLowerCase();
|
|
4365
4442
|
return l < E ? -1 : l > E ? 1 : 0;
|
|
4366
4443
|
});
|
|
4367
4444
|
});
|
|
@@ -4370,8 +4447,8 @@ class WidgetFramework {
|
|
|
4370
4447
|
class Widget {
|
|
4371
4448
|
//-------------------------------------
|
|
4372
4449
|
constructor(e) {
|
|
4373
|
-
|
|
4374
|
-
|
|
4450
|
+
n(this, "_schoolConf", {});
|
|
4451
|
+
n(this, "_userPref");
|
|
4375
4452
|
this._platformConf = e, this._userPref = null;
|
|
4376
4453
|
}
|
|
4377
4454
|
get platformConf() {
|