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
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */
|
|
2
|
+
/* To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */
|
|
3
|
+
{
|
|
4
|
+
"compileOnSave": false,
|
|
5
|
+
"compilerOptions": {
|
|
6
|
+
"outDir": "./dist/out-tsc",
|
|
7
|
+
"strict": true,
|
|
8
|
+
"noImplicitOverride": true,
|
|
9
|
+
"noPropertyAccessFromIndexSignature": true,
|
|
10
|
+
"noImplicitReturns": true,
|
|
11
|
+
"noFallthroughCasesInSwitch": true,
|
|
12
|
+
"skipLibCheck": true,
|
|
13
|
+
"isolatedModules": true,
|
|
14
|
+
"esModuleInterop": true,
|
|
15
|
+
"experimentalDecorators": true,
|
|
16
|
+
"moduleResolution": "bundler",
|
|
17
|
+
"importHelpers": true,
|
|
18
|
+
"target": "ES2022",
|
|
19
|
+
"module": "ES2022"
|
|
20
|
+
},
|
|
21
|
+
"angularCompilerOptions": {
|
|
22
|
+
"enableI18nLegacyMessageIdFormat": false,
|
|
23
|
+
"strictInjectionParameters": true,
|
|
24
|
+
"strictInputAccessModifiers": true,
|
|
25
|
+
"strictTemplates": true
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */
|
|
2
|
+
/* To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */
|
|
3
|
+
{
|
|
4
|
+
"extends": "./tsconfig.json",
|
|
5
|
+
"compilerOptions": {
|
|
6
|
+
"outDir": "./out-tsc/spec",
|
|
7
|
+
"types": [
|
|
8
|
+
"jasmine"
|
|
9
|
+
]
|
|
10
|
+
},
|
|
11
|
+
"include": [
|
|
12
|
+
"src/**/*.spec.ts",
|
|
13
|
+
"src/**/*.d.ts"
|
|
14
|
+
]
|
|
15
|
+
}
|
package/utils/index.js
ADDED
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import fs from 'fs';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
import readline from 'readline';
|
|
4
|
+
import { fileURLToPath } from 'url';
|
|
5
|
+
|
|
6
|
+
const lectorDeLineas = readline.createInterface({
|
|
7
|
+
input: process.stdin,
|
|
8
|
+
output: process.stdout,
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
export function hacerPregunta(pregunta) {
|
|
12
|
+
return new Promise((resolve) => lectorDeLineas.question(pregunta, resolve));
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export async function hacerPreguntaTrim(pregunta) {
|
|
16
|
+
const Respuesta = await hacerPregunta(pregunta);
|
|
17
|
+
return Respuesta.trim();
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export function reemplazarContenidoEnArchivo(rutaDeArchivo, valorABuscar, valorAReemplazar) {
|
|
21
|
+
if (!fs.existsSync(rutaDeArchivo)) {
|
|
22
|
+
// console.error(`El archivo ${rutaDeArchivo} no existe.`); // This might be desired behavior for files that don't always exist
|
|
23
|
+
return false; // Indicate that the file was not found or not replaced
|
|
24
|
+
}
|
|
25
|
+
const contenido = fs.readFileSync(rutaDeArchivo, 'utf-8');
|
|
26
|
+
const contenidoActualizado = contenido.replace(new RegExp(valorABuscar, 'g'), valorAReemplazar);
|
|
27
|
+
fs.writeFileSync(rutaDeArchivo, contenidoActualizado);
|
|
28
|
+
return true; // Indicate success
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// Adjusted to accept an array of files to exclude
|
|
32
|
+
export function copiarDirectorios(directorioFuente, directorioDestino, archivosAExcluir = []) {
|
|
33
|
+
if (!fs.existsSync(directorioDestino)) {
|
|
34
|
+
fs.mkdirSync(directorioDestino, { recursive: true });
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const entradas = fs.readdirSync(directorioFuente, { withFileTypes: true });
|
|
38
|
+
|
|
39
|
+
entradas.forEach((entrada) => {
|
|
40
|
+
const rutaFuente = path.join(directorioFuente, entrada.name);
|
|
41
|
+
const rutaDestino = path.join(directorioDestino, entrada.name);
|
|
42
|
+
|
|
43
|
+
// Check if the current file/directory should be excluded
|
|
44
|
+
if (archivosAExcluir.includes(entrada.name)) {
|
|
45
|
+
console.log(`Se omitió el archivo/directorio ${entrada.name}.`);
|
|
46
|
+
return; // Skip this entry
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
if (entrada.isDirectory()) {
|
|
50
|
+
copiarDirectorios(rutaFuente, rutaDestino, archivosAExcluir);
|
|
51
|
+
} else if (entrada.isFile()) {
|
|
52
|
+
fs.copyFileSync(rutaFuente, rutaDestino);
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export function limpiarDirectorioActual(excepciones = []) {
|
|
58
|
+
const directorio = process.cwd();
|
|
59
|
+
if (!fs.existsSync(directorio)) {
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
const elementos = fs.readdirSync(directorio);
|
|
64
|
+
|
|
65
|
+
elementos.forEach((elemento) => {
|
|
66
|
+
if (!excepciones.includes(elemento)) {
|
|
67
|
+
const ruta = path.join(directorio, elemento);
|
|
68
|
+
try {
|
|
69
|
+
const stats = fs.statSync(ruta);
|
|
70
|
+
if (stats.isDirectory()) {
|
|
71
|
+
fs.rmSync(ruta, { recursive: true, force: true });
|
|
72
|
+
} else {
|
|
73
|
+
fs.unlinkSync(ruta);
|
|
74
|
+
}
|
|
75
|
+
} catch (e) {
|
|
76
|
+
console.error(`No se pudo eliminar ${elemento}: ${e.message}`);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
console.log('Directorio limpiado correctamente.');
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export function mostrarVersion(packageJsonPath) {
|
|
84
|
+
const rutaDelModuloJson = path.resolve(packageJsonPath);
|
|
85
|
+
if (!fs.existsSync(rutaDelModuloJson)) {
|
|
86
|
+
console.error(`Error: package.json no encontrado en ${rutaDelModuloJson}`);
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
const informacionDelModuloJson = JSON.parse(fs.readFileSync(rutaDelModuloJson, 'utf-8'));
|
|
90
|
+
console.log(`Versión de ${informacionDelModuloJson.name}: ${informacionDelModuloJson.version}.`);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
// New utility to get package.json info
|
|
94
|
+
export function getPackageInfo(packageJsonPath) {
|
|
95
|
+
const rutaDelModuloJson = path.resolve(packageJsonPath);
|
|
96
|
+
if (!fs.existsSync(rutaDelModuloJson)) {
|
|
97
|
+
console.error(`Error: package.json no encontrado en ${rutaDelModuloJson}`);
|
|
98
|
+
return null;
|
|
99
|
+
}
|
|
100
|
+
return JSON.parse(fs.readFileSync(rutaDelModuloJson, 'utf-8'));
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export function closeReadLine() {
|
|
104
|
+
lectorDeLineas.close();
|
|
105
|
+
}
|