@edifice.io/client 2.5.2-develop-b2school-actualites.20251127174432 → 2.5.2-develop-b2school-actualites.20251201115331

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.js CHANGED
@@ -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((h) => h.name === o);
973
+ const c = this._me.apps.find((l) => l.name === o);
974
974
  if (c) {
975
- const h = Object.assign({}, c);
976
- this._bookmarkedApps.push(h);
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 h of t.structures) {
1084
- const l = e.structureMap[h];
1085
- if (l && l.collectiviteId && l.UAI) {
1086
- r = l;
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(h) {
1098
- let l = "";
1099
- for (let p = 0; p < h.length; p++)
1100
- l += h.charCodeAt(p);
1101
- return l;
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 = (h) => (h < 10 ? "0" : "") + h.toFixed(0), i = /* @__PURE__ */ new Date(), o = i.getFullYear(), a = i.getMonth() + 1, c = i.getDate();
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;
@@ -1912,11 +1912,11 @@ class ConfService {
1912
1912
  // Else get the theme from the user preference
1913
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, h = i == null ? void 0 : i.bootstrapVersion.split("-").slice(-1)[0], l = (i == null ? void 0 : i.parent) === "panda";
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: h,
1919
- is1d: l,
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: h }) => ({
1973
- nbUsers: h,
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: h }) => ({
1978
- profile: h,
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: "",
@@ -2001,17 +2001,17 @@ class DirectoryService {
2001
2001
  };
2002
2002
  } else
2003
2003
  return Promise.resolve(d);
2004
- }), h = (await Promise.all(a)).map((d) => d.members).reduce((d, b) => [...d, ...b], []), l = {
2004
+ }), l = (await Promise.all(a)).map((d) => d.members).reduce((d, b) => [...d, ...b], []), h = {
2005
2005
  name: e,
2006
- members: [...i, ...o, ...h]
2006
+ members: [...i, ...o, ...l]
2007
2007
  }, { id: p } = await this.http.postJson(
2008
2008
  "/directory/sharebookmark",
2009
- l
2009
+ h
2010
2010
  );
2011
2011
  return {
2012
2012
  id: p,
2013
2013
  displayName: e,
2014
- members: l.members
2014
+ members: h.members
2015
2015
  };
2016
2016
  }
2017
2017
  }
@@ -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
- (h) => h.name === o
2559
+ (l) => l.name === o
2560
2560
  );
2561
2561
  if (c) {
2562
- const h = Object.assign({}, c);
2563
- i.push(h);
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, h;
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"] : ((h = (c = a == null ? void 0 : a.result) == null ? void 0 : c[0]) == null ? void 0 : h.type) || ["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();
@@ -2944,18 +2944,21 @@ class ShareService {
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 h of a)
2948
- r[h].filter(
2947
+ for (const l of a)
2948
+ r[l].filter(
2949
2949
  (d) => o.includes(d)
2950
- ).length > 0 && c.push(h);
2950
+ ).length > 0 && c.push(l);
2951
2951
  return c;
2952
2952
  }
2953
2953
  async getRightsForResource(e, t, s) {
2954
2954
  const r = await this.directory.getBookMarks(), i = `/${e}/share/json/${t}?search=`, o = await this.cache.httpGetJson(
2955
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(
2956
+ ), a = await this.getShareMapping(
2957
+ e,
2958
+ s == null ? void 0 : s.getShareMapping
2959
+ ), c = await this.cache.httpGetJson(
2957
2960
  "/infra/public/json/sharing-rights.json"
2958
- ), h = Object.keys(o.users.checked).map((E) => o.users.visibles.find(
2961
+ ), l = Object.keys(o.users.checked).map((E) => o.users.visibles.find(
2959
2962
  (A) => A.id === E
2960
2963
  )).filter((E) => E !== void 0).map((E) => {
2961
2964
  const g = this.getActionsAvailableFor(
@@ -2979,7 +2982,7 @@ class ShareService {
2979
2982
  };
2980
2983
  })
2981
2984
  };
2982
- }).sort((E, g) => (E.displayName || "").localeCompare(g.displayName)), l = Object.keys(o.groups.checked).map((E) => o.groups.visibles.find(
2985
+ }).sort((E, g) => (E.displayName || "").localeCompare(g.displayName)), h = Object.keys(o.groups.checked).map((E) => o.groups.visibles.find(
2983
2986
  (A) => A.id === E
2984
2987
  )).filter((E) => E !== void 0).map((E) => {
2985
2988
  const g = this.getActionsAvailableFor(
@@ -3003,7 +3006,7 @@ class ShareService {
3003
3006
  };
3004
3007
  })
3005
3008
  };
3006
- }).sort((E, g) => (E.displayName || "").localeCompare(g.displayName)), p = [...h, ...l], d = o.groups.visibles.map(
3009
+ }).sort((E, g) => (E.displayName || "").localeCompare(g.displayName)), p = [...l, ...h], d = o.groups.visibles.map(
3007
3010
  ({ groupDisplayName: E, id: g, name: A, labels: f }) => ({
3008
3011
  labels: f,
3009
3012
  displayName: E || A,
@@ -3033,7 +3036,7 @@ class ShareService {
3033
3036
  bookmarks: {}
3034
3037
  }, i = await this.getShareMapping(e, s);
3035
3038
  for (const o of t) {
3036
- const a = o.actions.map((h) => i[h.id]).reduce((h, l) => Array.isArray(l) ? [...h, ...l] : h, []), c = [...new Set(a)];
3039
+ const a = o.actions.map((l) => i[l.id]).reduce((l, h) => Array.isArray(h) ? [...l, ...h] : l, []), c = [...new Set(a)];
3037
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);
3038
3041
  }
3039
3042
  return r;
@@ -3217,7 +3220,7 @@ class WorkspaceService {
3217
3220
  throw this.http.latestResponse.statusText;
3218
3221
  return r.forEach((o, a) => {
3219
3222
  const c = e.findIndex(
3220
- (h) => h._id === o._id
3223
+ (l) => l._id === o._id
3221
3224
  );
3222
3225
  0 <= c && c < e.length && (e[c] = i[a]);
3223
3226
  }), e.filter((o) => !!o);
@@ -3236,8 +3239,8 @@ class WorkspaceService {
3236
3239
  {
3237
3240
  const a = `/workspace/${e.public ? "pub/" : ""}document/${e._id}?thumbnail=`, c = e.thumbnails;
3238
3241
  if ((o = (i = e.metadata) == null ? void 0 : i["content-type"]) != null && o.includes("video")) {
3239
- const h = c && Object.keys(c).length > 0 ? Object.keys(c)[0] : null;
3240
- return h ? a + h : null;
3242
+ const l = c && Object.keys(c).length > 0 ? Object.keys(c)[0] : null;
3243
+ return l ? a + l : null;
3241
3244
  } else
3242
3245
  return a + r;
3243
3246
  }
@@ -3369,10 +3372,10 @@ class AnalyticsService {
3369
3372
  const t = await this.session.getUser(), s = await this.session.getUserProfile();
3370
3373
  let r;
3371
3374
  if (!(t != null && t.structures)) return;
3372
- for (const h of t.structures) {
3373
- const l = u.structureMap[h];
3374
- if (l && l.collectiviteId && l.UAI) {
3375
- r = l;
3375
+ for (const l of t.structures) {
3376
+ const h = u.structureMap[l];
3377
+ if (h && h.collectiviteId && h.UAI) {
3378
+ r = h;
3376
3379
  break;
3377
3380
  }
3378
3381
  }
@@ -3381,11 +3384,11 @@ class AnalyticsService {
3381
3384
  if (!i) return;
3382
3385
  const o = i.xiti;
3383
3386
  if (!o || !o.LIBELLE_SERVICE || !r.UAI) return;
3384
- function a(h) {
3385
- let l = "";
3386
- for (let p = 0; p < h.length; p++)
3387
- l += h.charCodeAt(p);
3388
- return l;
3387
+ function a(l) {
3388
+ let h = "";
3389
+ for (let p = 0; p < l.length; p++)
3390
+ h += l.charCodeAt(p);
3391
+ return h;
3389
3392
  }
3390
3393
  const c = {
3391
3394
  Student: "ELEVE",
@@ -3462,12 +3465,12 @@ const C = class C {
3462
3465
  { headers: { "Content-Type": "multipart/form-data" } }
3463
3466
  );
3464
3467
  if (c.state == "running") {
3465
- let h = 0, l = 1;
3468
+ let l = 0, h = 1;
3466
3469
  do {
3467
- const p = l + h;
3470
+ const p = h + l;
3468
3471
  await new Promise(
3469
3472
  (b) => setTimeout(b, p * 1e3)
3470
- ), h = l, l = Math.min(8, p);
3473
+ ), l = h, h = Math.min(8, p);
3471
3474
  const d = await this.http.get(
3472
3475
  `/video/status/${c.processid}`
3473
3476
  );
@@ -3527,10 +3530,10 @@ class EmbedderService {
3527
3530
  const s = new RegExp("[^{}]+(?=(?:[^{}]*{[^}]*})*[^}]*$)", "g"), r = new RegExp("{[^}]*}", "g");
3528
3531
  let i = !0;
3529
3532
  const o = t.match(s) || [], a = [];
3530
- return (t.match(r) || []).forEach((h, l) => {
3531
- h.includes("ignore") || a.push(o[l]);
3532
- }), a.forEach((h) => {
3533
- if (!e.includes(h)) {
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)) {
3534
3537
  i = !1;
3535
3538
  return;
3536
3539
  }
@@ -3562,15 +3565,15 @@ class EmbedderService {
3562
3565
  let o = e.embed;
3563
3566
  for (const a of i) {
3564
3567
  let c = s.split(a)[0];
3565
- const h = c.split("}");
3566
- h.length > 1 && (c = h[h.length - 1]);
3567
- let l = t.split(c)[1];
3568
- if (!l)
3568
+ const l = c.split("}");
3569
+ l.length > 1 && (c = l[l.length - 1]);
3570
+ let h = t.split(c)[1];
3571
+ if (!h)
3569
3572
  continue;
3570
3573
  const p = s.split(a)[1].split("{")[0];
3571
- p && (l = l.split(p)[0]);
3574
+ p && (h = h.split(p)[0]);
3572
3575
  const d = new RegExp("\\" + a.replace(/}/, "\\}"), "g");
3573
- o = o.replace(d, l);
3576
+ o = o.replace(d, h);
3574
3577
  }
3575
3578
  return o;
3576
3579
  }
@@ -3999,17 +4002,17 @@ class WorkspaceBehaviour extends AbstractBehaviourService {
3999
4002
  try {
4000
4003
  let o = "/workspace/documents?filter=all&hierarchical=true";
4001
4004
  s && s.length ? o += `&search=${t}` : t && t.length && (o += `&search=${t}`);
4002
- const c = (await this.httpGet(o)).filter((h) => !h.deleted).map((h) => {
4003
- const l = h.metadata["content-type"] && h.metadata["content-type"].indexOf("image") !== -1 ? `/workspace/document/${h._id}?thumbnail=120x120` : "/img/icons/unknown-large.png";
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";
4004
4007
  return this.dataToResource({
4005
- title: h.name,
4006
- ownerName: h.ownerName,
4007
- owner: h.owner,
4008
- icon: l,
4009
- path: `/workspace/document/${h._id}`,
4010
- _id: h._id,
4011
- shared: !!(h.shared && h.shared.length >= 0),
4012
- modified: h.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
4013
4016
  });
4014
4017
  });
4015
4018
  r(c);
@@ -4576,18 +4579,18 @@ class WidgetFramework {
4576
4579
  t.listSkins().then((r) => {
4577
4580
  var a;
4578
4581
  const i = ((a = r.find((c) => c.child === t.skin)) == null ? void 0 : a.parent) === "panda" ? secondLevelWidgets : firstLevelWidgets;
4579
- this._widgets = this._widgets.filter((c, h) => {
4580
- const l = c.platformConf.name;
4581
- return i.indexOf(l) !== -1 ? !1 : (this._userPrefs[l] || (this._userPrefs[l] = {
4582
- index: defaultWidgetOrder[l] ?? 999,
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,
4583
4586
  show: !0,
4584
4587
  position: c.platformConf.position
4585
- }), 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);
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);
4586
4589
  });
4587
4590
  const o = new Idiom();
4588
- this._widgets = this._widgets.sort((c, h) => {
4589
- const l = o.translate(`timeline.settings.${c.platformConf.name}`).toLowerCase(), p = o.translate(`timeline.settings.${h.platformConf.name}`).toLowerCase();
4590
- return l < p ? -1 : l > p ? 1 : 0;
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;
4591
4594
  });
4592
4595
  });
4593
4596
  }
@@ -12,7 +12,7 @@ export declare class ShareService {
12
12
  id: string;
13
13
  type: 'user' | 'group';
14
14
  }, payload: GetResourceRightPayload, mapping: ShareMapping): ShareRightActionDisplayName[];
15
- getRightsForResource(app: string, resourceId: string, urls?: ShareUrls): Promise<ShareRightWithVisibles>;
15
+ getRightsForResource(app: string, resourceId: string, shareUrls?: ShareUrls): Promise<ShareRightWithVisibles>;
16
16
  getPutSharePayload(app: string, rights: ShareRight[], urlGetShareMapping?: string): Promise<PutSharePayload>;
17
17
  saveRights(app: string, resourceId: string, rights: ShareRight[], urls?: ShareUrls): Promise<PutShareResponse>;
18
18
  getActionsForApp(app: string, urlShareMapping?: string): Promise<ShareRightAction[]>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@edifice.io/client",
3
- "version": "2.5.2-develop-b2school-actualites.20251127174432",
3
+ "version": "2.5.2-develop-b2school-actualites.20251201115331",
4
4
  "description": "Edifice TypeScript Client",
5
5
  "keywords": [
6
6
  "typescript",
@@ -36,7 +36,7 @@
36
36
  "dependencies": {
37
37
  "axios": "^1.7.7",
38
38
  "core-js": "^3.35.1",
39
- "@edifice.io/utilities": "2.5.2-develop-b2school-actualites.20251127174432"
39
+ "@edifice.io/utilities": "2.5.2-develop-b2school-actualites.20251201115331"
40
40
  },
41
41
  "devDependencies": {
42
42
  "@types/jasmine": "5.1.4",
@@ -48,7 +48,7 @@
48
48
  "typedoc-plugin-markdown": "3.17.1",
49
49
  "vite": "^5.4.11",
50
50
  "vite-plugin-dts": "^4.1.0",
51
- "@edifice.io/config": "2.5.2-develop-b2school-actualites.20251127174432"
51
+ "@edifice.io/config": "2.5.2-develop-b2school-actualites.20251201115331"
52
52
  },
53
53
  "scripts": {
54
54
  "build": "vite build",