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