@edifice.io/client 2.6.7-develop-integration.20261001195124 → 2.6.7-develop-b2school.20261002152737
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/configure/Service.d.ts +10 -1
- package/dist/directory/interface.d.ts +10 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +0 -3
- package/dist/index.js +341 -508
- package/dist/services/OdeServices.d.ts +0 -8
- package/package.json +3 -3
- package/dist/googledrive/Service.d.ts +0 -52
- package/dist/googledrive/interface.d.ts +0 -41
- package/dist/nextcloud/Service.d.ts +0 -42
- package/dist/nextcloud/interface.d.ts +0 -27
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
var P = Object.defineProperty;
|
|
2
2
|
var I = (n, e, t) => e in n ? P(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
|
|
3
|
-
var
|
|
3
|
+
var u = (n, e, t) => I(n, typeof e != "symbol" ? e + "" : e, t);
|
|
4
4
|
import axios from "axios";
|
|
5
5
|
import { MimeTypeUtils } from "@edifice.io/utilities";
|
|
6
6
|
import { UAParser } from "ua-parser-js";
|
|
@@ -100,8 +100,8 @@ const ERROR_CODE = {
|
|
|
100
100
|
// TODO compléter
|
|
101
101
|
}, C = class C {
|
|
102
102
|
constructor(e) {
|
|
103
|
-
|
|
104
|
-
|
|
103
|
+
u(this, "name");
|
|
104
|
+
u(this, "listeners", /* @__PURE__ */ new Set());
|
|
105
105
|
this.name = e;
|
|
106
106
|
}
|
|
107
107
|
/**
|
|
@@ -139,11 +139,11 @@ const ERROR_CODE = {
|
|
|
139
139
|
this.listeners.clear(), C.channels.delete(this.name);
|
|
140
140
|
}
|
|
141
141
|
};
|
|
142
|
-
|
|
142
|
+
u(C, "channels", /* @__PURE__ */ new Map());
|
|
143
143
|
let SimpleChannel = C;
|
|
144
144
|
class Subscription {
|
|
145
145
|
constructor(e, t) {
|
|
146
|
-
|
|
146
|
+
u(this, "revoke");
|
|
147
147
|
this._channel = e, this.revoke = this.setReceiver((s) => t == null ? void 0 : t(s));
|
|
148
148
|
}
|
|
149
149
|
setReceiver(e) {
|
|
@@ -160,7 +160,7 @@ class Subject {
|
|
|
160
160
|
/* We maintain channels for sending messages.
|
|
161
161
|
* Receiving channels are instantiated per subscription.
|
|
162
162
|
*/
|
|
163
|
-
|
|
163
|
+
u(this, "publishChannels", /* @__PURE__ */ new Map());
|
|
164
164
|
}
|
|
165
165
|
getChannelName(e) {
|
|
166
166
|
return "Subject:" + e;
|
|
@@ -195,9 +195,9 @@ const ASYNC_DATA_NAME = {
|
|
|
195
195
|
class Promisified {
|
|
196
196
|
constructor() {
|
|
197
197
|
//-------------------------------------
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
198
|
+
u(this, "_resolution");
|
|
199
|
+
u(this, "_rejection");
|
|
200
|
+
u(this, "_promise", new Promise((e, t) => {
|
|
201
201
|
this._resolution = e, this._rejection = t;
|
|
202
202
|
}));
|
|
203
203
|
}
|
|
@@ -214,8 +214,8 @@ class Promisified {
|
|
|
214
214
|
class NotifyFramework {
|
|
215
215
|
constructor() {
|
|
216
216
|
//-------------------------------------
|
|
217
|
-
|
|
218
|
-
|
|
217
|
+
u(this, "promises", {});
|
|
218
|
+
u(this, "subject", new Subject());
|
|
219
219
|
}
|
|
220
220
|
asyncData(e) {
|
|
221
221
|
return typeof this.promises[e] > "u" && (this.promises[e] = new Promisified()), this.promises[e];
|
|
@@ -246,8 +246,8 @@ const notify = new NotifyFramework(), loadedScripts$1 = {};
|
|
|
246
246
|
class Http {
|
|
247
247
|
constructor(e) {
|
|
248
248
|
// Axios automatically manages the XSRF-TOKEN cookie and the X-XSRF-TOKEN HTTP header.
|
|
249
|
-
|
|
250
|
-
|
|
249
|
+
u(this, "axios");
|
|
250
|
+
u(this, "_latestResponse");
|
|
251
251
|
this.axios = axios.create(e);
|
|
252
252
|
}
|
|
253
253
|
setCdn(e) {
|
|
@@ -327,8 +327,8 @@ class Http {
|
|
|
327
327
|
const r = s ?? "exports", i = this.toAxiosConfig(t);
|
|
328
328
|
return i.headers && (i.headers.Accept = "application/javascript"), this.axios.get(this.toCdnUrl(e), i).then((o) => this.mapAxiosResponse(o, t)).then((o) => {
|
|
329
329
|
try {
|
|
330
|
-
const
|
|
331
|
-
return Function(
|
|
330
|
+
const a = `"use strict";var ${r.split(".")[0]}={};${o};return ${r};`;
|
|
331
|
+
return Function(a)();
|
|
332
332
|
} catch {
|
|
333
333
|
return o;
|
|
334
334
|
}
|
|
@@ -344,7 +344,7 @@ class Http {
|
|
|
344
344
|
}
|
|
345
345
|
class TransportFramework {
|
|
346
346
|
constructor() {
|
|
347
|
-
|
|
347
|
+
u(this, "_http", new Http());
|
|
348
348
|
}
|
|
349
349
|
get http() {
|
|
350
350
|
return this._http;
|
|
@@ -363,11 +363,11 @@ class ConfigurationFrameworkFactory {
|
|
|
363
363
|
const http$2 = transport.http;
|
|
364
364
|
class Session {
|
|
365
365
|
constructor() {
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
366
|
+
u(this, "_me", null);
|
|
367
|
+
u(this, "_currentLanguage", "");
|
|
368
|
+
u(this, "_notLoggedIn", !0);
|
|
369
|
+
u(this, "_description");
|
|
370
|
+
u(this, "_profile");
|
|
371
371
|
}
|
|
372
372
|
get currentLanguage() {
|
|
373
373
|
return this._currentLanguage;
|
|
@@ -412,7 +412,7 @@ class Session {
|
|
|
412
412
|
hasRight(e, t) {
|
|
413
413
|
if (t === "owner")
|
|
414
414
|
return e.owner && e.owner.userId === this._me.userId;
|
|
415
|
-
const s = t.right || t, i = e.shared.filter((
|
|
415
|
+
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;
|
|
416
416
|
return i && o;
|
|
417
417
|
}
|
|
418
418
|
////////////////////////////////////////////////////////// Storage management
|
|
@@ -485,7 +485,7 @@ class Session {
|
|
|
485
485
|
}
|
|
486
486
|
class SessionFramework {
|
|
487
487
|
constructor() {
|
|
488
|
-
|
|
488
|
+
u(this, "session", new Session());
|
|
489
489
|
}
|
|
490
490
|
initialize() {
|
|
491
491
|
return this.session.initialize();
|
|
@@ -509,22 +509,22 @@ class SessionFramework {
|
|
|
509
509
|
const session = new SessionFramework();
|
|
510
510
|
class Theme {
|
|
511
511
|
constructor() {
|
|
512
|
-
|
|
513
|
-
|
|
512
|
+
u(this, "_conf");
|
|
513
|
+
u(this, "_loaded");
|
|
514
514
|
// legacy (readonly)
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
515
|
+
u(this, "skinName", "");
|
|
516
|
+
u(this, "themeName", "");
|
|
517
|
+
u(this, "skin", "raw");
|
|
518
|
+
u(this, "themeUrl", "/assets/themes/raw/default/");
|
|
519
|
+
u(this, "templateOverrides", {});
|
|
520
|
+
u(this, "portalTemplate", "/assets/themes/raw/portal.html");
|
|
521
|
+
u(this, "basePath", "");
|
|
522
|
+
u(this, "logoutCallback", "");
|
|
523
|
+
u(this, "skins", []);
|
|
524
|
+
u(this, "is1D", !1);
|
|
525
|
+
u(this, "is2D", !1);
|
|
526
|
+
u(this, "_onSkinReady", notify.onSkinReady());
|
|
527
|
+
u(this, "_onOverrideReady", notify.onOverridesReady());
|
|
528
528
|
}
|
|
529
529
|
initialize(e) {
|
|
530
530
|
return notify.onSessionReady().promise.then(() => this.load(e));
|
|
@@ -858,9 +858,9 @@ class Idiom {
|
|
|
858
858
|
const i = new Promisified();
|
|
859
859
|
promises$1[t] = i.promise;
|
|
860
860
|
const o = {};
|
|
861
|
-
e && (o["Accept-Language"] = e), transport.http.get(t, { headers: o }).then((
|
|
862
|
-
Object.assign(bundle$1,
|
|
863
|
-
}).catch((
|
|
861
|
+
e && (o["Accept-Language"] = e), transport.http.get(t, { headers: o }).then((a) => {
|
|
862
|
+
Object.assign(bundle$1, a), typeof s == "function" && s(), i.resolve();
|
|
863
|
+
}).catch((a) => {
|
|
864
864
|
typeof s == "function" && s(), i.reject();
|
|
865
865
|
});
|
|
866
866
|
}
|
|
@@ -896,7 +896,7 @@ class Idiom {
|
|
|
896
896
|
class UserPreferences {
|
|
897
897
|
constructor() {
|
|
898
898
|
//-------------------------------------
|
|
899
|
-
|
|
899
|
+
u(this, "data", {});
|
|
900
900
|
}
|
|
901
901
|
get(e) {
|
|
902
902
|
return this.data[e];
|
|
@@ -923,10 +923,10 @@ class UserPreferences {
|
|
|
923
923
|
class User {
|
|
924
924
|
constructor() {
|
|
925
925
|
//-------------------------------------
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
926
|
+
u(this, "_me", null);
|
|
927
|
+
u(this, "_keepOpenOnLogout", !1);
|
|
928
|
+
u(this, "_preferences", new UserPreferences());
|
|
929
|
+
u(this, "_bookmarkedApps", []);
|
|
930
930
|
}
|
|
931
931
|
get keepOpenOnLogout() {
|
|
932
932
|
return this._keepOpenOnLogout;
|
|
@@ -970,7 +970,7 @@ class User {
|
|
|
970
970
|
});
|
|
971
971
|
let r = !0;
|
|
972
972
|
const i = [];
|
|
973
|
-
s.bookmarks.forEach((o,
|
|
973
|
+
s.bookmarks.forEach((o, a) => {
|
|
974
974
|
const c = this._me.apps.find((l) => l.name === o);
|
|
975
975
|
if (c) {
|
|
976
976
|
const l = Object.assign({}, c);
|
|
@@ -978,8 +978,8 @@ class User {
|
|
|
978
978
|
} else
|
|
979
979
|
i.push(o), r = !1;
|
|
980
980
|
}), i.forEach((o) => {
|
|
981
|
-
const
|
|
982
|
-
|
|
981
|
+
const a = s.bookmarks.indexOf(o);
|
|
982
|
+
a !== -1 && s.bookmarks.splice(a, 1);
|
|
983
983
|
}), r || transport.http.putJson("/userbook/preference/apps", s);
|
|
984
984
|
});
|
|
985
985
|
}
|
|
@@ -1000,9 +1000,9 @@ const http$1 = transport == null ? void 0 : transport.http;
|
|
|
1000
1000
|
class AppConf {
|
|
1001
1001
|
constructor() {
|
|
1002
1002
|
//-------------------------------------
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1003
|
+
u(this, "_publicConf", {});
|
|
1004
|
+
u(this, "_currentApp");
|
|
1005
|
+
u(this, "_appConf", {});
|
|
1006
1006
|
}
|
|
1007
1007
|
/**
|
|
1008
1008
|
* Get the currently initialized App.
|
|
@@ -1040,8 +1040,8 @@ class AppConf {
|
|
|
1040
1040
|
class Analytics {
|
|
1041
1041
|
constructor() {
|
|
1042
1042
|
//-------------------------------------
|
|
1043
|
-
|
|
1044
|
-
|
|
1043
|
+
u(this, "_status", "void");
|
|
1044
|
+
u(this, "_params");
|
|
1045
1045
|
}
|
|
1046
1046
|
get status() {
|
|
1047
1047
|
return this._status;
|
|
@@ -1082,9 +1082,9 @@ class Analytics {
|
|
|
1082
1082
|
const t = await notify.onSessionReady().promise, s = session.session.description;
|
|
1083
1083
|
let r;
|
|
1084
1084
|
for (const l of t.structures) {
|
|
1085
|
-
const
|
|
1086
|
-
if (
|
|
1087
|
-
r =
|
|
1085
|
+
const h = e.structureMap[l];
|
|
1086
|
+
if (h && h.collectiviteId && h.UAI) {
|
|
1087
|
+
r = h;
|
|
1088
1088
|
break;
|
|
1089
1089
|
}
|
|
1090
1090
|
}
|
|
@@ -1095,11 +1095,11 @@ class Analytics {
|
|
|
1095
1095
|
if (!i) return;
|
|
1096
1096
|
const o = i.xiti;
|
|
1097
1097
|
if (!o || !o.LIBELLE_SERVICE || !r.UAI) return;
|
|
1098
|
-
function
|
|
1099
|
-
let
|
|
1100
|
-
for (let
|
|
1101
|
-
|
|
1102
|
-
return
|
|
1098
|
+
function a(l) {
|
|
1099
|
+
let h = "";
|
|
1100
|
+
for (let E = 0; E < l.length; E++)
|
|
1101
|
+
h += l.charCodeAt(E);
|
|
1102
|
+
return h;
|
|
1103
1103
|
}
|
|
1104
1104
|
const c = {
|
|
1105
1105
|
Student: "ELEVE",
|
|
@@ -1118,7 +1118,7 @@ class Analytics {
|
|
|
1118
1118
|
PROJET: r.projetId ? r.projetId : e.ID_PROJET,
|
|
1119
1119
|
EXPLOITANT: e.ID_EXPLOITANT,
|
|
1120
1120
|
PLATFORME: r.plateformeId ? r.plateformeId : e.ID_PLATEFORME,
|
|
1121
|
-
ID_PERSO:
|
|
1121
|
+
ID_PERSO: a(t.userId),
|
|
1122
1122
|
PROFILE: s.profiles && s.profiles.length > 0 ? c[s.profiles[0]] ?? "" : ""
|
|
1123
1123
|
};
|
|
1124
1124
|
}
|
|
@@ -1146,12 +1146,12 @@ function detectDevice() {
|
|
|
1146
1146
|
if (typeof window > "u")
|
|
1147
1147
|
return { osName: "", osVersion: "", deviceType: "", deviceName: "" };
|
|
1148
1148
|
const n = UAParser(), e = isPad(), t = n.device.vendor || "", s = n.device.model || "", r = t && s ? `${t} ${s}` : s || t || "Unknown";
|
|
1149
|
-
let i = n.os.name || "Unknown", o = n.device.type || (e ? "tablet" : "desktop"),
|
|
1150
|
-
return e && i.toLowerCase() == "macos" && (i = "iPadOS", o = "tablet",
|
|
1149
|
+
let i = n.os.name || "Unknown", o = n.device.type || (e ? "tablet" : "desktop"), a = r;
|
|
1150
|
+
return e && i.toLowerCase() == "macos" && (i = "iPadOS", o = "tablet", a = "iPad"), {
|
|
1151
1151
|
osName: i,
|
|
1152
1152
|
osVersion: n.os.version || "Unknown",
|
|
1153
1153
|
deviceType: o,
|
|
1154
|
-
deviceName:
|
|
1154
|
+
deviceName: a
|
|
1155
1155
|
};
|
|
1156
1156
|
}
|
|
1157
1157
|
function readDeviceCookies() {
|
|
@@ -1177,7 +1177,7 @@ function setDeviceCookies() {
|
|
|
1177
1177
|
class ConfigurationFramework {
|
|
1178
1178
|
constructor() {
|
|
1179
1179
|
//-------------------------------------
|
|
1180
|
-
|
|
1180
|
+
u(this, "Platform", {
|
|
1181
1181
|
deploymentTag: "",
|
|
1182
1182
|
cdnDomain: "",
|
|
1183
1183
|
apps: new AppConf(),
|
|
@@ -1186,16 +1186,16 @@ class ConfigurationFramework {
|
|
|
1186
1186
|
idiom: new Idiom(),
|
|
1187
1187
|
listLanguages: () => transport.http.get("/languages")
|
|
1188
1188
|
});
|
|
1189
|
-
|
|
1189
|
+
u(this, "School", {
|
|
1190
1190
|
//apps; -> pinnedApps;
|
|
1191
1191
|
});
|
|
1192
|
-
|
|
1192
|
+
u(this, "User", new User());
|
|
1193
1193
|
setDeviceCookies();
|
|
1194
1194
|
}
|
|
1195
1195
|
async initialize(e, t) {
|
|
1196
1196
|
if (!e) {
|
|
1197
|
-
const r = (l) => (l < 10 ? "0" : "") + l.toFixed(0), i = /* @__PURE__ */ new Date(), o = i.getFullYear(),
|
|
1198
|
-
e = `${o}${r(
|
|
1197
|
+
const r = (l) => (l < 10 ? "0" : "") + l.toFixed(0), i = /* @__PURE__ */ new Date(), o = i.getFullYear(), a = i.getMonth() + 1, c = i.getDate();
|
|
1198
|
+
e = `${o}${r(a)}${r(c)}`;
|
|
1199
1199
|
}
|
|
1200
1200
|
const s = e;
|
|
1201
1201
|
this.Platform.deploymentTag = e, typeof t == "string" && t.length > 0 && (this.Platform.cdnDomain = t), transport.http.setCdn(this.Platform.cdnDomain), await Promise.all([
|
|
@@ -1237,8 +1237,8 @@ var _;
|
|
|
1237
1237
|
const me = (_ = session == null ? void 0 : session.session) == null ? void 0 : _.user;
|
|
1238
1238
|
class Notification {
|
|
1239
1239
|
constructor(e) {
|
|
1240
|
-
|
|
1241
|
-
|
|
1240
|
+
u(this, "_id");
|
|
1241
|
+
u(this, "model");
|
|
1242
1242
|
e.reported = e.reporters && e.reporters.length > 0, this._id = e._id, this.model = e;
|
|
1243
1243
|
}
|
|
1244
1244
|
isUnread() {
|
|
@@ -1258,14 +1258,14 @@ class Notification {
|
|
|
1258
1258
|
class TimelineApp {
|
|
1259
1259
|
constructor() {
|
|
1260
1260
|
//-------------------------------------
|
|
1261
|
-
|
|
1262
|
-
|
|
1261
|
+
u(this, "_notifications", []);
|
|
1262
|
+
u(this, "_notificationTypes", []);
|
|
1263
1263
|
// ex: ["BLOG"]
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1264
|
+
u(this, "_flashMessages", []);
|
|
1265
|
+
u(this, "_pageNumber", 0);
|
|
1266
|
+
u(this, "_lastPage", !1);
|
|
1267
|
+
u(this, "_loading", !1);
|
|
1268
|
+
u(this, "showMine", !1);
|
|
1269
1269
|
}
|
|
1270
1270
|
get notifications() {
|
|
1271
1271
|
return this._notifications;
|
|
@@ -1324,7 +1324,7 @@ class TimelineApp {
|
|
|
1324
1324
|
if (r.number && r.results) {
|
|
1325
1325
|
const i = r.results.filter(
|
|
1326
1326
|
(o) => this._notifications.findIndex(
|
|
1327
|
-
(
|
|
1327
|
+
(a) => a._id === o._id
|
|
1328
1328
|
) === -1
|
|
1329
1329
|
).map((o) => new Notification(o));
|
|
1330
1330
|
this._notifications = this._notifications.concat(i), this._pageNumber++;
|
|
@@ -1355,97 +1355,7 @@ const ReactionTypes = [
|
|
|
1355
1355
|
"REACTION_2",
|
|
1356
1356
|
"REACTION_3",
|
|
1357
1357
|
"REACTION_4"
|
|
1358
|
-
]
|
|
1359
|
-
function toGoogleDriveDocument(n) {
|
|
1360
|
-
return {
|
|
1361
|
-
id: n.id,
|
|
1362
|
-
name: n.name,
|
|
1363
|
-
ownerDisplayName: n.ownerDisplayName,
|
|
1364
|
-
contentType: n.mimeType,
|
|
1365
|
-
size: n.size,
|
|
1366
|
-
isFolder: n.mimeType === GOOGLE_DRIVE_FOLDER_MIME_TYPE,
|
|
1367
|
-
lastModified: n.modifiedTime,
|
|
1368
|
-
shared: n.shared
|
|
1369
|
-
};
|
|
1370
|
-
}
|
|
1371
|
-
class GoogleDriveCopyError extends Error {
|
|
1372
|
-
constructor(e, t, s) {
|
|
1373
|
-
super(e), this.copied = t, this.failures = s, this.name = "GoogleDriveCopyError";
|
|
1374
|
-
}
|
|
1375
|
-
}
|
|
1376
|
-
class GoogleDriveService {
|
|
1377
|
-
constructor(e) {
|
|
1378
|
-
this.context = e;
|
|
1379
|
-
}
|
|
1380
|
-
get http() {
|
|
1381
|
-
return this.context.http();
|
|
1382
|
-
}
|
|
1383
|
-
/**
|
|
1384
|
-
* List a user's Google Drive documents and folders inside a given folder.
|
|
1385
|
-
*
|
|
1386
|
-
* Google Drive addresses its entries by opaque id, not by path: `parentId` is
|
|
1387
|
-
* the id of the folder to list. The query param is nonetheless named `path`,
|
|
1388
|
-
* as the backend kept the name it uses for Nextcloud.
|
|
1389
|
-
*
|
|
1390
|
-
* @param userId - the id of the user whose files are listed.
|
|
1391
|
-
* @param parentId - id of the folder to list; the Drive root when omitted.
|
|
1392
|
-
*/
|
|
1393
|
-
async listDocuments(e, t) {
|
|
1394
|
-
return (await this.http.get(
|
|
1395
|
-
`/googledrive/files/user/${e}`,
|
|
1396
|
-
{ queryParams: t ? { path: t } : void 0 }
|
|
1397
|
-
)).data.map(toGoogleDriveDocument);
|
|
1398
|
-
}
|
|
1399
|
-
/**
|
|
1400
|
-
* Copy Google Drive documents into the entcore workspace.
|
|
1401
|
-
*
|
|
1402
|
-
* @param userId - the id of the user whose files are copied.
|
|
1403
|
-
* @param ids - Drive ids of the documents to copy.
|
|
1404
|
-
* @param parentId - the workspace folder to copy into; user's root when omitted.
|
|
1405
|
-
* @param params.application - the application the documents are added from.
|
|
1406
|
-
* @param params.visibility - "protected" files the documents under the
|
|
1407
|
-
* documents added from applications, the way an upload does.
|
|
1408
|
-
* @throws GoogleDriveCopyError when the backend reports at least one failure.
|
|
1409
|
-
*/
|
|
1410
|
-
async copyDocumentToWorkspace(e, t, s, r) {
|
|
1411
|
-
const i = t.map((d) => `id=${encodeURIComponent(d)}`).join("&"), u = (await this.http.put(
|
|
1412
|
-
`/googledrive/files/user/${e}/copy/workspace?${i}`,
|
|
1413
|
-
void 0,
|
|
1414
|
-
{
|
|
1415
|
-
queryParams: {
|
|
1416
|
-
...s ? { parentId: s } : {},
|
|
1417
|
-
...r != null && r.application ? { application: r.application } : {},
|
|
1418
|
-
...(r == null ? void 0 : r.visibility) === "protected" ? { protected: !0 } : {}
|
|
1419
|
-
}
|
|
1420
|
-
}
|
|
1421
|
-
)).data ?? [], c = u.map((d) => d.workspace).filter((d) => !!(d != null && d._id)), l = new Set(u.map((d) => d.id)), p = [
|
|
1422
|
-
...u.filter((d) => {
|
|
1423
|
-
var h;
|
|
1424
|
-
return d.status === "error" || !((h = d.workspace) != null && h._id);
|
|
1425
|
-
}).map(({ id: d, message: h }) => ({ id: d, message: h })),
|
|
1426
|
-
...t.filter((d) => !l.has(d)).map((d) => ({ id: d, message: void 0 }))
|
|
1427
|
-
];
|
|
1428
|
-
if (p.length > 0)
|
|
1429
|
-
throw new GoogleDriveCopyError(
|
|
1430
|
-
`Failed to copy ${p.length} of ${t.length} Google Drive document(s) to the workspace`,
|
|
1431
|
-
c,
|
|
1432
|
-
p
|
|
1433
|
-
);
|
|
1434
|
-
return c;
|
|
1435
|
-
}
|
|
1436
|
-
/**
|
|
1437
|
-
* Build the URL to download/preview a Google Drive document.
|
|
1438
|
-
* There is no dedicated thumbnail endpoint on the backend, so this is also
|
|
1439
|
-
* used as an image preview source for image documents.
|
|
1440
|
-
* @param userId - the id of the user who owns the file.
|
|
1441
|
-
* @param doc - the document to build the URL for.
|
|
1442
|
-
*/
|
|
1443
|
-
getFileUrl(e, t) {
|
|
1444
|
-
return `/googledrive/files/user/${e}/file/${encodeURIComponent(
|
|
1445
|
-
t.id
|
|
1446
|
-
)}/download?isFolder=${t.isFolder}`;
|
|
1447
|
-
}
|
|
1448
|
-
}
|
|
1358
|
+
];
|
|
1449
1359
|
class NotifyFrameworkFactory {
|
|
1450
1360
|
static instance() {
|
|
1451
1361
|
return notify;
|
|
@@ -1504,7 +1414,7 @@ const m = class m {
|
|
|
1504
1414
|
//
|
|
1505
1415
|
// PROTECTED HELPERS
|
|
1506
1416
|
//
|
|
1507
|
-
|
|
1417
|
+
u(this, "checkHttpResponse", (e) => {
|
|
1508
1418
|
if (this.http.latestResponse.status >= 300)
|
|
1509
1419
|
throw this.http.latestResponse.statusText;
|
|
1510
1420
|
return e;
|
|
@@ -1722,22 +1632,22 @@ const m = class m {
|
|
|
1722
1632
|
//
|
|
1723
1633
|
// STATIC REGISTRY
|
|
1724
1634
|
//
|
|
1725
|
-
|
|
1726
|
-
|
|
1635
|
+
u(m, "registry", new ServiceRegistry()), // Expose some useful functions
|
|
1636
|
+
u(m, "register", m.registry.register.bind(m.registry)), u(m, "findService", m.registry.findService.bind(m.registry)), u(m, "findMainService", m.registry.findMainService.bind(m.registry)), u(m, "isRegistered", m.registry.isRegistered.bind(m.registry));
|
|
1727
1637
|
let ResourceService = m;
|
|
1728
1638
|
const APP$3 = "collaborativeeditor", RESOURCE$3 = "collaborativeeditor";
|
|
1729
1639
|
class CollaborativeEditorResourceService extends ResourceService {
|
|
1730
1640
|
async create(e) {
|
|
1731
|
-
const { name: t, description: s, thumbnail: r, folder: i } = e, o = r ? await this.getThumbnailPath(r) : "",
|
|
1641
|
+
const { name: t, description: s, thumbnail: r, folder: i } = e, o = r ? await this.getThumbnailPath(r) : "", a = await this.http.post("/collaborativeeditor", {
|
|
1732
1642
|
name: t,
|
|
1733
1643
|
description: s,
|
|
1734
1644
|
thumbnail: o,
|
|
1735
1645
|
folder: i
|
|
1736
1646
|
});
|
|
1737
|
-
return this.checkHttpResponse(
|
|
1647
|
+
return this.checkHttpResponse(a), a;
|
|
1738
1648
|
}
|
|
1739
1649
|
async update(e) {
|
|
1740
|
-
const { name: t, description: s, thumbnail: r, entId: i } = e, o = await this.getThumbnailPath(r),
|
|
1650
|
+
const { name: t, description: s, thumbnail: r, entId: i } = e, o = await this.getThumbnailPath(r), a = await this.http.put(
|
|
1741
1651
|
`/collaborativeeditor/${i}`,
|
|
1742
1652
|
{
|
|
1743
1653
|
name: t,
|
|
@@ -1745,7 +1655,7 @@ class CollaborativeEditorResourceService extends ResourceService {
|
|
|
1745
1655
|
thumbnail: o
|
|
1746
1656
|
}
|
|
1747
1657
|
);
|
|
1748
|
-
return this.checkHttpResponse(
|
|
1658
|
+
return this.checkHttpResponse(a), { thumbnail: o, entId: i };
|
|
1749
1659
|
}
|
|
1750
1660
|
getResourceType() {
|
|
1751
1661
|
return RESOURCE$3;
|
|
@@ -2000,9 +1910,9 @@ class AnalyticsService {
|
|
|
2000
1910
|
let r;
|
|
2001
1911
|
if (!(t != null && t.structures)) return;
|
|
2002
1912
|
for (const l of t.structures) {
|
|
2003
|
-
const
|
|
2004
|
-
if (
|
|
2005
|
-
r =
|
|
1913
|
+
const h = n.structureMap[l];
|
|
1914
|
+
if (h && h.collectiviteId && h.UAI) {
|
|
1915
|
+
r = h;
|
|
2006
1916
|
break;
|
|
2007
1917
|
}
|
|
2008
1918
|
}
|
|
@@ -2011,11 +1921,11 @@ class AnalyticsService {
|
|
|
2011
1921
|
if (!i) return;
|
|
2012
1922
|
const o = i.xiti;
|
|
2013
1923
|
if (!o || !o.LIBELLE_SERVICE || !r.UAI) return;
|
|
2014
|
-
function
|
|
2015
|
-
let
|
|
2016
|
-
for (let
|
|
2017
|
-
|
|
2018
|
-
return
|
|
1924
|
+
function a(l) {
|
|
1925
|
+
let h = "";
|
|
1926
|
+
for (let E = 0; E < l.length; E++)
|
|
1927
|
+
h += l.charCodeAt(E);
|
|
1928
|
+
return h;
|
|
2019
1929
|
}
|
|
2020
1930
|
const c = {
|
|
2021
1931
|
Student: "ELEVE",
|
|
@@ -2034,7 +1944,7 @@ class AnalyticsService {
|
|
|
2034
1944
|
PROJET: r.projetId ? r.projetId : n.ID_PROJET,
|
|
2035
1945
|
EXPLOITANT: n.ID_EXPLOITANT,
|
|
2036
1946
|
PLATFORME: r.plateformeId ? r.plateformeId : n.ID_PLATEFORME,
|
|
2037
|
-
ID_PERSO:
|
|
1947
|
+
ID_PERSO: a(t.userId),
|
|
2038
1948
|
PROFILE: s && s.length > 0 ? c[s[0]] ?? "" : ""
|
|
2039
1949
|
};
|
|
2040
1950
|
}
|
|
@@ -2216,15 +2126,31 @@ class ConfService {
|
|
|
2216
2126
|
}
|
|
2217
2127
|
getCdnUrl() {
|
|
2218
2128
|
}
|
|
2219
|
-
|
|
2220
|
-
|
|
2129
|
+
/** New-gen API to get all of the user's preferences at once. */
|
|
2130
|
+
async getUserPreferences() {
|
|
2131
|
+
const e = await this.http.get("/userbook/api/preferences");
|
|
2132
|
+
if (this.http.isResponseError() || typeof e == "string")
|
|
2133
|
+
throw ERROR_CODE.NOT_LOGGED_IN;
|
|
2134
|
+
return e;
|
|
2221
2135
|
}
|
|
2136
|
+
/**
|
|
2137
|
+
* New-gen API to set all of the user's preferences at once.
|
|
2138
|
+
* @return the latest exhaustive preferences, updated.
|
|
2139
|
+
*/
|
|
2140
|
+
async saveUserPreferences(e) {
|
|
2141
|
+
return this.http.putJson("/userbook/api/preferences", e);
|
|
2142
|
+
}
|
|
2143
|
+
/** Legacy API to get the user's preferences for a given key. */
|
|
2222
2144
|
async getPreference(e) {
|
|
2223
2145
|
const t = await this.http.get(
|
|
2224
2146
|
`/userbook/preference/${e}`
|
|
2225
2147
|
);
|
|
2226
2148
|
return this.http.isResponseError() || typeof t == "string" ? {} : JSON.parse(t.preference);
|
|
2227
2149
|
}
|
|
2150
|
+
/** Legacy API to set the user's preferences for a given key. */
|
|
2151
|
+
async savePreference(e, t) {
|
|
2152
|
+
this.http.putJson(`/userbook/preference/${e}`, t);
|
|
2153
|
+
}
|
|
2228
2154
|
async getThemeConf(e) {
|
|
2229
2155
|
return await this.http.getScript(
|
|
2230
2156
|
"/assets/theme-conf.js",
|
|
@@ -2253,25 +2179,25 @@ class ConfService {
|
|
|
2253
2179
|
conf: t,
|
|
2254
2180
|
publicTheme: s
|
|
2255
2181
|
}) {
|
|
2256
|
-
var
|
|
2257
|
-
const r = await this.http.get("/theme"), i = (
|
|
2258
|
-
(
|
|
2182
|
+
var E;
|
|
2183
|
+
const r = await this.http.get("/theme"), i = (E = t == null ? void 0 : t.overriding) == null ? void 0 : E.find(
|
|
2184
|
+
(p) => (
|
|
2259
2185
|
// Fix #WB2-2660:
|
|
2260
2186
|
// If Public access => get the neo theme
|
|
2261
2187
|
// Else get the theme from the user preference
|
|
2262
|
-
s ?
|
|
2188
|
+
s ? p.parent === "theme-open-ent" && p.bootstrapVersion === "ode-bootstrap-neo" : p.child === (r == null ? void 0 : r.themeName)
|
|
2263
2189
|
)
|
|
2264
|
-
), o = s ? "default" : (r == null ? void 0 : r.skinName) || (i == null ? void 0 : i.skins[0]),
|
|
2190
|
+
), o = s ? "default" : (r == null ? void 0 : r.skinName) || (i == null ? void 0 : i.skins[0]), a = (r == null ? void 0 : r.skin) || `/assets/themes/${i == null ? void 0 : i.child}/skins/${o}/`, c = i == null ? void 0 : i.skins, l = i == null ? void 0 : i.bootstrapVersion.split("-").slice(-1)[0], h = (i == null ? void 0 : i.parent) === "panda";
|
|
2265
2191
|
return {
|
|
2266
|
-
basePath: `${this.cdnDomain}${
|
|
2192
|
+
basePath: `${this.cdnDomain}${a}../../`,
|
|
2267
2193
|
bootstrapVersion: l,
|
|
2268
|
-
is1d:
|
|
2194
|
+
is1d: h,
|
|
2269
2195
|
logoutCallback: (r == null ? void 0 : r.logoutCallback) || "",
|
|
2270
2196
|
skin: i == null ? void 0 : i.child,
|
|
2271
2197
|
skinName: o,
|
|
2272
2198
|
skins: c,
|
|
2273
2199
|
themeName: i == null ? void 0 : i.child,
|
|
2274
|
-
themeUrl:
|
|
2200
|
+
themeUrl: a,
|
|
2275
2201
|
npmTheme: (i == null ? void 0 : i.npmTheme) ?? void 0,
|
|
2276
2202
|
uiOverrides: i == null ? void 0 : i.uiOverrides
|
|
2277
2203
|
};
|
|
@@ -2288,7 +2214,7 @@ class ConfService {
|
|
|
2288
2214
|
const SEND_ALL = "*";
|
|
2289
2215
|
class WebBroker {
|
|
2290
2216
|
constructor(e) {
|
|
2291
|
-
|
|
2217
|
+
u(this, "subscription");
|
|
2292
2218
|
this.odeServices = e;
|
|
2293
2219
|
}
|
|
2294
2220
|
get http() {
|
|
@@ -2320,10 +2246,10 @@ class WebBroker {
|
|
|
2320
2246
|
}
|
|
2321
2247
|
class DataService {
|
|
2322
2248
|
constructor(e) {
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
|
|
2249
|
+
u(this, "_webBroker");
|
|
2250
|
+
u(this, "app");
|
|
2251
|
+
u(this, "user");
|
|
2252
|
+
u(this, "profile");
|
|
2327
2253
|
this.odeServices = e;
|
|
2328
2254
|
}
|
|
2329
2255
|
get conf() {
|
|
@@ -2357,7 +2283,7 @@ class DataService {
|
|
|
2357
2283
|
addUserInfos(e) {
|
|
2358
2284
|
return this.user && (e.userId = this.user.userId, e.structure = this.user.structureNames[0]), this.profile && (e.profil = this.profile[0]), e;
|
|
2359
2285
|
}
|
|
2360
|
-
trackVideoSave(e, t, s, r, i, o,
|
|
2286
|
+
trackVideoSave(e, t, s, r, i, o, a) {
|
|
2361
2287
|
const c = this.addUserInfos({
|
|
2362
2288
|
"event-type": "VIDEO_SAVE",
|
|
2363
2289
|
module: this.app || "video",
|
|
@@ -2368,7 +2294,7 @@ class DataService {
|
|
|
2368
2294
|
source: r ? "CAPTURED" : "UPLOADED",
|
|
2369
2295
|
url: i
|
|
2370
2296
|
});
|
|
2371
|
-
|
|
2297
|
+
a && (c.device_type = a), this.trackWebEvent(c);
|
|
2372
2298
|
}
|
|
2373
2299
|
trackVideoRead(e, t, s, r, i) {
|
|
2374
2300
|
const o = this.addUserInfos({
|
|
@@ -2436,14 +2362,14 @@ class DirectoryService {
|
|
|
2436
2362
|
id: s,
|
|
2437
2363
|
displayName: r,
|
|
2438
2364
|
notVisibleCount: o,
|
|
2439
|
-
groups: t.map(({ name:
|
|
2365
|
+
groups: t.map(({ name: a, id: c, nbUsers: l }) => ({
|
|
2440
2366
|
nbUsers: l,
|
|
2441
|
-
displayName:
|
|
2367
|
+
displayName: a,
|
|
2442
2368
|
id: c
|
|
2443
2369
|
})),
|
|
2444
|
-
users: i.map(({ displayName:
|
|
2370
|
+
users: i.map(({ displayName: a, id: c, profile: l }) => ({
|
|
2445
2371
|
profile: l,
|
|
2446
|
-
displayName:
|
|
2372
|
+
displayName: a,
|
|
2447
2373
|
// these info are missing from api
|
|
2448
2374
|
firstName: "",
|
|
2449
2375
|
lastName: "",
|
|
@@ -2458,9 +2384,9 @@ class DirectoryService {
|
|
|
2458
2384
|
users: r
|
|
2459
2385
|
}) {
|
|
2460
2386
|
this.cache.clearCache("/directory/sharebookmark/all");
|
|
2461
|
-
const i = r.map((
|
|
2462
|
-
if (typeof
|
|
2463
|
-
const { displayName: y, groups:
|
|
2387
|
+
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) => {
|
|
2388
|
+
if (typeof p == "string") {
|
|
2389
|
+
const { displayName: y, groups: d, id: g, notVisibleCount: A, users: f } = await this.getBookMarkById(p), w = f.map((D) => D.id), F = d.map((D) => D.id);
|
|
2464
2390
|
return {
|
|
2465
2391
|
displayName: y,
|
|
2466
2392
|
id: g,
|
|
@@ -2468,19 +2394,19 @@ class DirectoryService {
|
|
|
2468
2394
|
members: [...F, ...w]
|
|
2469
2395
|
};
|
|
2470
2396
|
} else
|
|
2471
|
-
return Promise.resolve(
|
|
2472
|
-
}), l = (await Promise.all(
|
|
2397
|
+
return Promise.resolve(p);
|
|
2398
|
+
}), l = (await Promise.all(a)).map((p) => p.members).reduce((p, y) => [...p, ...y], []), h = {
|
|
2473
2399
|
name: e,
|
|
2474
2400
|
members: [...i, ...o, ...l]
|
|
2475
|
-
}, { id:
|
|
2401
|
+
}, { id: E } = await this.http.postJson(
|
|
2476
2402
|
"/directory/sharebookmark",
|
|
2477
|
-
|
|
2403
|
+
h
|
|
2478
2404
|
);
|
|
2479
2405
|
return {
|
|
2480
|
-
id:
|
|
2406
|
+
id: E,
|
|
2481
2407
|
displayName: e,
|
|
2482
2408
|
notVisibleCount: 0,
|
|
2483
|
-
members:
|
|
2409
|
+
members: h.members
|
|
2484
2410
|
};
|
|
2485
2411
|
}
|
|
2486
2412
|
}
|
|
@@ -2519,10 +2445,10 @@ class EmbedderService {
|
|
|
2519
2445
|
urlIsFromPattern(e, t) {
|
|
2520
2446
|
const s = new RegExp("[^{}]+(?=(?:[^{}]*{[^}]*})*[^}]*$)", "g"), r = new RegExp("{[^}]*}", "g");
|
|
2521
2447
|
let i = !0;
|
|
2522
|
-
const o = t.match(s) || [],
|
|
2523
|
-
return (t.match(r) || []).forEach((l,
|
|
2524
|
-
l.includes("ignore") ||
|
|
2525
|
-
}),
|
|
2448
|
+
const o = t.match(s) || [], a = [];
|
|
2449
|
+
return (t.match(r) || []).forEach((l, h) => {
|
|
2450
|
+
l.includes("ignore") || a.push(o[h]);
|
|
2451
|
+
}), a.forEach((l) => {
|
|
2526
2452
|
if (!e.includes(l)) {
|
|
2527
2453
|
i = !1;
|
|
2528
2454
|
return;
|
|
@@ -2553,17 +2479,17 @@ class EmbedderService {
|
|
|
2553
2479
|
if (this.urlIsFromPattern(t, s)) {
|
|
2554
2480
|
const r = new RegExp("{[a-zA-Z0-9_.]+}", "g"), i = s.match(r) || [];
|
|
2555
2481
|
let o = e.embed;
|
|
2556
|
-
for (const
|
|
2557
|
-
let c = s.split(
|
|
2482
|
+
for (const a of i) {
|
|
2483
|
+
let c = s.split(a)[0];
|
|
2558
2484
|
const l = c.split("}");
|
|
2559
2485
|
l.length > 1 && (c = l[l.length - 1]);
|
|
2560
|
-
let
|
|
2561
|
-
if (!
|
|
2486
|
+
let h = t.split(c)[1];
|
|
2487
|
+
if (!h)
|
|
2562
2488
|
continue;
|
|
2563
|
-
const
|
|
2564
|
-
|
|
2565
|
-
const
|
|
2566
|
-
o = o.replace(
|
|
2489
|
+
const E = s.split(a)[1].split("{")[0];
|
|
2490
|
+
E && (h = h.split(E)[0]);
|
|
2491
|
+
const p = new RegExp("\\" + a.replace(/}/, "\\}"), "g");
|
|
2492
|
+
o = o.replace(p, h);
|
|
2567
2493
|
}
|
|
2568
2494
|
return o;
|
|
2569
2495
|
}
|
|
@@ -2817,9 +2743,9 @@ class IdiomService {
|
|
|
2817
2743
|
const i = new Promisified();
|
|
2818
2744
|
promises[t] = i.promise;
|
|
2819
2745
|
const o = {};
|
|
2820
|
-
e && (o["Accept-Language"] = e), this.http.get(t, { headers: o }).then((
|
|
2821
|
-
Object.assign(bundle,
|
|
2822
|
-
}).catch((
|
|
2746
|
+
e && (o["Accept-Language"] = e), this.http.get(t, { headers: o }).then((a) => {
|
|
2747
|
+
Object.assign(bundle, a), typeof s == "function" && s(), i.resolve();
|
|
2748
|
+
}).catch((a) => {
|
|
2823
2749
|
typeof s == "function" && s(), i.reject();
|
|
2824
2750
|
});
|
|
2825
2751
|
}
|
|
@@ -2852,89 +2778,6 @@ class IdiomService {
|
|
|
2852
2778
|
return e;
|
|
2853
2779
|
}
|
|
2854
2780
|
}
|
|
2855
|
-
function toRelativePath(n, e) {
|
|
2856
|
-
const t = `/remote.php/dav/files/${e}`, s = n.startsWith(t) ? n.slice(t.length) : n;
|
|
2857
|
-
return decodeURIComponent(s || "/");
|
|
2858
|
-
}
|
|
2859
|
-
function toNextcloudDocument(n, e) {
|
|
2860
|
-
return {
|
|
2861
|
-
path: toRelativePath(n.path, e),
|
|
2862
|
-
name: decodeURIComponent(n.displayname),
|
|
2863
|
-
ownerDisplayName: n.ownerDisplayName,
|
|
2864
|
-
contentType: n.contentType,
|
|
2865
|
-
size: n.size,
|
|
2866
|
-
favorite: n.favorite,
|
|
2867
|
-
etag: n.etag,
|
|
2868
|
-
fileId: n.fileId,
|
|
2869
|
-
isFolder: n.isFolder,
|
|
2870
|
-
lastModified: n.lastModified
|
|
2871
|
-
};
|
|
2872
|
-
}
|
|
2873
|
-
class NextcloudService {
|
|
2874
|
-
constructor(e) {
|
|
2875
|
-
this.context = e;
|
|
2876
|
-
}
|
|
2877
|
-
get http() {
|
|
2878
|
-
return this.context.http();
|
|
2879
|
-
}
|
|
2880
|
-
/**
|
|
2881
|
-
* List a user's Nextcloud documents and folders at a given path.
|
|
2882
|
-
* @param userId - the id of the user whose files are listed.
|
|
2883
|
-
* @param path - path to list, relative to the user's Nextcloud root; root when omitted.
|
|
2884
|
-
*/
|
|
2885
|
-
async listDocuments(e, t) {
|
|
2886
|
-
return (await this.http.get(
|
|
2887
|
-
`/nextcloud/files/user/${e}`,
|
|
2888
|
-
{ queryParams: t ? { path: t } : void 0 }
|
|
2889
|
-
)).data.map((r) => toNextcloudDocument(r, e));
|
|
2890
|
-
}
|
|
2891
|
-
/**
|
|
2892
|
-
* Copy Nextcloud documents into the entcore workspace.
|
|
2893
|
-
* @param userId - the id of the user whose files are copied.
|
|
2894
|
-
* @param paths - paths of the documents to copy, relative to the user's Nextcloud root.
|
|
2895
|
-
* @param parentId - the workspace folder to copy into; user's root when omitted.
|
|
2896
|
-
* @param params.application - the application the documents are added from.
|
|
2897
|
-
* @param params.visibility - "protected" files the documents under the
|
|
2898
|
-
* documents added from applications, the way an upload does.
|
|
2899
|
-
*/
|
|
2900
|
-
async copyDocumentToWorkspace(e, t, s, r) {
|
|
2901
|
-
const i = t.map((u) => `path=${encodeURIComponent(u)}`).join("&");
|
|
2902
|
-
return (await this.http.put(
|
|
2903
|
-
`/nextcloud/files/user/${e}/copy/workspace?${i}`,
|
|
2904
|
-
void 0,
|
|
2905
|
-
{
|
|
2906
|
-
queryParams: {
|
|
2907
|
-
...s ? { parentId: s } : {},
|
|
2908
|
-
...r != null && r.application ? { application: r.application } : {},
|
|
2909
|
-
...(r == null ? void 0 : r.visibility) === "protected" ? { protected: !0 } : {}
|
|
2910
|
-
}
|
|
2911
|
-
}
|
|
2912
|
-
)).data.filter((u) => !!(u != null && u._id));
|
|
2913
|
-
}
|
|
2914
|
-
/**
|
|
2915
|
-
* Check whether a user has an active Nextcloud OAuth2 connection.
|
|
2916
|
-
* @param userId - the id of the user to check.
|
|
2917
|
-
*/
|
|
2918
|
-
async getOauth2Status(e) {
|
|
2919
|
-
return this.http.get(
|
|
2920
|
-
`/nextcloud/user/${e}/oauth2/status`
|
|
2921
|
-
);
|
|
2922
|
-
}
|
|
2923
|
-
/**
|
|
2924
|
-
* Build the URL to download/preview a Nextcloud document.
|
|
2925
|
-
* There is no dedicated thumbnail endpoint on the backend, so this is also
|
|
2926
|
-
* used as an image preview source for image documents.
|
|
2927
|
-
* @param userId - the id of the user who owns the file.
|
|
2928
|
-
* @param doc - the document to build the URL for.
|
|
2929
|
-
*/
|
|
2930
|
-
getFileUrl(e, t) {
|
|
2931
|
-
return `/nextcloud/files/user/${e}/file/${encodeURIComponent(
|
|
2932
|
-
t.name
|
|
2933
|
-
)}/download?path=${encodeURIComponent(
|
|
2934
|
-
t.path
|
|
2935
|
-
)}&contentType=${encodeURIComponent(t.contentType ?? "")}&isFolder=${t.isFolder}`;
|
|
2936
|
-
}
|
|
2937
|
-
}
|
|
2938
2781
|
class AbstractBehaviourService {
|
|
2939
2782
|
//
|
|
2940
2783
|
// IMPLEMENTATION
|
|
@@ -2943,7 +2786,7 @@ class AbstractBehaviourService {
|
|
|
2943
2786
|
//-----------------
|
|
2944
2787
|
//--- Utilities ---
|
|
2945
2788
|
//-----------------
|
|
2946
|
-
|
|
2789
|
+
u(this, "_cache");
|
|
2947
2790
|
this.context = e, this._cache = new CacheService(this.context);
|
|
2948
2791
|
}
|
|
2949
2792
|
getApplication() {
|
|
@@ -2977,8 +2820,8 @@ class AbstractBehaviourService {
|
|
|
2977
2820
|
class ActualitesBehaviour extends AbstractBehaviourService {
|
|
2978
2821
|
constructor() {
|
|
2979
2822
|
super(...arguments);
|
|
2980
|
-
|
|
2981
|
-
|
|
2823
|
+
u(this, "APP", "actualites");
|
|
2824
|
+
u(this, "RESOURCE", "actualites");
|
|
2982
2825
|
}
|
|
2983
2826
|
async loadResources() {
|
|
2984
2827
|
const [t, s] = await Promise.all([
|
|
@@ -2989,10 +2832,10 @@ class ActualitesBehaviour extends AbstractBehaviourService {
|
|
|
2989
2832
|
/* @__PURE__ */ new Map()
|
|
2990
2833
|
);
|
|
2991
2834
|
return t.map((i) => {
|
|
2992
|
-
var
|
|
2835
|
+
var a;
|
|
2993
2836
|
let o;
|
|
2994
2837
|
return i.threadIcon ? o = i.threadIcon + "?thumbnail=48x48" : o = "/img/icons/glyphicons_036_file.png", this.dataToResource({
|
|
2995
|
-
title: i.title + " [" + ((
|
|
2838
|
+
title: i.title + " [" + ((a = r.get(i.threadId)) == null ? void 0 : a.title) + "]",
|
|
2996
2839
|
ownerName: i.owner.displayName,
|
|
2997
2840
|
owner: i.owner.id,
|
|
2998
2841
|
icon: o,
|
|
@@ -3013,8 +2856,8 @@ const hexToDataUrl = (n, e = 1, t = 1) => {
|
|
|
3013
2856
|
class AppointmentsBehaviour extends AbstractBehaviourService {
|
|
3014
2857
|
constructor() {
|
|
3015
2858
|
super(...arguments);
|
|
3016
|
-
|
|
3017
|
-
|
|
2859
|
+
u(this, "APP", "appointments");
|
|
2860
|
+
u(this, "RESOURCE", "appointments");
|
|
3018
2861
|
}
|
|
3019
2862
|
async loadResources() {
|
|
3020
2863
|
return (await this.httpGet("/appointments/grids/linker")).map((s) => this.dataToResource({
|
|
@@ -3032,8 +2875,8 @@ class AppointmentsBehaviour extends AbstractBehaviourService {
|
|
|
3032
2875
|
class BlogBehaviour extends AbstractBehaviourService {
|
|
3033
2876
|
constructor() {
|
|
3034
2877
|
super(...arguments);
|
|
3035
|
-
|
|
3036
|
-
|
|
2878
|
+
u(this, "APP", "blog");
|
|
2879
|
+
u(this, "RESOURCE", "blog");
|
|
3037
2880
|
}
|
|
3038
2881
|
loadResources() {
|
|
3039
2882
|
return new Promise(async (t, s) => {
|
|
@@ -3041,7 +2884,7 @@ class BlogBehaviour extends AbstractBehaviourService {
|
|
|
3041
2884
|
const r = await this.httpGet("/blog/linker"), i = [];
|
|
3042
2885
|
r.forEach((o) => {
|
|
3043
2886
|
o.thumbnail ? o.thumbnail = o.thumbnail + "?thumbnail=48x48" : o.thumbnail = "/img/illustrations/blog.svg";
|
|
3044
|
-
const
|
|
2887
|
+
const a = o.fetchPosts.map((c) => this.dataToResource({
|
|
3045
2888
|
owner: o.author.userId,
|
|
3046
2889
|
ownerName: o.author.username,
|
|
3047
2890
|
title: c.title + " [" + o.title + "]",
|
|
@@ -3051,7 +2894,7 @@ class BlogBehaviour extends AbstractBehaviourService {
|
|
|
3051
2894
|
shared: !!(o.shared && o.shared.length >= 0),
|
|
3052
2895
|
modified: o.modified
|
|
3053
2896
|
}));
|
|
3054
|
-
i.push(...
|
|
2897
|
+
i.push(...a);
|
|
3055
2898
|
}), t(i);
|
|
3056
2899
|
} catch (r) {
|
|
3057
2900
|
s(r);
|
|
@@ -3062,8 +2905,8 @@ class BlogBehaviour extends AbstractBehaviourService {
|
|
|
3062
2905
|
class CollaborativewallBehaviour extends AbstractBehaviourService {
|
|
3063
2906
|
constructor() {
|
|
3064
2907
|
super(...arguments);
|
|
3065
|
-
|
|
3066
|
-
|
|
2908
|
+
u(this, "APP", "collaborativewall");
|
|
2909
|
+
u(this, "RESOURCE", "collaborativewall");
|
|
3067
2910
|
}
|
|
3068
2911
|
async loadResources() {
|
|
3069
2912
|
return (await this.httpGet(
|
|
@@ -3085,8 +2928,8 @@ class CollaborativewallBehaviour extends AbstractBehaviourService {
|
|
|
3085
2928
|
class CommunityBehaviour extends AbstractBehaviourService {
|
|
3086
2929
|
constructor() {
|
|
3087
2930
|
super(...arguments);
|
|
3088
|
-
|
|
3089
|
-
|
|
2931
|
+
u(this, "APP", "community");
|
|
2932
|
+
u(this, "RESOURCE", "community");
|
|
3090
2933
|
}
|
|
3091
2934
|
async loadResources() {
|
|
3092
2935
|
return (await this.httpGet(
|
|
@@ -3110,8 +2953,8 @@ class CommunityBehaviour extends AbstractBehaviourService {
|
|
|
3110
2953
|
class ExercizerBehaviour extends AbstractBehaviourService {
|
|
3111
2954
|
constructor() {
|
|
3112
2955
|
super(...arguments);
|
|
3113
|
-
|
|
3114
|
-
|
|
2956
|
+
u(this, "APP", "exercizer");
|
|
2957
|
+
u(this, "RESOURCE", "exercizer");
|
|
3115
2958
|
}
|
|
3116
2959
|
async loadResources() {
|
|
3117
2960
|
return (await this.httpGet(
|
|
@@ -3119,8 +2962,8 @@ class ExercizerBehaviour extends AbstractBehaviourService {
|
|
|
3119
2962
|
)).map((s) => {
|
|
3120
2963
|
const r = s.picture ? s.picture + "?thumbnail=48x48" : "/img/illustrations/exercizer.svg";
|
|
3121
2964
|
let i, o = !1;
|
|
3122
|
-
const
|
|
3123
|
-
return
|
|
2965
|
+
const a = JSON.parse(s.scheduled_at);
|
|
2966
|
+
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({
|
|
3124
2967
|
title: s.title,
|
|
3125
2968
|
owner: s.owner,
|
|
3126
2969
|
ownerName: i,
|
|
@@ -3136,8 +2979,8 @@ class ExercizerBehaviour extends AbstractBehaviourService {
|
|
|
3136
2979
|
class FormulaireBehaviour extends AbstractBehaviourService {
|
|
3137
2980
|
constructor() {
|
|
3138
2981
|
super(...arguments);
|
|
3139
|
-
|
|
3140
|
-
|
|
2982
|
+
u(this, "APP", "formulaire");
|
|
2983
|
+
u(this, "RESOURCE", "formulaire");
|
|
3141
2984
|
}
|
|
3142
2985
|
async loadResources() {
|
|
3143
2986
|
return (await this.httpGet(
|
|
@@ -3157,8 +3000,8 @@ class FormulaireBehaviour extends AbstractBehaviourService {
|
|
|
3157
3000
|
class ForumBehaviour extends AbstractBehaviourService {
|
|
3158
3001
|
constructor() {
|
|
3159
3002
|
super(...arguments);
|
|
3160
|
-
|
|
3161
|
-
|
|
3003
|
+
u(this, "APP", "forum");
|
|
3004
|
+
u(this, "RESOURCE", "forum");
|
|
3162
3005
|
}
|
|
3163
3006
|
async loadResources() {
|
|
3164
3007
|
return (await this.httpGet("/forum/categories")).map(
|
|
@@ -3178,8 +3021,8 @@ class ForumBehaviour extends AbstractBehaviourService {
|
|
|
3178
3021
|
class HomeworksBehaviour extends AbstractBehaviourService {
|
|
3179
3022
|
constructor() {
|
|
3180
3023
|
super(...arguments);
|
|
3181
|
-
|
|
3182
|
-
|
|
3024
|
+
u(this, "APP", "homeworks");
|
|
3025
|
+
u(this, "RESOURCE", "homeworks");
|
|
3183
3026
|
}
|
|
3184
3027
|
async loadResources() {
|
|
3185
3028
|
return (await this.httpGet("/homeworks/list")).filter((t) => t.owner && t.trashed === 0).map((t) => this.dataToResource({
|
|
@@ -3197,8 +3040,8 @@ class HomeworksBehaviour extends AbstractBehaviourService {
|
|
|
3197
3040
|
class MagnetoBehaviour extends AbstractBehaviourService {
|
|
3198
3041
|
constructor() {
|
|
3199
3042
|
super(...arguments);
|
|
3200
|
-
|
|
3201
|
-
|
|
3043
|
+
u(this, "APP", "magneto");
|
|
3044
|
+
u(this, "RESOURCE", "magneto");
|
|
3202
3045
|
}
|
|
3203
3046
|
async loadResources() {
|
|
3204
3047
|
const { all: t } = await this.httpGet(
|
|
@@ -3219,8 +3062,8 @@ class MagnetoBehaviour extends AbstractBehaviourService {
|
|
|
3219
3062
|
class MindmapBehaviour extends AbstractBehaviourService {
|
|
3220
3063
|
constructor() {
|
|
3221
3064
|
super(...arguments);
|
|
3222
|
-
|
|
3223
|
-
|
|
3065
|
+
u(this, "APP", "mindmap");
|
|
3066
|
+
u(this, "RESOURCE", "mindmap");
|
|
3224
3067
|
}
|
|
3225
3068
|
async loadResources() {
|
|
3226
3069
|
return (await this.httpGet("/mindmap/list/all")).map(
|
|
@@ -3240,8 +3083,8 @@ class MindmapBehaviour extends AbstractBehaviourService {
|
|
|
3240
3083
|
class PagesBehaviour extends AbstractBehaviourService {
|
|
3241
3084
|
constructor() {
|
|
3242
3085
|
super(...arguments);
|
|
3243
|
-
|
|
3244
|
-
|
|
3086
|
+
u(this, "APP", "pages");
|
|
3087
|
+
u(this, "RESOURCE", "pages");
|
|
3245
3088
|
}
|
|
3246
3089
|
async loadResources() {
|
|
3247
3090
|
const t = await this.httpGet("/pages/list/all"), s = [];
|
|
@@ -3259,15 +3102,15 @@ class PagesBehaviour extends AbstractBehaviourService {
|
|
|
3259
3102
|
shared: typeof r.shared < "u",
|
|
3260
3103
|
modified: r.modified
|
|
3261
3104
|
})
|
|
3262
|
-
), (o = r.pages) == null || o.forEach((
|
|
3105
|
+
), (o = r.pages) == null || o.forEach((a) => {
|
|
3263
3106
|
s.push(
|
|
3264
3107
|
this.dataToResource({
|
|
3265
|
-
title:
|
|
3108
|
+
title: a.title,
|
|
3266
3109
|
owner: r.owner.userId,
|
|
3267
3110
|
ownerName: r.owner.displayName,
|
|
3268
3111
|
icon: i,
|
|
3269
|
-
path: "/pages#/website/" + r._id + "/" +
|
|
3270
|
-
_id: r._id + "/" +
|
|
3112
|
+
path: "/pages#/website/" + r._id + "/" + a.titleLink,
|
|
3113
|
+
_id: r._id + "/" + a.titleLink,
|
|
3271
3114
|
shared: typeof r.shared < "u",
|
|
3272
3115
|
modified: r.modified
|
|
3273
3116
|
})
|
|
@@ -3279,8 +3122,8 @@ class PagesBehaviour extends AbstractBehaviourService {
|
|
|
3279
3122
|
class PollBehaviour extends AbstractBehaviourService {
|
|
3280
3123
|
constructor() {
|
|
3281
3124
|
super(...arguments);
|
|
3282
|
-
|
|
3283
|
-
|
|
3125
|
+
u(this, "APP", "poll");
|
|
3126
|
+
u(this, "RESOURCE", "poll");
|
|
3284
3127
|
}
|
|
3285
3128
|
async loadResources() {
|
|
3286
3129
|
return (await this.httpGet("/poll/list/all")).map((s) => {
|
|
@@ -3301,8 +3144,8 @@ class PollBehaviour extends AbstractBehaviourService {
|
|
|
3301
3144
|
class ScrapbookBehaviour extends AbstractBehaviourService {
|
|
3302
3145
|
constructor() {
|
|
3303
3146
|
super(...arguments);
|
|
3304
|
-
|
|
3305
|
-
|
|
3147
|
+
u(this, "APP", "scrapbook");
|
|
3148
|
+
u(this, "RESOURCE", "scrapbook");
|
|
3306
3149
|
}
|
|
3307
3150
|
async loadResources() {
|
|
3308
3151
|
return (await this.httpGet(
|
|
@@ -3325,8 +3168,8 @@ class ScrapbookBehaviour extends AbstractBehaviourService {
|
|
|
3325
3168
|
class TimelinegeneratorBehaviour extends AbstractBehaviourService {
|
|
3326
3169
|
constructor() {
|
|
3327
3170
|
super(...arguments);
|
|
3328
|
-
|
|
3329
|
-
|
|
3171
|
+
u(this, "APP", "timelinegenerator");
|
|
3172
|
+
u(this, "RESOURCE", "timelinegenerator");
|
|
3330
3173
|
}
|
|
3331
3174
|
loadResources() {
|
|
3332
3175
|
return new Promise(async (t, s) => {
|
|
@@ -3334,12 +3177,12 @@ class TimelinegeneratorBehaviour extends AbstractBehaviourService {
|
|
|
3334
3177
|
const i = (await this.httpGet(
|
|
3335
3178
|
"/timelinegenerator/timelines"
|
|
3336
3179
|
)).map((o) => {
|
|
3337
|
-
const
|
|
3180
|
+
const a = o.icon || "/img/illustrations/timeline-default.png";
|
|
3338
3181
|
return this.dataToResource({
|
|
3339
3182
|
title: o.headline,
|
|
3340
3183
|
ownerName: o.owner.displayName,
|
|
3341
3184
|
owner: o.owner.userId,
|
|
3342
|
-
icon:
|
|
3185
|
+
icon: a,
|
|
3343
3186
|
path: "/timelinegenerator#/view/" + o._id,
|
|
3344
3187
|
_id: o._id,
|
|
3345
3188
|
shared: typeof o.shared < "u",
|
|
@@ -3356,8 +3199,8 @@ class TimelinegeneratorBehaviour extends AbstractBehaviourService {
|
|
|
3356
3199
|
class WikiBehaviour extends AbstractBehaviourService {
|
|
3357
3200
|
constructor() {
|
|
3358
3201
|
super(...arguments);
|
|
3359
|
-
|
|
3360
|
-
|
|
3202
|
+
u(this, "APP", "wiki");
|
|
3203
|
+
u(this, "RESOURCE", "wiki");
|
|
3361
3204
|
}
|
|
3362
3205
|
async loadResources() {
|
|
3363
3206
|
return (await this.httpGet(
|
|
@@ -3380,8 +3223,8 @@ class WikiBehaviour extends AbstractBehaviourService {
|
|
|
3380
3223
|
class WorkspaceBehaviour extends AbstractBehaviourService {
|
|
3381
3224
|
constructor() {
|
|
3382
3225
|
super(...arguments);
|
|
3383
|
-
|
|
3384
|
-
|
|
3226
|
+
u(this, "APP", "workspace");
|
|
3227
|
+
u(this, "RESOURCE", "workspace");
|
|
3385
3228
|
}
|
|
3386
3229
|
loadResources({ search: t, asset_id: s }) {
|
|
3387
3230
|
return new Promise(async (r, i) => {
|
|
@@ -3389,12 +3232,12 @@ class WorkspaceBehaviour extends AbstractBehaviourService {
|
|
|
3389
3232
|
let o = "/workspace/documents?filter=all&hierarchical=true";
|
|
3390
3233
|
s && s.length ? o += `&search=${t}` : t && t.length && (o += `&search=${t}`);
|
|
3391
3234
|
const c = (await this.httpGet(o)).filter((l) => !l.deleted).map((l) => {
|
|
3392
|
-
const
|
|
3235
|
+
const h = l.metadata["content-type"] && l.metadata["content-type"].indexOf("image") !== -1 ? `/workspace/document/${l._id}?thumbnail=120x120` : "/img/icons/unknown-large.png";
|
|
3393
3236
|
return this.dataToResource({
|
|
3394
3237
|
title: l.name,
|
|
3395
3238
|
ownerName: l.ownerName,
|
|
3396
3239
|
owner: l.owner,
|
|
3397
|
-
icon:
|
|
3240
|
+
icon: h,
|
|
3398
3241
|
path: `/workspace/document/${l._id}`,
|
|
3399
3242
|
_id: l._id,
|
|
3400
3243
|
shared: !!(l.shared && l.shared.length >= 0),
|
|
@@ -3419,7 +3262,7 @@ const b = class b {
|
|
|
3419
3262
|
e.session().getUser()
|
|
3420
3263
|
]);
|
|
3421
3264
|
i != null && i.apps && (r != null && r.length) && (this.resourceProducingApps = r.filter(
|
|
3422
|
-
(o) => i.apps.some((
|
|
3265
|
+
(o) => i.apps.some((a) => a.address.includes(o))
|
|
3423
3266
|
));
|
|
3424
3267
|
} catch (r) {
|
|
3425
3268
|
console.warn("Failed to load resource-producing apps:", r);
|
|
@@ -3502,8 +3345,8 @@ const b = class b {
|
|
|
3502
3345
|
//
|
|
3503
3346
|
// STATIC REGISTRY
|
|
3504
3347
|
//
|
|
3505
|
-
|
|
3506
|
-
|
|
3348
|
+
u(b, "registry", new ServiceRegistry()), // Expose some useful functions
|
|
3349
|
+
u(b, "findBehaviour", b.registry.findService.bind(b.registry)), u(b, "hasBehaviour", b.registry.isRegistered.bind(b.registry)), u(b, "resourceProducingApps", []);
|
|
3507
3350
|
let SnipletsService = b;
|
|
3508
3351
|
class RightService {
|
|
3509
3352
|
constructor(e) {
|
|
@@ -3702,14 +3545,14 @@ class SessionService {
|
|
|
3702
3545
|
r,
|
|
3703
3546
|
i,
|
|
3704
3547
|
o,
|
|
3705
|
-
|
|
3548
|
+
a
|
|
3706
3549
|
] = await Promise.all([
|
|
3707
3550
|
this.getCurrentLanguage(e),
|
|
3708
3551
|
this.latestQuotaAndUsage(e),
|
|
3709
3552
|
this.loadDescription(e),
|
|
3710
3553
|
this.getUserProfile(),
|
|
3711
3554
|
this.getBookmarks(e)
|
|
3712
|
-
]), { type: c, ...l } = t || {},
|
|
3555
|
+
]), { type: c, ...l } = t || {}, h = {
|
|
3713
3556
|
...l,
|
|
3714
3557
|
profiles: c || ["Guest"],
|
|
3715
3558
|
// "type" field from /userbook/api/person becomes "profiles"
|
|
@@ -3720,9 +3563,9 @@ class SessionService {
|
|
|
3720
3563
|
user: e,
|
|
3721
3564
|
quotaAndUsage: r,
|
|
3722
3565
|
currentLanguage: s,
|
|
3723
|
-
userDescription:
|
|
3566
|
+
userDescription: h,
|
|
3724
3567
|
userProfile: o,
|
|
3725
|
-
bookmarkedApps:
|
|
3568
|
+
bookmarkedApps: a
|
|
3726
3569
|
};
|
|
3727
3570
|
}
|
|
3728
3571
|
login(e, t, s, r) {
|
|
@@ -3816,7 +3659,7 @@ class SessionService {
|
|
|
3816
3659
|
applications: []
|
|
3817
3660
|
});
|
|
3818
3661
|
const i = [];
|
|
3819
|
-
return r.bookmarks.forEach((o,
|
|
3662
|
+
return r.bookmarks.forEach((o, a) => {
|
|
3820
3663
|
const c = ((e == null ? void 0 : e.apps) || []).find(
|
|
3821
3664
|
(l) => l.name === o
|
|
3822
3665
|
);
|
|
@@ -3832,11 +3675,11 @@ class SessionService {
|
|
|
3832
3675
|
}
|
|
3833
3676
|
async getPerson(e = {}) {
|
|
3834
3677
|
var c;
|
|
3835
|
-
const { options: t = {}, params: s = {} } = e, r = new URLSearchParams(s).toString(), i = `/userbook/api/person${r ? `?${r}` : ""}`, { response: o, value:
|
|
3678
|
+
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(
|
|
3836
3679
|
i,
|
|
3837
3680
|
t
|
|
3838
3681
|
);
|
|
3839
|
-
return o.status < 200 || o.status >= 300 || typeof
|
|
3682
|
+
return o.status < 200 || o.status >= 300 || typeof a == "string" ? null : ((c = a == null ? void 0 : a.result) == null ? void 0 : c[0]) || null;
|
|
3840
3683
|
}
|
|
3841
3684
|
async isAdml() {
|
|
3842
3685
|
const e = await this.getUser();
|
|
@@ -3894,38 +3737,38 @@ class ShareService {
|
|
|
3894
3737
|
t,
|
|
3895
3738
|
s,
|
|
3896
3739
|
r
|
|
3897
|
-
),
|
|
3740
|
+
), a = await this.cache.httpGetJson(o), c = a.users.visibles.filter(({ username: p, firstName: y, lastName: d, login: g }) => {
|
|
3898
3741
|
const A = StringUtils.removeAccents(
|
|
3899
|
-
|
|
3742
|
+
d || ""
|
|
3900
3743
|
).toLowerCase(), f = StringUtils.removeAccents(
|
|
3901
3744
|
y || ""
|
|
3902
3745
|
).toLowerCase(), w = StringUtils.removeAccents(
|
|
3903
|
-
|
|
3746
|
+
p || ""
|
|
3904
3747
|
).toLowerCase(), F = StringUtils.removeAccents(g || "").toLowerCase();
|
|
3905
3748
|
return w.includes(i) || f.includes(i) || A.includes(i) || F.includes(i);
|
|
3906
|
-
}).map((
|
|
3907
|
-
avatarUrl: this.directory.getAvatarUrl(
|
|
3908
|
-
directoryUrl: this.directory.getDirectoryUrl(
|
|
3909
|
-
displayName:
|
|
3910
|
-
id:
|
|
3911
|
-
profile:
|
|
3749
|
+
}).map((p) => ({
|
|
3750
|
+
avatarUrl: this.directory.getAvatarUrl(p.id, "user"),
|
|
3751
|
+
directoryUrl: this.directory.getDirectoryUrl(p.id, "user"),
|
|
3752
|
+
displayName: p.username,
|
|
3753
|
+
id: p.id,
|
|
3754
|
+
profile: p.profile,
|
|
3912
3755
|
type: "user"
|
|
3913
|
-
})), l =
|
|
3914
|
-
avatarUrl: this.directory.getAvatarUrl(
|
|
3915
|
-
directoryUrl: this.directory.getDirectoryUrl(
|
|
3916
|
-
displayName:
|
|
3917
|
-
id:
|
|
3756
|
+
})), l = a.groups.visibles.filter(({ name: p }) => StringUtils.removeAccents(p || "").toLowerCase().includes(i)).map((p) => ({
|
|
3757
|
+
avatarUrl: this.directory.getAvatarUrl(p.id, "group"),
|
|
3758
|
+
directoryUrl: this.directory.getDirectoryUrl(p.id, "group"),
|
|
3759
|
+
displayName: p.name,
|
|
3760
|
+
id: p.id,
|
|
3918
3761
|
type: "group",
|
|
3919
|
-
structureName:
|
|
3762
|
+
structureName: p.structureName
|
|
3920
3763
|
}));
|
|
3921
|
-
return [...(await this.directory.getBookMarks()).filter(({ displayName:
|
|
3922
|
-
|
|
3923
|
-
).toLowerCase().includes(i)).map((
|
|
3764
|
+
return [...(await this.directory.getBookMarks()).filter(({ displayName: p }) => StringUtils.removeAccents(
|
|
3765
|
+
p || ""
|
|
3766
|
+
).toLowerCase().includes(i)).map((p) => ({
|
|
3924
3767
|
avatarUrl: "",
|
|
3925
3768
|
directoryUrl: "",
|
|
3926
3769
|
profile: "",
|
|
3927
|
-
displayName:
|
|
3928
|
-
id:
|
|
3770
|
+
displayName: p.displayName,
|
|
3771
|
+
id: p.id,
|
|
3929
3772
|
type: "sharebookmark"
|
|
3930
3773
|
})), ...c, ...l];
|
|
3931
3774
|
}
|
|
@@ -3941,10 +3784,10 @@ class ShareService {
|
|
|
3941
3784
|
return s;
|
|
3942
3785
|
}
|
|
3943
3786
|
getActionsAvailableFor({ id: e, type: t }, s, r) {
|
|
3944
|
-
const o = (t === "user" ? s.users.checked[e] : s.groups.checked[e]) || [],
|
|
3945
|
-
for (const l of
|
|
3787
|
+
const o = (t === "user" ? s.users.checked[e] : s.groups.checked[e]) || [], a = Object.keys(r), c = [];
|
|
3788
|
+
for (const l of a)
|
|
3946
3789
|
r[l].filter(
|
|
3947
|
-
(
|
|
3790
|
+
(p) => o.includes(p)
|
|
3948
3791
|
).length > 0 && c.push(l);
|
|
3949
3792
|
return c;
|
|
3950
3793
|
}
|
|
@@ -3956,26 +3799,26 @@ class ShareService {
|
|
|
3956
3799
|
s == null ? void 0 : s.getResourceRights
|
|
3957
3800
|
), o = await this.cache.httpGetJson(
|
|
3958
3801
|
i
|
|
3959
|
-
),
|
|
3802
|
+
), a = await this.getShareMapping(
|
|
3960
3803
|
e,
|
|
3961
3804
|
s == null ? void 0 : s.getShareMapping
|
|
3962
3805
|
), c = await this.cache.httpGetJson(
|
|
3963
3806
|
"/infra/public/json/sharing-rights.json"
|
|
3964
|
-
), l = Object.keys(o.users.checked).map((
|
|
3965
|
-
(A) => A.id ===
|
|
3966
|
-
)).filter((
|
|
3807
|
+
), l = Object.keys(o.users.checked).map((d) => o.users.visibles.find(
|
|
3808
|
+
(A) => A.id === d
|
|
3809
|
+
)).filter((d) => d !== void 0).map((d) => {
|
|
3967
3810
|
const g = this.getActionsAvailableFor(
|
|
3968
|
-
{ id:
|
|
3811
|
+
{ id: d.id, type: "user" },
|
|
3969
3812
|
o,
|
|
3970
|
-
|
|
3813
|
+
a
|
|
3971
3814
|
);
|
|
3972
3815
|
return {
|
|
3973
|
-
id:
|
|
3816
|
+
id: d.id,
|
|
3974
3817
|
type: "user",
|
|
3975
|
-
displayName:
|
|
3976
|
-
profile:
|
|
3977
|
-
avatarUrl: this.directory.getAvatarUrl(
|
|
3978
|
-
directoryUrl: this.directory.getDirectoryUrl(
|
|
3818
|
+
displayName: d.username,
|
|
3819
|
+
profile: d.profile,
|
|
3820
|
+
avatarUrl: this.directory.getAvatarUrl(d.id, "user"),
|
|
3821
|
+
directoryUrl: this.directory.getDirectoryUrl(d.id, "user"),
|
|
3979
3822
|
actions: g.map((f) => {
|
|
3980
3823
|
const w = c[f];
|
|
3981
3824
|
return {
|
|
@@ -3985,21 +3828,21 @@ class ShareService {
|
|
|
3985
3828
|
};
|
|
3986
3829
|
})
|
|
3987
3830
|
};
|
|
3988
|
-
}).sort((
|
|
3989
|
-
(A) => A.id ===
|
|
3990
|
-
)).filter((
|
|
3831
|
+
}).sort((d, g) => (d.displayName || "").localeCompare(g.displayName)), h = Object.keys(o.groups.checked).map((d) => o.groups.visibles.find(
|
|
3832
|
+
(A) => A.id === d
|
|
3833
|
+
)).filter((d) => d !== void 0).map((d) => {
|
|
3991
3834
|
const g = this.getActionsAvailableFor(
|
|
3992
|
-
{ id:
|
|
3835
|
+
{ id: d.id, type: "group" },
|
|
3993
3836
|
o,
|
|
3994
|
-
|
|
3837
|
+
a
|
|
3995
3838
|
);
|
|
3996
3839
|
return {
|
|
3997
|
-
id:
|
|
3840
|
+
id: d.id,
|
|
3998
3841
|
type: "group",
|
|
3999
|
-
displayName:
|
|
3842
|
+
displayName: d.name,
|
|
4000
3843
|
profile: void 0,
|
|
4001
|
-
avatarUrl: this.directory.getAvatarUrl(
|
|
4002
|
-
directoryUrl: this.directory.getDirectoryUrl(
|
|
3844
|
+
avatarUrl: this.directory.getAvatarUrl(d.id, "group"),
|
|
3845
|
+
directoryUrl: this.directory.getDirectoryUrl(d.id, "group"),
|
|
4003
3846
|
actions: g.map((f) => {
|
|
4004
3847
|
const w = c[f];
|
|
4005
3848
|
return {
|
|
@@ -4009,26 +3852,26 @@ class ShareService {
|
|
|
4009
3852
|
};
|
|
4010
3853
|
})
|
|
4011
3854
|
};
|
|
4012
|
-
}).sort((
|
|
4013
|
-
({ groupDisplayName:
|
|
3855
|
+
}).sort((d, g) => (d.displayName || "").localeCompare(g.displayName)), E = [...l, ...h], p = o.groups.visibles.map(
|
|
3856
|
+
({ groupDisplayName: d, id: g, name: A, labels: f }) => ({
|
|
4014
3857
|
labels: f,
|
|
4015
|
-
displayName:
|
|
3858
|
+
displayName: d || A,
|
|
4016
3859
|
id: g
|
|
4017
3860
|
})
|
|
4018
3861
|
), y = o.users.visibles.map(
|
|
4019
|
-
({ id:
|
|
3862
|
+
({ id: d, profile: g, username: A, firstName: f, lastName: w, login: F }) => ({
|
|
4020
3863
|
displayName: A,
|
|
4021
3864
|
firstName: f,
|
|
4022
3865
|
lastName: w,
|
|
4023
3866
|
login: F,
|
|
4024
3867
|
profile: g,
|
|
4025
|
-
id:
|
|
3868
|
+
id: d
|
|
4026
3869
|
})
|
|
4027
3870
|
);
|
|
4028
3871
|
return {
|
|
4029
|
-
rights:
|
|
3872
|
+
rights: E,
|
|
4030
3873
|
visibleBookmarks: r,
|
|
4031
|
-
visibleGroups:
|
|
3874
|
+
visibleGroups: p,
|
|
4032
3875
|
visibleUsers: y
|
|
4033
3876
|
};
|
|
4034
3877
|
}
|
|
@@ -4039,7 +3882,7 @@ class ShareService {
|
|
|
4039
3882
|
bookmarks: {}
|
|
4040
3883
|
}, i = await this.getShareMapping(e, s);
|
|
4041
3884
|
for (const o of t) {
|
|
4042
|
-
const
|
|
3885
|
+
const a = o.actions.map((l) => i[l.id]).reduce((l, h) => Array.isArray(h) ? [...l, ...h] : l, []), c = [...new Set(a)];
|
|
4043
3886
|
c.length > 0 && (o.type === "user" ? r.users[o.id] = c : o.type === "group" ? r.groups[o.id] = c : r.bookmarks[o.id] = c);
|
|
4044
3887
|
}
|
|
4045
3888
|
return r;
|
|
@@ -4049,40 +3892,40 @@ class ShareService {
|
|
|
4049
3892
|
e,
|
|
4050
3893
|
s,
|
|
4051
3894
|
r == null ? void 0 : r.getShareMapping
|
|
4052
|
-
), o = (r == null ? void 0 : r.saveResourceRights) || `/${e}/share/resource/${t}`,
|
|
3895
|
+
), o = (r == null ? void 0 : r.saveResourceRights) || `/${e}/share/resource/${t}`, a = this.getSearchUrl(
|
|
4053
3896
|
e,
|
|
4054
3897
|
t,
|
|
4055
3898
|
"",
|
|
4056
3899
|
r == null ? void 0 : r.getResourceRights
|
|
4057
3900
|
);
|
|
4058
|
-
return this.cache.clearCache(
|
|
3901
|
+
return this.cache.clearCache(a), await this.http.putJson(o, i);
|
|
4059
3902
|
}
|
|
4060
3903
|
async getActionsForApp(e, t) {
|
|
4061
3904
|
const s = await this.cache.httpGetJson(
|
|
4062
3905
|
"/infra/public/json/sharing-rights.json"
|
|
4063
3906
|
), r = await this.getShareMapping(e, t);
|
|
4064
3907
|
return Object.keys(s).map((o) => {
|
|
4065
|
-
const
|
|
3908
|
+
const a = s[o];
|
|
4066
3909
|
return {
|
|
4067
3910
|
displayName: o,
|
|
4068
3911
|
id: o,
|
|
4069
|
-
priority:
|
|
4070
|
-
requires:
|
|
3912
|
+
priority: a.priority,
|
|
3913
|
+
requires: a.requires
|
|
4071
3914
|
};
|
|
4072
3915
|
}).filter((o) => {
|
|
4073
|
-
var
|
|
4074
|
-
return ((
|
|
4075
|
-
}).sort((o,
|
|
3916
|
+
var a;
|
|
3917
|
+
return ((a = r[o.id]) == null ? void 0 : a.length) > 0;
|
|
3918
|
+
}).sort((o, a) => o.priority - a.priority);
|
|
4076
3919
|
}
|
|
4077
3920
|
}
|
|
4078
3921
|
const loadedScripts = {};
|
|
4079
3922
|
class HttpService {
|
|
4080
3923
|
constructor(e, t) {
|
|
4081
3924
|
// Axios automatically manages the XSRF-TOKEN cookie and the X-XSRF-TOKEN HTTP header.
|
|
4082
|
-
|
|
4083
|
-
|
|
4084
|
-
|
|
4085
|
-
|
|
3925
|
+
u(this, "axios");
|
|
3926
|
+
u(this, "baseUrl");
|
|
3927
|
+
u(this, "headers", {});
|
|
3928
|
+
u(this, "_latestResponse");
|
|
4086
3929
|
this.context = e, this.axios = axios.create(t);
|
|
4087
3930
|
}
|
|
4088
3931
|
fixBaseUrl(e) {
|
|
@@ -4297,8 +4140,8 @@ class HttpService {
|
|
|
4297
4140
|
const r = s ?? "exports", i = this.toAxiosConfig(t);
|
|
4298
4141
|
return i.headers && (i.headers.Accept = "application/javascript"), this.axios.get(this.toCdnUrl(e), i).then((o) => this.mapAxiosResponse(o, t)).then((o) => {
|
|
4299
4142
|
try {
|
|
4300
|
-
const
|
|
4301
|
-
return Function(
|
|
4143
|
+
const a = `"use strict";var ${r.split(".")[0]}={};${o};return ${r};`;
|
|
4144
|
+
return Function(a)();
|
|
4302
4145
|
} catch {
|
|
4303
4146
|
return o;
|
|
4304
4147
|
}
|
|
@@ -4357,42 +4200,42 @@ const R = class R {
|
|
|
4357
4200
|
throw new Error("Invalid video filename");
|
|
4358
4201
|
const i = `${e.browser.name} ${e.browser.version}`, o = new FormData();
|
|
4359
4202
|
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);
|
|
4360
|
-
let
|
|
4361
|
-
r && (
|
|
4203
|
+
let a = `/video/encode?captation=${s}`;
|
|
4204
|
+
r && (a += `&duration=${r}`);
|
|
4362
4205
|
const c = await this.http.post(
|
|
4363
|
-
|
|
4206
|
+
a,
|
|
4364
4207
|
o,
|
|
4365
4208
|
{ headers: { "Content-Type": "multipart/form-data" } }
|
|
4366
4209
|
);
|
|
4367
4210
|
if (c.state == "running") {
|
|
4368
|
-
let l = 0,
|
|
4211
|
+
let l = 0, h = 1;
|
|
4369
4212
|
do {
|
|
4370
|
-
const
|
|
4213
|
+
const E = h + l;
|
|
4371
4214
|
await new Promise(
|
|
4372
|
-
(y) => setTimeout(y,
|
|
4373
|
-
), l =
|
|
4374
|
-
const
|
|
4215
|
+
(y) => setTimeout(y, E * 1e3)
|
|
4216
|
+
), l = h, h = Math.min(8, E);
|
|
4217
|
+
const p = await this.http.get(
|
|
4375
4218
|
`/video/status/${c.processid}`
|
|
4376
4219
|
);
|
|
4377
|
-
if (
|
|
4378
|
-
return
|
|
4379
|
-
|
|
4220
|
+
if (p.state == "succeed")
|
|
4221
|
+
return p.videoworkspaceid && p.videosize && this.context.data().trackVideoSave(
|
|
4222
|
+
p.videoworkspaceid,
|
|
4380
4223
|
Math.round(r),
|
|
4381
|
-
|
|
4224
|
+
p.videosize,
|
|
4382
4225
|
s,
|
|
4383
4226
|
e.url,
|
|
4384
4227
|
i,
|
|
4385
4228
|
e.device
|
|
4386
|
-
),
|
|
4387
|
-
if (
|
|
4229
|
+
), p;
|
|
4230
|
+
if (p.state == "error")
|
|
4388
4231
|
break;
|
|
4389
4232
|
} while (!0);
|
|
4390
4233
|
}
|
|
4391
4234
|
throw new Error("Video cannot be uploaded.");
|
|
4392
4235
|
}
|
|
4393
4236
|
};
|
|
4394
|
-
|
|
4395
|
-
|
|
4237
|
+
u(R, "MAX_WEIGHT", 50), // in Mbytes. Applies to uploaded videos.
|
|
4238
|
+
u(R, "MAX_DURATION", 3);
|
|
4396
4239
|
let VideoService = R;
|
|
4397
4240
|
class WidgetService {
|
|
4398
4241
|
constructor(e) {
|
|
@@ -4474,7 +4317,7 @@ const defaultMappers = {
|
|
|
4474
4317
|
}
|
|
4475
4318
|
};
|
|
4476
4319
|
// FIXME add edumedia support
|
|
4477
|
-
|
|
4320
|
+
u(v, "roleMappers", [
|
|
4478
4321
|
(e) => Object.keys(defaultMappers).find((s) => defaultMappers[s](e))
|
|
4479
4322
|
]);
|
|
4480
4323
|
let DocumentHelper = v;
|
|
@@ -4492,29 +4335,29 @@ class WorkspaceService {
|
|
|
4492
4335
|
size: e.size,
|
|
4493
4336
|
extension: i,
|
|
4494
4337
|
role: DocumentHelper.role(r, !1, i)
|
|
4495
|
-
},
|
|
4496
|
-
return { basename:
|
|
4338
|
+
}, a = t.replace("." + o.extension, ""), c = o.extension ? a + "." + o.extension : a;
|
|
4339
|
+
return { basename: a, fullname: c, metadata: o };
|
|
4497
4340
|
}
|
|
4498
4341
|
async saveFile(e, t) {
|
|
4499
4342
|
const { fullname: s, metadata: r } = this.extractMetadata(e), i = new FormData();
|
|
4500
4343
|
i.append("file", e, s);
|
|
4501
4344
|
const o = [];
|
|
4502
4345
|
((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}`);
|
|
4503
|
-
const
|
|
4346
|
+
const a = await this.http.postFile(
|
|
4504
4347
|
`/workspace/document?${o.join("&")}`,
|
|
4505
4348
|
i
|
|
4506
4349
|
);
|
|
4507
4350
|
if (this.http.isResponseError())
|
|
4508
4351
|
throw this.http.latestResponse.statusText;
|
|
4509
|
-
return
|
|
4352
|
+
return a;
|
|
4510
4353
|
}
|
|
4511
4354
|
async updateFile(e, t, s) {
|
|
4512
4355
|
const { fullname: r, metadata: i } = this.extractMetadata(t), o = new FormData();
|
|
4513
4356
|
o.append("file", t, r);
|
|
4514
|
-
const
|
|
4515
|
-
i.role === "img" &&
|
|
4357
|
+
const a = [];
|
|
4358
|
+
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}`);
|
|
4516
4359
|
const c = await this.http.putFile(
|
|
4517
|
-
`/workspace/document/${e}?${
|
|
4360
|
+
`/workspace/document/${e}?${a.join("&")}`,
|
|
4518
4361
|
o
|
|
4519
4362
|
);
|
|
4520
4363
|
if (this.http.isResponseError())
|
|
@@ -4565,11 +4408,11 @@ class WorkspaceService {
|
|
|
4565
4408
|
);
|
|
4566
4409
|
if (this.http.isResponseError())
|
|
4567
4410
|
throw this.http.latestResponse.statusText;
|
|
4568
|
-
return r.forEach((o,
|
|
4411
|
+
return r.forEach((o, a) => {
|
|
4569
4412
|
const c = e.findIndex(
|
|
4570
4413
|
(l) => l._id === o._id
|
|
4571
4414
|
);
|
|
4572
|
-
0 <= c && c < e.length && (e[c] = i[
|
|
4415
|
+
0 <= c && c < e.length && (e[c] = i[a]);
|
|
4573
4416
|
}), e.filter((o) => !!o);
|
|
4574
4417
|
}
|
|
4575
4418
|
return e;
|
|
@@ -4584,12 +4427,12 @@ class WorkspaceService {
|
|
|
4584
4427
|
if (typeof e == "string")
|
|
4585
4428
|
return e.includes("data:image") || e.includes("thumbnail") ? e : `${e}${e.includes("?") ? "&" : "?"}thumbnail=${r}`;
|
|
4586
4429
|
{
|
|
4587
|
-
const
|
|
4430
|
+
const a = `/workspace/${e.public ? "pub/" : ""}document/${e._id}?thumbnail=`, c = e.thumbnails;
|
|
4588
4431
|
if ((o = (i = e.metadata) == null ? void 0 : i["content-type"]) != null && o.includes("video")) {
|
|
4589
4432
|
const l = c && Object.keys(c).length > 0 ? Object.keys(c)[0] : null;
|
|
4590
|
-
return l ?
|
|
4433
|
+
return l ? a + l : null;
|
|
4591
4434
|
} else
|
|
4592
|
-
return
|
|
4435
|
+
return a + r;
|
|
4593
4436
|
}
|
|
4594
4437
|
}
|
|
4595
4438
|
/**
|
|
@@ -4643,24 +4486,22 @@ class WorkspaceService {
|
|
|
4643
4486
|
}
|
|
4644
4487
|
class OdeServices {
|
|
4645
4488
|
constructor() {
|
|
4646
|
-
|
|
4647
|
-
|
|
4648
|
-
|
|
4649
|
-
|
|
4650
|
-
|
|
4651
|
-
|
|
4652
|
-
|
|
4653
|
-
|
|
4654
|
-
|
|
4655
|
-
|
|
4656
|
-
|
|
4657
|
-
|
|
4658
|
-
|
|
4659
|
-
|
|
4660
|
-
|
|
4661
|
-
|
|
4662
|
-
a(this, "_embedder");
|
|
4663
|
-
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._googledrive = new GoogleDriveService(this), this._http = new HttpService(this), this._idiom = new IdiomService(this), this._nextcloud = new NextcloudService(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._widget = new WidgetService(this), this._workspace = new WorkspaceService(this), this._embedder = new EmbedderService(this);
|
|
4489
|
+
u(this, "_analytics");
|
|
4490
|
+
u(this, "_cache");
|
|
4491
|
+
u(this, "_conf");
|
|
4492
|
+
u(this, "_data");
|
|
4493
|
+
u(this, "_directory");
|
|
4494
|
+
u(this, "_http");
|
|
4495
|
+
u(this, "_idiom");
|
|
4496
|
+
u(this, "_notify");
|
|
4497
|
+
u(this, "_rights");
|
|
4498
|
+
u(this, "_session");
|
|
4499
|
+
u(this, "_share");
|
|
4500
|
+
u(this, "_video");
|
|
4501
|
+
u(this, "_widget");
|
|
4502
|
+
u(this, "_workspace");
|
|
4503
|
+
u(this, "_embedder");
|
|
4504
|
+
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._widget = new WidgetService(this), this._workspace = new WorkspaceService(this), this._embedder = new EmbedderService(this);
|
|
4664
4505
|
}
|
|
4665
4506
|
initialize() {
|
|
4666
4507
|
return this._data.initialize(), this;
|
|
@@ -4683,18 +4524,12 @@ class OdeServices {
|
|
|
4683
4524
|
directory() {
|
|
4684
4525
|
return this._directory;
|
|
4685
4526
|
}
|
|
4686
|
-
googledrive() {
|
|
4687
|
-
return this._googledrive;
|
|
4688
|
-
}
|
|
4689
4527
|
http() {
|
|
4690
4528
|
return this._http;
|
|
4691
4529
|
}
|
|
4692
4530
|
idiom() {
|
|
4693
4531
|
return this._idiom;
|
|
4694
4532
|
}
|
|
4695
|
-
nextcloud() {
|
|
4696
|
-
return this._nextcloud;
|
|
4697
|
-
}
|
|
4698
4533
|
notify() {
|
|
4699
4534
|
return this._notify;
|
|
4700
4535
|
}
|
|
@@ -4870,10 +4705,10 @@ const isActionAvailable = (n, e) => {
|
|
|
4870
4705
|
class WidgetFramework {
|
|
4871
4706
|
constructor() {
|
|
4872
4707
|
//-------------------------------------
|
|
4873
|
-
|
|
4874
|
-
|
|
4708
|
+
u(this, "_initialized");
|
|
4709
|
+
u(this, "_widgets", []);
|
|
4875
4710
|
////////////////////////////////////// USER PREFERENCES
|
|
4876
|
-
|
|
4711
|
+
u(this, "_userPrefs", {});
|
|
4877
4712
|
}
|
|
4878
4713
|
initialize(e, t) {
|
|
4879
4714
|
return this._initialized || (this._initialized = new Promisified(), notify.onSessionReady().promise.then((s) => {
|
|
@@ -4916,20 +4751,20 @@ class WidgetFramework {
|
|
|
4916
4751
|
this._userPrefs = e ?? this._userPrefs;
|
|
4917
4752
|
const t = configure.Platform.theme, s = [];
|
|
4918
4753
|
t.listSkins().then((r) => {
|
|
4919
|
-
var
|
|
4920
|
-
const i = ((
|
|
4754
|
+
var a;
|
|
4755
|
+
const i = ((a = r.find((c) => c.child === t.skin)) == null ? void 0 : a.parent) === "panda" ? secondLevelWidgets : firstLevelWidgets;
|
|
4921
4756
|
this._widgets = this._widgets.filter((c, l) => {
|
|
4922
|
-
const
|
|
4923
|
-
return i.indexOf(
|
|
4924
|
-
index: defaultWidgetOrder[
|
|
4757
|
+
const h = c.platformConf.name;
|
|
4758
|
+
return i.indexOf(h) !== -1 ? !1 : (this._userPrefs[h] || (this._userPrefs[h] = {
|
|
4759
|
+
index: defaultWidgetOrder[h] ?? 999,
|
|
4925
4760
|
show: !0,
|
|
4926
4761
|
position: c.platformConf.position
|
|
4927
|
-
}), c.platformConf.mandatory && (this._userPrefs[
|
|
4762
|
+
}), c.platformConf.mandatory && (this._userPrefs[h].show = !0, this._userPrefs[h].index = defaultWidgetOrder[h] ?? 999), c.platformConf.i18n && s.push(c.platformConf.i18n), c.applyUserPref(this._userPrefs[h]), !0);
|
|
4928
4763
|
});
|
|
4929
4764
|
const o = new Idiom();
|
|
4930
4765
|
this._widgets = this._widgets.sort((c, l) => {
|
|
4931
|
-
const
|
|
4932
|
-
return
|
|
4766
|
+
const h = o.translate(`timeline.settings.${c.platformConf.name}`).toLowerCase(), E = o.translate(`timeline.settings.${l.platformConf.name}`).toLowerCase();
|
|
4767
|
+
return h < E ? -1 : h > E ? 1 : 0;
|
|
4933
4768
|
});
|
|
4934
4769
|
});
|
|
4935
4770
|
}
|
|
@@ -4937,8 +4772,8 @@ class WidgetFramework {
|
|
|
4937
4772
|
class Widget {
|
|
4938
4773
|
//-------------------------------------
|
|
4939
4774
|
constructor(e) {
|
|
4940
|
-
|
|
4941
|
-
|
|
4775
|
+
u(this, "_schoolConf", {});
|
|
4776
|
+
u(this, "_userPref");
|
|
4942
4777
|
this._platformConf = e, this._userPref = null;
|
|
4943
4778
|
}
|
|
4944
4779
|
get platformConf() {
|
|
@@ -4989,8 +4824,6 @@ export {
|
|
|
4989
4824
|
ERROR_CODE,
|
|
4990
4825
|
EVENT_NAME,
|
|
4991
4826
|
FOLDER,
|
|
4992
|
-
GOOGLE_DRIVE_FOLDER_MIME_TYPE,
|
|
4993
|
-
GoogleDriveCopyError,
|
|
4994
4827
|
ITimelineFactory,
|
|
4995
4828
|
LAYER_NAME,
|
|
4996
4829
|
NotifyFrameworkFactory,
|