@edifice.io/client 2.5.4-develop-b2school-actualites.20251212113049 → 2.5.4-develop-pedago.20251212164024
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 +212 -226
- package/dist/rights/Service.d.ts +1 -1
- package/dist/share/Service.d.ts +6 -7
- package/dist/share/interface.d.ts +9 -119
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -97,7 +97,7 @@ const ERROR_CODE = {
|
|
|
97
97
|
INFOTIP: "infotip",
|
|
98
98
|
RGPD_COOKIES: "rgpdCookies"
|
|
99
99
|
// TODO compléter
|
|
100
|
-
},
|
|
100
|
+
}, b = class b {
|
|
101
101
|
constructor(e) {
|
|
102
102
|
n(this, "name");
|
|
103
103
|
n(this, "listeners", /* @__PURE__ */ new Set());
|
|
@@ -109,8 +109,8 @@ const ERROR_CODE = {
|
|
|
109
109
|
* @returns the channel instance
|
|
110
110
|
*/
|
|
111
111
|
static getChannel(e) {
|
|
112
|
-
let t =
|
|
113
|
-
return t || (t = new
|
|
112
|
+
let t = b.channels.get(e);
|
|
113
|
+
return t || (t = new b(e), b.channels.set(e, t)), t;
|
|
114
114
|
}
|
|
115
115
|
/**
|
|
116
116
|
* Add a listener and return a revocation function to remove it.
|
|
@@ -135,11 +135,11 @@ const ERROR_CODE = {
|
|
|
135
135
|
* Close this channel: remove listeners and unregister from global map.
|
|
136
136
|
*/
|
|
137
137
|
close() {
|
|
138
|
-
this.listeners.clear(),
|
|
138
|
+
this.listeners.clear(), b.channels.delete(this.name);
|
|
139
139
|
}
|
|
140
140
|
};
|
|
141
|
-
n(
|
|
142
|
-
let SimpleChannel =
|
|
141
|
+
n(b, "channels", /* @__PURE__ */ new Map());
|
|
142
|
+
let SimpleChannel = b;
|
|
143
143
|
class Subscription {
|
|
144
144
|
constructor(e, t) {
|
|
145
145
|
n(this, "revoke");
|
|
@@ -970,10 +970,10 @@ class User {
|
|
|
970
970
|
let r = !0;
|
|
971
971
|
const i = [];
|
|
972
972
|
s.bookmarks.forEach((o, a) => {
|
|
973
|
-
const c = this._me.apps.find((
|
|
973
|
+
const c = this._me.apps.find((h) => h.name === o);
|
|
974
974
|
if (c) {
|
|
975
|
-
const
|
|
976
|
-
this._bookmarkedApps.push(
|
|
975
|
+
const h = Object.assign({}, c);
|
|
976
|
+
this._bookmarkedApps.push(h);
|
|
977
977
|
} else
|
|
978
978
|
i.push(o), r = !1;
|
|
979
979
|
}), i.forEach((o) => {
|
|
@@ -1080,10 +1080,10 @@ class Analytics {
|
|
|
1080
1080
|
if (!e.structureMap || !configure.Platform.apps.currentApp) return;
|
|
1081
1081
|
const t = await notify.onSessionReady().promise, s = session.session.description;
|
|
1082
1082
|
let r;
|
|
1083
|
-
for (const
|
|
1084
|
-
const
|
|
1085
|
-
if (
|
|
1086
|
-
r =
|
|
1083
|
+
for (const h of t.structures) {
|
|
1084
|
+
const l = e.structureMap[h];
|
|
1085
|
+
if (l && l.collectiviteId && l.UAI) {
|
|
1086
|
+
r = l;
|
|
1087
1087
|
break;
|
|
1088
1088
|
}
|
|
1089
1089
|
}
|
|
@@ -1094,11 +1094,11 @@ class Analytics {
|
|
|
1094
1094
|
if (!i) return;
|
|
1095
1095
|
const o = i.xiti;
|
|
1096
1096
|
if (!o || !o.LIBELLE_SERVICE || !r.UAI) return;
|
|
1097
|
-
function a(
|
|
1098
|
-
let
|
|
1099
|
-
for (let
|
|
1100
|
-
|
|
1101
|
-
return
|
|
1097
|
+
function a(h) {
|
|
1098
|
+
let l = "";
|
|
1099
|
+
for (let E = 0; E < h.length; E++)
|
|
1100
|
+
l += h.charCodeAt(E);
|
|
1101
|
+
return l;
|
|
1102
1102
|
}
|
|
1103
1103
|
const c = {
|
|
1104
1104
|
Student: "ELEVE",
|
|
@@ -1141,7 +1141,7 @@ class ConfigurationFramework {
|
|
|
1141
1141
|
}
|
|
1142
1142
|
async initialize(e, t) {
|
|
1143
1143
|
if (!e) {
|
|
1144
|
-
const r = (
|
|
1144
|
+
const r = (h) => (h < 10 ? "0" : "") + h.toFixed(0), i = /* @__PURE__ */ new Date(), o = i.getFullYear(), a = i.getMonth() + 1, c = i.getDate();
|
|
1145
1145
|
e = `${o}${r(a)}${r(c)}`;
|
|
1146
1146
|
}
|
|
1147
1147
|
const s = e;
|
|
@@ -1180,8 +1180,8 @@ class ConfigurationFramework {
|
|
|
1180
1180
|
// }
|
|
1181
1181
|
}
|
|
1182
1182
|
const configure = new ConfigurationFramework(), http = transport == null ? void 0 : transport.http;
|
|
1183
|
-
var
|
|
1184
|
-
const me = (
|
|
1183
|
+
var D;
|
|
1184
|
+
const me = (D = session == null ? void 0 : session.session) == null ? void 0 : D.user;
|
|
1185
1185
|
class Notification {
|
|
1186
1186
|
constructor(e) {
|
|
1187
1187
|
n(this, "_id");
|
|
@@ -1904,19 +1904,19 @@ class ConfService {
|
|
|
1904
1904
|
conf: t,
|
|
1905
1905
|
publicTheme: s
|
|
1906
1906
|
}) {
|
|
1907
|
-
var
|
|
1908
|
-
const r = await this.http.get("/theme"), i = (
|
|
1909
|
-
(
|
|
1907
|
+
var E;
|
|
1908
|
+
const r = await this.http.get("/theme"), i = (E = t == null ? void 0 : t.overriding) == null ? void 0 : E.find(
|
|
1909
|
+
(p) => (
|
|
1910
1910
|
// Fix #WB2-2660:
|
|
1911
1911
|
// If Public access => get the neo theme
|
|
1912
1912
|
// Else get the theme from the user preference
|
|
1913
|
-
s ?
|
|
1913
|
+
s ? p.parent === "theme-open-ent" && p.bootstrapVersion === "ode-bootstrap-neo" : p.child === (r == null ? void 0 : r.themeName)
|
|
1914
1914
|
)
|
|
1915
|
-
), 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,
|
|
1915
|
+
), 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, h = i == null ? void 0 : i.bootstrapVersion.split("-").slice(-1)[0], l = (i == null ? void 0 : i.parent) === "panda";
|
|
1916
1916
|
return {
|
|
1917
1917
|
basePath: `${this.cdnDomain}${a}../../`,
|
|
1918
|
-
bootstrapVersion:
|
|
1919
|
-
is1d:
|
|
1918
|
+
bootstrapVersion: h,
|
|
1919
|
+
is1d: l,
|
|
1920
1920
|
logoutCallback: (r == null ? void 0 : r.logoutCallback) || "",
|
|
1921
1921
|
skin: i == null ? void 0 : i.child,
|
|
1922
1922
|
skinName: o,
|
|
@@ -1969,13 +1969,13 @@ class DirectoryService {
|
|
|
1969
1969
|
id: s,
|
|
1970
1970
|
displayName: r,
|
|
1971
1971
|
notVisibleCount: o,
|
|
1972
|
-
groups: t.map(({ name: a, id: c, nbUsers:
|
|
1973
|
-
nbUsers:
|
|
1972
|
+
groups: t.map(({ name: a, id: c, nbUsers: h }) => ({
|
|
1973
|
+
nbUsers: h,
|
|
1974
1974
|
displayName: a,
|
|
1975
1975
|
id: c
|
|
1976
1976
|
})),
|
|
1977
|
-
users: i.map(({ displayName: a, id: c, profile:
|
|
1978
|
-
profile:
|
|
1977
|
+
users: i.map(({ displayName: a, id: c, profile: h }) => ({
|
|
1978
|
+
profile: h,
|
|
1979
1979
|
displayName: a,
|
|
1980
1980
|
// these info are missing from api
|
|
1981
1981
|
firstName: "",
|
|
@@ -1991,27 +1991,27 @@ class DirectoryService {
|
|
|
1991
1991
|
users: r
|
|
1992
1992
|
}) {
|
|
1993
1993
|
this.cache.clearCache("/directory/sharebookmark/all");
|
|
1994
|
-
const i = r.map((
|
|
1995
|
-
if (typeof
|
|
1996
|
-
const { displayName:
|
|
1994
|
+
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) => {
|
|
1995
|
+
if (typeof p == "string") {
|
|
1996
|
+
const { displayName: d, groups: g, id: A, users: f } = await this.getBookMarkById(p), y = f.map((_) => _.id), F = g.map((_) => _.id);
|
|
1997
1997
|
return {
|
|
1998
|
-
displayName:
|
|
1999
|
-
id:
|
|
2000
|
-
members: [...
|
|
1998
|
+
displayName: d,
|
|
1999
|
+
id: A,
|
|
2000
|
+
members: [...F, ...y]
|
|
2001
2001
|
};
|
|
2002
2002
|
} else
|
|
2003
|
-
return Promise.resolve(
|
|
2004
|
-
}),
|
|
2003
|
+
return Promise.resolve(p);
|
|
2004
|
+
}), h = (await Promise.all(a)).map((p) => p.members).reduce((p, d) => [...p, ...d], []), l = {
|
|
2005
2005
|
name: e,
|
|
2006
|
-
members: [...i, ...o, ...
|
|
2007
|
-
}, { id:
|
|
2006
|
+
members: [...i, ...o, ...h]
|
|
2007
|
+
}, { id: E } = await this.http.postJson(
|
|
2008
2008
|
"/directory/sharebookmark",
|
|
2009
|
-
|
|
2009
|
+
l
|
|
2010
2010
|
);
|
|
2011
2011
|
return {
|
|
2012
|
-
id:
|
|
2012
|
+
id: E,
|
|
2013
2013
|
displayName: e,
|
|
2014
|
-
members:
|
|
2014
|
+
members: l.members
|
|
2015
2015
|
};
|
|
2016
2016
|
}
|
|
2017
2017
|
}
|
|
@@ -2296,7 +2296,7 @@ class RightService {
|
|
|
2296
2296
|
return e.map((s) => this.parseResourceRight(s)).filter((s) => s !== void 0);
|
|
2297
2297
|
}
|
|
2298
2298
|
/**
|
|
2299
|
-
* Check wether a user has the expected right for a
|
|
2299
|
+
* Check wether a user has the expected right for a ressource
|
|
2300
2300
|
* @param user the userId and groupId concerned by the check
|
|
2301
2301
|
* @param expect the expected right to check
|
|
2302
2302
|
* @param rights array of Right for the resource
|
|
@@ -2556,18 +2556,18 @@ class SessionService {
|
|
|
2556
2556
|
const i = [];
|
|
2557
2557
|
return r.bookmarks.forEach((o, a) => {
|
|
2558
2558
|
const c = ((e == null ? void 0 : e.apps) || []).find(
|
|
2559
|
-
(
|
|
2559
|
+
(h) => h.name === o
|
|
2560
2560
|
);
|
|
2561
2561
|
if (c) {
|
|
2562
|
-
const
|
|
2563
|
-
i.push(
|
|
2562
|
+
const h = Object.assign({}, c);
|
|
2563
|
+
i.push(h);
|
|
2564
2564
|
}
|
|
2565
2565
|
}), i;
|
|
2566
2566
|
}
|
|
2567
2567
|
async getUserProfile(e = {}) {
|
|
2568
|
-
var c,
|
|
2568
|
+
var c, h;
|
|
2569
2569
|
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);
|
|
2570
|
-
return o.status < 200 || o.status >= 300 || typeof a == "string" ? ["Guest"] : ((
|
|
2570
|
+
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"];
|
|
2571
2571
|
}
|
|
2572
2572
|
async isAdml() {
|
|
2573
2573
|
const e = await this.getUser();
|
|
@@ -2893,88 +2893,83 @@ class ShareService {
|
|
|
2893
2893
|
get cache() {
|
|
2894
2894
|
return this.context.cache();
|
|
2895
2895
|
}
|
|
2896
|
-
async searchShareSubjects(e, t, s
|
|
2897
|
-
const
|
|
2898
|
-
|
|
2899
|
-
),
|
|
2896
|
+
async searchShareSubjects(e, t, s) {
|
|
2897
|
+
const r = StringUtils.removeAccents(s).toLowerCase(), i = await this.cache.httpGetJson(
|
|
2898
|
+
`/${e}/share/json/${t}?search=${s}`
|
|
2899
|
+
), o = i.users.visibles.filter(({ username: l, firstName: E, lastName: p, login: d }) => {
|
|
2900
2900
|
const g = StringUtils.removeAccents(
|
|
2901
|
-
|
|
2901
|
+
p || ""
|
|
2902
2902
|
).toLowerCase(), A = StringUtils.removeAccents(
|
|
2903
|
-
|
|
2903
|
+
E || ""
|
|
2904
2904
|
).toLowerCase(), f = StringUtils.removeAccents(
|
|
2905
|
-
|
|
2906
|
-
).toLowerCase(), y = StringUtils.removeAccents(
|
|
2907
|
-
return f.includes(
|
|
2908
|
-
}).map((
|
|
2909
|
-
avatarUrl: this.directory.getAvatarUrl(
|
|
2910
|
-
directoryUrl: this.directory.getDirectoryUrl(
|
|
2911
|
-
displayName:
|
|
2912
|
-
id:
|
|
2913
|
-
profile:
|
|
2905
|
+
l || ""
|
|
2906
|
+
).toLowerCase(), y = StringUtils.removeAccents(d || "").toLowerCase();
|
|
2907
|
+
return f.includes(r) || A.includes(r) || g.includes(r) || y.includes(r);
|
|
2908
|
+
}).map((l) => ({
|
|
2909
|
+
avatarUrl: this.directory.getAvatarUrl(l.id, "user"),
|
|
2910
|
+
directoryUrl: this.directory.getDirectoryUrl(l.id, "user"),
|
|
2911
|
+
displayName: l.username,
|
|
2912
|
+
id: l.id,
|
|
2913
|
+
profile: l.profile,
|
|
2914
2914
|
type: "user"
|
|
2915
|
-
})),
|
|
2916
|
-
avatarUrl: this.directory.getAvatarUrl(
|
|
2917
|
-
directoryUrl: this.directory.getDirectoryUrl(
|
|
2918
|
-
displayName:
|
|
2919
|
-
id:
|
|
2915
|
+
})), a = i.groups.visibles.filter(({ name: l }) => StringUtils.removeAccents(l || "").toLowerCase().includes(r)).map((l) => ({
|
|
2916
|
+
avatarUrl: this.directory.getAvatarUrl(l.id, "group"),
|
|
2917
|
+
directoryUrl: this.directory.getDirectoryUrl(l.id, "group"),
|
|
2918
|
+
displayName: l.name,
|
|
2919
|
+
id: l.id,
|
|
2920
2920
|
type: "group",
|
|
2921
|
-
structureName:
|
|
2921
|
+
structureName: l.structureName
|
|
2922
2922
|
}));
|
|
2923
|
-
return [...(await this.directory.getBookMarks()).filter(({ displayName:
|
|
2924
|
-
|
|
2925
|
-
).toLowerCase().includes(
|
|
2923
|
+
return [...(await this.directory.getBookMarks()).filter(({ displayName: l }) => StringUtils.removeAccents(
|
|
2924
|
+
l || ""
|
|
2925
|
+
).toLowerCase().includes(r)).map((l) => ({
|
|
2926
2926
|
avatarUrl: "",
|
|
2927
2927
|
directoryUrl: "",
|
|
2928
2928
|
profile: "",
|
|
2929
|
-
displayName:
|
|
2930
|
-
id:
|
|
2929
|
+
displayName: l.displayName,
|
|
2930
|
+
id: l.id,
|
|
2931
2931
|
type: "sharebookmark"
|
|
2932
|
-
})), ...
|
|
2932
|
+
})), ...o, ...a];
|
|
2933
2933
|
}
|
|
2934
|
-
async getShareMapping(e
|
|
2935
|
-
const
|
|
2936
|
-
|
|
2934
|
+
async getShareMapping(e) {
|
|
2935
|
+
const t = await this.cache.httpGetJson(
|
|
2936
|
+
`/${e}/rights/sharing`
|
|
2937
2937
|
);
|
|
2938
|
-
for (const
|
|
2939
|
-
if (
|
|
2940
|
-
const
|
|
2941
|
-
delete s
|
|
2938
|
+
for (const s of Object.keys(t))
|
|
2939
|
+
if (s.includes(".")) {
|
|
2940
|
+
const r = s.split(".")[1], i = t[s];
|
|
2941
|
+
delete t[s], t[r] = i;
|
|
2942
2942
|
}
|
|
2943
|
-
return
|
|
2943
|
+
return t;
|
|
2944
2944
|
}
|
|
2945
2945
|
getActionsAvailableFor({ id: e, type: t }, s, r) {
|
|
2946
2946
|
const o = (t === "user" ? s.users.checked[e] : s.groups.checked[e]) || [], a = Object.keys(r), c = [];
|
|
2947
|
-
for (const
|
|
2948
|
-
r[
|
|
2949
|
-
(
|
|
2950
|
-
).length > 0 && c.push(
|
|
2947
|
+
for (const h of a)
|
|
2948
|
+
r[h].filter(
|
|
2949
|
+
(p) => o.includes(p)
|
|
2950
|
+
).length > 0 && c.push(h);
|
|
2951
2951
|
return c;
|
|
2952
2952
|
}
|
|
2953
|
-
async getRightsForResource(e, t
|
|
2954
|
-
const
|
|
2955
|
-
(s == null ? void 0 : s.getResourceRights) || i
|
|
2956
|
-
), a = await this.getShareMapping(
|
|
2957
|
-
e,
|
|
2958
|
-
s == null ? void 0 : s.getShareMapping
|
|
2959
|
-
), c = await this.cache.httpGetJson(
|
|
2953
|
+
async getRightsForResource(e, t) {
|
|
2954
|
+
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(
|
|
2960
2955
|
"/infra/public/json/sharing-rights.json"
|
|
2961
|
-
),
|
|
2962
|
-
(A) => A.id ===
|
|
2963
|
-
)).filter((
|
|
2956
|
+
), c = Object.keys(i.users.checked).map((d) => i.users.visibles.find(
|
|
2957
|
+
(A) => A.id === d
|
|
2958
|
+
)).filter((d) => d !== void 0).map((d) => {
|
|
2964
2959
|
const g = this.getActionsAvailableFor(
|
|
2965
|
-
{ id:
|
|
2966
|
-
|
|
2967
|
-
|
|
2960
|
+
{ id: d.id, type: "user" },
|
|
2961
|
+
i,
|
|
2962
|
+
o
|
|
2968
2963
|
);
|
|
2969
2964
|
return {
|
|
2970
|
-
id:
|
|
2965
|
+
id: d.id,
|
|
2971
2966
|
type: "user",
|
|
2972
|
-
displayName:
|
|
2973
|
-
profile:
|
|
2974
|
-
avatarUrl: this.directory.getAvatarUrl(
|
|
2975
|
-
directoryUrl: this.directory.getDirectoryUrl(
|
|
2967
|
+
displayName: d.username,
|
|
2968
|
+
profile: d.profile,
|
|
2969
|
+
avatarUrl: this.directory.getAvatarUrl(d.id, "user"),
|
|
2970
|
+
directoryUrl: this.directory.getDirectoryUrl(d.id, "user"),
|
|
2976
2971
|
actions: g.map((f) => {
|
|
2977
|
-
const y =
|
|
2972
|
+
const y = a[f];
|
|
2978
2973
|
return {
|
|
2979
2974
|
displayName: f,
|
|
2980
2975
|
id: f,
|
|
@@ -2982,23 +2977,23 @@ class ShareService {
|
|
|
2982
2977
|
};
|
|
2983
2978
|
})
|
|
2984
2979
|
};
|
|
2985
|
-
}).sort((
|
|
2986
|
-
(A) => A.id ===
|
|
2987
|
-
)).filter((
|
|
2980
|
+
}).sort((d, g) => (d.displayName || "").localeCompare(g.displayName)), h = Object.keys(i.groups.checked).map((d) => i.groups.visibles.find(
|
|
2981
|
+
(A) => A.id === d
|
|
2982
|
+
)).filter((d) => d !== void 0).map((d) => {
|
|
2988
2983
|
const g = this.getActionsAvailableFor(
|
|
2989
|
-
{ id:
|
|
2990
|
-
|
|
2991
|
-
|
|
2984
|
+
{ id: d.id, type: "group" },
|
|
2985
|
+
i,
|
|
2986
|
+
o
|
|
2992
2987
|
);
|
|
2993
2988
|
return {
|
|
2994
|
-
id:
|
|
2989
|
+
id: d.id,
|
|
2995
2990
|
type: "group",
|
|
2996
|
-
displayName:
|
|
2991
|
+
displayName: d.name,
|
|
2997
2992
|
profile: void 0,
|
|
2998
|
-
avatarUrl: this.directory.getAvatarUrl(
|
|
2999
|
-
directoryUrl: this.directory.getDirectoryUrl(
|
|
2993
|
+
avatarUrl: this.directory.getAvatarUrl(d.id, "group"),
|
|
2994
|
+
directoryUrl: this.directory.getDirectoryUrl(d.id, "group"),
|
|
3000
2995
|
actions: g.map((f) => {
|
|
3001
|
-
const y =
|
|
2996
|
+
const y = a[f];
|
|
3002
2997
|
return {
|
|
3003
2998
|
displayName: f,
|
|
3004
2999
|
id: f,
|
|
@@ -3006,67 +3001,58 @@ class ShareService {
|
|
|
3006
3001
|
};
|
|
3007
3002
|
})
|
|
3008
3003
|
};
|
|
3009
|
-
}).sort((
|
|
3010
|
-
({ groupDisplayName:
|
|
3004
|
+
}).sort((d, g) => (d.displayName || "").localeCompare(g.displayName)), l = [...c, ...h], E = i.groups.visibles.map(
|
|
3005
|
+
({ groupDisplayName: d, id: g, name: A, labels: f }) => ({
|
|
3011
3006
|
labels: f,
|
|
3012
|
-
displayName:
|
|
3007
|
+
displayName: d || A,
|
|
3013
3008
|
id: g
|
|
3014
3009
|
})
|
|
3015
|
-
),
|
|
3016
|
-
({ id:
|
|
3010
|
+
), p = i.users.visibles.map(
|
|
3011
|
+
({ id: d, profile: g, username: A, firstName: f, lastName: y, login: F }) => ({
|
|
3017
3012
|
displayName: A,
|
|
3018
3013
|
firstName: f,
|
|
3019
3014
|
lastName: y,
|
|
3020
|
-
login:
|
|
3015
|
+
login: F,
|
|
3021
3016
|
profile: g,
|
|
3022
|
-
id:
|
|
3017
|
+
id: d
|
|
3023
3018
|
})
|
|
3024
3019
|
);
|
|
3025
3020
|
return {
|
|
3026
|
-
rights:
|
|
3027
|
-
visibleBookmarks:
|
|
3028
|
-
visibleGroups:
|
|
3029
|
-
visibleUsers:
|
|
3021
|
+
rights: l,
|
|
3022
|
+
visibleBookmarks: s,
|
|
3023
|
+
visibleGroups: E,
|
|
3024
|
+
visibleUsers: p
|
|
3030
3025
|
};
|
|
3031
3026
|
}
|
|
3032
|
-
async
|
|
3033
|
-
const r = {
|
|
3034
|
-
|
|
3027
|
+
async saveRights(e, t, s) {
|
|
3028
|
+
const r = await this.getShareMapping(e), i = {
|
|
3029
|
+
bookmarks: {},
|
|
3035
3030
|
groups: {},
|
|
3036
|
-
|
|
3037
|
-
}
|
|
3038
|
-
for (const
|
|
3039
|
-
const
|
|
3040
|
-
|
|
3031
|
+
users: {}
|
|
3032
|
+
};
|
|
3033
|
+
for (const c of s) {
|
|
3034
|
+
const h = c.actions.map((E) => r[E.id]).reduce((E, p) => Array.isArray(p) ? [...E, ...p] : E, []), l = [...new Set(h)];
|
|
3035
|
+
l.length > 0 && (c.type === "user" ? i.users[c.id] = l : c.type === "group" ? i.groups[c.id] = l : i.bookmarks[c.id] = l);
|
|
3041
3036
|
}
|
|
3042
|
-
|
|
3037
|
+
const o = `/${e}/share/resource/${t}`;
|
|
3038
|
+
return this.cache.clearCache(`/${e}/share/json/${t}?search=`), await this.http.putJson(o, i);
|
|
3043
3039
|
}
|
|
3044
|
-
async
|
|
3045
|
-
const
|
|
3046
|
-
e,
|
|
3047
|
-
s,
|
|
3048
|
-
r == null ? void 0 : r.getShareMapping
|
|
3049
|
-
), o = (r == null ? void 0 : r.saveResourceRights) || `/${e}/share/resource/${t}`;
|
|
3050
|
-
return this.cache.clearCache(
|
|
3051
|
-
(r == null ? void 0 : r.getResourceRights) || `/${e}/share/json/${t}?search=`
|
|
3052
|
-
), await this.http.putJson(o, i);
|
|
3053
|
-
}
|
|
3054
|
-
async getActionsForApp(e, t) {
|
|
3055
|
-
const s = await this.cache.httpGetJson(
|
|
3040
|
+
async getActionsForApp(e) {
|
|
3041
|
+
const t = await this.cache.httpGetJson(
|
|
3056
3042
|
"/infra/public/json/sharing-rights.json"
|
|
3057
|
-
),
|
|
3058
|
-
return Object.keys(
|
|
3059
|
-
const
|
|
3043
|
+
), s = await this.getShareMapping(e);
|
|
3044
|
+
return Object.keys(t).map((i) => {
|
|
3045
|
+
const o = t[i];
|
|
3060
3046
|
return {
|
|
3061
|
-
displayName:
|
|
3062
|
-
id:
|
|
3063
|
-
priority:
|
|
3064
|
-
requires:
|
|
3047
|
+
displayName: i,
|
|
3048
|
+
id: i,
|
|
3049
|
+
priority: o.priority,
|
|
3050
|
+
requires: o.requires
|
|
3065
3051
|
};
|
|
3066
|
-
}).filter((
|
|
3067
|
-
var
|
|
3068
|
-
return ((
|
|
3069
|
-
}).sort((
|
|
3052
|
+
}).filter((i) => {
|
|
3053
|
+
var o;
|
|
3054
|
+
return ((o = s[i.id]) == null ? void 0 : o.length) > 0;
|
|
3055
|
+
}).sort((i, o) => i.priority - o.priority);
|
|
3070
3056
|
}
|
|
3071
3057
|
}
|
|
3072
3058
|
const defaultMappers = {
|
|
@@ -3103,11 +3089,11 @@ const defaultMappers = {
|
|
|
3103
3089
|
zip: function({ type: u }) {
|
|
3104
3090
|
return u.indexOf("zip") !== -1 || u.indexOf("rar") !== -1 || u.indexOf("tar") !== -1 || u.indexOf("7z") !== -1;
|
|
3105
3091
|
}
|
|
3106
|
-
},
|
|
3092
|
+
}, C = class C {
|
|
3107
3093
|
/* Similar role notion as in infra-front > workspace > Model.ts */
|
|
3108
3094
|
static getRole(e) {
|
|
3109
3095
|
var t, s;
|
|
3110
|
-
return
|
|
3096
|
+
return C.role(
|
|
3111
3097
|
(t = e.metadata) == null ? void 0 : t["content-type"],
|
|
3112
3098
|
!1,
|
|
3113
3099
|
(s = e.metadata) == null ? void 0 : s.extension
|
|
@@ -3127,10 +3113,10 @@ const defaultMappers = {
|
|
|
3127
3113
|
}
|
|
3128
3114
|
};
|
|
3129
3115
|
// FIXME add edumedia support
|
|
3130
|
-
n(
|
|
3116
|
+
n(C, "roleMappers", [
|
|
3131
3117
|
(e) => Object.keys(defaultMappers).find((s) => defaultMappers[s](e))
|
|
3132
3118
|
]);
|
|
3133
|
-
let DocumentHelper =
|
|
3119
|
+
let DocumentHelper = C;
|
|
3134
3120
|
class WorkspaceService {
|
|
3135
3121
|
constructor(e) {
|
|
3136
3122
|
this.context = e;
|
|
@@ -3220,7 +3206,7 @@ class WorkspaceService {
|
|
|
3220
3206
|
throw this.http.latestResponse.statusText;
|
|
3221
3207
|
return r.forEach((o, a) => {
|
|
3222
3208
|
const c = e.findIndex(
|
|
3223
|
-
(
|
|
3209
|
+
(h) => h._id === o._id
|
|
3224
3210
|
);
|
|
3225
3211
|
0 <= c && c < e.length && (e[c] = i[a]);
|
|
3226
3212
|
}), e.filter((o) => !!o);
|
|
@@ -3239,8 +3225,8 @@ class WorkspaceService {
|
|
|
3239
3225
|
{
|
|
3240
3226
|
const a = `/workspace/${e.public ? "pub/" : ""}document/${e._id}?thumbnail=`, c = e.thumbnails;
|
|
3241
3227
|
if ((o = (i = e.metadata) == null ? void 0 : i["content-type"]) != null && o.includes("video")) {
|
|
3242
|
-
const
|
|
3243
|
-
return
|
|
3228
|
+
const h = c && Object.keys(c).length > 0 ? Object.keys(c)[0] : null;
|
|
3229
|
+
return h ? a + h : null;
|
|
3244
3230
|
} else
|
|
3245
3231
|
return a + r;
|
|
3246
3232
|
}
|
|
@@ -3372,10 +3358,10 @@ class AnalyticsService {
|
|
|
3372
3358
|
const t = await this.session.getUser(), s = await this.session.getUserProfile();
|
|
3373
3359
|
let r;
|
|
3374
3360
|
if (!(t != null && t.structures)) return;
|
|
3375
|
-
for (const
|
|
3376
|
-
const
|
|
3377
|
-
if (
|
|
3378
|
-
r =
|
|
3361
|
+
for (const h of t.structures) {
|
|
3362
|
+
const l = u.structureMap[h];
|
|
3363
|
+
if (l && l.collectiviteId && l.UAI) {
|
|
3364
|
+
r = l;
|
|
3379
3365
|
break;
|
|
3380
3366
|
}
|
|
3381
3367
|
}
|
|
@@ -3384,11 +3370,11 @@ class AnalyticsService {
|
|
|
3384
3370
|
if (!i) return;
|
|
3385
3371
|
const o = i.xiti;
|
|
3386
3372
|
if (!o || !o.LIBELLE_SERVICE || !r.UAI) return;
|
|
3387
|
-
function a(
|
|
3388
|
-
let
|
|
3389
|
-
for (let
|
|
3390
|
-
|
|
3391
|
-
return
|
|
3373
|
+
function a(h) {
|
|
3374
|
+
let l = "";
|
|
3375
|
+
for (let E = 0; E < h.length; E++)
|
|
3376
|
+
l += h.charCodeAt(E);
|
|
3377
|
+
return l;
|
|
3392
3378
|
}
|
|
3393
3379
|
const c = {
|
|
3394
3380
|
Student: "ELEVE",
|
|
@@ -3412,7 +3398,7 @@ class AnalyticsService {
|
|
|
3412
3398
|
};
|
|
3413
3399
|
}
|
|
3414
3400
|
}
|
|
3415
|
-
const
|
|
3401
|
+
const R = class R {
|
|
3416
3402
|
// in minutes. Applies to recorded videos.
|
|
3417
3403
|
constructor(e) {
|
|
3418
3404
|
this.context = e;
|
|
@@ -3433,8 +3419,8 @@ const C = class C {
|
|
|
3433
3419
|
APP$4.VIDEO
|
|
3434
3420
|
);
|
|
3435
3421
|
return {
|
|
3436
|
-
maxWeight: (e == null ? void 0 : e["max-videosize-mbytes"]) ??
|
|
3437
|
-
maxDuration: (e == null ? void 0 : e["max-videoduration-minutes"]) ??
|
|
3422
|
+
maxWeight: (e == null ? void 0 : e["max-videosize-mbytes"]) ?? R.MAX_WEIGHT,
|
|
3423
|
+
maxDuration: (e == null ? void 0 : e["max-videoduration-minutes"]) ?? R.MAX_DURATION,
|
|
3438
3424
|
acceptVideoUploadExtensions: ((t = e == null ? void 0 : e["accept-videoupload-extensions"]) == null ? void 0 : t.map(
|
|
3439
3425
|
(s) => s.toUpperCase()
|
|
3440
3426
|
)) ?? []
|
|
@@ -3465,35 +3451,35 @@ const C = class C {
|
|
|
3465
3451
|
{ headers: { "Content-Type": "multipart/form-data" } }
|
|
3466
3452
|
);
|
|
3467
3453
|
if (c.state == "running") {
|
|
3468
|
-
let
|
|
3454
|
+
let h = 0, l = 1;
|
|
3469
3455
|
do {
|
|
3470
|
-
const
|
|
3456
|
+
const E = l + h;
|
|
3471
3457
|
await new Promise(
|
|
3472
|
-
(
|
|
3473
|
-
),
|
|
3474
|
-
const
|
|
3458
|
+
(d) => setTimeout(d, E * 1e3)
|
|
3459
|
+
), h = l, l = Math.min(8, E);
|
|
3460
|
+
const p = await this.http.get(
|
|
3475
3461
|
`/video/status/${c.processid}`
|
|
3476
3462
|
);
|
|
3477
|
-
if (
|
|
3478
|
-
return
|
|
3479
|
-
|
|
3463
|
+
if (p.state == "succeed")
|
|
3464
|
+
return p.videoworkspaceid && p.videosize && this.context.data().trackVideoSave(
|
|
3465
|
+
p.videoworkspaceid,
|
|
3480
3466
|
Math.round(r),
|
|
3481
|
-
|
|
3467
|
+
p.videosize,
|
|
3482
3468
|
s,
|
|
3483
3469
|
e.url,
|
|
3484
3470
|
i,
|
|
3485
3471
|
e.device
|
|
3486
|
-
),
|
|
3487
|
-
if (
|
|
3472
|
+
), p;
|
|
3473
|
+
if (p.state == "error")
|
|
3488
3474
|
break;
|
|
3489
3475
|
} while (!0);
|
|
3490
3476
|
}
|
|
3491
3477
|
throw new Error("Video cannot be uploaded.");
|
|
3492
3478
|
}
|
|
3493
3479
|
};
|
|
3494
|
-
n(
|
|
3495
|
-
n(
|
|
3496
|
-
let VideoService =
|
|
3480
|
+
n(R, "MAX_WEIGHT", 50), // in Mbytes. Applies to uploaded videos.
|
|
3481
|
+
n(R, "MAX_DURATION", 3);
|
|
3482
|
+
let VideoService = R;
|
|
3497
3483
|
class EmbedderService {
|
|
3498
3484
|
constructor(e) {
|
|
3499
3485
|
this.context = e;
|
|
@@ -3530,10 +3516,10 @@ class EmbedderService {
|
|
|
3530
3516
|
const s = new RegExp("[^{}]+(?=(?:[^{}]*{[^}]*})*[^}]*$)", "g"), r = new RegExp("{[^}]*}", "g");
|
|
3531
3517
|
let i = !0;
|
|
3532
3518
|
const o = t.match(s) || [], a = [];
|
|
3533
|
-
return (t.match(r) || []).forEach((
|
|
3534
|
-
|
|
3535
|
-
}), a.forEach((
|
|
3536
|
-
if (!e.includes(
|
|
3519
|
+
return (t.match(r) || []).forEach((h, l) => {
|
|
3520
|
+
h.includes("ignore") || a.push(o[l]);
|
|
3521
|
+
}), a.forEach((h) => {
|
|
3522
|
+
if (!e.includes(h)) {
|
|
3537
3523
|
i = !1;
|
|
3538
3524
|
return;
|
|
3539
3525
|
}
|
|
@@ -3565,15 +3551,15 @@ class EmbedderService {
|
|
|
3565
3551
|
let o = e.embed;
|
|
3566
3552
|
for (const a of i) {
|
|
3567
3553
|
let c = s.split(a)[0];
|
|
3568
|
-
const
|
|
3569
|
-
|
|
3570
|
-
let
|
|
3571
|
-
if (!
|
|
3554
|
+
const h = c.split("}");
|
|
3555
|
+
h.length > 1 && (c = h[h.length - 1]);
|
|
3556
|
+
let l = t.split(c)[1];
|
|
3557
|
+
if (!l)
|
|
3572
3558
|
continue;
|
|
3573
|
-
const
|
|
3574
|
-
|
|
3575
|
-
const
|
|
3576
|
-
o = o.replace(
|
|
3559
|
+
const E = s.split(a)[1].split("{")[0];
|
|
3560
|
+
E && (l = l.split(E)[0]);
|
|
3561
|
+
const p = new RegExp("\\" + a.replace(/}/, "\\}"), "g");
|
|
3562
|
+
o = o.replace(p, l);
|
|
3577
3563
|
}
|
|
3578
3564
|
return o;
|
|
3579
3565
|
}
|
|
@@ -4002,17 +3988,17 @@ class WorkspaceBehaviour extends AbstractBehaviourService {
|
|
|
4002
3988
|
try {
|
|
4003
3989
|
let o = "/workspace/documents?filter=all&hierarchical=true";
|
|
4004
3990
|
s && s.length ? o += `&search=${t}` : t && t.length && (o += `&search=${t}`);
|
|
4005
|
-
const c = (await this.httpGet(o)).filter((
|
|
4006
|
-
const
|
|
3991
|
+
const c = (await this.httpGet(o)).filter((h) => !h.deleted).map((h) => {
|
|
3992
|
+
const l = h.metadata["content-type"] && h.metadata["content-type"].indexOf("image") !== -1 ? `/workspace/document/${h._id}?thumbnail=120x120` : "/img/icons/unknown-large.png";
|
|
4007
3993
|
return this.dataToResource({
|
|
4008
|
-
title:
|
|
4009
|
-
ownerName:
|
|
4010
|
-
owner:
|
|
4011
|
-
icon:
|
|
4012
|
-
path: `/workspace/document/${
|
|
4013
|
-
_id:
|
|
4014
|
-
shared: !!(
|
|
4015
|
-
modified:
|
|
3994
|
+
title: h.name,
|
|
3995
|
+
ownerName: h.ownerName,
|
|
3996
|
+
owner: h.owner,
|
|
3997
|
+
icon: l,
|
|
3998
|
+
path: `/workspace/document/${h._id}`,
|
|
3999
|
+
_id: h._id,
|
|
4000
|
+
shared: !!(h.shared && h.shared.length >= 0),
|
|
4001
|
+
modified: h.modified
|
|
4016
4002
|
});
|
|
4017
4003
|
});
|
|
4018
4004
|
r(c);
|
|
@@ -4579,18 +4565,18 @@ class WidgetFramework {
|
|
|
4579
4565
|
t.listSkins().then((r) => {
|
|
4580
4566
|
var a;
|
|
4581
4567
|
const i = ((a = r.find((c) => c.child === t.skin)) == null ? void 0 : a.parent) === "panda" ? secondLevelWidgets : firstLevelWidgets;
|
|
4582
|
-
this._widgets = this._widgets.filter((c,
|
|
4583
|
-
const
|
|
4584
|
-
return i.indexOf(
|
|
4585
|
-
index: defaultWidgetOrder[
|
|
4568
|
+
this._widgets = this._widgets.filter((c, h) => {
|
|
4569
|
+
const l = c.platformConf.name;
|
|
4570
|
+
return i.indexOf(l) !== -1 ? !1 : (this._userPrefs[l] || (this._userPrefs[l] = {
|
|
4571
|
+
index: defaultWidgetOrder[l] ?? 999,
|
|
4586
4572
|
show: !0,
|
|
4587
4573
|
position: c.platformConf.position
|
|
4588
|
-
}), c.platformConf.mandatory && (this._userPrefs[
|
|
4574
|
+
}), 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);
|
|
4589
4575
|
});
|
|
4590
4576
|
const o = new Idiom();
|
|
4591
|
-
this._widgets = this._widgets.sort((c,
|
|
4592
|
-
const
|
|
4593
|
-
return
|
|
4577
|
+
this._widgets = this._widgets.sort((c, h) => {
|
|
4578
|
+
const l = o.translate(`timeline.settings.${c.platformConf.name}`).toLowerCase(), E = o.translate(`timeline.settings.${h.platformConf.name}`).toLowerCase();
|
|
4579
|
+
return l < E ? -1 : l > E ? 1 : 0;
|
|
4594
4580
|
});
|
|
4595
4581
|
});
|
|
4596
4582
|
}
|