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