@edifice.io/client 2.6.7-develop-integration.20261005091442 → 2.6.7-develop-b2school.20261005112514
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +0 -3
- package/dist/index.js +332 -515
- 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";
|
|
@@ -98,10 +98,10 @@ const ERROR_CODE = {
|
|
|
98
98
|
INFOTIP: "infotip",
|
|
99
99
|
RGPD_COOKIES: "rgpdCookies"
|
|
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
|
/**
|
|
@@ -110,8 +110,8 @@ const ERROR_CODE = {
|
|
|
110
110
|
* @returns the channel instance
|
|
111
111
|
*/
|
|
112
112
|
static getChannel(e) {
|
|
113
|
-
let t =
|
|
114
|
-
return t || (t = new
|
|
113
|
+
let t = C.channels.get(e);
|
|
114
|
+
return t || (t = new C(e), C.channels.set(e, t)), t;
|
|
115
115
|
}
|
|
116
116
|
/**
|
|
117
117
|
* Add a listener and return a revocation function to remove it.
|
|
@@ -136,14 +136,14 @@ const ERROR_CODE = {
|
|
|
136
136
|
* Close this channel: remove listeners and unregister from global map.
|
|
137
137
|
*/
|
|
138
138
|
close() {
|
|
139
|
-
this.listeners.clear(),
|
|
139
|
+
this.listeners.clear(), C.channels.delete(this.name);
|
|
140
140
|
}
|
|
141
141
|
};
|
|
142
|
-
|
|
143
|
-
let SimpleChannel =
|
|
142
|
+
u(C, "channels", /* @__PURE__ */ new Map());
|
|
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
|
}
|
|
@@ -2269,25 +2179,25 @@ class ConfService {
|
|
|
2269
2179
|
conf: t,
|
|
2270
2180
|
publicTheme: s
|
|
2271
2181
|
}) {
|
|
2272
|
-
var
|
|
2273
|
-
const r = await this.http.get("/theme"), i = (
|
|
2274
|
-
(
|
|
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) => (
|
|
2275
2185
|
// Fix #WB2-2660:
|
|
2276
2186
|
// If Public access => get the neo theme
|
|
2277
2187
|
// Else get the theme from the user preference
|
|
2278
|
-
s ?
|
|
2188
|
+
s ? p.parent === "theme-open-ent" && p.bootstrapVersion === "ode-bootstrap-neo" : p.child === (r == null ? void 0 : r.themeName)
|
|
2279
2189
|
)
|
|
2280
|
-
), 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";
|
|
2281
2191
|
return {
|
|
2282
|
-
basePath: `${this.cdnDomain}${
|
|
2192
|
+
basePath: `${this.cdnDomain}${a}../../`,
|
|
2283
2193
|
bootstrapVersion: l,
|
|
2284
|
-
is1d:
|
|
2194
|
+
is1d: h,
|
|
2285
2195
|
logoutCallback: (r == null ? void 0 : r.logoutCallback) || "",
|
|
2286
2196
|
skin: i == null ? void 0 : i.child,
|
|
2287
2197
|
skinName: o,
|
|
2288
2198
|
skins: c,
|
|
2289
2199
|
themeName: i == null ? void 0 : i.child,
|
|
2290
|
-
themeUrl:
|
|
2200
|
+
themeUrl: a,
|
|
2291
2201
|
npmTheme: (i == null ? void 0 : i.npmTheme) ?? void 0,
|
|
2292
2202
|
uiOverrides: i == null ? void 0 : i.uiOverrides
|
|
2293
2203
|
};
|
|
@@ -2304,7 +2214,7 @@ class ConfService {
|
|
|
2304
2214
|
const SEND_ALL = "*";
|
|
2305
2215
|
class WebBroker {
|
|
2306
2216
|
constructor(e) {
|
|
2307
|
-
|
|
2217
|
+
u(this, "subscription");
|
|
2308
2218
|
this.odeServices = e;
|
|
2309
2219
|
}
|
|
2310
2220
|
get http() {
|
|
@@ -2336,10 +2246,10 @@ class WebBroker {
|
|
|
2336
2246
|
}
|
|
2337
2247
|
class DataService {
|
|
2338
2248
|
constructor(e) {
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2249
|
+
u(this, "_webBroker");
|
|
2250
|
+
u(this, "app");
|
|
2251
|
+
u(this, "user");
|
|
2252
|
+
u(this, "profile");
|
|
2343
2253
|
this.odeServices = e;
|
|
2344
2254
|
}
|
|
2345
2255
|
get conf() {
|
|
@@ -2373,7 +2283,7 @@ class DataService {
|
|
|
2373
2283
|
addUserInfos(e) {
|
|
2374
2284
|
return this.user && (e.userId = this.user.userId, e.structure = this.user.structureNames[0]), this.profile && (e.profil = this.profile[0]), e;
|
|
2375
2285
|
}
|
|
2376
|
-
trackVideoSave(e, t, s, r, i, o,
|
|
2286
|
+
trackVideoSave(e, t, s, r, i, o, a) {
|
|
2377
2287
|
const c = this.addUserInfos({
|
|
2378
2288
|
"event-type": "VIDEO_SAVE",
|
|
2379
2289
|
module: this.app || "video",
|
|
@@ -2384,7 +2294,7 @@ class DataService {
|
|
|
2384
2294
|
source: r ? "CAPTURED" : "UPLOADED",
|
|
2385
2295
|
url: i
|
|
2386
2296
|
});
|
|
2387
|
-
|
|
2297
|
+
a && (c.device_type = a), this.trackWebEvent(c);
|
|
2388
2298
|
}
|
|
2389
2299
|
trackVideoRead(e, t, s, r, i) {
|
|
2390
2300
|
const o = this.addUserInfos({
|
|
@@ -2452,14 +2362,14 @@ class DirectoryService {
|
|
|
2452
2362
|
id: s,
|
|
2453
2363
|
displayName: r,
|
|
2454
2364
|
notVisibleCount: o,
|
|
2455
|
-
groups: t.map(({ name:
|
|
2365
|
+
groups: t.map(({ name: a, id: c, nbUsers: l }) => ({
|
|
2456
2366
|
nbUsers: l,
|
|
2457
|
-
displayName:
|
|
2367
|
+
displayName: a,
|
|
2458
2368
|
id: c
|
|
2459
2369
|
})),
|
|
2460
|
-
users: i.map(({ displayName:
|
|
2370
|
+
users: i.map(({ displayName: a, id: c, profile: l }) => ({
|
|
2461
2371
|
profile: l,
|
|
2462
|
-
displayName:
|
|
2372
|
+
displayName: a,
|
|
2463
2373
|
// these info are missing from api
|
|
2464
2374
|
firstName: "",
|
|
2465
2375
|
lastName: "",
|
|
@@ -2474,9 +2384,9 @@ class DirectoryService {
|
|
|
2474
2384
|
users: r
|
|
2475
2385
|
}) {
|
|
2476
2386
|
this.cache.clearCache("/directory/sharebookmark/all");
|
|
2477
|
-
const i = r.map((
|
|
2478
|
-
if (typeof
|
|
2479
|
-
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);
|
|
2480
2390
|
return {
|
|
2481
2391
|
displayName: y,
|
|
2482
2392
|
id: g,
|
|
@@ -2484,19 +2394,19 @@ class DirectoryService {
|
|
|
2484
2394
|
members: [...F, ...w]
|
|
2485
2395
|
};
|
|
2486
2396
|
} else
|
|
2487
|
-
return Promise.resolve(
|
|
2488
|
-
}), 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 = {
|
|
2489
2399
|
name: e,
|
|
2490
2400
|
members: [...i, ...o, ...l]
|
|
2491
|
-
}, { id:
|
|
2401
|
+
}, { id: E } = await this.http.postJson(
|
|
2492
2402
|
"/directory/sharebookmark",
|
|
2493
|
-
|
|
2403
|
+
h
|
|
2494
2404
|
);
|
|
2495
2405
|
return {
|
|
2496
|
-
id:
|
|
2406
|
+
id: E,
|
|
2497
2407
|
displayName: e,
|
|
2498
2408
|
notVisibleCount: 0,
|
|
2499
|
-
members:
|
|
2409
|
+
members: h.members
|
|
2500
2410
|
};
|
|
2501
2411
|
}
|
|
2502
2412
|
}
|
|
@@ -2535,10 +2445,10 @@ class EmbedderService {
|
|
|
2535
2445
|
urlIsFromPattern(e, t) {
|
|
2536
2446
|
const s = new RegExp("[^{}]+(?=(?:[^{}]*{[^}]*})*[^}]*$)", "g"), r = new RegExp("{[^}]*}", "g");
|
|
2537
2447
|
let i = !0;
|
|
2538
|
-
const o = t.match(s) || [],
|
|
2539
|
-
return (t.match(r) || []).forEach((l,
|
|
2540
|
-
l.includes("ignore") ||
|
|
2541
|
-
}),
|
|
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) => {
|
|
2542
2452
|
if (!e.includes(l)) {
|
|
2543
2453
|
i = !1;
|
|
2544
2454
|
return;
|
|
@@ -2569,17 +2479,17 @@ class EmbedderService {
|
|
|
2569
2479
|
if (this.urlIsFromPattern(t, s)) {
|
|
2570
2480
|
const r = new RegExp("{[a-zA-Z0-9_.]+}", "g"), i = s.match(r) || [];
|
|
2571
2481
|
let o = e.embed;
|
|
2572
|
-
for (const
|
|
2573
|
-
let c = s.split(
|
|
2482
|
+
for (const a of i) {
|
|
2483
|
+
let c = s.split(a)[0];
|
|
2574
2484
|
const l = c.split("}");
|
|
2575
2485
|
l.length > 1 && (c = l[l.length - 1]);
|
|
2576
|
-
let
|
|
2577
|
-
if (!
|
|
2486
|
+
let h = t.split(c)[1];
|
|
2487
|
+
if (!h)
|
|
2578
2488
|
continue;
|
|
2579
|
-
const
|
|
2580
|
-
|
|
2581
|
-
const
|
|
2582
|
-
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);
|
|
2583
2493
|
}
|
|
2584
2494
|
return o;
|
|
2585
2495
|
}
|
|
@@ -2833,9 +2743,9 @@ class IdiomService {
|
|
|
2833
2743
|
const i = new Promisified();
|
|
2834
2744
|
promises[t] = i.promise;
|
|
2835
2745
|
const o = {};
|
|
2836
|
-
e && (o["Accept-Language"] = e), this.http.get(t, { headers: o }).then((
|
|
2837
|
-
Object.assign(bundle,
|
|
2838
|
-
}).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) => {
|
|
2839
2749
|
typeof s == "function" && s(), i.reject();
|
|
2840
2750
|
});
|
|
2841
2751
|
}
|
|
@@ -2868,89 +2778,6 @@ class IdiomService {
|
|
|
2868
2778
|
return e;
|
|
2869
2779
|
}
|
|
2870
2780
|
}
|
|
2871
|
-
function toRelativePath(n, e) {
|
|
2872
|
-
const t = `/remote.php/dav/files/${e}`, s = n.startsWith(t) ? n.slice(t.length) : n;
|
|
2873
|
-
return decodeURIComponent(s || "/");
|
|
2874
|
-
}
|
|
2875
|
-
function toNextcloudDocument(n, e) {
|
|
2876
|
-
return {
|
|
2877
|
-
path: toRelativePath(n.path, e),
|
|
2878
|
-
name: decodeURIComponent(n.displayname),
|
|
2879
|
-
ownerDisplayName: n.ownerDisplayName,
|
|
2880
|
-
contentType: n.contentType,
|
|
2881
|
-
size: n.size,
|
|
2882
|
-
favorite: n.favorite,
|
|
2883
|
-
etag: n.etag,
|
|
2884
|
-
fileId: n.fileId,
|
|
2885
|
-
isFolder: n.isFolder,
|
|
2886
|
-
lastModified: n.lastModified
|
|
2887
|
-
};
|
|
2888
|
-
}
|
|
2889
|
-
class NextcloudService {
|
|
2890
|
-
constructor(e) {
|
|
2891
|
-
this.context = e;
|
|
2892
|
-
}
|
|
2893
|
-
get http() {
|
|
2894
|
-
return this.context.http();
|
|
2895
|
-
}
|
|
2896
|
-
/**
|
|
2897
|
-
* List a user's Nextcloud documents and folders at a given path.
|
|
2898
|
-
* @param userId - the id of the user whose files are listed.
|
|
2899
|
-
* @param path - path to list, relative to the user's Nextcloud root; root when omitted.
|
|
2900
|
-
*/
|
|
2901
|
-
async listDocuments(e, t) {
|
|
2902
|
-
return (await this.http.get(
|
|
2903
|
-
`/nextcloud/files/user/${e}`,
|
|
2904
|
-
{ queryParams: t ? { path: t } : void 0 }
|
|
2905
|
-
)).data.map((r) => toNextcloudDocument(r, e));
|
|
2906
|
-
}
|
|
2907
|
-
/**
|
|
2908
|
-
* Copy Nextcloud documents into the entcore workspace.
|
|
2909
|
-
* @param userId - the id of the user whose files are copied.
|
|
2910
|
-
* @param paths - paths of the documents to copy, relative to the user's Nextcloud root.
|
|
2911
|
-
* @param parentId - the workspace folder to copy into; user's root when omitted.
|
|
2912
|
-
* @param params.application - the application the documents are added from.
|
|
2913
|
-
* @param params.visibility - "protected" files the documents under the
|
|
2914
|
-
* documents added from applications, the way an upload does.
|
|
2915
|
-
*/
|
|
2916
|
-
async copyDocumentToWorkspace(e, t, s, r) {
|
|
2917
|
-
const i = t.map((u) => `path=${encodeURIComponent(u)}`).join("&");
|
|
2918
|
-
return (await this.http.put(
|
|
2919
|
-
`/nextcloud/files/user/${e}/copy/workspace?${i}`,
|
|
2920
|
-
void 0,
|
|
2921
|
-
{
|
|
2922
|
-
queryParams: {
|
|
2923
|
-
...s ? { parentId: s } : {},
|
|
2924
|
-
...r != null && r.application ? { application: r.application } : {},
|
|
2925
|
-
...(r == null ? void 0 : r.visibility) === "protected" ? { protected: !0 } : {}
|
|
2926
|
-
}
|
|
2927
|
-
}
|
|
2928
|
-
)).data.filter((u) => !!(u != null && u._id));
|
|
2929
|
-
}
|
|
2930
|
-
/**
|
|
2931
|
-
* Check whether a user has an active Nextcloud OAuth2 connection.
|
|
2932
|
-
* @param userId - the id of the user to check.
|
|
2933
|
-
*/
|
|
2934
|
-
async getOauth2Status(e) {
|
|
2935
|
-
return this.http.get(
|
|
2936
|
-
`/nextcloud/user/${e}/oauth2/status`
|
|
2937
|
-
);
|
|
2938
|
-
}
|
|
2939
|
-
/**
|
|
2940
|
-
* Build the URL to download/preview a Nextcloud document.
|
|
2941
|
-
* There is no dedicated thumbnail endpoint on the backend, so this is also
|
|
2942
|
-
* used as an image preview source for image documents.
|
|
2943
|
-
* @param userId - the id of the user who owns the file.
|
|
2944
|
-
* @param doc - the document to build the URL for.
|
|
2945
|
-
*/
|
|
2946
|
-
getFileUrl(e, t) {
|
|
2947
|
-
return `/nextcloud/files/user/${e}/file/${encodeURIComponent(
|
|
2948
|
-
t.name
|
|
2949
|
-
)}/download?path=${encodeURIComponent(
|
|
2950
|
-
t.path
|
|
2951
|
-
)}&contentType=${encodeURIComponent(t.contentType ?? "")}&isFolder=${t.isFolder}`;
|
|
2952
|
-
}
|
|
2953
|
-
}
|
|
2954
2781
|
class AbstractBehaviourService {
|
|
2955
2782
|
//
|
|
2956
2783
|
// IMPLEMENTATION
|
|
@@ -2959,7 +2786,7 @@ class AbstractBehaviourService {
|
|
|
2959
2786
|
//-----------------
|
|
2960
2787
|
//--- Utilities ---
|
|
2961
2788
|
//-----------------
|
|
2962
|
-
|
|
2789
|
+
u(this, "_cache");
|
|
2963
2790
|
this.context = e, this._cache = new CacheService(this.context);
|
|
2964
2791
|
}
|
|
2965
2792
|
getApplication() {
|
|
@@ -2993,8 +2820,8 @@ class AbstractBehaviourService {
|
|
|
2993
2820
|
class ActualitesBehaviour extends AbstractBehaviourService {
|
|
2994
2821
|
constructor() {
|
|
2995
2822
|
super(...arguments);
|
|
2996
|
-
|
|
2997
|
-
|
|
2823
|
+
u(this, "APP", "actualites");
|
|
2824
|
+
u(this, "RESOURCE", "actualites");
|
|
2998
2825
|
}
|
|
2999
2826
|
async loadResources() {
|
|
3000
2827
|
const [t, s] = await Promise.all([
|
|
@@ -3005,10 +2832,10 @@ class ActualitesBehaviour extends AbstractBehaviourService {
|
|
|
3005
2832
|
/* @__PURE__ */ new Map()
|
|
3006
2833
|
);
|
|
3007
2834
|
return t.map((i) => {
|
|
3008
|
-
var
|
|
2835
|
+
var a;
|
|
3009
2836
|
let o;
|
|
3010
2837
|
return i.threadIcon ? o = i.threadIcon + "?thumbnail=48x48" : o = "/img/icons/glyphicons_036_file.png", this.dataToResource({
|
|
3011
|
-
title: i.title + " [" + ((
|
|
2838
|
+
title: i.title + " [" + ((a = r.get(i.threadId)) == null ? void 0 : a.title) + "]",
|
|
3012
2839
|
ownerName: i.owner.displayName,
|
|
3013
2840
|
owner: i.owner.id,
|
|
3014
2841
|
icon: o,
|
|
@@ -3029,8 +2856,8 @@ const hexToDataUrl = (n, e = 1, t = 1) => {
|
|
|
3029
2856
|
class AppointmentsBehaviour extends AbstractBehaviourService {
|
|
3030
2857
|
constructor() {
|
|
3031
2858
|
super(...arguments);
|
|
3032
|
-
|
|
3033
|
-
|
|
2859
|
+
u(this, "APP", "appointments");
|
|
2860
|
+
u(this, "RESOURCE", "appointments");
|
|
3034
2861
|
}
|
|
3035
2862
|
async loadResources() {
|
|
3036
2863
|
return (await this.httpGet("/appointments/grids/linker")).map((s) => this.dataToResource({
|
|
@@ -3048,8 +2875,8 @@ class AppointmentsBehaviour extends AbstractBehaviourService {
|
|
|
3048
2875
|
class BlogBehaviour extends AbstractBehaviourService {
|
|
3049
2876
|
constructor() {
|
|
3050
2877
|
super(...arguments);
|
|
3051
|
-
|
|
3052
|
-
|
|
2878
|
+
u(this, "APP", "blog");
|
|
2879
|
+
u(this, "RESOURCE", "blog");
|
|
3053
2880
|
}
|
|
3054
2881
|
loadResources() {
|
|
3055
2882
|
return new Promise(async (t, s) => {
|
|
@@ -3057,7 +2884,7 @@ class BlogBehaviour extends AbstractBehaviourService {
|
|
|
3057
2884
|
const r = await this.httpGet("/blog/linker"), i = [];
|
|
3058
2885
|
r.forEach((o) => {
|
|
3059
2886
|
o.thumbnail ? o.thumbnail = o.thumbnail + "?thumbnail=48x48" : o.thumbnail = "/img/illustrations/blog.svg";
|
|
3060
|
-
const
|
|
2887
|
+
const a = o.fetchPosts.map((c) => this.dataToResource({
|
|
3061
2888
|
owner: o.author.userId,
|
|
3062
2889
|
ownerName: o.author.username,
|
|
3063
2890
|
title: c.title + " [" + o.title + "]",
|
|
@@ -3067,7 +2894,7 @@ class BlogBehaviour extends AbstractBehaviourService {
|
|
|
3067
2894
|
shared: !!(o.shared && o.shared.length >= 0),
|
|
3068
2895
|
modified: o.modified
|
|
3069
2896
|
}));
|
|
3070
|
-
i.push(...
|
|
2897
|
+
i.push(...a);
|
|
3071
2898
|
}), t(i);
|
|
3072
2899
|
} catch (r) {
|
|
3073
2900
|
s(r);
|
|
@@ -3078,8 +2905,8 @@ class BlogBehaviour extends AbstractBehaviourService {
|
|
|
3078
2905
|
class CollaborativewallBehaviour extends AbstractBehaviourService {
|
|
3079
2906
|
constructor() {
|
|
3080
2907
|
super(...arguments);
|
|
3081
|
-
|
|
3082
|
-
|
|
2908
|
+
u(this, "APP", "collaborativewall");
|
|
2909
|
+
u(this, "RESOURCE", "collaborativewall");
|
|
3083
2910
|
}
|
|
3084
2911
|
async loadResources() {
|
|
3085
2912
|
return (await this.httpGet(
|
|
@@ -3101,8 +2928,8 @@ class CollaborativewallBehaviour extends AbstractBehaviourService {
|
|
|
3101
2928
|
class CommunityBehaviour extends AbstractBehaviourService {
|
|
3102
2929
|
constructor() {
|
|
3103
2930
|
super(...arguments);
|
|
3104
|
-
|
|
3105
|
-
|
|
2931
|
+
u(this, "APP", "community");
|
|
2932
|
+
u(this, "RESOURCE", "community");
|
|
3106
2933
|
}
|
|
3107
2934
|
async loadResources() {
|
|
3108
2935
|
return (await this.httpGet(
|
|
@@ -3126,8 +2953,8 @@ class CommunityBehaviour extends AbstractBehaviourService {
|
|
|
3126
2953
|
class ExercizerBehaviour extends AbstractBehaviourService {
|
|
3127
2954
|
constructor() {
|
|
3128
2955
|
super(...arguments);
|
|
3129
|
-
|
|
3130
|
-
|
|
2956
|
+
u(this, "APP", "exercizer");
|
|
2957
|
+
u(this, "RESOURCE", "exercizer");
|
|
3131
2958
|
}
|
|
3132
2959
|
async loadResources() {
|
|
3133
2960
|
return (await this.httpGet(
|
|
@@ -3135,8 +2962,8 @@ class ExercizerBehaviour extends AbstractBehaviourService {
|
|
|
3135
2962
|
)).map((s) => {
|
|
3136
2963
|
const r = s.picture ? s.picture + "?thumbnail=48x48" : "/img/illustrations/exercizer.svg";
|
|
3137
2964
|
let i, o = !1;
|
|
3138
|
-
const
|
|
3139
|
-
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({
|
|
3140
2967
|
title: s.title,
|
|
3141
2968
|
owner: s.owner,
|
|
3142
2969
|
ownerName: i,
|
|
@@ -3152,8 +2979,8 @@ class ExercizerBehaviour extends AbstractBehaviourService {
|
|
|
3152
2979
|
class FormulaireBehaviour extends AbstractBehaviourService {
|
|
3153
2980
|
constructor() {
|
|
3154
2981
|
super(...arguments);
|
|
3155
|
-
|
|
3156
|
-
|
|
2982
|
+
u(this, "APP", "formulaire");
|
|
2983
|
+
u(this, "RESOURCE", "formulaire");
|
|
3157
2984
|
}
|
|
3158
2985
|
async loadResources() {
|
|
3159
2986
|
return (await this.httpGet(
|
|
@@ -3173,8 +3000,8 @@ class FormulaireBehaviour extends AbstractBehaviourService {
|
|
|
3173
3000
|
class ForumBehaviour extends AbstractBehaviourService {
|
|
3174
3001
|
constructor() {
|
|
3175
3002
|
super(...arguments);
|
|
3176
|
-
|
|
3177
|
-
|
|
3003
|
+
u(this, "APP", "forum");
|
|
3004
|
+
u(this, "RESOURCE", "forum");
|
|
3178
3005
|
}
|
|
3179
3006
|
async loadResources() {
|
|
3180
3007
|
return (await this.httpGet("/forum/categories")).map(
|
|
@@ -3194,8 +3021,8 @@ class ForumBehaviour extends AbstractBehaviourService {
|
|
|
3194
3021
|
class HomeworksBehaviour extends AbstractBehaviourService {
|
|
3195
3022
|
constructor() {
|
|
3196
3023
|
super(...arguments);
|
|
3197
|
-
|
|
3198
|
-
|
|
3024
|
+
u(this, "APP", "homeworks");
|
|
3025
|
+
u(this, "RESOURCE", "homeworks");
|
|
3199
3026
|
}
|
|
3200
3027
|
async loadResources() {
|
|
3201
3028
|
return (await this.httpGet("/homeworks/list")).filter((t) => t.owner && t.trashed === 0).map((t) => this.dataToResource({
|
|
@@ -3213,8 +3040,8 @@ class HomeworksBehaviour extends AbstractBehaviourService {
|
|
|
3213
3040
|
class MagnetoBehaviour extends AbstractBehaviourService {
|
|
3214
3041
|
constructor() {
|
|
3215
3042
|
super(...arguments);
|
|
3216
|
-
|
|
3217
|
-
|
|
3043
|
+
u(this, "APP", "magneto");
|
|
3044
|
+
u(this, "RESOURCE", "magneto");
|
|
3218
3045
|
}
|
|
3219
3046
|
async loadResources() {
|
|
3220
3047
|
const { all: t } = await this.httpGet(
|
|
@@ -3235,8 +3062,8 @@ class MagnetoBehaviour extends AbstractBehaviourService {
|
|
|
3235
3062
|
class MindmapBehaviour extends AbstractBehaviourService {
|
|
3236
3063
|
constructor() {
|
|
3237
3064
|
super(...arguments);
|
|
3238
|
-
|
|
3239
|
-
|
|
3065
|
+
u(this, "APP", "mindmap");
|
|
3066
|
+
u(this, "RESOURCE", "mindmap");
|
|
3240
3067
|
}
|
|
3241
3068
|
async loadResources() {
|
|
3242
3069
|
return (await this.httpGet("/mindmap/list/all")).map(
|
|
@@ -3256,8 +3083,8 @@ class MindmapBehaviour extends AbstractBehaviourService {
|
|
|
3256
3083
|
class PagesBehaviour extends AbstractBehaviourService {
|
|
3257
3084
|
constructor() {
|
|
3258
3085
|
super(...arguments);
|
|
3259
|
-
|
|
3260
|
-
|
|
3086
|
+
u(this, "APP", "pages");
|
|
3087
|
+
u(this, "RESOURCE", "pages");
|
|
3261
3088
|
}
|
|
3262
3089
|
async loadResources() {
|
|
3263
3090
|
const t = await this.httpGet("/pages/list/all"), s = [];
|
|
@@ -3275,15 +3102,15 @@ class PagesBehaviour extends AbstractBehaviourService {
|
|
|
3275
3102
|
shared: typeof r.shared < "u",
|
|
3276
3103
|
modified: r.modified
|
|
3277
3104
|
})
|
|
3278
|
-
), (o = r.pages) == null || o.forEach((
|
|
3105
|
+
), (o = r.pages) == null || o.forEach((a) => {
|
|
3279
3106
|
s.push(
|
|
3280
3107
|
this.dataToResource({
|
|
3281
|
-
title:
|
|
3108
|
+
title: a.title,
|
|
3282
3109
|
owner: r.owner.userId,
|
|
3283
3110
|
ownerName: r.owner.displayName,
|
|
3284
3111
|
icon: i,
|
|
3285
|
-
path: "/pages#/website/" + r._id + "/" +
|
|
3286
|
-
_id: r._id + "/" +
|
|
3112
|
+
path: "/pages#/website/" + r._id + "/" + a.titleLink,
|
|
3113
|
+
_id: r._id + "/" + a.titleLink,
|
|
3287
3114
|
shared: typeof r.shared < "u",
|
|
3288
3115
|
modified: r.modified
|
|
3289
3116
|
})
|
|
@@ -3295,8 +3122,8 @@ class PagesBehaviour extends AbstractBehaviourService {
|
|
|
3295
3122
|
class PollBehaviour extends AbstractBehaviourService {
|
|
3296
3123
|
constructor() {
|
|
3297
3124
|
super(...arguments);
|
|
3298
|
-
|
|
3299
|
-
|
|
3125
|
+
u(this, "APP", "poll");
|
|
3126
|
+
u(this, "RESOURCE", "poll");
|
|
3300
3127
|
}
|
|
3301
3128
|
async loadResources() {
|
|
3302
3129
|
return (await this.httpGet("/poll/list/all")).map((s) => {
|
|
@@ -3317,8 +3144,8 @@ class PollBehaviour extends AbstractBehaviourService {
|
|
|
3317
3144
|
class ScrapbookBehaviour extends AbstractBehaviourService {
|
|
3318
3145
|
constructor() {
|
|
3319
3146
|
super(...arguments);
|
|
3320
|
-
|
|
3321
|
-
|
|
3147
|
+
u(this, "APP", "scrapbook");
|
|
3148
|
+
u(this, "RESOURCE", "scrapbook");
|
|
3322
3149
|
}
|
|
3323
3150
|
async loadResources() {
|
|
3324
3151
|
return (await this.httpGet(
|
|
@@ -3341,8 +3168,8 @@ class ScrapbookBehaviour extends AbstractBehaviourService {
|
|
|
3341
3168
|
class TimelinegeneratorBehaviour extends AbstractBehaviourService {
|
|
3342
3169
|
constructor() {
|
|
3343
3170
|
super(...arguments);
|
|
3344
|
-
|
|
3345
|
-
|
|
3171
|
+
u(this, "APP", "timelinegenerator");
|
|
3172
|
+
u(this, "RESOURCE", "timelinegenerator");
|
|
3346
3173
|
}
|
|
3347
3174
|
loadResources() {
|
|
3348
3175
|
return new Promise(async (t, s) => {
|
|
@@ -3350,12 +3177,12 @@ class TimelinegeneratorBehaviour extends AbstractBehaviourService {
|
|
|
3350
3177
|
const i = (await this.httpGet(
|
|
3351
3178
|
"/timelinegenerator/timelines"
|
|
3352
3179
|
)).map((o) => {
|
|
3353
|
-
const
|
|
3180
|
+
const a = o.icon || "/img/illustrations/timeline-default.png";
|
|
3354
3181
|
return this.dataToResource({
|
|
3355
3182
|
title: o.headline,
|
|
3356
3183
|
ownerName: o.owner.displayName,
|
|
3357
3184
|
owner: o.owner.userId,
|
|
3358
|
-
icon:
|
|
3185
|
+
icon: a,
|
|
3359
3186
|
path: "/timelinegenerator#/view/" + o._id,
|
|
3360
3187
|
_id: o._id,
|
|
3361
3188
|
shared: typeof o.shared < "u",
|
|
@@ -3372,8 +3199,8 @@ class TimelinegeneratorBehaviour extends AbstractBehaviourService {
|
|
|
3372
3199
|
class WikiBehaviour extends AbstractBehaviourService {
|
|
3373
3200
|
constructor() {
|
|
3374
3201
|
super(...arguments);
|
|
3375
|
-
|
|
3376
|
-
|
|
3202
|
+
u(this, "APP", "wiki");
|
|
3203
|
+
u(this, "RESOURCE", "wiki");
|
|
3377
3204
|
}
|
|
3378
3205
|
async loadResources() {
|
|
3379
3206
|
return (await this.httpGet(
|
|
@@ -3396,8 +3223,8 @@ class WikiBehaviour extends AbstractBehaviourService {
|
|
|
3396
3223
|
class WorkspaceBehaviour extends AbstractBehaviourService {
|
|
3397
3224
|
constructor() {
|
|
3398
3225
|
super(...arguments);
|
|
3399
|
-
|
|
3400
|
-
|
|
3226
|
+
u(this, "APP", "workspace");
|
|
3227
|
+
u(this, "RESOURCE", "workspace");
|
|
3401
3228
|
}
|
|
3402
3229
|
loadResources({ search: t, asset_id: s }) {
|
|
3403
3230
|
return new Promise(async (r, i) => {
|
|
@@ -3405,12 +3232,12 @@ class WorkspaceBehaviour extends AbstractBehaviourService {
|
|
|
3405
3232
|
let o = "/workspace/documents?filter=all&hierarchical=true";
|
|
3406
3233
|
s && s.length ? o += `&search=${t}` : t && t.length && (o += `&search=${t}`);
|
|
3407
3234
|
const c = (await this.httpGet(o)).filter((l) => !l.deleted).map((l) => {
|
|
3408
|
-
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";
|
|
3409
3236
|
return this.dataToResource({
|
|
3410
3237
|
title: l.name,
|
|
3411
3238
|
ownerName: l.ownerName,
|
|
3412
3239
|
owner: l.owner,
|
|
3413
|
-
icon:
|
|
3240
|
+
icon: h,
|
|
3414
3241
|
path: `/workspace/document/${l._id}`,
|
|
3415
3242
|
_id: l._id,
|
|
3416
3243
|
shared: !!(l.shared && l.shared.length >= 0),
|
|
@@ -3435,7 +3262,7 @@ const b = class b {
|
|
|
3435
3262
|
e.session().getUser()
|
|
3436
3263
|
]);
|
|
3437
3264
|
i != null && i.apps && (r != null && r.length) && (this.resourceProducingApps = r.filter(
|
|
3438
|
-
(o) => i.apps.some((
|
|
3265
|
+
(o) => i.apps.some((a) => a.address.includes(o))
|
|
3439
3266
|
));
|
|
3440
3267
|
} catch (r) {
|
|
3441
3268
|
console.warn("Failed to load resource-producing apps:", r);
|
|
@@ -3518,8 +3345,8 @@ const b = class b {
|
|
|
3518
3345
|
//
|
|
3519
3346
|
// STATIC REGISTRY
|
|
3520
3347
|
//
|
|
3521
|
-
|
|
3522
|
-
|
|
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", []);
|
|
3523
3350
|
let SnipletsService = b;
|
|
3524
3351
|
class RightService {
|
|
3525
3352
|
constructor(e) {
|
|
@@ -3718,14 +3545,14 @@ class SessionService {
|
|
|
3718
3545
|
r,
|
|
3719
3546
|
i,
|
|
3720
3547
|
o,
|
|
3721
|
-
|
|
3548
|
+
a
|
|
3722
3549
|
] = await Promise.all([
|
|
3723
3550
|
this.getCurrentLanguage(e),
|
|
3724
3551
|
this.latestQuotaAndUsage(e),
|
|
3725
3552
|
this.loadDescription(e),
|
|
3726
3553
|
this.getUserProfile(),
|
|
3727
3554
|
this.getBookmarks(e)
|
|
3728
|
-
]), { type: c, ...l } = t || {},
|
|
3555
|
+
]), { type: c, ...l } = t || {}, h = {
|
|
3729
3556
|
...l,
|
|
3730
3557
|
profiles: c || ["Guest"],
|
|
3731
3558
|
// "type" field from /userbook/api/person becomes "profiles"
|
|
@@ -3736,9 +3563,9 @@ class SessionService {
|
|
|
3736
3563
|
user: e,
|
|
3737
3564
|
quotaAndUsage: r,
|
|
3738
3565
|
currentLanguage: s,
|
|
3739
|
-
userDescription:
|
|
3566
|
+
userDescription: h,
|
|
3740
3567
|
userProfile: o,
|
|
3741
|
-
bookmarkedApps:
|
|
3568
|
+
bookmarkedApps: a
|
|
3742
3569
|
};
|
|
3743
3570
|
}
|
|
3744
3571
|
login(e, t, s, r) {
|
|
@@ -3832,7 +3659,7 @@ class SessionService {
|
|
|
3832
3659
|
applications: []
|
|
3833
3660
|
});
|
|
3834
3661
|
const i = [];
|
|
3835
|
-
return r.bookmarks.forEach((o,
|
|
3662
|
+
return r.bookmarks.forEach((o, a) => {
|
|
3836
3663
|
const c = ((e == null ? void 0 : e.apps) || []).find(
|
|
3837
3664
|
(l) => l.name === o
|
|
3838
3665
|
);
|
|
@@ -3848,11 +3675,11 @@ class SessionService {
|
|
|
3848
3675
|
}
|
|
3849
3676
|
async getPerson(e = {}) {
|
|
3850
3677
|
var c;
|
|
3851
|
-
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(
|
|
3852
3679
|
i,
|
|
3853
3680
|
t
|
|
3854
3681
|
);
|
|
3855
|
-
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;
|
|
3856
3683
|
}
|
|
3857
3684
|
async isAdml() {
|
|
3858
3685
|
const e = await this.getUser();
|
|
@@ -3910,38 +3737,38 @@ class ShareService {
|
|
|
3910
3737
|
t,
|
|
3911
3738
|
s,
|
|
3912
3739
|
r
|
|
3913
|
-
),
|
|
3740
|
+
), a = await this.cache.httpGetJson(o), c = a.users.visibles.filter(({ username: p, firstName: y, lastName: d, login: g }) => {
|
|
3914
3741
|
const A = StringUtils.removeAccents(
|
|
3915
|
-
|
|
3742
|
+
d || ""
|
|
3916
3743
|
).toLowerCase(), f = StringUtils.removeAccents(
|
|
3917
3744
|
y || ""
|
|
3918
3745
|
).toLowerCase(), w = StringUtils.removeAccents(
|
|
3919
|
-
|
|
3746
|
+
p || ""
|
|
3920
3747
|
).toLowerCase(), F = StringUtils.removeAccents(g || "").toLowerCase();
|
|
3921
3748
|
return w.includes(i) || f.includes(i) || A.includes(i) || F.includes(i);
|
|
3922
|
-
}).map((
|
|
3923
|
-
avatarUrl: this.directory.getAvatarUrl(
|
|
3924
|
-
directoryUrl: this.directory.getDirectoryUrl(
|
|
3925
|
-
displayName:
|
|
3926
|
-
id:
|
|
3927
|
-
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,
|
|
3928
3755
|
type: "user"
|
|
3929
|
-
})), l =
|
|
3930
|
-
avatarUrl: this.directory.getAvatarUrl(
|
|
3931
|
-
directoryUrl: this.directory.getDirectoryUrl(
|
|
3932
|
-
displayName:
|
|
3933
|
-
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,
|
|
3934
3761
|
type: "group",
|
|
3935
|
-
structureName:
|
|
3762
|
+
structureName: p.structureName
|
|
3936
3763
|
}));
|
|
3937
|
-
return [...(await this.directory.getBookMarks()).filter(({ displayName:
|
|
3938
|
-
|
|
3939
|
-
).toLowerCase().includes(i)).map((
|
|
3764
|
+
return [...(await this.directory.getBookMarks()).filter(({ displayName: p }) => StringUtils.removeAccents(
|
|
3765
|
+
p || ""
|
|
3766
|
+
).toLowerCase().includes(i)).map((p) => ({
|
|
3940
3767
|
avatarUrl: "",
|
|
3941
3768
|
directoryUrl: "",
|
|
3942
3769
|
profile: "",
|
|
3943
|
-
displayName:
|
|
3944
|
-
id:
|
|
3770
|
+
displayName: p.displayName,
|
|
3771
|
+
id: p.id,
|
|
3945
3772
|
type: "sharebookmark"
|
|
3946
3773
|
})), ...c, ...l];
|
|
3947
3774
|
}
|
|
@@ -3957,10 +3784,10 @@ class ShareService {
|
|
|
3957
3784
|
return s;
|
|
3958
3785
|
}
|
|
3959
3786
|
getActionsAvailableFor({ id: e, type: t }, s, r) {
|
|
3960
|
-
const o = (t === "user" ? s.users.checked[e] : s.groups.checked[e]) || [],
|
|
3961
|
-
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)
|
|
3962
3789
|
r[l].filter(
|
|
3963
|
-
(
|
|
3790
|
+
(p) => o.includes(p)
|
|
3964
3791
|
).length > 0 && c.push(l);
|
|
3965
3792
|
return c;
|
|
3966
3793
|
}
|
|
@@ -3972,26 +3799,26 @@ class ShareService {
|
|
|
3972
3799
|
s == null ? void 0 : s.getResourceRights
|
|
3973
3800
|
), o = await this.cache.httpGetJson(
|
|
3974
3801
|
i
|
|
3975
|
-
),
|
|
3802
|
+
), a = await this.getShareMapping(
|
|
3976
3803
|
e,
|
|
3977
3804
|
s == null ? void 0 : s.getShareMapping
|
|
3978
3805
|
), c = await this.cache.httpGetJson(
|
|
3979
3806
|
"/infra/public/json/sharing-rights.json"
|
|
3980
|
-
), l = Object.keys(o.users.checked).map((
|
|
3981
|
-
(A) => A.id ===
|
|
3982
|
-
)).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) => {
|
|
3983
3810
|
const g = this.getActionsAvailableFor(
|
|
3984
|
-
{ id:
|
|
3811
|
+
{ id: d.id, type: "user" },
|
|
3985
3812
|
o,
|
|
3986
|
-
|
|
3813
|
+
a
|
|
3987
3814
|
);
|
|
3988
3815
|
return {
|
|
3989
|
-
id:
|
|
3816
|
+
id: d.id,
|
|
3990
3817
|
type: "user",
|
|
3991
|
-
displayName:
|
|
3992
|
-
profile:
|
|
3993
|
-
avatarUrl: this.directory.getAvatarUrl(
|
|
3994
|
-
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"),
|
|
3995
3822
|
actions: g.map((f) => {
|
|
3996
3823
|
const w = c[f];
|
|
3997
3824
|
return {
|
|
@@ -4001,21 +3828,21 @@ class ShareService {
|
|
|
4001
3828
|
};
|
|
4002
3829
|
})
|
|
4003
3830
|
};
|
|
4004
|
-
}).sort((
|
|
4005
|
-
(A) => A.id ===
|
|
4006
|
-
)).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) => {
|
|
4007
3834
|
const g = this.getActionsAvailableFor(
|
|
4008
|
-
{ id:
|
|
3835
|
+
{ id: d.id, type: "group" },
|
|
4009
3836
|
o,
|
|
4010
|
-
|
|
3837
|
+
a
|
|
4011
3838
|
);
|
|
4012
3839
|
return {
|
|
4013
|
-
id:
|
|
3840
|
+
id: d.id,
|
|
4014
3841
|
type: "group",
|
|
4015
|
-
displayName:
|
|
3842
|
+
displayName: d.name,
|
|
4016
3843
|
profile: void 0,
|
|
4017
|
-
avatarUrl: this.directory.getAvatarUrl(
|
|
4018
|
-
directoryUrl: this.directory.getDirectoryUrl(
|
|
3844
|
+
avatarUrl: this.directory.getAvatarUrl(d.id, "group"),
|
|
3845
|
+
directoryUrl: this.directory.getDirectoryUrl(d.id, "group"),
|
|
4019
3846
|
actions: g.map((f) => {
|
|
4020
3847
|
const w = c[f];
|
|
4021
3848
|
return {
|
|
@@ -4025,26 +3852,26 @@ class ShareService {
|
|
|
4025
3852
|
};
|
|
4026
3853
|
})
|
|
4027
3854
|
};
|
|
4028
|
-
}).sort((
|
|
4029
|
-
({ 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 }) => ({
|
|
4030
3857
|
labels: f,
|
|
4031
|
-
displayName:
|
|
3858
|
+
displayName: d || A,
|
|
4032
3859
|
id: g
|
|
4033
3860
|
})
|
|
4034
3861
|
), y = o.users.visibles.map(
|
|
4035
|
-
({ id:
|
|
3862
|
+
({ id: d, profile: g, username: A, firstName: f, lastName: w, login: F }) => ({
|
|
4036
3863
|
displayName: A,
|
|
4037
3864
|
firstName: f,
|
|
4038
3865
|
lastName: w,
|
|
4039
3866
|
login: F,
|
|
4040
3867
|
profile: g,
|
|
4041
|
-
id:
|
|
3868
|
+
id: d
|
|
4042
3869
|
})
|
|
4043
3870
|
);
|
|
4044
3871
|
return {
|
|
4045
|
-
rights:
|
|
3872
|
+
rights: E,
|
|
4046
3873
|
visibleBookmarks: r,
|
|
4047
|
-
visibleGroups:
|
|
3874
|
+
visibleGroups: p,
|
|
4048
3875
|
visibleUsers: y
|
|
4049
3876
|
};
|
|
4050
3877
|
}
|
|
@@ -4055,7 +3882,7 @@ class ShareService {
|
|
|
4055
3882
|
bookmarks: {}
|
|
4056
3883
|
}, i = await this.getShareMapping(e, s);
|
|
4057
3884
|
for (const o of t) {
|
|
4058
|
-
const
|
|
3885
|
+
const a = o.actions.map((l) => i[l.id]).reduce((l, h) => Array.isArray(h) ? [...l, ...h] : l, []), c = [...new Set(a)];
|
|
4059
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);
|
|
4060
3887
|
}
|
|
4061
3888
|
return r;
|
|
@@ -4065,40 +3892,40 @@ class ShareService {
|
|
|
4065
3892
|
e,
|
|
4066
3893
|
s,
|
|
4067
3894
|
r == null ? void 0 : r.getShareMapping
|
|
4068
|
-
), 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(
|
|
4069
3896
|
e,
|
|
4070
3897
|
t,
|
|
4071
3898
|
"",
|
|
4072
3899
|
r == null ? void 0 : r.getResourceRights
|
|
4073
3900
|
);
|
|
4074
|
-
return this.cache.clearCache(
|
|
3901
|
+
return this.cache.clearCache(a), await this.http.putJson(o, i);
|
|
4075
3902
|
}
|
|
4076
3903
|
async getActionsForApp(e, t) {
|
|
4077
3904
|
const s = await this.cache.httpGetJson(
|
|
4078
3905
|
"/infra/public/json/sharing-rights.json"
|
|
4079
3906
|
), r = await this.getShareMapping(e, t);
|
|
4080
3907
|
return Object.keys(s).map((o) => {
|
|
4081
|
-
const
|
|
3908
|
+
const a = s[o];
|
|
4082
3909
|
return {
|
|
4083
3910
|
displayName: o,
|
|
4084
3911
|
id: o,
|
|
4085
|
-
priority:
|
|
4086
|
-
requires:
|
|
3912
|
+
priority: a.priority,
|
|
3913
|
+
requires: a.requires
|
|
4087
3914
|
};
|
|
4088
3915
|
}).filter((o) => {
|
|
4089
|
-
var
|
|
4090
|
-
return ((
|
|
4091
|
-
}).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);
|
|
4092
3919
|
}
|
|
4093
3920
|
}
|
|
4094
3921
|
const loadedScripts = {};
|
|
4095
3922
|
class HttpService {
|
|
4096
3923
|
constructor(e, t) {
|
|
4097
3924
|
// Axios automatically manages the XSRF-TOKEN cookie and the X-XSRF-TOKEN HTTP header.
|
|
4098
|
-
|
|
4099
|
-
|
|
4100
|
-
|
|
4101
|
-
|
|
3925
|
+
u(this, "axios");
|
|
3926
|
+
u(this, "baseUrl");
|
|
3927
|
+
u(this, "headers", {});
|
|
3928
|
+
u(this, "_latestResponse");
|
|
4102
3929
|
this.context = e, this.axios = axios.create(t);
|
|
4103
3930
|
}
|
|
4104
3931
|
fixBaseUrl(e) {
|
|
@@ -4313,8 +4140,8 @@ class HttpService {
|
|
|
4313
4140
|
const r = s ?? "exports", i = this.toAxiosConfig(t);
|
|
4314
4141
|
return i.headers && (i.headers.Accept = "application/javascript"), this.axios.get(this.toCdnUrl(e), i).then((o) => this.mapAxiosResponse(o, t)).then((o) => {
|
|
4315
4142
|
try {
|
|
4316
|
-
const
|
|
4317
|
-
return Function(
|
|
4143
|
+
const a = `"use strict";var ${r.split(".")[0]}={};${o};return ${r};`;
|
|
4144
|
+
return Function(a)();
|
|
4318
4145
|
} catch {
|
|
4319
4146
|
return o;
|
|
4320
4147
|
}
|
|
@@ -4328,7 +4155,7 @@ class HttpService {
|
|
|
4328
4155
|
});
|
|
4329
4156
|
}
|
|
4330
4157
|
}
|
|
4331
|
-
const
|
|
4158
|
+
const R = class R {
|
|
4332
4159
|
// in minutes. Applies to recorded videos.
|
|
4333
4160
|
constructor(e) {
|
|
4334
4161
|
this.context = e;
|
|
@@ -4349,8 +4176,8 @@ const C = class C {
|
|
|
4349
4176
|
APP$4.VIDEO
|
|
4350
4177
|
);
|
|
4351
4178
|
return {
|
|
4352
|
-
maxWeight: (e == null ? void 0 : e["max-videosize-mbytes"]) ??
|
|
4353
|
-
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,
|
|
4354
4181
|
acceptVideoUploadExtensions: ((t = e == null ? void 0 : e["accept-videoupload-extensions"]) == null ? void 0 : t.map(
|
|
4355
4182
|
(s) => s.toUpperCase()
|
|
4356
4183
|
)) ?? []
|
|
@@ -4373,43 +4200,43 @@ const C = class C {
|
|
|
4373
4200
|
throw new Error("Invalid video filename");
|
|
4374
4201
|
const i = `${e.browser.name} ${e.browser.version}`, o = new FormData();
|
|
4375
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);
|
|
4376
|
-
let
|
|
4377
|
-
r && (
|
|
4203
|
+
let a = `/video/encode?captation=${s}`;
|
|
4204
|
+
r && (a += `&duration=${r}`);
|
|
4378
4205
|
const c = await this.http.post(
|
|
4379
|
-
|
|
4206
|
+
a,
|
|
4380
4207
|
o,
|
|
4381
4208
|
{ headers: { "Content-Type": "multipart/form-data" } }
|
|
4382
4209
|
);
|
|
4383
4210
|
if (c.state == "running") {
|
|
4384
|
-
let l = 0,
|
|
4211
|
+
let l = 0, h = 1;
|
|
4385
4212
|
do {
|
|
4386
|
-
const
|
|
4213
|
+
const E = h + l;
|
|
4387
4214
|
await new Promise(
|
|
4388
|
-
(y) => setTimeout(y,
|
|
4389
|
-
), l =
|
|
4390
|
-
const
|
|
4215
|
+
(y) => setTimeout(y, E * 1e3)
|
|
4216
|
+
), l = h, h = Math.min(8, E);
|
|
4217
|
+
const p = await this.http.get(
|
|
4391
4218
|
`/video/status/${c.processid}`
|
|
4392
4219
|
);
|
|
4393
|
-
if (
|
|
4394
|
-
return
|
|
4395
|
-
|
|
4220
|
+
if (p.state == "succeed")
|
|
4221
|
+
return p.videoworkspaceid && p.videosize && this.context.data().trackVideoSave(
|
|
4222
|
+
p.videoworkspaceid,
|
|
4396
4223
|
Math.round(r),
|
|
4397
|
-
|
|
4224
|
+
p.videosize,
|
|
4398
4225
|
s,
|
|
4399
4226
|
e.url,
|
|
4400
4227
|
i,
|
|
4401
4228
|
e.device
|
|
4402
|
-
),
|
|
4403
|
-
if (
|
|
4229
|
+
), p;
|
|
4230
|
+
if (p.state == "error")
|
|
4404
4231
|
break;
|
|
4405
4232
|
} while (!0);
|
|
4406
4233
|
}
|
|
4407
4234
|
throw new Error("Video cannot be uploaded.");
|
|
4408
4235
|
}
|
|
4409
4236
|
};
|
|
4410
|
-
|
|
4411
|
-
|
|
4412
|
-
let VideoService =
|
|
4237
|
+
u(R, "MAX_WEIGHT", 50), // in Mbytes. Applies to uploaded videos.
|
|
4238
|
+
u(R, "MAX_DURATION", 3);
|
|
4239
|
+
let VideoService = R;
|
|
4413
4240
|
class WidgetService {
|
|
4414
4241
|
constructor(e) {
|
|
4415
4242
|
this.context = e;
|
|
@@ -4490,7 +4317,7 @@ const defaultMappers = {
|
|
|
4490
4317
|
}
|
|
4491
4318
|
};
|
|
4492
4319
|
// FIXME add edumedia support
|
|
4493
|
-
|
|
4320
|
+
u(v, "roleMappers", [
|
|
4494
4321
|
(e) => Object.keys(defaultMappers).find((s) => defaultMappers[s](e))
|
|
4495
4322
|
]);
|
|
4496
4323
|
let DocumentHelper = v;
|
|
@@ -4508,29 +4335,29 @@ class WorkspaceService {
|
|
|
4508
4335
|
size: e.size,
|
|
4509
4336
|
extension: i,
|
|
4510
4337
|
role: DocumentHelper.role(r, !1, i)
|
|
4511
|
-
},
|
|
4512
|
-
return { basename:
|
|
4338
|
+
}, a = t.replace("." + o.extension, ""), c = o.extension ? a + "." + o.extension : a;
|
|
4339
|
+
return { basename: a, fullname: c, metadata: o };
|
|
4513
4340
|
}
|
|
4514
4341
|
async saveFile(e, t) {
|
|
4515
4342
|
const { fullname: s, metadata: r } = this.extractMetadata(e), i = new FormData();
|
|
4516
4343
|
i.append("file", e, s);
|
|
4517
4344
|
const o = [];
|
|
4518
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}`);
|
|
4519
|
-
const
|
|
4346
|
+
const a = await this.http.postFile(
|
|
4520
4347
|
`/workspace/document?${o.join("&")}`,
|
|
4521
4348
|
i
|
|
4522
4349
|
);
|
|
4523
4350
|
if (this.http.isResponseError())
|
|
4524
4351
|
throw this.http.latestResponse.statusText;
|
|
4525
|
-
return
|
|
4352
|
+
return a;
|
|
4526
4353
|
}
|
|
4527
4354
|
async updateFile(e, t, s) {
|
|
4528
4355
|
const { fullname: r, metadata: i } = this.extractMetadata(t), o = new FormData();
|
|
4529
4356
|
o.append("file", t, r);
|
|
4530
|
-
const
|
|
4531
|
-
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}`);
|
|
4532
4359
|
const c = await this.http.putFile(
|
|
4533
|
-
`/workspace/document/${e}?${
|
|
4360
|
+
`/workspace/document/${e}?${a.join("&")}`,
|
|
4534
4361
|
o
|
|
4535
4362
|
);
|
|
4536
4363
|
if (this.http.isResponseError())
|
|
@@ -4581,11 +4408,11 @@ class WorkspaceService {
|
|
|
4581
4408
|
);
|
|
4582
4409
|
if (this.http.isResponseError())
|
|
4583
4410
|
throw this.http.latestResponse.statusText;
|
|
4584
|
-
return r.forEach((o,
|
|
4411
|
+
return r.forEach((o, a) => {
|
|
4585
4412
|
const c = e.findIndex(
|
|
4586
4413
|
(l) => l._id === o._id
|
|
4587
4414
|
);
|
|
4588
|
-
0 <= c && c < e.length && (e[c] = i[
|
|
4415
|
+
0 <= c && c < e.length && (e[c] = i[a]);
|
|
4589
4416
|
}), e.filter((o) => !!o);
|
|
4590
4417
|
}
|
|
4591
4418
|
return e;
|
|
@@ -4600,12 +4427,12 @@ class WorkspaceService {
|
|
|
4600
4427
|
if (typeof e == "string")
|
|
4601
4428
|
return e.includes("data:image") || e.includes("thumbnail") ? e : `${e}${e.includes("?") ? "&" : "?"}thumbnail=${r}`;
|
|
4602
4429
|
{
|
|
4603
|
-
const
|
|
4430
|
+
const a = `/workspace/${e.public ? "pub/" : ""}document/${e._id}?thumbnail=`, c = e.thumbnails;
|
|
4604
4431
|
if ((o = (i = e.metadata) == null ? void 0 : i["content-type"]) != null && o.includes("video")) {
|
|
4605
4432
|
const l = c && Object.keys(c).length > 0 ? Object.keys(c)[0] : null;
|
|
4606
|
-
return l ?
|
|
4433
|
+
return l ? a + l : null;
|
|
4607
4434
|
} else
|
|
4608
|
-
return
|
|
4435
|
+
return a + r;
|
|
4609
4436
|
}
|
|
4610
4437
|
}
|
|
4611
4438
|
/**
|
|
@@ -4659,24 +4486,22 @@ class WorkspaceService {
|
|
|
4659
4486
|
}
|
|
4660
4487
|
class OdeServices {
|
|
4661
4488
|
constructor() {
|
|
4662
|
-
|
|
4663
|
-
|
|
4664
|
-
|
|
4665
|
-
|
|
4666
|
-
|
|
4667
|
-
|
|
4668
|
-
|
|
4669
|
-
|
|
4670
|
-
|
|
4671
|
-
|
|
4672
|
-
|
|
4673
|
-
|
|
4674
|
-
|
|
4675
|
-
|
|
4676
|
-
|
|
4677
|
-
|
|
4678
|
-
a(this, "_embedder");
|
|
4679
|
-
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);
|
|
4680
4505
|
}
|
|
4681
4506
|
initialize() {
|
|
4682
4507
|
return this._data.initialize(), this;
|
|
@@ -4699,18 +4524,12 @@ class OdeServices {
|
|
|
4699
4524
|
directory() {
|
|
4700
4525
|
return this._directory;
|
|
4701
4526
|
}
|
|
4702
|
-
googledrive() {
|
|
4703
|
-
return this._googledrive;
|
|
4704
|
-
}
|
|
4705
4527
|
http() {
|
|
4706
4528
|
return this._http;
|
|
4707
4529
|
}
|
|
4708
4530
|
idiom() {
|
|
4709
4531
|
return this._idiom;
|
|
4710
4532
|
}
|
|
4711
|
-
nextcloud() {
|
|
4712
|
-
return this._nextcloud;
|
|
4713
|
-
}
|
|
4714
4533
|
notify() {
|
|
4715
4534
|
return this._notify;
|
|
4716
4535
|
}
|
|
@@ -4886,10 +4705,10 @@ const isActionAvailable = (n, e) => {
|
|
|
4886
4705
|
class WidgetFramework {
|
|
4887
4706
|
constructor() {
|
|
4888
4707
|
//-------------------------------------
|
|
4889
|
-
|
|
4890
|
-
|
|
4708
|
+
u(this, "_initialized");
|
|
4709
|
+
u(this, "_widgets", []);
|
|
4891
4710
|
////////////////////////////////////// USER PREFERENCES
|
|
4892
|
-
|
|
4711
|
+
u(this, "_userPrefs", {});
|
|
4893
4712
|
}
|
|
4894
4713
|
initialize(e, t) {
|
|
4895
4714
|
return this._initialized || (this._initialized = new Promisified(), notify.onSessionReady().promise.then((s) => {
|
|
@@ -4932,20 +4751,20 @@ class WidgetFramework {
|
|
|
4932
4751
|
this._userPrefs = e ?? this._userPrefs;
|
|
4933
4752
|
const t = configure.Platform.theme, s = [];
|
|
4934
4753
|
t.listSkins().then((r) => {
|
|
4935
|
-
var
|
|
4936
|
-
const i = ((
|
|
4754
|
+
var a;
|
|
4755
|
+
const i = ((a = r.find((c) => c.child === t.skin)) == null ? void 0 : a.parent) === "panda" ? secondLevelWidgets : firstLevelWidgets;
|
|
4937
4756
|
this._widgets = this._widgets.filter((c, l) => {
|
|
4938
|
-
const
|
|
4939
|
-
return i.indexOf(
|
|
4940
|
-
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,
|
|
4941
4760
|
show: !0,
|
|
4942
4761
|
position: c.platformConf.position
|
|
4943
|
-
}), 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);
|
|
4944
4763
|
});
|
|
4945
4764
|
const o = new Idiom();
|
|
4946
4765
|
this._widgets = this._widgets.sort((c, l) => {
|
|
4947
|
-
const
|
|
4948
|
-
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;
|
|
4949
4768
|
});
|
|
4950
4769
|
});
|
|
4951
4770
|
}
|
|
@@ -4953,8 +4772,8 @@ class WidgetFramework {
|
|
|
4953
4772
|
class Widget {
|
|
4954
4773
|
//-------------------------------------
|
|
4955
4774
|
constructor(e) {
|
|
4956
|
-
|
|
4957
|
-
|
|
4775
|
+
u(this, "_schoolConf", {});
|
|
4776
|
+
u(this, "_userPref");
|
|
4958
4777
|
this._platformConf = e, this._userPref = null;
|
|
4959
4778
|
}
|
|
4960
4779
|
get platformConf() {
|
|
@@ -5005,8 +4824,6 @@ export {
|
|
|
5005
4824
|
ERROR_CODE,
|
|
5006
4825
|
EVENT_NAME,
|
|
5007
4826
|
FOLDER,
|
|
5008
|
-
GOOGLE_DRIVE_FOLDER_MIME_TYPE,
|
|
5009
|
-
GoogleDriveCopyError,
|
|
5010
4827
|
ITimelineFactory,
|
|
5011
4828
|
LAYER_NAME,
|
|
5012
4829
|
NotifyFrameworkFactory,
|