@edifice.io/client 2.0.0-develop-pedago.20250115112809 → 2.0.0-develop-pedago.20250116124516
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.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
var v = Object.defineProperty;
|
|
2
2
|
var T = (o, e, t) => e in o ? v(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t;
|
|
3
|
-
var
|
|
3
|
+
var u = (o, e, t) => T(o, 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 = {
|
|
@@ -14,7 +14,7 @@ const ERROR_CODE = {
|
|
|
14
14
|
TIME_OUT: "0070",
|
|
15
15
|
MALFORMED_DATA: "0080",
|
|
16
16
|
NOT_LOGGED_IN: "0090"
|
|
17
|
-
}, APP$
|
|
17
|
+
}, APP$3 = {
|
|
18
18
|
ADMIN: "admin",
|
|
19
19
|
ARCHIVE: "archive",
|
|
20
20
|
AUTH: "auth",
|
|
@@ -35,7 +35,8 @@ const ERROR_CODE = {
|
|
|
35
35
|
MINDMAP: "mindmap",
|
|
36
36
|
SCRAPBOOK: "scrapbook",
|
|
37
37
|
COLLABORATIVEWALL: "collaborativewall",
|
|
38
|
-
WIKI: "wiki"
|
|
38
|
+
WIKI: "wiki",
|
|
39
|
+
TIMELINEGENERATOR: "timelinegenerator"
|
|
39
40
|
// TODO compléter/trier les apps suivantes
|
|
40
41
|
/*
|
|
41
42
|
"competences"
|
|
@@ -98,7 +99,7 @@ const ERROR_CODE = {
|
|
|
98
99
|
};
|
|
99
100
|
class Subscription {
|
|
100
101
|
constructor(e, t) {
|
|
101
|
-
|
|
102
|
+
u(this, "revoke");
|
|
102
103
|
this._channel = e, this.revoke = this.setReceiver(
|
|
103
104
|
(s) => t == null ? void 0 : t(s.data)
|
|
104
105
|
);
|
|
@@ -116,7 +117,7 @@ class Subject {
|
|
|
116
117
|
* => We maintain here channels for *sending* messages.
|
|
117
118
|
* *Receiving* channels will be instantiated while subscribing.
|
|
118
119
|
*/
|
|
119
|
-
|
|
120
|
+
u(this, "publishChannels", /* @__PURE__ */ new Map());
|
|
120
121
|
}
|
|
121
122
|
getChannelName(e) {
|
|
122
123
|
return "Subject:" + e;
|
|
@@ -151,9 +152,9 @@ const ASYNC_DATA_NAME = {
|
|
|
151
152
|
class Promisified {
|
|
152
153
|
constructor() {
|
|
153
154
|
//-------------------------------------
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
155
|
+
u(this, "_resolution");
|
|
156
|
+
u(this, "_rejection");
|
|
157
|
+
u(this, "_promise", new Promise((e, t) => {
|
|
157
158
|
this._resolution = e, this._rejection = t;
|
|
158
159
|
}));
|
|
159
160
|
}
|
|
@@ -170,8 +171,8 @@ class Promisified {
|
|
|
170
171
|
class NotifyFramework {
|
|
171
172
|
constructor() {
|
|
172
173
|
//-------------------------------------
|
|
173
|
-
|
|
174
|
-
|
|
174
|
+
u(this, "promises", {});
|
|
175
|
+
u(this, "subject", new Subject());
|
|
175
176
|
}
|
|
176
177
|
asyncData(e) {
|
|
177
178
|
return typeof this.promises[e] > "u" && (this.promises[e] = new Promisified()), this.promises[e];
|
|
@@ -202,8 +203,8 @@ const notify = new NotifyFramework(), loadedScripts$1 = {};
|
|
|
202
203
|
class Http {
|
|
203
204
|
constructor(e) {
|
|
204
205
|
// Axios automatically manages the XSRF-TOKEN cookie and the X-XSRF-TOKEN HTTP header.
|
|
205
|
-
|
|
206
|
-
|
|
206
|
+
u(this, "axios");
|
|
207
|
+
u(this, "_latestResponse");
|
|
207
208
|
this.axios = axios.create(e);
|
|
208
209
|
}
|
|
209
210
|
setCdn(e) {
|
|
@@ -281,15 +282,15 @@ class Http {
|
|
|
281
282
|
}
|
|
282
283
|
getScript(e, t, s) {
|
|
283
284
|
const r = s ?? "exports", i = this.toAxiosConfig(t);
|
|
284
|
-
return i.headers && (i.headers.Accept = "application/javascript"), this.axios.get(this.toCdnUrl(e), i).then((
|
|
285
|
+
return i.headers && (i.headers.Accept = "application/javascript"), this.axios.get(this.toCdnUrl(e), i).then((n) => this.mapAxiosResponse(n, t)).then((n) => {
|
|
285
286
|
try {
|
|
286
|
-
const a = `"use strict";var ${r.split(".")[0]}={};${
|
|
287
|
+
const a = `"use strict";var ${r.split(".")[0]}={};${n};return ${r};`;
|
|
287
288
|
return Function(a)();
|
|
288
289
|
} catch {
|
|
289
|
-
return
|
|
290
|
+
return n;
|
|
290
291
|
}
|
|
291
|
-
}).catch((
|
|
292
|
-
throw this.mapAxiosError(
|
|
292
|
+
}).catch((n) => {
|
|
293
|
+
throw this.mapAxiosError(n, t), n;
|
|
293
294
|
});
|
|
294
295
|
}
|
|
295
296
|
loadScript(e, t) {
|
|
@@ -300,7 +301,7 @@ class Http {
|
|
|
300
301
|
}
|
|
301
302
|
class TransportFramework {
|
|
302
303
|
constructor() {
|
|
303
|
-
|
|
304
|
+
u(this, "_http", new Http());
|
|
304
305
|
}
|
|
305
306
|
get http() {
|
|
306
307
|
return this._http;
|
|
@@ -319,11 +320,11 @@ class ConfigurationFrameworkFactory {
|
|
|
319
320
|
const http$2 = transport.http;
|
|
320
321
|
class Session {
|
|
321
322
|
constructor() {
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
323
|
+
u(this, "_me", null);
|
|
324
|
+
u(this, "_currentLanguage", "");
|
|
325
|
+
u(this, "_notLoggedIn", !0);
|
|
326
|
+
u(this, "_description");
|
|
327
|
+
u(this, "_profile");
|
|
327
328
|
}
|
|
328
329
|
get currentLanguage() {
|
|
329
330
|
return this._currentLanguage;
|
|
@@ -368,8 +369,8 @@ class Session {
|
|
|
368
369
|
hasRight(e, t) {
|
|
369
370
|
if (t === "owner")
|
|
370
371
|
return e.owner && e.owner.userId === this._me.userId;
|
|
371
|
-
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,
|
|
372
|
-
return i &&
|
|
372
|
+
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, n = t.workflow ? this.hasWorkflow(t.workflow) : !0;
|
|
373
|
+
return i && n;
|
|
373
374
|
}
|
|
374
375
|
////////////////////////////////////////////////////////// Storage management
|
|
375
376
|
get latestQuotaAndUsage() {
|
|
@@ -441,7 +442,7 @@ class Session {
|
|
|
441
442
|
}
|
|
442
443
|
class SessionFramework {
|
|
443
444
|
constructor() {
|
|
444
|
-
|
|
445
|
+
u(this, "session", new Session());
|
|
445
446
|
}
|
|
446
447
|
initialize() {
|
|
447
448
|
return this.session.initialize();
|
|
@@ -465,22 +466,22 @@ class SessionFramework {
|
|
|
465
466
|
const session = new SessionFramework();
|
|
466
467
|
class Theme {
|
|
467
468
|
constructor() {
|
|
468
|
-
|
|
469
|
-
|
|
469
|
+
u(this, "_conf");
|
|
470
|
+
u(this, "_loaded");
|
|
470
471
|
// legacy (readonly)
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
472
|
+
u(this, "skinName", "");
|
|
473
|
+
u(this, "themeName", "");
|
|
474
|
+
u(this, "skin", "raw");
|
|
475
|
+
u(this, "themeUrl", "/assets/themes/raw/default/");
|
|
476
|
+
u(this, "templateOverrides", {});
|
|
477
|
+
u(this, "portalTemplate", "/assets/themes/raw/portal.html");
|
|
478
|
+
u(this, "basePath", "");
|
|
479
|
+
u(this, "logoutCallback", "/");
|
|
480
|
+
u(this, "skins", []);
|
|
481
|
+
u(this, "is1D", !1);
|
|
482
|
+
u(this, "is2D", !1);
|
|
483
|
+
u(this, "_onSkinReady", notify.onSkinReady());
|
|
484
|
+
u(this, "_onOverrideReady", notify.onOverridesReady());
|
|
484
485
|
}
|
|
485
486
|
initialize(e) {
|
|
486
487
|
return notify.onSessionReady().promise.then(() => this.load(e));
|
|
@@ -813,8 +814,8 @@ class Idiom {
|
|
|
813
814
|
else {
|
|
814
815
|
const i = new Promisified();
|
|
815
816
|
promises$1[t] = i.promise;
|
|
816
|
-
const
|
|
817
|
-
e && (
|
|
817
|
+
const n = {};
|
|
818
|
+
e && (n["Accept-Language"] = e), transport.http.get(t, { headers: n }).then((a) => {
|
|
818
819
|
Object.assign(bundle$1, a), typeof s == "function" && s(), i.resolve();
|
|
819
820
|
}).catch((a) => {
|
|
820
821
|
typeof s == "function" && s(), i.reject();
|
|
@@ -852,7 +853,7 @@ class Idiom {
|
|
|
852
853
|
class UserPreferences {
|
|
853
854
|
constructor() {
|
|
854
855
|
//-------------------------------------
|
|
855
|
-
|
|
856
|
+
u(this, "data", {});
|
|
856
857
|
}
|
|
857
858
|
get(e) {
|
|
858
859
|
return this.data[e];
|
|
@@ -879,10 +880,10 @@ class UserPreferences {
|
|
|
879
880
|
class User {
|
|
880
881
|
constructor() {
|
|
881
882
|
//-------------------------------------
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
883
|
+
u(this, "_me", null);
|
|
884
|
+
u(this, "_keepOpenOnLogout", !1);
|
|
885
|
+
u(this, "_preferences", new UserPreferences());
|
|
886
|
+
u(this, "_bookmarkedApps", []);
|
|
886
887
|
}
|
|
887
888
|
get keepOpenOnLogout() {
|
|
888
889
|
return this._keepOpenOnLogout;
|
|
@@ -914,7 +915,7 @@ class User {
|
|
|
914
915
|
let s;
|
|
915
916
|
if (t && t.length && typeof t.concat == "function") {
|
|
916
917
|
this._bookmarkedApps = t, s = {
|
|
917
|
-
bookmarks: t.map((
|
|
918
|
+
bookmarks: t.map((n) => n.name),
|
|
918
919
|
applications: []
|
|
919
920
|
}, transport.http.putJson("/userbook/preference/apps", s);
|
|
920
921
|
return;
|
|
@@ -926,15 +927,15 @@ class User {
|
|
|
926
927
|
});
|
|
927
928
|
let r = !0;
|
|
928
929
|
const i = [];
|
|
929
|
-
s.bookmarks.forEach((
|
|
930
|
-
const c = this._me.apps.find((h) => h.name ===
|
|
930
|
+
s.bookmarks.forEach((n, a) => {
|
|
931
|
+
const c = this._me.apps.find((h) => h.name === n);
|
|
931
932
|
if (c) {
|
|
932
933
|
let h = Object.assign({}, c);
|
|
933
934
|
this._bookmarkedApps.push(h);
|
|
934
935
|
} else
|
|
935
|
-
i.push(
|
|
936
|
-
}), i.forEach((
|
|
937
|
-
let a = s.bookmarks.indexOf(
|
|
936
|
+
i.push(n), r = !1;
|
|
937
|
+
}), i.forEach((n) => {
|
|
938
|
+
let a = s.bookmarks.indexOf(n);
|
|
938
939
|
a !== -1 && s.bookmarks.splice(a, 1);
|
|
939
940
|
}), r || transport.http.putJson("/userbook/preference/apps", s);
|
|
940
941
|
});
|
|
@@ -956,9 +957,9 @@ const http$1 = transport == null ? void 0 : transport.http;
|
|
|
956
957
|
class AppConf {
|
|
957
958
|
constructor() {
|
|
958
959
|
//-------------------------------------
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
960
|
+
u(this, "_publicConf", {});
|
|
961
|
+
u(this, "_currentApp");
|
|
962
|
+
u(this, "_appConf", {});
|
|
962
963
|
}
|
|
963
964
|
/**
|
|
964
965
|
* Get the currently initialized App.
|
|
@@ -996,8 +997,8 @@ class AppConf {
|
|
|
996
997
|
class Analytics {
|
|
997
998
|
constructor() {
|
|
998
999
|
//-------------------------------------
|
|
999
|
-
|
|
1000
|
-
|
|
1000
|
+
u(this, "_status", "void");
|
|
1001
|
+
u(this, "_params");
|
|
1001
1002
|
}
|
|
1002
1003
|
get status() {
|
|
1003
1004
|
return this._status;
|
|
@@ -1049,8 +1050,8 @@ class Analytics {
|
|
|
1049
1050
|
configure.Platform.apps.currentApp
|
|
1050
1051
|
);
|
|
1051
1052
|
if (!i) return;
|
|
1052
|
-
const
|
|
1053
|
-
if (!
|
|
1053
|
+
const n = i.xiti;
|
|
1054
|
+
if (!n || !n.LIBELLE_SERVICE || !r.UAI) return;
|
|
1054
1055
|
function a(h) {
|
|
1055
1056
|
let l = "";
|
|
1056
1057
|
for (let E = 0; E < h.length; E++)
|
|
@@ -1065,10 +1066,10 @@ class Analytics {
|
|
|
1065
1066
|
Guest: "AUTRE"
|
|
1066
1067
|
};
|
|
1067
1068
|
return {
|
|
1068
|
-
LIBELLE_SERVICE:
|
|
1069
|
+
LIBELLE_SERVICE: n.LIBELLE_SERVICE,
|
|
1069
1070
|
// Which property of LIBELLE_SERVICE to use depends on the frontend.
|
|
1070
|
-
TYPE:
|
|
1071
|
-
OUTIL:
|
|
1071
|
+
TYPE: n.OUTIL ? "TIERS" : "NATIF",
|
|
1072
|
+
OUTIL: n.OUTIL ? n.OUTIL : "",
|
|
1072
1073
|
STRUCT_ID: r.collectiviteId,
|
|
1073
1074
|
STRUCT_UAI: r.UAI,
|
|
1074
1075
|
PROJET: r.projetId ? r.projetId : e.ID_PROJET,
|
|
@@ -1082,7 +1083,7 @@ class Analytics {
|
|
|
1082
1083
|
class ConfigurationFramework {
|
|
1083
1084
|
constructor() {
|
|
1084
1085
|
//-------------------------------------
|
|
1085
|
-
|
|
1086
|
+
u(this, "Platform", {
|
|
1086
1087
|
deploymentTag: "",
|
|
1087
1088
|
cdnDomain: "",
|
|
1088
1089
|
apps: new AppConf(),
|
|
@@ -1091,15 +1092,15 @@ class ConfigurationFramework {
|
|
|
1091
1092
|
idiom: new Idiom(),
|
|
1092
1093
|
listLanguages: () => transport.http.get("/languages")
|
|
1093
1094
|
});
|
|
1094
|
-
|
|
1095
|
+
u(this, "School", {
|
|
1095
1096
|
//apps; -> pinnedApps;
|
|
1096
1097
|
});
|
|
1097
|
-
|
|
1098
|
+
u(this, "User", new User());
|
|
1098
1099
|
}
|
|
1099
1100
|
async initialize(e, t) {
|
|
1100
1101
|
if (!e) {
|
|
1101
|
-
const r = (h) => (h < 10 ? "0" : "") + h.toFixed(0), i = /* @__PURE__ */ new Date(),
|
|
1102
|
-
e = `${
|
|
1102
|
+
const r = (h) => (h < 10 ? "0" : "") + h.toFixed(0), i = /* @__PURE__ */ new Date(), n = i.getFullYear(), a = i.getMonth() + 1, c = i.getDate();
|
|
1103
|
+
e = `${n}${r(a)}${r(c)}`;
|
|
1103
1104
|
}
|
|
1104
1105
|
const s = e;
|
|
1105
1106
|
this.Platform.deploymentTag = e, typeof t == "string" && t.length > 0 && (this.Platform.cdnDomain = t), transport.http.setCdn(this.Platform.cdnDomain), await Promise.all([
|
|
@@ -1141,8 +1142,8 @@ var _;
|
|
|
1141
1142
|
const me = (_ = session == null ? void 0 : session.session) == null ? void 0 : _.user;
|
|
1142
1143
|
class Notification {
|
|
1143
1144
|
constructor(e) {
|
|
1144
|
-
|
|
1145
|
-
|
|
1145
|
+
u(this, "_id");
|
|
1146
|
+
u(this, "model");
|
|
1146
1147
|
e.reported = e.reporters && e.reporters.length > 0, this._id = e._id, this.model = e;
|
|
1147
1148
|
}
|
|
1148
1149
|
isUnread() {
|
|
@@ -1162,14 +1163,14 @@ class Notification {
|
|
|
1162
1163
|
class TimelineApp {
|
|
1163
1164
|
constructor() {
|
|
1164
1165
|
//-------------------------------------
|
|
1165
|
-
|
|
1166
|
-
|
|
1166
|
+
u(this, "_notifications", []);
|
|
1167
|
+
u(this, "_notificationTypes", []);
|
|
1167
1168
|
// ex: ["BLOG"]
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1169
|
+
u(this, "_flashMessages", []);
|
|
1170
|
+
u(this, "_pageNumber", 0);
|
|
1171
|
+
u(this, "_lastPage", !1);
|
|
1172
|
+
u(this, "_loading", !1);
|
|
1173
|
+
u(this, "showMine", !1);
|
|
1173
1174
|
}
|
|
1174
1175
|
get notifications() {
|
|
1175
1176
|
return this._notifications;
|
|
@@ -1190,20 +1191,20 @@ class TimelineApp {
|
|
|
1190
1191
|
return this.preferences.type = this.preferences.type || [], this.preferences.type;
|
|
1191
1192
|
}
|
|
1192
1193
|
get preferences() {
|
|
1193
|
-
return configure.User.preferences.get(APP$
|
|
1194
|
+
return configure.User.preferences.get(APP$3.TIMELINE);
|
|
1194
1195
|
}
|
|
1195
1196
|
get flashMessages() {
|
|
1196
1197
|
return this._flashMessages;
|
|
1197
1198
|
}
|
|
1198
1199
|
savePreferences() {
|
|
1199
|
-
return configure.User.saveAppPrefs(APP$
|
|
1200
|
+
return configure.User.saveAppPrefs(APP$3.TIMELINE);
|
|
1200
1201
|
}
|
|
1201
1202
|
resetPagination() {
|
|
1202
1203
|
this._pageNumber = 0, this._lastPage = !1, this._loading = !1;
|
|
1203
1204
|
}
|
|
1204
1205
|
initialize() {
|
|
1205
1206
|
return Promise.all([
|
|
1206
|
-
configure.User.loadAppPrefs(APP$
|
|
1207
|
+
configure.User.loadAppPrefs(APP$3.TIMELINE),
|
|
1207
1208
|
transport.http.get("/timeline/types")
|
|
1208
1209
|
]).then((e) => {
|
|
1209
1210
|
this._notificationTypes = e[1];
|
|
@@ -1227,10 +1228,10 @@ class TimelineApp {
|
|
|
1227
1228
|
if (this._loading = !1, r.status === "ok")
|
|
1228
1229
|
if (r.number && r.results) {
|
|
1229
1230
|
const i = r.results.filter(
|
|
1230
|
-
(
|
|
1231
|
-
(a) => a._id ===
|
|
1231
|
+
(n) => this._notifications.findIndex(
|
|
1232
|
+
(a) => a._id === n._id
|
|
1232
1233
|
) === -1
|
|
1233
|
-
).map((
|
|
1234
|
+
).map((n) => new Notification(n));
|
|
1234
1235
|
this._notifications = this._notifications.concat(i), this._pageNumber++;
|
|
1235
1236
|
} else
|
|
1236
1237
|
this._lastPage = !0;
|
|
@@ -1318,7 +1319,7 @@ const f = class f {
|
|
|
1318
1319
|
//
|
|
1319
1320
|
// PROTECTED HELPERS
|
|
1320
1321
|
//
|
|
1321
|
-
|
|
1322
|
+
u(this, "checkHttpResponse", (e) => {
|
|
1322
1323
|
if (this.http.latestResponse.status >= 300)
|
|
1323
1324
|
throw this.http.latestResponse.statusText;
|
|
1324
1325
|
return e;
|
|
@@ -1470,7 +1471,7 @@ const f = class f {
|
|
|
1470
1471
|
});
|
|
1471
1472
|
return t.map((r) => {
|
|
1472
1473
|
const i = s.resources.find(
|
|
1473
|
-
(
|
|
1474
|
+
(n) => n.assetId === r
|
|
1474
1475
|
);
|
|
1475
1476
|
if (i === void 0)
|
|
1476
1477
|
throw "explorer.assetid.notfound";
|
|
@@ -1536,10 +1537,10 @@ const f = class f {
|
|
|
1536
1537
|
//
|
|
1537
1538
|
// STATIC REGISTRY
|
|
1538
1539
|
//
|
|
1539
|
-
|
|
1540
|
-
|
|
1540
|
+
u(f, "registry", new ServiceRegistry()), // Expose some useful functions
|
|
1541
|
+
u(f, "register", f.registry.register.bind(f.registry)), u(f, "findService", f.registry.findService.bind(f.registry)), u(f, "findMainService", f.registry.findMainService.bind(f.registry)), u(f, "isRegistered", f.registry.isRegistered.bind(f.registry));
|
|
1541
1542
|
let ResourceService = f;
|
|
1542
|
-
const APP$
|
|
1543
|
+
const APP$2 = "scrapbook", RESOURCE$2 = "scrapbook";
|
|
1543
1544
|
class ScrapbookResourceService extends ResourceService {
|
|
1544
1545
|
create(e) {
|
|
1545
1546
|
throw new Error("Method not implemented.");
|
|
@@ -1557,10 +1558,10 @@ class ScrapbookResourceService extends ResourceService {
|
|
|
1557
1558
|
return this.checkHttpResponse(s), { thumbnail: t, entId: e.entId };
|
|
1558
1559
|
}
|
|
1559
1560
|
getResourceType() {
|
|
1560
|
-
return RESOURCE$
|
|
1561
|
+
return RESOURCE$2;
|
|
1561
1562
|
}
|
|
1562
1563
|
getApplication() {
|
|
1563
|
-
return APP$
|
|
1564
|
+
return APP$2;
|
|
1564
1565
|
}
|
|
1565
1566
|
getFormUrl(e) {
|
|
1566
1567
|
return e ? `/scrapbook?folderid=${e}#/create-scrapbook/` : "/scrapbook#/create-scrapbook/";
|
|
@@ -1579,10 +1580,10 @@ class ScrapbookResourceService extends ResourceService {
|
|
|
1579
1580
|
}
|
|
1580
1581
|
}
|
|
1581
1582
|
ResourceService.register(
|
|
1582
|
-
{ application: RESOURCE$
|
|
1583
|
+
{ application: RESOURCE$2, resourceType: RESOURCE$2 },
|
|
1583
1584
|
(o) => new ScrapbookResourceService(o)
|
|
1584
1585
|
);
|
|
1585
|
-
const APP = "homeworks", RESOURCE = "homeworks";
|
|
1586
|
+
const APP$1 = "homeworks", RESOURCE$1 = "homeworks";
|
|
1586
1587
|
class HomeworksResourceService extends ResourceService {
|
|
1587
1588
|
async create(e) {
|
|
1588
1589
|
const t = await this.getThumbnailPath(e.thumbnail), s = await this.http.post("/homeworks", {
|
|
@@ -1605,10 +1606,10 @@ class HomeworksResourceService extends ResourceService {
|
|
|
1605
1606
|
return this.checkHttpResponse(s), { thumbnail: t, entId: e.entId };
|
|
1606
1607
|
}
|
|
1607
1608
|
getResourceType() {
|
|
1608
|
-
return RESOURCE;
|
|
1609
|
+
return RESOURCE$1;
|
|
1609
1610
|
}
|
|
1610
1611
|
getApplication() {
|
|
1611
|
-
return APP;
|
|
1612
|
+
return APP$1;
|
|
1612
1613
|
}
|
|
1613
1614
|
getFormUrl(e) {
|
|
1614
1615
|
return e ? `/homeworks?folderid=${e}#/create-homeworks/` : "/homeworks#/create-homeworks/";
|
|
@@ -1627,9 +1628,64 @@ class HomeworksResourceService extends ResourceService {
|
|
|
1627
1628
|
}
|
|
1628
1629
|
}
|
|
1629
1630
|
ResourceService.register(
|
|
1630
|
-
{ application: RESOURCE, resourceType: RESOURCE },
|
|
1631
|
+
{ application: RESOURCE$1, resourceType: RESOURCE$1 },
|
|
1631
1632
|
(o) => new HomeworksResourceService(o)
|
|
1632
1633
|
);
|
|
1634
|
+
const APP = "timelinegenerator", RESOURCE = "timelinegenerator";
|
|
1635
|
+
class TimelineGeneratorResourceService extends ResourceService {
|
|
1636
|
+
async create(e) {
|
|
1637
|
+
const t = e.thumbnail ? await this.getThumbnailPath(e.thumbnail) : "", s = await this.http.post(
|
|
1638
|
+
"/timelinegenerator/timelines",
|
|
1639
|
+
{
|
|
1640
|
+
headline: e.name,
|
|
1641
|
+
text: e.description,
|
|
1642
|
+
icon: t,
|
|
1643
|
+
type: "default",
|
|
1644
|
+
folder: e.folder
|
|
1645
|
+
}
|
|
1646
|
+
);
|
|
1647
|
+
return this.checkHttpResponse(s), s;
|
|
1648
|
+
}
|
|
1649
|
+
async update(e) {
|
|
1650
|
+
const t = await this.getThumbnailPath(e.thumbnail), s = await this.http.put(
|
|
1651
|
+
`/timelinegenerator/timeline/${e.entId}`,
|
|
1652
|
+
{
|
|
1653
|
+
headline: e.name,
|
|
1654
|
+
text: e.description,
|
|
1655
|
+
icon: t,
|
|
1656
|
+
trashed: !!e.trashed,
|
|
1657
|
+
_id: e.entId,
|
|
1658
|
+
type: "default"
|
|
1659
|
+
}
|
|
1660
|
+
);
|
|
1661
|
+
return this.checkHttpResponse(s), { thumbnail: t, entId: e.entId };
|
|
1662
|
+
}
|
|
1663
|
+
getResourceType() {
|
|
1664
|
+
return RESOURCE;
|
|
1665
|
+
}
|
|
1666
|
+
getApplication() {
|
|
1667
|
+
return APP;
|
|
1668
|
+
}
|
|
1669
|
+
getFormUrl() {
|
|
1670
|
+
throw new Error("Method not implemented.");
|
|
1671
|
+
}
|
|
1672
|
+
getViewUrl(e) {
|
|
1673
|
+
return `/timelinegenerator#/view/${e}`;
|
|
1674
|
+
}
|
|
1675
|
+
getPrintUrl(e) {
|
|
1676
|
+
return `/timelinegenerator/print#/print/${e}`;
|
|
1677
|
+
}
|
|
1678
|
+
getEditUrl() {
|
|
1679
|
+
throw new Error("Method not implemented.");
|
|
1680
|
+
}
|
|
1681
|
+
getExportUrl() {
|
|
1682
|
+
throw new Error("Method not implemented.");
|
|
1683
|
+
}
|
|
1684
|
+
}
|
|
1685
|
+
ResourceService.register(
|
|
1686
|
+
{ application: RESOURCE, resourceType: RESOURCE },
|
|
1687
|
+
(o) => new TimelineGeneratorResourceService(o)
|
|
1688
|
+
);
|
|
1633
1689
|
const globalCache = {}, mutexPromise = {};
|
|
1634
1690
|
class CacheService {
|
|
1635
1691
|
constructor(e) {
|
|
@@ -1697,14 +1753,14 @@ class ConfService {
|
|
|
1697
1753
|
]), [r, i] = await Promise.all([
|
|
1698
1754
|
this.getTheme({ conf: t, publicTheme: s === void 0 }),
|
|
1699
1755
|
this.getWebAppConf({ app: e, applications: s ?? [] })
|
|
1700
|
-
]),
|
|
1756
|
+
]), n = {
|
|
1701
1757
|
app: e,
|
|
1702
1758
|
applications: s ?? [],
|
|
1703
1759
|
conf: t,
|
|
1704
1760
|
currentApp: i,
|
|
1705
1761
|
theme: r
|
|
1706
1762
|
};
|
|
1707
|
-
return this.notify.onAppConfReady().resolve(
|
|
1763
|
+
return this.notify.onAppConfReady().resolve(n), n;
|
|
1708
1764
|
}
|
|
1709
1765
|
async getPublicConf(e) {
|
|
1710
1766
|
const { response: t, value: s } = await this.cache.httpGet(
|
|
@@ -1758,23 +1814,23 @@ class ConfService {
|
|
|
1758
1814
|
}) {
|
|
1759
1815
|
const { value: r } = await this.cache.httpGet("/theme", {
|
|
1760
1816
|
queryParams: { _: e }
|
|
1761
|
-
}), i = s ? null : r,
|
|
1817
|
+
}), i = s ? null : r, n = t == null ? void 0 : t.overriding.find(
|
|
1762
1818
|
(p) => (
|
|
1763
1819
|
// Public access => simply use the 1st override
|
|
1764
1820
|
i === null || p.child === i.themeName
|
|
1765
1821
|
)
|
|
1766
|
-
), a = (i == null ? void 0 : i.skinName) ||
|
|
1822
|
+
), a = (i == null ? void 0 : i.skinName) || n.skins[0], c = (i == null ? void 0 : i.skin) || `/assets/themes/${n.child}/skins/${a}/`, h = n.skins, l = n.bootstrapVersion.split("-").slice(-1)[0], E = n.parent === "panda";
|
|
1767
1823
|
return {
|
|
1768
1824
|
basePath: `${this.cdnDomain}${c}../../`,
|
|
1769
1825
|
bootstrapVersion: l,
|
|
1770
1826
|
is1d: E,
|
|
1771
1827
|
logoutCallback: (i == null ? void 0 : i.logoutCallback) || "/",
|
|
1772
|
-
skin:
|
|
1828
|
+
skin: n.child,
|
|
1773
1829
|
skinName: a,
|
|
1774
1830
|
skins: h,
|
|
1775
|
-
themeName:
|
|
1831
|
+
themeName: n.child,
|
|
1776
1832
|
themeUrl: c,
|
|
1777
|
-
npmTheme:
|
|
1833
|
+
npmTheme: n.npmTheme ?? void 0
|
|
1778
1834
|
};
|
|
1779
1835
|
}
|
|
1780
1836
|
async getLogoutCallback(e) {
|
|
@@ -1819,13 +1875,13 @@ class DirectoryService {
|
|
|
1819
1875
|
return {
|
|
1820
1876
|
id: s,
|
|
1821
1877
|
displayName: r,
|
|
1822
|
-
groups: t.map(({ name:
|
|
1823
|
-
displayName:
|
|
1878
|
+
groups: t.map(({ name: n, id: a }) => ({
|
|
1879
|
+
displayName: n,
|
|
1824
1880
|
id: a
|
|
1825
1881
|
})),
|
|
1826
|
-
users: i.map(({ displayName:
|
|
1882
|
+
users: i.map(({ displayName: n, id: a, profile: c }) => ({
|
|
1827
1883
|
profile: c,
|
|
1828
|
-
displayName:
|
|
1884
|
+
displayName: n,
|
|
1829
1885
|
// these info are missing from api
|
|
1830
1886
|
firstName: "",
|
|
1831
1887
|
lastName: "",
|
|
@@ -1840,19 +1896,19 @@ class DirectoryService {
|
|
|
1840
1896
|
users: r
|
|
1841
1897
|
}) {
|
|
1842
1898
|
this.cache.clearCache("/directory/sharebookmark/all");
|
|
1843
|
-
const i = r.map((p) => typeof p == "string" ? p : p.id),
|
|
1899
|
+
const i = r.map((p) => typeof p == "string" ? p : p.id), n = s.map((p) => typeof p == "string" ? p : p.id), a = t.map(async (p) => {
|
|
1844
1900
|
if (typeof p == "string") {
|
|
1845
|
-
const { displayName: d, groups: g, id: A, users: m } = await this.getBookMarkById(p), b = m.map((F) => F.id),
|
|
1901
|
+
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);
|
|
1846
1902
|
return {
|
|
1847
1903
|
displayName: d,
|
|
1848
1904
|
id: A,
|
|
1849
|
-
members: [...
|
|
1905
|
+
members: [...C, ...b]
|
|
1850
1906
|
};
|
|
1851
1907
|
} else
|
|
1852
1908
|
return Promise.resolve(p);
|
|
1853
1909
|
}), h = (await Promise.all(a)).map((p) => p.members).reduce((p, d) => [...p, ...d], []), l = {
|
|
1854
1910
|
name: e,
|
|
1855
|
-
members: [...i, ...
|
|
1911
|
+
members: [...i, ...n, ...h]
|
|
1856
1912
|
}, { id: E } = await this.http.postJson(
|
|
1857
1913
|
"/directory/sharebookmark",
|
|
1858
1914
|
l
|
|
@@ -1868,10 +1924,10 @@ const loadedScripts = {};
|
|
|
1868
1924
|
class HttpService {
|
|
1869
1925
|
constructor(e, t) {
|
|
1870
1926
|
// Axios automatically manages the XSRF-TOKEN cookie and the X-XSRF-TOKEN HTTP header.
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1927
|
+
u(this, "axios");
|
|
1928
|
+
u(this, "baseUrl");
|
|
1929
|
+
u(this, "headers", {});
|
|
1930
|
+
u(this, "_latestResponse");
|
|
1875
1931
|
this.context = e, this.axios = axios.create(t);
|
|
1876
1932
|
}
|
|
1877
1933
|
fixBaseUrl(e) {
|
|
@@ -1916,15 +1972,15 @@ class HttpService {
|
|
|
1916
1972
|
status: 500,
|
|
1917
1973
|
statusText: ERROR_CODE.UNKNOWN
|
|
1918
1974
|
};
|
|
1919
|
-
const { status: s, statusText: r, headers: i, data:
|
|
1975
|
+
const { status: s, statusText: r, headers: i, data: n } = this._latestResponse;
|
|
1920
1976
|
return t != null && t.disableNotifications || notify.events().publish(LAYER_NAME.TRANSPORT, {
|
|
1921
1977
|
name: EVENT_NAME.ERROR_OCCURED,
|
|
1922
1978
|
data: {
|
|
1923
1979
|
params: t,
|
|
1924
1980
|
response: { status: s, statusText: r, headers: i },
|
|
1925
|
-
payload:
|
|
1981
|
+
payload: n
|
|
1926
1982
|
}
|
|
1927
|
-
}),
|
|
1983
|
+
}), n;
|
|
1928
1984
|
}
|
|
1929
1985
|
mapAxiosResponse(e, t) {
|
|
1930
1986
|
return this._latestResponse = e, e.data;
|
|
@@ -2047,15 +2103,15 @@ class HttpService {
|
|
|
2047
2103
|
}
|
|
2048
2104
|
getScript(e, t, s) {
|
|
2049
2105
|
const r = s ?? "exports", i = this.toAxiosConfig(t);
|
|
2050
|
-
return i.headers && (i.headers.Accept = "application/javascript"), this.axios.get(this.toCdnUrl(e), i).then((
|
|
2106
|
+
return i.headers && (i.headers.Accept = "application/javascript"), this.axios.get(this.toCdnUrl(e), i).then((n) => this.mapAxiosResponse(n, t)).then((n) => {
|
|
2051
2107
|
try {
|
|
2052
|
-
const a = `"use strict";var ${r.split(".")[0]}={};${
|
|
2108
|
+
const a = `"use strict";var ${r.split(".")[0]}={};${n};return ${r};`;
|
|
2053
2109
|
return Function(a)();
|
|
2054
2110
|
} catch {
|
|
2055
|
-
return
|
|
2111
|
+
return n;
|
|
2056
2112
|
}
|
|
2057
|
-
}).catch((
|
|
2058
|
-
throw this.mapAxiosError(
|
|
2113
|
+
}).catch((n) => {
|
|
2114
|
+
throw this.mapAxiosError(n, t), n;
|
|
2059
2115
|
});
|
|
2060
2116
|
}
|
|
2061
2117
|
loadScript(e, t) {
|
|
@@ -2115,13 +2171,13 @@ class RightService {
|
|
|
2115
2171
|
* @returns true if has rights
|
|
2116
2172
|
*/
|
|
2117
2173
|
hasResourceRight({ id: e, groupIds: t }, s, r) {
|
|
2118
|
-
const i = r.map((
|
|
2119
|
-
for (const
|
|
2120
|
-
if (
|
|
2174
|
+
const i = r.map((n) => typeof n == "string" ? this.parseResourceRight(n) : n).filter((n) => n !== void 0);
|
|
2175
|
+
for (const n of i) {
|
|
2176
|
+
if (n.id === e && n.type === "creator")
|
|
2121
2177
|
return !0;
|
|
2122
|
-
if (
|
|
2178
|
+
if (n.id === e && n.type === "user" && n.right === s)
|
|
2123
2179
|
return !0;
|
|
2124
|
-
if (t.includes(
|
|
2180
|
+
if (t.includes(n.id) && n.type === "group" && n.right === s)
|
|
2125
2181
|
return !0;
|
|
2126
2182
|
}
|
|
2127
2183
|
return !1;
|
|
@@ -2258,7 +2314,7 @@ class SessionService {
|
|
|
2258
2314
|
s,
|
|
2259
2315
|
r,
|
|
2260
2316
|
i,
|
|
2261
|
-
|
|
2317
|
+
n
|
|
2262
2318
|
] = await Promise.all([
|
|
2263
2319
|
this.getCurrentLanguage(e),
|
|
2264
2320
|
this.latestQuotaAndUsage(e),
|
|
@@ -2272,7 +2328,7 @@ class SessionService {
|
|
|
2272
2328
|
currentLanguage: t,
|
|
2273
2329
|
userDescription: r,
|
|
2274
2330
|
userProfile: i,
|
|
2275
|
-
bookmarkedApps:
|
|
2331
|
+
bookmarkedApps: n
|
|
2276
2332
|
};
|
|
2277
2333
|
}
|
|
2278
2334
|
login(e, t, s, r) {
|
|
@@ -2366,9 +2422,9 @@ class SessionService {
|
|
|
2366
2422
|
applications: []
|
|
2367
2423
|
});
|
|
2368
2424
|
const i = [];
|
|
2369
|
-
return r.bookmarks.forEach((
|
|
2425
|
+
return r.bookmarks.forEach((n, a) => {
|
|
2370
2426
|
const c = ((e == null ? void 0 : e.apps) || []).find(
|
|
2371
|
-
(h) => h.name ===
|
|
2427
|
+
(h) => h.name === n
|
|
2372
2428
|
);
|
|
2373
2429
|
if (c) {
|
|
2374
2430
|
const h = Object.assign({}, c);
|
|
@@ -2378,8 +2434,8 @@ class SessionService {
|
|
|
2378
2434
|
}
|
|
2379
2435
|
async getUserProfile(e = {}) {
|
|
2380
2436
|
var c, h;
|
|
2381
|
-
const { options: t = {}, params: s = {} } = e, r = new URLSearchParams(s).toString(), i = `/userbook/api/person${r ? `?${r}` : ""}`, { response:
|
|
2382
|
-
return
|
|
2437
|
+
const { options: t = {}, params: s = {} } = e, r = new URLSearchParams(s).toString(), i = `/userbook/api/person${r ? `?${r}` : ""}`, { response: n, value: a } = await this.cache.httpGet(i, t);
|
|
2438
|
+
return n.status < 200 || n.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"];
|
|
2383
2439
|
}
|
|
2384
2440
|
async isAdml() {
|
|
2385
2441
|
const e = await this.getUser();
|
|
@@ -2426,7 +2482,7 @@ class ShareService {
|
|
|
2426
2482
|
async searchShareSubjects(e, t, s) {
|
|
2427
2483
|
const r = StringUtils.removeAccents(s).toLowerCase(), i = await this.cache.httpGetJson(
|
|
2428
2484
|
`/${e}/share/json/${t}?search=${s}`
|
|
2429
|
-
),
|
|
2485
|
+
), n = i.users.visibles.filter(({ username: l, firstName: E, lastName: p, login: d }) => {
|
|
2430
2486
|
const g = StringUtils.removeAccents(
|
|
2431
2487
|
p || ""
|
|
2432
2488
|
).toLowerCase(), A = StringUtils.removeAccents(
|
|
@@ -2459,7 +2515,7 @@ class ShareService {
|
|
|
2459
2515
|
displayName: l.displayName,
|
|
2460
2516
|
id: l.id,
|
|
2461
2517
|
type: "sharebookmark"
|
|
2462
|
-
})), ...
|
|
2518
|
+
})), ...n, ...a];
|
|
2463
2519
|
}
|
|
2464
2520
|
async getShareMapping(e) {
|
|
2465
2521
|
const t = await this.cache.httpGetJson(
|
|
@@ -2473,15 +2529,15 @@ class ShareService {
|
|
|
2473
2529
|
return t;
|
|
2474
2530
|
}
|
|
2475
2531
|
getActionsAvailableFor({ id: e, type: t }, s, r) {
|
|
2476
|
-
const
|
|
2532
|
+
const n = (t === "user" ? s.users.checked[e] : s.groups.checked[e]) || [], a = Object.keys(r), c = [];
|
|
2477
2533
|
for (const h of a)
|
|
2478
2534
|
r[h].filter(
|
|
2479
|
-
(p) =>
|
|
2535
|
+
(p) => n.includes(p)
|
|
2480
2536
|
).length > 0 && c.push(h);
|
|
2481
2537
|
return c;
|
|
2482
2538
|
}
|
|
2483
2539
|
async getRightsForResource(e, t) {
|
|
2484
|
-
const s = await this.directory.getBookMarks(), r = `/${e}/share/json/${t}?search=`, i = await this.cache.httpGetJson(r),
|
|
2540
|
+
const s = await this.directory.getBookMarks(), r = `/${e}/share/json/${t}?search=`, i = await this.cache.httpGetJson(r), n = await this.getShareMapping(e), a = await this.cache.httpGetJson(
|
|
2485
2541
|
"/infra/public/json/sharing-rights.json"
|
|
2486
2542
|
), c = Object.keys(i.users.checked).map((d) => i.users.visibles.find(
|
|
2487
2543
|
(A) => A.id === d
|
|
@@ -2489,7 +2545,7 @@ class ShareService {
|
|
|
2489
2545
|
const g = this.getActionsAvailableFor(
|
|
2490
2546
|
{ id: d.id, type: "user" },
|
|
2491
2547
|
i,
|
|
2492
|
-
|
|
2548
|
+
n
|
|
2493
2549
|
);
|
|
2494
2550
|
return {
|
|
2495
2551
|
id: d.id,
|
|
@@ -2513,7 +2569,7 @@ class ShareService {
|
|
|
2513
2569
|
const g = this.getActionsAvailableFor(
|
|
2514
2570
|
{ id: d.id, type: "group" },
|
|
2515
2571
|
i,
|
|
2516
|
-
|
|
2572
|
+
n
|
|
2517
2573
|
);
|
|
2518
2574
|
return {
|
|
2519
2575
|
id: d.id,
|
|
@@ -2537,11 +2593,11 @@ class ShareService {
|
|
|
2537
2593
|
id: g
|
|
2538
2594
|
})
|
|
2539
2595
|
), p = i.users.visibles.map(
|
|
2540
|
-
({ id: d, profile: g, username: A, firstName: m, lastName: b, login:
|
|
2596
|
+
({ id: d, profile: g, username: A, firstName: m, lastName: b, login: C }) => ({
|
|
2541
2597
|
displayName: A,
|
|
2542
2598
|
firstName: m,
|
|
2543
2599
|
lastName: b,
|
|
2544
|
-
login:
|
|
2600
|
+
login: C,
|
|
2545
2601
|
profile: g,
|
|
2546
2602
|
id: d
|
|
2547
2603
|
})
|
|
@@ -2563,25 +2619,25 @@ class ShareService {
|
|
|
2563
2619
|
const h = c.actions.map((E) => r[E.id]).reduce((E, p) => Array.isArray(p) ? [...E, ...p] : E, []), l = [...new Set(h)];
|
|
2564
2620
|
l.length > 0 && (c.type === "user" ? i.users[c.id] = l : c.type === "group" ? i.groups[c.id] = l : i.bookmarks[c.id] = l);
|
|
2565
2621
|
}
|
|
2566
|
-
const
|
|
2567
|
-
return this.cache.clearCache(`/${e}/share/json/${t}?search=`), await this.http.putJson(
|
|
2622
|
+
const n = `/${e}/share/resource/${t}`;
|
|
2623
|
+
return this.cache.clearCache(`/${e}/share/json/${t}?search=`), await this.http.putJson(n, i);
|
|
2568
2624
|
}
|
|
2569
2625
|
async getActionsForApp(e) {
|
|
2570
2626
|
const t = await this.cache.httpGetJson(
|
|
2571
2627
|
"/infra/public/json/sharing-rights.json"
|
|
2572
2628
|
), s = await this.getShareMapping(e);
|
|
2573
2629
|
return Object.keys(t).map((i) => {
|
|
2574
|
-
const
|
|
2630
|
+
const n = t[i];
|
|
2575
2631
|
return {
|
|
2576
2632
|
displayName: i,
|
|
2577
2633
|
id: i,
|
|
2578
|
-
priority:
|
|
2579
|
-
requires:
|
|
2634
|
+
priority: n.priority,
|
|
2635
|
+
requires: n.requires
|
|
2580
2636
|
};
|
|
2581
2637
|
}).filter((i) => {
|
|
2582
|
-
var
|
|
2583
|
-
return ((
|
|
2584
|
-
}).sort((i,
|
|
2638
|
+
var n;
|
|
2639
|
+
return ((n = s[i.id]) == null ? void 0 : n.length) > 0;
|
|
2640
|
+
}).sort((i, n) => i.priority - n.priority);
|
|
2585
2641
|
}
|
|
2586
2642
|
}
|
|
2587
2643
|
const defaultMappers = {
|
|
@@ -2618,11 +2674,11 @@ const defaultMappers = {
|
|
|
2618
2674
|
zip: function({ type: o }) {
|
|
2619
2675
|
return o.indexOf("zip") !== -1 || o.indexOf("rar") !== -1 || o.indexOf("tar") !== -1 || o.indexOf("7z") !== -1;
|
|
2620
2676
|
}
|
|
2621
|
-
},
|
|
2677
|
+
}, R = class R {
|
|
2622
2678
|
/* Similar role notion as in infra-front > workspace > Model.ts */
|
|
2623
2679
|
static getRole(e) {
|
|
2624
2680
|
var t, s;
|
|
2625
|
-
return
|
|
2681
|
+
return R.role(
|
|
2626
2682
|
(t = e.metadata) == null ? void 0 : t["content-type"],
|
|
2627
2683
|
!1,
|
|
2628
2684
|
(s = e.metadata) == null ? void 0 : s.extension
|
|
@@ -2634,18 +2690,18 @@ const defaultMappers = {
|
|
|
2634
2690
|
this.roleMappers || console.warn("[DocumentHelper.role] should not have empty roles", this);
|
|
2635
2691
|
const r = { type: e, previewRole: t, extension: s };
|
|
2636
2692
|
for (const i of this.roleMappers) {
|
|
2637
|
-
const
|
|
2638
|
-
if (
|
|
2639
|
-
return
|
|
2693
|
+
const n = i(r);
|
|
2694
|
+
if (n)
|
|
2695
|
+
return n;
|
|
2640
2696
|
}
|
|
2641
2697
|
return "unknown";
|
|
2642
2698
|
}
|
|
2643
2699
|
};
|
|
2644
2700
|
// FIXME add edumedia support
|
|
2645
|
-
|
|
2701
|
+
u(R, "roleMappers", [
|
|
2646
2702
|
(e) => Object.keys(defaultMappers).find((s) => defaultMappers[s](e))
|
|
2647
2703
|
]);
|
|
2648
|
-
let DocumentHelper =
|
|
2704
|
+
let DocumentHelper = R;
|
|
2649
2705
|
class WorkspaceService {
|
|
2650
2706
|
constructor(e) {
|
|
2651
2707
|
this.context = e;
|
|
@@ -2654,22 +2710,22 @@ class WorkspaceService {
|
|
|
2654
2710
|
return this.context.http();
|
|
2655
2711
|
}
|
|
2656
2712
|
extractMetadata(e) {
|
|
2657
|
-
const t = e.name || "", s = t.split("."), r = e.type || "application/octet-stream", i = s.length > 1 ? s[s.length - 1] : "",
|
|
2713
|
+
const t = e.name || "", s = t.split("."), r = e.type || "application/octet-stream", i = s.length > 1 ? s[s.length - 1] : "", n = {
|
|
2658
2714
|
"content-type": r,
|
|
2659
2715
|
filename: t,
|
|
2660
2716
|
size: e.size,
|
|
2661
2717
|
extension: i,
|
|
2662
2718
|
role: DocumentHelper.role(r, !1, i)
|
|
2663
|
-
}, a = t.replace("." +
|
|
2664
|
-
return { basename: a, fullname: c, metadata:
|
|
2719
|
+
}, a = t.replace("." + n.extension, ""), c = n.extension ? a + "." + n.extension : a;
|
|
2720
|
+
return { basename: a, fullname: c, metadata: n };
|
|
2665
2721
|
}
|
|
2666
2722
|
async saveFile(e, t) {
|
|
2667
2723
|
const { fullname: s, metadata: r } = this.extractMetadata(e), i = new FormData();
|
|
2668
2724
|
i.append("file", e, s);
|
|
2669
|
-
const
|
|
2670
|
-
((t == null ? void 0 : t.visibility) === "public" || (t == null ? void 0 : t.visibility) === "protected") &&
|
|
2725
|
+
const n = [];
|
|
2726
|
+
((t == null ? void 0 : t.visibility) === "public" || (t == null ? void 0 : t.visibility) === "protected") && n.push(`${t.visibility}=true`), t != null && t.application && n.push(`application=${t.application}`), r.role === "img" && n.push("quality=1"), t != null && t.parentId && n.push(`parentId=${t.parentId}`);
|
|
2671
2727
|
const a = await this.http.postFile(
|
|
2672
|
-
`/workspace/document?${
|
|
2728
|
+
`/workspace/document?${n.join("&")}`,
|
|
2673
2729
|
i
|
|
2674
2730
|
);
|
|
2675
2731
|
if (this.http.isResponseError())
|
|
@@ -2677,13 +2733,13 @@ class WorkspaceService {
|
|
|
2677
2733
|
return a;
|
|
2678
2734
|
}
|
|
2679
2735
|
async updateFile(e, t, s) {
|
|
2680
|
-
const { fullname: r, metadata: i } = this.extractMetadata(t),
|
|
2681
|
-
|
|
2736
|
+
const { fullname: r, metadata: i } = this.extractMetadata(t), n = new FormData();
|
|
2737
|
+
n.append("file", t, r);
|
|
2682
2738
|
const a = [];
|
|
2683
2739
|
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}`);
|
|
2684
2740
|
const c = await this.http.putFile(
|
|
2685
2741
|
`/workspace/document/${e}?${a.join("&")}`,
|
|
2686
|
-
|
|
2742
|
+
n
|
|
2687
2743
|
);
|
|
2688
2744
|
if (this.http.isResponseError())
|
|
2689
2745
|
throw this.http.latestResponse.statusText;
|
|
@@ -2728,17 +2784,17 @@ class WorkspaceService {
|
|
|
2728
2784
|
{
|
|
2729
2785
|
application: t,
|
|
2730
2786
|
visibility: s,
|
|
2731
|
-
ids: r.map((
|
|
2787
|
+
ids: r.map((n) => n._id)
|
|
2732
2788
|
}
|
|
2733
2789
|
);
|
|
2734
2790
|
if (this.http.isResponseError())
|
|
2735
2791
|
throw this.http.latestResponse.statusText;
|
|
2736
|
-
return r.forEach((
|
|
2792
|
+
return r.forEach((n, a) => {
|
|
2737
2793
|
const c = e.findIndex(
|
|
2738
|
-
(h) => h._id ===
|
|
2794
|
+
(h) => h._id === n._id
|
|
2739
2795
|
);
|
|
2740
2796
|
0 <= c && c < e.length && (e[c] = i[a]);
|
|
2741
|
-
}), e.filter((
|
|
2797
|
+
}), e.filter((n) => !!n);
|
|
2742
2798
|
}
|
|
2743
2799
|
return e;
|
|
2744
2800
|
}
|
|
@@ -2747,13 +2803,13 @@ class WorkspaceService {
|
|
|
2747
2803
|
* or `null` if none exists or can be created.
|
|
2748
2804
|
*/
|
|
2749
2805
|
getThumbnailUrl(e, t = 0, s = 0) {
|
|
2750
|
-
var i,
|
|
2806
|
+
var i, n;
|
|
2751
2807
|
const r = t > 0 || s > 0 ? `${t}x${s}` : "120x120";
|
|
2752
2808
|
if (typeof e == "string")
|
|
2753
2809
|
return e.includes("data:image") || e.includes("thumbnail") ? e : `${e}${e.includes("?") ? "&" : "?"}thumbnail=${r}`;
|
|
2754
2810
|
{
|
|
2755
2811
|
const a = `/workspace/${e.public ? "pub/" : ""}document/${e._id}?thumbnail=`, c = e.thumbnails;
|
|
2756
|
-
if ((
|
|
2812
|
+
if ((n = (i = e.metadata) == null ? void 0 : i["content-type"]) != null && n.includes("video")) {
|
|
2757
2813
|
const h = c && Object.keys(c).length > 0 ? Object.keys(c)[0] : null;
|
|
2758
2814
|
return h ? a + h : null;
|
|
2759
2815
|
} else
|
|
@@ -3007,8 +3063,8 @@ class IdiomService {
|
|
|
3007
3063
|
else {
|
|
3008
3064
|
const i = new Promisified();
|
|
3009
3065
|
promises[t] = i.promise;
|
|
3010
|
-
const
|
|
3011
|
-
e && (
|
|
3066
|
+
const n = {};
|
|
3067
|
+
e && (n["Accept-Language"] = e), this.http.get(t, { headers: n }).then((a) => {
|
|
3012
3068
|
Object.assign(bundle, a), typeof s == "function" && s(), i.resolve();
|
|
3013
3069
|
}).catch((a) => {
|
|
3014
3070
|
typeof s == "function" && s(), i.reject();
|
|
@@ -3131,8 +3187,8 @@ class AnalyticsService {
|
|
|
3131
3187
|
if (!r || !r.active) return;
|
|
3132
3188
|
const i = await configure.Platform.apps.getPublicConf(e);
|
|
3133
3189
|
if (!i) return;
|
|
3134
|
-
const
|
|
3135
|
-
if (!
|
|
3190
|
+
const n = i.xiti;
|
|
3191
|
+
if (!n || !n.LIBELLE_SERVICE || !r.UAI) return;
|
|
3136
3192
|
function a(h) {
|
|
3137
3193
|
let l = "";
|
|
3138
3194
|
for (let E = 0; E < h.length; E++)
|
|
@@ -3147,10 +3203,10 @@ class AnalyticsService {
|
|
|
3147
3203
|
Guest: "AUTRE"
|
|
3148
3204
|
};
|
|
3149
3205
|
return {
|
|
3150
|
-
LIBELLE_SERVICE:
|
|
3206
|
+
LIBELLE_SERVICE: n.LIBELLE_SERVICE,
|
|
3151
3207
|
// Which property of LIBELLE_SERVICE to use depends on the frontend.
|
|
3152
|
-
TYPE:
|
|
3153
|
-
OUTIL:
|
|
3208
|
+
TYPE: n.OUTIL ? "TIERS" : "NATIF",
|
|
3209
|
+
OUTIL: n.OUTIL ? n.OUTIL : "",
|
|
3154
3210
|
STRUCT_ID: r.collectiviteId,
|
|
3155
3211
|
STRUCT_UAI: r.UAI,
|
|
3156
3212
|
PROJET: r.projetId ? r.projetId : o.ID_PROJET,
|
|
@@ -3179,7 +3235,7 @@ const w = class w {
|
|
|
3179
3235
|
async getVideoConf() {
|
|
3180
3236
|
var t;
|
|
3181
3237
|
const e = await this.conf.getPublicConf(
|
|
3182
|
-
APP$
|
|
3238
|
+
APP$3.VIDEO
|
|
3183
3239
|
);
|
|
3184
3240
|
return {
|
|
3185
3241
|
maxWeight: (e == null ? void 0 : e["max-videosize-mbytes"]) ?? w.MAX_WEIGHT,
|
|
@@ -3204,13 +3260,13 @@ const w = class w {
|
|
|
3204
3260
|
throw new Error("Invalid video file.");
|
|
3205
3261
|
if (!e.filename)
|
|
3206
3262
|
throw new Error("Invalid video filename");
|
|
3207
|
-
const i = `${e.browser.name} ${e.browser.version}`,
|
|
3208
|
-
|
|
3263
|
+
const i = `${e.browser.name} ${e.browser.version}`, n = new FormData();
|
|
3264
|
+
n.append("device", e.device || ""), n.append("browser", i), n.append("url", e.url), n.append("app", t), n.append("file", e.file, e.filename), n.append("weight", "" + e.file.size), n.append("captation", "" + s);
|
|
3209
3265
|
let a = `/video/encode?captation=${s}`;
|
|
3210
3266
|
r && (a += `&duration=${r}`);
|
|
3211
3267
|
const c = await this.http.post(
|
|
3212
3268
|
a,
|
|
3213
|
-
|
|
3269
|
+
n,
|
|
3214
3270
|
{ headers: { "Content-Type": "multipart/form-data" } }
|
|
3215
3271
|
);
|
|
3216
3272
|
if (c.state == "running") {
|
|
@@ -3240,8 +3296,8 @@ const w = class w {
|
|
|
3240
3296
|
throw new Error("Video cannot be uploaded.");
|
|
3241
3297
|
}
|
|
3242
3298
|
};
|
|
3243
|
-
|
|
3244
|
-
|
|
3299
|
+
u(w, "MAX_WEIGHT", 50), // in Mbytes. Applies to uploaded videos.
|
|
3300
|
+
u(w, "MAX_DURATION", 3);
|
|
3245
3301
|
let VideoService = w;
|
|
3246
3302
|
class EmbedderService {
|
|
3247
3303
|
constructor(e) {
|
|
@@ -3278,9 +3334,9 @@ class EmbedderService {
|
|
|
3278
3334
|
urlIsFromPattern(e, t) {
|
|
3279
3335
|
const s = new RegExp("[^{}]+(?=(?:[^{}]*{[^}]*})*[^}]*$)", "g"), r = new RegExp("{[^}]*}", "g");
|
|
3280
3336
|
let i = !0;
|
|
3281
|
-
const
|
|
3337
|
+
const n = t.match(s) || [], a = [];
|
|
3282
3338
|
return (t.match(r) || []).forEach((h, l) => {
|
|
3283
|
-
h.includes("ignore") || a.push(
|
|
3339
|
+
h.includes("ignore") || a.push(n[l]);
|
|
3284
3340
|
}), a.forEach((h) => {
|
|
3285
3341
|
if (!e.includes(h)) {
|
|
3286
3342
|
i = !1;
|
|
@@ -3311,7 +3367,7 @@ class EmbedderService {
|
|
|
3311
3367
|
for (const s of e.url)
|
|
3312
3368
|
if (this.urlIsFromPattern(t, s)) {
|
|
3313
3369
|
const r = new RegExp("{[a-zA-Z0-9_.]+}", "g"), i = s.match(r) || [];
|
|
3314
|
-
let
|
|
3370
|
+
let n = e.embed;
|
|
3315
3371
|
for (const a of i) {
|
|
3316
3372
|
let c = s.split(a)[0];
|
|
3317
3373
|
const h = c.split("}");
|
|
@@ -3322,9 +3378,9 @@ class EmbedderService {
|
|
|
3322
3378
|
const E = s.split(a)[1].split("{")[0];
|
|
3323
3379
|
E && (l = l.split(E)[0]);
|
|
3324
3380
|
const p = new RegExp("\\" + a.replace(/}/, "\\}"), "g");
|
|
3325
|
-
|
|
3381
|
+
n = n.replace(p, l);
|
|
3326
3382
|
}
|
|
3327
|
-
return
|
|
3383
|
+
return n;
|
|
3328
3384
|
}
|
|
3329
3385
|
return "";
|
|
3330
3386
|
}
|
|
@@ -3337,7 +3393,7 @@ class AbstractBehaviourService {
|
|
|
3337
3393
|
//-----------------
|
|
3338
3394
|
//--- Utilities ---
|
|
3339
3395
|
//-----------------
|
|
3340
|
-
|
|
3396
|
+
u(this, "_cache");
|
|
3341
3397
|
this.context = e, this._cache = new CacheService(this.context);
|
|
3342
3398
|
}
|
|
3343
3399
|
getApplication() {
|
|
@@ -3371,8 +3427,8 @@ class AbstractBehaviourService {
|
|
|
3371
3427
|
class ActualitesBehaviour extends AbstractBehaviourService {
|
|
3372
3428
|
constructor() {
|
|
3373
3429
|
super(...arguments);
|
|
3374
|
-
|
|
3375
|
-
|
|
3430
|
+
u(this, "APP", "actualites");
|
|
3431
|
+
u(this, "RESOURCE", "actualites");
|
|
3376
3432
|
}
|
|
3377
3433
|
async loadResources() {
|
|
3378
3434
|
return (await this.httpGet(
|
|
@@ -3395,24 +3451,24 @@ class ActualitesBehaviour extends AbstractBehaviourService {
|
|
|
3395
3451
|
class BlogBehaviour extends AbstractBehaviourService {
|
|
3396
3452
|
constructor() {
|
|
3397
3453
|
super(...arguments);
|
|
3398
|
-
|
|
3399
|
-
|
|
3454
|
+
u(this, "APP", "blog");
|
|
3455
|
+
u(this, "RESOURCE", "blog");
|
|
3400
3456
|
}
|
|
3401
3457
|
loadResources() {
|
|
3402
3458
|
return new Promise(async (t, s) => {
|
|
3403
3459
|
try {
|
|
3404
3460
|
const r = await this.httpGet("/blog/linker"), i = [];
|
|
3405
|
-
r.forEach((
|
|
3406
|
-
|
|
3407
|
-
const a =
|
|
3408
|
-
owner:
|
|
3409
|
-
ownerName:
|
|
3410
|
-
title: c.title + " [" +
|
|
3411
|
-
_id: `${
|
|
3412
|
-
icon:
|
|
3413
|
-
path: `/blog/id/${
|
|
3414
|
-
shared: !!(
|
|
3415
|
-
modified:
|
|
3461
|
+
r.forEach((n) => {
|
|
3462
|
+
n.thumbnail ? n.thumbnail = n.thumbnail + "?thumbnail=48x48" : n.thumbnail = "/img/illustrations/blog.svg";
|
|
3463
|
+
const a = n.fetchPosts.map((c) => this.dataToResource({
|
|
3464
|
+
owner: n.author.userId,
|
|
3465
|
+
ownerName: n.author.username,
|
|
3466
|
+
title: c.title + " [" + n.title + "]",
|
|
3467
|
+
_id: `${n._id}#${c._id}`,
|
|
3468
|
+
icon: n.thumbnail,
|
|
3469
|
+
path: `/blog/id/${n._id}/post/${c._id}`,
|
|
3470
|
+
shared: !!(n.shared && n.shared.length >= 0),
|
|
3471
|
+
modified: n.modified
|
|
3416
3472
|
}));
|
|
3417
3473
|
i.push(...a);
|
|
3418
3474
|
}), t(i);
|
|
@@ -3425,8 +3481,8 @@ class BlogBehaviour extends AbstractBehaviourService {
|
|
|
3425
3481
|
class CollaborativewallBehaviour extends AbstractBehaviourService {
|
|
3426
3482
|
constructor() {
|
|
3427
3483
|
super(...arguments);
|
|
3428
|
-
|
|
3429
|
-
|
|
3484
|
+
u(this, "APP", "collaborativewall");
|
|
3485
|
+
u(this, "RESOURCE", "collaborativewall");
|
|
3430
3486
|
}
|
|
3431
3487
|
async loadResources() {
|
|
3432
3488
|
return (await this.httpGet(
|
|
@@ -3448,8 +3504,8 @@ class CollaborativewallBehaviour extends AbstractBehaviourService {
|
|
|
3448
3504
|
class CommunityBehaviour extends AbstractBehaviourService {
|
|
3449
3505
|
constructor() {
|
|
3450
3506
|
super(...arguments);
|
|
3451
|
-
|
|
3452
|
-
|
|
3507
|
+
u(this, "APP", "community");
|
|
3508
|
+
u(this, "RESOURCE", "community");
|
|
3453
3509
|
}
|
|
3454
3510
|
async loadResources() {
|
|
3455
3511
|
return (await this.httpGet(
|
|
@@ -3473,23 +3529,23 @@ class CommunityBehaviour extends AbstractBehaviourService {
|
|
|
3473
3529
|
class ExercizerBehaviour extends AbstractBehaviourService {
|
|
3474
3530
|
constructor() {
|
|
3475
3531
|
super(...arguments);
|
|
3476
|
-
|
|
3477
|
-
|
|
3532
|
+
u(this, "APP", "exercizer");
|
|
3533
|
+
u(this, "RESOURCE", "exercizer");
|
|
3478
3534
|
}
|
|
3479
3535
|
async loadResources() {
|
|
3480
3536
|
return (await this.httpGet(
|
|
3481
3537
|
"/exercizer/subjects-scheduled"
|
|
3482
3538
|
)).map((s) => {
|
|
3483
3539
|
const r = s.picture ? s.picture + "?thumbnail=48x48" : "/img/illustrations/exercizer.svg";
|
|
3484
|
-
let i,
|
|
3485
|
-
return a.groupList.length > 0 ? (
|
|
3540
|
+
let i, n = !1, a = JSON.parse(s.scheduled_at);
|
|
3541
|
+
return a.groupList.length > 0 ? (n = !0, i = a.groupList[0].name) : a.userList.length > 0 ? (n = !0, i = a.userList[0].name) : i = "", a.groupList.length + a.userList.length > 1 && (i += "..."), this.dataToResource({
|
|
3486
3542
|
title: s.title,
|
|
3487
3543
|
owner: s.owner,
|
|
3488
3544
|
ownerName: i,
|
|
3489
3545
|
icon: r,
|
|
3490
3546
|
path: "/exercizer#/linker/" + s.id,
|
|
3491
3547
|
_id: "" + s.id,
|
|
3492
|
-
shared:
|
|
3548
|
+
shared: n,
|
|
3493
3549
|
modified: s.modified
|
|
3494
3550
|
});
|
|
3495
3551
|
});
|
|
@@ -3498,8 +3554,8 @@ class ExercizerBehaviour extends AbstractBehaviourService {
|
|
|
3498
3554
|
class FormulaireBehaviour extends AbstractBehaviourService {
|
|
3499
3555
|
constructor() {
|
|
3500
3556
|
super(...arguments);
|
|
3501
|
-
|
|
3502
|
-
|
|
3557
|
+
u(this, "APP", "formulaire");
|
|
3558
|
+
u(this, "RESOURCE", "formulaire");
|
|
3503
3559
|
}
|
|
3504
3560
|
async loadResources() {
|
|
3505
3561
|
return (await this.httpGet(
|
|
@@ -3519,8 +3575,8 @@ class FormulaireBehaviour extends AbstractBehaviourService {
|
|
|
3519
3575
|
class ForumBehaviour extends AbstractBehaviourService {
|
|
3520
3576
|
constructor() {
|
|
3521
3577
|
super(...arguments);
|
|
3522
|
-
|
|
3523
|
-
|
|
3578
|
+
u(this, "APP", "forum");
|
|
3579
|
+
u(this, "RESOURCE", "forum");
|
|
3524
3580
|
}
|
|
3525
3581
|
async loadResources() {
|
|
3526
3582
|
return (await this.httpGet("/forum/categories")).map(
|
|
@@ -3540,8 +3596,8 @@ class ForumBehaviour extends AbstractBehaviourService {
|
|
|
3540
3596
|
class HomeworksBehaviour extends AbstractBehaviourService {
|
|
3541
3597
|
constructor() {
|
|
3542
3598
|
super(...arguments);
|
|
3543
|
-
|
|
3544
|
-
|
|
3599
|
+
u(this, "APP", "homeworks");
|
|
3600
|
+
u(this, "RESOURCE", "homeworks");
|
|
3545
3601
|
}
|
|
3546
3602
|
async loadResources() {
|
|
3547
3603
|
return (await this.httpGet("/homeworks/list")).filter((t) => t.owner && t.trashed === 0).map((t) => this.dataToResource({
|
|
@@ -3559,8 +3615,8 @@ class HomeworksBehaviour extends AbstractBehaviourService {
|
|
|
3559
3615
|
class MagnetoBehaviour extends AbstractBehaviourService {
|
|
3560
3616
|
constructor() {
|
|
3561
3617
|
super(...arguments);
|
|
3562
|
-
|
|
3563
|
-
|
|
3618
|
+
u(this, "APP", "magneto");
|
|
3619
|
+
u(this, "RESOURCE", "magneto");
|
|
3564
3620
|
}
|
|
3565
3621
|
async loadResources() {
|
|
3566
3622
|
const { all: t } = await this.httpGet(
|
|
@@ -3581,8 +3637,8 @@ class MagnetoBehaviour extends AbstractBehaviourService {
|
|
|
3581
3637
|
class MindmapBehaviour extends AbstractBehaviourService {
|
|
3582
3638
|
constructor() {
|
|
3583
3639
|
super(...arguments);
|
|
3584
|
-
|
|
3585
|
-
|
|
3640
|
+
u(this, "APP", "mindmap");
|
|
3641
|
+
u(this, "RESOURCE", "mindmap");
|
|
3586
3642
|
}
|
|
3587
3643
|
async loadResources() {
|
|
3588
3644
|
return (await this.httpGet("/mindmap/list/all")).map(
|
|
@@ -3602,13 +3658,13 @@ class MindmapBehaviour extends AbstractBehaviourService {
|
|
|
3602
3658
|
class PagesBehaviour extends AbstractBehaviourService {
|
|
3603
3659
|
constructor() {
|
|
3604
3660
|
super(...arguments);
|
|
3605
|
-
|
|
3606
|
-
|
|
3661
|
+
u(this, "APP", "pages");
|
|
3662
|
+
u(this, "RESOURCE", "pages");
|
|
3607
3663
|
}
|
|
3608
3664
|
async loadResources() {
|
|
3609
3665
|
const t = await this.httpGet("/pages/list/all"), s = [];
|
|
3610
3666
|
return t.forEach((r) => {
|
|
3611
|
-
var
|
|
3667
|
+
var n;
|
|
3612
3668
|
const i = r.thumbnail ? r.thumbnail + "?thumbnail=48x48" : "/img/illustrations/pages.svg";
|
|
3613
3669
|
s.push(
|
|
3614
3670
|
this.dataToResource({
|
|
@@ -3621,7 +3677,7 @@ class PagesBehaviour extends AbstractBehaviourService {
|
|
|
3621
3677
|
shared: typeof r.shared < "u",
|
|
3622
3678
|
modified: r.modified
|
|
3623
3679
|
})
|
|
3624
|
-
), (
|
|
3680
|
+
), (n = r.pages) == null || n.forEach((a) => {
|
|
3625
3681
|
s.push(
|
|
3626
3682
|
this.dataToResource({
|
|
3627
3683
|
title: a.title,
|
|
@@ -3641,8 +3697,8 @@ class PagesBehaviour extends AbstractBehaviourService {
|
|
|
3641
3697
|
class PollBehaviour extends AbstractBehaviourService {
|
|
3642
3698
|
constructor() {
|
|
3643
3699
|
super(...arguments);
|
|
3644
|
-
|
|
3645
|
-
|
|
3700
|
+
u(this, "APP", "poll");
|
|
3701
|
+
u(this, "RESOURCE", "poll");
|
|
3646
3702
|
}
|
|
3647
3703
|
async loadResources() {
|
|
3648
3704
|
return (await this.httpGet("/poll/list/all")).map((s) => {
|
|
@@ -3663,8 +3719,8 @@ class PollBehaviour extends AbstractBehaviourService {
|
|
|
3663
3719
|
class ScrapbookBehaviour extends AbstractBehaviourService {
|
|
3664
3720
|
constructor() {
|
|
3665
3721
|
super(...arguments);
|
|
3666
|
-
|
|
3667
|
-
|
|
3722
|
+
u(this, "APP", "scrapbook");
|
|
3723
|
+
u(this, "RESOURCE", "scrapbook");
|
|
3668
3724
|
}
|
|
3669
3725
|
async loadResources() {
|
|
3670
3726
|
return (await this.httpGet(
|
|
@@ -3687,25 +3743,25 @@ class ScrapbookBehaviour extends AbstractBehaviourService {
|
|
|
3687
3743
|
class TimelinegeneratorBehaviour extends AbstractBehaviourService {
|
|
3688
3744
|
constructor() {
|
|
3689
3745
|
super(...arguments);
|
|
3690
|
-
|
|
3691
|
-
|
|
3746
|
+
u(this, "APP", "timelinegenerator");
|
|
3747
|
+
u(this, "RESOURCE", "timelinegenerator");
|
|
3692
3748
|
}
|
|
3693
3749
|
loadResources() {
|
|
3694
3750
|
return new Promise(async (t, s) => {
|
|
3695
3751
|
try {
|
|
3696
3752
|
const i = (await this.httpGet(
|
|
3697
3753
|
"/timelinegenerator/timelines"
|
|
3698
|
-
)).map((
|
|
3699
|
-
const a =
|
|
3754
|
+
)).map((n) => {
|
|
3755
|
+
const a = n.icon || "/img/illustrations/timeline-default.png";
|
|
3700
3756
|
return this.dataToResource({
|
|
3701
|
-
title:
|
|
3702
|
-
ownerName:
|
|
3703
|
-
owner:
|
|
3757
|
+
title: n.headline,
|
|
3758
|
+
ownerName: n.owner.displayName,
|
|
3759
|
+
owner: n.owner.userId,
|
|
3704
3760
|
icon: a,
|
|
3705
|
-
path: "/timelinegenerator#/view/" +
|
|
3706
|
-
_id:
|
|
3707
|
-
shared: typeof
|
|
3708
|
-
modified:
|
|
3761
|
+
path: "/timelinegenerator#/view/" + n._id,
|
|
3762
|
+
_id: n._id,
|
|
3763
|
+
shared: typeof n.shared < "u",
|
|
3764
|
+
modified: n.modified
|
|
3709
3765
|
});
|
|
3710
3766
|
});
|
|
3711
3767
|
t(i);
|
|
@@ -3718,8 +3774,8 @@ class TimelinegeneratorBehaviour extends AbstractBehaviourService {
|
|
|
3718
3774
|
class WikiBehaviour extends AbstractBehaviourService {
|
|
3719
3775
|
constructor() {
|
|
3720
3776
|
super(...arguments);
|
|
3721
|
-
|
|
3722
|
-
|
|
3777
|
+
u(this, "APP", "wiki");
|
|
3778
|
+
u(this, "RESOURCE", "wiki");
|
|
3723
3779
|
}
|
|
3724
3780
|
async loadResources() {
|
|
3725
3781
|
return (await this.httpGet(
|
|
@@ -3742,15 +3798,15 @@ class WikiBehaviour extends AbstractBehaviourService {
|
|
|
3742
3798
|
class WorkspaceBehaviour extends AbstractBehaviourService {
|
|
3743
3799
|
constructor() {
|
|
3744
3800
|
super(...arguments);
|
|
3745
|
-
|
|
3746
|
-
|
|
3801
|
+
u(this, "APP", "workspace");
|
|
3802
|
+
u(this, "RESOURCE", "workspace");
|
|
3747
3803
|
}
|
|
3748
3804
|
loadResources({ search: t, asset_id: s }) {
|
|
3749
3805
|
return new Promise(async (r, i) => {
|
|
3750
3806
|
try {
|
|
3751
|
-
let
|
|
3752
|
-
s && s.length ?
|
|
3753
|
-
const c = (await this.httpGet(
|
|
3807
|
+
let n = "/workspace/documents?filter=all&hierarchical=true";
|
|
3808
|
+
s && s.length ? n += `&search=${t}` : t && t.length && (n += `&search=${t}`);
|
|
3809
|
+
const c = (await this.httpGet(n)).filter((h) => !h.deleted).map((h) => {
|
|
3754
3810
|
const l = h.metadata["content-type"] && h.metadata["content-type"].indexOf("image") !== -1 ? `/workspace/document/${h._id}?thumbnail=120x120` : "/img/icons/unknown-large.png";
|
|
3755
3811
|
return this.dataToResource({
|
|
3756
3812
|
title: h.name,
|
|
@@ -3764,8 +3820,8 @@ class WorkspaceBehaviour extends AbstractBehaviourService {
|
|
|
3764
3820
|
});
|
|
3765
3821
|
});
|
|
3766
3822
|
r(c);
|
|
3767
|
-
} catch (
|
|
3768
|
-
i(
|
|
3823
|
+
} catch (n) {
|
|
3824
|
+
i(n);
|
|
3769
3825
|
}
|
|
3770
3826
|
});
|
|
3771
3827
|
}
|
|
@@ -3781,7 +3837,7 @@ const y = class y {
|
|
|
3781
3837
|
e.session().getUser()
|
|
3782
3838
|
]);
|
|
3783
3839
|
i != null && i.apps && (r != null && r.length) && (this.resourceProducingApps = r.filter(
|
|
3784
|
-
(
|
|
3840
|
+
(n) => i.apps.some((a) => a.address.includes(n))
|
|
3785
3841
|
));
|
|
3786
3842
|
} catch (r) {
|
|
3787
3843
|
console.warn("Failed to load resource-producing apps:", r);
|
|
@@ -3858,13 +3914,13 @@ const y = class y {
|
|
|
3858
3914
|
//
|
|
3859
3915
|
// STATIC REGISTRY
|
|
3860
3916
|
//
|
|
3861
|
-
|
|
3862
|
-
|
|
3917
|
+
u(y, "registry", new ServiceRegistry()), // Expose some useful functions
|
|
3918
|
+
u(y, "findBehaviour", y.registry.findService.bind(y.registry)), u(y, "hasBehaviour", y.registry.isRegistered.bind(y.registry)), u(y, "resourceProducingApps", []);
|
|
3863
3919
|
let SnipletsService = y;
|
|
3864
3920
|
const SEND_ALL = "*";
|
|
3865
3921
|
class WebBroker {
|
|
3866
3922
|
constructor(e) {
|
|
3867
|
-
|
|
3923
|
+
u(this, "subscription");
|
|
3868
3924
|
this.odeServices = e;
|
|
3869
3925
|
}
|
|
3870
3926
|
get http() {
|
|
@@ -3896,10 +3952,10 @@ class WebBroker {
|
|
|
3896
3952
|
}
|
|
3897
3953
|
class DataService {
|
|
3898
3954
|
constructor(e) {
|
|
3899
|
-
|
|
3900
|
-
|
|
3901
|
-
|
|
3902
|
-
|
|
3955
|
+
u(this, "_webBroker");
|
|
3956
|
+
u(this, "app");
|
|
3957
|
+
u(this, "user");
|
|
3958
|
+
u(this, "profile");
|
|
3903
3959
|
this.odeServices = e;
|
|
3904
3960
|
}
|
|
3905
3961
|
get conf() {
|
|
@@ -3933,12 +3989,12 @@ class DataService {
|
|
|
3933
3989
|
addUserInfos(e) {
|
|
3934
3990
|
return this.user && (e.userId = this.user.userId, e.structure = this.user.structureNames[0]), this.profile && (e.profil = this.profile[0]), e;
|
|
3935
3991
|
}
|
|
3936
|
-
trackVideoSave(e, t, s, r, i,
|
|
3992
|
+
trackVideoSave(e, t, s, r, i, n, a) {
|
|
3937
3993
|
const c = this.addUserInfos({
|
|
3938
3994
|
"event-type": "VIDEO_SAVE",
|
|
3939
3995
|
module: "video",
|
|
3940
3996
|
video_id: e,
|
|
3941
|
-
browser:
|
|
3997
|
+
browser: n,
|
|
3942
3998
|
duration: Math.round(t),
|
|
3943
3999
|
weight: s,
|
|
3944
4000
|
source: r ? "CAPTURED" : "UPLOADED",
|
|
@@ -3947,7 +4003,7 @@ class DataService {
|
|
|
3947
4003
|
this.app && (c["override-module"] = this.app), a && (c.device_type = a), this.trackWebEvent(c);
|
|
3948
4004
|
}
|
|
3949
4005
|
trackVideoRead(e, t, s, r, i) {
|
|
3950
|
-
const
|
|
4006
|
+
const n = this.addUserInfos({
|
|
3951
4007
|
"event-type": "VIDEO_READ",
|
|
3952
4008
|
module: "video",
|
|
3953
4009
|
video_id: e,
|
|
@@ -3955,7 +4011,7 @@ class DataService {
|
|
|
3955
4011
|
source: t ? "CAPTURED" : "UPLOADED",
|
|
3956
4012
|
url: s
|
|
3957
4013
|
});
|
|
3958
|
-
this.app && (
|
|
4014
|
+
this.app && (n["override-module"] = this.app), i && (n.device_type = i), this.trackWebEvent(n);
|
|
3959
4015
|
}
|
|
3960
4016
|
trackSpeechAndText(e) {
|
|
3961
4017
|
const t = this.addUserInfos({
|
|
@@ -4061,20 +4117,20 @@ class AudienceService {
|
|
|
4061
4117
|
}
|
|
4062
4118
|
class OdeServices {
|
|
4063
4119
|
constructor() {
|
|
4064
|
-
|
|
4065
|
-
|
|
4066
|
-
|
|
4067
|
-
|
|
4068
|
-
|
|
4069
|
-
|
|
4070
|
-
|
|
4071
|
-
|
|
4072
|
-
|
|
4073
|
-
|
|
4074
|
-
|
|
4075
|
-
|
|
4076
|
-
|
|
4077
|
-
|
|
4120
|
+
u(this, "_analytics");
|
|
4121
|
+
u(this, "_cache");
|
|
4122
|
+
u(this, "_conf");
|
|
4123
|
+
u(this, "_data");
|
|
4124
|
+
u(this, "_directory");
|
|
4125
|
+
u(this, "_http");
|
|
4126
|
+
u(this, "_idiom");
|
|
4127
|
+
u(this, "_notify");
|
|
4128
|
+
u(this, "_rights");
|
|
4129
|
+
u(this, "_session");
|
|
4130
|
+
u(this, "_share");
|
|
4131
|
+
u(this, "_video");
|
|
4132
|
+
u(this, "_workspace");
|
|
4133
|
+
u(this, "_embedder");
|
|
4078
4134
|
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);
|
|
4079
4135
|
}
|
|
4080
4136
|
initialize() {
|
|
@@ -4276,10 +4332,10 @@ const isActionAvailable = (o, e) => {
|
|
|
4276
4332
|
class WidgetFramework {
|
|
4277
4333
|
constructor() {
|
|
4278
4334
|
//-------------------------------------
|
|
4279
|
-
|
|
4280
|
-
|
|
4335
|
+
u(this, "_initialized");
|
|
4336
|
+
u(this, "_widgets", []);
|
|
4281
4337
|
////////////////////////////////////// USER PREFERENCES
|
|
4282
|
-
|
|
4338
|
+
u(this, "_userPrefs", {});
|
|
4283
4339
|
}
|
|
4284
4340
|
initialize(e, t) {
|
|
4285
4341
|
return this._initialized || (this._initialized = new Promisified(), notify.onSessionReady().promise.then((s) => {
|
|
@@ -4290,8 +4346,8 @@ class WidgetFramework {
|
|
|
4290
4346
|
var i;
|
|
4291
4347
|
(i = this._initialized) == null || i.resolve();
|
|
4292
4348
|
}).catch((i) => {
|
|
4293
|
-
var
|
|
4294
|
-
(
|
|
4349
|
+
var n;
|
|
4350
|
+
(n = this._initialized) == null || n.reject();
|
|
4295
4351
|
})) : (r = this._initialized) == null || r.reject();
|
|
4296
4352
|
})), this._initialized.promise;
|
|
4297
4353
|
}
|
|
@@ -4332,9 +4388,9 @@ class WidgetFramework {
|
|
|
4332
4388
|
position: c.platformConf.position
|
|
4333
4389
|
}), 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);
|
|
4334
4390
|
});
|
|
4335
|
-
const
|
|
4391
|
+
const n = new Idiom();
|
|
4336
4392
|
this._widgets = this._widgets.sort((c, h) => {
|
|
4337
|
-
const l =
|
|
4393
|
+
const l = n.translate(`timeline.settings.${c.platformConf.name}`).toLowerCase(), E = n.translate(`timeline.settings.${h.platformConf.name}`).toLowerCase();
|
|
4338
4394
|
return l < E ? -1 : l > E ? 1 : 0;
|
|
4339
4395
|
});
|
|
4340
4396
|
});
|
|
@@ -4343,8 +4399,8 @@ class WidgetFramework {
|
|
|
4343
4399
|
class Widget {
|
|
4344
4400
|
//-------------------------------------
|
|
4345
4401
|
constructor(e) {
|
|
4346
|
-
|
|
4347
|
-
|
|
4402
|
+
u(this, "_schoolConf", {});
|
|
4403
|
+
u(this, "_userPref");
|
|
4348
4404
|
this._platformConf = e, this._userPref = null;
|
|
4349
4405
|
}
|
|
4350
4406
|
get platformConf() {
|
|
@@ -4403,7 +4459,7 @@ class WidgetFrameworkFactory {
|
|
|
4403
4459
|
}
|
|
4404
4460
|
export {
|
|
4405
4461
|
ACTION,
|
|
4406
|
-
APP$
|
|
4462
|
+
APP$3 as APP,
|
|
4407
4463
|
BOOLEAN_FILTER,
|
|
4408
4464
|
ConfigurationFrameworkFactory,
|
|
4409
4465
|
DocumentHelper,
|