utn-cli 2.0.12 → 2.0.14

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/db.js CHANGED
@@ -45,6 +45,6 @@ export async function initDb() {
45
45
 
46
46
  export function showDbVersion() {
47
47
  // Assuming the version for 'db' command comes from the main utn-cli package.json
48
- mostrarVersion(path.join(__dirname, '../../package.json'));
48
+ mostrarVersion(path.join(__dirname, '../package.json'));
49
49
  closeReadLine();
50
50
  }
@@ -53,7 +53,7 @@ export async function updateFrontend() {
53
53
  }
54
54
 
55
55
  copiarDirectorios(directoriodePlantillas, directorioDestino, archivosAExcluir);
56
- mostrarVersion(path.join(__dirname, '../../package.json'));
56
+ mostrarVersion(path.join(__dirname, '../package.json'));
57
57
  console.log('Proyecto de frontend actualizado exitosamente.');
58
58
  closeReadLine();
59
59
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "utn-cli",
3
- "version": "2.0.12",
3
+ "version": "2.0.14",
4
4
  "description": "Herramienta CLI unificada para la gestión de plantillas en SIGU.",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -40,6 +40,31 @@ class Miscelaneo {
40
40
  this.EnlaceDeAcceso = undefined;
41
41
  };
42
42
 
43
+ async RegistrarPermisoExtra(Permiso, Descripcion) {
44
+ await ejecutarConsultaSIGU("SELECT IFNULL(MAX(`PermisoExtraId`), 0) + 1 INTO @`SiguientePermisoId` FROM `SIGU`.`SIGU_PermisosExtraV2`;\
45
+ INSERT INTO `SIGU`.`SIGU_PermisosExtraV2` VALUES\
46
+ (@`SiguientePermisoId`, ?, ?, ?, NOW(4), USER()) ON DUPLICATE KEY UPDATE `LastUser` = USER(), `Nombre` = ?, `Descripcion` = ?;"
47
+ , [Permiso, this.NombreCanonicoDelModulo, Descripcion, Permiso, Descripcion]);
48
+
49
+ // Asginación inicial de permisos
50
+ if (this.UsuariosConAccesoInicial.length > 0) {
51
+ const PermisoExtraIdValor = await this.PermisoExtraId(Permiso);
52
+ this.UsuariosConAccesoInicial.forEach(async (dato) => {
53
+ await ejecutarConsultaSIGU("INSERT INTO `SIGU`.`SIGU_PermisosExtraPersonasV2` VALUES (?,\
54
+ (SELECT `Identificador` FROM `SIGU`.`SIGU_Personas` WHERE `Identificacion` = ?), NOW(4), USER())\
55
+ ON DUPLICATE KEY UPDATE `LastUpdate` = NOW(4)"
56
+ , [PermisoExtraIdValor, dato]);
57
+ });
58
+ }
59
+ }
60
+
61
+ async PermisoExtraId(Permiso) {
62
+ const PermisoExtraId = await ejecutarConsultaSIGU("SELECT `PermisoExtraId` FROM `SIGU`.`SIGU_PermisosExtraV2` \
63
+ WHERE `Nombre` = ? AND `Modulo` = ?"
64
+ , [Permiso, this.NombreCanonicoDelModulo]);
65
+ return PermisoExtraId[0]['PermisoExtraId'];
66
+ }
67
+
43
68
  obtenerNombreCanonicoDelModulo() {
44
69
  return this.NombreCanonicoDelModulo;
45
70
  }
@@ -572,12 +597,10 @@ class Miscelaneo {
572
597
  async registroDelModuloEnSIGUV2() {
573
598
  await ejecutarConsultaSIGU("INSERT INTO `SIGU`.`SIGU_ModulosV2` VALUES\
574
599
  (?, ?, ?, ?, ?, ?, ?, ?, ?, NOW(4), ?, 'DiccionarioDeDatos'\
575
- , ?, '-', '-', 'Activo', NOW(4), USER()) ON DUPLICATE KEY UPDATE `Padre` = ?, `Descripcion` = ?, `Detalle` = ?\
576
- , `Color` = ?, `Correo` = ?, `Version` = ?, `Repositorios` = ?, `AcuerdoDeNivelDeServicio` = ?"
600
+ , ?, '-', '-', 'Activo', NOW(4), USER()) ON DUPLICATE KEY UPDATE `Version` = ?"
577
601
  , [this.NombreCanonicoDelModulo, this.MenuPadre, this.DescripcionDelModulo, this.DetalleDelModulo
578
602
  , this.TipoDeCard, this.IconoDelModulo, this.ColorDelModulo, this.CorreoParaReportes, this.Version, this.versionDelNucleo().split(' ')[0], this.Repositorios
579
- , this.MenuPadre, this.DescripcionDelModulo, this.DetalleDelModulo, this.ColorDelModulo, this.CorreoParaReportes
580
- , this.Version, this.Repositorios, this.versionDelNucleo().split(' ')[0]]);
603
+ , this.Version]);
581
604
  await ejecutarConsultaSIGU("SELECT IFNULL(MAX(`PermisoId`), 0) + 1 INTO @`SiguientePermisoId` FROM `SIGU`.`SIGU_PermisosV2`;\
582
605
  INSERT INTO `SIGU`.`SIGU_PermisosV2` VALUES\
583
606
  (@`SiguientePermisoId`, ?, ?, ?, NOW(4), USER()) ON DUPLICATE KEY UPDATE `LastUser` = USER(), `Nombre` = ?, `Descripcion` = ?;"
@@ -1065,8 +1088,8 @@ class Miscelaneo {
1065
1088
  WHERE `PermisoId` = ? AND `Identificador` = ?", [rolPermisoId, Resultado.uid]);
1066
1089
  if (permisos[0]['Total'] === 1) {
1067
1090
  if (permisoExtraId) {
1068
- const ValidacionPermisoExtra = await ejecutarConsultaSIGU("SELECT COUNT(*) AS `Total` FROM `SIGU`.`SIGU_PermisosPersonasV2`\
1069
- WHERE `PermisoId` = ? AND `Identificador` = ?", [permisoExtraId, Resultado.uid]);
1091
+ const ValidacionPermisoExtra = await ejecutarConsultaSIGU("SELECT COUNT(*) AS `Total` FROM `SIGU`.`SIGU_PermisosExtraPersonasV2`\
1092
+ WHERE `PermisoExtraId` = ? AND `Identificador` = ?", [permisoExtraId, Resultado.uid]);
1070
1093
  if (ValidacionPermisoExtra[0]['Total'] === 1) {
1071
1094
  return true;
1072
1095
  }
@@ -1087,7 +1110,7 @@ class Miscelaneo {
1087
1110
  return false;
1088
1111
  }
1089
1112
 
1090
- async validarTokenV2(encabezadoDeAutorizacion) {
1113
+ async validarToken(encabezadoDeAutorizacion) {
1091
1114
  return await this.validarTokenV2(encabezadoDeAutorizacion);
1092
1115
  // const Resultado = undefined;
1093
1116
  // try {
@@ -1,6 +1,6 @@
1
1
  import { Component } from "@angular/core";
2
2
  import { TarjetaComponent } from "../../Componentes/Nucleo/tarjeta/tarjeta.component";
3
- // import { HttpClient, HttpHeaders } from "@angular/common/http";
3
+ // import { HttpClient } from "@angular/common/http";
4
4
  // import { DatosGlobalesService } from '../../datos-globales.service'
5
5
 
6
6
  @Component({