@edifice.io/client 2.1.1-develop-b2school.20250328142432 → 2.1.1-develop-b2school.20250402113004
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1 -1
- package/dist/index.js +278 -268
- package/dist/workspace/Service.d.ts +1 -0
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
var v = Object.defineProperty;
|
|
2
2
|
var T = (u, e, t) => e in u ? v(u, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : u[e] = t;
|
|
3
|
-
var
|
|
3
|
+
var n = (u, e, t) => T(u, typeof e != "symbol" ? e + "" : e, t);
|
|
4
4
|
import axios from "axios";
|
|
5
5
|
import { MimeTypeUtils } from "@edifice.io/utilities";
|
|
6
6
|
const ERROR_CODE = {
|
|
@@ -99,7 +99,7 @@ const ERROR_CODE = {
|
|
|
99
99
|
};
|
|
100
100
|
class Subscription {
|
|
101
101
|
constructor(e, t) {
|
|
102
|
-
|
|
102
|
+
n(this, "revoke");
|
|
103
103
|
this._channel = e, this.revoke = this.setReceiver(
|
|
104
104
|
(s) => t == null ? void 0 : t(s.data)
|
|
105
105
|
);
|
|
@@ -117,7 +117,7 @@ class Subject {
|
|
|
117
117
|
* => We maintain here channels for *sending* messages.
|
|
118
118
|
* *Receiving* channels will be instantiated while subscribing.
|
|
119
119
|
*/
|
|
120
|
-
|
|
120
|
+
n(this, "publishChannels", /* @__PURE__ */ new Map());
|
|
121
121
|
}
|
|
122
122
|
getChannelName(e) {
|
|
123
123
|
return "Subject:" + e;
|
|
@@ -152,9 +152,9 @@ const ASYNC_DATA_NAME = {
|
|
|
152
152
|
class Promisified {
|
|
153
153
|
constructor() {
|
|
154
154
|
//-------------------------------------
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
155
|
+
n(this, "_resolution");
|
|
156
|
+
n(this, "_rejection");
|
|
157
|
+
n(this, "_promise", new Promise((e, t) => {
|
|
158
158
|
this._resolution = e, this._rejection = t;
|
|
159
159
|
}));
|
|
160
160
|
}
|
|
@@ -171,8 +171,8 @@ class Promisified {
|
|
|
171
171
|
class NotifyFramework {
|
|
172
172
|
constructor() {
|
|
173
173
|
//-------------------------------------
|
|
174
|
-
|
|
175
|
-
|
|
174
|
+
n(this, "promises", {});
|
|
175
|
+
n(this, "subject", new Subject());
|
|
176
176
|
}
|
|
177
177
|
asyncData(e) {
|
|
178
178
|
return typeof this.promises[e] > "u" && (this.promises[e] = new Promisified()), this.promises[e];
|
|
@@ -203,8 +203,8 @@ const notify = new NotifyFramework(), loadedScripts$1 = {};
|
|
|
203
203
|
class Http {
|
|
204
204
|
constructor(e) {
|
|
205
205
|
// Axios automatically manages the XSRF-TOKEN cookie and the X-XSRF-TOKEN HTTP header.
|
|
206
|
-
|
|
207
|
-
|
|
206
|
+
n(this, "axios");
|
|
207
|
+
n(this, "_latestResponse");
|
|
208
208
|
this.axios = axios.create(e);
|
|
209
209
|
}
|
|
210
210
|
setCdn(e) {
|
|
@@ -282,15 +282,15 @@ class Http {
|
|
|
282
282
|
}
|
|
283
283
|
getScript(e, t, s) {
|
|
284
284
|
const r = s ?? "exports", i = this.toAxiosConfig(t);
|
|
285
|
-
return i.headers && (i.headers.Accept = "application/javascript"), this.axios.get(this.toCdnUrl(e), i).then((
|
|
285
|
+
return i.headers && (i.headers.Accept = "application/javascript"), this.axios.get(this.toCdnUrl(e), i).then((o) => this.mapAxiosResponse(o, t)).then((o) => {
|
|
286
286
|
try {
|
|
287
|
-
const a = `"use strict";var ${r.split(".")[0]}={};${
|
|
287
|
+
const a = `"use strict";var ${r.split(".")[0]}={};${o};return ${r};`;
|
|
288
288
|
return Function(a)();
|
|
289
289
|
} catch {
|
|
290
|
-
return
|
|
290
|
+
return o;
|
|
291
291
|
}
|
|
292
|
-
}).catch((
|
|
293
|
-
throw this.mapAxiosError(
|
|
292
|
+
}).catch((o) => {
|
|
293
|
+
throw this.mapAxiosError(o, t), o;
|
|
294
294
|
});
|
|
295
295
|
}
|
|
296
296
|
loadScript(e, t) {
|
|
@@ -301,7 +301,7 @@ class Http {
|
|
|
301
301
|
}
|
|
302
302
|
class TransportFramework {
|
|
303
303
|
constructor() {
|
|
304
|
-
|
|
304
|
+
n(this, "_http", new Http());
|
|
305
305
|
}
|
|
306
306
|
get http() {
|
|
307
307
|
return this._http;
|
|
@@ -320,11 +320,11 @@ class ConfigurationFrameworkFactory {
|
|
|
320
320
|
const http$2 = transport.http;
|
|
321
321
|
class Session {
|
|
322
322
|
constructor() {
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
323
|
+
n(this, "_me", null);
|
|
324
|
+
n(this, "_currentLanguage", "");
|
|
325
|
+
n(this, "_notLoggedIn", !0);
|
|
326
|
+
n(this, "_description");
|
|
327
|
+
n(this, "_profile");
|
|
328
328
|
}
|
|
329
329
|
get currentLanguage() {
|
|
330
330
|
return this._currentLanguage;
|
|
@@ -369,8 +369,8 @@ class Session {
|
|
|
369
369
|
hasRight(e, t) {
|
|
370
370
|
if (t === "owner")
|
|
371
371
|
return e.owner && e.owner.userId === this._me.userId;
|
|
372
|
-
const s = t.right || t, i = e.shared.filter((a) => (this._me.groupsIds || []).indexOf(a.groupId) !== -1 || a.userId === this._me.userId).find((a) => a[s] || a.manager) !== void 0,
|
|
373
|
-
return i &&
|
|
372
|
+
const s = t.right || t, i = e.shared.filter((a) => (this._me.groupsIds || []).indexOf(a.groupId) !== -1 || a.userId === this._me.userId).find((a) => a[s] || a.manager) !== void 0, o = t.workflow ? this.hasWorkflow(t.workflow) : !0;
|
|
373
|
+
return i && o;
|
|
374
374
|
}
|
|
375
375
|
////////////////////////////////////////////////////////// Storage management
|
|
376
376
|
get latestQuotaAndUsage() {
|
|
@@ -442,7 +442,7 @@ class Session {
|
|
|
442
442
|
}
|
|
443
443
|
class SessionFramework {
|
|
444
444
|
constructor() {
|
|
445
|
-
|
|
445
|
+
n(this, "session", new Session());
|
|
446
446
|
}
|
|
447
447
|
initialize() {
|
|
448
448
|
return this.session.initialize();
|
|
@@ -466,22 +466,22 @@ class SessionFramework {
|
|
|
466
466
|
const session = new SessionFramework();
|
|
467
467
|
class Theme {
|
|
468
468
|
constructor() {
|
|
469
|
-
|
|
470
|
-
|
|
469
|
+
n(this, "_conf");
|
|
470
|
+
n(this, "_loaded");
|
|
471
471
|
// legacy (readonly)
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
472
|
+
n(this, "skinName", "");
|
|
473
|
+
n(this, "themeName", "");
|
|
474
|
+
n(this, "skin", "raw");
|
|
475
|
+
n(this, "themeUrl", "/assets/themes/raw/default/");
|
|
476
|
+
n(this, "templateOverrides", {});
|
|
477
|
+
n(this, "portalTemplate", "/assets/themes/raw/portal.html");
|
|
478
|
+
n(this, "basePath", "");
|
|
479
|
+
n(this, "logoutCallback", "/");
|
|
480
|
+
n(this, "skins", []);
|
|
481
|
+
n(this, "is1D", !1);
|
|
482
|
+
n(this, "is2D", !1);
|
|
483
|
+
n(this, "_onSkinReady", notify.onSkinReady());
|
|
484
|
+
n(this, "_onOverrideReady", notify.onOverridesReady());
|
|
485
485
|
}
|
|
486
486
|
initialize(e) {
|
|
487
487
|
return notify.onSessionReady().promise.then(() => this.load(e));
|
|
@@ -814,8 +814,8 @@ class Idiom {
|
|
|
814
814
|
else {
|
|
815
815
|
const i = new Promisified();
|
|
816
816
|
promises$1[t] = i.promise;
|
|
817
|
-
const
|
|
818
|
-
e && (
|
|
817
|
+
const o = {};
|
|
818
|
+
e && (o["Accept-Language"] = e), transport.http.get(t, { headers: o }).then((a) => {
|
|
819
819
|
Object.assign(bundle$1, a), typeof s == "function" && s(), i.resolve();
|
|
820
820
|
}).catch((a) => {
|
|
821
821
|
typeof s == "function" && s(), i.reject();
|
|
@@ -853,7 +853,7 @@ class Idiom {
|
|
|
853
853
|
class UserPreferences {
|
|
854
854
|
constructor() {
|
|
855
855
|
//-------------------------------------
|
|
856
|
-
|
|
856
|
+
n(this, "data", {});
|
|
857
857
|
}
|
|
858
858
|
get(e) {
|
|
859
859
|
return this.data[e];
|
|
@@ -880,10 +880,10 @@ class UserPreferences {
|
|
|
880
880
|
class User {
|
|
881
881
|
constructor() {
|
|
882
882
|
//-------------------------------------
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
883
|
+
n(this, "_me", null);
|
|
884
|
+
n(this, "_keepOpenOnLogout", !1);
|
|
885
|
+
n(this, "_preferences", new UserPreferences());
|
|
886
|
+
n(this, "_bookmarkedApps", []);
|
|
887
887
|
}
|
|
888
888
|
get keepOpenOnLogout() {
|
|
889
889
|
return this._keepOpenOnLogout;
|
|
@@ -915,7 +915,7 @@ class User {
|
|
|
915
915
|
let s;
|
|
916
916
|
if (t && t.length && typeof t.concat == "function") {
|
|
917
917
|
this._bookmarkedApps = t, s = {
|
|
918
|
-
bookmarks: t.map((
|
|
918
|
+
bookmarks: t.map((o) => o.name),
|
|
919
919
|
applications: []
|
|
920
920
|
}, transport.http.putJson("/userbook/preference/apps", s);
|
|
921
921
|
return;
|
|
@@ -927,15 +927,15 @@ class User {
|
|
|
927
927
|
});
|
|
928
928
|
let r = !0;
|
|
929
929
|
const i = [];
|
|
930
|
-
s.bookmarks.forEach((
|
|
931
|
-
const c = this._me.apps.find((h) => h.name ===
|
|
930
|
+
s.bookmarks.forEach((o, a) => {
|
|
931
|
+
const c = this._me.apps.find((h) => h.name === o);
|
|
932
932
|
if (c) {
|
|
933
933
|
const h = Object.assign({}, c);
|
|
934
934
|
this._bookmarkedApps.push(h);
|
|
935
935
|
} else
|
|
936
|
-
i.push(
|
|
937
|
-
}), i.forEach((
|
|
938
|
-
const a = s.bookmarks.indexOf(
|
|
936
|
+
i.push(o), r = !1;
|
|
937
|
+
}), i.forEach((o) => {
|
|
938
|
+
const a = s.bookmarks.indexOf(o);
|
|
939
939
|
a !== -1 && s.bookmarks.splice(a, 1);
|
|
940
940
|
}), r || transport.http.putJson("/userbook/preference/apps", s);
|
|
941
941
|
});
|
|
@@ -957,9 +957,9 @@ const http$1 = transport == null ? void 0 : transport.http;
|
|
|
957
957
|
class AppConf {
|
|
958
958
|
constructor() {
|
|
959
959
|
//-------------------------------------
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
960
|
+
n(this, "_publicConf", {});
|
|
961
|
+
n(this, "_currentApp");
|
|
962
|
+
n(this, "_appConf", {});
|
|
963
963
|
}
|
|
964
964
|
/**
|
|
965
965
|
* Get the currently initialized App.
|
|
@@ -997,8 +997,8 @@ class AppConf {
|
|
|
997
997
|
class Analytics {
|
|
998
998
|
constructor() {
|
|
999
999
|
//-------------------------------------
|
|
1000
|
-
|
|
1001
|
-
|
|
1000
|
+
n(this, "_status", "void");
|
|
1001
|
+
n(this, "_params");
|
|
1002
1002
|
}
|
|
1003
1003
|
get status() {
|
|
1004
1004
|
return this._status;
|
|
@@ -1050,8 +1050,8 @@ class Analytics {
|
|
|
1050
1050
|
configure.Platform.apps.currentApp
|
|
1051
1051
|
);
|
|
1052
1052
|
if (!i) return;
|
|
1053
|
-
const
|
|
1054
|
-
if (!
|
|
1053
|
+
const o = i.xiti;
|
|
1054
|
+
if (!o || !o.LIBELLE_SERVICE || !r.UAI) return;
|
|
1055
1055
|
function a(h) {
|
|
1056
1056
|
let l = "";
|
|
1057
1057
|
for (let E = 0; E < h.length; E++)
|
|
@@ -1066,10 +1066,10 @@ class Analytics {
|
|
|
1066
1066
|
Guest: "AUTRE"
|
|
1067
1067
|
};
|
|
1068
1068
|
return {
|
|
1069
|
-
LIBELLE_SERVICE:
|
|
1069
|
+
LIBELLE_SERVICE: o.LIBELLE_SERVICE,
|
|
1070
1070
|
// Which property of LIBELLE_SERVICE to use depends on the frontend.
|
|
1071
|
-
TYPE:
|
|
1072
|
-
OUTIL:
|
|
1071
|
+
TYPE: o.OUTIL ? "TIERS" : "NATIF",
|
|
1072
|
+
OUTIL: o.OUTIL ? o.OUTIL : "",
|
|
1073
1073
|
STRUCT_ID: r.collectiviteId,
|
|
1074
1074
|
STRUCT_UAI: r.UAI,
|
|
1075
1075
|
PROJET: r.projetId ? r.projetId : e.ID_PROJET,
|
|
@@ -1083,7 +1083,7 @@ class Analytics {
|
|
|
1083
1083
|
class ConfigurationFramework {
|
|
1084
1084
|
constructor() {
|
|
1085
1085
|
//-------------------------------------
|
|
1086
|
-
|
|
1086
|
+
n(this, "Platform", {
|
|
1087
1087
|
deploymentTag: "",
|
|
1088
1088
|
cdnDomain: "",
|
|
1089
1089
|
apps: new AppConf(),
|
|
@@ -1092,15 +1092,15 @@ class ConfigurationFramework {
|
|
|
1092
1092
|
idiom: new Idiom(),
|
|
1093
1093
|
listLanguages: () => transport.http.get("/languages")
|
|
1094
1094
|
});
|
|
1095
|
-
|
|
1095
|
+
n(this, "School", {
|
|
1096
1096
|
//apps; -> pinnedApps;
|
|
1097
1097
|
});
|
|
1098
|
-
|
|
1098
|
+
n(this, "User", new User());
|
|
1099
1099
|
}
|
|
1100
1100
|
async initialize(e, t) {
|
|
1101
1101
|
if (!e) {
|
|
1102
|
-
const r = (h) => (h < 10 ? "0" : "") + h.toFixed(0), i = /* @__PURE__ */ new Date(),
|
|
1103
|
-
e = `${
|
|
1102
|
+
const r = (h) => (h < 10 ? "0" : "") + h.toFixed(0), i = /* @__PURE__ */ new Date(), o = i.getFullYear(), a = i.getMonth() + 1, c = i.getDate();
|
|
1103
|
+
e = `${o}${r(a)}${r(c)}`;
|
|
1104
1104
|
}
|
|
1105
1105
|
const s = e;
|
|
1106
1106
|
this.Platform.deploymentTag = e, typeof t == "string" && t.length > 0 && (this.Platform.cdnDomain = t), transport.http.setCdn(this.Platform.cdnDomain), await Promise.all([
|
|
@@ -1142,8 +1142,8 @@ var _;
|
|
|
1142
1142
|
const me = (_ = session == null ? void 0 : session.session) == null ? void 0 : _.user;
|
|
1143
1143
|
class Notification {
|
|
1144
1144
|
constructor(e) {
|
|
1145
|
-
|
|
1146
|
-
|
|
1145
|
+
n(this, "_id");
|
|
1146
|
+
n(this, "model");
|
|
1147
1147
|
e.reported = e.reporters && e.reporters.length > 0, this._id = e._id, this.model = e;
|
|
1148
1148
|
}
|
|
1149
1149
|
isUnread() {
|
|
@@ -1163,14 +1163,14 @@ class Notification {
|
|
|
1163
1163
|
class TimelineApp {
|
|
1164
1164
|
constructor() {
|
|
1165
1165
|
//-------------------------------------
|
|
1166
|
-
|
|
1167
|
-
|
|
1166
|
+
n(this, "_notifications", []);
|
|
1167
|
+
n(this, "_notificationTypes", []);
|
|
1168
1168
|
// ex: ["BLOG"]
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1169
|
+
n(this, "_flashMessages", []);
|
|
1170
|
+
n(this, "_pageNumber", 0);
|
|
1171
|
+
n(this, "_lastPage", !1);
|
|
1172
|
+
n(this, "_loading", !1);
|
|
1173
|
+
n(this, "showMine", !1);
|
|
1174
1174
|
}
|
|
1175
1175
|
get notifications() {
|
|
1176
1176
|
return this._notifications;
|
|
@@ -1228,10 +1228,10 @@ class TimelineApp {
|
|
|
1228
1228
|
if (this._loading = !1, r.status === "ok")
|
|
1229
1229
|
if (r.number && r.results) {
|
|
1230
1230
|
const i = r.results.filter(
|
|
1231
|
-
(
|
|
1232
|
-
(a) => a._id ===
|
|
1231
|
+
(o) => this._notifications.findIndex(
|
|
1232
|
+
(a) => a._id === o._id
|
|
1233
1233
|
) === -1
|
|
1234
|
-
).map((
|
|
1234
|
+
).map((o) => new Notification(o));
|
|
1235
1235
|
this._notifications = this._notifications.concat(i), this._pageNumber++;
|
|
1236
1236
|
} else
|
|
1237
1237
|
this._lastPage = !0;
|
|
@@ -1319,7 +1319,7 @@ const f = class f {
|
|
|
1319
1319
|
//
|
|
1320
1320
|
// PROTECTED HELPERS
|
|
1321
1321
|
//
|
|
1322
|
-
|
|
1322
|
+
n(this, "checkHttpResponse", (e) => {
|
|
1323
1323
|
if (this.http.latestResponse.status >= 300)
|
|
1324
1324
|
throw this.http.latestResponse.statusText;
|
|
1325
1325
|
return e;
|
|
@@ -1471,7 +1471,7 @@ const f = class f {
|
|
|
1471
1471
|
});
|
|
1472
1472
|
return t.map((r) => {
|
|
1473
1473
|
const i = s.resources.find(
|
|
1474
|
-
(
|
|
1474
|
+
(o) => o.assetId === r
|
|
1475
1475
|
);
|
|
1476
1476
|
if (i === void 0)
|
|
1477
1477
|
throw "explorer.assetid.notfound";
|
|
@@ -1537,8 +1537,8 @@ const f = class f {
|
|
|
1537
1537
|
//
|
|
1538
1538
|
// STATIC REGISTRY
|
|
1539
1539
|
//
|
|
1540
|
-
|
|
1541
|
-
|
|
1540
|
+
n(f, "registry", new ServiceRegistry()), // Expose some useful functions
|
|
1541
|
+
n(f, "register", f.registry.register.bind(f.registry)), n(f, "findService", f.registry.findService.bind(f.registry)), n(f, "findMainService", f.registry.findMainService.bind(f.registry)), n(f, "isRegistered", f.registry.isRegistered.bind(f.registry));
|
|
1542
1542
|
let ResourceService = f;
|
|
1543
1543
|
const APP$2 = "scrapbook", RESOURCE$2 = "scrapbook";
|
|
1544
1544
|
class ScrapbookResourceService extends ResourceService {
|
|
@@ -1753,14 +1753,14 @@ class ConfService {
|
|
|
1753
1753
|
]), [r, i] = await Promise.all([
|
|
1754
1754
|
this.getTheme({ conf: t, publicTheme: s === void 0 }),
|
|
1755
1755
|
this.getWebAppConf({ app: e, applications: s ?? [] })
|
|
1756
|
-
]),
|
|
1756
|
+
]), o = {
|
|
1757
1757
|
app: e,
|
|
1758
1758
|
applications: s ?? [],
|
|
1759
1759
|
conf: t,
|
|
1760
1760
|
currentApp: i,
|
|
1761
1761
|
theme: r
|
|
1762
1762
|
};
|
|
1763
|
-
return this.notify.onAppConfReady().resolve(
|
|
1763
|
+
return this.notify.onAppConfReady().resolve(o), o;
|
|
1764
1764
|
}
|
|
1765
1765
|
async getPublicConf(e) {
|
|
1766
1766
|
const { response: t, value: s } = await this.cache.httpGet(
|
|
@@ -1812,23 +1812,23 @@ class ConfService {
|
|
|
1812
1812
|
conf: t,
|
|
1813
1813
|
publicTheme: s
|
|
1814
1814
|
}) {
|
|
1815
|
-
const r = await this.http.get("/theme"), i = s ? null : r,
|
|
1815
|
+
const r = await this.http.get("/theme"), i = s ? null : r, o = t == null ? void 0 : t.overriding.find(
|
|
1816
1816
|
(p) => (
|
|
1817
1817
|
// Public access => simply use the 1st override
|
|
1818
1818
|
i === null || p.child === i.themeName
|
|
1819
1819
|
)
|
|
1820
|
-
), a = (i == null ? void 0 : i.skinName) ||
|
|
1820
|
+
), a = (i == null ? void 0 : i.skinName) || o.skins[0], c = (i == null ? void 0 : i.skin) || `/assets/themes/${o.child}/skins/${a}/`, h = o.skins, l = o.bootstrapVersion.split("-").slice(-1)[0], E = o.parent === "panda";
|
|
1821
1821
|
return {
|
|
1822
1822
|
basePath: `${this.cdnDomain}${c}../../`,
|
|
1823
1823
|
bootstrapVersion: l,
|
|
1824
1824
|
is1d: E,
|
|
1825
1825
|
logoutCallback: (i == null ? void 0 : i.logoutCallback) || "/",
|
|
1826
|
-
skin:
|
|
1826
|
+
skin: o.child,
|
|
1827
1827
|
skinName: a,
|
|
1828
1828
|
skins: h,
|
|
1829
|
-
themeName:
|
|
1829
|
+
themeName: o.child,
|
|
1830
1830
|
themeUrl: c,
|
|
1831
|
-
npmTheme:
|
|
1831
|
+
npmTheme: o.npmTheme ?? void 0
|
|
1832
1832
|
};
|
|
1833
1833
|
}
|
|
1834
1834
|
async getLogoutCallback(e) {
|
|
@@ -1873,13 +1873,13 @@ class DirectoryService {
|
|
|
1873
1873
|
return {
|
|
1874
1874
|
id: s,
|
|
1875
1875
|
displayName: r,
|
|
1876
|
-
groups: t.map(({ name:
|
|
1877
|
-
displayName:
|
|
1876
|
+
groups: t.map(({ name: o, id: a }) => ({
|
|
1877
|
+
displayName: o,
|
|
1878
1878
|
id: a
|
|
1879
1879
|
})),
|
|
1880
|
-
users: i.map(({ displayName:
|
|
1880
|
+
users: i.map(({ displayName: o, id: a, profile: c }) => ({
|
|
1881
1881
|
profile: c,
|
|
1882
|
-
displayName:
|
|
1882
|
+
displayName: o,
|
|
1883
1883
|
// these info are missing from api
|
|
1884
1884
|
firstName: "",
|
|
1885
1885
|
lastName: "",
|
|
@@ -1894,7 +1894,7 @@ class DirectoryService {
|
|
|
1894
1894
|
users: r
|
|
1895
1895
|
}) {
|
|
1896
1896
|
this.cache.clearCache("/directory/sharebookmark/all");
|
|
1897
|
-
const i = r.map((p) => typeof p == "string" ? p : p.id),
|
|
1897
|
+
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) => {
|
|
1898
1898
|
if (typeof p == "string") {
|
|
1899
1899
|
const { displayName: d, groups: g, id: A, users: m } = await this.getBookMarkById(p), b = m.map((F) => F.id), C = g.map((F) => F.id);
|
|
1900
1900
|
return {
|
|
@@ -1906,7 +1906,7 @@ class DirectoryService {
|
|
|
1906
1906
|
return Promise.resolve(p);
|
|
1907
1907
|
}), h = (await Promise.all(a)).map((p) => p.members).reduce((p, d) => [...p, ...d], []), l = {
|
|
1908
1908
|
name: e,
|
|
1909
|
-
members: [...i, ...
|
|
1909
|
+
members: [...i, ...o, ...h]
|
|
1910
1910
|
}, { id: E } = await this.http.postJson(
|
|
1911
1911
|
"/directory/sharebookmark",
|
|
1912
1912
|
l
|
|
@@ -1922,10 +1922,10 @@ const loadedScripts = {};
|
|
|
1922
1922
|
class HttpService {
|
|
1923
1923
|
constructor(e, t) {
|
|
1924
1924
|
// Axios automatically manages the XSRF-TOKEN cookie and the X-XSRF-TOKEN HTTP header.
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1925
|
+
n(this, "axios");
|
|
1926
|
+
n(this, "baseUrl");
|
|
1927
|
+
n(this, "headers", {});
|
|
1928
|
+
n(this, "_latestResponse");
|
|
1929
1929
|
this.context = e, this.axios = axios.create(t);
|
|
1930
1930
|
}
|
|
1931
1931
|
fixBaseUrl(e) {
|
|
@@ -1970,15 +1970,15 @@ class HttpService {
|
|
|
1970
1970
|
status: 500,
|
|
1971
1971
|
statusText: ERROR_CODE.UNKNOWN
|
|
1972
1972
|
};
|
|
1973
|
-
const { status: s, statusText: r, headers: i, data:
|
|
1973
|
+
const { status: s, statusText: r, headers: i, data: o } = this._latestResponse;
|
|
1974
1974
|
return t != null && t.disableNotifications || notify.events().publish(LAYER_NAME.TRANSPORT, {
|
|
1975
1975
|
name: EVENT_NAME.ERROR_OCCURED,
|
|
1976
1976
|
data: {
|
|
1977
1977
|
params: t,
|
|
1978
1978
|
response: { status: s, statusText: r, headers: i },
|
|
1979
|
-
payload:
|
|
1979
|
+
payload: o
|
|
1980
1980
|
}
|
|
1981
|
-
}),
|
|
1981
|
+
}), o;
|
|
1982
1982
|
}
|
|
1983
1983
|
mapAxiosResponse(e, t) {
|
|
1984
1984
|
return this._latestResponse = e, e.data;
|
|
@@ -2101,15 +2101,15 @@ class HttpService {
|
|
|
2101
2101
|
}
|
|
2102
2102
|
getScript(e, t, s) {
|
|
2103
2103
|
const r = s ?? "exports", i = this.toAxiosConfig(t);
|
|
2104
|
-
return i.headers && (i.headers.Accept = "application/javascript"), this.axios.get(this.toCdnUrl(e), i).then((
|
|
2104
|
+
return i.headers && (i.headers.Accept = "application/javascript"), this.axios.get(this.toCdnUrl(e), i).then((o) => this.mapAxiosResponse(o, t)).then((o) => {
|
|
2105
2105
|
try {
|
|
2106
|
-
const a = `"use strict";var ${r.split(".")[0]}={};${
|
|
2106
|
+
const a = `"use strict";var ${r.split(".")[0]}={};${o};return ${r};`;
|
|
2107
2107
|
return Function(a)();
|
|
2108
2108
|
} catch {
|
|
2109
|
-
return
|
|
2109
|
+
return o;
|
|
2110
2110
|
}
|
|
2111
|
-
}).catch((
|
|
2112
|
-
throw this.mapAxiosError(
|
|
2111
|
+
}).catch((o) => {
|
|
2112
|
+
throw this.mapAxiosError(o, t), o;
|
|
2113
2113
|
});
|
|
2114
2114
|
}
|
|
2115
2115
|
loadScript(e, t) {
|
|
@@ -2169,13 +2169,13 @@ class RightService {
|
|
|
2169
2169
|
* @returns true if has rights
|
|
2170
2170
|
*/
|
|
2171
2171
|
hasResourceRight({ id: e, groupIds: t }, s, r) {
|
|
2172
|
-
const i = r.map((
|
|
2173
|
-
for (const
|
|
2174
|
-
if (
|
|
2172
|
+
const i = r.map((o) => typeof o == "string" ? this.parseResourceRight(o) : o).filter((o) => o !== void 0);
|
|
2173
|
+
for (const o of i) {
|
|
2174
|
+
if (o.id === e && o.type === "creator")
|
|
2175
2175
|
return !0;
|
|
2176
|
-
if (
|
|
2176
|
+
if (o.id === e && o.type === "user" && o.right === s)
|
|
2177
2177
|
return !0;
|
|
2178
|
-
if (t.includes(
|
|
2178
|
+
if (t.includes(o.id) && o.type === "group" && o.right === s)
|
|
2179
2179
|
return !0;
|
|
2180
2180
|
}
|
|
2181
2181
|
return !1;
|
|
@@ -2312,7 +2312,7 @@ class SessionService {
|
|
|
2312
2312
|
s,
|
|
2313
2313
|
r,
|
|
2314
2314
|
i,
|
|
2315
|
-
|
|
2315
|
+
o
|
|
2316
2316
|
] = await Promise.all([
|
|
2317
2317
|
this.getCurrentLanguage(e),
|
|
2318
2318
|
this.latestQuotaAndUsage(e),
|
|
@@ -2326,7 +2326,7 @@ class SessionService {
|
|
|
2326
2326
|
currentLanguage: t,
|
|
2327
2327
|
userDescription: r,
|
|
2328
2328
|
userProfile: i,
|
|
2329
|
-
bookmarkedApps:
|
|
2329
|
+
bookmarkedApps: o
|
|
2330
2330
|
};
|
|
2331
2331
|
}
|
|
2332
2332
|
login(e, t, s, r) {
|
|
@@ -2420,9 +2420,9 @@ class SessionService {
|
|
|
2420
2420
|
applications: []
|
|
2421
2421
|
});
|
|
2422
2422
|
const i = [];
|
|
2423
|
-
return r.bookmarks.forEach((
|
|
2423
|
+
return r.bookmarks.forEach((o, a) => {
|
|
2424
2424
|
const c = ((e == null ? void 0 : e.apps) || []).find(
|
|
2425
|
-
(h) => h.name ===
|
|
2425
|
+
(h) => h.name === o
|
|
2426
2426
|
);
|
|
2427
2427
|
if (c) {
|
|
2428
2428
|
const h = Object.assign({}, c);
|
|
@@ -2432,8 +2432,8 @@ class SessionService {
|
|
|
2432
2432
|
}
|
|
2433
2433
|
async getUserProfile(e = {}) {
|
|
2434
2434
|
var c, h;
|
|
2435
|
-
const { options: t = {}, params: s = {} } = e, r = new URLSearchParams(s).toString(), i = `/userbook/api/person${r ? `?${r}` : ""}`, { response:
|
|
2436
|
-
return
|
|
2435
|
+
const { options: t = {}, params: s = {} } = e, r = new URLSearchParams(s).toString(), i = `/userbook/api/person${r ? `?${r}` : ""}`, { response: o, value: a } = await this.cache.httpGet(i, t);
|
|
2436
|
+
return o.status < 200 || o.status >= 300 || typeof a == "string" ? ["Guest"] : ((h = (c = a == null ? void 0 : a.result) == null ? void 0 : c[0]) == null ? void 0 : h.type) || ["Guest"];
|
|
2437
2437
|
}
|
|
2438
2438
|
async isAdml() {
|
|
2439
2439
|
const e = await this.getUser();
|
|
@@ -2697,8 +2697,8 @@ class IdiomService {
|
|
|
2697
2697
|
else {
|
|
2698
2698
|
const i = new Promisified();
|
|
2699
2699
|
promises[t] = i.promise;
|
|
2700
|
-
const
|
|
2701
|
-
e && (
|
|
2700
|
+
const o = {};
|
|
2701
|
+
e && (o["Accept-Language"] = e), this.http.get(t, { headers: o }).then((a) => {
|
|
2702
2702
|
Object.assign(bundle, a), typeof s == "function" && s(), i.resolve();
|
|
2703
2703
|
}).catch((a) => {
|
|
2704
2704
|
typeof s == "function" && s(), i.reject();
|
|
@@ -2762,7 +2762,7 @@ class ShareService {
|
|
|
2762
2762
|
async searchShareSubjects(e, t, s) {
|
|
2763
2763
|
const r = StringUtils.removeAccents(s).toLowerCase(), i = await this.cache.httpGetJson(
|
|
2764
2764
|
`/${e}/share/json/${t}?search=${s}`
|
|
2765
|
-
),
|
|
2765
|
+
), o = i.users.visibles.filter(({ username: l, firstName: E, lastName: p, login: d }) => {
|
|
2766
2766
|
const g = StringUtils.removeAccents(
|
|
2767
2767
|
p || ""
|
|
2768
2768
|
).toLowerCase(), A = StringUtils.removeAccents(
|
|
@@ -2795,7 +2795,7 @@ class ShareService {
|
|
|
2795
2795
|
displayName: l.displayName,
|
|
2796
2796
|
id: l.id,
|
|
2797
2797
|
type: "sharebookmark"
|
|
2798
|
-
})), ...
|
|
2798
|
+
})), ...o, ...a];
|
|
2799
2799
|
}
|
|
2800
2800
|
async getShareMapping(e) {
|
|
2801
2801
|
const t = await this.cache.httpGetJson(
|
|
@@ -2809,15 +2809,15 @@ class ShareService {
|
|
|
2809
2809
|
return t;
|
|
2810
2810
|
}
|
|
2811
2811
|
getActionsAvailableFor({ id: e, type: t }, s, r) {
|
|
2812
|
-
const
|
|
2812
|
+
const o = (t === "user" ? s.users.checked[e] : s.groups.checked[e]) || [], a = Object.keys(r), c = [];
|
|
2813
2813
|
for (const h of a)
|
|
2814
2814
|
r[h].filter(
|
|
2815
|
-
(p) =>
|
|
2815
|
+
(p) => o.includes(p)
|
|
2816
2816
|
).length > 0 && c.push(h);
|
|
2817
2817
|
return c;
|
|
2818
2818
|
}
|
|
2819
2819
|
async getRightsForResource(e, t) {
|
|
2820
|
-
const s = await this.directory.getBookMarks(), r = `/${e}/share/json/${t}?search=`, i = await this.cache.httpGetJson(r),
|
|
2820
|
+
const s = await this.directory.getBookMarks(), r = `/${e}/share/json/${t}?search=`, i = await this.cache.httpGetJson(r), o = await this.getShareMapping(e), a = await this.cache.httpGetJson(
|
|
2821
2821
|
"/infra/public/json/sharing-rights.json"
|
|
2822
2822
|
), c = Object.keys(i.users.checked).map((d) => i.users.visibles.find(
|
|
2823
2823
|
(A) => A.id === d
|
|
@@ -2825,7 +2825,7 @@ class ShareService {
|
|
|
2825
2825
|
const g = this.getActionsAvailableFor(
|
|
2826
2826
|
{ id: d.id, type: "user" },
|
|
2827
2827
|
i,
|
|
2828
|
-
|
|
2828
|
+
o
|
|
2829
2829
|
);
|
|
2830
2830
|
return {
|
|
2831
2831
|
id: d.id,
|
|
@@ -2849,7 +2849,7 @@ class ShareService {
|
|
|
2849
2849
|
const g = this.getActionsAvailableFor(
|
|
2850
2850
|
{ id: d.id, type: "group" },
|
|
2851
2851
|
i,
|
|
2852
|
-
|
|
2852
|
+
o
|
|
2853
2853
|
);
|
|
2854
2854
|
return {
|
|
2855
2855
|
id: d.id,
|
|
@@ -2899,25 +2899,25 @@ class ShareService {
|
|
|
2899
2899
|
const h = c.actions.map((E) => r[E.id]).reduce((E, p) => Array.isArray(p) ? [...E, ...p] : E, []), l = [...new Set(h)];
|
|
2900
2900
|
l.length > 0 && (c.type === "user" ? i.users[c.id] = l : c.type === "group" ? i.groups[c.id] = l : i.bookmarks[c.id] = l);
|
|
2901
2901
|
}
|
|
2902
|
-
const
|
|
2903
|
-
return this.cache.clearCache(`/${e}/share/json/${t}?search=`), await this.http.putJson(
|
|
2902
|
+
const o = `/${e}/share/resource/${t}`;
|
|
2903
|
+
return this.cache.clearCache(`/${e}/share/json/${t}?search=`), await this.http.putJson(o, i);
|
|
2904
2904
|
}
|
|
2905
2905
|
async getActionsForApp(e) {
|
|
2906
2906
|
const t = await this.cache.httpGetJson(
|
|
2907
2907
|
"/infra/public/json/sharing-rights.json"
|
|
2908
2908
|
), s = await this.getShareMapping(e);
|
|
2909
2909
|
return Object.keys(t).map((i) => {
|
|
2910
|
-
const
|
|
2910
|
+
const o = t[i];
|
|
2911
2911
|
return {
|
|
2912
2912
|
displayName: i,
|
|
2913
2913
|
id: i,
|
|
2914
|
-
priority:
|
|
2915
|
-
requires:
|
|
2914
|
+
priority: o.priority,
|
|
2915
|
+
requires: o.requires
|
|
2916
2916
|
};
|
|
2917
2917
|
}).filter((i) => {
|
|
2918
|
-
var
|
|
2919
|
-
return ((
|
|
2920
|
-
}).sort((i,
|
|
2918
|
+
var o;
|
|
2919
|
+
return ((o = s[i.id]) == null ? void 0 : o.length) > 0;
|
|
2920
|
+
}).sort((i, o) => i.priority - o.priority);
|
|
2921
2921
|
}
|
|
2922
2922
|
}
|
|
2923
2923
|
const defaultMappers = {
|
|
@@ -2970,15 +2970,15 @@ const defaultMappers = {
|
|
|
2970
2970
|
this.roleMappers || console.warn("[DocumentHelper.role] should not have empty roles", this);
|
|
2971
2971
|
const r = { type: e, previewRole: t, extension: s };
|
|
2972
2972
|
for (const i of this.roleMappers) {
|
|
2973
|
-
const
|
|
2974
|
-
if (
|
|
2975
|
-
return
|
|
2973
|
+
const o = i(r);
|
|
2974
|
+
if (o)
|
|
2975
|
+
return o;
|
|
2976
2976
|
}
|
|
2977
2977
|
return "unknown";
|
|
2978
2978
|
}
|
|
2979
2979
|
};
|
|
2980
2980
|
// FIXME add edumedia support
|
|
2981
|
-
|
|
2981
|
+
n(R, "roleMappers", [
|
|
2982
2982
|
(e) => Object.keys(defaultMappers).find((s) => defaultMappers[s](e))
|
|
2983
2983
|
]);
|
|
2984
2984
|
let DocumentHelper = R;
|
|
@@ -2990,22 +2990,22 @@ class WorkspaceService {
|
|
|
2990
2990
|
return this.context.http();
|
|
2991
2991
|
}
|
|
2992
2992
|
extractMetadata(e) {
|
|
2993
|
-
const t = e.name || "", s = t.split("."), r = e.type || "application/octet-stream", i = s.length > 1 ? s[s.length - 1] : "",
|
|
2993
|
+
const t = e.name || "", s = t.split("."), r = e.type || "application/octet-stream", i = s.length > 1 ? s[s.length - 1] : "", o = {
|
|
2994
2994
|
"content-type": r,
|
|
2995
2995
|
filename: t,
|
|
2996
2996
|
size: e.size,
|
|
2997
2997
|
extension: i,
|
|
2998
2998
|
role: DocumentHelper.role(r, !1, i)
|
|
2999
|
-
}, a = t.replace("." +
|
|
3000
|
-
return { basename: a, fullname: c, metadata:
|
|
2999
|
+
}, a = t.replace("." + o.extension, ""), c = o.extension ? a + "." + o.extension : a;
|
|
3000
|
+
return { basename: a, fullname: c, metadata: o };
|
|
3001
3001
|
}
|
|
3002
3002
|
async saveFile(e, t) {
|
|
3003
3003
|
const { fullname: s, metadata: r } = this.extractMetadata(e), i = new FormData();
|
|
3004
3004
|
i.append("file", e, s);
|
|
3005
|
-
const
|
|
3006
|
-
((t == null ? void 0 : t.visibility) === "public" || (t == null ? void 0 : t.visibility) === "protected") &&
|
|
3005
|
+
const o = [];
|
|
3006
|
+
((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}`);
|
|
3007
3007
|
const a = await this.http.postFile(
|
|
3008
|
-
`/workspace/document?${
|
|
3008
|
+
`/workspace/document?${o.join("&")}`,
|
|
3009
3009
|
i
|
|
3010
3010
|
);
|
|
3011
3011
|
if (this.http.isResponseError())
|
|
@@ -3013,13 +3013,13 @@ class WorkspaceService {
|
|
|
3013
3013
|
return a;
|
|
3014
3014
|
}
|
|
3015
3015
|
async updateFile(e, t, s) {
|
|
3016
|
-
const { fullname: r, metadata: i } = this.extractMetadata(t),
|
|
3017
|
-
|
|
3016
|
+
const { fullname: r, metadata: i } = this.extractMetadata(t), o = new FormData();
|
|
3017
|
+
o.append("file", t, r);
|
|
3018
3018
|
const a = [];
|
|
3019
3019
|
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}`);
|
|
3020
3020
|
const c = await this.http.putFile(
|
|
3021
3021
|
`/workspace/document/${e}?${a.join("&")}`,
|
|
3022
|
-
|
|
3022
|
+
o
|
|
3023
3023
|
);
|
|
3024
3024
|
if (this.http.isResponseError())
|
|
3025
3025
|
throw this.http.latestResponse.statusText;
|
|
@@ -3064,17 +3064,17 @@ class WorkspaceService {
|
|
|
3064
3064
|
{
|
|
3065
3065
|
application: t,
|
|
3066
3066
|
visibility: s,
|
|
3067
|
-
ids: r.map((
|
|
3067
|
+
ids: r.map((o) => o._id)
|
|
3068
3068
|
}
|
|
3069
3069
|
);
|
|
3070
3070
|
if (this.http.isResponseError())
|
|
3071
3071
|
throw this.http.latestResponse.statusText;
|
|
3072
|
-
return r.forEach((
|
|
3072
|
+
return r.forEach((o, a) => {
|
|
3073
3073
|
const c = e.findIndex(
|
|
3074
|
-
(h) => h._id ===
|
|
3074
|
+
(h) => h._id === o._id
|
|
3075
3075
|
);
|
|
3076
3076
|
0 <= c && c < e.length && (e[c] = i[a]);
|
|
3077
|
-
}), e.filter((
|
|
3077
|
+
}), e.filter((o) => !!o);
|
|
3078
3078
|
}
|
|
3079
3079
|
return e;
|
|
3080
3080
|
}
|
|
@@ -3083,19 +3083,29 @@ class WorkspaceService {
|
|
|
3083
3083
|
* or `null` if none exists or can be created.
|
|
3084
3084
|
*/
|
|
3085
3085
|
getThumbnailUrl(e, t = 0, s = 0) {
|
|
3086
|
-
var i,
|
|
3086
|
+
var i, o;
|
|
3087
3087
|
const r = t > 0 || s > 0 ? `${t}x${s}` : "120x120";
|
|
3088
3088
|
if (typeof e == "string")
|
|
3089
3089
|
return e.includes("data:image") || e.includes("thumbnail") ? e : `${e}${e.includes("?") ? "&" : "?"}thumbnail=${r}`;
|
|
3090
3090
|
{
|
|
3091
3091
|
const a = `/workspace/${e.public ? "pub/" : ""}document/${e._id}?thumbnail=`, c = e.thumbnails;
|
|
3092
|
-
if ((
|
|
3092
|
+
if ((o = (i = e.metadata) == null ? void 0 : i["content-type"]) != null && o.includes("video")) {
|
|
3093
3093
|
const h = c && Object.keys(c).length > 0 ? Object.keys(c)[0] : null;
|
|
3094
3094
|
return h ? a + h : null;
|
|
3095
3095
|
} else
|
|
3096
3096
|
return a + r;
|
|
3097
3097
|
}
|
|
3098
3098
|
}
|
|
3099
|
+
async listFolder(e, t = !1, s) {
|
|
3100
|
+
const r = {
|
|
3101
|
+
filter: e,
|
|
3102
|
+
hierarchical: t,
|
|
3103
|
+
parentId: s
|
|
3104
|
+
};
|
|
3105
|
+
return await this.http.get("/workspace/folders/list", {
|
|
3106
|
+
queryParams: r
|
|
3107
|
+
});
|
|
3108
|
+
}
|
|
3099
3109
|
}
|
|
3100
3110
|
let ATTag;
|
|
3101
3111
|
class AnalyticsService {
|
|
@@ -3185,8 +3195,8 @@ class AnalyticsService {
|
|
|
3185
3195
|
if (!r || !r.active) return;
|
|
3186
3196
|
const i = await configure.Platform.apps.getPublicConf(e);
|
|
3187
3197
|
if (!i) return;
|
|
3188
|
-
const
|
|
3189
|
-
if (!
|
|
3198
|
+
const o = i.xiti;
|
|
3199
|
+
if (!o || !o.LIBELLE_SERVICE || !r.UAI) return;
|
|
3190
3200
|
function a(h) {
|
|
3191
3201
|
let l = "";
|
|
3192
3202
|
for (let E = 0; E < h.length; E++)
|
|
@@ -3201,10 +3211,10 @@ class AnalyticsService {
|
|
|
3201
3211
|
Guest: "AUTRE"
|
|
3202
3212
|
};
|
|
3203
3213
|
return {
|
|
3204
|
-
LIBELLE_SERVICE:
|
|
3214
|
+
LIBELLE_SERVICE: o.LIBELLE_SERVICE,
|
|
3205
3215
|
// Which property of LIBELLE_SERVICE to use depends on the frontend.
|
|
3206
|
-
TYPE:
|
|
3207
|
-
OUTIL:
|
|
3216
|
+
TYPE: o.OUTIL ? "TIERS" : "NATIF",
|
|
3217
|
+
OUTIL: o.OUTIL ? o.OUTIL : "",
|
|
3208
3218
|
STRUCT_ID: r.collectiviteId,
|
|
3209
3219
|
STRUCT_UAI: r.UAI,
|
|
3210
3220
|
PROJET: r.projetId ? r.projetId : u.ID_PROJET,
|
|
@@ -3258,13 +3268,13 @@ const w = class w {
|
|
|
3258
3268
|
throw new Error("Invalid video file.");
|
|
3259
3269
|
if (!e.filename)
|
|
3260
3270
|
throw new Error("Invalid video filename");
|
|
3261
|
-
const i = `${e.browser.name} ${e.browser.version}`,
|
|
3262
|
-
|
|
3271
|
+
const i = `${e.browser.name} ${e.browser.version}`, o = new FormData();
|
|
3272
|
+
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);
|
|
3263
3273
|
let a = `/video/encode?captation=${s}`;
|
|
3264
3274
|
r && (a += `&duration=${r}`);
|
|
3265
3275
|
const c = await this.http.post(
|
|
3266
3276
|
a,
|
|
3267
|
-
|
|
3277
|
+
o,
|
|
3268
3278
|
{ headers: { "Content-Type": "multipart/form-data" } }
|
|
3269
3279
|
);
|
|
3270
3280
|
if (c.state == "running") {
|
|
@@ -3294,8 +3304,8 @@ const w = class w {
|
|
|
3294
3304
|
throw new Error("Video cannot be uploaded.");
|
|
3295
3305
|
}
|
|
3296
3306
|
};
|
|
3297
|
-
|
|
3298
|
-
|
|
3307
|
+
n(w, "MAX_WEIGHT", 50), // in Mbytes. Applies to uploaded videos.
|
|
3308
|
+
n(w, "MAX_DURATION", 3);
|
|
3299
3309
|
let VideoService = w;
|
|
3300
3310
|
class EmbedderService {
|
|
3301
3311
|
constructor(e) {
|
|
@@ -3332,9 +3342,9 @@ class EmbedderService {
|
|
|
3332
3342
|
urlIsFromPattern(e, t) {
|
|
3333
3343
|
const s = new RegExp("[^{}]+(?=(?:[^{}]*{[^}]*})*[^}]*$)", "g"), r = new RegExp("{[^}]*}", "g");
|
|
3334
3344
|
let i = !0;
|
|
3335
|
-
const
|
|
3345
|
+
const o = t.match(s) || [], a = [];
|
|
3336
3346
|
return (t.match(r) || []).forEach((h, l) => {
|
|
3337
|
-
h.includes("ignore") || a.push(
|
|
3347
|
+
h.includes("ignore") || a.push(o[l]);
|
|
3338
3348
|
}), a.forEach((h) => {
|
|
3339
3349
|
if (!e.includes(h)) {
|
|
3340
3350
|
i = !1;
|
|
@@ -3365,7 +3375,7 @@ class EmbedderService {
|
|
|
3365
3375
|
for (const s of e.url)
|
|
3366
3376
|
if (this.urlIsFromPattern(t, s)) {
|
|
3367
3377
|
const r = new RegExp("{[a-zA-Z0-9_.]+}", "g"), i = s.match(r) || [];
|
|
3368
|
-
let
|
|
3378
|
+
let o = e.embed;
|
|
3369
3379
|
for (const a of i) {
|
|
3370
3380
|
let c = s.split(a)[0];
|
|
3371
3381
|
const h = c.split("}");
|
|
@@ -3376,9 +3386,9 @@ class EmbedderService {
|
|
|
3376
3386
|
const E = s.split(a)[1].split("{")[0];
|
|
3377
3387
|
E && (l = l.split(E)[0]);
|
|
3378
3388
|
const p = new RegExp("\\" + a.replace(/}/, "\\}"), "g");
|
|
3379
|
-
|
|
3389
|
+
o = o.replace(p, l);
|
|
3380
3390
|
}
|
|
3381
|
-
return
|
|
3391
|
+
return o;
|
|
3382
3392
|
}
|
|
3383
3393
|
return "";
|
|
3384
3394
|
}
|
|
@@ -3391,7 +3401,7 @@ class AbstractBehaviourService {
|
|
|
3391
3401
|
//-----------------
|
|
3392
3402
|
//--- Utilities ---
|
|
3393
3403
|
//-----------------
|
|
3394
|
-
|
|
3404
|
+
n(this, "_cache");
|
|
3395
3405
|
this.context = e, this._cache = new CacheService(this.context);
|
|
3396
3406
|
}
|
|
3397
3407
|
getApplication() {
|
|
@@ -3425,8 +3435,8 @@ class AbstractBehaviourService {
|
|
|
3425
3435
|
class ActualitesBehaviour extends AbstractBehaviourService {
|
|
3426
3436
|
constructor() {
|
|
3427
3437
|
super(...arguments);
|
|
3428
|
-
|
|
3429
|
-
|
|
3438
|
+
n(this, "APP", "actualites");
|
|
3439
|
+
n(this, "RESOURCE", "actualites");
|
|
3430
3440
|
}
|
|
3431
3441
|
async loadResources() {
|
|
3432
3442
|
return (await this.httpGet(
|
|
@@ -3449,24 +3459,24 @@ class ActualitesBehaviour extends AbstractBehaviourService {
|
|
|
3449
3459
|
class BlogBehaviour extends AbstractBehaviourService {
|
|
3450
3460
|
constructor() {
|
|
3451
3461
|
super(...arguments);
|
|
3452
|
-
|
|
3453
|
-
|
|
3462
|
+
n(this, "APP", "blog");
|
|
3463
|
+
n(this, "RESOURCE", "blog");
|
|
3454
3464
|
}
|
|
3455
3465
|
loadResources() {
|
|
3456
3466
|
return new Promise(async (t, s) => {
|
|
3457
3467
|
try {
|
|
3458
3468
|
const r = await this.httpGet("/blog/linker"), i = [];
|
|
3459
|
-
r.forEach((
|
|
3460
|
-
|
|
3461
|
-
const a =
|
|
3462
|
-
owner:
|
|
3463
|
-
ownerName:
|
|
3464
|
-
title: c.title + " [" +
|
|
3465
|
-
_id: `${
|
|
3466
|
-
icon:
|
|
3467
|
-
path: `/blog/id/${
|
|
3468
|
-
shared: !!(
|
|
3469
|
-
modified:
|
|
3469
|
+
r.forEach((o) => {
|
|
3470
|
+
o.thumbnail ? o.thumbnail = o.thumbnail + "?thumbnail=48x48" : o.thumbnail = "/img/illustrations/blog.svg";
|
|
3471
|
+
const a = o.fetchPosts.map((c) => this.dataToResource({
|
|
3472
|
+
owner: o.author.userId,
|
|
3473
|
+
ownerName: o.author.username,
|
|
3474
|
+
title: c.title + " [" + o.title + "]",
|
|
3475
|
+
_id: `${o._id}#${c._id}`,
|
|
3476
|
+
icon: o.thumbnail,
|
|
3477
|
+
path: `/blog/id/${o._id}/post/${c._id}`,
|
|
3478
|
+
shared: !!(o.shared && o.shared.length >= 0),
|
|
3479
|
+
modified: o.modified
|
|
3470
3480
|
}));
|
|
3471
3481
|
i.push(...a);
|
|
3472
3482
|
}), t(i);
|
|
@@ -3479,8 +3489,8 @@ class BlogBehaviour extends AbstractBehaviourService {
|
|
|
3479
3489
|
class CollaborativewallBehaviour extends AbstractBehaviourService {
|
|
3480
3490
|
constructor() {
|
|
3481
3491
|
super(...arguments);
|
|
3482
|
-
|
|
3483
|
-
|
|
3492
|
+
n(this, "APP", "collaborativewall");
|
|
3493
|
+
n(this, "RESOURCE", "collaborativewall");
|
|
3484
3494
|
}
|
|
3485
3495
|
async loadResources() {
|
|
3486
3496
|
return (await this.httpGet(
|
|
@@ -3502,8 +3512,8 @@ class CollaborativewallBehaviour extends AbstractBehaviourService {
|
|
|
3502
3512
|
class CommunityBehaviour extends AbstractBehaviourService {
|
|
3503
3513
|
constructor() {
|
|
3504
3514
|
super(...arguments);
|
|
3505
|
-
|
|
3506
|
-
|
|
3515
|
+
n(this, "APP", "community");
|
|
3516
|
+
n(this, "RESOURCE", "community");
|
|
3507
3517
|
}
|
|
3508
3518
|
async loadResources() {
|
|
3509
3519
|
return (await this.httpGet(
|
|
@@ -3527,24 +3537,24 @@ class CommunityBehaviour extends AbstractBehaviourService {
|
|
|
3527
3537
|
class ExercizerBehaviour extends AbstractBehaviourService {
|
|
3528
3538
|
constructor() {
|
|
3529
3539
|
super(...arguments);
|
|
3530
|
-
|
|
3531
|
-
|
|
3540
|
+
n(this, "APP", "exercizer");
|
|
3541
|
+
n(this, "RESOURCE", "exercizer");
|
|
3532
3542
|
}
|
|
3533
3543
|
async loadResources() {
|
|
3534
3544
|
return (await this.httpGet(
|
|
3535
3545
|
"/exercizer/subjects-scheduled"
|
|
3536
3546
|
)).map((s) => {
|
|
3537
3547
|
const r = s.picture ? s.picture + "?thumbnail=48x48" : "/img/illustrations/exercizer.svg";
|
|
3538
|
-
let i,
|
|
3548
|
+
let i, o = !1;
|
|
3539
3549
|
const a = JSON.parse(s.scheduled_at);
|
|
3540
|
-
return a.groupList.length > 0 ? (
|
|
3550
|
+
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({
|
|
3541
3551
|
title: s.title,
|
|
3542
3552
|
owner: s.owner,
|
|
3543
3553
|
ownerName: i,
|
|
3544
3554
|
icon: r,
|
|
3545
3555
|
path: "/exercizer#/linker/" + s.id,
|
|
3546
3556
|
_id: "" + s.id,
|
|
3547
|
-
shared:
|
|
3557
|
+
shared: o,
|
|
3548
3558
|
modified: s.modified
|
|
3549
3559
|
});
|
|
3550
3560
|
});
|
|
@@ -3553,8 +3563,8 @@ class ExercizerBehaviour extends AbstractBehaviourService {
|
|
|
3553
3563
|
class FormulaireBehaviour extends AbstractBehaviourService {
|
|
3554
3564
|
constructor() {
|
|
3555
3565
|
super(...arguments);
|
|
3556
|
-
|
|
3557
|
-
|
|
3566
|
+
n(this, "APP", "formulaire");
|
|
3567
|
+
n(this, "RESOURCE", "formulaire");
|
|
3558
3568
|
}
|
|
3559
3569
|
async loadResources() {
|
|
3560
3570
|
return (await this.httpGet(
|
|
@@ -3574,8 +3584,8 @@ class FormulaireBehaviour extends AbstractBehaviourService {
|
|
|
3574
3584
|
class ForumBehaviour extends AbstractBehaviourService {
|
|
3575
3585
|
constructor() {
|
|
3576
3586
|
super(...arguments);
|
|
3577
|
-
|
|
3578
|
-
|
|
3587
|
+
n(this, "APP", "forum");
|
|
3588
|
+
n(this, "RESOURCE", "forum");
|
|
3579
3589
|
}
|
|
3580
3590
|
async loadResources() {
|
|
3581
3591
|
return (await this.httpGet("/forum/categories")).map(
|
|
@@ -3595,8 +3605,8 @@ class ForumBehaviour extends AbstractBehaviourService {
|
|
|
3595
3605
|
class HomeworksBehaviour extends AbstractBehaviourService {
|
|
3596
3606
|
constructor() {
|
|
3597
3607
|
super(...arguments);
|
|
3598
|
-
|
|
3599
|
-
|
|
3608
|
+
n(this, "APP", "homeworks");
|
|
3609
|
+
n(this, "RESOURCE", "homeworks");
|
|
3600
3610
|
}
|
|
3601
3611
|
async loadResources() {
|
|
3602
3612
|
return (await this.httpGet("/homeworks/list")).filter((t) => t.owner && t.trashed === 0).map((t) => this.dataToResource({
|
|
@@ -3614,8 +3624,8 @@ class HomeworksBehaviour extends AbstractBehaviourService {
|
|
|
3614
3624
|
class MagnetoBehaviour extends AbstractBehaviourService {
|
|
3615
3625
|
constructor() {
|
|
3616
3626
|
super(...arguments);
|
|
3617
|
-
|
|
3618
|
-
|
|
3627
|
+
n(this, "APP", "magneto");
|
|
3628
|
+
n(this, "RESOURCE", "magneto");
|
|
3619
3629
|
}
|
|
3620
3630
|
async loadResources() {
|
|
3621
3631
|
const { all: t } = await this.httpGet(
|
|
@@ -3636,8 +3646,8 @@ class MagnetoBehaviour extends AbstractBehaviourService {
|
|
|
3636
3646
|
class MindmapBehaviour extends AbstractBehaviourService {
|
|
3637
3647
|
constructor() {
|
|
3638
3648
|
super(...arguments);
|
|
3639
|
-
|
|
3640
|
-
|
|
3649
|
+
n(this, "APP", "mindmap");
|
|
3650
|
+
n(this, "RESOURCE", "mindmap");
|
|
3641
3651
|
}
|
|
3642
3652
|
async loadResources() {
|
|
3643
3653
|
return (await this.httpGet("/mindmap/list/all")).map(
|
|
@@ -3657,13 +3667,13 @@ class MindmapBehaviour extends AbstractBehaviourService {
|
|
|
3657
3667
|
class PagesBehaviour extends AbstractBehaviourService {
|
|
3658
3668
|
constructor() {
|
|
3659
3669
|
super(...arguments);
|
|
3660
|
-
|
|
3661
|
-
|
|
3670
|
+
n(this, "APP", "pages");
|
|
3671
|
+
n(this, "RESOURCE", "pages");
|
|
3662
3672
|
}
|
|
3663
3673
|
async loadResources() {
|
|
3664
3674
|
const t = await this.httpGet("/pages/list/all"), s = [];
|
|
3665
3675
|
return t.forEach((r) => {
|
|
3666
|
-
var
|
|
3676
|
+
var o;
|
|
3667
3677
|
const i = r.thumbnail ? r.thumbnail + "?thumbnail=48x48" : "/img/illustrations/pages.svg";
|
|
3668
3678
|
s.push(
|
|
3669
3679
|
this.dataToResource({
|
|
@@ -3676,7 +3686,7 @@ class PagesBehaviour extends AbstractBehaviourService {
|
|
|
3676
3686
|
shared: typeof r.shared < "u",
|
|
3677
3687
|
modified: r.modified
|
|
3678
3688
|
})
|
|
3679
|
-
), (
|
|
3689
|
+
), (o = r.pages) == null || o.forEach((a) => {
|
|
3680
3690
|
s.push(
|
|
3681
3691
|
this.dataToResource({
|
|
3682
3692
|
title: a.title,
|
|
@@ -3696,8 +3706,8 @@ class PagesBehaviour extends AbstractBehaviourService {
|
|
|
3696
3706
|
class PollBehaviour extends AbstractBehaviourService {
|
|
3697
3707
|
constructor() {
|
|
3698
3708
|
super(...arguments);
|
|
3699
|
-
|
|
3700
|
-
|
|
3709
|
+
n(this, "APP", "poll");
|
|
3710
|
+
n(this, "RESOURCE", "poll");
|
|
3701
3711
|
}
|
|
3702
3712
|
async loadResources() {
|
|
3703
3713
|
return (await this.httpGet("/poll/list/all")).map((s) => {
|
|
@@ -3718,8 +3728,8 @@ class PollBehaviour extends AbstractBehaviourService {
|
|
|
3718
3728
|
class ScrapbookBehaviour extends AbstractBehaviourService {
|
|
3719
3729
|
constructor() {
|
|
3720
3730
|
super(...arguments);
|
|
3721
|
-
|
|
3722
|
-
|
|
3731
|
+
n(this, "APP", "scrapbook");
|
|
3732
|
+
n(this, "RESOURCE", "scrapbook");
|
|
3723
3733
|
}
|
|
3724
3734
|
async loadResources() {
|
|
3725
3735
|
return (await this.httpGet(
|
|
@@ -3742,25 +3752,25 @@ class ScrapbookBehaviour extends AbstractBehaviourService {
|
|
|
3742
3752
|
class TimelinegeneratorBehaviour extends AbstractBehaviourService {
|
|
3743
3753
|
constructor() {
|
|
3744
3754
|
super(...arguments);
|
|
3745
|
-
|
|
3746
|
-
|
|
3755
|
+
n(this, "APP", "timelinegenerator");
|
|
3756
|
+
n(this, "RESOURCE", "timelinegenerator");
|
|
3747
3757
|
}
|
|
3748
3758
|
loadResources() {
|
|
3749
3759
|
return new Promise(async (t, s) => {
|
|
3750
3760
|
try {
|
|
3751
3761
|
const i = (await this.httpGet(
|
|
3752
3762
|
"/timelinegenerator/timelines"
|
|
3753
|
-
)).map((
|
|
3754
|
-
const a =
|
|
3763
|
+
)).map((o) => {
|
|
3764
|
+
const a = o.icon || "/img/illustrations/timeline-default.png";
|
|
3755
3765
|
return this.dataToResource({
|
|
3756
|
-
title:
|
|
3757
|
-
ownerName:
|
|
3758
|
-
owner:
|
|
3766
|
+
title: o.headline,
|
|
3767
|
+
ownerName: o.owner.displayName,
|
|
3768
|
+
owner: o.owner.userId,
|
|
3759
3769
|
icon: a,
|
|
3760
|
-
path: "/timelinegenerator#/view/" +
|
|
3761
|
-
_id:
|
|
3762
|
-
shared: typeof
|
|
3763
|
-
modified:
|
|
3770
|
+
path: "/timelinegenerator#/view/" + o._id,
|
|
3771
|
+
_id: o._id,
|
|
3772
|
+
shared: typeof o.shared < "u",
|
|
3773
|
+
modified: o.modified
|
|
3764
3774
|
});
|
|
3765
3775
|
});
|
|
3766
3776
|
t(i);
|
|
@@ -3773,8 +3783,8 @@ class TimelinegeneratorBehaviour extends AbstractBehaviourService {
|
|
|
3773
3783
|
class WikiBehaviour extends AbstractBehaviourService {
|
|
3774
3784
|
constructor() {
|
|
3775
3785
|
super(...arguments);
|
|
3776
|
-
|
|
3777
|
-
|
|
3786
|
+
n(this, "APP", "wiki");
|
|
3787
|
+
n(this, "RESOURCE", "wiki");
|
|
3778
3788
|
}
|
|
3779
3789
|
async loadResources() {
|
|
3780
3790
|
return (await this.httpGet(
|
|
@@ -3797,15 +3807,15 @@ class WikiBehaviour extends AbstractBehaviourService {
|
|
|
3797
3807
|
class WorkspaceBehaviour extends AbstractBehaviourService {
|
|
3798
3808
|
constructor() {
|
|
3799
3809
|
super(...arguments);
|
|
3800
|
-
|
|
3801
|
-
|
|
3810
|
+
n(this, "APP", "workspace");
|
|
3811
|
+
n(this, "RESOURCE", "workspace");
|
|
3802
3812
|
}
|
|
3803
3813
|
loadResources({ search: t, asset_id: s }) {
|
|
3804
3814
|
return new Promise(async (r, i) => {
|
|
3805
3815
|
try {
|
|
3806
|
-
let
|
|
3807
|
-
s && s.length ?
|
|
3808
|
-
const c = (await this.httpGet(
|
|
3816
|
+
let o = "/workspace/documents?filter=all&hierarchical=true";
|
|
3817
|
+
s && s.length ? o += `&search=${t}` : t && t.length && (o += `&search=${t}`);
|
|
3818
|
+
const c = (await this.httpGet(o)).filter((h) => !h.deleted).map((h) => {
|
|
3809
3819
|
const l = h.metadata["content-type"] && h.metadata["content-type"].indexOf("image") !== -1 ? `/workspace/document/${h._id}?thumbnail=120x120` : "/img/icons/unknown-large.png";
|
|
3810
3820
|
return this.dataToResource({
|
|
3811
3821
|
title: h.name,
|
|
@@ -3819,8 +3829,8 @@ class WorkspaceBehaviour extends AbstractBehaviourService {
|
|
|
3819
3829
|
});
|
|
3820
3830
|
});
|
|
3821
3831
|
r(c);
|
|
3822
|
-
} catch (
|
|
3823
|
-
i(
|
|
3832
|
+
} catch (o) {
|
|
3833
|
+
i(o);
|
|
3824
3834
|
}
|
|
3825
3835
|
});
|
|
3826
3836
|
}
|
|
@@ -3836,7 +3846,7 @@ const y = class y {
|
|
|
3836
3846
|
e.session().getUser()
|
|
3837
3847
|
]);
|
|
3838
3848
|
i != null && i.apps && (r != null && r.length) && (this.resourceProducingApps = r.filter(
|
|
3839
|
-
(
|
|
3849
|
+
(o) => i.apps.some((a) => a.address.includes(o))
|
|
3840
3850
|
));
|
|
3841
3851
|
} catch (r) {
|
|
3842
3852
|
console.warn("Failed to load resource-producing apps:", r);
|
|
@@ -3913,13 +3923,13 @@ const y = class y {
|
|
|
3913
3923
|
//
|
|
3914
3924
|
// STATIC REGISTRY
|
|
3915
3925
|
//
|
|
3916
|
-
|
|
3917
|
-
|
|
3926
|
+
n(y, "registry", new ServiceRegistry()), // Expose some useful functions
|
|
3927
|
+
n(y, "findBehaviour", y.registry.findService.bind(y.registry)), n(y, "hasBehaviour", y.registry.isRegistered.bind(y.registry)), n(y, "resourceProducingApps", []);
|
|
3918
3928
|
let SnipletsService = y;
|
|
3919
3929
|
const SEND_ALL = "*";
|
|
3920
3930
|
class WebBroker {
|
|
3921
3931
|
constructor(e) {
|
|
3922
|
-
|
|
3932
|
+
n(this, "subscription");
|
|
3923
3933
|
this.odeServices = e;
|
|
3924
3934
|
}
|
|
3925
3935
|
get http() {
|
|
@@ -3951,10 +3961,10 @@ class WebBroker {
|
|
|
3951
3961
|
}
|
|
3952
3962
|
class DataService {
|
|
3953
3963
|
constructor(e) {
|
|
3954
|
-
|
|
3955
|
-
|
|
3956
|
-
|
|
3957
|
-
|
|
3964
|
+
n(this, "_webBroker");
|
|
3965
|
+
n(this, "app");
|
|
3966
|
+
n(this, "user");
|
|
3967
|
+
n(this, "profile");
|
|
3958
3968
|
this.odeServices = e;
|
|
3959
3969
|
}
|
|
3960
3970
|
get conf() {
|
|
@@ -3988,12 +3998,12 @@ class DataService {
|
|
|
3988
3998
|
addUserInfos(e) {
|
|
3989
3999
|
return this.user && (e.userId = this.user.userId, e.structure = this.user.structureNames[0]), this.profile && (e.profil = this.profile[0]), e;
|
|
3990
4000
|
}
|
|
3991
|
-
trackVideoSave(e, t, s, r, i,
|
|
4001
|
+
trackVideoSave(e, t, s, r, i, o, a) {
|
|
3992
4002
|
const c = this.addUserInfos({
|
|
3993
4003
|
"event-type": "VIDEO_SAVE",
|
|
3994
4004
|
module: "video",
|
|
3995
4005
|
video_id: e,
|
|
3996
|
-
browser:
|
|
4006
|
+
browser: o,
|
|
3997
4007
|
duration: Math.round(t),
|
|
3998
4008
|
weight: s,
|
|
3999
4009
|
source: r ? "CAPTURED" : "UPLOADED",
|
|
@@ -4002,7 +4012,7 @@ class DataService {
|
|
|
4002
4012
|
this.app && (c["override-module"] = this.app), a && (c.device_type = a), this.trackWebEvent(c);
|
|
4003
4013
|
}
|
|
4004
4014
|
trackVideoRead(e, t, s, r, i) {
|
|
4005
|
-
const
|
|
4015
|
+
const o = this.addUserInfos({
|
|
4006
4016
|
"event-type": "VIDEO_READ",
|
|
4007
4017
|
module: "video",
|
|
4008
4018
|
video_id: e,
|
|
@@ -4010,7 +4020,7 @@ class DataService {
|
|
|
4010
4020
|
source: t ? "CAPTURED" : "UPLOADED",
|
|
4011
4021
|
url: s
|
|
4012
4022
|
});
|
|
4013
|
-
this.app && (
|
|
4023
|
+
this.app && (o["override-module"] = this.app), i && (o.device_type = i), this.trackWebEvent(o);
|
|
4014
4024
|
}
|
|
4015
4025
|
trackSpeechAndText(e) {
|
|
4016
4026
|
const t = this.addUserInfos({
|
|
@@ -4116,20 +4126,20 @@ class AudienceService {
|
|
|
4116
4126
|
}
|
|
4117
4127
|
class OdeServices {
|
|
4118
4128
|
constructor() {
|
|
4119
|
-
|
|
4120
|
-
|
|
4121
|
-
|
|
4122
|
-
|
|
4123
|
-
|
|
4124
|
-
|
|
4125
|
-
|
|
4126
|
-
|
|
4127
|
-
|
|
4128
|
-
|
|
4129
|
-
|
|
4130
|
-
|
|
4131
|
-
|
|
4132
|
-
|
|
4129
|
+
n(this, "_analytics");
|
|
4130
|
+
n(this, "_cache");
|
|
4131
|
+
n(this, "_conf");
|
|
4132
|
+
n(this, "_data");
|
|
4133
|
+
n(this, "_directory");
|
|
4134
|
+
n(this, "_http");
|
|
4135
|
+
n(this, "_idiom");
|
|
4136
|
+
n(this, "_notify");
|
|
4137
|
+
n(this, "_rights");
|
|
4138
|
+
n(this, "_session");
|
|
4139
|
+
n(this, "_share");
|
|
4140
|
+
n(this, "_video");
|
|
4141
|
+
n(this, "_workspace");
|
|
4142
|
+
n(this, "_embedder");
|
|
4133
4143
|
this._analytics = new AnalyticsService(this), this._cache = new CacheService(this), this._conf = new ConfService(this), this._data = new DataService(this), this._directory = new DirectoryService(this), this._http = new HttpService(this), this._idiom = new IdiomService(this), this._notify = NotifyFrameworkFactory.instance(), this._rights = new RightService(this), this._session = new SessionService(this), this._share = new ShareService(this), this._video = new VideoService(this), this._workspace = new WorkspaceService(this), this._embedder = new EmbedderService(this);
|
|
4134
4144
|
}
|
|
4135
4145
|
initialize() {
|
|
@@ -4331,10 +4341,10 @@ const isActionAvailable = (u, e) => {
|
|
|
4331
4341
|
class WidgetFramework {
|
|
4332
4342
|
constructor() {
|
|
4333
4343
|
//-------------------------------------
|
|
4334
|
-
|
|
4335
|
-
|
|
4344
|
+
n(this, "_initialized");
|
|
4345
|
+
n(this, "_widgets", []);
|
|
4336
4346
|
////////////////////////////////////// USER PREFERENCES
|
|
4337
|
-
|
|
4347
|
+
n(this, "_userPrefs", {});
|
|
4338
4348
|
}
|
|
4339
4349
|
initialize(e, t) {
|
|
4340
4350
|
return this._initialized || (this._initialized = new Promisified(), notify.onSessionReady().promise.then((s) => {
|
|
@@ -4345,8 +4355,8 @@ class WidgetFramework {
|
|
|
4345
4355
|
var i;
|
|
4346
4356
|
(i = this._initialized) == null || i.resolve();
|
|
4347
4357
|
}).catch((i) => {
|
|
4348
|
-
var
|
|
4349
|
-
(
|
|
4358
|
+
var o;
|
|
4359
|
+
(o = this._initialized) == null || o.reject();
|
|
4350
4360
|
})) : (r = this._initialized) == null || r.reject();
|
|
4351
4361
|
})), this._initialized.promise;
|
|
4352
4362
|
}
|
|
@@ -4387,9 +4397,9 @@ class WidgetFramework {
|
|
|
4387
4397
|
position: c.platformConf.position
|
|
4388
4398
|
}), c.platformConf.mandatory && (this._userPrefs[l].show = !0, this._userPrefs[l].index = defaultWidgetOrder[l] ?? 999), c.platformConf.i18n && s.push(c.platformConf.i18n), c.applyUserPref(this._userPrefs[l]), !0);
|
|
4389
4399
|
});
|
|
4390
|
-
const
|
|
4400
|
+
const o = new Idiom();
|
|
4391
4401
|
this._widgets = this._widgets.sort((c, h) => {
|
|
4392
|
-
const l =
|
|
4402
|
+
const l = o.translate(`timeline.settings.${c.platformConf.name}`).toLowerCase(), E = o.translate(`timeline.settings.${h.platformConf.name}`).toLowerCase();
|
|
4393
4403
|
return l < E ? -1 : l > E ? 1 : 0;
|
|
4394
4404
|
});
|
|
4395
4405
|
});
|
|
@@ -4398,8 +4408,8 @@ class WidgetFramework {
|
|
|
4398
4408
|
class Widget {
|
|
4399
4409
|
//-------------------------------------
|
|
4400
4410
|
constructor(e) {
|
|
4401
|
-
|
|
4402
|
-
|
|
4411
|
+
n(this, "_schoolConf", {});
|
|
4412
|
+
n(this, "_userPref");
|
|
4403
4413
|
this._platformConf = e, this._userPref = null;
|
|
4404
4414
|
}
|
|
4405
4415
|
get platformConf() {
|