utn-cli 1.0.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/commands/backend.js +282 -0
- package/commands/db.js +49 -0
- package/commands/frontend.js +225 -0
- package/index.js +98 -0
- package/package.json +27 -0
- package/templates/backend/InformacionDelModulo.json +21 -0
- package/templates/backend/NOMBRE_DEL_CANONICO_DEL_PROYECTO.rest +74 -0
- package/templates/backend/README.md +0 -0
- package/templates/backend/gitignore +3 -0
- package/templates/backend/index.rest +288 -0
- package/templates/backend/package.json +30 -0
- package/templates/backend/reporte.pdf +0 -0
- package/templates/backend/rutas/API.js +49 -0
- package/templates/backend/rutas/Servicio1.js +184 -0
- package/templates/backend/rutas/misc.js +671 -0
- package/templates/backend/rutas/rutas.js +11 -0
- package/templates/backend/server.js +79 -0
- package/templates/backend/servicios/API.js +101 -0
- package/templates/backend/servicios/InformacionDelModulo.js +70 -0
- package/templates/backend/servicios/Nucleo/EnvioDeCorreos.js +45 -0
- package/templates/backend/servicios/Nucleo/ManejadorDeErrores.js +54 -0
- package/templates/backend/servicios/Nucleo/Miscelaneas.js +1901 -0
- package/templates/backend/servicios/Nucleo/Monitoreo.js +65 -0
- package/templates/backend/servicios/Nucleo/db.js +78 -0
- package/templates/backend/servicios/Servicio1.js +118 -0
- package/templates/backend/variables-calidad.env +6 -0
- package/templates/backend/variables-desarrollo.env +6 -0
- package/templates/backend/variables-pruebas.env +6 -0
- package/templates/bd/README.md +78 -0
- package/templates/bd/cumulodb-scripts/gitignore +1 -0
- package/templates/bd/docker-compose.yml +28 -0
- package/templates/bd/docker-scripts/1-crear estructura.sql +29 -0
- package/templates/bd/docker-scripts/2-cambios estructura original.sql +1 -0
- package/templates/bd/docker-scripts/3-insertar datos de prueba.sql +1 -0
- package/templates/bd/docker-scripts/4-crear eventos y rutinas.sql +1 -0
- package/templates/bd/docker-scripts/5-crear vistas.sql +1 -0
- package/templates/bd/docker-scripts/6-calidad.sql +1 -0
- package/templates/bd/docker-scripts/7-pruebas.sql +1 -0
- package/templates/bd/docker-scripts/8-local.sql +1 -0
- package/templates/bd/servidores-scripts/calidad.sql +1 -0
- package/templates/bd/servidores-scripts/datos_iniciales_produccion.sql +1 -0
- package/templates/bd/servidores-scripts/produccion.sql +1 -0
- package/templates/bd/servidores-scripts/pruebas.sql +1 -0
- package/templates/frontend/.vscode/extensions.json +4 -0
- package/templates/frontend/.vscode/launch.json +20 -0
- package/templates/frontend/.vscode/tasks.json +42 -0
- package/templates/frontend/Dockerfile +5 -0
- package/templates/frontend/README.md +59 -0
- package/templates/frontend/angular.json +101 -0
- package/templates/frontend/dist/frontend/3rdpartylicenses.txt +459 -0
- package/templates/frontend/dist/frontend/prerendered-routes.json +3 -0
- package/templates/frontend/docker-compose.yml +5 -0
- package/templates/frontend/editorconfig +17 -0
- package/templates/frontend/gitignore +45 -0
- package/templates/frontend/nginx.conf +12 -0
- package/templates/frontend/package.json +46 -0
- package/templates/frontend/public/favicon.ico +0 -0
- package/templates/frontend/src/app/Componentes/Nucleo/graficos/graficos.component.css +15 -0
- package/templates/frontend/src/app/Componentes/Nucleo/graficos/graficos.component.html +25 -0
- package/templates/frontend/src/app/Componentes/Nucleo/graficos/graficos.component.ts +80 -0
- package/templates/frontend/src/app/Componentes/Nucleo/iframe/iframe.ts +37 -0
- package/templates/frontend/src/app/Componentes/Nucleo/mensaje-confirmacion/mensaje-confirmacion.component.css +5 -0
- package/templates/frontend/src/app/Componentes/Nucleo/mensaje-confirmacion/mensaje-confirmacion.component.html +22 -0
- package/templates/frontend/src/app/Componentes/Nucleo/mensaje-confirmacion/mensaje-confirmacion.ts +64 -0
- package/templates/frontend/src/app/Componentes/Nucleo/mensaje-confirmacion-html/mensaje-confirmacion-html.component.css +5 -0
- package/templates/frontend/src/app/Componentes/Nucleo/mensaje-confirmacion-html/mensaje-confirmacion-html.component.html +22 -0
- package/templates/frontend/src/app/Componentes/Nucleo/mensaje-confirmacion-html/mensaje-confirmacion-html.ts +64 -0
- package/templates/frontend/src/app/Componentes/Nucleo/mensaje-informacion/mensaje-informacion.component.css +5 -0
- package/templates/frontend/src/app/Componentes/Nucleo/mensaje-informacion/mensaje-informacion.component.html +11 -0
- package/templates/frontend/src/app/Componentes/Nucleo/mensaje-informacion/mensaje-informacion.ts +46 -0
- package/templates/frontend/src/app/Componentes/Nucleo/mensajes/mensajes.component.css +11 -0
- package/templates/frontend/src/app/Componentes/Nucleo/mensajes/mensajes.component.html +17 -0
- package/templates/frontend/src/app/Componentes/Nucleo/mensajes/mensajes.component.ts +43 -0
- package/templates/frontend/src/app/Componentes/Nucleo/reporte-de-incidencias/reporte-de-incidencias.component.css +37 -0
- package/templates/frontend/src/app/Componentes/Nucleo/reporte-de-incidencias/reporte-de-incidencias.component.html +35 -0
- package/templates/frontend/src/app/Componentes/Nucleo/reporte-de-incidencias/reporte-de-incidencias.component.ts +103 -0
- package/templates/frontend/src/app/Componentes/Nucleo/subir-archivo/subir-archivo.component.css +90 -0
- package/templates/frontend/src/app/Componentes/Nucleo/subir-archivo/subir-archivo.component.html +39 -0
- package/templates/frontend/src/app/Componentes/Nucleo/subir-archivo/subir-archivo.component.ts +132 -0
- package/templates/frontend/src/app/Componentes/Nucleo/tabla/paginador-personalizado.ts +17 -0
- package/templates/frontend/src/app/Componentes/Nucleo/tabla/tabla.component.css +332 -0
- package/templates/frontend/src/app/Componentes/Nucleo/tabla/tabla.component.html +166 -0
- package/templates/frontend/src/app/Componentes/Nucleo/tabla/tabla.component.ts +228 -0
- package/templates/frontend/src/app/Componentes/Nucleo/tarjeta/tarjeta.component.css +129 -0
- package/templates/frontend/src/app/Componentes/Nucleo/tarjeta/tarjeta.component.html +35 -0
- package/templates/frontend/src/app/Componentes/Nucleo/tarjeta/tarjeta.component.ts +46 -0
- package/templates/frontend/src/app/Componentes/Nucleo/tarjeta-modulo/tarjeta-modulo.component.css +92 -0
- package/templates/frontend/src/app/Componentes/Nucleo/tarjeta-modulo/tarjeta-modulo.component.html +17 -0
- package/templates/frontend/src/app/Componentes/Nucleo/tarjeta-modulo/tarjeta-modulo.component.ts +42 -0
- package/templates/frontend/src/app/Componentes/Nucleo/tarjeta-multiple/tarjeta-multiple.component.css +90 -0
- package/templates/frontend/src/app/Componentes/Nucleo/tarjeta-multiple/tarjeta-multiple.component.html +22 -0
- package/templates/frontend/src/app/Componentes/Nucleo/tarjeta-multiple/tarjeta-multiple.component.ts +46 -0
- package/templates/frontend/src/app/Componentes/Nucleo/tarjeta-reporte/tarjeta-reporte.component.css +129 -0
- package/templates/frontend/src/app/Componentes/Nucleo/tarjeta-reporte/tarjeta-reporte.component.html +20 -0
- package/templates/frontend/src/app/Componentes/Nucleo/tarjeta-reporte/tarjeta-reporte.component.ts +25 -0
- package/templates/frontend/src/app/Componentes/guardar-incapacidad/guardar-incapacidad.component.css +20 -0
- package/templates/frontend/src/app/Componentes/guardar-incapacidad/guardar-incapacidad.component.html +46 -0
- package/templates/frontend/src/app/Componentes/guardar-incapacidad/guardar-incapacidad.component.ts +64 -0
- package/templates/frontend/src/app/Paginas/Nucleo/contenedor-componentes/contenedor-componentes.component.css +142 -0
- package/templates/frontend/src/app/Paginas/Nucleo/contenedor-componentes/contenedor-componentes.component.html +90 -0
- package/templates/frontend/src/app/Paginas/Nucleo/contenedor-componentes/contenedor-componentes.component.ts +139 -0
- package/templates/frontend/src/app/Paginas/contenedor-principal/contenedor-principal.component.css +4 -0
- package/templates/frontend/src/app/Paginas/contenedor-principal/contenedor-principal.component.html +17 -0
- package/templates/frontend/src/app/Paginas/contenedor-principal/contenedor-principal.component.ts +36 -0
- package/templates/frontend/src/app/Paginas/gestion-de-reportes/gestion-de-reportes.component.css +4 -0
- package/templates/frontend/src/app/Paginas/gestion-de-reportes/gestion-de-reportes.component.html +6 -0
- package/templates/frontend/src/app/Paginas/gestion-de-reportes/gestion-de-reportes.component.ts +36 -0
- package/templates/frontend/src/app/Paginas/gestion-graficos/gestion-graficos.component.css +13 -0
- package/templates/frontend/src/app/Paginas/gestion-graficos/gestion-graficos.component.html +13 -0
- package/templates/frontend/src/app/Paginas/gestion-graficos/gestion-graficos.component.ts +75 -0
- package/templates/frontend/src/app/Paginas/gestion-iframe1/gestion-iframe1.component.css +13 -0
- package/templates/frontend/src/app/Paginas/gestion-iframe1/gestion-iframe1.component.html +3 -0
- package/templates/frontend/src/app/Paginas/gestion-iframe1/gestion-iframe1.component.ts +14 -0
- package/templates/frontend/src/app/Paginas/gestion-tabla/gestion-tabla.component.css +13 -0
- package/templates/frontend/src/app/Paginas/gestion-tabla/gestion-tabla.component.html +24 -0
- package/templates/frontend/src/app/Paginas/gestion-tabla/gestion-tabla.component.ts +300 -0
- package/templates/frontend/src/app/Paginas/gestion-tabla-XYZ/gestion-tabla-XYZ.component.css +13 -0
- package/templates/frontend/src/app/Paginas/gestion-tabla-XYZ/gestion-tabla-XYZ.component.html +43 -0
- package/templates/frontend/src/app/Paginas/gestion-tabla-XYZ/gestion-tabla-XYZ.component.ts +305 -0
- package/templates/frontend/src/app/Paginas/gestion-tabla-jefe/gestion-tabla-jefe.component.css +13 -0
- package/templates/frontend/src/app/Paginas/gestion-tabla-jefe/gestion-tabla-jefe.component.html +25 -0
- package/templates/frontend/src/app/Paginas/gestion-tabla-jefe/gestion-tabla-jefe.component.ts +245 -0
- package/templates/frontend/src/app/analytics.module.ts +45 -0
- package/templates/frontend/src/app/app.component.css +0 -0
- package/templates/frontend/src/app/app.component.html +1 -0
- package/templates/frontend/src/app/app.component.ts +10 -0
- package/templates/frontend/src/app/app.config.server.ts +14 -0
- package/templates/frontend/src/app/app.config.ts +27 -0
- package/templates/frontend/src/app/app.routes.ts +16 -0
- package/templates/frontend/src/app/auth.interceptor.ts +26 -0
- package/templates/frontend/src/app/datos-globales.service.ts +45 -0
- package/templates/frontend/src/assets/Puntos.svg +94 -0
- package/templates/frontend/src/index.html +36 -0
- package/templates/frontend/src/main.server.ts +7 -0
- package/templates/frontend/src/main.ts +6 -0
- package/templates/frontend/src/styles.css +14 -0
- package/templates/frontend/tsconfig.app.json +15 -0
- package/templates/frontend/tsconfig.json +27 -0
- package/templates/frontend/tsconfig.spec.json +15 -0
- package/utils/index.js +105 -0
package/package.json
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "utn-cli",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Herramienta CLI unificada para la gestión de plantillas en SIGU.",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"bin": {
|
|
8
|
+
"utn": "./index.js"
|
|
9
|
+
},
|
|
10
|
+
"scripts": {
|
|
11
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
12
|
+
},
|
|
13
|
+
"keywords": [
|
|
14
|
+
"utn",
|
|
15
|
+
"sigu",
|
|
16
|
+
"cli",
|
|
17
|
+
"plantillas",
|
|
18
|
+
"backend",
|
|
19
|
+
"frontend",
|
|
20
|
+
"database"
|
|
21
|
+
],
|
|
22
|
+
"author": "Para la Universidad Técnica Nacional por David Villalobos Cambronero",
|
|
23
|
+
"license": "MIT",
|
|
24
|
+
"dependencies": {
|
|
25
|
+
"commander": "^12.0.0"
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"NOMBRE_DEL_PROYECTO": "NOMBRE_DEL_PROYECTO",
|
|
3
|
+
"DESCRIPCION_DEL_PROYECTO": "DESCRIPCION_DEL_PROYECTO",
|
|
4
|
+
"DETALLE_DEL_PROYECTO": "DETALLE_DEL_PROYECTO",
|
|
5
|
+
"NOMBRE_DEL_CANONICO_DEL_PROYECTO": "NOMBRE_DEL_CANONICO_DEL_PROYECTO",
|
|
6
|
+
"TIPO_DE_TARJETA": "TIPO_DE_TARJETA",
|
|
7
|
+
"NOMBRE_DEL_ROL": "NOMBRE_DEL_ROL",
|
|
8
|
+
"NOMBRE_DEL_REPOSITORIO_DE_BASE_DE_DATOS": "NOMBRE_DEL_REPOSITORIO_DE_BASE_DE_DATOS",
|
|
9
|
+
"NOMBRE_DEL_REPOSITORIO_DE_BACKEND": "NOMBRE_DEL_REPOSITORIO_DE_BACKEND",
|
|
10
|
+
"NOMBRE_DEL_REPOSITORIO_DE_FRONTEND": "NOMBRE_DEL_REPOSITORIO_DE_FRONTEND",
|
|
11
|
+
"NOMBRE_DEL_PERMISO": "NOMBRE_DEL_PERMISO",
|
|
12
|
+
"DESCRIPCION_DEL_PERMISO": "DESCRIPCION_DEL_PERMISO",
|
|
13
|
+
"MENU_PADRE": "MENU_PADRE",
|
|
14
|
+
"COLOR_DEL_MODULO": "COLOR_DEL_MODULO",
|
|
15
|
+
"CORRECO_PARA_REPORTES": "CORRECO_PARA_REPORTES",
|
|
16
|
+
"nombre_de_desarrollador": "nombre_de_desarrollador",
|
|
17
|
+
"CEDULA_DEL_DESARROLLADOR": "CEDULA_DEL_DESARROLLADOR",
|
|
18
|
+
"url_del_grupo": "url_del_grupo",
|
|
19
|
+
"BACKENDS_QUE_CONSUME_ESTE_MODULO": "BACKENDS_QUE_CONSUME_ESTE_MODULO",
|
|
20
|
+
"VERSION": "VERSION"
|
|
21
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
###
|
|
2
|
+
@BASE_URL = http://localhost
|
|
3
|
+
@AUTH_TOKEN = eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1aWQiOjEyLCJjZWR1bGEiOiIxMTEwNTA1NzAiLCJlbWFpbCI6ImR2aWxsYWxvYm9zQHV0bi5hYy5jciIsIm5vbWJyZSI6IkRhdmlkIiwicHJpbWVyQXBlbGxpZG8iOiJWaWxsYWxvYm9zIiwic2VndW5kb0FwZWxsaWRvIjoiQ2FtYnJvbmVybyIsIm5vbWJyZUNvbXBsZXRvIjoiRGF2aWQgVmlsbGFsb2JvcyBDYW1icm9uZXJvIiwicm9sIjoiMSwyLDMsNCw2LDcsOCw5LDEyLDEzLDE1LDE2LDE3LDE4LDIwLDIxLDIyLDIzLDI0LDI1LDI2LDI3LDI4LDI5LDMwLDMxLDMyLDkwIiwiZXhwIjoxNzMxNTUwNjMyLCJpYXQiOjE3MzE1MTgyMzJ9.71REizfpdxfEnMdjdoyO-F3nlpB9n_he7BqDcwoUN-4
|
|
4
|
+
|
|
5
|
+
###
|
|
6
|
+
GET {{ BASE_URL }}/servicio1/funcionDeEjemplo HTTP/1.1
|
|
7
|
+
Authorization: Bearer {{ AUTH_TOKEN }}
|
|
8
|
+
Content-Type: application/json
|
|
9
|
+
Origin: {{ BASE_URL }}
|
|
10
|
+
|
|
11
|
+
# ###
|
|
12
|
+
# GET {{ BASE_URL }}/BeneficiosEstudiantilesParametros/listar HTTP/1.1
|
|
13
|
+
# Authorization: Bearer {{ AUTH_TOKEN }}
|
|
14
|
+
# Content-Type: application/json
|
|
15
|
+
# Origin: {{ BASE_URL }}
|
|
16
|
+
|
|
17
|
+
# ###
|
|
18
|
+
# GET {{ BASE_URL }}/BeneficiosEstudiantiles/Estados HTTP/1.1
|
|
19
|
+
# Authorization: Bearer {{ AUTH_TOKEN }}
|
|
20
|
+
# Content-Type: application/json
|
|
21
|
+
# Origin: {{ BASE_URL }}
|
|
22
|
+
|
|
23
|
+
# ###
|
|
24
|
+
# GET {{ BASE_URL }}/BeneficiosEstudiantiles/reporte HTTP/1.1
|
|
25
|
+
# Authorization: Bearer {{ AUTH_TOKEN }}
|
|
26
|
+
# Content-Type: application/json
|
|
27
|
+
# Origin: {{ BASE_URL }}
|
|
28
|
+
|
|
29
|
+
# ###
|
|
30
|
+
# GET {{ BASE_URL }}/BeneficiosEstudiantiles/detalle/17 HTTP/1.1
|
|
31
|
+
# Authorization: Bearer {{ AUTH_TOKEN }}
|
|
32
|
+
# Content-Type: application/json
|
|
33
|
+
# Origin: {{ BASE_URL }}
|
|
34
|
+
|
|
35
|
+
# ###
|
|
36
|
+
# POST {{ BASE_URL }}/BeneficiosEstudiantiles/actualizar HTTP/1.1
|
|
37
|
+
# Authorization: Bearer {{ AUTH_TOKEN }}
|
|
38
|
+
# Content-Type: application/json
|
|
39
|
+
# Origin: {{ BASE_URL }}
|
|
40
|
+
|
|
41
|
+
# {
|
|
42
|
+
# "BeneficioEstudiantilId": 12,
|
|
43
|
+
# "Nombre": "El beneficio de David versión 2",
|
|
44
|
+
# "Tipo": "Temporal",
|
|
45
|
+
# "Estado": "Inactivo"
|
|
46
|
+
# }
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
# ###
|
|
50
|
+
# POST {{ BASE_URL }}/BeneficiosEstudiantiles/borrar HTTP/1.1
|
|
51
|
+
# Authorization: Bearer {{ AUTH_TOKEN }}
|
|
52
|
+
# Content-Type: application/json
|
|
53
|
+
# Origin: {{ BASE_URL }}
|
|
54
|
+
|
|
55
|
+
# {
|
|
56
|
+
# "BeneficioEstudiantilId": 16
|
|
57
|
+
# }
|
|
58
|
+
|
|
59
|
+
# ###
|
|
60
|
+
# POST {{ BASE_URL }}/BeneficiosEstudiantiles/agregar HTTP/1.1
|
|
61
|
+
# Authorization: Bearer {{ AUTH_TOKEN }}
|
|
62
|
+
# Content-Type: application/json
|
|
63
|
+
# Origin: {{ BASE_URL }}
|
|
64
|
+
|
|
65
|
+
# {
|
|
66
|
+
# "Nombre": "El beneficio de David",
|
|
67
|
+
# "Tipo": "Ordinario"
|
|
68
|
+
# }
|
|
69
|
+
|
|
70
|
+
# ###
|
|
71
|
+
# GET {{ BASE_URL }}/BeneficiosEstudiantiles/listar HTTP/1.1
|
|
72
|
+
# Authorization: Bearer {{ AUTH_TOKEN }}
|
|
73
|
+
# Content-Type: application/json
|
|
74
|
+
# Origin: {{ BASE_URL }}
|
|
File without changes
|
|
@@ -0,0 +1,288 @@
|
|
|
1
|
+
###
|
|
2
|
+
@BASE_URL = http://localhost
|
|
3
|
+
@AUTH_TOKEN = eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1aWQiOiIxMiIsImlhdCI6MTc0NDgxMjQ5NiwiZXhwIjoxNzQ0ODQ4NDk2fQ.LcMFP1CE18fZxrZljhMMXomdKEC9-Jyjv9M5fnpZ8Zs
|
|
4
|
+
|
|
5
|
+
#
|
|
6
|
+
# Rutas del archivo misc.js
|
|
7
|
+
#
|
|
8
|
+
|
|
9
|
+
###
|
|
10
|
+
GET {{ BASE_URL }}/misc/DatosParaReporteCSV HTTP/1.1
|
|
11
|
+
Authorization: Bearer {{ AUTH_TOKEN }}
|
|
12
|
+
Content-Type: application/json
|
|
13
|
+
Origin: {{ BASE_URL }}
|
|
14
|
+
|
|
15
|
+
###
|
|
16
|
+
GET {{ BASE_URL }}/misc/DatosParaGraficoDeBarras HTTP/1.1
|
|
17
|
+
Authorization: Bearer {{ AUTH_TOKEN }}
|
|
18
|
+
Content-Type: application/json
|
|
19
|
+
Origin: {{ BASE_URL }}
|
|
20
|
+
|
|
21
|
+
###
|
|
22
|
+
GET {{ BASE_URL }}/misc/DatosParaGraficoDePie HTTP/1.1
|
|
23
|
+
Authorization: Bearer {{ AUTH_TOKEN }}
|
|
24
|
+
Content-Type: application/json
|
|
25
|
+
Origin: {{ BASE_URL }}
|
|
26
|
+
|
|
27
|
+
###
|
|
28
|
+
GET {{ BASE_URL }}/api/monitoreoV2 HTTP/1.1
|
|
29
|
+
Authorization: Bearer {{ AUTH_TOKEN }}
|
|
30
|
+
Content-Type: application/json
|
|
31
|
+
Origin: {{ BASE_URL }}
|
|
32
|
+
|
|
33
|
+
###
|
|
34
|
+
GET {{ BASE_URL }}/misc/validarTokenV2 HTTP/1.1
|
|
35
|
+
Authorization: Bearer {{ AUTH_TOKEN }}
|
|
36
|
+
Content-Type: application/json
|
|
37
|
+
Origin: {{ BASE_URL }}
|
|
38
|
+
|
|
39
|
+
###
|
|
40
|
+
GET {{ BASE_URL }}/misc/ListadoDePaisesParaCrearCuenta HTTP/1.1
|
|
41
|
+
Authorization: Bearer {{ AUTH_TOKEN }}
|
|
42
|
+
Content-Type: application/json
|
|
43
|
+
Origin: {{ BASE_URL }}
|
|
44
|
+
|
|
45
|
+
###
|
|
46
|
+
GET {{ BASE_URL }}/misc/configurarFrontend2 HTTP/1.1
|
|
47
|
+
Authorization: Bearer {{ AUTH_TOKEN }}
|
|
48
|
+
Content-Type: application/json
|
|
49
|
+
Origin: {{ BASE_URL }}
|
|
50
|
+
|
|
51
|
+
###
|
|
52
|
+
GET {{ BASE_URL }}/misc/obtenerDetalleDelModulo HTTP/1.1
|
|
53
|
+
Authorization: Bearer {{ AUTH_TOKEN }}
|
|
54
|
+
Content-Type: application/json
|
|
55
|
+
Origin: {{ BASE_URL }}
|
|
56
|
+
|
|
57
|
+
###
|
|
58
|
+
GET {{ BASE_URL }}/misc/obtenerDatosDelUsuario HTTP/1.1
|
|
59
|
+
Authorization: Bearer {{ AUTH_TOKEN }}
|
|
60
|
+
Content-Type: application/json
|
|
61
|
+
Origin: {{ BASE_URL }}
|
|
62
|
+
|
|
63
|
+
###
|
|
64
|
+
GET {{ BASE_URL }}/misc/obtenerMensajesInstitucionales HTTP/1.1
|
|
65
|
+
Authorization: Bearer {{ AUTH_TOKEN }}
|
|
66
|
+
Content-Type: application/json
|
|
67
|
+
Origin: {{ BASE_URL }}
|
|
68
|
+
|
|
69
|
+
###
|
|
70
|
+
GET {{ BASE_URL }}/misc/iniciarSesion HTTP/1.1
|
|
71
|
+
Authorization: Bearer {{ AUTH_TOKEN }}
|
|
72
|
+
Content-Type: application/json
|
|
73
|
+
Origin: {{ BASE_URL }}
|
|
74
|
+
|
|
75
|
+
###
|
|
76
|
+
GET {{ BASE_URL }}/misc/obtenerModulos/-/'-' HTTP/1.1
|
|
77
|
+
Authorization: Bearer {{ AUTH_TOKEN }}
|
|
78
|
+
Content-Type: application/json
|
|
79
|
+
Origin: {{ BASE_URL }}
|
|
80
|
+
|
|
81
|
+
###
|
|
82
|
+
POST {{ BASE_URL }}/misc/actualizarNotificacion HTTP/1.1
|
|
83
|
+
Authorization: Bearer {{ AUTH_TOKEN }}
|
|
84
|
+
Content-Type: application/json
|
|
85
|
+
Origin: {{ BASE_URL }}
|
|
86
|
+
|
|
87
|
+
{
|
|
88
|
+
"FechaYHoraDeCreacion": "2025-04-15 18:47:39.4664"
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
###
|
|
92
|
+
GET {{ BASE_URL }}/misc/obtenerNotificaciones HTTP/1.1
|
|
93
|
+
Authorization: Bearer {{ AUTH_TOKEN }}
|
|
94
|
+
Content-Type: application/json
|
|
95
|
+
Origin: {{ BASE_URL }}
|
|
96
|
+
|
|
97
|
+
###
|
|
98
|
+
POST {{ BASE_URL }}/misc/reporteDeIncidencia/{"detalle":"Detalle del problema","resultado":"Resultado esperado","adjuntos":"","contacto":"Información de contacto"} HTTP/1.1
|
|
99
|
+
Authorization: Bearer {{ AUTH_TOKEN }}
|
|
100
|
+
Content-Type: multipart/form-data; boundary=LimiteDeArchivo
|
|
101
|
+
Origin: {{ BASE_URL }}
|
|
102
|
+
|
|
103
|
+
--LimiteDeArchivo
|
|
104
|
+
Content-Disposition: form-data; name="Prueba"; filename="reportePP.pdf"
|
|
105
|
+
Content-Type: application/x-pdf
|
|
106
|
+
|
|
107
|
+
< ./reporte.pdf
|
|
108
|
+
--LimiteDeArchivo--
|
|
109
|
+
|
|
110
|
+
###
|
|
111
|
+
GET {{ BASE_URL }}/misc/cerrarSesion HTTP/1.1
|
|
112
|
+
Authorization: Bearer {{ AUTH_TOKEN }}
|
|
113
|
+
Content-Type: application/json
|
|
114
|
+
Origin: {{ BASE_URL }}
|
|
115
|
+
|
|
116
|
+
###
|
|
117
|
+
GET {{ BASE_URL }}/misc/obtenerEnlaceDePerfil HTTP/1.1
|
|
118
|
+
Authorization: Bearer {{ AUTH_TOKEN }}
|
|
119
|
+
Content-Type: application/json
|
|
120
|
+
Origin: {{ BASE_URL }}
|
|
121
|
+
|
|
122
|
+
###
|
|
123
|
+
GET {{ BASE_URL }}/misc/obtenerPersonasFuncionarias HTTP/1.1
|
|
124
|
+
Authorization: Bearer {{ AUTH_TOKEN }}
|
|
125
|
+
Content-Type: application/json
|
|
126
|
+
Origin: {{ BASE_URL }}
|
|
127
|
+
|
|
128
|
+
###
|
|
129
|
+
GET {{ BASE_URL }}/misc/obtenerEnlaceDePortal HTTP/1.1
|
|
130
|
+
Authorization: Bearer {{ AUTH_TOKEN }}
|
|
131
|
+
Content-Type: application/json
|
|
132
|
+
Origin: {{ BASE_URL }}
|
|
133
|
+
|
|
134
|
+
###
|
|
135
|
+
GET {{ BASE_URL }}/misc/obtenerEnlaceDelModuloPadre HTTP/1.1
|
|
136
|
+
Authorization: Bearer {{ AUTH_TOKEN }}
|
|
137
|
+
Content-Type: application/json
|
|
138
|
+
Origin: {{ BASE_URL }}
|
|
139
|
+
|
|
140
|
+
###
|
|
141
|
+
GET {{ BASE_URL }}/misc/configurarFrontend HTTP/1.1
|
|
142
|
+
Authorization: Bearer {{ AUTH_TOKEN }}
|
|
143
|
+
Content-Type: application/json
|
|
144
|
+
Origin: {{ BASE_URL }}
|
|
145
|
+
|
|
146
|
+
###
|
|
147
|
+
GET {{ BASE_URL }}/misc/validarToken HTTP/1.1
|
|
148
|
+
Authorization: Bearer {{ AUTH_TOKEN }}
|
|
149
|
+
Content-Type: application/json
|
|
150
|
+
Origin: {{ BASE_URL }}
|
|
151
|
+
|
|
152
|
+
###
|
|
153
|
+
GET {{ BASE_URL }}/misc/descargarArchivo/3 HTTP/1.1
|
|
154
|
+
Authorization: Bearer {{ AUTH_TOKEN }}
|
|
155
|
+
Content-Type: application/json
|
|
156
|
+
Origin: {{ BASE_URL }}
|
|
157
|
+
|
|
158
|
+
###
|
|
159
|
+
DELETE {{ BASE_URL }}/misc/borrarArchivo/1 HTTP/1.1
|
|
160
|
+
Authorization: Bearer {{ AUTH_TOKEN }}
|
|
161
|
+
Content-Type: application/json
|
|
162
|
+
Origin: {{ BASE_URL }}
|
|
163
|
+
|
|
164
|
+
###
|
|
165
|
+
GET {{ BASE_URL }}/misc/listarArchivos/Etiqueta--Tag28--Permiso=Usuario HTTP/1.1
|
|
166
|
+
Authorization: Bearer {{ AUTH_TOKEN }}
|
|
167
|
+
Content-Type: application/json
|
|
168
|
+
Origin: {{ BASE_URL }}
|
|
169
|
+
|
|
170
|
+
###
|
|
171
|
+
POST {{ BASE_URL }}/misc/cargarArchivo/Etiqueta--Tag28--Permiso=Usuario HTTP/1.1
|
|
172
|
+
Authorization: Bearer {{ AUTH_TOKEN }}
|
|
173
|
+
Content-Type: multipart/form-data; boundary=LimiteDeArchivo
|
|
174
|
+
Origin: {{ BASE_URL }}
|
|
175
|
+
|
|
176
|
+
--LimiteDeArchivo
|
|
177
|
+
Content-Disposition: form-data; name="Prueba"; filename="reportePP.pdf"
|
|
178
|
+
Content-Type: application/x-pdf
|
|
179
|
+
|
|
180
|
+
< ./reporte.pdf
|
|
181
|
+
--LimiteDeArchivo--
|
|
182
|
+
|
|
183
|
+
###
|
|
184
|
+
GET {{ BASE_URL }}/misc/crearToken/12 HTTP/1.1
|
|
185
|
+
Authorization: Bearer {{ AUTH_TOKEN }}
|
|
186
|
+
Content-Type: application/json
|
|
187
|
+
Origin: {{ BASE_URL }}
|
|
188
|
+
|
|
189
|
+
###
|
|
190
|
+
POST {{ BASE_URL }}/misc/verificarToken HTTP/1.1
|
|
191
|
+
Authorization: Bearer {{ AUTH_TOKEN }}
|
|
192
|
+
Content-Type: application/json
|
|
193
|
+
Origin: {{ BASE_URL }}
|
|
194
|
+
|
|
195
|
+
{
|
|
196
|
+
"Token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1aWQiOiIxMiIsImlhdCI6MTc0NDgxMjQ5NiwiZXhwIjoxNzQ0ODQ4NDk2fQ.LcMFP1CE18fZxrZljhMMXomdKEC9-Jyjv9M5fnpZ8Zs"
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
###
|
|
200
|
+
POST {{ BASE_URL }}/misc/almacenarCuentaIBAN HTTP/1.1
|
|
201
|
+
Authorization: Bearer {{ AUTH_TOKEN }}
|
|
202
|
+
Content-Type: application/json
|
|
203
|
+
Origin: {{ BASE_URL }}
|
|
204
|
+
|
|
205
|
+
{
|
|
206
|
+
"Identificador": 12,
|
|
207
|
+
"IBAN": "CR58016100013109305017"
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
###
|
|
211
|
+
GET {{ BASE_URL }}/misc/reportePDFDeEjemplo HTTP/1.1
|
|
212
|
+
Authorization: Bearer {{ AUTH_TOKEN }}
|
|
213
|
+
Content-Type: application/json
|
|
214
|
+
Origin: {{ BASE_URL }}
|
|
215
|
+
|
|
216
|
+
###
|
|
217
|
+
GET {{ BASE_URL }}/misc/versionDelNucleo HTTP/1.1
|
|
218
|
+
Authorization: Bearer {{ AUTH_TOKEN }}
|
|
219
|
+
Content-Type: application/json
|
|
220
|
+
Origin: {{ BASE_URL }}
|
|
221
|
+
|
|
222
|
+
###
|
|
223
|
+
GET {{ BASE_URL }}/misc/obtenerDatosDeLaPersonaPorIdentificacion/111050570 HTTP/1.1
|
|
224
|
+
Authorization: Bearer {{ AUTH_TOKEN }}
|
|
225
|
+
Content-Type: application/json
|
|
226
|
+
Origin: {{ BASE_URL }}
|
|
227
|
+
|
|
228
|
+
###
|
|
229
|
+
POST {{ BASE_URL }}/misc/obtenerDatosDeLaPersona HTTP/1.1
|
|
230
|
+
Authorization: Bearer {{ AUTH_TOKEN }}
|
|
231
|
+
Content-Type: application/json
|
|
232
|
+
Origin: {{ BASE_URL }}
|
|
233
|
+
|
|
234
|
+
###
|
|
235
|
+
GET {{ BASE_URL }}/misc/obtenerEstudiantes HTTP/1.1
|
|
236
|
+
Authorization: Bearer {{ AUTH_TOKEN }}
|
|
237
|
+
Content-Type: application/json
|
|
238
|
+
Origin: {{ BASE_URL }}
|
|
239
|
+
|
|
240
|
+
###
|
|
241
|
+
GET {{ BASE_URL }}/misc/obtenerBeneficios HTTP/1.1
|
|
242
|
+
Authorization: Bearer {{ AUTH_TOKEN }}
|
|
243
|
+
Content-Type: application/json
|
|
244
|
+
Origin: {{ BASE_URL }}
|
|
245
|
+
|
|
246
|
+
###
|
|
247
|
+
GET {{ BASE_URL }}/misc/obtenerPeriodos HTTP/1.1
|
|
248
|
+
Authorization: Bearer {{ AUTH_TOKEN }}
|
|
249
|
+
Content-Type: application/json
|
|
250
|
+
Origin: {{ BASE_URL }}
|
|
251
|
+
|
|
252
|
+
###
|
|
253
|
+
GET {{ BASE_URL }}/misc/obtenerAnios HTTP/1.1
|
|
254
|
+
Authorization: Bearer {{ AUTH_TOKEN }}
|
|
255
|
+
Content-Type: application/json
|
|
256
|
+
Origin: {{ BASE_URL }}
|
|
257
|
+
|
|
258
|
+
###
|
|
259
|
+
GET {{ BASE_URL }}/misc/obtenerRecintos HTTP/1.1
|
|
260
|
+
Authorization: Bearer {{ AUTH_TOKEN }}
|
|
261
|
+
Content-Type: application/json
|
|
262
|
+
Origin: {{ BASE_URL }}
|
|
263
|
+
|
|
264
|
+
###
|
|
265
|
+
GET {{ BASE_URL }}/misc/obtenerSedes HTTP/1.1
|
|
266
|
+
Authorization: Bearer {{ AUTH_TOKEN }}
|
|
267
|
+
Content-Type: application/json
|
|
268
|
+
Origin: {{ BASE_URL }}
|
|
269
|
+
|
|
270
|
+
###
|
|
271
|
+
GET {{ BASE_URL }}/misc/obtenerIdentificacion/12 HTTP/1.1
|
|
272
|
+
Authorization: Bearer {{ AUTH_TOKEN }}
|
|
273
|
+
Content-Type: application/json
|
|
274
|
+
Origin: {{ BASE_URL }}
|
|
275
|
+
|
|
276
|
+
#
|
|
277
|
+
# Rutas del archivo API.js
|
|
278
|
+
#
|
|
279
|
+
|
|
280
|
+
###
|
|
281
|
+
POST {{ BASE_URL }}/api/monitoreo HTTP/1.1
|
|
282
|
+
Content-Type: application/json
|
|
283
|
+
Origin: {{ BASE_URL }}
|
|
284
|
+
|
|
285
|
+
{
|
|
286
|
+
"Identificacion": "UNA_IDENTIFICACIÓN_AQUÍ",
|
|
287
|
+
"Clave": "UNA_CLAVE_AQUÍ"
|
|
288
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "nombre_del_repositorio_backend",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Backend para nombre_del_repositorio_backend",
|
|
5
|
+
"main": "server.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
|
8
|
+
"start": "node server.js",
|
|
9
|
+
"dev": "nodemon server.js"
|
|
10
|
+
},
|
|
11
|
+
"repository": {
|
|
12
|
+
"type": "git",
|
|
13
|
+
"url": "url_del_grupo"
|
|
14
|
+
},
|
|
15
|
+
"author": "nombre_de_desarrollador",
|
|
16
|
+
"license": "ISC",
|
|
17
|
+
"devDependencies": {
|
|
18
|
+
"nodemon": "^3.1.11"
|
|
19
|
+
},
|
|
20
|
+
"dependencies": {
|
|
21
|
+
"bcryptjs": "^2.4.3",
|
|
22
|
+
"cors": "^2.8.5",
|
|
23
|
+
"express": "^4.22.1",
|
|
24
|
+
"helmet": "^7.2.0",
|
|
25
|
+
"jsonwebtoken": "^9.0.3",
|
|
26
|
+
"mysql2": "^3.15.3",
|
|
27
|
+
"nodemailer": "^7.0.11",
|
|
28
|
+
"pdfkit": "^0.15.2"
|
|
29
|
+
}
|
|
30
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
const express = require('express');
|
|
2
|
+
const Router = express.Router();
|
|
3
|
+
|
|
4
|
+
const Miscelaneo = require('../servicios/Nucleo/Miscelaneas.js');
|
|
5
|
+
const { moitoreo } = require('../servicios/Nucleo/Monitoreo.js');
|
|
6
|
+
|
|
7
|
+
Router.post('/monitoreo/', async (solicitud, respuesta, next) => {
|
|
8
|
+
try {
|
|
9
|
+
if (await Miscelaneo.validarToken(solicitud.headers.authorization) && await Miscelaneo.validarAccesoDelOrigen(solicitud)) {
|
|
10
|
+
if (await moitoreo()) {
|
|
11
|
+
return respuesta.status(200).json({ 'Estado:': 'Ok' });
|
|
12
|
+
} else {
|
|
13
|
+
return respuesta.status(500).json({ 'Estado:': 'Error' });
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
} catch (error) {
|
|
17
|
+
next(error);
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
Router.get('/monitoreoV2', async (solicitud, respuesta, next) => {
|
|
22
|
+
try {
|
|
23
|
+
if (await Miscelaneo.validarToken(solicitud.headers.authorization) && await Miscelaneo.validarAccesoDelOrigen(solicitud)) {
|
|
24
|
+
try {
|
|
25
|
+
if (await moitoreo()) {
|
|
26
|
+
return respuesta.status(200).json({ 'Estado:': 'Ok' });
|
|
27
|
+
} else {
|
|
28
|
+
return respuesta.status(500).json({ 'Estado:': 'Error' });
|
|
29
|
+
}
|
|
30
|
+
} catch (error) {
|
|
31
|
+
const MensajeDeError = 'No fue posible monitorear el módulo';
|
|
32
|
+
console.error(new ManejadorDeErrores(MensajeDeError, ManejadorDeErrores.obtenerNumeroDeLinea(), true, `Dirección IP: ${solicitud.ip}`));
|
|
33
|
+
return respuesta.status(500).json({ body: undefined, error: MensajeDeError });
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
return respuesta.status(401).json({ body: undefined, error: ManejadorDeErrores.mensajeDeError401() });
|
|
37
|
+
} catch (error) {
|
|
38
|
+
next(error);
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
// Router.get('/beneficiosActivosPorSede/:SedesId', async (solicitud, respuesta) => {
|
|
43
|
+
// if (await Miscelaneo.validarIdentificadorAPI(solicitud.headers)) {
|
|
44
|
+
// return respuesta.json(await Beneficios.beneficiosActivosPorSede(solicitud.params.SedesId));
|
|
45
|
+
// }
|
|
46
|
+
// return respuesta.status(401).json();
|
|
47
|
+
// });
|
|
48
|
+
|
|
49
|
+
module.exports = Router;
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
const express = require('express');
|
|
2
|
+
const Router = express.Router();
|
|
3
|
+
|
|
4
|
+
const Servicio1 = require('../servicios/Servicio1.js');
|
|
5
|
+
const Miscelaneo = require('../servicios/Nucleo/Miscelaneas.js');
|
|
6
|
+
const ManejadorDeErrores = require('../servicios/Nucleo/ManejadorDeErrores.js');
|
|
7
|
+
|
|
8
|
+
Router.get('/funcionDeEjemplo', async (solicitud, respuesta, next) => {
|
|
9
|
+
try {
|
|
10
|
+
if (await Miscelaneo.validarToken(solicitud.headers.authorization) && await Miscelaneo.validarAccesoDelOrigen(solicitud)) {
|
|
11
|
+
try {
|
|
12
|
+
return respuesta.json({ body: await Servicio1.funcionDeEjemplo(), error: undefined });
|
|
13
|
+
} catch (error) {
|
|
14
|
+
const MensajeDeError = 'No fue posible obtener los datos de la función de ejemplo';
|
|
15
|
+
console.error(new ManejadorDeErrores(MensajeDeError, ManejadorDeErrores.obtenerNumeroDeLinea(), true, `Dirección IP: ${solicitud.ip}`));
|
|
16
|
+
return respuesta.status(500).json({ body: undefined, error: MensajeDeError });
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
return respuesta.status(401).json({ body: undefined, error: ManejadorDeErrores.mensajeDeError401() });
|
|
20
|
+
} catch (error) {
|
|
21
|
+
next(error);
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
// Router.get("/listar/:PaginadorAccion/:PaginadorIndice/:PaginadorTamanio/:PaginadorFiltro/:PaginadorColumnaParaFiltrar/:PaginadorColumnasParaFiltrar/:ColumnaParaOrdenar/:TipoDeOrden", async (solicitud, respuesta, next) => {
|
|
26
|
+
// try {
|
|
27
|
+
// if (await Miscelaneo.validarToken(solicitud.headers.authorization) && await Miscelaneo.validarAccesoDelOrigen(solicitud)) {
|
|
28
|
+
// try {
|
|
29
|
+
// return respuesta.json({ body: await CorreosPersona.listar(solicitud.params), error: undefined });
|
|
30
|
+
// } catch (error) {
|
|
31
|
+
// const MensajeDeError = "No fue posible listar los correos de las personas";
|
|
32
|
+
// console.error(new ManejadorDeErrores(MensajeDeError, ManejadorDeErrores.obtenerNumeroDeLinea(), true, `Dirección IP: ${solicitud.ip}`));
|
|
33
|
+
// return respuesta.status(500).json({ body: undefined, error: MensajeDeError });
|
|
34
|
+
// }
|
|
35
|
+
// }
|
|
36
|
+
// return respuesta.status(401).json({ body: undefined, error: ManejadorDeErrores.mensajeDeError401() });
|
|
37
|
+
// } catch (error) {
|
|
38
|
+
// next(error);
|
|
39
|
+
// }
|
|
40
|
+
// });
|
|
41
|
+
|
|
42
|
+
// Router.get('/Estados', async (solicitud, respuesta, next) => {
|
|
43
|
+
// try {
|
|
44
|
+
// if (await Miscelaneo.validarToken(solicitud.headers.authorization) && await Miscelaneo.validarAccesoDelOrigen(solicitud)) {
|
|
45
|
+
// try {
|
|
46
|
+
// return respuesta.json({ body: await BeneficiosEstudiantiles.Estados(), error: undefined });
|
|
47
|
+
// } catch (error) {
|
|
48
|
+
// const MensajeDeError = 'No fue posible obtener los estados';
|
|
49
|
+
// console.error(new ManejadorDeErrores(MensajeDeError, ManejadorDeErrores.obtenerNumeroDeLinea(), true, `Dirección IP: ${solicitud.ip}`));
|
|
50
|
+
// return respuesta.status(500).json({ body: undefined, error: MensajeDeError });
|
|
51
|
+
// }
|
|
52
|
+
// }
|
|
53
|
+
// return respuesta.status(401).json({ body: undefined, error: ManejadorDeErrores.mensajeDeError401() });
|
|
54
|
+
// } catch (error) {
|
|
55
|
+
// next(error);
|
|
56
|
+
// }
|
|
57
|
+
// });
|
|
58
|
+
|
|
59
|
+
// Router.get('/tipos', async (solicitud, respuesta, next) => {
|
|
60
|
+
// try {
|
|
61
|
+
// if (await Miscelaneo.validarToken(solicitud.headers.authorization) && await Miscelaneo.validarAccesoDelOrigen(solicitud)) {
|
|
62
|
+
// try {
|
|
63
|
+
// return respuesta.json({ body: await BeneficiosEstudiantiles.tipos(), error: undefined });
|
|
64
|
+
// } catch (error) {
|
|
65
|
+
// const MensajeDeError = 'No fue posible obtener los tipos de bebeficios';
|
|
66
|
+
// console.error(new ManejadorDeErrores(MensajeDeError, ManejadorDeErrores.obtenerNumeroDeLinea(), true, `Dirección IP: ${solicitud.ip}`));
|
|
67
|
+
// return respuesta.status(500).json({ body: undefined, error: MensajeDeError });
|
|
68
|
+
// }
|
|
69
|
+
// }
|
|
70
|
+
// return respuesta.status(401).json({ body: undefined, error: ManejadorDeErrores.mensajeDeError401() });
|
|
71
|
+
// } catch (error) {
|
|
72
|
+
// next(error);
|
|
73
|
+
// }
|
|
74
|
+
// });
|
|
75
|
+
|
|
76
|
+
// Router.get('/reporte', async (solicitud, respuesta, next) => {
|
|
77
|
+
// try {
|
|
78
|
+
// if (await Miscelaneo.validarToken(solicitud.headers.authorization) && await Miscelaneo.validarAccesoDelOrigen(solicitud)) {
|
|
79
|
+
// try {
|
|
80
|
+
// respuesta.header('Content-Type', 'text/csv; charset=utf-8');
|
|
81
|
+
// respuesta.attachment('Datos.csv');
|
|
82
|
+
// return respuesta.send(encodeURI(await BeneficiosEstudiantiles.reporte()));
|
|
83
|
+
// } catch (error) {
|
|
84
|
+
// const MensajeDeError = 'No fue posible generar el reporte de los datos';
|
|
85
|
+
// console.error(new ManejadorDeErrores(MensajeDeError, ManejadorDeErrores.obtenerNumeroDeLinea(), true, `Dirección IP: ${solicitud.ip}`));
|
|
86
|
+
// return respuesta.status(500).json({ body: undefined, error: MensajeDeError });
|
|
87
|
+
// }
|
|
88
|
+
// }
|
|
89
|
+
// return respuesta.status(401).json({ body: undefined, error: ManejadorDeErrores.mensajeDeError401() });
|
|
90
|
+
// } catch (error) {
|
|
91
|
+
// next(error);
|
|
92
|
+
// }
|
|
93
|
+
// });
|
|
94
|
+
|
|
95
|
+
// Router.get('/detalle/:BeneficioId', async (solicitud, respuesta, next) => {
|
|
96
|
+
// try {
|
|
97
|
+
// if (await Miscelaneo.validarToken(solicitud.headers.authorization) && await Miscelaneo.validarAccesoDelOrigen(solicitud)) {
|
|
98
|
+
// try {
|
|
99
|
+
// return respuesta.json({ body: await BeneficiosEstudiantiles.detalle(solicitud.params.BeneficioId), error: undefined });
|
|
100
|
+
// } catch (error) {
|
|
101
|
+
// const MensajeDeError = 'No fue posible obtener los tipos de bebeficios';
|
|
102
|
+
// console.error(new ManejadorDeErrores(MensajeDeError, ManejadorDeErrores.obtenerNumeroDeLinea(), true, `Dirección IP: ${solicitud.ip}`));
|
|
103
|
+
// return respuesta.status(500).json({ body: undefined, error: MensajeDeError });
|
|
104
|
+
// }
|
|
105
|
+
// }
|
|
106
|
+
// return respuesta.status(401).json({ body: undefined, error: ManejadorDeErrores.mensajeDeError401() });
|
|
107
|
+
// } catch (error) {
|
|
108
|
+
// next(error);
|
|
109
|
+
// }
|
|
110
|
+
// });
|
|
111
|
+
|
|
112
|
+
// Router.post('/actualizar', async (solicitud, respuesta, next) => {
|
|
113
|
+
// try {
|
|
114
|
+
// if (await Miscelaneo.validarToken(solicitud.headers.authorization) && await Miscelaneo.validarAccesoDelOrigen(solicitud)) {
|
|
115
|
+
// try {
|
|
116
|
+
// const Datos = solicitud.body;
|
|
117
|
+
// Datos.LastUser = await Miscelaneo.generarLastUser(solicitud);
|
|
118
|
+
// return respuesta.json({ body: await BeneficiosEstudiantiles.actualizar(Datos), error: undefined });
|
|
119
|
+
// } catch (error) {
|
|
120
|
+
// const MensajeDeError = 'No fue posible actualizar el beneficio';
|
|
121
|
+
// console.error(new ManejadorDeErrores(MensajeDeError, ManejadorDeErrores.obtenerNumeroDeLinea(), true, `Dirección IP: ${solicitud.ip}`));
|
|
122
|
+
// return respuesta.status(500).json({ body: undefined, error: MensajeDeError });
|
|
123
|
+
// }
|
|
124
|
+
// }
|
|
125
|
+
// return respuesta.status(401).json({ body: undefined, error: ManejadorDeErrores.mensajeDeError401() });
|
|
126
|
+
// } catch (error) {
|
|
127
|
+
// next(error);
|
|
128
|
+
// }
|
|
129
|
+
// });
|
|
130
|
+
|
|
131
|
+
// Router.post('/borrar', async (solicitud, respuesta, next) => {
|
|
132
|
+
// try {
|
|
133
|
+
// if (await Miscelaneo.validarToken(solicitud.headers.authorization) && await Miscelaneo.validarAccesoDelOrigen(solicitud)) {
|
|
134
|
+
// try {
|
|
135
|
+
// return respuesta.json({ body: await BeneficiosEstudiantiles.borrar(solicitud.body), error: undefined });
|
|
136
|
+
// } catch (error) {
|
|
137
|
+
// const MensajeDeError = 'No fue posible actualizar el beneficio';
|
|
138
|
+
// console.error(new ManejadorDeErrores(MensajeDeError, ManejadorDeErrores.obtenerNumeroDeLinea(), true, `Dirección IP: ${solicitud.ip}`));
|
|
139
|
+
// return respuesta.status(500).json({ body: undefined, error: MensajeDeError });
|
|
140
|
+
// }
|
|
141
|
+
// }
|
|
142
|
+
// return respuesta.status(401).json({ body: undefined, error: ManejadorDeErrores.mensajeDeError401() });
|
|
143
|
+
// } catch (error) {
|
|
144
|
+
// next(error);
|
|
145
|
+
// }
|
|
146
|
+
// });
|
|
147
|
+
|
|
148
|
+
// Router.post('/agregar', async (solicitud, respuesta, next) => {
|
|
149
|
+
// try {
|
|
150
|
+
// if (await Miscelaneo.validarToken(solicitud.headers.authorization) && await Miscelaneo.validarAccesoDelOrigen(solicitud)) {
|
|
151
|
+
// try {
|
|
152
|
+
// const Datos = solicitud.body;
|
|
153
|
+
// Datos.LastUser = await Miscelaneo.generarLastUser(solicitud);
|
|
154
|
+
// return respuesta.json({ body: await BeneficiosEstudiantiles.agregar(Datos), error: undefined });
|
|
155
|
+
// } catch (error) {
|
|
156
|
+
// const MensajeDeError = 'No fue posible agregar el beneficio';
|
|
157
|
+
// console.error(new ManejadorDeErrores(MensajeDeError, ManejadorDeErrores.obtenerNumeroDeLinea(), true, `Dirección IP: ${solicitud.ip}`));
|
|
158
|
+
// return respuesta.status(500).json({ body: undefined, error: MensajeDeError });
|
|
159
|
+
// }
|
|
160
|
+
// }
|
|
161
|
+
// return respuesta.status(401).json({ body: undefined, error: ManejadorDeErrores.mensajeDeError401() });
|
|
162
|
+
// } catch (error) {
|
|
163
|
+
// next(error);
|
|
164
|
+
// }
|
|
165
|
+
// });
|
|
166
|
+
|
|
167
|
+
// Router.get('/listar', async (solicitud, respuesta, next) => {
|
|
168
|
+
// try {
|
|
169
|
+
// if (await Miscelaneo.validarToken(solicitud.headers.authorization) && await Miscelaneo.validarAccesoDelOrigen(solicitud)) {
|
|
170
|
+
// try {
|
|
171
|
+
// return respuesta.json({ body: await BeneficiosEstudiantiles.listar(), error: undefined });
|
|
172
|
+
// } catch (error) {
|
|
173
|
+
// const MensajeDeError = 'No fue posible agregar el beneficio';
|
|
174
|
+
// console.error(new ManejadorDeErrores(MensajeDeError, ManejadorDeErrores.obtenerNumeroDeLinea(), true, `Dirección IP: ${solicitud.ip}`));
|
|
175
|
+
// return respuesta.status(500).json({ body: undefined, error: MensajeDeError });
|
|
176
|
+
// }
|
|
177
|
+
// }
|
|
178
|
+
// return respuesta.status(401).json({ body: undefined, error: ManejadorDeErrores.mensajeDeError401() });
|
|
179
|
+
// } catch (error) {
|
|
180
|
+
// next(error);
|
|
181
|
+
// }
|
|
182
|
+
// });
|
|
183
|
+
|
|
184
|
+
module.exports = Router;
|