react-ecosistema-unp 2.5.0 → 2.6.1

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.
Files changed (62) hide show
  1. package/README.md +354 -25
  2. package/dist/{AppList-DORGpC4I.js → AppList-CNtk-CBh.js} +56 -55
  3. package/dist/auth/hooks/useFinalizarSesion.js +12 -12
  4. package/dist/auth/services/FinSesionService.js +10 -11
  5. package/dist/cards/tarjeta/nuevo-elemento/NuevoElemento.js +1 -1
  6. package/dist/cards/tarjeta-info/TarjetaInfo.js +1 -1
  7. package/dist/data/tarjeta-datos/TarjetaDatos.js +1 -1
  8. package/dist/{index-BqaJxgOF.js → index-HaNVi1BU.js} +8 -8
  9. package/dist/lib/accessibility/barra-accesibilidad/BarraAccesibilidad.d.ts +1 -1
  10. package/dist/lib/assets/animations/loadingDuck.json.d.ts +1 -1
  11. package/dist/lib/utils/logger/logger.d.ts +25 -0
  12. package/dist/lib/utils/modal-radicados/ModalDocumento.d.ts +1 -1
  13. package/dist/lib/utils/sanitizar-html/sanitizarHtml.d.ts +12 -0
  14. package/dist/loadingDuck-Deggug5u.js +27 -0
  15. package/dist/shared/app-list/AppList.js +4 -3
  16. package/dist/shared/iconos-sistema/IconosSistema.js +1 -1
  17. package/dist/shared/iconos-sistema/logout-button/LogoutButton.js +1 -1
  18. package/dist/shared/menu-lateral/MenuLateral.js +5 -3
  19. package/dist/shared/notificacion-usuario/NotificacionUsuario.js +194 -745
  20. package/dist/shared/notificacion-usuario/services/notificacionesService.js +52 -51
  21. package/dist/shared/user-profile-icon/UserProfileIcon.js +17 -17
  22. package/dist/shared/ventana-tabs/VentanaTabs.js +1 -1
  23. package/dist/tables/custom-data-table/CustomDataTable.js +4 -2
  24. package/dist/tables/custom-data-table-split/CustomDataTableSplit.js +4 -2
  25. package/dist/tables/eco-data-table/components/EcoBandejaEncabezado.js +3 -2
  26. package/dist/tables/eco-data-table/components/EcoDataTable/EcoDataTable.js +1 -1
  27. package/dist/tables/tabla-registros/buscador/Buscador.js +1 -1
  28. package/dist/tables/tabla-registros/encabezado-tabla/EncabezadoTabla.js +3 -2
  29. package/dist/tables/tabla-registros/modal-v2/EcoModal.js +1 -1
  30. package/dist/tables/tabla-registros/tabla/Tabla.js +1 -1
  31. package/dist/ui/alertas/AlertaFormulario.js +1 -1
  32. package/dist/ui/animacion/Animacion.js +1 -1
  33. package/dist/ui/contenido-modal/ContenidoModal.js +1 -1
  34. package/dist/ui/contenido-modal/ContenidoModalv0.1.js +1 -1
  35. package/dist/ui/contenido-modal-v2/ContenidoModalV2.js +1 -1
  36. package/dist/ui/contenido-modal-v2/ModalV2Menu.js +1 -1
  37. package/dist/ui/icono-tooltip/IconoTooltip.js +1 -1
  38. package/dist/ui/items-modal/ItemsModal.js +1 -1
  39. package/dist/ui/nav-formularios-lateral/NavFormulariosLateral.js +1 -1
  40. package/dist/ui/notificacion-popover-v2/NotificacionPopoverV2.js +80 -79
  41. package/dist/ui/status-filter-bar/StatusFilterBar.js +1 -1
  42. package/dist/ui/status-semaphore/StatusSemaphore.js +1 -1
  43. package/dist/ui/stepper-v2/StepperV2.js +1 -1
  44. package/dist/utils/components/ProtectedRoute.js +25 -26
  45. package/dist/utils/components/UserRoute.js +14 -16
  46. package/dist/utils/eco-provider/EcoContext.js +4 -2
  47. package/dist/utils/fetch-data/useFetchData.js +60 -59
  48. package/dist/utils/logger/logger.js +20 -0
  49. package/dist/utils/modal-radicados/AuxRadicadosComponents/TarjetaRadicado.js +20 -18
  50. package/dist/utils/modal-radicados/DocumentoVisorEstado.js +4 -3
  51. package/dist/utils/modal-radicados/ModalDocumento.js +1 -1
  52. package/dist/utils/modal-radicados/ModalRadicado.js +82 -80
  53. package/dist/utils/sanitizar-html/sanitizarHtml.js +1486 -0
  54. package/dist/utils/unp-historico/FetchHistorico.js +6 -5
  55. package/dist/utils/unp-historico/UnpHistorico.js +3 -2
  56. package/dist/utils/websocket-manager/websocket.js +19 -18
  57. package/package.json +28 -19
  58. package/dist/lib/utils/fetch/fetchInterceptor.d.ts +0 -7
  59. package/dist/lib/utils/fetch/fingerprintService.d.ts +0 -27
  60. package/dist/loadingDuck-Diu5KD6X.js +0 -27
  61. package/dist/utils/fetch/fetchInterceptor.js +0 -98
  62. package/dist/utils/fetch/fingerprintService.js +0 -1749
@@ -1,80 +1,81 @@
1
- import { getUserToken as c } from "../../../auth/services/User.js";
2
- const t = () => `${window.location.protocol}//${window.location.host}/api-gateway`, r = () => ({
3
- Authorization: `Bearer ${c()}`,
1
+ import { getUserToken as l } from "../../../auth/services/User.js";
2
+ import { logger as r } from "../../../utils/logger/logger.js";
3
+ const e = () => `${window.location.protocol}//${window.location.host}/api-gateway`, n = () => ({
4
+ Authorization: `Bearer ${l()}`,
4
5
  "BK-Service": "api-noti"
5
- }), n = () => {
6
- var e;
7
- const a = localStorage.getItem("auth_state"), o = a ? JSON.parse(a) : null;
8
- return ((e = o == null ? void 0 : o.user) == null ? void 0 : e.id_busuario) || "";
9
- }, i = async (a) => {
10
- const o = a.headers.get("content-type");
11
- return o && o.indexOf("application/json") !== -1 ? await a.json() : null;
12
- }, d = async () => {
6
+ }), i = () => {
7
+ var o;
8
+ const t = localStorage.getItem("auth_state"), a = t ? JSON.parse(t) : null;
9
+ return ((o = a == null ? void 0 : a.user) == null ? void 0 : o.id_busuario) || "";
10
+ }, s = async (t) => {
11
+ const a = t.headers.get("content-type");
12
+ return a && a.indexOf("application/json") !== -1 ? await t.json() : null;
13
+ }, h = async () => {
13
14
  try {
14
- const a = await fetch(`${t()}/usuarios/${n()}/notificaciones/count-unread?medio=1`, {
15
- headers: r()
15
+ const t = await fetch(`${e()}/usuarios/${i()}/notificaciones/count-unread?medio=1`, {
16
+ headers: n()
16
17
  });
17
- if (!a.ok) return 0;
18
- const o = await i(a);
19
- return o ? o.count : 0;
18
+ if (!t.ok) return 0;
19
+ const a = await s(t);
20
+ return a ? a.count : 0;
20
21
  } catch {
21
22
  return 0;
22
23
  }
23
- }, f = async (a, o = 1) => {
24
+ }, m = async (t, a = 1) => {
24
25
  try {
25
- let e = `${t()}/usuarios/${n()}/notificaciones?page=${o}&medio=1`;
26
- a !== void 0 && (e += `&leida=${a}`);
27
- const s = await fetch(e, { headers: r() });
28
- return s.ok ? await i(s) || { count: 0, next: null, previous: null, results: [] } : { count: 0, next: null, previous: null, results: [] };
26
+ let o = `${e()}/usuarios/${i()}/notificaciones?page=${a}&medio=1`;
27
+ t !== void 0 && (o += `&leida=${t}`);
28
+ const c = await fetch(o, { headers: n() });
29
+ return c.ok ? await s(c) || { count: 0, next: null, previous: null, results: [] } : { count: 0, next: null, previous: null, results: [] };
29
30
  } catch {
30
31
  return { count: 0, next: null, previous: null, results: [] };
31
32
  }
32
- }, h = async (a) => {
33
+ }, $ = async (t) => {
33
34
  try {
34
- const o = await fetch(`${t()}/usuarios/${n()}/notificaciones/${a}/marcar-leida/`, {
35
+ const a = await fetch(`${e()}/usuarios/${i()}/notificaciones/${t}/marcar-leida/`, {
35
36
  method: "POST",
36
- headers: r()
37
- }), e = await i(o);
38
- e && console.log(e.detail);
37
+ headers: n()
38
+ }), o = await s(a);
39
+ o && r.log(o.detail);
39
40
  } catch {
40
- console.error("Error al marcar como leída");
41
+ r.error("Error al marcar como leída");
41
42
  }
42
- }, m = async (a) => {
43
+ }, p = async (t) => {
43
44
  try {
44
- const o = await fetch(`${t()}/usuarios/${n()}/notificaciones/${a}/marcar-no-leida/`, {
45
+ const a = await fetch(`${e()}/usuarios/${i()}/notificaciones/${t}/marcar-no-leida/`, {
45
46
  method: "POST",
46
- headers: r()
47
- }), e = await i(o);
48
- e && console.log(e.detail);
47
+ headers: n()
48
+ }), o = await s(a);
49
+ o && r.log(o.detail);
49
50
  } catch {
50
- console.error("Error al marcar como no leída");
51
+ r.error("Error al marcar como no leída");
51
52
  }
52
- }, $ = async (a) => {
53
+ }, w = async (t) => {
53
54
  try {
54
- const o = await fetch(`${t()}/usuarios/${n()}/notificaciones/${a}/eliminar/`, {
55
+ const a = await fetch(`${e()}/usuarios/${i()}/notificaciones/${t}/eliminar/`, {
55
56
  method: "POST",
56
- headers: r()
57
- }), e = await i(o);
58
- e && console.log(e.detail);
57
+ headers: n()
58
+ }), o = await s(a);
59
+ o && r.log(o.detail);
59
60
  } catch {
60
- console.error("Error al eliminar la notificación");
61
+ r.error("Error al eliminar la notificación");
61
62
  }
62
- }, w = async () => {
63
+ }, g = async () => {
63
64
  try {
64
- const a = await fetch(`${t()}/usuarios/${n()}/notificaciones/eliminar-leidas/`, {
65
+ const t = await fetch(`${e()}/usuarios/${i()}/notificaciones/eliminar-leidas/`, {
65
66
  method: "POST",
66
- headers: r()
67
- }), o = await i(a);
68
- o && console.log(o.detail);
67
+ headers: n()
68
+ }), a = await s(t);
69
+ a && r.log(a.detail);
69
70
  } catch {
70
- console.error("Error al eliminar las notificaciones leídas");
71
+ r.error("Error al eliminar las notificaciones leídas");
71
72
  }
72
73
  };
73
74
  export {
74
- $ as eliminarNotificacion,
75
- w as eliminarNotificacionesLeidas,
76
- f as getNotificaciones,
77
- d as getUnreadCount,
78
- h as marcarLeida,
79
- m as marcarNoLeida
75
+ w as eliminarNotificacion,
76
+ g as eliminarNotificacionesLeidas,
77
+ m as getNotificaciones,
78
+ h as getUnreadCount,
79
+ $ as marcarLeida,
80
+ p as marcarNoLeida
80
81
  };