@edifice.io/client 2.4.2-develop-b2school-actualites.20251126112549 → 2.4.2-develop-pedago.20251126113601
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/directory/interface.d.ts +0 -2
- package/dist/index.cjs +1 -1
- package/dist/index.js +157 -169
- 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");
|
|
@@ -1096,8 +1096,8 @@ class Analytics {
|
|
|
1096
1096
|
if (!o || !o.LIBELLE_SERVICE || !r.UAI) return;
|
|
1097
1097
|
function a(h) {
|
|
1098
1098
|
let l = "";
|
|
1099
|
-
for (let
|
|
1100
|
-
l += h.charCodeAt(
|
|
1099
|
+
for (let E = 0; E < h.length; E++)
|
|
1100
|
+
l += h.charCodeAt(E);
|
|
1101
1101
|
return l;
|
|
1102
1102
|
}
|
|
1103
1103
|
const c = {
|
|
@@ -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,13 +1904,13 @@ 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
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 {
|
|
@@ -1962,26 +1962,25 @@ class DirectoryService {
|
|
|
1962
1962
|
}));
|
|
1963
1963
|
}
|
|
1964
1964
|
async getBookMarkById(e) {
|
|
1965
|
-
const { groups: t, id: s, name: r, users: i
|
|
1965
|
+
const { groups: t, id: s, name: r, users: i } = await this.http.get(
|
|
1966
1966
|
`/directory/sharebookmark/${e}`
|
|
1967
1967
|
);
|
|
1968
1968
|
return {
|
|
1969
1969
|
id: s,
|
|
1970
1970
|
displayName: r,
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
id: c
|
|
1971
|
+
groups: t.map(({ name: o, id: a, nbUsers: c }) => ({
|
|
1972
|
+
nbUsers: c,
|
|
1973
|
+
displayName: o,
|
|
1974
|
+
id: a
|
|
1976
1975
|
})),
|
|
1977
|
-
users: i.map(({ displayName:
|
|
1978
|
-
profile:
|
|
1979
|
-
displayName:
|
|
1976
|
+
users: i.map(({ displayName: o, id: a, profile: c }) => ({
|
|
1977
|
+
profile: c,
|
|
1978
|
+
displayName: o,
|
|
1980
1979
|
// these info are missing from api
|
|
1981
1980
|
firstName: "",
|
|
1982
1981
|
lastName: "",
|
|
1983
1982
|
login: "",
|
|
1984
|
-
id:
|
|
1983
|
+
id: a
|
|
1985
1984
|
}))
|
|
1986
1985
|
};
|
|
1987
1986
|
}
|
|
@@ -1991,25 +1990,25 @@ class DirectoryService {
|
|
|
1991
1990
|
users: r
|
|
1992
1991
|
}) {
|
|
1993
1992
|
this.cache.clearCache("/directory/sharebookmark/all");
|
|
1994
|
-
const i = r.map((
|
|
1995
|
-
if (typeof
|
|
1996
|
-
const { displayName:
|
|
1993
|
+
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) => {
|
|
1994
|
+
if (typeof p == "string") {
|
|
1995
|
+
const { displayName: d, groups: g, id: A, users: f } = await this.getBookMarkById(p), y = f.map((_) => _.id), F = g.map((_) => _.id);
|
|
1997
1996
|
return {
|
|
1998
|
-
displayName:
|
|
1999
|
-
id:
|
|
2000
|
-
members: [...
|
|
1997
|
+
displayName: d,
|
|
1998
|
+
id: A,
|
|
1999
|
+
members: [...F, ...y]
|
|
2001
2000
|
};
|
|
2002
2001
|
} else
|
|
2003
|
-
return Promise.resolve(
|
|
2004
|
-
}), h = (await Promise.all(a)).map((
|
|
2002
|
+
return Promise.resolve(p);
|
|
2003
|
+
}), h = (await Promise.all(a)).map((p) => p.members).reduce((p, d) => [...p, ...d], []), l = {
|
|
2005
2004
|
name: e,
|
|
2006
2005
|
members: [...i, ...o, ...h]
|
|
2007
|
-
}, { id:
|
|
2006
|
+
}, { id: E } = await this.http.postJson(
|
|
2008
2007
|
"/directory/sharebookmark",
|
|
2009
2008
|
l
|
|
2010
2009
|
);
|
|
2011
2010
|
return {
|
|
2012
|
-
id:
|
|
2011
|
+
id: E,
|
|
2013
2012
|
displayName: e,
|
|
2014
2013
|
members: l.members
|
|
2015
2014
|
};
|
|
@@ -2296,7 +2295,7 @@ class RightService {
|
|
|
2296
2295
|
return e.map((s) => this.parseResourceRight(s)).filter((s) => s !== void 0);
|
|
2297
2296
|
}
|
|
2298
2297
|
/**
|
|
2299
|
-
* Check wether a user has the expected right for a
|
|
2298
|
+
* Check wether a user has the expected right for a ressource
|
|
2300
2299
|
* @param user the userId and groupId concerned by the check
|
|
2301
2300
|
* @param expect the expected right to check
|
|
2302
2301
|
* @param rights array of Right for the resource
|
|
@@ -2893,85 +2892,83 @@ class ShareService {
|
|
|
2893
2892
|
get cache() {
|
|
2894
2893
|
return this.context.cache();
|
|
2895
2894
|
}
|
|
2896
|
-
async searchShareSubjects(e, t, s
|
|
2897
|
-
const
|
|
2898
|
-
|
|
2899
|
-
),
|
|
2895
|
+
async searchShareSubjects(e, t, s) {
|
|
2896
|
+
const r = StringUtils.removeAccents(s).toLowerCase(), i = await this.cache.httpGetJson(
|
|
2897
|
+
`/${e}/share/json/${t}?search=${s}`
|
|
2898
|
+
), o = i.users.visibles.filter(({ username: l, firstName: E, lastName: p, login: d }) => {
|
|
2900
2899
|
const g = StringUtils.removeAccents(
|
|
2901
|
-
|
|
2900
|
+
p || ""
|
|
2902
2901
|
).toLowerCase(), A = StringUtils.removeAccents(
|
|
2903
|
-
|
|
2902
|
+
E || ""
|
|
2904
2903
|
).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:
|
|
2904
|
+
l || ""
|
|
2905
|
+
).toLowerCase(), y = StringUtils.removeAccents(d || "").toLowerCase();
|
|
2906
|
+
return f.includes(r) || A.includes(r) || g.includes(r) || y.includes(r);
|
|
2907
|
+
}).map((l) => ({
|
|
2908
|
+
avatarUrl: this.directory.getAvatarUrl(l.id, "user"),
|
|
2909
|
+
directoryUrl: this.directory.getDirectoryUrl(l.id, "user"),
|
|
2910
|
+
displayName: l.username,
|
|
2911
|
+
id: l.id,
|
|
2912
|
+
profile: l.profile,
|
|
2914
2913
|
type: "user"
|
|
2915
|
-
})),
|
|
2916
|
-
avatarUrl: this.directory.getAvatarUrl(
|
|
2917
|
-
directoryUrl: this.directory.getDirectoryUrl(
|
|
2918
|
-
displayName:
|
|
2919
|
-
id:
|
|
2914
|
+
})), a = i.groups.visibles.filter(({ name: l }) => StringUtils.removeAccents(l || "").toLowerCase().includes(r)).map((l) => ({
|
|
2915
|
+
avatarUrl: this.directory.getAvatarUrl(l.id, "group"),
|
|
2916
|
+
directoryUrl: this.directory.getDirectoryUrl(l.id, "group"),
|
|
2917
|
+
displayName: l.name,
|
|
2918
|
+
id: l.id,
|
|
2920
2919
|
type: "group",
|
|
2921
|
-
structureName:
|
|
2920
|
+
structureName: l.structureName
|
|
2922
2921
|
}));
|
|
2923
|
-
return [...(await this.directory.getBookMarks()).filter(({ displayName:
|
|
2924
|
-
|
|
2925
|
-
).toLowerCase().includes(
|
|
2922
|
+
return [...(await this.directory.getBookMarks()).filter(({ displayName: l }) => StringUtils.removeAccents(
|
|
2923
|
+
l || ""
|
|
2924
|
+
).toLowerCase().includes(r)).map((l) => ({
|
|
2926
2925
|
avatarUrl: "",
|
|
2927
2926
|
directoryUrl: "",
|
|
2928
2927
|
profile: "",
|
|
2929
|
-
displayName:
|
|
2930
|
-
id:
|
|
2928
|
+
displayName: l.displayName,
|
|
2929
|
+
id: l.id,
|
|
2931
2930
|
type: "sharebookmark"
|
|
2932
|
-
})), ...
|
|
2931
|
+
})), ...o, ...a];
|
|
2933
2932
|
}
|
|
2934
|
-
async getShareMapping(e
|
|
2935
|
-
const
|
|
2936
|
-
|
|
2933
|
+
async getShareMapping(e) {
|
|
2934
|
+
const t = await this.cache.httpGetJson(
|
|
2935
|
+
`/${e}/rights/sharing`
|
|
2937
2936
|
);
|
|
2938
|
-
for (const
|
|
2939
|
-
if (
|
|
2940
|
-
const
|
|
2941
|
-
delete s
|
|
2937
|
+
for (const s of Object.keys(t))
|
|
2938
|
+
if (s.includes(".")) {
|
|
2939
|
+
const r = s.split(".")[1], i = t[s];
|
|
2940
|
+
delete t[s], t[r] = i;
|
|
2942
2941
|
}
|
|
2943
|
-
return
|
|
2942
|
+
return t;
|
|
2944
2943
|
}
|
|
2945
2944
|
getActionsAvailableFor({ id: e, type: t }, s, r) {
|
|
2946
2945
|
const o = (t === "user" ? s.users.checked[e] : s.groups.checked[e]) || [], a = Object.keys(r), c = [];
|
|
2947
2946
|
for (const h of a)
|
|
2948
2947
|
r[h].filter(
|
|
2949
|
-
(
|
|
2948
|
+
(p) => o.includes(p)
|
|
2950
2949
|
).length > 0 && c.push(h);
|
|
2951
2950
|
return c;
|
|
2952
2951
|
}
|
|
2953
|
-
async getRightsForResource(e, t
|
|
2954
|
-
const
|
|
2955
|
-
(s == null ? void 0 : s.getResourceRights) || i
|
|
2956
|
-
), a = await this.getShareMapping(e, s == null ? void 0 : s.getShareMapping), c = await this.cache.httpGetJson(
|
|
2952
|
+
async getRightsForResource(e, t) {
|
|
2953
|
+
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(
|
|
2957
2954
|
"/infra/public/json/sharing-rights.json"
|
|
2958
|
-
),
|
|
2959
|
-
(A) => A.id ===
|
|
2960
|
-
)).filter((
|
|
2955
|
+
), c = Object.keys(i.users.checked).map((d) => i.users.visibles.find(
|
|
2956
|
+
(A) => A.id === d
|
|
2957
|
+
)).filter((d) => d !== void 0).map((d) => {
|
|
2961
2958
|
const g = this.getActionsAvailableFor(
|
|
2962
|
-
{ id:
|
|
2963
|
-
|
|
2964
|
-
|
|
2959
|
+
{ id: d.id, type: "user" },
|
|
2960
|
+
i,
|
|
2961
|
+
o
|
|
2965
2962
|
);
|
|
2966
2963
|
return {
|
|
2967
|
-
id:
|
|
2964
|
+
id: d.id,
|
|
2968
2965
|
type: "user",
|
|
2969
|
-
displayName:
|
|
2970
|
-
profile:
|
|
2971
|
-
avatarUrl: this.directory.getAvatarUrl(
|
|
2972
|
-
directoryUrl: this.directory.getDirectoryUrl(
|
|
2966
|
+
displayName: d.username,
|
|
2967
|
+
profile: d.profile,
|
|
2968
|
+
avatarUrl: this.directory.getAvatarUrl(d.id, "user"),
|
|
2969
|
+
directoryUrl: this.directory.getDirectoryUrl(d.id, "user"),
|
|
2973
2970
|
actions: g.map((f) => {
|
|
2974
|
-
const y =
|
|
2971
|
+
const y = a[f];
|
|
2975
2972
|
return {
|
|
2976
2973
|
displayName: f,
|
|
2977
2974
|
id: f,
|
|
@@ -2979,23 +2976,23 @@ class ShareService {
|
|
|
2979
2976
|
};
|
|
2980
2977
|
})
|
|
2981
2978
|
};
|
|
2982
|
-
}).sort((
|
|
2983
|
-
(A) => A.id ===
|
|
2984
|
-
)).filter((
|
|
2979
|
+
}).sort((d, g) => (d.displayName || "").localeCompare(g.displayName)), h = Object.keys(i.groups.checked).map((d) => i.groups.visibles.find(
|
|
2980
|
+
(A) => A.id === d
|
|
2981
|
+
)).filter((d) => d !== void 0).map((d) => {
|
|
2985
2982
|
const g = this.getActionsAvailableFor(
|
|
2986
|
-
{ id:
|
|
2987
|
-
|
|
2988
|
-
|
|
2983
|
+
{ id: d.id, type: "group" },
|
|
2984
|
+
i,
|
|
2985
|
+
o
|
|
2989
2986
|
);
|
|
2990
2987
|
return {
|
|
2991
|
-
id:
|
|
2988
|
+
id: d.id,
|
|
2992
2989
|
type: "group",
|
|
2993
|
-
displayName:
|
|
2990
|
+
displayName: d.name,
|
|
2994
2991
|
profile: void 0,
|
|
2995
|
-
avatarUrl: this.directory.getAvatarUrl(
|
|
2996
|
-
directoryUrl: this.directory.getDirectoryUrl(
|
|
2992
|
+
avatarUrl: this.directory.getAvatarUrl(d.id, "group"),
|
|
2993
|
+
directoryUrl: this.directory.getDirectoryUrl(d.id, "group"),
|
|
2997
2994
|
actions: g.map((f) => {
|
|
2998
|
-
const y =
|
|
2995
|
+
const y = a[f];
|
|
2999
2996
|
return {
|
|
3000
2997
|
displayName: f,
|
|
3001
2998
|
id: f,
|
|
@@ -3003,67 +3000,58 @@ class ShareService {
|
|
|
3003
3000
|
};
|
|
3004
3001
|
})
|
|
3005
3002
|
};
|
|
3006
|
-
}).sort((
|
|
3007
|
-
({ groupDisplayName:
|
|
3003
|
+
}).sort((d, g) => (d.displayName || "").localeCompare(g.displayName)), l = [...c, ...h], E = i.groups.visibles.map(
|
|
3004
|
+
({ groupDisplayName: d, id: g, name: A, labels: f }) => ({
|
|
3008
3005
|
labels: f,
|
|
3009
|
-
displayName:
|
|
3006
|
+
displayName: d || A,
|
|
3010
3007
|
id: g
|
|
3011
3008
|
})
|
|
3012
|
-
),
|
|
3013
|
-
({ id:
|
|
3009
|
+
), p = i.users.visibles.map(
|
|
3010
|
+
({ id: d, profile: g, username: A, firstName: f, lastName: y, login: F }) => ({
|
|
3014
3011
|
displayName: A,
|
|
3015
3012
|
firstName: f,
|
|
3016
3013
|
lastName: y,
|
|
3017
|
-
login:
|
|
3014
|
+
login: F,
|
|
3018
3015
|
profile: g,
|
|
3019
|
-
id:
|
|
3016
|
+
id: d
|
|
3020
3017
|
})
|
|
3021
3018
|
);
|
|
3022
3019
|
return {
|
|
3023
|
-
rights:
|
|
3024
|
-
visibleBookmarks:
|
|
3025
|
-
visibleGroups:
|
|
3026
|
-
visibleUsers:
|
|
3020
|
+
rights: l,
|
|
3021
|
+
visibleBookmarks: s,
|
|
3022
|
+
visibleGroups: E,
|
|
3023
|
+
visibleUsers: p
|
|
3027
3024
|
};
|
|
3028
3025
|
}
|
|
3029
|
-
async
|
|
3030
|
-
const r = {
|
|
3031
|
-
|
|
3026
|
+
async saveRights(e, t, s) {
|
|
3027
|
+
const r = await this.getShareMapping(e), i = {
|
|
3028
|
+
bookmarks: {},
|
|
3032
3029
|
groups: {},
|
|
3033
|
-
|
|
3034
|
-
}
|
|
3035
|
-
for (const
|
|
3036
|
-
const
|
|
3037
|
-
|
|
3030
|
+
users: {}
|
|
3031
|
+
};
|
|
3032
|
+
for (const c of s) {
|
|
3033
|
+
const h = c.actions.map((E) => r[E.id]).reduce((E, p) => Array.isArray(p) ? [...E, ...p] : E, []), l = [...new Set(h)];
|
|
3034
|
+
l.length > 0 && (c.type === "user" ? i.users[c.id] = l : c.type === "group" ? i.groups[c.id] = l : i.bookmarks[c.id] = l);
|
|
3038
3035
|
}
|
|
3039
|
-
|
|
3036
|
+
const o = `/${e}/share/resource/${t}`;
|
|
3037
|
+
return this.cache.clearCache(`/${e}/share/json/${t}?search=`), await this.http.putJson(o, i);
|
|
3040
3038
|
}
|
|
3041
|
-
async
|
|
3042
|
-
const
|
|
3043
|
-
e,
|
|
3044
|
-
s,
|
|
3045
|
-
r == null ? void 0 : r.getShareMapping
|
|
3046
|
-
), o = (r == null ? void 0 : r.saveResourceRights) || `/${e}/share/resource/${t}`;
|
|
3047
|
-
return this.cache.clearCache(
|
|
3048
|
-
(r == null ? void 0 : r.getResourceRights) || `/${e}/share/json/${t}?search=`
|
|
3049
|
-
), await this.http.putJson(o, i);
|
|
3050
|
-
}
|
|
3051
|
-
async getActionsForApp(e, t) {
|
|
3052
|
-
const s = await this.cache.httpGetJson(
|
|
3039
|
+
async getActionsForApp(e) {
|
|
3040
|
+
const t = await this.cache.httpGetJson(
|
|
3053
3041
|
"/infra/public/json/sharing-rights.json"
|
|
3054
|
-
),
|
|
3055
|
-
return Object.keys(
|
|
3056
|
-
const
|
|
3042
|
+
), s = await this.getShareMapping(e);
|
|
3043
|
+
return Object.keys(t).map((i) => {
|
|
3044
|
+
const o = t[i];
|
|
3057
3045
|
return {
|
|
3058
|
-
displayName:
|
|
3059
|
-
id:
|
|
3060
|
-
priority:
|
|
3061
|
-
requires:
|
|
3046
|
+
displayName: i,
|
|
3047
|
+
id: i,
|
|
3048
|
+
priority: o.priority,
|
|
3049
|
+
requires: o.requires
|
|
3062
3050
|
};
|
|
3063
|
-
}).filter((
|
|
3064
|
-
var
|
|
3065
|
-
return ((
|
|
3066
|
-
}).sort((
|
|
3051
|
+
}).filter((i) => {
|
|
3052
|
+
var o;
|
|
3053
|
+
return ((o = s[i.id]) == null ? void 0 : o.length) > 0;
|
|
3054
|
+
}).sort((i, o) => i.priority - o.priority);
|
|
3067
3055
|
}
|
|
3068
3056
|
}
|
|
3069
3057
|
const defaultMappers = {
|
|
@@ -3100,11 +3088,11 @@ const defaultMappers = {
|
|
|
3100
3088
|
zip: function({ type: u }) {
|
|
3101
3089
|
return u.indexOf("zip") !== -1 || u.indexOf("rar") !== -1 || u.indexOf("tar") !== -1 || u.indexOf("7z") !== -1;
|
|
3102
3090
|
}
|
|
3103
|
-
},
|
|
3091
|
+
}, C = class C {
|
|
3104
3092
|
/* Similar role notion as in infra-front > workspace > Model.ts */
|
|
3105
3093
|
static getRole(e) {
|
|
3106
3094
|
var t, s;
|
|
3107
|
-
return
|
|
3095
|
+
return C.role(
|
|
3108
3096
|
(t = e.metadata) == null ? void 0 : t["content-type"],
|
|
3109
3097
|
!1,
|
|
3110
3098
|
(s = e.metadata) == null ? void 0 : s.extension
|
|
@@ -3124,10 +3112,10 @@ const defaultMappers = {
|
|
|
3124
3112
|
}
|
|
3125
3113
|
};
|
|
3126
3114
|
// FIXME add edumedia support
|
|
3127
|
-
n(
|
|
3115
|
+
n(C, "roleMappers", [
|
|
3128
3116
|
(e) => Object.keys(defaultMappers).find((s) => defaultMappers[s](e))
|
|
3129
3117
|
]);
|
|
3130
|
-
let DocumentHelper =
|
|
3118
|
+
let DocumentHelper = C;
|
|
3131
3119
|
class WorkspaceService {
|
|
3132
3120
|
constructor(e) {
|
|
3133
3121
|
this.context = e;
|
|
@@ -3383,8 +3371,8 @@ class AnalyticsService {
|
|
|
3383
3371
|
if (!o || !o.LIBELLE_SERVICE || !r.UAI) return;
|
|
3384
3372
|
function a(h) {
|
|
3385
3373
|
let l = "";
|
|
3386
|
-
for (let
|
|
3387
|
-
l += h.charCodeAt(
|
|
3374
|
+
for (let E = 0; E < h.length; E++)
|
|
3375
|
+
l += h.charCodeAt(E);
|
|
3388
3376
|
return l;
|
|
3389
3377
|
}
|
|
3390
3378
|
const c = {
|
|
@@ -3409,7 +3397,7 @@ class AnalyticsService {
|
|
|
3409
3397
|
};
|
|
3410
3398
|
}
|
|
3411
3399
|
}
|
|
3412
|
-
const
|
|
3400
|
+
const R = class R {
|
|
3413
3401
|
// in minutes. Applies to recorded videos.
|
|
3414
3402
|
constructor(e) {
|
|
3415
3403
|
this.context = e;
|
|
@@ -3430,8 +3418,8 @@ const C = class C {
|
|
|
3430
3418
|
APP$4.VIDEO
|
|
3431
3419
|
);
|
|
3432
3420
|
return {
|
|
3433
|
-
maxWeight: (e == null ? void 0 : e["max-videosize-mbytes"]) ??
|
|
3434
|
-
maxDuration: (e == null ? void 0 : e["max-videoduration-minutes"]) ??
|
|
3421
|
+
maxWeight: (e == null ? void 0 : e["max-videosize-mbytes"]) ?? R.MAX_WEIGHT,
|
|
3422
|
+
maxDuration: (e == null ? void 0 : e["max-videoduration-minutes"]) ?? R.MAX_DURATION,
|
|
3435
3423
|
acceptVideoUploadExtensions: ((t = e == null ? void 0 : e["accept-videoupload-extensions"]) == null ? void 0 : t.map(
|
|
3436
3424
|
(s) => s.toUpperCase()
|
|
3437
3425
|
)) ?? []
|
|
@@ -3464,33 +3452,33 @@ const C = class C {
|
|
|
3464
3452
|
if (c.state == "running") {
|
|
3465
3453
|
let h = 0, l = 1;
|
|
3466
3454
|
do {
|
|
3467
|
-
const
|
|
3455
|
+
const E = l + h;
|
|
3468
3456
|
await new Promise(
|
|
3469
|
-
(
|
|
3470
|
-
), h = l, l = Math.min(8,
|
|
3471
|
-
const
|
|
3457
|
+
(d) => setTimeout(d, E * 1e3)
|
|
3458
|
+
), h = l, l = Math.min(8, E);
|
|
3459
|
+
const p = await this.http.get(
|
|
3472
3460
|
`/video/status/${c.processid}`
|
|
3473
3461
|
);
|
|
3474
|
-
if (
|
|
3475
|
-
return
|
|
3476
|
-
|
|
3462
|
+
if (p.state == "succeed")
|
|
3463
|
+
return p.videoworkspaceid && p.videosize && this.context.data().trackVideoSave(
|
|
3464
|
+
p.videoworkspaceid,
|
|
3477
3465
|
Math.round(r),
|
|
3478
|
-
|
|
3466
|
+
p.videosize,
|
|
3479
3467
|
s,
|
|
3480
3468
|
e.url,
|
|
3481
3469
|
i,
|
|
3482
3470
|
e.device
|
|
3483
|
-
),
|
|
3484
|
-
if (
|
|
3471
|
+
), p;
|
|
3472
|
+
if (p.state == "error")
|
|
3485
3473
|
break;
|
|
3486
3474
|
} while (!0);
|
|
3487
3475
|
}
|
|
3488
3476
|
throw new Error("Video cannot be uploaded.");
|
|
3489
3477
|
}
|
|
3490
3478
|
};
|
|
3491
|
-
n(
|
|
3492
|
-
n(
|
|
3493
|
-
let VideoService =
|
|
3479
|
+
n(R, "MAX_WEIGHT", 50), // in Mbytes. Applies to uploaded videos.
|
|
3480
|
+
n(R, "MAX_DURATION", 3);
|
|
3481
|
+
let VideoService = R;
|
|
3494
3482
|
class EmbedderService {
|
|
3495
3483
|
constructor(e) {
|
|
3496
3484
|
this.context = e;
|
|
@@ -3567,10 +3555,10 @@ class EmbedderService {
|
|
|
3567
3555
|
let l = t.split(c)[1];
|
|
3568
3556
|
if (!l)
|
|
3569
3557
|
continue;
|
|
3570
|
-
const
|
|
3571
|
-
|
|
3572
|
-
const
|
|
3573
|
-
o = o.replace(
|
|
3558
|
+
const E = s.split(a)[1].split("{")[0];
|
|
3559
|
+
E && (l = l.split(E)[0]);
|
|
3560
|
+
const p = new RegExp("\\" + a.replace(/}/, "\\}"), "g");
|
|
3561
|
+
o = o.replace(p, l);
|
|
3574
3562
|
}
|
|
3575
3563
|
return o;
|
|
3576
3564
|
}
|
|
@@ -4586,8 +4574,8 @@ class WidgetFramework {
|
|
|
4586
4574
|
});
|
|
4587
4575
|
const o = new Idiom();
|
|
4588
4576
|
this._widgets = this._widgets.sort((c, h) => {
|
|
4589
|
-
const l = o.translate(`timeline.settings.${c.platformConf.name}`).toLowerCase(),
|
|
4590
|
-
return l <
|
|
4577
|
+
const l = o.translate(`timeline.settings.${c.platformConf.name}`).toLowerCase(), E = o.translate(`timeline.settings.${h.platformConf.name}`).toLowerCase();
|
|
4578
|
+
return l < E ? -1 : l > E ? 1 : 0;
|
|
4591
4579
|
});
|
|
4592
4580
|
});
|
|
4593
4581
|
}
|
package/dist/rights/Service.d.ts
CHANGED
|
@@ -25,7 +25,7 @@ export declare class RightService {
|
|
|
25
25
|
*/
|
|
26
26
|
parseResourceRights(rights: RightStringified[]): ResourceRight[];
|
|
27
27
|
/**
|
|
28
|
-
* Check wether a user has the expected right for a
|
|
28
|
+
* Check wether a user has the expected right for a ressource
|
|
29
29
|
* @param user the userId and groupId concerned by the check
|
|
30
30
|
* @param expect the expected right to check
|
|
31
31
|
* @param rights array of Right for the resource
|
package/dist/share/Service.d.ts
CHANGED
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
import { IOdeServices } from '../services/OdeServices';
|
|
2
|
-
import { GetResourceRightPayload,
|
|
2
|
+
import { GetResourceRightPayload, PutShareResponse, ShareMapping, ShareRight, ShareRightAction, ShareRightActionDisplayName, ShareRightWithVisibles, ShareSubject } from './interface';
|
|
3
3
|
export declare class ShareService {
|
|
4
4
|
protected context: IOdeServices;
|
|
5
5
|
constructor(context: IOdeServices);
|
|
6
6
|
get directory(): import('../directory/Service').DirectoryService;
|
|
7
7
|
get http(): import('../transport/Service').HttpService;
|
|
8
8
|
get cache(): import('../cache/Service').CacheService;
|
|
9
|
-
searchShareSubjects(app: string, resourceId: string, searchText: string
|
|
10
|
-
getShareMapping(app: string
|
|
9
|
+
searchShareSubjects(app: string, resourceId: string, searchText: string): Promise<ShareSubject[]>;
|
|
10
|
+
getShareMapping(app: string): Promise<ShareMapping>;
|
|
11
11
|
getActionsAvailableFor({ id, type }: {
|
|
12
12
|
id: string;
|
|
13
13
|
type: 'user' | 'group';
|
|
14
14
|
}, payload: GetResourceRightPayload, mapping: ShareMapping): ShareRightActionDisplayName[];
|
|
15
|
-
getRightsForResource(app: string, resourceId: string
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
getActionsForApp(app: string, urlShareMapping?: string): Promise<ShareRightAction[]>;
|
|
15
|
+
getRightsForResource(app: string, resourceId: string): Promise<ShareRightWithVisibles>;
|
|
16
|
+
saveRights(app: string, resourceId: string, rights: ShareRight[]): Promise<PutShareResponse>;
|
|
17
|
+
getActionsForApp(app: string): Promise<ShareRightAction[]>;
|
|
19
18
|
}
|