@edifice.io/client 2.6.9-develop-integration.20261015175127 → 2.6.9-develop-b2school.20261016112251
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/calendar/interface.d.ts +22 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -3
- package/dist/index.js +330 -542
- package/dist/services/OdeServices.d.ts +0 -8
- package/package.json +3 -3
- package/dist/googledrive/Service.d.ts +0 -63
- package/dist/googledrive/interface.d.ts +0 -58
- 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([
|
|
@@ -1233,12 +1233,12 @@ class ConfigurationFramework {
|
|
|
1233
1233
|
// }
|
|
1234
1234
|
}
|
|
1235
1235
|
const configure = new ConfigurationFramework(), http = transport == null ? void 0 : transport.http;
|
|
1236
|
-
var
|
|
1237
|
-
const me = (
|
|
1236
|
+
var _;
|
|
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,126 +1355,7 @@ const ReactionTypes = [
|
|
|
1355
1355
|
"REACTION_2",
|
|
1356
1356
|
"REACTION_3",
|
|
1357
1357
|
"REACTION_4"
|
|
1358
|
-
], GOOGLE_DRIVE_FOLDER_MIME_TYPE = "application/vnd.google-apps.folder", GOOGLE_DRIVE_NATIVE_MIME_TYPE_PREFIX = "application/vnd.google-apps.", GOOGLE_DRIVE_EXPORTABLE_MIME_TYPES = [
|
|
1359
|
-
"application/vnd.google-apps.document",
|
|
1360
|
-
"application/vnd.google-apps.spreadsheet",
|
|
1361
|
-
"application/vnd.google-apps.presentation"
|
|
1362
1358
|
];
|
|
1363
|
-
function toGoogleDriveDocument(n) {
|
|
1364
|
-
const e = n.mimeType === GOOGLE_DRIVE_FOLDER_MIME_TYPE;
|
|
1365
|
-
return {
|
|
1366
|
-
id: n.id,
|
|
1367
|
-
name: n.name,
|
|
1368
|
-
ownerDisplayName: n.ownerDisplayName,
|
|
1369
|
-
contentType: n.mimeType,
|
|
1370
|
-
size: n.size,
|
|
1371
|
-
isFolder: e,
|
|
1372
|
-
canCopyToWorkspace: e || !n.mimeType.startsWith(GOOGLE_DRIVE_NATIVE_MIME_TYPE_PREFIX) || GOOGLE_DRIVE_EXPORTABLE_MIME_TYPES.includes(n.mimeType),
|
|
1373
|
-
lastModified: n.modifiedTime,
|
|
1374
|
-
shared: n.shared
|
|
1375
|
-
};
|
|
1376
|
-
}
|
|
1377
|
-
class GoogleDriveCopyError extends Error {
|
|
1378
|
-
constructor(e, t, s) {
|
|
1379
|
-
super(e), this.copied = t, this.failures = s, this.name = "GoogleDriveCopyError";
|
|
1380
|
-
}
|
|
1381
|
-
}
|
|
1382
|
-
class GoogleDriveService {
|
|
1383
|
-
constructor(e) {
|
|
1384
|
-
this.context = e;
|
|
1385
|
-
}
|
|
1386
|
-
get http() {
|
|
1387
|
-
return this.context.http();
|
|
1388
|
-
}
|
|
1389
|
-
/**
|
|
1390
|
-
* List a user's Google Drive documents and folders inside a given folder.
|
|
1391
|
-
*
|
|
1392
|
-
* Google Drive addresses its entries by opaque id, not by path: `parentId` is
|
|
1393
|
-
* the id of the folder to list. The query param is nonetheless named `path`,
|
|
1394
|
-
* as the backend kept the name it uses for Nextcloud.
|
|
1395
|
-
*
|
|
1396
|
-
* @param userId - the id of the user whose files are listed.
|
|
1397
|
-
* @param parentId - id of the folder to list; the Drive root when omitted.
|
|
1398
|
-
*/
|
|
1399
|
-
async listDocuments(e, t) {
|
|
1400
|
-
return (await this.http.get(
|
|
1401
|
-
`/googledrive/files/user/${e}`,
|
|
1402
|
-
{ queryParams: t ? { path: t } : void 0 }
|
|
1403
|
-
)).data.map(toGoogleDriveDocument);
|
|
1404
|
-
}
|
|
1405
|
-
/**
|
|
1406
|
-
* List the documents and folders other users shared with a user. Browse the
|
|
1407
|
-
* content of a shared folder with `listDocuments`, from the folder's id.
|
|
1408
|
-
*
|
|
1409
|
-
* As in the legacy workspace, only a document shared for editing can be
|
|
1410
|
-
* copied to the workspace: an owner can forbid readers and commenters to
|
|
1411
|
-
* download a file (copyRequiresWriterPermission), which fails the copy.
|
|
1412
|
-
*
|
|
1413
|
-
* @param userId - the id of the user the documents are shared with.
|
|
1414
|
-
*/
|
|
1415
|
-
async listSharedDocuments(e) {
|
|
1416
|
-
return (await this.http.get(`/googledrive/files/user/${e}/shared`)).data.map(({ owners: s, role: r, ...i }) => {
|
|
1417
|
-
var u;
|
|
1418
|
-
const o = toGoogleDriveDocument({
|
|
1419
|
-
...i,
|
|
1420
|
-
ownerDisplayName: (u = s == null ? void 0 : s[0]) == null ? void 0 : u.displayName
|
|
1421
|
-
});
|
|
1422
|
-
return {
|
|
1423
|
-
...o,
|
|
1424
|
-
canCopyToWorkspace: o.canCopyToWorkspace && r === "writer"
|
|
1425
|
-
};
|
|
1426
|
-
});
|
|
1427
|
-
}
|
|
1428
|
-
/**
|
|
1429
|
-
* Copy Google Drive documents into the entcore workspace.
|
|
1430
|
-
*
|
|
1431
|
-
* @param userId - the id of the user whose files are copied.
|
|
1432
|
-
* @param ids - Drive ids of the documents to copy.
|
|
1433
|
-
* @param parentId - the workspace folder to copy into; user's root when omitted.
|
|
1434
|
-
* @param params.application - the application the documents are added from.
|
|
1435
|
-
* @param params.visibility - "protected" files the documents under the
|
|
1436
|
-
* documents added from applications, the way an upload does.
|
|
1437
|
-
* @throws GoogleDriveCopyError when the backend reports at least one failure.
|
|
1438
|
-
*/
|
|
1439
|
-
async copyDocumentToWorkspace(e, t, s, r) {
|
|
1440
|
-
const i = t.map((d) => `id=${encodeURIComponent(d)}`).join("&"), u = (await this.http.put(
|
|
1441
|
-
`/googledrive/files/user/${e}/copy/workspace?${i}`,
|
|
1442
|
-
void 0,
|
|
1443
|
-
{
|
|
1444
|
-
queryParams: {
|
|
1445
|
-
...s ? { parentId: s } : {},
|
|
1446
|
-
...r != null && r.application ? { application: r.application } : {},
|
|
1447
|
-
...(r == null ? void 0 : r.visibility) === "protected" ? { protected: !0 } : {}
|
|
1448
|
-
}
|
|
1449
|
-
}
|
|
1450
|
-
)).data ?? [], c = u.map((d) => d.workspace).filter((d) => !!(d != null && d._id)), l = new Set(u.map((d) => d.id)), p = [
|
|
1451
|
-
...u.filter((d) => {
|
|
1452
|
-
var h;
|
|
1453
|
-
return d.status === "error" || !((h = d.workspace) != null && h._id);
|
|
1454
|
-
}).map(({ id: d, message: h }) => ({ id: d, message: h })),
|
|
1455
|
-
...t.filter((d) => !l.has(d)).map((d) => ({ id: d, message: void 0 }))
|
|
1456
|
-
];
|
|
1457
|
-
if (p.length > 0)
|
|
1458
|
-
throw new GoogleDriveCopyError(
|
|
1459
|
-
`Failed to copy ${p.length} of ${t.length} Google Drive document(s) to the workspace`,
|
|
1460
|
-
c,
|
|
1461
|
-
p
|
|
1462
|
-
);
|
|
1463
|
-
return c;
|
|
1464
|
-
}
|
|
1465
|
-
/**
|
|
1466
|
-
* Build the URL to download/preview a Google Drive document.
|
|
1467
|
-
* There is no dedicated thumbnail endpoint on the backend, so this is also
|
|
1468
|
-
* used as an image preview source for image documents.
|
|
1469
|
-
* @param userId - the id of the user who owns the file.
|
|
1470
|
-
* @param doc - the document to build the URL for.
|
|
1471
|
-
*/
|
|
1472
|
-
getFileUrl(e, t) {
|
|
1473
|
-
return `/googledrive/files/user/${e}/file/${encodeURIComponent(
|
|
1474
|
-
t.id
|
|
1475
|
-
)}/download?isFolder=${t.isFolder}`;
|
|
1476
|
-
}
|
|
1477
|
-
}
|
|
1478
1359
|
class NotifyFrameworkFactory {
|
|
1479
1360
|
static instance() {
|
|
1480
1361
|
return notify;
|
|
@@ -1533,7 +1414,7 @@ const m = class m {
|
|
|
1533
1414
|
//
|
|
1534
1415
|
// PROTECTED HELPERS
|
|
1535
1416
|
//
|
|
1536
|
-
|
|
1417
|
+
u(this, "checkHttpResponse", (e) => {
|
|
1537
1418
|
if (this.http.latestResponse.status >= 300)
|
|
1538
1419
|
throw this.http.latestResponse.statusText;
|
|
1539
1420
|
return e;
|
|
@@ -1751,22 +1632,22 @@ const m = class m {
|
|
|
1751
1632
|
//
|
|
1752
1633
|
// STATIC REGISTRY
|
|
1753
1634
|
//
|
|
1754
|
-
|
|
1755
|
-
|
|
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));
|
|
1756
1637
|
let ResourceService = m;
|
|
1757
1638
|
const APP$3 = "collaborativeeditor", RESOURCE$3 = "collaborativeeditor";
|
|
1758
1639
|
class CollaborativeEditorResourceService extends ResourceService {
|
|
1759
1640
|
async create(e) {
|
|
1760
|
-
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", {
|
|
1761
1642
|
name: t,
|
|
1762
1643
|
description: s,
|
|
1763
1644
|
thumbnail: o,
|
|
1764
1645
|
folder: i
|
|
1765
1646
|
});
|
|
1766
|
-
return this.checkHttpResponse(
|
|
1647
|
+
return this.checkHttpResponse(a), a;
|
|
1767
1648
|
}
|
|
1768
1649
|
async update(e) {
|
|
1769
|
-
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(
|
|
1770
1651
|
`/collaborativeeditor/${i}`,
|
|
1771
1652
|
{
|
|
1772
1653
|
name: t,
|
|
@@ -1774,7 +1655,7 @@ class CollaborativeEditorResourceService extends ResourceService {
|
|
|
1774
1655
|
thumbnail: o
|
|
1775
1656
|
}
|
|
1776
1657
|
);
|
|
1777
|
-
return this.checkHttpResponse(
|
|
1658
|
+
return this.checkHttpResponse(a), { thumbnail: o, entId: i };
|
|
1778
1659
|
}
|
|
1779
1660
|
getResourceType() {
|
|
1780
1661
|
return RESOURCE$3;
|
|
@@ -2029,9 +1910,9 @@ class AnalyticsService {
|
|
|
2029
1910
|
let r;
|
|
2030
1911
|
if (!(t != null && t.structures)) return;
|
|
2031
1912
|
for (const l of t.structures) {
|
|
2032
|
-
const
|
|
2033
|
-
if (
|
|
2034
|
-
r =
|
|
1913
|
+
const h = n.structureMap[l];
|
|
1914
|
+
if (h && h.collectiviteId && h.UAI) {
|
|
1915
|
+
r = h;
|
|
2035
1916
|
break;
|
|
2036
1917
|
}
|
|
2037
1918
|
}
|
|
@@ -2040,11 +1921,11 @@ class AnalyticsService {
|
|
|
2040
1921
|
if (!i) return;
|
|
2041
1922
|
const o = i.xiti;
|
|
2042
1923
|
if (!o || !o.LIBELLE_SERVICE || !r.UAI) return;
|
|
2043
|
-
function
|
|
2044
|
-
let
|
|
2045
|
-
for (let
|
|
2046
|
-
|
|
2047
|
-
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;
|
|
2048
1929
|
}
|
|
2049
1930
|
const c = {
|
|
2050
1931
|
Student: "ELEVE",
|
|
@@ -2063,7 +1944,7 @@ class AnalyticsService {
|
|
|
2063
1944
|
PROJET: r.projetId ? r.projetId : n.ID_PROJET,
|
|
2064
1945
|
EXPLOITANT: n.ID_EXPLOITANT,
|
|
2065
1946
|
PLATFORME: r.plateformeId ? r.plateformeId : n.ID_PLATEFORME,
|
|
2066
|
-
ID_PERSO:
|
|
1947
|
+
ID_PERSO: a(t.userId),
|
|
2067
1948
|
PROFILE: s && s.length > 0 ? c[s[0]] ?? "" : ""
|
|
2068
1949
|
};
|
|
2069
1950
|
}
|
|
@@ -2298,25 +2179,25 @@ class ConfService {
|
|
|
2298
2179
|
conf: t,
|
|
2299
2180
|
publicTheme: s
|
|
2300
2181
|
}) {
|
|
2301
|
-
var
|
|
2302
|
-
const r = await this.http.get("/theme"), i = (
|
|
2303
|
-
(
|
|
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) => (
|
|
2304
2185
|
// Fix #WB2-2660:
|
|
2305
2186
|
// If Public access => get the neo theme
|
|
2306
2187
|
// Else get the theme from the user preference
|
|
2307
|
-
s ?
|
|
2188
|
+
s ? p.parent === "theme-open-ent" && p.bootstrapVersion === "ode-bootstrap-neo" : p.child === (r == null ? void 0 : r.themeName)
|
|
2308
2189
|
)
|
|
2309
|
-
), 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";
|
|
2310
2191
|
return {
|
|
2311
|
-
basePath: `${this.cdnDomain}${
|
|
2192
|
+
basePath: `${this.cdnDomain}${a}../../`,
|
|
2312
2193
|
bootstrapVersion: l,
|
|
2313
|
-
is1d:
|
|
2194
|
+
is1d: h,
|
|
2314
2195
|
logoutCallback: (r == null ? void 0 : r.logoutCallback) || "",
|
|
2315
2196
|
skin: i == null ? void 0 : i.child,
|
|
2316
2197
|
skinName: o,
|
|
2317
2198
|
skins: c,
|
|
2318
2199
|
themeName: i == null ? void 0 : i.child,
|
|
2319
|
-
themeUrl:
|
|
2200
|
+
themeUrl: a,
|
|
2320
2201
|
npmTheme: (i == null ? void 0 : i.npmTheme) ?? void 0,
|
|
2321
2202
|
uiOverrides: i == null ? void 0 : i.uiOverrides
|
|
2322
2203
|
};
|
|
@@ -2333,7 +2214,7 @@ class ConfService {
|
|
|
2333
2214
|
const SEND_ALL = "*";
|
|
2334
2215
|
class WebBroker {
|
|
2335
2216
|
constructor(e) {
|
|
2336
|
-
|
|
2217
|
+
u(this, "subscription");
|
|
2337
2218
|
this.odeServices = e;
|
|
2338
2219
|
}
|
|
2339
2220
|
get http() {
|
|
@@ -2365,10 +2246,10 @@ class WebBroker {
|
|
|
2365
2246
|
}
|
|
2366
2247
|
class DataService {
|
|
2367
2248
|
constructor(e) {
|
|
2368
|
-
|
|
2369
|
-
|
|
2370
|
-
|
|
2371
|
-
|
|
2249
|
+
u(this, "_webBroker");
|
|
2250
|
+
u(this, "app");
|
|
2251
|
+
u(this, "user");
|
|
2252
|
+
u(this, "profile");
|
|
2372
2253
|
this.odeServices = e;
|
|
2373
2254
|
}
|
|
2374
2255
|
get conf() {
|
|
@@ -2402,7 +2283,7 @@ class DataService {
|
|
|
2402
2283
|
addUserInfos(e) {
|
|
2403
2284
|
return this.user && (e.userId = this.user.userId, e.structure = this.user.structureNames[0]), this.profile && (e.profil = this.profile[0]), e;
|
|
2404
2285
|
}
|
|
2405
|
-
trackVideoSave(e, t, s, r, i, o,
|
|
2286
|
+
trackVideoSave(e, t, s, r, i, o, a) {
|
|
2406
2287
|
const c = this.addUserInfos({
|
|
2407
2288
|
"event-type": "VIDEO_SAVE",
|
|
2408
2289
|
module: this.app || "video",
|
|
@@ -2413,7 +2294,7 @@ class DataService {
|
|
|
2413
2294
|
source: r ? "CAPTURED" : "UPLOADED",
|
|
2414
2295
|
url: i
|
|
2415
2296
|
});
|
|
2416
|
-
|
|
2297
|
+
a && (c.device_type = a), this.trackWebEvent(c);
|
|
2417
2298
|
}
|
|
2418
2299
|
trackVideoRead(e, t, s, r, i) {
|
|
2419
2300
|
const o = this.addUserInfos({
|
|
@@ -2481,14 +2362,14 @@ class DirectoryService {
|
|
|
2481
2362
|
id: s,
|
|
2482
2363
|
displayName: r,
|
|
2483
2364
|
notVisibleCount: o,
|
|
2484
|
-
groups: t.map(({ name:
|
|
2365
|
+
groups: t.map(({ name: a, id: c, nbUsers: l }) => ({
|
|
2485
2366
|
nbUsers: l,
|
|
2486
|
-
displayName:
|
|
2367
|
+
displayName: a,
|
|
2487
2368
|
id: c
|
|
2488
2369
|
})),
|
|
2489
|
-
users: i.map(({ displayName:
|
|
2370
|
+
users: i.map(({ displayName: a, id: c, profile: l }) => ({
|
|
2490
2371
|
profile: l,
|
|
2491
|
-
displayName:
|
|
2372
|
+
displayName: a,
|
|
2492
2373
|
// these info are missing from api
|
|
2493
2374
|
firstName: "",
|
|
2494
2375
|
lastName: "",
|
|
@@ -2503,9 +2384,9 @@ class DirectoryService {
|
|
|
2503
2384
|
users: r
|
|
2504
2385
|
}) {
|
|
2505
2386
|
this.cache.clearCache("/directory/sharebookmark/all");
|
|
2506
|
-
const i = r.map((
|
|
2507
|
-
if (typeof
|
|
2508
|
-
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);
|
|
2509
2390
|
return {
|
|
2510
2391
|
displayName: y,
|
|
2511
2392
|
id: g,
|
|
@@ -2513,19 +2394,19 @@ class DirectoryService {
|
|
|
2513
2394
|
members: [...F, ...w]
|
|
2514
2395
|
};
|
|
2515
2396
|
} else
|
|
2516
|
-
return Promise.resolve(
|
|
2517
|
-
}), 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 = {
|
|
2518
2399
|
name: e,
|
|
2519
2400
|
members: [...i, ...o, ...l]
|
|
2520
|
-
}, { id:
|
|
2401
|
+
}, { id: E } = await this.http.postJson(
|
|
2521
2402
|
"/directory/sharebookmark",
|
|
2522
|
-
|
|
2403
|
+
h
|
|
2523
2404
|
);
|
|
2524
2405
|
return {
|
|
2525
|
-
id:
|
|
2406
|
+
id: E,
|
|
2526
2407
|
displayName: e,
|
|
2527
2408
|
notVisibleCount: 0,
|
|
2528
|
-
members:
|
|
2409
|
+
members: h.members
|
|
2529
2410
|
};
|
|
2530
2411
|
}
|
|
2531
2412
|
}
|
|
@@ -2564,10 +2445,10 @@ class EmbedderService {
|
|
|
2564
2445
|
urlIsFromPattern(e, t) {
|
|
2565
2446
|
const s = new RegExp("[^{}]+(?=(?:[^{}]*{[^}]*})*[^}]*$)", "g"), r = new RegExp("{[^}]*}", "g");
|
|
2566
2447
|
let i = !0;
|
|
2567
|
-
const o = t.match(s) || [],
|
|
2568
|
-
return (t.match(r) || []).forEach((l,
|
|
2569
|
-
l.includes("ignore") ||
|
|
2570
|
-
}),
|
|
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) => {
|
|
2571
2452
|
if (!e.includes(l)) {
|
|
2572
2453
|
i = !1;
|
|
2573
2454
|
return;
|
|
@@ -2598,17 +2479,17 @@ class EmbedderService {
|
|
|
2598
2479
|
if (this.urlIsFromPattern(t, s)) {
|
|
2599
2480
|
const r = new RegExp("{[a-zA-Z0-9_.]+}", "g"), i = s.match(r) || [];
|
|
2600
2481
|
let o = e.embed;
|
|
2601
|
-
for (const
|
|
2602
|
-
let c = s.split(
|
|
2482
|
+
for (const a of i) {
|
|
2483
|
+
let c = s.split(a)[0];
|
|
2603
2484
|
const l = c.split("}");
|
|
2604
2485
|
l.length > 1 && (c = l[l.length - 1]);
|
|
2605
|
-
let
|
|
2606
|
-
if (!
|
|
2486
|
+
let h = t.split(c)[1];
|
|
2487
|
+
if (!h)
|
|
2607
2488
|
continue;
|
|
2608
|
-
const
|
|
2609
|
-
|
|
2610
|
-
const
|
|
2611
|
-
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);
|
|
2612
2493
|
}
|
|
2613
2494
|
return o;
|
|
2614
2495
|
}
|
|
@@ -2862,9 +2743,9 @@ class IdiomService {
|
|
|
2862
2743
|
const i = new Promisified();
|
|
2863
2744
|
promises[t] = i.promise;
|
|
2864
2745
|
const o = {};
|
|
2865
|
-
e && (o["Accept-Language"] = e), this.http.get(t, { headers: o }).then((
|
|
2866
|
-
Object.assign(bundle,
|
|
2867
|
-
}).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) => {
|
|
2868
2749
|
typeof s == "function" && s(), i.reject();
|
|
2869
2750
|
});
|
|
2870
2751
|
}
|
|
@@ -2897,89 +2778,6 @@ class IdiomService {
|
|
|
2897
2778
|
return e;
|
|
2898
2779
|
}
|
|
2899
2780
|
}
|
|
2900
|
-
function toRelativePath(n, e) {
|
|
2901
|
-
const t = `/remote.php/dav/files/${e}`, s = n.startsWith(t) ? n.slice(t.length) : n;
|
|
2902
|
-
return decodeURIComponent(s || "/");
|
|
2903
|
-
}
|
|
2904
|
-
function toNextcloudDocument(n, e) {
|
|
2905
|
-
return {
|
|
2906
|
-
path: toRelativePath(n.path, e),
|
|
2907
|
-
name: decodeURIComponent(n.displayname),
|
|
2908
|
-
ownerDisplayName: n.ownerDisplayName,
|
|
2909
|
-
contentType: n.contentType,
|
|
2910
|
-
size: n.size,
|
|
2911
|
-
favorite: n.favorite,
|
|
2912
|
-
etag: n.etag,
|
|
2913
|
-
fileId: n.fileId,
|
|
2914
|
-
isFolder: n.isFolder,
|
|
2915
|
-
lastModified: n.lastModified
|
|
2916
|
-
};
|
|
2917
|
-
}
|
|
2918
|
-
class NextcloudService {
|
|
2919
|
-
constructor(e) {
|
|
2920
|
-
this.context = e;
|
|
2921
|
-
}
|
|
2922
|
-
get http() {
|
|
2923
|
-
return this.context.http();
|
|
2924
|
-
}
|
|
2925
|
-
/**
|
|
2926
|
-
* List a user's Nextcloud documents and folders at a given path.
|
|
2927
|
-
* @param userId - the id of the user whose files are listed.
|
|
2928
|
-
* @param path - path to list, relative to the user's Nextcloud root; root when omitted.
|
|
2929
|
-
*/
|
|
2930
|
-
async listDocuments(e, t) {
|
|
2931
|
-
return (await this.http.get(
|
|
2932
|
-
`/nextcloud/files/user/${e}`,
|
|
2933
|
-
{ queryParams: t ? { path: t } : void 0 }
|
|
2934
|
-
)).data.map((r) => toNextcloudDocument(r, e));
|
|
2935
|
-
}
|
|
2936
|
-
/**
|
|
2937
|
-
* Copy Nextcloud documents into the entcore workspace.
|
|
2938
|
-
* @param userId - the id of the user whose files are copied.
|
|
2939
|
-
* @param paths - paths of the documents to copy, relative to the user's Nextcloud root.
|
|
2940
|
-
* @param parentId - the workspace folder to copy into; user's root when omitted.
|
|
2941
|
-
* @param params.application - the application the documents are added from.
|
|
2942
|
-
* @param params.visibility - "protected" files the documents under the
|
|
2943
|
-
* documents added from applications, the way an upload does.
|
|
2944
|
-
*/
|
|
2945
|
-
async copyDocumentToWorkspace(e, t, s, r) {
|
|
2946
|
-
const i = t.map((u) => `path=${encodeURIComponent(u)}`).join("&");
|
|
2947
|
-
return (await this.http.put(
|
|
2948
|
-
`/nextcloud/files/user/${e}/copy/workspace?${i}`,
|
|
2949
|
-
void 0,
|
|
2950
|
-
{
|
|
2951
|
-
queryParams: {
|
|
2952
|
-
...s ? { parentId: s } : {},
|
|
2953
|
-
...r != null && r.application ? { application: r.application } : {},
|
|
2954
|
-
...(r == null ? void 0 : r.visibility) === "protected" ? { protected: !0 } : {}
|
|
2955
|
-
}
|
|
2956
|
-
}
|
|
2957
|
-
)).data.filter((u) => !!(u != null && u._id));
|
|
2958
|
-
}
|
|
2959
|
-
/**
|
|
2960
|
-
* Check whether a user has an active Nextcloud OAuth2 connection.
|
|
2961
|
-
* @param userId - the id of the user to check.
|
|
2962
|
-
*/
|
|
2963
|
-
async getOauth2Status(e) {
|
|
2964
|
-
return this.http.get(
|
|
2965
|
-
`/nextcloud/user/${e}/oauth2/status`
|
|
2966
|
-
);
|
|
2967
|
-
}
|
|
2968
|
-
/**
|
|
2969
|
-
* Build the URL to download/preview a Nextcloud document.
|
|
2970
|
-
* There is no dedicated thumbnail endpoint on the backend, so this is also
|
|
2971
|
-
* used as an image preview source for image documents.
|
|
2972
|
-
* @param userId - the id of the user who owns the file.
|
|
2973
|
-
* @param doc - the document to build the URL for.
|
|
2974
|
-
*/
|
|
2975
|
-
getFileUrl(e, t) {
|
|
2976
|
-
return `/nextcloud/files/user/${e}/file/${encodeURIComponent(
|
|
2977
|
-
t.name
|
|
2978
|
-
)}/download?path=${encodeURIComponent(
|
|
2979
|
-
t.path
|
|
2980
|
-
)}&contentType=${encodeURIComponent(t.contentType ?? "")}&isFolder=${t.isFolder}`;
|
|
2981
|
-
}
|
|
2982
|
-
}
|
|
2983
2781
|
class AbstractBehaviourService {
|
|
2984
2782
|
//
|
|
2985
2783
|
// IMPLEMENTATION
|
|
@@ -2988,7 +2786,7 @@ class AbstractBehaviourService {
|
|
|
2988
2786
|
//-----------------
|
|
2989
2787
|
//--- Utilities ---
|
|
2990
2788
|
//-----------------
|
|
2991
|
-
|
|
2789
|
+
u(this, "_cache");
|
|
2992
2790
|
this.context = e, this._cache = new CacheService(this.context);
|
|
2993
2791
|
}
|
|
2994
2792
|
getApplication() {
|
|
@@ -3022,8 +2820,8 @@ class AbstractBehaviourService {
|
|
|
3022
2820
|
class ActualitesBehaviour extends AbstractBehaviourService {
|
|
3023
2821
|
constructor() {
|
|
3024
2822
|
super(...arguments);
|
|
3025
|
-
|
|
3026
|
-
|
|
2823
|
+
u(this, "APP", "actualites");
|
|
2824
|
+
u(this, "RESOURCE", "actualites");
|
|
3027
2825
|
}
|
|
3028
2826
|
async loadResources() {
|
|
3029
2827
|
const [t, s] = await Promise.all([
|
|
@@ -3034,10 +2832,10 @@ class ActualitesBehaviour extends AbstractBehaviourService {
|
|
|
3034
2832
|
/* @__PURE__ */ new Map()
|
|
3035
2833
|
);
|
|
3036
2834
|
return t.map((i) => {
|
|
3037
|
-
var
|
|
2835
|
+
var a;
|
|
3038
2836
|
let o;
|
|
3039
2837
|
return i.threadIcon ? o = i.threadIcon + "?thumbnail=48x48" : o = "/img/icons/glyphicons_036_file.png", this.dataToResource({
|
|
3040
|
-
title: i.title + " [" + ((
|
|
2838
|
+
title: i.title + " [" + ((a = r.get(i.threadId)) == null ? void 0 : a.title) + "]",
|
|
3041
2839
|
ownerName: i.owner.displayName,
|
|
3042
2840
|
owner: i.owner.id,
|
|
3043
2841
|
icon: o,
|
|
@@ -3058,8 +2856,8 @@ const hexToDataUrl = (n, e = 1, t = 1) => {
|
|
|
3058
2856
|
class AppointmentsBehaviour extends AbstractBehaviourService {
|
|
3059
2857
|
constructor() {
|
|
3060
2858
|
super(...arguments);
|
|
3061
|
-
|
|
3062
|
-
|
|
2859
|
+
u(this, "APP", "appointments");
|
|
2860
|
+
u(this, "RESOURCE", "appointments");
|
|
3063
2861
|
}
|
|
3064
2862
|
async loadResources() {
|
|
3065
2863
|
return (await this.httpGet("/appointments/grids/linker")).map((s) => this.dataToResource({
|
|
@@ -3077,8 +2875,8 @@ class AppointmentsBehaviour extends AbstractBehaviourService {
|
|
|
3077
2875
|
class BlogBehaviour extends AbstractBehaviourService {
|
|
3078
2876
|
constructor() {
|
|
3079
2877
|
super(...arguments);
|
|
3080
|
-
|
|
3081
|
-
|
|
2878
|
+
u(this, "APP", "blog");
|
|
2879
|
+
u(this, "RESOURCE", "blog");
|
|
3082
2880
|
}
|
|
3083
2881
|
loadResources() {
|
|
3084
2882
|
return new Promise(async (t, s) => {
|
|
@@ -3086,7 +2884,7 @@ class BlogBehaviour extends AbstractBehaviourService {
|
|
|
3086
2884
|
const r = await this.httpGet("/blog/linker"), i = [];
|
|
3087
2885
|
r.forEach((o) => {
|
|
3088
2886
|
o.thumbnail ? o.thumbnail = o.thumbnail + "?thumbnail=48x48" : o.thumbnail = "/img/illustrations/blog.svg";
|
|
3089
|
-
const
|
|
2887
|
+
const a = o.fetchPosts.map((c) => this.dataToResource({
|
|
3090
2888
|
owner: o.author.userId,
|
|
3091
2889
|
ownerName: o.author.username,
|
|
3092
2890
|
title: c.title + " [" + o.title + "]",
|
|
@@ -3096,7 +2894,7 @@ class BlogBehaviour extends AbstractBehaviourService {
|
|
|
3096
2894
|
shared: !!(o.shared && o.shared.length >= 0),
|
|
3097
2895
|
modified: o.modified
|
|
3098
2896
|
}));
|
|
3099
|
-
i.push(...
|
|
2897
|
+
i.push(...a);
|
|
3100
2898
|
}), t(i);
|
|
3101
2899
|
} catch (r) {
|
|
3102
2900
|
s(r);
|
|
@@ -3107,8 +2905,8 @@ class BlogBehaviour extends AbstractBehaviourService {
|
|
|
3107
2905
|
class CollaborativewallBehaviour extends AbstractBehaviourService {
|
|
3108
2906
|
constructor() {
|
|
3109
2907
|
super(...arguments);
|
|
3110
|
-
|
|
3111
|
-
|
|
2908
|
+
u(this, "APP", "collaborativewall");
|
|
2909
|
+
u(this, "RESOURCE", "collaborativewall");
|
|
3112
2910
|
}
|
|
3113
2911
|
async loadResources() {
|
|
3114
2912
|
return (await this.httpGet(
|
|
@@ -3130,8 +2928,8 @@ class CollaborativewallBehaviour extends AbstractBehaviourService {
|
|
|
3130
2928
|
class CommunityBehaviour extends AbstractBehaviourService {
|
|
3131
2929
|
constructor() {
|
|
3132
2930
|
super(...arguments);
|
|
3133
|
-
|
|
3134
|
-
|
|
2931
|
+
u(this, "APP", "community");
|
|
2932
|
+
u(this, "RESOURCE", "community");
|
|
3135
2933
|
}
|
|
3136
2934
|
async loadResources() {
|
|
3137
2935
|
return (await this.httpGet(
|
|
@@ -3155,8 +2953,8 @@ class CommunityBehaviour extends AbstractBehaviourService {
|
|
|
3155
2953
|
class ExercizerBehaviour extends AbstractBehaviourService {
|
|
3156
2954
|
constructor() {
|
|
3157
2955
|
super(...arguments);
|
|
3158
|
-
|
|
3159
|
-
|
|
2956
|
+
u(this, "APP", "exercizer");
|
|
2957
|
+
u(this, "RESOURCE", "exercizer");
|
|
3160
2958
|
}
|
|
3161
2959
|
async loadResources() {
|
|
3162
2960
|
return (await this.httpGet(
|
|
@@ -3164,8 +2962,8 @@ class ExercizerBehaviour extends AbstractBehaviourService {
|
|
|
3164
2962
|
)).map((s) => {
|
|
3165
2963
|
const r = s.picture ? s.picture + "?thumbnail=48x48" : "/img/illustrations/exercizer.svg";
|
|
3166
2964
|
let i, o = !1;
|
|
3167
|
-
const
|
|
3168
|
-
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({
|
|
3169
2967
|
title: s.title,
|
|
3170
2968
|
owner: s.owner,
|
|
3171
2969
|
ownerName: i,
|
|
@@ -3181,8 +2979,8 @@ class ExercizerBehaviour extends AbstractBehaviourService {
|
|
|
3181
2979
|
class FormulaireBehaviour extends AbstractBehaviourService {
|
|
3182
2980
|
constructor() {
|
|
3183
2981
|
super(...arguments);
|
|
3184
|
-
|
|
3185
|
-
|
|
2982
|
+
u(this, "APP", "formulaire");
|
|
2983
|
+
u(this, "RESOURCE", "formulaire");
|
|
3186
2984
|
}
|
|
3187
2985
|
async loadResources() {
|
|
3188
2986
|
return (await this.httpGet(
|
|
@@ -3202,8 +3000,8 @@ class FormulaireBehaviour extends AbstractBehaviourService {
|
|
|
3202
3000
|
class ForumBehaviour extends AbstractBehaviourService {
|
|
3203
3001
|
constructor() {
|
|
3204
3002
|
super(...arguments);
|
|
3205
|
-
|
|
3206
|
-
|
|
3003
|
+
u(this, "APP", "forum");
|
|
3004
|
+
u(this, "RESOURCE", "forum");
|
|
3207
3005
|
}
|
|
3208
3006
|
async loadResources() {
|
|
3209
3007
|
return (await this.httpGet("/forum/categories")).map(
|
|
@@ -3223,8 +3021,8 @@ class ForumBehaviour extends AbstractBehaviourService {
|
|
|
3223
3021
|
class HomeworksBehaviour extends AbstractBehaviourService {
|
|
3224
3022
|
constructor() {
|
|
3225
3023
|
super(...arguments);
|
|
3226
|
-
|
|
3227
|
-
|
|
3024
|
+
u(this, "APP", "homeworks");
|
|
3025
|
+
u(this, "RESOURCE", "homeworks");
|
|
3228
3026
|
}
|
|
3229
3027
|
async loadResources() {
|
|
3230
3028
|
return (await this.httpGet("/homeworks/list")).filter((t) => t.owner && t.trashed === 0).map((t) => this.dataToResource({
|
|
@@ -3242,8 +3040,8 @@ class HomeworksBehaviour extends AbstractBehaviourService {
|
|
|
3242
3040
|
class MagnetoBehaviour extends AbstractBehaviourService {
|
|
3243
3041
|
constructor() {
|
|
3244
3042
|
super(...arguments);
|
|
3245
|
-
|
|
3246
|
-
|
|
3043
|
+
u(this, "APP", "magneto");
|
|
3044
|
+
u(this, "RESOURCE", "magneto");
|
|
3247
3045
|
}
|
|
3248
3046
|
async loadResources() {
|
|
3249
3047
|
const { all: t } = await this.httpGet(
|
|
@@ -3264,8 +3062,8 @@ class MagnetoBehaviour extends AbstractBehaviourService {
|
|
|
3264
3062
|
class MindmapBehaviour extends AbstractBehaviourService {
|
|
3265
3063
|
constructor() {
|
|
3266
3064
|
super(...arguments);
|
|
3267
|
-
|
|
3268
|
-
|
|
3065
|
+
u(this, "APP", "mindmap");
|
|
3066
|
+
u(this, "RESOURCE", "mindmap");
|
|
3269
3067
|
}
|
|
3270
3068
|
async loadResources() {
|
|
3271
3069
|
return (await this.httpGet("/mindmap/list/all")).map(
|
|
@@ -3285,8 +3083,8 @@ class MindmapBehaviour extends AbstractBehaviourService {
|
|
|
3285
3083
|
class PagesBehaviour extends AbstractBehaviourService {
|
|
3286
3084
|
constructor() {
|
|
3287
3085
|
super(...arguments);
|
|
3288
|
-
|
|
3289
|
-
|
|
3086
|
+
u(this, "APP", "pages");
|
|
3087
|
+
u(this, "RESOURCE", "pages");
|
|
3290
3088
|
}
|
|
3291
3089
|
async loadResources() {
|
|
3292
3090
|
const t = await this.httpGet("/pages/list/all"), s = [];
|
|
@@ -3304,15 +3102,15 @@ class PagesBehaviour extends AbstractBehaviourService {
|
|
|
3304
3102
|
shared: typeof r.shared < "u",
|
|
3305
3103
|
modified: r.modified
|
|
3306
3104
|
})
|
|
3307
|
-
), (o = r.pages) == null || o.forEach((
|
|
3105
|
+
), (o = r.pages) == null || o.forEach((a) => {
|
|
3308
3106
|
s.push(
|
|
3309
3107
|
this.dataToResource({
|
|
3310
|
-
title:
|
|
3108
|
+
title: a.title,
|
|
3311
3109
|
owner: r.owner.userId,
|
|
3312
3110
|
ownerName: r.owner.displayName,
|
|
3313
3111
|
icon: i,
|
|
3314
|
-
path: "/pages#/website/" + r._id + "/" +
|
|
3315
|
-
_id: r._id + "/" +
|
|
3112
|
+
path: "/pages#/website/" + r._id + "/" + a.titleLink,
|
|
3113
|
+
_id: r._id + "/" + a.titleLink,
|
|
3316
3114
|
shared: typeof r.shared < "u",
|
|
3317
3115
|
modified: r.modified
|
|
3318
3116
|
})
|
|
@@ -3324,8 +3122,8 @@ class PagesBehaviour extends AbstractBehaviourService {
|
|
|
3324
3122
|
class PollBehaviour extends AbstractBehaviourService {
|
|
3325
3123
|
constructor() {
|
|
3326
3124
|
super(...arguments);
|
|
3327
|
-
|
|
3328
|
-
|
|
3125
|
+
u(this, "APP", "poll");
|
|
3126
|
+
u(this, "RESOURCE", "poll");
|
|
3329
3127
|
}
|
|
3330
3128
|
async loadResources() {
|
|
3331
3129
|
return (await this.httpGet("/poll/list/all")).map((s) => {
|
|
@@ -3346,8 +3144,8 @@ class PollBehaviour extends AbstractBehaviourService {
|
|
|
3346
3144
|
class ScrapbookBehaviour extends AbstractBehaviourService {
|
|
3347
3145
|
constructor() {
|
|
3348
3146
|
super(...arguments);
|
|
3349
|
-
|
|
3350
|
-
|
|
3147
|
+
u(this, "APP", "scrapbook");
|
|
3148
|
+
u(this, "RESOURCE", "scrapbook");
|
|
3351
3149
|
}
|
|
3352
3150
|
async loadResources() {
|
|
3353
3151
|
return (await this.httpGet(
|
|
@@ -3370,8 +3168,8 @@ class ScrapbookBehaviour extends AbstractBehaviourService {
|
|
|
3370
3168
|
class TimelinegeneratorBehaviour extends AbstractBehaviourService {
|
|
3371
3169
|
constructor() {
|
|
3372
3170
|
super(...arguments);
|
|
3373
|
-
|
|
3374
|
-
|
|
3171
|
+
u(this, "APP", "timelinegenerator");
|
|
3172
|
+
u(this, "RESOURCE", "timelinegenerator");
|
|
3375
3173
|
}
|
|
3376
3174
|
loadResources() {
|
|
3377
3175
|
return new Promise(async (t, s) => {
|
|
@@ -3379,12 +3177,12 @@ class TimelinegeneratorBehaviour extends AbstractBehaviourService {
|
|
|
3379
3177
|
const i = (await this.httpGet(
|
|
3380
3178
|
"/timelinegenerator/timelines"
|
|
3381
3179
|
)).map((o) => {
|
|
3382
|
-
const
|
|
3180
|
+
const a = o.icon || "/img/illustrations/timeline-default.png";
|
|
3383
3181
|
return this.dataToResource({
|
|
3384
3182
|
title: o.headline,
|
|
3385
3183
|
ownerName: o.owner.displayName,
|
|
3386
3184
|
owner: o.owner.userId,
|
|
3387
|
-
icon:
|
|
3185
|
+
icon: a,
|
|
3388
3186
|
path: "/timelinegenerator#/view/" + o._id,
|
|
3389
3187
|
_id: o._id,
|
|
3390
3188
|
shared: typeof o.shared < "u",
|
|
@@ -3401,8 +3199,8 @@ class TimelinegeneratorBehaviour extends AbstractBehaviourService {
|
|
|
3401
3199
|
class WikiBehaviour extends AbstractBehaviourService {
|
|
3402
3200
|
constructor() {
|
|
3403
3201
|
super(...arguments);
|
|
3404
|
-
|
|
3405
|
-
|
|
3202
|
+
u(this, "APP", "wiki");
|
|
3203
|
+
u(this, "RESOURCE", "wiki");
|
|
3406
3204
|
}
|
|
3407
3205
|
async loadResources() {
|
|
3408
3206
|
return (await this.httpGet(
|
|
@@ -3425,8 +3223,8 @@ class WikiBehaviour extends AbstractBehaviourService {
|
|
|
3425
3223
|
class WorkspaceBehaviour extends AbstractBehaviourService {
|
|
3426
3224
|
constructor() {
|
|
3427
3225
|
super(...arguments);
|
|
3428
|
-
|
|
3429
|
-
|
|
3226
|
+
u(this, "APP", "workspace");
|
|
3227
|
+
u(this, "RESOURCE", "workspace");
|
|
3430
3228
|
}
|
|
3431
3229
|
loadResources({ search: t, asset_id: s }) {
|
|
3432
3230
|
return new Promise(async (r, i) => {
|
|
@@ -3434,12 +3232,12 @@ class WorkspaceBehaviour extends AbstractBehaviourService {
|
|
|
3434
3232
|
let o = "/workspace/documents?filter=all&hierarchical=true";
|
|
3435
3233
|
s && s.length ? o += `&search=${t}` : t && t.length && (o += `&search=${t}`);
|
|
3436
3234
|
const c = (await this.httpGet(o)).filter((l) => !l.deleted).map((l) => {
|
|
3437
|
-
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";
|
|
3438
3236
|
return this.dataToResource({
|
|
3439
3237
|
title: l.name,
|
|
3440
3238
|
ownerName: l.ownerName,
|
|
3441
3239
|
owner: l.owner,
|
|
3442
|
-
icon:
|
|
3240
|
+
icon: h,
|
|
3443
3241
|
path: `/workspace/document/${l._id}`,
|
|
3444
3242
|
_id: l._id,
|
|
3445
3243
|
shared: !!(l.shared && l.shared.length >= 0),
|
|
@@ -3453,7 +3251,7 @@ class WorkspaceBehaviour extends AbstractBehaviourService {
|
|
|
3453
3251
|
});
|
|
3454
3252
|
}
|
|
3455
3253
|
}
|
|
3456
|
-
const
|
|
3254
|
+
const b = class b {
|
|
3457
3255
|
static async initialize(e, t) {
|
|
3458
3256
|
const s = e.http();
|
|
3459
3257
|
if (!this.resourceProducingApps.length) {
|
|
@@ -3464,7 +3262,7 @@ const R = class R {
|
|
|
3464
3262
|
e.session().getUser()
|
|
3465
3263
|
]);
|
|
3466
3264
|
i != null && i.apps && (r != null && r.length) && (this.resourceProducingApps = r.filter(
|
|
3467
|
-
(o) => i.apps.some((
|
|
3265
|
+
(o) => i.apps.some((a) => a.address.includes(o))
|
|
3468
3266
|
));
|
|
3469
3267
|
} catch (r) {
|
|
3470
3268
|
console.warn("Failed to load resource-producing apps:", r);
|
|
@@ -3547,9 +3345,9 @@ const R = class R {
|
|
|
3547
3345
|
//
|
|
3548
3346
|
// STATIC REGISTRY
|
|
3549
3347
|
//
|
|
3550
|
-
|
|
3551
|
-
|
|
3552
|
-
let SnipletsService =
|
|
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", []);
|
|
3350
|
+
let SnipletsService = b;
|
|
3553
3351
|
class RightService {
|
|
3554
3352
|
constructor(e) {
|
|
3555
3353
|
this.context = e;
|
|
@@ -3747,14 +3545,14 @@ class SessionService {
|
|
|
3747
3545
|
r,
|
|
3748
3546
|
i,
|
|
3749
3547
|
o,
|
|
3750
|
-
|
|
3548
|
+
a
|
|
3751
3549
|
] = await Promise.all([
|
|
3752
3550
|
this.getCurrentLanguage(e),
|
|
3753
3551
|
this.latestQuotaAndUsage(e),
|
|
3754
3552
|
this.loadDescription(e),
|
|
3755
3553
|
this.getUserProfile(),
|
|
3756
3554
|
this.getBookmarks(e)
|
|
3757
|
-
]), { type: c, ...l } = t || {},
|
|
3555
|
+
]), { type: c, ...l } = t || {}, h = {
|
|
3758
3556
|
...l,
|
|
3759
3557
|
profiles: c || ["Guest"],
|
|
3760
3558
|
// "type" field from /userbook/api/person becomes "profiles"
|
|
@@ -3765,9 +3563,9 @@ class SessionService {
|
|
|
3765
3563
|
user: e,
|
|
3766
3564
|
quotaAndUsage: r,
|
|
3767
3565
|
currentLanguage: s,
|
|
3768
|
-
userDescription:
|
|
3566
|
+
userDescription: h,
|
|
3769
3567
|
userProfile: o,
|
|
3770
|
-
bookmarkedApps:
|
|
3568
|
+
bookmarkedApps: a
|
|
3771
3569
|
};
|
|
3772
3570
|
}
|
|
3773
3571
|
login(e, t, s, r) {
|
|
@@ -3861,7 +3659,7 @@ class SessionService {
|
|
|
3861
3659
|
applications: []
|
|
3862
3660
|
});
|
|
3863
3661
|
const i = [];
|
|
3864
|
-
return r.bookmarks.forEach((o,
|
|
3662
|
+
return r.bookmarks.forEach((o, a) => {
|
|
3865
3663
|
const c = ((e == null ? void 0 : e.apps) || []).find(
|
|
3866
3664
|
(l) => l.name === o
|
|
3867
3665
|
);
|
|
@@ -3877,11 +3675,11 @@ class SessionService {
|
|
|
3877
3675
|
}
|
|
3878
3676
|
async getPerson(e = {}) {
|
|
3879
3677
|
var c;
|
|
3880
|
-
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(
|
|
3881
3679
|
i,
|
|
3882
3680
|
t
|
|
3883
3681
|
);
|
|
3884
|
-
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;
|
|
3885
3683
|
}
|
|
3886
3684
|
async isAdml() {
|
|
3887
3685
|
const e = await this.getUser();
|
|
@@ -3939,38 +3737,38 @@ class ShareService {
|
|
|
3939
3737
|
t,
|
|
3940
3738
|
s,
|
|
3941
3739
|
r
|
|
3942
|
-
),
|
|
3740
|
+
), a = await this.cache.httpGetJson(o), c = a.users.visibles.filter(({ username: p, firstName: y, lastName: d, login: g }) => {
|
|
3943
3741
|
const A = StringUtils.removeAccents(
|
|
3944
|
-
|
|
3742
|
+
d || ""
|
|
3945
3743
|
).toLowerCase(), f = StringUtils.removeAccents(
|
|
3946
3744
|
y || ""
|
|
3947
3745
|
).toLowerCase(), w = StringUtils.removeAccents(
|
|
3948
|
-
|
|
3746
|
+
p || ""
|
|
3949
3747
|
).toLowerCase(), F = StringUtils.removeAccents(g || "").toLowerCase();
|
|
3950
3748
|
return w.includes(i) || f.includes(i) || A.includes(i) || F.includes(i);
|
|
3951
|
-
}).map((
|
|
3952
|
-
avatarUrl: this.directory.getAvatarUrl(
|
|
3953
|
-
directoryUrl: this.directory.getDirectoryUrl(
|
|
3954
|
-
displayName:
|
|
3955
|
-
id:
|
|
3956
|
-
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,
|
|
3957
3755
|
type: "user"
|
|
3958
|
-
})), l =
|
|
3959
|
-
avatarUrl: this.directory.getAvatarUrl(
|
|
3960
|
-
directoryUrl: this.directory.getDirectoryUrl(
|
|
3961
|
-
displayName:
|
|
3962
|
-
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,
|
|
3963
3761
|
type: "group",
|
|
3964
|
-
structureName:
|
|
3762
|
+
structureName: p.structureName
|
|
3965
3763
|
}));
|
|
3966
|
-
return [...(await this.directory.getBookMarks()).filter(({ displayName:
|
|
3967
|
-
|
|
3968
|
-
).toLowerCase().includes(i)).map((
|
|
3764
|
+
return [...(await this.directory.getBookMarks()).filter(({ displayName: p }) => StringUtils.removeAccents(
|
|
3765
|
+
p || ""
|
|
3766
|
+
).toLowerCase().includes(i)).map((p) => ({
|
|
3969
3767
|
avatarUrl: "",
|
|
3970
3768
|
directoryUrl: "",
|
|
3971
3769
|
profile: "",
|
|
3972
|
-
displayName:
|
|
3973
|
-
id:
|
|
3770
|
+
displayName: p.displayName,
|
|
3771
|
+
id: p.id,
|
|
3974
3772
|
type: "sharebookmark"
|
|
3975
3773
|
})), ...c, ...l];
|
|
3976
3774
|
}
|
|
@@ -3986,10 +3784,10 @@ class ShareService {
|
|
|
3986
3784
|
return s;
|
|
3987
3785
|
}
|
|
3988
3786
|
getActionsAvailableFor({ id: e, type: t }, s, r) {
|
|
3989
|
-
const o = (t === "user" ? s.users.checked[e] : s.groups.checked[e]) || [],
|
|
3990
|
-
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)
|
|
3991
3789
|
r[l].filter(
|
|
3992
|
-
(
|
|
3790
|
+
(p) => o.includes(p)
|
|
3993
3791
|
).length > 0 && c.push(l);
|
|
3994
3792
|
return c;
|
|
3995
3793
|
}
|
|
@@ -4001,26 +3799,26 @@ class ShareService {
|
|
|
4001
3799
|
s == null ? void 0 : s.getResourceRights
|
|
4002
3800
|
), o = await this.cache.httpGetJson(
|
|
4003
3801
|
i
|
|
4004
|
-
),
|
|
3802
|
+
), a = await this.getShareMapping(
|
|
4005
3803
|
e,
|
|
4006
3804
|
s == null ? void 0 : s.getShareMapping
|
|
4007
3805
|
), c = await this.cache.httpGetJson(
|
|
4008
3806
|
"/infra/public/json/sharing-rights.json"
|
|
4009
|
-
), l = Object.keys(o.users.checked).map((
|
|
4010
|
-
(A) => A.id ===
|
|
4011
|
-
)).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) => {
|
|
4012
3810
|
const g = this.getActionsAvailableFor(
|
|
4013
|
-
{ id:
|
|
3811
|
+
{ id: d.id, type: "user" },
|
|
4014
3812
|
o,
|
|
4015
|
-
|
|
3813
|
+
a
|
|
4016
3814
|
);
|
|
4017
3815
|
return {
|
|
4018
|
-
id:
|
|
3816
|
+
id: d.id,
|
|
4019
3817
|
type: "user",
|
|
4020
|
-
displayName:
|
|
4021
|
-
profile:
|
|
4022
|
-
avatarUrl: this.directory.getAvatarUrl(
|
|
4023
|
-
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"),
|
|
4024
3822
|
actions: g.map((f) => {
|
|
4025
3823
|
const w = c[f];
|
|
4026
3824
|
return {
|
|
@@ -4030,21 +3828,21 @@ class ShareService {
|
|
|
4030
3828
|
};
|
|
4031
3829
|
})
|
|
4032
3830
|
};
|
|
4033
|
-
}).sort((
|
|
4034
|
-
(A) => A.id ===
|
|
4035
|
-
)).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) => {
|
|
4036
3834
|
const g = this.getActionsAvailableFor(
|
|
4037
|
-
{ id:
|
|
3835
|
+
{ id: d.id, type: "group" },
|
|
4038
3836
|
o,
|
|
4039
|
-
|
|
3837
|
+
a
|
|
4040
3838
|
);
|
|
4041
3839
|
return {
|
|
4042
|
-
id:
|
|
3840
|
+
id: d.id,
|
|
4043
3841
|
type: "group",
|
|
4044
|
-
displayName:
|
|
3842
|
+
displayName: d.name,
|
|
4045
3843
|
profile: void 0,
|
|
4046
|
-
avatarUrl: this.directory.getAvatarUrl(
|
|
4047
|
-
directoryUrl: this.directory.getDirectoryUrl(
|
|
3844
|
+
avatarUrl: this.directory.getAvatarUrl(d.id, "group"),
|
|
3845
|
+
directoryUrl: this.directory.getDirectoryUrl(d.id, "group"),
|
|
4048
3846
|
actions: g.map((f) => {
|
|
4049
3847
|
const w = c[f];
|
|
4050
3848
|
return {
|
|
@@ -4054,26 +3852,26 @@ class ShareService {
|
|
|
4054
3852
|
};
|
|
4055
3853
|
})
|
|
4056
3854
|
};
|
|
4057
|
-
}).sort((
|
|
4058
|
-
({ 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 }) => ({
|
|
4059
3857
|
labels: f,
|
|
4060
|
-
displayName:
|
|
3858
|
+
displayName: d || A,
|
|
4061
3859
|
id: g
|
|
4062
3860
|
})
|
|
4063
3861
|
), y = o.users.visibles.map(
|
|
4064
|
-
({ id:
|
|
3862
|
+
({ id: d, profile: g, username: A, firstName: f, lastName: w, login: F }) => ({
|
|
4065
3863
|
displayName: A,
|
|
4066
3864
|
firstName: f,
|
|
4067
3865
|
lastName: w,
|
|
4068
3866
|
login: F,
|
|
4069
3867
|
profile: g,
|
|
4070
|
-
id:
|
|
3868
|
+
id: d
|
|
4071
3869
|
})
|
|
4072
3870
|
);
|
|
4073
3871
|
return {
|
|
4074
|
-
rights:
|
|
3872
|
+
rights: E,
|
|
4075
3873
|
visibleBookmarks: r,
|
|
4076
|
-
visibleGroups:
|
|
3874
|
+
visibleGroups: p,
|
|
4077
3875
|
visibleUsers: y
|
|
4078
3876
|
};
|
|
4079
3877
|
}
|
|
@@ -4084,7 +3882,7 @@ class ShareService {
|
|
|
4084
3882
|
bookmarks: {}
|
|
4085
3883
|
}, i = await this.getShareMapping(e, s);
|
|
4086
3884
|
for (const o of t) {
|
|
4087
|
-
const
|
|
3885
|
+
const a = o.actions.map((l) => i[l.id]).reduce((l, h) => Array.isArray(h) ? [...l, ...h] : l, []), c = [...new Set(a)];
|
|
4088
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);
|
|
4089
3887
|
}
|
|
4090
3888
|
return r;
|
|
@@ -4094,40 +3892,40 @@ class ShareService {
|
|
|
4094
3892
|
e,
|
|
4095
3893
|
s,
|
|
4096
3894
|
r == null ? void 0 : r.getShareMapping
|
|
4097
|
-
), 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(
|
|
4098
3896
|
e,
|
|
4099
3897
|
t,
|
|
4100
3898
|
"",
|
|
4101
3899
|
r == null ? void 0 : r.getResourceRights
|
|
4102
3900
|
);
|
|
4103
|
-
return this.cache.clearCache(
|
|
3901
|
+
return this.cache.clearCache(a), await this.http.putJson(o, i);
|
|
4104
3902
|
}
|
|
4105
3903
|
async getActionsForApp(e, t) {
|
|
4106
3904
|
const s = await this.cache.httpGetJson(
|
|
4107
3905
|
"/infra/public/json/sharing-rights.json"
|
|
4108
3906
|
), r = await this.getShareMapping(e, t);
|
|
4109
3907
|
return Object.keys(s).map((o) => {
|
|
4110
|
-
const
|
|
3908
|
+
const a = s[o];
|
|
4111
3909
|
return {
|
|
4112
3910
|
displayName: o,
|
|
4113
3911
|
id: o,
|
|
4114
|
-
priority:
|
|
4115
|
-
requires:
|
|
3912
|
+
priority: a.priority,
|
|
3913
|
+
requires: a.requires
|
|
4116
3914
|
};
|
|
4117
3915
|
}).filter((o) => {
|
|
4118
|
-
var
|
|
4119
|
-
return ((
|
|
4120
|
-
}).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);
|
|
4121
3919
|
}
|
|
4122
3920
|
}
|
|
4123
3921
|
const loadedScripts = {};
|
|
4124
3922
|
class HttpService {
|
|
4125
3923
|
constructor(e, t) {
|
|
4126
3924
|
// Axios automatically manages the XSRF-TOKEN cookie and the X-XSRF-TOKEN HTTP header.
|
|
4127
|
-
|
|
4128
|
-
|
|
4129
|
-
|
|
4130
|
-
|
|
3925
|
+
u(this, "axios");
|
|
3926
|
+
u(this, "baseUrl");
|
|
3927
|
+
u(this, "headers", {});
|
|
3928
|
+
u(this, "_latestResponse");
|
|
4131
3929
|
this.context = e, this.axios = axios.create(t);
|
|
4132
3930
|
}
|
|
4133
3931
|
fixBaseUrl(e) {
|
|
@@ -4342,8 +4140,8 @@ class HttpService {
|
|
|
4342
4140
|
const r = s ?? "exports", i = this.toAxiosConfig(t);
|
|
4343
4141
|
return i.headers && (i.headers.Accept = "application/javascript"), this.axios.get(this.toCdnUrl(e), i).then((o) => this.mapAxiosResponse(o, t)).then((o) => {
|
|
4344
4142
|
try {
|
|
4345
|
-
const
|
|
4346
|
-
return Function(
|
|
4143
|
+
const a = `"use strict";var ${r.split(".")[0]}={};${o};return ${r};`;
|
|
4144
|
+
return Function(a)();
|
|
4347
4145
|
} catch {
|
|
4348
4146
|
return o;
|
|
4349
4147
|
}
|
|
@@ -4357,7 +4155,7 @@ class HttpService {
|
|
|
4357
4155
|
});
|
|
4358
4156
|
}
|
|
4359
4157
|
}
|
|
4360
|
-
const
|
|
4158
|
+
const R = class R {
|
|
4361
4159
|
// in minutes. Applies to recorded videos.
|
|
4362
4160
|
constructor(e) {
|
|
4363
4161
|
this.context = e;
|
|
@@ -4378,8 +4176,8 @@ const b = class b {
|
|
|
4378
4176
|
APP$4.VIDEO
|
|
4379
4177
|
);
|
|
4380
4178
|
return {
|
|
4381
|
-
maxWeight: (e == null ? void 0 : e["max-videosize-mbytes"]) ??
|
|
4382
|
-
maxDuration: (e == null ? void 0 : e["max-videoduration-minutes"]) ??
|
|
4179
|
+
maxWeight: (e == null ? void 0 : e["max-videosize-mbytes"]) ?? R.MAX_WEIGHT,
|
|
4180
|
+
maxDuration: (e == null ? void 0 : e["max-videoduration-minutes"]) ?? R.MAX_DURATION,
|
|
4383
4181
|
acceptVideoUploadExtensions: ((t = e == null ? void 0 : e["accept-videoupload-extensions"]) == null ? void 0 : t.map(
|
|
4384
4182
|
(s) => s.toUpperCase()
|
|
4385
4183
|
)) ?? []
|
|
@@ -4402,43 +4200,43 @@ const b = class b {
|
|
|
4402
4200
|
throw new Error("Invalid video filename");
|
|
4403
4201
|
const i = `${e.browser.name} ${e.browser.version}`, o = new FormData();
|
|
4404
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);
|
|
4405
|
-
let
|
|
4406
|
-
r && (
|
|
4203
|
+
let a = `/video/encode?captation=${s}`;
|
|
4204
|
+
r && (a += `&duration=${r}`);
|
|
4407
4205
|
const c = await this.http.post(
|
|
4408
|
-
|
|
4206
|
+
a,
|
|
4409
4207
|
o,
|
|
4410
4208
|
{ headers: { "Content-Type": "multipart/form-data" } }
|
|
4411
4209
|
);
|
|
4412
4210
|
if (c.state == "running") {
|
|
4413
|
-
let l = 0,
|
|
4211
|
+
let l = 0, h = 1;
|
|
4414
4212
|
do {
|
|
4415
|
-
const
|
|
4213
|
+
const E = h + l;
|
|
4416
4214
|
await new Promise(
|
|
4417
|
-
(y) => setTimeout(y,
|
|
4418
|
-
), l =
|
|
4419
|
-
const
|
|
4215
|
+
(y) => setTimeout(y, E * 1e3)
|
|
4216
|
+
), l = h, h = Math.min(8, E);
|
|
4217
|
+
const p = await this.http.get(
|
|
4420
4218
|
`/video/status/${c.processid}`
|
|
4421
4219
|
);
|
|
4422
|
-
if (
|
|
4423
|
-
return
|
|
4424
|
-
|
|
4220
|
+
if (p.state == "succeed")
|
|
4221
|
+
return p.videoworkspaceid && p.videosize && this.context.data().trackVideoSave(
|
|
4222
|
+
p.videoworkspaceid,
|
|
4425
4223
|
Math.round(r),
|
|
4426
|
-
|
|
4224
|
+
p.videosize,
|
|
4427
4225
|
s,
|
|
4428
4226
|
e.url,
|
|
4429
4227
|
i,
|
|
4430
4228
|
e.device
|
|
4431
|
-
),
|
|
4432
|
-
if (
|
|
4229
|
+
), p;
|
|
4230
|
+
if (p.state == "error")
|
|
4433
4231
|
break;
|
|
4434
4232
|
} while (!0);
|
|
4435
4233
|
}
|
|
4436
4234
|
throw new Error("Video cannot be uploaded.");
|
|
4437
4235
|
}
|
|
4438
4236
|
};
|
|
4439
|
-
|
|
4440
|
-
|
|
4441
|
-
let VideoService =
|
|
4237
|
+
u(R, "MAX_WEIGHT", 50), // in Mbytes. Applies to uploaded videos.
|
|
4238
|
+
u(R, "MAX_DURATION", 3);
|
|
4239
|
+
let VideoService = R;
|
|
4442
4240
|
class WidgetService {
|
|
4443
4241
|
constructor(e) {
|
|
4444
4242
|
this.context = e;
|
|
@@ -4519,7 +4317,7 @@ const defaultMappers = {
|
|
|
4519
4317
|
}
|
|
4520
4318
|
};
|
|
4521
4319
|
// FIXME add edumedia support
|
|
4522
|
-
|
|
4320
|
+
u(v, "roleMappers", [
|
|
4523
4321
|
(e) => Object.keys(defaultMappers).find((s) => defaultMappers[s](e))
|
|
4524
4322
|
]);
|
|
4525
4323
|
let DocumentHelper = v;
|
|
@@ -4537,29 +4335,29 @@ class WorkspaceService {
|
|
|
4537
4335
|
size: e.size,
|
|
4538
4336
|
extension: i,
|
|
4539
4337
|
role: DocumentHelper.role(r, !1, i)
|
|
4540
|
-
},
|
|
4541
|
-
return { basename:
|
|
4338
|
+
}, a = t.replace("." + o.extension, ""), c = o.extension ? a + "." + o.extension : a;
|
|
4339
|
+
return { basename: a, fullname: c, metadata: o };
|
|
4542
4340
|
}
|
|
4543
4341
|
async saveFile(e, t) {
|
|
4544
4342
|
const { fullname: s, metadata: r } = this.extractMetadata(e), i = new FormData();
|
|
4545
4343
|
i.append("file", e, s);
|
|
4546
4344
|
const o = [];
|
|
4547
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}`);
|
|
4548
|
-
const
|
|
4346
|
+
const a = await this.http.postFile(
|
|
4549
4347
|
`/workspace/document?${o.join("&")}`,
|
|
4550
4348
|
i
|
|
4551
4349
|
);
|
|
4552
4350
|
if (this.http.isResponseError())
|
|
4553
4351
|
throw this.http.latestResponse.statusText;
|
|
4554
|
-
return
|
|
4352
|
+
return a;
|
|
4555
4353
|
}
|
|
4556
4354
|
async updateFile(e, t, s) {
|
|
4557
4355
|
const { fullname: r, metadata: i } = this.extractMetadata(t), o = new FormData();
|
|
4558
4356
|
o.append("file", t, r);
|
|
4559
|
-
const
|
|
4560
|
-
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}`);
|
|
4561
4359
|
const c = await this.http.putFile(
|
|
4562
|
-
`/workspace/document/${e}?${
|
|
4360
|
+
`/workspace/document/${e}?${a.join("&")}`,
|
|
4563
4361
|
o
|
|
4564
4362
|
);
|
|
4565
4363
|
if (this.http.isResponseError())
|
|
@@ -4610,11 +4408,11 @@ class WorkspaceService {
|
|
|
4610
4408
|
);
|
|
4611
4409
|
if (this.http.isResponseError())
|
|
4612
4410
|
throw this.http.latestResponse.statusText;
|
|
4613
|
-
return r.forEach((o,
|
|
4411
|
+
return r.forEach((o, a) => {
|
|
4614
4412
|
const c = e.findIndex(
|
|
4615
4413
|
(l) => l._id === o._id
|
|
4616
4414
|
);
|
|
4617
|
-
0 <= c && c < e.length && (e[c] = i[
|
|
4415
|
+
0 <= c && c < e.length && (e[c] = i[a]);
|
|
4618
4416
|
}), e.filter((o) => !!o);
|
|
4619
4417
|
}
|
|
4620
4418
|
return e;
|
|
@@ -4629,12 +4427,12 @@ class WorkspaceService {
|
|
|
4629
4427
|
if (typeof e == "string")
|
|
4630
4428
|
return e.includes("data:image") || e.includes("thumbnail") ? e : `${e}${e.includes("?") ? "&" : "?"}thumbnail=${r}`;
|
|
4631
4429
|
{
|
|
4632
|
-
const
|
|
4430
|
+
const a = `/workspace/${e.public ? "pub/" : ""}document/${e._id}?thumbnail=`, c = e.thumbnails;
|
|
4633
4431
|
if ((o = (i = e.metadata) == null ? void 0 : i["content-type"]) != null && o.includes("video")) {
|
|
4634
4432
|
const l = c && Object.keys(c).length > 0 ? Object.keys(c)[0] : null;
|
|
4635
|
-
return l ?
|
|
4433
|
+
return l ? a + l : null;
|
|
4636
4434
|
} else
|
|
4637
|
-
return
|
|
4435
|
+
return a + r;
|
|
4638
4436
|
}
|
|
4639
4437
|
}
|
|
4640
4438
|
/**
|
|
@@ -4688,24 +4486,22 @@ class WorkspaceService {
|
|
|
4688
4486
|
}
|
|
4689
4487
|
class OdeServices {
|
|
4690
4488
|
constructor() {
|
|
4691
|
-
|
|
4692
|
-
|
|
4693
|
-
|
|
4694
|
-
|
|
4695
|
-
|
|
4696
|
-
|
|
4697
|
-
|
|
4698
|
-
|
|
4699
|
-
|
|
4700
|
-
|
|
4701
|
-
|
|
4702
|
-
|
|
4703
|
-
|
|
4704
|
-
|
|
4705
|
-
|
|
4706
|
-
|
|
4707
|
-
a(this, "_embedder");
|
|
4708
|
-
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);
|
|
4709
4505
|
}
|
|
4710
4506
|
initialize() {
|
|
4711
4507
|
return this._data.initialize(), this;
|
|
@@ -4728,18 +4524,12 @@ class OdeServices {
|
|
|
4728
4524
|
directory() {
|
|
4729
4525
|
return this._directory;
|
|
4730
4526
|
}
|
|
4731
|
-
googledrive() {
|
|
4732
|
-
return this._googledrive;
|
|
4733
|
-
}
|
|
4734
4527
|
http() {
|
|
4735
4528
|
return this._http;
|
|
4736
4529
|
}
|
|
4737
4530
|
idiom() {
|
|
4738
4531
|
return this._idiom;
|
|
4739
4532
|
}
|
|
4740
|
-
nextcloud() {
|
|
4741
|
-
return this._nextcloud;
|
|
4742
|
-
}
|
|
4743
4533
|
notify() {
|
|
4744
4534
|
return this._notify;
|
|
4745
4535
|
}
|
|
@@ -4915,10 +4705,10 @@ const isActionAvailable = (n, e) => {
|
|
|
4915
4705
|
class WidgetFramework {
|
|
4916
4706
|
constructor() {
|
|
4917
4707
|
//-------------------------------------
|
|
4918
|
-
|
|
4919
|
-
|
|
4708
|
+
u(this, "_initialized");
|
|
4709
|
+
u(this, "_widgets", []);
|
|
4920
4710
|
////////////////////////////////////// USER PREFERENCES
|
|
4921
|
-
|
|
4711
|
+
u(this, "_userPrefs", {});
|
|
4922
4712
|
}
|
|
4923
4713
|
initialize(e, t) {
|
|
4924
4714
|
return this._initialized || (this._initialized = new Promisified(), notify.onSessionReady().promise.then((s) => {
|
|
@@ -4961,20 +4751,20 @@ class WidgetFramework {
|
|
|
4961
4751
|
this._userPrefs = e ?? this._userPrefs;
|
|
4962
4752
|
const t = configure.Platform.theme, s = [];
|
|
4963
4753
|
t.listSkins().then((r) => {
|
|
4964
|
-
var
|
|
4965
|
-
const i = ((
|
|
4754
|
+
var a;
|
|
4755
|
+
const i = ((a = r.find((c) => c.child === t.skin)) == null ? void 0 : a.parent) === "panda" ? secondLevelWidgets : firstLevelWidgets;
|
|
4966
4756
|
this._widgets = this._widgets.filter((c, l) => {
|
|
4967
|
-
const
|
|
4968
|
-
return i.indexOf(
|
|
4969
|
-
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,
|
|
4970
4760
|
show: !0,
|
|
4971
4761
|
position: c.platformConf.position
|
|
4972
|
-
}), 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);
|
|
4973
4763
|
});
|
|
4974
4764
|
const o = new Idiom();
|
|
4975
4765
|
this._widgets = this._widgets.sort((c, l) => {
|
|
4976
|
-
const
|
|
4977
|
-
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;
|
|
4978
4768
|
});
|
|
4979
4769
|
});
|
|
4980
4770
|
}
|
|
@@ -4982,8 +4772,8 @@ class WidgetFramework {
|
|
|
4982
4772
|
class Widget {
|
|
4983
4773
|
//-------------------------------------
|
|
4984
4774
|
constructor(e) {
|
|
4985
|
-
|
|
4986
|
-
|
|
4775
|
+
u(this, "_schoolConf", {});
|
|
4776
|
+
u(this, "_userPref");
|
|
4987
4777
|
this._platformConf = e, this._userPref = null;
|
|
4988
4778
|
}
|
|
4989
4779
|
get platformConf() {
|
|
@@ -5034,8 +4824,6 @@ export {
|
|
|
5034
4824
|
ERROR_CODE,
|
|
5035
4825
|
EVENT_NAME,
|
|
5036
4826
|
FOLDER,
|
|
5037
|
-
GOOGLE_DRIVE_FOLDER_MIME_TYPE,
|
|
5038
|
-
GoogleDriveCopyError,
|
|
5039
4827
|
ITimelineFactory,
|
|
5040
4828
|
LAYER_NAME,
|
|
5041
4829
|
NotifyFrameworkFactory,
|