From a4ddd949dacf4cdfe36d133d0f427fbadc1c780c Mon Sep 17 00:00:00 2001 From: Zathiald Date: Fri, 6 Sep 2024 16:22:20 -0600 Subject: [PATCH 001/231] feat add backend agregarRutas --- models/ruta/ruta.model.js | 53 +++++++++++++++++++ .../controllers/registrarRuta.controller.js | 24 +++++++++ modules/mapa/routes/mapaIndex.routes.js | 6 +-- modules/mapa/routes/registrarRuta.routes.js | 10 ++++ 4 files changed, 89 insertions(+), 4 deletions(-) create mode 100644 modules/mapa/controllers/registrarRuta.controller.js create mode 100644 modules/mapa/routes/registrarRuta.routes.js diff --git a/models/ruta/ruta.model.js b/models/ruta/ruta.model.js index e69de29..8dc2fb3 100644 --- a/models/ruta/ruta.model.js +++ b/models/ruta/ruta.model.js @@ -0,0 +1,53 @@ +const mongoose = require('mongoose'); + +const coordenadaSchema = new mongoose.Schema({ + latitud: { + type: Number, + required: true + }, + longitud: { + type: Number, + required: true + }, + tipo: { + type: String, + required: true + } +}); + +const rutaSchema = new mongoose.Schema({ + titulo: { + type: String, + required: true + }, + distancia: { + type: String, + required: true + }, + tiempo: { + type: String, + required: true + }, + nivel: { + type: Number, + required: true, + }, + lugar: { + type: String, + required: true + }, + descanso: { + type: String, + required: false + }, + coordenadas: { + type: [coordenadaSchema], + required: true + }, +}, { + collection: 'Rutas' +}); + +const Ruta = mongoose.model('Ruta', rutaSchema); + +module.exports = Ruta; \ No newline at end of file diff --git a/modules/mapa/controllers/registrarRuta.controller.js b/modules/mapa/controllers/registrarRuta.controller.js new file mode 100644 index 0000000..ce93b20 --- /dev/null +++ b/modules/mapa/controllers/registrarRuta.controller.js @@ -0,0 +1,24 @@ +const Ruta = require('../../../models/ruta/ruta.model'); + +exports.postRuta = async (req, res) => { + try { + const nuevaRuta = new Ruta({ + titulo: req.body.Titulo, + distancia: req.body.Distancia, + tiempo: req.body.Tiempo, + nivel: req.body.Nivel, + lugar: req.body.Lugar, + descanso: req.body.Descanso, + coordenadas: req.body.Coordenadas, + }); + + const rutaGuardada = await nuevaRuta.save(); + res.status(201).json(rutaGuardada); + } catch (error) { + console.error('Error al guardar la ruta:', error); + res.status(500).json({ + message: 'Error al guardar la ruta', + error: error.message || error + }); + } +}; \ No newline at end of file diff --git a/modules/mapa/routes/mapaIndex.routes.js b/modules/mapa/routes/mapaIndex.routes.js index 4f3c24d..21036cc 100644 --- a/modules/mapa/routes/mapaIndex.routes.js +++ b/modules/mapa/routes/mapaIndex.routes.js @@ -1,10 +1,8 @@ const express = require('express'); const router = express.Router(); -// Importen aquí los archivos de ruta del módulo -// EJEMPLO: const registrarActividadRoute = require('./registrarActividad.routes'); +const registrarRutaRoute = require('./registrarRuta.routes'); -// Pongan la ruta que quieren usar y el archivo de la ruta de la funcionalidad -// EJEMPLO router.use('/registrar', registrarActividadRoute); +router.use('/', registrarRutaRoute); module.exports = router; \ No newline at end of file diff --git a/modules/mapa/routes/registrarRuta.routes.js b/modules/mapa/routes/registrarRuta.routes.js new file mode 100644 index 0000000..1fe3597 --- /dev/null +++ b/modules/mapa/routes/registrarRuta.routes.js @@ -0,0 +1,10 @@ +const express = require('express'); +const router = express.Router(); + +// Importar el controlador que maneja la creación de actividades +const registrarRutaController = require('../controllers/registrarRuta.controller'); + +// Definir la ruta para crear una actividad +router.post('/registrarRuta', registrarRutaController.postRuta); + +module.exports = router; \ No newline at end of file From 66e58853ded1c056609ef2634a30c0499bc86e63 Mon Sep 17 00:00:00 2001 From: Jesus0204 Date: Sun, 8 Sep 2024 00:53:03 -0600 Subject: [PATCH 002/231] feat: Base de registrar usuario con MongoDB --- .gitignore | 3 + app.js | 2 + models/perfil/contienePrivilegio.model.js | 18 + models/perfil/poseeRol.model.js | 18 + models/perfil/privilegio.model.js | 19 + models/perfil/rol.model.js | 19 + models/perfil/usuario.model.js | 39 +- .../registrarUsuario.controller.js | 39 + .../session/routes/registrarUsuario.routes.js | 8 + modules/session/routes/sessionIndex.routes.js | 8 + package-lock.json | 1841 ++++++++++++++++- package.json | 2 + util/firebase.js | 9 + util/verifyUserToken.js | 34 + 14 files changed, 2026 insertions(+), 33 deletions(-) create mode 100644 modules/session/controllers/registrarUsuario.controller.js create mode 100644 modules/session/routes/registrarUsuario.routes.js create mode 100644 modules/session/routes/sessionIndex.routes.js create mode 100644 util/firebase.js create mode 100644 util/verifyUserToken.js diff --git a/.gitignore b/.gitignore index 18fa98c..bc4e2bd 100644 --- a/.gitignore +++ b/.gitignore @@ -134,3 +134,6 @@ dist # Generated by vscode .vscode/ + +# Firebase Service SDK +/util/firebase-adminsdk.json \ No newline at end of file diff --git a/app.js b/app.js index e50314b..e2b10da 100644 --- a/app.js +++ b/app.js @@ -42,6 +42,7 @@ const preguntasRoutes = require('./modules/preguntasFrecuentes/routes/preguntasI const rentaRoutes = require('./modules/renta/routes/rentaIndex.routes'); const reporteRoutes = require('./modules/reporte/routes/reporteIndex.routes'); const rodadasRoutes = require('./modules/rodadas/routes/rodadasIndex.routes'); +const sessionRoutes = require('./modules/session/routes/sessionIndex.routes'); // Usar las rutas de los módulos app.use('/actividades', actividadesRoutes); @@ -55,6 +56,7 @@ app.use('/preguntasFrecuentes', preguntasRoutes); app.use('/renta', rentaRoutes); app.use('/reporte', reporteRoutes); app.use('/rodadas', rodadasRoutes); +app.use('/session', sessionRoutes); // Middleware para verificar si la sesión está activa // function checkSession(req, res, next) { diff --git a/models/perfil/contienePrivilegio.model.js b/models/perfil/contienePrivilegio.model.js index e69de29..a67ec5f 100644 --- a/models/perfil/contienePrivilegio.model.js +++ b/models/perfil/contienePrivilegio.model.js @@ -0,0 +1,18 @@ +const mongoose = require('mongoose'); + +const ContienePrivilegioSchema = new mongoose.Schema({ + IDPrivilegio: { + type: mongoose.SchemaTypes.ObjectId, + ref: "Privilegio" + }, + IDRol: { + type: mongoose.SchemaTypes.ObjectId, + ref: "Rol" + } +}, { + collection: 'Contiene' +}); + +const ContienePrivilegio = mongoose.model('ContienePrivilegio', ContienePrivilegioSchema); + +module.exports = ContienePrivilegio; \ No newline at end of file diff --git a/models/perfil/poseeRol.model.js b/models/perfil/poseeRol.model.js index e69de29..61d5d90 100644 --- a/models/perfil/poseeRol.model.js +++ b/models/perfil/poseeRol.model.js @@ -0,0 +1,18 @@ +const mongoose = require('mongoose'); + +const PoseeRolSchema = new mongoose.Schema({ + IDUsuario: { + type: mongoose.SchemaTypes.ObjectId, + ref: "Usuario" + }, + IDRol: { + type: mongoose.SchemaTypes.ObjectId, + ref: "Rol" + } +}, { + collection: 'Posee' +}); + +const PoseeRol = mongoose.model('PoseeRol', PoseeRolSchema); + +module.exports = PoseeRol; \ No newline at end of file diff --git a/models/perfil/privilegio.model.js b/models/perfil/privilegio.model.js index e69de29..4532b70 100644 --- a/models/perfil/privilegio.model.js +++ b/models/perfil/privilegio.model.js @@ -0,0 +1,19 @@ +const mongoose = require('mongoose'); + +const PrivilegioSchema = new mongoose.Schema({ + nombre: { + type: String, + required: true, + }, + createdAt: { + type: Date, + immutable: true, + default: () => Date.now(), + } +}, { + collection: 'Privilegio' +}); + +const Privilegio = mongoose.model('Privilegio', PrivilegioSchema); + +module.exports = Privilegio; \ No newline at end of file diff --git a/models/perfil/rol.model.js b/models/perfil/rol.model.js index e69de29..424d54b 100644 --- a/models/perfil/rol.model.js +++ b/models/perfil/rol.model.js @@ -0,0 +1,19 @@ +const mongoose = require('mongoose'); + +const RolSchema = new mongoose.Schema({ + nombre: { + type: String, + required: true, + }, + createdAt: { + type: Date, + immutable: true, + default: () => Date.now(), + } +}, { + collection: 'Rol' +}); + +const Rol = mongoose.model('Rol', RolSchema); + +module.exports = Rol; \ No newline at end of file diff --git a/models/perfil/usuario.model.js b/models/perfil/usuario.model.js index 4010bb7..0ecb9cd 100644 --- a/models/perfil/usuario.model.js +++ b/models/perfil/usuario.model.js @@ -1,19 +1,42 @@ const mongoose = require('mongoose'); const usuarioSchema = new mongoose.Schema({ - username: String, - nombre: String, - edad: Number, - contraseña: String, - tipoSangre: String, - correoElectronico: String, - numeroEmergencia: String, + username: { + type: String, + required: true, + }, + nombre: { + type: String, + required: true, + }, + edad: { + type: Number, + required: true, + }, + tipoSangre: { + type: String, + required: true, + }, + correoElectronico: { + type: String, + required: true, + unique: true, + }, + numeroEmergencia: { + type: String, + required: true, + }, fechaRegistro: { type: Date, + immutable: true, default: Date.now + }, + firebaseUID: { + type: String, + unique: true, } }, { - collection: 'Usuarios' + collection: 'Usuario' }); const Usuario = mongoose.model('Usuario', usuarioSchema); diff --git a/modules/session/controllers/registrarUsuario.controller.js b/modules/session/controllers/registrarUsuario.controller.js new file mode 100644 index 0000000..2f66aae --- /dev/null +++ b/modules/session/controllers/registrarUsuario.controller.js @@ -0,0 +1,39 @@ +// const admin = require('../../../util/firebase'); +const Usuario = require('../../../models/perfil/usuario.model'); + +exports.registrarUsuario = async (request, response) => { + try { + // Sacar los datos body + const { + username, + nombre, + edad, + tipoSangre, + correoElectronico, + numeroEmergencia + } = request.body; + + // Crear el usuario en MongoDB, por ahora sin firebaseUID + const newUser = new Usuario({ + username, + nombre, + edad, + tipoSangre, + correoElectronico, + numeroEmergencia + // firebaseUID: uid, // Descomentar cuando uses Firebase + }); + + await newUser.save(); + + response.status(201).json({ + message: 'User registered successfully', + user: newUser + }); + + } catch (error) { + response.status(400).json({ + error: error.message + }); + } +}; \ No newline at end of file diff --git a/modules/session/routes/registrarUsuario.routes.js b/modules/session/routes/registrarUsuario.routes.js new file mode 100644 index 0000000..4d1d743 --- /dev/null +++ b/modules/session/routes/registrarUsuario.routes.js @@ -0,0 +1,8 @@ +const express = require('express'); +const router = express.Router(); + +const registrarUsuarioController = require('../controllers/registrarUsuario.controller'); + +router.post('/', registrarUsuarioController.registrarUsuario); + +module.exports = router; \ No newline at end of file diff --git a/modules/session/routes/sessionIndex.routes.js b/modules/session/routes/sessionIndex.routes.js new file mode 100644 index 0000000..8c7d4ad --- /dev/null +++ b/modules/session/routes/sessionIndex.routes.js @@ -0,0 +1,8 @@ +const express = require('express'); +const router = express.Router(); + +const registrarUsuarioRoute = require('./registrarUsuario.routes'); + +router.use('/registrarUsuario', registrarUsuarioRoute); + +module.exports = router; \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 8f0e5c4..49f538b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,9 @@ "license": "MIT", "dependencies": { "compression": "^1.7.4", + "dotenv": "^16.4.5", "express": "^4.19.2", + "firebase-admin": "^12.4.0", "mongoose": "^8.6.0", "nodemon": "^3.1.4" }, @@ -181,6 +183,217 @@ "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } }, + "node_modules/@fastify/busboy": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@fastify/busboy/-/busboy-3.0.0.tgz", + "integrity": "sha512-83rnH2nCvclWaPQQKvkJ2pdOjG4TZyEVuFDnlOF6KP08lDaaceVyw/W63mDuafQT+MKHCvXIPpE5uYWeM0rT4w==", + "license": "MIT" + }, + "node_modules/@firebase/app-check-interop-types": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/@firebase/app-check-interop-types/-/app-check-interop-types-0.3.2.tgz", + "integrity": "sha512-LMs47Vinv2HBMZi49C09dJxp0QT5LwDzFaVGf/+ITHe3BlIhUiLNttkATSXplc89A2lAaeTqjgqVkiRfUGyQiQ==", + "license": "Apache-2.0" + }, + "node_modules/@firebase/app-types": { + "version": "0.9.2", + "resolved": "https://registry.npmjs.org/@firebase/app-types/-/app-types-0.9.2.tgz", + "integrity": "sha512-oMEZ1TDlBz479lmABwWsWjzHwheQKiAgnuKxE0pz0IXCVx7/rtlkx1fQ6GfgK24WCrxDKMplZrT50Kh04iMbXQ==", + "license": "Apache-2.0" + }, + "node_modules/@firebase/auth-interop-types": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/@firebase/auth-interop-types/-/auth-interop-types-0.2.3.tgz", + "integrity": "sha512-Fc9wuJGgxoxQeavybiuwgyi+0rssr76b+nHpj+eGhXFYAdudMWyfBHvFL/I5fEHniUM/UQdFzi9VXJK2iZF7FQ==", + "license": "Apache-2.0" + }, + "node_modules/@firebase/component": { + "version": "0.6.8", + "resolved": "https://registry.npmjs.org/@firebase/component/-/component-0.6.8.tgz", + "integrity": "sha512-LcNvxGLLGjBwB0dJUsBGCej2fqAepWyBubs4jt1Tiuns7QLbXHuyObZ4aMeBjZjWx4m8g1LoVI9QFpSaq/k4/g==", + "license": "Apache-2.0", + "dependencies": { + "@firebase/util": "1.9.7", + "tslib": "^2.1.0" + } + }, + "node_modules/@firebase/database": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/@firebase/database/-/database-1.0.7.tgz", + "integrity": "sha512-wjXr5AO8RPxVVg7rRCYffT7FMtBjHRfJ9KMwi19MbOf0vBf0H9YqW3WCgcnLpXI6ehiUcU3z3qgPnnU0nK6SnA==", + "license": "Apache-2.0", + "dependencies": { + "@firebase/app-check-interop-types": "0.3.2", + "@firebase/auth-interop-types": "0.2.3", + "@firebase/component": "0.6.8", + "@firebase/logger": "0.4.2", + "@firebase/util": "1.9.7", + "faye-websocket": "0.11.4", + "tslib": "^2.1.0" + } + }, + "node_modules/@firebase/database-compat": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/@firebase/database-compat/-/database-compat-1.0.7.tgz", + "integrity": "sha512-R/3B+VVzEFN5YcHmfWns3eitA8fHLTL03io+FIoMcTYkajFnrBdS3A+g/KceN9omP7FYYYGTQWF9lvbEx6eMEg==", + "license": "Apache-2.0", + "dependencies": { + "@firebase/component": "0.6.8", + "@firebase/database": "1.0.7", + "@firebase/database-types": "1.0.4", + "@firebase/logger": "0.4.2", + "@firebase/util": "1.9.7", + "tslib": "^2.1.0" + } + }, + "node_modules/@firebase/database-types": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@firebase/database-types/-/database-types-1.0.4.tgz", + "integrity": "sha512-mz9ZzbH6euFXbcBo+enuJ36I5dR5w+enJHHjy9Y5ThCdKUseqfDjW3vCp1YxE9zygFCSjJJ/z1cQ+zodvUcwPQ==", + "license": "Apache-2.0", + "dependencies": { + "@firebase/app-types": "0.9.2", + "@firebase/util": "1.9.7" + } + }, + "node_modules/@firebase/logger": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/@firebase/logger/-/logger-0.4.2.tgz", + "integrity": "sha512-Q1VuA5M1Gjqrwom6I6NUU4lQXdo9IAQieXlujeHZWvRt1b7qQ0KwBaNAjgxG27jgF9/mUwsNmO8ptBCGVYhB0A==", + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.1.0" + } + }, + "node_modules/@firebase/util": { + "version": "1.9.7", + "resolved": "https://registry.npmjs.org/@firebase/util/-/util-1.9.7.tgz", + "integrity": "sha512-fBVNH/8bRbYjqlbIhZ+lBtdAAS4WqZumx03K06/u7fJSpz1TGjEMm1ImvKD47w+xaFKIP2ori6z8BrbakRfjJA==", + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.1.0" + } + }, + "node_modules/@google-cloud/firestore": { + "version": "7.10.0", + "resolved": "https://registry.npmjs.org/@google-cloud/firestore/-/firestore-7.10.0.tgz", + "integrity": "sha512-VFNhdHvfnmqcHHs6YhmSNHHxQqaaD64GwiL0c+e1qz85S8SWZPC2XFRf8p9yHRTF40Kow424s1KBU9f0fdQa+Q==", + "license": "Apache-2.0", + "optional": true, + "dependencies": { + "@opentelemetry/api": "^1.3.0", + "fast-deep-equal": "^3.1.1", + "functional-red-black-tree": "^1.0.1", + "google-gax": "^4.3.3", + "protobufjs": "^7.2.6" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@google-cloud/paginator": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/@google-cloud/paginator/-/paginator-5.0.2.tgz", + "integrity": "sha512-DJS3s0OVH4zFDB1PzjxAsHqJT6sKVbRwwML0ZBP9PbU7Yebtu/7SWMRzvO2J3nUi9pRNITCfu4LJeooM2w4pjg==", + "license": "Apache-2.0", + "optional": true, + "dependencies": { + "arrify": "^2.0.0", + "extend": "^3.0.2" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@google-cloud/projectify": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@google-cloud/projectify/-/projectify-4.0.0.tgz", + "integrity": "sha512-MmaX6HeSvyPbWGwFq7mXdo0uQZLGBYCwziiLIGq5JVX+/bdI3SAq6bP98trV5eTWfLuvsMcIC1YJOF2vfteLFA==", + "license": "Apache-2.0", + "optional": true, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@google-cloud/promisify": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@google-cloud/promisify/-/promisify-4.0.0.tgz", + "integrity": "sha512-Orxzlfb9c67A15cq2JQEyVc7wEsmFBmHjZWZYQMUyJ1qivXyMwdyNOs9odi79hze+2zqdTtu1E19IM/FtqZ10g==", + "license": "Apache-2.0", + "optional": true, + "engines": { + "node": ">=14" + } + }, + "node_modules/@google-cloud/storage": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@google-cloud/storage/-/storage-7.12.1.tgz", + "integrity": "sha512-Z3ZzOnF3YKLuvpkvF+TjQ6lztxcAyTILp+FjKonmVpEwPa9vFvxpZjubLR4sB6bf19i/8HL2AXRjA0YFgHFRmQ==", + "license": "Apache-2.0", + "optional": true, + "dependencies": { + "@google-cloud/paginator": "^5.0.0", + "@google-cloud/projectify": "^4.0.0", + "@google-cloud/promisify": "^4.0.0", + "abort-controller": "^3.0.0", + "async-retry": "^1.3.3", + "duplexify": "^4.1.3", + "fast-xml-parser": "^4.4.1", + "gaxios": "^6.0.2", + "google-auth-library": "^9.6.3", + "html-entities": "^2.5.2", + "mime": "^3.0.0", + "p-limit": "^3.0.1", + "retry-request": "^7.0.0", + "teeny-request": "^9.0.0", + "uuid": "^8.0.0" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/@google-cloud/storage/node_modules/mime": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-3.0.0.tgz", + "integrity": "sha512-jSCU7/VB1loIWBZe14aEYHU/+1UMEHoaO7qxCOVJOw9GgH72VAWppxNcjU+x9a2k3GSIBXNKxXQFqRvvZ7vr3A==", + "license": "MIT", + "optional": true, + "bin": { + "mime": "cli.js" + }, + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/@google-cloud/storage/node_modules/uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "license": "MIT", + "optional": true, + "bin": { + "uuid": "dist/bin/uuid" + } + }, + "node_modules/@grpc/proto-loader": { + "version": "0.7.13", + "resolved": "https://registry.npmjs.org/@grpc/proto-loader/-/proto-loader-0.7.13.tgz", + "integrity": "sha512-AiXO/bfe9bmxBjxxtYxFAXGZvMaN5s8kO+jBHAJCON8rJoB5YS/D6X7ZNc6XQkuHNmyl4CYaMI1fJ/Gn27RGGw==", + "license": "Apache-2.0", + "optional": true, + "dependencies": { + "lodash.camelcase": "^4.3.0", + "long": "^5.0.0", + "protobufjs": "^7.2.5", + "yargs": "^17.7.2" + }, + "bin": { + "proto-loader-gen-types": "build/bin/proto-loader-gen-types.js" + }, + "engines": { + "node": ">=6" + } + }, "node_modules/@humanwhocodes/module-importer": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", @@ -209,6 +422,17 @@ "url": "https://github.com/sponsors/nzakas" } }, + "node_modules/@js-sdsl/ordered-map": { + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/@js-sdsl/ordered-map/-/ordered-map-4.4.2.tgz", + "integrity": "sha512-iUKgm52T8HOE/makSxjqoWhe95ZJA1/G1sYsGev2JDKUSS14KAgg1LHb+Ba+IPow0xflbnSkOsZcO08C7w1gYw==", + "license": "MIT", + "optional": true, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/js-sdsl" + } + }, "node_modules/@mongodb-js/saslprep": { "version": "1.1.8", "resolved": "https://registry.npmjs.org/@mongodb-js/saslprep/-/saslprep-1.1.8.tgz", @@ -256,6 +480,240 @@ "node": ">= 8" } }, + "node_modules/@opentelemetry/api": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/api/-/api-1.9.0.tgz", + "integrity": "sha512-3giAOQvZiH5F9bMlMiv8+GSPMeqg0dbaeo58/0SlA9sxSqZhnUtxzX9/2FzyhS9sWQf5S0GJE0AKBrFqjpeYcg==", + "license": "Apache-2.0", + "optional": true, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/@protobufjs/aspromise": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz", + "integrity": "sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ==", + "license": "BSD-3-Clause", + "optional": true + }, + "node_modules/@protobufjs/base64": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz", + "integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==", + "license": "BSD-3-Clause", + "optional": true + }, + "node_modules/@protobufjs/codegen": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.4.tgz", + "integrity": "sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg==", + "license": "BSD-3-Clause", + "optional": true + }, + "node_modules/@protobufjs/eventemitter": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz", + "integrity": "sha512-j9ednRT81vYJ9OfVuXG6ERSTdEL1xVsNgqpkxMsbIabzSo3goCjDIveeGv5d03om39ML71RdmrGNjG5SReBP/Q==", + "license": "BSD-3-Clause", + "optional": true + }, + "node_modules/@protobufjs/fetch": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz", + "integrity": "sha512-lljVXpqXebpsijW71PZaCYeIcE5on1w5DlQy5WH6GLbFryLUrBD4932W/E2BSpfRJWseIL4v/KPgBFxDOIdKpQ==", + "license": "BSD-3-Clause", + "optional": true, + "dependencies": { + "@protobufjs/aspromise": "^1.1.1", + "@protobufjs/inquire": "^1.1.0" + } + }, + "node_modules/@protobufjs/float": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz", + "integrity": "sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ==", + "license": "BSD-3-Clause", + "optional": true + }, + "node_modules/@protobufjs/inquire": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz", + "integrity": "sha512-kdSefcPdruJiFMVSbn801t4vFK7KB/5gd2fYvrxhuJYg8ILrmn9SKSX2tZdV6V+ksulWqS7aXjBcRXl3wHoD9Q==", + "license": "BSD-3-Clause", + "optional": true + }, + "node_modules/@protobufjs/path": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz", + "integrity": "sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA==", + "license": "BSD-3-Clause", + "optional": true + }, + "node_modules/@protobufjs/pool": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz", + "integrity": "sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw==", + "license": "BSD-3-Clause", + "optional": true + }, + "node_modules/@protobufjs/utf8": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz", + "integrity": "sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==", + "license": "BSD-3-Clause", + "optional": true + }, + "node_modules/@tootallnate/once": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-2.0.0.tgz", + "integrity": "sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A==", + "license": "MIT", + "optional": true, + "engines": { + "node": ">= 10" + } + }, + "node_modules/@types/body-parser": { + "version": "1.19.5", + "resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.5.tgz", + "integrity": "sha512-fB3Zu92ucau0iQ0JMCFQE7b/dv8Ot07NI3KaZIkIUNXq82k4eBAqUaneXfleGY9JWskeS9y+u0nXMyspcuQrCg==", + "license": "MIT", + "dependencies": { + "@types/connect": "*", + "@types/node": "*" + } + }, + "node_modules/@types/caseless": { + "version": "0.12.5", + "resolved": "https://registry.npmjs.org/@types/caseless/-/caseless-0.12.5.tgz", + "integrity": "sha512-hWtVTC2q7hc7xZ/RLbxapMvDMgUnDvKvMOpKal4DrMyfGBUfB1oKaZlIRr6mJL+If3bAP6sV/QneGzF6tJjZDg==", + "license": "MIT", + "optional": true + }, + "node_modules/@types/connect": { + "version": "3.4.38", + "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.38.tgz", + "integrity": "sha512-K6uROf1LD88uDQqJCktA4yzL1YYAK6NgfsI0v/mTgyPKWsX1CnJ0XPSDhViejru1GcRkLWb8RlzFYJRqGUbaug==", + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/express": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.21.tgz", + "integrity": "sha512-ejlPM315qwLpaQlQDTjPdsUFSc6ZsP4AN6AlWnogPjQ7CVi7PYF3YVz+CY3jE2pwYf7E/7HlDAN0rV2GxTG0HQ==", + "license": "MIT", + "dependencies": { + "@types/body-parser": "*", + "@types/express-serve-static-core": "^4.17.33", + "@types/qs": "*", + "@types/serve-static": "*" + } + }, + "node_modules/@types/express-serve-static-core": { + "version": "4.19.5", + "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.19.5.tgz", + "integrity": "sha512-y6W03tvrACO72aijJ5uF02FRq5cgDR9lUxddQ8vyF+GvmjJQqbzDcJngEjURc+ZsG31VI3hODNZJ2URj86pzmg==", + "license": "MIT", + "dependencies": { + "@types/node": "*", + "@types/qs": "*", + "@types/range-parser": "*", + "@types/send": "*" + } + }, + "node_modules/@types/http-errors": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@types/http-errors/-/http-errors-2.0.4.tgz", + "integrity": "sha512-D0CFMMtydbJAegzOyHjtiKPLlvnm3iTZyZRSZoLq2mRhDdmLfIWOCYPfQJ4cu2erKghU++QvjcUjp/5h7hESpA==", + "license": "MIT" + }, + "node_modules/@types/jsonwebtoken": { + "version": "9.0.6", + "resolved": "https://registry.npmjs.org/@types/jsonwebtoken/-/jsonwebtoken-9.0.6.tgz", + "integrity": "sha512-/5hndP5dCjloafCXns6SZyESp3Ldq7YjH3zwzwczYnjxIT0Fqzk5ROSYVGfFyczIue7IUEj8hkvLbPoLQ18vQw==", + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/long": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@types/long/-/long-4.0.2.tgz", + "integrity": "sha512-MqTGEo5bj5t157U6fA/BiDynNkn0YknVdh48CMPkTSpFTVmvao5UQmm7uEF6xBEo7qIMAlY/JSleYaE6VOdpaA==", + "license": "MIT", + "optional": true + }, + "node_modules/@types/mime": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.5.tgz", + "integrity": "sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w==", + "license": "MIT" + }, + "node_modules/@types/node": { + "version": "22.5.4", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.5.4.tgz", + "integrity": "sha512-FDuKUJQm/ju9fT/SeX/6+gBzoPzlVCzfzmGkwKvRHQVxi4BntVbyIwf6a4Xn62mrvndLiml6z/UBXIdEVjQLXg==", + "license": "MIT", + "dependencies": { + "undici-types": "~6.19.2" + } + }, + "node_modules/@types/qs": { + "version": "6.9.15", + "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.15.tgz", + "integrity": "sha512-uXHQKES6DQKKCLh441Xv/dwxOq1TVS3JPUMlEqoEglvlhR6Mxnlew/Xq/LRVHpLyk7iK3zODe1qYHIMltO7XGg==", + "license": "MIT" + }, + "node_modules/@types/range-parser": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.7.tgz", + "integrity": "sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ==", + "license": "MIT" + }, + "node_modules/@types/request": { + "version": "2.48.12", + "resolved": "https://registry.npmjs.org/@types/request/-/request-2.48.12.tgz", + "integrity": "sha512-G3sY+NpsA9jnwm0ixhAFQSJ3Q9JkpLZpJbI3GMv0mIAT0y3mRabYeINzal5WOChIiaTEGQYlHOKgkaM9EisWHw==", + "license": "MIT", + "optional": true, + "dependencies": { + "@types/caseless": "*", + "@types/node": "*", + "@types/tough-cookie": "*", + "form-data": "^2.5.0" + } + }, + "node_modules/@types/send": { + "version": "0.17.4", + "resolved": "https://registry.npmjs.org/@types/send/-/send-0.17.4.tgz", + "integrity": "sha512-x2EM6TJOybec7c52BX0ZspPodMsQUd5L6PRwOunVyVUhXiBSKf3AezDL8Dgvgt5o0UfKNfuA0eMLr2wLT4AiBA==", + "license": "MIT", + "dependencies": { + "@types/mime": "^1", + "@types/node": "*" + } + }, + "node_modules/@types/serve-static": { + "version": "1.15.7", + "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.15.7.tgz", + "integrity": "sha512-W8Ym+h8nhuRwaKPaDw34QUkwsGi6Rc4yYqvKFo5rm2FUEhCFbzVWrxXUxuKK8TASjWsysJY0nsmNCGhCOIsrOw==", + "license": "MIT", + "dependencies": { + "@types/http-errors": "*", + "@types/node": "*", + "@types/send": "*" + } + }, + "node_modules/@types/tough-cookie": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/@types/tough-cookie/-/tough-cookie-4.0.5.tgz", + "integrity": "sha512-/Ad8+nIOV7Rl++6f1BdKxFSMgmoqEoYbHRpPcx3JEfv8VRsQe9Z4mCXeJBzxs7mbHY/XOZZuXlRNfhpVPbs6ZA==", + "license": "MIT", + "optional": true + }, "node_modules/@types/webidl-conversions": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/@types/webidl-conversions/-/webidl-conversions-7.0.3.tgz", @@ -271,6 +729,19 @@ "@types/webidl-conversions": "*" } }, + "node_modules/abort-controller": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz", + "integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==", + "license": "MIT", + "optional": true, + "dependencies": { + "event-target-shim": "^5.0.0" + }, + "engines": { + "node": ">=6.5" + } + }, "node_modules/accepts": { "version": "1.3.8", "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", @@ -307,6 +778,44 @@ "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" } }, + "node_modules/agent-base": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.1.tgz", + "integrity": "sha512-H0TSyFNDMomMNJQBn8wFV5YC/2eJ+VXECwOadZJT554xP6cODZHPX3H9QMQECxvrgiSOP1pHjy1sMWQVYJOUOA==", + "license": "MIT", + "optional": true, + "dependencies": { + "debug": "^4.3.4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/agent-base/node_modules/debug": { + "version": "4.3.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", + "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", + "license": "MIT", + "optional": true, + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/agent-base/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "license": "MIT", + "optional": true + }, "node_modules/ajv": { "version": "6.12.6", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", @@ -328,7 +837,7 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true, + "devOptional": true, "license": "MIT", "engines": { "node": ">=8" @@ -338,7 +847,7 @@ "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, + "devOptional": true, "license": "MIT", "dependencies": { "color-convert": "^2.0.1" @@ -376,12 +885,70 @@ "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==", "license": "MIT" }, + "node_modules/arrify": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-2.0.1.tgz", + "integrity": "sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug==", + "license": "MIT", + "optional": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/async-retry": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/async-retry/-/async-retry-1.3.3.tgz", + "integrity": "sha512-wfr/jstw9xNi/0teMHrRW7dsz3Lt5ARhYNZ2ewpadnhaIp5mbALhOAP+EAdsC7t4Z6wqsDVv9+W6gm1Dk9mEyw==", + "license": "MIT", + "optional": true, + "dependencies": { + "retry": "0.13.1" + } + }, + "node_modules/asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", + "license": "MIT", + "optional": true + }, "node_modules/balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", "license": "MIT" }, + "node_modules/base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "optional": true + }, + "node_modules/bignumber.js": { + "version": "9.1.2", + "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.1.2.tgz", + "integrity": "sha512-2/mKyZH9K85bzOEfhXDBFZTGd1CTs+5IHpeFQo9luiBG7hghdC851Pj2WAhb6E3R6b9tZj/XKhbg4fum+Kepug==", + "license": "MIT", + "optional": true, + "engines": { + "node": "*" + } + }, "node_modules/binary-extensions": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.3.0.tgz", @@ -449,6 +1016,12 @@ "node": ">=16.20.1" } }, + "node_modules/buffer-equal-constant-time": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", + "integrity": "sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA==", + "license": "BSD-3-Clause" + }, "node_modules/bytes": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", @@ -540,11 +1113,26 @@ "node": ">= 6" } }, + "node_modules/cliui": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "license": "ISC", + "optional": true, + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, "node_modules/color-convert": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, + "devOptional": true, "license": "MIT", "dependencies": { "color-name": "~1.1.4" @@ -557,9 +1145,22 @@ "version": "1.1.4", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true, + "devOptional": true, "license": "MIT" }, + "node_modules/combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "license": "MIT", + "optional": true, + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, "node_modules/compressible": { "version": "2.0.18", "resolved": "https://registry.npmjs.org/compressible/-/compressible-2.0.18.tgz", @@ -695,6 +1296,16 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "license": "MIT", + "optional": true, + "engines": { + "node": ">=0.4.0" + } + }, "node_modules/depd": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", @@ -714,12 +1325,53 @@ "npm": "1.2.8000 || >= 1.4.16" } }, + "node_modules/dotenv": { + "version": "16.4.5", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.4.5.tgz", + "integrity": "sha512-ZmdL2rui+eB2YwhsWzjInR8LldtZHGDoQ1ugH85ppHKwpUHL7j7rN0Ti9NCnGiQbhaZ11FpR+7ao1dNsmduNUg==", + "license": "BSD-2-Clause", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://dotenvx.com" + } + }, + "node_modules/duplexify": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-4.1.3.tgz", + "integrity": "sha512-M3BmBhwJRZsSx38lZyhE53Csddgzl5R7xGJNk7CVddZD6CcmwMCH8J+7AprIrQKH7TonKxaCjcv27Qmf+sQ+oA==", + "license": "MIT", + "optional": true, + "dependencies": { + "end-of-stream": "^1.4.1", + "inherits": "^2.0.3", + "readable-stream": "^3.1.1", + "stream-shift": "^1.0.2" + } + }, + "node_modules/ecdsa-sig-formatter": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz", + "integrity": "sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==", + "license": "Apache-2.0", + "dependencies": { + "safe-buffer": "^5.0.1" + } + }, "node_modules/ee-first": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==", "license": "MIT" }, + "node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "license": "MIT", + "optional": true + }, "node_modules/encodeurl": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", @@ -729,6 +1381,16 @@ "node": ">= 0.8" } }, + "node_modules/end-of-stream": { + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", + "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", + "license": "MIT", + "optional": true, + "dependencies": { + "once": "^1.4.0" + } + }, "node_modules/es-define-property": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", @@ -750,6 +1412,16 @@ "node": ">= 0.4" } }, + "node_modules/escalade": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", + "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", + "license": "MIT", + "optional": true, + "engines": { + "node": ">=6" + } + }, "node_modules/escape-html": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", @@ -957,6 +1629,16 @@ "node": ">= 0.6" } }, + "node_modules/event-target-shim": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz", + "integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==", + "license": "MIT", + "optional": true, + "engines": { + "node": ">=6" + } + }, "node_modules/express": { "version": "4.19.2", "resolved": "https://registry.npmjs.org/express/-/express-4.19.2.tgz", @@ -999,11 +1681,27 @@ "node": ">= 0.10.0" } }, + "node_modules/extend": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", + "license": "MIT", + "optional": true + }, + "node_modules/farmhash-modern": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/farmhash-modern/-/farmhash-modern-1.1.0.tgz", + "integrity": "sha512-6ypT4XfgqJk/F3Yuv4SX26I3doUjt0GTG4a+JgWxXQpxXzTBq8fPUeGHfcYMMDPHJHm3yPOSjaeBwBGAHWXCdA==", + "license": "MIT", + "engines": { + "node": ">=18.0.0" + } + }, "node_modules/fast-deep-equal": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", - "dev": true, + "devOptional": true, "license": "MIT" }, "node_modules/fast-json-stable-stringify": { @@ -1020,6 +1718,29 @@ "dev": true, "license": "MIT" }, + "node_modules/fast-xml-parser": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-4.5.0.tgz", + "integrity": "sha512-/PlTQCI96+fZMAOLMZK4CWG1ItCbfZ/0jx7UIJFChPNrx7tcEgerUgWbeieCM9MfHInUDyK8DWYZ+YrywDJuTg==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/NaturalIntelligence" + }, + { + "type": "paypal", + "url": "https://paypal.me/naturalintelligence" + } + ], + "license": "MIT", + "optional": true, + "dependencies": { + "strnum": "^1.0.5" + }, + "bin": { + "fxparser": "src/cli/cli.js" + } + }, "node_modules/fastq": { "version": "1.17.1", "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.17.1.tgz", @@ -1030,6 +1751,18 @@ "reusify": "^1.0.4" } }, + "node_modules/faye-websocket": { + "version": "0.11.4", + "resolved": "https://registry.npmjs.org/faye-websocket/-/faye-websocket-0.11.4.tgz", + "integrity": "sha512-CzbClwlXAuiRQAlUyfqPgvPoNKTckTPGfwZV4ZdAhVcP2lh9KUxJg2b5GkE7XbjKQ3YJnQ9z6D9ntLAlB+tP8g==", + "license": "Apache-2.0", + "dependencies": { + "websocket-driver": ">=0.5.1" + }, + "engines": { + "node": ">=0.8.0" + } + }, "node_modules/file-entry-cache": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-8.0.0.tgz", @@ -1090,6 +1823,30 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/firebase-admin": { + "version": "12.4.0", + "resolved": "https://registry.npmjs.org/firebase-admin/-/firebase-admin-12.4.0.tgz", + "integrity": "sha512-3HOHqJxNmFv0JgK3voyMQgmcibhJN4LQfZfhnZGb6pcONnZxejki4nQ1twsoJlGaIvgQWBtO7rc5mh/cqlOJNA==", + "license": "Apache-2.0", + "dependencies": { + "@fastify/busboy": "^3.0.0", + "@firebase/database-compat": "^1.0.2", + "@firebase/database-types": "^1.0.0", + "@types/node": "^22.0.1", + "farmhash-modern": "^1.1.0", + "jsonwebtoken": "^9.0.0", + "jwks-rsa": "^3.1.0", + "node-forge": "^1.3.1", + "uuid": "^10.0.0" + }, + "engines": { + "node": ">=14" + }, + "optionalDependencies": { + "@google-cloud/firestore": "^7.7.0", + "@google-cloud/storage": "^7.7.0" + } + }, "node_modules/flat-cache": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-4.0.1.tgz", @@ -1111,6 +1868,21 @@ "dev": true, "license": "ISC" }, + "node_modules/form-data": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.5.1.tgz", + "integrity": "sha512-m21N3WOmEEURgk6B9GLOE4RuWOFf28Lhh9qGYeNlGq4VDXUlJy2th2slBNU8Gp8EzloYZOibZJ7t5ecIrFSjVA==", + "license": "MIT", + "optional": true, + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.6", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 0.12" + } + }, "node_modules/forwarded": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", @@ -1148,8 +1920,144 @@ "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", "license": "MIT", - "funding": { - "url": "https://github.com/sponsors/ljharb" + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/functional-red-black-tree": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", + "integrity": "sha512-dsKNQNdj6xA3T+QlADDA7mOSlX0qiMINjn0cgr+eGHGsbSHzTabcIogz2+p/iqP1Xs6EP/sS2SbqH+brGTbq0g==", + "license": "MIT", + "optional": true + }, + "node_modules/gaxios": { + "version": "6.7.1", + "resolved": "https://registry.npmjs.org/gaxios/-/gaxios-6.7.1.tgz", + "integrity": "sha512-LDODD4TMYx7XXdpwxAVRAIAuB0bzv0s+ywFonY46k126qzQHT9ygyoa9tncmOiQmmDrik65UYsEkv3lbfqQ3yQ==", + "license": "Apache-2.0", + "optional": true, + "dependencies": { + "extend": "^3.0.2", + "https-proxy-agent": "^7.0.1", + "is-stream": "^2.0.0", + "node-fetch": "^2.6.9", + "uuid": "^9.0.1" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/gaxios/node_modules/uuid": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", + "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", + "funding": [ + "https://github.com/sponsors/broofa", + "https://github.com/sponsors/ctavan" + ], + "license": "MIT", + "optional": true, + "bin": { + "uuid": "dist/bin/uuid" + } + }, + "node_modules/gcp-metadata": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-5.3.0.tgz", + "integrity": "sha512-FNTkdNEnBdlqF2oatizolQqNANMrcqJt6AAYt99B3y1aLLC8Hc5IOBb+ZnnzllodEEf6xMBp6wRcBbc16fa65w==", + "license": "Apache-2.0", + "optional": true, + "peer": true, + "dependencies": { + "gaxios": "^5.0.0", + "json-bigint": "^1.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/gcp-metadata/node_modules/agent-base": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", + "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "license": "MIT", + "optional": true, + "peer": true, + "dependencies": { + "debug": "4" + }, + "engines": { + "node": ">= 6.0.0" + } + }, + "node_modules/gcp-metadata/node_modules/debug": { + "version": "4.3.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", + "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", + "license": "MIT", + "optional": true, + "peer": true, + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/gcp-metadata/node_modules/gaxios": { + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/gaxios/-/gaxios-5.1.3.tgz", + "integrity": "sha512-95hVgBRgEIRQQQHIbnxBXeHbW4TqFk4ZDJW7wmVtvYar72FdhRIo1UGOLS2eRAKCPEdPBWu+M7+A33D9CdX9rA==", + "license": "Apache-2.0", + "optional": true, + "peer": true, + "dependencies": { + "extend": "^3.0.2", + "https-proxy-agent": "^5.0.0", + "is-stream": "^2.0.0", + "node-fetch": "^2.6.9" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/gcp-metadata/node_modules/https-proxy-agent": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", + "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", + "license": "MIT", + "optional": true, + "peer": true, + "dependencies": { + "agent-base": "6", + "debug": "4" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/gcp-metadata/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "license": "MIT", + "optional": true, + "peer": true + }, + "node_modules/get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "license": "ISC", + "optional": true, + "engines": { + "node": "6.* || 8.* || >= 10.*" } }, "node_modules/get-intrinsic": { @@ -1197,6 +2105,90 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/google-auth-library": { + "version": "9.14.1", + "resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-9.14.1.tgz", + "integrity": "sha512-Rj+PMjoNFGFTmtItH7gHfbHpGVSb3vmnGK3nwNBqxQF9NoBpttSZI/rc0WiM63ma2uGDQtYEkMHkK9U6937NiA==", + "license": "Apache-2.0", + "optional": true, + "dependencies": { + "base64-js": "^1.3.0", + "ecdsa-sig-formatter": "^1.0.11", + "gaxios": "^6.1.1", + "gcp-metadata": "^6.1.0", + "gtoken": "^7.0.0", + "jws": "^4.0.0" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/google-auth-library/node_modules/gcp-metadata": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-6.1.0.tgz", + "integrity": "sha512-Jh/AIwwgaxan+7ZUUmRLCjtchyDiqh4KjBJ5tW3plBZb5iL/BPcso8A5DlzeD9qlw0duCamnNdpFjxwaT0KyKg==", + "license": "Apache-2.0", + "optional": true, + "dependencies": { + "gaxios": "^6.0.0", + "json-bigint": "^1.0.0" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/google-gax": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/google-gax/-/google-gax-4.4.1.tgz", + "integrity": "sha512-Phyp9fMfA00J3sZbJxbbB4jC55b7DBjE3F6poyL3wKMEBVKA79q6BGuHcTiM28yOzVql0NDbRL8MLLh8Iwk9Dg==", + "license": "Apache-2.0", + "optional": true, + "dependencies": { + "@grpc/grpc-js": "^1.10.9", + "@grpc/proto-loader": "^0.7.13", + "@types/long": "^4.0.0", + "abort-controller": "^3.0.0", + "duplexify": "^4.0.0", + "google-auth-library": "^9.3.0", + "node-fetch": "^2.7.0", + "object-hash": "^3.0.0", + "proto3-json-serializer": "^2.0.2", + "protobufjs": "^7.3.2", + "retry-request": "^7.0.0", + "uuid": "^9.0.1" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/google-gax/node_modules/@grpc/grpc-js": { + "version": "1.11.2", + "resolved": "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-1.11.2.tgz", + "integrity": "sha512-DWp92gDD7/Qkj7r8kus6/HCINeo3yPZWZ3paKgDgsbKbSpoxKg1yvN8xe2Q8uE3zOsPe3bX8FQX2+XValq2yTw==", + "license": "Apache-2.0", + "optional": true, + "dependencies": { + "@grpc/proto-loader": "^0.7.13", + "@js-sdsl/ordered-map": "^4.4.2" + }, + "engines": { + "node": ">=12.10.0" + } + }, + "node_modules/google-gax/node_modules/uuid": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", + "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", + "funding": [ + "https://github.com/sponsors/broofa", + "https://github.com/sponsors/ctavan" + ], + "license": "MIT", + "optional": true, + "bin": { + "uuid": "dist/bin/uuid" + } + }, "node_modules/gopd": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", @@ -1209,6 +2201,20 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/gtoken": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/gtoken/-/gtoken-7.1.0.tgz", + "integrity": "sha512-pCcEwRi+TKpMlxAQObHDQ56KawURgyAf6jtIY046fJ5tIv3zDe/LEIubckAO8fj6JnAxLdmWkUfNyulQ2iKdEw==", + "license": "MIT", + "optional": true, + "dependencies": { + "gaxios": "^6.0.0", + "jws": "^4.0.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, "node_modules/has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", @@ -1267,6 +2273,23 @@ "node": ">= 0.4" } }, + "node_modules/html-entities": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/html-entities/-/html-entities-2.5.2.tgz", + "integrity": "sha512-K//PSRMQk4FZ78Kyau+mZurHn3FH0Vwr+H36eE0rPbeYkRRi9YxceYPhuN60UwWorxyKHhqoAJl2OFKa4BVtaA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/mdevils" + }, + { + "type": "patreon", + "url": "https://patreon.com/mdevils" + } + ], + "license": "MIT", + "optional": true + }, "node_modules/http-errors": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", @@ -1283,6 +2306,104 @@ "node": ">= 0.8" } }, + "node_modules/http-parser-js": { + "version": "0.5.8", + "resolved": "https://registry.npmjs.org/http-parser-js/-/http-parser-js-0.5.8.tgz", + "integrity": "sha512-SGeBX54F94Wgu5RH3X5jsDtf4eHyRogWX1XGT3b4HuW3tQPM4AaBzoUji/4AAJNXCEOWZ5O0DgZmJw1947gD5Q==", + "license": "MIT" + }, + "node_modules/http-proxy-agent": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-5.0.0.tgz", + "integrity": "sha512-n2hY8YdoRE1i7r6M0w9DIw5GgZN0G25P8zLCRQ8rjXtTU3vsNFBI/vWK/UIeE6g5MUUz6avwAPXmL6Fy9D/90w==", + "license": "MIT", + "optional": true, + "dependencies": { + "@tootallnate/once": "2", + "agent-base": "6", + "debug": "4" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/http-proxy-agent/node_modules/agent-base": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", + "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "license": "MIT", + "optional": true, + "dependencies": { + "debug": "4" + }, + "engines": { + "node": ">= 6.0.0" + } + }, + "node_modules/http-proxy-agent/node_modules/debug": { + "version": "4.3.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", + "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", + "license": "MIT", + "optional": true, + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/http-proxy-agent/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "license": "MIT", + "optional": true + }, + "node_modules/https-proxy-agent": { + "version": "7.0.5", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.5.tgz", + "integrity": "sha512-1e4Wqeblerz+tMKPIq2EMGiiWW1dIjZOksyHWSUm1rmuvw/how9hBHZ38lAGj5ID4Ik6EdkOw7NmWPy6LAwalw==", + "license": "MIT", + "optional": true, + "dependencies": { + "agent-base": "^7.0.2", + "debug": "4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/https-proxy-agent/node_modules/debug": { + "version": "4.3.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", + "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", + "license": "MIT", + "optional": true, + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/https-proxy-agent/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "license": "MIT", + "optional": true + }, "node_modules/iconv-lite": { "version": "0.4.24", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", @@ -1374,6 +2495,16 @@ "node": ">=0.10.0" } }, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "license": "MIT", + "optional": true, + "engines": { + "node": ">=8" + } + }, "node_modules/is-glob": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", @@ -1405,6 +2536,19 @@ "node": ">=8" } }, + "node_modules/is-stream": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", + "license": "MIT", + "optional": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", @@ -1412,6 +2556,15 @@ "dev": true, "license": "ISC" }, + "node_modules/jose": { + "version": "4.15.9", + "resolved": "https://registry.npmjs.org/jose/-/jose-4.15.9.tgz", + "integrity": "sha512-1vUQX+IdDMVPj4k8kOxgUqlcK518yluMuGZwqlr44FS1ppZB/5GWh4rZG89erpOBOJjU/OBsnCVFfapsRz6nEA==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/panva" + } + }, "node_modules/js-yaml": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", @@ -1425,6 +2578,16 @@ "js-yaml": "bin/js-yaml.js" } }, + "node_modules/json-bigint": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-bigint/-/json-bigint-1.0.0.tgz", + "integrity": "sha512-SiPv/8VpZuWbvLSMtTDU8hEfrZWg/mH/nV/b4o0CYbSxu1UIQPLdwKOCIyLQX+VIPO5vrLX3i8qtqFyhdPSUSQ==", + "license": "MIT", + "optional": true, + "dependencies": { + "bignumber.js": "^9.0.0" + } + }, "node_modules/json-buffer": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", @@ -1446,6 +2609,118 @@ "dev": true, "license": "MIT" }, + "node_modules/jsonwebtoken": { + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-9.0.2.tgz", + "integrity": "sha512-PRp66vJ865SSqOlgqS8hujT5U4AOgMfhrwYIuIhfKaoSCZcirrmASQr8CX7cUg+RMih+hgznrjp99o+W4pJLHQ==", + "license": "MIT", + "dependencies": { + "jws": "^3.2.2", + "lodash.includes": "^4.3.0", + "lodash.isboolean": "^3.0.3", + "lodash.isinteger": "^4.0.4", + "lodash.isnumber": "^3.0.3", + "lodash.isplainobject": "^4.0.6", + "lodash.isstring": "^4.0.1", + "lodash.once": "^4.0.0", + "ms": "^2.1.1", + "semver": "^7.5.4" + }, + "engines": { + "node": ">=12", + "npm": ">=6" + } + }, + "node_modules/jsonwebtoken/node_modules/jwa": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/jwa/-/jwa-1.4.1.tgz", + "integrity": "sha512-qiLX/xhEEFKUAJ6FiBMbes3w9ATzyk5W7Hvzpa/SLYdxNtng+gcurvrI7TbACjIXlsJyr05/S1oUhZrc63evQA==", + "license": "MIT", + "dependencies": { + "buffer-equal-constant-time": "1.0.1", + "ecdsa-sig-formatter": "1.0.11", + "safe-buffer": "^5.0.1" + } + }, + "node_modules/jsonwebtoken/node_modules/jws": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/jws/-/jws-3.2.2.tgz", + "integrity": "sha512-YHlZCB6lMTllWDtSPHz/ZXTsi8S00usEV6v1tjq8tOUZzw7DpSDWVXjXDre6ed1w/pd495ODpHZYSdkRTsa0HA==", + "license": "MIT", + "dependencies": { + "jwa": "^1.4.1", + "safe-buffer": "^5.0.1" + } + }, + "node_modules/jsonwebtoken/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "license": "MIT" + }, + "node_modules/jwa": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/jwa/-/jwa-2.0.0.tgz", + "integrity": "sha512-jrZ2Qx916EA+fq9cEAeCROWPTfCwi1IVHqT2tapuqLEVVDKFDENFw1oL+MwrTvH6msKxsd1YTDVw6uKEcsrLEA==", + "license": "MIT", + "optional": true, + "dependencies": { + "buffer-equal-constant-time": "1.0.1", + "ecdsa-sig-formatter": "1.0.11", + "safe-buffer": "^5.0.1" + } + }, + "node_modules/jwks-rsa": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/jwks-rsa/-/jwks-rsa-3.1.0.tgz", + "integrity": "sha512-v7nqlfezb9YfHHzYII3ef2a2j1XnGeSE/bK3WfumaYCqONAIstJbrEGapz4kadScZzEt7zYCN7bucj8C0Mv/Rg==", + "license": "MIT", + "dependencies": { + "@types/express": "^4.17.17", + "@types/jsonwebtoken": "^9.0.2", + "debug": "^4.3.4", + "jose": "^4.14.6", + "limiter": "^1.1.5", + "lru-memoizer": "^2.2.0" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/jwks-rsa/node_modules/debug": { + "version": "4.3.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", + "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/jwks-rsa/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "license": "MIT" + }, + "node_modules/jws": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jws/-/jws-4.0.0.tgz", + "integrity": "sha512-KDncfTmOZoOMTFG4mBlG0qUIOlc03fmzH+ru6RgYVZhPkyiy/92Owlt/8UEN+a4TXR1FQetfIpJE8ApdvdVxTg==", + "license": "MIT", + "optional": true, + "dependencies": { + "jwa": "^2.0.0", + "safe-buffer": "^5.0.1" + } + }, "node_modules/kareem": { "version": "2.6.3", "resolved": "https://registry.npmjs.org/kareem/-/kareem-2.6.3.tgz", @@ -1479,28 +2754,117 @@ "node": ">= 0.8.0" } }, - "node_modules/locate-path": { + "node_modules/limiter": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/limiter/-/limiter-1.1.5.tgz", + "integrity": "sha512-FWWMIEOxz3GwUI4Ts/IvgVy6LPvoMPgjMdQ185nN6psJyBJ4yOpzqm695/h5umdLJg2vW3GR5iG11MAkR2AzJA==" + }, + "node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/lodash.camelcase": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz", + "integrity": "sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==", + "license": "MIT", + "optional": true + }, + "node_modules/lodash.clonedeep": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", + "integrity": "sha512-H5ZhCF25riFd9uB5UCkVKo61m3S/xZk1x4wA6yp/L3RFP6Z/eHH1ymQcGLo7J3GMPfm0V/7m1tryHuGVxpqEBQ==", + "license": "MIT" + }, + "node_modules/lodash.includes": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/lodash.includes/-/lodash.includes-4.3.0.tgz", + "integrity": "sha512-W3Bx6mdkRTGtlJISOvVD/lbqjTlPPUDTMnlXZFnVwi9NKJ6tiAk6LVdlhZMm17VZisqhKcgzpO5Wz91PCt5b0w==", + "license": "MIT" + }, + "node_modules/lodash.isboolean": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/lodash.isboolean/-/lodash.isboolean-3.0.3.tgz", + "integrity": "sha512-Bz5mupy2SVbPHURB98VAcw+aHh4vRV5IPNhILUCsOzRmsTmSQ17jIuqopAentWoehktxGd9e/hbIXq980/1QJg==", + "license": "MIT" + }, + "node_modules/lodash.isinteger": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/lodash.isinteger/-/lodash.isinteger-4.0.4.tgz", + "integrity": "sha512-DBwtEWN2caHQ9/imiNeEA5ys1JoRtRfY3d7V9wkqtbycnAmTvRRmbHKDV4a0EYc678/dia0jrte4tjYwVBaZUA==", + "license": "MIT" + }, + "node_modules/lodash.isnumber": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/lodash.isnumber/-/lodash.isnumber-3.0.3.tgz", + "integrity": "sha512-QYqzpfwO3/CWf3XP+Z+tkQsfaLL/EnUlXWVkIk5FUPc4sBdTehEqZONuyRt2P67PXAk+NXmTBcc97zw9t1FQrw==", + "license": "MIT" + }, + "node_modules/lodash.isplainobject": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", + "integrity": "sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA==", + "license": "MIT" + }, + "node_modules/lodash.isstring": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/lodash.isstring/-/lodash.isstring-4.0.1.tgz", + "integrity": "sha512-0wJxfxH1wgO3GrbuP+dTTk7op+6L41QCXbGINEmD+ny/G/eCqGzxyCsh7159S+mgDDcoarnBw6PC1PS5+wUGgw==", + "license": "MIT" + }, + "node_modules/lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/lodash.once": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/lodash.once/-/lodash.once-4.1.1.tgz", + "integrity": "sha512-Sb487aTOCr9drQVL8pIxOzVhafOjZN9UU54hiN8PU3uAiSV7lx1yYNpbNmex2PK6dSJoNTSJUUswT651yww3Mg==", + "license": "MIT" + }, + "node_modules/long": { + "version": "5.2.3", + "resolved": "https://registry.npmjs.org/long/-/long-5.2.3.tgz", + "integrity": "sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q==", + "license": "Apache-2.0", + "optional": true + }, + "node_modules/lru-cache": { "version": "6.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", - "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", - "dev": true, - "license": "MIT", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "license": "ISC", "dependencies": { - "p-locate": "^5.0.0" + "yallist": "^4.0.0" }, "engines": { "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/lodash.merge": { - "version": "4.6.2", - "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", - "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", - "dev": true, - "license": "MIT" + "node_modules/lru-memoizer": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/lru-memoizer/-/lru-memoizer-2.3.0.tgz", + "integrity": "sha512-GXn7gyHAMhO13WSKrIiNfztwxodVsP8IoZ3XfrJV4yH2x0/OeTO/FIaAHTY5YekdGgW94njfuKmyyt1E0mR6Ug==", + "license": "MIT", + "dependencies": { + "lodash.clonedeep": "^4.5.0", + "lru-cache": "6.0.0" + } }, "node_modules/media-typer": { "version": "0.3.0", @@ -1727,6 +3091,61 @@ "node": ">= 0.6" } }, + "node_modules/node-fetch": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", + "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", + "license": "MIT", + "optional": true, + "dependencies": { + "whatwg-url": "^5.0.0" + }, + "engines": { + "node": "4.x || >=6.0.0" + }, + "peerDependencies": { + "encoding": "^0.1.0" + }, + "peerDependenciesMeta": { + "encoding": { + "optional": true + } + } + }, + "node_modules/node-fetch/node_modules/tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", + "license": "MIT", + "optional": true + }, + "node_modules/node-fetch/node_modules/webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==", + "license": "BSD-2-Clause", + "optional": true + }, + "node_modules/node-fetch/node_modules/whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", + "license": "MIT", + "optional": true, + "dependencies": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + }, + "node_modules/node-forge": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-1.3.1.tgz", + "integrity": "sha512-dPEtOeMvF9VMcYV/1Wb8CPoVAXtp6MKMlcbAt4ddqmGqUJ6fQZFXkNZNkNlfevtNkGtaSoXf/vNNNSvgrdXwtA==", + "license": "(BSD-3-Clause OR GPL-2.0)", + "engines": { + "node": ">= 6.13.0" + } + }, "node_modules/nodemon": { "version": "3.1.4", "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-3.1.4.tgz", @@ -1808,6 +3227,16 @@ "node": ">=0.10.0" } }, + "node_modules/object-hash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/object-hash/-/object-hash-3.0.0.tgz", + "integrity": "sha512-RSn9F68PjH9HqtltsSnqYC1XXoWe9Bju5+213R98cNGttag9q9yAOTzdbsqvIa7aNm5WffBZFpWYr2aWrklWAw==", + "license": "MIT", + "optional": true, + "engines": { + "node": ">= 6" + } + }, "node_modules/object-inspect": { "version": "1.13.2", "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.2.tgz", @@ -1841,6 +3270,16 @@ "node": ">= 0.8" } }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "license": "ISC", + "optional": true, + "dependencies": { + "wrappy": "1" + } + }, "node_modules/optionator": { "version": "0.9.4", "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", @@ -1863,7 +3302,7 @@ "version": "3.1.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", - "dev": true, + "devOptional": true, "license": "MIT", "dependencies": { "yocto-queue": "^0.1.0" @@ -1961,6 +3400,44 @@ "node": ">= 0.8.0" } }, + "node_modules/proto3-json-serializer": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/proto3-json-serializer/-/proto3-json-serializer-2.0.2.tgz", + "integrity": "sha512-SAzp/O4Yh02jGdRc+uIrGoe87dkN/XtwxfZ4ZyafJHymd79ozp5VG5nyZ7ygqPM5+cpLDjjGnYFUkngonyDPOQ==", + "license": "Apache-2.0", + "optional": true, + "dependencies": { + "protobufjs": "^7.2.5" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/protobufjs": { + "version": "7.4.0", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.4.0.tgz", + "integrity": "sha512-mRUWCc3KUU4w1jU8sGxICXH/gNS94DvI1gxqDvBzhj1JpcsimQkYiOJfwsPUykUI5ZaspFbSgmBLER8IrQ3tqw==", + "hasInstallScript": true, + "license": "BSD-3-Clause", + "optional": true, + "dependencies": { + "@protobufjs/aspromise": "^1.1.2", + "@protobufjs/base64": "^1.1.2", + "@protobufjs/codegen": "^2.0.4", + "@protobufjs/eventemitter": "^1.1.0", + "@protobufjs/fetch": "^1.1.0", + "@protobufjs/float": "^1.0.2", + "@protobufjs/inquire": "^1.1.0", + "@protobufjs/path": "^1.1.2", + "@protobufjs/pool": "^1.1.0", + "@protobufjs/utf8": "^1.1.0", + "@types/node": ">=13.7.0", + "long": "^5.0.0" + }, + "engines": { + "node": ">=12.0.0" + } + }, "node_modules/proxy-addr": { "version": "2.0.7", "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", @@ -2049,6 +3526,21 @@ "node": ">= 0.8" } }, + "node_modules/readable-stream": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "license": "MIT", + "optional": true, + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/readdirp": { "version": "3.6.0", "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", @@ -2061,6 +3553,16 @@ "node": ">=8.10.0" } }, + "node_modules/require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", + "license": "MIT", + "optional": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/resolve-from": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", @@ -2071,6 +3573,31 @@ "node": ">=4" } }, + "node_modules/retry": { + "version": "0.13.1", + "resolved": "https://registry.npmjs.org/retry/-/retry-0.13.1.tgz", + "integrity": "sha512-XQBQ3I8W1Cge0Seh+6gjj03LbmRFWuoszgK9ooCpwYIrhhoO80pfq4cUkU5DkknwfOfFteRwlZ56PYOGYyFWdg==", + "license": "MIT", + "optional": true, + "engines": { + "node": ">= 4" + } + }, + "node_modules/retry-request": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/retry-request/-/retry-request-7.0.2.tgz", + "integrity": "sha512-dUOvLMJ0/JJYEn8NrpOaGNE7X3vpI5XlZS/u0ANjqtcZVKnIxP7IgCFwrKTxENw29emmwug53awKtaMm4i9g5w==", + "license": "MIT", + "optional": true, + "dependencies": { + "@types/request": "^2.48.8", + "extend": "^3.0.2", + "teeny-request": "^9.0.0" + }, + "engines": { + "node": ">=14" + } + }, "node_modules/reusify": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", @@ -2289,11 +3816,53 @@ "node": ">= 0.8" } }, + "node_modules/stream-events": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/stream-events/-/stream-events-1.0.5.tgz", + "integrity": "sha512-E1GUzBSgvct8Jsb3v2X15pjzN1tYebtbLaMg+eBOUOAxgbLoSbT2NS91ckc5lJD1KfLjId+jXJRgo0qnV5Nerg==", + "license": "MIT", + "optional": true, + "dependencies": { + "stubs": "^3.0.0" + } + }, + "node_modules/stream-shift": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.3.tgz", + "integrity": "sha512-76ORR0DO1o1hlKwTbi/DM3EXWGf3ZJYO8cXX5RJwnul2DEg2oyoZyjLNoQM8WsvZiFKCRfC1O0J7iCvie3RZmQ==", + "license": "MIT", + "optional": true + }, + "node_modules/string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "license": "MIT", + "optional": true, + "dependencies": { + "safe-buffer": "~5.2.0" + } + }, + "node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "license": "MIT", + "optional": true, + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/strip-ansi": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, + "devOptional": true, "license": "MIT", "dependencies": { "ansi-regex": "^5.0.1" @@ -2315,6 +3884,20 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/strnum": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/strnum/-/strnum-1.0.5.tgz", + "integrity": "sha512-J8bbNyKKXl5qYcR36TIO8W3mVGVHrmmxsd5PAItGkmyzwJvybiw2IVq5nqd0i4LSNSkB/sx9VHllbfFdr9k1JA==", + "license": "MIT", + "optional": true + }, + "node_modules/stubs": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/stubs/-/stubs-3.0.0.tgz", + "integrity": "sha512-PdHt7hHUJKxvTCgbKX9C1V/ftOcjJQgz8BZwNfV5c4B6dcGqlpelTbJ999jBGZ2jYiPAwcX5dP6oBwVlBlUbxw==", + "license": "MIT", + "optional": true + }, "node_modules/supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", @@ -2328,6 +3911,89 @@ "node": ">=8" } }, + "node_modules/teeny-request": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/teeny-request/-/teeny-request-9.0.0.tgz", + "integrity": "sha512-resvxdc6Mgb7YEThw6G6bExlXKkv6+YbuzGg9xuXxSgxJF7Ozs+o8Y9+2R3sArdWdW8nOokoQb1yrpFB0pQK2g==", + "license": "Apache-2.0", + "optional": true, + "dependencies": { + "http-proxy-agent": "^5.0.0", + "https-proxy-agent": "^5.0.0", + "node-fetch": "^2.6.9", + "stream-events": "^1.0.5", + "uuid": "^9.0.0" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/teeny-request/node_modules/agent-base": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", + "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "license": "MIT", + "optional": true, + "dependencies": { + "debug": "4" + }, + "engines": { + "node": ">= 6.0.0" + } + }, + "node_modules/teeny-request/node_modules/debug": { + "version": "4.3.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", + "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", + "license": "MIT", + "optional": true, + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/teeny-request/node_modules/https-proxy-agent": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", + "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", + "license": "MIT", + "optional": true, + "dependencies": { + "agent-base": "6", + "debug": "4" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/teeny-request/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "license": "MIT", + "optional": true + }, + "node_modules/teeny-request/node_modules/uuid": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", + "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", + "funding": [ + "https://github.com/sponsors/broofa", + "https://github.com/sponsors/ctavan" + ], + "license": "MIT", + "optional": true, + "bin": { + "uuid": "dist/bin/uuid" + } + }, "node_modules/text-table": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", @@ -2377,6 +4043,12 @@ "node": ">=14" } }, + "node_modules/tslib": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.7.0.tgz", + "integrity": "sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA==", + "license": "0BSD" + }, "node_modules/type-check": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", @@ -2409,6 +4081,12 @@ "integrity": "sha512-WxONCrssBM8TSPRqN5EmsjVrsv4A8X12J4ArBiiayv3DyyG3ZlIg6yysuuSYdZsVz3TKcTg2fd//Ujd4CHV1iA==", "license": "MIT" }, + "node_modules/undici-types": { + "version": "6.19.8", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz", + "integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==", + "license": "MIT" + }, "node_modules/unpipe": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", @@ -2428,6 +4106,13 @@ "punycode": "^2.1.0" } }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", + "license": "MIT", + "optional": true + }, "node_modules/utils-merge": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", @@ -2437,6 +4122,19 @@ "node": ">= 0.4.0" } }, + "node_modules/uuid": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-10.0.0.tgz", + "integrity": "sha512-8XkAphELsDnEGrDxUOHB3RGvXz6TeuYSGEZBOjtTtPm2lwhGBjLgOzLHB63IUWfBpNucQjND6d3AOudO+H3RWQ==", + "funding": [ + "https://github.com/sponsors/broofa", + "https://github.com/sponsors/ctavan" + ], + "license": "MIT", + "bin": { + "uuid": "dist/bin/uuid" + } + }, "node_modules/vary": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", @@ -2455,6 +4153,29 @@ "node": ">=12" } }, + "node_modules/websocket-driver": { + "version": "0.7.4", + "resolved": "https://registry.npmjs.org/websocket-driver/-/websocket-driver-0.7.4.tgz", + "integrity": "sha512-b17KeDIQVjvb0ssuSDF2cYXSg2iztliJ4B9WdsuB6J952qCPKmnVq4DyW5motImXHDC1cBT/1UezrJVsKw5zjg==", + "license": "Apache-2.0", + "dependencies": { + "http-parser-js": ">=0.5.1", + "safe-buffer": ">=5.1.0", + "websocket-extensions": ">=0.1.1" + }, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/websocket-extensions": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/websocket-extensions/-/websocket-extensions-0.1.4.tgz", + "integrity": "sha512-OqedPIGOfsDlo31UNwYbCFMSaO9m9G/0faIHj5/dZFDMFqPTcx6UwqyOy3COEaEOg/9VsGIpdqn62W5KhoKSpg==", + "license": "Apache-2.0", + "engines": { + "node": ">=0.8.0" + } + }, "node_modules/whatwg-url": { "version": "13.0.0", "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-13.0.0.tgz", @@ -2494,11 +4215,81 @@ "node": ">=0.10.0" } }, + "node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "license": "MIT", + "optional": true, + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "license": "ISC", + "optional": true + }, + "node_modules/y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "license": "ISC", + "optional": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "license": "ISC" + }, + "node_modules/yargs": { + "version": "17.7.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", + "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", + "license": "MIT", + "optional": true, + "dependencies": { + "cliui": "^8.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.1.1" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "license": "ISC", + "optional": true, + "engines": { + "node": ">=12" + } + }, "node_modules/yocto-queue": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", - "dev": true, + "devOptional": true, "license": "MIT", "engines": { "node": ">=10" diff --git a/package.json b/package.json index 200e50b..fc4461e 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,9 @@ "homepage": "https://github.com/Saca-la-Bici/app-backend#readme", "dependencies": { "compression": "^1.7.4", + "dotenv": "^16.4.5", "express": "^4.19.2", + "firebase-admin": "^12.4.0", "mongoose": "^8.6.0", "nodemon": "^3.1.4" }, diff --git a/util/firebase.js b/util/firebase.js new file mode 100644 index 0000000..9a73579 --- /dev/null +++ b/util/firebase.js @@ -0,0 +1,9 @@ +const admin = require('firebase-admin'); +const path = require('./firebase-adminsdk.json'); + +admin.initializeApp({ + credential: admin.credential.cert(require(path)) +}); + +// Exportar la instancia de admin para usar en otros archivos +module.exports = admin; \ No newline at end of file diff --git a/util/verifyUserToken.js b/util/verifyUserToken.js new file mode 100644 index 0000000..ba06ee5 --- /dev/null +++ b/util/verifyUserToken.js @@ -0,0 +1,34 @@ +const admin = require('firebase-admin'); + +// Middleware para verificar el idToken +const verifyUserToken = async (request, response, next) => { + + // Extraer el token de los headers + const idToken = request.headers.authorization?.split(' ')[1]; + + if (!idToken) { + return response.status(401).json({ + error: 'No token provided' + }); + } + + try { + // Verificar el token con Firebase Admin SDK + const decodedToken = await admin.auth().verifyIdToken(idToken); + // Guardar el uid de Firebase del usuario en request.user + request.userUID = { + uid: decodedToken.uid + }; + + // Pasar al siguiente middleware + next(); + } catch (error) { + // Regresar el error si por alguna razón el token es incorrecto + return response.status(401).json({ + error: error, + message: 'Invalid token' + }); + } +}; + +module.exports = verifyUserToken; \ No newline at end of file From 75bad29381b308f78c9a416c2186d9d306e3fd49 Mon Sep 17 00:00:00 2001 From: Jesus0204 Date: Sun, 8 Sep 2024 11:58:16 -0600 Subject: [PATCH 003/231] feat: Agregar endpoints para Rol y Privilegios --- .../registrarContiene.controller.js | 264 ++++++++++++++++++ .../registrarPrivilegio.controller.js | 26 ++ .../controllers/registrarRol.controller.js | 25 ++ .../session/routes/rolPrivilegio.routes.js | 12 + modules/session/routes/sessionIndex.routes.js | 2 + 5 files changed, 329 insertions(+) create mode 100644 modules/session/controllers/registrarContiene.controller.js create mode 100644 modules/session/controllers/registrarPrivilegio.controller.js create mode 100644 modules/session/controllers/registrarRol.controller.js create mode 100644 modules/session/routes/rolPrivilegio.routes.js diff --git a/modules/session/controllers/registrarContiene.controller.js b/modules/session/controllers/registrarContiene.controller.js new file mode 100644 index 0000000..14ead16 --- /dev/null +++ b/modules/session/controllers/registrarContiene.controller.js @@ -0,0 +1,264 @@ +const Rol = require('../../../models/perfil/rol.model'); +const Privilegio = require('../../../models/perfil/privilegio.model'); +const ContienePrivilegio = require('../../../models/perfil/contienePrivilegio.model'); + +exports.registrarContiene = async (request, response) => { + // Primero se verifica que la colleción este vacía + try { + // Hacer una consulta para verificar si existe cualquier registro + const relacion = await ContienePrivilegio.findOne(); // Esto busca el primer registro que encuentre + + if (relacion) { + return response.status(400).json({ + error: `La tabla de Contiene ya tiene permisos asociados a ciertos Roles. Si quieres resetear la colección favor de borrarla primero.` + }); + } + } catch (error) { + return response.status(400).json({ + error: error.message + }); + } + + // Se insertan los privilegios de Staff + try { + const rolStaff = await Rol.findOne({ + nombre: 'Staff' + }); + if (!rolStaff) { + return response.status(404).json({ + message: 'Rol Staff no encontrado' + }); + } + + // Busca los privilegios que quieres asociar con el rol "Staff" + const privilegiosStaff = [ + 'Consultar anuncio', + 'Registrar cuenta', + 'Consultar perfil propio', + 'Modificar perfil', + 'Eliminar cuenta', + 'Consultar actividades', + 'Registrar reporte', + 'Consultar foro', + 'Publicar comentario', + 'Modificar comentario', + 'Consultar sección de ayuda', + 'Iniciar rodada', + 'Desactivar rodada', + 'Registrar ruta', + 'Modificar ruta', + 'Eliminar ruta', + 'Consultar solicitudes de amistad', + 'Enviar solicitud de amistad', + 'Aceptar solicitud de amistad', + 'Rechazar solicitud de amistad', + 'Eliminar amigo', + 'Registrar pregunta frecuente', + 'Modificar pregunta frecuente', + 'Eliminar pregunta frecuente', + 'Consultar mapa', + 'Consultar notificaciones', + 'Consultar actividad individual', + 'Resolver solicitud de apoyo', + 'Cancelar solicitud de apoyo', + 'Buscar Usuarios', + 'Cancelar solicitud de amistad', + 'Bloquear usuario', + 'Consultar lista de amigos', + 'Desbloquear usuario', + 'Verificar asistencia' + ];; + + // Buscar los privilegios en la colección + const privilegios = await Privilegio.find({ + nombre: { + $in: privilegiosStaff + } + }); + + if (privilegios.length !== privilegiosStaff.length) { + return response.status(404).json({ + message: 'No se encontraron todos los privilegios especificados para Staff', + foundPrivilegios: privilegios.map(p => p.nombre) + }); + } + + // Poblar la colección Contiene + const contieneStaff = privilegios.map(privilegio => ({ + IDRol: rolStaff._id, + IDPrivilegio: privilegio._id + })); + + await ContienePrivilegio.insertMany(contieneStaff); + + } catch (error) { + return response.status(400).json({ + error: error.message + }); + } + + // Se insertan los privilegios de Administrador + try { + const rolAdmin = await Rol.findOne({ + nombre: 'Administrador' + }); + if (!rolAdmin) { + return response.status(404).json({ + message: 'Rol Staff no encontrado' + }); + } + + // Busca los privilegios que quieres asociar con el rol "Admin" + const privilegiosAdmin = [ + 'Registrar anuncio', + 'Modificar anuncio', + 'Eliminar anuncio', + 'Consultar anuncio', + 'Registrar actividad', + 'Modificar actividad', + 'Eliminar actividad', + 'Consultar estadísticas', + 'Modificar rol', + 'Desactivar usuario', + 'Eliminar comentario', + 'Registrar cuenta', + 'Consultar perfil propio', + 'Modificar perfil', + 'Eliminar cuenta', + 'Consultar actividades', + 'Registrar reporte', + 'Consultar foro', + 'Publicar comentario', + 'Modificar comentario', + 'Consultar sección de ayuda', + 'Iniciar rodada', + 'Desactivar rodada', + 'Registrar ruta', + 'Modificar ruta', + 'Eliminar ruta', + 'Consultar solicitudes de amistad', + 'Enviar solicitud de amistad', + 'Aceptar solicitud de amistad', + 'Rechazar solicitud de amistad', + 'Eliminar amigo', + 'Registrar pregunta frecuente', + 'Modificar pregunta frecuente', + 'Eliminar pregunta frecuente', + 'Consultar mapa', + 'Consultar notificaciones', + 'Consultar actividad individual', + 'Resolver solicitud de apoyo', + 'Cancelar solicitud de apoyo', + 'Buscar Usuarios', + 'Cancelar solicitud de amistad', + 'Bloquear usuario', + 'Consultar lista de amigos', + 'Desbloquear usuario', + 'Verificar asistencia', + 'Consultar Usuarios' + ];; + + // Buscar los privilegios en la colección + const privilegios = await Privilegio.find({ + nombre: { + $in: privilegiosAdmin + } + }); + + if (privilegios.length !== privilegiosAdmin.length) { + return response.status(404).json({ + message: 'No se encontraron todos los privilegios especificados para Admin', + foundPrivilegios: privilegios.map(p => p.nombre) + }); + } + + // Poblar la colección Contiene + const contieneAdmin = privilegios.map(privilegio => ({ + IDRol: rolAdmin._id, + IDPrivilegio: privilegio._id + })); + + await ContienePrivilegio.insertMany(contieneAdmin); + + } catch (error) { + return response.status(400).json({ + error: error.message + }); + } + + try { + const rolUsuario = await Rol.findOne({ + nombre: 'Usuario' + }); + if (!rolUsuario) { + return response.status(404).json({ + message: 'Rol Staff no encontrado' + }); + } + + // Busca los privilegios que quieres asociar con el rol "Usuario" + const privilegiosUsuario = [ + 'Consultar anuncio', + 'Registrar cuenta', + 'Consultar perfil propio', + 'Modificar perfil', + 'Eliminar cuenta', + 'Consultar actividades', + 'Registrar reporte', + 'Consultar foro', + 'Publicar comentario', + 'Modificar comentario', + 'Consultar sección de ayuda', + 'Inscribir actividad', + 'Cancelar asistencia', + 'Consultar renta de bicicletas', + 'Solicitar apoyo', + 'Consultar solicitudes de amistad', + 'Enviar solicitud de amistad', + 'Aceptar solicitud de amistad', + 'Rechazar solicitud de amistad', + 'Eliminar amigo', + 'Consultar medallas/reconocimientos', + 'Consultar mapa', + 'Consultar notificaciones', + 'Consultar actividad individual', + 'Cancelar solicitud de apoyo', + 'Buscar Usuarios', + 'Cancelar solicitud de amistad', + 'Bloquear usuario', + 'Consultar lista de amigos', + 'Desbloquear usuario' + ]; + + // Buscar los privilegios en la colección + const privilegios = await Privilegio.find({ + nombre: { + $in: privilegiosUsuario + } + }); + + if (privilegios.length !== privilegiosUsuario.length) { + return response.status(404).json({ + message: 'No se encontraron todos los privilegios especificados para Usuario', + foundPrivilegios: privilegios.map(p => p.nombre) + }); + } + + // Poblar la colección Contiene + const contieneUsuario = privilegios.map(privilegio => ({ + IDRol: rolUsuario._id, + IDPrivilegio: privilegio._id + })); + + await ContienePrivilegio.insertMany(contieneUsuario); + + } catch (error) { + return response.status(400).json({ + error: error.message + }); + } + + return response.status(201).json({ + message: 'Privilegios asignados a los roles con éxito' + }); +}; \ No newline at end of file diff --git a/modules/session/controllers/registrarPrivilegio.controller.js b/modules/session/controllers/registrarPrivilegio.controller.js new file mode 100644 index 0000000..fa34388 --- /dev/null +++ b/modules/session/controllers/registrarPrivilegio.controller.js @@ -0,0 +1,26 @@ +const Privilegio = require('../../../models/perfil/privilegio.model'); + +exports.registrarPrivilegio = async (request, response) => { + try { + // Sacar los datos del body (un array de nombres de privilegios) + const nombres = request.body.nombre; + + // Crear los privilegios para pasarlos a un array + const privilegiosArray = nombres.map(nombre => ({ + nombre + })); + + // Insertar todos los privilegios + const nuevosPrivilegios = await Privilegio.insertMany(privilegiosArray); + + response.status(201).json({ + message: 'Privilegios registrados con éxito', + privilegios: nuevosPrivilegios + }); + + } catch (error) { + response.status(400).json({ + error: error.message + }); + } +}; \ No newline at end of file diff --git a/modules/session/controllers/registrarRol.controller.js b/modules/session/controllers/registrarRol.controller.js new file mode 100644 index 0000000..da763e2 --- /dev/null +++ b/modules/session/controllers/registrarRol.controller.js @@ -0,0 +1,25 @@ +const Rol = require('../../../models/perfil/rol.model'); + +exports.registrarRol = async (request, response) => { + try { + // Sacar los datos body + const nombre = request.body.nombre; + + // Crear el usuario en MongoDB, por ahora sin firebaseUID + const newRol = new Rol({ + nombre + }); + + await newRol.save(); + + response.status(201).json({ + message: 'Rol registrado con éxito', + user: newRol + }); + + } catch (error) { + response.status(400).json({ + error: error.message + }); + } +}; \ No newline at end of file diff --git a/modules/session/routes/rolPrivilegio.routes.js b/modules/session/routes/rolPrivilegio.routes.js new file mode 100644 index 0000000..bb2e39d --- /dev/null +++ b/modules/session/routes/rolPrivilegio.routes.js @@ -0,0 +1,12 @@ +const express = require('express'); +const router = express.Router(); + +const registrarRolController = require('../controllers/registrarRol.controller'); +const registrarPrivilegioController = require('../controllers/registrarPrivilegio.controller'); +const registrarContieneController = require('../controllers/registrarContiene.controller'); + +router.post('/registrarRol', registrarRolController.registrarRol); +router.post('/registrarPrivilegio', registrarPrivilegioController.registrarPrivilegio); +router.get('/registrarContiene', registrarContieneController.registrarContiene); + +module.exports = router; \ No newline at end of file diff --git a/modules/session/routes/sessionIndex.routes.js b/modules/session/routes/sessionIndex.routes.js index 8c7d4ad..842aa0c 100644 --- a/modules/session/routes/sessionIndex.routes.js +++ b/modules/session/routes/sessionIndex.routes.js @@ -2,7 +2,9 @@ const express = require('express'); const router = express.Router(); const registrarUsuarioRoute = require('./registrarUsuario.routes'); +const rolPrivilegioRoute = require('./rolPrivilegio.routes'); router.use('/registrarUsuario', registrarUsuarioRoute); +router.use('/rolPrivilegio', rolPrivilegioRoute); module.exports = router; \ No newline at end of file From e3f527149d1c8512bb09d1d153b2b91d02a56ea3 Mon Sep 17 00:00:00 2001 From: Jesus0204 Date: Sun, 8 Sep 2024 12:10:24 -0600 Subject: [PATCH 004/231] feat: Agregar Rol a Usuario --- .../registrarUsuario.controller.js | 25 ++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/modules/session/controllers/registrarUsuario.controller.js b/modules/session/controllers/registrarUsuario.controller.js index 2f66aae..ecce287 100644 --- a/modules/session/controllers/registrarUsuario.controller.js +++ b/modules/session/controllers/registrarUsuario.controller.js @@ -1,5 +1,7 @@ // const admin = require('../../../util/firebase'); const Usuario = require('../../../models/perfil/usuario.model'); +const Rol = require('../../../models/perfil/rol.model'); +const PoseeRol = require('../../../models/perfil/poseeRol.model'); // Modelo para la relación entre usuario y rol exports.registrarUsuario = async (request, response) => { try { @@ -13,6 +15,16 @@ exports.registrarUsuario = async (request, response) => { numeroEmergencia } = request.body; + // Buscar el rol Usuario + const rolUsuario = await Rol.findOne({ + nombre: 'Usuario' + }); + if (!rolUsuario) { + return response.status(404).json({ + message: 'Rol Usuario no encontrado' + }); + } + // Crear el usuario en MongoDB, por ahora sin firebaseUID const newUser = new Usuario({ username, @@ -26,8 +38,19 @@ exports.registrarUsuario = async (request, response) => { await newUser.save(); + // Poblar la tabla Posee con la relación entre el usuario y el rol + const poseeRol = new PoseeRol({ + // ObjectId del nuevo usuario + IDUsuario: newUser._id, + // ObjectId del rol "Usuario" + IDRol: rolUsuario._id + }); + + // Guardar la relación en la tabla Posee + await poseeRol.save(); + response.status(201).json({ - message: 'User registered successfully', + message: 'User registrado con éxito', user: newUser }); From baf6fd52403f009c18b15827ab61d8cbeacba6cc Mon Sep 17 00:00:00 2001 From: Jesus0204 Date: Sun, 8 Sep 2024 22:34:23 -0600 Subject: [PATCH 005/231] fix: Usar variables .env para Firebase --- util/firebase.js | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/util/firebase.js b/util/firebase.js index 9a73579..f7f17e4 100644 --- a/util/firebase.js +++ b/util/firebase.js @@ -1,8 +1,19 @@ const admin = require('firebase-admin'); -const path = require('./firebase-adminsdk.json'); admin.initializeApp({ - credential: admin.credential.cert(require(path)) + credential: admin.credential.cert({ + type: 'service_account', + project_id: process.env.FIREBASE_PROJECT_ID, + private_key_id: process.env.FIREBASE_PRIVATE_KEY_ID, + private_key: process.env.FIREBASE_PRIVATE_KEY.replace(/\\n/g, '\n'), // Reemplazar los \n con saltos de línea reales + client_email: process.env.FIREBASE_CLIENT_EMAIL, + client_id: process.env.FIREBASE_CLIENT_ID, + auth_uri: process.env.FIREBASE_AUTH_URI, + token_uri: process.env.FIREBASE_TOKEN_URI, + auth_provider_x509_cert_url: process.env.FIREBASE_AUTH_PROVIDER_CERT_URL, + client_x509_cert_url: process.env.FIREBASE_CLIENT_CERT_URL, + universe_domain: 'googleapis.com' + }) }); // Exportar la instancia de admin para usar en otros archivos From 9dbb03f8f8c4e8da9e65c43df2abeebd23fad539 Mon Sep 17 00:00:00 2001 From: Zathiald Date: Mon, 9 Sep 2024 12:58:33 -0600 Subject: [PATCH 006/231] Feat: Funcion consultar rutas --- models/ruta/ruta.model.js | 53 +++++++++++++++++++ .../controllers/consultarMapa.controller.js | 13 +++-- modules/mapa/routes/consultarMapa.routes.js | 6 +-- modules/mapa/routes/mapaIndex.routes.js | 6 +-- 4 files changed, 67 insertions(+), 11 deletions(-) diff --git a/models/ruta/ruta.model.js b/models/ruta/ruta.model.js index e69de29..8dc2fb3 100644 --- a/models/ruta/ruta.model.js +++ b/models/ruta/ruta.model.js @@ -0,0 +1,53 @@ +const mongoose = require('mongoose'); + +const coordenadaSchema = new mongoose.Schema({ + latitud: { + type: Number, + required: true + }, + longitud: { + type: Number, + required: true + }, + tipo: { + type: String, + required: true + } +}); + +const rutaSchema = new mongoose.Schema({ + titulo: { + type: String, + required: true + }, + distancia: { + type: String, + required: true + }, + tiempo: { + type: String, + required: true + }, + nivel: { + type: Number, + required: true, + }, + lugar: { + type: String, + required: true + }, + descanso: { + type: String, + required: false + }, + coordenadas: { + type: [coordenadaSchema], + required: true + }, +}, { + collection: 'Rutas' +}); + +const Ruta = mongoose.model('Ruta', rutaSchema); + +module.exports = Ruta; \ No newline at end of file diff --git a/modules/mapa/controllers/consultarMapa.controller.js b/modules/mapa/controllers/consultarMapa.controller.js index e618800..4e2ceb4 100644 --- a/modules/mapa/controllers/consultarMapa.controller.js +++ b/modules/mapa/controllers/consultarMapa.controller.js @@ -1,3 +1,10 @@ -exports.getPrueba = (request, response) => { - response.json('Mapa: Esta es la plantilla que deben usar.'); -}; \ No newline at end of file +const Ruta = require('../../../models/ruta/ruta.model'); + +exports.getRutas = async (req, res) => { + try { + const rutas = await Ruta.find({}) + res.json(rutas); + } catch (error) { + res.status(500).json({ message: 'Error al obtener las rutas', error }); + } +}; diff --git a/modules/mapa/routes/consultarMapa.routes.js b/modules/mapa/routes/consultarMapa.routes.js index fede7fd..bf12e28 100644 --- a/modules/mapa/routes/consultarMapa.routes.js +++ b/modules/mapa/routes/consultarMapa.routes.js @@ -1,10 +1,8 @@ const express = require('express'); const router = express.Router(); -// Importar el controlador que maneja la Funcionalidad que quieres -// EJEMPLO: const registrarAnuncioController = require('../controllers/registrarAnuncio.controller'); + const consultarMapaController = require('../controllers/consultarMapa.controller'); -// Definir la ruta para la funcionalidad y la funcion del controlador -// EJEMPLO: router.get('/', registrarActividadController.getPrueba); +router.get('/', consultarMapaController.getRutas); module.exports = router; \ No newline at end of file diff --git a/modules/mapa/routes/mapaIndex.routes.js b/modules/mapa/routes/mapaIndex.routes.js index 4f3c24d..a769cae 100644 --- a/modules/mapa/routes/mapaIndex.routes.js +++ b/modules/mapa/routes/mapaIndex.routes.js @@ -1,10 +1,8 @@ const express = require('express'); const router = express.Router(); -// Importen aquí los archivos de ruta del módulo -// EJEMPLO: const registrarActividadRoute = require('./registrarActividad.routes'); +const consultarRutaRoute = require('./consultarMapa.routes'); -// Pongan la ruta que quieren usar y el archivo de la ruta de la funcionalidad -// EJEMPLO router.use('/registrar', registrarActividadRoute); +router.use('/consultarRutas', consultarRutaRoute); module.exports = router; \ No newline at end of file From c33ddeb9163098c1151633a296985147b340c510 Mon Sep 17 00:00:00 2001 From: Jesus0204 Date: Mon, 9 Sep 2024 19:04:50 -0600 Subject: [PATCH 007/231] =?UTF-8?q?feat:=20Verificar=20token=20con=20petic?= =?UTF-8?q?i=C3=B3n=20movil?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 3 +- app.js | 9 +- .../registrarUsuario.controller.js | 7 +- package-lock.json | 627 +----------------- util/firebase-admin-config.js | 25 + util/firebase.js | 20 - util/verifyUserToken.js | 2 +- 7 files changed, 40 insertions(+), 653 deletions(-) create mode 100644 util/firebase-admin-config.js delete mode 100644 util/firebase.js diff --git a/.gitignore b/.gitignore index bc4e2bd..3005310 100644 --- a/.gitignore +++ b/.gitignore @@ -136,4 +136,5 @@ dist .vscode/ # Firebase Service SDK -/util/firebase-adminsdk.json \ No newline at end of file +/util/firebase-adminsdk.json +/util/login-app.json \ No newline at end of file diff --git a/app.js b/app.js index e2b10da..6de318a 100644 --- a/app.js +++ b/app.js @@ -68,8 +68,13 @@ app.use('/session', sessionRoutes); // next(); // } -app.get('/', (request, response) => { - response.json('¡Bienvenido a Saca la Bici!'); +const verifyToken = require('./util/verifyUserToken'); + +app.get('/', verifyToken, (request, response) => { + response.status(200).json({ + message: '¡Bienvenido a Saca la Bici!' + }); + console.log(request.userUID) }); // Para error 404 diff --git a/modules/session/controllers/registrarUsuario.controller.js b/modules/session/controllers/registrarUsuario.controller.js index ecce287..2aa8364 100644 --- a/modules/session/controllers/registrarUsuario.controller.js +++ b/modules/session/controllers/registrarUsuario.controller.js @@ -12,7 +12,8 @@ exports.registrarUsuario = async (request, response) => { edad, tipoSangre, correoElectronico, - numeroEmergencia + numeroEmergencia, + firebaseUID } = request.body; // Buscar el rol Usuario @@ -32,8 +33,8 @@ exports.registrarUsuario = async (request, response) => { edad, tipoSangre, correoElectronico, - numeroEmergencia - // firebaseUID: uid, // Descomentar cuando uses Firebase + numeroEmergencia, + firebaseUID }); await newUser.save(); diff --git a/package-lock.json b/package-lock.json index 49f538b..bce72a0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -24,8 +24,6 @@ }, "node_modules/@eslint-community/eslint-utils": { "version": "4.4.0", - "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", - "integrity": "sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==", "dev": true, "license": "MIT", "dependencies": { @@ -40,8 +38,6 @@ }, "node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys": { "version": "3.4.3", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", - "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", "dev": true, "license": "Apache-2.0", "engines": { @@ -53,8 +49,6 @@ }, "node_modules/@eslint-community/regexpp": { "version": "4.11.0", - "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.11.0.tgz", - "integrity": "sha512-G/M/tIiMrTAxEWRfLfQJMmGNX28IxBg4PBz8XqQhqUHLFI6TL2htpIB1iQCj144V5ee/JaKyT9/WZ0MGZWfA7A==", "dev": true, "license": "MIT", "engines": { @@ -63,8 +57,6 @@ }, "node_modules/@eslint/config-array": { "version": "0.18.0", - "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.18.0.tgz", - "integrity": "sha512-fTxvnS1sRMu3+JjXwJG0j/i4RT9u4qJ+lqS/yCGap4lH4zZGzQ7tu+xZqQmcMZq5OBZDL4QRxQzRjkWcGt8IVw==", "dev": true, "license": "Apache-2.0", "dependencies": { @@ -78,8 +70,6 @@ }, "node_modules/@eslint/config-array/node_modules/debug": { "version": "4.3.6", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.6.tgz", - "integrity": "sha512-O/09Bd4Z1fBrU4VzkhFqVgpPzaGbw6Sm9FEkBT1A/YBXQFGuuSxa1dN2nxgxS34JmKXqYx8CZAwEVoJFImUXIg==", "dev": true, "license": "MIT", "dependencies": { @@ -96,15 +86,11 @@ }, "node_modules/@eslint/config-array/node_modules/ms": { "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "dev": true, "license": "MIT" }, "node_modules/@eslint/eslintrc": { "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.1.0.tgz", - "integrity": "sha512-4Bfj15dVJdoy3RfZmmo86RK1Fwzn6SstsvK9JS+BaVKqC6QQQQyXekNaC+g+LKNgkQ+2VhGAzm6hO40AhMR3zQ==", "dev": true, "license": "MIT", "dependencies": { @@ -127,8 +113,6 @@ }, "node_modules/@eslint/eslintrc/node_modules/debug": { "version": "4.3.6", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.6.tgz", - "integrity": "sha512-O/09Bd4Z1fBrU4VzkhFqVgpPzaGbw6Sm9FEkBT1A/YBXQFGuuSxa1dN2nxgxS34JmKXqYx8CZAwEVoJFImUXIg==", "dev": true, "license": "MIT", "dependencies": { @@ -145,8 +129,6 @@ }, "node_modules/@eslint/eslintrc/node_modules/globals": { "version": "14.0.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-14.0.0.tgz", - "integrity": "sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==", "dev": true, "license": "MIT", "engines": { @@ -158,15 +140,11 @@ }, "node_modules/@eslint/eslintrc/node_modules/ms": { "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "dev": true, "license": "MIT" }, "node_modules/@eslint/js": { "version": "9.9.1", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.9.1.tgz", - "integrity": "sha512-xIDQRsfg5hNBqHz04H1R3scSVwmI+KUbqjsQKHKQ1DAUSaUjYPReZZmS/5PNiKu1fUvzDd6H7DEDKACSEhu+TQ==", "dev": true, "license": "MIT", "engines": { @@ -175,8 +153,6 @@ }, "node_modules/@eslint/object-schema": { "version": "2.1.4", - "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-2.1.4.tgz", - "integrity": "sha512-BsWiH1yFGjXXS2yvrf5LyuoSIIbPrGUWob917o+BTKuZ7qJdxX8aJLRxs1fS9n6r7vESrq1OUqb68dANcFXuQQ==", "dev": true, "license": "Apache-2.0", "engines": { @@ -185,32 +161,22 @@ }, "node_modules/@fastify/busboy": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@fastify/busboy/-/busboy-3.0.0.tgz", - "integrity": "sha512-83rnH2nCvclWaPQQKvkJ2pdOjG4TZyEVuFDnlOF6KP08lDaaceVyw/W63mDuafQT+MKHCvXIPpE5uYWeM0rT4w==", "license": "MIT" }, "node_modules/@firebase/app-check-interop-types": { "version": "0.3.2", - "resolved": "https://registry.npmjs.org/@firebase/app-check-interop-types/-/app-check-interop-types-0.3.2.tgz", - "integrity": "sha512-LMs47Vinv2HBMZi49C09dJxp0QT5LwDzFaVGf/+ITHe3BlIhUiLNttkATSXplc89A2lAaeTqjgqVkiRfUGyQiQ==", "license": "Apache-2.0" }, "node_modules/@firebase/app-types": { "version": "0.9.2", - "resolved": "https://registry.npmjs.org/@firebase/app-types/-/app-types-0.9.2.tgz", - "integrity": "sha512-oMEZ1TDlBz479lmABwWsWjzHwheQKiAgnuKxE0pz0IXCVx7/rtlkx1fQ6GfgK24WCrxDKMplZrT50Kh04iMbXQ==", "license": "Apache-2.0" }, "node_modules/@firebase/auth-interop-types": { "version": "0.2.3", - "resolved": "https://registry.npmjs.org/@firebase/auth-interop-types/-/auth-interop-types-0.2.3.tgz", - "integrity": "sha512-Fc9wuJGgxoxQeavybiuwgyi+0rssr76b+nHpj+eGhXFYAdudMWyfBHvFL/I5fEHniUM/UQdFzi9VXJK2iZF7FQ==", "license": "Apache-2.0" }, "node_modules/@firebase/component": { "version": "0.6.8", - "resolved": "https://registry.npmjs.org/@firebase/component/-/component-0.6.8.tgz", - "integrity": "sha512-LcNvxGLLGjBwB0dJUsBGCej2fqAepWyBubs4jt1Tiuns7QLbXHuyObZ4aMeBjZjWx4m8g1LoVI9QFpSaq/k4/g==", "license": "Apache-2.0", "dependencies": { "@firebase/util": "1.9.7", @@ -219,8 +185,6 @@ }, "node_modules/@firebase/database": { "version": "1.0.7", - "resolved": "https://registry.npmjs.org/@firebase/database/-/database-1.0.7.tgz", - "integrity": "sha512-wjXr5AO8RPxVVg7rRCYffT7FMtBjHRfJ9KMwi19MbOf0vBf0H9YqW3WCgcnLpXI6ehiUcU3z3qgPnnU0nK6SnA==", "license": "Apache-2.0", "dependencies": { "@firebase/app-check-interop-types": "0.3.2", @@ -234,8 +198,6 @@ }, "node_modules/@firebase/database-compat": { "version": "1.0.7", - "resolved": "https://registry.npmjs.org/@firebase/database-compat/-/database-compat-1.0.7.tgz", - "integrity": "sha512-R/3B+VVzEFN5YcHmfWns3eitA8fHLTL03io+FIoMcTYkajFnrBdS3A+g/KceN9omP7FYYYGTQWF9lvbEx6eMEg==", "license": "Apache-2.0", "dependencies": { "@firebase/component": "0.6.8", @@ -248,8 +210,6 @@ }, "node_modules/@firebase/database-types": { "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@firebase/database-types/-/database-types-1.0.4.tgz", - "integrity": "sha512-mz9ZzbH6euFXbcBo+enuJ36I5dR5w+enJHHjy9Y5ThCdKUseqfDjW3vCp1YxE9zygFCSjJJ/z1cQ+zodvUcwPQ==", "license": "Apache-2.0", "dependencies": { "@firebase/app-types": "0.9.2", @@ -258,8 +218,6 @@ }, "node_modules/@firebase/logger": { "version": "0.4.2", - "resolved": "https://registry.npmjs.org/@firebase/logger/-/logger-0.4.2.tgz", - "integrity": "sha512-Q1VuA5M1Gjqrwom6I6NUU4lQXdo9IAQieXlujeHZWvRt1b7qQ0KwBaNAjgxG27jgF9/mUwsNmO8ptBCGVYhB0A==", "license": "Apache-2.0", "dependencies": { "tslib": "^2.1.0" @@ -267,8 +225,6 @@ }, "node_modules/@firebase/util": { "version": "1.9.7", - "resolved": "https://registry.npmjs.org/@firebase/util/-/util-1.9.7.tgz", - "integrity": "sha512-fBVNH/8bRbYjqlbIhZ+lBtdAAS4WqZumx03K06/u7fJSpz1TGjEMm1ImvKD47w+xaFKIP2ori6z8BrbakRfjJA==", "license": "Apache-2.0", "dependencies": { "tslib": "^2.1.0" @@ -276,8 +232,6 @@ }, "node_modules/@google-cloud/firestore": { "version": "7.10.0", - "resolved": "https://registry.npmjs.org/@google-cloud/firestore/-/firestore-7.10.0.tgz", - "integrity": "sha512-VFNhdHvfnmqcHHs6YhmSNHHxQqaaD64GwiL0c+e1qz85S8SWZPC2XFRf8p9yHRTF40Kow424s1KBU9f0fdQa+Q==", "license": "Apache-2.0", "optional": true, "dependencies": { @@ -293,8 +247,6 @@ }, "node_modules/@google-cloud/paginator": { "version": "5.0.2", - "resolved": "https://registry.npmjs.org/@google-cloud/paginator/-/paginator-5.0.2.tgz", - "integrity": "sha512-DJS3s0OVH4zFDB1PzjxAsHqJT6sKVbRwwML0ZBP9PbU7Yebtu/7SWMRzvO2J3nUi9pRNITCfu4LJeooM2w4pjg==", "license": "Apache-2.0", "optional": true, "dependencies": { @@ -307,8 +259,6 @@ }, "node_modules/@google-cloud/projectify": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@google-cloud/projectify/-/projectify-4.0.0.tgz", - "integrity": "sha512-MmaX6HeSvyPbWGwFq7mXdo0uQZLGBYCwziiLIGq5JVX+/bdI3SAq6bP98trV5eTWfLuvsMcIC1YJOF2vfteLFA==", "license": "Apache-2.0", "optional": true, "engines": { @@ -317,8 +267,6 @@ }, "node_modules/@google-cloud/promisify": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@google-cloud/promisify/-/promisify-4.0.0.tgz", - "integrity": "sha512-Orxzlfb9c67A15cq2JQEyVc7wEsmFBmHjZWZYQMUyJ1qivXyMwdyNOs9odi79hze+2zqdTtu1E19IM/FtqZ10g==", "license": "Apache-2.0", "optional": true, "engines": { @@ -327,8 +275,6 @@ }, "node_modules/@google-cloud/storage": { "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@google-cloud/storage/-/storage-7.12.1.tgz", - "integrity": "sha512-Z3ZzOnF3YKLuvpkvF+TjQ6lztxcAyTILp+FjKonmVpEwPa9vFvxpZjubLR4sB6bf19i/8HL2AXRjA0YFgHFRmQ==", "license": "Apache-2.0", "optional": true, "dependencies": { @@ -354,8 +300,6 @@ }, "node_modules/@google-cloud/storage/node_modules/mime": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/mime/-/mime-3.0.0.tgz", - "integrity": "sha512-jSCU7/VB1loIWBZe14aEYHU/+1UMEHoaO7qxCOVJOw9GgH72VAWppxNcjU+x9a2k3GSIBXNKxXQFqRvvZ7vr3A==", "license": "MIT", "optional": true, "bin": { @@ -367,8 +311,6 @@ }, "node_modules/@google-cloud/storage/node_modules/uuid": { "version": "8.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", - "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", "license": "MIT", "optional": true, "bin": { @@ -377,8 +319,6 @@ }, "node_modules/@grpc/proto-loader": { "version": "0.7.13", - "resolved": "https://registry.npmjs.org/@grpc/proto-loader/-/proto-loader-0.7.13.tgz", - "integrity": "sha512-AiXO/bfe9bmxBjxxtYxFAXGZvMaN5s8kO+jBHAJCON8rJoB5YS/D6X7ZNc6XQkuHNmyl4CYaMI1fJ/Gn27RGGw==", "license": "Apache-2.0", "optional": true, "dependencies": { @@ -396,8 +336,6 @@ }, "node_modules/@humanwhocodes/module-importer": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", - "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", "dev": true, "license": "Apache-2.0", "engines": { @@ -410,8 +348,6 @@ }, "node_modules/@humanwhocodes/retry": { "version": "0.3.0", - "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.3.0.tgz", - "integrity": "sha512-d2CGZR2o7fS6sWB7DG/3a95bGKQyHMACZ5aW8qGkkqQpUoZV6C0X7Pc7l4ZNMZkfNBf4VWNe9E1jRsf0G146Ew==", "dev": true, "license": "Apache-2.0", "engines": { @@ -424,8 +360,6 @@ }, "node_modules/@js-sdsl/ordered-map": { "version": "4.4.2", - "resolved": "https://registry.npmjs.org/@js-sdsl/ordered-map/-/ordered-map-4.4.2.tgz", - "integrity": "sha512-iUKgm52T8HOE/makSxjqoWhe95ZJA1/G1sYsGev2JDKUSS14KAgg1LHb+Ba+IPow0xflbnSkOsZcO08C7w1gYw==", "license": "MIT", "optional": true, "funding": { @@ -435,8 +369,6 @@ }, "node_modules/@mongodb-js/saslprep": { "version": "1.1.8", - "resolved": "https://registry.npmjs.org/@mongodb-js/saslprep/-/saslprep-1.1.8.tgz", - "integrity": "sha512-qKwC/M/nNNaKUBMQ0nuzm47b7ZYWQHN3pcXq4IIcoSBc2hOIrflAxJduIvvqmhoz3gR2TacTAs8vlsCVPkiEdQ==", "license": "MIT", "dependencies": { "sparse-bitfield": "^3.0.3" @@ -444,8 +376,6 @@ }, "node_modules/@nodelib/fs.scandir": { "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", - "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", "dev": true, "license": "MIT", "dependencies": { @@ -458,8 +388,6 @@ }, "node_modules/@nodelib/fs.stat": { "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", - "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", "dev": true, "license": "MIT", "engines": { @@ -468,8 +396,6 @@ }, "node_modules/@nodelib/fs.walk": { "version": "1.2.8", - "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", - "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", "dev": true, "license": "MIT", "dependencies": { @@ -482,8 +408,6 @@ }, "node_modules/@opentelemetry/api": { "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/api/-/api-1.9.0.tgz", - "integrity": "sha512-3giAOQvZiH5F9bMlMiv8+GSPMeqg0dbaeo58/0SlA9sxSqZhnUtxzX9/2FzyhS9sWQf5S0GJE0AKBrFqjpeYcg==", "license": "Apache-2.0", "optional": true, "engines": { @@ -492,36 +416,26 @@ }, "node_modules/@protobufjs/aspromise": { "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz", - "integrity": "sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ==", "license": "BSD-3-Clause", "optional": true }, "node_modules/@protobufjs/base64": { "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz", - "integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==", "license": "BSD-3-Clause", "optional": true }, "node_modules/@protobufjs/codegen": { "version": "2.0.4", - "resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.4.tgz", - "integrity": "sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg==", "license": "BSD-3-Clause", "optional": true }, "node_modules/@protobufjs/eventemitter": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz", - "integrity": "sha512-j9ednRT81vYJ9OfVuXG6ERSTdEL1xVsNgqpkxMsbIabzSo3goCjDIveeGv5d03om39ML71RdmrGNjG5SReBP/Q==", "license": "BSD-3-Clause", "optional": true }, "node_modules/@protobufjs/fetch": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz", - "integrity": "sha512-lljVXpqXebpsijW71PZaCYeIcE5on1w5DlQy5WH6GLbFryLUrBD4932W/E2BSpfRJWseIL4v/KPgBFxDOIdKpQ==", "license": "BSD-3-Clause", "optional": true, "dependencies": { @@ -531,43 +445,31 @@ }, "node_modules/@protobufjs/float": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz", - "integrity": "sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ==", "license": "BSD-3-Clause", "optional": true }, "node_modules/@protobufjs/inquire": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz", - "integrity": "sha512-kdSefcPdruJiFMVSbn801t4vFK7KB/5gd2fYvrxhuJYg8ILrmn9SKSX2tZdV6V+ksulWqS7aXjBcRXl3wHoD9Q==", "license": "BSD-3-Clause", "optional": true }, "node_modules/@protobufjs/path": { "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz", - "integrity": "sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA==", "license": "BSD-3-Clause", "optional": true }, "node_modules/@protobufjs/pool": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz", - "integrity": "sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw==", "license": "BSD-3-Clause", "optional": true }, "node_modules/@protobufjs/utf8": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz", - "integrity": "sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==", "license": "BSD-3-Clause", "optional": true }, "node_modules/@tootallnate/once": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-2.0.0.tgz", - "integrity": "sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A==", "license": "MIT", "optional": true, "engines": { @@ -576,8 +478,6 @@ }, "node_modules/@types/body-parser": { "version": "1.19.5", - "resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.5.tgz", - "integrity": "sha512-fB3Zu92ucau0iQ0JMCFQE7b/dv8Ot07NI3KaZIkIUNXq82k4eBAqUaneXfleGY9JWskeS9y+u0nXMyspcuQrCg==", "license": "MIT", "dependencies": { "@types/connect": "*", @@ -586,15 +486,11 @@ }, "node_modules/@types/caseless": { "version": "0.12.5", - "resolved": "https://registry.npmjs.org/@types/caseless/-/caseless-0.12.5.tgz", - "integrity": "sha512-hWtVTC2q7hc7xZ/RLbxapMvDMgUnDvKvMOpKal4DrMyfGBUfB1oKaZlIRr6mJL+If3bAP6sV/QneGzF6tJjZDg==", "license": "MIT", "optional": true }, "node_modules/@types/connect": { "version": "3.4.38", - "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.38.tgz", - "integrity": "sha512-K6uROf1LD88uDQqJCktA4yzL1YYAK6NgfsI0v/mTgyPKWsX1CnJ0XPSDhViejru1GcRkLWb8RlzFYJRqGUbaug==", "license": "MIT", "dependencies": { "@types/node": "*" @@ -602,8 +498,6 @@ }, "node_modules/@types/express": { "version": "4.17.21", - "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.21.tgz", - "integrity": "sha512-ejlPM315qwLpaQlQDTjPdsUFSc6ZsP4AN6AlWnogPjQ7CVi7PYF3YVz+CY3jE2pwYf7E/7HlDAN0rV2GxTG0HQ==", "license": "MIT", "dependencies": { "@types/body-parser": "*", @@ -614,8 +508,6 @@ }, "node_modules/@types/express-serve-static-core": { "version": "4.19.5", - "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.19.5.tgz", - "integrity": "sha512-y6W03tvrACO72aijJ5uF02FRq5cgDR9lUxddQ8vyF+GvmjJQqbzDcJngEjURc+ZsG31VI3hODNZJ2URj86pzmg==", "license": "MIT", "dependencies": { "@types/node": "*", @@ -626,14 +518,10 @@ }, "node_modules/@types/http-errors": { "version": "2.0.4", - "resolved": "https://registry.npmjs.org/@types/http-errors/-/http-errors-2.0.4.tgz", - "integrity": "sha512-D0CFMMtydbJAegzOyHjtiKPLlvnm3iTZyZRSZoLq2mRhDdmLfIWOCYPfQJ4cu2erKghU++QvjcUjp/5h7hESpA==", "license": "MIT" }, "node_modules/@types/jsonwebtoken": { "version": "9.0.6", - "resolved": "https://registry.npmjs.org/@types/jsonwebtoken/-/jsonwebtoken-9.0.6.tgz", - "integrity": "sha512-/5hndP5dCjloafCXns6SZyESp3Ldq7YjH3zwzwczYnjxIT0Fqzk5ROSYVGfFyczIue7IUEj8hkvLbPoLQ18vQw==", "license": "MIT", "dependencies": { "@types/node": "*" @@ -641,21 +529,15 @@ }, "node_modules/@types/long": { "version": "4.0.2", - "resolved": "https://registry.npmjs.org/@types/long/-/long-4.0.2.tgz", - "integrity": "sha512-MqTGEo5bj5t157U6fA/BiDynNkn0YknVdh48CMPkTSpFTVmvao5UQmm7uEF6xBEo7qIMAlY/JSleYaE6VOdpaA==", "license": "MIT", "optional": true }, "node_modules/@types/mime": { "version": "1.3.5", - "resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.5.tgz", - "integrity": "sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w==", "license": "MIT" }, "node_modules/@types/node": { "version": "22.5.4", - "resolved": "https://registry.npmjs.org/@types/node/-/node-22.5.4.tgz", - "integrity": "sha512-FDuKUJQm/ju9fT/SeX/6+gBzoPzlVCzfzmGkwKvRHQVxi4BntVbyIwf6a4Xn62mrvndLiml6z/UBXIdEVjQLXg==", "license": "MIT", "dependencies": { "undici-types": "~6.19.2" @@ -663,20 +545,14 @@ }, "node_modules/@types/qs": { "version": "6.9.15", - "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.15.tgz", - "integrity": "sha512-uXHQKES6DQKKCLh441Xv/dwxOq1TVS3JPUMlEqoEglvlhR6Mxnlew/Xq/LRVHpLyk7iK3zODe1qYHIMltO7XGg==", "license": "MIT" }, "node_modules/@types/range-parser": { "version": "1.2.7", - "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.7.tgz", - "integrity": "sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ==", "license": "MIT" }, "node_modules/@types/request": { "version": "2.48.12", - "resolved": "https://registry.npmjs.org/@types/request/-/request-2.48.12.tgz", - "integrity": "sha512-G3sY+NpsA9jnwm0ixhAFQSJ3Q9JkpLZpJbI3GMv0mIAT0y3mRabYeINzal5WOChIiaTEGQYlHOKgkaM9EisWHw==", "license": "MIT", "optional": true, "dependencies": { @@ -688,8 +564,6 @@ }, "node_modules/@types/send": { "version": "0.17.4", - "resolved": "https://registry.npmjs.org/@types/send/-/send-0.17.4.tgz", - "integrity": "sha512-x2EM6TJOybec7c52BX0ZspPodMsQUd5L6PRwOunVyVUhXiBSKf3AezDL8Dgvgt5o0UfKNfuA0eMLr2wLT4AiBA==", "license": "MIT", "dependencies": { "@types/mime": "^1", @@ -698,8 +572,6 @@ }, "node_modules/@types/serve-static": { "version": "1.15.7", - "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.15.7.tgz", - "integrity": "sha512-W8Ym+h8nhuRwaKPaDw34QUkwsGi6Rc4yYqvKFo5rm2FUEhCFbzVWrxXUxuKK8TASjWsysJY0nsmNCGhCOIsrOw==", "license": "MIT", "dependencies": { "@types/http-errors": "*", @@ -709,21 +581,15 @@ }, "node_modules/@types/tough-cookie": { "version": "4.0.5", - "resolved": "https://registry.npmjs.org/@types/tough-cookie/-/tough-cookie-4.0.5.tgz", - "integrity": "sha512-/Ad8+nIOV7Rl++6f1BdKxFSMgmoqEoYbHRpPcx3JEfv8VRsQe9Z4mCXeJBzxs7mbHY/XOZZuXlRNfhpVPbs6ZA==", "license": "MIT", "optional": true }, "node_modules/@types/webidl-conversions": { "version": "7.0.3", - "resolved": "https://registry.npmjs.org/@types/webidl-conversions/-/webidl-conversions-7.0.3.tgz", - "integrity": "sha512-CiJJvcRtIgzadHCYXw7dqEnMNRjhGZlYK05Mj9OyktqV8uVT8fD2BFOB7S1uwBE3Kj2Z+4UyPmFw/Ixgw/LAlA==", "license": "MIT" }, "node_modules/@types/whatwg-url": { "version": "11.0.5", - "resolved": "https://registry.npmjs.org/@types/whatwg-url/-/whatwg-url-11.0.5.tgz", - "integrity": "sha512-coYR071JRaHa+xoEvvYqvnIHaVqaYrLPbsufM9BF63HkwI5Lgmy2QR8Q5K/lYDYo5AK82wOvSOS0UsLTpTG7uQ==", "license": "MIT", "dependencies": { "@types/webidl-conversions": "*" @@ -731,8 +597,6 @@ }, "node_modules/abort-controller": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz", - "integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==", "license": "MIT", "optional": true, "dependencies": { @@ -744,8 +608,6 @@ }, "node_modules/accepts": { "version": "1.3.8", - "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", - "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", "license": "MIT", "dependencies": { "mime-types": "~2.1.34", @@ -757,8 +619,6 @@ }, "node_modules/acorn": { "version": "8.12.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.12.1.tgz", - "integrity": "sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg==", "dev": true, "license": "MIT", "bin": { @@ -770,8 +630,6 @@ }, "node_modules/acorn-jsx": { "version": "5.3.2", - "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", - "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", "dev": true, "license": "MIT", "peerDependencies": { @@ -780,8 +638,6 @@ }, "node_modules/agent-base": { "version": "7.1.1", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.1.tgz", - "integrity": "sha512-H0TSyFNDMomMNJQBn8wFV5YC/2eJ+VXECwOadZJT554xP6cODZHPX3H9QMQECxvrgiSOP1pHjy1sMWQVYJOUOA==", "license": "MIT", "optional": true, "dependencies": { @@ -793,8 +649,6 @@ }, "node_modules/agent-base/node_modules/debug": { "version": "4.3.7", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", - "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", "license": "MIT", "optional": true, "dependencies": { @@ -811,15 +665,11 @@ }, "node_modules/agent-base/node_modules/ms": { "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", "license": "MIT", "optional": true }, "node_modules/ajv": { "version": "6.12.6", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", - "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", "dev": true, "license": "MIT", "dependencies": { @@ -835,8 +685,6 @@ }, "node_modules/ansi-regex": { "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "devOptional": true, "license": "MIT", "engines": { @@ -845,8 +693,6 @@ }, "node_modules/ansi-styles": { "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "devOptional": true, "license": "MIT", "dependencies": { @@ -861,8 +707,6 @@ }, "node_modules/anymatch": { "version": "3.1.3", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", - "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", "license": "ISC", "dependencies": { "normalize-path": "^3.0.0", @@ -874,8 +718,6 @@ }, "node_modules/argparse": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", - "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", "dev": true, "license": "Python-2.0" }, @@ -887,8 +729,6 @@ }, "node_modules/arrify": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/arrify/-/arrify-2.0.1.tgz", - "integrity": "sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug==", "license": "MIT", "optional": true, "engines": { @@ -897,8 +737,6 @@ }, "node_modules/async-retry": { "version": "1.3.3", - "resolved": "https://registry.npmjs.org/async-retry/-/async-retry-1.3.3.tgz", - "integrity": "sha512-wfr/jstw9xNi/0teMHrRW7dsz3Lt5ARhYNZ2ewpadnhaIp5mbALhOAP+EAdsC7t4Z6wqsDVv9+W6gm1Dk9mEyw==", "license": "MIT", "optional": true, "dependencies": { @@ -907,21 +745,15 @@ }, "node_modules/asynckit": { "version": "0.4.0", - "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", "license": "MIT", "optional": true }, "node_modules/balanced-match": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", "license": "MIT" }, "node_modules/base64-js": { "version": "1.5.1", - "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", - "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", "funding": [ { "type": "github", @@ -941,8 +773,6 @@ }, "node_modules/bignumber.js": { "version": "9.1.2", - "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.1.2.tgz", - "integrity": "sha512-2/mKyZH9K85bzOEfhXDBFZTGd1CTs+5IHpeFQo9luiBG7hghdC851Pj2WAhb6E3R6b9tZj/XKhbg4fum+Kepug==", "license": "MIT", "optional": true, "engines": { @@ -951,8 +781,6 @@ }, "node_modules/binary-extensions": { "version": "2.3.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.3.0.tgz", - "integrity": "sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==", "license": "MIT", "engines": { "node": ">=8" @@ -987,8 +815,6 @@ }, "node_modules/brace-expansion": { "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "license": "MIT", "dependencies": { "balanced-match": "^1.0.0", @@ -997,8 +823,6 @@ }, "node_modules/braces": { "version": "3.0.3", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", - "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", "license": "MIT", "dependencies": { "fill-range": "^7.1.1" @@ -1009,8 +833,6 @@ }, "node_modules/bson": { "version": "6.8.0", - "resolved": "https://registry.npmjs.org/bson/-/bson-6.8.0.tgz", - "integrity": "sha512-iOJg8pr7wq2tg/zSlCCHMi3hMm5JTOxLTagf3zxhcenHsFp+c6uOs6K7W5UE7A4QIJGtqh/ZovFNMP4mOPJynQ==", "license": "Apache-2.0", "engines": { "node": ">=16.20.1" @@ -1018,8 +840,6 @@ }, "node_modules/buffer-equal-constant-time": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", - "integrity": "sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA==", "license": "BSD-3-Clause" }, "node_modules/bytes": { @@ -1052,8 +872,6 @@ }, "node_modules/callsites": { "version": "3.1.0", - "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", - "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", "dev": true, "license": "MIT", "engines": { @@ -1062,8 +880,6 @@ }, "node_modules/chalk": { "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "license": "MIT", "dependencies": { @@ -1079,8 +895,6 @@ }, "node_modules/chokidar": { "version": "3.6.0", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz", - "integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==", "license": "MIT", "dependencies": { "anymatch": "~3.1.2", @@ -1103,8 +917,6 @@ }, "node_modules/chokidar/node_modules/glob-parent": { "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", "license": "ISC", "dependencies": { "is-glob": "^4.0.1" @@ -1115,8 +927,6 @@ }, "node_modules/cliui": { "version": "8.0.1", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", - "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", "license": "ISC", "optional": true, "dependencies": { @@ -1130,8 +940,6 @@ }, "node_modules/color-convert": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "devOptional": true, "license": "MIT", "dependencies": { @@ -1143,15 +951,11 @@ }, "node_modules/color-name": { "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "devOptional": true, "license": "MIT" }, "node_modules/combined-stream": { "version": "1.0.8", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", - "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", "license": "MIT", "optional": true, "dependencies": { @@ -1163,8 +967,6 @@ }, "node_modules/compressible": { "version": "2.0.18", - "resolved": "https://registry.npmjs.org/compressible/-/compressible-2.0.18.tgz", - "integrity": "sha512-AF3r7P5dWxL8MxyITRMlORQNaOA2IkAFaTr4k7BUumjPtRpGDTZpl0Pb1XCO6JeDCBdp126Cgs9sMxqSjgYyRg==", "license": "MIT", "dependencies": { "mime-db": ">= 1.43.0 < 2" @@ -1175,8 +977,6 @@ }, "node_modules/compression": { "version": "1.7.4", - "resolved": "https://registry.npmjs.org/compression/-/compression-1.7.4.tgz", - "integrity": "sha512-jaSIDzP9pZVS4ZfQ+TzvtiWhdpFhE2RDHz8QJkpX9SIpLq88VueF5jJw6t+6CUQcAoA6t+x89MLrWAqpfDE8iQ==", "license": "MIT", "dependencies": { "accepts": "~1.3.5", @@ -1193,8 +993,6 @@ }, "node_modules/compression/node_modules/bytes": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.0.0.tgz", - "integrity": "sha512-pMhOfFDPiv9t5jjIXkHosWmkSyQbvsgEVNkz0ERHbuLh2T/7j4Mqqpz523Fe8MVY89KC6Sh/QfS2sM+SjgFDcw==", "license": "MIT", "engines": { "node": ">= 0.8" @@ -1202,14 +1000,10 @@ }, "node_modules/compression/node_modules/safe-buffer": { "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", "license": "MIT" }, "node_modules/concat-map": { "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", "license": "MIT" }, "node_modules/content-disposition": { @@ -1250,8 +1044,6 @@ }, "node_modules/cross-spawn": { "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", "dev": true, "license": "MIT", "dependencies": { @@ -1265,8 +1057,6 @@ }, "node_modules/debug": { "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", "license": "MIT", "dependencies": { "ms": "2.0.0" @@ -1274,8 +1064,6 @@ }, "node_modules/deep-is": { "version": "0.1.4", - "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", - "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", "dev": true, "license": "MIT" }, @@ -1298,8 +1086,6 @@ }, "node_modules/delayed-stream": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", "license": "MIT", "optional": true, "engines": { @@ -1327,8 +1113,6 @@ }, "node_modules/dotenv": { "version": "16.4.5", - "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.4.5.tgz", - "integrity": "sha512-ZmdL2rui+eB2YwhsWzjInR8LldtZHGDoQ1ugH85ppHKwpUHL7j7rN0Ti9NCnGiQbhaZ11FpR+7ao1dNsmduNUg==", "license": "BSD-2-Clause", "engines": { "node": ">=12" @@ -1339,8 +1123,6 @@ }, "node_modules/duplexify": { "version": "4.1.3", - "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-4.1.3.tgz", - "integrity": "sha512-M3BmBhwJRZsSx38lZyhE53Csddgzl5R7xGJNk7CVddZD6CcmwMCH8J+7AprIrQKH7TonKxaCjcv27Qmf+sQ+oA==", "license": "MIT", "optional": true, "dependencies": { @@ -1352,8 +1134,6 @@ }, "node_modules/ecdsa-sig-formatter": { "version": "1.0.11", - "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz", - "integrity": "sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==", "license": "Apache-2.0", "dependencies": { "safe-buffer": "^5.0.1" @@ -1367,8 +1147,6 @@ }, "node_modules/emoji-regex": { "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", "license": "MIT", "optional": true }, @@ -1383,8 +1161,6 @@ }, "node_modules/end-of-stream": { "version": "1.4.4", - "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", - "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", "license": "MIT", "optional": true, "dependencies": { @@ -1414,8 +1190,6 @@ }, "node_modules/escalade": { "version": "3.2.0", - "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", - "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", "license": "MIT", "optional": true, "engines": { @@ -1430,8 +1204,6 @@ }, "node_modules/escape-string-regexp": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", - "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", "dev": true, "license": "MIT", "engines": { @@ -1443,8 +1215,6 @@ }, "node_modules/eslint": { "version": "9.9.1", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.9.1.tgz", - "integrity": "sha512-dHvhrbfr4xFQ9/dq+jcVneZMyRYLjggWjk6RVsIiHsP8Rz6yZ8LvZ//iU4TrZF+SXWG+JkNF2OyiZRvzgRDqMg==", "dev": true, "license": "MIT", "dependencies": { @@ -1503,8 +1273,6 @@ }, "node_modules/eslint-scope": { "version": "8.0.2", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.0.2.tgz", - "integrity": "sha512-6E4xmrTw5wtxnLA5wYL3WDfhZ/1bUBGOXV0zQvVRDOtrR8D0p6W7fs3JweNYhwRYeGvd/1CKX2se0/2s7Q/nJA==", "dev": true, "license": "BSD-2-Clause", "dependencies": { @@ -1520,8 +1288,6 @@ }, "node_modules/eslint-visitor-keys": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.0.0.tgz", - "integrity": "sha512-OtIRv/2GyiF6o/d8K7MYKKbXrOUBIK6SfkIRM4Z0dY3w+LiQ0vy3F57m0Z71bjbyeiWFiHJ8brqnmE6H6/jEuw==", "dev": true, "license": "Apache-2.0", "engines": { @@ -1533,8 +1299,6 @@ }, "node_modules/eslint/node_modules/debug": { "version": "4.3.6", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.6.tgz", - "integrity": "sha512-O/09Bd4Z1fBrU4VzkhFqVgpPzaGbw6Sm9FEkBT1A/YBXQFGuuSxa1dN2nxgxS34JmKXqYx8CZAwEVoJFImUXIg==", "dev": true, "license": "MIT", "dependencies": { @@ -1551,15 +1315,11 @@ }, "node_modules/eslint/node_modules/ms": { "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "dev": true, "license": "MIT" }, "node_modules/espree": { "version": "10.1.0", - "resolved": "https://registry.npmjs.org/espree/-/espree-10.1.0.tgz", - "integrity": "sha512-M1M6CpiE6ffoigIOWYO9UDP8TMUw9kqb21tf+08IgDYjCsOvCuDt4jQcZmoYxx+w7zlKw9/N0KXfto+I8/FrXA==", "dev": true, "license": "BSD-2-Clause", "dependencies": { @@ -1576,8 +1336,6 @@ }, "node_modules/esquery": { "version": "1.6.0", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.6.0.tgz", - "integrity": "sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg==", "dev": true, "license": "BSD-3-Clause", "dependencies": { @@ -1589,8 +1347,6 @@ }, "node_modules/esrecurse": { "version": "4.3.0", - "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", - "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", "dev": true, "license": "BSD-2-Clause", "dependencies": { @@ -1602,8 +1358,6 @@ }, "node_modules/estraverse": { "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", "dev": true, "license": "BSD-2-Clause", "engines": { @@ -1612,8 +1366,6 @@ }, "node_modules/esutils": { "version": "2.0.3", - "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", - "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", "dev": true, "license": "BSD-2-Clause", "engines": { @@ -1631,8 +1383,6 @@ }, "node_modules/event-target-shim": { "version": "5.0.1", - "resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz", - "integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==", "license": "MIT", "optional": true, "engines": { @@ -1683,15 +1433,11 @@ }, "node_modules/extend": { "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", - "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", "license": "MIT", "optional": true }, "node_modules/farmhash-modern": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/farmhash-modern/-/farmhash-modern-1.1.0.tgz", - "integrity": "sha512-6ypT4XfgqJk/F3Yuv4SX26I3doUjt0GTG4a+JgWxXQpxXzTBq8fPUeGHfcYMMDPHJHm3yPOSjaeBwBGAHWXCdA==", "license": "MIT", "engines": { "node": ">=18.0.0" @@ -1699,29 +1445,21 @@ }, "node_modules/fast-deep-equal": { "version": "3.1.3", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", "devOptional": true, "license": "MIT" }, "node_modules/fast-json-stable-stringify": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", "dev": true, "license": "MIT" }, "node_modules/fast-levenshtein": { "version": "2.0.6", - "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", - "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", "dev": true, "license": "MIT" }, "node_modules/fast-xml-parser": { "version": "4.5.0", - "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-4.5.0.tgz", - "integrity": "sha512-/PlTQCI96+fZMAOLMZK4CWG1ItCbfZ/0jx7UIJFChPNrx7tcEgerUgWbeieCM9MfHInUDyK8DWYZ+YrywDJuTg==", "funding": [ { "type": "github", @@ -1743,8 +1481,6 @@ }, "node_modules/fastq": { "version": "1.17.1", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.17.1.tgz", - "integrity": "sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==", "dev": true, "license": "ISC", "dependencies": { @@ -1753,8 +1489,6 @@ }, "node_modules/faye-websocket": { "version": "0.11.4", - "resolved": "https://registry.npmjs.org/faye-websocket/-/faye-websocket-0.11.4.tgz", - "integrity": "sha512-CzbClwlXAuiRQAlUyfqPgvPoNKTckTPGfwZV4ZdAhVcP2lh9KUxJg2b5GkE7XbjKQ3YJnQ9z6D9ntLAlB+tP8g==", "license": "Apache-2.0", "dependencies": { "websocket-driver": ">=0.5.1" @@ -1765,8 +1499,6 @@ }, "node_modules/file-entry-cache": { "version": "8.0.0", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-8.0.0.tgz", - "integrity": "sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==", "dev": true, "license": "MIT", "dependencies": { @@ -1778,8 +1510,6 @@ }, "node_modules/fill-range": { "version": "7.1.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", - "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", "license": "MIT", "dependencies": { "to-regex-range": "^5.0.1" @@ -1808,8 +1538,6 @@ }, "node_modules/find-up": { "version": "5.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", - "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", "dev": true, "license": "MIT", "dependencies": { @@ -1825,8 +1553,6 @@ }, "node_modules/firebase-admin": { "version": "12.4.0", - "resolved": "https://registry.npmjs.org/firebase-admin/-/firebase-admin-12.4.0.tgz", - "integrity": "sha512-3HOHqJxNmFv0JgK3voyMQgmcibhJN4LQfZfhnZGb6pcONnZxejki4nQ1twsoJlGaIvgQWBtO7rc5mh/cqlOJNA==", "license": "Apache-2.0", "dependencies": { "@fastify/busboy": "^3.0.0", @@ -1849,8 +1575,6 @@ }, "node_modules/flat-cache": { "version": "4.0.1", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-4.0.1.tgz", - "integrity": "sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==", "dev": true, "license": "MIT", "dependencies": { @@ -1863,15 +1587,11 @@ }, "node_modules/flatted": { "version": "3.3.1", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.1.tgz", - "integrity": "sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==", "dev": true, "license": "ISC" }, "node_modules/form-data": { "version": "2.5.1", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.5.1.tgz", - "integrity": "sha512-m21N3WOmEEURgk6B9GLOE4RuWOFf28Lhh9qGYeNlGq4VDXUlJy2th2slBNU8Gp8EzloYZOibZJ7t5ecIrFSjVA==", "license": "MIT", "optional": true, "dependencies": { @@ -1903,9 +1623,6 @@ }, "node_modules/fsevents": { "version": "2.3.3", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", - "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", - "hasInstallScript": true, "license": "MIT", "optional": true, "os": [ @@ -1926,15 +1643,11 @@ }, "node_modules/functional-red-black-tree": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", - "integrity": "sha512-dsKNQNdj6xA3T+QlADDA7mOSlX0qiMINjn0cgr+eGHGsbSHzTabcIogz2+p/iqP1Xs6EP/sS2SbqH+brGTbq0g==", "license": "MIT", "optional": true }, "node_modules/gaxios": { "version": "6.7.1", - "resolved": "https://registry.npmjs.org/gaxios/-/gaxios-6.7.1.tgz", - "integrity": "sha512-LDODD4TMYx7XXdpwxAVRAIAuB0bzv0s+ywFonY46k126qzQHT9ygyoa9tncmOiQmmDrik65UYsEkv3lbfqQ3yQ==", "license": "Apache-2.0", "optional": true, "dependencies": { @@ -1950,8 +1663,6 @@ }, "node_modules/gaxios/node_modules/uuid": { "version": "9.0.1", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", - "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", "funding": [ "https://github.com/sponsors/broofa", "https://github.com/sponsors/ctavan" @@ -1964,8 +1675,6 @@ }, "node_modules/gcp-metadata": { "version": "5.3.0", - "resolved": "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-5.3.0.tgz", - "integrity": "sha512-FNTkdNEnBdlqF2oatizolQqNANMrcqJt6AAYt99B3y1aLLC8Hc5IOBb+ZnnzllodEEf6xMBp6wRcBbc16fa65w==", "license": "Apache-2.0", "optional": true, "peer": true, @@ -1979,8 +1688,6 @@ }, "node_modules/gcp-metadata/node_modules/agent-base": { "version": "6.0.2", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", - "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", "license": "MIT", "optional": true, "peer": true, @@ -1993,8 +1700,6 @@ }, "node_modules/gcp-metadata/node_modules/debug": { "version": "4.3.7", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", - "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", "license": "MIT", "optional": true, "peer": true, @@ -2012,8 +1717,6 @@ }, "node_modules/gcp-metadata/node_modules/gaxios": { "version": "5.1.3", - "resolved": "https://registry.npmjs.org/gaxios/-/gaxios-5.1.3.tgz", - "integrity": "sha512-95hVgBRgEIRQQQHIbnxBXeHbW4TqFk4ZDJW7wmVtvYar72FdhRIo1UGOLS2eRAKCPEdPBWu+M7+A33D9CdX9rA==", "license": "Apache-2.0", "optional": true, "peer": true, @@ -2029,8 +1732,6 @@ }, "node_modules/gcp-metadata/node_modules/https-proxy-agent": { "version": "5.0.1", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", - "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", "license": "MIT", "optional": true, "peer": true, @@ -2044,16 +1745,12 @@ }, "node_modules/gcp-metadata/node_modules/ms": { "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", "license": "MIT", "optional": true, "peer": true }, "node_modules/get-caller-file": { "version": "2.0.5", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", - "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", "license": "ISC", "optional": true, "engines": { @@ -2081,8 +1778,6 @@ }, "node_modules/glob-parent": { "version": "6.0.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", - "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", "dev": true, "license": "ISC", "dependencies": { @@ -2094,8 +1789,6 @@ }, "node_modules/globals": { "version": "15.9.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-15.9.0.tgz", - "integrity": "sha512-SmSKyLLKFbSr6rptvP8izbyxJL4ILwqO9Jg23UA0sDlGlu58V59D1//I3vlc0KJphVdUR7vMjHIplYnzBxorQA==", "dev": true, "license": "MIT", "engines": { @@ -2107,8 +1800,6 @@ }, "node_modules/google-auth-library": { "version": "9.14.1", - "resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-9.14.1.tgz", - "integrity": "sha512-Rj+PMjoNFGFTmtItH7gHfbHpGVSb3vmnGK3nwNBqxQF9NoBpttSZI/rc0WiM63ma2uGDQtYEkMHkK9U6937NiA==", "license": "Apache-2.0", "optional": true, "dependencies": { @@ -2125,8 +1816,6 @@ }, "node_modules/google-auth-library/node_modules/gcp-metadata": { "version": "6.1.0", - "resolved": "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-6.1.0.tgz", - "integrity": "sha512-Jh/AIwwgaxan+7ZUUmRLCjtchyDiqh4KjBJ5tW3plBZb5iL/BPcso8A5DlzeD9qlw0duCamnNdpFjxwaT0KyKg==", "license": "Apache-2.0", "optional": true, "dependencies": { @@ -2139,8 +1828,6 @@ }, "node_modules/google-gax": { "version": "4.4.1", - "resolved": "https://registry.npmjs.org/google-gax/-/google-gax-4.4.1.tgz", - "integrity": "sha512-Phyp9fMfA00J3sZbJxbbB4jC55b7DBjE3F6poyL3wKMEBVKA79q6BGuHcTiM28yOzVql0NDbRL8MLLh8Iwk9Dg==", "license": "Apache-2.0", "optional": true, "dependencies": { @@ -2163,8 +1850,6 @@ }, "node_modules/google-gax/node_modules/@grpc/grpc-js": { "version": "1.11.2", - "resolved": "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-1.11.2.tgz", - "integrity": "sha512-DWp92gDD7/Qkj7r8kus6/HCINeo3yPZWZ3paKgDgsbKbSpoxKg1yvN8xe2Q8uE3zOsPe3bX8FQX2+XValq2yTw==", "license": "Apache-2.0", "optional": true, "dependencies": { @@ -2177,8 +1862,6 @@ }, "node_modules/google-gax/node_modules/uuid": { "version": "9.0.1", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", - "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", "funding": [ "https://github.com/sponsors/broofa", "https://github.com/sponsors/ctavan" @@ -2203,8 +1886,6 @@ }, "node_modules/gtoken": { "version": "7.1.0", - "resolved": "https://registry.npmjs.org/gtoken/-/gtoken-7.1.0.tgz", - "integrity": "sha512-pCcEwRi+TKpMlxAQObHDQ56KawURgyAf6jtIY046fJ5tIv3zDe/LEIubckAO8fj6JnAxLdmWkUfNyulQ2iKdEw==", "license": "MIT", "optional": true, "dependencies": { @@ -2217,8 +1898,6 @@ }, "node_modules/has-flag": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, "license": "MIT", "engines": { @@ -2275,8 +1954,6 @@ }, "node_modules/html-entities": { "version": "2.5.2", - "resolved": "https://registry.npmjs.org/html-entities/-/html-entities-2.5.2.tgz", - "integrity": "sha512-K//PSRMQk4FZ78Kyau+mZurHn3FH0Vwr+H36eE0rPbeYkRRi9YxceYPhuN60UwWorxyKHhqoAJl2OFKa4BVtaA==", "funding": [ { "type": "github", @@ -2308,14 +1985,10 @@ }, "node_modules/http-parser-js": { "version": "0.5.8", - "resolved": "https://registry.npmjs.org/http-parser-js/-/http-parser-js-0.5.8.tgz", - "integrity": "sha512-SGeBX54F94Wgu5RH3X5jsDtf4eHyRogWX1XGT3b4HuW3tQPM4AaBzoUji/4AAJNXCEOWZ5O0DgZmJw1947gD5Q==", "license": "MIT" }, "node_modules/http-proxy-agent": { "version": "5.0.0", - "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-5.0.0.tgz", - "integrity": "sha512-n2hY8YdoRE1i7r6M0w9DIw5GgZN0G25P8zLCRQ8rjXtTU3vsNFBI/vWK/UIeE6g5MUUz6avwAPXmL6Fy9D/90w==", "license": "MIT", "optional": true, "dependencies": { @@ -2329,8 +2002,6 @@ }, "node_modules/http-proxy-agent/node_modules/agent-base": { "version": "6.0.2", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", - "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", "license": "MIT", "optional": true, "dependencies": { @@ -2342,8 +2013,6 @@ }, "node_modules/http-proxy-agent/node_modules/debug": { "version": "4.3.7", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", - "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", "license": "MIT", "optional": true, "dependencies": { @@ -2360,15 +2029,11 @@ }, "node_modules/http-proxy-agent/node_modules/ms": { "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", "license": "MIT", "optional": true }, "node_modules/https-proxy-agent": { "version": "7.0.5", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.5.tgz", - "integrity": "sha512-1e4Wqeblerz+tMKPIq2EMGiiWW1dIjZOksyHWSUm1rmuvw/how9hBHZ38lAGj5ID4Ik6EdkOw7NmWPy6LAwalw==", "license": "MIT", "optional": true, "dependencies": { @@ -2381,8 +2046,6 @@ }, "node_modules/https-proxy-agent/node_modules/debug": { "version": "4.3.7", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", - "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", "license": "MIT", "optional": true, "dependencies": { @@ -2399,8 +2062,6 @@ }, "node_modules/https-proxy-agent/node_modules/ms": { "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", "license": "MIT", "optional": true }, @@ -2418,8 +2079,6 @@ }, "node_modules/ignore": { "version": "5.3.2", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", - "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", "dev": true, "license": "MIT", "engines": { @@ -2428,14 +2087,10 @@ }, "node_modules/ignore-by-default": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/ignore-by-default/-/ignore-by-default-1.0.1.tgz", - "integrity": "sha512-Ius2VYcGNk7T90CppJqcIkS5ooHUZyIQK+ClZfMfMNFEF9VSE73Fq+906u/CWu92x4gzZMWOwfFYckPObzdEbA==", "license": "ISC" }, "node_modules/import-fresh": { "version": "3.3.0", - "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", - "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", "dev": true, "license": "MIT", "dependencies": { @@ -2451,8 +2106,6 @@ }, "node_modules/imurmurhash": { "version": "0.1.4", - "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", "dev": true, "license": "MIT", "engines": { @@ -2461,8 +2114,6 @@ }, "node_modules/inherits": { "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", "license": "ISC" }, "node_modules/ipaddr.js": { @@ -2476,8 +2127,6 @@ }, "node_modules/is-binary-path": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", - "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", "license": "MIT", "dependencies": { "binary-extensions": "^2.0.0" @@ -2488,8 +2137,6 @@ }, "node_modules/is-extglob": { "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", "license": "MIT", "engines": { "node": ">=0.10.0" @@ -2497,8 +2144,6 @@ }, "node_modules/is-fullwidth-code-point": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", "license": "MIT", "optional": true, "engines": { @@ -2507,8 +2152,6 @@ }, "node_modules/is-glob": { "version": "4.0.3", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", - "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", "license": "MIT", "dependencies": { "is-extglob": "^2.1.1" @@ -2519,8 +2162,6 @@ }, "node_modules/is-number": { "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", "license": "MIT", "engines": { "node": ">=0.12.0" @@ -2528,8 +2169,6 @@ }, "node_modules/is-path-inside": { "version": "3.0.3", - "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", - "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", "dev": true, "license": "MIT", "engines": { @@ -2538,8 +2177,6 @@ }, "node_modules/is-stream": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", - "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", "license": "MIT", "optional": true, "engines": { @@ -2551,15 +2188,11 @@ }, "node_modules/isexe": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", "dev": true, "license": "ISC" }, "node_modules/jose": { "version": "4.15.9", - "resolved": "https://registry.npmjs.org/jose/-/jose-4.15.9.tgz", - "integrity": "sha512-1vUQX+IdDMVPj4k8kOxgUqlcK518yluMuGZwqlr44FS1ppZB/5GWh4rZG89erpOBOJjU/OBsnCVFfapsRz6nEA==", "license": "MIT", "funding": { "url": "https://github.com/sponsors/panva" @@ -2567,8 +2200,6 @@ }, "node_modules/js-yaml": { "version": "4.1.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", - "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", "dev": true, "license": "MIT", "dependencies": { @@ -2580,8 +2211,6 @@ }, "node_modules/json-bigint": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-bigint/-/json-bigint-1.0.0.tgz", - "integrity": "sha512-SiPv/8VpZuWbvLSMtTDU8hEfrZWg/mH/nV/b4o0CYbSxu1UIQPLdwKOCIyLQX+VIPO5vrLX3i8qtqFyhdPSUSQ==", "license": "MIT", "optional": true, "dependencies": { @@ -2590,29 +2219,21 @@ }, "node_modules/json-buffer": { "version": "3.0.1", - "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", - "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", "dev": true, "license": "MIT" }, "node_modules/json-schema-traverse": { "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", "dev": true, "license": "MIT" }, "node_modules/json-stable-stringify-without-jsonify": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", - "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", "dev": true, "license": "MIT" }, "node_modules/jsonwebtoken": { "version": "9.0.2", - "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-9.0.2.tgz", - "integrity": "sha512-PRp66vJ865SSqOlgqS8hujT5U4AOgMfhrwYIuIhfKaoSCZcirrmASQr8CX7cUg+RMih+hgznrjp99o+W4pJLHQ==", "license": "MIT", "dependencies": { "jws": "^3.2.2", @@ -2633,8 +2254,6 @@ }, "node_modules/jsonwebtoken/node_modules/jwa": { "version": "1.4.1", - "resolved": "https://registry.npmjs.org/jwa/-/jwa-1.4.1.tgz", - "integrity": "sha512-qiLX/xhEEFKUAJ6FiBMbes3w9ATzyk5W7Hvzpa/SLYdxNtng+gcurvrI7TbACjIXlsJyr05/S1oUhZrc63evQA==", "license": "MIT", "dependencies": { "buffer-equal-constant-time": "1.0.1", @@ -2644,8 +2263,6 @@ }, "node_modules/jsonwebtoken/node_modules/jws": { "version": "3.2.2", - "resolved": "https://registry.npmjs.org/jws/-/jws-3.2.2.tgz", - "integrity": "sha512-YHlZCB6lMTllWDtSPHz/ZXTsi8S00usEV6v1tjq8tOUZzw7DpSDWVXjXDre6ed1w/pd495ODpHZYSdkRTsa0HA==", "license": "MIT", "dependencies": { "jwa": "^1.4.1", @@ -2654,14 +2271,10 @@ }, "node_modules/jsonwebtoken/node_modules/ms": { "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", "license": "MIT" }, "node_modules/jwa": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/jwa/-/jwa-2.0.0.tgz", - "integrity": "sha512-jrZ2Qx916EA+fq9cEAeCROWPTfCwi1IVHqT2tapuqLEVVDKFDENFw1oL+MwrTvH6msKxsd1YTDVw6uKEcsrLEA==", "license": "MIT", "optional": true, "dependencies": { @@ -2672,8 +2285,6 @@ }, "node_modules/jwks-rsa": { "version": "3.1.0", - "resolved": "https://registry.npmjs.org/jwks-rsa/-/jwks-rsa-3.1.0.tgz", - "integrity": "sha512-v7nqlfezb9YfHHzYII3ef2a2j1XnGeSE/bK3WfumaYCqONAIstJbrEGapz4kadScZzEt7zYCN7bucj8C0Mv/Rg==", "license": "MIT", "dependencies": { "@types/express": "^4.17.17", @@ -2689,8 +2300,6 @@ }, "node_modules/jwks-rsa/node_modules/debug": { "version": "4.3.7", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", - "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", "license": "MIT", "dependencies": { "ms": "^2.1.3" @@ -2706,14 +2315,10 @@ }, "node_modules/jwks-rsa/node_modules/ms": { "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", "license": "MIT" }, "node_modules/jws": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/jws/-/jws-4.0.0.tgz", - "integrity": "sha512-KDncfTmOZoOMTFG4mBlG0qUIOlc03fmzH+ru6RgYVZhPkyiy/92Owlt/8UEN+a4TXR1FQetfIpJE8ApdvdVxTg==", "license": "MIT", "optional": true, "dependencies": { @@ -2723,8 +2328,6 @@ }, "node_modules/kareem": { "version": "2.6.3", - "resolved": "https://registry.npmjs.org/kareem/-/kareem-2.6.3.tgz", - "integrity": "sha512-C3iHfuGUXK2u8/ipq9LfjFfXFxAZMQJJq7vLS45r3D9Y2xQ/m4S8zaR4zMLFWh9AsNPXmcFfUDhTEO8UIC/V6Q==", "license": "Apache-2.0", "engines": { "node": ">=12.0.0" @@ -2732,8 +2335,6 @@ }, "node_modules/keyv": { "version": "4.5.4", - "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", - "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", "dev": true, "license": "MIT", "dependencies": { @@ -2742,8 +2343,6 @@ }, "node_modules/levn": { "version": "0.4.1", - "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", - "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", "dev": true, "license": "MIT", "dependencies": { @@ -2755,14 +2354,10 @@ } }, "node_modules/limiter": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/limiter/-/limiter-1.1.5.tgz", - "integrity": "sha512-FWWMIEOxz3GwUI4Ts/IvgVy6LPvoMPgjMdQ185nN6psJyBJ4yOpzqm695/h5umdLJg2vW3GR5iG11MAkR2AzJA==" + "version": "1.1.5" }, "node_modules/locate-path": { "version": "6.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", - "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", "dev": true, "license": "MIT", "dependencies": { @@ -2777,77 +2372,53 @@ }, "node_modules/lodash.camelcase": { "version": "4.3.0", - "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz", - "integrity": "sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==", "license": "MIT", "optional": true }, "node_modules/lodash.clonedeep": { "version": "4.5.0", - "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", - "integrity": "sha512-H5ZhCF25riFd9uB5UCkVKo61m3S/xZk1x4wA6yp/L3RFP6Z/eHH1ymQcGLo7J3GMPfm0V/7m1tryHuGVxpqEBQ==", "license": "MIT" }, "node_modules/lodash.includes": { "version": "4.3.0", - "resolved": "https://registry.npmjs.org/lodash.includes/-/lodash.includes-4.3.0.tgz", - "integrity": "sha512-W3Bx6mdkRTGtlJISOvVD/lbqjTlPPUDTMnlXZFnVwi9NKJ6tiAk6LVdlhZMm17VZisqhKcgzpO5Wz91PCt5b0w==", "license": "MIT" }, "node_modules/lodash.isboolean": { "version": "3.0.3", - "resolved": "https://registry.npmjs.org/lodash.isboolean/-/lodash.isboolean-3.0.3.tgz", - "integrity": "sha512-Bz5mupy2SVbPHURB98VAcw+aHh4vRV5IPNhILUCsOzRmsTmSQ17jIuqopAentWoehktxGd9e/hbIXq980/1QJg==", "license": "MIT" }, "node_modules/lodash.isinteger": { "version": "4.0.4", - "resolved": "https://registry.npmjs.org/lodash.isinteger/-/lodash.isinteger-4.0.4.tgz", - "integrity": "sha512-DBwtEWN2caHQ9/imiNeEA5ys1JoRtRfY3d7V9wkqtbycnAmTvRRmbHKDV4a0EYc678/dia0jrte4tjYwVBaZUA==", "license": "MIT" }, "node_modules/lodash.isnumber": { "version": "3.0.3", - "resolved": "https://registry.npmjs.org/lodash.isnumber/-/lodash.isnumber-3.0.3.tgz", - "integrity": "sha512-QYqzpfwO3/CWf3XP+Z+tkQsfaLL/EnUlXWVkIk5FUPc4sBdTehEqZONuyRt2P67PXAk+NXmTBcc97zw9t1FQrw==", "license": "MIT" }, "node_modules/lodash.isplainobject": { "version": "4.0.6", - "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", - "integrity": "sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA==", "license": "MIT" }, "node_modules/lodash.isstring": { "version": "4.0.1", - "resolved": "https://registry.npmjs.org/lodash.isstring/-/lodash.isstring-4.0.1.tgz", - "integrity": "sha512-0wJxfxH1wgO3GrbuP+dTTk7op+6L41QCXbGINEmD+ny/G/eCqGzxyCsh7159S+mgDDcoarnBw6PC1PS5+wUGgw==", "license": "MIT" }, "node_modules/lodash.merge": { "version": "4.6.2", - "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", - "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", "dev": true, "license": "MIT" }, "node_modules/lodash.once": { "version": "4.1.1", - "resolved": "https://registry.npmjs.org/lodash.once/-/lodash.once-4.1.1.tgz", - "integrity": "sha512-Sb487aTOCr9drQVL8pIxOzVhafOjZN9UU54hiN8PU3uAiSV7lx1yYNpbNmex2PK6dSJoNTSJUUswT651yww3Mg==", "license": "MIT" }, "node_modules/long": { "version": "5.2.3", - "resolved": "https://registry.npmjs.org/long/-/long-5.2.3.tgz", - "integrity": "sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q==", "license": "Apache-2.0", "optional": true }, "node_modules/lru-cache": { "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", "license": "ISC", "dependencies": { "yallist": "^4.0.0" @@ -2858,8 +2429,6 @@ }, "node_modules/lru-memoizer": { "version": "2.3.0", - "resolved": "https://registry.npmjs.org/lru-memoizer/-/lru-memoizer-2.3.0.tgz", - "integrity": "sha512-GXn7gyHAMhO13WSKrIiNfztwxodVsP8IoZ3XfrJV4yH2x0/OeTO/FIaAHTY5YekdGgW94njfuKmyyt1E0mR6Ug==", "license": "MIT", "dependencies": { "lodash.clonedeep": "^4.5.0", @@ -2877,8 +2446,6 @@ }, "node_modules/memory-pager": { "version": "1.5.0", - "resolved": "https://registry.npmjs.org/memory-pager/-/memory-pager-1.5.0.tgz", - "integrity": "sha512-ZS4Bp4r/Zoeq6+NLJpP+0Zzm0pR8whtGPf1XExKLJBAczGMnSi3It14OiNCStjQjM6NU1okjQGSxgEZN8eBYKg==", "license": "MIT" }, "node_modules/merge-descriptors": { @@ -2910,8 +2477,6 @@ }, "node_modules/mime-db": { "version": "1.52.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", - "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", "license": "MIT", "engines": { "node": ">= 0.6" @@ -2919,8 +2484,6 @@ }, "node_modules/mime-types": { "version": "2.1.35", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", - "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", "license": "MIT", "dependencies": { "mime-db": "1.52.0" @@ -2931,8 +2494,6 @@ }, "node_modules/minimatch": { "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "license": "ISC", "dependencies": { "brace-expansion": "^1.1.7" @@ -2943,8 +2504,6 @@ }, "node_modules/mongodb": { "version": "6.8.0", - "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-6.8.0.tgz", - "integrity": "sha512-HGQ9NWDle5WvwMnrvUxsFYPd3JEbqD3RgABHBQRuoCEND0qzhsd0iH5ypHsf1eJ+sXmvmyKpP+FLOKY8Il7jMw==", "license": "Apache-2.0", "dependencies": { "@mongodb-js/saslprep": "^1.1.5", @@ -2989,8 +2548,6 @@ }, "node_modules/mongodb-connection-string-url": { "version": "3.0.1", - "resolved": "https://registry.npmjs.org/mongodb-connection-string-url/-/mongodb-connection-string-url-3.0.1.tgz", - "integrity": "sha512-XqMGwRX0Lgn05TDB4PyG2h2kKO/FfWJyCzYQbIhXUxz7ETt0I/FqHjUeqj37irJ+Dl1ZtU82uYyj14u2XsZKfg==", "license": "Apache-2.0", "dependencies": { "@types/whatwg-url": "^11.0.2", @@ -2999,8 +2556,6 @@ }, "node_modules/mongoose": { "version": "8.6.0", - "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-8.6.0.tgz", - "integrity": "sha512-p6VSbYKvD4ZIabqo8C0kS5eKX1Xpji+opTAIJ9wyuPJ8Y/FblgXSMnFRXnB40bYZLKPQT089K5KU8+bqIXtFdw==", "license": "MIT", "dependencies": { "bson": "^6.7.0", @@ -3021,14 +2576,10 @@ }, "node_modules/mongoose/node_modules/ms": { "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", "license": "MIT" }, "node_modules/mpath": { "version": "0.9.0", - "resolved": "https://registry.npmjs.org/mpath/-/mpath-0.9.0.tgz", - "integrity": "sha512-ikJRQTk8hw5DEoFVxHG1Gn9T/xcjtdnOKIU1JTmGjZZlg9LST2mBLmcX3/ICIbgJydT2GOc15RnNy5mHmzfSew==", "license": "MIT", "engines": { "node": ">=4.0.0" @@ -3036,8 +2587,6 @@ }, "node_modules/mquery": { "version": "5.0.0", - "resolved": "https://registry.npmjs.org/mquery/-/mquery-5.0.0.tgz", - "integrity": "sha512-iQMncpmEK8R8ncT8HJGsGc9Dsp8xcgYMVSbs5jgnm1lFHTZqMJTUWTDx1LBO8+mK3tPNZWFLBghQEIOULSTHZg==", "license": "MIT", "dependencies": { "debug": "4.x" @@ -3048,8 +2597,6 @@ }, "node_modules/mquery/node_modules/debug": { "version": "4.3.6", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.6.tgz", - "integrity": "sha512-O/09Bd4Z1fBrU4VzkhFqVgpPzaGbw6Sm9FEkBT1A/YBXQFGuuSxa1dN2nxgxS34JmKXqYx8CZAwEVoJFImUXIg==", "license": "MIT", "dependencies": { "ms": "2.1.2" @@ -3065,27 +2612,19 @@ }, "node_modules/mquery/node_modules/ms": { "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "license": "MIT" }, "node_modules/ms": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", "license": "MIT" }, "node_modules/natural-compare": { "version": "1.4.0", - "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", - "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", "dev": true, "license": "MIT" }, "node_modules/negotiator": { "version": "0.6.3", - "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", - "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", "license": "MIT", "engines": { "node": ">= 0.6" @@ -3093,8 +2632,6 @@ }, "node_modules/node-fetch": { "version": "2.7.0", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", - "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", "license": "MIT", "optional": true, "dependencies": { @@ -3114,22 +2651,16 @@ }, "node_modules/node-fetch/node_modules/tr46": { "version": "0.0.3", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", - "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", "license": "MIT", "optional": true }, "node_modules/node-fetch/node_modules/webidl-conversions": { "version": "3.0.1", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", - "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==", "license": "BSD-2-Clause", "optional": true }, "node_modules/node-fetch/node_modules/whatwg-url": { "version": "5.0.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", - "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", "license": "MIT", "optional": true, "dependencies": { @@ -3139,8 +2670,6 @@ }, "node_modules/node-forge": { "version": "1.3.1", - "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-1.3.1.tgz", - "integrity": "sha512-dPEtOeMvF9VMcYV/1Wb8CPoVAXtp6MKMlcbAt4ddqmGqUJ6fQZFXkNZNkNlfevtNkGtaSoXf/vNNNSvgrdXwtA==", "license": "(BSD-3-Clause OR GPL-2.0)", "engines": { "node": ">= 6.13.0" @@ -3148,8 +2677,6 @@ }, "node_modules/nodemon": { "version": "3.1.4", - "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-3.1.4.tgz", - "integrity": "sha512-wjPBbFhtpJwmIeY2yP7QF+UKzPfltVGtfce1g/bB15/8vCGZj8uxD62b/b9M9/WVgme0NZudpownKN+c0plXlQ==", "license": "MIT", "dependencies": { "chokidar": "^3.5.2", @@ -3176,8 +2703,6 @@ }, "node_modules/nodemon/node_modules/debug": { "version": "4.3.6", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.6.tgz", - "integrity": "sha512-O/09Bd4Z1fBrU4VzkhFqVgpPzaGbw6Sm9FEkBT1A/YBXQFGuuSxa1dN2nxgxS34JmKXqYx8CZAwEVoJFImUXIg==", "license": "MIT", "dependencies": { "ms": "2.1.2" @@ -3193,8 +2718,6 @@ }, "node_modules/nodemon/node_modules/has-flag": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", "license": "MIT", "engines": { "node": ">=4" @@ -3202,14 +2725,10 @@ }, "node_modules/nodemon/node_modules/ms": { "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "license": "MIT" }, "node_modules/nodemon/node_modules/supports-color": { "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", "license": "MIT", "dependencies": { "has-flag": "^3.0.0" @@ -3220,8 +2739,6 @@ }, "node_modules/normalize-path": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", - "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", "license": "MIT", "engines": { "node": ">=0.10.0" @@ -3229,8 +2746,6 @@ }, "node_modules/object-hash": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/object-hash/-/object-hash-3.0.0.tgz", - "integrity": "sha512-RSn9F68PjH9HqtltsSnqYC1XXoWe9Bju5+213R98cNGttag9q9yAOTzdbsqvIa7aNm5WffBZFpWYr2aWrklWAw==", "license": "MIT", "optional": true, "engines": { @@ -3263,8 +2778,6 @@ }, "node_modules/on-headers": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/on-headers/-/on-headers-1.0.2.tgz", - "integrity": "sha512-pZAE+FJLoyITytdqK0U5s+FIpjN0JP3OzFi/u8Rx+EV5/W+JTWGXG8xFzevE7AjBfDqHv/8vL8qQsIhHnqRkrA==", "license": "MIT", "engines": { "node": ">= 0.8" @@ -3272,8 +2785,6 @@ }, "node_modules/once": { "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", "license": "ISC", "optional": true, "dependencies": { @@ -3282,8 +2793,6 @@ }, "node_modules/optionator": { "version": "0.9.4", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", - "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==", "dev": true, "license": "MIT", "dependencies": { @@ -3300,8 +2809,6 @@ }, "node_modules/p-limit": { "version": "3.1.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", - "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", "devOptional": true, "license": "MIT", "dependencies": { @@ -3316,8 +2823,6 @@ }, "node_modules/p-locate": { "version": "5.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", - "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", "dev": true, "license": "MIT", "dependencies": { @@ -3332,8 +2837,6 @@ }, "node_modules/parent-module": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", - "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", "dev": true, "license": "MIT", "dependencies": { @@ -3354,8 +2857,6 @@ }, "node_modules/path-exists": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", "dev": true, "license": "MIT", "engines": { @@ -3364,8 +2865,6 @@ }, "node_modules/path-key": { "version": "3.1.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", "dev": true, "license": "MIT", "engines": { @@ -3380,8 +2879,6 @@ }, "node_modules/picomatch": { "version": "2.3.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", "license": "MIT", "engines": { "node": ">=8.6" @@ -3392,8 +2889,6 @@ }, "node_modules/prelude-ls": { "version": "1.2.1", - "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", - "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", "dev": true, "license": "MIT", "engines": { @@ -3402,8 +2897,6 @@ }, "node_modules/proto3-json-serializer": { "version": "2.0.2", - "resolved": "https://registry.npmjs.org/proto3-json-serializer/-/proto3-json-serializer-2.0.2.tgz", - "integrity": "sha512-SAzp/O4Yh02jGdRc+uIrGoe87dkN/XtwxfZ4ZyafJHymd79ozp5VG5nyZ7ygqPM5+cpLDjjGnYFUkngonyDPOQ==", "license": "Apache-2.0", "optional": true, "dependencies": { @@ -3415,8 +2908,6 @@ }, "node_modules/protobufjs": { "version": "7.4.0", - "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.4.0.tgz", - "integrity": "sha512-mRUWCc3KUU4w1jU8sGxICXH/gNS94DvI1gxqDvBzhj1JpcsimQkYiOJfwsPUykUI5ZaspFbSgmBLER8IrQ3tqw==", "hasInstallScript": true, "license": "BSD-3-Clause", "optional": true, @@ -3453,14 +2944,10 @@ }, "node_modules/pstree.remy": { "version": "1.1.8", - "resolved": "https://registry.npmjs.org/pstree.remy/-/pstree.remy-1.1.8.tgz", - "integrity": "sha512-77DZwxQmxKnu3aR542U+X8FypNzbfJ+C5XQDk3uWjWxn6151aIMGthWYRXTqT1E5oJvg+ljaa2OJi+VfvCOQ8w==", "license": "MIT" }, "node_modules/punycode": { "version": "2.3.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", - "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", "license": "MIT", "engines": { "node": ">=6" @@ -3483,8 +2970,6 @@ }, "node_modules/queue-microtask": { "version": "1.2.3", - "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", - "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", "dev": true, "funding": [ { @@ -3528,8 +3013,6 @@ }, "node_modules/readable-stream": { "version": "3.6.2", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", - "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", "license": "MIT", "optional": true, "dependencies": { @@ -3543,8 +3026,6 @@ }, "node_modules/readdirp": { "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", - "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", "license": "MIT", "dependencies": { "picomatch": "^2.2.1" @@ -3555,8 +3036,6 @@ }, "node_modules/require-directory": { "version": "2.1.1", - "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", "license": "MIT", "optional": true, "engines": { @@ -3565,8 +3044,6 @@ }, "node_modules/resolve-from": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", - "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", "dev": true, "license": "MIT", "engines": { @@ -3575,8 +3052,6 @@ }, "node_modules/retry": { "version": "0.13.1", - "resolved": "https://registry.npmjs.org/retry/-/retry-0.13.1.tgz", - "integrity": "sha512-XQBQ3I8W1Cge0Seh+6gjj03LbmRFWuoszgK9ooCpwYIrhhoO80pfq4cUkU5DkknwfOfFteRwlZ56PYOGYyFWdg==", "license": "MIT", "optional": true, "engines": { @@ -3585,8 +3060,6 @@ }, "node_modules/retry-request": { "version": "7.0.2", - "resolved": "https://registry.npmjs.org/retry-request/-/retry-request-7.0.2.tgz", - "integrity": "sha512-dUOvLMJ0/JJYEn8NrpOaGNE7X3vpI5XlZS/u0ANjqtcZVKnIxP7IgCFwrKTxENw29emmwug53awKtaMm4i9g5w==", "license": "MIT", "optional": true, "dependencies": { @@ -3600,8 +3073,6 @@ }, "node_modules/reusify": { "version": "1.0.4", - "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", - "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", "dev": true, "license": "MIT", "engines": { @@ -3611,8 +3082,6 @@ }, "node_modules/run-parallel": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", - "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", "dev": true, "funding": [ { @@ -3635,8 +3104,6 @@ }, "node_modules/safe-buffer": { "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", "funding": [ { "type": "github", @@ -3661,8 +3128,6 @@ }, "node_modules/semver": { "version": "7.6.3", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", - "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", "license": "ISC", "bin": { "semver": "bin/semver.js" @@ -3741,8 +3206,6 @@ }, "node_modules/shebang-command": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", - "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", "dev": true, "license": "MIT", "dependencies": { @@ -3754,8 +3217,6 @@ }, "node_modules/shebang-regex": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", "dev": true, "license": "MIT", "engines": { @@ -3782,14 +3243,10 @@ }, "node_modules/sift": { "version": "17.1.3", - "resolved": "https://registry.npmjs.org/sift/-/sift-17.1.3.tgz", - "integrity": "sha512-Rtlj66/b0ICeFzYTuNvX/EF1igRbbnGSvEyT79McoZa/DeGhMyC5pWKOEsZKnpkqtSeovd5FL/bjHWC3CIIvCQ==", "license": "MIT" }, "node_modules/simple-update-notifier": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/simple-update-notifier/-/simple-update-notifier-2.0.0.tgz", - "integrity": "sha512-a2B9Y0KlNXl9u/vsW6sTIu9vGEpfKu2wRV6l1H3XEas/0gUIzGzBoP/IouTcUQbm9JWZLH3COxyn03TYlFax6w==", "license": "MIT", "dependencies": { "semver": "^7.5.3" @@ -3800,8 +3257,6 @@ }, "node_modules/sparse-bitfield": { "version": "3.0.3", - "resolved": "https://registry.npmjs.org/sparse-bitfield/-/sparse-bitfield-3.0.3.tgz", - "integrity": "sha512-kvzhi7vqKTfkh0PZU+2D2PIllw2ymqJKujUcyPMd9Y75Nv4nPbGJZXNhxsgdQab2BmlDct1YnfQCguEvHr7VsQ==", "license": "MIT", "dependencies": { "memory-pager": "^1.0.2" @@ -3818,8 +3273,6 @@ }, "node_modules/stream-events": { "version": "1.0.5", - "resolved": "https://registry.npmjs.org/stream-events/-/stream-events-1.0.5.tgz", - "integrity": "sha512-E1GUzBSgvct8Jsb3v2X15pjzN1tYebtbLaMg+eBOUOAxgbLoSbT2NS91ckc5lJD1KfLjId+jXJRgo0qnV5Nerg==", "license": "MIT", "optional": true, "dependencies": { @@ -3828,15 +3281,11 @@ }, "node_modules/stream-shift": { "version": "1.0.3", - "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.3.tgz", - "integrity": "sha512-76ORR0DO1o1hlKwTbi/DM3EXWGf3ZJYO8cXX5RJwnul2DEg2oyoZyjLNoQM8WsvZiFKCRfC1O0J7iCvie3RZmQ==", "license": "MIT", "optional": true }, "node_modules/string_decoder": { "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", "license": "MIT", "optional": true, "dependencies": { @@ -3845,8 +3294,6 @@ }, "node_modules/string-width": { "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "license": "MIT", "optional": true, "dependencies": { @@ -3860,8 +3307,6 @@ }, "node_modules/strip-ansi": { "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "devOptional": true, "license": "MIT", "dependencies": { @@ -3873,8 +3318,6 @@ }, "node_modules/strip-json-comments": { "version": "3.1.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", - "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", "dev": true, "license": "MIT", "engines": { @@ -3886,22 +3329,16 @@ }, "node_modules/strnum": { "version": "1.0.5", - "resolved": "https://registry.npmjs.org/strnum/-/strnum-1.0.5.tgz", - "integrity": "sha512-J8bbNyKKXl5qYcR36TIO8W3mVGVHrmmxsd5PAItGkmyzwJvybiw2IVq5nqd0i4LSNSkB/sx9VHllbfFdr9k1JA==", "license": "MIT", "optional": true }, "node_modules/stubs": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/stubs/-/stubs-3.0.0.tgz", - "integrity": "sha512-PdHt7hHUJKxvTCgbKX9C1V/ftOcjJQgz8BZwNfV5c4B6dcGqlpelTbJ999jBGZ2jYiPAwcX5dP6oBwVlBlUbxw==", "license": "MIT", "optional": true }, "node_modules/supports-color": { "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "license": "MIT", "dependencies": { @@ -3913,8 +3350,6 @@ }, "node_modules/teeny-request": { "version": "9.0.0", - "resolved": "https://registry.npmjs.org/teeny-request/-/teeny-request-9.0.0.tgz", - "integrity": "sha512-resvxdc6Mgb7YEThw6G6bExlXKkv6+YbuzGg9xuXxSgxJF7Ozs+o8Y9+2R3sArdWdW8nOokoQb1yrpFB0pQK2g==", "license": "Apache-2.0", "optional": true, "dependencies": { @@ -3930,8 +3365,6 @@ }, "node_modules/teeny-request/node_modules/agent-base": { "version": "6.0.2", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", - "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", "license": "MIT", "optional": true, "dependencies": { @@ -3943,8 +3376,6 @@ }, "node_modules/teeny-request/node_modules/debug": { "version": "4.3.7", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", - "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", "license": "MIT", "optional": true, "dependencies": { @@ -3961,8 +3392,6 @@ }, "node_modules/teeny-request/node_modules/https-proxy-agent": { "version": "5.0.1", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", - "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", "license": "MIT", "optional": true, "dependencies": { @@ -3975,15 +3404,11 @@ }, "node_modules/teeny-request/node_modules/ms": { "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", "license": "MIT", "optional": true }, "node_modules/teeny-request/node_modules/uuid": { "version": "9.0.1", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", - "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", "funding": [ "https://github.com/sponsors/broofa", "https://github.com/sponsors/ctavan" @@ -3996,15 +3421,11 @@ }, "node_modules/text-table": { "version": "0.2.0", - "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", - "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", "dev": true, "license": "MIT" }, "node_modules/to-regex-range": { "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", "license": "MIT", "dependencies": { "is-number": "^7.0.0" @@ -4024,8 +3445,6 @@ }, "node_modules/touch": { "version": "3.1.1", - "resolved": "https://registry.npmjs.org/touch/-/touch-3.1.1.tgz", - "integrity": "sha512-r0eojU4bI8MnHr8c5bNo7lJDdI2qXlWWJk6a9EAFG7vbhTjElYhBVS3/miuE0uOuoLdb8Mc/rVfsmm6eo5o9GA==", "license": "ISC", "bin": { "nodetouch": "bin/nodetouch.js" @@ -4033,8 +3452,6 @@ }, "node_modules/tr46": { "version": "4.1.1", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-4.1.1.tgz", - "integrity": "sha512-2lv/66T7e5yNyhAAC4NaKe5nVavzuGJQVVtRYLyQ2OI8tsJ61PMLlelehb0wi2Hx6+hT/OJUWZcw8MjlSRnxvw==", "license": "MIT", "dependencies": { "punycode": "^2.3.0" @@ -4045,14 +3462,10 @@ }, "node_modules/tslib": { "version": "2.7.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.7.0.tgz", - "integrity": "sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA==", "license": "0BSD" }, "node_modules/type-check": { "version": "0.4.0", - "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", - "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", "dev": true, "license": "MIT", "dependencies": { @@ -4077,14 +3490,10 @@ }, "node_modules/undefsafe": { "version": "2.0.5", - "resolved": "https://registry.npmjs.org/undefsafe/-/undefsafe-2.0.5.tgz", - "integrity": "sha512-WxONCrssBM8TSPRqN5EmsjVrsv4A8X12J4ArBiiayv3DyyG3ZlIg6yysuuSYdZsVz3TKcTg2fd//Ujd4CHV1iA==", "license": "MIT" }, "node_modules/undici-types": { "version": "6.19.8", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz", - "integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==", "license": "MIT" }, "node_modules/unpipe": { @@ -4098,8 +3507,6 @@ }, "node_modules/uri-js": { "version": "4.4.1", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", - "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", "dev": true, "license": "BSD-2-Clause", "dependencies": { @@ -4108,8 +3515,6 @@ }, "node_modules/util-deprecate": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", "license": "MIT", "optional": true }, @@ -4124,8 +3529,6 @@ }, "node_modules/uuid": { "version": "10.0.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-10.0.0.tgz", - "integrity": "sha512-8XkAphELsDnEGrDxUOHB3RGvXz6TeuYSGEZBOjtTtPm2lwhGBjLgOzLHB63IUWfBpNucQjND6d3AOudO+H3RWQ==", "funding": [ "https://github.com/sponsors/broofa", "https://github.com/sponsors/ctavan" @@ -4137,8 +3540,6 @@ }, "node_modules/vary": { "version": "1.1.2", - "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", - "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", "license": "MIT", "engines": { "node": ">= 0.8" @@ -4146,8 +3547,6 @@ }, "node_modules/webidl-conversions": { "version": "7.0.0", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz", - "integrity": "sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==", "license": "BSD-2-Clause", "engines": { "node": ">=12" @@ -4155,8 +3554,6 @@ }, "node_modules/websocket-driver": { "version": "0.7.4", - "resolved": "https://registry.npmjs.org/websocket-driver/-/websocket-driver-0.7.4.tgz", - "integrity": "sha512-b17KeDIQVjvb0ssuSDF2cYXSg2iztliJ4B9WdsuB6J952qCPKmnVq4DyW5motImXHDC1cBT/1UezrJVsKw5zjg==", "license": "Apache-2.0", "dependencies": { "http-parser-js": ">=0.5.1", @@ -4169,8 +3566,6 @@ }, "node_modules/websocket-extensions": { "version": "0.1.4", - "resolved": "https://registry.npmjs.org/websocket-extensions/-/websocket-extensions-0.1.4.tgz", - "integrity": "sha512-OqedPIGOfsDlo31UNwYbCFMSaO9m9G/0faIHj5/dZFDMFqPTcx6UwqyOy3COEaEOg/9VsGIpdqn62W5KhoKSpg==", "license": "Apache-2.0", "engines": { "node": ">=0.8.0" @@ -4178,8 +3573,6 @@ }, "node_modules/whatwg-url": { "version": "13.0.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-13.0.0.tgz", - "integrity": "sha512-9WWbymnqj57+XEuqADHrCJ2eSXzn8WXIW/YSGaZtb2WKAInQ6CHfaUUcTyyver0p8BDg5StLQq8h1vtZuwmOig==", "license": "MIT", "dependencies": { "tr46": "^4.1.1", @@ -4191,8 +3584,6 @@ }, "node_modules/which": { "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", "dev": true, "license": "ISC", "dependencies": { @@ -4207,8 +3598,6 @@ }, "node_modules/word-wrap": { "version": "1.2.5", - "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", - "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", "dev": true, "license": "MIT", "engines": { @@ -4217,8 +3606,6 @@ }, "node_modules/wrap-ansi": { "version": "7.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", "license": "MIT", "optional": true, "dependencies": { @@ -4235,15 +3622,11 @@ }, "node_modules/wrappy": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", "license": "ISC", "optional": true }, "node_modules/y18n": { "version": "5.0.8", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", - "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", "license": "ISC", "optional": true, "engines": { @@ -4252,14 +3635,10 @@ }, "node_modules/yallist": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", "license": "ISC" }, "node_modules/yargs": { "version": "17.7.2", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", - "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", "license": "MIT", "optional": true, "dependencies": { @@ -4277,8 +3656,6 @@ }, "node_modules/yargs-parser": { "version": "21.1.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", - "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", "license": "ISC", "optional": true, "engines": { @@ -4287,8 +3664,6 @@ }, "node_modules/yocto-queue": { "version": "0.1.0", - "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", - "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", "devOptional": true, "license": "MIT", "engines": { diff --git a/util/firebase-admin-config.js b/util/firebase-admin-config.js new file mode 100644 index 0000000..7ba9ba8 --- /dev/null +++ b/util/firebase-admin-config.js @@ -0,0 +1,25 @@ +const admin = require('firebase-admin'); +const serviceAccount = require("./login-app.json"); + +admin.initializeApp({ + credential: admin.credential.cert(serviceAccount) +}); + +// admin.initializeApp({ +// credential: admin.credential.cert({ +// type: 'service_account', +// project_id: process.env.FIREBASE_PROJECT_ID, +// private_key_id: process.env.FIREBASE_PRIVATE_KEY_ID, +// private_key: process.env.FIREBASE_PRIVATE_KEY.replace(/\\n/g, '\n'), // Reemplazar los \n con saltos de línea reales +// client_email: process.env.FIREBASE_CLIENT_EMAIL, +// client_id: process.env.FIREBASE_CLIENT_ID, +// auth_uri: process.env.FIREBASE_AUTH_URI, +// token_uri: process.env.FIREBASE_TOKEN_URI, +// auth_provider_x509_cert_url: process.env.FIREBASE_AUTH_PROVIDER_CERT_URL, +// client_x509_cert_url: process.env.FIREBASE_CLIENT_CERT_URL, +// universe_domain: 'googleapis.com' +// }) +// }); + +// Exportar la instancia de admin para usar en otros archivos +module.exports = admin; \ No newline at end of file diff --git a/util/firebase.js b/util/firebase.js deleted file mode 100644 index f7f17e4..0000000 --- a/util/firebase.js +++ /dev/null @@ -1,20 +0,0 @@ -const admin = require('firebase-admin'); - -admin.initializeApp({ - credential: admin.credential.cert({ - type: 'service_account', - project_id: process.env.FIREBASE_PROJECT_ID, - private_key_id: process.env.FIREBASE_PRIVATE_KEY_ID, - private_key: process.env.FIREBASE_PRIVATE_KEY.replace(/\\n/g, '\n'), // Reemplazar los \n con saltos de línea reales - client_email: process.env.FIREBASE_CLIENT_EMAIL, - client_id: process.env.FIREBASE_CLIENT_ID, - auth_uri: process.env.FIREBASE_AUTH_URI, - token_uri: process.env.FIREBASE_TOKEN_URI, - auth_provider_x509_cert_url: process.env.FIREBASE_AUTH_PROVIDER_CERT_URL, - client_x509_cert_url: process.env.FIREBASE_CLIENT_CERT_URL, - universe_domain: 'googleapis.com' - }) -}); - -// Exportar la instancia de admin para usar en otros archivos -module.exports = admin; \ No newline at end of file diff --git a/util/verifyUserToken.js b/util/verifyUserToken.js index ba06ee5..a3b37a7 100644 --- a/util/verifyUserToken.js +++ b/util/verifyUserToken.js @@ -1,4 +1,4 @@ -const admin = require('firebase-admin'); +const admin = require('./firebase-admin-config'); // Middleware para verificar el idToken const verifyUserToken = async (request, response, next) => { From 49cd5f0656336c0f4273647f844af405efdb39cd Mon Sep 17 00:00:00 2001 From: Zathiald Date: Tue, 10 Sep 2024 13:48:31 -0600 Subject: [PATCH 008/231] Agregar funcion para jalar una sola ruta --- .../mapa/controllers/consultarMapa.controller.js | 15 +++++++++++++++ modules/mapa/routes/consultarMapa.routes.js | 2 ++ 2 files changed, 17 insertions(+) diff --git a/modules/mapa/controllers/consultarMapa.controller.js b/modules/mapa/controllers/consultarMapa.controller.js index 4e2ceb4..d3559be 100644 --- a/modules/mapa/controllers/consultarMapa.controller.js +++ b/modules/mapa/controllers/consultarMapa.controller.js @@ -8,3 +8,18 @@ exports.getRutas = async (req, res) => { res.status(500).json({ message: 'Error al obtener las rutas', error }); } }; + +exports.getRuta = async (req, res) => { + try { + const { id } = req.params; // Obtén el ID de los parámetros de la solicitud + const ruta = await Ruta.findById(id); // Busca la ruta por ID + + if (!ruta) { + return res.status(404).json({ message: 'Ruta no encontrada' }); + } + + res.json(ruta); + } catch (error) { + res.status(500).json({ message: 'Error al obtener la ruta', error }); + } +}; diff --git a/modules/mapa/routes/consultarMapa.routes.js b/modules/mapa/routes/consultarMapa.routes.js index bf12e28..c894ac1 100644 --- a/modules/mapa/routes/consultarMapa.routes.js +++ b/modules/mapa/routes/consultarMapa.routes.js @@ -5,4 +5,6 @@ const router = express.Router(); router.get('/', consultarMapaController.getRutas); +router.get('/:id', consultarMapaController.getRuta); + module.exports = router; \ No newline at end of file From f38d07fa085f283c35eee364b6e322f2a5b980aa Mon Sep 17 00:00:00 2001 From: SebastianCo1126 Date: Wed, 11 Sep 2024 17:12:57 -0600 Subject: [PATCH 009/231] feat(actividades): Modelo de actividades creado --- models/actividades/actividad.model.js | 79 +++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) diff --git a/models/actividades/actividad.model.js b/models/actividades/actividad.model.js index e69de29..aa22db4 100644 --- a/models/actividades/actividad.model.js +++ b/models/actividades/actividad.model.js @@ -0,0 +1,79 @@ +const mongoose = require('mongoose'); +const coordenadaSchema = require('../ruta/ruta.model'); + +const actividadSchema = new mongoose.Schema ({ + titulo: { + type: String, + required: true + }, + fechaHora: { + type: Date, + required: true + }, + personasInscritas: { + type: Number, + required: true + }, + ubicacion: { + type: [coordenadaSchema], + required: true + }, + // Incluye materiales requeridos para actividad + descripcion: { + type: String, + required: true + }, + estado: { + type: Boolean, + required: true + }, + duracion: { + type: Number, + required: true + }, +}); + +const rodadaSchema = new mongoose.Schema ({ + informacion: { + type: [actividadSchema], + required: true + }, + ruta: { + type: [rutaSchema], + required: true + }, +}, { + collection: 'Rodadas' +}); + +const tallerSchema = new mongoose.Schema ({ + informacion: { + type: [actividadSchema], + required: true + }, + tipo: { + type: "Taller", + required: true + }, +}, { + collection: 'Talleres' +}); + +const eventoSchema = new mongoose.Schema ({ + informacion: { + type: [actividadSchema], + required: true + }, + tipo: { + type: "Evento", + required: true + }, +}, { + collection: 'Eventos' +}); + +const rodada = mongoose.model('Actividad', rodadaSchema); +const taller = mongoose.model('Taller', tallerSchema); +const evento = mongoose.model('Evento', eventoSchema); + +module.exports = Actividad; \ No newline at end of file From 27fb6789e28c8bf2d63278209c084bd6f10cccf5 Mon Sep 17 00:00:00 2001 From: Gaby Chimali Nava Date: Fri, 13 Sep 2024 12:24:06 -0600 Subject: [PATCH 010/231] refactor(models): Borrar archivos de tipos de actividades --- models/actividades/evento.model.js | 0 models/actividades/rodada.model.js | 0 models/actividades/taller.model.js | 0 3 files changed, 0 insertions(+), 0 deletions(-) delete mode 100644 models/actividades/evento.model.js delete mode 100644 models/actividades/rodada.model.js delete mode 100644 models/actividades/taller.model.js diff --git a/models/actividades/evento.model.js b/models/actividades/evento.model.js deleted file mode 100644 index e69de29..0000000 diff --git a/models/actividades/rodada.model.js b/models/actividades/rodada.model.js deleted file mode 100644 index e69de29..0000000 diff --git a/models/actividades/taller.model.js b/models/actividades/taller.model.js deleted file mode 100644 index e69de29..0000000 From 8e2a8b47d0590a899723747c9926dd23a411653c Mon Sep 17 00:00:00 2001 From: Zathiald Date: Fri, 13 Sep 2024 23:21:52 -0600 Subject: [PATCH 011/231] Refactor: Quitar lugar y coordenada de ruta --- models/ruta/ruta.model.js | 8 -------- 1 file changed, 8 deletions(-) diff --git a/models/ruta/ruta.model.js b/models/ruta/ruta.model.js index 8dc2fb3..8a09af1 100644 --- a/models/ruta/ruta.model.js +++ b/models/ruta/ruta.model.js @@ -32,14 +32,6 @@ const rutaSchema = new mongoose.Schema({ type: Number, required: true, }, - lugar: { - type: String, - required: true - }, - descanso: { - type: String, - required: false - }, coordenadas: { type: [coordenadaSchema], required: true From fd6161571a5c03138e90a237c9140515950d5c28 Mon Sep 17 00:00:00 2001 From: Zathiald Date: Fri, 13 Sep 2024 23:22:30 -0600 Subject: [PATCH 012/231] Refactor: Quitar lugar y descanso de ruta --- models/ruta/ruta.model.js | 8 -------- 1 file changed, 8 deletions(-) diff --git a/models/ruta/ruta.model.js b/models/ruta/ruta.model.js index 8dc2fb3..8a09af1 100644 --- a/models/ruta/ruta.model.js +++ b/models/ruta/ruta.model.js @@ -32,14 +32,6 @@ const rutaSchema = new mongoose.Schema({ type: Number, required: true, }, - lugar: { - type: String, - required: true - }, - descanso: { - type: String, - required: false - }, coordenadas: { type: [coordenadaSchema], required: true From af3a627534a31196ec1255300907e01d143fea61 Mon Sep 17 00:00:00 2001 From: DanielContrerasCh Date: Sat, 14 Sep 2024 00:23:22 -0600 Subject: [PATCH 013/231] Feat: Registrar, consultar y eliminar anuncios --- models/otros/anuncio.model.js | 69 +++++++++++++++++++ .../consultarAnuncio.controller.js | 12 ++++ .../controllers/eliminarAnuncio.controller.js | 12 ++++ .../registrarAnuncio.controller.js | 15 +++- .../anuncios/routes/anunciosIndex.routes.js | 4 ++ .../routes/consultarAnuncio.routes.js | 10 +++ .../anuncios/routes/eliminarAnuncio.routes.js | 10 +++ .../routes/registrarAnuncio.routes.js | 2 +- 8 files changed, 131 insertions(+), 3 deletions(-) create mode 100644 modules/anuncios/controllers/consultarAnuncio.controller.js create mode 100644 modules/anuncios/controllers/eliminarAnuncio.controller.js create mode 100644 modules/anuncios/routes/consultarAnuncio.routes.js create mode 100644 modules/anuncios/routes/eliminarAnuncio.routes.js diff --git a/models/otros/anuncio.model.js b/models/otros/anuncio.model.js index e69de29..a886375 100644 --- a/models/otros/anuncio.model.js +++ b/models/otros/anuncio.model.js @@ -0,0 +1,69 @@ +const mongoose = require("mongoose"); + +const announcementSchema = new mongoose.Schema({ + IDAnuncio: { + type: Number, + unique: true + }, + IDUsuario: { + type: mongoose.SchemaTypes.ObjectId, + ref: 'Usuario', + required: true, + }, + contenido: { + type: String, + required: true + }, + imagen: { + type: String, + }, + createdAt: { + type: Date, + default: Date.now + }, + fechaCaducidad: { + type: Date, + default: function() { + return new Date(Date.now() + 2 * 24 * 60 * 60 * 1000); // 2 días después de la fecha actual + } + } +}); + +const Anuncio = mongoose.model('Anuncio', announcementSchema); + +async function postAnnouncement(IDUsuario, contenido, imagen){ + try { + const announcement = await Anuncio.create({ + IDUsuario: IDUsuario, + contenido: contenido, + imagen: imagen + }); + await announcement.save(); + } catch (error) { + throw error; + } +} + +async function getAnnouncement(IDAnuncio){ + try { + const announcement = await Anuncio.findById(IDAnuncio); + return announcement; + } catch (error) { + throw error; + } +} + +async function deleteAnnouncement(IDAnuncio){ + try { + await Anuncio.findByIdAndDelete(IDAnuncio); + } catch (error) { + throw error; + } +} + +module.exports = { + Anuncio, + postAnnouncement, + getAnnouncement, + deleteAnnouncement +}; \ No newline at end of file diff --git a/modules/anuncios/controllers/consultarAnuncio.controller.js b/modules/anuncios/controllers/consultarAnuncio.controller.js new file mode 100644 index 0000000..68cd5e1 --- /dev/null +++ b/modules/anuncios/controllers/consultarAnuncio.controller.js @@ -0,0 +1,12 @@ + +const Announcement = require('../../../models/otros/anuncio.model'); + +exports.getAnnouncement = async (request, response) => { + const IDAnuncio = request.params.IDAnuncio + try { + const anuncio = await Announcement.getAnnouncement(IDAnuncio); + return response.status(201).json(anuncio); + } catch (error) { + return response.status(404).json({ message: 'Anuncio no encontrado', error: error.message }); + } +}; \ No newline at end of file diff --git a/modules/anuncios/controllers/eliminarAnuncio.controller.js b/modules/anuncios/controllers/eliminarAnuncio.controller.js new file mode 100644 index 0000000..77957d2 --- /dev/null +++ b/modules/anuncios/controllers/eliminarAnuncio.controller.js @@ -0,0 +1,12 @@ + +const Announcement = require('../../../models/otros/anuncio.model'); + +exports.deleteAnnouncement = async (request, response) => { + const IDAnuncio = request.params.IDAnuncio + try { + const anuncio = await Announcement.deleteAnnouncement(IDAnuncio); + return response.status(204).json(anuncio); + } catch (error) { + return response.status(404).json({ message: 'Error al eliminar el anuncio', error: error.message }); + } +}; \ No newline at end of file diff --git a/modules/anuncios/controllers/registrarAnuncio.controller.js b/modules/anuncios/controllers/registrarAnuncio.controller.js index 38cea7d..8e6703e 100644 --- a/modules/anuncios/controllers/registrarAnuncio.controller.js +++ b/modules/anuncios/controllers/registrarAnuncio.controller.js @@ -1,3 +1,14 @@ -exports.getPrueba = (request, response) => { - response.json('Anuncio: Esta es la plantilla que deben usar.'); + +const Announcement = require('../../../models/otros/anuncio.model'); + +exports.postAnnouncement = async (request, response) => { + const idUsuario = request.body.IDUsuario + const contenido = request.body.contenido; + const imagen = request.body.imagen; + try { + await Announcement.postAnnouncement(idUsuario, contenido, imagen); + return response.status(201).json({ message: 'Anuncio creado correctamente' }); + } catch (error) { + return response.status(500).json({ message: 'Error al crear el anuncio', error: error.message }); + } }; \ No newline at end of file diff --git a/modules/anuncios/routes/anunciosIndex.routes.js b/modules/anuncios/routes/anunciosIndex.routes.js index 5bef141..3488bb2 100644 --- a/modules/anuncios/routes/anunciosIndex.routes.js +++ b/modules/anuncios/routes/anunciosIndex.routes.js @@ -2,8 +2,12 @@ const express = require('express'); const router = express.Router(); const registrarAnuncioRoute = require('./registrarAnuncio.routes'); +const consultarAnuncioRoute = require('./consultarAnuncio.routes'); +const eliminarAnuncioRoute = require('./eliminarAnuncio.routes'); // Importar y usar las rutas en el enrutador principal del módulo router.use('/registrar', registrarAnuncioRoute); +router.use('/consultar', consultarAnuncioRoute); +router.use('/eliminar', eliminarAnuncioRoute); module.exports = router; \ No newline at end of file diff --git a/modules/anuncios/routes/consultarAnuncio.routes.js b/modules/anuncios/routes/consultarAnuncio.routes.js new file mode 100644 index 0000000..8498512 --- /dev/null +++ b/modules/anuncios/routes/consultarAnuncio.routes.js @@ -0,0 +1,10 @@ +const express = require('express'); +const router = express.Router(); + +// Importar el controlador que maneja la creación de actividades +const consultarAnuncioController = require('../controllers/consultarAnuncio.controller'); + +// Definir la ruta para crear una actividad +router.get('/:IDAnuncio', consultarAnuncioController.getAnnouncement); + +module.exports = router; \ No newline at end of file diff --git a/modules/anuncios/routes/eliminarAnuncio.routes.js b/modules/anuncios/routes/eliminarAnuncio.routes.js new file mode 100644 index 0000000..7b64bc1 --- /dev/null +++ b/modules/anuncios/routes/eliminarAnuncio.routes.js @@ -0,0 +1,10 @@ +const express = require('express'); +const router = express.Router(); + +// Importar el controlador que maneja la creación de actividades +const eliminarAnuncioController = require('../controllers/eliminarAnuncio.controller'); + +// Definir la ruta para crear una actividad +router.delete('/:IDAnuncio', eliminarAnuncioController.deleteAnnouncement); + +module.exports = router; \ No newline at end of file diff --git a/modules/anuncios/routes/registrarAnuncio.routes.js b/modules/anuncios/routes/registrarAnuncio.routes.js index 266c2b7..bdb5278 100644 --- a/modules/anuncios/routes/registrarAnuncio.routes.js +++ b/modules/anuncios/routes/registrarAnuncio.routes.js @@ -5,6 +5,6 @@ const router = express.Router(); const registrarAnuncioController = require('../controllers/registrarAnuncio.controller'); // Definir la ruta para crear una actividad -router.get('/', registrarAnuncioController.getPrueba); +router.post('/', registrarAnuncioController.postAnnouncement); module.exports = router; \ No newline at end of file From 5d6269c52383b73554c7818c748f431694299fc0 Mon Sep 17 00:00:00 2001 From: Zathiald Date: Sat, 14 Sep 2024 09:01:22 -0600 Subject: [PATCH 014/231] Fix: Asegurar ruta llegue desde android --- models/ruta/ruta.model.js | 2 +- .../controllers/registrarRuta.controller.js | 25 +++-- package-lock.json | 94 +++++++++++-------- 3 files changed, 70 insertions(+), 51 deletions(-) diff --git a/models/ruta/ruta.model.js b/models/ruta/ruta.model.js index 8a09af1..cd03d71 100644 --- a/models/ruta/ruta.model.js +++ b/models/ruta/ruta.model.js @@ -29,7 +29,7 @@ const rutaSchema = new mongoose.Schema({ required: true }, nivel: { - type: Number, + type: String, required: true, }, coordenadas: { diff --git a/modules/mapa/controllers/registrarRuta.controller.js b/modules/mapa/controllers/registrarRuta.controller.js index ce93b20..cbd733e 100644 --- a/modules/mapa/controllers/registrarRuta.controller.js +++ b/modules/mapa/controllers/registrarRuta.controller.js @@ -2,18 +2,25 @@ const Ruta = require('../../../models/ruta/ruta.model'); exports.postRuta = async (req, res) => { try { + console.log('Solicitud recibida en POST /registrarRuta'); + console.log('Datos recibidos:', req.body); // Verifica qué datos llegan al servidor + + // Crear un nuevo objeto Ruta con los datos recibidos const nuevaRuta = new Ruta({ - titulo: req.body.Titulo, - distancia: req.body.Distancia, - tiempo: req.body.Tiempo, - nivel: req.body.Nivel, - lugar: req.body.Lugar, - descanso: req.body.Descanso, - coordenadas: req.body.Coordenadas, + titulo: req.body.titulo, // Asegúrate que los nombres coincidan en Android y backend + distancia: req.body.distancia, + tiempo: req.body.tiempo, + nivel: req.body.nivel, + coordenadas: req.body.coordenadas, // Verifica si las coordenadas se reciben correctamente }); + console.log('Nueva ruta creada:', nuevaRuta); + + // Guardar la ruta en la base de datos const rutaGuardada = await nuevaRuta.save(); - res.status(201).json(rutaGuardada); + console.log('Ruta guardada exitosamente:', rutaGuardada); + + res.status(200).json(rutaGuardada); // Respuesta exitosa } catch (error) { console.error('Error al guardar la ruta:', error); res.status(500).json({ @@ -21,4 +28,4 @@ exports.postRuta = async (req, res) => { error: error.message || error }); } -}; \ No newline at end of file +}; diff --git a/package-lock.json b/package-lock.json index 8f0e5c4..7061949 100644 --- a/package-lock.json +++ b/package-lock.json @@ -395,9 +395,9 @@ } }, "node_modules/body-parser": { - "version": "1.20.2", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.2.tgz", - "integrity": "sha512-ml9pReCu3M61kGlqoTm2umSXTlRTuGTx0bfYj+uIUKKYycG5NtSbeetV3faSU6R7ajOPw0g/J1PvK4qNy7s5bA==", + "version": "1.20.3", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.3.tgz", + "integrity": "sha512-7rAxByjUMqQ3/bHJy7D6OGXvx/MMc4IqBn/X0fcM1QUcAItpZrBEYhWGem+tzXH90c+G01ypMcYJBO9Y30203g==", "license": "MIT", "dependencies": { "bytes": "3.1.2", @@ -408,7 +408,7 @@ "http-errors": "2.0.0", "iconv-lite": "0.4.24", "on-finished": "2.4.1", - "qs": "6.11.0", + "qs": "6.13.0", "raw-body": "2.5.2", "type-is": "~1.6.18", "unpipe": "1.0.0" @@ -721,9 +721,9 @@ "license": "MIT" }, "node_modules/encodeurl": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", - "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz", + "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==", "license": "MIT", "engines": { "node": ">= 0.8" @@ -958,37 +958,37 @@ } }, "node_modules/express": { - "version": "4.19.2", - "resolved": "https://registry.npmjs.org/express/-/express-4.19.2.tgz", - "integrity": "sha512-5T6nhjsT+EOMzuck8JjBHARTHfMht0POzlA60WV2pMD3gyXw2LZnZ+ueGdNxG+0calOJcWKbpFcuzLZ91YWq9Q==", + "version": "4.21.0", + "resolved": "https://registry.npmjs.org/express/-/express-4.21.0.tgz", + "integrity": "sha512-VqcNGcj/Id5ZT1LZ/cfihi3ttTn+NJmkli2eZADigjq29qTlWi/hAQ43t/VLPq8+UX06FCEx3ByOYet6ZFblng==", "license": "MIT", "dependencies": { "accepts": "~1.3.8", "array-flatten": "1.1.1", - "body-parser": "1.20.2", + "body-parser": "1.20.3", "content-disposition": "0.5.4", "content-type": "~1.0.4", "cookie": "0.6.0", "cookie-signature": "1.0.6", "debug": "2.6.9", "depd": "2.0.0", - "encodeurl": "~1.0.2", + "encodeurl": "~2.0.0", "escape-html": "~1.0.3", "etag": "~1.8.1", - "finalhandler": "1.2.0", + "finalhandler": "1.3.1", "fresh": "0.5.2", "http-errors": "2.0.0", - "merge-descriptors": "1.0.1", + "merge-descriptors": "1.0.3", "methods": "~1.1.2", "on-finished": "2.4.1", "parseurl": "~1.3.3", - "path-to-regexp": "0.1.7", + "path-to-regexp": "0.1.10", "proxy-addr": "~2.0.7", - "qs": "6.11.0", + "qs": "6.13.0", "range-parser": "~1.2.1", "safe-buffer": "5.2.1", - "send": "0.18.0", - "serve-static": "1.15.0", + "send": "0.19.0", + "serve-static": "1.16.2", "setprototypeof": "1.2.0", "statuses": "2.0.1", "type-is": "~1.6.18", @@ -1056,13 +1056,13 @@ } }, "node_modules/finalhandler": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.2.0.tgz", - "integrity": "sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.3.1.tgz", + "integrity": "sha512-6BN9trH7bp3qvnrRyzsBz+g3lZxTNZTbVO2EV1CS0WIcDbawYVdYvGflME/9QP0h0pYlCDBCTjYa9nZzMDpyxQ==", "license": "MIT", "dependencies": { "debug": "2.6.9", - "encodeurl": "~1.0.2", + "encodeurl": "~2.0.0", "escape-html": "~1.0.3", "on-finished": "2.4.1", "parseurl": "~1.3.3", @@ -1518,10 +1518,13 @@ "license": "MIT" }, "node_modules/merge-descriptors": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", - "integrity": "sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w==", - "license": "MIT" + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.3.tgz", + "integrity": "sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } }, "node_modules/methods": { "version": "1.1.2", @@ -1934,9 +1937,9 @@ } }, "node_modules/path-to-regexp": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", - "integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==", + "version": "0.1.10", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.10.tgz", + "integrity": "sha512-7lf7qcQidTku0Gu3YDPc8DJ1q7OOucfa/BSsIwjuh56VU7katFvuM8hULfkwB3Fns/rsVF7PwPKVw1sl5KQS9w==", "license": "MIT" }, "node_modules/picomatch": { @@ -1990,12 +1993,12 @@ } }, "node_modules/qs": { - "version": "6.11.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", - "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.13.0.tgz", + "integrity": "sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg==", "license": "BSD-3-Clause", "dependencies": { - "side-channel": "^1.0.4" + "side-channel": "^1.0.6" }, "engines": { "node": ">=0.6" @@ -2145,9 +2148,9 @@ } }, "node_modules/send": { - "version": "0.18.0", - "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz", - "integrity": "sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==", + "version": "0.19.0", + "resolved": "https://registry.npmjs.org/send/-/send-0.19.0.tgz", + "integrity": "sha512-dW41u5VfLXu8SJh5bwRmyYUbAoSB3c9uQh6L8h/KtsFREPWpbX1lrljJo186Jc4nmci/sGUZ9a0a0J2zgfq2hw==", "license": "MIT", "dependencies": { "debug": "2.6.9", @@ -2168,6 +2171,15 @@ "node": ">= 0.8.0" } }, + "node_modules/send/node_modules/encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, "node_modules/send/node_modules/ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", @@ -2175,15 +2187,15 @@ "license": "MIT" }, "node_modules/serve-static": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.15.0.tgz", - "integrity": "sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==", + "version": "1.16.2", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.16.2.tgz", + "integrity": "sha512-VqpjJZKadQB/PEbEwvFdO43Ax5dFBZ2UECszz8bQ7pi7wt//PWe1P6MN7eCnjsatYtBT6EuiClbjSWP2WrIoTw==", "license": "MIT", "dependencies": { - "encodeurl": "~1.0.2", + "encodeurl": "~2.0.0", "escape-html": "~1.0.3", "parseurl": "~1.3.3", - "send": "0.18.0" + "send": "0.19.0" }, "engines": { "node": ">= 0.8.0" From ec28bb01250b8fc9cb8f5888b03c13f0d0377ac8 Mon Sep 17 00:00:00 2001 From: AndreaMedinaRico Date: Sat, 14 Sep 2024 17:50:44 -0600 Subject: [PATCH 015/231] feat(actividades): Registrar actividad --- models/actividades/actividad.model.js | 49 +++---------------- models/actividades/evento.model.js | 15 ++++++ models/actividades/registraActividad.model.js | 22 +++++++++ models/actividades/rodada.model.js | 20 ++++++++ models/actividades/taller.model.js | 15 ++++++ .../registrarActividad.controller.js | 28 ++++++++++- .../routes/registrarActividad.routes.js | 3 +- 7 files changed, 106 insertions(+), 46 deletions(-) create mode 100644 models/actividades/evento.model.js create mode 100644 models/actividades/rodada.model.js create mode 100644 models/actividades/taller.model.js diff --git a/models/actividades/actividad.model.js b/models/actividades/actividad.model.js index aa22db4..81e5c14 100644 --- a/models/actividades/actividad.model.js +++ b/models/actividades/actividad.model.js @@ -30,50 +30,13 @@ const actividadSchema = new mongoose.Schema ({ duracion: { type: Number, required: true - }, -}); - -const rodadaSchema = new mongoose.Schema ({ - informacion: { - type: [actividadSchema], - required: true - }, - ruta: { - type: [rutaSchema], - required: true - }, -}, { - collection: 'Rodadas' -}); - -const tallerSchema = new mongoose.Schema ({ - informacion: { - type: [actividadSchema], - required: true - }, - tipo: { - type: "Taller", - required: true - }, -}, { - collection: 'Talleres' -}); - -const eventoSchema = new mongoose.Schema ({ - informacion: { - type: [actividadSchema], - required: true - }, - tipo: { - type: "Evento", - required: true }, -}, { - collection: 'Eventos' + imagen: { + type: String, + required: false + } }); -const rodada = mongoose.model('Actividad', rodadaSchema); -const taller = mongoose.model('Taller', tallerSchema); -const evento = mongoose.model('Evento', eventoSchema); +const actividad = mongoose.model('Actividad', actividadSchema); -module.exports = Actividad; \ No newline at end of file +module.exports = actividad; \ No newline at end of file diff --git a/models/actividades/evento.model.js b/models/actividades/evento.model.js new file mode 100644 index 0000000..1527dc4 --- /dev/null +++ b/models/actividades/evento.model.js @@ -0,0 +1,15 @@ +const mongoose = require('mongoose'); +const actividadSchema = require('./actividad.model'); + +const eventoSchema = new mongoose.Schema ({ + informacion: { + type: [actividadSchema], + required: true + } +}, { + collection: 'Eventos' +}); + +const evento = mongoose.model('Evento', eventoSchema); + +module.exports = evento; \ No newline at end of file diff --git a/models/actividades/registraActividad.model.js b/models/actividades/registraActividad.model.js index e69de29..b5e44ea 100644 --- a/models/actividades/registraActividad.model.js +++ b/models/actividades/registraActividad.model.js @@ -0,0 +1,22 @@ +const Rodada = require('./rodada.model'); +const Taller = require('./taller.model'); +const Evento = require('./evento.model'); + +async function registrar(titulo, fechaHora, personasInscritas, ubicacion, descripcion, estado, duracion, imagen) { + try { + const nuevaActividad = new Actividad({ + titulo: titulo, + fechaHora: fechaHora, + personasInscritas: personasInscritas, + ubicacion: ubicacion, + descripcion: descripcion, + estado: estado, + duracion: duracion, + imagen: imagen + }); + await nuevaActividad.save(); + + } catch (error) { + console.error('Error al registrar la actividad:', error); + } +} \ No newline at end of file diff --git a/models/actividades/rodada.model.js b/models/actividades/rodada.model.js new file mode 100644 index 0000000..c242372 --- /dev/null +++ b/models/actividades/rodada.model.js @@ -0,0 +1,20 @@ +const mongoose = require('mongoose'); +const rutaSchema = require('../ruta/ruta.model'); +const actividadSchema = require('./actividad.model'); + +const rodadaSchema = new mongoose.Schema ({ + informacion: { + type: [actividadSchema], + required: true + }, + ruta: { + type: [rutaSchema], + required: true + }, +}, { + collection: 'Rodadas' +}); + +const rodada = mongoose.model('Rodada', rodadaSchema); + +module.exports = rodada; \ No newline at end of file diff --git a/models/actividades/taller.model.js b/models/actividades/taller.model.js new file mode 100644 index 0000000..3ee881b --- /dev/null +++ b/models/actividades/taller.model.js @@ -0,0 +1,15 @@ +const mongoose = require('mongoose'); +const actividadSchema = require('./actividad.model'); + +const tallerSchema = new mongoose.Schema ({ + informacion: { + type: [actividadSchema], + required: true + } +}, { + collection: 'Talleres' +}); + +const taller = mongoose.model('Taller', tallerSchema); + +module.exports = taller; \ No newline at end of file diff --git a/modules/actividades/controllers/registrarActividad.controller.js b/modules/actividades/controllers/registrarActividad.controller.js index 17e73aa..9e495f1 100644 --- a/modules/actividades/controllers/registrarActividad.controller.js +++ b/modules/actividades/controllers/registrarActividad.controller.js @@ -1,3 +1,27 @@ -exports.getPrueba = (request, response) => { +const {Rodada, Taller, Evento} = require('../../../models/actividades/registraActividad.model.js'); + +exports.getRegistrarActividad = (request, response) => { response.json('Actividad: Esta es la plantilla que deben usar.'); -}; \ No newline at end of file +}; + +exports.postRegistrarRodada = (request, response) => { + const { + titulo, + fechaHora, + personasInscritas, + ubicacion, + descripcion, + estado, + duracion, + imagen, + ruta + } = request.body; + + try { + Actividad.registrarActividad(titulo, fechaHora, personasInscritas, ubicacion, descripcion, estado, duracion, imagen, ruta); + res.status(201).json(nuevaRodada); + } catch (error) { + res.status(500).json({ message: 'Error al crear la rodada', error }); + } + +} diff --git a/modules/actividades/routes/registrarActividad.routes.js b/modules/actividades/routes/registrarActividad.routes.js index a6a2400..427cc2f 100644 --- a/modules/actividades/routes/registrarActividad.routes.js +++ b/modules/actividades/routes/registrarActividad.routes.js @@ -5,6 +5,7 @@ const router = express.Router(); const registrarActividadController = require('../controllers/registrarActividad.controller'); // Definir la ruta para crear una actividad -router.get('/', registrarActividadController.getPrueba); +router.get('/', registrarActividadController.getRegistrarActividad); +router.post('/', registrarActividadController.postRegistrarActividad); module.exports = router; \ No newline at end of file From 08eab4a1e76eb1b84baf7ba13eb9d888107855bc Mon Sep 17 00:00:00 2001 From: AndreaMedinaRico Date: Sat, 14 Sep 2024 18:39:03 -0600 Subject: [PATCH 016/231] refactor(actividades): registrar por rodada, evento o taller --- models/actividades/registraActividad.model.js | 53 +++++++++++++++++-- .../registrarActividad.controller.js | 44 ++++++++++++++- 2 files changed, 91 insertions(+), 6 deletions(-) diff --git a/models/actividades/registraActividad.model.js b/models/actividades/registraActividad.model.js index b5e44ea..b01d111 100644 --- a/models/actividades/registraActividad.model.js +++ b/models/actividades/registraActividad.model.js @@ -2,9 +2,48 @@ const Rodada = require('./rodada.model'); const Taller = require('./taller.model'); const Evento = require('./evento.model'); -async function registrar(titulo, fechaHora, personasInscritas, ubicacion, descripcion, estado, duracion, imagen) { +async function registrarRodada(titulo, fechaHora, personasInscritas, ubicacion, descripcion, estado, duracion, imagen, ruta) { try { - const nuevaActividad = new Actividad({ + const rodada = await Rodada.create({ + titulo: titulo, + fechaHora: fechaHora, + personasInscritas: personasInscritas, + ubicacion: ubicacion, + descripcion: descripcion, + estado: estado, + duracion: duracion, + imagen: imagen, + ruta: ruta + }); + await rodada.save(); + + } catch (error) { + throw(error); + } +} + +async function registrarTaller(titulo, fechaHora, personasInscritas, ubicacion, descripcion, estado, duracion, imagen) { + try { + const taller = await Taller.create({ + titulo: titulo, + fechaHora: fechaHora, + personasInscritas: personasInscritas, + ubicacion: ubicacion, + descripcion: descripcion, + estado: estado, + duracion: duracion, + imagen: imagen + }); + await taller.save(); + + } catch (error) { + throw(error); + } +} + +async function registrarEvento(titulo, fechaHora, personasInscritas, ubicacion, descripcion, estado, duracion, imagen) { + try { + const evento = await Evento.create({ titulo: titulo, fechaHora: fechaHora, personasInscritas: personasInscritas, @@ -14,9 +53,15 @@ async function registrar(titulo, fechaHora, personasInscritas, ubicacion, descri duracion: duracion, imagen: imagen }); - await nuevaActividad.save(); + await evento.save(); } catch (error) { - console.error('Error al registrar la actividad:', error); + throw(error); } +} + +module.exports = { + registrarRodada, + registrarTaller, + registrarEvento } \ No newline at end of file diff --git a/modules/actividades/controllers/registrarActividad.controller.js b/modules/actividades/controllers/registrarActividad.controller.js index 9e495f1..cd7570d 100644 --- a/modules/actividades/controllers/registrarActividad.controller.js +++ b/modules/actividades/controllers/registrarActividad.controller.js @@ -18,10 +18,50 @@ exports.postRegistrarRodada = (request, response) => { } = request.body; try { - Actividad.registrarActividad(titulo, fechaHora, personasInscritas, ubicacion, descripcion, estado, duracion, imagen, ruta); - res.status(201).json(nuevaRodada); + Rodada.registrarRodada(titulo, fechaHora, personasInscritas, ubicacion, descripcion, estado, duracion, imagen, ruta); + res.status(201).json({ message: 'Rodada creada exitosamente.', error }); } catch (error) { res.status(500).json({ message: 'Error al crear la rodada', error }); } } + +exports.postRegistrarTaller = (request, response) => { + const { + titulo, + fechaHora, + personasInscritas, + ubicacion, + descripcion, + estado, + duracion, + imagen + } = request.body; + + try { + Taller.registrarTaller(titulo, fechaHora, personasInscritas, ubicacion, descripcion, estado, duracion, imagen); + res.status(201).json({ message: 'Taller creado exitosamente.', error }); + } catch (error) { + res.status(500).json({ message: 'Error al crear el taller', error }); + } +} + +exports.postRegistrarEvento = (request, response) => { + const { + titulo, + fechaHora, + personasInscritas, + ubicacion, + descripcion, + estado, + duracion, + imagen + } = request.body; + + try { + Evento.registrarEvento(titulo, fechaHora, personasInscritas, ubicacion, descripcion, estado, duracion, imagen); + res.status(201).json({ message: 'Evento creado exitosamente.', error }); + } catch (error) { + res.status(500).json({ message: 'Error al crear el evento', error }); + } +} \ No newline at end of file From a23f5ba7bcd77c88936113023e6a385145c9ae77 Mon Sep 17 00:00:00 2001 From: SebastianCo1126 Date: Sun, 15 Sep 2024 15:17:27 -0600 Subject: [PATCH 017/231] feat(actividades): HU Modificar Actividad, modelo, controlador y rutas. --- models/actividades/modificaActividad.model.js | 32 +++++++++++++++++++ .../modificarActividad.controller.js | 13 ++++++++ .../routes/actividadesIndex.routes.js | 3 ++ .../routes/modificarActividad.routes.js | 10 ++++++ 4 files changed, 58 insertions(+) create mode 100644 models/actividades/modificaActividad.model.js create mode 100644 modules/actividades/controllers/modificarActividad.controller.js create mode 100644 modules/actividades/routes/modificarActividad.routes.js diff --git a/models/actividades/modificaActividad.model.js b/models/actividades/modificaActividad.model.js new file mode 100644 index 0000000..b48549a --- /dev/null +++ b/models/actividades/modificaActividad.model.js @@ -0,0 +1,32 @@ +const { Rodada, Taller, Evento } = require('../../../models/actividades/registraActividad.model.js'); + +async function encontrarEvento(id) { + + // Encontrar el tipo de evento por colección + let event = await Rodada.findById(id); + if (event) return { model: Rodada, event }; + + event = await Taller.findById(id); + if (event) return { model: Taller, event }; + + event = await Evento.findById(id); + if (event) return { model: Evento, event }; + + + throw new Error('No se encontró ninguna actividad con este ID.'); +} + +async function modificarEvento(id, data) { + try { + // Checa el tipo de modelo (Rodada, Taller, or Evento) + const { model } = await encontrarEvento(id); + + // Actualización del evento + const updatedEvent = await model.findByIdAndUpdate(id, data, { new: true }); + return updatedEvent; + } catch (error) { + throw error; + } +} + +module.exports = { modificarEvento }; diff --git a/modules/actividades/controllers/modificarActividad.controller.js b/modules/actividades/controllers/modificarActividad.controller.js new file mode 100644 index 0000000..fcc1d31 --- /dev/null +++ b/modules/actividades/controllers/modificarActividad.controller.js @@ -0,0 +1,13 @@ +const { modificarEvento } = requestuire('../../../models/actividades/registraActividad.model.js'); + +exports.postModificarActividad = async (req, res) => { + const { id } = req.params; + const data = req.body; + + try { + const updatedActivity = await modificarEvento(id, data); + res.status(201).json({ message: 'Actividad modificada exitosamente.', updatedActivity }); + } catch (error) { + res.status(500).json({ message: 'Error al modificar la actividad', error }); + } +}; diff --git a/modules/actividades/routes/actividadesIndex.routes.js b/modules/actividades/routes/actividadesIndex.routes.js index b4f57f1..c63a366 100644 --- a/modules/actividades/routes/actividadesIndex.routes.js +++ b/modules/actividades/routes/actividadesIndex.routes.js @@ -2,8 +2,11 @@ const express = require('express'); const router = express.Router(); const registrarActividadRoute = require('./registrarActividad.routes'); +const modificarActividadRoute = require('./modificarActividad.routes'); // Importar y usar las rutas en el enrutador principal del módulo router.use('/registrar', registrarActividadRoute); +router.use('/modificar', modificarActividadRouteActividadRoute); + module.exports = router; \ No newline at end of file diff --git a/modules/actividades/routes/modificarActividad.routes.js b/modules/actividades/routes/modificarActividad.routes.js new file mode 100644 index 0000000..56b7e7d --- /dev/null +++ b/modules/actividades/routes/modificarActividad.routes.js @@ -0,0 +1,10 @@ +const express = require('express'); +const router = express.Router(); + +// Importar el controlador que maneja la modificación de actividades +const modificarActividadController = require('../controllers/modificarActividad.controller'); + +// Definir la ruta para modificar una actividad +router.post('/', modificarActividadController.postModificarActividadActividad); + +module.exports = router; \ No newline at end of file From c5d85f1b7a53e5d7100190d6a288f01fa2600f4d Mon Sep 17 00:00:00 2001 From: Tony <111481792+Bowist27@users.noreply.github.com> Date: Sun, 15 Sep 2024 17:38:30 -0600 Subject: [PATCH 018/231] fix: Usar Conexion EC2 --- app.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app.js b/app.js index 6de318a..908b68c 100644 --- a/app.js +++ b/app.js @@ -23,9 +23,10 @@ const compression = require('compression'); app.use(compression()); // Conectar a la base de datos local de MongoDB -mongoose.connect('mongodb://localhost:27017/Saca_la_Bici') +mongoose.connect('mongodb://lec2-3-144-225-207.us-east-2.compute.amazonaws.com:27017/Saca_la_Bici') + .then(() => { - console.log('Conectado a la base de datos local de MongoDB'); + console.log('Conectado a la base de datos de MongoDB en AWS EC2'); }).catch((error) => { console.error('Error al conectar con la base de datos:', error); }); From 90a574c09a3692af5616c4fe8029838ee4a21d2c Mon Sep 17 00:00:00 2001 From: Tony <111481792+Bowist27@users.noreply.github.com> Date: Sun, 15 Sep 2024 19:35:12 -0600 Subject: [PATCH 019/231] fix: Firebase SDK Admin --- app.js | 3 +- package-lock.json | 149 ++++++++++++++++++---------------------------- package.json | 2 +- 3 files changed, 60 insertions(+), 94 deletions(-) diff --git a/app.js b/app.js index 908b68c..7081dc3 100644 --- a/app.js +++ b/app.js @@ -23,7 +23,8 @@ const compression = require('compression'); app.use(compression()); // Conectar a la base de datos local de MongoDB -mongoose.connect('mongodb://lec2-3-144-225-207.us-east-2.compute.amazonaws.com:27017/Saca_la_Bici') +mongoose.connect('mongodb://ec2-3-144-225-207.us-east-2.compute.amazonaws.com:27017') + .then(() => { console.log('Conectado a la base de datos de MongoDB en AWS EC2'); diff --git a/package-lock.json b/package-lock.json index bce72a0..f560121 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,7 +11,7 @@ "dependencies": { "compression": "^1.7.4", "dotenv": "^16.4.5", - "express": "^4.19.2", + "express": "^4.21.0", "firebase-admin": "^12.4.0", "mongoose": "^8.6.0", "nodemon": "^3.1.4" @@ -790,10 +790,9 @@ } }, "node_modules/body-parser": { - "version": "1.20.2", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.2.tgz", - "integrity": "sha512-ml9pReCu3M61kGlqoTm2umSXTlRTuGTx0bfYj+uIUKKYycG5NtSbeetV3faSU6R7ajOPw0g/J1PvK4qNy7s5bA==", - "license": "MIT", + "version": "1.20.3", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.3.tgz", + "integrity": "sha512-7rAxByjUMqQ3/bHJy7D6OGXvx/MMc4IqBn/X0fcM1QUcAItpZrBEYhWGem+tzXH90c+G01ypMcYJBO9Y30203g==", "dependencies": { "bytes": "3.1.2", "content-type": "~1.0.5", @@ -803,7 +802,7 @@ "http-errors": "2.0.0", "iconv-lite": "0.4.24", "on-finished": "2.4.1", - "qs": "6.11.0", + "qs": "6.13.0", "raw-body": "2.5.2", "type-is": "~1.6.18", "unpipe": "1.0.0" @@ -846,7 +845,6 @@ "version": "3.1.2", "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", - "license": "MIT", "engines": { "node": ">= 0.8" } @@ -855,7 +853,6 @@ "version": "1.0.7", "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", - "license": "MIT", "dependencies": { "es-define-property": "^1.0.0", "es-errors": "^1.3.0", @@ -1022,7 +1019,6 @@ "version": "1.0.5", "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", - "license": "MIT", "engines": { "node": ">= 0.6" } @@ -1071,7 +1067,6 @@ "version": "1.1.4", "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", - "license": "MIT", "dependencies": { "es-define-property": "^1.0.0", "es-errors": "^1.3.0", @@ -1096,7 +1091,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", - "license": "MIT", "engines": { "node": ">= 0.8" } @@ -1105,7 +1099,6 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==", - "license": "MIT", "engines": { "node": ">= 0.8", "npm": "1.2.8000 || >= 1.4.16" @@ -1142,8 +1135,7 @@ "node_modules/ee-first": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", - "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==", - "license": "MIT" + "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==" }, "node_modules/emoji-regex": { "version": "8.0.0", @@ -1151,10 +1143,9 @@ "optional": true }, "node_modules/encodeurl": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", - "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", - "license": "MIT", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz", + "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==", "engines": { "node": ">= 0.8" } @@ -1171,7 +1162,6 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", - "license": "MIT", "dependencies": { "get-intrinsic": "^1.2.4" }, @@ -1183,7 +1173,6 @@ "version": "1.3.0", "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", - "license": "MIT", "engines": { "node": ">= 0.4" } @@ -1199,8 +1188,7 @@ "node_modules/escape-html": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", - "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==", - "license": "MIT" + "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==" }, "node_modules/escape-string-regexp": { "version": "4.0.0", @@ -1376,7 +1364,6 @@ "version": "1.8.1", "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", - "license": "MIT", "engines": { "node": ">= 0.6" } @@ -1390,37 +1377,36 @@ } }, "node_modules/express": { - "version": "4.19.2", - "resolved": "https://registry.npmjs.org/express/-/express-4.19.2.tgz", - "integrity": "sha512-5T6nhjsT+EOMzuck8JjBHARTHfMht0POzlA60WV2pMD3gyXw2LZnZ+ueGdNxG+0calOJcWKbpFcuzLZ91YWq9Q==", - "license": "MIT", + "version": "4.21.0", + "resolved": "https://registry.npmjs.org/express/-/express-4.21.0.tgz", + "integrity": "sha512-VqcNGcj/Id5ZT1LZ/cfihi3ttTn+NJmkli2eZADigjq29qTlWi/hAQ43t/VLPq8+UX06FCEx3ByOYet6ZFblng==", "dependencies": { "accepts": "~1.3.8", "array-flatten": "1.1.1", - "body-parser": "1.20.2", + "body-parser": "1.20.3", "content-disposition": "0.5.4", "content-type": "~1.0.4", "cookie": "0.6.0", "cookie-signature": "1.0.6", "debug": "2.6.9", "depd": "2.0.0", - "encodeurl": "~1.0.2", + "encodeurl": "~2.0.0", "escape-html": "~1.0.3", "etag": "~1.8.1", - "finalhandler": "1.2.0", + "finalhandler": "1.3.1", "fresh": "0.5.2", "http-errors": "2.0.0", - "merge-descriptors": "1.0.1", + "merge-descriptors": "1.0.3", "methods": "~1.1.2", "on-finished": "2.4.1", "parseurl": "~1.3.3", - "path-to-regexp": "0.1.7", + "path-to-regexp": "0.1.10", "proxy-addr": "~2.0.7", - "qs": "6.11.0", + "qs": "6.13.0", "range-parser": "~1.2.1", "safe-buffer": "5.2.1", - "send": "0.18.0", - "serve-static": "1.15.0", + "send": "0.19.0", + "serve-static": "1.16.2", "setprototypeof": "1.2.0", "statuses": "2.0.1", "type-is": "~1.6.18", @@ -1519,13 +1505,12 @@ } }, "node_modules/finalhandler": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.2.0.tgz", - "integrity": "sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==", - "license": "MIT", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.3.1.tgz", + "integrity": "sha512-6BN9trH7bp3qvnrRyzsBz+g3lZxTNZTbVO2EV1CS0WIcDbawYVdYvGflME/9QP0h0pYlCDBCTjYa9nZzMDpyxQ==", "dependencies": { "debug": "2.6.9", - "encodeurl": "~1.0.2", + "encodeurl": "~2.0.0", "escape-html": "~1.0.3", "on-finished": "2.4.1", "parseurl": "~1.3.3", @@ -1616,7 +1601,6 @@ "version": "0.5.2", "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==", - "license": "MIT", "engines": { "node": ">= 0.6" } @@ -1636,7 +1620,6 @@ "version": "1.1.2", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", - "license": "MIT", "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -1761,7 +1744,6 @@ "version": "1.2.4", "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", - "license": "MIT", "dependencies": { "es-errors": "^1.3.0", "function-bind": "^1.1.2", @@ -1876,7 +1858,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", - "license": "MIT", "dependencies": { "get-intrinsic": "^1.1.3" }, @@ -1908,7 +1889,6 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", - "license": "MIT", "dependencies": { "es-define-property": "^1.0.0" }, @@ -1920,7 +1900,6 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz", "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==", - "license": "MIT", "engines": { "node": ">= 0.4" }, @@ -1932,7 +1911,6 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", - "license": "MIT", "engines": { "node": ">= 0.4" }, @@ -1944,7 +1922,6 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", - "license": "MIT", "dependencies": { "function-bind": "^1.1.2" }, @@ -1971,7 +1948,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", - "license": "MIT", "dependencies": { "depd": "2.0.0", "inherits": "2.0.4", @@ -2069,7 +2045,6 @@ "version": "0.4.24", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", - "license": "MIT", "dependencies": { "safer-buffer": ">= 2.1.2 < 3" }, @@ -2439,7 +2414,6 @@ "version": "0.3.0", "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==", - "license": "MIT", "engines": { "node": ">= 0.6" } @@ -2449,10 +2423,12 @@ "license": "MIT" }, "node_modules/merge-descriptors": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", - "integrity": "sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w==", - "license": "MIT" + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.3.tgz", + "integrity": "sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ==", + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } }, "node_modules/methods": { "version": "1.1.2", @@ -2467,7 +2443,6 @@ "version": "1.6.0", "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", - "license": "MIT", "bin": { "mime": "cli.js" }, @@ -2756,7 +2731,6 @@ "version": "1.13.2", "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.2.tgz", "integrity": "sha512-IRZSRuzJiynemAXPYtPe5BoI/RESNYR7TYm50MC5Mqbd3Jmw5y790sErYw3V6SryFJD64b74qQQs9wn5Bg/k3g==", - "license": "MIT", "engines": { "node": ">= 0.4" }, @@ -2768,7 +2742,6 @@ "version": "2.4.1", "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", - "license": "MIT", "dependencies": { "ee-first": "1.1.1" }, @@ -2850,7 +2823,6 @@ "version": "1.3.3", "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", - "license": "MIT", "engines": { "node": ">= 0.8" } @@ -2872,10 +2844,9 @@ } }, "node_modules/path-to-regexp": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", - "integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==", - "license": "MIT" + "version": "0.1.10", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.10.tgz", + "integrity": "sha512-7lf7qcQidTku0Gu3YDPc8DJ1q7OOucfa/BSsIwjuh56VU7katFvuM8hULfkwB3Fns/rsVF7PwPKVw1sl5KQS9w==" }, "node_modules/picomatch": { "version": "2.3.1", @@ -2954,12 +2925,11 @@ } }, "node_modules/qs": { - "version": "6.11.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", - "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", - "license": "BSD-3-Clause", + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.13.0.tgz", + "integrity": "sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg==", "dependencies": { - "side-channel": "^1.0.4" + "side-channel": "^1.0.6" }, "engines": { "node": ">=0.6" @@ -2991,7 +2961,6 @@ "version": "1.2.1", "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", - "license": "MIT", "engines": { "node": ">= 0.6" } @@ -3000,7 +2969,6 @@ "version": "2.5.2", "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.2.tgz", "integrity": "sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==", - "license": "MIT", "dependencies": { "bytes": "3.1.2", "http-errors": "2.0.0", @@ -3123,8 +3091,7 @@ "node_modules/safer-buffer": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", - "license": "MIT" + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" }, "node_modules/semver": { "version": "7.6.3", @@ -3137,10 +3104,9 @@ } }, "node_modules/send": { - "version": "0.18.0", - "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz", - "integrity": "sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==", - "license": "MIT", + "version": "0.19.0", + "resolved": "https://registry.npmjs.org/send/-/send-0.19.0.tgz", + "integrity": "sha512-dW41u5VfLXu8SJh5bwRmyYUbAoSB3c9uQh6L8h/KtsFREPWpbX1lrljJo186Jc4nmci/sGUZ9a0a0J2zgfq2hw==", "dependencies": { "debug": "2.6.9", "depd": "2.0.0", @@ -3160,22 +3126,28 @@ "node": ">= 0.8.0" } }, + "node_modules/send/node_modules/encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", + "engines": { + "node": ">= 0.8" + } + }, "node_modules/send/node_modules/ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "license": "MIT" + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" }, "node_modules/serve-static": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.15.0.tgz", - "integrity": "sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==", - "license": "MIT", + "version": "1.16.2", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.16.2.tgz", + "integrity": "sha512-VqpjJZKadQB/PEbEwvFdO43Ax5dFBZ2UECszz8bQ7pi7wt//PWe1P6MN7eCnjsatYtBT6EuiClbjSWP2WrIoTw==", "dependencies": { - "encodeurl": "~1.0.2", + "encodeurl": "~2.0.0", "escape-html": "~1.0.3", "parseurl": "~1.3.3", - "send": "0.18.0" + "send": "0.19.0" }, "engines": { "node": ">= 0.8.0" @@ -3185,7 +3157,6 @@ "version": "1.2.2", "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", - "license": "MIT", "dependencies": { "define-data-property": "^1.1.4", "es-errors": "^1.3.0", @@ -3201,8 +3172,7 @@ "node_modules/setprototypeof": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", - "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==", - "license": "ISC" + "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==" }, "node_modules/shebang-command": { "version": "2.0.0", @@ -3227,7 +3197,6 @@ "version": "1.0.6", "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.6.tgz", "integrity": "sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==", - "license": "MIT", "dependencies": { "call-bind": "^1.0.7", "es-errors": "^1.3.0", @@ -3266,7 +3235,6 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", - "license": "MIT", "engines": { "node": ">= 0.8" } @@ -3438,7 +3406,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", - "license": "MIT", "engines": { "node": ">=0.6" } @@ -3479,7 +3446,6 @@ "version": "1.6.18", "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", - "license": "MIT", "dependencies": { "media-typer": "0.3.0", "mime-types": "~2.1.24" @@ -3500,7 +3466,6 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", - "license": "MIT", "engines": { "node": ">= 0.8" } diff --git a/package.json b/package.json index fc4461e..4c4ea31 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ "dependencies": { "compression": "^1.7.4", "dotenv": "^16.4.5", - "express": "^4.19.2", + "express": "^4.21.0", "firebase-admin": "^12.4.0", "mongoose": "^8.6.0", "nodemon": "^3.1.4" From 6d14f08d22c29946d9ceb8a0ae9e974b5f53e244 Mon Sep 17 00:00:00 2001 From: PAOLA MARIA garrido Date: Mon, 16 Sep 2024 09:52:41 -0600 Subject: [PATCH 020/231] feat: Se agrego archivo de modelo FAQ. --- models/otros/preguntasFrecuentes.model.js | 31 +++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/models/otros/preguntasFrecuentes.model.js b/models/otros/preguntasFrecuentes.model.js index e69de29..e536854 100644 --- a/models/otros/preguntasFrecuentes.model.js +++ b/models/otros/preguntasFrecuentes.model.js @@ -0,0 +1,31 @@ +const mongoose = require('mongoose'); + +const preguntasFrecuentesSchema = new mongoose.Schema({ + IDPregunta: { + type: String, + required: true, + unique: true + }, + Pregunta: { + type: String, + required: true + }, + Respuesta: { + type: String, + required: true + }, + Tema: { + type: String, + required: true + }, + Imagen: { + type: String, + required: false + } +}, { + collection: 'PreguntasFrecuentes' +}); + +const PreguntaFrecuente = mongoose.model('PreguntaFrecuente', preguntasFrecuentesSchema); + +module.exports = PreguntaFrecuente; From c159e30a32c141c911a915b83295b16cfc18f25d Mon Sep 17 00:00:00 2001 From: Angeltrek Date: Mon, 16 Sep 2024 11:10:04 -0600 Subject: [PATCH 021/231] fix: registrarContiene ahora muestra los privilegios no asociados --- app.js | 96 ++-- models/perfil/usuario.model.js | 52 +-- .../registrarContiene.controller.js | 433 ++++++++---------- util/firebase-admin-config.js | 32 +- util/inicializarBD.js | 299 ++++++++++++ util/inicializarPrivilegios.js | 299 ++++++++++++ 6 files changed, 870 insertions(+), 341 deletions(-) create mode 100644 util/inicializarBD.js create mode 100644 util/inicializarPrivilegios.js diff --git a/app.js b/app.js index 6de318a..c51ea3c 100644 --- a/app.js +++ b/app.js @@ -1,62 +1,66 @@ // Para usar express en vez de http -const express = require('express'); -const mongoose = require('mongoose'); +const express = require("express"); +const mongoose = require("mongoose"); // Inicia la app usuando a express const app = express(); const port = 7070; // Manipular facil los datos de las peticiones -const bodyParser = require('body-parser'); +const bodyParser = require("body-parser"); // Configura bodyparser -app.use(bodyParser.urlencoded({ - extended: false -})); +app.use( + bodyParser.urlencoded({ + extended: false, + }) +); app.use(bodyParser.json()); // USAR JWT (JSON Web Tokens) para autenticar las solicitudes -const compression = require('compression'); +const compression = require("compression"); app.use(compression()); // Conectar a la base de datos local de MongoDB -mongoose.connect('mongodb://localhost:27017/Saca_la_Bici') -.then(() => { - console.log('Conectado a la base de datos local de MongoDB'); -}).catch((error) => { - console.error('Error al conectar con la base de datos:', error); -}); +mongoose + .connect("mongodb://ec2-3-144-225-207.us-east-2.compute.amazonaws.com:27017/") + .then(() => { + console.log("Conectado a la base de datos local de MongoDB"); + }) + .catch((error) => { + console.error("Error al conectar con la base de datos:", error); + }); // Importar el archivo index de cada módulo -const actividadesRoutes = require('./modules/actividades/routes/actividadesIndex.routes'); -const anunciosRoutes = require('./modules/anuncios/routes/anunciosIndex.routes'); -const ayudaRoutes = require('./modules/ayuda/routes/ayudaIndex.routes'); -const estadisticasRoutes = require('./modules/estadisticas/routes/estadisticasIndex.routes'); -const foroRoutes = require('./modules/foro/routes/foroIndex.routes'); -const mapaRoutes = require('./modules/mapa/routes/mapaIndex.routes'); -const perfilRoutes = require('./modules/perfil/routes/perfilIndex.routes'); -const preguntasRoutes = require('./modules/preguntasFrecuentes/routes/preguntasIndex.routes'); -const rentaRoutes = require('./modules/renta/routes/rentaIndex.routes'); -const reporteRoutes = require('./modules/reporte/routes/reporteIndex.routes'); -const rodadasRoutes = require('./modules/rodadas/routes/rodadasIndex.routes'); -const sessionRoutes = require('./modules/session/routes/sessionIndex.routes'); +const actividadesRoutes = require("./modules/actividades/routes/actividadesIndex.routes"); +const anunciosRoutes = require("./modules/anuncios/routes/anunciosIndex.routes"); +const ayudaRoutes = require("./modules/ayuda/routes/ayudaIndex.routes"); +const estadisticasRoutes = require("./modules/estadisticas/routes/estadisticasIndex.routes"); +const foroRoutes = require("./modules/foro/routes/foroIndex.routes"); +const mapaRoutes = require("./modules/mapa/routes/mapaIndex.routes"); +const perfilRoutes = require("./modules/perfil/routes/perfilIndex.routes"); +const preguntasRoutes = require("./modules/preguntasFrecuentes/routes/preguntasIndex.routes"); +const rentaRoutes = require("./modules/renta/routes/rentaIndex.routes"); +const reporteRoutes = require("./modules/reporte/routes/reporteIndex.routes"); +const rodadasRoutes = require("./modules/rodadas/routes/rodadasIndex.routes"); +const sessionRoutes = require("./modules/session/routes/sessionIndex.routes"); // Usar las rutas de los módulos -app.use('/actividades', actividadesRoutes); -app.use('/anuncios', anunciosRoutes); -app.use('/ayuda', ayudaRoutes); -app.use('/estadisticas', estadisticasRoutes); -app.use('/foro', foroRoutes); -app.use('/mapa', mapaRoutes); -app.use('/perfil', perfilRoutes); -app.use('/preguntasFrecuentes', preguntasRoutes); -app.use('/renta', rentaRoutes); -app.use('/reporte', reporteRoutes); -app.use('/rodadas', rodadasRoutes); -app.use('/session', sessionRoutes); +app.use("/actividades", actividadesRoutes); +app.use("/anuncios", anunciosRoutes); +app.use("/ayuda", ayudaRoutes); +app.use("/estadisticas", estadisticasRoutes); +app.use("/foro", foroRoutes); +app.use("/mapa", mapaRoutes); +app.use("/perfil", perfilRoutes); +app.use("/preguntasFrecuentes", preguntasRoutes); +app.use("/renta", rentaRoutes); +app.use("/reporte", reporteRoutes); +app.use("/rodadas", rodadasRoutes); +app.use("/session", sessionRoutes); // Middleware para verificar si la sesión está activa // function checkSession(req, res, next) { @@ -68,20 +72,20 @@ app.use('/session', sessionRoutes); // next(); // } -const verifyToken = require('./util/verifyUserToken'); +const verifyToken = require("./util/verifyUserToken"); -app.get('/', verifyToken, (request, response) => { - response.status(200).json({ - message: '¡Bienvenido a Saca la Bici!' - }); - console.log(request.userUID) +app.get("/", verifyToken, (request, response) => { + response.status(200).json({ + message: "¡Bienvenido a Saca la Bici!", + }); + console.log(request.userUID); }); // Para error 404 app.use((request, response) => { - response.status(404).json({ - message: 'No se encuentra el endpoint o ruta que estas buscando' - }); + response.status(404).json({ + message: "No se encuentra el endpoint o ruta que estas buscando", + }); }); // Para que el servidor este activo diff --git a/models/perfil/usuario.model.js b/models/perfil/usuario.model.js index 0ecb9cd..74b3b9a 100644 --- a/models/perfil/usuario.model.js +++ b/models/perfil/usuario.model.js @@ -1,44 +1,42 @@ -const mongoose = require('mongoose'); +const mongoose = require("mongoose"); -const usuarioSchema = new mongoose.Schema({ +const usuarioSchema = new mongoose.Schema( + { username: { - type: String, - required: true, + type: String, }, nombre: { - type: String, - required: true, + type: String, }, edad: { - type: Number, - required: true, + type: Number, }, tipoSangre: { - type: String, - required: true, + type: String, }, correoElectronico: { - type: String, - required: true, - unique: true, + type: String, + required: true, + unique: true, }, numeroEmergencia: { - type: String, - required: true, + type: String, }, fechaRegistro: { - type: Date, - immutable: true, - default: Date.now - }, + type: Date, + immutable: true, + default: Date.now, + }, firebaseUID: { - type: String, - unique: true, - } -}, { - collection: 'Usuario' -}); + type: String, + unique: true, + }, + }, + { + collection: "Usuario", + } +); -const Usuario = mongoose.model('Usuario', usuarioSchema); +const Usuario = mongoose.model("Usuario", usuarioSchema); -module.exports = Usuario; \ No newline at end of file +module.exports = Usuario; diff --git a/modules/session/controllers/registrarContiene.controller.js b/modules/session/controllers/registrarContiene.controller.js index 14ead16..6a2b632 100644 --- a/modules/session/controllers/registrarContiene.controller.js +++ b/modules/session/controllers/registrarContiene.controller.js @@ -1,264 +1,193 @@ -const Rol = require('../../../models/perfil/rol.model'); -const Privilegio = require('../../../models/perfil/privilegio.model'); -const ContienePrivilegio = require('../../../models/perfil/contienePrivilegio.model'); +const Rol = require("../../../models/perfil/rol.model"); +const Privilegio = require("../../../models/perfil/privilegio.model"); +const ContienePrivilegio = require("../../../models/perfil/contienePrivilegio.model"); exports.registrarContiene = async (request, response) => { - // Primero se verifica que la colleción este vacía - try { - // Hacer una consulta para verificar si existe cualquier registro - const relacion = await ContienePrivilegio.findOne(); // Esto busca el primer registro que encuentre - - if (relacion) { - return response.status(400).json({ - error: `La tabla de Contiene ya tiene permisos asociados a ciertos Roles. Si quieres resetear la colección favor de borrarla primero.` - }); - } - } catch (error) { - return response.status(400).json({ - error: error.message - }); + // Primero se verifica que la colección esté vacía + try { + const relacion = await ContienePrivilegio.findOne(); // Busca el primer registro que encuentre + + if (relacion) { + return response.status(400).json({ + error: `La tabla de Contiene ya tiene permisos asociados a ciertos Roles. Si quieres resetear la colección favor de borrarla primero.`, + }); } + } catch (error) { + return response.status(400).json({ + error: error.message, + }); + } - // Se insertan los privilegios de Staff - try { - const rolStaff = await Rol.findOne({ - nombre: 'Staff' - }); - if (!rolStaff) { - return response.status(404).json({ - message: 'Rol Staff no encontrado' - }); - } - - // Busca los privilegios que quieres asociar con el rol "Staff" - const privilegiosStaff = [ - 'Consultar anuncio', - 'Registrar cuenta', - 'Consultar perfil propio', - 'Modificar perfil', - 'Eliminar cuenta', - 'Consultar actividades', - 'Registrar reporte', - 'Consultar foro', - 'Publicar comentario', - 'Modificar comentario', - 'Consultar sección de ayuda', - 'Iniciar rodada', - 'Desactivar rodada', - 'Registrar ruta', - 'Modificar ruta', - 'Eliminar ruta', - 'Consultar solicitudes de amistad', - 'Enviar solicitud de amistad', - 'Aceptar solicitud de amistad', - 'Rechazar solicitud de amistad', - 'Eliminar amigo', - 'Registrar pregunta frecuente', - 'Modificar pregunta frecuente', - 'Eliminar pregunta frecuente', - 'Consultar mapa', - 'Consultar notificaciones', - 'Consultar actividad individual', - 'Resolver solicitud de apoyo', - 'Cancelar solicitud de apoyo', - 'Buscar Usuarios', - 'Cancelar solicitud de amistad', - 'Bloquear usuario', - 'Consultar lista de amigos', - 'Desbloquear usuario', - 'Verificar asistencia' - ];; - - // Buscar los privilegios en la colección - const privilegios = await Privilegio.find({ - nombre: { - $in: privilegiosStaff - } - }); - - if (privilegios.length !== privilegiosStaff.length) { - return response.status(404).json({ - message: 'No se encontraron todos los privilegios especificados para Staff', - foundPrivilegios: privilegios.map(p => p.nombre) - }); - } - - // Poblar la colección Contiene - const contieneStaff = privilegios.map(privilegio => ({ - IDRol: rolStaff._id, - IDPrivilegio: privilegio._id - })); - - await ContienePrivilegio.insertMany(contieneStaff); - - } catch (error) { - return response.status(400).json({ - error: error.message - }); - } - - // Se insertan los privilegios de Administrador - try { - const rolAdmin = await Rol.findOne({ - nombre: 'Administrador' - }); - if (!rolAdmin) { - return response.status(404).json({ - message: 'Rol Staff no encontrado' - }); - } - - // Busca los privilegios que quieres asociar con el rol "Admin" - const privilegiosAdmin = [ - 'Registrar anuncio', - 'Modificar anuncio', - 'Eliminar anuncio', - 'Consultar anuncio', - 'Registrar actividad', - 'Modificar actividad', - 'Eliminar actividad', - 'Consultar estadísticas', - 'Modificar rol', - 'Desactivar usuario', - 'Eliminar comentario', - 'Registrar cuenta', - 'Consultar perfil propio', - 'Modificar perfil', - 'Eliminar cuenta', - 'Consultar actividades', - 'Registrar reporte', - 'Consultar foro', - 'Publicar comentario', - 'Modificar comentario', - 'Consultar sección de ayuda', - 'Iniciar rodada', - 'Desactivar rodada', - 'Registrar ruta', - 'Modificar ruta', - 'Eliminar ruta', - 'Consultar solicitudes de amistad', - 'Enviar solicitud de amistad', - 'Aceptar solicitud de amistad', - 'Rechazar solicitud de amistad', - 'Eliminar amigo', - 'Registrar pregunta frecuente', - 'Modificar pregunta frecuente', - 'Eliminar pregunta frecuente', - 'Consultar mapa', - 'Consultar notificaciones', - 'Consultar actividad individual', - 'Resolver solicitud de apoyo', - 'Cancelar solicitud de apoyo', - 'Buscar Usuarios', - 'Cancelar solicitud de amistad', - 'Bloquear usuario', - 'Consultar lista de amigos', - 'Desbloquear usuario', - 'Verificar asistencia', - 'Consultar Usuarios' - ];; - - // Buscar los privilegios en la colección - const privilegios = await Privilegio.find({ - nombre: { - $in: privilegiosAdmin - } - }); - - if (privilegios.length !== privilegiosAdmin.length) { - return response.status(404).json({ - message: 'No se encontraron todos los privilegios especificados para Admin', - foundPrivilegios: privilegios.map(p => p.nombre) - }); - } - - // Poblar la colección Contiene - const contieneAdmin = privilegios.map(privilegio => ({ - IDRol: rolAdmin._id, - IDPrivilegio: privilegio._id - })); - - await ContienePrivilegio.insertMany(contieneAdmin); - - } catch (error) { - return response.status(400).json({ - error: error.message - }); - } + // Helper para encontrar privilegios que no se encontraron + const findMissingPrivileges = (allPrivilegios, foundPrivilegios) => { + const foundNames = new Set(foundPrivilegios.map((p) => p.nombre)); + return allPrivilegios.filter((name) => !foundNames.has(name)); + }; + const processRole = async (roleName, privilegiosLista) => { try { - const rolUsuario = await Rol.findOne({ - nombre: 'Usuario' + const rol = await Rol.findOne({ nombre: roleName }); + if (!rol) { + return response.status(404).json({ + message: `Rol ${roleName} no encontrado`, }); - if (!rolUsuario) { - return response.status(404).json({ - message: 'Rol Staff no encontrado' - }); - } - - // Busca los privilegios que quieres asociar con el rol "Usuario" - const privilegiosUsuario = [ - 'Consultar anuncio', - 'Registrar cuenta', - 'Consultar perfil propio', - 'Modificar perfil', - 'Eliminar cuenta', - 'Consultar actividades', - 'Registrar reporte', - 'Consultar foro', - 'Publicar comentario', - 'Modificar comentario', - 'Consultar sección de ayuda', - 'Inscribir actividad', - 'Cancelar asistencia', - 'Consultar renta de bicicletas', - 'Solicitar apoyo', - 'Consultar solicitudes de amistad', - 'Enviar solicitud de amistad', - 'Aceptar solicitud de amistad', - 'Rechazar solicitud de amistad', - 'Eliminar amigo', - 'Consultar medallas/reconocimientos', - 'Consultar mapa', - 'Consultar notificaciones', - 'Consultar actividad individual', - 'Cancelar solicitud de apoyo', - 'Buscar Usuarios', - 'Cancelar solicitud de amistad', - 'Bloquear usuario', - 'Consultar lista de amigos', - 'Desbloquear usuario' - ]; - - // Buscar los privilegios en la colección - const privilegios = await Privilegio.find({ - nombre: { - $in: privilegiosUsuario - } + } + + // Buscar los privilegios en la colección + const privilegios = await Privilegio.find({ + nombre: { $in: privilegiosLista }, + }); + + // Identificar privilegios no encontrados + const missingPrivilegios = findMissingPrivileges( + privilegiosLista, + privilegios + ); + + if (missingPrivilegios.length > 0) { + return response.status(404).json({ + message: `No se encontraron todos los privilegios especificados para ${roleName}`, + foundPrivilegios: privilegios.map((p) => p.nombre), + missingPrivilegios: missingPrivilegios, }); + } - if (privilegios.length !== privilegiosUsuario.length) { - return response.status(404).json({ - message: 'No se encontraron todos los privilegios especificados para Usuario', - foundPrivilegios: privilegios.map(p => p.nombre) - }); - } - - // Poblar la colección Contiene - const contieneUsuario = privilegios.map(privilegio => ({ - IDRol: rolUsuario._id, - IDPrivilegio: privilegio._id - })); - - await ContienePrivilegio.insertMany(contieneUsuario); + // Poblar la colección Contiene + const contiene = privilegios.map((privilegio) => ({ + IDRol: rol._id, + IDPrivilegio: privilegio._id, + })); + await ContienePrivilegio.insertMany(contiene); } catch (error) { - return response.status(400).json({ - error: error.message - }); + return response.status(400).json({ + error: error.message, + }); } - - return response.status(201).json({ - message: 'Privilegios asignados a los roles con éxito' - }); -}; \ No newline at end of file + }; + + // Procesar los privilegios para cada rol + await processRole("Staff", [ + "Consultar anuncio", + "Registrar cuenta", + "Consultar perfil propio", + "Modificar perfil", + "Eliminar cuenta", + "Consultar actividades", + "Registrar reporte", + "Consultar foro", + "Publicar comentario", + "Modificar comentario", + "Consultar sección de ayuda", + "Iniciar rodada", + "Desactivar rodada", + "Registrar ruta", + "Modificar ruta", + "Eliminar ruta", + "Consultar solicitudes de amistad", + "Enviar solicitud de amistad", + "Aceptar solicitud de amistad", + "Rechazar solicitud de amistad", + "Eliminar amigo", + "Registrar pregunta frecuente", + "Modificar pregunta frecuente", + "Eliminar pregunta frecuente", + "Consultar mapa", + "Consultar notificaciones", + "Consultar actividad individual", + "Resolver solicitud de apoyo", + "Cancelar solicitud de apoyo", + "Buscar Usuarios", + "Cancelar solicitud de amistad", + "Bloquear usuario", + "Consultar lista de amigos", + "Desbloquear usuario", + "Verificar asistencia", + ]); + + await processRole("Administrador", [ + "Registrar anuncio", + "Modificar anuncio", + "Eliminar anuncio", + "Consultar anuncio", + "Registrar actividad", + "Modificar actividad", + "Eliminar actividad", + "Consultar estadísticas", + "Modificar rol", + "Desactivar usuario", + "Eliminar comentario", + "Registrar cuenta", + "Consultar perfil propio", + "Modificar perfil", + "Eliminar cuenta", + "Consultar actividades", + "Registrar reporte", + "Consultar foro", + "Publicar comentario", + "Modificar comentario", + "Consultar sección de ayuda", + "Iniciar rodada", + "Desactivar rodada", + "Registrar ruta", + "Modificar ruta", + "Eliminar ruta", + "Consultar solicitudes de amistad", + "Enviar solicitud de amistad", + "Aceptar solicitud de amistad", + "Rechazar solicitud de amistad", + "Eliminar amigo", + "Registrar pregunta frecuente", + "Modificar pregunta frecuente", + "Eliminar pregunta frecuente", + "Consultar mapa", + "Consultar notificaciones", + "Consultar actividad individual", + "Resolver solicitud de apoyo", + "Cancelar solicitud de apoyo", + "Buscar Usuarios", + "Cancelar solicitud de amistad", + "Bloquear usuario", + "Consultar lista de amigos", + "Desbloquear usuario", + "Verificar asistencia", + "Consultar Usuarios", + ]); + + await processRole("Usuario", [ + "Consultar anuncio", + "Registrar cuenta", + "Consultar perfil propio", + "Modificar perfil", + "Eliminar cuenta", + "Consultar actividades", + "Registrar reporte", + "Consultar foro", + "Publicar comentario", + "Modificar comentario", + "Consultar sección de ayuda", + "Inscribir actividad", + "Cancelar asistencia", + "Consultar renta de bicicletas", + "Solicitar apoyo", + "Consultar solicitudes de amistad", + "Enviar solicitud de amistad", + "Aceptar solicitud de amistad", + "Rechazar solicitud de amistad", + "Eliminar amigo", + "Consultar medallas/reconocimientos", + "Consultar mapa", + "Consultar notificaciones", + "Consultar actividad individual", + "Cancelar solicitud de apoyo", + "Buscar Usuarios", + "Cancelar solicitud de amistad", + "Bloquear usuario", + "Consultar lista de amigos", + "Desbloquear usuario", + ]); + + return response.status(201).json({ + message: "Privilegios asignados a los roles con éxito", + }); +}; diff --git a/util/firebase-admin-config.js b/util/firebase-admin-config.js index 7ba9ba8..4a05fc7 100644 --- a/util/firebase-admin-config.js +++ b/util/firebase-admin-config.js @@ -1,25 +1,25 @@ -const admin = require('firebase-admin'); +const admin = require("firebase-admin"); const serviceAccount = require("./login-app.json"); admin.initializeApp({ - credential: admin.credential.cert(serviceAccount) + credential: admin.credential.cert(serviceAccount), }); // admin.initializeApp({ -// credential: admin.credential.cert({ -// type: 'service_account', -// project_id: process.env.FIREBASE_PROJECT_ID, -// private_key_id: process.env.FIREBASE_PRIVATE_KEY_ID, -// private_key: process.env.FIREBASE_PRIVATE_KEY.replace(/\\n/g, '\n'), // Reemplazar los \n con saltos de línea reales -// client_email: process.env.FIREBASE_CLIENT_EMAIL, -// client_id: process.env.FIREBASE_CLIENT_ID, -// auth_uri: process.env.FIREBASE_AUTH_URI, -// token_uri: process.env.FIREBASE_TOKEN_URI, -// auth_provider_x509_cert_url: process.env.FIREBASE_AUTH_PROVIDER_CERT_URL, -// client_x509_cert_url: process.env.FIREBASE_CLIENT_CERT_URL, -// universe_domain: 'googleapis.com' -// }) +// credential: admin.credential.cert({ +// type: "service_account", +// project_id: process.env.FIREBASE_PROJECT_ID, +// private_key_id: process.env.FIREBASE_PRIVATE_KEY_ID, +// private_key: process.env.FIREBASE_PRIVATE_KEY.replace(/\\n/g, "\n"), // Reemplazar los \n con saltos de línea reales +// client_email: process.env.FIREBASE_CLIENT_EMAIL, +// client_id: process.env.FIREBASE_CLIENT_ID, +// auth_uri: process.env.FIREBASE_AUTH_URI, +// token_uri: process.env.FIREBASE_TOKEN_URI, +// auth_provider_x509_cert_url: process.env.FIREBASE_AUTH_PROVIDER_CERT_URL, +// client_x509_cert_url: process.env.FIREBASE_CLIENT_CERT_URL, +// universe_domain: "googleapis.com", +// }), // }); // Exportar la instancia de admin para usar en otros archivos -module.exports = admin; \ No newline at end of file +module.exports = admin; diff --git a/util/inicializarBD.js b/util/inicializarBD.js new file mode 100644 index 0000000..2175567 --- /dev/null +++ b/util/inicializarBD.js @@ -0,0 +1,299 @@ +const mongoose = require("mongoose"); +const Rol = require("../models/perfil/rol.model"); +const Privilegio = require("../models/perfil/privilegio.model"); +const ContienePrivilegio = require("../models/perfil/contienePrivilegio.model"); + +const privilegiosPredeterminados = [ + { nombre: "crear_usuario", createdAt: new Date() }, + { nombre: "leer_usuario", createdAt: new Date() }, + { nombre: "actualizar_usuario", createdAt: new Date() }, + { nombre: "eliminar_usuario", createdAt: new Date() }, + { nombre: "crear_rol", createdAt: new Date() }, + { nombre: "leer_rol", createdAt: new Date() }, + { nombre: "actualizar_rol", createdAt: new Date() }, + { nombre: "eliminar_rol", createdAt: new Date() }, + { nombre: "asignar_privilegio_a_rol", createdAt: new Date() }, + { nombre: "eliminar_privilegio_de_rol", createdAt: new Date() }, + { nombre: "crear_recurso", createdAt: new Date() }, + { nombre: "leer_recurso", createdAt: new Date() }, + { nombre: "actualizar_recurso", createdAt: new Date() }, + { nombre: "eliminar_recurso", createdAt: new Date() }, + { nombre: "acceso_configuracion", createdAt: new Date() }, + { nombre: "actualizar_configuracion", createdAt: new Date() }, + { nombre: "ver_estadisticas", createdAt: new Date() }, + { nombre: "gestionar_politicas_seguridad", createdAt: new Date() }, + { nombre: "administrar_usuarios", createdAt: new Date() }, + { nombre: "acceso_funcionalidades_avanzadas", createdAt: new Date() }, +]; + +const rolesPredeterminados = [ + { nombre: "admin", createdAt: new Date() }, + { nombre: "staff", createdAt: new Date() }, + { nombre: "usuario", createdAt: new Date() }, +]; + +async function inicializarDatos() { + try { + // Conectar a la base de datos + await mongoose.connect("mongodb://localhost:27017/miBaseDeDatos", { + useNewUrlParser: true, + useUnifiedTopology: true, + }); + + // Crear Privilegios + const privilegios = await Privilegio.insertMany(privilegiosPredeterminados); + console.log("Privilegios creados:", privilegios); + + // Crear Roles + const roles = await Rol.insertMany(rolesPredeterminados); + console.log("Roles creados:", roles); + + // Asignar Privilegios a Roles + const asignaciones = [ + // Admin tiene todos los privilegios + { + IDPrivilegio: privilegios.find((p) => p.nombre === "crear_usuario")._id, + IDRol: roles.find((r) => r.nombre === "admin")._id, + createdAt: new Date(), + }, + { + IDPrivilegio: privilegios.find((p) => p.nombre === "leer_usuario")._id, + IDRol: roles.find((r) => r.nombre === "admin")._id, + createdAt: new Date(), + }, + { + IDPrivilegio: privilegios.find((p) => p.nombre === "actualizar_usuario") + ._id, + IDRol: roles.find((r) => r.nombre === "admin")._id, + createdAt: new Date(), + }, + { + IDPrivilegio: privilegios.find((p) => p.nombre === "eliminar_usuario") + ._id, + IDRol: roles.find((r) => r.nombre === "admin")._id, + createdAt: new Date(), + }, + { + IDPrivilegio: privilegios.find((p) => p.nombre === "crear_rol")._id, + IDRol: roles.find((r) => r.nombre === "admin")._id, + createdAt: new Date(), + }, + { + IDPrivilegio: privilegios.find((p) => p.nombre === "leer_rol")._id, + IDRol: roles.find((r) => r.nombre === "admin")._id, + createdAt: new Date(), + }, + { + IDPrivilegio: privilegios.find((p) => p.nombre === "actualizar_rol") + ._id, + IDRol: roles.find((r) => r.nombre === "admin")._id, + createdAt: new Date(), + }, + { + IDPrivilegio: privilegios.find((p) => p.nombre === "eliminar_rol")._id, + IDRol: roles.find((r) => r.nombre === "admin")._id, + createdAt: new Date(), + }, + { + IDPrivilegio: privilegios.find( + (p) => p.nombre === "asignar_privilegio_a_rol" + )._id, + IDRol: roles.find((r) => r.nombre === "admin")._id, + createdAt: new Date(), + }, + { + IDPrivilegio: privilegios.find( + (p) => p.nombre === "eliminar_privilegio_de_rol" + )._id, + IDRol: roles.find((r) => r.nombre === "admin")._id, + createdAt: new Date(), + }, + { + IDPrivilegio: privilegios.find((p) => p.nombre === "crear_recurso")._id, + IDRol: roles.find((r) => r.nombre === "admin")._id, + createdAt: new Date(), + }, + { + IDPrivilegio: privilegios.find((p) => p.nombre === "leer_recurso")._id, + IDRol: roles.find((r) => r.nombre === "admin")._id, + createdAt: new Date(), + }, + { + IDPrivilegio: privilegios.find((p) => p.nombre === "actualizar_recurso") + ._id, + IDRol: roles.find((r) => r.nombre === "admin")._id, + createdAt: new Date(), + }, + { + IDPrivilegio: privilegios.find((p) => p.nombre === "eliminar_recurso") + ._id, + IDRol: roles.find((r) => r.nombre === "admin")._id, + createdAt: new Date(), + }, + { + IDPrivilegio: privilegios.find( + (p) => p.nombre === "acceso_configuracion" + )._id, + IDRol: roles.find((r) => r.nombre === "admin")._id, + createdAt: new Date(), + }, + { + IDPrivilegio: privilegios.find( + (p) => p.nombre === "actualizar_configuracion" + )._id, + IDRol: roles.find((r) => r.nombre === "admin")._id, + createdAt: new Date(), + }, + { + IDPrivilegio: privilegios.find((p) => p.nombre === "ver_estadisticas") + ._id, + IDRol: roles.find((r) => r.nombre === "admin")._id, + createdAt: new Date(), + }, + { + IDPrivilegio: privilegios.find( + (p) => p.nombre === "gestionar_politicas_seguridad" + )._id, + IDRol: roles.find((r) => r.nombre === "admin")._id, + createdAt: new Date(), + }, + { + IDPrivilegio: privilegios.find( + (p) => p.nombre === "administrar_usuarios" + )._id, + IDRol: roles.find((r) => r.nombre === "admin")._id, + createdAt: new Date(), + }, + { + IDPrivilegio: privilegios.find( + (p) => p.nombre === "acceso_funcionalidades_avanzadas" + )._id, + IDRol: roles.find((r) => r.nombre === "admin")._id, + createdAt: new Date(), + }, + + // Staff tiene privilegios de CRUD y asignación de privilegios a roles + { + IDPrivilegio: privilegios.find((p) => p.nombre === "crear_usuario")._id, + IDRol: roles.find((r) => r.nombre === "admin")._id, + createdAt: new Date(), + }, + { + IDPrivilegio: privilegios.find((p) => p.nombre === "leer_usuario")._id, + IDRol: roles.find((r) => r.nombre === "admin")._id, + createdAt: new Date(), + }, + { + IDPrivilegio: privilegios.find((p) => p.nombre === "actualizar_usuario") + ._id, + IDRol: roles.find((r) => r.nombre === "admin")._id, + createdAt: new Date(), + }, + { + IDPrivilegio: privilegios.find((p) => p.nombre === "eliminar_usuario") + ._id, + IDRol: roles.find((r) => r.nombre === "admin")._id, + createdAt: new Date(), + }, + { + IDPrivilegio: privilegios.find((p) => p.nombre === "crear_recurso")._id, + IDRol: roles.find((r) => r.nombre === "admin")._id, + createdAt: new Date(), + }, + { + IDPrivilegio: privilegios.find((p) => p.nombre === "leer_recurso")._id, + IDRol: roles.find((r) => r.nombre === "admin")._id, + createdAt: new Date(), + }, + { + IDPrivilegio: privilegios.find((p) => p.nombre === "actualizar_recurso") + ._id, + IDRol: roles.find((r) => r.nombre === "admin")._id, + createdAt: new Date(), + }, + { + IDPrivilegio: privilegios.find((p) => p.nombre === "eliminar_recurso") + ._id, + IDRol: roles.find((r) => r.nombre === "admin")._id, + createdAt: new Date(), + }, + { + IDPrivilegio: privilegios.find( + (p) => p.nombre === "acceso_configuracion" + )._id, + IDRol: roles.find((r) => r.nombre === "admin")._id, + createdAt: new Date(), + }, + { + IDPrivilegio: privilegios.find( + (p) => p.nombre === "acceso_funcionalidades_avanzadas" + )._id, + IDRol: roles.find((r) => r.nombre === "admin")._id, + createdAt: new Date(), + }, + + // Usuario tiene privilegios limitados + { + IDPrivilegio: privilegios.find((p) => p.nombre === "crear_usuario")._id, + IDRol: roles.find((r) => r.nombre === "admin")._id, + createdAt: new Date(), + }, + { + IDPrivilegio: privilegios.find((p) => p.nombre === "leer_usuario")._id, + IDRol: roles.find((r) => r.nombre === "admin")._id, + createdAt: new Date(), + }, + { + IDPrivilegio: privilegios.find((p) => p.nombre === "actualizar_usuario") + ._id, + IDRol: roles.find((r) => r.nombre === "admin")._id, + createdAt: new Date(), + }, + { + IDPrivilegio: privilegios.find((p) => p.nombre === "eliminar_usuario") + ._id, + IDRol: roles.find((r) => r.nombre === "admin")._id, + createdAt: new Date(), + }, + { + IDPrivilegio: privilegios.find((p) => p.nombre === "crear_recurso")._id, + IDRol: roles.find((r) => r.nombre === "admin")._id, + createdAt: new Date(), + }, + { + IDPrivilegio: privilegios.find((p) => p.nombre === "leer_recurso")._id, + IDRol: roles.find((r) => r.nombre === "admin")._id, + createdAt: new Date(), + }, + { + IDPrivilegio: privilegios.find((p) => p.nombre === "actualizar_recurso") + ._id, + IDRol: roles.find((r) => r.nombre === "admin")._id, + createdAt: new Date(), + }, + { + IDPrivilegio: privilegios.find((p) => p.nombre === "eliminar_recurso") + ._id, + IDRol: roles.find((r) => r.nombre === "admin")._id, + createdAt: new Date(), + }, + { + IDPrivilegio: privilegios.find( + (p) => p.nombre === "acceso_configuracion" + )._id, + IDRol: roles.find((r) => r.nombre === "admin")._id, + createdAt: new Date(), + }, + ]; + + await ContienePrivilegio.insertMany(asignaciones); + console.log("Privilegios asignados a roles."); + + // Desconectar de la base de datos + await mongoose.disconnect(); + } catch (error) { + console.error("Error al inicializar datos:", error); + } +} + +module.exports = inicializarDatos; diff --git a/util/inicializarPrivilegios.js b/util/inicializarPrivilegios.js new file mode 100644 index 0000000..cb938f8 --- /dev/null +++ b/util/inicializarPrivilegios.js @@ -0,0 +1,299 @@ +const mongoose = require("mongoose"); +const Rol = require("../../../models/perfil/rol.model"); +const Privilegio = require("../../../models/perfil/privilegio.model"); +const ContienePrivilegio = require("../../../models/perfil/contienePrivilegio.model"); + +const privilegiosPredeterminados = [ + { nombre: "crear_usuario", createdAt: new Date() }, + { nombre: "leer_usuario", createdAt: new Date() }, + { nombre: "actualizar_usuario", createdAt: new Date() }, + { nombre: "eliminar_usuario", createdAt: new Date() }, + { nombre: "crear_rol", createdAt: new Date() }, + { nombre: "leer_rol", createdAt: new Date() }, + { nombre: "actualizar_rol", createdAt: new Date() }, + { nombre: "eliminar_rol", createdAt: new Date() }, + { nombre: "asignar_privilegio_a_rol", createdAt: new Date() }, + { nombre: "eliminar_privilegio_de_rol", createdAt: new Date() }, + { nombre: "crear_recurso", createdAt: new Date() }, + { nombre: "leer_recurso", createdAt: new Date() }, + { nombre: "actualizar_recurso", createdAt: new Date() }, + { nombre: "eliminar_recurso", createdAt: new Date() }, + { nombre: "acceso_configuracion", createdAt: new Date() }, + { nombre: "actualizar_configuracion", createdAt: new Date() }, + { nombre: "ver_estadisticas", createdAt: new Date() }, + { nombre: "gestionar_politicas_seguridad", createdAt: new Date() }, + { nombre: "administrar_usuarios", createdAt: new Date() }, + { nombre: "acceso_funcionalidades_avanzadas", createdAt: new Date() }, +]; + +const rolesPredeterminados = [ + { nombre: "admin", createdAt: new Date() }, + { nombre: "staff", createdAt: new Date() }, + { nombre: "usuario", createdAt: new Date() }, +]; + +async function inicializarDatos() { + try { + // Conectar a la base de datos + await mongoose.connect("mongodb://localhost:27017/miBaseDeDatos", { + useNewUrlParser: true, + useUnifiedTopology: true, + }); + + // Crear Privilegios + const privilegios = await Privilegio.insertMany(privilegiosPredeterminados); + console.log("Privilegios creados:", privilegios); + + // Crear Roles + const roles = await Rol.insertMany(rolesPredeterminados); + console.log("Roles creados:", roles); + + // Asignar Privilegios a Roles + const asignaciones = [ + // Admin tiene todos los privilegios + { + IDPrivilegio: privilegios.find((p) => p.nombre === "crear_usuario")._id, + IDRol: roles.find((r) => r.nombre === "admin")._id, + createdAt: new Date(), + }, + { + IDPrivilegio: privilegios.find((p) => p.nombre === "leer_usuario")._id, + IDRol: roles.find((r) => r.nombre === "admin")._id, + createdAt: new Date(), + }, + { + IDPrivilegio: privilegios.find((p) => p.nombre === "actualizar_usuario") + ._id, + IDRol: roles.find((r) => r.nombre === "admin")._id, + createdAt: new Date(), + }, + { + IDPrivilegio: privilegios.find((p) => p.nombre === "eliminar_usuario") + ._id, + IDRol: roles.find((r) => r.nombre === "admin")._id, + createdAt: new Date(), + }, + { + IDPrivilegio: privilegios.find((p) => p.nombre === "crear_rol")._id, + IDRol: roles.find((r) => r.nombre === "admin")._id, + createdAt: new Date(), + }, + { + IDPrivilegio: privilegios.find((p) => p.nombre === "leer_rol")._id, + IDRol: roles.find((r) => r.nombre === "admin")._id, + createdAt: new Date(), + }, + { + IDPrivilegio: privilegios.find((p) => p.nombre === "actualizar_rol") + ._id, + IDRol: roles.find((r) => r.nombre === "admin")._id, + createdAt: new Date(), + }, + { + IDPrivilegio: privilegios.find((p) => p.nombre === "eliminar_rol")._id, + IDRol: roles.find((r) => r.nombre === "admin")._id, + createdAt: new Date(), + }, + { + IDPrivilegio: privilegios.find( + (p) => p.nombre === "asignar_privilegio_a_rol" + )._id, + IDRol: roles.find((r) => r.nombre === "admin")._id, + createdAt: new Date(), + }, + { + IDPrivilegio: privilegios.find( + (p) => p.nombre === "eliminar_privilegio_de_rol" + )._id, + IDRol: roles.find((r) => r.nombre === "admin")._id, + createdAt: new Date(), + }, + { + IDPrivilegio: privilegios.find((p) => p.nombre === "crear_recurso")._id, + IDRol: roles.find((r) => r.nombre === "admin")._id, + createdAt: new Date(), + }, + { + IDPrivilegio: privilegios.find((p) => p.nombre === "leer_recurso")._id, + IDRol: roles.find((r) => r.nombre === "admin")._id, + createdAt: new Date(), + }, + { + IDPrivilegio: privilegios.find((p) => p.nombre === "actualizar_recurso") + ._id, + IDRol: roles.find((r) => r.nombre === "admin")._id, + createdAt: new Date(), + }, + { + IDPrivilegio: privilegios.find((p) => p.nombre === "eliminar_recurso") + ._id, + IDRol: roles.find((r) => r.nombre === "admin")._id, + createdAt: new Date(), + }, + { + IDPrivilegio: privilegios.find( + (p) => p.nombre === "acceso_configuracion" + )._id, + IDRol: roles.find((r) => r.nombre === "admin")._id, + createdAt: new Date(), + }, + { + IDPrivilegio: privilegios.find( + (p) => p.nombre === "actualizar_configuracion" + )._id, + IDRol: roles.find((r) => r.nombre === "admin")._id, + createdAt: new Date(), + }, + { + IDPrivilegio: privilegios.find((p) => p.nombre === "ver_estadisticas") + ._id, + IDRol: roles.find((r) => r.nombre === "admin")._id, + createdAt: new Date(), + }, + { + IDPrivilegio: privilegios.find( + (p) => p.nombre === "gestionar_politicas_seguridad" + )._id, + IDRol: roles.find((r) => r.nombre === "admin")._id, + createdAt: new Date(), + }, + { + IDPrivilegio: privilegios.find( + (p) => p.nombre === "administrar_usuarios" + )._id, + IDRol: roles.find((r) => r.nombre === "admin")._id, + createdAt: new Date(), + }, + { + IDPrivilegio: privilegios.find( + (p) => p.nombre === "acceso_funcionalidades_avanzadas" + )._id, + IDRol: roles.find((r) => r.nombre === "admin")._id, + createdAt: new Date(), + }, + + // Staff tiene privilegios de CRUD y asignación de privilegios a roles + { + IDPrivilegio: privilegios.find((p) => p.nombre === "crear_usuario")._id, + IDRol: roles.find((r) => r.nombre === "admin")._id, + createdAt: new Date(), + }, + { + IDPrivilegio: privilegios.find((p) => p.nombre === "leer_usuario")._id, + IDRol: roles.find((r) => r.nombre === "admin")._id, + createdAt: new Date(), + }, + { + IDPrivilegio: privilegios.find((p) => p.nombre === "actualizar_usuario") + ._id, + IDRol: roles.find((r) => r.nombre === "admin")._id, + createdAt: new Date(), + }, + { + IDPrivilegio: privilegios.find((p) => p.nombre === "eliminar_usuario") + ._id, + IDRol: roles.find((r) => r.nombre === "admin")._id, + createdAt: new Date(), + }, + { + IDPrivilegio: privilegios.find((p) => p.nombre === "crear_recurso")._id, + IDRol: roles.find((r) => r.nombre === "admin")._id, + createdAt: new Date(), + }, + { + IDPrivilegio: privilegios.find((p) => p.nombre === "leer_recurso")._id, + IDRol: roles.find((r) => r.nombre === "admin")._id, + createdAt: new Date(), + }, + { + IDPrivilegio: privilegios.find((p) => p.nombre === "actualizar_recurso") + ._id, + IDRol: roles.find((r) => r.nombre === "admin")._id, + createdAt: new Date(), + }, + { + IDPrivilegio: privilegios.find((p) => p.nombre === "eliminar_recurso") + ._id, + IDRol: roles.find((r) => r.nombre === "admin")._id, + createdAt: new Date(), + }, + { + IDPrivilegio: privilegios.find( + (p) => p.nombre === "acceso_configuracion" + )._id, + IDRol: roles.find((r) => r.nombre === "admin")._id, + createdAt: new Date(), + }, + { + IDPrivilegio: privilegios.find( + (p) => p.nombre === "acceso_funcionalidades_avanzadas" + )._id, + IDRol: roles.find((r) => r.nombre === "admin")._id, + createdAt: new Date(), + }, + + // Usuario tiene privilegios limitados + { + IDPrivilegio: privilegios.find((p) => p.nombre === "crear_usuario")._id, + IDRol: roles.find((r) => r.nombre === "admin")._id, + createdAt: new Date(), + }, + { + IDPrivilegio: privilegios.find((p) => p.nombre === "leer_usuario")._id, + IDRol: roles.find((r) => r.nombre === "admin")._id, + createdAt: new Date(), + }, + { + IDPrivilegio: privilegios.find((p) => p.nombre === "actualizar_usuario") + ._id, + IDRol: roles.find((r) => r.nombre === "admin")._id, + createdAt: new Date(), + }, + { + IDPrivilegio: privilegios.find((p) => p.nombre === "eliminar_usuario") + ._id, + IDRol: roles.find((r) => r.nombre === "admin")._id, + createdAt: new Date(), + }, + { + IDPrivilegio: privilegios.find((p) => p.nombre === "crear_recurso")._id, + IDRol: roles.find((r) => r.nombre === "admin")._id, + createdAt: new Date(), + }, + { + IDPrivilegio: privilegios.find((p) => p.nombre === "leer_recurso")._id, + IDRol: roles.find((r) => r.nombre === "admin")._id, + createdAt: new Date(), + }, + { + IDPrivilegio: privilegios.find((p) => p.nombre === "actualizar_recurso") + ._id, + IDRol: roles.find((r) => r.nombre === "admin")._id, + createdAt: new Date(), + }, + { + IDPrivilegio: privilegios.find((p) => p.nombre === "eliminar_recurso") + ._id, + IDRol: roles.find((r) => r.nombre === "admin")._id, + createdAt: new Date(), + }, + { + IDPrivilegio: privilegios.find( + (p) => p.nombre === "acceso_configuracion" + )._id, + IDRol: roles.find((r) => r.nombre === "admin")._id, + createdAt: new Date(), + }, + ]; + + await ContienePrivilegio.insertMany(asignaciones); + console.log("Privilegios asignados a roles."); + + // Desconectar de la base de datos + await mongoose.disconnect(); + } catch (error) { + console.error("Error al inicializar datos:", error); + } +} + +inicializarDatos(); From f93badb220a5ca50c7d451a6412f0715b0041513 Mon Sep 17 00:00:00 2001 From: PAOLA MARIA garrido Date: Mon, 16 Sep 2024 11:14:10 -0600 Subject: [PATCH 022/231] feat: Agregar rutas de FAQ. --- .../routes/consultarPreguntasFrecuentes.routes.js | 8 ++++++++ .../routes/preguntasIndex.routes.js | 8 ++++---- .../routes/registrarPreguntasFrecuente.routes.js | 10 ---------- .../routes/registrarPreguntasFrecuentes.routes.js | 8 ++++++++ 4 files changed, 20 insertions(+), 14 deletions(-) create mode 100644 modules/preguntasFrecuentes/routes/consultarPreguntasFrecuentes.routes.js delete mode 100644 modules/preguntasFrecuentes/routes/registrarPreguntasFrecuente.routes.js create mode 100644 modules/preguntasFrecuentes/routes/registrarPreguntasFrecuentes.routes.js diff --git a/modules/preguntasFrecuentes/routes/consultarPreguntasFrecuentes.routes.js b/modules/preguntasFrecuentes/routes/consultarPreguntasFrecuentes.routes.js new file mode 100644 index 0000000..54ef3d6 --- /dev/null +++ b/modules/preguntasFrecuentes/routes/consultarPreguntasFrecuentes.routes.js @@ -0,0 +1,8 @@ +const express = require('express'); +const router = express.Router(); + +const consultarPreguntas = require('../controllers/consultarPreguntasFrecuentes.controller'); + +router.get('/', consultarPreguntas.consultarPreguntasFrecuentes); + +module.exports = router; \ No newline at end of file diff --git a/modules/preguntasFrecuentes/routes/preguntasIndex.routes.js b/modules/preguntasFrecuentes/routes/preguntasIndex.routes.js index 4f3c24d..3529ce4 100644 --- a/modules/preguntasFrecuentes/routes/preguntasIndex.routes.js +++ b/modules/preguntasFrecuentes/routes/preguntasIndex.routes.js @@ -1,10 +1,10 @@ const express = require('express'); const router = express.Router(); -// Importen aquí los archivos de ruta del módulo -// EJEMPLO: const registrarActividadRoute = require('./registrarActividad.routes'); +const consultarPreguntasRoute = require('./consultarPreguntasFrecuentes.routes'); +const registrarPreguntasRoute = require('./registrarPreguntasFrecuentes.routes'); -// Pongan la ruta que quieren usar y el archivo de la ruta de la funcionalidad -// EJEMPLO router.use('/registrar', registrarActividadRoute); +router.use('/consultar', consultarPreguntasRoute); +router.use('/registrar', registrarPreguntasRoute); module.exports = router; \ No newline at end of file diff --git a/modules/preguntasFrecuentes/routes/registrarPreguntasFrecuente.routes.js b/modules/preguntasFrecuentes/routes/registrarPreguntasFrecuente.routes.js deleted file mode 100644 index fede7fd..0000000 --- a/modules/preguntasFrecuentes/routes/registrarPreguntasFrecuente.routes.js +++ /dev/null @@ -1,10 +0,0 @@ -const express = require('express'); -const router = express.Router(); - -// Importar el controlador que maneja la Funcionalidad que quieres -// EJEMPLO: const registrarAnuncioController = require('../controllers/registrarAnuncio.controller'); - -// Definir la ruta para la funcionalidad y la funcion del controlador -// EJEMPLO: router.get('/', registrarActividadController.getPrueba); - -module.exports = router; \ No newline at end of file diff --git a/modules/preguntasFrecuentes/routes/registrarPreguntasFrecuentes.routes.js b/modules/preguntasFrecuentes/routes/registrarPreguntasFrecuentes.routes.js new file mode 100644 index 0000000..037e83d --- /dev/null +++ b/modules/preguntasFrecuentes/routes/registrarPreguntasFrecuentes.routes.js @@ -0,0 +1,8 @@ +const express = require('express'); +const router = express.Router(); + +const registrarPregunta = require('../controllers/registrarPreguntaFrecuente.controller'); + +router.post('/', registrarPregunta.registrarPreguntaFrecuente); + +module.exports = router; \ No newline at end of file From 276425c1d940ce4c1b10c3e98011a8c2df388940 Mon Sep 17 00:00:00 2001 From: Angeltrek Date: Mon, 16 Sep 2024 11:23:49 -0600 Subject: [PATCH 023/231] fix: puerto de conexion --- app.js | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/app.js b/app.js index 2035db4..8c16ab5 100644 --- a/app.js +++ b/app.js @@ -25,14 +25,17 @@ const compression = require("compression"); app.use(compression()); // Conectar a la base de datos local de MongoDB -mongoose.connect('mongodb://ec2-3-144-225-207.us-east-2.compute.amazonaws.com:27017') +mongoose + .connect( + "mongodb://SacalaBiciDeveloper:uY*Gn_rQgiy15744unN1884%24%24@ec2-3-145-117-182.us-east-2.compute.amazonaws.com:28222/?authSource=admin" + ) - -.then(() => { - console.log('Conectado a la base de datos de MongoDB en AWS EC2'); -}).catch((error) => { - console.error('Error al conectar con la base de datos:', error); -}); + .then(() => { + console.log("Conectado a la base de datos de MongoDB en AWS EC2"); + }) + .catch((error) => { + console.error("Error al conectar con la base de datos:", error); + }); // Importar el archivo index de cada módulo const actividadesRoutes = require("./modules/actividades/routes/actividadesIndex.routes"); From cac57798c6c507043e695c127d461f3b428e6e28 Mon Sep 17 00:00:00 2001 From: PAOLA MARIA garrido Date: Mon, 16 Sep 2024 11:46:37 -0600 Subject: [PATCH 024/231] feat: Agregar controlador para consultar FAQ. --- .../consultarPreguntasFrecuentes.controller.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 modules/preguntasFrecuentes/controllers/consultarPreguntasFrecuentes.controller.js diff --git a/modules/preguntasFrecuentes/controllers/consultarPreguntasFrecuentes.controller.js b/modules/preguntasFrecuentes/controllers/consultarPreguntasFrecuentes.controller.js new file mode 100644 index 0000000..21c37ab --- /dev/null +++ b/modules/preguntasFrecuentes/controllers/consultarPreguntasFrecuentes.controller.js @@ -0,0 +1,18 @@ +const PreguntaFrecuente = require('../../../models/otros/preguntasFrecuentes.model'); + +exports.consultarPreguntasFrecuentes = async (req, res) => { + try { + const preguntas = await PreguntaFrecuente.find(); + return res.status(200).json({ + code: 200, + msg: 'Consulta de preguntas frecuentes exitosa', + data: preguntas + }); + } catch (error) { + return res.status(500).json({ + code: 500, + msg: 'Error al intentar consultar las preguntas frecuentes', + data: null + }); + } +}; \ No newline at end of file From 52d12cbd556284f0b14931dce770a85a30fc2207 Mon Sep 17 00:00:00 2001 From: PAOLA MARIA garrido Date: Mon, 16 Sep 2024 12:11:40 -0600 Subject: [PATCH 025/231] =?UTF-8?q?feat:=20Correci=C3=B3n=20de=20error.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controllers/consultarPreguntasFrecuentes.controller.js | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/preguntasFrecuentes/controllers/consultarPreguntasFrecuentes.controller.js b/modules/preguntasFrecuentes/controllers/consultarPreguntasFrecuentes.controller.js index 21c37ab..24a7cc2 100644 --- a/modules/preguntasFrecuentes/controllers/consultarPreguntasFrecuentes.controller.js +++ b/modules/preguntasFrecuentes/controllers/consultarPreguntasFrecuentes.controller.js @@ -9,6 +9,7 @@ exports.consultarPreguntasFrecuentes = async (req, res) => { data: preguntas }); } catch (error) { + console.error(error); return res.status(500).json({ code: 500, msg: 'Error al intentar consultar las preguntas frecuentes', From 9a06d617f27e8f81b11721d50c1dfb592ac87c72 Mon Sep 17 00:00:00 2001 From: PAOLA MARIA garrido Date: Mon, 16 Sep 2024 12:37:47 -0600 Subject: [PATCH 026/231] feat: Agregar contolador para registrar FAQ. --- .../registrarPreguntaFrecuente.controller.js | 28 +++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/modules/preguntasFrecuentes/controllers/registrarPreguntaFrecuente.controller.js b/modules/preguntasFrecuentes/controllers/registrarPreguntaFrecuente.controller.js index 066ec72..80e3023 100644 --- a/modules/preguntasFrecuentes/controllers/registrarPreguntaFrecuente.controller.js +++ b/modules/preguntasFrecuentes/controllers/registrarPreguntaFrecuente.controller.js @@ -1,3 +1,27 @@ -exports.getPrueba = (request, response) => { - response.json('Preguntas Frecuentes: Esta es la plantilla que deben usar.'); +const PreguntaFrecuente = require('../../../models/otros/preguntasFrecuentes.model'); + +exports.registrarPreguntaFrecuente = async (req, res) => { + try { + const { IDPregunta, Pregunta, Respuesta, Tema, Imagen } = req.body; + const nuevaPregunta = new PreguntaFrecuente({ + IDPregunta, + Pregunta, + Respuesta, + Tema, + Imagen + }); + await nuevaPregunta.save(); + return res.status(200).json({ + code: 200, + msg: 'La pregunta ha sido registrada con éxito', + data: nuevaPregunta + }); + } catch (error) { + console.error(error); + return res.status(500).json({ + code: 500, + msg: 'Error al intentar registrar la pregunta', + data: null + }); + } }; \ No newline at end of file From a147c1a36ed76feaf04fd26f6aeb3effdb0de837 Mon Sep 17 00:00:00 2001 From: DanielQueijeiro Date: Mon, 16 Sep 2024 14:18:57 -0600 Subject: [PATCH 027/231] =?UTF-8?q?=20Conexi=C3=B3n=20a=20base=20de?= =?UTF-8?q?=20datos=20en=20linea=20AWS=20EC2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .idea/.gitignore | 3 + .idea/app-backend.iml | 9 ++ .idea/misc.xml | 6 + .idea/modules.xml | 8 ++ .idea/other.xml | 318 +++++++++++++++++++++++++++++++++++++++++ .idea/vcs.xml | 6 + Backend.code-workspace | 7 + app.js | 1 + 8 files changed, 358 insertions(+) create mode 100644 .idea/.gitignore create mode 100644 .idea/app-backend.iml create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/other.xml create mode 100644 .idea/vcs.xml create mode 100644 Backend.code-workspace diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..26d3352 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/.idea/app-backend.iml b/.idea/app-backend.iml new file mode 100644 index 0000000..d6ebd48 --- /dev/null +++ b/.idea/app-backend.iml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..07115cd --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..ae95f02 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/other.xml b/.idea/other.xml new file mode 100644 index 0000000..94c96f6 --- /dev/null +++ b/.idea/other.xml @@ -0,0 +1,318 @@ + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..35eb1dd --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/Backend.code-workspace b/Backend.code-workspace new file mode 100644 index 0000000..362d7c2 --- /dev/null +++ b/Backend.code-workspace @@ -0,0 +1,7 @@ +{ + "folders": [ + { + "path": "." + } + ] +} \ No newline at end of file diff --git a/app.js b/app.js index e50314b..4f549b9 100644 --- a/app.js +++ b/app.js @@ -23,6 +23,7 @@ const compression = require('compression'); app.use(compression()); // Conectar a la base de datos local de MongoDB +//mongoose.connect('mongodb://SacalaBiciDeveloper:uY*Gn_rQgiy15744unN1884%24%24@ec2-3-145-117-182.us-east-2.compute.amazonaws.com:28222/?authSource=admin') mongoose.connect('mongodb://localhost:27017/Saca_la_Bici') .then(() => { console.log('Conectado a la base de datos local de MongoDB'); From de776ad95a49b97341a8c5fab82efce16d7e2e56 Mon Sep 17 00:00:00 2001 From: Angeltrek Date: Mon, 16 Sep 2024 20:57:17 -0600 Subject: [PATCH 028/231] fix: auth con cuentas registradas --- .../registrarUsuario.controller.js | 127 ++++++++++-------- 1 file changed, 68 insertions(+), 59 deletions(-) diff --git a/modules/session/controllers/registrarUsuario.controller.js b/modules/session/controllers/registrarUsuario.controller.js index 2aa8364..fcddd64 100644 --- a/modules/session/controllers/registrarUsuario.controller.js +++ b/modules/session/controllers/registrarUsuario.controller.js @@ -1,63 +1,72 @@ // const admin = require('../../../util/firebase'); -const Usuario = require('../../../models/perfil/usuario.model'); -const Rol = require('../../../models/perfil/rol.model'); -const PoseeRol = require('../../../models/perfil/poseeRol.model'); // Modelo para la relación entre usuario y rol +const Usuario = require("../../../models/perfil/usuario.model"); +const Rol = require("../../../models/perfil/rol.model"); +const PoseeRol = require("../../../models/perfil/poseeRol.model"); // Modelo para la relación entre usuario y rol exports.registrarUsuario = async (request, response) => { - try { - // Sacar los datos body - const { - username, - nombre, - edad, - tipoSangre, - correoElectronico, - numeroEmergencia, - firebaseUID - } = request.body; - - // Buscar el rol Usuario - const rolUsuario = await Rol.findOne({ - nombre: 'Usuario' - }); - if (!rolUsuario) { - return response.status(404).json({ - message: 'Rol Usuario no encontrado' - }); - } - - // Crear el usuario en MongoDB, por ahora sin firebaseUID - const newUser = new Usuario({ - username, - nombre, - edad, - tipoSangre, - correoElectronico, - numeroEmergencia, - firebaseUID - }); - - await newUser.save(); - - // Poblar la tabla Posee con la relación entre el usuario y el rol - const poseeRol = new PoseeRol({ - // ObjectId del nuevo usuario - IDUsuario: newUser._id, - // ObjectId del rol "Usuario" - IDRol: rolUsuario._id - }); - - // Guardar la relación en la tabla Posee - await poseeRol.save(); - - response.status(201).json({ - message: 'User registrado con éxito', - user: newUser - }); - - } catch (error) { - response.status(400).json({ - error: error.message - }); + try { + // Sacar los datos body + const { + username, + nombre, + edad, + tipoSangre, + correoElectronico, + numeroEmergencia, + firebaseUID, + } = request.body; + + // Verificar si el usuario ya está registrado en MongoDB + let existingUser = await Usuario.findOne({ firebaseUID }); + if (existingUser) { + // Si el usuario ya existe, responder con éxito + return response.status(200).json({ + message: "Usuario ya registrado", + user: existingUser, + }); + } + + // Buscar el rol Usuario + const rolUsuario = await Rol.findOne({ + nombre: "Usuario", + }); + if (!rolUsuario) { + return response.status(404).json({ + message: "Rol Usuario no encontrado", + }); } -}; \ No newline at end of file + + // Crear el usuario en MongoDB, por ahora sin firebaseUID + const newUser = new Usuario({ + username, + nombre, + edad, + tipoSangre, + correoElectronico, + numeroEmergencia, + firebaseUID, + }); + + await newUser.save(); + + // Poblar la tabla Posee con la relación entre el usuario y el rol + const poseeRol = new PoseeRol({ + // ObjectId del nuevo usuario + IDUsuario: newUser._id, + // ObjectId del rol "Usuario" + IDRol: rolUsuario._id, + }); + + // Guardar la relación en la tabla Posee + await poseeRol.save(); + + response.status(201).json({ + message: "User registrado con éxito", + user: newUser, + }); + } catch (error) { + response.status(400).json({ + error: error.message, + }); + } +}; From e78444c495d3c98d2a55c30cc4cd09e0839989ef Mon Sep 17 00:00:00 2001 From: Angeltrek Date: Mon, 16 Sep 2024 21:10:58 -0600 Subject: [PATCH 029/231] feat: .env implementado --- app.js | 38 ++++++++++---------------------------- package-lock.json | 3 ++- 2 files changed, 12 insertions(+), 29 deletions(-) diff --git a/app.js b/app.js index 8c16ab5..c6dcd4f 100644 --- a/app.js +++ b/app.js @@ -1,35 +1,28 @@ -// Para usar express en vez de http +require("dotenv").config(); const express = require("express"); const mongoose = require("mongoose"); -// Inicia la app usuando a express const app = express(); -const port = 7070; +const port = process.env.PORT || 7070; -// Manipular facil los datos de las peticiones const bodyParser = require("body-parser"); -// Configura bodyparser app.use( bodyParser.urlencoded({ extended: false, }) ); - app.use(bodyParser.json()); -// USAR JWT (JSON Web Tokens) para autenticar las solicitudes - const compression = require("compression"); - app.use(compression()); -// Conectar a la base de datos local de MongoDB +// Conectar a la base de datos usando variables de entorno mongoose - .connect( - "mongodb://SacalaBiciDeveloper:uY*Gn_rQgiy15744unN1884%24%24@ec2-3-145-117-182.us-east-2.compute.amazonaws.com:28222/?authSource=admin" - ) - + .connect(process.env.MONGO_URI, { + useNewUrlParser: true, + useUnifiedTopology: true, + }) .then(() => { console.log("Conectado a la base de datos de MongoDB en AWS EC2"); }) @@ -51,7 +44,6 @@ const reporteRoutes = require("./modules/reporte/routes/reporteIndex.routes"); const rodadasRoutes = require("./modules/rodadas/routes/rodadasIndex.routes"); const sessionRoutes = require("./modules/session/routes/sessionIndex.routes"); -// Usar las rutas de los módulos app.use("/actividades", actividadesRoutes); app.use("/anuncios", anunciosRoutes); app.use("/ayuda", ayudaRoutes); @@ -65,16 +57,6 @@ app.use("/reporte", reporteRoutes); app.use("/rodadas", rodadasRoutes); app.use("/session", sessionRoutes); -// Middleware para verificar si la sesión está activa -// function checkSession(req, res, next) { -// if (!req.session.username) { -// return res.status(401).json({ -// message: 'No hay sesión activa' -// }); -// } -// next(); -// } - const verifyToken = require("./util/verifyUserToken"); app.get("/", verifyToken, (request, response) => { @@ -84,12 +66,12 @@ app.get("/", verifyToken, (request, response) => { console.log(request.userUID); }); -// Para error 404 app.use((request, response) => { response.status(404).json({ message: "No se encuentra el endpoint o ruta que estas buscando", }); }); -// Para que el servidor este activo -app.listen(port); +app.listen(port, () => { + console.log(`Servidor escuchando en el puerto ${port}`); +}); diff --git a/package-lock.json b/package-lock.json index f560121..b2e3475 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1106,7 +1106,8 @@ }, "node_modules/dotenv": { "version": "16.4.5", - "license": "BSD-2-Clause", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.4.5.tgz", + "integrity": "sha512-ZmdL2rui+eB2YwhsWzjInR8LldtZHGDoQ1ugH85ppHKwpUHL7j7rN0Ti9NCnGiQbhaZ11FpR+7ao1dNsmduNUg==", "engines": { "node": ">=12" }, From 6ed4310408775d1674b700a115d61a04dd8d7f34 Mon Sep 17 00:00:00 2001 From: Jesus0204 Date: Mon, 16 Sep 2024 22:05:10 -0600 Subject: [PATCH 030/231] feat: Agregar que el login se pueda con username --- models/perfil/usuario.model.js | 1 + .../controllers/getUserEmail.controller.js | 33 ++++++ modules/session/routes/getUserEmail.routes.js | 8 ++ .../session/routes/registrarUsuario.routes.js | 4 +- modules/session/routes/sessionIndex.routes.js | 2 + package-lock.json | 109 +++++++++++++----- 6 files changed, 130 insertions(+), 27 deletions(-) create mode 100644 modules/session/controllers/getUserEmail.controller.js create mode 100644 modules/session/routes/getUserEmail.routes.js diff --git a/models/perfil/usuario.model.js b/models/perfil/usuario.model.js index 0ecb9cd..3299a91 100644 --- a/models/perfil/usuario.model.js +++ b/models/perfil/usuario.model.js @@ -4,6 +4,7 @@ const usuarioSchema = new mongoose.Schema({ username: { type: String, required: true, + unique: true, }, nombre: { type: String, diff --git a/modules/session/controllers/getUserEmail.controller.js b/modules/session/controllers/getUserEmail.controller.js new file mode 100644 index 0000000..9c18fbe --- /dev/null +++ b/modules/session/controllers/getUserEmail.controller.js @@ -0,0 +1,33 @@ +const Usuario = require('../../../models/perfil/usuario.model'); + +exports.getUserEmail = async (request, response) => { + const username = request.query.username; + + if (!username) { + return response.status(400).json({ + error: 'El nombre de usuario es obligatorio' + }); + } + + try { + // Busca el usuario en la base de datos + const user = await Usuario.findOne({ + username: username + }); + + if (user) { + return response.status(200).json({ + correoElectronico: user.correoElectronico + }); + } else { + return response.status(404).json({ + error: 'Usuario no encontrado' + }); + } + } catch (error) { + console.error('Error al obtener el correo electrónico:', error); + return response.status(500).json({ + error: 'Error interno del servidor' + }); + } +} diff --git a/modules/session/routes/getUserEmail.routes.js b/modules/session/routes/getUserEmail.routes.js new file mode 100644 index 0000000..1ae64fd --- /dev/null +++ b/modules/session/routes/getUserEmail.routes.js @@ -0,0 +1,8 @@ +const express = require('express'); +const router = express.Router(); + +const getUserEmailController = require('../controllers/getUserEmail.controller'); + +router.get('/', getUserEmailController.getUserEmail); + +module.exports = router; \ No newline at end of file diff --git a/modules/session/routes/registrarUsuario.routes.js b/modules/session/routes/registrarUsuario.routes.js index 4d1d743..f693f50 100644 --- a/modules/session/routes/registrarUsuario.routes.js +++ b/modules/session/routes/registrarUsuario.routes.js @@ -1,8 +1,10 @@ const express = require('express'); const router = express.Router(); +const verifyToken = require('../../../util/verifyUserToken'); + const registrarUsuarioController = require('../controllers/registrarUsuario.controller'); -router.post('/', registrarUsuarioController.registrarUsuario); +router.post('/', verifyToken, registrarUsuarioController.registrarUsuario); module.exports = router; \ No newline at end of file diff --git a/modules/session/routes/sessionIndex.routes.js b/modules/session/routes/sessionIndex.routes.js index 842aa0c..69cd587 100644 --- a/modules/session/routes/sessionIndex.routes.js +++ b/modules/session/routes/sessionIndex.routes.js @@ -3,8 +3,10 @@ const router = express.Router(); const registrarUsuarioRoute = require('./registrarUsuario.routes'); const rolPrivilegioRoute = require('./rolPrivilegio.routes'); +const getUserEmail = require('./getUserEmail.routes'); router.use('/registrarUsuario', registrarUsuarioRoute); router.use('/rolPrivilegio', rolPrivilegioRoute); +router.use('/getUserEmail', getUserEmail); module.exports = router; \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index bce72a0..c806f05 100644 --- a/package-lock.json +++ b/package-lock.json @@ -790,9 +790,9 @@ } }, "node_modules/body-parser": { - "version": "1.20.2", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.2.tgz", - "integrity": "sha512-ml9pReCu3M61kGlqoTm2umSXTlRTuGTx0bfYj+uIUKKYycG5NtSbeetV3faSU6R7ajOPw0g/J1PvK4qNy7s5bA==", + "version": "1.20.3", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.3.tgz", + "integrity": "sha512-7rAxByjUMqQ3/bHJy7D6OGXvx/MMc4IqBn/X0fcM1QUcAItpZrBEYhWGem+tzXH90c+G01ypMcYJBO9Y30203g==", "license": "MIT", "dependencies": { "bytes": "3.1.2", @@ -803,7 +803,7 @@ "http-errors": "2.0.0", "iconv-lite": "0.4.24", "on-finished": "2.4.1", - "qs": "6.11.0", + "qs": "6.13.0", "raw-body": "2.5.2", "type-is": "~1.6.18", "unpipe": "1.0.0" @@ -813,6 +813,21 @@ "npm": "1.2.8000 || >= 1.4.16" } }, + "node_modules/body-parser/node_modules/qs": { + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.13.0.tgz", + "integrity": "sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg==", + "license": "BSD-3-Clause", + "dependencies": { + "side-channel": "^1.0.6" + }, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/brace-expansion": { "version": "1.1.11", "license": "MIT", @@ -1390,37 +1405,37 @@ } }, "node_modules/express": { - "version": "4.19.2", - "resolved": "https://registry.npmjs.org/express/-/express-4.19.2.tgz", - "integrity": "sha512-5T6nhjsT+EOMzuck8JjBHARTHfMht0POzlA60WV2pMD3gyXw2LZnZ+ueGdNxG+0calOJcWKbpFcuzLZ91YWq9Q==", + "version": "4.20.0", + "resolved": "https://registry.npmjs.org/express/-/express-4.20.0.tgz", + "integrity": "sha512-pLdae7I6QqShF5PnNTCVn4hI91Dx0Grkn2+IAsMTgMIKuQVte2dN9PeGSSAME2FR8anOhVA62QDIUaWVfEXVLw==", "license": "MIT", "dependencies": { "accepts": "~1.3.8", "array-flatten": "1.1.1", - "body-parser": "1.20.2", + "body-parser": "1.20.3", "content-disposition": "0.5.4", "content-type": "~1.0.4", "cookie": "0.6.0", "cookie-signature": "1.0.6", "debug": "2.6.9", "depd": "2.0.0", - "encodeurl": "~1.0.2", + "encodeurl": "~2.0.0", "escape-html": "~1.0.3", "etag": "~1.8.1", "finalhandler": "1.2.0", "fresh": "0.5.2", "http-errors": "2.0.0", - "merge-descriptors": "1.0.1", + "merge-descriptors": "1.0.3", "methods": "~1.1.2", "on-finished": "2.4.1", "parseurl": "~1.3.3", - "path-to-regexp": "0.1.7", + "path-to-regexp": "0.1.10", "proxy-addr": "~2.0.7", "qs": "6.11.0", "range-parser": "~1.2.1", "safe-buffer": "5.2.1", - "send": "0.18.0", - "serve-static": "1.15.0", + "send": "0.19.0", + "serve-static": "1.16.0", "setprototypeof": "1.2.0", "statuses": "2.0.1", "type-is": "~1.6.18", @@ -1431,6 +1446,15 @@ "node": ">= 0.10.0" } }, + "node_modules/express/node_modules/encodeurl": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz", + "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, "node_modules/extend": { "version": "3.0.2", "license": "MIT", @@ -2449,10 +2473,13 @@ "license": "MIT" }, "node_modules/merge-descriptors": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", - "integrity": "sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w==", - "license": "MIT" + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.3.tgz", + "integrity": "sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } }, "node_modules/methods": { "version": "1.1.2", @@ -2872,9 +2899,9 @@ } }, "node_modules/path-to-regexp": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", - "integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==", + "version": "0.1.10", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.10.tgz", + "integrity": "sha512-7lf7qcQidTku0Gu3YDPc8DJ1q7OOucfa/BSsIwjuh56VU7katFvuM8hULfkwB3Fns/rsVF7PwPKVw1sl5KQS9w==", "license": "MIT" }, "node_modules/picomatch": { @@ -3137,9 +3164,9 @@ } }, "node_modules/send": { - "version": "0.18.0", - "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz", - "integrity": "sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==", + "version": "0.19.0", + "resolved": "https://registry.npmjs.org/send/-/send-0.19.0.tgz", + "integrity": "sha512-dW41u5VfLXu8SJh5bwRmyYUbAoSB3c9uQh6L8h/KtsFREPWpbX1lrljJo186Jc4nmci/sGUZ9a0a0J2zgfq2hw==", "license": "MIT", "dependencies": { "debug": "2.6.9", @@ -3167,9 +3194,9 @@ "license": "MIT" }, "node_modules/serve-static": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.15.0.tgz", - "integrity": "sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==", + "version": "1.16.0", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.16.0.tgz", + "integrity": "sha512-pDLK8zwl2eKaYrs8mrPZBJua4hMplRWJ1tIFksVC3FtBEBnl8dxgeHtsaMS8DhS9i4fLObaon6ABoc4/hQGdPA==", "license": "MIT", "dependencies": { "encodeurl": "~1.0.2", @@ -3181,6 +3208,36 @@ "node": ">= 0.8.0" } }, + "node_modules/serve-static/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "license": "MIT" + }, + "node_modules/serve-static/node_modules/send": { + "version": "0.18.0", + "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz", + "integrity": "sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==", + "license": "MIT", + "dependencies": { + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "fresh": "0.5.2", + "http-errors": "2.0.0", + "mime": "1.6.0", + "ms": "2.1.3", + "on-finished": "2.4.1", + "range-parser": "~1.2.1", + "statuses": "2.0.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, "node_modules/set-function-length": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", From 6da733f32b0d1aeaa78b9b8f9f261ec5aa96f0d7 Mon Sep 17 00:00:00 2001 From: AndreaMedinaRico Date: Tue, 17 Sep 2024 01:20:17 -0600 Subject: [PATCH 031/231] =?UTF-8?q?refac(actividades):=20reducir=20registr?= =?UTF-8?q?arActividad=20a=20una=20funci=C3=B3n=20en=20modelo=20y=20contro?= =?UTF-8?q?lador?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- models/actividades/registraActividad.model.js | 64 +++---------------- .../registrarActividad.controller.js | 58 ++--------------- 2 files changed, 14 insertions(+), 108 deletions(-) diff --git a/models/actividades/registraActividad.model.js b/models/actividades/registraActividad.model.js index b01d111..7b6b13b 100644 --- a/models/actividades/registraActividad.model.js +++ b/models/actividades/registraActividad.model.js @@ -2,66 +2,20 @@ const Rodada = require('./rodada.model'); const Taller = require('./taller.model'); const Evento = require('./evento.model'); -async function registrarRodada(titulo, fechaHora, personasInscritas, ubicacion, descripcion, estado, duracion, imagen, ruta) { - try { - const rodada = await Rodada.create({ - titulo: titulo, - fechaHora: fechaHora, - personasInscritas: personasInscritas, - ubicacion: ubicacion, - descripcion: descripcion, - estado: estado, - duracion: duracion, - imagen: imagen, - ruta: ruta - }); - await rodada.save(); - - } catch (error) { - throw(error); - } +async function encontrarTipo(tipo) { + if (tipo === 'rodada') return Rodada; + if (tipo === 'taller') return Taller; + if (tipo === 'evento') return Evento; } -async function registrarTaller(titulo, fechaHora, personasInscritas, ubicacion, descripcion, estado, duracion, imagen) { +async function registrarActividad(tipo, data) { try { - const taller = await Taller.create({ - titulo: titulo, - fechaHora: fechaHora, - personasInscritas: personasInscritas, - ubicacion: ubicacion, - descripcion: descripcion, - estado: estado, - duracion: duracion, - imagen: imagen - }); - await taller.save(); - - } catch (error) { - throw(error); - } -} - -async function registrarEvento(titulo, fechaHora, personasInscritas, ubicacion, descripcion, estado, duracion, imagen) { - try { - const evento = await Evento.create({ - titulo: titulo, - fechaHora: fechaHora, - personasInscritas: personasInscritas, - ubicacion: ubicacion, - descripcion: descripcion, - estado: estado, - duracion: duracion, - imagen: imagen - }); - await evento.save(); - + const Modelo = await encontrarTipo(tipo); + const actividad = await Modelo.create(data); + await actividad.save(); } catch (error) { throw(error); } } -module.exports = { - registrarRodada, - registrarTaller, - registrarEvento -} \ No newline at end of file +module.exports = { registrarActividad }; \ No newline at end of file diff --git a/modules/actividades/controllers/registrarActividad.controller.js b/modules/actividades/controllers/registrarActividad.controller.js index cd7570d..64f2b70 100644 --- a/modules/actividades/controllers/registrarActividad.controller.js +++ b/modules/actividades/controllers/registrarActividad.controller.js @@ -1,24 +1,15 @@ -const {Rodada, Taller, Evento} = require('../../../models/actividades/registraActividad.model.js'); +const { registrarActividad } = require('../../../models/actividades/registraActividad.model.js'); exports.getRegistrarActividad = (request, response) => { response.json('Actividad: Esta es la plantilla que deben usar.'); }; -exports.postRegistrarRodada = (request, response) => { - const { - titulo, - fechaHora, - personasInscritas, - ubicacion, - descripcion, - estado, - duracion, - imagen, - ruta - } = request.body; +exports.postRegistrarActividad = (request, response) => { + const data = request.body; + const tipo = request.params.tipo; try { - Rodada.registrarRodada(titulo, fechaHora, personasInscritas, ubicacion, descripcion, estado, duracion, imagen, ruta); + registrarActividad(tipo, data); res.status(201).json({ message: 'Rodada creada exitosamente.', error }); } catch (error) { res.status(500).json({ message: 'Error al crear la rodada', error }); @@ -26,42 +17,3 @@ exports.postRegistrarRodada = (request, response) => { } -exports.postRegistrarTaller = (request, response) => { - const { - titulo, - fechaHora, - personasInscritas, - ubicacion, - descripcion, - estado, - duracion, - imagen - } = request.body; - - try { - Taller.registrarTaller(titulo, fechaHora, personasInscritas, ubicacion, descripcion, estado, duracion, imagen); - res.status(201).json({ message: 'Taller creado exitosamente.', error }); - } catch (error) { - res.status(500).json({ message: 'Error al crear el taller', error }); - } -} - -exports.postRegistrarEvento = (request, response) => { - const { - titulo, - fechaHora, - personasInscritas, - ubicacion, - descripcion, - estado, - duracion, - imagen - } = request.body; - - try { - Evento.registrarEvento(titulo, fechaHora, personasInscritas, ubicacion, descripcion, estado, duracion, imagen); - res.status(201).json({ message: 'Evento creado exitosamente.', error }); - } catch (error) { - res.status(500).json({ message: 'Error al crear el evento', error }); - } -} \ No newline at end of file From ca2e249bd93b3404f9b7b16e90c58104e281bee1 Mon Sep 17 00:00:00 2001 From: DanielQueijeiro Date: Tue, 17 Sep 2024 08:32:31 -0600 Subject: [PATCH 032/231] Modificar GET para obtener todos los anuncios y agregar autoincremento a IDAnuncio --- models/otros/anuncio.model.js | 16 ++++++++----- .../consultarAnuncio.controller.js | 4 ++-- .../routes/consultarAnuncio.routes.js | 2 +- package-lock.json | 23 +++++++++++++++++++ package.json | 1 + 5 files changed, 37 insertions(+), 9 deletions(-) diff --git a/models/otros/anuncio.model.js b/models/otros/anuncio.model.js index a886375..049bfd8 100644 --- a/models/otros/anuncio.model.js +++ b/models/otros/anuncio.model.js @@ -1,4 +1,5 @@ const mongoose = require("mongoose"); +const AutoIncrement = require('mongoose-sequence')(mongoose); const announcementSchema = new mongoose.Schema({ IDAnuncio: { @@ -6,8 +7,9 @@ const announcementSchema = new mongoose.Schema({ unique: true }, IDUsuario: { - type: mongoose.SchemaTypes.ObjectId, - ref: 'Usuario', + type: Number, + //type: mongoose.SchemaTypes.ObjectId, + //ref: 'Usuario', required: true, }, contenido: { @@ -29,6 +31,8 @@ const announcementSchema = new mongoose.Schema({ } }); +announcementSchema.plugin(AutoIncrement, {inc_field: 'IDAnuncio'}); // Autoincrementa el IDAnuncio + const Anuncio = mongoose.model('Anuncio', announcementSchema); async function postAnnouncement(IDUsuario, contenido, imagen){ @@ -44,10 +48,10 @@ async function postAnnouncement(IDUsuario, contenido, imagen){ } } -async function getAnnouncement(IDAnuncio){ +async function getAnnouncements(IDAnuncio){ try { - const announcement = await Anuncio.findById(IDAnuncio); - return announcement; + const announcements = await Anuncio.find(); + return announcements; } catch (error) { throw error; } @@ -64,6 +68,6 @@ async function deleteAnnouncement(IDAnuncio){ module.exports = { Anuncio, postAnnouncement, - getAnnouncement, + getAnnouncements, deleteAnnouncement }; \ No newline at end of file diff --git a/modules/anuncios/controllers/consultarAnuncio.controller.js b/modules/anuncios/controllers/consultarAnuncio.controller.js index 68cd5e1..e81f411 100644 --- a/modules/anuncios/controllers/consultarAnuncio.controller.js +++ b/modules/anuncios/controllers/consultarAnuncio.controller.js @@ -1,10 +1,10 @@ const Announcement = require('../../../models/otros/anuncio.model'); -exports.getAnnouncement = async (request, response) => { +exports.getAnnouncements = async (request, response) => { const IDAnuncio = request.params.IDAnuncio try { - const anuncio = await Announcement.getAnnouncement(IDAnuncio); + const anuncio = await Announcement.getAnnouncements(); return response.status(201).json(anuncio); } catch (error) { return response.status(404).json({ message: 'Anuncio no encontrado', error: error.message }); diff --git a/modules/anuncios/routes/consultarAnuncio.routes.js b/modules/anuncios/routes/consultarAnuncio.routes.js index 8498512..8ec12ed 100644 --- a/modules/anuncios/routes/consultarAnuncio.routes.js +++ b/modules/anuncios/routes/consultarAnuncio.routes.js @@ -5,6 +5,6 @@ const router = express.Router(); const consultarAnuncioController = require('../controllers/consultarAnuncio.controller'); // Definir la ruta para crear una actividad -router.get('/:IDAnuncio', consultarAnuncioController.getAnnouncement); +router.get('/', consultarAnuncioController.getAnnouncements); module.exports = router; \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 8f0e5c4..d2a98b9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,6 +12,7 @@ "compression": "^1.7.4", "express": "^4.19.2", "mongoose": "^8.6.0", + "mongoose-sequence": "^6.0.1", "nodemon": "^3.1.4" }, "devDependencies": { @@ -376,6 +377,11 @@ "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==", "license": "MIT" }, + "node_modules/async": { + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/async/-/async-3.2.6.tgz", + "integrity": "sha512-htCUDlxyyCLMgaM3xXg0C0LW2xqfuQ6p05pCEIsXuyQ+a1koYKTuBMzRNwmybfLgvJDMd0r1LTn4+E0Ti6C2AA==" + }, "node_modules/balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", @@ -1495,6 +1501,11 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" + }, "node_modules/lodash.merge": { "version": "4.6.2", "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", @@ -1655,6 +1666,18 @@ "url": "https://opencollective.com/mongoose" } }, + "node_modules/mongoose-sequence": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/mongoose-sequence/-/mongoose-sequence-6.0.1.tgz", + "integrity": "sha512-uXnLCW9pu2V49Xw8BmdXdeRugd2mv+ntu3nT2Bbm33pNRmmvHE2GKA+8BASKoQt960McLX4VL78wkb492f6MoQ==", + "dependencies": { + "async": "^3.2.5", + "lodash": "^4.17.21" + }, + "peerDependencies": { + "mongoose": ">=5" + } + }, "node_modules/mongoose/node_modules/ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", diff --git a/package.json b/package.json index 200e50b..b9b514a 100644 --- a/package.json +++ b/package.json @@ -28,6 +28,7 @@ "compression": "^1.7.4", "express": "^4.19.2", "mongoose": "^8.6.0", + "mongoose-sequence": "^6.0.1", "nodemon": "^3.1.4" }, "devDependencies": { From d7a0da1e2098035b8e22c5a96beb66eedac17846 Mon Sep 17 00:00:00 2001 From: SebastianCo1126 Date: Tue, 17 Sep 2024 09:01:18 -0600 Subject: [PATCH 033/231] feat(actividades): Cambios en modificar actividad --- models/actividades/modificaActividad.model.js | 4 +++- .../controllers/modificarActividad.controller.js | 12 ++++++------ .../actividades/routes/modificarActividad.routes.js | 2 +- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/models/actividades/modificaActividad.model.js b/models/actividades/modificaActividad.model.js index b48549a..e0d623e 100644 --- a/models/actividades/modificaActividad.model.js +++ b/models/actividades/modificaActividad.model.js @@ -1,4 +1,6 @@ -const { Rodada, Taller, Evento } = require('../../../models/actividades/registraActividad.model.js'); +const Rodada = require('./rodada.model'); +const Taller = require('./taller.model'); +const Evento = require('./evento.model'); async function encontrarEvento(id) { diff --git a/modules/actividades/controllers/modificarActividad.controller.js b/modules/actividades/controllers/modificarActividad.controller.js index fcc1d31..de6c4a3 100644 --- a/modules/actividades/controllers/modificarActividad.controller.js +++ b/modules/actividades/controllers/modificarActividad.controller.js @@ -1,13 +1,13 @@ -const { modificarEvento } = requestuire('../../../models/actividades/registraActividad.model.js'); +const { modificarEvento } = require('../../../models/actividades/registraActividad.model.js'); -exports.postModificarActividad = async (req, res) => { - const { id } = req.params; - const data = req.body; +exports.postModificarActividad = async (request, response) => { + const { id } = request.params; + const data = request.body; try { const updatedActivity = await modificarEvento(id, data); - res.status(201).json({ message: 'Actividad modificada exitosamente.', updatedActivity }); + response.status(201).json({ message: 'Actividad modificada exitosamente.', updatedActivity }); } catch (error) { - res.status(500).json({ message: 'Error al modificar la actividad', error }); + response.status(500).json({ message: 'Error al modificar la actividad', error }); } }; diff --git a/modules/actividades/routes/modificarActividad.routes.js b/modules/actividades/routes/modificarActividad.routes.js index 56b7e7d..93cd0d4 100644 --- a/modules/actividades/routes/modificarActividad.routes.js +++ b/modules/actividades/routes/modificarActividad.routes.js @@ -5,6 +5,6 @@ const router = express.Router(); const modificarActividadController = require('../controllers/modificarActividad.controller'); // Definir la ruta para modificar una actividad -router.post('/', modificarActividadController.postModificarActividadActividad); +router.post('/', modificarActividadController.postModificarActividad); module.exports = router; \ No newline at end of file From 599958b01ed6e53bac07c3f5ecf7e0505d662dd8 Mon Sep 17 00:00:00 2001 From: DanielQueijeiro Date: Tue, 17 Sep 2024 11:41:36 -0600 Subject: [PATCH 034/231] Agregar metodo PUT para modificar anuncios --- models/otros/anuncio.model.js | 33 ++++++++++++++----- .../consultarAnuncio.controller.js | 4 ++- .../modificarAnuncio.controller.js | 15 +++++++++ .../registrarAnuncio.controller.js | 5 +-- .../anuncios/routes/anunciosIndex.routes.js | 2 ++ .../routes/modificarAnuncio.routes.js | 10 ++++++ package-lock.json | 1 - package.json | 1 - 8 files changed, 58 insertions(+), 13 deletions(-) create mode 100644 modules/anuncios/controllers/modificarAnuncio.controller.js create mode 100644 modules/anuncios/routes/modificarAnuncio.routes.js diff --git a/models/otros/anuncio.model.js b/models/otros/anuncio.model.js index 049bfd8..896f5ba 100644 --- a/models/otros/anuncio.model.js +++ b/models/otros/anuncio.model.js @@ -1,17 +1,16 @@ const mongoose = require("mongoose"); -const AutoIncrement = require('mongoose-sequence')(mongoose); const announcementSchema = new mongoose.Schema({ - IDAnuncio: { - type: Number, - unique: true - }, IDUsuario: { type: Number, //type: mongoose.SchemaTypes.ObjectId, //ref: 'Usuario', required: true, }, + titulo:{ + type: String, + required: true + }, contenido: { type: String, required: true @@ -31,14 +30,13 @@ const announcementSchema = new mongoose.Schema({ } }); -announcementSchema.plugin(AutoIncrement, {inc_field: 'IDAnuncio'}); // Autoincrementa el IDAnuncio - const Anuncio = mongoose.model('Anuncio', announcementSchema); -async function postAnnouncement(IDUsuario, contenido, imagen){ +async function postAnnouncement(IDUsuario, titulo, contenido, imagen){ try { const announcement = await Anuncio.create({ IDUsuario: IDUsuario, + titulo: titulo, contenido: contenido, imagen: imagen }); @@ -57,6 +55,24 @@ async function getAnnouncements(IDAnuncio){ } } +async function putAnnouncement(IDAnuncio, IDUsuario, titulo, contenido, imagen){ + try { + const announcement = await Anuncio.findById(IDAnuncio); + if (announcement) { + announcement.IDUsuario = IDUsuario; + announcement.titulo = titulo; + announcement.contenido = contenido; + announcement.imagen = imagen; + await announcement.save(); + return announcement; + } else { + throw new Error('Anuncio no encontrado'); + } + } catch (error) { + throw error; + } +} + async function deleteAnnouncement(IDAnuncio){ try { await Anuncio.findByIdAndDelete(IDAnuncio); @@ -69,5 +85,6 @@ module.exports = { Anuncio, postAnnouncement, getAnnouncements, + putAnnouncement, deleteAnnouncement }; \ No newline at end of file diff --git a/modules/anuncios/controllers/consultarAnuncio.controller.js b/modules/anuncios/controllers/consultarAnuncio.controller.js index e81f411..0682c7e 100644 --- a/modules/anuncios/controllers/consultarAnuncio.controller.js +++ b/modules/anuncios/controllers/consultarAnuncio.controller.js @@ -2,9 +2,11 @@ const Announcement = require('../../../models/otros/anuncio.model'); exports.getAnnouncements = async (request, response) => { - const IDAnuncio = request.params.IDAnuncio try { const anuncio = await Announcement.getAnnouncements(); + if(anuncio.length === 0){ + return response.status(204).json({ message: 'No hay anuncios' }); + } return response.status(201).json(anuncio); } catch (error) { return response.status(404).json({ message: 'Anuncio no encontrado', error: error.message }); diff --git a/modules/anuncios/controllers/modificarAnuncio.controller.js b/modules/anuncios/controllers/modificarAnuncio.controller.js new file mode 100644 index 0000000..813cb9f --- /dev/null +++ b/modules/anuncios/controllers/modificarAnuncio.controller.js @@ -0,0 +1,15 @@ +const Announcement = require('../../../models/otros/anuncio.model'); + +exports.putAnnouncement = async (request, response) => { + const IDAnuncio = request.params.IDAnuncio + const idUsuario = request.body.IDUsuario; + const titulo = request.body.titulo; + const contenido = request.body.contenido; + const imagen = request.body.imagen; + try { + const anuncio = await Announcement.putAnnouncement(IDAnuncio, idUsuario, titulo, contenido, imagen); + return response.status(201).json(anuncio); + } catch (error) { + return response.status(404).json({ message: 'Anuncio no encontrado', error: error.message }); + } +}; \ No newline at end of file diff --git a/modules/anuncios/controllers/registrarAnuncio.controller.js b/modules/anuncios/controllers/registrarAnuncio.controller.js index 8e6703e..edf6712 100644 --- a/modules/anuncios/controllers/registrarAnuncio.controller.js +++ b/modules/anuncios/controllers/registrarAnuncio.controller.js @@ -2,11 +2,12 @@ const Announcement = require('../../../models/otros/anuncio.model'); exports.postAnnouncement = async (request, response) => { - const idUsuario = request.body.IDUsuario + const idUsuario = request.body.IDUsuario; + const titulo = request.body.titulo; const contenido = request.body.contenido; const imagen = request.body.imagen; try { - await Announcement.postAnnouncement(idUsuario, contenido, imagen); + await Announcement.postAnnouncement(idUsuario, titulo, contenido, imagen); return response.status(201).json({ message: 'Anuncio creado correctamente' }); } catch (error) { return response.status(500).json({ message: 'Error al crear el anuncio', error: error.message }); diff --git a/modules/anuncios/routes/anunciosIndex.routes.js b/modules/anuncios/routes/anunciosIndex.routes.js index 3488bb2..7e8c32d 100644 --- a/modules/anuncios/routes/anunciosIndex.routes.js +++ b/modules/anuncios/routes/anunciosIndex.routes.js @@ -3,11 +3,13 @@ const router = express.Router(); const registrarAnuncioRoute = require('./registrarAnuncio.routes'); const consultarAnuncioRoute = require('./consultarAnuncio.routes'); +const modificarAnuncioRoute = require('./modificarAnuncio.routes'); const eliminarAnuncioRoute = require('./eliminarAnuncio.routes'); // Importar y usar las rutas en el enrutador principal del módulo router.use('/registrar', registrarAnuncioRoute); router.use('/consultar', consultarAnuncioRoute); +router.use('/modificar', modificarAnuncioRoute); router.use('/eliminar', eliminarAnuncioRoute); module.exports = router; \ No newline at end of file diff --git a/modules/anuncios/routes/modificarAnuncio.routes.js b/modules/anuncios/routes/modificarAnuncio.routes.js new file mode 100644 index 0000000..2ed7743 --- /dev/null +++ b/modules/anuncios/routes/modificarAnuncio.routes.js @@ -0,0 +1,10 @@ +const express = require('express'); +const router = express.Router(); + +// Importar el controlador que maneja la creación de actividades +const modificarAnuncioController = require('../controllers/modificarAnuncio.controller'); + +// Definir la ruta para crear una actividad +router.put('/:IDAnuncio', modificarAnuncioController.putAnnouncement); + +module.exports = router; \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index d2a98b9..61477fc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,7 +12,6 @@ "compression": "^1.7.4", "express": "^4.19.2", "mongoose": "^8.6.0", - "mongoose-sequence": "^6.0.1", "nodemon": "^3.1.4" }, "devDependencies": { diff --git a/package.json b/package.json index b9b514a..200e50b 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,6 @@ "compression": "^1.7.4", "express": "^4.19.2", "mongoose": "^8.6.0", - "mongoose-sequence": "^6.0.1", "nodemon": "^3.1.4" }, "devDependencies": { From 015284c0ee740e304b8ce521321fca53e51f6a80 Mon Sep 17 00:00:00 2001 From: Jesus0204 Date: Tue, 17 Sep 2024 18:36:59 -0600 Subject: [PATCH 035/231] feat: endpoints necesarios para firebase --- models/perfil/usuario.model.js | 5 +- .../controllers/perfilCompleto.controller.js | 25 ++++++ .../registrarUsuario.controller.js | 81 ++++++++++--------- .../session/routes/perfilCompleto.routes.js | 10 +++ modules/session/routes/sessionIndex.routes.js | 6 +- 5 files changed, 85 insertions(+), 42 deletions(-) create mode 100644 modules/session/controllers/perfilCompleto.controller.js create mode 100644 modules/session/routes/perfilCompleto.routes.js diff --git a/models/perfil/usuario.model.js b/models/perfil/usuario.model.js index be4261e..e0a35ec 100644 --- a/models/perfil/usuario.model.js +++ b/models/perfil/usuario.model.js @@ -10,8 +10,9 @@ const usuarioSchema = new mongoose.Schema({ type: String, required: true, }, - edad: { - type: Number, + fechaNacimiento: { + type: Date, + immutable: true, required: true, }, tipoSangre: { diff --git a/modules/session/controllers/perfilCompleto.controller.js b/modules/session/controllers/perfilCompleto.controller.js new file mode 100644 index 0000000..d1b0485 --- /dev/null +++ b/modules/session/controllers/perfilCompleto.controller.js @@ -0,0 +1,25 @@ +const Usuario = require('../../../models/perfil/usuario.model'); + +exports.perfilCompleto = async (request, response) => { + + try { + const usuario = await Usuario.findOne({ + firebaseUID: request.userUID.uid + }); + + if (!usuario) { + return response.status(404).json({ + perfilRegistrado: false + }); + } + + return response.status(200).json({ + perfilRegistrado: true + }); + + } catch (error) { + return response.status(500).json({ + error: error + }); + } +} diff --git a/modules/session/controllers/registrarUsuario.controller.js b/modules/session/controllers/registrarUsuario.controller.js index fcddd64..25dc826 100644 --- a/modules/session/controllers/registrarUsuario.controller.js +++ b/modules/session/controllers/registrarUsuario.controller.js @@ -4,69 +4,74 @@ const Rol = require("../../../models/perfil/rol.model"); const PoseeRol = require("../../../models/perfil/poseeRol.model"); // Modelo para la relación entre usuario y rol exports.registrarUsuario = async (request, response) => { - try { - // Sacar los datos body - const { - username, - nombre, - edad, - tipoSangre, - correoElectronico, - numeroEmergencia, - firebaseUID, - } = request.body; + try { + // Sacar los datos body + const { + username, + nombre, + fechaNacimiento, + tipoSangre, + correoElectronico, + numeroEmergencia, + firebaseUID, + } = request.body; + + // Verificar si el usuario ya está registrado en MongoDB + let existingUser = await Usuario.findOne({ + firebaseUID + }); - // Verificar si el usuario ya está registrado en MongoDB - let existingUser = await Usuario.findOne({ firebaseUID }); if (existingUser) { - // Si el usuario ya existe, responder con éxito - return response.status(200).json({ - message: "Usuario ya registrado", - user: existingUser, - }); + // Si el usuario ya existe, responder con éxito + return response.status(200).json({ + message: "Usuario ya registrado", + user: existingUser, + }); } // Buscar el rol Usuario const rolUsuario = await Rol.findOne({ - nombre: "Usuario", + nombre: "Usuario", }); + if (!rolUsuario) { - return response.status(404).json({ + return response.status(404).json({ message: "Rol Usuario no encontrado", - }); + }); } // Crear el usuario en MongoDB, por ahora sin firebaseUID const newUser = new Usuario({ - username, - nombre, - edad, - tipoSangre, - correoElectronico, - numeroEmergencia, - firebaseUID, + username, + nombre, + fechaNacimiento, + tipoSangre, + correoElectronico, + numeroEmergencia, + firebaseUID, }); await newUser.save(); // Poblar la tabla Posee con la relación entre el usuario y el rol const poseeRol = new PoseeRol({ - // ObjectId del nuevo usuario - IDUsuario: newUser._id, - // ObjectId del rol "Usuario" - IDRol: rolUsuario._id, + // ObjectId del nuevo usuario + IDUsuario: newUser._id, + // ObjectId del rol "Usuario" + IDRol: rolUsuario._id, }); // Guardar la relación en la tabla Posee await poseeRol.save(); response.status(201).json({ - message: "User registrado con éxito", - user: newUser, + message: "User registrado con éxito", + user: newUser, }); - } catch (error) { - response.status(400).json({ - error: error.message, + + } catch (error) { + response.status(400).json({ + error: error.message, }); - } +} }; diff --git a/modules/session/routes/perfilCompleto.routes.js b/modules/session/routes/perfilCompleto.routes.js new file mode 100644 index 0000000..7ec79e5 --- /dev/null +++ b/modules/session/routes/perfilCompleto.routes.js @@ -0,0 +1,10 @@ +const express = require('express'); +const router = express.Router(); + +const verifyToken = require('../../../util/verifyUserToken'); + +const perfilCompletoController = require('../controllers/perfilCompleto.controller'); + +router.get('/', verifyToken, perfilCompletoController.perfilCompleto); + +module.exports = router; \ No newline at end of file diff --git a/modules/session/routes/sessionIndex.routes.js b/modules/session/routes/sessionIndex.routes.js index 69cd587..c0874ca 100644 --- a/modules/session/routes/sessionIndex.routes.js +++ b/modules/session/routes/sessionIndex.routes.js @@ -3,10 +3,12 @@ const router = express.Router(); const registrarUsuarioRoute = require('./registrarUsuario.routes'); const rolPrivilegioRoute = require('./rolPrivilegio.routes'); -const getUserEmail = require('./getUserEmail.routes'); +const getUserEmailRoute = require('./getUserEmail.routes'); +const perfilCompletoRoute = require('./perfilCompleto.routes'); router.use('/registrarUsuario', registrarUsuarioRoute); router.use('/rolPrivilegio', rolPrivilegioRoute); -router.use('/getUserEmail', getUserEmail); +router.use('/getUserEmail', getUserEmailRoute); +router.use('/perfilCompleto', perfilCompletoRoute); module.exports = router; \ No newline at end of file From c801d7a9a6507597c027f00578136e9be3a75caf Mon Sep 17 00:00:00 2001 From: MariaJoseGaytan Date: Tue, 17 Sep 2024 19:49:17 -0600 Subject: [PATCH 036/231] Cambiar response de consultarAnuncio --- .../consultarAnuncio.controller.js | 2 +- package-lock.json | 22 ------------------- 2 files changed, 1 insertion(+), 23 deletions(-) diff --git a/modules/anuncios/controllers/consultarAnuncio.controller.js b/modules/anuncios/controllers/consultarAnuncio.controller.js index 0682c7e..ede0256 100644 --- a/modules/anuncios/controllers/consultarAnuncio.controller.js +++ b/modules/anuncios/controllers/consultarAnuncio.controller.js @@ -7,7 +7,7 @@ exports.getAnnouncements = async (request, response) => { if(anuncio.length === 0){ return response.status(204).json({ message: 'No hay anuncios' }); } - return response.status(201).json(anuncio); + return response.status(200).json(anuncio); } catch (error) { return response.status(404).json({ message: 'Anuncio no encontrado', error: error.message }); } diff --git a/package-lock.json b/package-lock.json index 61477fc..8f0e5c4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -376,11 +376,6 @@ "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==", "license": "MIT" }, - "node_modules/async": { - "version": "3.2.6", - "resolved": "https://registry.npmjs.org/async/-/async-3.2.6.tgz", - "integrity": "sha512-htCUDlxyyCLMgaM3xXg0C0LW2xqfuQ6p05pCEIsXuyQ+a1koYKTuBMzRNwmybfLgvJDMd0r1LTn4+E0Ti6C2AA==" - }, "node_modules/balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", @@ -1500,11 +1495,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/lodash": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" - }, "node_modules/lodash.merge": { "version": "4.6.2", "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", @@ -1665,18 +1655,6 @@ "url": "https://opencollective.com/mongoose" } }, - "node_modules/mongoose-sequence": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/mongoose-sequence/-/mongoose-sequence-6.0.1.tgz", - "integrity": "sha512-uXnLCW9pu2V49Xw8BmdXdeRugd2mv+ntu3nT2Bbm33pNRmmvHE2GKA+8BASKoQt960McLX4VL78wkb492f6MoQ==", - "dependencies": { - "async": "^3.2.5", - "lodash": "^4.17.21" - }, - "peerDependencies": { - "mongoose": ">=5" - } - }, "node_modules/mongoose/node_modules/ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", From 029dea37833bb9c17a778afe4df6c16f2926e114 Mon Sep 17 00:00:00 2001 From: Juan Pablo Date: Tue, 17 Sep 2024 21:38:07 -0600 Subject: [PATCH 037/231] =?UTF-8?q?feat:=20Consulta=20y=20modificaci=C3=B3?= =?UTF-8?q?n=20de=20pregunta=20frecuente?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- models/otros/preguntasFrecuentes.model.js | 2 +- ...rPreguntaFrecuenteIndividual.controller.js | 38 +++++++++++++++++++ ...ultarPreguntaFrecuenteIndividual.routes.js | 8 ++++ .../routes/preguntasIndex.routes.js | 2 + 4 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 modules/preguntasFrecuentes/controllers/consultarPreguntaFrecuenteIndividual.controller.js create mode 100644 modules/preguntasFrecuentes/routes/consultarPreguntaFrecuenteIndividual.routes.js diff --git a/models/otros/preguntasFrecuentes.model.js b/models/otros/preguntasFrecuentes.model.js index e536854..c34a1d7 100644 --- a/models/otros/preguntasFrecuentes.model.js +++ b/models/otros/preguntasFrecuentes.model.js @@ -1,7 +1,7 @@ const mongoose = require('mongoose'); const preguntasFrecuentesSchema = new mongoose.Schema({ - IDPregunta: { + IdPregunta: { type: String, required: true, unique: true diff --git a/modules/preguntasFrecuentes/controllers/consultarPreguntaFrecuenteIndividual.controller.js b/modules/preguntasFrecuentes/controllers/consultarPreguntaFrecuenteIndividual.controller.js new file mode 100644 index 0000000..dd941bf --- /dev/null +++ b/modules/preguntasFrecuentes/controllers/consultarPreguntaFrecuenteIndividual.controller.js @@ -0,0 +1,38 @@ +const PreguntaFrecuente = require('../../../models/PreguntaFrecuente'); + +exports.consultarPreguntaIndividual = async (req, res) => { + try { + const { IDPregunta } = req.params; // Obtenemos el ID de la URL + const pregunta = await PreguntaFrecuente.findOne({ IDPregunta }); // Busca una pregunta por su IDPregunta + return res.status(200).json({ + code: 200, + msg: 'Consulta de pregunta frecuente exitosa', + data: pregunta + }); + } catch (error) { + return res.status(500).json({ + code: 500, + msg: 'Error de lectura, vuelva a intentarlo más tarde', + data: null + }); + } +}; + +exports.modificarPreguntaFrecuente = async (req,res) => { + const {IdPregunta} = req.params; + const {Pregunta, Respuesta, Tema, Imagen} = req.body; + + try{ + const PreguntaActualizada = await PreguntaFrecuente.findByIdAndUpdate(IdPregunta,{Pregunta, Respuesta, Tema, Imagen}, + {new: true}) + if (!PreguntaActualizada){ + return res.status(404).json({ + message: 'No se encontró pregunta que actualizar'}); + } + res.status(200).json({ + message: "La pregunta fue modificada con éxito" + }) + } catch(err){ + return res.status(500).json({message : "No se pudo actualizar la pregunta, inténtelo más tarde ", err}) + } + } diff --git a/modules/preguntasFrecuentes/routes/consultarPreguntaFrecuenteIndividual.routes.js b/modules/preguntasFrecuentes/routes/consultarPreguntaFrecuenteIndividual.routes.js new file mode 100644 index 0000000..24617b9 --- /dev/null +++ b/modules/preguntasFrecuentes/routes/consultarPreguntaFrecuenteIndividual.routes.js @@ -0,0 +1,8 @@ +const express = require('express'); +const router = express.Router(); + +const helperPregunta = require('../controllers/consultarPreguntaFrecuenteIndividual.controller'); + +router.get('/:IdPregunta', helperPregunta.get_PreguntaIndividual); + +module.exports = router; \ No newline at end of file diff --git a/modules/preguntasFrecuentes/routes/preguntasIndex.routes.js b/modules/preguntasFrecuentes/routes/preguntasIndex.routes.js index 3529ce4..e9deea1 100644 --- a/modules/preguntasFrecuentes/routes/preguntasIndex.routes.js +++ b/modules/preguntasFrecuentes/routes/preguntasIndex.routes.js @@ -3,8 +3,10 @@ const router = express.Router(); const consultarPreguntasRoute = require('./consultarPreguntasFrecuentes.routes'); const registrarPreguntasRoute = require('./registrarPreguntasFrecuentes.routes'); +const consultarPreguntaIndividualRoute = require("./consultarPreguntaFrecuenteIndividual.routes"); router.use('/consultar', consultarPreguntasRoute); router.use('/registrar', registrarPreguntasRoute); +router.use('/consultarIndividual', consultarPreguntaIndividualRoute); module.exports = router; \ No newline at end of file From 96d0461d6ed9ca4a60bc68a2bf97812112015f47 Mon Sep 17 00:00:00 2001 From: Gaby Chimali Nava Date: Wed, 18 Sep 2024 07:43:59 -0600 Subject: [PATCH 038/231] =?UTF-8?q?feat(actividades):=20agregar=20m=C3=A9t?= =?UTF-8?q?odos=20GET?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- models/actividades/actividad.model.js | 17 ++-- models/actividades/evento.model.js | 16 +-- models/actividades/rodada.model.js | 25 ++--- models/actividades/taller.model.js | 16 +-- .../consultarActividades.controller.js | 33 +++++++ .../routes/actividadesIndex.routes.js | 2 + .../routes/consultarActividades.routes.js | 10 ++ package-lock.json | 97 +++++++++++-------- package.json | 3 +- 9 files changed, 143 insertions(+), 76 deletions(-) create mode 100644 modules/actividades/controllers/consultarActividades.controller.js create mode 100644 modules/actividades/routes/consultarActividades.routes.js diff --git a/models/actividades/actividad.model.js b/models/actividades/actividad.model.js index 81e5c14..1970c70 100644 --- a/models/actividades/actividad.model.js +++ b/models/actividades/actividad.model.js @@ -1,7 +1,8 @@ const mongoose = require('mongoose'); -const coordenadaSchema = require('../ruta/ruta.model'); +const Schema = mongoose.Schema; +const Ruta = require('../ruta/ruta.model'); -const actividadSchema = new mongoose.Schema ({ +const actividadSchema = new Schema ({ titulo: { type: String, required: true @@ -14,11 +15,11 @@ const actividadSchema = new mongoose.Schema ({ type: Number, required: true }, - ubicacion: { - type: [coordenadaSchema], + ubicacion: [{ + type: Schema.Types.ObjectId, + ref: 'Ruta', required: true - }, - // Incluye materiales requeridos para actividad + }], descripcion: { type: String, required: true @@ -37,6 +38,6 @@ const actividadSchema = new mongoose.Schema ({ } }); -const actividad = mongoose.model('Actividad', actividadSchema); +const Actividad = mongoose.model('Actividad', actividadSchema); -module.exports = actividad; \ No newline at end of file +module.exports = Actividad; \ No newline at end of file diff --git a/models/actividades/evento.model.js b/models/actividades/evento.model.js index 1527dc4..3e90740 100644 --- a/models/actividades/evento.model.js +++ b/models/actividades/evento.model.js @@ -1,15 +1,17 @@ const mongoose = require('mongoose'); -const actividadSchema = require('./actividad.model'); +const Schema = mongoose.Schema; +const Actividad = require('./actividad.model'); -const eventoSchema = new mongoose.Schema ({ - informacion: { - type: [actividadSchema], +const eventoSchema = new Schema ({ + informacion: [{ + type: Schema.Types.ObjectId, + ref: 'Actividad', required: true - } + }] }, { collection: 'Eventos' }); -const evento = mongoose.model('Evento', eventoSchema); +const Evento = mongoose.model('Evento', eventoSchema); -module.exports = evento; \ No newline at end of file +module.exports = Evento; \ No newline at end of file diff --git a/models/actividades/rodada.model.js b/models/actividades/rodada.model.js index c242372..f473dc1 100644 --- a/models/actividades/rodada.model.js +++ b/models/actividades/rodada.model.js @@ -1,20 +1,23 @@ const mongoose = require('mongoose'); -const rutaSchema = require('../ruta/ruta.model'); -const actividadSchema = require('./actividad.model'); +const Schema = mongoose.Schema; +const Ruta = require('../ruta/ruta.model'); +const Actividad = require('./actividad.model'); -const rodadaSchema = new mongoose.Schema ({ - informacion: { - type: [actividadSchema], +const rodadaSchema = new Schema ({ + informacion: [{ + type: Schema.Types.ObjectId, + ref: 'Actividad', required: true - }, - ruta: { - type: [rutaSchema], + }], + ruta: [{ + type: Schema.Types.ObjectId, + ref: 'Ruta', required: true - }, + }], }, { collection: 'Rodadas' }); -const rodada = mongoose.model('Rodada', rodadaSchema); +const Rodada = mongoose.model('Rodada', rodadaSchema); -module.exports = rodada; \ No newline at end of file +module.exports = Rodada; \ No newline at end of file diff --git a/models/actividades/taller.model.js b/models/actividades/taller.model.js index 3ee881b..c298863 100644 --- a/models/actividades/taller.model.js +++ b/models/actividades/taller.model.js @@ -1,15 +1,17 @@ const mongoose = require('mongoose'); -const actividadSchema = require('./actividad.model'); +const Schema = mongoose.Schema; +const Actividad = require('./actividad.model'); -const tallerSchema = new mongoose.Schema ({ - informacion: { - type: [actividadSchema], +const tallerSchema = new Schema ({ + informacion: [{ + type: Schema.Types.ObjectId, + ref: 'Actividad', required: true - } + }] }, { collection: 'Talleres' }); -const taller = mongoose.model('Taller', tallerSchema); +const Taller = mongoose.model('Taller', tallerSchema); -module.exports = taller; \ No newline at end of file +module.exports = Taller; \ No newline at end of file diff --git a/modules/actividades/controllers/consultarActividades.controller.js b/modules/actividades/controllers/consultarActividades.controller.js new file mode 100644 index 0000000..18ecc22 --- /dev/null +++ b/modules/actividades/controllers/consultarActividades.controller.js @@ -0,0 +1,33 @@ +const Rodada = require('../../models/actividades/rodada.model'); +const Evento = require('../../models/actividades/evento.model'); +const Taller = require('../../models/actividades/taller.model'); +const { request } = require('express'); + +const getRodadas = async (request, response) => { + try { + const rodadas = await Rodada.find(); + response.status(200).json(rodadas); + } catch (error) { + response.status(500).json({ message: 'Error al obtener las rodadas', error }); + } +}; + +const getEventos = async (request, response) => { + try { + const eventos = await Evento.find(); + response.status(200).json(eventos); + } catch (error) { + response.status(500).json({ message: 'Error al obtener los eventos', error }); + } +}; + +const getTalleres = async (request, response) => { + try { + const talleres = await Taller.find(); + response.status(200).json(talleres); + } catch (error) { + response.status(500).json({ message: 'Error al obtener los talleres', error }); + } +} + +module.exports = { getRodadas, getEventos, getTalleres }; \ No newline at end of file diff --git a/modules/actividades/routes/actividadesIndex.routes.js b/modules/actividades/routes/actividadesIndex.routes.js index c63a366..fdfda9b 100644 --- a/modules/actividades/routes/actividadesIndex.routes.js +++ b/modules/actividades/routes/actividadesIndex.routes.js @@ -3,10 +3,12 @@ const router = express.Router(); const registrarActividadRoute = require('./registrarActividad.routes'); const modificarActividadRoute = require('./modificarActividad.routes'); +const consultarActividadesRoute = require('./consultarActividades.routes'); // Importar y usar las rutas en el enrutador principal del módulo router.use('/registrar', registrarActividadRoute); router.use('/modificar', modificarActividadRouteActividadRoute); +router.use('/consultar', consultarActividadesRoute); module.exports = router; \ No newline at end of file diff --git a/modules/actividades/routes/consultarActividades.routes.js b/modules/actividades/routes/consultarActividades.routes.js new file mode 100644 index 0000000..0fa275b --- /dev/null +++ b/modules/actividades/routes/consultarActividades.routes.js @@ -0,0 +1,10 @@ +const express = require('express'); +const router = express.Router(); + +const { getRodadas, getEventos, getTalleres } = require('../controllers/consultarActividades.controller'); + +router.get('/rodadas', getRodadas); +router.get('/eventos', getEventos); +router.get('/talleres', getTalleres); + +module.exports = router; \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 8f0e5c4..10f1a83 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,8 +9,9 @@ "version": "1.0.0", "license": "MIT", "dependencies": { + "body-parser": "^1.20.3", "compression": "^1.7.4", - "express": "^4.19.2", + "express": "^4.21.0", "mongoose": "^8.6.0", "nodemon": "^3.1.4" }, @@ -395,9 +396,9 @@ } }, "node_modules/body-parser": { - "version": "1.20.2", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.2.tgz", - "integrity": "sha512-ml9pReCu3M61kGlqoTm2umSXTlRTuGTx0bfYj+uIUKKYycG5NtSbeetV3faSU6R7ajOPw0g/J1PvK4qNy7s5bA==", + "version": "1.20.3", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.3.tgz", + "integrity": "sha512-7rAxByjUMqQ3/bHJy7D6OGXvx/MMc4IqBn/X0fcM1QUcAItpZrBEYhWGem+tzXH90c+G01ypMcYJBO9Y30203g==", "license": "MIT", "dependencies": { "bytes": "3.1.2", @@ -408,7 +409,7 @@ "http-errors": "2.0.0", "iconv-lite": "0.4.24", "on-finished": "2.4.1", - "qs": "6.11.0", + "qs": "6.13.0", "raw-body": "2.5.2", "type-is": "~1.6.18", "unpipe": "1.0.0" @@ -721,9 +722,9 @@ "license": "MIT" }, "node_modules/encodeurl": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", - "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz", + "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==", "license": "MIT", "engines": { "node": ">= 0.8" @@ -958,37 +959,37 @@ } }, "node_modules/express": { - "version": "4.19.2", - "resolved": "https://registry.npmjs.org/express/-/express-4.19.2.tgz", - "integrity": "sha512-5T6nhjsT+EOMzuck8JjBHARTHfMht0POzlA60WV2pMD3gyXw2LZnZ+ueGdNxG+0calOJcWKbpFcuzLZ91YWq9Q==", + "version": "4.21.0", + "resolved": "https://registry.npmjs.org/express/-/express-4.21.0.tgz", + "integrity": "sha512-VqcNGcj/Id5ZT1LZ/cfihi3ttTn+NJmkli2eZADigjq29qTlWi/hAQ43t/VLPq8+UX06FCEx3ByOYet6ZFblng==", "license": "MIT", "dependencies": { "accepts": "~1.3.8", "array-flatten": "1.1.1", - "body-parser": "1.20.2", + "body-parser": "1.20.3", "content-disposition": "0.5.4", "content-type": "~1.0.4", "cookie": "0.6.0", "cookie-signature": "1.0.6", "debug": "2.6.9", "depd": "2.0.0", - "encodeurl": "~1.0.2", + "encodeurl": "~2.0.0", "escape-html": "~1.0.3", "etag": "~1.8.1", - "finalhandler": "1.2.0", + "finalhandler": "1.3.1", "fresh": "0.5.2", "http-errors": "2.0.0", - "merge-descriptors": "1.0.1", + "merge-descriptors": "1.0.3", "methods": "~1.1.2", "on-finished": "2.4.1", "parseurl": "~1.3.3", - "path-to-regexp": "0.1.7", + "path-to-regexp": "0.1.10", "proxy-addr": "~2.0.7", - "qs": "6.11.0", + "qs": "6.13.0", "range-parser": "~1.2.1", "safe-buffer": "5.2.1", - "send": "0.18.0", - "serve-static": "1.15.0", + "send": "0.19.0", + "serve-static": "1.16.2", "setprototypeof": "1.2.0", "statuses": "2.0.1", "type-is": "~1.6.18", @@ -1056,13 +1057,13 @@ } }, "node_modules/finalhandler": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.2.0.tgz", - "integrity": "sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.3.1.tgz", + "integrity": "sha512-6BN9trH7bp3qvnrRyzsBz+g3lZxTNZTbVO2EV1CS0WIcDbawYVdYvGflME/9QP0h0pYlCDBCTjYa9nZzMDpyxQ==", "license": "MIT", "dependencies": { "debug": "2.6.9", - "encodeurl": "~1.0.2", + "encodeurl": "~2.0.0", "escape-html": "~1.0.3", "on-finished": "2.4.1", "parseurl": "~1.3.3", @@ -1518,10 +1519,13 @@ "license": "MIT" }, "node_modules/merge-descriptors": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", - "integrity": "sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w==", - "license": "MIT" + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.3.tgz", + "integrity": "sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } }, "node_modules/methods": { "version": "1.1.2", @@ -1934,9 +1938,9 @@ } }, "node_modules/path-to-regexp": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", - "integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==", + "version": "0.1.10", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.10.tgz", + "integrity": "sha512-7lf7qcQidTku0Gu3YDPc8DJ1q7OOucfa/BSsIwjuh56VU7katFvuM8hULfkwB3Fns/rsVF7PwPKVw1sl5KQS9w==", "license": "MIT" }, "node_modules/picomatch": { @@ -1990,12 +1994,12 @@ } }, "node_modules/qs": { - "version": "6.11.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", - "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.13.0.tgz", + "integrity": "sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg==", "license": "BSD-3-Clause", "dependencies": { - "side-channel": "^1.0.4" + "side-channel": "^1.0.6" }, "engines": { "node": ">=0.6" @@ -2145,9 +2149,9 @@ } }, "node_modules/send": { - "version": "0.18.0", - "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz", - "integrity": "sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==", + "version": "0.19.0", + "resolved": "https://registry.npmjs.org/send/-/send-0.19.0.tgz", + "integrity": "sha512-dW41u5VfLXu8SJh5bwRmyYUbAoSB3c9uQh6L8h/KtsFREPWpbX1lrljJo186Jc4nmci/sGUZ9a0a0J2zgfq2hw==", "license": "MIT", "dependencies": { "debug": "2.6.9", @@ -2168,6 +2172,15 @@ "node": ">= 0.8.0" } }, + "node_modules/send/node_modules/encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, "node_modules/send/node_modules/ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", @@ -2175,15 +2188,15 @@ "license": "MIT" }, "node_modules/serve-static": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.15.0.tgz", - "integrity": "sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==", + "version": "1.16.2", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.16.2.tgz", + "integrity": "sha512-VqpjJZKadQB/PEbEwvFdO43Ax5dFBZ2UECszz8bQ7pi7wt//PWe1P6MN7eCnjsatYtBT6EuiClbjSWP2WrIoTw==", "license": "MIT", "dependencies": { - "encodeurl": "~1.0.2", + "encodeurl": "~2.0.0", "escape-html": "~1.0.3", "parseurl": "~1.3.3", - "send": "0.18.0" + "send": "0.19.0" }, "engines": { "node": ">= 0.8.0" diff --git a/package.json b/package.json index 200e50b..0c76021 100644 --- a/package.json +++ b/package.json @@ -25,8 +25,9 @@ }, "homepage": "https://github.com/Saca-la-Bici/app-backend#readme", "dependencies": { + "body-parser": "^1.20.3", "compression": "^1.7.4", - "express": "^4.19.2", + "express": "^4.21.0", "mongoose": "^8.6.0", "nodemon": "^3.1.4" }, From 7a5df21ed10177bbb1962bd52445b63b847381ef Mon Sep 17 00:00:00 2001 From: Gaby Chimali Nava Date: Wed, 18 Sep 2024 08:03:16 -0600 Subject: [PATCH 039/231] refactor(actividades): corregir rutas de controller de consultar --- .../controllers/consultarActividades.controller.js | 6 +++--- modules/actividades/routes/actividadesIndex.routes.js | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/actividades/controllers/consultarActividades.controller.js b/modules/actividades/controllers/consultarActividades.controller.js index 18ecc22..7309d10 100644 --- a/modules/actividades/controllers/consultarActividades.controller.js +++ b/modules/actividades/controllers/consultarActividades.controller.js @@ -1,6 +1,6 @@ -const Rodada = require('../../models/actividades/rodada.model'); -const Evento = require('../../models/actividades/evento.model'); -const Taller = require('../../models/actividades/taller.model'); +const Rodada = require('../../../models/actividades/rodada.model'); +const Evento = require('../../../models/actividades/evento.model'); +const Taller = require('../../../models/actividades/taller.model'); const { request } = require('express'); const getRodadas = async (request, response) => { diff --git a/modules/actividades/routes/actividadesIndex.routes.js b/modules/actividades/routes/actividadesIndex.routes.js index fdfda9b..cf57ce0 100644 --- a/modules/actividades/routes/actividadesIndex.routes.js +++ b/modules/actividades/routes/actividadesIndex.routes.js @@ -1,13 +1,13 @@ const express = require('express'); const router = express.Router(); -const registrarActividadRoute = require('./registrarActividad.routes'); +//const registrarActividadRoute = require('./registrarActividad.routes'); const modificarActividadRoute = require('./modificarActividad.routes'); const consultarActividadesRoute = require('./consultarActividades.routes'); // Importar y usar las rutas en el enrutador principal del módulo -router.use('/registrar', registrarActividadRoute); -router.use('/modificar', modificarActividadRouteActividadRoute); +//router.use('/registrar', registrarActividadRoute); +//router.use('/modificar', modificarActividadRouteActividadRoute); router.use('/consultar', consultarActividadesRoute); From 52e7f5d9abd82c696b8a81ef2553b11923bbac28 Mon Sep 17 00:00:00 2001 From: AndreaMedinaRico Date: Wed, 18 Sep 2024 09:09:29 -0600 Subject: [PATCH 040/231] fix(actividades): corregir modelos de tipos de actividad --- models/actividades/actividad.model.js | 6 +++--- models/actividades/registraActividad.model.js | 2 +- models/actividades/rodada.model.js | 2 +- models/ruta/ruta.model.js | 5 ++++- .../controllers/modificarActividad.controller.js | 2 +- 5 files changed, 10 insertions(+), 7 deletions(-) diff --git a/models/actividades/actividad.model.js b/models/actividades/actividad.model.js index 81e5c14..f2d36db 100644 --- a/models/actividades/actividad.model.js +++ b/models/actividades/actividad.model.js @@ -1,5 +1,5 @@ const mongoose = require('mongoose'); -const coordenadaSchema = require('../ruta/ruta.model'); +const {rutaSchema, coordenadaSchema} = require('../ruta/ruta.model'); const actividadSchema = new mongoose.Schema ({ titulo: { @@ -37,6 +37,6 @@ const actividadSchema = new mongoose.Schema ({ } }); -const actividad = mongoose.model('Actividad', actividadSchema); +//const actividad = mongoose.model('Actividad', actividadSchema); -module.exports = actividad; \ No newline at end of file +module.exports = actividadSchema; \ No newline at end of file diff --git a/models/actividades/registraActividad.model.js b/models/actividades/registraActividad.model.js index 7b6b13b..29a4a96 100644 --- a/models/actividades/registraActividad.model.js +++ b/models/actividades/registraActividad.model.js @@ -10,7 +10,7 @@ async function encontrarTipo(tipo) { async function registrarActividad(tipo, data) { try { - const Modelo = await encontrarTipo(tipo); + const { Modelo } = await encontrarTipo(tipo); const actividad = await Modelo.create(data); await actividad.save(); } catch (error) { diff --git a/models/actividades/rodada.model.js b/models/actividades/rodada.model.js index c242372..f210643 100644 --- a/models/actividades/rodada.model.js +++ b/models/actividades/rodada.model.js @@ -1,6 +1,6 @@ const mongoose = require('mongoose'); -const rutaSchema = require('../ruta/ruta.model'); const actividadSchema = require('./actividad.model'); +const {rutaSchema, coordenadaSchema} = require('../ruta/ruta.model'); const rodadaSchema = new mongoose.Schema ({ informacion: { diff --git a/models/ruta/ruta.model.js b/models/ruta/ruta.model.js index cd03d71..4e3aa98 100644 --- a/models/ruta/ruta.model.js +++ b/models/ruta/ruta.model.js @@ -41,5 +41,8 @@ const rutaSchema = new mongoose.Schema({ }); const Ruta = mongoose.model('Ruta', rutaSchema); +const Coordenada = mongoose.model('Coordenada', coordenadaSchema); -module.exports = Ruta; \ No newline at end of file +module.exports = { + Ruta, + Coordenada}; \ No newline at end of file diff --git a/modules/actividades/controllers/modificarActividad.controller.js b/modules/actividades/controllers/modificarActividad.controller.js index fcc1d31..47b1777 100644 --- a/modules/actividades/controllers/modificarActividad.controller.js +++ b/modules/actividades/controllers/modificarActividad.controller.js @@ -1,4 +1,4 @@ -const { modificarEvento } = requestuire('../../../models/actividades/registraActividad.model.js'); +const { modificarEvento } = require('../../../models/actividades/modificaActividad.model.js'); exports.postModificarActividad = async (req, res) => { const { id } = req.params; From 16191c61254eb37551787b173b948f671ae485ae Mon Sep 17 00:00:00 2001 From: Juan Pablo Date: Wed, 18 Sep 2024 10:33:47 -0600 Subject: [PATCH 041/231] fix: model mal importado --- .../consultarPreguntaFrecuenteIndividual.controller.js | 4 ++-- .../controllers/registrarPreguntaFrecuente.controller.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/preguntasFrecuentes/controllers/consultarPreguntaFrecuenteIndividual.controller.js b/modules/preguntasFrecuentes/controllers/consultarPreguntaFrecuenteIndividual.controller.js index dd941bf..da456bc 100644 --- a/modules/preguntasFrecuentes/controllers/consultarPreguntaFrecuenteIndividual.controller.js +++ b/modules/preguntasFrecuentes/controllers/consultarPreguntaFrecuenteIndividual.controller.js @@ -1,6 +1,6 @@ -const PreguntaFrecuente = require('../../../models/PreguntaFrecuente'); +const PreguntaFrecuente = require('../../../models/otros/preguntasFrecuentes.model'); -exports.consultarPreguntaIndividual = async (req, res) => { +exports.get_PreguntaIndividual = async (req, res) => { try { const { IDPregunta } = req.params; // Obtenemos el ID de la URL const pregunta = await PreguntaFrecuente.findOne({ IDPregunta }); // Busca una pregunta por su IDPregunta diff --git a/modules/preguntasFrecuentes/controllers/registrarPreguntaFrecuente.controller.js b/modules/preguntasFrecuentes/controllers/registrarPreguntaFrecuente.controller.js index 066ec72..317f757 100644 --- a/modules/preguntasFrecuentes/controllers/registrarPreguntaFrecuente.controller.js +++ b/modules/preguntasFrecuentes/controllers/registrarPreguntaFrecuente.controller.js @@ -1,3 +1,3 @@ -exports.getPrueba = (request, response) => { +exports.registrarPreguntaFrecuente = (request, response) => { response.json('Preguntas Frecuentes: Esta es la plantilla que deben usar.'); }; \ No newline at end of file From 407f9c4f9aeae1dc6fa967d5aa199d6b0cb55404 Mon Sep 17 00:00:00 2001 From: Juan Pablo Date: Wed, 18 Sep 2024 10:57:29 -0600 Subject: [PATCH 042/231] fix: Uso de PUT para modificar una pregunta --- .../consultarPreguntaFrecuenteIndividual.controller.js | 2 +- .../routes/consultarPreguntaFrecuenteIndividual.routes.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/preguntasFrecuentes/controllers/consultarPreguntaFrecuenteIndividual.controller.js b/modules/preguntasFrecuentes/controllers/consultarPreguntaFrecuenteIndividual.controller.js index da456bc..cbdfd6e 100644 --- a/modules/preguntasFrecuentes/controllers/consultarPreguntaFrecuenteIndividual.controller.js +++ b/modules/preguntasFrecuentes/controllers/consultarPreguntaFrecuenteIndividual.controller.js @@ -18,7 +18,7 @@ exports.get_PreguntaIndividual = async (req, res) => { } }; -exports.modificarPreguntaFrecuente = async (req,res) => { +exports.put_modificarPreguntaFrecuente = async (req,res) => { const {IdPregunta} = req.params; const {Pregunta, Respuesta, Tema, Imagen} = req.body; diff --git a/modules/preguntasFrecuentes/routes/consultarPreguntaFrecuenteIndividual.routes.js b/modules/preguntasFrecuentes/routes/consultarPreguntaFrecuenteIndividual.routes.js index 24617b9..96bc3df 100644 --- a/modules/preguntasFrecuentes/routes/consultarPreguntaFrecuenteIndividual.routes.js +++ b/modules/preguntasFrecuentes/routes/consultarPreguntaFrecuenteIndividual.routes.js @@ -4,5 +4,6 @@ const router = express.Router(); const helperPregunta = require('../controllers/consultarPreguntaFrecuenteIndividual.controller'); router.get('/:IdPregunta', helperPregunta.get_PreguntaIndividual); +router.put('/:IdPregunta/Modificacion', helperPregunta.put_modificarPreguntaFrecuente); module.exports = router; \ No newline at end of file From c0bb83d2925c6b4e39b7e769f57916ce4bcdaae0 Mon Sep 17 00:00:00 2001 From: Juan Pablo Date: Wed, 18 Sep 2024 11:14:18 -0600 Subject: [PATCH 043/231] =?UTF-8?q?fix:=20Error=20en=20Schema=20|=20feat:?= =?UTF-8?q?=20Modificaci=C3=B3n=20de=20pregunta?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- models/otros/preguntasFrecuentes.model.js | 2 +- .../consultarPreguntaFrecuenteIndividual.controller.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/models/otros/preguntasFrecuentes.model.js b/models/otros/preguntasFrecuentes.model.js index c34a1d7..7e41532 100644 --- a/models/otros/preguntasFrecuentes.model.js +++ b/models/otros/preguntasFrecuentes.model.js @@ -2,7 +2,7 @@ const mongoose = require('mongoose'); const preguntasFrecuentesSchema = new mongoose.Schema({ IdPregunta: { - type: String, + type: Number, required: true, unique: true }, diff --git a/modules/preguntasFrecuentes/controllers/consultarPreguntaFrecuenteIndividual.controller.js b/modules/preguntasFrecuentes/controllers/consultarPreguntaFrecuenteIndividual.controller.js index cbdfd6e..970f13b 100644 --- a/modules/preguntasFrecuentes/controllers/consultarPreguntaFrecuenteIndividual.controller.js +++ b/modules/preguntasFrecuentes/controllers/consultarPreguntaFrecuenteIndividual.controller.js @@ -23,7 +23,7 @@ exports.put_modificarPreguntaFrecuente = async (req,res) => { const {Pregunta, Respuesta, Tema, Imagen} = req.body; try{ - const PreguntaActualizada = await PreguntaFrecuente.findByIdAndUpdate(IdPregunta,{Pregunta, Respuesta, Tema, Imagen}, + const PreguntaActualizada = await PreguntaFrecuente.findOneAndUpdate({IdPregunta:IdPregunta},{Pregunta, Respuesta, Tema, Imagen}, {new: true}) if (!PreguntaActualizada){ return res.status(404).json({ From 632d706c141e595ce16922a0af9cbbfddbed933d Mon Sep 17 00:00:00 2001 From: Jesus0204 Date: Wed, 18 Sep 2024 12:45:14 -0600 Subject: [PATCH 044/231] fix: correcion de codigo de perfil completo --- modules/session/controllers/perfilCompleto.controller.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/session/controllers/perfilCompleto.controller.js b/modules/session/controllers/perfilCompleto.controller.js index d1b0485..57ac8a1 100644 --- a/modules/session/controllers/perfilCompleto.controller.js +++ b/modules/session/controllers/perfilCompleto.controller.js @@ -8,7 +8,7 @@ exports.perfilCompleto = async (request, response) => { }); if (!usuario) { - return response.status(404).json({ + return response.status(200).json({ perfilRegistrado: false }); } @@ -19,7 +19,7 @@ exports.perfilCompleto = async (request, response) => { } catch (error) { return response.status(500).json({ - error: error + error: error.message, }); } } From ccca32754ea0e4a908f86f58dbc53506d9507a9f Mon Sep 17 00:00:00 2001 From: Jesus0204 Date: Wed, 18 Sep 2024 13:05:10 -0600 Subject: [PATCH 045/231] refactor: borrar archivos inecesarios --- util/inicializarBD.js | 299 --------------------------------- util/inicializarPrivilegios.js | 299 --------------------------------- 2 files changed, 598 deletions(-) delete mode 100644 util/inicializarBD.js delete mode 100644 util/inicializarPrivilegios.js diff --git a/util/inicializarBD.js b/util/inicializarBD.js deleted file mode 100644 index 2175567..0000000 --- a/util/inicializarBD.js +++ /dev/null @@ -1,299 +0,0 @@ -const mongoose = require("mongoose"); -const Rol = require("../models/perfil/rol.model"); -const Privilegio = require("../models/perfil/privilegio.model"); -const ContienePrivilegio = require("../models/perfil/contienePrivilegio.model"); - -const privilegiosPredeterminados = [ - { nombre: "crear_usuario", createdAt: new Date() }, - { nombre: "leer_usuario", createdAt: new Date() }, - { nombre: "actualizar_usuario", createdAt: new Date() }, - { nombre: "eliminar_usuario", createdAt: new Date() }, - { nombre: "crear_rol", createdAt: new Date() }, - { nombre: "leer_rol", createdAt: new Date() }, - { nombre: "actualizar_rol", createdAt: new Date() }, - { nombre: "eliminar_rol", createdAt: new Date() }, - { nombre: "asignar_privilegio_a_rol", createdAt: new Date() }, - { nombre: "eliminar_privilegio_de_rol", createdAt: new Date() }, - { nombre: "crear_recurso", createdAt: new Date() }, - { nombre: "leer_recurso", createdAt: new Date() }, - { nombre: "actualizar_recurso", createdAt: new Date() }, - { nombre: "eliminar_recurso", createdAt: new Date() }, - { nombre: "acceso_configuracion", createdAt: new Date() }, - { nombre: "actualizar_configuracion", createdAt: new Date() }, - { nombre: "ver_estadisticas", createdAt: new Date() }, - { nombre: "gestionar_politicas_seguridad", createdAt: new Date() }, - { nombre: "administrar_usuarios", createdAt: new Date() }, - { nombre: "acceso_funcionalidades_avanzadas", createdAt: new Date() }, -]; - -const rolesPredeterminados = [ - { nombre: "admin", createdAt: new Date() }, - { nombre: "staff", createdAt: new Date() }, - { nombre: "usuario", createdAt: new Date() }, -]; - -async function inicializarDatos() { - try { - // Conectar a la base de datos - await mongoose.connect("mongodb://localhost:27017/miBaseDeDatos", { - useNewUrlParser: true, - useUnifiedTopology: true, - }); - - // Crear Privilegios - const privilegios = await Privilegio.insertMany(privilegiosPredeterminados); - console.log("Privilegios creados:", privilegios); - - // Crear Roles - const roles = await Rol.insertMany(rolesPredeterminados); - console.log("Roles creados:", roles); - - // Asignar Privilegios a Roles - const asignaciones = [ - // Admin tiene todos los privilegios - { - IDPrivilegio: privilegios.find((p) => p.nombre === "crear_usuario")._id, - IDRol: roles.find((r) => r.nombre === "admin")._id, - createdAt: new Date(), - }, - { - IDPrivilegio: privilegios.find((p) => p.nombre === "leer_usuario")._id, - IDRol: roles.find((r) => r.nombre === "admin")._id, - createdAt: new Date(), - }, - { - IDPrivilegio: privilegios.find((p) => p.nombre === "actualizar_usuario") - ._id, - IDRol: roles.find((r) => r.nombre === "admin")._id, - createdAt: new Date(), - }, - { - IDPrivilegio: privilegios.find((p) => p.nombre === "eliminar_usuario") - ._id, - IDRol: roles.find((r) => r.nombre === "admin")._id, - createdAt: new Date(), - }, - { - IDPrivilegio: privilegios.find((p) => p.nombre === "crear_rol")._id, - IDRol: roles.find((r) => r.nombre === "admin")._id, - createdAt: new Date(), - }, - { - IDPrivilegio: privilegios.find((p) => p.nombre === "leer_rol")._id, - IDRol: roles.find((r) => r.nombre === "admin")._id, - createdAt: new Date(), - }, - { - IDPrivilegio: privilegios.find((p) => p.nombre === "actualizar_rol") - ._id, - IDRol: roles.find((r) => r.nombre === "admin")._id, - createdAt: new Date(), - }, - { - IDPrivilegio: privilegios.find((p) => p.nombre === "eliminar_rol")._id, - IDRol: roles.find((r) => r.nombre === "admin")._id, - createdAt: new Date(), - }, - { - IDPrivilegio: privilegios.find( - (p) => p.nombre === "asignar_privilegio_a_rol" - )._id, - IDRol: roles.find((r) => r.nombre === "admin")._id, - createdAt: new Date(), - }, - { - IDPrivilegio: privilegios.find( - (p) => p.nombre === "eliminar_privilegio_de_rol" - )._id, - IDRol: roles.find((r) => r.nombre === "admin")._id, - createdAt: new Date(), - }, - { - IDPrivilegio: privilegios.find((p) => p.nombre === "crear_recurso")._id, - IDRol: roles.find((r) => r.nombre === "admin")._id, - createdAt: new Date(), - }, - { - IDPrivilegio: privilegios.find((p) => p.nombre === "leer_recurso")._id, - IDRol: roles.find((r) => r.nombre === "admin")._id, - createdAt: new Date(), - }, - { - IDPrivilegio: privilegios.find((p) => p.nombre === "actualizar_recurso") - ._id, - IDRol: roles.find((r) => r.nombre === "admin")._id, - createdAt: new Date(), - }, - { - IDPrivilegio: privilegios.find((p) => p.nombre === "eliminar_recurso") - ._id, - IDRol: roles.find((r) => r.nombre === "admin")._id, - createdAt: new Date(), - }, - { - IDPrivilegio: privilegios.find( - (p) => p.nombre === "acceso_configuracion" - )._id, - IDRol: roles.find((r) => r.nombre === "admin")._id, - createdAt: new Date(), - }, - { - IDPrivilegio: privilegios.find( - (p) => p.nombre === "actualizar_configuracion" - )._id, - IDRol: roles.find((r) => r.nombre === "admin")._id, - createdAt: new Date(), - }, - { - IDPrivilegio: privilegios.find((p) => p.nombre === "ver_estadisticas") - ._id, - IDRol: roles.find((r) => r.nombre === "admin")._id, - createdAt: new Date(), - }, - { - IDPrivilegio: privilegios.find( - (p) => p.nombre === "gestionar_politicas_seguridad" - )._id, - IDRol: roles.find((r) => r.nombre === "admin")._id, - createdAt: new Date(), - }, - { - IDPrivilegio: privilegios.find( - (p) => p.nombre === "administrar_usuarios" - )._id, - IDRol: roles.find((r) => r.nombre === "admin")._id, - createdAt: new Date(), - }, - { - IDPrivilegio: privilegios.find( - (p) => p.nombre === "acceso_funcionalidades_avanzadas" - )._id, - IDRol: roles.find((r) => r.nombre === "admin")._id, - createdAt: new Date(), - }, - - // Staff tiene privilegios de CRUD y asignación de privilegios a roles - { - IDPrivilegio: privilegios.find((p) => p.nombre === "crear_usuario")._id, - IDRol: roles.find((r) => r.nombre === "admin")._id, - createdAt: new Date(), - }, - { - IDPrivilegio: privilegios.find((p) => p.nombre === "leer_usuario")._id, - IDRol: roles.find((r) => r.nombre === "admin")._id, - createdAt: new Date(), - }, - { - IDPrivilegio: privilegios.find((p) => p.nombre === "actualizar_usuario") - ._id, - IDRol: roles.find((r) => r.nombre === "admin")._id, - createdAt: new Date(), - }, - { - IDPrivilegio: privilegios.find((p) => p.nombre === "eliminar_usuario") - ._id, - IDRol: roles.find((r) => r.nombre === "admin")._id, - createdAt: new Date(), - }, - { - IDPrivilegio: privilegios.find((p) => p.nombre === "crear_recurso")._id, - IDRol: roles.find((r) => r.nombre === "admin")._id, - createdAt: new Date(), - }, - { - IDPrivilegio: privilegios.find((p) => p.nombre === "leer_recurso")._id, - IDRol: roles.find((r) => r.nombre === "admin")._id, - createdAt: new Date(), - }, - { - IDPrivilegio: privilegios.find((p) => p.nombre === "actualizar_recurso") - ._id, - IDRol: roles.find((r) => r.nombre === "admin")._id, - createdAt: new Date(), - }, - { - IDPrivilegio: privilegios.find((p) => p.nombre === "eliminar_recurso") - ._id, - IDRol: roles.find((r) => r.nombre === "admin")._id, - createdAt: new Date(), - }, - { - IDPrivilegio: privilegios.find( - (p) => p.nombre === "acceso_configuracion" - )._id, - IDRol: roles.find((r) => r.nombre === "admin")._id, - createdAt: new Date(), - }, - { - IDPrivilegio: privilegios.find( - (p) => p.nombre === "acceso_funcionalidades_avanzadas" - )._id, - IDRol: roles.find((r) => r.nombre === "admin")._id, - createdAt: new Date(), - }, - - // Usuario tiene privilegios limitados - { - IDPrivilegio: privilegios.find((p) => p.nombre === "crear_usuario")._id, - IDRol: roles.find((r) => r.nombre === "admin")._id, - createdAt: new Date(), - }, - { - IDPrivilegio: privilegios.find((p) => p.nombre === "leer_usuario")._id, - IDRol: roles.find((r) => r.nombre === "admin")._id, - createdAt: new Date(), - }, - { - IDPrivilegio: privilegios.find((p) => p.nombre === "actualizar_usuario") - ._id, - IDRol: roles.find((r) => r.nombre === "admin")._id, - createdAt: new Date(), - }, - { - IDPrivilegio: privilegios.find((p) => p.nombre === "eliminar_usuario") - ._id, - IDRol: roles.find((r) => r.nombre === "admin")._id, - createdAt: new Date(), - }, - { - IDPrivilegio: privilegios.find((p) => p.nombre === "crear_recurso")._id, - IDRol: roles.find((r) => r.nombre === "admin")._id, - createdAt: new Date(), - }, - { - IDPrivilegio: privilegios.find((p) => p.nombre === "leer_recurso")._id, - IDRol: roles.find((r) => r.nombre === "admin")._id, - createdAt: new Date(), - }, - { - IDPrivilegio: privilegios.find((p) => p.nombre === "actualizar_recurso") - ._id, - IDRol: roles.find((r) => r.nombre === "admin")._id, - createdAt: new Date(), - }, - { - IDPrivilegio: privilegios.find((p) => p.nombre === "eliminar_recurso") - ._id, - IDRol: roles.find((r) => r.nombre === "admin")._id, - createdAt: new Date(), - }, - { - IDPrivilegio: privilegios.find( - (p) => p.nombre === "acceso_configuracion" - )._id, - IDRol: roles.find((r) => r.nombre === "admin")._id, - createdAt: new Date(), - }, - ]; - - await ContienePrivilegio.insertMany(asignaciones); - console.log("Privilegios asignados a roles."); - - // Desconectar de la base de datos - await mongoose.disconnect(); - } catch (error) { - console.error("Error al inicializar datos:", error); - } -} - -module.exports = inicializarDatos; diff --git a/util/inicializarPrivilegios.js b/util/inicializarPrivilegios.js deleted file mode 100644 index cb938f8..0000000 --- a/util/inicializarPrivilegios.js +++ /dev/null @@ -1,299 +0,0 @@ -const mongoose = require("mongoose"); -const Rol = require("../../../models/perfil/rol.model"); -const Privilegio = require("../../../models/perfil/privilegio.model"); -const ContienePrivilegio = require("../../../models/perfil/contienePrivilegio.model"); - -const privilegiosPredeterminados = [ - { nombre: "crear_usuario", createdAt: new Date() }, - { nombre: "leer_usuario", createdAt: new Date() }, - { nombre: "actualizar_usuario", createdAt: new Date() }, - { nombre: "eliminar_usuario", createdAt: new Date() }, - { nombre: "crear_rol", createdAt: new Date() }, - { nombre: "leer_rol", createdAt: new Date() }, - { nombre: "actualizar_rol", createdAt: new Date() }, - { nombre: "eliminar_rol", createdAt: new Date() }, - { nombre: "asignar_privilegio_a_rol", createdAt: new Date() }, - { nombre: "eliminar_privilegio_de_rol", createdAt: new Date() }, - { nombre: "crear_recurso", createdAt: new Date() }, - { nombre: "leer_recurso", createdAt: new Date() }, - { nombre: "actualizar_recurso", createdAt: new Date() }, - { nombre: "eliminar_recurso", createdAt: new Date() }, - { nombre: "acceso_configuracion", createdAt: new Date() }, - { nombre: "actualizar_configuracion", createdAt: new Date() }, - { nombre: "ver_estadisticas", createdAt: new Date() }, - { nombre: "gestionar_politicas_seguridad", createdAt: new Date() }, - { nombre: "administrar_usuarios", createdAt: new Date() }, - { nombre: "acceso_funcionalidades_avanzadas", createdAt: new Date() }, -]; - -const rolesPredeterminados = [ - { nombre: "admin", createdAt: new Date() }, - { nombre: "staff", createdAt: new Date() }, - { nombre: "usuario", createdAt: new Date() }, -]; - -async function inicializarDatos() { - try { - // Conectar a la base de datos - await mongoose.connect("mongodb://localhost:27017/miBaseDeDatos", { - useNewUrlParser: true, - useUnifiedTopology: true, - }); - - // Crear Privilegios - const privilegios = await Privilegio.insertMany(privilegiosPredeterminados); - console.log("Privilegios creados:", privilegios); - - // Crear Roles - const roles = await Rol.insertMany(rolesPredeterminados); - console.log("Roles creados:", roles); - - // Asignar Privilegios a Roles - const asignaciones = [ - // Admin tiene todos los privilegios - { - IDPrivilegio: privilegios.find((p) => p.nombre === "crear_usuario")._id, - IDRol: roles.find((r) => r.nombre === "admin")._id, - createdAt: new Date(), - }, - { - IDPrivilegio: privilegios.find((p) => p.nombre === "leer_usuario")._id, - IDRol: roles.find((r) => r.nombre === "admin")._id, - createdAt: new Date(), - }, - { - IDPrivilegio: privilegios.find((p) => p.nombre === "actualizar_usuario") - ._id, - IDRol: roles.find((r) => r.nombre === "admin")._id, - createdAt: new Date(), - }, - { - IDPrivilegio: privilegios.find((p) => p.nombre === "eliminar_usuario") - ._id, - IDRol: roles.find((r) => r.nombre === "admin")._id, - createdAt: new Date(), - }, - { - IDPrivilegio: privilegios.find((p) => p.nombre === "crear_rol")._id, - IDRol: roles.find((r) => r.nombre === "admin")._id, - createdAt: new Date(), - }, - { - IDPrivilegio: privilegios.find((p) => p.nombre === "leer_rol")._id, - IDRol: roles.find((r) => r.nombre === "admin")._id, - createdAt: new Date(), - }, - { - IDPrivilegio: privilegios.find((p) => p.nombre === "actualizar_rol") - ._id, - IDRol: roles.find((r) => r.nombre === "admin")._id, - createdAt: new Date(), - }, - { - IDPrivilegio: privilegios.find((p) => p.nombre === "eliminar_rol")._id, - IDRol: roles.find((r) => r.nombre === "admin")._id, - createdAt: new Date(), - }, - { - IDPrivilegio: privilegios.find( - (p) => p.nombre === "asignar_privilegio_a_rol" - )._id, - IDRol: roles.find((r) => r.nombre === "admin")._id, - createdAt: new Date(), - }, - { - IDPrivilegio: privilegios.find( - (p) => p.nombre === "eliminar_privilegio_de_rol" - )._id, - IDRol: roles.find((r) => r.nombre === "admin")._id, - createdAt: new Date(), - }, - { - IDPrivilegio: privilegios.find((p) => p.nombre === "crear_recurso")._id, - IDRol: roles.find((r) => r.nombre === "admin")._id, - createdAt: new Date(), - }, - { - IDPrivilegio: privilegios.find((p) => p.nombre === "leer_recurso")._id, - IDRol: roles.find((r) => r.nombre === "admin")._id, - createdAt: new Date(), - }, - { - IDPrivilegio: privilegios.find((p) => p.nombre === "actualizar_recurso") - ._id, - IDRol: roles.find((r) => r.nombre === "admin")._id, - createdAt: new Date(), - }, - { - IDPrivilegio: privilegios.find((p) => p.nombre === "eliminar_recurso") - ._id, - IDRol: roles.find((r) => r.nombre === "admin")._id, - createdAt: new Date(), - }, - { - IDPrivilegio: privilegios.find( - (p) => p.nombre === "acceso_configuracion" - )._id, - IDRol: roles.find((r) => r.nombre === "admin")._id, - createdAt: new Date(), - }, - { - IDPrivilegio: privilegios.find( - (p) => p.nombre === "actualizar_configuracion" - )._id, - IDRol: roles.find((r) => r.nombre === "admin")._id, - createdAt: new Date(), - }, - { - IDPrivilegio: privilegios.find((p) => p.nombre === "ver_estadisticas") - ._id, - IDRol: roles.find((r) => r.nombre === "admin")._id, - createdAt: new Date(), - }, - { - IDPrivilegio: privilegios.find( - (p) => p.nombre === "gestionar_politicas_seguridad" - )._id, - IDRol: roles.find((r) => r.nombre === "admin")._id, - createdAt: new Date(), - }, - { - IDPrivilegio: privilegios.find( - (p) => p.nombre === "administrar_usuarios" - )._id, - IDRol: roles.find((r) => r.nombre === "admin")._id, - createdAt: new Date(), - }, - { - IDPrivilegio: privilegios.find( - (p) => p.nombre === "acceso_funcionalidades_avanzadas" - )._id, - IDRol: roles.find((r) => r.nombre === "admin")._id, - createdAt: new Date(), - }, - - // Staff tiene privilegios de CRUD y asignación de privilegios a roles - { - IDPrivilegio: privilegios.find((p) => p.nombre === "crear_usuario")._id, - IDRol: roles.find((r) => r.nombre === "admin")._id, - createdAt: new Date(), - }, - { - IDPrivilegio: privilegios.find((p) => p.nombre === "leer_usuario")._id, - IDRol: roles.find((r) => r.nombre === "admin")._id, - createdAt: new Date(), - }, - { - IDPrivilegio: privilegios.find((p) => p.nombre === "actualizar_usuario") - ._id, - IDRol: roles.find((r) => r.nombre === "admin")._id, - createdAt: new Date(), - }, - { - IDPrivilegio: privilegios.find((p) => p.nombre === "eliminar_usuario") - ._id, - IDRol: roles.find((r) => r.nombre === "admin")._id, - createdAt: new Date(), - }, - { - IDPrivilegio: privilegios.find((p) => p.nombre === "crear_recurso")._id, - IDRol: roles.find((r) => r.nombre === "admin")._id, - createdAt: new Date(), - }, - { - IDPrivilegio: privilegios.find((p) => p.nombre === "leer_recurso")._id, - IDRol: roles.find((r) => r.nombre === "admin")._id, - createdAt: new Date(), - }, - { - IDPrivilegio: privilegios.find((p) => p.nombre === "actualizar_recurso") - ._id, - IDRol: roles.find((r) => r.nombre === "admin")._id, - createdAt: new Date(), - }, - { - IDPrivilegio: privilegios.find((p) => p.nombre === "eliminar_recurso") - ._id, - IDRol: roles.find((r) => r.nombre === "admin")._id, - createdAt: new Date(), - }, - { - IDPrivilegio: privilegios.find( - (p) => p.nombre === "acceso_configuracion" - )._id, - IDRol: roles.find((r) => r.nombre === "admin")._id, - createdAt: new Date(), - }, - { - IDPrivilegio: privilegios.find( - (p) => p.nombre === "acceso_funcionalidades_avanzadas" - )._id, - IDRol: roles.find((r) => r.nombre === "admin")._id, - createdAt: new Date(), - }, - - // Usuario tiene privilegios limitados - { - IDPrivilegio: privilegios.find((p) => p.nombre === "crear_usuario")._id, - IDRol: roles.find((r) => r.nombre === "admin")._id, - createdAt: new Date(), - }, - { - IDPrivilegio: privilegios.find((p) => p.nombre === "leer_usuario")._id, - IDRol: roles.find((r) => r.nombre === "admin")._id, - createdAt: new Date(), - }, - { - IDPrivilegio: privilegios.find((p) => p.nombre === "actualizar_usuario") - ._id, - IDRol: roles.find((r) => r.nombre === "admin")._id, - createdAt: new Date(), - }, - { - IDPrivilegio: privilegios.find((p) => p.nombre === "eliminar_usuario") - ._id, - IDRol: roles.find((r) => r.nombre === "admin")._id, - createdAt: new Date(), - }, - { - IDPrivilegio: privilegios.find((p) => p.nombre === "crear_recurso")._id, - IDRol: roles.find((r) => r.nombre === "admin")._id, - createdAt: new Date(), - }, - { - IDPrivilegio: privilegios.find((p) => p.nombre === "leer_recurso")._id, - IDRol: roles.find((r) => r.nombre === "admin")._id, - createdAt: new Date(), - }, - { - IDPrivilegio: privilegios.find((p) => p.nombre === "actualizar_recurso") - ._id, - IDRol: roles.find((r) => r.nombre === "admin")._id, - createdAt: new Date(), - }, - { - IDPrivilegio: privilegios.find((p) => p.nombre === "eliminar_recurso") - ._id, - IDRol: roles.find((r) => r.nombre === "admin")._id, - createdAt: new Date(), - }, - { - IDPrivilegio: privilegios.find( - (p) => p.nombre === "acceso_configuracion" - )._id, - IDRol: roles.find((r) => r.nombre === "admin")._id, - createdAt: new Date(), - }, - ]; - - await ContienePrivilegio.insertMany(asignaciones); - console.log("Privilegios asignados a roles."); - - // Desconectar de la base de datos - await mongoose.disconnect(); - } catch (error) { - console.error("Error al inicializar datos:", error); - } -} - -inicializarDatos(); From 291e7af64bf4d27e0ec614c60cfcdbfbddec4045 Mon Sep 17 00:00:00 2001 From: Ethan Luna Date: Wed, 18 Sep 2024 15:34:54 -0600 Subject: [PATCH 046/231] fix: arregle el ordenamiento de las carpetas dentro de perfil --- .../controllers/modificarRol.controller.js | 26 +++++++++++++++++++ modules/perfil/routes/sesionIndex.routes.js | 9 +++++++ 2 files changed, 35 insertions(+) create mode 100644 modules/perfil/controllers/modificarRol.controller.js create mode 100644 modules/perfil/routes/sesionIndex.routes.js diff --git a/modules/perfil/controllers/modificarRol.controller.js b/modules/perfil/controllers/modificarRol.controller.js new file mode 100644 index 0000000..56ef57b --- /dev/null +++ b/modules/perfil/controllers/modificarRol.controller.js @@ -0,0 +1,26 @@ +const Usuario = require('../../../usuario/models/usuario.model'); +const Rol = require('../../../rol/models/rol.model'); + +async function modificarRol(req, res) { + const { id } = req.params; + const { rolId } = req.body; + + try { + //Declaración de constantes + const usuario = await Usuario.findByIdAndUpdate(id, { rolId }, { new: true }); + const rol = await Rol.findById(rolId); + + //Validación de existencia de usuario y rol + if (!usuario) throw new Error ('Usuario no encontrado'); + if (!rol) throw new Error ('Rol no encontrado'); + + //Asignación y guardado de rol al usuario + usuario.rol = rol; + await usuario.save(); + + return usuario; + } catch (error) { + throw new Error ('Error al cambiar el rol: ' + error.message); + + } +} \ No newline at end of file diff --git a/modules/perfil/routes/sesionIndex.routes.js b/modules/perfil/routes/sesionIndex.routes.js new file mode 100644 index 0000000..ba94861 --- /dev/null +++ b/modules/perfil/routes/sesionIndex.routes.js @@ -0,0 +1,9 @@ +const express = require('express'); +const router = express.Router(); + +const modificarRolRoute = require('./modificarRol.routes'); + +// Importar y usar las rutas en el enrutador principal del módulo +router.use('/modificar', modificarRolRoute); + +module.exports = router; \ No newline at end of file From 7304f2f74201ad04bb601b9e6227f04460cec0fb Mon Sep 17 00:00:00 2001 From: A01710217 Date: Wed, 18 Sep 2024 16:26:04 -0600 Subject: [PATCH 047/231] feat(): agregar archivos en controller y rutas de consular usuarios --- modules/perfil/controllers/consultarUsuario.controller.js | 0 modules/perfil/routes/consultarUsuario.route.js | 0 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 modules/perfil/controllers/consultarUsuario.controller.js create mode 100644 modules/perfil/routes/consultarUsuario.route.js diff --git a/modules/perfil/controllers/consultarUsuario.controller.js b/modules/perfil/controllers/consultarUsuario.controller.js new file mode 100644 index 0000000..e69de29 diff --git a/modules/perfil/routes/consultarUsuario.route.js b/modules/perfil/routes/consultarUsuario.route.js new file mode 100644 index 0000000..e69de29 From 20d3af4692619f0751772033fe859323243cf446 Mon Sep 17 00:00:00 2001 From: Ethan Luna Date: Wed, 18 Sep 2024 17:29:20 -0600 Subject: [PATCH 048/231] fix(): Arregle un error por presionar mucho cntrl-z --- app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app.js b/app.js index c6dcd4f..f15d51d 100644 --- a/app.js +++ b/app.js @@ -74,4 +74,4 @@ app.use((request, response) => { app.listen(port, () => { console.log(`Servidor escuchando en el puerto ${port}`); -}); +}); \ No newline at end of file From 45ca8af2ff68ef57974b2fda6b63ed0a1e760e0a Mon Sep 17 00:00:00 2001 From: Gaby Chimali Nava Date: Wed, 18 Sep 2024 17:39:40 -0600 Subject: [PATCH 049/231] refactor(actividades): modificar herencia de modelo actividad --- models/actividades/evento.model.js | 7 +++---- models/actividades/rodada.model.js | 5 ++--- models/actividades/taller.model.js | 7 +++---- 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/models/actividades/evento.model.js b/models/actividades/evento.model.js index 3e90740..8587c0a 100644 --- a/models/actividades/evento.model.js +++ b/models/actividades/evento.model.js @@ -3,11 +3,10 @@ const Schema = mongoose.Schema; const Actividad = require('./actividad.model'); const eventoSchema = new Schema ({ - informacion: [{ - type: Schema.Types.ObjectId, - ref: 'Actividad', + actividad: { + type: Actividad.schema, required: true - }] + } }, { collection: 'Eventos' }); diff --git a/models/actividades/rodada.model.js b/models/actividades/rodada.model.js index f473dc1..0e7640e 100644 --- a/models/actividades/rodada.model.js +++ b/models/actividades/rodada.model.js @@ -4,9 +4,8 @@ const Ruta = require('../ruta/ruta.model'); const Actividad = require('./actividad.model'); const rodadaSchema = new Schema ({ - informacion: [{ - type: Schema.Types.ObjectId, - ref: 'Actividad', + actividad: [{ + type: Actividad.schema, required: true }], ruta: [{ diff --git a/models/actividades/taller.model.js b/models/actividades/taller.model.js index c298863..fbe9cd1 100644 --- a/models/actividades/taller.model.js +++ b/models/actividades/taller.model.js @@ -3,11 +3,10 @@ const Schema = mongoose.Schema; const Actividad = require('./actividad.model'); const tallerSchema = new Schema ({ - informacion: [{ - type: Schema.Types.ObjectId, - ref: 'Actividad', + actividad: { + type: Actividad.schema, required: true - }] + } }, { collection: 'Talleres' }); From 655087110fc0a97c9418dff9c5259f55ba076600 Mon Sep 17 00:00:00 2001 From: Juan Pablo Date: Wed, 18 Sep 2024 18:15:58 -0600 Subject: [PATCH 050/231] =?UTF-8?q?fix(PreguntasFrecuentes):=20Error=20en?= =?UTF-8?q?=20el=20controlador=20por=20un=20merge=20accidental,=20detiene?= =?UTF-8?q?=20la=20ejecuci=C3=B3n.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controllers/registrarPreguntaFrecuente.controller.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/preguntasFrecuentes/controllers/registrarPreguntaFrecuente.controller.js b/modules/preguntasFrecuentes/controllers/registrarPreguntaFrecuente.controller.js index 066ec72..317f757 100644 --- a/modules/preguntasFrecuentes/controllers/registrarPreguntaFrecuente.controller.js +++ b/modules/preguntasFrecuentes/controllers/registrarPreguntaFrecuente.controller.js @@ -1,3 +1,3 @@ -exports.getPrueba = (request, response) => { +exports.registrarPreguntaFrecuente = (request, response) => { response.json('Preguntas Frecuentes: Esta es la plantilla que deben usar.'); }; \ No newline at end of file From 048036564bd40fd696d0b149903cc9f8be62c49b Mon Sep 17 00:00:00 2001 From: AndreaMedinaRico Date: Wed, 18 Sep 2024 18:29:40 -0600 Subject: [PATCH 051/231] fix(actividades): arreglar tipo de actividad para registrarla --- app.js | 5 +---- models/actividades/evento.model.js | 2 +- models/actividades/registraActividad.model.js | 22 +++++++++++++++---- models/actividades/rodada.model.js | 2 +- models/actividades/taller.model.js | 2 +- models/ruta/ruta.model.js | 4 ++-- .../registrarActividad.controller.js | 8 +++---- .../routes/registrarActividad.routes.js | 2 +- 8 files changed, 29 insertions(+), 18 deletions(-) diff --git a/app.js b/app.js index c6dcd4f..ac1c6d1 100644 --- a/app.js +++ b/app.js @@ -19,10 +19,7 @@ app.use(compression()); // Conectar a la base de datos usando variables de entorno mongoose - .connect(process.env.MONGO_URI, { - useNewUrlParser: true, - useUnifiedTopology: true, - }) + .connect('mongodb://localhost:27017/Saca_la_Bici') .then(() => { console.log("Conectado a la base de datos de MongoDB en AWS EC2"); }) diff --git a/models/actividades/evento.model.js b/models/actividades/evento.model.js index 1527dc4..084cfa4 100644 --- a/models/actividades/evento.model.js +++ b/models/actividades/evento.model.js @@ -7,7 +7,7 @@ const eventoSchema = new mongoose.Schema ({ required: true } }, { - collection: 'Eventos' + collection: 'Evento' }); const evento = mongoose.model('Evento', eventoSchema); diff --git a/models/actividades/registraActividad.model.js b/models/actividades/registraActividad.model.js index 29a4a96..8bfa1ae 100644 --- a/models/actividades/registraActividad.model.js +++ b/models/actividades/registraActividad.model.js @@ -4,15 +4,29 @@ const Evento = require('./evento.model'); async function encontrarTipo(tipo) { if (tipo === 'rodada') return Rodada; - if (tipo === 'taller') return Taller; + if (tipo === 'taller') return {model: Taller}; if (tipo === 'evento') return Evento; + throw new Error('Tipo de actividad no válido'); } async function registrarActividad(tipo, data) { try { - const { Modelo } = await encontrarTipo(tipo); - const actividad = await Modelo.create(data); - await actividad.save(); + console.log("El tipo es: ", tipo); + if (tipo === 'rodada') { + const rodada = await Rodada.create(data); + await rodada.save(); + } else if (tipo === 'taller') { + console.log("Creando taller"); + const taller = await Taller.create(data); + console.log("Taller creado"); + await taller.save(); + console.log("Taller guardado"); + } else if (tipo === 'evento') { + const evento = await Evento.create(data); + await evento.save(); + } else { + throw new Error('Tipo de actividad no válido'); + } } catch (error) { throw(error); } diff --git a/models/actividades/rodada.model.js b/models/actividades/rodada.model.js index f210643..b43fddb 100644 --- a/models/actividades/rodada.model.js +++ b/models/actividades/rodada.model.js @@ -12,7 +12,7 @@ const rodadaSchema = new mongoose.Schema ({ required: true }, }, { - collection: 'Rodadas' + collection: 'Rodada' }); const rodada = mongoose.model('Rodada', rodadaSchema); diff --git a/models/actividades/taller.model.js b/models/actividades/taller.model.js index 3ee881b..51c2631 100644 --- a/models/actividades/taller.model.js +++ b/models/actividades/taller.model.js @@ -7,7 +7,7 @@ const tallerSchema = new mongoose.Schema ({ required: true } }, { - collection: 'Talleres' + collection: 'Taller' }); const taller = mongoose.model('Taller', tallerSchema); diff --git a/models/ruta/ruta.model.js b/models/ruta/ruta.model.js index 4e3aa98..7c166ba 100644 --- a/models/ruta/ruta.model.js +++ b/models/ruta/ruta.model.js @@ -41,8 +41,8 @@ const rutaSchema = new mongoose.Schema({ }); const Ruta = mongoose.model('Ruta', rutaSchema); -const Coordenada = mongoose.model('Coordenada', coordenadaSchema); +//const Coordenada = mongoose.model('Coordenada', coordenadaSchema); module.exports = { Ruta, - Coordenada}; \ No newline at end of file + coordenadaSchema}; \ No newline at end of file diff --git a/modules/actividades/controllers/registrarActividad.controller.js b/modules/actividades/controllers/registrarActividad.controller.js index 64f2b70..211303a 100644 --- a/modules/actividades/controllers/registrarActividad.controller.js +++ b/modules/actividades/controllers/registrarActividad.controller.js @@ -4,15 +4,15 @@ exports.getRegistrarActividad = (request, response) => { response.json('Actividad: Esta es la plantilla que deben usar.'); }; -exports.postRegistrarActividad = (request, response) => { +exports.postRegistrarActividad = async (request, response) => { const data = request.body; const tipo = request.params.tipo; try { - registrarActividad(tipo, data); - res.status(201).json({ message: 'Rodada creada exitosamente.', error }); + const registro = await registrarActividad(tipo, data); + response.status(201).json({ message: 'Rodada creada exitosamente.', error }); } catch (error) { - res.status(500).json({ message: 'Error al crear la rodada', error }); + response.status(500).json({ message: 'Error al crear la rodada', error }); } } diff --git a/modules/actividades/routes/registrarActividad.routes.js b/modules/actividades/routes/registrarActividad.routes.js index 427cc2f..5892799 100644 --- a/modules/actividades/routes/registrarActividad.routes.js +++ b/modules/actividades/routes/registrarActividad.routes.js @@ -6,6 +6,6 @@ const registrarActividadController = require('../controllers/registrarActividad. // Definir la ruta para crear una actividad router.get('/', registrarActividadController.getRegistrarActividad); -router.post('/', registrarActividadController.postRegistrarActividad); +router.post('/:tipo', registrarActividadController.postRegistrarActividad); module.exports = router; \ No newline at end of file From 5f68f1e301fdefec4329dde8017729225ce99af0 Mon Sep 17 00:00:00 2001 From: Ethan Luna Date: Wed, 18 Sep 2024 18:52:10 -0600 Subject: [PATCH 052/231] fix(): regrese la branch a su branch padre priginal y corregi la funcionalidad de modificarRol --- models/perfil/rol.model.js | 19 +++++++++ .../controllers/modificarRol.controller.js | 39 +++++++++++-------- modules/perfil/routes/modificarRol.routes.js | 8 ++++ modules/perfil/routes/perfilIndex.routes.js | 7 ++-- modules/perfil/routes/sesionIndex.routes.js | 2 +- 5 files changed, 54 insertions(+), 21 deletions(-) create mode 100644 modules/perfil/routes/modificarRol.routes.js diff --git a/models/perfil/rol.model.js b/models/perfil/rol.model.js index e69de29..424d54b 100644 --- a/models/perfil/rol.model.js +++ b/models/perfil/rol.model.js @@ -0,0 +1,19 @@ +const mongoose = require('mongoose'); + +const RolSchema = new mongoose.Schema({ + nombre: { + type: String, + required: true, + }, + createdAt: { + type: Date, + immutable: true, + default: () => Date.now(), + } +}, { + collection: 'Rol' +}); + +const Rol = mongoose.model('Rol', RolSchema); + +module.exports = Rol; \ No newline at end of file diff --git a/modules/perfil/controllers/modificarRol.controller.js b/modules/perfil/controllers/modificarRol.controller.js index 56ef57b..7ba21f2 100644 --- a/modules/perfil/controllers/modificarRol.controller.js +++ b/modules/perfil/controllers/modificarRol.controller.js @@ -1,26 +1,33 @@ -const Usuario = require('../../../usuario/models/usuario.model'); -const Rol = require('../../../rol/models/rol.model'); +const Usuario = require('../../../models/perfil/usuario.model'); +const Rol = require('../../../models/perfil/rol.model'); async function modificarRol(req, res) { - const { id } = req.params; - const { rolId } = req.body; + const { id } = req.body; // ID del usuario + const { rolId } = req.body; // ID del rol a asignar try { - //Declaración de constantes - const usuario = await Usuario.findByIdAndUpdate(id, { rolId }, { new: true }); + // Buscar el usuario y el rol + const usuario = await Usuario.findById(id); const rol = await Rol.findById(rolId); - //Validación de existencia de usuario y rol - if (!usuario) throw new Error ('Usuario no encontrado'); - if (!rol) throw new Error ('Rol no encontrado'); - - //Asignación y guardado de rol al usuario - usuario.rol = rol; + // Validar si el usuario y el rol existen + if (!usuario) { + return res.status(404).json({ error: 'Usuario no encontrado' }); + } + if (!rol) { + return res.status(404).json({ error: 'Rol no encontrado' }); + } + + // Actualizar el rol del usuario + usuario.rolId = rolId; await usuario.save(); - return usuario; + // Responder con el usuario actualizado + return res.status(200).json({ message: 'Rol actualizado exitosamente', usuario }); } catch (error) { - throw new Error ('Error al cambiar el rol: ' + error.message); - + // Manejar errores y enviar respuesta + return res.status(500).json({ error: 'Error al cambiar el rol: ' + error.message }); } -} \ No newline at end of file +} + +module.exports = { modificarRol }; diff --git a/modules/perfil/routes/modificarRol.routes.js b/modules/perfil/routes/modificarRol.routes.js new file mode 100644 index 0000000..3dfd1ae --- /dev/null +++ b/modules/perfil/routes/modificarRol.routes.js @@ -0,0 +1,8 @@ +const express = require('express'); +const router = express.Router(); + +const modificarRolController = require('../controllers/modificarRol.controller'); + +router.get('/', modificarRolController.modificarRol); + +module.exports = router; \ No newline at end of file diff --git a/modules/perfil/routes/perfilIndex.routes.js b/modules/perfil/routes/perfilIndex.routes.js index 4f3c24d..059adb8 100644 --- a/modules/perfil/routes/perfilIndex.routes.js +++ b/modules/perfil/routes/perfilIndex.routes.js @@ -1,10 +1,9 @@ const express = require('express'); const router = express.Router(); -// Importen aquí los archivos de ruta del módulo -// EJEMPLO: const registrarActividadRoute = require('./registrarActividad.routes'); +const modificarRolRoute = require('./modificarRol.routes.js'); -// Pongan la ruta que quieren usar y el archivo de la ruta de la funcionalidad -// EJEMPLO router.use('/registrar', registrarActividadRoute); +// Importar y usar las rutas en el enrutador principal del módulo +router.use('/modificar', modificarRolRoute); module.exports = router; \ No newline at end of file diff --git a/modules/perfil/routes/sesionIndex.routes.js b/modules/perfil/routes/sesionIndex.routes.js index ba94861..059adb8 100644 --- a/modules/perfil/routes/sesionIndex.routes.js +++ b/modules/perfil/routes/sesionIndex.routes.js @@ -1,7 +1,7 @@ const express = require('express'); const router = express.Router(); -const modificarRolRoute = require('./modificarRol.routes'); +const modificarRolRoute = require('./modificarRol.routes.js'); // Importar y usar las rutas en el enrutador principal del módulo router.use('/modificar', modificarRolRoute); From 24b5f31d7e73b50635df8874798783dea572fc8d Mon Sep 17 00:00:00 2001 From: Jesus0204 Date: Wed, 18 Sep 2024 19:35:02 -0600 Subject: [PATCH 053/231] fix: borrar comentarios inecesarios --- util/firebase-admin-config.js | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/util/firebase-admin-config.js b/util/firebase-admin-config.js index 4a05fc7..45de6d7 100644 --- a/util/firebase-admin-config.js +++ b/util/firebase-admin-config.js @@ -5,21 +5,5 @@ admin.initializeApp({ credential: admin.credential.cert(serviceAccount), }); -// admin.initializeApp({ -// credential: admin.credential.cert({ -// type: "service_account", -// project_id: process.env.FIREBASE_PROJECT_ID, -// private_key_id: process.env.FIREBASE_PRIVATE_KEY_ID, -// private_key: process.env.FIREBASE_PRIVATE_KEY.replace(/\\n/g, "\n"), // Reemplazar los \n con saltos de línea reales -// client_email: process.env.FIREBASE_CLIENT_EMAIL, -// client_id: process.env.FIREBASE_CLIENT_ID, -// auth_uri: process.env.FIREBASE_AUTH_URI, -// token_uri: process.env.FIREBASE_TOKEN_URI, -// auth_provider_x509_cert_url: process.env.FIREBASE_AUTH_PROVIDER_CERT_URL, -// client_x509_cert_url: process.env.FIREBASE_CLIENT_CERT_URL, -// universe_domain: "googleapis.com", -// }), -// }); - // Exportar la instancia de admin para usar en otros archivos module.exports = admin; From 1bbb1be3dac9b51a730edf9023a6b8caf230985a Mon Sep 17 00:00:00 2001 From: Diego Date: Wed, 18 Sep 2024 22:03:22 -0600 Subject: [PATCH 054/231] feat(perfil) - Backend de perfil iniciado --- models/perfil/consultarPerfil.model.js | 39 +++++++++++++++++++ .../controllers/consultarPerfil.controller.js | 19 +++++++++ .../controllers/modificarPerfil.controller.js | 19 +++++++++ .../perfil/routes/consultarPerfil.routes.js | 14 +++++++ .../perfil/routes/modificarPerfil.routes.js | 14 +++++++ modules/perfil/routes/perfilIndex.routes.js | 9 +++++ 6 files changed, 114 insertions(+) create mode 100644 models/perfil/consultarPerfil.model.js create mode 100644 modules/perfil/controllers/consultarPerfil.controller.js create mode 100644 modules/perfil/controllers/modificarPerfil.controller.js create mode 100644 modules/perfil/routes/consultarPerfil.routes.js create mode 100644 modules/perfil/routes/modificarPerfil.routes.js diff --git a/models/perfil/consultarPerfil.model.js b/models/perfil/consultarPerfil.model.js new file mode 100644 index 0000000..e1953d7 --- /dev/null +++ b/models/perfil/consultarPerfil.model.js @@ -0,0 +1,39 @@ +const mongoose = require('mongoose'); + +const DatosPerfilSchema = new mongoose.Schema({ + IDUsuario: { + type: String, + required: true, + unique: true + }, + Nombre: { + type: String, + required: true, + }, + Rodadas: { + type: Number, + required: true + }, + Kilometros: { + type: Number, + required: true + }, + Amigos: { + type: Number, + required: true + }, + Foto: { + type: String, + required: false + }, + TipoSangre: { + type: String, + required: false + } +}, { + collection: 'DatosPerfil' +}); + +const DatosPerfil = mongoose.model('DatosPerfil', DatosPerfilSchema); + +module.exports = DatosPerfil; \ No newline at end of file diff --git a/modules/perfil/controllers/consultarPerfil.controller.js b/modules/perfil/controllers/consultarPerfil.controller.js new file mode 100644 index 0000000..88dace8 --- /dev/null +++ b/modules/perfil/controllers/consultarPerfil.controller.js @@ -0,0 +1,19 @@ +const DatosPerfil = require('../../../models/perfil/consultarPerfil.model'); + +exports.consultarPerfil = async (req, res) => { + try{ + const perfil = await DatosPerfil.find(); + return res.status(200).json({ + code: 200, + msg: 'Consulta de datos de perfil exitosa', + data: datos + }); + } catch(error){ + console.error(error); + return res.status(500).json({ + code: 500, + msg: 'Error al intentar consultar las preguntas frecuentes', + data: null + }); + } +} \ No newline at end of file diff --git a/modules/perfil/controllers/modificarPerfil.controller.js b/modules/perfil/controllers/modificarPerfil.controller.js new file mode 100644 index 0000000..acd4807 --- /dev/null +++ b/modules/perfil/controllers/modificarPerfil.controller.js @@ -0,0 +1,19 @@ +const DatosPerfil = require('../../../models/perfil/consultarPerfil.model'); + +exports.modificarPerfil = async (req, res) => { + try{ + const perfil = await DatosPerfil.find(); + return res.status(200).json({ + code: 200, + msg: 'Consulta de datos de perfil exitosa', + data: datos + }); + } catch(error){ + console.error(error); + return res.status(500).json({ + code: 500, + msg: 'Error al intentar consultar las preguntas frecuentes', + data: null + }); + } +} \ No newline at end of file diff --git a/modules/perfil/routes/consultarPerfil.routes.js b/modules/perfil/routes/consultarPerfil.routes.js new file mode 100644 index 0000000..2559ecb --- /dev/null +++ b/modules/perfil/routes/consultarPerfil.routes.js @@ -0,0 +1,14 @@ +const express = require('express'); +const router = express.Router(); + +// Importen aquí los archivos de ruta del módulo +// EJEMPLO: const registrarActividadRoute = require('./registrarActividad.routes'); + +// Pongan la ruta que quieren usar y el archivo de la ruta de la funcionalidad +// EJEMPLO router.use('/registrar', registrarActividadRoute); + +const consultarPerfil = require('../controllers/consultarPerfil.controller'); + +router.get('/', consultarPerfil.consultarPerfil) + +module.exports = router; \ No newline at end of file diff --git a/modules/perfil/routes/modificarPerfil.routes.js b/modules/perfil/routes/modificarPerfil.routes.js new file mode 100644 index 0000000..6e18235 --- /dev/null +++ b/modules/perfil/routes/modificarPerfil.routes.js @@ -0,0 +1,14 @@ +const express = require('express'); +const router = express.Router(); + +// Importen aquí los archivos de ruta del módulo +// EJEMPLO: const registrarActividadRoute = require('./registrarActividad.routes'); + +// Pongan la ruta que quieren usar y el archivo de la ruta de la funcionalidad +// EJEMPLO router.use('/registrar', registrarActividadRoute); + +const modificarPerfil = require('../controllers/modificarPerfil.controller'); + +router.get('/', modificarPerfil.modificarPerfil) + +module.exports = router; \ No newline at end of file diff --git a/modules/perfil/routes/perfilIndex.routes.js b/modules/perfil/routes/perfilIndex.routes.js index 4f3c24d..470bc79 100644 --- a/modules/perfil/routes/perfilIndex.routes.js +++ b/modules/perfil/routes/perfilIndex.routes.js @@ -7,4 +7,13 @@ const router = express.Router(); // Pongan la ruta que quieren usar y el archivo de la ruta de la funcionalidad // EJEMPLO router.use('/registrar', registrarActividadRoute); + + +const consultarPerfilRoutes = require('./consultarPerfil.routes'); +const modificarPerfilRoutes = require('./modificarPerfil.routes'); + + +router.get('/consultar', consultarPerfilRoutes) +router.get('/modificar', modificarPerfilRoutes) + module.exports = router; \ No newline at end of file From f0632f8086612e3ffb00add146543cd300dbb656 Mon Sep 17 00:00:00 2001 From: DanielQueijeiro Date: Wed, 18 Sep 2024 22:05:20 -0600 Subject: [PATCH 055/231] Comentar error de rutas FAQ --- .../routes/registrarPreguntasFrecuentes.routes.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/preguntasFrecuentes/routes/registrarPreguntasFrecuentes.routes.js b/modules/preguntasFrecuentes/routes/registrarPreguntasFrecuentes.routes.js index 037e83d..48a71d3 100644 --- a/modules/preguntasFrecuentes/routes/registrarPreguntasFrecuentes.routes.js +++ b/modules/preguntasFrecuentes/routes/registrarPreguntasFrecuentes.routes.js @@ -1,8 +1,8 @@ const express = require('express'); const router = express.Router(); -const registrarPregunta = require('../controllers/registrarPreguntaFrecuente.controller'); +//const registrarPregunta = require('../controllers/registrarPreguntaFrecuente.controller'); -router.post('/', registrarPregunta.registrarPreguntaFrecuente); +//router.post('/', registrarPregunta.registrarPreguntaFrecuente); module.exports = router; \ No newline at end of file From 7998eba0b8b599ad9ba190bc0d152837ebfcdaa6 Mon Sep 17 00:00:00 2001 From: Angeltrek Date: Thu, 19 Sep 2024 00:53:49 -0600 Subject: [PATCH 056/231] fix: usuario model --- models/perfil/usuario.model.js | 81 ++++++++++++++++------------------ 1 file changed, 39 insertions(+), 42 deletions(-) diff --git a/models/perfil/usuario.model.js b/models/perfil/usuario.model.js index e0a35ec..c33a4af 100644 --- a/models/perfil/usuario.model.js +++ b/models/perfil/usuario.model.js @@ -1,47 +1,44 @@ const mongoose = require("mongoose"); -const usuarioSchema = new mongoose.Schema({ - username: { - type: String, - required: true, - unique: true, - }, - nombre: { - type: String, - required: true, - }, - fechaNacimiento: { - type: Date, - immutable: true, - required: true, - }, - tipoSangre: { - type: String, - required: true, - }, - correoElectronico: { - type: String, - required: true, - unique: true, - }, - numeroEmergencia: { - type: String, - required: true, - }, - fechaRegistro: { - type: Date, - immutable: true, - default: Date.now, - }, - firebaseUID: { - type: String, - unique: true, - required: true, - }, -}, { - collection: "Usuario", -}); +const usuarioSchema = new mongoose.Schema( + { + username: { + type: String, + required: true, + }, + nombre: { + type: String, + }, + fechaNacimiento: { + type: Date, + }, + tipoSangre: { + type: String, + }, + correoElectronico: { + type: String, + required: true, + unique: true, + }, + numeroEmergencia: { + type: String, + }, + fechaRegistro: { + type: Date, + immutable: true, + default: Date.now, + }, + firebaseUID: { + type: String, + unique: true, + required: true, + }, + }, + { + collection: "Usuario", + } +); const Usuario = mongoose.model("Usuario", usuarioSchema); -module.exports = Usuario; \ No newline at end of file +module.exports = Usuario; From 50966b5c077ec3109c11a204d28a408d81ddc567 Mon Sep 17 00:00:00 2001 From: DanielContrerasCh Date: Thu, 19 Sep 2024 08:21:02 -0600 Subject: [PATCH 057/231] =?UTF-8?q?feature:=20Registrar=20anuncios,=20cone?= =?UTF-8?q?xi=C3=B3n=20front=20y=20back?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- models/otros/anuncio.model.js | 5 +++++ modules/anuncios/controllers/registrarAnuncio.controller.js | 2 ++ 2 files changed, 7 insertions(+) diff --git a/models/otros/anuncio.model.js b/models/otros/anuncio.model.js index 896f5ba..ea4906a 100644 --- a/models/otros/anuncio.model.js +++ b/models/otros/anuncio.model.js @@ -33,6 +33,11 @@ const announcementSchema = new mongoose.Schema({ const Anuncio = mongoose.model('Anuncio', announcementSchema); async function postAnnouncement(IDUsuario, titulo, contenido, imagen){ + console.log("LLEGAMOS AL MODEL") + console.log('IDUsuario:', IDUsuario); + console.log('titulo:', titulo); + console.log('contenido:', contenido); + console.log('imagen:', imagen); try { const announcement = await Anuncio.create({ IDUsuario: IDUsuario, diff --git a/modules/anuncios/controllers/registrarAnuncio.controller.js b/modules/anuncios/controllers/registrarAnuncio.controller.js index edf6712..c7a2769 100644 --- a/modules/anuncios/controllers/registrarAnuncio.controller.js +++ b/modules/anuncios/controllers/registrarAnuncio.controller.js @@ -3,6 +3,8 @@ const Announcement = require('../../../models/otros/anuncio.model'); exports.postAnnouncement = async (request, response) => { const idUsuario = request.body.IDUsuario; + console.log("LLEGAMOS AL CONTROLLER") + console.log('IDUsuario:', idUsuario); const titulo = request.body.titulo; const contenido = request.body.contenido; const imagen = request.body.imagen; From b3d40d100f1c3cbe3f15b24b5785d28787f38535 Mon Sep 17 00:00:00 2001 From: DanielContrerasCh Date: Thu, 19 Sep 2024 08:59:02 -0600 Subject: [PATCH 058/231] Fix: Quitar logs --- models/otros/anuncio.model.js | 5 ----- modules/anuncios/controllers/registrarAnuncio.controller.js | 2 -- 2 files changed, 7 deletions(-) diff --git a/models/otros/anuncio.model.js b/models/otros/anuncio.model.js index ea4906a..896f5ba 100644 --- a/models/otros/anuncio.model.js +++ b/models/otros/anuncio.model.js @@ -33,11 +33,6 @@ const announcementSchema = new mongoose.Schema({ const Anuncio = mongoose.model('Anuncio', announcementSchema); async function postAnnouncement(IDUsuario, titulo, contenido, imagen){ - console.log("LLEGAMOS AL MODEL") - console.log('IDUsuario:', IDUsuario); - console.log('titulo:', titulo); - console.log('contenido:', contenido); - console.log('imagen:', imagen); try { const announcement = await Anuncio.create({ IDUsuario: IDUsuario, diff --git a/modules/anuncios/controllers/registrarAnuncio.controller.js b/modules/anuncios/controllers/registrarAnuncio.controller.js index c7a2769..edf6712 100644 --- a/modules/anuncios/controllers/registrarAnuncio.controller.js +++ b/modules/anuncios/controllers/registrarAnuncio.controller.js @@ -3,8 +3,6 @@ const Announcement = require('../../../models/otros/anuncio.model'); exports.postAnnouncement = async (request, response) => { const idUsuario = request.body.IDUsuario; - console.log("LLEGAMOS AL CONTROLLER") - console.log('IDUsuario:', idUsuario); const titulo = request.body.titulo; const contenido = request.body.contenido; const imagen = request.body.imagen; From ffbaddfbb2ab4bac772c961ced5cdc4dd4831de1 Mon Sep 17 00:00:00 2001 From: Angeltrek Date: Thu, 19 Sep 2024 14:14:14 -0600 Subject: [PATCH 059/231] Fix: Added user profile image --- app.js | 2 +- models/perfil/usuario.model.js | 15 +++ .../registrarUsuario.controller.js | 101 +++++++++--------- 3 files changed, 68 insertions(+), 50 deletions(-) diff --git a/app.js b/app.js index c6dcd4f..c9c5bb5 100644 --- a/app.js +++ b/app.js @@ -3,7 +3,7 @@ const express = require("express"); const mongoose = require("mongoose"); const app = express(); -const port = process.env.PORT || 7070; +const port = process.env.PORT || 8080; const bodyParser = require("body-parser"); diff --git a/models/perfil/usuario.model.js b/models/perfil/usuario.model.js index c33a4af..77aeeea 100644 --- a/models/perfil/usuario.model.js +++ b/models/perfil/usuario.model.js @@ -15,6 +15,9 @@ const usuarioSchema = new mongoose.Schema( tipoSangre: { type: String, }, + imagen: { + type: String, + }, correoElectronico: { type: String, required: true, @@ -28,6 +31,18 @@ const usuarioSchema = new mongoose.Schema( immutable: true, default: Date.now, }, + kilometrosRecorridos: { + type: Number, + default: 0, + }, + tiempoEnRecorrido: { + type: Number, + default: 0.0, + }, + rodadasCompletadas: { + type: Number, + default: 0, + }, firebaseUID: { type: String, unique: true, diff --git a/modules/session/controllers/registrarUsuario.controller.js b/modules/session/controllers/registrarUsuario.controller.js index 25dc826..6685170 100644 --- a/modules/session/controllers/registrarUsuario.controller.js +++ b/modules/session/controllers/registrarUsuario.controller.js @@ -1,77 +1,80 @@ -// const admin = require('../../../util/firebase'); const Usuario = require("../../../models/perfil/usuario.model"); const Rol = require("../../../models/perfil/rol.model"); const PoseeRol = require("../../../models/perfil/poseeRol.model"); // Modelo para la relación entre usuario y rol exports.registrarUsuario = async (request, response) => { - try { - // Sacar los datos body - const { - username, - nombre, - fechaNacimiento, - tipoSangre, - correoElectronico, - numeroEmergencia, - firebaseUID, - } = request.body; - - // Verificar si el usuario ya está registrado en MongoDB - let existingUser = await Usuario.findOne({ - firebaseUID - }); + try { + // Extraer los datos del body + const { + username, + nombre, + fechaNacimiento, + tipoSangre, + correoElectronico, + numeroEmergencia, + firebaseUID, + } = request.body; + + // Validar que los campos requeridos estén presentes + if (!username || !correoElectronico || !firebaseUID) { + return response.status(400).json({ + message: + "Faltan datos requeridos: username, correoElectronico o firebaseUID", + }); + } + + // Verificar si el usuario ya está registrado en MongoDB + let existingUser = await Usuario.findOne({ firebaseUID }); if (existingUser) { - // Si el usuario ya existe, responder con éxito - return response.status(200).json({ - message: "Usuario ya registrado", - user: existingUser, - }); + // Si el usuario ya existe, responder con éxito + return response.status(200).json({ + message: "Usuario ya registrado", + user: existingUser, + }); } - // Buscar el rol Usuario - const rolUsuario = await Rol.findOne({ - nombre: "Usuario", - }); + // Buscar el rol "Usuario" + const rolUsuario = await Rol.findOne({ nombre: "Usuario" }); if (!rolUsuario) { - return response.status(404).json({ + return response.status(404).json({ message: "Rol Usuario no encontrado", - }); + }); } - // Crear el usuario en MongoDB, por ahora sin firebaseUID + // Crear el usuario en MongoDB const newUser = new Usuario({ - username, - nombre, - fechaNacimiento, - tipoSangre, - correoElectronico, - numeroEmergencia, - firebaseUID, + username, + nombre, + fechaNacimiento, + tipoSangre, + correoElectronico, + numeroEmergencia, + firebaseUID, }); await newUser.save(); - // Poblar la tabla Posee con la relación entre el usuario y el rol + // Crear la relación entre el usuario y el rol en la tabla PoseeRol const poseeRol = new PoseeRol({ - // ObjectId del nuevo usuario - IDUsuario: newUser._id, - // ObjectId del rol "Usuario" - IDRol: rolUsuario._id, + IDUsuario: newUser._id, // ObjectId del nuevo usuario + IDRol: rolUsuario._id, // ObjectId del rol "Usuario" }); - // Guardar la relación en la tabla Posee await poseeRol.save(); + // Responder con éxito response.status(201).json({ - message: "User registrado con éxito", - user: newUser, + message: "Usuario registrado con éxito", + user: newUser, }); - - } catch (error) { - response.status(400).json({ - error: error.message, + } catch (error) { + // Manejo de errores + console.error("Error al registrar usuario:", error); + response.status(500).json({ + message: "Error interno del servidor", + error: error.message, }); -} + } }; From 304731868f430597c3d6d1dfa12226e73efc4934 Mon Sep 17 00:00:00 2001 From: Angeltrek Date: Thu, 19 Sep 2024 14:20:46 -0600 Subject: [PATCH 060/231] fix: removed unnecesary file --- Backend.code-workspace | 7 ------- 1 file changed, 7 deletions(-) delete mode 100644 Backend.code-workspace diff --git a/Backend.code-workspace b/Backend.code-workspace deleted file mode 100644 index 362d7c2..0000000 --- a/Backend.code-workspace +++ /dev/null @@ -1,7 +0,0 @@ -{ - "folders": [ - { - "path": "." - } - ] -} \ No newline at end of file From 46fb176077b04566f94fa675f5a472bac44d2850 Mon Sep 17 00:00:00 2001 From: Zathiald Date: Thu, 19 Sep 2024 15:38:54 -0600 Subject: [PATCH 061/231] Feat: Agregar funciones de consultar ruta --- .../controllers/consultarMapa.controller.js | 26 +++++++++++++-- .../controllers/modificarRuta.controller.js | 32 +++++++++++++++++++ modules/mapa/routes/consultarMapa.routes.js | 8 ++--- modules/mapa/routes/mapaIndex.routes.js | 6 ++++ modules/mapa/routes/modificarRuta.routes.js | 10 ++++++ 5 files changed, 76 insertions(+), 6 deletions(-) create mode 100644 modules/mapa/controllers/modificarRuta.controller.js create mode 100644 modules/mapa/routes/modificarRuta.routes.js diff --git a/modules/mapa/controllers/consultarMapa.controller.js b/modules/mapa/controllers/consultarMapa.controller.js index e618800..c9abfd2 100644 --- a/modules/mapa/controllers/consultarMapa.controller.js +++ b/modules/mapa/controllers/consultarMapa.controller.js @@ -1,3 +1,25 @@ -exports.getPrueba = (request, response) => { - response.json('Mapa: Esta es la plantilla que deben usar.'); +const Ruta = require('../../../models/ruta/ruta.model'); + +exports.getRutas = async (req, res) => { + try { + const rutas = await Ruta.find({}) + res.json(rutas); + } catch (error) { + res.status(500).json({ message: 'Error al obtener las rutas', error }); + } +}; + +exports.getRuta = async (req, res) => { + try { + const { id } = req.params; // Obtén el ID de los parámetros de la solicitud + const ruta = await Ruta.findById(id); // Busca la ruta por ID + + if (!ruta) { + return res.status(404).json({ message: 'Ruta no encontrada' }); + } + + res.json(ruta); + } catch (error) { + res.status(500).json({ message: 'Error al obtener la ruta', error }); + } }; \ No newline at end of file diff --git a/modules/mapa/controllers/modificarRuta.controller.js b/modules/mapa/controllers/modificarRuta.controller.js new file mode 100644 index 0000000..812a72e --- /dev/null +++ b/modules/mapa/controllers/modificarRuta.controller.js @@ -0,0 +1,32 @@ +const Ruta = require('../../../models/ruta/ruta.model'); + +exports.modificarRuta = async (req, res) => { + try { + const rutaId = req.params.id; // Asume que el ID de la ruta se pasa como parámetro en la URL + + const rutaActualizada = { + titulo: req.body.Titulo, + distancia: req.body.Distancia, + tiempo: req.body.Tiempo, + nivel: req.body.Nivel, + lugar: req.body.Lugar, + descanso: req.body.Descanso, + coordenadas: req.body.Coordenadas, + }; + + // Actualiza la ruta existente + const rutaModificada = await Ruta.findByIdAndUpdate(rutaId, rutaActualizada, { new: true }); + + if (!rutaModificada) { + return res.status(404).json({ message: 'Ruta no encontrada' }); + } + + res.status(200).json(rutaModificada); + } catch (error) { + console.error('Error al modificar la ruta:', error); + res.status(500).json({ + message: 'Error al modificar la ruta', + error: error.message || error + }); + } +}; \ No newline at end of file diff --git a/modules/mapa/routes/consultarMapa.routes.js b/modules/mapa/routes/consultarMapa.routes.js index fede7fd..c894ac1 100644 --- a/modules/mapa/routes/consultarMapa.routes.js +++ b/modules/mapa/routes/consultarMapa.routes.js @@ -1,10 +1,10 @@ const express = require('express'); const router = express.Router(); -// Importar el controlador que maneja la Funcionalidad que quieres -// EJEMPLO: const registrarAnuncioController = require('../controllers/registrarAnuncio.controller'); + const consultarMapaController = require('../controllers/consultarMapa.controller'); -// Definir la ruta para la funcionalidad y la funcion del controlador -// EJEMPLO: router.get('/', registrarActividadController.getPrueba); +router.get('/', consultarMapaController.getRutas); + +router.get('/:id', consultarMapaController.getRuta); module.exports = router; \ No newline at end of file diff --git a/modules/mapa/routes/mapaIndex.routes.js b/modules/mapa/routes/mapaIndex.routes.js index 21036cc..95446fd 100644 --- a/modules/mapa/routes/mapaIndex.routes.js +++ b/modules/mapa/routes/mapaIndex.routes.js @@ -2,7 +2,13 @@ const express = require('express'); const router = express.Router(); const registrarRutaRoute = require('./registrarRuta.routes'); +const modificarRutaRoute = require('./modificarRuta.routes'); +const consultarRutaRoute = require('./consultarMapa.routes'); + +router.use('/consultarRutas', consultarRutaRoute); router.use('/', registrarRutaRoute); +router.use('/', modificarRutaRoute); + module.exports = router; \ No newline at end of file diff --git a/modules/mapa/routes/modificarRuta.routes.js b/modules/mapa/routes/modificarRuta.routes.js new file mode 100644 index 0000000..a759481 --- /dev/null +++ b/modules/mapa/routes/modificarRuta.routes.js @@ -0,0 +1,10 @@ +const express = require('express'); +const router = express.Router(); + +// Importar el controlador que maneja la modificacion de rutas +const modificarRutaController = require('../controllers/modificarRuta.controller'); + +// Definir la ruta para modificar una ruta +router.put('/modificarRuta/:id', modificarRutaController.modificarRuta); + +module.exports = router; \ No newline at end of file From df020e9afc87c8e63faeb2a9d2b8ea13b9a53732 Mon Sep 17 00:00:00 2001 From: Zathiald Date: Thu, 19 Sep 2024 16:16:37 -0600 Subject: [PATCH 062/231] Fix: Actualizar package-lock --- package-lock.json | 1887 ++++++++++++++++++++++++++++++++++++--------- 1 file changed, 1518 insertions(+), 369 deletions(-) diff --git a/package-lock.json b/package-lock.json index 7061949..5967d03 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,9 @@ "license": "MIT", "dependencies": { "compression": "^1.7.4", - "express": "^4.19.2", + "dotenv": "^16.4.5", + "express": "^4.21.0", + "firebase-admin": "^12.4.0", "mongoose": "^8.6.0", "nodemon": "^3.1.4" }, @@ -22,8 +24,6 @@ }, "node_modules/@eslint-community/eslint-utils": { "version": "4.4.0", - "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", - "integrity": "sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==", "dev": true, "license": "MIT", "dependencies": { @@ -38,8 +38,6 @@ }, "node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys": { "version": "3.4.3", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", - "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", "dev": true, "license": "Apache-2.0", "engines": { @@ -51,8 +49,6 @@ }, "node_modules/@eslint-community/regexpp": { "version": "4.11.0", - "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.11.0.tgz", - "integrity": "sha512-G/M/tIiMrTAxEWRfLfQJMmGNX28IxBg4PBz8XqQhqUHLFI6TL2htpIB1iQCj144V5ee/JaKyT9/WZ0MGZWfA7A==", "dev": true, "license": "MIT", "engines": { @@ -61,8 +57,6 @@ }, "node_modules/@eslint/config-array": { "version": "0.18.0", - "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.18.0.tgz", - "integrity": "sha512-fTxvnS1sRMu3+JjXwJG0j/i4RT9u4qJ+lqS/yCGap4lH4zZGzQ7tu+xZqQmcMZq5OBZDL4QRxQzRjkWcGt8IVw==", "dev": true, "license": "Apache-2.0", "dependencies": { @@ -76,8 +70,6 @@ }, "node_modules/@eslint/config-array/node_modules/debug": { "version": "4.3.6", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.6.tgz", - "integrity": "sha512-O/09Bd4Z1fBrU4VzkhFqVgpPzaGbw6Sm9FEkBT1A/YBXQFGuuSxa1dN2nxgxS34JmKXqYx8CZAwEVoJFImUXIg==", "dev": true, "license": "MIT", "dependencies": { @@ -94,15 +86,11 @@ }, "node_modules/@eslint/config-array/node_modules/ms": { "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "dev": true, "license": "MIT" }, "node_modules/@eslint/eslintrc": { "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.1.0.tgz", - "integrity": "sha512-4Bfj15dVJdoy3RfZmmo86RK1Fwzn6SstsvK9JS+BaVKqC6QQQQyXekNaC+g+LKNgkQ+2VhGAzm6hO40AhMR3zQ==", "dev": true, "license": "MIT", "dependencies": { @@ -125,8 +113,6 @@ }, "node_modules/@eslint/eslintrc/node_modules/debug": { "version": "4.3.6", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.6.tgz", - "integrity": "sha512-O/09Bd4Z1fBrU4VzkhFqVgpPzaGbw6Sm9FEkBT1A/YBXQFGuuSxa1dN2nxgxS34JmKXqYx8CZAwEVoJFImUXIg==", "dev": true, "license": "MIT", "dependencies": { @@ -143,8 +129,6 @@ }, "node_modules/@eslint/eslintrc/node_modules/globals": { "version": "14.0.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-14.0.0.tgz", - "integrity": "sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==", "dev": true, "license": "MIT", "engines": { @@ -156,15 +140,11 @@ }, "node_modules/@eslint/eslintrc/node_modules/ms": { "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "dev": true, "license": "MIT" }, "node_modules/@eslint/js": { "version": "9.9.1", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.9.1.tgz", - "integrity": "sha512-xIDQRsfg5hNBqHz04H1R3scSVwmI+KUbqjsQKHKQ1DAUSaUjYPReZZmS/5PNiKu1fUvzDd6H7DEDKACSEhu+TQ==", "dev": true, "license": "MIT", "engines": { @@ -173,18 +153,189 @@ }, "node_modules/@eslint/object-schema": { "version": "2.1.4", - "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-2.1.4.tgz", - "integrity": "sha512-BsWiH1yFGjXXS2yvrf5LyuoSIIbPrGUWob917o+BTKuZ7qJdxX8aJLRxs1fS9n6r7vESrq1OUqb68dANcFXuQQ==", "dev": true, "license": "Apache-2.0", "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } }, + "node_modules/@fastify/busboy": { + "version": "3.0.0", + "license": "MIT" + }, + "node_modules/@firebase/app-check-interop-types": { + "version": "0.3.2", + "license": "Apache-2.0" + }, + "node_modules/@firebase/app-types": { + "version": "0.9.2", + "license": "Apache-2.0" + }, + "node_modules/@firebase/auth-interop-types": { + "version": "0.2.3", + "license": "Apache-2.0" + }, + "node_modules/@firebase/component": { + "version": "0.6.8", + "license": "Apache-2.0", + "dependencies": { + "@firebase/util": "1.9.7", + "tslib": "^2.1.0" + } + }, + "node_modules/@firebase/database": { + "version": "1.0.7", + "license": "Apache-2.0", + "dependencies": { + "@firebase/app-check-interop-types": "0.3.2", + "@firebase/auth-interop-types": "0.2.3", + "@firebase/component": "0.6.8", + "@firebase/logger": "0.4.2", + "@firebase/util": "1.9.7", + "faye-websocket": "0.11.4", + "tslib": "^2.1.0" + } + }, + "node_modules/@firebase/database-compat": { + "version": "1.0.7", + "license": "Apache-2.0", + "dependencies": { + "@firebase/component": "0.6.8", + "@firebase/database": "1.0.7", + "@firebase/database-types": "1.0.4", + "@firebase/logger": "0.4.2", + "@firebase/util": "1.9.7", + "tslib": "^2.1.0" + } + }, + "node_modules/@firebase/database-types": { + "version": "1.0.4", + "license": "Apache-2.0", + "dependencies": { + "@firebase/app-types": "0.9.2", + "@firebase/util": "1.9.7" + } + }, + "node_modules/@firebase/logger": { + "version": "0.4.2", + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.1.0" + } + }, + "node_modules/@firebase/util": { + "version": "1.9.7", + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.1.0" + } + }, + "node_modules/@google-cloud/firestore": { + "version": "7.10.0", + "license": "Apache-2.0", + "optional": true, + "dependencies": { + "@opentelemetry/api": "^1.3.0", + "fast-deep-equal": "^3.1.1", + "functional-red-black-tree": "^1.0.1", + "google-gax": "^4.3.3", + "protobufjs": "^7.2.6" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@google-cloud/paginator": { + "version": "5.0.2", + "license": "Apache-2.0", + "optional": true, + "dependencies": { + "arrify": "^2.0.0", + "extend": "^3.0.2" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@google-cloud/projectify": { + "version": "4.0.0", + "license": "Apache-2.0", + "optional": true, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@google-cloud/promisify": { + "version": "4.0.0", + "license": "Apache-2.0", + "optional": true, + "engines": { + "node": ">=14" + } + }, + "node_modules/@google-cloud/storage": { + "version": "7.12.1", + "license": "Apache-2.0", + "optional": true, + "dependencies": { + "@google-cloud/paginator": "^5.0.0", + "@google-cloud/projectify": "^4.0.0", + "@google-cloud/promisify": "^4.0.0", + "abort-controller": "^3.0.0", + "async-retry": "^1.3.3", + "duplexify": "^4.1.3", + "fast-xml-parser": "^4.4.1", + "gaxios": "^6.0.2", + "google-auth-library": "^9.6.3", + "html-entities": "^2.5.2", + "mime": "^3.0.0", + "p-limit": "^3.0.1", + "retry-request": "^7.0.0", + "teeny-request": "^9.0.0", + "uuid": "^8.0.0" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/@google-cloud/storage/node_modules/mime": { + "version": "3.0.0", + "license": "MIT", + "optional": true, + "bin": { + "mime": "cli.js" + }, + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/@google-cloud/storage/node_modules/uuid": { + "version": "8.3.2", + "license": "MIT", + "optional": true, + "bin": { + "uuid": "dist/bin/uuid" + } + }, + "node_modules/@grpc/proto-loader": { + "version": "0.7.13", + "license": "Apache-2.0", + "optional": true, + "dependencies": { + "lodash.camelcase": "^4.3.0", + "long": "^5.0.0", + "protobufjs": "^7.2.5", + "yargs": "^17.7.2" + }, + "bin": { + "proto-loader-gen-types": "build/bin/proto-loader-gen-types.js" + }, + "engines": { + "node": ">=6" + } + }, "node_modules/@humanwhocodes/module-importer": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", - "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", "dev": true, "license": "Apache-2.0", "engines": { @@ -197,8 +348,6 @@ }, "node_modules/@humanwhocodes/retry": { "version": "0.3.0", - "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.3.0.tgz", - "integrity": "sha512-d2CGZR2o7fS6sWB7DG/3a95bGKQyHMACZ5aW8qGkkqQpUoZV6C0X7Pc7l4ZNMZkfNBf4VWNe9E1jRsf0G146Ew==", "dev": true, "license": "Apache-2.0", "engines": { @@ -209,10 +358,17 @@ "url": "https://github.com/sponsors/nzakas" } }, + "node_modules/@js-sdsl/ordered-map": { + "version": "4.4.2", + "license": "MIT", + "optional": true, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/js-sdsl" + } + }, "node_modules/@mongodb-js/saslprep": { "version": "1.1.8", - "resolved": "https://registry.npmjs.org/@mongodb-js/saslprep/-/saslprep-1.1.8.tgz", - "integrity": "sha512-qKwC/M/nNNaKUBMQ0nuzm47b7ZYWQHN3pcXq4IIcoSBc2hOIrflAxJduIvvqmhoz3gR2TacTAs8vlsCVPkiEdQ==", "license": "MIT", "dependencies": { "sparse-bitfield": "^3.0.3" @@ -220,8 +376,6 @@ }, "node_modules/@nodelib/fs.scandir": { "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", - "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", "dev": true, "license": "MIT", "dependencies": { @@ -234,8 +388,6 @@ }, "node_modules/@nodelib/fs.stat": { "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", - "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", "dev": true, "license": "MIT", "engines": { @@ -244,8 +396,6 @@ }, "node_modules/@nodelib/fs.walk": { "version": "1.2.8", - "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", - "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", "dev": true, "license": "MIT", "dependencies": { @@ -256,25 +406,208 @@ "node": ">= 8" } }, + "node_modules/@opentelemetry/api": { + "version": "1.9.0", + "license": "Apache-2.0", + "optional": true, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/@protobufjs/aspromise": { + "version": "1.1.2", + "license": "BSD-3-Clause", + "optional": true + }, + "node_modules/@protobufjs/base64": { + "version": "1.1.2", + "license": "BSD-3-Clause", + "optional": true + }, + "node_modules/@protobufjs/codegen": { + "version": "2.0.4", + "license": "BSD-3-Clause", + "optional": true + }, + "node_modules/@protobufjs/eventemitter": { + "version": "1.1.0", + "license": "BSD-3-Clause", + "optional": true + }, + "node_modules/@protobufjs/fetch": { + "version": "1.1.0", + "license": "BSD-3-Clause", + "optional": true, + "dependencies": { + "@protobufjs/aspromise": "^1.1.1", + "@protobufjs/inquire": "^1.1.0" + } + }, + "node_modules/@protobufjs/float": { + "version": "1.0.2", + "license": "BSD-3-Clause", + "optional": true + }, + "node_modules/@protobufjs/inquire": { + "version": "1.1.0", + "license": "BSD-3-Clause", + "optional": true + }, + "node_modules/@protobufjs/path": { + "version": "1.1.2", + "license": "BSD-3-Clause", + "optional": true + }, + "node_modules/@protobufjs/pool": { + "version": "1.1.0", + "license": "BSD-3-Clause", + "optional": true + }, + "node_modules/@protobufjs/utf8": { + "version": "1.1.0", + "license": "BSD-3-Clause", + "optional": true + }, + "node_modules/@tootallnate/once": { + "version": "2.0.0", + "license": "MIT", + "optional": true, + "engines": { + "node": ">= 10" + } + }, + "node_modules/@types/body-parser": { + "version": "1.19.5", + "license": "MIT", + "dependencies": { + "@types/connect": "*", + "@types/node": "*" + } + }, + "node_modules/@types/caseless": { + "version": "0.12.5", + "license": "MIT", + "optional": true + }, + "node_modules/@types/connect": { + "version": "3.4.38", + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/express": { + "version": "4.17.21", + "license": "MIT", + "dependencies": { + "@types/body-parser": "*", + "@types/express-serve-static-core": "^4.17.33", + "@types/qs": "*", + "@types/serve-static": "*" + } + }, + "node_modules/@types/express-serve-static-core": { + "version": "4.19.5", + "license": "MIT", + "dependencies": { + "@types/node": "*", + "@types/qs": "*", + "@types/range-parser": "*", + "@types/send": "*" + } + }, + "node_modules/@types/http-errors": { + "version": "2.0.4", + "license": "MIT" + }, + "node_modules/@types/jsonwebtoken": { + "version": "9.0.6", + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/long": { + "version": "4.0.2", + "license": "MIT", + "optional": true + }, + "node_modules/@types/mime": { + "version": "1.3.5", + "license": "MIT" + }, + "node_modules/@types/node": { + "version": "22.5.4", + "license": "MIT", + "dependencies": { + "undici-types": "~6.19.2" + } + }, + "node_modules/@types/qs": { + "version": "6.9.15", + "license": "MIT" + }, + "node_modules/@types/range-parser": { + "version": "1.2.7", + "license": "MIT" + }, + "node_modules/@types/request": { + "version": "2.48.12", + "license": "MIT", + "optional": true, + "dependencies": { + "@types/caseless": "*", + "@types/node": "*", + "@types/tough-cookie": "*", + "form-data": "^2.5.0" + } + }, + "node_modules/@types/send": { + "version": "0.17.4", + "license": "MIT", + "dependencies": { + "@types/mime": "^1", + "@types/node": "*" + } + }, + "node_modules/@types/serve-static": { + "version": "1.15.7", + "license": "MIT", + "dependencies": { + "@types/http-errors": "*", + "@types/node": "*", + "@types/send": "*" + } + }, + "node_modules/@types/tough-cookie": { + "version": "4.0.5", + "license": "MIT", + "optional": true + }, "node_modules/@types/webidl-conversions": { "version": "7.0.3", - "resolved": "https://registry.npmjs.org/@types/webidl-conversions/-/webidl-conversions-7.0.3.tgz", - "integrity": "sha512-CiJJvcRtIgzadHCYXw7dqEnMNRjhGZlYK05Mj9OyktqV8uVT8fD2BFOB7S1uwBE3Kj2Z+4UyPmFw/Ixgw/LAlA==", "license": "MIT" }, "node_modules/@types/whatwg-url": { "version": "11.0.5", - "resolved": "https://registry.npmjs.org/@types/whatwg-url/-/whatwg-url-11.0.5.tgz", - "integrity": "sha512-coYR071JRaHa+xoEvvYqvnIHaVqaYrLPbsufM9BF63HkwI5Lgmy2QR8Q5K/lYDYo5AK82wOvSOS0UsLTpTG7uQ==", "license": "MIT", "dependencies": { "@types/webidl-conversions": "*" } }, + "node_modules/abort-controller": { + "version": "3.0.0", + "license": "MIT", + "optional": true, + "dependencies": { + "event-target-shim": "^5.0.0" + }, + "engines": { + "node": ">=6.5" + } + }, "node_modules/accepts": { "version": "1.3.8", - "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", - "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", "license": "MIT", "dependencies": { "mime-types": "~2.1.34", @@ -286,8 +619,6 @@ }, "node_modules/acorn": { "version": "8.12.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.12.1.tgz", - "integrity": "sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg==", "dev": true, "license": "MIT", "bin": { @@ -299,18 +630,46 @@ }, "node_modules/acorn-jsx": { "version": "5.3.2", - "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", - "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", "dev": true, "license": "MIT", "peerDependencies": { "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" } }, + "node_modules/agent-base": { + "version": "7.1.1", + "license": "MIT", + "optional": true, + "dependencies": { + "debug": "^4.3.4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/agent-base/node_modules/debug": { + "version": "4.3.7", + "license": "MIT", + "optional": true, + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/agent-base/node_modules/ms": { + "version": "2.1.3", + "license": "MIT", + "optional": true + }, "node_modules/ajv": { "version": "6.12.6", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", - "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", "dev": true, "license": "MIT", "dependencies": { @@ -326,9 +685,7 @@ }, "node_modules/ansi-regex": { "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true, + "devOptional": true, "license": "MIT", "engines": { "node": ">=8" @@ -336,9 +693,7 @@ }, "node_modules/ansi-styles": { "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, + "devOptional": true, "license": "MIT", "dependencies": { "color-convert": "^2.0.1" @@ -352,8 +707,6 @@ }, "node_modules/anymatch": { "version": "3.1.3", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", - "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", "license": "ISC", "dependencies": { "normalize-path": "^3.0.0", @@ -365,8 +718,6 @@ }, "node_modules/argparse": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", - "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", "dev": true, "license": "Python-2.0" }, @@ -376,16 +727,60 @@ "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==", "license": "MIT" }, + "node_modules/arrify": { + "version": "2.0.1", + "license": "MIT", + "optional": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/async-retry": { + "version": "1.3.3", + "license": "MIT", + "optional": true, + "dependencies": { + "retry": "0.13.1" + } + }, + "node_modules/asynckit": { + "version": "0.4.0", + "license": "MIT", + "optional": true + }, "node_modules/balanced-match": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", "license": "MIT" }, + "node_modules/base64-js": { + "version": "1.5.1", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "optional": true + }, + "node_modules/bignumber.js": { + "version": "9.1.2", + "license": "MIT", + "optional": true, + "engines": { + "node": "*" + } + }, "node_modules/binary-extensions": { "version": "2.3.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.3.0.tgz", - "integrity": "sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==", "license": "MIT", "engines": { "node": ">=8" @@ -418,10 +813,23 @@ "npm": "1.2.8000 || >= 1.4.16" } }, + "node_modules/body-parser/node_modules/qs": { + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.13.0.tgz", + "integrity": "sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg==", + "license": "BSD-3-Clause", + "dependencies": { + "side-channel": "^1.0.6" + }, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/brace-expansion": { "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "license": "MIT", "dependencies": { "balanced-match": "^1.0.0", @@ -430,8 +838,6 @@ }, "node_modules/braces": { "version": "3.0.3", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", - "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", "license": "MIT", "dependencies": { "fill-range": "^7.1.1" @@ -442,18 +848,19 @@ }, "node_modules/bson": { "version": "6.8.0", - "resolved": "https://registry.npmjs.org/bson/-/bson-6.8.0.tgz", - "integrity": "sha512-iOJg8pr7wq2tg/zSlCCHMi3hMm5JTOxLTagf3zxhcenHsFp+c6uOs6K7W5UE7A4QIJGtqh/ZovFNMP4mOPJynQ==", "license": "Apache-2.0", "engines": { "node": ">=16.20.1" } }, + "node_modules/buffer-equal-constant-time": { + "version": "1.0.1", + "license": "BSD-3-Clause" + }, "node_modules/bytes": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", - "license": "MIT", "engines": { "node": ">= 0.8" } @@ -462,7 +869,6 @@ "version": "1.0.7", "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", - "license": "MIT", "dependencies": { "es-define-property": "^1.0.0", "es-errors": "^1.3.0", @@ -479,8 +885,6 @@ }, "node_modules/callsites": { "version": "3.1.0", - "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", - "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", "dev": true, "license": "MIT", "engines": { @@ -489,8 +893,6 @@ }, "node_modules/chalk": { "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "license": "MIT", "dependencies": { @@ -506,8 +908,6 @@ }, "node_modules/chokidar": { "version": "3.6.0", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz", - "integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==", "license": "MIT", "dependencies": { "anymatch": "~3.1.2", @@ -530,8 +930,6 @@ }, "node_modules/chokidar/node_modules/glob-parent": { "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", "license": "ISC", "dependencies": { "is-glob": "^4.0.1" @@ -540,11 +938,22 @@ "node": ">= 6" } }, + "node_modules/cliui": { + "version": "8.0.1", + "license": "ISC", + "optional": true, + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, "node_modules/color-convert": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, + "devOptional": true, "license": "MIT", "dependencies": { "color-name": "~1.1.4" @@ -555,15 +964,22 @@ }, "node_modules/color-name": { "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true, + "devOptional": true, "license": "MIT" }, + "node_modules/combined-stream": { + "version": "1.0.8", + "license": "MIT", + "optional": true, + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, "node_modules/compressible": { "version": "2.0.18", - "resolved": "https://registry.npmjs.org/compressible/-/compressible-2.0.18.tgz", - "integrity": "sha512-AF3r7P5dWxL8MxyITRMlORQNaOA2IkAFaTr4k7BUumjPtRpGDTZpl0Pb1XCO6JeDCBdp126Cgs9sMxqSjgYyRg==", "license": "MIT", "dependencies": { "mime-db": ">= 1.43.0 < 2" @@ -574,8 +990,6 @@ }, "node_modules/compression": { "version": "1.7.4", - "resolved": "https://registry.npmjs.org/compression/-/compression-1.7.4.tgz", - "integrity": "sha512-jaSIDzP9pZVS4ZfQ+TzvtiWhdpFhE2RDHz8QJkpX9SIpLq88VueF5jJw6t+6CUQcAoA6t+x89MLrWAqpfDE8iQ==", "license": "MIT", "dependencies": { "accepts": "~1.3.5", @@ -592,8 +1006,6 @@ }, "node_modules/compression/node_modules/bytes": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.0.0.tgz", - "integrity": "sha512-pMhOfFDPiv9t5jjIXkHosWmkSyQbvsgEVNkz0ERHbuLh2T/7j4Mqqpz523Fe8MVY89KC6Sh/QfS2sM+SjgFDcw==", "license": "MIT", "engines": { "node": ">= 0.8" @@ -601,14 +1013,10 @@ }, "node_modules/compression/node_modules/safe-buffer": { "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", "license": "MIT" }, "node_modules/concat-map": { "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", "license": "MIT" }, "node_modules/content-disposition": { @@ -627,7 +1035,6 @@ "version": "1.0.5", "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", - "license": "MIT", "engines": { "node": ">= 0.6" } @@ -649,8 +1056,6 @@ }, "node_modules/cross-spawn": { "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", "dev": true, "license": "MIT", "dependencies": { @@ -664,8 +1069,6 @@ }, "node_modules/debug": { "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", "license": "MIT", "dependencies": { "ms": "2.0.0" @@ -673,8 +1076,6 @@ }, "node_modules/deep-is": { "version": "0.1.4", - "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", - "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", "dev": true, "license": "MIT" }, @@ -682,7 +1083,6 @@ "version": "1.1.4", "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", - "license": "MIT", "dependencies": { "es-define-property": "^1.0.0", "es-errors": "^1.3.0", @@ -695,11 +1095,18 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/delayed-stream": { + "version": "1.0.0", + "license": "MIT", + "optional": true, + "engines": { + "node": ">=0.4.0" + } + }, "node_modules/depd": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", - "license": "MIT", "engines": { "node": ">= 0.8" } @@ -708,32 +1115,70 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==", - "license": "MIT", "engines": { "node": ">= 0.8", "npm": "1.2.8000 || >= 1.4.16" } }, + "node_modules/dotenv": { + "version": "16.4.5", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.4.5.tgz", + "integrity": "sha512-ZmdL2rui+eB2YwhsWzjInR8LldtZHGDoQ1ugH85ppHKwpUHL7j7rN0Ti9NCnGiQbhaZ11FpR+7ao1dNsmduNUg==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://dotenvx.com" + } + }, + "node_modules/duplexify": { + "version": "4.1.3", + "license": "MIT", + "optional": true, + "dependencies": { + "end-of-stream": "^1.4.1", + "inherits": "^2.0.3", + "readable-stream": "^3.1.1", + "stream-shift": "^1.0.2" + } + }, + "node_modules/ecdsa-sig-formatter": { + "version": "1.0.11", + "license": "Apache-2.0", + "dependencies": { + "safe-buffer": "^5.0.1" + } + }, "node_modules/ee-first": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", - "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==", - "license": "MIT" + "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==" + }, + "node_modules/emoji-regex": { + "version": "8.0.0", + "license": "MIT", + "optional": true }, "node_modules/encodeurl": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz", "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==", - "license": "MIT", "engines": { "node": ">= 0.8" } }, + "node_modules/end-of-stream": { + "version": "1.4.4", + "license": "MIT", + "optional": true, + "dependencies": { + "once": "^1.4.0" + } + }, "node_modules/es-define-property": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", - "license": "MIT", "dependencies": { "get-intrinsic": "^1.2.4" }, @@ -745,21 +1190,25 @@ "version": "1.3.0", "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", - "license": "MIT", "engines": { "node": ">= 0.4" } }, + "node_modules/escalade": { + "version": "3.2.0", + "license": "MIT", + "optional": true, + "engines": { + "node": ">=6" + } + }, "node_modules/escape-html": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", - "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==", - "license": "MIT" + "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==" }, "node_modules/escape-string-regexp": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", - "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", "dev": true, "license": "MIT", "engines": { @@ -771,8 +1220,6 @@ }, "node_modules/eslint": { "version": "9.9.1", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.9.1.tgz", - "integrity": "sha512-dHvhrbfr4xFQ9/dq+jcVneZMyRYLjggWjk6RVsIiHsP8Rz6yZ8LvZ//iU4TrZF+SXWG+JkNF2OyiZRvzgRDqMg==", "dev": true, "license": "MIT", "dependencies": { @@ -831,8 +1278,6 @@ }, "node_modules/eslint-scope": { "version": "8.0.2", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.0.2.tgz", - "integrity": "sha512-6E4xmrTw5wtxnLA5wYL3WDfhZ/1bUBGOXV0zQvVRDOtrR8D0p6W7fs3JweNYhwRYeGvd/1CKX2se0/2s7Q/nJA==", "dev": true, "license": "BSD-2-Clause", "dependencies": { @@ -848,8 +1293,6 @@ }, "node_modules/eslint-visitor-keys": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.0.0.tgz", - "integrity": "sha512-OtIRv/2GyiF6o/d8K7MYKKbXrOUBIK6SfkIRM4Z0dY3w+LiQ0vy3F57m0Z71bjbyeiWFiHJ8brqnmE6H6/jEuw==", "dev": true, "license": "Apache-2.0", "engines": { @@ -861,8 +1304,6 @@ }, "node_modules/eslint/node_modules/debug": { "version": "4.3.6", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.6.tgz", - "integrity": "sha512-O/09Bd4Z1fBrU4VzkhFqVgpPzaGbw6Sm9FEkBT1A/YBXQFGuuSxa1dN2nxgxS34JmKXqYx8CZAwEVoJFImUXIg==", "dev": true, "license": "MIT", "dependencies": { @@ -879,15 +1320,11 @@ }, "node_modules/eslint/node_modules/ms": { "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "dev": true, "license": "MIT" }, "node_modules/espree": { "version": "10.1.0", - "resolved": "https://registry.npmjs.org/espree/-/espree-10.1.0.tgz", - "integrity": "sha512-M1M6CpiE6ffoigIOWYO9UDP8TMUw9kqb21tf+08IgDYjCsOvCuDt4jQcZmoYxx+w7zlKw9/N0KXfto+I8/FrXA==", "dev": true, "license": "BSD-2-Clause", "dependencies": { @@ -904,8 +1341,6 @@ }, "node_modules/esquery": { "version": "1.6.0", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.6.0.tgz", - "integrity": "sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg==", "dev": true, "license": "BSD-3-Clause", "dependencies": { @@ -917,8 +1352,6 @@ }, "node_modules/esrecurse": { "version": "4.3.0", - "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", - "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", "dev": true, "license": "BSD-2-Clause", "dependencies": { @@ -930,8 +1363,6 @@ }, "node_modules/estraverse": { "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", "dev": true, "license": "BSD-2-Clause", "engines": { @@ -940,8 +1371,6 @@ }, "node_modules/esutils": { "version": "2.0.3", - "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", - "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", "dev": true, "license": "BSD-2-Clause", "engines": { @@ -952,16 +1381,22 @@ "version": "1.8.1", "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", - "license": "MIT", "engines": { "node": ">= 0.6" } }, + "node_modules/event-target-shim": { + "version": "5.0.1", + "license": "MIT", + "optional": true, + "engines": { + "node": ">=6" + } + }, "node_modules/express": { "version": "4.21.0", "resolved": "https://registry.npmjs.org/express/-/express-4.21.0.tgz", "integrity": "sha512-VqcNGcj/Id5ZT1LZ/cfihi3ttTn+NJmkli2eZADigjq29qTlWi/hAQ43t/VLPq8+UX06FCEx3ByOYet6ZFblng==", - "license": "MIT", "dependencies": { "accepts": "~1.3.8", "array-flatten": "1.1.1", @@ -999,41 +1434,83 @@ "node": ">= 0.10.0" } }, + "node_modules/express/node_modules/encodeurl": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz", + "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/extend": { + "version": "3.0.2", + "license": "MIT", + "optional": true + }, + "node_modules/farmhash-modern": { + "version": "1.1.0", + "license": "MIT", + "engines": { + "node": ">=18.0.0" + } + }, "node_modules/fast-deep-equal": { "version": "3.1.3", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", - "dev": true, + "devOptional": true, "license": "MIT" }, "node_modules/fast-json-stable-stringify": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", "dev": true, "license": "MIT" }, "node_modules/fast-levenshtein": { "version": "2.0.6", - "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", - "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", "dev": true, "license": "MIT" }, + "node_modules/fast-xml-parser": { + "version": "4.5.0", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/NaturalIntelligence" + }, + { + "type": "paypal", + "url": "https://paypal.me/naturalintelligence" + } + ], + "license": "MIT", + "optional": true, + "dependencies": { + "strnum": "^1.0.5" + }, + "bin": { + "fxparser": "src/cli/cli.js" + } + }, "node_modules/fastq": { "version": "1.17.1", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.17.1.tgz", - "integrity": "sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==", "dev": true, "license": "ISC", "dependencies": { "reusify": "^1.0.4" } }, + "node_modules/faye-websocket": { + "version": "0.11.4", + "license": "Apache-2.0", + "dependencies": { + "websocket-driver": ">=0.5.1" + }, + "engines": { + "node": ">=0.8.0" + } + }, "node_modules/file-entry-cache": { "version": "8.0.0", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-8.0.0.tgz", - "integrity": "sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==", "dev": true, "license": "MIT", "dependencies": { @@ -1045,8 +1522,6 @@ }, "node_modules/fill-range": { "version": "7.1.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", - "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", "license": "MIT", "dependencies": { "to-regex-range": "^5.0.1" @@ -1059,7 +1534,6 @@ "version": "1.3.1", "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.3.1.tgz", "integrity": "sha512-6BN9trH7bp3qvnrRyzsBz+g3lZxTNZTbVO2EV1CS0WIcDbawYVdYvGflME/9QP0h0pYlCDBCTjYa9nZzMDpyxQ==", - "license": "MIT", "dependencies": { "debug": "2.6.9", "encodeurl": "~2.0.0", @@ -1075,8 +1549,6 @@ }, "node_modules/find-up": { "version": "5.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", - "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", "dev": true, "license": "MIT", "dependencies": { @@ -1090,10 +1562,30 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/firebase-admin": { + "version": "12.4.0", + "license": "Apache-2.0", + "dependencies": { + "@fastify/busboy": "^3.0.0", + "@firebase/database-compat": "^1.0.2", + "@firebase/database-types": "^1.0.0", + "@types/node": "^22.0.1", + "farmhash-modern": "^1.1.0", + "jsonwebtoken": "^9.0.0", + "jwks-rsa": "^3.1.0", + "node-forge": "^1.3.1", + "uuid": "^10.0.0" + }, + "engines": { + "node": ">=14" + }, + "optionalDependencies": { + "@google-cloud/firestore": "^7.7.0", + "@google-cloud/storage": "^7.7.0" + } + }, "node_modules/flat-cache": { "version": "4.0.1", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-4.0.1.tgz", - "integrity": "sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==", "dev": true, "license": "MIT", "dependencies": { @@ -1106,11 +1598,22 @@ }, "node_modules/flatted": { "version": "3.3.1", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.1.tgz", - "integrity": "sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==", "dev": true, "license": "ISC" }, + "node_modules/form-data": { + "version": "2.5.1", + "license": "MIT", + "optional": true, + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.6", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 0.12" + } + }, "node_modules/forwarded": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", @@ -1124,16 +1627,12 @@ "version": "0.5.2", "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==", - "license": "MIT", "engines": { "node": ">= 0.6" } }, "node_modules/fsevents": { "version": "2.3.3", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", - "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", - "hasInstallScript": true, "license": "MIT", "optional": true, "os": [ @@ -1143,20 +1642,134 @@ "node": "^8.16.0 || ^10.6.0 || >=11.0.0" } }, - "node_modules/function-bind": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", - "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/functional-red-black-tree": { + "version": "1.0.1", + "license": "MIT", + "optional": true + }, + "node_modules/gaxios": { + "version": "6.7.1", + "license": "Apache-2.0", + "optional": true, + "dependencies": { + "extend": "^3.0.2", + "https-proxy-agent": "^7.0.1", + "is-stream": "^2.0.0", + "node-fetch": "^2.6.9", + "uuid": "^9.0.1" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/gaxios/node_modules/uuid": { + "version": "9.0.1", + "funding": [ + "https://github.com/sponsors/broofa", + "https://github.com/sponsors/ctavan" + ], + "license": "MIT", + "optional": true, + "bin": { + "uuid": "dist/bin/uuid" + } + }, + "node_modules/gcp-metadata": { + "version": "5.3.0", + "license": "Apache-2.0", + "optional": true, + "peer": true, + "dependencies": { + "gaxios": "^5.0.0", + "json-bigint": "^1.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/gcp-metadata/node_modules/agent-base": { + "version": "6.0.2", + "license": "MIT", + "optional": true, + "peer": true, + "dependencies": { + "debug": "4" + }, + "engines": { + "node": ">= 6.0.0" + } + }, + "node_modules/gcp-metadata/node_modules/debug": { + "version": "4.3.7", + "license": "MIT", + "optional": true, + "peer": true, + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/gcp-metadata/node_modules/gaxios": { + "version": "5.1.3", + "license": "Apache-2.0", + "optional": true, + "peer": true, + "dependencies": { + "extend": "^3.0.2", + "https-proxy-agent": "^5.0.0", + "is-stream": "^2.0.0", + "node-fetch": "^2.6.9" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/gcp-metadata/node_modules/https-proxy-agent": { + "version": "5.0.1", + "license": "MIT", + "optional": true, + "peer": true, + "dependencies": { + "agent-base": "6", + "debug": "4" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/gcp-metadata/node_modules/ms": { + "version": "2.1.3", "license": "MIT", - "funding": { - "url": "https://github.com/sponsors/ljharb" + "optional": true, + "peer": true + }, + "node_modules/get-caller-file": { + "version": "2.0.5", + "license": "ISC", + "optional": true, + "engines": { + "node": "6.* || 8.* || >= 10.*" } }, "node_modules/get-intrinsic": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", - "license": "MIT", "dependencies": { "es-errors": "^1.3.0", "function-bind": "^1.1.2", @@ -1173,8 +1786,6 @@ }, "node_modules/glob-parent": { "version": "6.0.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", - "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", "dev": true, "license": "ISC", "dependencies": { @@ -1186,8 +1797,6 @@ }, "node_modules/globals": { "version": "15.9.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-15.9.0.tgz", - "integrity": "sha512-SmSKyLLKFbSr6rptvP8izbyxJL4ILwqO9Jg23UA0sDlGlu58V59D1//I3vlc0KJphVdUR7vMjHIplYnzBxorQA==", "dev": true, "license": "MIT", "engines": { @@ -1197,11 +1806,84 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/google-auth-library": { + "version": "9.14.1", + "license": "Apache-2.0", + "optional": true, + "dependencies": { + "base64-js": "^1.3.0", + "ecdsa-sig-formatter": "^1.0.11", + "gaxios": "^6.1.1", + "gcp-metadata": "^6.1.0", + "gtoken": "^7.0.0", + "jws": "^4.0.0" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/google-auth-library/node_modules/gcp-metadata": { + "version": "6.1.0", + "license": "Apache-2.0", + "optional": true, + "dependencies": { + "gaxios": "^6.0.0", + "json-bigint": "^1.0.0" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/google-gax": { + "version": "4.4.1", + "license": "Apache-2.0", + "optional": true, + "dependencies": { + "@grpc/grpc-js": "^1.10.9", + "@grpc/proto-loader": "^0.7.13", + "@types/long": "^4.0.0", + "abort-controller": "^3.0.0", + "duplexify": "^4.0.0", + "google-auth-library": "^9.3.0", + "node-fetch": "^2.7.0", + "object-hash": "^3.0.0", + "proto3-json-serializer": "^2.0.2", + "protobufjs": "^7.3.2", + "retry-request": "^7.0.0", + "uuid": "^9.0.1" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/google-gax/node_modules/@grpc/grpc-js": { + "version": "1.11.2", + "license": "Apache-2.0", + "optional": true, + "dependencies": { + "@grpc/proto-loader": "^0.7.13", + "@js-sdsl/ordered-map": "^4.4.2" + }, + "engines": { + "node": ">=12.10.0" + } + }, + "node_modules/google-gax/node_modules/uuid": { + "version": "9.0.1", + "funding": [ + "https://github.com/sponsors/broofa", + "https://github.com/sponsors/ctavan" + ], + "license": "MIT", + "optional": true, + "bin": { + "uuid": "dist/bin/uuid" + } + }, "node_modules/gopd": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", - "license": "MIT", "dependencies": { "get-intrinsic": "^1.1.3" }, @@ -1209,10 +1891,20 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/gtoken": { + "version": "7.1.0", + "license": "MIT", + "optional": true, + "dependencies": { + "gaxios": "^6.0.0", + "jws": "^4.0.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, "node_modules/has-flag": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, "license": "MIT", "engines": { @@ -1223,7 +1915,6 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", - "license": "MIT", "dependencies": { "es-define-property": "^1.0.0" }, @@ -1235,7 +1926,6 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz", "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==", - "license": "MIT", "engines": { "node": ">= 0.4" }, @@ -1247,7 +1937,6 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", - "license": "MIT", "engines": { "node": ">= 0.4" }, @@ -1259,7 +1948,6 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", - "license": "MIT", "dependencies": { "function-bind": "^1.1.2" }, @@ -1267,11 +1955,25 @@ "node": ">= 0.4" } }, + "node_modules/html-entities": { + "version": "2.5.2", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/mdevils" + }, + { + "type": "patreon", + "url": "https://patreon.com/mdevils" + } + ], + "license": "MIT", + "optional": true + }, "node_modules/http-errors": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", - "license": "MIT", "dependencies": { "depd": "2.0.0", "inherits": "2.0.4", @@ -1283,11 +1985,92 @@ "node": ">= 0.8" } }, + "node_modules/http-parser-js": { + "version": "0.5.8", + "license": "MIT" + }, + "node_modules/http-proxy-agent": { + "version": "5.0.0", + "license": "MIT", + "optional": true, + "dependencies": { + "@tootallnate/once": "2", + "agent-base": "6", + "debug": "4" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/http-proxy-agent/node_modules/agent-base": { + "version": "6.0.2", + "license": "MIT", + "optional": true, + "dependencies": { + "debug": "4" + }, + "engines": { + "node": ">= 6.0.0" + } + }, + "node_modules/http-proxy-agent/node_modules/debug": { + "version": "4.3.7", + "license": "MIT", + "optional": true, + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/http-proxy-agent/node_modules/ms": { + "version": "2.1.3", + "license": "MIT", + "optional": true + }, + "node_modules/https-proxy-agent": { + "version": "7.0.5", + "license": "MIT", + "optional": true, + "dependencies": { + "agent-base": "^7.0.2", + "debug": "4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/https-proxy-agent/node_modules/debug": { + "version": "4.3.7", + "license": "MIT", + "optional": true, + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/https-proxy-agent/node_modules/ms": { + "version": "2.1.3", + "license": "MIT", + "optional": true + }, "node_modules/iconv-lite": { "version": "0.4.24", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", - "license": "MIT", "dependencies": { "safer-buffer": ">= 2.1.2 < 3" }, @@ -1297,8 +2080,6 @@ }, "node_modules/ignore": { "version": "5.3.2", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", - "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", "dev": true, "license": "MIT", "engines": { @@ -1307,14 +2088,10 @@ }, "node_modules/ignore-by-default": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/ignore-by-default/-/ignore-by-default-1.0.1.tgz", - "integrity": "sha512-Ius2VYcGNk7T90CppJqcIkS5ooHUZyIQK+ClZfMfMNFEF9VSE73Fq+906u/CWu92x4gzZMWOwfFYckPObzdEbA==", "license": "ISC" }, "node_modules/import-fresh": { "version": "3.3.0", - "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", - "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", "dev": true, "license": "MIT", "dependencies": { @@ -1330,8 +2107,6 @@ }, "node_modules/imurmurhash": { "version": "0.1.4", - "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", "dev": true, "license": "MIT", "engines": { @@ -1340,8 +2115,6 @@ }, "node_modules/inherits": { "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", "license": "ISC" }, "node_modules/ipaddr.js": { @@ -1355,8 +2128,6 @@ }, "node_modules/is-binary-path": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", - "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", "license": "MIT", "dependencies": { "binary-extensions": "^2.0.0" @@ -1367,17 +2138,21 @@ }, "node_modules/is-extglob": { "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", "license": "MIT", "engines": { "node": ">=0.10.0" } }, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "license": "MIT", + "optional": true, + "engines": { + "node": ">=8" + } + }, "node_modules/is-glob": { "version": "4.0.3", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", - "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", "license": "MIT", "dependencies": { "is-extglob": "^2.1.1" @@ -1388,8 +2163,6 @@ }, "node_modules/is-number": { "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", "license": "MIT", "engines": { "node": ">=0.12.0" @@ -1397,25 +2170,37 @@ }, "node_modules/is-path-inside": { "version": "3.0.3", - "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", - "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", "dev": true, "license": "MIT", "engines": { "node": ">=8" } }, + "node_modules/is-stream": { + "version": "2.0.1", + "license": "MIT", + "optional": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/isexe": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", "dev": true, "license": "ISC" }, + "node_modules/jose": { + "version": "4.15.9", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/panva" + } + }, "node_modules/js-yaml": { "version": "4.1.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", - "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", "dev": true, "license": "MIT", "dependencies": { @@ -1425,31 +2210,125 @@ "js-yaml": "bin/js-yaml.js" } }, + "node_modules/json-bigint": { + "version": "1.0.0", + "license": "MIT", + "optional": true, + "dependencies": { + "bignumber.js": "^9.0.0" + } + }, "node_modules/json-buffer": { "version": "3.0.1", - "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", - "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", "dev": true, "license": "MIT" }, "node_modules/json-schema-traverse": { "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", "dev": true, "license": "MIT" }, "node_modules/json-stable-stringify-without-jsonify": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", - "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", "dev": true, "license": "MIT" }, + "node_modules/jsonwebtoken": { + "version": "9.0.2", + "license": "MIT", + "dependencies": { + "jws": "^3.2.2", + "lodash.includes": "^4.3.0", + "lodash.isboolean": "^3.0.3", + "lodash.isinteger": "^4.0.4", + "lodash.isnumber": "^3.0.3", + "lodash.isplainobject": "^4.0.6", + "lodash.isstring": "^4.0.1", + "lodash.once": "^4.0.0", + "ms": "^2.1.1", + "semver": "^7.5.4" + }, + "engines": { + "node": ">=12", + "npm": ">=6" + } + }, + "node_modules/jsonwebtoken/node_modules/jwa": { + "version": "1.4.1", + "license": "MIT", + "dependencies": { + "buffer-equal-constant-time": "1.0.1", + "ecdsa-sig-formatter": "1.0.11", + "safe-buffer": "^5.0.1" + } + }, + "node_modules/jsonwebtoken/node_modules/jws": { + "version": "3.2.2", + "license": "MIT", + "dependencies": { + "jwa": "^1.4.1", + "safe-buffer": "^5.0.1" + } + }, + "node_modules/jsonwebtoken/node_modules/ms": { + "version": "2.1.3", + "license": "MIT" + }, + "node_modules/jwa": { + "version": "2.0.0", + "license": "MIT", + "optional": true, + "dependencies": { + "buffer-equal-constant-time": "1.0.1", + "ecdsa-sig-formatter": "1.0.11", + "safe-buffer": "^5.0.1" + } + }, + "node_modules/jwks-rsa": { + "version": "3.1.0", + "license": "MIT", + "dependencies": { + "@types/express": "^4.17.17", + "@types/jsonwebtoken": "^9.0.2", + "debug": "^4.3.4", + "jose": "^4.14.6", + "limiter": "^1.1.5", + "lru-memoizer": "^2.2.0" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/jwks-rsa/node_modules/debug": { + "version": "4.3.7", + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/jwks-rsa/node_modules/ms": { + "version": "2.1.3", + "license": "MIT" + }, + "node_modules/jws": { + "version": "4.0.0", + "license": "MIT", + "optional": true, + "dependencies": { + "jwa": "^2.0.0", + "safe-buffer": "^5.0.1" + } + }, "node_modules/kareem": { "version": "2.6.3", - "resolved": "https://registry.npmjs.org/kareem/-/kareem-2.6.3.tgz", - "integrity": "sha512-C3iHfuGUXK2u8/ipq9LfjFfXFxAZMQJJq7vLS45r3D9Y2xQ/m4S8zaR4zMLFWh9AsNPXmcFfUDhTEO8UIC/V6Q==", "license": "Apache-2.0", "engines": { "node": ">=12.0.0" @@ -1457,8 +2336,6 @@ }, "node_modules/keyv": { "version": "4.5.4", - "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", - "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", "dev": true, "license": "MIT", "dependencies": { @@ -1467,8 +2344,6 @@ }, "node_modules/levn": { "version": "0.4.1", - "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", - "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", "dev": true, "license": "MIT", "dependencies": { @@ -1479,10 +2354,11 @@ "node": ">= 0.8.0" } }, + "node_modules/limiter": { + "version": "1.1.5" + }, "node_modules/locate-path": { "version": "6.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", - "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", "dev": true, "license": "MIT", "dependencies": { @@ -1495,26 +2371,81 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/lodash.merge": { - "version": "4.6.2", - "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", - "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", - "dev": true, - "license": "MIT" + "node_modules/lodash.camelcase": { + "version": "4.3.0", + "license": "MIT", + "optional": true + }, + "node_modules/lodash.clonedeep": { + "version": "4.5.0", + "license": "MIT" + }, + "node_modules/lodash.includes": { + "version": "4.3.0", + "license": "MIT" + }, + "node_modules/lodash.isboolean": { + "version": "3.0.3", + "license": "MIT" + }, + "node_modules/lodash.isinteger": { + "version": "4.0.4", + "license": "MIT" + }, + "node_modules/lodash.isnumber": { + "version": "3.0.3", + "license": "MIT" + }, + "node_modules/lodash.isplainobject": { + "version": "4.0.6", + "license": "MIT" + }, + "node_modules/lodash.isstring": { + "version": "4.0.1", + "license": "MIT" + }, + "node_modules/lodash.merge": { + "version": "4.6.2", + "dev": true, + "license": "MIT" + }, + "node_modules/lodash.once": { + "version": "4.1.1", + "license": "MIT" + }, + "node_modules/long": { + "version": "5.2.3", + "license": "Apache-2.0", + "optional": true + }, + "node_modules/lru-cache": { + "version": "6.0.0", + "license": "ISC", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/lru-memoizer": { + "version": "2.3.0", + "license": "MIT", + "dependencies": { + "lodash.clonedeep": "^4.5.0", + "lru-cache": "6.0.0" + } }, "node_modules/media-typer": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==", - "license": "MIT", "engines": { "node": ">= 0.6" } }, "node_modules/memory-pager": { "version": "1.5.0", - "resolved": "https://registry.npmjs.org/memory-pager/-/memory-pager-1.5.0.tgz", - "integrity": "sha512-ZS4Bp4r/Zoeq6+NLJpP+0Zzm0pR8whtGPf1XExKLJBAczGMnSi3It14OiNCStjQjM6NU1okjQGSxgEZN8eBYKg==", "license": "MIT" }, "node_modules/merge-descriptors": { @@ -1539,7 +2470,6 @@ "version": "1.6.0", "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", - "license": "MIT", "bin": { "mime": "cli.js" }, @@ -1549,8 +2479,6 @@ }, "node_modules/mime-db": { "version": "1.52.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", - "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", "license": "MIT", "engines": { "node": ">= 0.6" @@ -1558,8 +2486,6 @@ }, "node_modules/mime-types": { "version": "2.1.35", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", - "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", "license": "MIT", "dependencies": { "mime-db": "1.52.0" @@ -1570,8 +2496,6 @@ }, "node_modules/minimatch": { "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "license": "ISC", "dependencies": { "brace-expansion": "^1.1.7" @@ -1582,8 +2506,6 @@ }, "node_modules/mongodb": { "version": "6.8.0", - "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-6.8.0.tgz", - "integrity": "sha512-HGQ9NWDle5WvwMnrvUxsFYPd3JEbqD3RgABHBQRuoCEND0qzhsd0iH5ypHsf1eJ+sXmvmyKpP+FLOKY8Il7jMw==", "license": "Apache-2.0", "dependencies": { "@mongodb-js/saslprep": "^1.1.5", @@ -1628,8 +2550,6 @@ }, "node_modules/mongodb-connection-string-url": { "version": "3.0.1", - "resolved": "https://registry.npmjs.org/mongodb-connection-string-url/-/mongodb-connection-string-url-3.0.1.tgz", - "integrity": "sha512-XqMGwRX0Lgn05TDB4PyG2h2kKO/FfWJyCzYQbIhXUxz7ETt0I/FqHjUeqj37irJ+Dl1ZtU82uYyj14u2XsZKfg==", "license": "Apache-2.0", "dependencies": { "@types/whatwg-url": "^11.0.2", @@ -1638,8 +2558,6 @@ }, "node_modules/mongoose": { "version": "8.6.0", - "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-8.6.0.tgz", - "integrity": "sha512-p6VSbYKvD4ZIabqo8C0kS5eKX1Xpji+opTAIJ9wyuPJ8Y/FblgXSMnFRXnB40bYZLKPQT089K5KU8+bqIXtFdw==", "license": "MIT", "dependencies": { "bson": "^6.7.0", @@ -1660,14 +2578,10 @@ }, "node_modules/mongoose/node_modules/ms": { "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", "license": "MIT" }, "node_modules/mpath": { "version": "0.9.0", - "resolved": "https://registry.npmjs.org/mpath/-/mpath-0.9.0.tgz", - "integrity": "sha512-ikJRQTk8hw5DEoFVxHG1Gn9T/xcjtdnOKIU1JTmGjZZlg9LST2mBLmcX3/ICIbgJydT2GOc15RnNy5mHmzfSew==", "license": "MIT", "engines": { "node": ">=4.0.0" @@ -1675,8 +2589,6 @@ }, "node_modules/mquery": { "version": "5.0.0", - "resolved": "https://registry.npmjs.org/mquery/-/mquery-5.0.0.tgz", - "integrity": "sha512-iQMncpmEK8R8ncT8HJGsGc9Dsp8xcgYMVSbs5jgnm1lFHTZqMJTUWTDx1LBO8+mK3tPNZWFLBghQEIOULSTHZg==", "license": "MIT", "dependencies": { "debug": "4.x" @@ -1687,8 +2599,6 @@ }, "node_modules/mquery/node_modules/debug": { "version": "4.3.6", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.6.tgz", - "integrity": "sha512-O/09Bd4Z1fBrU4VzkhFqVgpPzaGbw6Sm9FEkBT1A/YBXQFGuuSxa1dN2nxgxS34JmKXqYx8CZAwEVoJFImUXIg==", "license": "MIT", "dependencies": { "ms": "2.1.2" @@ -1704,36 +2614,71 @@ }, "node_modules/mquery/node_modules/ms": { "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "license": "MIT" }, "node_modules/ms": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", "license": "MIT" }, "node_modules/natural-compare": { "version": "1.4.0", - "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", - "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", "dev": true, "license": "MIT" }, "node_modules/negotiator": { "version": "0.6.3", - "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", - "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", "license": "MIT", "engines": { "node": ">= 0.6" } }, + "node_modules/node-fetch": { + "version": "2.7.0", + "license": "MIT", + "optional": true, + "dependencies": { + "whatwg-url": "^5.0.0" + }, + "engines": { + "node": "4.x || >=6.0.0" + }, + "peerDependencies": { + "encoding": "^0.1.0" + }, + "peerDependenciesMeta": { + "encoding": { + "optional": true + } + } + }, + "node_modules/node-fetch/node_modules/tr46": { + "version": "0.0.3", + "license": "MIT", + "optional": true + }, + "node_modules/node-fetch/node_modules/webidl-conversions": { + "version": "3.0.1", + "license": "BSD-2-Clause", + "optional": true + }, + "node_modules/node-fetch/node_modules/whatwg-url": { + "version": "5.0.0", + "license": "MIT", + "optional": true, + "dependencies": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + }, + "node_modules/node-forge": { + "version": "1.3.1", + "license": "(BSD-3-Clause OR GPL-2.0)", + "engines": { + "node": ">= 6.13.0" + } + }, "node_modules/nodemon": { "version": "3.1.4", - "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-3.1.4.tgz", - "integrity": "sha512-wjPBbFhtpJwmIeY2yP7QF+UKzPfltVGtfce1g/bB15/8vCGZj8uxD62b/b9M9/WVgme0NZudpownKN+c0plXlQ==", "license": "MIT", "dependencies": { "chokidar": "^3.5.2", @@ -1760,8 +2705,6 @@ }, "node_modules/nodemon/node_modules/debug": { "version": "4.3.6", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.6.tgz", - "integrity": "sha512-O/09Bd4Z1fBrU4VzkhFqVgpPzaGbw6Sm9FEkBT1A/YBXQFGuuSxa1dN2nxgxS34JmKXqYx8CZAwEVoJFImUXIg==", "license": "MIT", "dependencies": { "ms": "2.1.2" @@ -1777,8 +2720,6 @@ }, "node_modules/nodemon/node_modules/has-flag": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", "license": "MIT", "engines": { "node": ">=4" @@ -1786,14 +2727,10 @@ }, "node_modules/nodemon/node_modules/ms": { "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "license": "MIT" }, "node_modules/nodemon/node_modules/supports-color": { "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", "license": "MIT", "dependencies": { "has-flag": "^3.0.0" @@ -1804,18 +2741,23 @@ }, "node_modules/normalize-path": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", - "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", "license": "MIT", "engines": { "node": ">=0.10.0" } }, + "node_modules/object-hash": { + "version": "3.0.0", + "license": "MIT", + "optional": true, + "engines": { + "node": ">= 6" + } + }, "node_modules/object-inspect": { "version": "1.13.2", "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.2.tgz", "integrity": "sha512-IRZSRuzJiynemAXPYtPe5BoI/RESNYR7TYm50MC5Mqbd3Jmw5y790sErYw3V6SryFJD64b74qQQs9wn5Bg/k3g==", - "license": "MIT", "engines": { "node": ">= 0.4" }, @@ -1827,7 +2769,6 @@ "version": "2.4.1", "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", - "license": "MIT", "dependencies": { "ee-first": "1.1.1" }, @@ -1837,17 +2778,21 @@ }, "node_modules/on-headers": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/on-headers/-/on-headers-1.0.2.tgz", - "integrity": "sha512-pZAE+FJLoyITytdqK0U5s+FIpjN0JP3OzFi/u8Rx+EV5/W+JTWGXG8xFzevE7AjBfDqHv/8vL8qQsIhHnqRkrA==", "license": "MIT", "engines": { "node": ">= 0.8" } }, + "node_modules/once": { + "version": "1.4.0", + "license": "ISC", + "optional": true, + "dependencies": { + "wrappy": "1" + } + }, "node_modules/optionator": { "version": "0.9.4", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", - "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==", "dev": true, "license": "MIT", "dependencies": { @@ -1864,9 +2809,7 @@ }, "node_modules/p-limit": { "version": "3.1.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", - "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", - "dev": true, + "devOptional": true, "license": "MIT", "dependencies": { "yocto-queue": "^0.1.0" @@ -1880,8 +2823,6 @@ }, "node_modules/p-locate": { "version": "5.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", - "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", "dev": true, "license": "MIT", "dependencies": { @@ -1896,8 +2837,6 @@ }, "node_modules/parent-module": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", - "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", "dev": true, "license": "MIT", "dependencies": { @@ -1911,15 +2850,12 @@ "version": "1.3.3", "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", - "license": "MIT", "engines": { "node": ">= 0.8" } }, "node_modules/path-exists": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", "dev": true, "license": "MIT", "engines": { @@ -1928,8 +2864,6 @@ }, "node_modules/path-key": { "version": "3.1.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", "dev": true, "license": "MIT", "engines": { @@ -1944,8 +2878,6 @@ }, "node_modules/picomatch": { "version": "2.3.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", "license": "MIT", "engines": { "node": ">=8.6" @@ -1956,14 +2888,46 @@ }, "node_modules/prelude-ls": { "version": "1.2.1", - "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", - "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", "dev": true, "license": "MIT", "engines": { "node": ">= 0.8.0" } }, + "node_modules/proto3-json-serializer": { + "version": "2.0.2", + "license": "Apache-2.0", + "optional": true, + "dependencies": { + "protobufjs": "^7.2.5" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/protobufjs": { + "version": "7.4.0", + "hasInstallScript": true, + "license": "BSD-3-Clause", + "optional": true, + "dependencies": { + "@protobufjs/aspromise": "^1.1.2", + "@protobufjs/base64": "^1.1.2", + "@protobufjs/codegen": "^2.0.4", + "@protobufjs/eventemitter": "^1.1.0", + "@protobufjs/fetch": "^1.1.0", + "@protobufjs/float": "^1.0.2", + "@protobufjs/inquire": "^1.1.0", + "@protobufjs/path": "^1.1.2", + "@protobufjs/pool": "^1.1.0", + "@protobufjs/utf8": "^1.1.0", + "@types/node": ">=13.7.0", + "long": "^5.0.0" + }, + "engines": { + "node": ">=12.0.0" + } + }, "node_modules/proxy-addr": { "version": "2.0.7", "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", @@ -1979,14 +2943,10 @@ }, "node_modules/pstree.remy": { "version": "1.1.8", - "resolved": "https://registry.npmjs.org/pstree.remy/-/pstree.remy-1.1.8.tgz", - "integrity": "sha512-77DZwxQmxKnu3aR542U+X8FypNzbfJ+C5XQDk3uWjWxn6151aIMGthWYRXTqT1E5oJvg+ljaa2OJi+VfvCOQ8w==", "license": "MIT" }, "node_modules/punycode": { "version": "2.3.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", - "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", "license": "MIT", "engines": { "node": ">=6" @@ -1996,7 +2956,6 @@ "version": "6.13.0", "resolved": "https://registry.npmjs.org/qs/-/qs-6.13.0.tgz", "integrity": "sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg==", - "license": "BSD-3-Clause", "dependencies": { "side-channel": "^1.0.6" }, @@ -2009,8 +2968,6 @@ }, "node_modules/queue-microtask": { "version": "1.2.3", - "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", - "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", "dev": true, "funding": [ { @@ -2032,7 +2989,6 @@ "version": "1.2.1", "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", - "license": "MIT", "engines": { "node": ">= 0.6" } @@ -2041,7 +2997,6 @@ "version": "2.5.2", "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.2.tgz", "integrity": "sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==", - "license": "MIT", "dependencies": { "bytes": "3.1.2", "http-errors": "2.0.0", @@ -2052,10 +3007,21 @@ "node": ">= 0.8" } }, + "node_modules/readable-stream": { + "version": "3.6.2", + "license": "MIT", + "optional": true, + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/readdirp": { "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", - "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", "license": "MIT", "dependencies": { "picomatch": "^2.2.1" @@ -2064,20 +3030,45 @@ "node": ">=8.10.0" } }, + "node_modules/require-directory": { + "version": "2.1.1", + "license": "MIT", + "optional": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/resolve-from": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", - "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", "dev": true, "license": "MIT", "engines": { "node": ">=4" } }, + "node_modules/retry": { + "version": "0.13.1", + "license": "MIT", + "optional": true, + "engines": { + "node": ">= 4" + } + }, + "node_modules/retry-request": { + "version": "7.0.2", + "license": "MIT", + "optional": true, + "dependencies": { + "@types/request": "^2.48.8", + "extend": "^3.0.2", + "teeny-request": "^9.0.0" + }, + "engines": { + "node": ">=14" + } + }, "node_modules/reusify": { "version": "1.0.4", - "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", - "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", "dev": true, "license": "MIT", "engines": { @@ -2087,8 +3078,6 @@ }, "node_modules/run-parallel": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", - "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", "dev": true, "funding": [ { @@ -2111,8 +3100,6 @@ }, "node_modules/safe-buffer": { "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", "funding": [ { "type": "github", @@ -2132,13 +3119,10 @@ "node_modules/safer-buffer": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", - "license": "MIT" + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" }, "node_modules/semver": { "version": "7.6.3", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", - "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", "license": "ISC", "bin": { "semver": "bin/semver.js" @@ -2175,7 +3159,6 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", - "license": "MIT", "engines": { "node": ">= 0.8" } @@ -2183,8 +3166,7 @@ "node_modules/send/node_modules/ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "license": "MIT" + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" }, "node_modules/serve-static": { "version": "1.16.2", @@ -2205,7 +3187,6 @@ "version": "1.2.2", "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", - "license": "MIT", "dependencies": { "define-data-property": "^1.1.4", "es-errors": "^1.3.0", @@ -2221,13 +3202,10 @@ "node_modules/setprototypeof": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", - "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==", - "license": "ISC" + "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==" }, "node_modules/shebang-command": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", - "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", "dev": true, "license": "MIT", "dependencies": { @@ -2239,8 +3217,6 @@ }, "node_modules/shebang-regex": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", "dev": true, "license": "MIT", "engines": { @@ -2251,7 +3227,6 @@ "version": "1.0.6", "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.6.tgz", "integrity": "sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==", - "license": "MIT", "dependencies": { "call-bind": "^1.0.7", "es-errors": "^1.3.0", @@ -2267,14 +3242,10 @@ }, "node_modules/sift": { "version": "17.1.3", - "resolved": "https://registry.npmjs.org/sift/-/sift-17.1.3.tgz", - "integrity": "sha512-Rtlj66/b0ICeFzYTuNvX/EF1igRbbnGSvEyT79McoZa/DeGhMyC5pWKOEsZKnpkqtSeovd5FL/bjHWC3CIIvCQ==", "license": "MIT" }, "node_modules/simple-update-notifier": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/simple-update-notifier/-/simple-update-notifier-2.0.0.tgz", - "integrity": "sha512-a2B9Y0KlNXl9u/vsW6sTIu9vGEpfKu2wRV6l1H3XEas/0gUIzGzBoP/IouTcUQbm9JWZLH3COxyn03TYlFax6w==", "license": "MIT", "dependencies": { "semver": "^7.5.3" @@ -2285,8 +3256,6 @@ }, "node_modules/sparse-bitfield": { "version": "3.0.3", - "resolved": "https://registry.npmjs.org/sparse-bitfield/-/sparse-bitfield-3.0.3.tgz", - "integrity": "sha512-kvzhi7vqKTfkh0PZU+2D2PIllw2ymqJKujUcyPMd9Y75Nv4nPbGJZXNhxsgdQab2BmlDct1YnfQCguEvHr7VsQ==", "license": "MIT", "dependencies": { "memory-pager": "^1.0.2" @@ -2296,16 +3265,47 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", - "license": "MIT", "engines": { "node": ">= 0.8" } }, + "node_modules/stream-events": { + "version": "1.0.5", + "license": "MIT", + "optional": true, + "dependencies": { + "stubs": "^3.0.0" + } + }, + "node_modules/stream-shift": { + "version": "1.0.3", + "license": "MIT", + "optional": true + }, + "node_modules/string_decoder": { + "version": "1.3.0", + "license": "MIT", + "optional": true, + "dependencies": { + "safe-buffer": "~5.2.0" + } + }, + "node_modules/string-width": { + "version": "4.2.3", + "license": "MIT", + "optional": true, + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/strip-ansi": { "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, + "devOptional": true, "license": "MIT", "dependencies": { "ansi-regex": "^5.0.1" @@ -2316,8 +3316,6 @@ }, "node_modules/strip-json-comments": { "version": "3.1.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", - "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", "dev": true, "license": "MIT", "engines": { @@ -2327,10 +3325,18 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/strnum": { + "version": "1.0.5", + "license": "MIT", + "optional": true + }, + "node_modules/stubs": { + "version": "3.0.0", + "license": "MIT", + "optional": true + }, "node_modules/supports-color": { "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "license": "MIT", "dependencies": { @@ -2340,17 +3346,84 @@ "node": ">=8" } }, + "node_modules/teeny-request": { + "version": "9.0.0", + "license": "Apache-2.0", + "optional": true, + "dependencies": { + "http-proxy-agent": "^5.0.0", + "https-proxy-agent": "^5.0.0", + "node-fetch": "^2.6.9", + "stream-events": "^1.0.5", + "uuid": "^9.0.0" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/teeny-request/node_modules/agent-base": { + "version": "6.0.2", + "license": "MIT", + "optional": true, + "dependencies": { + "debug": "4" + }, + "engines": { + "node": ">= 6.0.0" + } + }, + "node_modules/teeny-request/node_modules/debug": { + "version": "4.3.7", + "license": "MIT", + "optional": true, + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/teeny-request/node_modules/https-proxy-agent": { + "version": "5.0.1", + "license": "MIT", + "optional": true, + "dependencies": { + "agent-base": "6", + "debug": "4" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/teeny-request/node_modules/ms": { + "version": "2.1.3", + "license": "MIT", + "optional": true + }, + "node_modules/teeny-request/node_modules/uuid": { + "version": "9.0.1", + "funding": [ + "https://github.com/sponsors/broofa", + "https://github.com/sponsors/ctavan" + ], + "license": "MIT", + "optional": true, + "bin": { + "uuid": "dist/bin/uuid" + } + }, "node_modules/text-table": { "version": "0.2.0", - "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", - "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", "dev": true, "license": "MIT" }, "node_modules/to-regex-range": { "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", "license": "MIT", "dependencies": { "is-number": "^7.0.0" @@ -2363,15 +3436,12 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", - "license": "MIT", "engines": { "node": ">=0.6" } }, "node_modules/touch": { "version": "3.1.1", - "resolved": "https://registry.npmjs.org/touch/-/touch-3.1.1.tgz", - "integrity": "sha512-r0eojU4bI8MnHr8c5bNo7lJDdI2qXlWWJk6a9EAFG7vbhTjElYhBVS3/miuE0uOuoLdb8Mc/rVfsmm6eo5o9GA==", "license": "ISC", "bin": { "nodetouch": "bin/nodetouch.js" @@ -2379,8 +3449,6 @@ }, "node_modules/tr46": { "version": "4.1.1", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-4.1.1.tgz", - "integrity": "sha512-2lv/66T7e5yNyhAAC4NaKe5nVavzuGJQVVtRYLyQ2OI8tsJ61PMLlelehb0wi2Hx6+hT/OJUWZcw8MjlSRnxvw==", "license": "MIT", "dependencies": { "punycode": "^2.3.0" @@ -2389,10 +3457,12 @@ "node": ">=14" } }, + "node_modules/tslib": { + "version": "2.7.0", + "license": "0BSD" + }, "node_modules/type-check": { "version": "0.4.0", - "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", - "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", "dev": true, "license": "MIT", "dependencies": { @@ -2406,7 +3476,6 @@ "version": "1.6.18", "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", - "license": "MIT", "dependencies": { "media-typer": "0.3.0", "mime-types": "~2.1.24" @@ -2417,29 +3486,33 @@ }, "node_modules/undefsafe": { "version": "2.0.5", - "resolved": "https://registry.npmjs.org/undefsafe/-/undefsafe-2.0.5.tgz", - "integrity": "sha512-WxONCrssBM8TSPRqN5EmsjVrsv4A8X12J4ArBiiayv3DyyG3ZlIg6yysuuSYdZsVz3TKcTg2fd//Ujd4CHV1iA==", + "license": "MIT" + }, + "node_modules/undici-types": { + "version": "6.19.8", "license": "MIT" }, "node_modules/unpipe": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", - "license": "MIT", "engines": { "node": ">= 0.8" } }, "node_modules/uri-js": { "version": "4.4.1", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", - "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", "dev": true, "license": "BSD-2-Clause", "dependencies": { "punycode": "^2.1.0" } }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "license": "MIT", + "optional": true + }, "node_modules/utils-merge": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", @@ -2449,10 +3522,19 @@ "node": ">= 0.4.0" } }, + "node_modules/uuid": { + "version": "10.0.0", + "funding": [ + "https://github.com/sponsors/broofa", + "https://github.com/sponsors/ctavan" + ], + "license": "MIT", + "bin": { + "uuid": "dist/bin/uuid" + } + }, "node_modules/vary": { "version": "1.1.2", - "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", - "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", "license": "MIT", "engines": { "node": ">= 0.8" @@ -2460,17 +3542,32 @@ }, "node_modules/webidl-conversions": { "version": "7.0.0", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz", - "integrity": "sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==", "license": "BSD-2-Clause", "engines": { "node": ">=12" } }, + "node_modules/websocket-driver": { + "version": "0.7.4", + "license": "Apache-2.0", + "dependencies": { + "http-parser-js": ">=0.5.1", + "safe-buffer": ">=5.1.0", + "websocket-extensions": ">=0.1.1" + }, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/websocket-extensions": { + "version": "0.1.4", + "license": "Apache-2.0", + "engines": { + "node": ">=0.8.0" + } + }, "node_modules/whatwg-url": { "version": "13.0.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-13.0.0.tgz", - "integrity": "sha512-9WWbymnqj57+XEuqADHrCJ2eSXzn8WXIW/YSGaZtb2WKAInQ6CHfaUUcTyyver0p8BDg5StLQq8h1vtZuwmOig==", "license": "MIT", "dependencies": { "tr46": "^4.1.1", @@ -2482,8 +3579,6 @@ }, "node_modules/which": { "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", "dev": true, "license": "ISC", "dependencies": { @@ -2498,19 +3593,73 @@ }, "node_modules/word-wrap": { "version": "1.2.5", - "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", - "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", "dev": true, "license": "MIT", "engines": { "node": ">=0.10.0" } }, + "node_modules/wrap-ansi": { + "version": "7.0.0", + "license": "MIT", + "optional": true, + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "license": "ISC", + "optional": true + }, + "node_modules/y18n": { + "version": "5.0.8", + "license": "ISC", + "optional": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/yallist": { + "version": "4.0.0", + "license": "ISC" + }, + "node_modules/yargs": { + "version": "17.7.2", + "license": "MIT", + "optional": true, + "dependencies": { + "cliui": "^8.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.1.1" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/yargs-parser": { + "version": "21.1.1", + "license": "ISC", + "optional": true, + "engines": { + "node": ">=12" + } + }, "node_modules/yocto-queue": { "version": "0.1.0", - "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", - "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", - "dev": true, + "devOptional": true, "license": "MIT", "engines": { "node": ">=10" @@ -2520,4 +3669,4 @@ } } } -} +} \ No newline at end of file From ae63eae7dd9c1c005dee8ddc4164e94aaa0a636a Mon Sep 17 00:00:00 2001 From: Diego Date: Thu, 19 Sep 2024 18:00:38 -0600 Subject: [PATCH 063/231] feat(perfil) - Backend para consultar y modificar perfil --- models/perfil/consultarPerfil.model.js | 39 ----------- models/perfil/perfil.model.js | 66 +++++++++++++++++++ .../controllers/consultarPerfil.controller.js | 4 +- .../controllers/modificarPerfil.controller.js | 35 +++++----- modules/perfil/routes/perfilIndex.routes.js | 18 ++--- 5 files changed, 91 insertions(+), 71 deletions(-) delete mode 100644 models/perfil/consultarPerfil.model.js create mode 100644 models/perfil/perfil.model.js diff --git a/models/perfil/consultarPerfil.model.js b/models/perfil/consultarPerfil.model.js deleted file mode 100644 index e1953d7..0000000 --- a/models/perfil/consultarPerfil.model.js +++ /dev/null @@ -1,39 +0,0 @@ -const mongoose = require('mongoose'); - -const DatosPerfilSchema = new mongoose.Schema({ - IDUsuario: { - type: String, - required: true, - unique: true - }, - Nombre: { - type: String, - required: true, - }, - Rodadas: { - type: Number, - required: true - }, - Kilometros: { - type: Number, - required: true - }, - Amigos: { - type: Number, - required: true - }, - Foto: { - type: String, - required: false - }, - TipoSangre: { - type: String, - required: false - } -}, { - collection: 'DatosPerfil' -}); - -const DatosPerfil = mongoose.model('DatosPerfil', DatosPerfilSchema); - -module.exports = DatosPerfil; \ No newline at end of file diff --git a/models/perfil/perfil.model.js b/models/perfil/perfil.model.js new file mode 100644 index 0000000..f3b0565 --- /dev/null +++ b/models/perfil/perfil.model.js @@ -0,0 +1,66 @@ +const mongoose = require('mongoose'); + +const DatosPerfilSchema = new mongoose.Schema( + { + _id: { + type: String, + required: true, + }, + username: { + type: String, + required: true + }, + nombre: { + type: String, + required: true + }, + tipoSangre: { + type: String, + required: false + }, + correoElectronico: { + type: String, + required: true + }, + numeroEmergencia: { + type: Number, + required: false + }, + fechaRegistro: { + type: Date, + required: true + } +}, { + collection: 'DatosPerfil' +}); + +const Perfil = mongoose.model('Usuario', DatosPerfilSchema); + + + + + +async function putPerfil(IDUsuario, Username, nombre, tipoSangre, numeroEmergencia){ + try { + const perfil = await Perfil.findById(IDUsuario); + if (perfil) { + perfil.username = Username; + perfil.nombre = nombre + perfil.tipoSangre = tipoSangre; + perfil.numeroEmergencia = numeroEmergencia; + + await perfil.save(); + return perfil; + } else { + throw new Error('Perfil no encontrado'); + } + } catch (error) { + throw error; + } +} + + +module.exports = { + Perfil, + putPerfil +}; \ No newline at end of file diff --git a/modules/perfil/controllers/consultarPerfil.controller.js b/modules/perfil/controllers/consultarPerfil.controller.js index 88dace8..b2a3bfa 100644 --- a/modules/perfil/controllers/consultarPerfil.controller.js +++ b/modules/perfil/controllers/consultarPerfil.controller.js @@ -1,6 +1,6 @@ -const DatosPerfil = require('../../../models/perfil/consultarPerfil.model'); +const DatosPerfil = require('../../../models/perfil/perfil.model'); -exports.consultarPerfil = async (req, res) => { +exports.consultarPerfil = async (request, response) => { try{ const perfil = await DatosPerfil.find(); return res.status(200).json({ diff --git a/modules/perfil/controllers/modificarPerfil.controller.js b/modules/perfil/controllers/modificarPerfil.controller.js index acd4807..3b2c5a0 100644 --- a/modules/perfil/controllers/modificarPerfil.controller.js +++ b/modules/perfil/controllers/modificarPerfil.controller.js @@ -1,19 +1,20 @@ -const DatosPerfil = require('../../../models/perfil/consultarPerfil.model'); +const Perfil = require('../../../models/perfil/perfil.model'); -exports.modificarPerfil = async (req, res) => { - try{ - const perfil = await DatosPerfil.find(); - return res.status(200).json({ - code: 200, - msg: 'Consulta de datos de perfil exitosa', - data: datos - }); - } catch(error){ - console.error(error); - return res.status(500).json({ - code: 500, - msg: 'Error al intentar consultar las preguntas frecuentes', - data: null - }); + +exports.putPerfil = async (request, response) => { + const IDUsuario = request.body.IDUsuario; + const Username = request.body.Username; + const nombre = request.body.nombre + const tipoSangre = request.body.tipoSangre; + const numeroEmergencia = request.body.numeroEmergencia; + + try { + const perfil = await Perfil.putPerfil(IDUsuario, Username, nombre, tipoSangre, numeroEmergencia); + return response.status(201).json(perfil); + } catch (error) { + return response.status(404).json({ message: 'Error al modificar el perfil', error: error.message }); } -} \ No newline at end of file +} + + + diff --git a/modules/perfil/routes/perfilIndex.routes.js b/modules/perfil/routes/perfilIndex.routes.js index 470bc79..fe89d1b 100644 --- a/modules/perfil/routes/perfilIndex.routes.js +++ b/modules/perfil/routes/perfilIndex.routes.js @@ -1,19 +1,11 @@ const express = require('express'); const router = express.Router(); -// Importen aquí los archivos de ruta del módulo -// EJEMPLO: const registrarActividadRoute = require('./registrarActividad.routes'); +const consultarPerfilRoute = require('./consultarPerfil.routes'); +const modificarPerfilRoute = require('./modificarPerfil.routes'); -// Pongan la ruta que quieren usar y el archivo de la ruta de la funcionalidad -// EJEMPLO router.use('/registrar', registrarActividadRoute); - - - -const consultarPerfilRoutes = require('./consultarPerfil.routes'); -const modificarPerfilRoutes = require('./modificarPerfil.routes'); - - -router.get('/consultar', consultarPerfilRoutes) -router.get('/modificar', modificarPerfilRoutes) +// Importar y usar las rutas en el enrutador principal del módulo +router.use('/consultar', consultarPerfilRoute) +router.use('/modificar', modificarPerfilRoute) module.exports = router; \ No newline at end of file From 58e0f2e0630958efc21811286bde9489fe8524c4 Mon Sep 17 00:00:00 2001 From: Diego Date: Thu, 19 Sep 2024 18:34:19 -0600 Subject: [PATCH 064/231] fix(perfil) - Error en las rutas de modificar perfil --- models/perfil/perfil.model.js | 16 ++++++++++++++++ .../controllers/consultarPerfil.controller.js | 4 ++-- .../controllers/modificarPerfil.controller.js | 4 ++-- modules/perfil/routes/modificarPerfil.routes.js | 9 ++++++--- modules/perfil/routes/perfilIndex.routes.js | 1 + 5 files changed, 27 insertions(+), 7 deletions(-) diff --git a/models/perfil/perfil.model.js b/models/perfil/perfil.model.js index f3b0565..7dae4eb 100644 --- a/models/perfil/perfil.model.js +++ b/models/perfil/perfil.model.js @@ -14,6 +14,10 @@ const DatosPerfilSchema = new mongoose.Schema( type: String, required: true }, + fechaNacimiento: { + type: Date, + required: false + }, tipoSangre: { type: String, required: false @@ -26,6 +30,18 @@ const DatosPerfilSchema = new mongoose.Schema( type: Number, required: false }, + kilometrosRecorridos: { + type: Number, + required: false + }, + tiempoEnRecorrido: { + type: Number, + required: false + }, + rodadasCompletadas: { + type: Number, + required: false + }, fechaRegistro: { type: Date, required: true diff --git a/modules/perfil/controllers/consultarPerfil.controller.js b/modules/perfil/controllers/consultarPerfil.controller.js index b2a3bfa..90e9017 100644 --- a/modules/perfil/controllers/consultarPerfil.controller.js +++ b/modules/perfil/controllers/consultarPerfil.controller.js @@ -1,8 +1,8 @@ -const DatosPerfil = require('../../../models/perfil/perfil.model'); +const Perfil = require('../../../models/perfil/perfil.model'); exports.consultarPerfil = async (request, response) => { try{ - const perfil = await DatosPerfil.find(); + const perfil = await Perfil.find(); return res.status(200).json({ code: 200, msg: 'Consulta de datos de perfil exitosa', diff --git a/modules/perfil/controllers/modificarPerfil.controller.js b/modules/perfil/controllers/modificarPerfil.controller.js index 3b2c5a0..53dcf02 100644 --- a/modules/perfil/controllers/modificarPerfil.controller.js +++ b/modules/perfil/controllers/modificarPerfil.controller.js @@ -9,8 +9,8 @@ exports.putPerfil = async (request, response) => { const numeroEmergencia = request.body.numeroEmergencia; try { - const perfil = await Perfil.putPerfil(IDUsuario, Username, nombre, tipoSangre, numeroEmergencia); - return response.status(201).json(perfil); + const profile = await Perfil.putPerfil(IDUsuario, Username, nombre, tipoSangre, numeroEmergencia); + return response.status(201).json(profile); } catch (error) { return response.status(404).json({ message: 'Error al modificar el perfil', error: error.message }); } diff --git a/modules/perfil/routes/modificarPerfil.routes.js b/modules/perfil/routes/modificarPerfil.routes.js index 6e18235..2f552e5 100644 --- a/modules/perfil/routes/modificarPerfil.routes.js +++ b/modules/perfil/routes/modificarPerfil.routes.js @@ -7,8 +7,11 @@ const router = express.Router(); // Pongan la ruta que quieren usar y el archivo de la ruta de la funcionalidad // EJEMPLO router.use('/registrar', registrarActividadRoute); -const modificarPerfil = require('../controllers/modificarPerfil.controller'); +const modificarPerfilController = require('../controllers/modificarPerfil.controller'); -router.get('/', modificarPerfil.modificarPerfil) +router.put('/', function(req, res){ + modificarPerfilController.modificarPerfil + }); + +module.exports = router; -module.exports = router; \ No newline at end of file diff --git a/modules/perfil/routes/perfilIndex.routes.js b/modules/perfil/routes/perfilIndex.routes.js index fe89d1b..dbe2d68 100644 --- a/modules/perfil/routes/perfilIndex.routes.js +++ b/modules/perfil/routes/perfilIndex.routes.js @@ -8,4 +8,5 @@ const modificarPerfilRoute = require('./modificarPerfil.routes'); router.use('/consultar', consultarPerfilRoute) router.use('/modificar', modificarPerfilRoute) + module.exports = router; \ No newline at end of file From 1d493890db345339b76703a25e002d6792dba35d Mon Sep 17 00:00:00 2001 From: Zathiald Date: Thu, 19 Sep 2024 19:36:35 -0600 Subject: [PATCH 065/231] Fix: Arreglar nombre de lista de rutas --- modules/mapa/controllers/consultarMapa.controller.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/mapa/controllers/consultarMapa.controller.js b/modules/mapa/controllers/consultarMapa.controller.js index c9abfd2..c17ceef 100644 --- a/modules/mapa/controllers/consultarMapa.controller.js +++ b/modules/mapa/controllers/consultarMapa.controller.js @@ -2,13 +2,14 @@ const Ruta = require('../../../models/ruta/ruta.model'); exports.getRutas = async (req, res) => { try { - const rutas = await Ruta.find({}) - res.json(rutas); + const rutas = await Ruta.find({}); + res.json({ "listaDeRutas": rutas }); // Cambia esto a un objeto con la propiedad 'listaDeRutas' } catch (error) { res.status(500).json({ message: 'Error al obtener las rutas', error }); } }; + exports.getRuta = async (req, res) => { try { const { id } = req.params; // Obtén el ID de los parámetros de la solicitud From b0e0dfc0afa6b34bff294f6f152d91807c859b85 Mon Sep 17 00:00:00 2001 From: AndreaMedinaRico Date: Thu, 19 Sep 2024 20:18:20 -0600 Subject: [PATCH 066/231] fix(actividades): arreglar error en modelos --- models/actividades/actividad.model.js | 8 ++++---- models/actividades/evento.model.js | 11 +++++------ models/actividades/rodada.model.js | 8 ++++---- models/actividades/taller.model.js | 11 +++++------ 4 files changed, 18 insertions(+), 20 deletions(-) diff --git a/models/actividades/actividad.model.js b/models/actividades/actividad.model.js index e3fc780..58b28d2 100644 --- a/models/actividades/actividad.model.js +++ b/models/actividades/actividad.model.js @@ -1,6 +1,7 @@ const mongoose = require('mongoose'); +const {rutaSchema, coordenadaSchema} = require('../ruta/ruta.model'); -const actividadSchema = new Schema ({ +const actividadSchema = new mongoose.Schema ({ titulo: { type: String, required: true @@ -17,6 +18,7 @@ const actividadSchema = new Schema ({ type: String, required: true }, + // Incluye materiales requeridos para actividad descripcion: { type: String, required: true @@ -35,6 +37,4 @@ const actividadSchema = new Schema ({ } }); -const actividad = mongoose.model('Actividad', actividadSchema); - -module.exports = actividad; \ No newline at end of file +module.exports = actividadSchema; \ No newline at end of file diff --git a/models/actividades/evento.model.js b/models/actividades/evento.model.js index c7c9ad4..084cfa4 100644 --- a/models/actividades/evento.model.js +++ b/models/actividades/evento.model.js @@ -1,16 +1,15 @@ const mongoose = require('mongoose'); -const Schema = mongoose.Schema; -const Actividad = require('./actividad.model'); +const actividadSchema = require('./actividad.model'); -const eventoSchema = new Schema ({ +const eventoSchema = new mongoose.Schema ({ informacion: { - type: Actividad.schema, + type: [actividadSchema], required: true } }, { collection: 'Evento' }); -const Evento = mongoose.model('Evento', eventoSchema); +const evento = mongoose.model('Evento', eventoSchema); -module.exports = Evento; \ No newline at end of file +module.exports = evento; \ No newline at end of file diff --git a/models/actividades/rodada.model.js b/models/actividades/rodada.model.js index 576d389..53a88f7 100644 --- a/models/actividades/rodada.model.js +++ b/models/actividades/rodada.model.js @@ -1,13 +1,13 @@ const mongoose = require('mongoose'); const Schema = mongoose.Schema; const Ruta = require('../ruta/ruta.model'); -const Actividad = require('./actividad.model'); +const actividadSchema = require('./actividad.model'); const rodadaSchema = new Schema ({ - informacion: [{ - type: Actividad.schema, + informacion: { + type: [actividadSchema], required: true - }], + }, ruta: [{ type: Schema.Types.ObjectId, ref: 'Ruta', diff --git a/models/actividades/taller.model.js b/models/actividades/taller.model.js index 2a830d3..51c2631 100644 --- a/models/actividades/taller.model.js +++ b/models/actividades/taller.model.js @@ -1,16 +1,15 @@ const mongoose = require('mongoose'); -const Schema = mongoose.Schema; -const Actividad = require('./actividad.model'); +const actividadSchema = require('./actividad.model'); -const tallerSchema = new Schema ({ +const tallerSchema = new mongoose.Schema ({ informacion: { - type: Actividad.schema, + type: [actividadSchema], required: true } }, { collection: 'Taller' }); -const Taller = mongoose.model('Taller', tallerSchema); +const taller = mongoose.model('Taller', tallerSchema); -module.exports = Taller; \ No newline at end of file +module.exports = taller; \ No newline at end of file From 400aea71561bf2fea5cf8df3d4fd7e624f4584b4 Mon Sep 17 00:00:00 2001 From: AndreaMedinaRico Date: Thu, 19 Sep 2024 20:50:55 -0600 Subject: [PATCH 067/231] fix(actividades): arreglar response del controlador de registrar --- models/actividades/registraActividad.model.js | 6 ++++++ .../controllers/registrarActividad.controller.js | 6 ++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/models/actividades/registraActividad.model.js b/models/actividades/registraActividad.model.js index 8bfa1ae..f0be24d 100644 --- a/models/actividades/registraActividad.model.js +++ b/models/actividades/registraActividad.model.js @@ -15,15 +15,21 @@ async function registrarActividad(tipo, data) { if (tipo === 'rodada') { const rodada = await Rodada.create(data); await rodada.save(); + return rodada; + } else if (tipo === 'taller') { console.log("Creando taller"); const taller = await Taller.create(data); console.log("Taller creado"); await taller.save(); console.log("Taller guardado"); + return taller; + } else if (tipo === 'evento') { const evento = await Evento.create(data); await evento.save(); + return evento; + } else { throw new Error('Tipo de actividad no válido'); } diff --git a/modules/actividades/controllers/registrarActividad.controller.js b/modules/actividades/controllers/registrarActividad.controller.js index 211303a..b5d5cad 100644 --- a/modules/actividades/controllers/registrarActividad.controller.js +++ b/modules/actividades/controllers/registrarActividad.controller.js @@ -7,12 +7,14 @@ exports.getRegistrarActividad = (request, response) => { exports.postRegistrarActividad = async (request, response) => { const data = request.body; const tipo = request.params.tipo; + console.log("El tipo es:", tipo); + console.log("Los datos son:", data); try { const registro = await registrarActividad(tipo, data); - response.status(201).json({ message: 'Rodada creada exitosamente.', error }); + response.status(201).json({ message: `${tipo} creada exitosamente.`, registro }); } catch (error) { - response.status(500).json({ message: 'Error al crear la rodada', error }); + response.status(500).json({ message: `Error al crear la ${tipo}`, error }); } } From ce3bf845eb6573bdabd27e702324800f86205dd7 Mon Sep 17 00:00:00 2001 From: Jesus0204 Date: Fri, 20 Sep 2024 09:55:07 -0600 Subject: [PATCH 068/231] feat: get para verificar si un username ya existe --- models/perfil/usuario.model.js | 1 + .../controllers/getUsername.controller.js | 34 +++++++++++++++++++ modules/session/routes/getUsername.routes.js | 8 +++++ modules/session/routes/sessionIndex.routes.js | 2 ++ 4 files changed, 45 insertions(+) create mode 100644 modules/session/controllers/getUsername.controller.js create mode 100644 modules/session/routes/getUsername.routes.js diff --git a/models/perfil/usuario.model.js b/models/perfil/usuario.model.js index 77aeeea..b8afe2f 100644 --- a/models/perfil/usuario.model.js +++ b/models/perfil/usuario.model.js @@ -5,6 +5,7 @@ const usuarioSchema = new mongoose.Schema( username: { type: String, required: true, + unique: true, }, nombre: { type: String, diff --git a/modules/session/controllers/getUsername.controller.js b/modules/session/controllers/getUsername.controller.js new file mode 100644 index 0000000..a97eb5f --- /dev/null +++ b/modules/session/controllers/getUsername.controller.js @@ -0,0 +1,34 @@ +const Usuario = require('../../../models/perfil/usuario.model'); + +exports.getUsername = async (request, response) => { + try { + // Obtener el username desde los parámetros de consulta (query params) + const { + username + } = request.query; + + // Buscar en la base de datos si el username ya existe + const usuario = await Usuario.findOne({ + username: username + }); + + if (usuario) { + // Si se encuentra un usuario con ese username + return response.status(200).json({ + usernameExistente: true, + mensaje: "El username ya existe" + }); + } else { + // Si no se encuentra ningún usuario con ese username + return response.status(200).json({ + usernameExistente: false, + mensaje: "El username está disponible" + }); + } + + } catch (error) { + return response.status(500).json({ + error: error.message + }); + } +} \ No newline at end of file diff --git a/modules/session/routes/getUsername.routes.js b/modules/session/routes/getUsername.routes.js new file mode 100644 index 0000000..5eb8256 --- /dev/null +++ b/modules/session/routes/getUsername.routes.js @@ -0,0 +1,8 @@ +const express = require('express'); +const router = express.Router(); + +const getUsernameController = require('../controllers/getUsername.controller'); + +router.get('/', getUsernameController.getUsername); + +module.exports = router; \ No newline at end of file diff --git a/modules/session/routes/sessionIndex.routes.js b/modules/session/routes/sessionIndex.routes.js index c0874ca..b22f8cf 100644 --- a/modules/session/routes/sessionIndex.routes.js +++ b/modules/session/routes/sessionIndex.routes.js @@ -5,10 +5,12 @@ const registrarUsuarioRoute = require('./registrarUsuario.routes'); const rolPrivilegioRoute = require('./rolPrivilegio.routes'); const getUserEmailRoute = require('./getUserEmail.routes'); const perfilCompletoRoute = require('./perfilCompleto.routes'); +const getUsernameRoute = require('./getUsername.routes'); router.use('/registrarUsuario', registrarUsuarioRoute); router.use('/rolPrivilegio', rolPrivilegioRoute); router.use('/getUserEmail', getUserEmailRoute); router.use('/perfilCompleto', perfilCompletoRoute); +router.use('/getUsername', getUsernameRoute); module.exports = router; \ No newline at end of file From b50449f1eb656287a810eaa5a5500ed3760a7b9e Mon Sep 17 00:00:00 2001 From: Jesus0204 Date: Fri, 20 Sep 2024 10:05:41 -0600 Subject: [PATCH 069/231] fix: corregir errores de linter --- models/otros/anuncio.model.js | 58 +++++++++++++---------------------- 1 file changed, 21 insertions(+), 37 deletions(-) diff --git a/models/otros/anuncio.model.js b/models/otros/anuncio.model.js index 896f5ba..9da01c2 100644 --- a/models/otros/anuncio.model.js +++ b/models/otros/anuncio.model.js @@ -33,52 +33,36 @@ const announcementSchema = new mongoose.Schema({ const Anuncio = mongoose.model('Anuncio', announcementSchema); async function postAnnouncement(IDUsuario, titulo, contenido, imagen){ - try { - const announcement = await Anuncio.create({ - IDUsuario: IDUsuario, - titulo: titulo, - contenido: contenido, - imagen: imagen - }); - await announcement.save(); - } catch (error) { - throw error; - } + const announcement = await Anuncio.create({ + IDUsuario: IDUsuario, + titulo: titulo, + contenido: contenido, + imagen: imagen + }); + await announcement.save(); } -async function getAnnouncements(IDAnuncio){ - try { - const announcements = await Anuncio.find(); - return announcements; - } catch (error) { - throw error; - } +async function getAnnouncements(){ + const announcements = await Anuncio.find(); + return announcements; } async function putAnnouncement(IDAnuncio, IDUsuario, titulo, contenido, imagen){ - try { - const announcement = await Anuncio.findById(IDAnuncio); - if (announcement) { - announcement.IDUsuario = IDUsuario; - announcement.titulo = titulo; - announcement.contenido = contenido; - announcement.imagen = imagen; - await announcement.save(); - return announcement; - } else { - throw new Error('Anuncio no encontrado'); - } - } catch (error) { - throw error; + const announcement = await Anuncio.findById(IDAnuncio); + if (announcement) { + announcement.IDUsuario = IDUsuario; + announcement.titulo = titulo; + announcement.contenido = contenido; + announcement.imagen = imagen; + await announcement.save(); + return announcement; + } else { + throw new Error('Anuncio no encontrado'); } } async function deleteAnnouncement(IDAnuncio){ - try { - await Anuncio.findByIdAndDelete(IDAnuncio); - } catch (error) { - throw error; - } + await Anuncio.findByIdAndDelete(IDAnuncio); } module.exports = { From e2de2931011946c741b2a54aa212dfd9be930b2f Mon Sep 17 00:00:00 2001 From: SamirBaidon <111139805+Zathiald@users.noreply.github.com> Date: Fri, 20 Sep 2024 21:49:09 -0600 Subject: [PATCH 070/231] Fix: Cambiar atributo de nivel --- models/ruta/ruta.model.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/models/ruta/ruta.model.js b/models/ruta/ruta.model.js index 8a09af1..98da426 100644 --- a/models/ruta/ruta.model.js +++ b/models/ruta/ruta.model.js @@ -29,7 +29,7 @@ const rutaSchema = new mongoose.Schema({ required: true }, nivel: { - type: Number, + type: String, required: true, }, coordenadas: { @@ -42,4 +42,4 @@ const rutaSchema = new mongoose.Schema({ const Ruta = mongoose.model('Ruta', rutaSchema); -module.exports = Ruta; \ No newline at end of file +module.exports = Ruta; From 063d3f2c932632cbc273f4078dc33cfebabe83d8 Mon Sep 17 00:00:00 2001 From: SamirBaidon <111139805+Zathiald@users.noreply.github.com> Date: Fri, 20 Sep 2024 21:51:09 -0600 Subject: [PATCH 071/231] Fix: Eliminar duplicacion de Route --- modules/mapa/routes/mapaIndex.routes.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/modules/mapa/routes/mapaIndex.routes.js b/modules/mapa/routes/mapaIndex.routes.js index 86f01cd..8785be7 100644 --- a/modules/mapa/routes/mapaIndex.routes.js +++ b/modules/mapa/routes/mapaIndex.routes.js @@ -1,7 +1,6 @@ const express = require('express'); const router = express.Router(); -const consultarRutaRoute = require('./consultarMapa.routes'); const registrarRutaRoute = require('./registrarRuta.routes'); const modificarRutaRoute = require('./modificarRuta.routes'); const consultarRutaRoute = require('./consultarMapa.routes'); @@ -12,4 +11,4 @@ router.use('/', registrarRutaRoute); router.use('/', modificarRutaRoute); -module.exports = router; \ No newline at end of file +module.exports = router; From 7d3309a8e05a957c689138651472f9ece017fb04 Mon Sep 17 00:00:00 2001 From: A01710217 Date: Sat, 21 Sep 2024 23:02:50 -0600 Subject: [PATCH 072/231] fix(ConsultarUsuariosActivity): filtrar por rol --- app.js | 2 +- .../consultarUsuario.controller.js | 33 +++++++++++++++++++ .../perfil/routes/consultarUsuario.route.js | 0 .../perfil/routes/consultarUsuario.routes.js | 11 +++++++ modules/perfil/routes/perfilIndex.routes.js | 7 ++-- .../registrarPreguntaFrecuente.controller.js | 2 +- 6 files changed, 49 insertions(+), 6 deletions(-) delete mode 100644 modules/perfil/routes/consultarUsuario.route.js create mode 100644 modules/perfil/routes/consultarUsuario.routes.js diff --git a/app.js b/app.js index c6dcd4f..c9c5bb5 100644 --- a/app.js +++ b/app.js @@ -3,7 +3,7 @@ const express = require("express"); const mongoose = require("mongoose"); const app = express(); -const port = process.env.PORT || 7070; +const port = process.env.PORT || 8080; const bodyParser = require("body-parser"); diff --git a/modules/perfil/controllers/consultarUsuario.controller.js b/modules/perfil/controllers/consultarUsuario.controller.js index e69de29..12ecfbe 100644 --- a/modules/perfil/controllers/consultarUsuario.controller.js +++ b/modules/perfil/controllers/consultarUsuario.controller.js @@ -0,0 +1,33 @@ +const PoseeRol = require('../../../models/perfil/poseeRol.model'); + +exports.getUsuarios = async (req, res) => { + try { + //Consultar los usuarios con los roles + const usuariosConRoles = await PoseeRol.find({}) + .populate('IDUsuario') //Aquí unimos la relación con el Usuario + .populate('IDRol'); //Aquí unimos la relación con el Rol + + //Verificar que ambos objetos (usuario y rol) existan + const result = usuariosConRoles + .filter(ur => ur.IDUsuario && ur.IDRol) //Filtrar los registros que tengan ambos datos + .map(ur => ({ + usuario: { + id: ur.IDUsuario._id, + username: ur.IDUsuario.username, + nombre: ur.IDUsuario.nombre, + correoElectronico: ur.IDUsuario.correoElectronico, + }, + rol: { + id: ur.IDRol._id, + nombreRol: ur.IDRol.nombre + } + })); + + //Enviar la respuesta con los usuarios y roles + res.status(200).json({ usuarios: result }); + + } catch (error) { + //En caso de error, responder con un mensaje de error y el código HTTP 500 (Error interno del servidor) + res.status(500).json({ message: "Error al obtener los usuarios", error: error.message }); + } +}; diff --git a/modules/perfil/routes/consultarUsuario.route.js b/modules/perfil/routes/consultarUsuario.route.js deleted file mode 100644 index e69de29..0000000 diff --git a/modules/perfil/routes/consultarUsuario.routes.js b/modules/perfil/routes/consultarUsuario.routes.js new file mode 100644 index 0000000..000f36e --- /dev/null +++ b/modules/perfil/routes/consultarUsuario.routes.js @@ -0,0 +1,11 @@ +const express = require('express'); +const router = express.Router(); + +// Importar el controlador que maneja la creación de actividades +const consultarUsuariosController = require('../controllers/consultarUsuario.controller'); + +// Definir la ruta para crear una actividad +router.get('/', consultarUsuariosController.getUsuarios); + + +module.exports = router; \ No newline at end of file diff --git a/modules/perfil/routes/perfilIndex.routes.js b/modules/perfil/routes/perfilIndex.routes.js index 4f3c24d..862daf9 100644 --- a/modules/perfil/routes/perfilIndex.routes.js +++ b/modules/perfil/routes/perfilIndex.routes.js @@ -1,10 +1,9 @@ const express = require('express'); const router = express.Router(); -// Importen aquí los archivos de ruta del módulo -// EJEMPLO: const registrarActividadRoute = require('./registrarActividad.routes'); +const consultarUsuariosRoute = require('./consultarUsuario.routes'); -// Pongan la ruta que quieren usar y el archivo de la ruta de la funcionalidad -// EJEMPLO router.use('/registrar', registrarActividadRoute); +//Importar y usar las rutas en el enrutador principal del módulo +router.use('/consultarUsuarios', consultarUsuariosRoute); module.exports = router; \ No newline at end of file diff --git a/modules/preguntasFrecuentes/controllers/registrarPreguntaFrecuente.controller.js b/modules/preguntasFrecuentes/controllers/registrarPreguntaFrecuente.controller.js index 066ec72..317f757 100644 --- a/modules/preguntasFrecuentes/controllers/registrarPreguntaFrecuente.controller.js +++ b/modules/preguntasFrecuentes/controllers/registrarPreguntaFrecuente.controller.js @@ -1,3 +1,3 @@ -exports.getPrueba = (request, response) => { +exports.registrarPreguntaFrecuente = (request, response) => { response.json('Preguntas Frecuentes: Esta es la plantilla que deben usar.'); }; \ No newline at end of file From 7ad6ffb366aa0f43f8fb07f867dcd0f909bc6bcd Mon Sep 17 00:00:00 2001 From: Angeltrek Date: Sun, 22 Sep 2024 03:41:38 -0600 Subject: [PATCH 073/231] feat(buscarUsuarios): agregar buscar usuarios por nombre o correo --- .../controllers/buscarUsuarios.controller.js | 47 +++++++++++++++++++ ...ler.js => consultarUsuarios.controller.js} | 0 .../perfil/routes/buscarUsuarios.routes.js | 10 ++++ .../perfil/routes/consultarUsuario.routes.js | 11 ----- .../perfil/routes/consultarUsuarios.routes.js | 10 ++++ modules/perfil/routes/perfilIndex.routes.js | 10 ++-- 6 files changed, 73 insertions(+), 15 deletions(-) create mode 100644 modules/perfil/controllers/buscarUsuarios.controller.js rename modules/perfil/controllers/{consultarUsuario.controller.js => consultarUsuarios.controller.js} (100%) create mode 100644 modules/perfil/routes/buscarUsuarios.routes.js delete mode 100644 modules/perfil/routes/consultarUsuario.routes.js create mode 100644 modules/perfil/routes/consultarUsuarios.routes.js diff --git a/modules/perfil/controllers/buscarUsuarios.controller.js b/modules/perfil/controllers/buscarUsuarios.controller.js new file mode 100644 index 0000000..2f69dfc --- /dev/null +++ b/modules/perfil/controllers/buscarUsuarios.controller.js @@ -0,0 +1,47 @@ +const Usuario = require("../../../models/perfil/usuario.model"); +const PoseeRol = require("../../../models/perfil/poseeRol.model"); + +exports.searchUsuarios = async (req, res) => { + const { query } = req.query; // Recibe el criterio de búsqueda desde la URL, por ejemplo: ?query=john.doe + + try { + // Consultar los usuarios cuyo username o correo coincidan con el criterio + const usuarios = await Usuario.find({ + $or: [ + { username: { $regex: query, $options: "i" } }, // Búsqueda por username (case-insensitive) + { correoElectronico: { $regex: query, $options: "i" } }, // Búsqueda por correo electrónico + ], + }); + + // Obtener los roles relacionados para cada usuario encontrado + const usuariosConRoles = await PoseeRol.find({ + IDUsuario: { $in: usuarios.map((u) => u._id) }, + }) + .populate("IDUsuario") // Unir con los datos del usuario + .populate("IDRol"); // Unir con los roles + + // Filtrar y estructurar la respuesta + const result = usuariosConRoles + .filter((ur) => ur.IDUsuario && ur.IDRol) // Filtrar registros válidos + .map((ur) => ({ + usuario: { + id: ur.IDUsuario._id, + username: ur.IDUsuario.username, + nombre: ur.IDUsuario.nombre, + correoElectronico: ur.IDUsuario.correoElectronico, + }, + rol: { + id: ur.IDRol._id, + nombreRol: ur.IDRol.nombre, + }, + })); + + // Enviar la respuesta con los usuarios y roles + res.status(200).json({ usuarios: result }); + } catch (error) { + // En caso de error, responder con un mensaje de error + res + .status(500) + .json({ message: "Error al buscar los usuarios", error: error.message }); + } +}; diff --git a/modules/perfil/controllers/consultarUsuario.controller.js b/modules/perfil/controllers/consultarUsuarios.controller.js similarity index 100% rename from modules/perfil/controllers/consultarUsuario.controller.js rename to modules/perfil/controllers/consultarUsuarios.controller.js diff --git a/modules/perfil/routes/buscarUsuarios.routes.js b/modules/perfil/routes/buscarUsuarios.routes.js new file mode 100644 index 0000000..508ec18 --- /dev/null +++ b/modules/perfil/routes/buscarUsuarios.routes.js @@ -0,0 +1,10 @@ +const express = require("express"); +const router = express.Router(); + +// Importar el controlador que maneja la creación de actividades +const buscarUsuariosController = require("../controllers/buscarUsuarios.controller"); + +// Definir la ruta para crear una actividad +router.get("/", buscarUsuariosController.searchUsuarios); + +module.exports = router; diff --git a/modules/perfil/routes/consultarUsuario.routes.js b/modules/perfil/routes/consultarUsuario.routes.js deleted file mode 100644 index 000f36e..0000000 --- a/modules/perfil/routes/consultarUsuario.routes.js +++ /dev/null @@ -1,11 +0,0 @@ -const express = require('express'); -const router = express.Router(); - -// Importar el controlador que maneja la creación de actividades -const consultarUsuariosController = require('../controllers/consultarUsuario.controller'); - -// Definir la ruta para crear una actividad -router.get('/', consultarUsuariosController.getUsuarios); - - -module.exports = router; \ No newline at end of file diff --git a/modules/perfil/routes/consultarUsuarios.routes.js b/modules/perfil/routes/consultarUsuarios.routes.js new file mode 100644 index 0000000..63e258b --- /dev/null +++ b/modules/perfil/routes/consultarUsuarios.routes.js @@ -0,0 +1,10 @@ +const express = require("express"); +const router = express.Router(); + +// Importar el controlador que maneja la creación de actividades +const consultarUsuariosController = require("../controllers/consultarUsuarios.controller"); + +// Definir la ruta para crear una actividad +router.get("/", consultarUsuariosController.getUsuarios); + +module.exports = router; diff --git a/modules/perfil/routes/perfilIndex.routes.js b/modules/perfil/routes/perfilIndex.routes.js index 862daf9..1d3137a 100644 --- a/modules/perfil/routes/perfilIndex.routes.js +++ b/modules/perfil/routes/perfilIndex.routes.js @@ -1,9 +1,11 @@ -const express = require('express'); +const express = require("express"); const router = express.Router(); -const consultarUsuariosRoute = require('./consultarUsuario.routes'); +const consultarUsuariosRoute = require("./consultarUsuarios.routes"); +const buscarUsuariosRoute = require("./buscarUsuarios.routes"); //Importar y usar las rutas en el enrutador principal del módulo -router.use('/consultarUsuarios', consultarUsuariosRoute); +router.use("/consultarUsuarios", consultarUsuariosRoute); +router.use("/buscarUsuarios", buscarUsuariosRoute); -module.exports = router; \ No newline at end of file +module.exports = router; From c4c4ed3d1e74f6f343c97d28084c0254ec280c75 Mon Sep 17 00:00:00 2001 From: Angeltrek Date: Sun, 22 Sep 2024 17:14:14 -0600 Subject: [PATCH 074/231] fixed(consultarPerfil.controller): Se comento todo el codigo porque no se sigue la estructura de la base de datos --- app.js | 4 +- models/perfil/perfil.model.js | 149 +++++++++--------- .../controllers/consultarPerfil.controller.js | 36 ++--- .../perfil/routes/consultarPerfil.routes.js | 8 +- 4 files changed, 96 insertions(+), 101 deletions(-) diff --git a/app.js b/app.js index 309c7d6..20064b5 100644 --- a/app.js +++ b/app.js @@ -19,7 +19,7 @@ app.use(compression()); // Conectar a la base de datos usando variables de entorno mongoose - .connect('mongodb://localhost:27017/Saca_la_Bici') + .connect(process.env.MONGO_URI) .then(() => { console.log("Conectado a la base de datos de MongoDB en AWS EC2"); }) @@ -71,4 +71,4 @@ app.use((request, response) => { app.listen(port, () => { console.log(`Servidor escuchando en el puerto ${port}`); -}); \ No newline at end of file +}); diff --git a/models/perfil/perfil.model.js b/models/perfil/perfil.model.js index 7dae4eb..44051c7 100644 --- a/models/perfil/perfil.model.js +++ b/models/perfil/perfil.model.js @@ -1,82 +1,77 @@ -const mongoose = require('mongoose'); +// const mongoose = require('mongoose'); -const DatosPerfilSchema = new mongoose.Schema( - { - _id: { - type: String, - required: true, - }, - username: { - type: String, - required: true - }, - nombre: { - type: String, - required: true - }, - fechaNacimiento: { - type: Date, - required: false - }, - tipoSangre: { - type: String, - required: false - }, - correoElectronico: { - type: String, - required: true - }, - numeroEmergencia: { - type: Number, - required: false - }, - kilometrosRecorridos: { - type: Number, - required: false - }, - tiempoEnRecorrido: { - type: Number, - required: false - }, - rodadasCompletadas: { - type: Number, - required: false - }, - fechaRegistro: { - type: Date, - required: true - } -}, { - collection: 'DatosPerfil' -}); +// const DatosPerfilSchema = new mongoose.Schema( +// { +// _id: { +// type: String, +// required: true, +// }, +// username: { +// type: String, +// required: true +// }, +// nombre: { +// type: String, +// required: true +// }, +// fechaNacimiento: { +// type: Date, +// required: false +// }, +// tipoSangre: { +// type: String, +// required: false +// }, +// correoElectronico: { +// type: String, +// required: true +// }, +// numeroEmergencia: { +// type: Number, +// required: false +// }, +// kilometrosRecorridos: { +// type: Number, +// required: false +// }, +// tiempoEnRecorrido: { +// type: Number, +// required: false +// }, +// rodadasCompletadas: { +// type: Number, +// required: false +// }, +// fechaRegistro: { +// type: Date, +// required: true +// } +// }, { +// collection: 'DatosPerfil' +// }); -const Perfil = mongoose.model('Usuario', DatosPerfilSchema); +// const Perfil = mongoose.model('Usuario', DatosPerfilSchema); +// async function putPerfil(IDUsuario, Username, nombre, tipoSangre, numeroEmergencia){ +// try { +// const perfil = await Perfil.findById(IDUsuario); +// if (perfil) { +// perfil.username = Username; +// perfil.nombre = nombre +// perfil.tipoSangre = tipoSangre; +// perfil.numeroEmergencia = numeroEmergencia; +// await perfil.save(); +// return perfil; +// } else { +// throw new Error('Perfil no encontrado'); +// } +// } catch (error) { +// throw error; +// } +// } - - -async function putPerfil(IDUsuario, Username, nombre, tipoSangre, numeroEmergencia){ - try { - const perfil = await Perfil.findById(IDUsuario); - if (perfil) { - perfil.username = Username; - perfil.nombre = nombre - perfil.tipoSangre = tipoSangre; - perfil.numeroEmergencia = numeroEmergencia; - - await perfil.save(); - return perfil; - } else { - throw new Error('Perfil no encontrado'); - } - } catch (error) { - throw error; - } -} - - -module.exports = { - Perfil, - putPerfil -}; \ No newline at end of file +// module.exports = { +// Perfil, +// putPerfil +// }; diff --git a/modules/perfil/controllers/consultarPerfil.controller.js b/modules/perfil/controllers/consultarPerfil.controller.js index 90e9017..5e4039d 100644 --- a/modules/perfil/controllers/consultarPerfil.controller.js +++ b/modules/perfil/controllers/consultarPerfil.controller.js @@ -1,19 +1,19 @@ -const Perfil = require('../../../models/perfil/perfil.model'); +// const Perfil = require('../../../models/perfil/perfil.model'); -exports.consultarPerfil = async (request, response) => { - try{ - const perfil = await Perfil.find(); - return res.status(200).json({ - code: 200, - msg: 'Consulta de datos de perfil exitosa', - data: datos - }); - } catch(error){ - console.error(error); - return res.status(500).json({ - code: 500, - msg: 'Error al intentar consultar las preguntas frecuentes', - data: null - }); - } -} \ No newline at end of file +// exports.consultarPerfil = async (request, response) => { +// try{ +// const perfil = await Perfil.find(); +// return res.status(200).json({ +// code: 200, +// msg: 'Consulta de datos de perfil exitosa', +// data: datos +// }); +// } catch(error){ +// console.error(error); +// return res.status(500).json({ +// code: 500, +// msg: 'Error al intentar consultar las preguntas frecuentes', +// data: null +// }); +// } +// } diff --git a/modules/perfil/routes/consultarPerfil.routes.js b/modules/perfil/routes/consultarPerfil.routes.js index 2559ecb..e9d3478 100644 --- a/modules/perfil/routes/consultarPerfil.routes.js +++ b/modules/perfil/routes/consultarPerfil.routes.js @@ -1,4 +1,4 @@ -const express = require('express'); +const express = require("express"); const router = express.Router(); // Importen aquí los archivos de ruta del módulo @@ -7,8 +7,8 @@ const router = express.Router(); // Pongan la ruta que quieren usar y el archivo de la ruta de la funcionalidad // EJEMPLO router.use('/registrar', registrarActividadRoute); -const consultarPerfil = require('../controllers/consultarPerfil.controller'); +// const consultarPerfil = require('../controllers/consultarPerfil.controller'); -router.get('/', consultarPerfil.consultarPerfil) +// router.get('/', consultarPerfil.consultarPerfil) -module.exports = router; \ No newline at end of file +module.exports = router; From 5bf332d255e6824df4d848c80f4e252188644aa8 Mon Sep 17 00:00:00 2001 From: Diego Date: Sun, 22 Sep 2024 20:38:26 -0600 Subject: [PATCH 075/231] Refactor(Perfil) - Perfil.model movido a usuario.model --- models/perfil/usuario.model.js | 26 +++++++++++++- .../controllers/consultarPerfil.controller.js | 36 +++++++++---------- 2 files changed, 43 insertions(+), 19 deletions(-) diff --git a/models/perfil/usuario.model.js b/models/perfil/usuario.model.js index b8afe2f..3c42532 100644 --- a/models/perfil/usuario.model.js +++ b/models/perfil/usuario.model.js @@ -57,4 +57,28 @@ const usuarioSchema = new mongoose.Schema( const Usuario = mongoose.model("Usuario", usuarioSchema); -module.exports = Usuario; + +async function putUsuario(IDUsuario, Username, nombre, tipoSangre, numeroEmergencia){ + try { + const usuario = await Usuario.findById(IDUsuario); + if (usuario) { + usuario.username = Username; + usuario.nombre = nombre + usuario.tipoSangre = tipoSangre; + usuario.numeroEmergencia = numeroEmergencia; + + await usuario.save(); + return usuario; + } else { + throw new Error('Usuario no encontrado'); + } + } catch (error) { + throw error; + } +} + + +module.exports = { + Usuario, + putUsuario +}; diff --git a/modules/perfil/controllers/consultarPerfil.controller.js b/modules/perfil/controllers/consultarPerfil.controller.js index 5e4039d..13857b2 100644 --- a/modules/perfil/controllers/consultarPerfil.controller.js +++ b/modules/perfil/controllers/consultarPerfil.controller.js @@ -1,19 +1,19 @@ -// const Perfil = require('../../../models/perfil/perfil.model'); +const Perfil = require('../../../models/perfil/usuario.model'); -// exports.consultarPerfil = async (request, response) => { -// try{ -// const perfil = await Perfil.find(); -// return res.status(200).json({ -// code: 200, -// msg: 'Consulta de datos de perfil exitosa', -// data: datos -// }); -// } catch(error){ -// console.error(error); -// return res.status(500).json({ -// code: 500, -// msg: 'Error al intentar consultar las preguntas frecuentes', -// data: null -// }); -// } -// } +exports.consultarPerfil = async (request, response) => { + try{ + const perfil = await Perfil.find(); + return response.status(200).json({ + code: 200, + msg: 'Consulta de datos de perfil exitosa', + data: perfil + }); + } catch(error){ + console.error(error); + return ressponse.status(500).json({ + code: 500, + msg: 'Error al intentar consultar el perfil', + data: null + }); + } +} From d41019e54da63047fdcf63e6632e1d3f8161e88e Mon Sep 17 00:00:00 2001 From: Diego Date: Sun, 22 Sep 2024 20:39:44 -0600 Subject: [PATCH 076/231] Refactor(Perfil) - Perfil.model movido a usuario.model --- modules/perfil/controllers/modificarPerfil.controller.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/modules/perfil/controllers/modificarPerfil.controller.js b/modules/perfil/controllers/modificarPerfil.controller.js index 53dcf02..8ea0a6e 100644 --- a/modules/perfil/controllers/modificarPerfil.controller.js +++ b/modules/perfil/controllers/modificarPerfil.controller.js @@ -1,5 +1,4 @@ -const Perfil = require('../../../models/perfil/perfil.model'); - +const Perfil = require('../../../models/perfil/usuario.model'); exports.putPerfil = async (request, response) => { const IDUsuario = request.body.IDUsuario; @@ -9,7 +8,7 @@ exports.putPerfil = async (request, response) => { const numeroEmergencia = request.body.numeroEmergencia; try { - const profile = await Perfil.putPerfil(IDUsuario, Username, nombre, tipoSangre, numeroEmergencia); + const profile = await Perfil.putUsuario(IDUsuario, Username, nombre, tipoSangre, numeroEmergencia); return response.status(201).json(profile); } catch (error) { return response.status(404).json({ message: 'Error al modificar el perfil', error: error.message }); From 82f41b62ee1e571847e3cedbafc82bcebc4bc17e Mon Sep 17 00:00:00 2001 From: DiegoGarciaPadilla Date: Sun, 22 Sep 2024 21:17:45 -0600 Subject: [PATCH 077/231] fix: conflictos dentro de package-lock.json --- package-lock.json | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/package-lock.json b/package-lock.json index 1cdec69..22c2343 100644 --- a/package-lock.json +++ b/package-lock.json @@ -791,15 +791,9 @@ } }, "node_modules/body-parser": { -<<<<<<< HEAD - "version": "1.20.2", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.2.tgz", - "integrity": "sha512-ml9pReCu3M61kGlqoTm2umSXTlRTuGTx0bfYj+uIUKKYycG5NtSbeetV3faSU6R7ajOPw0g/J1PvK4qNy7s5bA==", -======= "version": "1.20.3", "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.3.tgz", "integrity": "sha512-7rAxByjUMqQ3/bHJy7D6OGXvx/MMc4IqBn/X0fcM1QUcAItpZrBEYhWGem+tzXH90c+G01ypMcYJBO9Y30203g==", ->>>>>>> release/0.1 "license": "MIT", "dependencies": { "bytes": "3.1.2", @@ -1394,15 +1388,8 @@ "node": ">= 0.6" } }, -<<<<<<< HEAD - "node_modules/express": { - "version": "4.21.0", - "resolved": "https://registry.npmjs.org/express/-/express-4.21.0.tgz", - "integrity": "sha512-VqcNGcj/Id5ZT1LZ/cfihi3ttTn+NJmkli2eZADigjq29qTlWi/hAQ43t/VLPq8+UX06FCEx3ByOYet6ZFblng==", -======= "node_modules/event-target-shim": { "version": "5.0.1", ->>>>>>> release/0.1 "license": "MIT", "optional": true, "engines": { @@ -1550,10 +1537,6 @@ "version": "1.3.1", "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.3.1.tgz", "integrity": "sha512-6BN9trH7bp3qvnrRyzsBz+g3lZxTNZTbVO2EV1CS0WIcDbawYVdYvGflME/9QP0h0pYlCDBCTjYa9nZzMDpyxQ==", -<<<<<<< HEAD - "license": "MIT", -======= ->>>>>>> release/0.1 "dependencies": { "debug": "2.6.9", "encodeurl": "~2.0.0", @@ -2976,10 +2959,7 @@ "version": "6.13.0", "resolved": "https://registry.npmjs.org/qs/-/qs-6.13.0.tgz", "integrity": "sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg==", -<<<<<<< HEAD "license": "BSD-3-Clause", -======= ->>>>>>> release/0.1 "dependencies": { "side-channel": "^1.0.6" }, @@ -3183,10 +3163,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", -<<<<<<< HEAD "license": "MIT", -======= ->>>>>>> release/0.1 "engines": { "node": ">= 0.8" } From adddc1e0ec5ab2fc38a3263f235beb208aa4e480 Mon Sep 17 00:00:00 2001 From: Diego Date: Mon, 23 Sep 2024 07:38:38 -0600 Subject: [PATCH 078/231] refactor(perfil) - fusionar perfil.model con usuario.model --- models/perfil/perfil.model.js | 77 ----------------------------------- 1 file changed, 77 deletions(-) delete mode 100644 models/perfil/perfil.model.js diff --git a/models/perfil/perfil.model.js b/models/perfil/perfil.model.js deleted file mode 100644 index 44051c7..0000000 --- a/models/perfil/perfil.model.js +++ /dev/null @@ -1,77 +0,0 @@ -// const mongoose = require('mongoose'); - -// const DatosPerfilSchema = new mongoose.Schema( -// { -// _id: { -// type: String, -// required: true, -// }, -// username: { -// type: String, -// required: true -// }, -// nombre: { -// type: String, -// required: true -// }, -// fechaNacimiento: { -// type: Date, -// required: false -// }, -// tipoSangre: { -// type: String, -// required: false -// }, -// correoElectronico: { -// type: String, -// required: true -// }, -// numeroEmergencia: { -// type: Number, -// required: false -// }, -// kilometrosRecorridos: { -// type: Number, -// required: false -// }, -// tiempoEnRecorrido: { -// type: Number, -// required: false -// }, -// rodadasCompletadas: { -// type: Number, -// required: false -// }, -// fechaRegistro: { -// type: Date, -// required: true -// } -// }, { -// collection: 'DatosPerfil' -// }); - -// const Perfil = mongoose.model('Usuario', DatosPerfilSchema); - -// async function putPerfil(IDUsuario, Username, nombre, tipoSangre, numeroEmergencia){ -// try { -// const perfil = await Perfil.findById(IDUsuario); -// if (perfil) { -// perfil.username = Username; -// perfil.nombre = nombre -// perfil.tipoSangre = tipoSangre; -// perfil.numeroEmergencia = numeroEmergencia; - -// await perfil.save(); -// return perfil; -// } else { -// throw new Error('Perfil no encontrado'); -// } -// } catch (error) { -// throw error; -// } -// } - -// module.exports = { -// Perfil, -// putPerfil -// }; From 1ea71fcfab90134fd00fb65a15559278017c4f71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81ngel=20Francisco=20Garc=C3=ADa=20Guzm=C3=A1n?= Date: Mon, 23 Sep 2024 09:32:42 -0600 Subject: [PATCH 079/231] Feat: agregar variable de ubicacion al modelo de usuario --- models/perfil/usuario.model.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/models/perfil/usuario.model.js b/models/perfil/usuario.model.js index b8afe2f..70083ad 100644 --- a/models/perfil/usuario.model.js +++ b/models/perfil/usuario.model.js @@ -1,5 +1,18 @@ const mongoose = require("mongoose"); +const ubicacionSchema = new mongoose.Schema({ + + latitud: { + type: Number, + required: true + }, + + longitud: { + type: Number, + required: true + }, +}) + const usuarioSchema = new mongoose.Schema( { username: { @@ -49,6 +62,10 @@ const usuarioSchema = new mongoose.Schema( unique: true, required: true, }, + + ubicacion: { + type: [ubicacionSchema] + }, }, { collection: "Usuario", From 93592e2d188b178c6079b8b3d94109bd701c91a4 Mon Sep 17 00:00:00 2001 From: AndreaMedinaRico Date: Mon, 23 Sep 2024 11:01:37 -0600 Subject: [PATCH 080/231] refac(actividades): registrar rodada y separar funciones por tipo --- models/actividades/registraActividad.model.js | 41 ++++++++++++++--- .../registrarActividad.controller.js | 44 ++++++++++++++++++- .../routes/registrarActividad.routes.js | 6 ++- modules/mapa/routes/mapaIndex.routes.js | 1 - 4 files changed, 83 insertions(+), 9 deletions(-) diff --git a/models/actividades/registraActividad.model.js b/models/actividades/registraActividad.model.js index f0be24d..eed2242 100644 --- a/models/actividades/registraActividad.model.js +++ b/models/actividades/registraActividad.model.js @@ -2,11 +2,35 @@ const Rodada = require('./rodada.model'); const Taller = require('./taller.model'); const Evento = require('./evento.model'); -async function encontrarTipo(tipo) { - if (tipo === 'rodada') return Rodada; - if (tipo === 'taller') return {model: Taller}; - if (tipo === 'evento') return Evento; - throw new Error('Tipo de actividad no válido'); +async function postRodada(data, id) { + try { + const rodada = await Rodada.create(data); + rodada.ruta = id; + await rodada.save(); + return rodada; + } catch (error) { + throw(error); + } +} + +async function postTaller(data) { + try { + const taller = await Taller.create(data); + await taller.save(); + return taller; + } catch (error) { + throw(error); + } +} + +async function postEvento(data) { + try { + const evento = await Evento.create(data); + await evento.save(); + return evento; + } catch (error) { + throw(error); + } } async function registrarActividad(tipo, data) { @@ -38,4 +62,9 @@ async function registrarActividad(tipo, data) { } } -module.exports = { registrarActividad }; \ No newline at end of file +module.exports = { + registrarActividad, + postRodada, + postTaller, + postEvento +}; \ No newline at end of file diff --git a/modules/actividades/controllers/registrarActividad.controller.js b/modules/actividades/controllers/registrarActividad.controller.js index b5d5cad..1b539bd 100644 --- a/modules/actividades/controllers/registrarActividad.controller.js +++ b/modules/actividades/controllers/registrarActividad.controller.js @@ -1,4 +1,9 @@ -const { registrarActividad } = require('../../../models/actividades/registraActividad.model.js'); +const { + registrarActividad, + postRodada, + postTaller, + postEvento +} = require('../../../models/actividades/registraActividad.model.js'); exports.getRegistrarActividad = (request, response) => { response.json('Actividad: Esta es la plantilla que deben usar.'); @@ -16,6 +21,43 @@ exports.postRegistrarActividad = async (request, response) => { } catch (error) { response.status(500).json({ message: `Error al crear la ${tipo}`, error }); } +} + +exports.postRodada = async (request, response) => { + const data = request.body; + const {id} = request.query; + + console.log("Los datos son:", data); + console.log("El id de la ruta es:", id); + + try { + const registro = await postRodada(data, id); + response.status(201).json({ message: `Rodada creada exitosamente.`, registro }); + } catch (error) { + response.status(500).json({ message: `Error al crear la rodada`, error }); + } +} + +exports.postTaller = async (request, response) => { + const data = request.body; + console.log("Los datos son:", data); + try { + const registro = await postTaller(data); + response.status(201).json({ message: `Taller creado exitosamente.`, registro }); + } catch (error) { + response.status(500).json({ message: `Error al crear el taller`, error }); + } } +exports.postEvento = async (request, response) => { + const data = request.body; + console.log("Los datos son:", data); + + try { + const registro = await postEvento(data); + response.status(201).json({ message: `Evento creado exitosamente.`, registro }); + } catch (error) { + response.status(500).json({ message: `Error al crear el evento`, error }); + } +} \ No newline at end of file diff --git a/modules/actividades/routes/registrarActividad.routes.js b/modules/actividades/routes/registrarActividad.routes.js index 5892799..9af8739 100644 --- a/modules/actividades/routes/registrarActividad.routes.js +++ b/modules/actividades/routes/registrarActividad.routes.js @@ -6,6 +6,10 @@ const registrarActividadController = require('../controllers/registrarActividad. // Definir la ruta para crear una actividad router.get('/', registrarActividadController.getRegistrarActividad); -router.post('/:tipo', registrarActividadController.postRegistrarActividad); +//router.post('/:tipo', registrarActividadController.postRegistrarActividad); + +router.post('/rodada', registrarActividadController.postRodada); +router.post('/taller', registrarActividadController.postTaller); +router.post('/evento', registrarActividadController.postEvento); module.exports = router; \ No newline at end of file diff --git a/modules/mapa/routes/mapaIndex.routes.js b/modules/mapa/routes/mapaIndex.routes.js index 86f01cd..95446fd 100644 --- a/modules/mapa/routes/mapaIndex.routes.js +++ b/modules/mapa/routes/mapaIndex.routes.js @@ -1,7 +1,6 @@ const express = require('express'); const router = express.Router(); -const consultarRutaRoute = require('./consultarMapa.routes'); const registrarRutaRoute = require('./registrarRuta.routes'); const modificarRutaRoute = require('./modificarRuta.routes'); const consultarRutaRoute = require('./consultarMapa.routes'); From 5a6612518c1f8f6fb4d72538ebc6b344a242d303 Mon Sep 17 00:00:00 2001 From: AndreaMedinaRico Date: Mon, 23 Sep 2024 11:02:51 -0600 Subject: [PATCH 081/231] refactor(actividades): eliminar funciones no utilizadas --- .../registrarActividad.controller.js | 18 ------------------ .../routes/registrarActividad.routes.js | 3 --- 2 files changed, 21 deletions(-) diff --git a/modules/actividades/controllers/registrarActividad.controller.js b/modules/actividades/controllers/registrarActividad.controller.js index 1b539bd..bf6fbca 100644 --- a/modules/actividades/controllers/registrarActividad.controller.js +++ b/modules/actividades/controllers/registrarActividad.controller.js @@ -5,24 +5,6 @@ const { postEvento } = require('../../../models/actividades/registraActividad.model.js'); -exports.getRegistrarActividad = (request, response) => { - response.json('Actividad: Esta es la plantilla que deben usar.'); -}; - -exports.postRegistrarActividad = async (request, response) => { - const data = request.body; - const tipo = request.params.tipo; - console.log("El tipo es:", tipo); - console.log("Los datos son:", data); - - try { - const registro = await registrarActividad(tipo, data); - response.status(201).json({ message: `${tipo} creada exitosamente.`, registro }); - } catch (error) { - response.status(500).json({ message: `Error al crear la ${tipo}`, error }); - } -} - exports.postRodada = async (request, response) => { const data = request.body; const {id} = request.query; diff --git a/modules/actividades/routes/registrarActividad.routes.js b/modules/actividades/routes/registrarActividad.routes.js index 9af8739..2791238 100644 --- a/modules/actividades/routes/registrarActividad.routes.js +++ b/modules/actividades/routes/registrarActividad.routes.js @@ -5,9 +5,6 @@ const router = express.Router(); const registrarActividadController = require('../controllers/registrarActividad.controller'); // Definir la ruta para crear una actividad -router.get('/', registrarActividadController.getRegistrarActividad); -//router.post('/:tipo', registrarActividadController.postRegistrarActividad); - router.post('/rodada', registrarActividadController.postRodada); router.post('/taller', registrarActividadController.postTaller); router.post('/evento', registrarActividadController.postEvento); From 7c8d7d95d0a066ef09fe11af54abf37e67159690 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81ngel=20Francisco=20Garc=C3=ADa=20Guzm=C3=A1n?= Date: Mon, 23 Sep 2024 11:55:38 -0600 Subject: [PATCH 082/231] Feat: Iniciar desarrollo de backend para iniciarRodada --- app.js | 2 + .../controllers/iniciarRodadaController.js | 46 +++++++++++++++ modules/mapa/routes/iniciarRodada.routes.js | 14 +++++ package-lock.json | 11 ++-- util/firebase-admin-config.js | 13 ++--- util/verifyUserToken.js | 58 ++++++++----------- 6 files changed, 97 insertions(+), 47 deletions(-) create mode 100644 modules/mapa/controllers/iniciarRodadaController.js create mode 100644 modules/mapa/routes/iniciarRodada.routes.js diff --git a/app.js b/app.js index 20064b5..ad5ae77 100644 --- a/app.js +++ b/app.js @@ -40,6 +40,7 @@ const rentaRoutes = require("./modules/renta/routes/rentaIndex.routes"); const reporteRoutes = require("./modules/reporte/routes/reporteIndex.routes"); const rodadasRoutes = require("./modules/rodadas/routes/rodadasIndex.routes"); const sessionRoutes = require("./modules/session/routes/sessionIndex.routes"); +const iniciarRodadaRoutes = require("./modules/mapa/routes/iniciarRodada.routes"); app.use("/actividades", actividadesRoutes); app.use("/anuncios", anunciosRoutes); @@ -53,6 +54,7 @@ app.use("/renta", rentaRoutes); app.use("/reporte", reporteRoutes); app.use("/rodadas", rodadasRoutes); app.use("/session", sessionRoutes); +app.use("/rodadas/iniciar", iniciarRodadaRoutes); const verifyToken = require("./util/verifyUserToken"); diff --git a/modules/mapa/controllers/iniciarRodadaController.js b/modules/mapa/controllers/iniciarRodadaController.js new file mode 100644 index 0000000..ba7337a --- /dev/null +++ b/modules/mapa/controllers/iniciarRodadaController.js @@ -0,0 +1,46 @@ +// iniciarRodada.controller.js + +// Simulación de una base de datos en memoria para almacenar la ubicación +let ubicacionAdmin = null; + +// Controlador para iniciar la rodada +exports.iniciarRodada = (req, res) => { + const { rutaId, adminId } = req.body; + + // Validar que se reciban ambos parámetros + if (!rutaId || !adminId) { + return res.status(400).json({ error: 'Faltan parámetros rutaId o adminId.' }); + } + + // Aquí puedes agregar lógica adicional para validar la ruta y administrador, o iniciar la rodada en la base de datos + + // Responder con éxito + res.status(200).json({ message: 'Rodada iniciada con éxito', rutaId, adminId }); +}; + +// Controlador para actualizar la ubicación del administrador +exports.actualizarUbicacion = (req, res) => { + const { latitud, longitud, adminId } = req.body; + + // Validar los parámetros de ubicación + if (!latitud || !longitud || !adminId) { + return res.status(400).json({ error: 'Faltan parámetros de ubicación o adminId.' }); + } + + // Actualizar la ubicación del administrador en la "base de datos" (aquí es solo en memoria) + ubicacionAdmin = { latitud, longitud, adminId }; + + // Responder con un mensaje de éxito + res.status(200).json({ message: 'Ubicación actualizada con éxito', ubicacion: ubicacionAdmin }); +}; + +// Controlador para obtener la ubicación actual del administrador +exports.obtenerUbicacion = (req, res) => { + // Verificar si la ubicación ha sido registrada + if (!ubicacionAdmin) { + return res.status(404).json({ error: 'No hay ubicación del administrador disponible.' }); + } + + // Responder con la ubicación actual del administrador + res.status(200).json({ ubicacion: ubicacionAdmin }); +}; diff --git a/modules/mapa/routes/iniciarRodada.routes.js b/modules/mapa/routes/iniciarRodada.routes.js new file mode 100644 index 0000000..4f616b0 --- /dev/null +++ b/modules/mapa/routes/iniciarRodada.routes.js @@ -0,0 +1,14 @@ +const express = require('express'); +const router = express.Router(); +const iniciarRodadaController = require('../controllers/iniciarRodadaController'); + +// Ruta para iniciar la rodada +router.post('/iniciar', iniciarRodadaController.iniciarRodada); + +// Ruta para recibir y actualizar la ubicación del administrador +router.post('/ubicacion', iniciarRodadaController.actualizarUbicacion); + +// Ruta opcional para obtener la ubicación actual del administrador +router.get('/ubicacion', iniciarRodadaController.obtenerUbicacion); + +module.exports = router; diff --git a/package-lock.json b/package-lock.json index 22c2343..f6ee589 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1155,11 +1155,10 @@ "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==" }, - "node_modules/encodeurl": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz", - "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==", - "license": "MIT", + "node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", "optional": true }, "node_modules/encodeurl": { @@ -3674,4 +3673,4 @@ } } } -} \ No newline at end of file +} diff --git a/util/firebase-admin-config.js b/util/firebase-admin-config.js index 45de6d7..ff1560f 100644 --- a/util/firebase-admin-config.js +++ b/util/firebase-admin-config.js @@ -1,9 +1,8 @@ -const admin = require("firebase-admin"); -const serviceAccount = require("./login-app.json"); +// const admin = require("firebase-admin"); +// const serviceAccount = require("./login-app.json"); -admin.initializeApp({ - credential: admin.credential.cert(serviceAccount), -}); +// admin.initializeApp({ +// credential: admin.credential.cert(serviceAccount), +// }); -// Exportar la instancia de admin para usar en otros archivos -module.exports = admin; +// module.exports = admin; \ No newline at end of file diff --git a/util/verifyUserToken.js b/util/verifyUserToken.js index a3b37a7..ad3632a 100644 --- a/util/verifyUserToken.js +++ b/util/verifyUserToken.js @@ -1,34 +1,24 @@ -const admin = require('./firebase-admin-config'); - -// Middleware para verificar el idToken -const verifyUserToken = async (request, response, next) => { - - // Extraer el token de los headers - const idToken = request.headers.authorization?.split(' ')[1]; - - if (!idToken) { - return response.status(401).json({ - error: 'No token provided' - }); - } - - try { - // Verificar el token con Firebase Admin SDK - const decodedToken = await admin.auth().verifyIdToken(idToken); - // Guardar el uid de Firebase del usuario en request.user - request.userUID = { - uid: decodedToken.uid - }; - - // Pasar al siguiente middleware - next(); - } catch (error) { - // Regresar el error si por alguna razón el token es incorrecto - return response.status(401).json({ - error: error, - message: 'Invalid token' - }); - } -}; - -module.exports = verifyUserToken; \ No newline at end of file +// Temporarily bypass token verification for local testing +module.exports = (req, res, next) => { + req.userUID = "test-user-id"; // Fake user ID for local testing + next(); + }; + + // Original Firebase token verification code (commented out) + // const admin = require("./firebase-admin-config"); + + // module.exports = (req, res, next) => { + // const token = req.headers.authorization; + // if (!token) { + // return res.status(401).json({ error: "Token no proporcionado" }); + // } + // admin.auth() + // .verifyIdToken(token.replace("Bearer ", "")) + // .then((decodedToken) => { + // req.userUID = decodedToken.uid; + // next(); + // }) + // .catch((error) => { + // return res.status(401).json({ error: "Token inválido" }); + // }); + // }; \ No newline at end of file From 4dd265973c4339757d0f357d829f38dd147d36bc Mon Sep 17 00:00:00 2001 From: Zathiald Date: Mon, 23 Sep 2024 12:04:02 -0600 Subject: [PATCH 083/231] Fix: Mantener base de datos en local --- app.js | 6 +++--- models/ruta/ruta.model.js | 2 +- util/firebase-admin-config.js | 12 ++++++------ util/verifyUserToken.js | 32 ++++++++++++++++---------------- 4 files changed, 26 insertions(+), 26 deletions(-) diff --git a/app.js b/app.js index ad5ae77..8482510 100644 --- a/app.js +++ b/app.js @@ -19,7 +19,7 @@ app.use(compression()); // Conectar a la base de datos usando variables de entorno mongoose - .connect(process.env.MONGO_URI) + .connect('mongodb://localhost:27017/Saca_la_Bici') .then(() => { console.log("Conectado a la base de datos de MongoDB en AWS EC2"); }) @@ -56,14 +56,14 @@ app.use("/rodadas", rodadasRoutes); app.use("/session", sessionRoutes); app.use("/rodadas/iniciar", iniciarRodadaRoutes); -const verifyToken = require("./util/verifyUserToken"); +/* const verifyToken = require("./util/verifyUserToken"); app.get("/", verifyToken, (request, response) => { response.status(200).json({ message: "¡Bienvenido a Saca la Bici!", }); console.log(request.userUID); -}); +}); */ app.use((request, response) => { response.status(404).json({ diff --git a/models/ruta/ruta.model.js b/models/ruta/ruta.model.js index 98da426..cd03d71 100644 --- a/models/ruta/ruta.model.js +++ b/models/ruta/ruta.model.js @@ -42,4 +42,4 @@ const rutaSchema = new mongoose.Schema({ const Ruta = mongoose.model('Ruta', rutaSchema); -module.exports = Ruta; +module.exports = Ruta; \ No newline at end of file diff --git a/util/firebase-admin-config.js b/util/firebase-admin-config.js index ff1560f..9a2e9da 100644 --- a/util/firebase-admin-config.js +++ b/util/firebase-admin-config.js @@ -1,8 +1,8 @@ -// const admin = require("firebase-admin"); -// const serviceAccount = require("./login-app.json"); +/* const admin = require("firebase-admin"); + const serviceAccount = require("./login-app.json"); -// admin.initializeApp({ -// credential: admin.credential.cert(serviceAccount), -// }); + admin.initializeApp({ + credential: admin.credential.cert(serviceAccount), + }); -// module.exports = admin; \ No newline at end of file + module.exports = admin; */ \ No newline at end of file diff --git a/util/verifyUserToken.js b/util/verifyUserToken.js index ad3632a..4630e7c 100644 --- a/util/verifyUserToken.js +++ b/util/verifyUserToken.js @@ -5,20 +5,20 @@ module.exports = (req, res, next) => { }; // Original Firebase token verification code (commented out) - // const admin = require("./firebase-admin-config"); + const admin = require("./firebase-admin-config"); - // module.exports = (req, res, next) => { - // const token = req.headers.authorization; - // if (!token) { - // return res.status(401).json({ error: "Token no proporcionado" }); - // } - // admin.auth() - // .verifyIdToken(token.replace("Bearer ", "")) - // .then((decodedToken) => { - // req.userUID = decodedToken.uid; - // next(); - // }) - // .catch((error) => { - // return res.status(401).json({ error: "Token inválido" }); - // }); - // }; \ No newline at end of file + module.exports = (req, res, next) => { + const token = req.headers.authorization; + if (!token) { + return res.status(401).json({ error: "Token no proporcionado" }); + } + admin.auth() + .verifyIdToken(token.replace("Bearer ", "")) + .then((decodedToken) => { + req.userUID = decodedToken.uid; + next(); + }) + .catch((error) => { + return res.status(401).json({ error: "Token inválido" }); + }); + }; \ No newline at end of file From a6787957d7916d98c6f2638053c0875eb5d19fad Mon Sep 17 00:00:00 2001 From: SamirBaidon <111139805+Zathiald@users.noreply.github.com> Date: Mon, 23 Sep 2024 17:22:57 -0600 Subject: [PATCH 084/231] Fix: Error al obtener id de ruta --- modules/mapa/controllers/modificarRuta.controller.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/mapa/controllers/modificarRuta.controller.js b/modules/mapa/controllers/modificarRuta.controller.js index 812a72e..259f3e3 100644 --- a/modules/mapa/controllers/modificarRuta.controller.js +++ b/modules/mapa/controllers/modificarRuta.controller.js @@ -2,7 +2,7 @@ const Ruta = require('../../../models/ruta/ruta.model'); exports.modificarRuta = async (req, res) => { try { - const rutaId = req.params.id; // Asume que el ID de la ruta se pasa como parámetro en la URL + const rutaId = req.params.id.trim(); // Asume que el ID de la ruta se pasa como parámetro en la URL const rutaActualizada = { titulo: req.body.Titulo, @@ -29,4 +29,4 @@ exports.modificarRuta = async (req, res) => { error: error.message || error }); } -}; \ No newline at end of file +}; From 1a9789842542897ce442712fd9c90917c6170916 Mon Sep 17 00:00:00 2001 From: SamirBaidon <111139805+Zathiald@users.noreply.github.com> Date: Mon, 23 Sep 2024 17:39:08 -0600 Subject: [PATCH 085/231] Fix: Mayusculas en variables --- .../mapa/controllers/modificarRuta.controller.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/modules/mapa/controllers/modificarRuta.controller.js b/modules/mapa/controllers/modificarRuta.controller.js index 259f3e3..d1820b9 100644 --- a/modules/mapa/controllers/modificarRuta.controller.js +++ b/modules/mapa/controllers/modificarRuta.controller.js @@ -5,13 +5,13 @@ exports.modificarRuta = async (req, res) => { const rutaId = req.params.id.trim(); // Asume que el ID de la ruta se pasa como parámetro en la URL const rutaActualizada = { - titulo: req.body.Titulo, - distancia: req.body.Distancia, - tiempo: req.body.Tiempo, - nivel: req.body.Nivel, - lugar: req.body.Lugar, - descanso: req.body.Descanso, - coordenadas: req.body.Coordenadas, + titulo: req.body.titulo, + distancia: req.body.distancia, + tiempo: req.body.tiempo, + nivel: req.body.nivel, + lugar: req.body.lugar, + descanso: req.body.descanso, + coordenadas: req.body.coordenadas, }; // Actualiza la ruta existente From b1966c50a62504184b51484d33f7baf76d3c086b Mon Sep 17 00:00:00 2001 From: SamirBaidon <111139805+Zathiald@users.noreply.github.com> Date: Mon, 23 Sep 2024 17:44:08 -0600 Subject: [PATCH 086/231] Fix: Cambio en actualizacion de ruta --- modules/mapa/controllers/modificarRuta.controller.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/mapa/controllers/modificarRuta.controller.js b/modules/mapa/controllers/modificarRuta.controller.js index d1820b9..2465b82 100644 --- a/modules/mapa/controllers/modificarRuta.controller.js +++ b/modules/mapa/controllers/modificarRuta.controller.js @@ -15,7 +15,7 @@ exports.modificarRuta = async (req, res) => { }; // Actualiza la ruta existente - const rutaModificada = await Ruta.findByIdAndUpdate(rutaId, rutaActualizada, { new: true }); + const rutaModificada = await Ruta.findByIdAndUpdate(rutaId, rutaActualizada, { new: true, overwrite: true }); if (!rutaModificada) { return res.status(404).json({ message: 'Ruta no encontrada' }); From b953ac8805e7f0a9ff3d833c7796c019215cc81e Mon Sep 17 00:00:00 2001 From: Jesus0204 Date: Mon, 23 Sep 2024 18:27:30 -0600 Subject: [PATCH 087/231] fix: Cambiar importacion de modulo de usuario --- models/perfil/usuario.model.js | 28 ++++++++----------- .../controllers/getUserEmail.controller.js | 4 ++- .../controllers/getUsername.controller.js | 4 ++- .../controllers/perfilCompleto.controller.js | 4 ++- .../registrarUsuario.controller.js | 4 ++- 5 files changed, 24 insertions(+), 20 deletions(-) diff --git a/models/perfil/usuario.model.js b/models/perfil/usuario.model.js index 3c42532..19a024a 100644 --- a/models/perfil/usuario.model.js +++ b/models/perfil/usuario.model.js @@ -59,22 +59,18 @@ const Usuario = mongoose.model("Usuario", usuarioSchema); async function putUsuario(IDUsuario, Username, nombre, tipoSangre, numeroEmergencia){ - try { - const usuario = await Usuario.findById(IDUsuario); - if (usuario) { - usuario.username = Username; - usuario.nombre = nombre - usuario.tipoSangre = tipoSangre; - usuario.numeroEmergencia = numeroEmergencia; - - await usuario.save(); - return usuario; - } else { - throw new Error('Usuario no encontrado'); - } - } catch (error) { - throw error; - } + const usuario = await Usuario.findById(IDUsuario); + if (usuario) { + usuario.username = Username; + usuario.nombre = nombre + usuario.tipoSangre = tipoSangre; + usuario.numeroEmergencia = numeroEmergencia; + + await usuario.save(); + return usuario; + } else { + throw new Error('Usuario no encontrado'); + } } diff --git a/modules/session/controllers/getUserEmail.controller.js b/modules/session/controllers/getUserEmail.controller.js index 9c18fbe..66e5030 100644 --- a/modules/session/controllers/getUserEmail.controller.js +++ b/modules/session/controllers/getUserEmail.controller.js @@ -1,4 +1,6 @@ -const Usuario = require('../../../models/perfil/usuario.model'); +const { + Usuario +} = require('../../../models/perfil/usuario.model'); exports.getUserEmail = async (request, response) => { const username = request.query.username; diff --git a/modules/session/controllers/getUsername.controller.js b/modules/session/controllers/getUsername.controller.js index a97eb5f..b92f64a 100644 --- a/modules/session/controllers/getUsername.controller.js +++ b/modules/session/controllers/getUsername.controller.js @@ -1,4 +1,6 @@ -const Usuario = require('../../../models/perfil/usuario.model'); +const { + Usuario +} = require('../../../models/perfil/usuario.model'); exports.getUsername = async (request, response) => { try { diff --git a/modules/session/controllers/perfilCompleto.controller.js b/modules/session/controllers/perfilCompleto.controller.js index 57ac8a1..0fe0dc0 100644 --- a/modules/session/controllers/perfilCompleto.controller.js +++ b/modules/session/controllers/perfilCompleto.controller.js @@ -1,4 +1,6 @@ -const Usuario = require('../../../models/perfil/usuario.model'); +const { + Usuario +} = require('../../../models/perfil/usuario.model'); exports.perfilCompleto = async (request, response) => { diff --git a/modules/session/controllers/registrarUsuario.controller.js b/modules/session/controllers/registrarUsuario.controller.js index 6685170..e9b85e7 100644 --- a/modules/session/controllers/registrarUsuario.controller.js +++ b/modules/session/controllers/registrarUsuario.controller.js @@ -1,4 +1,6 @@ -const Usuario = require("../../../models/perfil/usuario.model"); +const { + Usuario +} = require('../../../models/perfil/usuario.model'); const Rol = require("../../../models/perfil/rol.model"); const PoseeRol = require("../../../models/perfil/poseeRol.model"); // Modelo para la relación entre usuario y rol From 67c9aa7ac4e1764fe9d0bf9f0d90b008eda7a345 Mon Sep 17 00:00:00 2001 From: AndreaMedinaRico Date: Tue, 24 Sep 2024 10:25:19 -0600 Subject: [PATCH 088/231] feat(actividades): agregar espacio para comentarios de foro --- models/actividades/actividad.model.js | 27 +++++++++---- models/actividades/registraActividad.model.js | 35 ++-------------- models/actividades/rodada.model.js | 7 ++-- models/foro/comentario.model.js | 40 +++++++++++++++++++ models/foro/respuesta.model.js | 0 models/perfil/usuario.model.js | 1 + 6 files changed, 68 insertions(+), 42 deletions(-) delete mode 100644 models/foro/respuesta.model.js diff --git a/models/actividades/actividad.model.js b/models/actividades/actividad.model.js index 58b28d2..e868e35 100644 --- a/models/actividades/actividad.model.js +++ b/models/actividades/actividad.model.js @@ -1,14 +1,21 @@ const mongoose = require('mongoose'); -const {rutaSchema, coordenadaSchema} = require('../ruta/ruta.model'); +const foro = require('../foro/foro.model'); +const comentarioSchema = require('../foro/comentario.model'); const actividadSchema = new mongoose.Schema ({ titulo: { - type: String, + type: String, + minLength: 4, + maxLength: 200, required: true }, - fechaHora: { + fecha: { type: Date, required: true + }, + hora: { + type: String, + required: true }, personasInscritas: { type: Number, @@ -16,25 +23,31 @@ const actividadSchema = new mongoose.Schema ({ }, ubicacion: { type: String, + maxLength: 200, required: true }, - // Incluye materiales requeridos para actividad descripcion: { type: String, + minLength: 4, + maxLength: 200, required: true }, estado: { type: Boolean, - required: true + default: 1 }, duracion: { - type: Number, + type: String, required: true }, imagen: { type: String, required: false - } + }, + comentarios: { + type: [comentarioSchema], + default: [] + }, }); module.exports = actividadSchema; \ No newline at end of file diff --git a/models/actividades/registraActividad.model.js b/models/actividades/registraActividad.model.js index eed2242..263ac43 100644 --- a/models/actividades/registraActividad.model.js +++ b/models/actividades/registraActividad.model.js @@ -5,7 +5,10 @@ const Evento = require('./evento.model'); async function postRodada(data, id) { try { const rodada = await Rodada.create(data); - rodada.ruta = id; + + let _ruta = Rodada.findById(id); + rodada.ruta = _ruta; + await rodada.save(); return rodada; } catch (error) { @@ -33,37 +36,7 @@ async function postEvento(data) { } } -async function registrarActividad(tipo, data) { - try { - console.log("El tipo es: ", tipo); - if (tipo === 'rodada') { - const rodada = await Rodada.create(data); - await rodada.save(); - return rodada; - - } else if (tipo === 'taller') { - console.log("Creando taller"); - const taller = await Taller.create(data); - console.log("Taller creado"); - await taller.save(); - console.log("Taller guardado"); - return taller; - - } else if (tipo === 'evento') { - const evento = await Evento.create(data); - await evento.save(); - return evento; - - } else { - throw new Error('Tipo de actividad no válido'); - } - } catch (error) { - throw(error); - } -} - module.exports = { - registrarActividad, postRodada, postTaller, postEvento diff --git a/models/actividades/rodada.model.js b/models/actividades/rodada.model.js index 53a88f7..7b760f8 100644 --- a/models/actividades/rodada.model.js +++ b/models/actividades/rodada.model.js @@ -8,11 +8,10 @@ const rodadaSchema = new Schema ({ type: [actividadSchema], required: true }, - ruta: [{ - type: Schema.Types.ObjectId, - ref: 'Ruta', + ruta: { + type: [Ruta.schema], required: true - }], + }, }, { collection: 'Rodada' }); diff --git a/models/foro/comentario.model.js b/models/foro/comentario.model.js index e69de29..16e8cda 100644 --- a/models/foro/comentario.model.js +++ b/models/foro/comentario.model.js @@ -0,0 +1,40 @@ +const mongoose = require('mongoose'); +const Schema = mongoose.Schema; + +const comentarioSchema = new Schema({ + username: { + type: String, + ref: "Usuario", + required: true + }, + fotoPerfil: { + type: String, + ref: "Usuario", + required: false + }, + contenido: { + type: String, + minLength: 4, + maxLength: 500, + required: true + }, + fechaCreacion: { + type: Date, + immutable: true, + default:() => Date.now() + }, + fechaModificacion: { + type: Date, + default:() => Date.now() + }, + likes: { + type: Number, + default: 0 + }, + respuestas: [{ + type: mongoose.Schema.Types.ObjectId, + ref: 'Comentario' + }] +}) + +module.exports = comentarioSchema; \ No newline at end of file diff --git a/models/foro/respuesta.model.js b/models/foro/respuesta.model.js deleted file mode 100644 index e69de29..0000000 diff --git a/models/perfil/usuario.model.js b/models/perfil/usuario.model.js index 77aeeea..e1c4b15 100644 --- a/models/perfil/usuario.model.js +++ b/models/perfil/usuario.model.js @@ -22,6 +22,7 @@ const usuarioSchema = new mongoose.Schema( type: String, required: true, unique: true, + sparse: true, }, numeroEmergencia: { type: String, From 32332512038841f38e9db06538dc112045a05749 Mon Sep 17 00:00:00 2001 From: AndreaMedinaRico Date: Tue, 24 Sep 2024 12:11:30 -0600 Subject: [PATCH 089/231] fix(actividades): registrar tipo de actividad --- models/actividades/actividad.model.js | 7 ++++++- models/actividades/registraActividad.model.js | 4 +--- models/actividades/rodada.model.js | 3 ++- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/models/actividades/actividad.model.js b/models/actividades/actividad.model.js index e868e35..b68bed0 100644 --- a/models/actividades/actividad.model.js +++ b/models/actividades/actividad.model.js @@ -1,5 +1,4 @@ const mongoose = require('mongoose'); -const foro = require('../foro/foro.model'); const comentarioSchema = require('../foro/comentario.model'); const actividadSchema = new mongoose.Schema ({ @@ -44,6 +43,12 @@ const actividadSchema = new mongoose.Schema ({ type: String, required: false }, + tipo: { + type: String, + required: true, + immutable: true, + enum: ['Rodada', 'Taller', 'Evento'] + }, comentarios: { type: [comentarioSchema], default: [] diff --git a/models/actividades/registraActividad.model.js b/models/actividades/registraActividad.model.js index 263ac43..85af03c 100644 --- a/models/actividades/registraActividad.model.js +++ b/models/actividades/registraActividad.model.js @@ -4,11 +4,9 @@ const Evento = require('./evento.model'); async function postRodada(data, id) { try { + data.ruta = id; const rodada = await Rodada.create(data); - let _ruta = Rodada.findById(id); - rodada.ruta = _ruta; - await rodada.save(); return rodada; } catch (error) { diff --git a/models/actividades/rodada.model.js b/models/actividades/rodada.model.js index 7b760f8..d3808f4 100644 --- a/models/actividades/rodada.model.js +++ b/models/actividades/rodada.model.js @@ -9,7 +9,8 @@ const rodadaSchema = new Schema ({ required: true }, ruta: { - type: [Ruta.schema], + type: mongoose.Schema.Types.ObjectId, + ref: Ruta, required: true }, }, { From fdfc71e182368b7caea674214f1db3ed3a674365 Mon Sep 17 00:00:00 2001 From: AndreaMedinaRico Date: Tue, 24 Sep 2024 16:47:37 -0600 Subject: [PATCH 090/231] fix(actividades): arreglar consulta de rodada --- .../actividades/controllers/consultarActividades.controller.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/actividades/controllers/consultarActividades.controller.js b/modules/actividades/controllers/consultarActividades.controller.js index 7309d10..fe1ba84 100644 --- a/modules/actividades/controllers/consultarActividades.controller.js +++ b/modules/actividades/controllers/consultarActividades.controller.js @@ -5,7 +5,7 @@ const { request } = require('express'); const getRodadas = async (request, response) => { try { - const rodadas = await Rodada.find(); + const rodadas = await Rodada.find().populate('ruta'); response.status(200).json(rodadas); } catch (error) { response.status(500).json({ message: 'Error al obtener las rodadas', error }); From bcefa762103cfb6311cff4903109d4c5d0a3f941 Mon Sep 17 00:00:00 2001 From: Angie Date: Tue, 24 Sep 2024 19:52:00 -0600 Subject: [PATCH 091/231] feat(perfil): Consultar perfil --- models/perfil/usuario.model.js | 25 +++++++++++-------- .../controllers/consultarPerfil.controller.js | 15 +++++------ .../perfil/routes/consultarPerfil.routes.js | 12 +++------ 3 files changed, 27 insertions(+), 25 deletions(-) diff --git a/models/perfil/usuario.model.js b/models/perfil/usuario.model.js index 19a024a..897828d 100644 --- a/models/perfil/usuario.model.js +++ b/models/perfil/usuario.model.js @@ -5,49 +5,56 @@ const usuarioSchema = new mongoose.Schema( username: { type: String, required: true, - unique: true, + unique: true }, nombre: { type: String, + required: true }, fechaNacimiento: { type: Date, + required: true }, tipoSangre: { type: String, + required: false }, imagen: { type: String, + required: false }, correoElectronico: { type: String, required: true, - unique: true, + unique: true }, numeroEmergencia: { - type: String, + type: String }, fechaRegistro: { type: Date, immutable: true, - default: Date.now, + default: Date.now }, kilometrosRecorridos: { type: Number, default: 0, + required: false }, tiempoEnRecorrido: { type: Number, default: 0.0, + required: false }, rodadasCompletadas: { type: Number, default: 0, + required: false }, firebaseUID: { type: String, unique: true, - required: true, + required: true }, }, { @@ -58,7 +65,7 @@ const usuarioSchema = new mongoose.Schema( const Usuario = mongoose.model("Usuario", usuarioSchema); -async function putUsuario(IDUsuario, Username, nombre, tipoSangre, numeroEmergencia){ +/*async function putUsuario(IDUsuario, Username, nombre, tipoSangre, numeroEmergencia){ const usuario = await Usuario.findById(IDUsuario); if (usuario) { usuario.username = Username; @@ -72,9 +79,7 @@ async function putUsuario(IDUsuario, Username, nombre, tipoSangre, numeroEmergen throw new Error('Usuario no encontrado'); } } +*/ -module.exports = { - Usuario, - putUsuario -}; +module.exports = Usuario; diff --git a/modules/perfil/controllers/consultarPerfil.controller.js b/modules/perfil/controllers/consultarPerfil.controller.js index 13857b2..12a5544 100644 --- a/modules/perfil/controllers/consultarPerfil.controller.js +++ b/modules/perfil/controllers/consultarPerfil.controller.js @@ -1,19 +1,20 @@ -const Perfil = require('../../../models/perfil/usuario.model'); +const Usuario = require('../../../models/perfil/usuario.model'); -exports.consultarPerfil = async (request, response) => { - try{ - const perfil = await Perfil.find(); +exports.get_Perfil = async (request, response) => { + try { + const { firebaseUID } = request.params; + const perfil = await Usuario.findOne({ firebaseUID }); return response.status(200).json({ code: 200, msg: 'Consulta de datos de perfil exitosa', data: perfil }); - } catch(error){ + } catch (error) { console.error(error); - return ressponse.status(500).json({ + return response.status(500).json({ code: 500, msg: 'Error al intentar consultar el perfil', data: null }); } -} +}; diff --git a/modules/perfil/routes/consultarPerfil.routes.js b/modules/perfil/routes/consultarPerfil.routes.js index e9d3478..6e2b4fd 100644 --- a/modules/perfil/routes/consultarPerfil.routes.js +++ b/modules/perfil/routes/consultarPerfil.routes.js @@ -1,14 +1,10 @@ const express = require("express"); const router = express.Router(); -// Importen aquí los archivos de ruta del módulo -// EJEMPLO: const registrarActividadRoute = require('./registrarActividad.routes'); +// Importar el controlador que maneja la creación de actividades +const consultarPerfilController = require("../controllers/consultarPerfil.controller"); -// Pongan la ruta que quieren usar y el archivo de la ruta de la funcionalidad -// EJEMPLO router.use('/registrar', registrarActividadRoute); - -// const consultarPerfil = require('../controllers/consultarPerfil.controller'); - -// router.get('/', consultarPerfil.consultarPerfil) +// Definir la ruta para crear una actividad +router.get("/:firebaseUID", consultarPerfilController.get_Perfil); module.exports = router; From 20ed6bcb421042344b0bb7282ff04beede2d1db1 Mon Sep 17 00:00:00 2001 From: Jesus0204 Date: Tue, 24 Sep 2024 20:23:36 -0600 Subject: [PATCH 092/231] fix: modelo de usuario y como pasar UID de firebase en consultarPerfil --- models/perfil/usuario.model.js | 4 +++- modules/perfil/controllers/consultarPerfil.controller.js | 8 ++++++-- modules/perfil/routes/consultarPerfil.routes.js | 4 +++- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/models/perfil/usuario.model.js b/models/perfil/usuario.model.js index 897828d..ddb01e3 100644 --- a/models/perfil/usuario.model.js +++ b/models/perfil/usuario.model.js @@ -82,4 +82,6 @@ const Usuario = mongoose.model("Usuario", usuarioSchema); */ -module.exports = Usuario; +module.exports = { + Usuario +}; diff --git a/modules/perfil/controllers/consultarPerfil.controller.js b/modules/perfil/controllers/consultarPerfil.controller.js index 12a5544..5b9010a 100644 --- a/modules/perfil/controllers/consultarPerfil.controller.js +++ b/modules/perfil/controllers/consultarPerfil.controller.js @@ -2,8 +2,12 @@ const Usuario = require('../../../models/perfil/usuario.model'); exports.get_Perfil = async (request, response) => { try { - const { firebaseUID } = request.params; - const perfil = await Usuario.findOne({ firebaseUID }); + const { + firebaseUID + } = request.userUID.uid + const perfil = await Usuario.findOne({ + firebaseUID + }); return response.status(200).json({ code: 200, msg: 'Consulta de datos de perfil exitosa', diff --git a/modules/perfil/routes/consultarPerfil.routes.js b/modules/perfil/routes/consultarPerfil.routes.js index 6e2b4fd..c633faf 100644 --- a/modules/perfil/routes/consultarPerfil.routes.js +++ b/modules/perfil/routes/consultarPerfil.routes.js @@ -4,7 +4,9 @@ const router = express.Router(); // Importar el controlador que maneja la creación de actividades const consultarPerfilController = require("../controllers/consultarPerfil.controller"); +const verifyToken = require("./util/verifyUserToken"); + // Definir la ruta para crear una actividad -router.get("/:firebaseUID", consultarPerfilController.get_Perfil); +router.get("/", verifyToken, consultarPerfilController.get_Perfil); module.exports = router; From 09676eb36407c3d7969bd3c14c14d5c58727f7a0 Mon Sep 17 00:00:00 2001 From: Jesus0204 Date: Tue, 24 Sep 2024 20:36:56 -0600 Subject: [PATCH 093/231] fix: ruta a verifyUserToke --- modules/perfil/routes/consultarPerfil.routes.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/perfil/routes/consultarPerfil.routes.js b/modules/perfil/routes/consultarPerfil.routes.js index c633faf..de3bc69 100644 --- a/modules/perfil/routes/consultarPerfil.routes.js +++ b/modules/perfil/routes/consultarPerfil.routes.js @@ -4,7 +4,7 @@ const router = express.Router(); // Importar el controlador que maneja la creación de actividades const consultarPerfilController = require("../controllers/consultarPerfil.controller"); -const verifyToken = require("./util/verifyUserToken"); +const verifyToken = require("../../../util/verifyUserToken"); // Definir la ruta para crear una actividad router.get("/", verifyToken, consultarPerfilController.get_Perfil); From 2234d3968d9e2da6411e3ead578a51f3205d37e0 Mon Sep 17 00:00:00 2001 From: DanielContrerasCh Date: Tue, 24 Sep 2024 21:53:08 -0600 Subject: [PATCH 094/231] : obtener firebaseUID del request y usar verifytoken --- models/otros/anuncio.model.js | 11 +++++------ .../controllers/registrarAnuncio.controller.js | 4 ++-- modules/anuncios/routes/registrarAnuncio.routes.js | 3 ++- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/models/otros/anuncio.model.js b/models/otros/anuncio.model.js index 896f5ba..47260c9 100644 --- a/models/otros/anuncio.model.js +++ b/models/otros/anuncio.model.js @@ -1,10 +1,9 @@ const mongoose = require("mongoose"); const announcementSchema = new mongoose.Schema({ - IDUsuario: { - type: Number, - //type: mongoose.SchemaTypes.ObjectId, - //ref: 'Usuario', + firebaseUID: { + type: String, + ref: 'Usuario', required: true, }, titulo:{ @@ -32,10 +31,10 @@ const announcementSchema = new mongoose.Schema({ const Anuncio = mongoose.model('Anuncio', announcementSchema); -async function postAnnouncement(IDUsuario, titulo, contenido, imagen){ +async function postAnnouncement(firebaseUID, titulo, contenido, imagen){ try { const announcement = await Anuncio.create({ - IDUsuario: IDUsuario, + firebaseUID: firebaseUID, titulo: titulo, contenido: contenido, imagen: imagen diff --git a/modules/anuncios/controllers/registrarAnuncio.controller.js b/modules/anuncios/controllers/registrarAnuncio.controller.js index edf6712..980f4b1 100644 --- a/modules/anuncios/controllers/registrarAnuncio.controller.js +++ b/modules/anuncios/controllers/registrarAnuncio.controller.js @@ -2,12 +2,12 @@ const Announcement = require('../../../models/otros/anuncio.model'); exports.postAnnouncement = async (request, response) => { - const idUsuario = request.body.IDUsuario; + const firebaseUID = request.userUID.uid; const titulo = request.body.titulo; const contenido = request.body.contenido; const imagen = request.body.imagen; try { - await Announcement.postAnnouncement(idUsuario, titulo, contenido, imagen); + await Announcement.postAnnouncement(firebaseUID, titulo, contenido, imagen); return response.status(201).json({ message: 'Anuncio creado correctamente' }); } catch (error) { return response.status(500).json({ message: 'Error al crear el anuncio', error: error.message }); diff --git a/modules/anuncios/routes/registrarAnuncio.routes.js b/modules/anuncios/routes/registrarAnuncio.routes.js index bdb5278..9f0124b 100644 --- a/modules/anuncios/routes/registrarAnuncio.routes.js +++ b/modules/anuncios/routes/registrarAnuncio.routes.js @@ -1,10 +1,11 @@ const express = require('express'); const router = express.Router(); +const verifyUserToken = require('../../../util/verifyUserToken'); // Importar el controlador que maneja la creación de actividades const registrarAnuncioController = require('../controllers/registrarAnuncio.controller'); // Definir la ruta para crear una actividad -router.post('/', registrarAnuncioController.postAnnouncement); +router.post('/', verifyUserToken, registrarAnuncioController.postAnnouncement); module.exports = router; \ No newline at end of file From a857aac64a41ae22c0f38b32a3bc639aebf3b84b Mon Sep 17 00:00:00 2001 From: DanielContrerasCh Date: Tue, 24 Sep 2024 22:35:51 -0600 Subject: [PATCH 095/231] : trabajar con el token en rutas de anuncios --- modules/anuncios/routes/consultarAnuncio.routes.js | 3 ++- modules/anuncios/routes/eliminarAnuncio.routes.js | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/anuncios/routes/consultarAnuncio.routes.js b/modules/anuncios/routes/consultarAnuncio.routes.js index 8ec12ed..06cb115 100644 --- a/modules/anuncios/routes/consultarAnuncio.routes.js +++ b/modules/anuncios/routes/consultarAnuncio.routes.js @@ -1,10 +1,11 @@ const express = require('express'); const router = express.Router(); +const verifyUserToken = require('../../../util/verifyUserToken'); // Importar el controlador que maneja la creación de actividades const consultarAnuncioController = require('../controllers/consultarAnuncio.controller'); // Definir la ruta para crear una actividad -router.get('/', consultarAnuncioController.getAnnouncements); +router.get('/', verifyUserToken, consultarAnuncioController.getAnnouncements); module.exports = router; \ No newline at end of file diff --git a/modules/anuncios/routes/eliminarAnuncio.routes.js b/modules/anuncios/routes/eliminarAnuncio.routes.js index 7b64bc1..272a8f2 100644 --- a/modules/anuncios/routes/eliminarAnuncio.routes.js +++ b/modules/anuncios/routes/eliminarAnuncio.routes.js @@ -1,10 +1,11 @@ const express = require('express'); const router = express.Router(); +const verifyUserToken = require('../../../util/verifyUserToken'); // Importar el controlador que maneja la creación de actividades const eliminarAnuncioController = require('../controllers/eliminarAnuncio.controller'); // Definir la ruta para crear una actividad -router.delete('/:IDAnuncio', eliminarAnuncioController.deleteAnnouncement); +router.delete('/:IDAnuncio', verifyUserToken, eliminarAnuncioController.deleteAnnouncement); module.exports = router; \ No newline at end of file From e69a68429522d93063ae7318618975fe876eb17e Mon Sep 17 00:00:00 2001 From: A01710217 Date: Tue, 24 Sep 2024 23:32:34 -0600 Subject: [PATCH 096/231] fix(registrarUsuario.controller): corregir problemas con la varibale de Usuario (err:500) --- modules/session/controllers/registrarUsuario.controller.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/modules/session/controllers/registrarUsuario.controller.js b/modules/session/controllers/registrarUsuario.controller.js index e9b85e7..6685170 100644 --- a/modules/session/controllers/registrarUsuario.controller.js +++ b/modules/session/controllers/registrarUsuario.controller.js @@ -1,6 +1,4 @@ -const { - Usuario -} = require('../../../models/perfil/usuario.model'); +const Usuario = require("../../../models/perfil/usuario.model"); const Rol = require("../../../models/perfil/rol.model"); const PoseeRol = require("../../../models/perfil/poseeRol.model"); // Modelo para la relación entre usuario y rol From 0e685f78d2e77978d303be8715af22416f2fa2c6 Mon Sep 17 00:00:00 2001 From: A01710217 Date: Wed, 25 Sep 2024 00:03:47 -0600 Subject: [PATCH 097/231] fix(registrarUsuario.controller): Regresar correcion --- modules/session/controllers/registrarUsuario.controller.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/session/controllers/registrarUsuario.controller.js b/modules/session/controllers/registrarUsuario.controller.js index 6685170..1f02c14 100644 --- a/modules/session/controllers/registrarUsuario.controller.js +++ b/modules/session/controllers/registrarUsuario.controller.js @@ -1,4 +1,4 @@ -const Usuario = require("../../../models/perfil/usuario.model"); +const { Usuario } = require("../../../models/perfil/usuario.model"); const Rol = require("../../../models/perfil/rol.model"); const PoseeRol = require("../../../models/perfil/poseeRol.model"); // Modelo para la relación entre usuario y rol From b27d9750467498c144c791575f265f232ec4351e Mon Sep 17 00:00:00 2001 From: alexmushi Date: Wed, 25 Sep 2024 00:16:09 -0600 Subject: [PATCH 098/231] Fix: Se restauran archivos de iniciarRodada --- .idea/misc.xml | 2 +- .../controllers/iniciarRodada.controller.js | 36 +++++++++++++++++-- .../rodadas/routes/iniciarRodada.routes.js | 14 ++++---- 3 files changed, 42 insertions(+), 10 deletions(-) diff --git a/.idea/misc.xml b/.idea/misc.xml index 07115cd..cc6eae0 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,6 +1,6 @@ - + \ No newline at end of file diff --git a/modules/rodadas/controllers/iniciarRodada.controller.js b/modules/rodadas/controllers/iniciarRodada.controller.js index 4410528..74cdf5a 100644 --- a/modules/rodadas/controllers/iniciarRodada.controller.js +++ b/modules/rodadas/controllers/iniciarRodada.controller.js @@ -1,3 +1,35 @@ -exports.getPrueba = (request, response) => { - response.json('Rodada: Esta es la plantilla que deben usar.'); +// iniciarRodada.controller.js +// Simulación de una base de datos en memoria para almacenar la ubicación +let ubicacionAdmin = null; +// Controlador para iniciar la rodada +exports.iniciarRodada = (req, res) => { + const { rutaId, adminId } = req.body; + // Validar que se reciban ambos parámetros + if (!rutaId || !adminId) { + return res.status(400).json({ error: 'Faltan parámetros rutaId o adminId.' }); + } + // Aquí puedes agregar lógica adicional para validar la ruta y administrador, o iniciar la rodada en la base de datos + // Responder con éxito + res.status(200).json({ message: 'Rodada iniciada con éxito', rutaId, adminId }); +}; +// Controlador para actualizar la ubicación del administrador +exports.actualizarUbicacion = (req, res) => { + const { latitud, longitud, adminId } = req.body; + // Validar los parámetros de ubicación + if (!latitud || !longitud || !adminId) { + return res.status(400).json({ error: 'Faltan parámetros de ubicación o adminId.' }); + } + // Actualizar la ubicación del administrador en la "base de datos" (aquí es solo en memoria) + ubicacionAdmin = { latitud, longitud, adminId }; + // Responder con un mensaje de éxito + res.status(200).json({ message: 'Ubicación actualizada con éxito', ubicacion: ubicacionAdmin }); +}; +// Controlador para obtener la ubicación actual del administrador +exports.obtenerUbicacion = (req, res) => { + // Verificar si la ubicación ha sido registrada + if (!ubicacionAdmin) { + return res.status(404).json({ error: 'No hay ubicación del administrador disponible.' }); + } + // Responder con la ubicación actual del administrador + res.status(200).json({ ubicacion: ubicacionAdmin }); }; \ No newline at end of file diff --git a/modules/rodadas/routes/iniciarRodada.routes.js b/modules/rodadas/routes/iniciarRodada.routes.js index fede7fd..5268233 100644 --- a/modules/rodadas/routes/iniciarRodada.routes.js +++ b/modules/rodadas/routes/iniciarRodada.routes.js @@ -1,10 +1,10 @@ const express = require('express'); const router = express.Router(); - -// Importar el controlador que maneja la Funcionalidad que quieres -// EJEMPLO: const registrarAnuncioController = require('../controllers/registrarAnuncio.controller'); - -// Definir la ruta para la funcionalidad y la funcion del controlador -// EJEMPLO: router.get('/', registrarActividadController.getPrueba); - +const iniciarRodadaController = require('../controllers/iniciarRodadaController'); +// Ruta para iniciar la rodada +router.post('/iniciar', iniciarRodadaController.iniciarRodada); +// Ruta para recibir y actualizar la ubicación del administrador +router.post('/ubicacion', iniciarRodadaController.actualizarUbicacion); +// Ruta opcional para obtener la ubicación actual del administrador +router.get('/ubicacion', iniciarRodadaController.obtenerUbicacion); module.exports = router; \ No newline at end of file From 4c88602e4d95fa48c810031661e2433e0341d551 Mon Sep 17 00:00:00 2001 From: A01710217 Date: Wed, 25 Sep 2024 00:23:51 -0600 Subject: [PATCH 099/231] fix(usuario.model): Corregir required en nombre --- models/perfil/usuario.model.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/perfil/usuario.model.js b/models/perfil/usuario.model.js index ddb01e3..88ac595 100644 --- a/models/perfil/usuario.model.js +++ b/models/perfil/usuario.model.js @@ -9,7 +9,7 @@ const usuarioSchema = new mongoose.Schema( }, nombre: { type: String, - required: true + required: false }, fechaNacimiento: { type: Date, From f6ca088a7d0ee99927b7278d638ca4cb8ca57697 Mon Sep 17 00:00:00 2001 From: alexmushi Date: Wed, 25 Sep 2024 00:33:35 -0600 Subject: [PATCH 100/231] feat: Se agrega controlador de terminarRodada, elimina la ubicacion guardada del admin --- .idea/{other.xml => caches/deviceStreaming.xml} | 2 +- .../controllers/iniciarRodada.controller.js | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) rename .idea/{other.xml => caches/deviceStreaming.xml} (99%) diff --git a/.idea/other.xml b/.idea/caches/deviceStreaming.xml similarity index 99% rename from .idea/other.xml rename to .idea/caches/deviceStreaming.xml index 94c96f6..af74dbf 100644 --- a/.idea/other.xml +++ b/.idea/caches/deviceStreaming.xml @@ -1,6 +1,6 @@ - +